@tonyclaw/llm-inspector 1.14.4 → 1.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{index-o0Ui96SM.css → index-BFNoWwFI.css} +1 -1
- package/.output/public/assets/{index-5yrjXc3u.js → index-LH-YtFEM.js} +25 -25
- package/.output/public/assets/{main-CC0TDCAo.js → main-Dp5657Eq.js} +1 -1
- package/.output/server/_ssr/{index-Cz6oxzsy.mjs → index-D2yS8VvO.mjs} +53 -9
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-Bl3OCdGC.mjs → router-DCfjmmJu.mjs} +52 -30
- package/.output/server/{_tanstack-start-manifest_v-Oekf1osO.mjs → _tanstack-start-manifest_v-DupqJc5d.mjs} +1 -1
- package/.output/server/index.mjs +28 -28
- package/package.json +1 -1
- package/src/assets/logos/claude-code.svg +4 -0
- package/src/assets/logos/opencode.svg +4 -0
- package/src/components/providers/ImportWizardDialog.tsx +55 -17
- package/src/proxy/providerImporters.ts +32 -2
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import{u as Bc,a as gp,r as v,b as yr,c as Er,g as ds,j as c,R as ot,d as Uc,e as xp}from"./main-CC0TDCAo.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 Zc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Vc={};function Gt(e){return Vc}function Wc(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 Ni(e,t){return typeof t=="bigint"?t.toString():t}function vo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fs(e){return e==null}function hs(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 ba=Symbol("evaluating");function Te(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ba)return r===void 0&&(r=ba,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 wa(e){return JSON.stringify(e)}function vp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Hc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bp=vo(()=>{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 qc(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 Nr(e){return typeof e=="string"?e:e?.message}function Jt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Nr(e.inst?._zod.def?.error?.(e))??Nr(t?.error?.(e))??Nr(n.customError?.(e))??Nr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ps(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 Kc=(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,Ni,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gc=X("$ZodError",Kc),Jc=X("$ZodError",Kc,{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 ms=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 Hc(a,o?.callee),a}return s.value},gs=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 Hc(a,o?.callee),a}return s.value},bo=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??Gc)(i.issues.map(s=>Jt(s,o,Gt())))}:{success:!0,data:i.value}},Rp=bo(Jc),wo=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=wo(Jc),Op=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ms(e)(t,n,o)},Dp=e=>(t,n,r)=>ms(e)(t,n,r),Mp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gs(e)(t,n,o)},Lp=e=>async(t,n,r)=>gs(e)(t,n,r),Fp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bo(e)(t,n,o)},$p=e=>(t,n,r)=>bo(e)(t,n,r),Bp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wo(e)(t,n,o)},Up=e=>async(t,n,r)=>wo(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})$/,ka=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}=))?$/,Yc=/^[A-Za-z0-9_-]*$/,im=/^\+[1-9]\d{6,14}$/,Xc="(?:(?:\\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(`^${Xc}$`);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(`^${Xc}T(?:${r})$`)}const cm=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},um=/^-?\d+$/,eu=/^-?\d+(?:\.\d+)?$/,dm=/^(?:true|false)$/i,fm=/^null$/i,hm=/^[^A-Z]*$/,pm=/^[^a-z]*$/,st=X("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tu={number:"number",bigint:"bigint",object:"date"},nu=X("$ZodCheckLessThan",(e,t)=>{st.init(e,t);const n=tu[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})}}),ru=X("$ZodCheckGreaterThan",(e,t)=>{st.init(e,t);const n=tu[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)=>{st.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)=>{st.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;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!fs(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=ps(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;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!fs(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=ps(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),vm=X("$ZodCheckLengthEquals",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!fs(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=ps(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})}}),ko=X("$ZodCheckStringFormat",(e,t)=>{var n,r;st.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=()=>{})}),bm=X("$ZodCheckRegex",(e,t)=>{ko.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),ko.init(e,t)}),km=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pm),ko.init(e,t)}),_m=X("$ZodCheckIncludes",(e,t)=>{st.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)=>{st.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)=>{st.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)=>{st.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(`
|
|
1
|
+
import{u as Bc,a as gp,r as v,b as yr,c as Er,g as ds,j as c,R as ot,d as Uc,e as xp}from"./main-Dp5657Eq.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 Zc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Vc={};function Gt(e){return Vc}function Wc(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 ji(e,t){return typeof t=="bigint"?t.toString():t}function vo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fs(e){return e==null}function hs(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 ba=Symbol("evaluating");function Te(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ba)return r===void 0&&(r=ba,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 wa(e){return JSON.stringify(e)}function vp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Hc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bp=vo(()=>{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 qc(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 jp(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 Np(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 jr(e){return typeof e=="string"?e:e?.message}function Jt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=jr(e.inst?._zod.def?.error?.(e))??jr(t?.error?.(e))??jr(n.customError?.(e))??jr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ps(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 Kc=(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,ji,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gc=X("$ZodError",Kc),Jc=X("$ZodError",Kc,{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 ms=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 Hc(a,o?.callee),a}return s.value},gs=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 Hc(a,o?.callee),a}return s.value},bo=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??Gc)(i.issues.map(s=>Jt(s,o,Gt())))}:{success:!0,data:i.value}},Rp=bo(Jc),wo=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=wo(Jc),Op=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ms(e)(t,n,o)},Dp=e=>(t,n,r)=>ms(e)(t,n,r),Mp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gs(e)(t,n,o)},Lp=e=>async(t,n,r)=>gs(e)(t,n,r),Fp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bo(e)(t,n,o)},$p=e=>(t,n,r)=>bo(e)(t,n,r),Bp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wo(e)(t,n,o)},Up=e=>async(t,n,r)=>wo(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})$/,ka=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}=))?$/,Yc=/^[A-Za-z0-9_-]*$/,im=/^\+[1-9]\d{6,14}$/,Xc="(?:(?:\\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(`^${Xc}$`);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(`^${Xc}T(?:${r})$`)}const cm=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},um=/^-?\d+$/,eu=/^-?\d+(?:\.\d+)?$/,dm=/^(?:true|false)$/i,fm=/^null$/i,hm=/^[^A-Z]*$/,pm=/^[^a-z]*$/,st=X("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tu={number:"number",bigint:"bigint",object:"date"},nu=X("$ZodCheckLessThan",(e,t)=>{st.init(e,t);const n=tu[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})}}),ru=X("$ZodCheckGreaterThan",(e,t)=>{st.init(e,t);const n=tu[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)=>{st.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)=>{st.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;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!fs(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=ps(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;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!fs(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=ps(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),vm=X("$ZodCheckLengthEquals",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!fs(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=ps(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})}}),ko=X("$ZodCheckStringFormat",(e,t)=>{var n,r;st.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=()=>{})}),bm=X("$ZodCheckRegex",(e,t)=>{ko.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),ko.init(e,t)}),km=X("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=pm),ko.init(e,t)}),_m=X("$ZodCheckIncludes",(e,t)=>{st.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)=>{st.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)=>{st.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)=>{st.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class jm{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2
2
|
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
3
|
-
`))}}const
|
|
3
|
+
`))}}const Nm={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=Nm;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)}}Te(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}))}),xs=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)=>{ko.init(e,t),xs.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=ka(r))}else t.pattern??(t.pattern=ka());$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 ou(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=>{ou(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Gm(e){if(!Yc.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return ou(n)}const Jm=X("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yc),$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})}}),iu=X("$ZodNumber",(e,t)=>{Le.init(e,t),e._zod.pattern=e._zod.bag.pattern??eu,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),iu.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 _a(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=>_a(u,n,s))):_a(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Yr(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 su(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 au(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=>Yr(f,n,h,t,d))):Yr(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=vo(()=>su(t));Te(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],y=f._zod.optout==="optional",m=f._zod.run({value:u[p],issues:[]},l);m instanceof Promise?d.push(m.then(x=>Yr(x,a,p,u,y))):Yr(m,a,p,u,y)}return i?au(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=vo(()=>su(t)),o=p=>{const f=new jm(["shape","payload","ctx"]),y=r.value,m=k=>{const S=wa(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");const x=Object.create(null);let g=0;for(const k of y.keys)x[k]=`key_${g++}`;f.write("const newResult = {};");for(const k of y.keys){const S=x[k],N=wa(k),j=p[k]?._zod?.optout==="optional";f.write(`const ${S} = ${m(k)};`),j?f.write(`
|
|
4
4
|
if (${S}.issues.length) {
|
|
5
|
-
if (${
|
|
5
|
+
if (${N} in input) {
|
|
6
6
|
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
7
7
|
...iss,
|
|
8
|
-
path: iss.path ? [${
|
|
8
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
9
9
|
})));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
if (${S}.value === undefined) {
|
|
14
|
-
if (${
|
|
15
|
-
newResult[${
|
|
14
|
+
if (${N} in input) {
|
|
15
|
+
newResult[${N}] = undefined;
|
|
16
16
|
}
|
|
17
17
|
} else {
|
|
18
|
-
newResult[${
|
|
18
|
+
newResult[${N}] = ${S}.value;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
`):f.write(`
|
|
22
22
|
if (${S}.issues.length) {
|
|
23
23
|
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
24
24
|
...iss,
|
|
25
|
-
path: iss.path ? [${
|
|
25
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
26
26
|
})));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
if (${S}.value === undefined) {
|
|
30
|
-
if (${
|
|
31
|
-
newResult[${
|
|
30
|
+
if (${N} in input) {
|
|
31
|
+
newResult[${N}] = undefined;
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
|
-
newResult[${
|
|
34
|
+
newResult[${N}] = ${S}.value;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");const b=f.compile();return(k,S)=>b(p,k,S)};let i;const s=fr,a=!Vc.jitless,u=a&&bp.value,d=t.catchall;let h;e._zod.parse=(p,f)=>{h??(h=r.value);const y=p.value;return s(y)?a&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=o(t.shape)),p=i(p,f),d?au([],y,p,f,h,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),p)}});function Sa(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 lu=X("$ZodUnion",(e,t)=>{Le.init(e,t),Te(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Te(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Te(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Te(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=>hs(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=>Sa(l,o,e,i)):Sa(a,o,e,i)}}),lg=X("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lu.init(e,t);const n=e._zod.parse;Te(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=vo(()=>{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])=>Ca(n,l,u)):Ca(n,i,s)}});function ji(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=ji(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=ji(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 Ca(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=ji(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"&&eu.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=Wc(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 Zc(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 Ea(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const cu=X("$ZodOptional",(e,t)=>{Le.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Te(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hs(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=>Ea(i,n.value)):Ea(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),pg=X("$ZodExactOptional",(e,t)=>{cu.init(e,t),Te(e._zod,"values",()=>t.innerType._zod.values),Te(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),Te(e._zod,"optin",()=>t.innerType._zod.optin),Te(e._zod,"optout",()=>t.innerType._zod.optout),Te(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hs(n.source)}|null)$`):void 0}),Te(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",Te(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=>Na(i,t)):Na(o,t)}});function Na(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",Te(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),Te(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=>ja(i,e)):ja(o,e)}});function ja(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 vg=X("$ZodCatch",(e,t)=>{Le.init(e,t),Te(e._zod,"optin",()=>t.innerType._zod.optin),Te(e._zod,"optout",()=>t.innerType._zod.optout),Te(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)}}),bg=X("$ZodPipe",(e,t)=>{Le.init(e,t),Te(e._zod,"values",()=>t.in._zod.values),Te(e._zod,"optin",()=>t.in._zod.optin),Te(e._zod,"optout",()=>t.out._zod.optout),Te(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=>jr(s,t.in,r)):jr(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>jr(i,t.out,r)):jr(o,t.out,r)}});function jr(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),Te(e._zod,"propValues",()=>t.innerType._zod.propValues),Te(e._zod,"values",()=>t.innerType._zod.values),Te(e._zod,"optin",()=>t.innerType?._zod?.optin),Te(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(Ta):Ta(o)}});function Ta(e){return e.value=Object.freeze(e.value),e}const kg=X("$ZodLazy",(e,t)=>{Le.init(e,t),Te(e._zod,"innerType",()=>t.getter()),Te(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Te(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Te(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Te(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)=>{st.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=>Aa(i,n,r,e));Aa(o,n,r,e)}});function Aa(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 za;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}(za=globalThis).__zod_globalRegistry??(za.__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 Ia(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 Ra(e,t){return new nu({check:"less_than",...ye(t),value:e,inclusive:!1})}function Jo(e,t){return new nu({check:"less_than",...ye(t),value:e,inclusive:!0})}function Pa(e,t){return new ru({check:"greater_than",...ye(t),value:e,inclusive:!1})}function Yo(e,t){return new ru({check:"greater_than",...ye(t),value:e,inclusive:!0})}function Oa(e,t){return new mm({check:"multiple_of",...ye(t),value:e})}function uu(e,t){return new xm({check:"max_length",...ye(t),maximum:e})}function Xr(e,t){return new ym({check:"min_length",...ye(t),minimum:e})}function du(e,t){return new vm({check:"length_equals",...ye(t),length:e})}function ox(e,t){return new bm({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=>vp(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 st({check:"custom",...ye(t)});return n._zod.check=e,n}function fu(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"&&et(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 hu(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??(y=>y);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>
|
|
37
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");const b=f.compile();return(k,S)=>b(p,k,S)};let i;const s=fr,a=!Vc.jitless,u=a&&bp.value,d=t.catchall;let h;e._zod.parse=(p,f)=>{h??(h=r.value);const y=p.value;return s(y)?a&&u&&f?.async===!1&&f.jitless!==!0?(i||(i=o(t.shape)),p=i(p,f),d?au([],y,p,f,h,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),p)}});function Sa(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 lu=X("$ZodUnion",(e,t)=>{Le.init(e,t),Te(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Te(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Te(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Te(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=>hs(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=>Sa(l,o,e,i)):Sa(a,o,e,i)}}),lg=X("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lu.init(e,t);const n=e._zod.parse;Te(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=vo(()=>{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])=>Ca(n,l,u)):Ca(n,i,s)}});function Ni(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=Ni(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=Ni(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 Ca(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=Ni(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"&&eu.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=Wc(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 Zc(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 Ea(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const cu=X("$ZodOptional",(e,t)=>{Le.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Te(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Te(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hs(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=>Ea(i,n.value)):Ea(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),pg=X("$ZodExactOptional",(e,t)=>{cu.init(e,t),Te(e._zod,"values",()=>t.innerType._zod.values),Te(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),Te(e._zod,"optin",()=>t.innerType._zod.optin),Te(e._zod,"optout",()=>t.innerType._zod.optout),Te(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${hs(n.source)}|null)$`):void 0}),Te(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",Te(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=>ja(i,t)):ja(o,t)}});function ja(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",Te(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),Te(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=>Na(i,e)):Na(o,e)}});function Na(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 vg=X("$ZodCatch",(e,t)=>{Le.init(e,t),Te(e._zod,"optin",()=>t.innerType._zod.optin),Te(e._zod,"optout",()=>t.innerType._zod.optout),Te(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)}}),bg=X("$ZodPipe",(e,t)=>{Le.init(e,t),Te(e._zod,"values",()=>t.in._zod.values),Te(e._zod,"optin",()=>t.in._zod.optin),Te(e._zod,"optout",()=>t.out._zod.optout),Te(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),Te(e._zod,"propValues",()=>t.innerType._zod.propValues),Te(e._zod,"values",()=>t.innerType._zod.values),Te(e._zod,"optin",()=>t.innerType?._zod?.optin),Te(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(Ta):Ta(o)}});function Ta(e){return e.value=Object.freeze(e.value),e}const kg=X("$ZodLazy",(e,t)=>{Le.init(e,t),Te(e._zod,"innerType",()=>t.getter()),Te(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Te(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Te(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Te(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)=>{st.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=>Aa(i,n,r,e));Aa(o,n,r,e)}});function Aa(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 za;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}(za=globalThis).__zod_globalRegistry??(za.__zod_globalRegistry=Cg());const ar=globalThis.__zod_globalRegistry;function Eg(e,t){return new e({type:"string",...ye(t)})}function jg(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function Ia(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function Ng(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 Ra(e,t){return new nu({check:"less_than",...ye(t),value:e,inclusive:!1})}function Jo(e,t){return new nu({check:"less_than",...ye(t),value:e,inclusive:!0})}function Pa(e,t){return new ru({check:"greater_than",...ye(t),value:e,inclusive:!1})}function Yo(e,t){return new ru({check:"greater_than",...ye(t),value:e,inclusive:!0})}function Oa(e,t){return new mm({check:"multiple_of",...ye(t),value:e})}function uu(e,t){return new xm({check:"max_length",...ye(t),maximum:e})}function Xr(e,t){return new ym({check:"min_length",...ye(t),minimum:e})}function du(e,t){return new vm({check:"length_equals",...ye(t),length:e})}function ox(e,t){return new bm({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=>vp(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 st({check:"custom",...ye(t)});return n._zod.check=e,n}function fu(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"&&Qe(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 hu(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??(y=>y);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
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 pu(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:Qr(t,"input",e.processors),output:Qr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function et(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 et(r.element,n);if(r.type==="set")return et(r.valueType,n);if(r.type==="lazy")return et(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 et(r.innerType,n);if(r.type==="intersection")return et(r.left,n)||et(r.right,n);if(r.type==="record"||r.type==="map")return et(r.keyType,n)||et(r.valueType,n);if(r.type==="pipe")return et(r.in,n)||et(r.out,n);if(r.type==="object"){for(const o in r.shape)if(et(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(et(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(et(o,n))return!0;return!!(r.rest&&et(r.rest,n))}return!1}const vx=(e,t={})=>n=>{const r=fu({...n,processors:t});return Ve(e,r),hu(r,e),pu(r,e)},Qr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=fu({...o??{},target:i,io:t,processors:n});return Ve(e,s),hu(s,e),pu(s,e)},bx={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=bx[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=Wc(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},mu=(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)=>{Gc.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,Ni,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ni,2)}},isEmpty:{get(){return e.issues.length===0}}})},gt=X("ZodError",Xx,{Parent:Error}),Qx=ms(gt),e0=gs(gt),t0=bo(gt),n0=wo(gt),r0=Op(gt),o0=Dp(gt),i0=Mp(gt),s0=Lp(gt),a0=Fp(gt),l0=$p(gt),c0=Bp(gt),u0=Up(gt),Fe=X("ZodType",(e,t)=>(Le.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Qr(e,"input"),output:Qr(e,"output")}}),e.toJSONSchema=vx(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=()=>Fa(e),e.exactOptional=()=>W0(e),e.nullable=()=>$a(e),e.nullish=()=>Fa($a(e)),e.nonoptional=n=>Y0(e,n),e.array=()=>ze(e),e.or=n=>Zt([e,n]),e.and=n=>F0(e,n),e.transform=n=>Ba(e,Z0(n)),e.default=n=>K0(e,n),e.prefault=n=>J0(e,n),e.catch=n=>Q0(e,n),e.pipe=n=>Ba(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)),gu=X("_ZodString",(e,t)=>{xs.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(Xr(...r)),e.max=(...r)=>e.check(uu(...r)),e.length=(...r)=>e.check(du(...r)),e.nonempty=(...r)=>e.check(Xr(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)=>{xs.init(e,t),gu.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(Ia(Da,n)),e.uuid=n=>e.check(jg(Tr,n)),e.uuidv4=n=>e.check(Tg(Tr,n)),e.uuidv6=n=>e.check(Ag(Tr,n)),e.uuidv7=n=>e.check(zg(Tr,n)),e.nanoid=n=>e.check(Pg(m0,n)),e.guid=n=>e.check(Ia(Da,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(v0,n)),e.ksuid=n=>e.check(Fg(b0,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 K(e){return Eg(d0,e)}const Ue=X("ZodStringFormat",(e,t)=>{$e.init(e,t),gu.init(e,t)}),f0=X("ZodEmail",(e,t)=>{zm.init(e,t),Ue.init(e,t)}),Da=X("ZodGUID",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),Tr=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)}),v0=X("ZodXID",(e,t)=>{Lm.init(e,t),Ue.init(e,t)}),b0=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)}),xu=X("ZodNumber",(e,t)=>{iu.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>kx(e,r,o),e.gt=(r,o)=>e.check(Pa(r,o)),e.gte=(r,o)=>e.check(Yo(r,o)),e.min=(r,o)=>e.check(Yo(r,o)),e.lt=(r,o)=>e.check(Ra(r,o)),e.lte=(r,o)=>e.check(Jo(r,o)),e.max=(r,o)=>e.check(Jo(r,o)),e.int=r=>e.check(Ma(r)),e.safe=r=>e.check(Ma(r)),e.positive=r=>e.check(Pa(0,r)),e.nonnegative=r=>e.check(Yo(0,r)),e.negative=r=>e.check(Ra(0,r)),e.nonpositive=r=>e.check(Jo(0,r)),e.multipleOf=(r,o)=>e.check(Oa(r,o)),e.step=(r,o)=>e.check(Oa(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(xu,e)}const T0=X("ZodNumberFormat",(e,t)=>{eg.init(e,t),xu.init(e,t)});function Ma(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 Xe(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 Ti(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 La(){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(Xr(n,r)),e.nonempty=n=>e.check(Xr(1,n)),e.max=(n,r)=>e.check(uu(n,r)),e.length=(n,r)=>e.check(du(n,r)),e.unwrap=()=>e.element});function ze(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),Te(e,"shape",()=>t.shape),e.keyof=()=>ft(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:La()}),e.loose=()=>e.clone({...e._zod.def,catchall:La()}),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(vu,e,n[0]),e.required=(...n)=>Ap(bu,e,n[0])});function ie(e,t){const n={type:"object",shape:e??{},...ye(t)};return new D0(n)}const yu=X("ZodUnion",(e,t)=>{lu.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 yu({type:"union",options:e,...ye(t)})}const M0=X("ZodDiscriminatedUnion",(e,t)=>{yu.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 Ai=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 Ai({...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 Ai({...t,checks:[],...ye(o),entries:i})}});function ft(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Ai({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 Se(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 Zc(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 vu=X("ZodOptional",(e,t)=>{cu.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mu(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Fa(e){return new vu({type:"optional",innerType:e})}const V0=X("ZodExactOptional",(e,t)=>{pg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mu(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 $a(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():qc(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():qc(t)}})}const bu=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 bu({type:"nonoptional",innerType:e,...ye(t)})}const X0=X("ZodCatch",(e,t)=>{vg.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)=>{bg.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 Ba(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([K(),ve(),Xe(),Ti(),ze(Dn),$t(K(),Dn)])),ys=ie({type:K(),ttl:K().optional(),scope:K().optional()}),vs=ie({type:Se("text"),text:K(),cache_control:ys.optional()}),wu=ie({type:Se("thinking"),thinking:K(),signature:K().optional()}),ly=ie({type:Se("think"),thinking:K(),signature:K().optional()}),cy=ie({type:Se("base64"),media_type:K(),data:K()}),ku=ie({type:Se("image"),source:cy}),_u=ie({type:Se("tool_use"),id:K(),name:K(),input:$t(K(),Dn)}),uy=hn("type",[vs,ku]),dy=ie({type:Se("tool_result"),tool_use_id:K().optional(),content:Zt([K(),ze(uy)]),is_error:Xe().optional()}),fy=hn("type",[vs,wu,ku,_u,dy]),hy=Zt([K(),ze(fy)]),py=ie({role:ft(["user","assistant"]),content:hy}),my=ie({type:Se("text"),text:K(),cache_control:ys.optional()}),gy=ie({type:K(),properties:$t(K(),$t(K(),Dn)).optional(),required:ze(K()).optional(),additionalProperties:Xe().optional(),$schema:K().optional()}),xy=ie({name:K(),description:K().optional(),input_schema:gy.optional(),cache_control:ys.optional()}),yy=hn("type",[ie({type:Se("enabled"),budget_tokens:ve()}),ie({type:Se("disabled")}),ie({type:Se("adaptive")})]),vy=ie({model:K(),messages:ze(py),system:ze(my).optional(),tools:ze(xy).optional(),max_tokens:ve().optional(),temperature:ve().optional(),stream:Xe().optional(),thinking:yy.optional(),metadata:ie({user_id:K().optional()}).optional()}),bs=hn("type",[vs,wu,ly,_u]),by=ie({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=ie({id:K(),type:Se("message"),model:K(),role:Se("assistant"),content:ze(bs),stop_reason:K().nullable(),stop_sequence:K().nullable().optional(),usage:by}).passthrough(),ky=ie({type:Se("message_start"),message:ie({id:K(),type:Se("message"),model:K(),role:Se("assistant"),content:ze(bs),stop_reason:Ti(),stop_sequence:Ti(),usage:ie({input_tokens:ve(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()})}),_y=ie({type:Se("content_block_start"),index:ve(),content_block:bs}),Sy=hn("type",[ie({type:Se("text_delta"),text:K()}),ie({type:Se("input_json_delta"),partial_json:K()}),ie({type:Se("thinking_delta"),thinking:K()}),ie({type:Se("signature_delta"),signature:K()})]),Cy=ie({type:Se("content_block_delta"),index:ve(),delta:Sy}),Ey=ie({type:Se("content_block_stop"),index:ve()}),Ny=ie({type:Se("message_delta"),delta:ie({stop_reason:K().nullable(),stop_sequence:K().nullable().optional()}),usage:ie({output_tokens:ve(),input_tokens:ve().optional(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()}),jy=ie({type:Se("message_stop")}),Ty=ie({type:Se("ping")}),Ay=ie({type:Se("error"),error:ie({type:K(),message:K()})});hn("type",[ky,_y,Cy,Ey,Ny,jy,Ty,Ay]);const zy=vy,Iy=wy,Ry=Zt([K(),ze(hn("type",[ie({type:Se("text"),text:K()}),ie({type:Se("image_url"),image_url:ie({url:K(),detail:K().optional()})})]))]),Su=ie({role:ft(["system","user","assistant","tool"]),content:Ry,name:K().optional(),reasoning_content:K().optional(),thinking:K().optional(),think:K().optional()}),Py=ie({name:K(),arguments:K()}),Cu=ie({index:ve().optional(),id:K().optional(),type:Se("function").optional(),function:ie({name:K().optional(),arguments:K().optional()})});Su.extend({content:Zt([K(),ze(ie({type:Se("text"),text:K()}))]).optional(),function_call:Py.optional(),tool_calls:ze(Cu).optional()});const Oy=ie({type:Se("function"),function:ie({name:K(),description:K().optional(),parameters:$t(K(),Dn)})});ie({model:K(),messages:ze(Su),temperature:ve().optional(),max_tokens:ve().optional(),stream:Xe().optional(),tools:ze(Oy).optional(),tool_choice:Zt([ie({type:Se("auto")}),ie({type:Se("none")}),ie({type:Se("function"),function:ie({name:K()})})]).optional(),user:K().optional()});const Eu=ie({role:ft(["assistant"]).optional(),content:K().nullable().optional(),reasoning_content:K().nullable().optional(),thinking:K().nullable().optional(),think:K().nullable().optional(),function_call:ie({name:K().optional(),arguments:K().optional()}).nullable().optional(),tool_calls:ze(ie({index:ve(),id:K().optional(),type:Se("function").optional(),function:ie({name:K().optional(),arguments:K().optional()})})).nullable().optional()}),Dy=ie({index:ve(),message:ie({role:ft(["assistant"]),content:K().nullable(),reasoning_content:K().optional(),thinking:K().optional(),think:K().optional(),function_call:ie({name:K(),arguments:K()}).nullable().optional(),tool_calls:ze(Cu).optional()}).optional(),delta:Eu.optional(),finish_reason:K().nullable()}),My=ie({id:K(),object:Se("chat.completion"),created:ve(),model:K(),choices:ze(Dy),usage:ie({prompt_tokens:ve().nullable().optional(),completion_tokens:ve().nullable().optional(),total_tokens:ve().nullable().optional()}).passthrough(),service_tier:K().nullable().optional(),system_fingerprint:K().nullable().optional()}).passthrough();ie({id:K(),object:Se("chat.completion.chunk"),created:ve(),model:K(),choices:ze(ie({index:ve(),delta:Eu,finish_reason:K().nullable().optional()})),usage:ie({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 Nu=ie({index:ve(),timestamp:ve(),type:K(),data:Dn}),Fy=ie({chunks:ze(Nu),truncated:Xe().optional().default(!1)}),zi=ie({id:ve(),timestamp:K(),method:K(),path:K(),model:K().nullable(),sessionId:K().nullable(),rawRequestBody:K().nullable(),responseStatus:ve().nullable(),responseText:K().nullable(),inputTokens:ve().nullable(),outputTokens:ve().nullable(),cacheCreationInputTokens:ve().nullable(),cacheReadInputTokens:ve().nullable(),elapsedMs:ve().nullable(),streaming:Xe(),userAgent:K().nullable(),origin:K().nullable(),rawHeaders:$t(K(),K()).optional(),headers:$t(K(),K()).optional(),apiFormat:ft(["anthropic","openai","unknown"]).default("unknown"),isTest:Xe().optional().default(!1),providerName:K().nullable().optional(),clientPort:ve().nullable().optional(),clientPid:ve().nullable().optional(),clientCwd:K().nullable().optional(),clientProjectFolder:K().nullable().optional(),streamingChunks:Fy.optional(),streamingChunksPath:K().nullable().optional(),error:K().nullable().optional()});ie({model:K()});ie({model:K().optional(),metadata:ie({user_id:K().optional()}).passthrough().optional()});function Ii(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=ie({error:K()});async function Sn(e,t){const n=await e.json();return t.parse(n)}async function Vr(e,t){try{const n=await e.json(),r=$y.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function ws(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 Vr(o,i))}return Sn(o,t)}const ju=ie({stripClaudeCodeBillingHeader:Xe()}),Ri="/api/config";async function By(e){return ws(e,ju,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function Uy(e){return ws(Ri,ju,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function Tu(){const e=Bc(Ri,By,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=gp(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(Ri,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 Ua(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Za=(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 Va=()=>{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},Wa=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(Wa(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(Wa(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},eo={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,eo),i&&r.addEventListener("scrollend",d,eo),()=>{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 ev{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 x=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;x&&(a=[x.key,this.getScrollOffset()-x.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,!(!Va()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,eo),i.addEventListener("touchend",a,eo),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();Za(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 y of this.laneAssignments.keys())y>=n&&this.laneAssignments.delete(y);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(y=>{this.itemSizeCache.set(y.key,y.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 y=this.options.gap,m=n*2;let x=this._flatMeasurements;if(!x||x.length<m){const k=new Float64Array(m);x&&h>0&&k.set(x.subarray(0,h*2)),x=k,this._flatMeasurements=x}let g;if(h===0)g=r+o;else{const k=h-1;g=x[k*2]+x[k*2+1]+y}for(let k=h;k<n;k++){const S=i(k),j=d.get(S),C=typeof j=="number"?j:this.options.estimateSize(k);x[k*2]=g,x[k*2+1]=C,g+=C+y}const b=Zy(n,x,i);return this.measurementsCache=b,b}const p=this.measurementsCache.slice(0,h),f=new Array(a).fill(void 0);for(let y=0;y<h;y++){const m=p[y];m&&(f[m.lane]=y)}for(let y=h;y<n;y++){const m=i(y),x=this.laneAssignments.get(y);let g,b;const k=l==="estimate"||d.has(m);if(x!==void 0&&this.options.lanes>1){g=x;const N=f[g],I=N!==void 0?p[N]:void 0;b=I?I.end+this.options.gap:r+o}else{const N=this.options.lanes===1?p[y-1]:this.getFurthestMeasurement(p,y);b=N?N.end+this.options.gap:r+o,g=N?N.lane:y%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(y,g)}const S=d.get(m),j=typeof S=="number"?S:this.options.estimateSize(y),C=b+j;p[y]={index:y,start:b,size:j,end:C,key:m,lane:g},f[g]=y}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?tv({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,y=((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):y&&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=Au(0,r.length-1,i?a=>o[a*2]:a=>Ua(r[a]).start,n);return Ua(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&&(Va()&&(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&&Za(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 Au=(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 tv({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=Au(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 Ha=typeof document<"u"?v.useLayoutEffect:v.useEffect;function nv({useFlushSync:e=!0,...t}){const n=v.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?yr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=v.useState(()=>new ev(r));return o.setOptions(r),Ha(()=>o._didMount(),[]),Ha(()=>o._willUpdate()),o}function zu(e){return nv({observeElementRect:qy,observeElementOffset:Jy,scrollToFn:Qy,...e})}const Iu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const rv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ov=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const qa=e=>{const t=ov(e);return t.charAt(0).toUpperCase()+t.slice(1)};var iv={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 sv=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const av=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>v.createElement("svg",{ref:l,...iv,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Iu("lucide",o),...!i&&!sv(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,d])=>v.createElement(u,d)),...Array.isArray(i)?i:[i]]));const be=(e,t)=>{const n=v.forwardRef(({className:r,...o},i)=>v.createElement(av,{ref:i,iconNode:t,className:Iu(`lucide-${rv(qa(e))}`,`lucide-${e}`,r),...o}));return n.displayName=qa(e),n};const lv=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],cv=be("arrow-down",lv);const uv=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],dv=be("arrow-up",uv);const fv=[["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"}]],hv=be("brain",fv);const pv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vt=be("check",pv);const mv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mt=be("chevron-down",mv);const gv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kt=be("chevron-right",gv);const xv=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yv=be("chevron-up",xv);const vv=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],bv=be("chevrons-down",vv);const wv=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],kv=be("chevrons-up",wv);const _v=[["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"}]],pr=be("circle-alert",_v);const Sv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Cv=be("circle-check-big",Sv);const Ev=[["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"}]],Nv=be("circle-question-mark",Ev);const jv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Ru=be("circle-stop",jv);const Tv=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_o=be("clock",Tv);const Av=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Pu=be("columns-2",Av);const zv=[["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=be("copy",zv);const Iv=[["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"}]],ks=be("download",Iv);const Rv=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],Pv=be("equal",Rv);const Ov=[["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"}]],Dv=be("external-link",Ov);const Mv=[["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"}]],_s=be("eye-off",Mv);const Lv=[["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"}]],Ss=be("eye",Lv);const Fv=[["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"}]],$v=be("file-terminal",Fv);const Bv=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Uv=be("gauge",Bv);const Zv=[["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"}]],Ou=be("git-compare-arrows",Zv);const Vv=[["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"}]],Wv=be("globe",Vv);const Hv=[["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"}]],qv=be("layout-grid",Hv);const Kv=[["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"}]],Gv=be("list",Kv);const Jv=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],to=be("loader-circle",Jv);const Yv=[["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"}]],Xv=be("lock",Yv);const Qv=[["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"}]],Du=be("message-square",Qv);const eb=[["path",{d:"M5 12h14",key:"1ays0h"}]],Cs=be("minus",eb);const tb=[["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"}]],Es=be("pencil",tb);const nb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],no=be("plus",nb);const rb=[["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"}]],ob=be("radio",rb);const ib=[["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"}]],Mu=be("rotate-ccw",ib);const sb=[["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"}]],Lu=be("rotate-cw",sb);const ab=[["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"}]],Fu=be("rows-3",ab);const lb=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],cb=be("scan",lb);const ub=[["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"}]],db=be("server",ub);const fb=[["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"}]],hb=be("settings",fb);const pb=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$u=be("terminal",pb);const mb=[["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"}]],gb=be("trash-2",mb);const xb=[["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"}]],yb=be("triangle-alert",xb);const vb=[["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"}]],bb=be("upload",vb);const wb=[["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"}]],kb=be("user",wb);const _b=[["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"}]],Sb=be("wifi-off",_b);const Cb=[["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"}]],Eb=be("wifi",Cb);const Nb=[["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"}]],jb=be("wrench",Nb);const Tb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ns=be("x",Tb);const Ab=[["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"}]],vr=be("zap",Ab);function Ar(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 Xo={exports:{}};var Ka;function zb(){return Ka||(Ka=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 Ar=="function"&&Ar;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(y){var m=r[u][1][y];return s(m||y)},f,f.exports,n,r,o,i)}return o[u].exports}for(var a=typeof Ar=="function"&&Ar,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,y,m,x=[],g=0,b=l.length,k=b,S=i.getTypeOf(l)!=="string";g<l.length;)k=b-g,h=S?(u=l[g++],d=g<b?l[g++]:0,g<b?l[g++]:0):(u=l.charCodeAt(g++),d=g<b?l.charCodeAt(g++):0,g<b?l.charCodeAt(g++):0),p=u>>2,f=(3&u)<<4|d>>4,y=1<k?(15&d)<<2|h>>6:64,m=2<k?63&h:64,x.push(a.charAt(p)+a.charAt(f)+a.charAt(y)+a.charAt(m));return x.join("")},o.decode=function(l){var u,d,h,p,f,y,m=0,x=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var b,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)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|(y=a.indexOf(l.charAt(m++))),b[x++]=u,f!==64&&(b[x++]=d),y!==64&&(b[x++]=h);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function u(d,h,p,f,y){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=y}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,y=p+h;u^=-1;for(var m=p;m<y;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,y=p+h;u^=-1;for(var m=p;m<y;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,y){var m,x="";for(m=0;m<y;m++)x+=String.fromCharCode(255&f),f>>>=8;return x}function s(f,y,m,x,g,b){var k,S,j=f.file,C=f.compression,N=b!==u.utf8encode,I=a.transformTo("string",b(j.name)),P=a.transformTo("string",u.utf8encode(j.name)),M=j.comment,U=a.transformTo("string",b(M)),E=a.transformTo("string",u.utf8encode(M)),D=P.length!==j.name.length,w=E.length!==M.length,O="",J="",W="",q=j.dir,Y=j.date,T={crc32:0,compressedSize:0,uncompressedSize:0};y&&!m||(T.crc32=f.crc32,T.compressedSize=f.compressedSize,T.uncompressedSize=f.uncompressedSize);var F=0;y&&(F|=8),N||!D&&!w||(F|=2048);var $=0,A=0;q&&($|=16),g==="UNIX"?(A=798,$|=(function(G,le){var Q=G;return G||(Q=le?16893:33204),(65535&Q)<<16})(j.unixPermissions,q)):(A=20,$|=(function(G){return 63&(G||0)})(j.dosPermissions)),k=Y.getUTCHours(),k<<=6,k|=Y.getUTCMinutes(),k<<=5,k|=Y.getUTCSeconds()/2,S=Y.getUTCFullYear()-1980,S<<=4,S|=Y.getUTCMonth()+1,S<<=5,S|=Y.getUTCDate(),D&&(J=i(1,1)+i(d(I),4)+P,O+="up"+i(J.length,2)+J),w&&(W=i(1,1)+i(d(U),4)+E,O+="uc"+i(W.length,2)+W);var te="";return te+=`
|
|
40
|
-
\0`,te+=i(F,2),te+=C.magic,te+=i(k,2),te+=i(S,2),te+=i(T.crc32,4),te+=i(T.compressedSize,4),te+=i(T.uncompressedSize,4),te+=i(I.length,2),te+=i(O.length,2),{fileRecord:h.LOCAL_FILE_HEADER+te+I+O,dirRecord:h.CENTRAL_FILE_HEADER+i(A,2)+te+i(U.length,2)+"\0\0\0\0"+i($,4)+i(x,4)+I+O+U}}var a=n("../utils"),l=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(f,y,m,x){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=x,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 y=f.meta.percent||0,m=this.entriesCount,x=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?(y+100*(m-x-1))/m:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var y=this.streamFiles&&!f.file.dir;if(y){var m=s(f,y,!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 y=this.streamFiles&&!f.file.dir,m=s(f,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:(function(x){return h.DATA_DESCRIPTOR+i(x.crc32,4)+i(x.compressedSize,4)+i(x.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,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var m=this.bytesWritten-f,x=(function(g,b,k,S,j){var C=a.transformTo("string",j(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(b,4)+i(k,4)+i(C.length,2)+C})(this.dirRecords.length,m,f,this.zipComment,this.encodeFileName);this.push({data:x,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 y=this;return f.on("data",function(m){y.processChunk(m)}),f.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),f.on("error",function(m){y.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 y=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var m=0;m<y.length;m++)try{y[m].error(f)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,y=0;y<f.length;y++)f[y].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 y=(function(b,k){var S=b||k,j=i[S];if(!j)throw new Error(S+" is not a valid compression method !");return j})(f.options.compression,l.compression),m=f.options.compressionOptions||l.compressionOptions||{},x=f.dir,g=f.date;f._compressWorker(y,m).withStreamInfo("file",{name:p,dir:x,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,y){var m=p.decompressed.getContentWorker().pipe(new u);m.on("error",function(x){y(x)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var y=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 x=new l(f);return x.load(m),x}).then(function(m){var x=[s.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var b=0;b<g.length;b++)x.push(h(g[b]));return s.Promise.all(x)}).then(function(m){for(var x=m.shift(),g=x.files,b=0;b<g.length;b++){var k=g[b],S=k.fileNameStr,j=i.resolve(k.fileNameStr);y.file(j,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(y.file(j).unsafeOriginalName=S)}return x.zipComment.length&&(y.comment=x.zipComment),y})}},{"./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(j,C,N){var I,P=a.getTypeOf(C),M=a.extend(N||{},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&&(j=g(j)),M.createFolders&&(I=x(j))&&b.call(this,I,!0);var U=P==="string"&&M.binary===!1&&M.base64===!1;N&&N.binary!==void 0||(M.binary=!U),(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 E=null;E=C instanceof h||C instanceof l?C:y.isNode&&y.isStream(C)?new m(j,C):a.prepareContent(j,C,M.binary,M.optimizedBinaryString,M.base64);var D=new p(j,E,M);this.files[j]=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"),y=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),x=function(j){j.slice(-1)==="/"&&(j=j.substring(0,j.length-1));var C=j.lastIndexOf("/");return 0<C?j.substring(0,C):""},g=function(j){return j.slice(-1)!=="/"&&(j+="/"),j},b=function(j,C){return C=C!==void 0?C:d.createFolders,j=g(j),this.files[j]||i.call(this,j,null,{dir:!0,createFolders:C}),this.files[j]};function k(j){return Object.prototype.toString.call(j)==="[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(j){var C,N,I;for(C in this.files)I=this.files[C],(N=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&j(N,I)},filter:function(j){var C=[];return this.forEach(function(N,I){j(N,I)&&C.push(I)}),C},file:function(j,C,N){if(arguments.length!==1)return j=this.root+j,i.call(this,j,C,N),this;if(k(j)){var I=j;return this.filter(function(M,U){return!U.dir&&I.test(M)})}var P=this.files[this.root+j];return P&&!P.dir?P:null},folder:function(j){if(!j)return this;if(k(j))return this.filter(function(P,M){return M.dir&&j.test(P)});var C=this.root+j,N=b.call(this,C),I=this.clone();return I.root=N.name,I},remove:function(j){j=this.root+j;var C=this.files[j];if(C||(j.slice(-1)!=="/"&&(j+="/"),C=this.files[j]),C&&!C.dir)delete this.files[j];else for(var N=this.filter(function(P,M){return M.name.slice(0,j.length)===j}),I=0;I<N.length;I++)delete this.files[N[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(j){var C,N={};try{if((N=a.extend(j||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=N.type.toLowerCase(),N.compression=N.compression.toUpperCase(),N.type==="binarystring"&&(N.type="string"),!N.type)throw new Error("No output type specified.");a.checkSupport(N.type),N.platform!=="darwin"&&N.platform!=="freebsd"&&N.platform!=="linux"&&N.platform!=="sunos"||(N.platform="UNIX"),N.platform==="win32"&&(N.platform="DOS");var I=N.comment||this.comment||"";C=f.generateWorker(this,N,I)}catch(P){(C=new l("error")).error(P)}return new u(C,N.type||"string",N.mimeType)},generateAsync:function(j,C){return this.generateInternalStream(j).accumulate(C)},generateNodeStream:function(j,C){return(j=j||{}).type||(j.type="nodebuffer"),this.generateInternalStream(j).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(y,m){return new d.Promise(function(x,g){var b=[],k=y._internalType,S=y._outputType,j=y._mimeType;y.on("data",function(C,N){b.push(C),m&&m(N)}).on("error",function(C){b=[],g(C)}).on("end",function(){try{var C=(function(N,I,P){switch(N){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),P);case"base64":return l.encode(I);default:return i.transformTo(N,I)}})(S,(function(N,I){var P,M=0,U=null,E=0;for(P=0;P<I.length;P++)E+=I[P].length;switch(N){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(U=new Uint8Array(E),P=0;P<I.length;P++)U.set(I[P],M),M+=I[P].length;return U;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+N+"'")}})(k,b),j);x(C)}catch(N){g(N)}b=[]}).resume()})}function f(y,m,x){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=x,i.checkSupport(g),this._worker=y.pipe(new s(g)),y.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}f.prototype={accumulate:function(y){return p(this,y)},on:function(y,m){var x=this;return y==="data"?this._worker.on(y,function(g){m.call(x,g.data,g.meta)}):this._worker.on(y,function(){i.delay(m,arguments,x)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){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"},y)}},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(y){var m,x,g,b,k,S=y.length,j=0;for(b=0;b<S;b++)(64512&(x=y.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=y.charCodeAt(b+1)))==56320&&(x=65536+(x-55296<<10)+(g-56320),b++),j+=x<128?1:x<2048?2:x<65536?3:4;for(m=s.uint8array?new Uint8Array(j):new Array(j),b=k=0;k<j;b++)(64512&(x=y.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=y.charCodeAt(b+1)))==56320&&(x=65536+(x-55296<<10)+(g-56320),b++),x<128?m[k++]=x:(x<2048?m[k++]=192|x>>>6:(x<65536?m[k++]=224|x>>>12:(m[k++]=240|x>>>18,m[k++]=128|x>>>12&63),m[k++]=128|x>>>6&63),m[k++]=128|63&x);return m})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(y){var m,x,g,b,k=y.length,S=new Array(2*k);for(m=x=0;m<k;)if((g=y[m++])<128)S[x++]=g;else if(4<(b=u[g]))S[x++]=65533,m+=b-1;else{for(g&=b===2?31:b===3?15:7;1<b&&m<k;)g=g<<6|63&y[m++],b--;1<b?S[x++]=65533:g<65536?S[x++]=g:(g-=65536,S[x++]=55296|g>>10&1023,S[x++]=56320|1023&g)}return S.length!==x&&(S.subarray?S=S.subarray(0,x):S.length=x),i.applyFromCharCode(S)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(h,l),h.prototype.processChunk=function(f){var y=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var x=(function(b,k){var S;for((k=k||b.length)>b.length&&(k=b.length),S=k-1;0<=S&&(192&b[S])==128;)S--;return S<0||S===0?k:S+u[b[S]]>k?S:k})(y),g=y;x!==y.length&&(s.uint8array?(g=y.subarray(0,x),this.leftOver=y.subarray(x,y.length)):(g=y.slice(0,x),this.leftOver=y.slice(x,y.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,x){for(var g=0;g<m.length;++g)x[g]=255&m.charCodeAt(g);return x}n("setimmediate"),o.newBlob=function(m,x){o.checkSupport("blob");try{return new Blob([m],{type:x})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,x,g){var b=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)x==="array"||x==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):b.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return b.join("")},stringifyByChar:function(m){for(var x="",g=0;g<m.length;g++)x+=String.fromCharCode(m[g]);return x},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 x=65536,g=o.getTypeOf(m),b=!0;if(g==="uint8array"?b=h.applyCanBeUsed.uint8array:g==="nodebuffer"&&(b=h.applyCanBeUsed.nodebuffer),b)for(;1<x;)try{return h.stringifyByChunk(m,g,x)}catch{x=Math.floor(x/2)}return h.stringifyByChar(m)}function f(m,x){for(var g=0;g<m.length;g++)x[g]=m[g];return x}o.applyFromCharCode=p;var y={};y.string={string:u,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return y.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,a.allocBuffer(m.length))}},y.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)}},y.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))}},y.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)}},y.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return y.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:u},o.transformTo=function(m,x){if(x=x||"",!m)return x;o.checkSupport(m);var g=o.getTypeOf(x);return y[g][m](x)},o.resolve=function(m){for(var x=m.split("/"),g=[],b=0;b<x.length;b++){var k=x[b];k==="."||k===""&&b!==0&&b!==x.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var x,g,b="";for(g=0;g<(m||"").length;g++)b+="\\x"+((x=m.charCodeAt(g))<16?"0":"")+x.toString(16).toUpperCase();return b},o.delay=function(m,x,g){setImmediate(function(){m.apply(g||null,x||[])})},o.inherits=function(m,x){function g(){}g.prototype=x.prototype,m.prototype=new g},o.extend=function(){var m,x,g={};for(m=0;m<arguments.length;m++)for(x in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],x)&&g[x]===void 0&&(g[x]=arguments[m][x]);return g},o.prepareContent=function(m,x,g,b,k){return l.Promise.resolve(x).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(j,C){var N=new FileReader;N.onload=function(I){j(I.target.result)},N.onerror=function(I){C(I.target.error)},N.readAsArrayBuffer(S)}):S}).then(function(S){var j=o.getTypeOf(S);return j?(j==="arraybuffer"?S=o.transformTo("uint8array",S):j==="string"&&(k?S=s.decode(S):g&&b!==!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 y=this.reader.readString(4)===p;return this.reader.setIndex(f),y},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,y=this.zip64EndOfCentralSize-44;0<y;)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 y=p-f;if(0<y)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" 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,y){this.options=f,this.loadOptions=y}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var y,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((y=(function(x){for(var g in d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===x)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,y,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 y=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(y),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 y,m,x,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)y=f.readInt(2),m=f.readInt(2),x=f.readData(m),this.extraFields[y]={id:y,length:m,value:x};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 y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var m=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var y=i(f.value);return y.readInt(1)!==1||l(this.fileName)!==y.readInt(4)?null:u.utf8decode(y.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var y=i(f.value);return y.readInt(1)!==1||l(this.fileComment)!==y.readInt(4)?null:u.utf8decode(y.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(y,m,x){this.name=y,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=m,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),u=n("./compressedObject"),d=n("./stream/GenericWorker");i.prototype={internalStream:function(y){var m=null,x="string";try{if(!y)throw new Error("No output type specified.");var g=(x=y.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!b&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new d("error")).error(k)}return new s(m,x,"")},async:function(y,m){return this.internalStream(y).accumulate(m)},nodeStream:function(y,m){return this.internalStream(y||"nodebuffer").toNodejsStream(m)},_compressWorker:function(y,m){if(this._data instanceof u&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new l.Utf8EncodeWorker)),u.createWorkerFrom(x,y,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(y),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(){y(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(y,0)};else{var p=new i.MessageChannel;p.port1.onmessage=y,s=function(){p.port2.postMessage(0)}}var f=[];function y(){var m,x;a=!0;for(var g=f.length;g;){for(x=f,f=[],m=-1;++m<g;)x[m]();g=f.length}a=!1}r.exports=function(m){f.push(m)!==1||a||s()}}).call(this,typeof Er<"u"?Er: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,b,k){this.promise=g,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,b,k){i(function(){var S;try{S=b(k)}catch(j){return a.reject(g,j)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function y(g){var b=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof b=="function")return function(){b.apply(g,arguments)}}function m(g,b){var k=!1;function S(N){k||(k=!0,a.reject(g,N))}function j(N){k||(k=!0,a.resolve(g,N))}var C=x(function(){b(j,S)});C.status==="error"&&S(C.value)}function x(g,b){var k={};try{k.value=g(b),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=h).prototype.finally=function(g){if(typeof g!="function")return this;var b=this.constructor;return this.then(function(k){return b.resolve(g()).then(function(){return k})},function(k){return b.resolve(g()).then(function(){throw k})})},h.prototype.catch=function(g){return this.then(null,g)},h.prototype.then=function(g,b){if(typeof g!="function"&&this.state===u||typeof b!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===u?g:b,this.outcome):this.queue.push(new p(k,g,b)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){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,b){var k=x(y,b);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=u,g.outcome=b;for(var j=-1,C=g.queue.length;++j<C;)g.queue[j].callFulfilled(b)}return g},a.reject=function(g,b){g.state=l,g.outcome=b;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(b);return g},h.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},h.reject=function(g){var b=new this(s);return a.reject(b,g)},h.all=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var j=new Array(k),C=0,N=-1,I=new this(s);++N<k;)P(g[N],N);return I;function P(M,U){b.resolve(M).then(function(E){j[U]=E,++C!==k||S||(S=!0,a.resolve(I,j))},function(E){S||(S=!0,a.reject(I,E))})}},h.race=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var j=-1,C=new this(s);++j<k;)N=g[j],b.resolve(N).then(function(I){S||(S=!0,a.resolve(C,I))},function(I){S||(S=!0,a.reject(C,I))});var N;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,y=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(k!==h)throw new Error(l[k]);if(b.header&&i.deflateSetHeader(this.strm,b.header),b.dictionary){var S;if(S=typeof b.dictionary=="string"?a.string2buf(b.dictionary):d.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[k]);this._dict_set=!0}}function x(g,b){var k=new m(b);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,b){var k,S,j=this.strm,C=this.options.chunkSize;if(this.ended)return!1;S=b===~~b?b:b===!0?4:0,typeof g=="string"?j.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?j.input=new Uint8Array(g):j.input=g,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new s.Buf8(C),j.next_out=0,j.avail_out=C),(k=i.deflate(j,S))!==1&&k!==h)return this.onEnd(k),!(this.ended=!0);j.avail_out!==0&&(j.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(j.output,j.next_out))):this.onData(s.shrinkBuf(j.output,j.next_out)))}while((0<j.avail_in||j.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===h):S!==2||(this.onEnd(h),!(j.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=x,o.deflateRaw=function(g,b){return(b=b||{}).raw=!0,x(g,b)},o.gzip=function(g,b){return(b=b||{}).gzip=!0,x(g,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),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 x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||m&&m.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&(15&x.windowBits)==0&&(x.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,x.windowBits);if(g!==l.Z_OK)throw new Error(u[g]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function y(m,x){var g=new f(x);if(g.push(m,!0),g.err)throw g.msg||u[g.err];return g.result}f.prototype.push=function(m,x){var g,b,k,S,j,C,N=this.strm,I=this.options.chunkSize,P=this.options.dictionary,M=!1;if(this.ended)return!1;b=x===~~x?x:x===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?N.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?N.input=new Uint8Array(m):N.input=m,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new s.Buf8(I),N.next_out=0,N.avail_out=I),(g=i.inflate(N,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);N.next_out&&(N.avail_out!==0&&g!==l.Z_STREAM_END&&(N.avail_in!==0||b!==l.Z_FINISH&&b!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(N.output,N.next_out),S=N.next_out-k,j=a.buf2string(N.output,k),N.next_out=S,N.avail_out=I-S,S&&s.arraySet(N.output,N.output,k,S,0),this.onData(j)):this.onData(s.shrinkBuf(N.output,N.next_out)))),N.avail_in===0&&N.avail_out===0&&(M=!0)}while((0<N.avail_in||N.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(b=l.Z_FINISH),b===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):b!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(N.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=y,o.inflateRaw=function(m,x){return(x=x||{}).raw=!0,y(m,x)},o.ungzip=y},{"./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,y;for(u=h=0,d=l.length;u<d;u++)h+=l[u].length;for(y=new Uint8Array(h),u=p=0,d=l.length;u<d;u++)f=l[u],y.set(f,p),p+=f.length;return y}},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="",y=0;y<p;y++)f+=String.fromCharCode(h[y]);return f}l[254]=l[254]=1,o.string2buf=function(h){var p,f,y,m,x,g=h.length,b=0;for(m=0;m<g;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(y=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(y-56320),m++),b+=f<128?1:f<2048?2:f<65536?3:4;for(p=new i.Buf8(b),m=x=0;x<b;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(y=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(y-56320),m++),f<128?p[x++]=f:(f<2048?p[x++]=192|f>>>6:(f<65536?p[x++]=224|f>>>12:(p[x++]=240|f>>>18,p[x++]=128|f>>>12&63),p[x++]=128|f>>>6&63),p[x++]=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,y=p.length;f<y;f++)p[f]=h.charCodeAt(f);return p},o.buf2string=function(h,p){var f,y,m,x,g=p||h.length,b=new Array(2*g);for(f=y=0;f<g;)if((m=h[f++])<128)b[y++]=m;else if(4<(x=l[m]))b[y++]=65533,f+=x-1;else{for(m&=x===2?31:x===3?15:7;1<x&&f<g;)m=m<<6|63&h[f++],x--;1<x?b[y++]=65533:m<65536?b[y++]=m:(m-=65536,b[y++]=55296|m>>10&1023,b[y++]=56320|1023&m)}return d(b,y)},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,y=-2,m=-1,x=4,g=2,b=8,k=9,S=286,j=30,C=19,N=2*S+1,I=15,P=3,M=258,U=M+P+1,E=42,D=113,w=1,O=2,J=3,W=4;function q(_,Z){return _.msg=d[Z],Z}function Y(_){return(_<<1)-(4<_?9:0)}function T(_){for(var Z=_.length;0<=--Z;)_[Z]=0}function F(_){var Z=_.state,B=Z.pending;B>_.avail_out&&(B=_.avail_out),B!==0&&(s.arraySet(_.output,Z.pending_buf,Z.pending_out,B,_.next_out),_.next_out+=B,Z.pending_out+=B,_.total_out+=B,_.avail_out-=B,Z.pending-=B,Z.pending===0&&(Z.pending_out=0))}function $(_,Z){a._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,Z),_.block_start=_.strstart,F(_.strm)}function A(_,Z){_.pending_buf[_.pending++]=Z}function te(_,Z){_.pending_buf[_.pending++]=Z>>>8&255,_.pending_buf[_.pending++]=255&Z}function G(_,Z){var B,R,z=_.max_chain_length,L=_.strstart,ee=_.prev_length,re=_.nice_match,H=_.strstart>_.w_size-U?_.strstart-(_.w_size-U):0,se=_.window,fe=_.w_mask,ae=_.prev,V=_.strstart+M,ne=se[L+ee-1],ue=se[L+ee];_.prev_length>=_.good_match&&(z>>=2),re>_.lookahead&&(re=_.lookahead);do if(se[(B=Z)+ee]===ue&&se[B+ee-1]===ne&&se[B]===se[L]&&se[++B]===se[L+1]){L+=2,B++;do;while(se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&L<V);if(R=M-(V-L),L=V-M,ee<R){if(_.match_start=Z,re<=(ee=R))break;ne=se[L+ee-1],ue=se[L+ee]}}while((Z=ae[Z&fe])>H&&--z!=0);return ee<=_.lookahead?ee:_.lookahead}function le(_){var Z,B,R,z,L,ee,re,H,se,fe,ae=_.w_size;do{if(z=_.window_size-_.lookahead-_.strstart,_.strstart>=ae+(ae-U)){for(s.arraySet(_.window,_.window,ae,ae,0),_.match_start-=ae,_.strstart-=ae,_.block_start-=ae,Z=B=_.hash_size;R=_.head[--Z],_.head[Z]=ae<=R?R-ae:0,--B;);for(Z=B=ae;R=_.prev[--Z],_.prev[Z]=ae<=R?R-ae:0,--B;);z+=ae}if(_.strm.avail_in===0)break;if(ee=_.strm,re=_.window,H=_.strstart+_.lookahead,se=z,fe=void 0,fe=ee.avail_in,se<fe&&(fe=se),B=fe===0?0:(ee.avail_in-=fe,s.arraySet(re,ee.input,ee.next_in,fe,H),ee.state.wrap===1?ee.adler=l(ee.adler,re,fe,H):ee.state.wrap===2&&(ee.adler=u(ee.adler,re,fe,H)),ee.next_in+=fe,ee.total_in+=fe,fe),_.lookahead+=B,_.lookahead+_.insert>=P)for(L=_.strstart-_.insert,_.ins_h=_.window[L],_.ins_h=(_.ins_h<<_.hash_shift^_.window[L+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[L+P-1])&_.hash_mask,_.prev[L&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=L,L++,_.insert--,!(_.lookahead+_.insert<P)););}while(_.lookahead<U&&_.strm.avail_in!==0)}function Q(_,Z){for(var B,R;;){if(_.lookahead<U){if(le(_),_.lookahead<U&&Z===h)return w;if(_.lookahead===0)break}if(B=0,_.lookahead>=P&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),B!==0&&_.strstart-B<=_.w_size-U&&(_.match_length=G(_,B)),_.match_length>=P)if(R=a._tr_tally(_,_.strstart-_.match_start,_.match_length-P),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=P){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else R=a._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(R&&($(_,!1),_.strm.avail_out===0))return w}return _.insert=_.strstart<P-1?_.strstart:P-1,Z===p?($(_,!0),_.strm.avail_out===0?J:W):_.last_lit&&($(_,!1),_.strm.avail_out===0)?w:O}function ce(_,Z){for(var B,R,z;;){if(_.lookahead<U){if(le(_),_.lookahead<U&&Z===h)return w;if(_.lookahead===0)break}if(B=0,_.lookahead>=P&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=P-1,B!==0&&_.prev_length<_.max_lazy_match&&_.strstart-B<=_.w_size-U&&(_.match_length=G(_,B),_.match_length<=5&&(_.strategy===1||_.match_length===P&&4096<_.strstart-_.match_start)&&(_.match_length=P-1)),_.prev_length>=P&&_.match_length<=_.prev_length){for(z=_.strstart+_.lookahead-P,R=a._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-P),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=P-1,_.strstart++,R&&($(_,!1),_.strm.avail_out===0))return w}else if(_.match_available){if((R=a._tr_tally(_,0,_.window[_.strstart-1]))&&$(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return w}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(R=a._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<P-1?_.strstart:P-1,Z===p?($(_,!0),_.strm.avail_out===0?J:W):_.last_lit&&($(_,!1),_.strm.avail_out===0)?w:O}function de(_,Z,B,R,z){this.good_length=_,this.max_lazy=Z,this.nice_length=B,this.max_chain=R,this.func=z}function ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*N),this.dyn_dtree=new s.Buf16(2*(2*j+1)),this.bl_tree=new s.Buf16(2*(2*C+1)),T(this.dyn_ltree),T(this.dyn_dtree),T(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),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),T(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(_){var Z;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=g,(Z=_.state).pending=0,Z.pending_out=0,Z.wrap<0&&(Z.wrap=-Z.wrap),Z.status=Z.wrap?E:D,_.adler=Z.wrap===2?0:1,Z.last_flush=h,a._tr_init(Z),f):q(_,y)}function Ne(_){var Z=xe(_);return Z===f&&(function(B){B.window_size=2*B.w_size,T(B.head),B.max_lazy_match=i[B.level].max_lazy,B.good_match=i[B.level].good_length,B.nice_match=i[B.level].nice_length,B.max_chain_length=i[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=P-1,B.match_available=0,B.ins_h=0})(_.state),Z}function Oe(_,Z,B,R,z,L){if(!_)return y;var ee=1;if(Z===m&&(Z=6),R<0?(ee=0,R=-R):15<R&&(ee=2,R-=16),z<1||k<z||B!==b||R<8||15<R||Z<0||9<Z||L<0||x<L)return q(_,y);R===8&&(R=9);var re=new ge;return(_.state=re).strm=_,re.wrap=ee,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=Z,re.strategy=L,re.method=B,Ne(_)}i=[new de(0,0,0,0,function(_,Z){var B=65535;for(B>_.pending_buf_size-5&&(B=_.pending_buf_size-5);;){if(_.lookahead<=1){if(le(_),_.lookahead===0&&Z===h)return w;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var R=_.block_start+B;if((_.strstart===0||_.strstart>=R)&&(_.lookahead=_.strstart-R,_.strstart=R,$(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-U&&($(_,!1),_.strm.avail_out===0))return w}return _.insert=0,Z===p?($(_,!0),_.strm.avail_out===0?J:W):(_.strstart>_.block_start&&($(_,!1),_.strm.avail_out),w)}),new de(4,4,8,4,Q),new de(4,5,16,8,Q),new de(4,6,32,32,Q),new de(4,4,16,16,ce),new de(8,16,32,32,ce),new de(8,16,128,128,ce),new de(8,32,128,256,ce),new de(32,128,258,1024,ce),new de(32,258,258,4096,ce)],o.deflateInit=function(_,Z){return Oe(_,Z,b,15,8,0)},o.deflateInit2=Oe,o.deflateReset=Ne,o.deflateResetKeep=xe,o.deflateSetHeader=function(_,Z){return _&&_.state?_.state.wrap!==2?y:(_.state.gzhead=Z,f):y},o.deflate=function(_,Z){var B,R,z,L;if(!_||!_.state||5<Z||Z<0)return _?q(_,y):y;if(R=_.state,!_.output||!_.input&&_.avail_in!==0||R.status===666&&Z!==p)return q(_,_.avail_out===0?-5:y);if(R.strm=_,B=R.last_flush,R.last_flush=Z,R.status===E)if(R.wrap===2)_.adler=0,A(R,31),A(R,139),A(R,8),R.gzhead?(A(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)),A(R,255&R.gzhead.time),A(R,R.gzhead.time>>8&255),A(R,R.gzhead.time>>16&255),A(R,R.gzhead.time>>24&255),A(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),A(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(A(R,255&R.gzhead.extra.length),A(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(_.adler=u(_.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(A(R,0),A(R,0),A(R,0),A(R,0),A(R,0),A(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),A(R,3),R.status=D);else{var ee=b+(R.w_bits-8<<4)<<8;ee|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(ee|=32),ee+=31-ee%31,R.status=D,te(R,ee),R.strstart!==0&&(te(R,_.adler>>>16),te(R,65535&_.adler)),_.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&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),F(_),z=R.pending,R.pending!==R.pending_buf_size));)A(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>z&&(_.adler=u(_.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&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),F(_),z=R.pending,R.pending===R.pending_buf_size)){L=1;break}L=R.gzindex<R.gzhead.name.length?255&R.gzhead.name.charCodeAt(R.gzindex++):0,A(R,L)}while(L!==0);R.gzhead.hcrc&&R.pending>z&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),L===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&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),F(_),z=R.pending,R.pending===R.pending_buf_size)){L=1;break}L=R.gzindex<R.gzhead.comment.length?255&R.gzhead.comment.charCodeAt(R.gzindex++):0,A(R,L)}while(L!==0);R.gzhead.hcrc&&R.pending>z&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),L===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&F(_),R.pending+2<=R.pending_buf_size&&(A(R,255&_.adler),A(R,_.adler>>8&255),_.adler=0,R.status=D)):R.status=D),R.pending!==0){if(F(_),_.avail_out===0)return R.last_flush=-1,f}else if(_.avail_in===0&&Y(Z)<=Y(B)&&Z!==p)return q(_,-5);if(R.status===666&&_.avail_in!==0)return q(_,-5);if(_.avail_in!==0||R.lookahead!==0||Z!==h&&R.status!==666){var re=R.strategy===2?(function(H,se){for(var fe;;){if(H.lookahead===0&&(le(H),H.lookahead===0)){if(se===h)return w;break}if(H.match_length=0,fe=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,fe&&($(H,!1),H.strm.avail_out===0))return w}return H.insert=0,se===p?($(H,!0),H.strm.avail_out===0?J:W):H.last_lit&&($(H,!1),H.strm.avail_out===0)?w:O})(R,Z):R.strategy===3?(function(H,se){for(var fe,ae,V,ne,ue=H.window;;){if(H.lookahead<=M){if(le(H),H.lookahead<=M&&se===h)return w;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=P&&0<H.strstart&&(ae=ue[V=H.strstart-1])===ue[++V]&&ae===ue[++V]&&ae===ue[++V]){ne=H.strstart+M;do;while(ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&V<ne);H.match_length=M-(ne-V),H.match_length>H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=P?(fe=a._tr_tally(H,1,H.match_length-P),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(fe=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),fe&&($(H,!1),H.strm.avail_out===0))return w}return H.insert=0,se===p?($(H,!0),H.strm.avail_out===0?J:W):H.last_lit&&($(H,!1),H.strm.avail_out===0)?w:O})(R,Z):i[R.level].func(R,Z);if(re!==J&&re!==W||(R.status=666),re===w||re===J)return _.avail_out===0&&(R.last_flush=-1),f;if(re===O&&(Z===1?a._tr_align(R):Z!==5&&(a._tr_stored_block(R,0,0,!1),Z===3&&(T(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),F(_),_.avail_out===0))return R.last_flush=-1,f}return Z!==p?f:R.wrap<=0?1:(R.wrap===2?(A(R,255&_.adler),A(R,_.adler>>8&255),A(R,_.adler>>16&255),A(R,_.adler>>24&255),A(R,255&_.total_in),A(R,_.total_in>>8&255),A(R,_.total_in>>16&255),A(R,_.total_in>>24&255)):(te(R,_.adler>>>16),te(R,65535&_.adler)),F(_),0<R.wrap&&(R.wrap=-R.wrap),R.pending!==0?f:1)},o.deflateEnd=function(_){var Z;return _&&_.state?(Z=_.state.status)!==E&&Z!==69&&Z!==73&&Z!==91&&Z!==103&&Z!==D&&Z!==666?q(_,y):(_.state=null,Z===D?q(_,-3):f):y},o.deflateSetDictionary=function(_,Z){var B,R,z,L,ee,re,H,se,fe=Z.length;if(!_||!_.state||(L=(B=_.state).wrap)===2||L===1&&B.status!==E||B.lookahead)return y;for(L===1&&(_.adler=l(_.adler,Z,fe,0)),B.wrap=0,fe>=B.w_size&&(L===0&&(T(B.head),B.strstart=0,B.block_start=0,B.insert=0),se=new s.Buf8(B.w_size),s.arraySet(se,Z,fe-B.w_size,B.w_size,0),Z=se,fe=B.w_size),ee=_.avail_in,re=_.next_in,H=_.input,_.avail_in=fe,_.next_in=0,_.input=Z,le(B);B.lookahead>=P;){for(R=B.strstart,z=B.lookahead-(P-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[R+P-1])&B.hash_mask,B.prev[R&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=R,R++,--z;);B.strstart=R,B.lookahead=P-1,le(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=P-1,B.match_available=0,_.next_in=re,_.input=H,_.avail_in=ee,B.wrap=L,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,y,m,x,g,b,k,S,j,C,N,I,P,M,U,E,D,w,O;a=i.state,l=i.next_in,w=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,y=a.wsize,m=a.whave,x=a.wnext,g=a.window,b=a.hold,k=a.bits,S=a.lencode,j=a.distcode,C=(1<<a.lenbits)-1,N=(1<<a.distbits)-1;e:do{k<15&&(b+=w[l++]<<k,k+=8,b+=w[l++]<<k,k+=8),I=S[b&C];t:for(;;){if(b>>>=P=I>>>24,k-=P,(P=I>>>16&255)===0)O[d++]=65535&I;else{if(!(16&P)){if((64&P)==0){I=S[(65535&I)+(b&(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)&&(k<P&&(b+=w[l++]<<k,k+=8),M+=b&(1<<P)-1,b>>>=P,k-=P),k<15&&(b+=w[l++]<<k,k+=8,b+=w[l++]<<k,k+=8),I=j[b&N];n:for(;;){if(b>>>=P=I>>>24,k-=P,!(16&(P=I>>>16&255))){if((64&P)==0){I=j[(65535&I)+(b&(1<<P)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(U=65535&I,k<(P&=15)&&(b+=w[l++]<<k,(k+=8)<P&&(b+=w[l++]<<k,k+=8)),f<(U+=b&(1<<P)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=P,k-=P,(P=d-h)<U){if(m<(P=U-P)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(D=g,(E=0)===x){if(E+=y-P,P<M){for(M-=P;O[d++]=g[E++],--P;);E=d-U,D=O}}else if(x<P){if(E+=y+x-P,(P-=x)<M){for(M-=P;O[d++]=g[E++],--P;);if(E=0,x<M){for(M-=P=x;O[d++]=g[E++],--P;);E=d-U,D=O}}}else if(E+=x-P,P<M){for(M-=P;O[d++]=g[E++],--P;);E=d-U,D=O}for(;2<M;)O[d++]=D[E++],O[d++]=D[E++],O[d++]=D[E++],M-=3;M&&(O[d++]=D[E++],1<M&&(O[d++]=D[E++]))}else{for(E=d-U;O[d++]=O[E++],O[d++]=O[E++],O[d++]=O[E++],2<(M-=3););M&&(O[d++]=O[E++],1<M&&(O[d++]=O[E++]))}break}}break}}while(l<u&&d<p);l-=M=k>>3,b&=(1<<(k-=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=b,a.bits=k}},{}],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,y=1,m=852,x=592;function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var D;return E&&E.state?(D=E.state,E.total_in=E.total_out=D.total=0,E.msg="",D.wrap&&(E.adler=1&D.wrap),D.mode=y,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(x),D.sane=1,D.back=-1,p):f}function S(E){var D;return E&&E.state?((D=E.state).wsize=0,D.whave=0,D.wnext=0,k(E)):f}function j(E,D){var w,O;return E&&E.state?(O=E.state,D<0?(w=0,D=-D):(w=1+(D>>4),D<48&&(D&=15)),D&&(D<8||15<D)?f:(O.window!==null&&O.wbits!==D&&(O.window=null),O.wrap=w,O.wbits=D,S(E))):f}function C(E,D){var w,O;return E?(O=new b,(E.state=O).window=null,(w=j(E,D))!==p&&(E.state=null),w):f}var N,I,P=!0;function M(E){if(P){var D;for(N=new i.Buf32(512),I=new i.Buf32(32),D=0;D<144;)E.lens[D++]=8;for(;D<256;)E.lens[D++]=9;for(;D<280;)E.lens[D++]=7;for(;D<288;)E.lens[D++]=8;for(u(d,E.lens,0,288,N,0,E.work,{bits:9}),D=0;D<32;)E.lens[D++]=5;u(h,E.lens,0,32,I,0,E.work,{bits:5}),P=!1}E.lencode=N,E.lenbits=9,E.distcode=I,E.distbits=5}function U(E,D,w,O){var J,W=E.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),O>=W.wsize?(i.arraySet(W.window,D,w-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(O<(J=W.wsize-W.wnext)&&(J=O),i.arraySet(W.window,D,w-O,J,W.wnext),(O-=J)?(i.arraySet(W.window,D,w-O,O,0),W.wnext=O,W.whave=W.wsize):(W.wnext+=J,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=J))),0}o.inflateReset=S,o.inflateReset2=j,o.inflateResetKeep=k,o.inflateInit=function(E){return C(E,15)},o.inflateInit2=C,o.inflate=function(E,D){var w,O,J,W,q,Y,T,F,$,A,te,G,le,Q,ce,de,ge,xe,Ne,Oe,_,Z,B,R,z=0,L=new i.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return f;(w=E.state).mode===12&&(w.mode=13),q=E.next_out,J=E.output,T=E.avail_out,W=E.next_in,O=E.input,Y=E.avail_in,F=w.hold,$=w.bits,A=Y,te=T,Z=p;e:for(;;)switch(w.mode){case y:if(w.wrap===0){w.mode=13;break}for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(2&w.wrap&&F===35615){L[w.check=0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0),$=F=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&F)<<8)+(F>>8))%31){E.msg="incorrect header check",w.mode=30;break}if((15&F)!=8){E.msg="unknown compression method",w.mode=30;break}if($-=4,_=8+(15&(F>>>=4)),w.wbits===0)w.wbits=_;else if(_>w.wbits){E.msg="invalid window size",w.mode=30;break}w.dmax=1<<_,E.adler=w.check=1,w.mode=512&F?10:12,$=F=0;break;case 2:for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(w.flags=F,(255&w.flags)!=8){E.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){E.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=F>>8&1),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0)),$=F=0,w.mode=3;case 3:for(;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.head&&(w.head.time=F),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,L[2]=F>>>16&255,L[3]=F>>>24&255,w.check=a(w.check,L,4,0)),$=F=0,w.mode=4;case 4:for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.head&&(w.head.xflags=255&F,w.head.os=F>>8),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0)),$=F=0,w.mode=5;case 5:if(1024&w.flags){for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.length=F,w.head&&(w.head.extra_len=F),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0)),$=F=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(Y<(G=w.length)&&(G=Y),G&&(w.head&&(_=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),i.arraySet(w.head.extra,O,W,G,_)),512&w.flags&&(w.check=a(w.check,O,G,W)),Y-=G,W+=G,w.length-=G),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(Y===0)break e;for(G=0;_=O[W+G++],w.head&&_&&w.length<65536&&(w.head.name+=String.fromCharCode(_)),_&&G<Y;);if(512&w.flags&&(w.check=a(w.check,O,G,W)),Y-=G,W+=G,_)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(Y===0)break e;for(G=0;_=O[W+G++],w.head&&_&&w.length<65536&&(w.head.comment+=String.fromCharCode(_)),_&&G<Y;);if(512&w.flags&&(w.check=a(w.check,O,G,W)),Y-=G,W+=G,_)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(F!==(65535&w.check)){E.msg="header crc mismatch",w.mode=30;break}$=F=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),E.adler=w.check=0,w.mode=12;break;case 10:for(;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}E.adler=w.check=g(F),$=F=0,w.mode=11;case 11:if(w.havedict===0)return E.next_out=q,E.avail_out=T,E.next_in=W,E.avail_in=Y,w.hold=F,w.bits=$,2;E.adler=w.check=1,w.mode=12;case 12:if(D===5||D===6)break e;case 13:if(w.last){F>>>=7&$,$-=7&$,w.mode=27;break}for(;$<3;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}switch(w.last=1&F,$-=1,3&(F>>>=1)){case 0:w.mode=14;break;case 1:if(M(w),w.mode=20,D!==6)break;F>>>=2,$-=2;break e;case 2:w.mode=17;break;case 3:E.msg="invalid block type",w.mode=30}F>>>=2,$-=2;break;case 14:for(F>>>=7&$,$-=7&$;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if((65535&F)!=(F>>>16^65535)){E.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&F,$=F=0,w.mode=15,D===6)break e;case 15:w.mode=16;case 16:if(G=w.length){if(Y<G&&(G=Y),T<G&&(G=T),G===0)break e;i.arraySet(J,O,W,G,q),Y-=G,W+=G,T-=G,q+=G,w.length-=G;break}w.mode=12;break;case 17:for(;$<14;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(w.nlen=257+(31&F),F>>>=5,$-=5,w.ndist=1+(31&F),F>>>=5,$-=5,w.ncode=4+(15&F),F>>>=4,$-=4,286<w.nlen||30<w.ndist){E.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;$<3;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.lens[ee[w.have++]]=7&F,F>>>=3,$-=3}for(;w.have<19;)w.lens[ee[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,B={bits:w.lenbits},Z=u(0,w.lens,0,19,w.lencode,0,w.work,B),w.lenbits=B.bits,Z){E.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;de=(z=w.lencode[F&(1<<w.lenbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(ge<16)F>>>=ce,$-=ce,w.lens[w.have++]=ge;else{if(ge===16){for(R=ce+2;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(F>>>=ce,$-=ce,w.have===0){E.msg="invalid bit length repeat",w.mode=30;break}_=w.lens[w.have-1],G=3+(3&F),F>>>=2,$-=2}else if(ge===17){for(R=ce+3;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}$-=ce,_=0,G=3+(7&(F>>>=ce)),F>>>=3,$-=3}else{for(R=ce+7;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}$-=ce,_=0,G=11+(127&(F>>>=ce)),F>>>=7,$-=7}if(w.have+G>w.nlen+w.ndist){E.msg="invalid bit length repeat",w.mode=30;break}for(;G--;)w.lens[w.have++]=_}}if(w.mode===30)break;if(w.lens[256]===0){E.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,B={bits:w.lenbits},Z=u(d,w.lens,0,w.nlen,w.lencode,0,w.work,B),w.lenbits=B.bits,Z){E.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,B={bits:w.distbits},Z=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,B),w.distbits=B.bits,Z){E.msg="invalid distances set",w.mode=30;break}if(w.mode=20,D===6)break e;case 20:w.mode=21;case 21:if(6<=Y&&258<=T){E.next_out=q,E.avail_out=T,E.next_in=W,E.avail_in=Y,w.hold=F,w.bits=$,l(E,te),q=E.next_out,J=E.output,T=E.avail_out,W=E.next_in,O=E.input,Y=E.avail_in,F=w.hold,$=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;de=(z=w.lencode[F&(1<<w.lenbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(de&&(240&de)==0){for(xe=ce,Ne=de,Oe=ge;de=(z=w.lencode[Oe+((F&(1<<xe+Ne)-1)>>xe)])>>>16&255,ge=65535&z,!(xe+(ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}F>>>=xe,$-=xe,w.back+=xe}if(F>>>=ce,$-=ce,w.back+=ce,w.length=ge,de===0){w.mode=26;break}if(32&de){w.back=-1,w.mode=12;break}if(64&de){E.msg="invalid literal/length code",w.mode=30;break}w.extra=15&de,w.mode=22;case 22:if(w.extra){for(R=w.extra;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.length+=F&(1<<w.extra)-1,F>>>=w.extra,$-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;de=(z=w.distcode[F&(1<<w.distbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if((240&de)==0){for(xe=ce,Ne=de,Oe=ge;de=(z=w.distcode[Oe+((F&(1<<xe+Ne)-1)>>xe)])>>>16&255,ge=65535&z,!(xe+(ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}F>>>=xe,$-=xe,w.back+=xe}if(F>>>=ce,$-=ce,w.back+=ce,64&de){E.msg="invalid distance code",w.mode=30;break}w.offset=ge,w.extra=15&de,w.mode=24;case 24:if(w.extra){for(R=w.extra;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.offset+=F&(1<<w.extra)-1,F>>>=w.extra,$-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){E.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(T===0)break e;if(G=te-T,w.offset>G){if((G=w.offset-G)>w.whave&&w.sane){E.msg="invalid distance too far back",w.mode=30;break}le=G>w.wnext?(G-=w.wnext,w.wsize-G):w.wnext-G,G>w.length&&(G=w.length),Q=w.window}else Q=J,le=q-w.offset,G=w.length;for(T<G&&(G=T),T-=G,w.length-=G;J[q++]=Q[le++],--G;);w.length===0&&(w.mode=21);break;case 26:if(T===0)break e;J[q++]=w.length,T--,w.mode=21;break;case 27:if(w.wrap){for(;$<32;){if(Y===0)break e;Y--,F|=O[W++]<<$,$+=8}if(te-=T,E.total_out+=te,w.total+=te,te&&(E.adler=w.check=w.flags?a(w.check,J,te,q-te):s(w.check,J,te,q-te)),te=T,(w.flags?F:g(F))!==w.check){E.msg="incorrect data check",w.mode=30;break}$=F=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(F!==(4294967295&w.total)){E.msg="incorrect length check",w.mode=30;break}$=F=0}w.mode=29;case 29:Z=1;break e;case 30:Z=-3;break e;case 31:return-4;default:return f}return E.next_out=q,E.avail_out=T,E.next_in=W,E.avail_in=Y,w.hold=F,w.bits=$,(w.wsize||te!==E.avail_out&&w.mode<30&&(w.mode<27||D!==4))&&U(E,E.output,E.next_out,te-E.avail_out)?(w.mode=31,-4):(A-=E.avail_in,te-=E.avail_out,E.total_in+=A,E.total_out+=te,w.total+=te,w.wrap&&te&&(E.adler=w.check=w.flags?a(w.check,J,te,E.next_out-te):s(w.check,J,te,E.next_out-te)),E.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(A==0&&te===0||D===4)&&Z===p&&(Z=-5),Z)},o.inflateEnd=function(E){if(!E||!E.state)return f;var D=E.state;return D.window&&(D.window=null),E.state=null,p},o.inflateGetHeader=function(E,D){var w;return E&&E.state?(2&(w=E.state).wrap)==0?f:((w.head=D).done=!1,p):f},o.inflateSetDictionary=function(E,D){var w,O=D.length;return E&&E.state?(w=E.state).wrap!==0&&w.mode!==11?f:w.mode===11&&s(1,D,O,0)!==w.check?-3:U(E,D,O,O)?(w.mode=31,-4):(w.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,y,m,x,g){var b,k,S,j,C,N,I,P,M,U=g.bits,E=0,D=0,w=0,O=0,J=0,W=0,q=0,Y=0,T=0,F=0,$=null,A=0,te=new i.Buf16(16),G=new i.Buf16(16),le=null,Q=0;for(E=0;E<=15;E++)te[E]=0;for(D=0;D<f;D++)te[h[p+D]]++;for(J=U,O=15;1<=O&&te[O]===0;O--);if(O<J&&(J=O),O===0)return y[m++]=20971520,y[m++]=20971520,g.bits=1,0;for(w=1;w<O&&te[w]===0;w++);for(J<w&&(J=w),E=Y=1;E<=15;E++)if(Y<<=1,(Y-=te[E])<0)return-1;if(0<Y&&(d===0||O!==1))return-1;for(G[1]=0,E=1;E<15;E++)G[E+1]=G[E]+te[E];for(D=0;D<f;D++)h[p+D]!==0&&(x[G[h[p+D]]++]=D);if(N=d===0?($=le=x,19):d===1?($=s,A-=257,le=a,Q-=257,256):($=l,le=u,-1),E=w,C=m,q=D=F=0,S=-1,j=(T=1<<(W=J))-1,d===1&&852<T||d===2&&592<T)return 1;for(;;){for(I=E-q,M=x[D]<N?(P=0,x[D]):x[D]>N?(P=le[Q+x[D]],$[A+x[D]]):(P=96,0),b=1<<E-q,w=k=1<<W;y[C+(F>>q)+(k-=b)]=I<<24|P<<16|M|0,k!==0;);for(b=1<<E-1;F&b;)b>>=1;if(b!==0?(F&=b-1,F+=b):F=0,D++,--te[E]==0){if(E===O)break;E=h[p+x[D]]}if(J<E&&(F&j)!==S){for(q===0&&(q=J),C+=w,Y=1<<(W=E-q);W+q<O&&!((Y-=te[W+q])<=0);)W++,Y<<=1;if(T+=1<<W,d===1&&852<T||d===2&&592<T)return 1;y[S=F&j]=J<<24|W<<16|C-m|0}}return F!==0&&(y[C+F]=E-q<<24|64<<16|0),g.bits=J,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 L=z.length;0<=--L;)z[L]=0}var u=0,d=29,h=256,p=h+1+d,f=30,y=19,m=2*p+1,x=15,g=16,b=7,k=256,S=16,j=17,C=18,N=[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],U=new Array(2*(p+2));l(U);var E=new Array(2*f);l(E);var D=new Array(512);l(D);var w=new Array(256);l(w);var O=new Array(d);l(O);var J,W,q,Y=new Array(f);function T(z,L,ee,re,H){this.static_tree=z,this.extra_bits=L,this.extra_base=ee,this.elems=re,this.max_length=H,this.has_stree=z&&z.length}function F(z,L){this.dyn_tree=z,this.max_code=0,this.stat_desc=L}function $(z){return z<256?D[z]:D[256+(z>>>7)]}function A(z,L){z.pending_buf[z.pending++]=255&L,z.pending_buf[z.pending++]=L>>>8&255}function te(z,L,ee){z.bi_valid>g-ee?(z.bi_buf|=L<<z.bi_valid&65535,A(z,z.bi_buf),z.bi_buf=L>>g-z.bi_valid,z.bi_valid+=ee-g):(z.bi_buf|=L<<z.bi_valid&65535,z.bi_valid+=ee)}function G(z,L,ee){te(z,ee[2*L],ee[2*L+1])}function le(z,L){for(var ee=0;ee|=1&z,z>>>=1,ee<<=1,0<--L;);return ee>>>1}function Q(z,L,ee){var re,H,se=new Array(x+1),fe=0;for(re=1;re<=x;re++)se[re]=fe=fe+ee[re-1]<<1;for(H=0;H<=L;H++){var ae=z[2*H+1];ae!==0&&(z[2*H]=le(se[ae]++,ae))}}function ce(z){var L;for(L=0;L<p;L++)z.dyn_ltree[2*L]=0;for(L=0;L<f;L++)z.dyn_dtree[2*L]=0;for(L=0;L<y;L++)z.bl_tree[2*L]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function de(z){8<z.bi_valid?A(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 ge(z,L,ee,re){var H=2*L,se=2*ee;return z[H]<z[se]||z[H]===z[se]&&re[L]<=re[ee]}function xe(z,L,ee){for(var re=z.heap[ee],H=ee<<1;H<=z.heap_len&&(H<z.heap_len&&ge(L,z.heap[H+1],z.heap[H],z.depth)&&H++,!ge(L,re,z.heap[H],z.depth));)z.heap[ee]=z.heap[H],ee=H,H<<=1;z.heap[ee]=re}function Ne(z,L,ee){var re,H,se,fe,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],H=z.pending_buf[z.l_buf+ae],ae++,re===0?G(z,H,L):(G(z,(se=w[H])+h+1,L),(fe=N[se])!==0&&te(z,H-=O[se],fe),G(z,se=$(--re),ee),(fe=I[se])!==0&&te(z,re-=Y[se],fe)),ae<z.last_lit;);G(z,k,L)}function Oe(z,L){var ee,re,H,se=L.dyn_tree,fe=L.stat_desc.static_tree,ae=L.stat_desc.has_stree,V=L.stat_desc.elems,ne=-1;for(z.heap_len=0,z.heap_max=m,ee=0;ee<V;ee++)se[2*ee]!==0?(z.heap[++z.heap_len]=ne=ee,z.depth[ee]=0):se[2*ee+1]=0;for(;z.heap_len<2;)se[2*(H=z.heap[++z.heap_len]=ne<2?++ne:0)]=1,z.depth[H]=0,z.opt_len--,ae&&(z.static_len-=fe[2*H+1]);for(L.max_code=ne,ee=z.heap_len>>1;1<=ee;ee--)xe(z,se,ee);for(H=V;ee=z.heap[1],z.heap[1]=z.heap[z.heap_len--],xe(z,se,1),re=z.heap[1],z.heap[--z.heap_max]=ee,z.heap[--z.heap_max]=re,se[2*H]=se[2*ee]+se[2*re],z.depth[H]=(z.depth[ee]>=z.depth[re]?z.depth[ee]:z.depth[re])+1,se[2*ee+1]=se[2*re+1]=H,z.heap[1]=H++,xe(z,se,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(ue,we){var Ae,Ze,lt,Ie,Et,Mt,Be=we.dyn_tree,Lt=we.max_code,vt=we.stat_desc.static_tree,pp=we.stat_desc.has_stree,mp=we.stat_desc.extra_bits,va=we.stat_desc.extra_base,Xn=we.stat_desc.max_length,Cr=0;for(Ie=0;Ie<=x;Ie++)ue.bl_count[Ie]=0;for(Be[2*ue.heap[ue.heap_max]+1]=0,Ae=ue.heap_max+1;Ae<m;Ae++)Xn<(Ie=Be[2*Be[2*(Ze=ue.heap[Ae])+1]+1]+1)&&(Ie=Xn,Cr++),Be[2*Ze+1]=Ie,Lt<Ze||(ue.bl_count[Ie]++,Et=0,va<=Ze&&(Et=mp[Ze-va]),Mt=Be[2*Ze],ue.opt_len+=Mt*(Ie+Et),pp&&(ue.static_len+=Mt*(vt[2*Ze+1]+Et)));if(Cr!==0){do{for(Ie=Xn-1;ue.bl_count[Ie]===0;)Ie--;ue.bl_count[Ie]--,ue.bl_count[Ie+1]+=2,ue.bl_count[Xn]--,Cr-=2}while(0<Cr);for(Ie=Xn;Ie!==0;Ie--)for(Ze=ue.bl_count[Ie];Ze!==0;)Lt<(lt=ue.heap[--Ae])||(Be[2*lt+1]!==Ie&&(ue.opt_len+=(Ie-Be[2*lt+1])*Be[2*lt],Be[2*lt+1]=Ie),Ze--)}})(z,L),Q(se,ne,z.bl_count)}function _(z,L,ee){var re,H,se=-1,fe=L[1],ae=0,V=7,ne=4;for(fe===0&&(V=138,ne=3),L[2*(ee+1)+1]=65535,re=0;re<=ee;re++)H=fe,fe=L[2*(re+1)+1],++ae<V&&H===fe||(ae<ne?z.bl_tree[2*H]+=ae:H!==0?(H!==se&&z.bl_tree[2*H]++,z.bl_tree[2*S]++):ae<=10?z.bl_tree[2*j]++:z.bl_tree[2*C]++,se=H,ne=(ae=0)===fe?(V=138,3):H===fe?(V=6,3):(V=7,4))}function Z(z,L,ee){var re,H,se=-1,fe=L[1],ae=0,V=7,ne=4;for(fe===0&&(V=138,ne=3),re=0;re<=ee;re++)if(H=fe,fe=L[2*(re+1)+1],!(++ae<V&&H===fe)){if(ae<ne)for(;G(z,H,z.bl_tree),--ae!=0;);else H!==0?(H!==se&&(G(z,H,z.bl_tree),ae--),G(z,S,z.bl_tree),te(z,ae-3,2)):ae<=10?(G(z,j,z.bl_tree),te(z,ae-3,3)):(G(z,C,z.bl_tree),te(z,ae-11,7));se=H,ne=(ae=0)===fe?(V=138,3):H===fe?(V=6,3):(V=7,4)}}l(Y);var B=!1;function R(z,L,ee,re){te(z,(u<<1)+(re?1:0),3),(function(H,se,fe,ae){de(H),A(H,fe),A(H,~fe),i.arraySet(H.pending_buf,H.window,se,fe,H.pending),H.pending+=fe})(z,L,ee)}o._tr_init=function(z){B||((function(){var L,ee,re,H,se,fe=new Array(x+1);for(H=re=0;H<d-1;H++)for(O[H]=re,L=0;L<1<<N[H];L++)w[re++]=H;for(w[re-1]=H,H=se=0;H<16;H++)for(Y[H]=se,L=0;L<1<<I[H];L++)D[se++]=H;for(se>>=7;H<f;H++)for(Y[H]=se<<7,L=0;L<1<<I[H]-7;L++)D[256+se++]=H;for(ee=0;ee<=x;ee++)fe[ee]=0;for(L=0;L<=143;)U[2*L+1]=8,L++,fe[8]++;for(;L<=255;)U[2*L+1]=9,L++,fe[9]++;for(;L<=279;)U[2*L+1]=7,L++,fe[7]++;for(;L<=287;)U[2*L+1]=8,L++,fe[8]++;for(Q(U,p+1,fe),L=0;L<f;L++)E[2*L+1]=5,E[2*L]=le(L,5);J=new T(U,N,h+1,p,x),W=new T(E,I,0,f,x),q=new T(new Array(0),P,0,y,b)})(),B=!0),z.l_desc=new F(z.dyn_ltree,J),z.d_desc=new F(z.dyn_dtree,W),z.bl_desc=new F(z.bl_tree,q),z.bi_buf=0,z.bi_valid=0,ce(z)},o._tr_stored_block=R,o._tr_flush_block=function(z,L,ee,re){var H,se,fe=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(ae){var V,ne=4093624447;for(V=0;V<=31;V++,ne>>>=1)if(1&ne&&ae.dyn_ltree[2*V]!==0)return s;if(ae.dyn_ltree[18]!==0||ae.dyn_ltree[20]!==0||ae.dyn_ltree[26]!==0)return a;for(V=32;V<h;V++)if(ae.dyn_ltree[2*V]!==0)return a;return s})(z)),Oe(z,z.l_desc),Oe(z,z.d_desc),fe=(function(ae){var V;for(_(ae,ae.dyn_ltree,ae.l_desc.max_code),_(ae,ae.dyn_dtree,ae.d_desc.max_code),Oe(ae,ae.bl_desc),V=y-1;3<=V&&ae.bl_tree[2*M[V]+1]===0;V--);return ae.opt_len+=3*(V+1)+5+5+4,V})(z),H=z.opt_len+3+7>>>3,(se=z.static_len+3+7>>>3)<=H&&(H=se)):H=se=ee+5,ee+4<=H&&L!==-1?R(z,L,ee,re):z.strategy===4||se===H?(te(z,2+(re?1:0),3),Ne(z,U,E)):(te(z,4+(re?1:0),3),(function(ae,V,ne,ue){var we;for(te(ae,V-257,5),te(ae,ne-1,5),te(ae,ue-4,4),we=0;we<ue;we++)te(ae,ae.bl_tree[2*M[we]+1],3);Z(ae,ae.dyn_ltree,V-1),Z(ae,ae.dyn_dtree,ne-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,fe+1),Ne(z,z.dyn_ltree,z.dyn_dtree)),ce(z),re&&de(z)},o._tr_tally=function(z,L,ee){return z.pending_buf[z.d_buf+2*z.last_lit]=L>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&L,z.pending_buf[z.l_buf+z.last_lit]=255&ee,z.last_lit++,L===0?z.dyn_ltree[2*ee]++:(z.matches++,L--,z.dyn_ltree[2*(w[ee]+h+1)]++,z.dyn_dtree[2*$(L)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){te(z,2,3),G(z,k,U),(function(L){L.bi_valid===16?(A(L,L.bi_buf),L.bi_buf=0,L.bi_valid=0):8<=L.bi_valid&&(L.pending_buf[L.pending++]=255&L.bi_buf,L.bi_buf>>=8,L.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={},y=!1,m=s.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(s);x=x&&x.setTimeout?x:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){b(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,j=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=j,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){b(S.data)},function(S){d.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(S){var j=m.createElement("script");j.onreadystatechange=function(){b(S),j.onreadystatechange=null,u.removeChild(j),j=null},u.appendChild(j)}):function(S){setTimeout(b,0,S)},x.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var j=new Array(arguments.length-1),C=0;C<j.length;C++)j[C]=arguments[C+1];var N={callback:S,args:j};return f[p]=N,l(p),p++},x.clearImmediate=g}function g(S){delete f[S]}function b(S){if(y)setTimeout(b,0,S);else{var j=f[S];if(j){y=!0;try{(function(C){var N=C.callback,I=C.args;switch(I.length){case 0:N();break;case 1:N(I[0]);break;case 2:N(I[0],I[1]);break;case 3:N(I[0],I[1],I[2]);break;default:N.apply(a,I)}})(j)}finally{g(S),y=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&b(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof Er<"u"?Er:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Xo)),Xo.exports}var Ib=zb();const Rb=ds(Ib);async function Pb(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 Ob(e){const t=new Rb;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 Pb(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 Db="1.14.4",Mb={version:Db};function Bu(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=Bu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Uu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bu(e))&&(r&&(r+=" "),r+=t);return r}const Lb=(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},Fb=(e,t)=>({classGroupId:e,validator:t}),Zu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ro="-",Ga=[],$b="arbitrary..",Bb=e=>{const t=Zb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Ub(s);const a=s.split(ro),l=a[0]===""&&a.length>1?1:0;return Vu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],u=n[s];return l?u?Lb(u,l):l:u||Ga}return n[s]||Ga}}},Vu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=Vu(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(ro):e.slice(t).join(ro),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},Ub=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?$b+r:void 0})(),Zb=e=>{const{theme:t,classGroups:n}=e;return Vb(n,t)},Vb=(e,t)=>{const n=Zu();for(const r in e){const o=e[r];js(o,n,r,t)}return n},js=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Wb(s,t,n,r)}},Wb=(e,t,n,r)=>{if(typeof e=="string"){Hb(e,t,n);return}if(typeof e=="function"){qb(e,t,n,r);return}Kb(e,t,n,r)},Hb=(e,t,n)=>{const r=e===""?t:Wu(t,e);r.classGroupId=n},qb=(e,t,n,r)=>{if(Gb(e)){js(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Fb(n,e))},Kb=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];js(l,Wu(t,a),n,r)}},Wu=(e,t)=>{let n=e;const r=t.split(ro),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=Zu(),n.nextPart.set(s,a)),n=a}return n},Gb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Jb=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)}}},Pi="!",Ja=":",Yb=[],Ya=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Xb=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 x=o[m];if(s===0&&a===0){if(x===Ja){i.push(o.slice(l,m)),l=m+1;continue}if(x==="/"){u=m;continue}}x==="["?s++:x==="]"?s--:x==="("?a++:x===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,f=!1;h.endsWith(Pi)?(p=h.slice(0,-1),f=!0):h.startsWith(Pi)&&(p=h.slice(1),f=!0);const y=u&&u>l?u-l:void 0;return Ya(i,f,p,y)};if(t){const o=t+Ja,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Ya(Yb,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Qb=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}},e1=e=>({cache:Jb(e.cacheSize),parseClassName:Xb(e),sortModifiers:Qb(e),...Bb(e)}),t1=/\s+/,n1=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(t1);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:m}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let x=!!m,g=r(x?y.substring(0,m):y);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=r(y),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const b=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=f?b+Pi:b,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const j=o(g,x);for(let C=0;C<j.length;++C){const N=j[C];s.push(k+N)}l=d+(l.length>0?" "+l:l)}return l},r1=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Hu(n))&&(o&&(o+=" "),o+=r);return o},Hu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Hu(e[r]))&&(n&&(n+=" "),n+=t);return n},o1=(e,...t)=>{let n,r,o,i;const s=l=>{const u=t.reduce((d,h)=>h(d),e());return n=e1(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=n1(l,n);return o(l,d),d};return i=s,(...l)=>i(r1(...l))},i1=[],He=e=>{const t=n=>n[e]||i1;return t.isThemeGetter=!0,t},qu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ku=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s1=/^\d+\/\d+$/,a1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l1=/\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$/,c1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,u1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,d1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yn=e=>s1.test(e),je=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>!!e&&Number.isInteger(Number(e)),Qo=e=>e.endsWith("%")&&je(e.slice(0,-1)),Ft=e=>a1.test(e),f1=()=>!0,h1=e=>l1.test(e)&&!c1.test(e),Gu=()=>!1,p1=e=>u1.test(e),m1=e=>d1.test(e),g1=e=>!he(e)&&!pe(e),x1=e=>Wn(e,Xu,Gu),he=e=>qu.test(e),on=e=>Wn(e,Qu,h1),ei=e=>Wn(e,k1,je),Xa=e=>Wn(e,Ju,Gu),y1=e=>Wn(e,Yu,m1),zr=e=>Wn(e,ed,p1),pe=e=>Ku.test(e),er=e=>Hn(e,Qu),v1=e=>Hn(e,_1),Qa=e=>Hn(e,Ju),b1=e=>Hn(e,Xu),w1=e=>Hn(e,Yu),Ir=e=>Hn(e,ed,!0),Wn=(e,t,n)=>{const r=qu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Hn=(e,t,n=!1)=>{const r=Ku.exec(e);return r?r[1]?t(r[1]):n:!1},Ju=e=>e==="position"||e==="percentage",Yu=e=>e==="image"||e==="url",Xu=e=>e==="length"||e==="size"||e==="bg-size",Qu=e=>e==="length",k1=e=>e==="number",_1=e=>e==="family-name",ed=e=>e==="shadow",S1=()=>{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"),y=He("blur"),m=He("perspective"),x=He("aspect"),g=He("ease"),b=He("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...S(),pe,he],C=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],I=()=>[pe,he,l],P=()=>[yn,"full","auto",...I()],M=()=>[Ht,"none","subgrid",pe,he],U=()=>["auto",{span:["full",Ht,pe,he]},Ht,pe,he],E=()=>[Ht,"auto",pe,he],D=()=>["auto","min","max","fr",pe,he],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...I()],W=()=>[yn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],q=()=>[e,pe,he],Y=()=>[...S(),Qa,Xa,{position:[pe,he]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",b1,x1,{size:[pe,he]}],$=()=>[Qo,er,on],A=()=>["","none","full",u,pe,he],te=()=>["",je,er,on],G=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[je,Qo,Qa,Xa],ce=()=>["","none",y,pe,he],de=()=>["none",je,pe,he],ge=()=>["none",je,pe,he],xe=()=>[je,pe,he],Ne=()=>[yn,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ft],breakpoint:[Ft],color:[f1],container:[Ft],"drop-shadow":[Ft],ease:["in","out","in-out"],font:[g1],"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",je],text:[Ft],"text-shadow":[Ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yn,he,pe,x]}],container:["container"],columns:[{columns:[je,he,pe,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],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",pe,he]}],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:[je,yn,"auto","initial","none",he]}],grow:[{grow:["",je,pe,he]}],shrink:[{shrink:["",je,pe,he]}],order:[{order:[Ht,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"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:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,er,on]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pe,ei]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qo,he]}],"font-family":[{font:[v1,he,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,pe,he]}],"line-clamp":[{"line-clamp":[je,"none",pe,ei]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[je,"from-font","auto",pe,on]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[je,"auto",pe,he]}],"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",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ht,pe,he],radial:["",pe,he],conic:[Ht,pe,he]},w1,y1]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[je,pe,he]}],"outline-w":[{outline:["",je,er,on]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",d,Ir,zr]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",h,Ir,zr]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[je,on]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",p,Ir,zr]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[je,pe,he]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"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":[je]}],"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":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"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":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"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":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"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":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"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":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"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":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"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":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"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":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":[je]}],"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":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:ce()}],brightness:[{brightness:[je,pe,he]}],contrast:[{contrast:[je,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",f,Ir,zr]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",je,pe,he]}],"hue-rotate":[{"hue-rotate":[je,pe,he]}],invert:[{invert:["",je,pe,he]}],saturate:[{saturate:[je,pe,he]}],sepia:[{sepia:["",je,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[je,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[je,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",je,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[je,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",je,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[je,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[je,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",je,pe,he]}],"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",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[je,"initial",pe,he]}],ease:[{ease:["linear","initial",g,pe,he]}],delay:[{delay:[je,pe,he]}],animate:[{animate:["none",b,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,pe,he]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ne()}],"translate-x":[{"translate-x":Ne()}],"translate-y":[{"translate-y":Ne()}],"translate-z":[{"translate-z":Ne()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",pe,he]}],"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",pe,he]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[je,er,on,ei]}],stroke:[{stroke:["none",...q()]}],"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"]}},C1=o1(S1);function me(...e){return C1(Uu(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 td(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const el=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tl=Uu,Ts=(e,t)=>n=>{var r;if(t?.variants==null)return tl(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=el(d)||el(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(y=>{let[m,x]=y;return Array.isArray(x)?x.includes({...i,...a}[m]):{...i,...a}[m]===x})?[...u,h,p]:u},[]);return tl(e,s,l,n?.class,n?.className)};function nl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nd(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nl(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():nl(e[o],null)}}}}function Pe(...e){return v.useCallback(nd(...e),e)}function Mn(e){const t=N1(e),n=v.forwardRef((r,o)=>{const{children:i,...s}=r,a=v.Children.toArray(i),l=a.find(T1);if(l){const u=l.props.children,d=a.map(h=>h===l?v.Children.count(u)>1?v.Children.only(null):v.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:v.isValidElement(u)?v.cloneElement(u,void 0,d):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var E1=Mn("Slot");function N1(e){const t=v.forwardRef((n,r)=>{const{children:o,...i}=n;if(v.isValidElement(o)){const s=z1(o),a=A1(i,o.props);return o.type!==v.Fragment&&(a.ref=r?nd(r,s):s),v.cloneElement(o,a)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rd=Symbol("radix.slottable");function j1(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=rd,t}function T1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rd}function A1(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 z1(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 I1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=I1.reduce((e,t)=>{const n=Mn(`Primitive.${t}`),r=v.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 R1(e,t){e&&yr.flushSync(()=>e.dispatchEvent(t))}var od=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"}),P1="VisuallyHidden",id=v.forwardRef((e,t)=>c.jsx(Ce.span,{...e,ref:t,style:{...od,...e.style}}));id.displayName=P1;var O1=id;function D1(e,t){const n=v.createContext(t),r=i=>{const{children:s,...a}=i,l=v.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=v.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=v.createContext(s),l=n.length;n=[...n,s];const u=h=>{const{scope:p,children:f,...y}=h,m=p?.[e]?.[l]||a,x=v.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:x,children:f})};u.displayName=i+"Provider";function d(h,p){const f=p?.[e]?.[l]||a,y=v.useContext(f);if(y)return y;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=>v.createContext(s));return function(a){const l=a?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,M1(o,...t)]}function M1(...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 v.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function sd(e){const t=e+"CollectionProvider",[n,r]=Wt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:x,children:g}=m,b=ot.useRef(null),k=ot.useRef(new Map).current;return c.jsx(o,{scope:x,itemMap:k,collectionRef:b,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Mn(a),u=ot.forwardRef((m,x)=>{const{scope:g,children:b}=m,k=i(a,g),S=Pe(x,k.collectionRef);return c.jsx(l,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",p=Mn(d),f=ot.forwardRef((m,x)=>{const{scope:g,children:b,...k}=m,S=ot.useRef(null),j=Pe(x,S),C=i(d,g);return ot.useEffect(()=>(C.itemMap.set(S,{ref:S,...k}),()=>{C.itemMap.delete(S)})),c.jsx(p,{[h]:"",ref:j,children:b})});f.displayName=d;function y(m){const x=i(e+"CollectionConsumer",m);return ot.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const k=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((C,N)=>k.indexOf(C.ref.current)-k.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:f},y,r]}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Ke=globalThis?.document?v.useLayoutEffect:()=>{},L1=Uc[" useInsertionEffect ".trim().toString()]||Ke;function an({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=F1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=v.useRef(e!==void 0);v.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=v.useCallback(d=>{if(a){const h=$1(d)?d(e):d;h!==e&&s.current?.(h)}else i(d)},[a,e,i,s]);return[l,u]}function F1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),o=v.useRef(n),i=v.useRef(t);return L1(()=>{i.current=t},[t]),v.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function $1(e){return typeof e=="function"}function B1(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var xt=e=>{const{present:t,children:n}=e,r=U1(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=Pe(r.ref,Z1(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};xt.displayName="Presence";function U1(e){const[t,n]=v.useState(),r=v.useRef(null),o=v.useRef(e),i=v.useRef("none"),s=e?"mounted":"unmounted",[a,l]=B1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=Rr(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=Rr(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=Rr(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=f=>{f.target===t&&(i.current=Rr(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:v.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Rr(e){return e?.animationName||"none"}function Z1(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 V1=Uc[" useId ".trim().toString()]||(()=>{}),W1=0;function zt(e){const[t,n]=v.useState(V1());return Ke(()=>{n(r=>r??String(W1++))},[e]),e||(t?`radix-${t}`:"")}var So="Collapsible",[H1]=Wt(So),[q1,As]=H1(So),ad=v.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:So});return c.jsx(q1,{scope:n,disabled:i,contentId:zt(),open:l,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:c.jsx(Ce.div,{"data-state":Is(l),"data-disabled":i?"":void 0,...a,ref:t})})});ad.displayName=So;var ld="CollapsibleTrigger",cd=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=As(ld,n);return c.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Is(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ke(e.onClick,o.onOpenToggle)})});cd.displayName=ld;var zs="CollapsibleContent",ud=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=As(zs,e.__scopeCollapsible);return c.jsx(xt,{present:n||o.open,children:({present:i})=>c.jsx(K1,{...r,ref:t,present:i})})});ud.displayName=zs;var K1=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=As(zs,n),[a,l]=v.useState(r),u=v.useRef(null),d=Pe(t,u),h=v.useRef(0),p=h.current,f=v.useRef(0),y=f.current,m=s.open||a,x=v.useRef(m),g=v.useRef(void 0);return v.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Ke(()=>{const b=u.current;if(b){g.current=g.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const k=b.getBoundingClientRect();h.current=k.height,f.current=k.width,x.current||(b.style.transitionDuration=g.current.transitionDuration,b.style.animationName=g.current.animationName),l(r)}},[s.open,r]),c.jsx(Ce.div,{"data-state":Is(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":y?`${y}px`:void 0,...e.style},children:m&&o})});function Is(e){return e?"open":"closed"}var G1=ad,J1=v.createContext(void 0);function Co(e){const t=v.useContext(J1);return e||t||"ltr"}function tt(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Y1(e,t=globalThis?.document){const n=tt(e);v.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 X1="DismissableLayer",Oi="dismissableLayer.update",Q1="dismissableLayer.pointerDownOutside",ew="dismissableLayer.focusOutside",rl,dd=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Eo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=v.useContext(dd),[d,h]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=v.useState({}),y=Pe(t,N=>h(N)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(x),b=d?m.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=g,j=rw(N=>{const I=N.target,P=[...u.branches].some(M=>M.contains(I));!S||P||(o?.(N),s?.(N),N.defaultPrevented||a?.())},p),C=ow(N=>{const I=N.target;[...u.branches].some(M=>M.contains(I))||(i?.(N),s?.(N),N.defaultPrevented||a?.())},p);return Y1(N=>{b===u.layers.size-1&&(r?.(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},p),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ol(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=rl)}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ol())},[d,u]),v.useEffect(()=>{const N=()=>f({});return document.addEventListener(Oi,N),()=>document.removeEventListener(Oi,N)},[]),c.jsx(Ce.div,{...l,ref:y,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,j.onPointerDownCapture)})});Eo.displayName=X1;var tw="DismissableLayerBranch",nw=v.forwardRef((e,t)=>{const n=v.useContext(dd),r=v.useRef(null),o=Pe(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Ce.div,{...e,ref:o})});nw.displayName=tw;function rw(e,t=globalThis?.document){const n=tt(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){fd(Q1,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 ow(e,t=globalThis?.document){const n=tt(e),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&fd(ew,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 ol(){const e=new CustomEvent(Oi);document.dispatchEvent(e)}function fd(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?R1(o,i):o.dispatchEvent(i)}var ti="focusScope.autoFocusOnMount",ni="focusScope.autoFocusOnUnmount",il={bubbles:!1,cancelable:!0},iw="FocusScope",Rs=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=v.useState(null),u=tt(o),d=tt(i),h=v.useRef(null),p=Pe(t,m=>l(m)),f=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?h.current=S:Kt(h.current,{select:!0})},x=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Kt(h.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const j of k)j.removedNodes.length>0&&Kt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(g);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,f.paused]),v.useEffect(()=>{if(a){al.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(ti,il);a.addEventListener(ti,u),a.dispatchEvent(g),g.defaultPrevented||(sw(dw(hd(a)),{select:!0}),document.activeElement===m&&Kt(a))}return()=>{a.removeEventListener(ti,u),setTimeout(()=>{const g=new CustomEvent(ni,il);a.addEventListener(ni,d),a.dispatchEvent(g),g.defaultPrevented||Kt(m??document.body,{select:!0}),a.removeEventListener(ni,d),al.remove(f)},0)}}},[a,u,d,f]);const y=v.useCallback(m=>{if(!n&&!r||f.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(x&&g){const b=m.currentTarget,[k,S]=aw(b);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Kt(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Kt(S,{select:!0})):g===b&&m.preventDefault()}},[n,r,f.paused]);return c.jsx(Ce.div,{tabIndex:-1,...s,ref:p,onKeyDown:y})});Rs.displayName=iw;function sw(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Kt(r,{select:t}),document.activeElement!==n)return}function aw(e){const t=hd(e),n=sl(t,e),r=sl(t.reverse(),e);return[n,r]}function hd(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 sl(e,t){for(const n of e)if(!lw(n,{upTo:t}))return n}function lw(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 cw(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&&cw(e)&&t&&e.select()}}var al=uw();function uw(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ll(e,t),e.unshift(t)},remove(t){e=ll(e,t),e[0]?.resume()}}}function ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dw(e){return e.filter(t=>t.tagName!=="A")}var fw="Portal",No=v.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=v.useState(!1);Ke(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?xp.createPortal(c.jsx(Ce.div,{...r,ref:t}),s):null});No.displayName=fw;var ri=0;function pd(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cl()),document.body.insertAdjacentElement("beforeend",e[1]??cl()),ri++,()=>{ri===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ri--}},[])}function cl(){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 md(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 hw(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 Wr="right-scroll-bar-position",Hr="width-before-scroll-bar",pw="with-scroll-bars-hidden",mw="--removed-body-scroll-bar-size";function oi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gw(e,t){var n=v.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 xw=typeof window<"u"?v.useLayoutEffect:v.useEffect,ul=new WeakMap;function yw(e,t){var n=gw(null,function(r){return e.forEach(function(o){return oi(o,r)})});return xw(function(){var r=ul.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||oi(a,null)}),i.forEach(function(a){o.has(a)||oi(a,s)})}ul.set(n,e)},[e]),n}function vw(e){return e}function bw(e,t){t===void 0&&(t=vw);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 ww(e){e===void 0&&(e={});var t=bw(null);return t.options=jt({async:!0,ssr:!1},e),t}var gd=function(e){var t=e.sideCar,n=md(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 v.createElement(r,jt({},n))};gd.isSideCarExport=!0;function kw(e,t){return e.useMedium(t),gd}var xd=ww(),ii=function(){},jo=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ii,onWheelCapture:ii,onTouchMoveCapture:ii}),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,y=e.noIsolation,m=e.inert,x=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,k=e.gapMode,S=md(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,C=yw([n,t]),N=jt(jt({},S),o);return v.createElement(v.Fragment,null,d&&v.createElement(j,{sideCar:xd,removeScrollBar:u,shards:h,noRelative:f,noIsolation:y,inert:m,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:k}),s?v.cloneElement(v.Children.only(a),jt(jt({},N),{ref:C})):v.createElement(b,jt({},N,{className:l,ref:C}),a))});jo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jo.classNames={fullWidth:Hr,zeroRight:Wr};var _w=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_w();return t&&e.setAttribute("nonce",t),e}function Cw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ew(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Nw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sw())&&(Cw(t,n),Ew(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jw=function(){var e=Nw();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yd=function(){var e=jw(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Tw={left:0,top:0,right:0,gap:0},si=function(e){return parseInt(e||"",10)||0},Aw=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[si(n),si(r),si(o)]},zw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tw;var t=Aw(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])}},Iw=yd(),An="data-scroll-locked",Rw=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
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 pu(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:Qr(t,"input",e.processors),output:Qr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Qe(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 Qe(r.element,n);if(r.type==="set")return Qe(r.valueType,n);if(r.type==="lazy")return Qe(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 Qe(r.innerType,n);if(r.type==="intersection")return Qe(r.left,n)||Qe(r.right,n);if(r.type==="record"||r.type==="map")return Qe(r.keyType,n)||Qe(r.valueType,n);if(r.type==="pipe")return Qe(r.in,n)||Qe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Qe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Qe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Qe(o,n))return!0;return!!(r.rest&&Qe(r.rest,n))}return!1}const vx=(e,t={})=>n=>{const r=fu({...n,processors:t});return Ve(e,r),hu(r,e),pu(r,e)},Qr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=fu({...o??{},target:i,io:t,processors:n});return Ve(e,s),hu(s,e),pu(s,e)},bx={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=bx[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)=>{},jx=(e,t,n,r)=>{const o=e._zod.def,i=Wc(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},Nx=(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},mu=(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)=>{Gc.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,ji,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ji,2)}},isEmpty:{get(){return e.issues.length===0}}})},gt=X("ZodError",Xx,{Parent:Error}),Qx=ms(gt),e0=gs(gt),t0=bo(gt),n0=wo(gt),r0=Op(gt),o0=Dp(gt),i0=Mp(gt),s0=Lp(gt),a0=Fp(gt),l0=$p(gt),c0=Bp(gt),u0=Up(gt),Fe=X("ZodType",(e,t)=>(Le.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Qr(e,"input"),output:Qr(e,"output")}}),e.toJSONSchema=vx(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=()=>Fa(e),e.exactOptional=()=>W0(e),e.nullable=()=>$a(e),e.nullish=()=>Fa($a(e)),e.nonoptional=n=>Y0(e,n),e.array=()=>ze(e),e.or=n=>Zt([e,n]),e.and=n=>F0(e,n),e.transform=n=>Ba(e,Z0(n)),e.default=n=>K0(e,n),e.prefault=n=>J0(e,n),e.catch=n=>Q0(e,n),e.pipe=n=>Ba(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)),gu=X("_ZodString",(e,t)=>{xs.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(Xr(...r)),e.max=(...r)=>e.check(uu(...r)),e.length=(...r)=>e.check(du(...r)),e.nonempty=(...r)=>e.check(Xr(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)=>{xs.init(e,t),gu.init(e,t),e.email=n=>e.check(jg(f0,n)),e.url=n=>e.check(Ig(h0,n)),e.jwt=n=>e.check(qg(N0,n)),e.emoji=n=>e.check(Rg(p0,n)),e.guid=n=>e.check(Ia(Da,n)),e.uuid=n=>e.check(Ng(Tr,n)),e.uuidv4=n=>e.check(Tg(Tr,n)),e.uuidv6=n=>e.check(Ag(Tr,n)),e.uuidv7=n=>e.check(zg(Tr,n)),e.nanoid=n=>e.check(Pg(m0,n)),e.guid=n=>e.check(Ia(Da,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(v0,n)),e.ksuid=n=>e.check(Fg(b0,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(j0,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 K(e){return Eg(d0,e)}const Ue=X("ZodStringFormat",(e,t)=>{$e.init(e,t),gu.init(e,t)}),f0=X("ZodEmail",(e,t)=>{zm.init(e,t),Ue.init(e,t)}),Da=X("ZodGUID",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),Tr=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)}),v0=X("ZodXID",(e,t)=>{Lm.init(e,t),Ue.init(e,t)}),b0=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)}),j0=X("ZodE164",(e,t)=>{Ym.init(e,t),Ue.init(e,t)}),N0=X("ZodJWT",(e,t)=>{Qm.init(e,t),Ue.init(e,t)}),xu=X("ZodNumber",(e,t)=>{iu.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>kx(e,r,o),e.gt=(r,o)=>e.check(Pa(r,o)),e.gte=(r,o)=>e.check(Yo(r,o)),e.min=(r,o)=>e.check(Yo(r,o)),e.lt=(r,o)=>e.check(Ra(r,o)),e.lte=(r,o)=>e.check(Jo(r,o)),e.max=(r,o)=>e.check(Jo(r,o)),e.int=r=>e.check(Ma(r)),e.safe=r=>e.check(Ma(r)),e.positive=r=>e.check(Pa(0,r)),e.nonnegative=r=>e.check(Yo(0,r)),e.negative=r=>e.check(Ra(0,r)),e.nonpositive=r=>e.check(Jo(0,r)),e.multipleOf=(r,o)=>e.check(Oa(r,o)),e.step=(r,o)=>e.check(Oa(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(xu,e)}const T0=X("ZodNumberFormat",(e,t)=>{eg.init(e,t),xu.init(e,t)});function Ma(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 Ye(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 Ti(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 La(){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(Xr(n,r)),e.nonempty=n=>e.check(Xr(1,n)),e.max=(n,r)=>e.check(uu(n,r)),e.length=(n,r)=>e.check(du(n,r)),e.unwrap=()=>e.element});function ze(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),Te(e,"shape",()=>t.shape),e.keyof=()=>ft(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:La()}),e.loose=()=>e.clone({...e._zod.def,catchall:La()}),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=>jp(e,n),e.merge=n=>Np(e,n),e.pick=n=>Sp(e,n),e.omit=n=>Cp(e,n),e.partial=(...n)=>Tp(vu,e,n[0]),e.required=(...n)=>Ap(bu,e,n[0])});function ie(e,t){const n={type:"object",shape:e??{},...ye(t)};return new D0(n)}const yu=X("ZodUnion",(e,t)=>{lu.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 yu({type:"union",options:e,...ye(t)})}const M0=X("ZodDiscriminatedUnion",(e,t)=>{yu.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 Ai=X("ZodEnum",(e,t)=>{dg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>jx(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 Ai({...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 Ai({...t,checks:[],...ye(o),entries:i})}});function ft(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Ai({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)=>Nx(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 Se(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 Zc(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 vu=X("ZodOptional",(e,t)=>{cu.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mu(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Fa(e){return new vu({type:"optional",innerType:e})}const V0=X("ZodExactOptional",(e,t)=>{pg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mu(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 $a(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():qc(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():qc(t)}})}const bu=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 bu({type:"nonoptional",innerType:e,...ye(t)})}const X0=X("ZodCatch",(e,t)=>{vg.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)=>{bg.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 Ba(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([K(),ve(),Ye(),Ti(),ze(Dn),$t(K(),Dn)])),ys=ie({type:K(),ttl:K().optional(),scope:K().optional()}),vs=ie({type:Se("text"),text:K(),cache_control:ys.optional()}),wu=ie({type:Se("thinking"),thinking:K(),signature:K().optional()}),ly=ie({type:Se("think"),thinking:K(),signature:K().optional()}),cy=ie({type:Se("base64"),media_type:K(),data:K()}),ku=ie({type:Se("image"),source:cy}),_u=ie({type:Se("tool_use"),id:K(),name:K(),input:$t(K(),Dn)}),uy=hn("type",[vs,ku]),dy=ie({type:Se("tool_result"),tool_use_id:K().optional(),content:Zt([K(),ze(uy)]),is_error:Ye().optional()}),fy=hn("type",[vs,wu,ku,_u,dy]),hy=Zt([K(),ze(fy)]),py=ie({role:ft(["user","assistant"]),content:hy}),my=ie({type:Se("text"),text:K(),cache_control:ys.optional()}),gy=ie({type:K(),properties:$t(K(),$t(K(),Dn)).optional(),required:ze(K()).optional(),additionalProperties:Ye().optional(),$schema:K().optional()}),xy=ie({name:K(),description:K().optional(),input_schema:gy.optional(),cache_control:ys.optional()}),yy=hn("type",[ie({type:Se("enabled"),budget_tokens:ve()}),ie({type:Se("disabled")}),ie({type:Se("adaptive")})]),vy=ie({model:K(),messages:ze(py),system:ze(my).optional(),tools:ze(xy).optional(),max_tokens:ve().optional(),temperature:ve().optional(),stream:Ye().optional(),thinking:yy.optional(),metadata:ie({user_id:K().optional()}).optional()}),bs=hn("type",[vs,wu,ly,_u]),by=ie({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=ie({id:K(),type:Se("message"),model:K(),role:Se("assistant"),content:ze(bs),stop_reason:K().nullable(),stop_sequence:K().nullable().optional(),usage:by}).passthrough(),ky=ie({type:Se("message_start"),message:ie({id:K(),type:Se("message"),model:K(),role:Se("assistant"),content:ze(bs),stop_reason:Ti(),stop_sequence:Ti(),usage:ie({input_tokens:ve(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()})}),_y=ie({type:Se("content_block_start"),index:ve(),content_block:bs}),Sy=hn("type",[ie({type:Se("text_delta"),text:K()}),ie({type:Se("input_json_delta"),partial_json:K()}),ie({type:Se("thinking_delta"),thinking:K()}),ie({type:Se("signature_delta"),signature:K()})]),Cy=ie({type:Se("content_block_delta"),index:ve(),delta:Sy}),Ey=ie({type:Se("content_block_stop"),index:ve()}),jy=ie({type:Se("message_delta"),delta:ie({stop_reason:K().nullable(),stop_sequence:K().nullable().optional()}),usage:ie({output_tokens:ve(),input_tokens:ve().optional(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()}),Ny=ie({type:Se("message_stop")}),Ty=ie({type:Se("ping")}),Ay=ie({type:Se("error"),error:ie({type:K(),message:K()})});hn("type",[ky,_y,Cy,Ey,jy,Ny,Ty,Ay]);const zy=vy,Iy=wy,Ry=Zt([K(),ze(hn("type",[ie({type:Se("text"),text:K()}),ie({type:Se("image_url"),image_url:ie({url:K(),detail:K().optional()})})]))]),Su=ie({role:ft(["system","user","assistant","tool"]),content:Ry,name:K().optional(),reasoning_content:K().optional(),thinking:K().optional(),think:K().optional()}),Py=ie({name:K(),arguments:K()}),Cu=ie({index:ve().optional(),id:K().optional(),type:Se("function").optional(),function:ie({name:K().optional(),arguments:K().optional()})});Su.extend({content:Zt([K(),ze(ie({type:Se("text"),text:K()}))]).optional(),function_call:Py.optional(),tool_calls:ze(Cu).optional()});const Oy=ie({type:Se("function"),function:ie({name:K(),description:K().optional(),parameters:$t(K(),Dn)})});ie({model:K(),messages:ze(Su),temperature:ve().optional(),max_tokens:ve().optional(),stream:Ye().optional(),tools:ze(Oy).optional(),tool_choice:Zt([ie({type:Se("auto")}),ie({type:Se("none")}),ie({type:Se("function"),function:ie({name:K()})})]).optional(),user:K().optional()});const Eu=ie({role:ft(["assistant"]).optional(),content:K().nullable().optional(),reasoning_content:K().nullable().optional(),thinking:K().nullable().optional(),think:K().nullable().optional(),function_call:ie({name:K().optional(),arguments:K().optional()}).nullable().optional(),tool_calls:ze(ie({index:ve(),id:K().optional(),type:Se("function").optional(),function:ie({name:K().optional(),arguments:K().optional()})})).nullable().optional()}),Dy=ie({index:ve(),message:ie({role:ft(["assistant"]),content:K().nullable(),reasoning_content:K().optional(),thinking:K().optional(),think:K().optional(),function_call:ie({name:K(),arguments:K()}).nullable().optional(),tool_calls:ze(Cu).optional()}).optional(),delta:Eu.optional(),finish_reason:K().nullable()}),My=ie({id:K(),object:Se("chat.completion"),created:ve(),model:K(),choices:ze(Dy),usage:ie({prompt_tokens:ve().nullable().optional(),completion_tokens:ve().nullable().optional(),total_tokens:ve().nullable().optional()}).passthrough(),service_tier:K().nullable().optional(),system_fingerprint:K().nullable().optional()}).passthrough();ie({id:K(),object:Se("chat.completion.chunk"),created:ve(),model:K(),choices:ze(ie({index:ve(),delta:Eu,finish_reason:K().nullable().optional()})),usage:ie({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 ju=ie({index:ve(),timestamp:ve(),type:K(),data:Dn}),Fy=ie({chunks:ze(ju),truncated:Ye().optional().default(!1)}),zi=ie({id:ve(),timestamp:K(),method:K(),path:K(),model:K().nullable(),sessionId:K().nullable(),rawRequestBody:K().nullable(),responseStatus:ve().nullable(),responseText:K().nullable(),inputTokens:ve().nullable(),outputTokens:ve().nullable(),cacheCreationInputTokens:ve().nullable(),cacheReadInputTokens:ve().nullable(),elapsedMs:ve().nullable(),streaming:Ye(),userAgent:K().nullable(),origin:K().nullable(),rawHeaders:$t(K(),K()).optional(),headers:$t(K(),K()).optional(),apiFormat:ft(["anthropic","openai","unknown"]).default("unknown"),isTest:Ye().optional().default(!1),providerName:K().nullable().optional(),clientPort:ve().nullable().optional(),clientPid:ve().nullable().optional(),clientCwd:K().nullable().optional(),clientProjectFolder:K().nullable().optional(),streamingChunks:Fy.optional(),streamingChunksPath:K().nullable().optional(),error:K().nullable().optional()});ie({model:K()});ie({model:K().optional(),metadata:ie({user_id:K().optional()}).passthrough().optional()});function Ii(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=ie({error:K()});async function Sn(e,t){const n=await e.json();return t.parse(n)}async function Vr(e,t){try{const n=await e.json(),r=$y.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function ws(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 Vr(o,i))}return Sn(o,t)}const Nu=ie({stripClaudeCodeBillingHeader:Ye()}),Ri="/api/config";async function By(e){return ws(e,Nu,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function Uy(e){return ws(Ri,Nu,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function Tu(){const e=Bc(Ri,By,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=gp(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(Ri,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 Ua(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Za=(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 Va=()=>{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},Wa=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(Wa(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(Wa(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},eo={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,eo),i&&r.addEventListener("scrollend",d,eo),()=>{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 ev{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 x=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;x&&(a=[x.key,this.getScrollOffset()-x.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,!(!Va()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,eo),i.addEventListener("touchend",a,eo),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();Za(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 y of this.laneAssignments.keys())y>=n&&this.laneAssignments.delete(y);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(y=>{this.itemSizeCache.set(y.key,y.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 y=this.options.gap,m=n*2;let x=this._flatMeasurements;if(!x||x.length<m){const k=new Float64Array(m);x&&h>0&&k.set(x.subarray(0,h*2)),x=k,this._flatMeasurements=x}let g;if(h===0)g=r+o;else{const k=h-1;g=x[k*2]+x[k*2+1]+y}for(let k=h;k<n;k++){const S=i(k),N=d.get(S),C=typeof N=="number"?N:this.options.estimateSize(k);x[k*2]=g,x[k*2+1]=C,g+=C+y}const b=Zy(n,x,i);return this.measurementsCache=b,b}const p=this.measurementsCache.slice(0,h),f=new Array(a).fill(void 0);for(let y=0;y<h;y++){const m=p[y];m&&(f[m.lane]=y)}for(let y=h;y<n;y++){const m=i(y),x=this.laneAssignments.get(y);let g,b;const k=l==="estimate"||d.has(m);if(x!==void 0&&this.options.lanes>1){g=x;const j=f[g],I=j!==void 0?p[j]:void 0;b=I?I.end+this.options.gap:r+o}else{const j=this.options.lanes===1?p[y-1]:this.getFurthestMeasurement(p,y);b=j?j.end+this.options.gap:r+o,g=j?j.lane:y%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(y,g)}const S=d.get(m),N=typeof S=="number"?S:this.options.estimateSize(y),C=b+N;p[y]={index:y,start:b,size:N,end:C,key:m,lane:g},f[g]=y}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?tv({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,y=((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):y&&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=Au(0,r.length-1,i?a=>o[a*2]:a=>Ua(r[a]).start,n);return Ua(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&&(Va()&&(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&&Za(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 Au=(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 tv({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=Au(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 Ha=typeof document<"u"?v.useLayoutEffect:v.useEffect;function nv({useFlushSync:e=!0,...t}){const n=v.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?yr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=v.useState(()=>new ev(r));return o.setOptions(r),Ha(()=>o._didMount(),[]),Ha(()=>o._willUpdate()),o}function zu(e){return nv({observeElementRect:qy,observeElementOffset:Jy,scrollToFn:Qy,...e})}const Iu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const rv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ov=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const qa=e=>{const t=ov(e);return t.charAt(0).toUpperCase()+t.slice(1)};var iv={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 sv=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const av=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>v.createElement("svg",{ref:l,...iv,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Iu("lucide",o),...!i&&!sv(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,d])=>v.createElement(u,d)),...Array.isArray(i)?i:[i]]));const be=(e,t)=>{const n=v.forwardRef(({className:r,...o},i)=>v.createElement(av,{ref:i,iconNode:t,className:Iu(`lucide-${rv(qa(e))}`,`lucide-${e}`,r),...o}));return n.displayName=qa(e),n};const lv=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],cv=be("arrow-down",lv);const uv=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],dv=be("arrow-up",uv);const fv=[["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"}]],hv=be("brain",fv);const pv=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vt=be("check",pv);const mv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mt=be("chevron-down",mv);const gv=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],kt=be("chevron-right",gv);const xv=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yv=be("chevron-up",xv);const vv=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],bv=be("chevrons-down",vv);const wv=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],kv=be("chevrons-up",wv);const _v=[["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"}]],pr=be("circle-alert",_v);const Sv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Cv=be("circle-check-big",Sv);const Ev=[["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"}]],jv=be("circle-question-mark",Ev);const Nv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Ru=be("circle-stop",Nv);const Tv=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_o=be("clock",Tv);const Av=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Pu=be("columns-2",Av);const zv=[["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=be("copy",zv);const Iv=[["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"}]],ks=be("download",Iv);const Rv=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],Pv=be("equal",Rv);const Ov=[["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"}]],Dv=be("external-link",Ov);const Mv=[["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"}]],_s=be("eye-off",Mv);const Lv=[["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"}]],Ss=be("eye",Lv);const Fv=[["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"}]],$v=be("file-terminal",Fv);const Bv=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Uv=be("gauge",Bv);const Zv=[["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"}]],Ou=be("git-compare-arrows",Zv);const Vv=[["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"}]],Wv=be("globe",Vv);const Hv=[["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"}]],qv=be("layout-grid",Hv);const Kv=[["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"}]],Gv=be("list",Kv);const Jv=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],to=be("loader-circle",Jv);const Yv=[["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"}]],Xv=be("lock",Yv);const Qv=[["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"}]],Du=be("message-square",Qv);const eb=[["path",{d:"M5 12h14",key:"1ays0h"}]],Cs=be("minus",eb);const tb=[["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"}]],Es=be("pencil",tb);const nb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],no=be("plus",nb);const rb=[["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"}]],ob=be("radio",rb);const ib=[["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"}]],Mu=be("rotate-ccw",ib);const sb=[["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"}]],Lu=be("rotate-cw",sb);const ab=[["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"}]],Fu=be("rows-3",ab);const lb=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],cb=be("scan",lb);const ub=[["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"}]],db=be("server",ub);const fb=[["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"}]],hb=be("settings",fb);const pb=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],$u=be("terminal",pb);const mb=[["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"}]],gb=be("trash-2",mb);const xb=[["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"}]],yb=be("triangle-alert",xb);const vb=[["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"}]],bb=be("upload",vb);const wb=[["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"}]],kb=be("user",wb);const _b=[["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"}]],Sb=be("wifi-off",_b);const Cb=[["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"}]],Eb=be("wifi",Cb);const jb=[["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"}]],Nb=be("wrench",jb);const Tb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],js=be("x",Tb);const Ab=[["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"}]],vr=be("zap",Ab);function Ar(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 Xo={exports:{}};var Ka;function zb(){return Ka||(Ka=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 Ar=="function"&&Ar;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(y){var m=r[u][1][y];return s(m||y)},f,f.exports,n,r,o,i)}return o[u].exports}for(var a=typeof Ar=="function"&&Ar,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,y,m,x=[],g=0,b=l.length,k=b,S=i.getTypeOf(l)!=="string";g<l.length;)k=b-g,h=S?(u=l[g++],d=g<b?l[g++]:0,g<b?l[g++]:0):(u=l.charCodeAt(g++),d=g<b?l.charCodeAt(g++):0,g<b?l.charCodeAt(g++):0),p=u>>2,f=(3&u)<<4|d>>4,y=1<k?(15&d)<<2|h>>6:64,m=2<k?63&h:64,x.push(a.charAt(p)+a.charAt(f)+a.charAt(y)+a.charAt(m));return x.join("")},o.decode=function(l){var u,d,h,p,f,y,m=0,x=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var b,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)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|(y=a.indexOf(l.charAt(m++))),b[x++]=u,f!==64&&(b[x++]=d),y!==64&&(b[x++]=h);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function u(d,h,p,f,y){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=y}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,y=p+h;u^=-1;for(var m=p;m<y;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,y=p+h;u^=-1;for(var m=p;m<y;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,y){var m,x="";for(m=0;m<y;m++)x+=String.fromCharCode(255&f),f>>>=8;return x}function s(f,y,m,x,g,b){var k,S,N=f.file,C=f.compression,j=b!==u.utf8encode,I=a.transformTo("string",b(N.name)),P=a.transformTo("string",u.utf8encode(N.name)),M=N.comment,U=a.transformTo("string",b(M)),E=a.transformTo("string",u.utf8encode(M)),D=P.length!==N.name.length,w=E.length!==M.length,O="",J="",W="",q=N.dir,Y=N.date,T={crc32:0,compressedSize:0,uncompressedSize:0};y&&!m||(T.crc32=f.crc32,T.compressedSize=f.compressedSize,T.uncompressedSize=f.uncompressedSize);var F=0;y&&(F|=8),j||!D&&!w||(F|=2048);var $=0,A=0;q&&($|=16),g==="UNIX"?(A=798,$|=(function(G,le){var Q=G;return G||(Q=le?16893:33204),(65535&Q)<<16})(N.unixPermissions,q)):(A=20,$|=(function(G){return 63&(G||0)})(N.dosPermissions)),k=Y.getUTCHours(),k<<=6,k|=Y.getUTCMinutes(),k<<=5,k|=Y.getUTCSeconds()/2,S=Y.getUTCFullYear()-1980,S<<=4,S|=Y.getUTCMonth()+1,S<<=5,S|=Y.getUTCDate(),D&&(J=i(1,1)+i(d(I),4)+P,O+="up"+i(J.length,2)+J),w&&(W=i(1,1)+i(d(U),4)+E,O+="uc"+i(W.length,2)+W);var te="";return te+=`
|
|
40
|
+
\0`,te+=i(F,2),te+=C.magic,te+=i(k,2),te+=i(S,2),te+=i(T.crc32,4),te+=i(T.compressedSize,4),te+=i(T.uncompressedSize,4),te+=i(I.length,2),te+=i(O.length,2),{fileRecord:h.LOCAL_FILE_HEADER+te+I+O,dirRecord:h.CENTRAL_FILE_HEADER+i(A,2)+te+i(U.length,2)+"\0\0\0\0"+i($,4)+i(x,4)+I+O+U}}var a=n("../utils"),l=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(f,y,m,x){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=m,this.encodeFileName=x,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 y=f.meta.percent||0,m=this.entriesCount,x=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?(y+100*(m-x-1))/m:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var y=this.streamFiles&&!f.file.dir;if(y){var m=s(f,y,!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 y=this.streamFiles&&!f.file.dir,m=s(f,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),y)this.push({data:(function(x){return h.DATA_DESCRIPTOR+i(x.crc32,4)+i(x.compressedSize,4)+i(x.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,y=0;y<this.dirRecords.length;y++)this.push({data:this.dirRecords[y],meta:{percent:100}});var m=this.bytesWritten-f,x=(function(g,b,k,S,N){var C=a.transformTo("string",N(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(b,4)+i(k,4)+i(C.length,2)+C})(this.dirRecords.length,m,f,this.zipComment,this.encodeFileName);this.push({data:x,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 y=this;return f.on("data",function(m){y.processChunk(m)}),f.on("end",function(){y.closedSource(y.previous.streamInfo),y._sources.length?y.prepareNextSource():y.end()}),f.on("error",function(m){y.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 y=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var m=0;m<y.length;m++)try{y[m].error(f)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,y=0;y<f.length;y++)f[y].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 y=(function(b,k){var S=b||k,N=i[S];if(!N)throw new Error(S+" is not a valid compression method !");return N})(f.options.compression,l.compression),m=f.options.compressionOptions||l.compressionOptions||{},x=f.dir,g=f.date;f._compressWorker(y,m).withStreamInfo("file",{name:p,dir:x,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,y){var m=p.decompressed.getContentWorker().pipe(new u);m.on("error",function(x){y(x)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var y=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 x=new l(f);return x.load(m),x}).then(function(m){var x=[s.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var b=0;b<g.length;b++)x.push(h(g[b]));return s.Promise.all(x)}).then(function(m){for(var x=m.shift(),g=x.files,b=0;b<g.length;b++){var k=g[b],S=k.fileNameStr,N=i.resolve(k.fileNameStr);y.file(N,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(y.file(N).unsafeOriginalName=S)}return x.zipComment.length&&(y.comment=x.zipComment),y})}},{"./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(N,C,j){var I,P=a.getTypeOf(C),M=a.extend(j||{},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&&(N=g(N)),M.createFolders&&(I=x(N))&&b.call(this,I,!0);var U=P==="string"&&M.binary===!1&&M.base64===!1;j&&j.binary!==void 0||(M.binary=!U),(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 E=null;E=C instanceof h||C instanceof l?C:y.isNode&&y.isStream(C)?new m(N,C):a.prepareContent(N,C,M.binary,M.optimizedBinaryString,M.base64);var D=new p(N,E,M);this.files[N]=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"),y=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),x=function(N){N.slice(-1)==="/"&&(N=N.substring(0,N.length-1));var C=N.lastIndexOf("/");return 0<C?N.substring(0,C):""},g=function(N){return N.slice(-1)!=="/"&&(N+="/"),N},b=function(N,C){return C=C!==void 0?C:d.createFolders,N=g(N),this.files[N]||i.call(this,N,null,{dir:!0,createFolders:C}),this.files[N]};function k(N){return Object.prototype.toString.call(N)==="[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(N){var C,j,I;for(C in this.files)I=this.files[C],(j=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&N(j,I)},filter:function(N){var C=[];return this.forEach(function(j,I){N(j,I)&&C.push(I)}),C},file:function(N,C,j){if(arguments.length!==1)return N=this.root+N,i.call(this,N,C,j),this;if(k(N)){var I=N;return this.filter(function(M,U){return!U.dir&&I.test(M)})}var P=this.files[this.root+N];return P&&!P.dir?P:null},folder:function(N){if(!N)return this;if(k(N))return this.filter(function(P,M){return M.dir&&N.test(P)});var C=this.root+N,j=b.call(this,C),I=this.clone();return I.root=j.name,I},remove:function(N){N=this.root+N;var C=this.files[N];if(C||(N.slice(-1)!=="/"&&(N+="/"),C=this.files[N]),C&&!C.dir)delete this.files[N];else for(var j=this.filter(function(P,M){return M.name.slice(0,N.length)===N}),I=0;I<j.length;I++)delete this.files[j[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(N){var C,j={};try{if((j=a.extend(N||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=j.type.toLowerCase(),j.compression=j.compression.toUpperCase(),j.type==="binarystring"&&(j.type="string"),!j.type)throw new Error("No output type specified.");a.checkSupport(j.type),j.platform!=="darwin"&&j.platform!=="freebsd"&&j.platform!=="linux"&&j.platform!=="sunos"||(j.platform="UNIX"),j.platform==="win32"&&(j.platform="DOS");var I=j.comment||this.comment||"";C=f.generateWorker(this,j,I)}catch(P){(C=new l("error")).error(P)}return new u(C,j.type||"string",j.mimeType)},generateAsync:function(N,C){return this.generateInternalStream(N).accumulate(C)},generateNodeStream:function(N,C){return(N=N||{}).type||(N.type="nodebuffer"),this.generateInternalStream(N).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(y,m){return new d.Promise(function(x,g){var b=[],k=y._internalType,S=y._outputType,N=y._mimeType;y.on("data",function(C,j){b.push(C),m&&m(j)}).on("error",function(C){b=[],g(C)}).on("end",function(){try{var C=(function(j,I,P){switch(j){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),P);case"base64":return l.encode(I);default:return i.transformTo(j,I)}})(S,(function(j,I){var P,M=0,U=null,E=0;for(P=0;P<I.length;P++)E+=I[P].length;switch(j){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(U=new Uint8Array(E),P=0;P<I.length;P++)U.set(I[P],M),M+=I[P].length;return U;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+j+"'")}})(k,b),N);x(C)}catch(j){g(j)}b=[]}).resume()})}function f(y,m,x){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=x,i.checkSupport(g),this._worker=y.pipe(new s(g)),y.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}f.prototype={accumulate:function(y){return p(this,y)},on:function(y,m){var x=this;return y==="data"?this._worker.on(y,function(g){m.call(x,g.data,g.meta)}):this._worker.on(y,function(){i.delay(m,arguments,x)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(y){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"},y)}},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(y){var m,x,g,b,k,S=y.length,N=0;for(b=0;b<S;b++)(64512&(x=y.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=y.charCodeAt(b+1)))==56320&&(x=65536+(x-55296<<10)+(g-56320),b++),N+=x<128?1:x<2048?2:x<65536?3:4;for(m=s.uint8array?new Uint8Array(N):new Array(N),b=k=0;k<N;b++)(64512&(x=y.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=y.charCodeAt(b+1)))==56320&&(x=65536+(x-55296<<10)+(g-56320),b++),x<128?m[k++]=x:(x<2048?m[k++]=192|x>>>6:(x<65536?m[k++]=224|x>>>12:(m[k++]=240|x>>>18,m[k++]=128|x>>>12&63),m[k++]=128|x>>>6&63),m[k++]=128|63&x);return m})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(y){var m,x,g,b,k=y.length,S=new Array(2*k);for(m=x=0;m<k;)if((g=y[m++])<128)S[x++]=g;else if(4<(b=u[g]))S[x++]=65533,m+=b-1;else{for(g&=b===2?31:b===3?15:7;1<b&&m<k;)g=g<<6|63&y[m++],b--;1<b?S[x++]=65533:g<65536?S[x++]=g:(g-=65536,S[x++]=55296|g>>10&1023,S[x++]=56320|1023&g)}return S.length!==x&&(S.subarray?S=S.subarray(0,x):S.length=x),i.applyFromCharCode(S)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(h,l),h.prototype.processChunk=function(f){var y=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=y;(y=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),y.set(m,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var x=(function(b,k){var S;for((k=k||b.length)>b.length&&(k=b.length),S=k-1;0<=S&&(192&b[S])==128;)S--;return S<0||S===0?k:S+u[b[S]]>k?S:k})(y),g=y;x!==y.length&&(s.uint8array?(g=y.subarray(0,x),this.leftOver=y.subarray(x,y.length)):(g=y.slice(0,x),this.leftOver=y.slice(x,y.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,x){for(var g=0;g<m.length;++g)x[g]=255&m.charCodeAt(g);return x}n("setimmediate"),o.newBlob=function(m,x){o.checkSupport("blob");try{return new Blob([m],{type:x})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,x,g){var b=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)x==="array"||x==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):b.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return b.join("")},stringifyByChar:function(m){for(var x="",g=0;g<m.length;g++)x+=String.fromCharCode(m[g]);return x},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 x=65536,g=o.getTypeOf(m),b=!0;if(g==="uint8array"?b=h.applyCanBeUsed.uint8array:g==="nodebuffer"&&(b=h.applyCanBeUsed.nodebuffer),b)for(;1<x;)try{return h.stringifyByChunk(m,g,x)}catch{x=Math.floor(x/2)}return h.stringifyByChar(m)}function f(m,x){for(var g=0;g<m.length;g++)x[g]=m[g];return x}o.applyFromCharCode=p;var y={};y.string={string:u,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return y.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,a.allocBuffer(m.length))}},y.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)}},y.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))}},y.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)}},y.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return y.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:u},o.transformTo=function(m,x){if(x=x||"",!m)return x;o.checkSupport(m);var g=o.getTypeOf(x);return y[g][m](x)},o.resolve=function(m){for(var x=m.split("/"),g=[],b=0;b<x.length;b++){var k=x[b];k==="."||k===""&&b!==0&&b!==x.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var x,g,b="";for(g=0;g<(m||"").length;g++)b+="\\x"+((x=m.charCodeAt(g))<16?"0":"")+x.toString(16).toUpperCase();return b},o.delay=function(m,x,g){setImmediate(function(){m.apply(g||null,x||[])})},o.inherits=function(m,x){function g(){}g.prototype=x.prototype,m.prototype=new g},o.extend=function(){var m,x,g={};for(m=0;m<arguments.length;m++)for(x in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],x)&&g[x]===void 0&&(g[x]=arguments[m][x]);return g},o.prepareContent=function(m,x,g,b,k){return l.Promise.resolve(x).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(N,C){var j=new FileReader;j.onload=function(I){N(I.target.result)},j.onerror=function(I){C(I.target.error)},j.readAsArrayBuffer(S)}):S}).then(function(S){var N=o.getTypeOf(S);return N?(N==="arraybuffer"?S=o.transformTo("uint8array",S):N==="string"&&(k?S=s.decode(S):g&&b!==!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 y=this.reader.readString(4)===p;return this.reader.setIndex(f),y},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,y=this.zip64EndOfCentralSize-44;0<y;)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 y=p-f;if(0<y)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=y);else if(y<0)throw new Error("Corrupted zip: missing "+Math.abs(y)+" 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,y){this.options=f,this.loadOptions=y}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var y,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((y=(function(x){for(var g in d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===x)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,y,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 y=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(y),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 y,m,x,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)y=f.readInt(2),m=f.readInt(2),x=f.readData(m),this.extraFields[y]={id:y,length:m,value:x};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 y=this.findExtraFieldUnicodePath();if(y!==null)this.fileNameStr=y;else{var m=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var y=i(f.value);return y.readInt(1)!==1||l(this.fileName)!==y.readInt(4)?null:u.utf8decode(y.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var y=i(f.value);return y.readInt(1)!==1||l(this.fileComment)!==y.readInt(4)?null:u.utf8decode(y.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(y,m,x){this.name=y,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=m,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),u=n("./compressedObject"),d=n("./stream/GenericWorker");i.prototype={internalStream:function(y){var m=null,x="string";try{if(!y)throw new Error("No output type specified.");var g=(x=y.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!b&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new d("error")).error(k)}return new s(m,x,"")},async:function(y,m){return this.internalStream(y).accumulate(m)},nodeStream:function(y,m){return this.internalStream(y||"nodebuffer").toNodejsStream(m)},_compressWorker:function(y,m){if(this._data instanceof u&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new l.Utf8EncodeWorker)),u.createWorkerFrom(x,y,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(y),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(){y(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(y,0)};else{var p=new i.MessageChannel;p.port1.onmessage=y,s=function(){p.port2.postMessage(0)}}var f=[];function y(){var m,x;a=!0;for(var g=f.length;g;){for(x=f,f=[],m=-1;++m<g;)x[m]();g=f.length}a=!1}r.exports=function(m){f.push(m)!==1||a||s()}}).call(this,typeof Er<"u"?Er: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,b,k){this.promise=g,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,b,k){i(function(){var S;try{S=b(k)}catch(N){return a.reject(g,N)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function y(g){var b=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof b=="function")return function(){b.apply(g,arguments)}}function m(g,b){var k=!1;function S(j){k||(k=!0,a.reject(g,j))}function N(j){k||(k=!0,a.resolve(g,j))}var C=x(function(){b(N,S)});C.status==="error"&&S(C.value)}function x(g,b){var k={};try{k.value=g(b),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=h).prototype.finally=function(g){if(typeof g!="function")return this;var b=this.constructor;return this.then(function(k){return b.resolve(g()).then(function(){return k})},function(k){return b.resolve(g()).then(function(){throw k})})},h.prototype.catch=function(g){return this.then(null,g)},h.prototype.then=function(g,b){if(typeof g!="function"&&this.state===u||typeof b!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?f(k,this.state===u?g:b,this.outcome):this.queue.push(new p(k,g,b)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){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,b){var k=x(y,b);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=u,g.outcome=b;for(var N=-1,C=g.queue.length;++N<C;)g.queue[N].callFulfilled(b)}return g},a.reject=function(g,b){g.state=l,g.outcome=b;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(b);return g},h.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},h.reject=function(g){var b=new this(s);return a.reject(b,g)},h.all=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var N=new Array(k),C=0,j=-1,I=new this(s);++j<k;)P(g[j],j);return I;function P(M,U){b.resolve(M).then(function(E){N[U]=E,++C!==k||S||(S=!0,a.resolve(I,N))},function(E){S||(S=!0,a.reject(I,E))})}},h.race=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var N=-1,C=new this(s);++N<k;)j=g[N],b.resolve(j).then(function(I){S||(S=!0,a.resolve(C,I))},function(I){S||(S=!0,a.reject(C,I))});var j;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,y=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(k!==h)throw new Error(l[k]);if(b.header&&i.deflateSetHeader(this.strm,b.header),b.dictionary){var S;if(S=typeof b.dictionary=="string"?a.string2buf(b.dictionary):d.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[k]);this._dict_set=!0}}function x(g,b){var k=new m(b);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,b){var k,S,N=this.strm,C=this.options.chunkSize;if(this.ended)return!1;S=b===~~b?b:b===!0?4:0,typeof g=="string"?N.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?N.input=new Uint8Array(g):N.input=g,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new s.Buf8(C),N.next_out=0,N.avail_out=C),(k=i.deflate(N,S))!==1&&k!==h)return this.onEnd(k),!(this.ended=!0);N.avail_out!==0&&(N.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(N.output,N.next_out))):this.onData(s.shrinkBuf(N.output,N.next_out)))}while((0<N.avail_in||N.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===h):S!==2||(this.onEnd(h),!(N.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=x,o.deflateRaw=function(g,b){return(b=b||{}).raw=!0,x(g,b)},o.gzip=function(g,b){return(b=b||{}).gzip=!0,x(g,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),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 x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||m&&m.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&(15&x.windowBits)==0&&(x.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,x.windowBits);if(g!==l.Z_OK)throw new Error(u[g]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function y(m,x){var g=new f(x);if(g.push(m,!0),g.err)throw g.msg||u[g.err];return g.result}f.prototype.push=function(m,x){var g,b,k,S,N,C,j=this.strm,I=this.options.chunkSize,P=this.options.dictionary,M=!1;if(this.ended)return!1;b=x===~~x?x:x===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?j.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?j.input=new Uint8Array(m):j.input=m,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new s.Buf8(I),j.next_out=0,j.avail_out=I),(g=i.inflate(j,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);j.next_out&&(j.avail_out!==0&&g!==l.Z_STREAM_END&&(j.avail_in!==0||b!==l.Z_FINISH&&b!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(j.output,j.next_out),S=j.next_out-k,N=a.buf2string(j.output,k),j.next_out=S,j.avail_out=I-S,S&&s.arraySet(j.output,j.output,k,S,0),this.onData(N)):this.onData(s.shrinkBuf(j.output,j.next_out)))),j.avail_in===0&&j.avail_out===0&&(M=!0)}while((0<j.avail_in||j.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(b=l.Z_FINISH),b===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):b!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(j.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=y,o.inflateRaw=function(m,x){return(x=x||{}).raw=!0,y(m,x)},o.ungzip=y},{"./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,y;for(u=h=0,d=l.length;u<d;u++)h+=l[u].length;for(y=new Uint8Array(h),u=p=0,d=l.length;u<d;u++)f=l[u],y.set(f,p),p+=f.length;return y}},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="",y=0;y<p;y++)f+=String.fromCharCode(h[y]);return f}l[254]=l[254]=1,o.string2buf=function(h){var p,f,y,m,x,g=h.length,b=0;for(m=0;m<g;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(y=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(y-56320),m++),b+=f<128?1:f<2048?2:f<65536?3:4;for(p=new i.Buf8(b),m=x=0;x<b;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(y=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(y-56320),m++),f<128?p[x++]=f:(f<2048?p[x++]=192|f>>>6:(f<65536?p[x++]=224|f>>>12:(p[x++]=240|f>>>18,p[x++]=128|f>>>12&63),p[x++]=128|f>>>6&63),p[x++]=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,y=p.length;f<y;f++)p[f]=h.charCodeAt(f);return p},o.buf2string=function(h,p){var f,y,m,x,g=p||h.length,b=new Array(2*g);for(f=y=0;f<g;)if((m=h[f++])<128)b[y++]=m;else if(4<(x=l[m]))b[y++]=65533,f+=x-1;else{for(m&=x===2?31:x===3?15:7;1<x&&f<g;)m=m<<6|63&h[f++],x--;1<x?b[y++]=65533:m<65536?b[y++]=m:(m-=65536,b[y++]=55296|m>>10&1023,b[y++]=56320|1023&m)}return d(b,y)},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,y=-2,m=-1,x=4,g=2,b=8,k=9,S=286,N=30,C=19,j=2*S+1,I=15,P=3,M=258,U=M+P+1,E=42,D=113,w=1,O=2,J=3,W=4;function q(_,Z){return _.msg=d[Z],Z}function Y(_){return(_<<1)-(4<_?9:0)}function T(_){for(var Z=_.length;0<=--Z;)_[Z]=0}function F(_){var Z=_.state,B=Z.pending;B>_.avail_out&&(B=_.avail_out),B!==0&&(s.arraySet(_.output,Z.pending_buf,Z.pending_out,B,_.next_out),_.next_out+=B,Z.pending_out+=B,_.total_out+=B,_.avail_out-=B,Z.pending-=B,Z.pending===0&&(Z.pending_out=0))}function $(_,Z){a._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,Z),_.block_start=_.strstart,F(_.strm)}function A(_,Z){_.pending_buf[_.pending++]=Z}function te(_,Z){_.pending_buf[_.pending++]=Z>>>8&255,_.pending_buf[_.pending++]=255&Z}function G(_,Z){var B,R,z=_.max_chain_length,L=_.strstart,ee=_.prev_length,re=_.nice_match,H=_.strstart>_.w_size-U?_.strstart-(_.w_size-U):0,se=_.window,fe=_.w_mask,ae=_.prev,V=_.strstart+M,ne=se[L+ee-1],ue=se[L+ee];_.prev_length>=_.good_match&&(z>>=2),re>_.lookahead&&(re=_.lookahead);do if(se[(B=Z)+ee]===ue&&se[B+ee-1]===ne&&se[B]===se[L]&&se[++B]===se[L+1]){L+=2,B++;do;while(se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&se[++L]===se[++B]&&L<V);if(R=M-(V-L),L=V-M,ee<R){if(_.match_start=Z,re<=(ee=R))break;ne=se[L+ee-1],ue=se[L+ee]}}while((Z=ae[Z&fe])>H&&--z!=0);return ee<=_.lookahead?ee:_.lookahead}function le(_){var Z,B,R,z,L,ee,re,H,se,fe,ae=_.w_size;do{if(z=_.window_size-_.lookahead-_.strstart,_.strstart>=ae+(ae-U)){for(s.arraySet(_.window,_.window,ae,ae,0),_.match_start-=ae,_.strstart-=ae,_.block_start-=ae,Z=B=_.hash_size;R=_.head[--Z],_.head[Z]=ae<=R?R-ae:0,--B;);for(Z=B=ae;R=_.prev[--Z],_.prev[Z]=ae<=R?R-ae:0,--B;);z+=ae}if(_.strm.avail_in===0)break;if(ee=_.strm,re=_.window,H=_.strstart+_.lookahead,se=z,fe=void 0,fe=ee.avail_in,se<fe&&(fe=se),B=fe===0?0:(ee.avail_in-=fe,s.arraySet(re,ee.input,ee.next_in,fe,H),ee.state.wrap===1?ee.adler=l(ee.adler,re,fe,H):ee.state.wrap===2&&(ee.adler=u(ee.adler,re,fe,H)),ee.next_in+=fe,ee.total_in+=fe,fe),_.lookahead+=B,_.lookahead+_.insert>=P)for(L=_.strstart-_.insert,_.ins_h=_.window[L],_.ins_h=(_.ins_h<<_.hash_shift^_.window[L+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[L+P-1])&_.hash_mask,_.prev[L&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=L,L++,_.insert--,!(_.lookahead+_.insert<P)););}while(_.lookahead<U&&_.strm.avail_in!==0)}function Q(_,Z){for(var B,R;;){if(_.lookahead<U){if(le(_),_.lookahead<U&&Z===h)return w;if(_.lookahead===0)break}if(B=0,_.lookahead>=P&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),B!==0&&_.strstart-B<=_.w_size-U&&(_.match_length=G(_,B)),_.match_length>=P)if(R=a._tr_tally(_,_.strstart-_.match_start,_.match_length-P),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=P){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else R=a._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(R&&($(_,!1),_.strm.avail_out===0))return w}return _.insert=_.strstart<P-1?_.strstart:P-1,Z===p?($(_,!0),_.strm.avail_out===0?J:W):_.last_lit&&($(_,!1),_.strm.avail_out===0)?w:O}function ce(_,Z){for(var B,R,z;;){if(_.lookahead<U){if(le(_),_.lookahead<U&&Z===h)return w;if(_.lookahead===0)break}if(B=0,_.lookahead>=P&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=P-1,B!==0&&_.prev_length<_.max_lazy_match&&_.strstart-B<=_.w_size-U&&(_.match_length=G(_,B),_.match_length<=5&&(_.strategy===1||_.match_length===P&&4096<_.strstart-_.match_start)&&(_.match_length=P-1)),_.prev_length>=P&&_.match_length<=_.prev_length){for(z=_.strstart+_.lookahead-P,R=a._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-P),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+P-1])&_.hash_mask,B=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=P-1,_.strstart++,R&&($(_,!1),_.strm.avail_out===0))return w}else if(_.match_available){if((R=a._tr_tally(_,0,_.window[_.strstart-1]))&&$(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return w}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(R=a._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<P-1?_.strstart:P-1,Z===p?($(_,!0),_.strm.avail_out===0?J:W):_.last_lit&&($(_,!1),_.strm.avail_out===0)?w:O}function de(_,Z,B,R,z){this.good_length=_,this.max_lazy=Z,this.nice_length=B,this.max_chain=R,this.func=z}function ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*j),this.dyn_dtree=new s.Buf16(2*(2*N+1)),this.bl_tree=new s.Buf16(2*(2*C+1)),T(this.dyn_ltree),T(this.dyn_dtree),T(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),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),T(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(_){var Z;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=g,(Z=_.state).pending=0,Z.pending_out=0,Z.wrap<0&&(Z.wrap=-Z.wrap),Z.status=Z.wrap?E:D,_.adler=Z.wrap===2?0:1,Z.last_flush=h,a._tr_init(Z),f):q(_,y)}function je(_){var Z=xe(_);return Z===f&&(function(B){B.window_size=2*B.w_size,T(B.head),B.max_lazy_match=i[B.level].max_lazy,B.good_match=i[B.level].good_length,B.nice_match=i[B.level].nice_length,B.max_chain_length=i[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=P-1,B.match_available=0,B.ins_h=0})(_.state),Z}function Oe(_,Z,B,R,z,L){if(!_)return y;var ee=1;if(Z===m&&(Z=6),R<0?(ee=0,R=-R):15<R&&(ee=2,R-=16),z<1||k<z||B!==b||R<8||15<R||Z<0||9<Z||L<0||x<L)return q(_,y);R===8&&(R=9);var re=new ge;return(_.state=re).strm=_,re.wrap=ee,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=Z,re.strategy=L,re.method=B,je(_)}i=[new de(0,0,0,0,function(_,Z){var B=65535;for(B>_.pending_buf_size-5&&(B=_.pending_buf_size-5);;){if(_.lookahead<=1){if(le(_),_.lookahead===0&&Z===h)return w;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var R=_.block_start+B;if((_.strstart===0||_.strstart>=R)&&(_.lookahead=_.strstart-R,_.strstart=R,$(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-U&&($(_,!1),_.strm.avail_out===0))return w}return _.insert=0,Z===p?($(_,!0),_.strm.avail_out===0?J:W):(_.strstart>_.block_start&&($(_,!1),_.strm.avail_out),w)}),new de(4,4,8,4,Q),new de(4,5,16,8,Q),new de(4,6,32,32,Q),new de(4,4,16,16,ce),new de(8,16,32,32,ce),new de(8,16,128,128,ce),new de(8,32,128,256,ce),new de(32,128,258,1024,ce),new de(32,258,258,4096,ce)],o.deflateInit=function(_,Z){return Oe(_,Z,b,15,8,0)},o.deflateInit2=Oe,o.deflateReset=je,o.deflateResetKeep=xe,o.deflateSetHeader=function(_,Z){return _&&_.state?_.state.wrap!==2?y:(_.state.gzhead=Z,f):y},o.deflate=function(_,Z){var B,R,z,L;if(!_||!_.state||5<Z||Z<0)return _?q(_,y):y;if(R=_.state,!_.output||!_.input&&_.avail_in!==0||R.status===666&&Z!==p)return q(_,_.avail_out===0?-5:y);if(R.strm=_,B=R.last_flush,R.last_flush=Z,R.status===E)if(R.wrap===2)_.adler=0,A(R,31),A(R,139),A(R,8),R.gzhead?(A(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)),A(R,255&R.gzhead.time),A(R,R.gzhead.time>>8&255),A(R,R.gzhead.time>>16&255),A(R,R.gzhead.time>>24&255),A(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),A(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(A(R,255&R.gzhead.extra.length),A(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(_.adler=u(_.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(A(R,0),A(R,0),A(R,0),A(R,0),A(R,0),A(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),A(R,3),R.status=D);else{var ee=b+(R.w_bits-8<<4)<<8;ee|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(ee|=32),ee+=31-ee%31,R.status=D,te(R,ee),R.strstart!==0&&(te(R,_.adler>>>16),te(R,65535&_.adler)),_.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&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),F(_),z=R.pending,R.pending!==R.pending_buf_size));)A(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>z&&(_.adler=u(_.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&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),F(_),z=R.pending,R.pending===R.pending_buf_size)){L=1;break}L=R.gzindex<R.gzhead.name.length?255&R.gzhead.name.charCodeAt(R.gzindex++):0,A(R,L)}while(L!==0);R.gzhead.hcrc&&R.pending>z&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),L===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&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),F(_),z=R.pending,R.pending===R.pending_buf_size)){L=1;break}L=R.gzindex<R.gzhead.comment.length?255&R.gzhead.comment.charCodeAt(R.gzindex++):0,A(R,L)}while(L!==0);R.gzhead.hcrc&&R.pending>z&&(_.adler=u(_.adler,R.pending_buf,R.pending-z,z)),L===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&F(_),R.pending+2<=R.pending_buf_size&&(A(R,255&_.adler),A(R,_.adler>>8&255),_.adler=0,R.status=D)):R.status=D),R.pending!==0){if(F(_),_.avail_out===0)return R.last_flush=-1,f}else if(_.avail_in===0&&Y(Z)<=Y(B)&&Z!==p)return q(_,-5);if(R.status===666&&_.avail_in!==0)return q(_,-5);if(_.avail_in!==0||R.lookahead!==0||Z!==h&&R.status!==666){var re=R.strategy===2?(function(H,se){for(var fe;;){if(H.lookahead===0&&(le(H),H.lookahead===0)){if(se===h)return w;break}if(H.match_length=0,fe=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++,fe&&($(H,!1),H.strm.avail_out===0))return w}return H.insert=0,se===p?($(H,!0),H.strm.avail_out===0?J:W):H.last_lit&&($(H,!1),H.strm.avail_out===0)?w:O})(R,Z):R.strategy===3?(function(H,se){for(var fe,ae,V,ne,ue=H.window;;){if(H.lookahead<=M){if(le(H),H.lookahead<=M&&se===h)return w;if(H.lookahead===0)break}if(H.match_length=0,H.lookahead>=P&&0<H.strstart&&(ae=ue[V=H.strstart-1])===ue[++V]&&ae===ue[++V]&&ae===ue[++V]){ne=H.strstart+M;do;while(ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&ae===ue[++V]&&V<ne);H.match_length=M-(ne-V),H.match_length>H.lookahead&&(H.match_length=H.lookahead)}if(H.match_length>=P?(fe=a._tr_tally(H,1,H.match_length-P),H.lookahead-=H.match_length,H.strstart+=H.match_length,H.match_length=0):(fe=a._tr_tally(H,0,H.window[H.strstart]),H.lookahead--,H.strstart++),fe&&($(H,!1),H.strm.avail_out===0))return w}return H.insert=0,se===p?($(H,!0),H.strm.avail_out===0?J:W):H.last_lit&&($(H,!1),H.strm.avail_out===0)?w:O})(R,Z):i[R.level].func(R,Z);if(re!==J&&re!==W||(R.status=666),re===w||re===J)return _.avail_out===0&&(R.last_flush=-1),f;if(re===O&&(Z===1?a._tr_align(R):Z!==5&&(a._tr_stored_block(R,0,0,!1),Z===3&&(T(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),F(_),_.avail_out===0))return R.last_flush=-1,f}return Z!==p?f:R.wrap<=0?1:(R.wrap===2?(A(R,255&_.adler),A(R,_.adler>>8&255),A(R,_.adler>>16&255),A(R,_.adler>>24&255),A(R,255&_.total_in),A(R,_.total_in>>8&255),A(R,_.total_in>>16&255),A(R,_.total_in>>24&255)):(te(R,_.adler>>>16),te(R,65535&_.adler)),F(_),0<R.wrap&&(R.wrap=-R.wrap),R.pending!==0?f:1)},o.deflateEnd=function(_){var Z;return _&&_.state?(Z=_.state.status)!==E&&Z!==69&&Z!==73&&Z!==91&&Z!==103&&Z!==D&&Z!==666?q(_,y):(_.state=null,Z===D?q(_,-3):f):y},o.deflateSetDictionary=function(_,Z){var B,R,z,L,ee,re,H,se,fe=Z.length;if(!_||!_.state||(L=(B=_.state).wrap)===2||L===1&&B.status!==E||B.lookahead)return y;for(L===1&&(_.adler=l(_.adler,Z,fe,0)),B.wrap=0,fe>=B.w_size&&(L===0&&(T(B.head),B.strstart=0,B.block_start=0,B.insert=0),se=new s.Buf8(B.w_size),s.arraySet(se,Z,fe-B.w_size,B.w_size,0),Z=se,fe=B.w_size),ee=_.avail_in,re=_.next_in,H=_.input,_.avail_in=fe,_.next_in=0,_.input=Z,le(B);B.lookahead>=P;){for(R=B.strstart,z=B.lookahead-(P-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[R+P-1])&B.hash_mask,B.prev[R&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=R,R++,--z;);B.strstart=R,B.lookahead=P-1,le(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=P-1,B.match_available=0,_.next_in=re,_.input=H,_.avail_in=ee,B.wrap=L,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,y,m,x,g,b,k,S,N,C,j,I,P,M,U,E,D,w,O;a=i.state,l=i.next_in,w=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,y=a.wsize,m=a.whave,x=a.wnext,g=a.window,b=a.hold,k=a.bits,S=a.lencode,N=a.distcode,C=(1<<a.lenbits)-1,j=(1<<a.distbits)-1;e:do{k<15&&(b+=w[l++]<<k,k+=8,b+=w[l++]<<k,k+=8),I=S[b&C];t:for(;;){if(b>>>=P=I>>>24,k-=P,(P=I>>>16&255)===0)O[d++]=65535&I;else{if(!(16&P)){if((64&P)==0){I=S[(65535&I)+(b&(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)&&(k<P&&(b+=w[l++]<<k,k+=8),M+=b&(1<<P)-1,b>>>=P,k-=P),k<15&&(b+=w[l++]<<k,k+=8,b+=w[l++]<<k,k+=8),I=N[b&j];n:for(;;){if(b>>>=P=I>>>24,k-=P,!(16&(P=I>>>16&255))){if((64&P)==0){I=N[(65535&I)+(b&(1<<P)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(U=65535&I,k<(P&=15)&&(b+=w[l++]<<k,(k+=8)<P&&(b+=w[l++]<<k,k+=8)),f<(U+=b&(1<<P)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=P,k-=P,(P=d-h)<U){if(m<(P=U-P)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(D=g,(E=0)===x){if(E+=y-P,P<M){for(M-=P;O[d++]=g[E++],--P;);E=d-U,D=O}}else if(x<P){if(E+=y+x-P,(P-=x)<M){for(M-=P;O[d++]=g[E++],--P;);if(E=0,x<M){for(M-=P=x;O[d++]=g[E++],--P;);E=d-U,D=O}}}else if(E+=x-P,P<M){for(M-=P;O[d++]=g[E++],--P;);E=d-U,D=O}for(;2<M;)O[d++]=D[E++],O[d++]=D[E++],O[d++]=D[E++],M-=3;M&&(O[d++]=D[E++],1<M&&(O[d++]=D[E++]))}else{for(E=d-U;O[d++]=O[E++],O[d++]=O[E++],O[d++]=O[E++],2<(M-=3););M&&(O[d++]=O[E++],1<M&&(O[d++]=O[E++]))}break}}break}}while(l<u&&d<p);l-=M=k>>3,b&=(1<<(k-=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=b,a.bits=k}},{}],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,y=1,m=852,x=592;function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var D;return E&&E.state?(D=E.state,E.total_in=E.total_out=D.total=0,E.msg="",D.wrap&&(E.adler=1&D.wrap),D.mode=y,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(x),D.sane=1,D.back=-1,p):f}function S(E){var D;return E&&E.state?((D=E.state).wsize=0,D.whave=0,D.wnext=0,k(E)):f}function N(E,D){var w,O;return E&&E.state?(O=E.state,D<0?(w=0,D=-D):(w=1+(D>>4),D<48&&(D&=15)),D&&(D<8||15<D)?f:(O.window!==null&&O.wbits!==D&&(O.window=null),O.wrap=w,O.wbits=D,S(E))):f}function C(E,D){var w,O;return E?(O=new b,(E.state=O).window=null,(w=N(E,D))!==p&&(E.state=null),w):f}var j,I,P=!0;function M(E){if(P){var D;for(j=new i.Buf32(512),I=new i.Buf32(32),D=0;D<144;)E.lens[D++]=8;for(;D<256;)E.lens[D++]=9;for(;D<280;)E.lens[D++]=7;for(;D<288;)E.lens[D++]=8;for(u(d,E.lens,0,288,j,0,E.work,{bits:9}),D=0;D<32;)E.lens[D++]=5;u(h,E.lens,0,32,I,0,E.work,{bits:5}),P=!1}E.lencode=j,E.lenbits=9,E.distcode=I,E.distbits=5}function U(E,D,w,O){var J,W=E.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new i.Buf8(W.wsize)),O>=W.wsize?(i.arraySet(W.window,D,w-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(O<(J=W.wsize-W.wnext)&&(J=O),i.arraySet(W.window,D,w-O,J,W.wnext),(O-=J)?(i.arraySet(W.window,D,w-O,O,0),W.wnext=O,W.whave=W.wsize):(W.wnext+=J,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=J))),0}o.inflateReset=S,o.inflateReset2=N,o.inflateResetKeep=k,o.inflateInit=function(E){return C(E,15)},o.inflateInit2=C,o.inflate=function(E,D){var w,O,J,W,q,Y,T,F,$,A,te,G,le,Q,ce,de,ge,xe,je,Oe,_,Z,B,R,z=0,L=new i.Buf8(4),ee=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!E||!E.state||!E.output||!E.input&&E.avail_in!==0)return f;(w=E.state).mode===12&&(w.mode=13),q=E.next_out,J=E.output,T=E.avail_out,W=E.next_in,O=E.input,Y=E.avail_in,F=w.hold,$=w.bits,A=Y,te=T,Z=p;e:for(;;)switch(w.mode){case y:if(w.wrap===0){w.mode=13;break}for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(2&w.wrap&&F===35615){L[w.check=0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0),$=F=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&F)<<8)+(F>>8))%31){E.msg="incorrect header check",w.mode=30;break}if((15&F)!=8){E.msg="unknown compression method",w.mode=30;break}if($-=4,_=8+(15&(F>>>=4)),w.wbits===0)w.wbits=_;else if(_>w.wbits){E.msg="invalid window size",w.mode=30;break}w.dmax=1<<_,E.adler=w.check=1,w.mode=512&F?10:12,$=F=0;break;case 2:for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(w.flags=F,(255&w.flags)!=8){E.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){E.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=F>>8&1),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0)),$=F=0,w.mode=3;case 3:for(;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.head&&(w.head.time=F),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,L[2]=F>>>16&255,L[3]=F>>>24&255,w.check=a(w.check,L,4,0)),$=F=0,w.mode=4;case 4:for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.head&&(w.head.xflags=255&F,w.head.os=F>>8),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0)),$=F=0,w.mode=5;case 5:if(1024&w.flags){for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.length=F,w.head&&(w.head.extra_len=F),512&w.flags&&(L[0]=255&F,L[1]=F>>>8&255,w.check=a(w.check,L,2,0)),$=F=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(Y<(G=w.length)&&(G=Y),G&&(w.head&&(_=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),i.arraySet(w.head.extra,O,W,G,_)),512&w.flags&&(w.check=a(w.check,O,G,W)),Y-=G,W+=G,w.length-=G),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(Y===0)break e;for(G=0;_=O[W+G++],w.head&&_&&w.length<65536&&(w.head.name+=String.fromCharCode(_)),_&&G<Y;);if(512&w.flags&&(w.check=a(w.check,O,G,W)),Y-=G,W+=G,_)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(Y===0)break e;for(G=0;_=O[W+G++],w.head&&_&&w.length<65536&&(w.head.comment+=String.fromCharCode(_)),_&&G<Y;);if(512&w.flags&&(w.check=a(w.check,O,G,W)),Y-=G,W+=G,_)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;$<16;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(F!==(65535&w.check)){E.msg="header crc mismatch",w.mode=30;break}$=F=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),E.adler=w.check=0,w.mode=12;break;case 10:for(;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}E.adler=w.check=g(F),$=F=0,w.mode=11;case 11:if(w.havedict===0)return E.next_out=q,E.avail_out=T,E.next_in=W,E.avail_in=Y,w.hold=F,w.bits=$,2;E.adler=w.check=1,w.mode=12;case 12:if(D===5||D===6)break e;case 13:if(w.last){F>>>=7&$,$-=7&$,w.mode=27;break}for(;$<3;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}switch(w.last=1&F,$-=1,3&(F>>>=1)){case 0:w.mode=14;break;case 1:if(M(w),w.mode=20,D!==6)break;F>>>=2,$-=2;break e;case 2:w.mode=17;break;case 3:E.msg="invalid block type",w.mode=30}F>>>=2,$-=2;break;case 14:for(F>>>=7&$,$-=7&$;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if((65535&F)!=(F>>>16^65535)){E.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&F,$=F=0,w.mode=15,D===6)break e;case 15:w.mode=16;case 16:if(G=w.length){if(Y<G&&(G=Y),T<G&&(G=T),G===0)break e;i.arraySet(J,O,W,G,q),Y-=G,W+=G,T-=G,q+=G,w.length-=G;break}w.mode=12;break;case 17:for(;$<14;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(w.nlen=257+(31&F),F>>>=5,$-=5,w.ndist=1+(31&F),F>>>=5,$-=5,w.ncode=4+(15&F),F>>>=4,$-=4,286<w.nlen||30<w.ndist){E.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;$<3;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.lens[ee[w.have++]]=7&F,F>>>=3,$-=3}for(;w.have<19;)w.lens[ee[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,B={bits:w.lenbits},Z=u(0,w.lens,0,19,w.lencode,0,w.work,B),w.lenbits=B.bits,Z){E.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;de=(z=w.lencode[F&(1<<w.lenbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(ge<16)F>>>=ce,$-=ce,w.lens[w.have++]=ge;else{if(ge===16){for(R=ce+2;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(F>>>=ce,$-=ce,w.have===0){E.msg="invalid bit length repeat",w.mode=30;break}_=w.lens[w.have-1],G=3+(3&F),F>>>=2,$-=2}else if(ge===17){for(R=ce+3;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}$-=ce,_=0,G=3+(7&(F>>>=ce)),F>>>=3,$-=3}else{for(R=ce+7;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}$-=ce,_=0,G=11+(127&(F>>>=ce)),F>>>=7,$-=7}if(w.have+G>w.nlen+w.ndist){E.msg="invalid bit length repeat",w.mode=30;break}for(;G--;)w.lens[w.have++]=_}}if(w.mode===30)break;if(w.lens[256]===0){E.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,B={bits:w.lenbits},Z=u(d,w.lens,0,w.nlen,w.lencode,0,w.work,B),w.lenbits=B.bits,Z){E.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,B={bits:w.distbits},Z=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,B),w.distbits=B.bits,Z){E.msg="invalid distances set",w.mode=30;break}if(w.mode=20,D===6)break e;case 20:w.mode=21;case 21:if(6<=Y&&258<=T){E.next_out=q,E.avail_out=T,E.next_in=W,E.avail_in=Y,w.hold=F,w.bits=$,l(E,te),q=E.next_out,J=E.output,T=E.avail_out,W=E.next_in,O=E.input,Y=E.avail_in,F=w.hold,$=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;de=(z=w.lencode[F&(1<<w.lenbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(de&&(240&de)==0){for(xe=ce,je=de,Oe=ge;de=(z=w.lencode[Oe+((F&(1<<xe+je)-1)>>xe)])>>>16&255,ge=65535&z,!(xe+(ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}F>>>=xe,$-=xe,w.back+=xe}if(F>>>=ce,$-=ce,w.back+=ce,w.length=ge,de===0){w.mode=26;break}if(32&de){w.back=-1,w.mode=12;break}if(64&de){E.msg="invalid literal/length code",w.mode=30;break}w.extra=15&de,w.mode=22;case 22:if(w.extra){for(R=w.extra;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.length+=F&(1<<w.extra)-1,F>>>=w.extra,$-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;de=(z=w.distcode[F&(1<<w.distbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if((240&de)==0){for(xe=ce,je=de,Oe=ge;de=(z=w.distcode[Oe+((F&(1<<xe+je)-1)>>xe)])>>>16&255,ge=65535&z,!(xe+(ce=z>>>24)<=$);){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}F>>>=xe,$-=xe,w.back+=xe}if(F>>>=ce,$-=ce,w.back+=ce,64&de){E.msg="invalid distance code",w.mode=30;break}w.offset=ge,w.extra=15&de,w.mode=24;case 24:if(w.extra){for(R=w.extra;$<R;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}w.offset+=F&(1<<w.extra)-1,F>>>=w.extra,$-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){E.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(T===0)break e;if(G=te-T,w.offset>G){if((G=w.offset-G)>w.whave&&w.sane){E.msg="invalid distance too far back",w.mode=30;break}le=G>w.wnext?(G-=w.wnext,w.wsize-G):w.wnext-G,G>w.length&&(G=w.length),Q=w.window}else Q=J,le=q-w.offset,G=w.length;for(T<G&&(G=T),T-=G,w.length-=G;J[q++]=Q[le++],--G;);w.length===0&&(w.mode=21);break;case 26:if(T===0)break e;J[q++]=w.length,T--,w.mode=21;break;case 27:if(w.wrap){for(;$<32;){if(Y===0)break e;Y--,F|=O[W++]<<$,$+=8}if(te-=T,E.total_out+=te,w.total+=te,te&&(E.adler=w.check=w.flags?a(w.check,J,te,q-te):s(w.check,J,te,q-te)),te=T,(w.flags?F:g(F))!==w.check){E.msg="incorrect data check",w.mode=30;break}$=F=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;$<32;){if(Y===0)break e;Y--,F+=O[W++]<<$,$+=8}if(F!==(4294967295&w.total)){E.msg="incorrect length check",w.mode=30;break}$=F=0}w.mode=29;case 29:Z=1;break e;case 30:Z=-3;break e;case 31:return-4;default:return f}return E.next_out=q,E.avail_out=T,E.next_in=W,E.avail_in=Y,w.hold=F,w.bits=$,(w.wsize||te!==E.avail_out&&w.mode<30&&(w.mode<27||D!==4))&&U(E,E.output,E.next_out,te-E.avail_out)?(w.mode=31,-4):(A-=E.avail_in,te-=E.avail_out,E.total_in+=A,E.total_out+=te,w.total+=te,w.wrap&&te&&(E.adler=w.check=w.flags?a(w.check,J,te,E.next_out-te):s(w.check,J,te,E.next_out-te)),E.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(A==0&&te===0||D===4)&&Z===p&&(Z=-5),Z)},o.inflateEnd=function(E){if(!E||!E.state)return f;var D=E.state;return D.window&&(D.window=null),E.state=null,p},o.inflateGetHeader=function(E,D){var w;return E&&E.state?(2&(w=E.state).wrap)==0?f:((w.head=D).done=!1,p):f},o.inflateSetDictionary=function(E,D){var w,O=D.length;return E&&E.state?(w=E.state).wrap!==0&&w.mode!==11?f:w.mode===11&&s(1,D,O,0)!==w.check?-3:U(E,D,O,O)?(w.mode=31,-4):(w.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,y,m,x,g){var b,k,S,N,C,j,I,P,M,U=g.bits,E=0,D=0,w=0,O=0,J=0,W=0,q=0,Y=0,T=0,F=0,$=null,A=0,te=new i.Buf16(16),G=new i.Buf16(16),le=null,Q=0;for(E=0;E<=15;E++)te[E]=0;for(D=0;D<f;D++)te[h[p+D]]++;for(J=U,O=15;1<=O&&te[O]===0;O--);if(O<J&&(J=O),O===0)return y[m++]=20971520,y[m++]=20971520,g.bits=1,0;for(w=1;w<O&&te[w]===0;w++);for(J<w&&(J=w),E=Y=1;E<=15;E++)if(Y<<=1,(Y-=te[E])<0)return-1;if(0<Y&&(d===0||O!==1))return-1;for(G[1]=0,E=1;E<15;E++)G[E+1]=G[E]+te[E];for(D=0;D<f;D++)h[p+D]!==0&&(x[G[h[p+D]]++]=D);if(j=d===0?($=le=x,19):d===1?($=s,A-=257,le=a,Q-=257,256):($=l,le=u,-1),E=w,C=m,q=D=F=0,S=-1,N=(T=1<<(W=J))-1,d===1&&852<T||d===2&&592<T)return 1;for(;;){for(I=E-q,M=x[D]<j?(P=0,x[D]):x[D]>j?(P=le[Q+x[D]],$[A+x[D]]):(P=96,0),b=1<<E-q,w=k=1<<W;y[C+(F>>q)+(k-=b)]=I<<24|P<<16|M|0,k!==0;);for(b=1<<E-1;F&b;)b>>=1;if(b!==0?(F&=b-1,F+=b):F=0,D++,--te[E]==0){if(E===O)break;E=h[p+x[D]]}if(J<E&&(F&N)!==S){for(q===0&&(q=J),C+=w,Y=1<<(W=E-q);W+q<O&&!((Y-=te[W+q])<=0);)W++,Y<<=1;if(T+=1<<W,d===1&&852<T||d===2&&592<T)return 1;y[S=F&N]=J<<24|W<<16|C-m|0}}return F!==0&&(y[C+F]=E-q<<24|64<<16|0),g.bits=J,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 L=z.length;0<=--L;)z[L]=0}var u=0,d=29,h=256,p=h+1+d,f=30,y=19,m=2*p+1,x=15,g=16,b=7,k=256,S=16,N=17,C=18,j=[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],U=new Array(2*(p+2));l(U);var E=new Array(2*f);l(E);var D=new Array(512);l(D);var w=new Array(256);l(w);var O=new Array(d);l(O);var J,W,q,Y=new Array(f);function T(z,L,ee,re,H){this.static_tree=z,this.extra_bits=L,this.extra_base=ee,this.elems=re,this.max_length=H,this.has_stree=z&&z.length}function F(z,L){this.dyn_tree=z,this.max_code=0,this.stat_desc=L}function $(z){return z<256?D[z]:D[256+(z>>>7)]}function A(z,L){z.pending_buf[z.pending++]=255&L,z.pending_buf[z.pending++]=L>>>8&255}function te(z,L,ee){z.bi_valid>g-ee?(z.bi_buf|=L<<z.bi_valid&65535,A(z,z.bi_buf),z.bi_buf=L>>g-z.bi_valid,z.bi_valid+=ee-g):(z.bi_buf|=L<<z.bi_valid&65535,z.bi_valid+=ee)}function G(z,L,ee){te(z,ee[2*L],ee[2*L+1])}function le(z,L){for(var ee=0;ee|=1&z,z>>>=1,ee<<=1,0<--L;);return ee>>>1}function Q(z,L,ee){var re,H,se=new Array(x+1),fe=0;for(re=1;re<=x;re++)se[re]=fe=fe+ee[re-1]<<1;for(H=0;H<=L;H++){var ae=z[2*H+1];ae!==0&&(z[2*H]=le(se[ae]++,ae))}}function ce(z){var L;for(L=0;L<p;L++)z.dyn_ltree[2*L]=0;for(L=0;L<f;L++)z.dyn_dtree[2*L]=0;for(L=0;L<y;L++)z.bl_tree[2*L]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function de(z){8<z.bi_valid?A(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 ge(z,L,ee,re){var H=2*L,se=2*ee;return z[H]<z[se]||z[H]===z[se]&&re[L]<=re[ee]}function xe(z,L,ee){for(var re=z.heap[ee],H=ee<<1;H<=z.heap_len&&(H<z.heap_len&&ge(L,z.heap[H+1],z.heap[H],z.depth)&&H++,!ge(L,re,z.heap[H],z.depth));)z.heap[ee]=z.heap[H],ee=H,H<<=1;z.heap[ee]=re}function je(z,L,ee){var re,H,se,fe,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],H=z.pending_buf[z.l_buf+ae],ae++,re===0?G(z,H,L):(G(z,(se=w[H])+h+1,L),(fe=j[se])!==0&&te(z,H-=O[se],fe),G(z,se=$(--re),ee),(fe=I[se])!==0&&te(z,re-=Y[se],fe)),ae<z.last_lit;);G(z,k,L)}function Oe(z,L){var ee,re,H,se=L.dyn_tree,fe=L.stat_desc.static_tree,ae=L.stat_desc.has_stree,V=L.stat_desc.elems,ne=-1;for(z.heap_len=0,z.heap_max=m,ee=0;ee<V;ee++)se[2*ee]!==0?(z.heap[++z.heap_len]=ne=ee,z.depth[ee]=0):se[2*ee+1]=0;for(;z.heap_len<2;)se[2*(H=z.heap[++z.heap_len]=ne<2?++ne:0)]=1,z.depth[H]=0,z.opt_len--,ae&&(z.static_len-=fe[2*H+1]);for(L.max_code=ne,ee=z.heap_len>>1;1<=ee;ee--)xe(z,se,ee);for(H=V;ee=z.heap[1],z.heap[1]=z.heap[z.heap_len--],xe(z,se,1),re=z.heap[1],z.heap[--z.heap_max]=ee,z.heap[--z.heap_max]=re,se[2*H]=se[2*ee]+se[2*re],z.depth[H]=(z.depth[ee]>=z.depth[re]?z.depth[ee]:z.depth[re])+1,se[2*ee+1]=se[2*re+1]=H,z.heap[1]=H++,xe(z,se,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(ue,we){var Ae,Ze,lt,Ie,Et,Mt,Be=we.dyn_tree,Lt=we.max_code,vt=we.stat_desc.static_tree,pp=we.stat_desc.has_stree,mp=we.stat_desc.extra_bits,va=we.stat_desc.extra_base,Xn=we.stat_desc.max_length,Cr=0;for(Ie=0;Ie<=x;Ie++)ue.bl_count[Ie]=0;for(Be[2*ue.heap[ue.heap_max]+1]=0,Ae=ue.heap_max+1;Ae<m;Ae++)Xn<(Ie=Be[2*Be[2*(Ze=ue.heap[Ae])+1]+1]+1)&&(Ie=Xn,Cr++),Be[2*Ze+1]=Ie,Lt<Ze||(ue.bl_count[Ie]++,Et=0,va<=Ze&&(Et=mp[Ze-va]),Mt=Be[2*Ze],ue.opt_len+=Mt*(Ie+Et),pp&&(ue.static_len+=Mt*(vt[2*Ze+1]+Et)));if(Cr!==0){do{for(Ie=Xn-1;ue.bl_count[Ie]===0;)Ie--;ue.bl_count[Ie]--,ue.bl_count[Ie+1]+=2,ue.bl_count[Xn]--,Cr-=2}while(0<Cr);for(Ie=Xn;Ie!==0;Ie--)for(Ze=ue.bl_count[Ie];Ze!==0;)Lt<(lt=ue.heap[--Ae])||(Be[2*lt+1]!==Ie&&(ue.opt_len+=(Ie-Be[2*lt+1])*Be[2*lt],Be[2*lt+1]=Ie),Ze--)}})(z,L),Q(se,ne,z.bl_count)}function _(z,L,ee){var re,H,se=-1,fe=L[1],ae=0,V=7,ne=4;for(fe===0&&(V=138,ne=3),L[2*(ee+1)+1]=65535,re=0;re<=ee;re++)H=fe,fe=L[2*(re+1)+1],++ae<V&&H===fe||(ae<ne?z.bl_tree[2*H]+=ae:H!==0?(H!==se&&z.bl_tree[2*H]++,z.bl_tree[2*S]++):ae<=10?z.bl_tree[2*N]++:z.bl_tree[2*C]++,se=H,ne=(ae=0)===fe?(V=138,3):H===fe?(V=6,3):(V=7,4))}function Z(z,L,ee){var re,H,se=-1,fe=L[1],ae=0,V=7,ne=4;for(fe===0&&(V=138,ne=3),re=0;re<=ee;re++)if(H=fe,fe=L[2*(re+1)+1],!(++ae<V&&H===fe)){if(ae<ne)for(;G(z,H,z.bl_tree),--ae!=0;);else H!==0?(H!==se&&(G(z,H,z.bl_tree),ae--),G(z,S,z.bl_tree),te(z,ae-3,2)):ae<=10?(G(z,N,z.bl_tree),te(z,ae-3,3)):(G(z,C,z.bl_tree),te(z,ae-11,7));se=H,ne=(ae=0)===fe?(V=138,3):H===fe?(V=6,3):(V=7,4)}}l(Y);var B=!1;function R(z,L,ee,re){te(z,(u<<1)+(re?1:0),3),(function(H,se,fe,ae){de(H),A(H,fe),A(H,~fe),i.arraySet(H.pending_buf,H.window,se,fe,H.pending),H.pending+=fe})(z,L,ee)}o._tr_init=function(z){B||((function(){var L,ee,re,H,se,fe=new Array(x+1);for(H=re=0;H<d-1;H++)for(O[H]=re,L=0;L<1<<j[H];L++)w[re++]=H;for(w[re-1]=H,H=se=0;H<16;H++)for(Y[H]=se,L=0;L<1<<I[H];L++)D[se++]=H;for(se>>=7;H<f;H++)for(Y[H]=se<<7,L=0;L<1<<I[H]-7;L++)D[256+se++]=H;for(ee=0;ee<=x;ee++)fe[ee]=0;for(L=0;L<=143;)U[2*L+1]=8,L++,fe[8]++;for(;L<=255;)U[2*L+1]=9,L++,fe[9]++;for(;L<=279;)U[2*L+1]=7,L++,fe[7]++;for(;L<=287;)U[2*L+1]=8,L++,fe[8]++;for(Q(U,p+1,fe),L=0;L<f;L++)E[2*L+1]=5,E[2*L]=le(L,5);J=new T(U,j,h+1,p,x),W=new T(E,I,0,f,x),q=new T(new Array(0),P,0,y,b)})(),B=!0),z.l_desc=new F(z.dyn_ltree,J),z.d_desc=new F(z.dyn_dtree,W),z.bl_desc=new F(z.bl_tree,q),z.bi_buf=0,z.bi_valid=0,ce(z)},o._tr_stored_block=R,o._tr_flush_block=function(z,L,ee,re){var H,se,fe=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(ae){var V,ne=4093624447;for(V=0;V<=31;V++,ne>>>=1)if(1&ne&&ae.dyn_ltree[2*V]!==0)return s;if(ae.dyn_ltree[18]!==0||ae.dyn_ltree[20]!==0||ae.dyn_ltree[26]!==0)return a;for(V=32;V<h;V++)if(ae.dyn_ltree[2*V]!==0)return a;return s})(z)),Oe(z,z.l_desc),Oe(z,z.d_desc),fe=(function(ae){var V;for(_(ae,ae.dyn_ltree,ae.l_desc.max_code),_(ae,ae.dyn_dtree,ae.d_desc.max_code),Oe(ae,ae.bl_desc),V=y-1;3<=V&&ae.bl_tree[2*M[V]+1]===0;V--);return ae.opt_len+=3*(V+1)+5+5+4,V})(z),H=z.opt_len+3+7>>>3,(se=z.static_len+3+7>>>3)<=H&&(H=se)):H=se=ee+5,ee+4<=H&&L!==-1?R(z,L,ee,re):z.strategy===4||se===H?(te(z,2+(re?1:0),3),je(z,U,E)):(te(z,4+(re?1:0),3),(function(ae,V,ne,ue){var we;for(te(ae,V-257,5),te(ae,ne-1,5),te(ae,ue-4,4),we=0;we<ue;we++)te(ae,ae.bl_tree[2*M[we]+1],3);Z(ae,ae.dyn_ltree,V-1),Z(ae,ae.dyn_dtree,ne-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,fe+1),je(z,z.dyn_ltree,z.dyn_dtree)),ce(z),re&&de(z)},o._tr_tally=function(z,L,ee){return z.pending_buf[z.d_buf+2*z.last_lit]=L>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&L,z.pending_buf[z.l_buf+z.last_lit]=255&ee,z.last_lit++,L===0?z.dyn_ltree[2*ee]++:(z.matches++,L--,z.dyn_ltree[2*(w[ee]+h+1)]++,z.dyn_dtree[2*$(L)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){te(z,2,3),G(z,k,U),(function(L){L.bi_valid===16?(A(L,L.bi_buf),L.bi_buf=0,L.bi_valid=0):8<=L.bi_valid&&(L.pending_buf[L.pending++]=255&L.bi_buf,L.bi_buf>>=8,L.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={},y=!1,m=s.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(s);x=x&&x.setTimeout?x:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){b(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,N=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=N,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){b(S.data)},function(S){d.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(S){var N=m.createElement("script");N.onreadystatechange=function(){b(S),N.onreadystatechange=null,u.removeChild(N),N=null},u.appendChild(N)}):function(S){setTimeout(b,0,S)},x.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var N=new Array(arguments.length-1),C=0;C<N.length;C++)N[C]=arguments[C+1];var j={callback:S,args:N};return f[p]=j,l(p),p++},x.clearImmediate=g}function g(S){delete f[S]}function b(S){if(y)setTimeout(b,0,S);else{var N=f[S];if(N){y=!0;try{(function(C){var j=C.callback,I=C.args;switch(I.length){case 0:j();break;case 1:j(I[0]);break;case 2:j(I[0],I[1]);break;case 3:j(I[0],I[1],I[2]);break;default:j.apply(a,I)}})(N)}finally{g(S),y=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&b(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof Er<"u"?Er:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Xo)),Xo.exports}var Ib=zb();const Rb=ds(Ib);async function Pb(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 Ob(e){const t=new Rb;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 Pb(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 Db="1.14.6",Mb={version:Db};function Bu(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=Bu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Uu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Bu(e))&&(r&&(r+=" "),r+=t);return r}const Lb=(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},Fb=(e,t)=>({classGroupId:e,validator:t}),Zu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ro="-",Ga=[],$b="arbitrary..",Bb=e=>{const t=Zb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Ub(s);const a=s.split(ro),l=a[0]===""&&a.length>1?1:0;return Vu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],u=n[s];return l?u?Lb(u,l):l:u||Ga}return n[s]||Ga}}},Vu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=Vu(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const a=t===0?e.join(ro):e.slice(t).join(ro),l=s.length;for(let u=0;u<l;u++){const d=s[u];if(d.validator(a))return d.classGroupId}},Ub=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?$b+r:void 0})(),Zb=e=>{const{theme:t,classGroups:n}=e;return Vb(n,t)},Vb=(e,t)=>{const n=Zu();for(const r in e){const o=e[r];Ns(o,n,r,t)}return n},Ns=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Wb(s,t,n,r)}},Wb=(e,t,n,r)=>{if(typeof e=="string"){Hb(e,t,n);return}if(typeof e=="function"){qb(e,t,n,r);return}Kb(e,t,n,r)},Hb=(e,t,n)=>{const r=e===""?t:Wu(t,e);r.classGroupId=n},qb=(e,t,n,r)=>{if(Gb(e)){Ns(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Fb(n,e))},Kb=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];Ns(l,Wu(t,a),n,r)}},Wu=(e,t)=>{let n=e;const r=t.split(ro),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=Zu(),n.nextPart.set(s,a)),n=a}return n},Gb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Jb=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)}}},Pi="!",Ja=":",Yb=[],Ya=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Xb=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 x=o[m];if(s===0&&a===0){if(x===Ja){i.push(o.slice(l,m)),l=m+1;continue}if(x==="/"){u=m;continue}}x==="["?s++:x==="]"?s--:x==="("?a++:x===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,f=!1;h.endsWith(Pi)?(p=h.slice(0,-1),f=!0):h.startsWith(Pi)&&(p=h.slice(1),f=!0);const y=u&&u>l?u-l:void 0;return Ya(i,f,p,y)};if(t){const o=t+Ja,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Ya(Yb,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Qb=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}},e1=e=>({cache:Jb(e.cacheSize),parseClassName:Xb(e),sortModifiers:Qb(e),...Bb(e)}),t1=/\s+/,n1=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(t1);let l="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:y,maybePostfixModifierPosition:m}=n(d);if(h){l=d+(l.length>0?" "+l:l);continue}let x=!!m,g=r(x?y.substring(0,m):y);if(!g){if(!x){l=d+(l.length>0?" "+l:l);continue}if(g=r(y),!g){l=d+(l.length>0?" "+l:l);continue}x=!1}const b=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=f?b+Pi:b,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const N=o(g,x);for(let C=0;C<N.length;++C){const j=N[C];s.push(k+j)}l=d+(l.length>0?" "+l:l)}return l},r1=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Hu(n))&&(o&&(o+=" "),o+=r);return o},Hu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Hu(e[r]))&&(n&&(n+=" "),n+=t);return n},o1=(e,...t)=>{let n,r,o,i;const s=l=>{const u=t.reduce((d,h)=>h(d),e());return n=e1(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=n1(l,n);return o(l,d),d};return i=s,(...l)=>i(r1(...l))},i1=[],He=e=>{const t=n=>n[e]||i1;return t.isThemeGetter=!0,t},qu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ku=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s1=/^\d+\/\d+$/,a1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,l1=/\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$/,c1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,u1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,d1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yn=e=>s1.test(e),Ne=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>!!e&&Number.isInteger(Number(e)),Qo=e=>e.endsWith("%")&&Ne(e.slice(0,-1)),Ft=e=>a1.test(e),f1=()=>!0,h1=e=>l1.test(e)&&!c1.test(e),Gu=()=>!1,p1=e=>u1.test(e),m1=e=>d1.test(e),g1=e=>!he(e)&&!pe(e),x1=e=>Wn(e,Xu,Gu),he=e=>qu.test(e),on=e=>Wn(e,Qu,h1),ei=e=>Wn(e,k1,Ne),Xa=e=>Wn(e,Ju,Gu),y1=e=>Wn(e,Yu,m1),zr=e=>Wn(e,ed,p1),pe=e=>Ku.test(e),er=e=>Hn(e,Qu),v1=e=>Hn(e,_1),Qa=e=>Hn(e,Ju),b1=e=>Hn(e,Xu),w1=e=>Hn(e,Yu),Ir=e=>Hn(e,ed,!0),Wn=(e,t,n)=>{const r=qu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Hn=(e,t,n=!1)=>{const r=Ku.exec(e);return r?r[1]?t(r[1]):n:!1},Ju=e=>e==="position"||e==="percentage",Yu=e=>e==="image"||e==="url",Xu=e=>e==="length"||e==="size"||e==="bg-size",Qu=e=>e==="length",k1=e=>e==="number",_1=e=>e==="family-name",ed=e=>e==="shadow",S1=()=>{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"),y=He("blur"),m=He("perspective"),x=He("aspect"),g=He("ease"),b=He("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...S(),pe,he],C=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],I=()=>[pe,he,l],P=()=>[yn,"full","auto",...I()],M=()=>[Ht,"none","subgrid",pe,he],U=()=>["auto",{span:["full",Ht,pe,he]},Ht,pe,he],E=()=>[Ht,"auto",pe,he],D=()=>["auto","min","max","fr",pe,he],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...I()],W=()=>[yn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],q=()=>[e,pe,he],Y=()=>[...S(),Qa,Xa,{position:[pe,he]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",b1,x1,{size:[pe,he]}],$=()=>[Qo,er,on],A=()=>["","none","full",u,pe,he],te=()=>["",Ne,er,on],G=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Ne,Qo,Qa,Xa],ce=()=>["","none",y,pe,he],de=()=>["none",Ne,pe,he],ge=()=>["none",Ne,pe,he],xe=()=>[Ne,pe,he],je=()=>[yn,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ft],breakpoint:[Ft],color:[f1],container:[Ft],"drop-shadow":[Ft],ease:["in","out","in-out"],font:[g1],"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",Ne],text:[Ft],"text-shadow":[Ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yn,he,pe,x]}],container:["container"],columns:[{columns:[Ne,he,pe,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],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",pe,he]}],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:[Ne,yn,"auto","initial","none",he]}],grow:[{grow:["",Ne,pe,he]}],shrink:[{shrink:["",Ne,pe,he]}],order:[{order:[Ht,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"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:J()}],mx:[{mx:J()}],my:[{my:J()}],ms:[{ms:J()}],me:[{me:J()}],mt:[{mt:J()}],mr:[{mr:J()}],mb:[{mb:J()}],ml:[{ml:J()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,er,on]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pe,ei]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qo,he]}],"font-family":[{font:[v1,he,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,pe,he]}],"line-clamp":[{"line-clamp":[Ne,"none",pe,ei]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",pe,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",pe,on]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Ne,"auto",pe,he]}],"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",pe,he]}],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",pe,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ht,pe,he],radial:["",pe,he],conic:[Ht,pe,he]},w1,y1]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,pe,he]}],"outline-w":[{outline:["",Ne,er,on]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",d,Ir,zr]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",h,Ir,zr]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Ne,on]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",p,Ir,zr]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[Ne,pe,he]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"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":[Ne]}],"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":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"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":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"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":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"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":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"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":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"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":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"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":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"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":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"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":[Ne]}],"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":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:ce()}],brightness:[{brightness:[Ne,pe,he]}],contrast:[{contrast:[Ne,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",f,Ir,zr]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",Ne,pe,he]}],"hue-rotate":[{"hue-rotate":[Ne,pe,he]}],invert:[{invert:["",Ne,pe,he]}],saturate:[{saturate:[Ne,pe,he]}],sepia:[{sepia:["",Ne,pe,he]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,he]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,pe,he]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,pe,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,pe,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,pe,he]}],"backdrop-invert":[{"backdrop-invert":["",Ne,pe,he]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,pe,he]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,pe,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,pe,he]}],"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",pe,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",pe,he]}],ease:[{ease:["linear","initial",g,pe,he]}],delay:[{delay:[Ne,pe,he]}],animate:[{animate:["none",b,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,pe,he]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"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:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"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",pe,he]}],"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",pe,he]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Ne,er,on,ei]}],stroke:[{stroke:["none",...q()]}],"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"]}},C1=o1(S1);function me(...e){return C1(Uu(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 td(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const el=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tl=Uu,Ts=(e,t)=>n=>{var r;if(t?.variants==null)return tl(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=el(d)||el(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(y=>{let[m,x]=y;return Array.isArray(x)?x.includes({...i,...a}[m]):{...i,...a}[m]===x})?[...u,h,p]:u},[]);return tl(e,s,l,n?.class,n?.className)};function nl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function nd(...e){return t=>{let n=!1;const r=e.map(o=>{const i=nl(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():nl(e[o],null)}}}}function Pe(...e){return v.useCallback(nd(...e),e)}function Mn(e){const t=j1(e),n=v.forwardRef((r,o)=>{const{children:i,...s}=r,a=v.Children.toArray(i),l=a.find(T1);if(l){const u=l.props.children,d=a.map(h=>h===l?v.Children.count(u)>1?v.Children.only(null):v.isValidElement(u)?u.props.children:null:h);return c.jsx(t,{...s,ref:o,children:v.isValidElement(u)?v.cloneElement(u,void 0,d):null})}return c.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var E1=Mn("Slot");function j1(e){const t=v.forwardRef((n,r)=>{const{children:o,...i}=n;if(v.isValidElement(o)){const s=z1(o),a=A1(i,o.props);return o.type!==v.Fragment&&(a.ref=r?nd(r,s):s),v.cloneElement(o,a)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rd=Symbol("radix.slottable");function N1(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=rd,t}function T1(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rd}function A1(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 z1(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 I1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=I1.reduce((e,t)=>{const n=Mn(`Primitive.${t}`),r=v.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 R1(e,t){e&&yr.flushSync(()=>e.dispatchEvent(t))}var od=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"}),P1="VisuallyHidden",id=v.forwardRef((e,t)=>c.jsx(Ce.span,{...e,ref:t,style:{...od,...e.style}}));id.displayName=P1;var O1=id;function D1(e,t){const n=v.createContext(t),r=i=>{const{children:s,...a}=i,l=v.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=v.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=v.createContext(s),l=n.length;n=[...n,s];const u=h=>{const{scope:p,children:f,...y}=h,m=p?.[e]?.[l]||a,x=v.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:x,children:f})};u.displayName=i+"Provider";function d(h,p){const f=p?.[e]?.[l]||a,y=v.useContext(f);if(y)return y;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=>v.createContext(s));return function(a){const l=a?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,M1(o,...t)]}function M1(...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 v.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function sd(e){const t=e+"CollectionProvider",[n,r]=Wt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:x,children:g}=m,b=ot.useRef(null),k=ot.useRef(new Map).current;return c.jsx(o,{scope:x,itemMap:k,collectionRef:b,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Mn(a),u=ot.forwardRef((m,x)=>{const{scope:g,children:b}=m,k=i(a,g),S=Pe(x,k.collectionRef);return c.jsx(l,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",p=Mn(d),f=ot.forwardRef((m,x)=>{const{scope:g,children:b,...k}=m,S=ot.useRef(null),N=Pe(x,S),C=i(d,g);return ot.useEffect(()=>(C.itemMap.set(S,{ref:S,...k}),()=>{C.itemMap.delete(S)})),c.jsx(p,{[h]:"",ref:N,children:b})});f.displayName=d;function y(m){const x=i(e+"CollectionConsumer",m);return ot.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const k=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((C,j)=>k.indexOf(C.ref.current)-k.indexOf(j.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:f},y,r]}function ke(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var Ke=globalThis?.document?v.useLayoutEffect:()=>{},L1=Uc[" useInsertionEffect ".trim().toString()]||Ke;function an({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=F1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=v.useRef(e!==void 0);v.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=v.useCallback(d=>{if(a){const h=$1(d)?d(e):d;h!==e&&s.current?.(h)}else i(d)},[a,e,i,s]);return[l,u]}function F1({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),o=v.useRef(n),i=v.useRef(t);return L1(()=>{i.current=t},[t]),v.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function $1(e){return typeof e=="function"}function B1(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var xt=e=>{const{present:t,children:n}=e,r=U1(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=Pe(r.ref,Z1(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:i}):null};xt.displayName="Presence";function U1(e){const[t,n]=v.useState(),r=v.useRef(null),o=v.useRef(e),i=v.useRef("none"),s=e?"mounted":"unmounted",[a,l]=B1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=Rr(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=Rr(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=Rr(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=f=>{f.target===t&&(i.current=Rr(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:v.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Rr(e){return e?.animationName||"none"}function Z1(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 V1=Uc[" useId ".trim().toString()]||(()=>{}),W1=0;function zt(e){const[t,n]=v.useState(V1());return Ke(()=>{n(r=>r??String(W1++))},[e]),e||(t?`radix-${t}`:"")}var So="Collapsible",[H1]=Wt(So),[q1,As]=H1(So),ad=v.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:So});return c.jsx(q1,{scope:n,disabled:i,contentId:zt(),open:l,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:c.jsx(Ce.div,{"data-state":Is(l),"data-disabled":i?"":void 0,...a,ref:t})})});ad.displayName=So;var ld="CollapsibleTrigger",cd=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=As(ld,n);return c.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Is(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:ke(e.onClick,o.onOpenToggle)})});cd.displayName=ld;var zs="CollapsibleContent",ud=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=As(zs,e.__scopeCollapsible);return c.jsx(xt,{present:n||o.open,children:({present:i})=>c.jsx(K1,{...r,ref:t,present:i})})});ud.displayName=zs;var K1=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=As(zs,n),[a,l]=v.useState(r),u=v.useRef(null),d=Pe(t,u),h=v.useRef(0),p=h.current,f=v.useRef(0),y=f.current,m=s.open||a,x=v.useRef(m),g=v.useRef(void 0);return v.useEffect(()=>{const b=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(b)},[]),Ke(()=>{const b=u.current;if(b){g.current=g.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const k=b.getBoundingClientRect();h.current=k.height,f.current=k.width,x.current||(b.style.transitionDuration=g.current.transitionDuration,b.style.animationName=g.current.animationName),l(r)}},[s.open,r]),c.jsx(Ce.div,{"data-state":Is(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":y?`${y}px`:void 0,...e.style},children:m&&o})});function Is(e){return e?"open":"closed"}var G1=ad,J1=v.createContext(void 0);function Co(e){const t=v.useContext(J1);return e||t||"ltr"}function et(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Y1(e,t=globalThis?.document){const n=et(e);v.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 X1="DismissableLayer",Oi="dismissableLayer.update",Q1="dismissableLayer.pointerDownOutside",ew="dismissableLayer.focusOutside",rl,dd=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Eo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=v.useContext(dd),[d,h]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=v.useState({}),y=Pe(t,j=>h(j)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(x),b=d?m.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=g,N=rw(j=>{const I=j.target,P=[...u.branches].some(M=>M.contains(I));!S||P||(o?.(j),s?.(j),j.defaultPrevented||a?.())},p),C=ow(j=>{const I=j.target;[...u.branches].some(M=>M.contains(I))||(i?.(j),s?.(j),j.defaultPrevented||a?.())},p);return Y1(j=>{b===u.layers.size-1&&(r?.(j),!j.defaultPrevented&&a&&(j.preventDefault(),a()))},p),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ol(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=rl)}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ol())},[d,u]),v.useEffect(()=>{const j=()=>f({});return document.addEventListener(Oi,j),()=>document.removeEventListener(Oi,j)},[]),c.jsx(Ce.div,{...l,ref:y,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,N.onPointerDownCapture)})});Eo.displayName=X1;var tw="DismissableLayerBranch",nw=v.forwardRef((e,t)=>{const n=v.useContext(dd),r=v.useRef(null),o=Pe(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Ce.div,{...e,ref:o})});nw.displayName=tw;function rw(e,t=globalThis?.document){const n=et(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){fd(Q1,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 ow(e,t=globalThis?.document){const n=et(e),r=v.useRef(!1);return v.useEffect(()=>{const o=i=>{i.target&&!r.current&&fd(ew,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 ol(){const e=new CustomEvent(Oi);document.dispatchEvent(e)}function fd(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?R1(o,i):o.dispatchEvent(i)}var ti="focusScope.autoFocusOnMount",ni="focusScope.autoFocusOnUnmount",il={bubbles:!1,cancelable:!0},iw="FocusScope",Rs=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=v.useState(null),u=et(o),d=et(i),h=v.useRef(null),p=Pe(t,m=>l(m)),f=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?h.current=S:Kt(h.current,{select:!0})},x=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Kt(h.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const N of k)N.removedNodes.length>0&&Kt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(g);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[r,a,f.paused]),v.useEffect(()=>{if(a){al.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(ti,il);a.addEventListener(ti,u),a.dispatchEvent(g),g.defaultPrevented||(sw(dw(hd(a)),{select:!0}),document.activeElement===m&&Kt(a))}return()=>{a.removeEventListener(ti,u),setTimeout(()=>{const g=new CustomEvent(ni,il);a.addEventListener(ni,d),a.dispatchEvent(g),g.defaultPrevented||Kt(m??document.body,{select:!0}),a.removeEventListener(ni,d),al.remove(f)},0)}}},[a,u,d,f]);const y=v.useCallback(m=>{if(!n&&!r||f.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(x&&g){const b=m.currentTarget,[k,S]=aw(b);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Kt(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Kt(S,{select:!0})):g===b&&m.preventDefault()}},[n,r,f.paused]);return c.jsx(Ce.div,{tabIndex:-1,...s,ref:p,onKeyDown:y})});Rs.displayName=iw;function sw(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Kt(r,{select:t}),document.activeElement!==n)return}function aw(e){const t=hd(e),n=sl(t,e),r=sl(t.reverse(),e);return[n,r]}function hd(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 sl(e,t){for(const n of e)if(!lw(n,{upTo:t}))return n}function lw(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 cw(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&&cw(e)&&t&&e.select()}}var al=uw();function uw(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ll(e,t),e.unshift(t)},remove(t){e=ll(e,t),e[0]?.resume()}}}function ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dw(e){return e.filter(t=>t.tagName!=="A")}var fw="Portal",jo=v.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=v.useState(!1);Ke(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?xp.createPortal(c.jsx(Ce.div,{...r,ref:t}),s):null});jo.displayName=fw;var ri=0;function pd(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cl()),document.body.insertAdjacentElement("beforeend",e[1]??cl()),ri++,()=>{ri===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ri--}},[])}function cl(){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 Nt=function(){return Nt=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},Nt.apply(this,arguments)};function md(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 hw(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 Wr="right-scroll-bar-position",Hr="width-before-scroll-bar",pw="with-scroll-bars-hidden",mw="--removed-body-scroll-bar-size";function oi(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gw(e,t){var n=v.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 xw=typeof window<"u"?v.useLayoutEffect:v.useEffect,ul=new WeakMap;function yw(e,t){var n=gw(null,function(r){return e.forEach(function(o){return oi(o,r)})});return xw(function(){var r=ul.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||oi(a,null)}),i.forEach(function(a){o.has(a)||oi(a,s)})}ul.set(n,e)},[e]),n}function vw(e){return e}function bw(e,t){t===void 0&&(t=vw);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 ww(e){e===void 0&&(e={});var t=bw(null);return t.options=Nt({async:!0,ssr:!1},e),t}var gd=function(e){var t=e.sideCar,n=md(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 v.createElement(r,Nt({},n))};gd.isSideCarExport=!0;function kw(e,t){return e.useMedium(t),gd}var xd=ww(),ii=function(){},No=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ii,onWheelCapture:ii,onTouchMoveCapture:ii}),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,y=e.noIsolation,m=e.inert,x=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,k=e.gapMode,S=md(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,C=yw([n,t]),j=Nt(Nt({},S),o);return v.createElement(v.Fragment,null,d&&v.createElement(N,{sideCar:xd,removeScrollBar:u,shards:h,noRelative:f,noIsolation:y,inert:m,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:k}),s?v.cloneElement(v.Children.only(a),Nt(Nt({},j),{ref:C})):v.createElement(b,Nt({},j,{className:l,ref:C}),a))});No.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};No.classNames={fullWidth:Hr,zeroRight:Wr};var _w=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_w();return t&&e.setAttribute("nonce",t),e}function Cw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ew(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sw())&&(Cw(t,n),Ew(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Nw=function(){var e=jw();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yd=function(){var e=Nw(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Tw={left:0,top:0,right:0,gap:0},si=function(e){return parseInt(e||"",10)||0},Aw=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[si(n),si(r),si(o)]},zw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tw;var t=Aw(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])}},Iw=yd(),An="data-scroll-locked",Rw=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
41
|
.`.concat(pw,` {
|
|
42
42
|
overflow: hidden `).concat(r,`;
|
|
43
43
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -77,24 +77,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
77
77
|
`)},dl=function(){var e=parseInt(document.body.getAttribute(An)||"0",10);return isFinite(e)?e:0},Pw=function(){v.useEffect(function(){return document.body.setAttribute(An,(dl()+1).toString()),function(){var e=dl()-1;e<=0?document.body.removeAttribute(An):document.body.setAttribute(An,e.toString())}},[])},Ow=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Pw();var i=v.useMemo(function(){return zw(o)},[o]);return v.createElement(Iw,{styles:Rw(i,!t,o,n?"":"!important")})},Di=!1;if(typeof window<"u")try{var Pr=Object.defineProperty({},"passive",{get:function(){return Di=!0,!0}});window.addEventListener("test",Pr,Pr),window.removeEventListener("test",Pr,Pr)}catch{Di=!1}var vn=Di?{passive:!1}:!1,Dw=function(e){return e.tagName==="TEXTAREA"},vd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Dw(e)&&n[t]==="visible")},Mw=function(e){return vd(e,"overflowY")},Lw=function(e){return vd(e,"overflowX")},fl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=bd(e,r);if(o){var i=wd(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Fw=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$w=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bd=function(e,t){return e==="v"?Mw(t):Lw(t)},wd=function(e,t){return e==="v"?Fw(t):$w(t)},Bw=function(e,t){return e==="h"&&t==="rtl"?-1:1},Uw=function(e,t,n,r,o){var i=Bw(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=wd(e,a),y=f[0],m=f[1],x=f[2],g=m-x-i*y;(y||g)&&bd(e,a)&&(h+=g,p+=y);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(h)<1||!d&&Math.abs(p)<1)&&(u=!0),u},Or=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hl=function(e){return[e.deltaX,e.deltaY]},pl=function(e){return e&&"current"in e?e.current:e},Zw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vw=function(e){return`
|
|
78
78
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
79
79
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
80
|
-
`)},Ww=0,bn=[];function Hw(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(Ww++)[0],i=v.useState(yd)[0],s=v.useRef(e);v.useEffect(function(){s.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=hw([e.lockRef.current],(e.shards||[]).map(pl),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=Or(m),b=n.current,k="deltaX"in m?m.deltaX:b[0]-g[0],S="deltaY"in m?m.deltaY:b[1]-g[1],
|
|
80
|
+
`)},Ww=0,bn=[];function Hw(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(Ww++)[0],i=v.useState(yd)[0],s=v.useRef(e);v.useEffect(function(){s.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=hw([e.lockRef.current],(e.shards||[]).map(pl),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=v.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=Or(m),b=n.current,k="deltaX"in m?m.deltaX:b[0]-g[0],S="deltaY"in m?m.deltaY:b[1]-g[1],N,C=m.target,j=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in m&&j==="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 U=fl(j,C);if(!U)return!0;if(U?N=j:(N=j==="v"?"h":"v",U=fl(j,C)),!U)return!1;if(!r.current&&"changedTouches"in m&&(k||S)&&(r.current=N),!N)return!0;var E=r.current||N;return Uw(E,x,m,E==="h"?k:S)},[]),l=v.useCallback(function(m){var x=m;if(!(!bn.length||bn[bn.length-1]!==i)){var g="deltaY"in x?hl(x):Or(x),b=t.current.filter(function(N){return N.name===x.type&&(N.target===x.target||x.target===N.shadowParent)&&Zw(N.delta,g)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var k=(s.current.shards||[]).map(pl).filter(Boolean).filter(function(N){return N.contains(x.target)}),S=k.length>0?a(x,k[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=v.useCallback(function(m,x,g,b){var k={name:m,delta:x,target:g,should:b,shadowParent:qw(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),d=v.useCallback(function(m){n.current=Or(m),r.current=void 0},[]),h=v.useCallback(function(m){u(m.type,hl(m),m.target,a(m,e.lockRef.current))},[]),p=v.useCallback(function(m){u(m.type,Or(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return bn.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,vn),document.addEventListener("touchmove",l,vn),document.addEventListener("touchstart",d,vn),function(){bn=bn.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,vn),document.removeEventListener("touchmove",l,vn),document.removeEventListener("touchstart",d,vn)}},[]);var f=e.removeScrollBar,y=e.inert;return v.createElement(v.Fragment,null,y?v.createElement(i,{styles:Vw(o)}):null,f?v.createElement(Ow,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kw=kw(xd,Hw);var Ps=v.forwardRef(function(e,t){return v.createElement(No,Nt({},e,{ref:t,sideCar:Kw}))});Ps.classNames=No.classNames;var Gw=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wn=new WeakMap,Dr=new WeakMap,Mr={},ai=0,kd=function(e){return e&&(e.host||kd(e.parentNode))},Jw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kd(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})},Yw=function(e,t,n,r){var o=Jw(t,Array.isArray(e)?e:[e]);Mr[n]||(Mr[n]=new WeakMap);var i=Mr[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),y=f!==null&&f!=="false",m=(wn.get(p)||0)+1,x=(i.get(p)||0)+1;wn.set(p,m),i.set(p,x),s.push(p),m===1&&y&&Dr.set(p,!0),x===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return d(t),a.clear(),ai++,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||(Dr.has(h)||h.removeAttribute(r),Dr.delete(h)),f||h.removeAttribute(n)}),ai--,ai||(wn=new WeakMap,wn=new WeakMap,Dr=new WeakMap,Mr={})}},_d=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Gw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Yw(r,o,n,"aria-hidden")):function(){return null}},To="Dialog",[Sd]=Wt(To),[Xw,Ct]=Sd(To),Cd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=v.useRef(null),l=v.useRef(null),[u,d]=an({prop:r,defaultProp:o??!1,onChange:i,caller:To});return c.jsx(Xw,{scope:t,triggerRef:a,contentRef:l,contentId:zt(),titleId:zt(),descriptionId:zt(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(h=>!h),[d]),modal:s,children:n})};Cd.displayName=To;var Ed="DialogTrigger",jd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Ed,n),i=Pe(t,o.triggerRef);return c.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ms(o.open),...r,ref:i,onClick:ke(e.onClick,o.onOpenToggle)})});jd.displayName=Ed;var Os="DialogPortal",[Qw,Nd]=Sd(Os,{forceMount:void 0}),Td=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Ct(Os,t);return c.jsx(Qw,{scope:t,forceMount:n,children:v.Children.map(r,s=>c.jsx(xt,{present:n||i.open,children:c.jsx(jo,{asChild:!0,container:o,children:s})}))})};Td.displayName=Os;var oo="DialogOverlay",Ad=v.forwardRef((e,t)=>{const n=Nd(oo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ct(oo,e.__scopeDialog);return i.modal?c.jsx(xt,{present:r||i.open,children:c.jsx(t2,{...o,ref:t})}):null});Ad.displayName=oo;var e2=Mn("DialogOverlay.RemoveScroll"),t2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(oo,n);return c.jsx(Ps,{as:e2,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Ce.div,{"data-state":Ms(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ln="DialogContent",zd=v.forwardRef((e,t)=>{const n=Nd(ln,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Ct(ln,e.__scopeDialog);return c.jsx(xt,{present:r||i.open,children:i.modal?c.jsx(n2,{...o,ref:t}):c.jsx(r2,{...o,ref:t})})});zd.displayName=ln;var n2=v.forwardRef((e,t)=>{const n=Ct(ln,e.__scopeDialog),r=v.useRef(null),o=Pe(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return _d(i)},[]),c.jsx(Id,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,i=>i.preventDefault())})}),r2=v.forwardRef((e,t)=>{const n=Ct(ln,e.__scopeDialog),r=v.useRef(!1),o=v.useRef(!1);return c.jsx(Id,{...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()}})}),Id=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Ct(ln,n),l=v.useRef(null),u=Pe(t,l);return pd(),c.jsxs(c.Fragment,{children:[c.jsx(Rs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(Eo,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ms(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(i2,{titleId:a.titleId}),c.jsx(a2,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Ds="DialogTitle",Rd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Ds,n);return c.jsx(Ce.h2,{id:o.titleId,...r,ref:t})});Rd.displayName=Ds;var Pd="DialogDescription",o2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Pd,n);return c.jsx(Ce.p,{id:o.descriptionId,...r,ref:t})});o2.displayName=Pd;var Od="DialogClose",Dd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Ct(Od,n);return c.jsx(Ce.button,{type:"button",...r,ref:t,onClick:ke(e.onClick,()=>o.onOpenChange(!1))})});Dd.displayName=Od;function Ms(e){return e?"open":"closed"}var Md="DialogTitleWarning",[fT,Ld]=D1(Md,{contentName:ln,titleName:Ds,docsSlug:"dialog"}),i2=({titleId:e})=>{const t=Ld(Md),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
81
81
|
|
|
82
82
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
83
83
|
|
|
84
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},s2="DialogDescriptionWarning",a2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ld(s2).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},l2=Cd,c2=Nd,u2=Td,d2=Ad,f2=zd,h2=Rd,p2=Dd;function m2(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function g2(e){const[t,n]=v.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 x2=["top","right","bottom","left"],Yt=Math.min,ut=Math.max,io=Math.round,Lr=Math.floor,It=e=>({x:e,y:e}),y2={left:"right",right:"left",bottom:"top",top:"bottom"},v2={start:"end",end:"start"};function Mi(e,t,n){return ut(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 Ls(e){return e==="x"?"y":"x"}function Fs(e){return e==="y"?"height":"width"}const b2=new Set(["top","bottom"]);function At(e){return b2.has(Ut(e))?"y":"x"}function $s(e){return Ls(At(e))}function w2(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=$s(e),i=Fs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=so(s)),[s,so(s)]}function k2(e){const t=so(e);return[Li(e),t,Li(t)]}function Li(e){return e.replace(/start|end/g,t=>v2[t])}const ml=["left","right"],gl=["right","left"],_2=["top","bottom"],S2=["bottom","top"];function C2(e,t,n){switch(e){case"top":case"bottom":return n?t?gl:ml:t?ml:gl;case"left":case"right":return t?_2:S2;default:return[]}}function E2(e,t,n,r){const o=qn(e);let i=C2(Ut(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Li)))),i}function so(e){return e.replace(/left|right|bottom|top/g,t=>y2[t])}function N2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fd(e){return typeof e!="number"?N2(e):{top:e,right:e,bottom:e,left:e}}function ao(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 xl(e,t,n){let{reference:r,floating:o}=e;const i=At(t),s=$s(t),a=Fs(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 j2(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),y=Fd(f),x=a[p?h==="floating"?"reference":"floating":h],g=ao(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),b=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},j=ao(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:k,strategy:l}):b);return{top:(g.top-j.top+y.top)/S.y,bottom:(j.bottom-g.bottom+y.bottom)/S.y,left:(g.left-j.left+y.left)/S.x,right:(j.right-g.right+y.right)/S.x}}const T2=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}=xl(u,r,l),p=r,f={},y=0;for(let x=0;x<a.length;x++){var m;const{name:g,fn:b}=a[x],{x:k,y:S,data:j,reset:C}=await b({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:j2},elements:{reference:e,floating:t}});d=k??d,h=S??h,f={...f,[g]:{...f[g],...j}},C&&y<=50&&(y++,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}=xl(u,p,l)),x=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:f}},A2=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=Fd(d),p={x:n,y:r},f=$s(o),y=Fs(f),m=await s.getDimensions(u),x=f==="y",g=x?"top":"left",b=x?"bottom":"right",k=x?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[f]-p[f]-i.floating[y],j=p[f]-i.reference[f],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let N=C?C[k]:0;(!N||!await(s.isElement==null?void 0:s.isElement(C)))&&(N=a.floating[k]||i.floating[y]);const I=S/2-j/2,P=N/2-m[y]/2-1,M=Yt(h[g],P),U=Yt(h[b],P),E=M,D=N-m[y]-U,w=N/2-m[y]/2+I,O=Mi(E,w,D),J=!l.arrow&&qn(o)!=null&&w!==O&&i.reference[y]/2-(w<E?M:U)-m[y]/2<0,W=J?w<E?w-E:w-D:0;return{[f]:p[f]+W,data:{[f]:O,centerOffset:w-O-W,...J&&{alignmentOffset:W}},reset:J}}}),z2=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:y="none",flipAlignment:m=!0,...x}=Bt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ut(o),b=At(a),k=Ut(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),j=p||(k||!m?[so(a)]:k2(a)),C=y!=="none";!p&&C&&j.push(...E2(a,m,y,S));const N=[a,...j],I=await l.detectOverflow(t,x),P=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(I[g]),h){const w=w2(o,s,S);P.push(I[w[0]],I[w[1]])}if(M=[...M,{placement:o,overflows:P}],!P.every(w=>w<=0)){var U,E;const w=(((U=i.flip)==null?void 0:U.index)||0)+1,O=N[w];if(O&&(!(h==="alignment"?b!==At(O):!1)||M.every(q=>At(q.placement)===b?q.overflows[0]>0:!0)))return{data:{index:w,overflows:M},reset:{placement:O}};let J=(E=M.filter(W=>W.overflows[0]<=0).sort((W,q)=>W.overflows[1]-q.overflows[1])[0])==null?void 0:E.placement;if(!J)switch(f){case"bestFit":{var D;const W=(D=M.filter(q=>{if(C){const Y=At(q.placement);return Y===b||Y==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,T)=>Y+T,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:D[0];W&&(J=W);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function yl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vl(e){return x2.some(t=>e[t]>=0)}const I2=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=yl(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=yl(s,n.floating);return{data:{escapedOffsets:a,escaped:vl(a)}}}default:return{}}}}},$d=new Set(["left","top"]);async function R2(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=$d.has(s)?-1:1,d=i&&l?-1:1,h=Bt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof y=="number"&&(f=a==="end"?y*-1:y),l?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const P2=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 R2(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}}}}},O2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:b,y:k}=g;return{x:b,y:k}}},...u}=Bt(e,t),d={x:n,y:r},h=await i.detectOverflow(t,u),p=At(Ut(o)),f=Ls(p);let y=d[f],m=d[p];if(s){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",k=y+h[g],S=y-h[b];y=Mi(k,y,S)}if(a){const g=p==="y"?"top":"left",b=p==="y"?"bottom":"right",k=m+h[g],S=m-h[b];m=Mi(k,m,S)}const x=l.fn({...t,[f]:y,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:s,[p]:a}}}}}},D2=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=Ls(h);let f=d[p],y=d[h];const m=Bt(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const k=p==="y"?"height":"width",S=i.reference[p]-i.floating[k]+x.mainAxis,j=i.reference[p]+i.reference[k]-x.mainAxis;f<S?f=S:f>j&&(f=j)}if(u){var g,b;const k=p==="y"?"width":"height",S=$d.has(Ut(o)),j=i.reference[h]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[h])||0)+(S?0:x.crossAxis),C=i.reference[h]+i.reference[k]+(S?0:((b=s.offset)==null?void 0:b[h])||0)-(S?x.crossAxis:0);y<j?y=j:y>C&&(y=C)}return{[p]:f,[h]:y}}}},M2=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:y,height:m}=i.floating;let x,g;h==="top"||h==="bottom"?(x=h,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,x=p==="end"?"top":"bottom");const b=m-d.top-d.bottom,k=y-d.left-d.right,S=Yt(m-d[x],b),j=Yt(y-d[g],k),C=!t.middlewareData.shift;let N=S,I=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=b),C&&!p){const M=ut(d.left,0),U=ut(d.right,0),E=ut(d.top,0),D=ut(d.bottom,0);f?I=y-2*(M!==0||U!==0?M+U:ut(d.left,d.right)):N=m-2*(E!==0||D!==0?E+D:ut(d.top,d.bottom))}await l({...t,availableWidth:I,availableHeight:N});const P=await s.getDimensions(a.floating);return y!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<"u"}function Kn(e){return Bd(e)?(e.nodeName||"").toLowerCase():"#document"}function ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ot(e){var t;return(t=(Bd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bd(e){return Ao()?e instanceof Node||e instanceof ht(e).Node:!1}function _t(e){return Ao()?e instanceof Element||e instanceof ht(e).Element:!1}function Rt(e){return Ao()?e instanceof HTMLElement||e instanceof ht(e).HTMLElement:!1}function bl(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot}const L2=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)&&!L2.has(o)}const F2=new Set(["table","td","th"]);function $2(e){return F2.has(Kn(e))}const B2=[":popover-open",":modal"];function zo(e){return B2.some(t=>{try{return e.matches(t)}catch{return!1}})}const U2=["transform","translate","scale","rotate","perspective"],Z2=["transform","translate","scale","rotate","perspective","filter"],V2=["paint","layout","strict","content"];function Bs(e){const t=Us(),n=_t(e)?St(e):e;return U2.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)||Z2.some(r=>(n.willChange||"").includes(r))||V2.some(r=>(n.contain||"").includes(r))}function W2(e){let t=Xt(e);for(;Rt(t)&&!Ln(t);){if(Bs(t))return t;if(zo(t))return null;t=Xt(t)}return null}function Us(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const H2=new Set(["html","body","#document"]);function Ln(e){return H2.has(Kn(e))}function St(e){return ht(e).getComputedStyle(e)}function Io(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||bl(e)&&e.host||Ot(e);return bl(t)?t.host:t}function Ud(e){const t=Xt(e);return Ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&br(t)?t:Ud(t)}function mr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ud(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ht(o);if(i){const a=Fi(s);return t.concat(s,s.visualViewport||[],br(o)?o:[],a&&n?mr(a):[])}return t.concat(o,mr(o,[],n))}function Fi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zd(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=io(n)!==i||io(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Zs(e){return _t(e)?e:e.contextElement}function zn(e){const t=Zs(e);if(!Rt(t))return It(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zd(t);let s=(i?io(n.width):n.width)/r,a=(i?io(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const q2=It(0);function Vd(e){const t=ht(e);return!Us()||!t.visualViewport?q2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ht(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Zs(e);let s=It(1);t&&(r?_t(r)&&(s=zn(r)):s=zn(e));const a=K2(i,n,r)?Vd(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=ht(i),f=r&&_t(r)?ht(r):r;let y=p,m=Fi(y);for(;m&&r&&f!==y;){const x=zn(m),g=m.getBoundingClientRect(),b=St(m),k=g.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,S=g.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,h*=x.y,l+=k,u+=S,y=ht(m),m=Fi(y)}}return ao({width:d,height:h,x:l,y:u})}function Ro(e,t){const n=Io(e).scrollLeft;return t?t.left+n:cn(Ot(e)).left+n}function Wd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ro(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function G2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ot(r),a=t?zo(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=Io(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?Wd(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 J2(e){return Array.from(e.getClientRects())}function Y2(e){const t=Ot(e),n=Io(e),r=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ro(e);const a=-n.scrollTop;return St(r).direction==="rtl"&&(s+=ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const wl=25;function X2(e,t){const n=ht(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=Us();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Ro(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,y=Math.abs(r.clientWidth-h.clientWidth-f);y<=wl&&(i-=y)}else u<=wl&&(i+=u);return{width:i,height:s,x:a,y:l}}const Q2=new Set(["absolute","fixed"]);function ek(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 kl(e,t,n){let r;if(t==="viewport")r=X2(e,n);else if(t==="document")r=Y2(Ot(e));else if(_t(t))r=ek(t,n);else{const o=Vd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ao(r)}function Hd(e,t){const n=Xt(e);return n===t||!_t(n)||Ln(n)?!1:St(n).position==="fixed"||Hd(n,t)}function tk(e,t){const n=t.get(e);if(n)return n;let r=mr(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=Bs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Q2.has(o.position)||br(s)&&!l&&Hd(e,s))?r=r.filter(d=>d!==s):o=a,s=Xt(s)}return t.set(e,r),r}function nk(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?zo(t)?[]:tk(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=kl(t,d,o);return u.top=ut(h.top,u.top),u.right=Yt(h.right,u.right),u.bottom=Yt(h.bottom,u.bottom),u.left=ut(h.left,u.left),u},kl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rk(e){const{width:t,height:n}=Zd(e);return{width:t,height:n}}function ok(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=Ro(o)}if(r||!r&&!i)if((Kn(t)!=="body"||br(o))&&(a=Io(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?Wd(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 li(e){return St(e).position==="static"}function _l(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 qd(e,t){const n=ht(e);if(zo(e))return n;if(!Rt(e)){let o=Xt(e);for(;o&&!Ln(o);){if(_t(o)&&!li(o))return o;o=Xt(o)}return n}let r=_l(e,t);for(;r&&$2(r)&&li(r);)r=_l(r,t);return r&&Ln(r)&&li(r)&&!Bs(r)?n:r||W2(e)||n}const ik=async function(e){const t=this.getOffsetParent||qd,n=this.getDimensions,r=await n(e.floating);return{reference:ok(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sk(e){return St(e).direction==="rtl"}const ak={convertOffsetParentRelativeRectToViewportRelativeRect:G2,getDocumentElement:Ot,getClippingRect:nk,getOffsetParent:qd,getElementRects:ik,getClientRects:J2,getDimensions:rk,getScale:zn,isElement:_t,isRTL:sk};function Kd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lk(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 y=Lr(h),m=Lr(o.clientWidth-(d+p)),x=Lr(o.clientHeight-(h+f)),g=Lr(d),k={rootMargin:-y+"px "+-m+"px "+-x+"px "+-g+"px",threshold:ut(0,Yt(1,l))||1};let S=!0;function j(C){const N=C[0].intersectionRatio;if(N!==l){if(!S)return s();N?s(!1,N):r=setTimeout(()=>{s(!1,1e-7)},1e3)}N===1&&!Kd(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(j,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,k)}n.observe(e)}return s(!0),i}function ck(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=Zs(e),d=o||i?[...u?mr(u):[],...mr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const h=u&&a?lk(u,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let y,m=l?cn(e):null;l&&x();function x(){const g=cn(e);m&&!Kd(m,g)&&n(),m=g,y=requestAnimationFrame(x)}return n(),()=>{var g;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(y)}}const uk=P2,dk=O2,fk=z2,hk=M2,pk=I2,Sl=A2,mk=D2,gk=(e,t,n)=>{const r=new Map,o={platform:ak,...n},i={...o.platform,_c:r};return T2(e,t,{...o,platform:i})};var xk=typeof document<"u",yk=function(){},qr=xk?v.useLayoutEffect:yk;function lo(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(!lo(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)&&!lo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Gd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cl(e,t){const n=Gd(e);return Math.round(t*n)/n}function ci(e){const t=v.useRef(e);return qr(()=>{t.current=e}),t}function vk(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=v.useState(r);lo(p,r)||f(r);const[y,m]=v.useState(null),[x,g]=v.useState(null),b=v.useCallback(q=>{q!==C.current&&(C.current=q,m(q))},[]),k=v.useCallback(q=>{q!==N.current&&(N.current=q,g(q))},[]),S=i||y,j=s||x,C=v.useRef(null),N=v.useRef(null),I=v.useRef(d),P=l!=null,M=ci(l),U=ci(o),E=ci(u),D=v.useCallback(()=>{if(!C.current||!N.current)return;const q={placement:t,strategy:n,middleware:p};U.current&&(q.platform=U.current),gk(C.current,N.current,q).then(Y=>{const T={...Y,isPositioned:E.current!==!1};w.current&&!lo(I.current,T)&&(I.current=T,yr.flushSync(()=>{h(T)}))})},[p,t,n,U,E]);qr(()=>{u===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(q=>({...q,isPositioned:!1})))},[u]);const w=v.useRef(!1);qr(()=>(w.current=!0,()=>{w.current=!1}),[]),qr(()=>{if(S&&(C.current=S),j&&(N.current=j),S&&j){if(M.current)return M.current(S,j,D);D()}},[S,j,D,M,P]);const O=v.useMemo(()=>({reference:C,floating:N,setReference:b,setFloating:k}),[b,k]),J=v.useMemo(()=>({reference:S,floating:j}),[S,j]),W=v.useMemo(()=>{const q={position:n,left:0,top:0};if(!J.floating)return q;const Y=Cl(J.floating,d.x),T=Cl(J.floating,d.y);return a?{...q,transform:"translate("+Y+"px, "+T+"px)",...Gd(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:T}},[n,a,J.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:D,refs:O,elements:J,floatingStyles:W}),[d,D,O,J,W])}const bk=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?Sl({element:r.current,padding:o}).fn(n):{}:r?Sl({element:r,padding:o}).fn(n):{}}}},wk=(e,t)=>({...uk(e),options:[e,t]}),kk=(e,t)=>({...dk(e),options:[e,t]}),_k=(e,t)=>({...mk(e),options:[e,t]}),Sk=(e,t)=>({...fk(e),options:[e,t]}),Ck=(e,t)=>({...hk(e),options:[e,t]}),Ek=(e,t)=>({...pk(e),options:[e,t]}),Nk=(e,t)=>({...bk(e),options:[e,t]});var jk="Arrow",Jd=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return c.jsx(Ce.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"})})});Jd.displayName=jk;var Tk=Jd,Vs="Popper",[Yd,Po]=Wt(Vs),[Ak,Xd]=Yd(Vs),Qd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.useState(null);return c.jsx(Ak,{scope:t,anchor:r,onAnchorChange:o,children:n})};Qd.displayName=Vs;var ef="PopperAnchor",tf=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Xd(ef,n),s=v.useRef(null),a=Pe(t,s),l=v.useRef(null);return v.useEffect(()=>{const u=l.current;l.current=r?.current||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:c.jsx(Ce.div,{...o,ref:a})});tf.displayName=ef;var Ws="PopperContent",[zk,Ik]=Yd(Ws),nf=v.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:y,...m}=e,x=Xd(Ws,n),[g,b]=v.useState(null),k=Pe(t,Q=>b(Q)),[S,j]=v.useState(null),C=g2(S),N=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},U=Array.isArray(u)?u:[u],E=U.length>0,D={padding:M,boundary:U.filter(Pk),altBoundary:E},{refs:w,floatingStyles:O,placement:J,isPositioned:W,middlewareData:q}=vk({strategy:"fixed",placement:P,whileElementsMounted:(...Q)=>ck(...Q,{animationFrame:f==="always"}),elements:{reference:x.anchor},middleware:[wk({mainAxis:o+I,alignmentAxis:s}),l&&kk({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?_k():void 0,...D}),l&&Sk({...D}),Ck({...D,apply:({elements:Q,rects:ce,availableWidth:de,availableHeight:ge})=>{const{width:xe,height:Ne}=ce.reference,Oe=Q.floating.style;Oe.setProperty("--radix-popper-available-width",`${de}px`),Oe.setProperty("--radix-popper-available-height",`${ge}px`),Oe.setProperty("--radix-popper-anchor-width",`${xe}px`),Oe.setProperty("--radix-popper-anchor-height",`${Ne}px`)}}),S&&Nk({element:S,padding:a}),Ok({arrowWidth:N,arrowHeight:I}),p&&Ek({strategy:"referenceHidden",...D})]}),[Y,T]=sf(J),F=tt(y);Ke(()=>{W&&F?.()},[W,F]);const $=q.arrow?.x,A=q.arrow?.y,te=q.arrow?.centerOffset!==0,[G,le]=v.useState();return Ke(()=>{g&&le(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:W?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(zk,{scope:n,placedSide:Y,onArrowChange:j,arrowX:$,arrowY:A,shouldHideArrow:te,children:c.jsx(Ce.div,{"data-side":Y,"data-align":T,...m,ref:k,style:{...m.style,animation:W?void 0:"none"}})})})});nf.displayName=Ws;var rf="PopperArrow",Rk={top:"bottom",right:"left",bottom:"top",left:"right"},of=v.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Ik(rf,r),s=Rk[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(Tk,{...o,ref:n,style:{...o.style,display:"block"}})})});of.displayName=rf;function Pk(e){return e!==null}var Ok=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]=sf(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2;let y="",m="";return u==="bottom"?(y=s?h:`${p}px`,m=`${-l}px`):u==="top"?(y=s?h:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,m=s?h:`${f}px`):u==="left"&&(y=`${r.floating.width+l}px`,m=s?h:`${f}px`),{data:{x:y,y:m}}}});function sf(e){const[t,n="center"]=e.split("-");return[t,n]}var af=Qd,lf=tf,cf=nf,uf=of,ui="rovingFocusGroup.onEntryFocus",Dk={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[$i,df,Mk]=sd(wr),[Lk,ff]=Wt(wr,[Mk]),[Fk,$k]=Lk(wr),hf=v.forwardRef((e,t)=>c.jsx($i.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx($i.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Bk,{...e,ref:t})})}));hf.displayName=wr;var Bk=v.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=v.useRef(null),f=Pe(t,p),y=Co(i),[m,x]=an({prop:s,defaultProp:a??null,onChange:l,caller:wr}),[g,b]=v.useState(!1),k=tt(u),S=df(n),j=v.useRef(!1),[C,N]=v.useState(0);return v.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(ui,k),()=>I.removeEventListener(ui,k)},[k]),c.jsx(Fk,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(I=>x(I),[x]),onItemShiftTab:v.useCallback(()=>b(!0),[]),onFocusableItemAdd:v.useCallback(()=>N(I=>I+1),[]),onFocusableItemRemove:v.useCallback(()=>N(I=>I-1),[]),children:c.jsx(Ce.div,{tabIndex:g||C===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{j.current=!0}),onFocus:ke(e.onFocus,I=>{const P=!j.current;if(I.target===I.currentTarget&&P&&!g){const M=new CustomEvent(ui,Dk);if(I.currentTarget.dispatchEvent(M),!M.defaultPrevented){const U=S().filter(J=>J.focusable),E=U.find(J=>J.active),D=U.find(J=>J.id===m),O=[E,D,...U].filter(Boolean).map(J=>J.ref.current);gf(O,d)}}j.current=!1}),onBlur:ke(e.onBlur,()=>b(!1))})})}),pf="RovingFocusGroupItem",mf=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=zt(),u=i||l,d=$k(pf,n),h=d.currentTabStopId===u,p=df(n),{onFocusableItemAdd:f,onFocusableItemRemove:y,currentTabStopId:m}=d;return v.useEffect(()=>{if(r)return f(),()=>y()},[r,f,y]),c.jsx($i.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ke(e.onMouseDown,x=>{r?d.onItemFocus(u):x.preventDefault()}),onFocus:ke(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ke(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=Vk(x,d.orientation,d.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();const S=k.indexOf(x.currentTarget);k=d.loop?Wk(k,S+1):k.slice(S+1)}setTimeout(()=>gf(k))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});mf.displayName=pf;var Uk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vk(e,t,n){const r=Zk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Uk[r]}function gf(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hk=hf,qk=mf;function Bi(e,[t,n]){return Math.min(n,Math.max(t,e))}function Kk(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Hs="ScrollArea",[xf]=Wt(Hs),[Gk,yt]=xf(Hs),yf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=v.useState(null),[u,d]=v.useState(null),[h,p]=v.useState(null),[f,y]=v.useState(null),[m,x]=v.useState(null),[g,b]=v.useState(0),[k,S]=v.useState(0),[j,C]=v.useState(!1),[N,I]=v.useState(!1),P=Pe(t,U=>l(U)),M=Co(o);return c.jsx(Gk,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:y,scrollbarXEnabled:j,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:N,onScrollbarYEnabledChange:I,onCornerWidthChange:b,onCornerHeightChange:S,children:c.jsx(Ce.div,{dir:M,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});yf.displayName=Hs;var vf="ScrollAreaViewport",bf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=yt(vf,n),a=v.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(Ce.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})})]})});bf.displayName=vf;var Dt="ScrollAreaScrollbar",wf=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yt(Dt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return v.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?c.jsx(Jk,{...r,ref:t,forceMount:n}):o.type==="scroll"?c.jsx(Yk,{...r,ref:t,forceMount:n}):o.type==="auto"?c.jsx(kf,{...r,ref:t,forceMount:n}):o.type==="always"?c.jsx(qs,{...r,ref:t}):null});wf.displayName=Dt;var Jk=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yt(Dt,e.__scopeScrollArea),[i,s]=v.useState(!1);return v.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(xt,{present:n||i,children:c.jsx(kf,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Yk=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yt(Dt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Do(()=>l("SCROLL_END"),100),[a,l]=Kk("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 v.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,l]),v.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(xt,{present:n||a!=="hidden",children:c.jsx(qs,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),kf=v.forwardRef((e,t)=>{const n=yt(Dt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=v.useState(!1),a=e.orientation==="horizontal",l=Do(()=>{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(xt,{present:r||i,children:c.jsx(qs,{"data-state":i?"visible":"hidden",...o,ref:t})})}),qs=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=yt(Dt,e.__scopeScrollArea),i=v.useRef(null),s=v.useRef(0),[a,l]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Nf(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 r_(p,s.current,a,f)}return n==="horizontal"?c.jsx(Xk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,f=El(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(Qk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,f=El(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}),Xk=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=yt(Dt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),u=Pe(t,l,i.onScrollbarXChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(Sf,{"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":Oo(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),Tf(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:uo(s.paddingLeft),paddingEnd:uo(s.paddingRight)}})}})}),Qk=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=yt(Dt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),u=Pe(t,l,i.onScrollbarYChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(Sf,{"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":Oo(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),Tf(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:uo(s.paddingTop),paddingEnd:uo(s.paddingBottom)}})}})}),[e_,_f]=xf(Dt),Sf=v.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=yt(Dt,n),[y,m]=v.useState(null),x=Pe(t,P=>m(P)),g=v.useRef(null),b=v.useRef(""),k=f.viewport,S=r.content-r.viewport,j=tt(d),C=tt(l),N=Do(h,10);function I(P){if(g.current){const M=P.clientX-g.current.left,U=P.clientY-g.current.top;u({x:M,y:U})}}return v.useEffect(()=>{const P=M=>{const U=M.target;y?.contains(U)&&j(M,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[k,y,S,j]),v.useEffect(C,[r,C]),Fn(y,N),Fn(f.content,N),c.jsx(e_,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:tt(i),onThumbPointerUp:tt(s),onThumbPositionChange:C,onThumbPointerDown:tt(a),children:c.jsx(Ce.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:ke(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=y.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),I(P))}),onPointerMove:ke(e.onPointerMove,I),onPointerUp:ke(e.onPointerUp,P=>{const M=P.target;M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=b.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),co="ScrollAreaThumb",Cf=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_f(co,e.__scopeScrollArea);return c.jsx(xt,{present:n||o.hasThumb,children:c.jsx(t_,{ref:t,...r})})}),t_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=yt(co,n),s=_f(co,n),{onThumbPositionChange:a}=s,l=Pe(t,h=>s.onThumbChange(h)),u=v.useRef(void 0),d=Do(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(d(),!u.current){const f=o_(h,a);u.current=f,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,d,a]),c.jsx(Ce.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:ke(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),y=h.clientX-f.left,m=h.clientY-f.top;s.onThumbPointerDown({x:y,y:m})}),onPointerUp:ke(e.onPointerUp,s.onThumbPointerUp)})});Cf.displayName=co;var Ks="ScrollAreaCorner",Ef=v.forwardRef((e,t)=>{const n=yt(Ks,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(n_,{...e,ref:t}):null});Ef.displayName=Ks;var n_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=yt(Ks,n),[i,s]=v.useState(0),[a,l]=v.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(Ce.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 uo(e){return e?parseInt(e,10):0}function Nf(e,t){const n=e/t;return isNaN(n)?0:n}function Oo(e){const t=Nf(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function r_(e,t,n,r="ltr"){const o=Oo(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 jf([l,u],h)(e)}function El(e,t,n="ltr"){const r=Oo(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=Bi(e,l);return jf([0,s],[0,a])(u)}function jf(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 Tf(e,t){return e>0&&e<t}var o_=(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 Do(e,t){const n=tt(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Fn(e,t){const n=tt(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 i_=yf,s_=bf,a_=Ef,l_=[" ","Enter","ArrowUp","ArrowDown"],c_=[" ","Enter"],un="Select",[Mo,Lo,u_]=sd(un),[Gn]=Wt(un,[u_,Po]),Fo=Po(),[d_,tn]=Gn(un),[f_,h_]=Gn(un),Af=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:y}=e,m=Fo(t),[x,g]=v.useState(null),[b,k]=v.useState(null),[S,j]=v.useState(!1),C=Co(u),[N,I]=an({prop:r,defaultProp:o??!1,onChange:i,caller:un}),[P,M]=an({prop:s,defaultProp:a,onChange:l,caller:un}),U=v.useRef(null),E=x?y||!!x.closest("form"):!0,[D,w]=v.useState(new Set),O=Array.from(D).map(J=>J.props.value).join(";");return c.jsx(af,{...m,children:c.jsxs(d_,{required:f,scope:t,trigger:x,onTriggerChange:g,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:zt(),value:P,onValueChange:M,open:N,onOpenChange:I,dir:C,triggerPointerDownPosRef:U,disabled:p,children:[c.jsx(Mo.Provider,{scope:t,children:c.jsx(f_,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(J=>{w(W=>new Set(W).add(J))},[]),onNativeOptionRemove:v.useCallback(J=>{w(W=>{const q=new Set(W);return q.delete(J),q})},[]),children:n})}),E?c.jsxs(Xf,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:P,onChange:J=>M(J.target.value),disabled:p,form:y,children:[P===void 0?c.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};Af.displayName=un;var zf="SelectTrigger",If=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Fo(n),s=tn(zf,n),a=s.disabled||r,l=Pe(t,s.onTriggerChange),u=Lo(n),d=v.useRef("touch"),[h,p,f]=eh(m=>{const x=u().filter(k=>!k.disabled),g=x.find(k=>k.value===s.value),b=th(x,m,g);b!==void 0&&s.onValueChange(b.value)}),y=m=>{a||(s.onOpenChange(!0),f()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(lf,{asChild:!0,...i,children:c.jsx(Ce.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":Qf(s.value)?"":void 0,...o,ref:l,onClick:ke(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&y(m)}),onPointerDown:ke(o.onPointerDown,m=>{d.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:ke(o.onKeyDown,m=>{const x=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(x&&m.key===" ")&&l_.includes(m.key)&&(y(),m.preventDefault())})})})});If.displayName=zf;var Rf="SelectValue",Pf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=tn(Rf,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=Pe(t,l.onValueNodeChange);return Ke(()=>{u(d)},[u,d]),c.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:Qf(l.value)?c.jsx(c.Fragment,{children:s}):i})});Pf.displayName=Rf;var p_="SelectIcon",Of=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Of.displayName=p_;var m_="SelectPortal",Df=e=>c.jsx(No,{asChild:!0,...e});Df.displayName=m_;var dn="SelectContent",Mf=v.forwardRef((e,t)=>{const n=tn(dn,e.__scopeSelect),[r,o]=v.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?yr.createPortal(c.jsx(Lf,{scope:e.__scopeSelect,children:c.jsx(Mo.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(Ff,{...e,ref:t})});Mf.displayName=dn;var bt=10,[Lf,nn]=Gn(dn),g_="SelectContentImpl",x_=Mn("SelectContent.RemoveScroll"),Ff=v.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:y,hideWhenDetached:m,avoidCollisions:x,...g}=e,b=tn(dn,n),[k,S]=v.useState(null),[j,C]=v.useState(null),N=Pe(t,Q=>S(Q)),[I,P]=v.useState(null),[M,U]=v.useState(null),E=Lo(n),[D,w]=v.useState(!1),O=v.useRef(!1);v.useEffect(()=>{if(k)return _d(k)},[k]),pd();const J=v.useCallback(Q=>{const[ce,...de]=E().map(Ne=>Ne.ref.current),[ge]=de.slice(-1),xe=document.activeElement;for(const Ne of Q)if(Ne===xe||(Ne?.scrollIntoView({block:"nearest"}),Ne===ce&&j&&(j.scrollTop=0),Ne===ge&&j&&(j.scrollTop=j.scrollHeight),Ne?.focus(),document.activeElement!==xe))return},[E,j]),W=v.useCallback(()=>J([I,k]),[J,I,k]);v.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:q,triggerPointerDownPosRef:Y}=b;v.useEffect(()=>{if(k){let Q={x:0,y:0};const ce=ge=>{Q={x:Math.abs(Math.round(ge.pageX)-(Y.current?.x??0)),y:Math.abs(Math.round(ge.pageY)-(Y.current?.y??0))}},de=ge=>{Q.x<=10&&Q.y<=10?ge.preventDefault():k.contains(ge.target)||q(!1),document.removeEventListener("pointermove",ce),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",de,{capture:!0})}}},[k,q,Y]),v.useEffect(()=>{const Q=()=>q(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[q]);const[T,F]=eh(Q=>{const ce=E().filter(xe=>!xe.disabled),de=ce.find(xe=>xe.ref.current===document.activeElement),ge=th(ce,Q,de);ge&&setTimeout(()=>ge.ref.current.focus())}),$=v.useCallback((Q,ce,de)=>{const ge=!O.current&&!de;(b.value!==void 0&&b.value===ce||ge)&&(P(Q),ge&&(O.current=!0))},[b.value]),A=v.useCallback(()=>k?.focus(),[k]),te=v.useCallback((Q,ce,de)=>{const ge=!O.current&&!de;(b.value!==void 0&&b.value===ce||ge)&&U(Q)},[b.value]),G=r==="popper"?Ui:$f,le=G===Ui?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:y,hideWhenDetached:m,avoidCollisions:x}:{};return c.jsx(Lf,{scope:n,content:k,viewport:j,onViewportChange:C,itemRefCallback:$,selectedItem:I,onItemLeave:A,itemTextRefCallback:te,focusSelectedItem:W,selectedItemText:M,position:r,isPositioned:D,searchRef:T,children:c.jsx(Ps,{as:x_,allowPinchZoom:!0,children:c.jsx(Rs,{asChild:!0,trapped:b.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:ke(o,Q=>{b.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:c.jsx(Eo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:c.jsx(G,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Q=>Q.preventDefault(),...g,...le,onPlaced:()=>w(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ke(g.onKeyDown,Q=>{const ce=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ce&&Q.key.length===1&&F(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ge=E().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const xe=Q.target,Ne=ge.indexOf(xe);ge=ge.slice(Ne+1)}setTimeout(()=>J(ge)),Q.preventDefault()}})})})})})})});Ff.displayName=g_;var y_="SelectItemAlignedPosition",$f=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tn(dn,n),s=nn(dn,n),[a,l]=v.useState(null),[u,d]=v.useState(null),h=Pe(t,N=>d(N)),p=Lo(n),f=v.useRef(!1),y=v.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:g,focusSelectedItem:b}=s,k=v.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&x&&g){const N=i.trigger.getBoundingClientRect(),I=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(i.dir!=="rtl"){const xe=M.left-I.left,Ne=P.left-xe,Oe=N.left-Ne,_=N.width+Oe,Z=Math.max(_,I.width),B=window.innerWidth-bt,R=Bi(Ne,[bt,Math.max(bt,B-Z)]);a.style.minWidth=_+"px",a.style.left=R+"px"}else{const xe=I.right-M.right,Ne=window.innerWidth-P.right-xe,Oe=window.innerWidth-N.right-Ne,_=N.width+Oe,Z=Math.max(_,I.width),B=window.innerWidth-bt,R=Bi(Ne,[bt,Math.max(bt,B-Z)]);a.style.minWidth=_+"px",a.style.right=R+"px"}const U=p(),E=window.innerHeight-bt*2,D=m.scrollHeight,w=window.getComputedStyle(u),O=parseInt(w.borderTopWidth,10),J=parseInt(w.paddingTop,10),W=parseInt(w.borderBottomWidth,10),q=parseInt(w.paddingBottom,10),Y=O+J+D+q+W,T=Math.min(x.offsetHeight*5,Y),F=window.getComputedStyle(m),$=parseInt(F.paddingTop,10),A=parseInt(F.paddingBottom,10),te=N.top+N.height/2-bt,G=E-te,le=x.offsetHeight/2,Q=x.offsetTop+le,ce=O+J+Q,de=Y-ce;if(ce<=te){const xe=U.length>0&&x===U[U.length-1].ref.current;a.style.bottom="0px";const Ne=u.clientHeight-m.offsetTop-m.offsetHeight,Oe=Math.max(G,le+(xe?A:0)+Ne+W),_=ce+Oe;a.style.height=_+"px"}else{const xe=U.length>0&&x===U[0].ref.current;a.style.top="0px";const Oe=Math.max(te,O+m.offsetTop+(xe?$:0)+le)+de;a.style.height=Oe+"px",m.scrollTop=ce-te+m.offsetTop}a.style.margin=`${bt}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=E+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[p,i.trigger,i.valueNode,a,u,m,x,g,i.dir,r]);Ke(()=>k(),[k]);const[S,j]=v.useState();Ke(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const C=v.useCallback(N=>{N&&y.current===!0&&(k(),b?.(),y.current=!1)},[k,b]);return c.jsx(b_,{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(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$f.displayName=y_;var v_="SelectPopperPosition",Ui=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=bt,...i}=e,s=Fo(n);return c.jsx(cf,{...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)"}})});Ui.displayName=v_;var[b_,Gs]=Gn(dn,{}),Zi="SelectViewport",Bf=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nn(Zi,n),s=Gs(Zi,n),a=Pe(t,i.onViewportChange),l=v.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(Mo.Slot,{scope:n,children:c.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ke(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 y=window.innerHeight-bt*2,m=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),g=Math.max(m,x);if(g<y){const b=g+f,k=Math.min(y,b),S=b-k;h.style.height=k+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Bf.displayName=Zi;var Uf="SelectGroup",[w_,k_]=Gn(Uf),__=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=zt();return c.jsx(w_,{scope:n,id:o,children:c.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});__.displayName=Uf;var Zf="SelectLabel",S_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=k_(Zf,n);return c.jsx(Ce.div,{id:o.id,...r,ref:t})});S_.displayName=Zf;var fo="SelectItem",[C_,Vf]=Gn(fo),Wf=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=tn(fo,n),l=nn(fo,n),u=a.value===r,[d,h]=v.useState(i??""),[p,f]=v.useState(!1),y=Pe(t,b=>l.itemRefCallback?.(b,r,o)),m=zt(),x=v.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(C_,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:v.useCallback(b=>{h(k=>k||(b?.textContent??"").trim())},[]),children:c.jsx(Mo.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ce.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:y,onFocus:ke(s.onFocus,()=>f(!0)),onBlur:ke(s.onBlur,()=>f(!1)),onClick:ke(s.onClick,()=>{x.current!=="mouse"&&g()}),onPointerUp:ke(s.onPointerUp,()=>{x.current==="mouse"&&g()}),onPointerDown:ke(s.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:ke(s.onPointerMove,b=>{x.current=b.pointerType,o?l.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ke(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(c_.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});Wf.displayName=fo;var lr="SelectItemText",Hf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=tn(lr,n),a=nn(lr,n),l=Vf(lr,n),u=h_(lr,n),[d,h]=v.useState(null),p=Pe(t,g=>h(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),f=d?.textContent,y=v.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return Ke(()=>(m(y),()=>x(y)),[m,x,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ce.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?yr.createPortal(i.children,s.valueNode):null]})});Hf.displayName=lr;var qf="SelectItemIndicator",Kf=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Vf(qf,n).isSelected?c.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});Kf.displayName=qf;var Vi="SelectScrollUpButton",Gf=v.forwardRef((e,t)=>{const n=nn(Vi,e.__scopeSelect),r=Gs(Vi,e.__scopeSelect),[o,i]=v.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(Yf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Gf.displayName=Vi;var Wi="SelectScrollDownButton",Jf=v.forwardRef((e,t)=>{const n=nn(Wi,e.__scopeSelect),r=Gs(Wi,e.__scopeSelect),[o,i]=v.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(Yf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Jf.displayName=Wi;var Yf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nn("SelectScrollButton",n),s=v.useRef(null),a=Lo(n),l=v.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),Ke(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:ke(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{l()})})}),E_="SelectSeparator",N_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});N_.displayName=E_;var Hi="SelectArrow",j_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Fo(n),i=tn(Hi,n),s=nn(Hi,n);return i.open&&s.position==="popper"?c.jsx(uf,{...o,...r,ref:t}):null});j_.displayName=Hi;var T_="SelectBubbleInput",Xf=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=v.useRef(null),i=Pe(r,o),s=m2(t);return v.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(Ce.select,{...n,style:{...od,...n.style},ref:i,defaultValue:t})});Xf.displayName=T_;function Qf(e){return e===""||e===void 0}function eh(e){const t=tt(e),n=v.useRef(""),r=v.useRef(0),o=v.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=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function th(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=A_(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 A_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var z_=Af,I_=If,R_=Pf,P_=Of,O_=Df,D_=Mf,M_=Bf,L_=Wf,F_=Hf,$_=Kf,B_=Gf,U_=Jf,Z_="Separator",Nl="horizontal",V_=["horizontal","vertical"],nh=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=Nl,...o}=e,i=W_(r)?r:Nl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.jsx(Ce.div,{"data-orientation":i,...a,...o,ref:t})});nh.displayName=Z_;function W_(e){return V_.includes(e)}var H_=nh,$o="Tabs",[q_]=Wt($o,[ff]),rh=ff(),[K_,Js]=q_($o),oh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=Co(a),[h,p]=an({prop:r,onChange:o,defaultProp:i??"",caller:$o});return c.jsx(K_,{scope:n,baseId:zt(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l,children:c.jsx(Ce.div,{dir:d,"data-orientation":s,...u,ref:t})})});oh.displayName=$o;var ih="TabsList",sh=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Js(ih,n),s=rh(n);return c.jsx(Hk,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:c.jsx(Ce.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});sh.displayName=ih;var ah="TabsTrigger",lh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Js(ah,n),a=rh(n),l=dh(s.baseId,r),u=fh(s.baseId,r),d=r===s.value;return c.jsx(qk,{asChild:!0,...a,focusable:!o,active:d,children:c.jsx(Ce.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:ke(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:ke(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})})});lh.displayName=ah;var ch="TabsContent",uh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Js(ch,n),l=dh(a.baseId,r),u=fh(a.baseId,r),d=r===a.value,h=v.useRef(d);return v.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(xt,{present:o||d,children:({present:p})=>c.jsx(Ce.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})})});uh.displayName=ch;function dh(e,t){return`${e}-trigger-${t}`}function fh(e,t){return`${e}-content-${t}`}var G_=oh,J_=sh,Y_=lh,X_=uh,[Bo]=Wt("Tooltip",[Po]),Uo=Po(),hh="TooltipProvider",Q_=700,qi="tooltip.open",[eS,Ys]=Bo(hh),ph=e=>{const{__scopeTooltip:t,delayDuration:n=Q_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=v.useRef(!0),a=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(eS,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};ph.displayName=hh;var gr="Tooltip",[tS,kr]=Bo(gr),mh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Ys(gr,e.__scopeTooltip),u=Uo(t),[d,h]=v.useState(null),p=zt(),f=v.useRef(0),y=s??l.disableHoverableContent,m=a??l.delayDuration,x=v.useRef(!1),[g,b]=an({prop:r,defaultProp:o??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(qi))):l.onClose(),i?.(N)},caller:gr}),k=v.useMemo(()=>g?x.current?"delayed-open":"instant-open":"closed",[g]),S=v.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,b(!0)},[b]),j=v.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),C=v.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,b(!0),f.current=0},m)},[m,b]);return v.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(af,{...u,children:c.jsx(tS,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:d,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{l.isOpenDelayedRef.current?C():S()},[l.isOpenDelayedRef,C,S]),onTriggerLeave:v.useCallback(()=>{y?j():(window.clearTimeout(f.current),f.current=0)},[j,y]),onOpen:S,onClose:j,disableHoverableContent:y,children:n})})};mh.displayName=gr;var Ki="TooltipTrigger",gh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=kr(Ki,n),i=Ys(Ki,n),s=Uo(n),a=v.useRef(null),l=Pe(t,a,o.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),h=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(lf,{asChild:!0,...s,children:c.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ke(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ke(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})})});gh.displayName=Ki;var Xs="TooltipPortal",[nS,rS]=Bo(Xs,{forceMount:void 0}),xh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=kr(Xs,t);return c.jsx(nS,{scope:t,forceMount:n,children:c.jsx(xt,{present:n||i.open,children:c.jsx(No,{asChild:!0,container:o,children:r})})})};xh.displayName=Xs;var $n="TooltipContent",yh=v.forwardRef((e,t)=>{const n=rS($n,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=kr($n,e.__scopeTooltip);return c.jsx(xt,{present:r||s.open,children:s.disableHoverableContent?c.jsx(vh,{side:o,...i,ref:t}):c.jsx(oS,{side:o,...i,ref:t})})}),oS=v.forwardRef((e,t)=>{const n=kr($n,e.__scopeTooltip),r=Ys($n,e.__scopeTooltip),o=v.useRef(null),i=Pe(t,o),[s,a]=v.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:h}=r,p=v.useCallback(()=>{a(null),h(!1)},[h]),f=v.useCallback((y,m)=>{const x=y.currentTarget,g={x:y.clientX,y:y.clientY},b=lS(g,x.getBoundingClientRect()),k=cS(g,b),S=uS(m.getBoundingClientRect()),j=fS([...k,...S]);a(j),h(!0)},[h]);return v.useEffect(()=>()=>p(),[p]),v.useEffect(()=>{if(l&&d){const y=x=>f(x,d),m=x=>f(x,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",m)}}},[l,d,f,p]),v.useEffect(()=>{if(s){const y=m=>{const x=m.target,g={x:m.clientX,y:m.clientY},b=l?.contains(x)||d?.contains(x),k=!dS(g,s);b?p():k&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,s,u,p]),c.jsx(vh,{...e,ref:i})}),[iS,sS]=Bo(gr,{isInside:!1}),aS=j1("TooltipContent"),vh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=kr($n,n),u=Uo(n),{onClose:d}=l;return v.useEffect(()=>(document.addEventListener(qi,d),()=>document.removeEventListener(qi,d)),[d]),v.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(Eo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(cf,{"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(aS,{children:r}),c.jsx(iS,{scope:n,isInside:!0,children:c.jsx(O1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});yh.displayName=$n;var bh="TooltipArrow",wh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Uo(n);return sS(bh,n).isInside?null:c.jsx(uf,{...o,...r,ref:t})});wh.displayName=bh;function lS(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 cS(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 uS(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 dS(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 fS(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),hS(t)}function hS(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 pS=ph,mS=mh,gS=gh,xS=xh,yS=yh,vS=wh;const bS=Ts("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 Ye({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?E1:"span";return c.jsx(o,{"data-slot":"badge","data-variant":t,className:me(bS({variant:t}),e),...r})}const wS={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function jl(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function kS({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:me("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(mt,{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(Ye,{variant:"outline",className:me("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:wS[s]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(_o,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[jl(t)," - ",jl(n)]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(Du,{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(vr,{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 _S(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function SS(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 CS(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 ES="x-anthropic-billing-header:";function NS(e){return e.trimStart().toLowerCase().startsWith(ES)}function Tl(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function jS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function TS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Tl(e,"type"),n=Tl(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:NS(n)}function AS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!jS(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(TS(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 zS=Ts("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 nt({className:e,variant:t,size:n,...r}){return c.jsx("button",{"data-slot":"button",className:me(zS({variant:t,size:n,className:e})),...r})}function IS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const RS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OS={};function Al(e,t){return(OS.jsx?PS:RS).test(e)}const DS=/[ \t\n\f\r]/g;function MS(e){return typeof e=="object"?e.type==="text"?zl(e.value):!1:zl(e)}function zl(e){return e.replace(DS,"")===""}class _r{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_r.prototype.normal={};_r.prototype.property={};_r.prototype.space=void 0;function kh(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new _r(n,r,t)}function Gi(e){return e.toLowerCase()}class at{constructor(t,n){this.attribute=n,this.property=t}}at.prototype.attribute="";at.prototype.booleanish=!1;at.prototype.boolean=!1;at.prototype.commaOrSpaceSeparated=!1;at.prototype.commaSeparated=!1;at.prototype.defined=!1;at.prototype.mustUseProperty=!1;at.prototype.number=!1;at.prototype.overloadedBoolean=!1;at.prototype.property="";at.prototype.spaceSeparated=!1;at.prototype.space=void 0;let LS=0;const Ee=mn(),We=mn(),Ji=mn(),oe=mn(),De=mn(),In=mn(),ct=mn();function mn(){return 2**++LS}const Yi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:We,commaOrSpaceSeparated:ct,commaSeparated:In,number:oe,overloadedBoolean:Ji,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),di=Object.keys(Yi);class Qs extends at{constructor(t,n,r,o){let i=-1;if(super(t,n),Il(this,"space",o),typeof r=="number")for(;++i<di.length;){const s=di[i];Il(this,di[i],(r&Yi[s])===Yi[s])}}}Qs.prototype.defined=!0;function Il(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 Qs(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Gi(r)]=r,n[Gi(i.attribute)]=r}return new _r(t,n,e.space)}const _h=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 Sh(e,t){return t in e?e[t]:t}function Ch(e,t){return Sh(e,t.toLowerCase())}const FS=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:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:De,autoFocus:Ee,autoPlay:Ee,blocking:De,capture:null,charSet:null,checked:Ee,cite:null,className:De,cols:oe,colSpan:null,content:null,contentEditable:We,controls:Ee,controlsList:De,coords:oe|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:Ji,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:De,height:oe,hidden:Ji,high:oe,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:De,itemRef:De,itemScope:Ee,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:oe,pattern:null,ping:De,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:De,required:Ee,reversed:Ee,rows:oe,rowSpan:oe,sandbox:De,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,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:Ee,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:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,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:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:Ch}),$S=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:ct,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:Ee,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:ct,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:ct,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ct,rev:ct,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ct,requiredFeatures:ct,requiredFonts:ct,requiredFormats:ct,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:ct,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:ct,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:ct,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:Sh}),Eh=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()}}),Nh=Jn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ch}),jh=Jn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BS={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"},US=/[A-Z]/g,Rl=/-[a-z]/g,ZS=/^data[-\w.:]+$/i;function VS(e,t){const n=Gi(t);let r=t,o=at;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Rl,HS);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Rl.test(i)){let s=i.replace(US,WS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Qs}return new o(r,t)}function WS(e){return"-"+e.toLowerCase()}function HS(e){return e.charAt(1).toUpperCase()}const qS=kh([_h,FS,Eh,Nh,jh],"html"),ea=kh([_h,$S,Eh,Nh,jh],"svg");function KS(e){return e.join(" ").trim()}var kn={},fi,Pl;function GS(){if(Pl)return fi;Pl=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 y(x,g){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];g=g||{};var b=1,k=1;function S(w){var O=w.match(t);O&&(b+=O.length);var J=w.lastIndexOf(l);k=~J?w.length-J:k+w.length}function j(){var w={line:b,column:k};return function(O){return O.position=new C(w),P(),O}}function C(w){this.start=w,this.end={line:b,column:k},this.source=g.source}C.prototype.content=x;function N(w){var O=new Error(g.source+":"+b+":"+k+": "+w);if(O.reason=w,O.filename=g.source,O.line=b,O.column=k,O.source=x,!g.silent)throw O}function I(w){var O=w.exec(x);if(O){var J=O[0];return S(J),x=x.slice(J.length),O}}function P(){I(n)}function M(w){var O;for(w=w||[];O=U();)O!==!1&&w.push(O);return w}function U(){var w=j();if(!(u!=x.charAt(0)||d!=x.charAt(1))){for(var O=2;h!=x.charAt(O)&&(d!=x.charAt(O)||u!=x.charAt(O+1));)++O;if(O+=2,h===x.charAt(O-1))return N("End of comment missing");var J=x.slice(2,O-2);return k+=2,S(J),x=x.slice(O),k+=2,w({type:p,comment:J})}}function E(){var w=j(),O=I(r);if(O){if(U(),!I(o))return N("property missing ':'");var J=I(i),W=w({type:f,property:m(O[0].replace(e,h)),value:J?m(J[0].replace(e,h)):h});return I(s),W}}function D(){var w=[];M(w);for(var O;O=E();)O!==!1&&(w.push(O),M(w));return w}return P(),D()}function m(x){return x?x.replace(a,h):h}return fi=y,fi}var Ol;function JS(){if(Ol)return kn;Ol=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(GS());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={},Dl;function YS(){if(Dl)return tr;Dl=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,Ml;function XS(){if(Ml)return nr;Ml=1;var e=nr&&nr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(JS()),n=YS();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 QS=XS();const eC=ds(QS),Th=Ah("end"),ta=Ah("start");function Ah(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 tC(e){const t=ta(e),n=Th(e);if(t&&n)return{start:t,end:n}}function cr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ll(e.position):"start"in e||"end"in e?Ll(e):"line"in e||"column"in e?Xi(e):""}function Xi(e){return Fl(e&&e.line)+":"+Fl(e&&e.column)}function Ll(e){return Xi(e&&e.start)+"-"+Xi(e&&e.end)}function Fl(e){return e&&typeof e=="number"?e:1}class Qe 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}}Qe.prototype.file="";Qe.prototype.name="";Qe.prototype.reason="";Qe.prototype.message="";Qe.prototype.stack="";Qe.prototype.column=void 0;Qe.prototype.line=void 0;Qe.prototype.ancestors=void 0;Qe.prototype.cause=void 0;Qe.prototype.fatal=void 0;Qe.prototype.place=void 0;Qe.prototype.ruleId=void 0;Qe.prototype.source=void 0;const na={}.hasOwnProperty,nC=new Map,rC=/[A-Z]/g,oC=new Set(["table","tbody","thead","tfoot","tr"]),iC=new Set(["td","th"]),zh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sC(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=pC(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=hC(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"?ea:qS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Ih(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Ih(e,t,n){if(t.type==="element")return aC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return lC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return uC(e,t,n);if(t.type==="mdxjsEsm")return cC(e,t);if(t.type==="root")return dC(e,t,n);if(t.type==="text")return fC(e,t)}function aC(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=ea,e.schema=o),e.ancestors.push(t);const i=Ph(e,t.tagName,!1),s=mC(e,t);let a=oa(e,t);return oC.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!MS(l):!0})),Rh(e,s,i,t),ra(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function lC(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)}xr(e,t.position)}function cC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xr(e,t.position)}function uC(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=ea,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Ph(e,t.name,!0),s=gC(e,t),a=oa(e,t);return Rh(e,s,i,t),ra(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function dC(e,t,n){const r={};return ra(r,oa(e,t)),e.create(t,e.Fragment,r,n)}function fC(e,t){return t.value}function Rh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ra(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hC(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 pC(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=ta(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 mC(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&na.call(t.properties,o)){const i=xC(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&iC.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 gC(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 xr(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 xr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function oa(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:nC;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=Ih(e,i,s);a!==void 0&&n.push(a)}return n}function xC(e,t,n){const r=VS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IS(n):KS(n)),r.property==="style"){let o=typeof n=="object"?n:yC(e,String(n));return e.stylePropertyNameCase==="css"&&(o=vC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?BS[r.property]||r.property:r.attribute,n]}}function yC(e,t){try{return eC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Qe("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=zh+"#cannot-parse-style-attribute",o}}function Ph(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=Al(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=Al(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return na.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);xr(e)}function xr(e,t){const n=new Qe("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=zh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function vC(e){const t={};let n;for(n in e)na.call(e,n)&&(t[bC(n)]=e[n]);return t}function bC(e){let t=e.replace(rC,wC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function wC(e){return"-"+e.toLowerCase()}const hi={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"]},kC={};function _C(e,t){const n=kC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Oh(e,r,o)}function Oh(e,t,n){if(SC(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 $l(e.children,t,n)}return Array.isArray(e)?$l(e,t,n):""}function $l(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Oh(e[o],t,n);return r.join("")}function SC(e){return!!(e&&typeof e=="object")}const Bl=document.createElement("i");function ia(e){const t="&"+e+";";Bl.innerHTML=t;const n=Bl.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 pt(e,t){return e.length>0?(Pt(e,e.length,0,t),e):t}const Ul={}.hasOwnProperty;function CC(e){const t={};let n=-1;for(;++n<e.length;)EC(t,e[n]);return t}function EC(e,t){let n;for(n in t){const o=(Ul.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Ul.call(o,s)||(o[s]=[]);const a=i[s];NC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function NC(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 Dh(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]/),dt=rn(/[\dA-Za-z]/),jC=rn(/[#-'*+\--9=?A-Z^-~]/);function Qi(e){return e!==null&&(e<32||e===127)}const es=rn(/\d/),TC=rn(/[\dA-Fa-f]/),AC=rn(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const zC=rn(new RegExp("\\p{P}|\\p{S}","u")),IC=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&&dt(e.charCodeAt(n+1))&&dt(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 RC={tokenize:PC};function PC(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 _e(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const OC={tokenize:DC},Zl={tokenize:MC};function DC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(k)}return u(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const S=t.events.length;let j=S,C;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){C=t.events[j][1].end;break}g(r);let N=S;for(;N<t.events.length;)t.events[N][1].end={...C},N++;return Pt(t.events,j+1,0,t.events.slice(S)),t.events.length=N,u(k)}return a(k)}function u(k){if(r===n.length){if(!o)return p(k);if(o.currentConstruct&&o.currentConstruct.concrete)return y(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zl,d,h)(k)}function d(k){return o&&b(),g(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(k)}function p(k){return t.containerState={},e.attempt(Zl,f,y)(k)}function f(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function y(k){if(k===null){o&&b(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(k)}function m(k){if(k===null){x(e.exit("chunkFlow"),!0),g(0),e.consume(k);return}return _e(k)?(e.consume(k),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),m)}function x(k,S){const j=t.sliceStream(k);if(S&&j.push(null),k.previous=i,i&&(i.next=k),i=k,o.defineSkip(k.start),o.write(j),t.parser.lazy[k.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 N=t.events.length;let I=N,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=N;C<t.events.length;)t.events[C][1].end={...M},C++;Pt(t.events,I+1,0,t.events.slice(N)),t.events.length=C}}function g(k){let S=n.length;for(;S-- >k;){const j=n[S];t.containerState=j[1],j[0].exit.call(t,e)}n.length=k}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function MC(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 Vl(e){if(e===null||it(e)||IC(e))return 1;if(zC(e))return 2}function sa(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 ts={name:"attention",resolveAll:LC,tokenize:FC};function LC(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};Wl(h,-l),Wl(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=pt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=pt(u,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=pt(u,sa(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=pt(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=pt(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 FC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Vl(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=Vl(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 Wl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const $C={name:"autolink",tokenize:BC};function BC(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||dt(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||dt(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||Qi(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),d):jC(f)?(e.consume(f),u):n(f)}function d(f){return dt(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||dt(f))&&r++<63){const y=f===45?p:h;return e.consume(f),y}return n(f)}}const Zo={partial:!0,tokenize:UC};function UC(e,t,n){return r;function r(i){return Re(i)?Me(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||_e(i)?t(i):n(i)}}const Mh={continuation:{tokenize:VC},exit:WC,name:"blockQuote",tokenize:ZC};function ZC(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 VC(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(Mh,t,n)(s)}}function WC(e){e.exit("blockQuote")}const Lh={name:"characterEscape",tokenize:HC};function HC(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 AC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Fh={name:"characterReference",tokenize:qC};function qC(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=dt,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=TC,d):(e.enter("characterReferenceValue"),i=7,s=es,d(h))}function d(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===dt&&!ia(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 Hl={partial:!0,tokenize:GC},ql={concrete:!0,name:"codeFenced",tokenize:KC};function KC(e,t,n){const r=this,o={partial:!0,tokenize:j};let i=0,s=0,a;return l;function l(C){return u(C)}function u(C){const N=r.events[r.events.length-1];return i=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[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||_e(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Hl,m,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||_e(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||_e(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===a?n(C):(e.consume(C),y)}function m(C){return e.attempt(o,S,x)(C)}function x(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return i>0&&Re(C)?Me(e,b,"linePrefix",i+1)(C):b(C)}function b(C){return C===null||_e(C)?e.check(Hl,m,S)(C):(e.enter("codeFlowValue"),k(C))}function k(C){return C===null||_e(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),k)}function S(C){return e.exit("codeFenced"),t(C)}function j(C,N,I){let P=0;return M;function M(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),U}function U(O){return C.enter("codeFencedFence"),Re(O)?Me(C,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):E(O)}function E(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,w,"whitespace")(O):w(O)):I(O)}function w(O){return O===null||_e(O)?(C.exit("codeFencedFence"),N(O)):I(O)}}}function GC(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 pi={name:"codeIndented",tokenize:YC},JC={partial:!0,tokenize:XC};function YC(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):_e(u)?e.attempt(JC,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||_e(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function XC(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):_e(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):_e(s)?o(s):n(s)}}const QC={name:"codeText",previous:tE,resolve:eE,tokenize:nE};function eE(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 tE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nE(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)):_e(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||_e(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 rE{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 $h(e){const t={};let n=-1,r,o,i,s,a,l,u;const d=new rE(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,oE(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 oE(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,y=0,m=0;const x=[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,x.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):x.pop(),p=x.length;p--;){const g=a.slice(x[p],x[p+1]),b=i.pop();l.push([b,b+g.length-1]),e.splice(b,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[y+l[p][0]]=y+l[p][1],y+=l[p][1]-l[p][0]-1;return u}const iE={resolve:aE,tokenize:lE},sE={partial:!0,tokenize:cE};function aE(e){return $h(e),e}function lE(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):_e(a)?e.check(sE,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 cE(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||_e(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 Bh(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||Qi(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||_e(g)?n(g):(e.consume(g),g===92?y:f)}function y(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!d&&(g===null||g===41||it(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||Qi(g)?n(g):(e.consume(g),g===92?x:m)}function x(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function Uh(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):_e(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||_e(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 Zh(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):_e(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||_e(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 _e(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 uE={name:"definition",tokenize:fE},dE={partial:!0,tokenize:hE};function fE(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return Uh.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 it(f)?ur(e,u)(f):u(f)}function u(f){return Bh(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(dE,h,h)(f)}function h(f){return Re(f)?Me(e,p,"whitespace")(f):p(f)}function p(f){return f===null||_e(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function hE(e,t,n){return r;function r(a){return it(a)?ur(e,o)(a):n(a)}function o(a){return Zh(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||_e(a)?t(a):n(a)}}const pE={name:"hardBreakEscape",tokenize:mE};function mE(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return _e(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const gE={name:"headingAtx",resolve:xE,tokenize:yE};function xE(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 yE(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||it(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||_e(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||it(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const vE=["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"],Kl=["pre","script","style","textarea"],bE={concrete:!0,name:"htmlFlow",resolveTo:_E,tokenize:SE},wE={partial:!0,tokenize:EE},kE={partial:!0,tokenize:CE};function _E(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 SE(e,t,n){const r=this;let o,i,s,a,l;return u;function u(A){return d(A)}function d(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),i=!0,m):A===63?(e.consume(A),o=3,r.interrupt?t:T):Tt(A)?(e.consume(A),s=String.fromCharCode(A),x):n(A)}function p(A){return A===45?(e.consume(A),o=2,f):A===91?(e.consume(A),o=5,a=0,y):Tt(A)?(e.consume(A),o=4,r.interrupt?t:T):n(A)}function f(A){return A===45?(e.consume(A),r.interrupt?t:T):n(A)}function y(A){const te="CDATA[";return A===te.charCodeAt(a++)?(e.consume(A),a===te.length?r.interrupt?t:E:y):n(A)}function m(A){return Tt(A)?(e.consume(A),s=String.fromCharCode(A),x):n(A)}function x(A){if(A===null||A===47||A===62||it(A)){const te=A===47,G=s.toLowerCase();return!te&&!i&&Kl.includes(G)?(o=1,r.interrupt?t(A):E(A)):vE.includes(s.toLowerCase())?(o=6,te?(e.consume(A),g):r.interrupt?t(A):E(A)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):i?b(A):k(A))}return A===45||dt(A)?(e.consume(A),s+=String.fromCharCode(A),x):n(A)}function g(A){return A===62?(e.consume(A),r.interrupt?t:E):n(A)}function b(A){return Re(A)?(e.consume(A),b):M(A)}function k(A){return A===47?(e.consume(A),M):A===58||A===95||Tt(A)?(e.consume(A),S):Re(A)?(e.consume(A),k):M(A)}function S(A){return A===45||A===46||A===58||A===95||dt(A)?(e.consume(A),S):j(A)}function j(A){return A===61?(e.consume(A),C):Re(A)?(e.consume(A),j):k(A)}function C(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,N):Re(A)?(e.consume(A),C):I(A)}function N(A){return A===l?(e.consume(A),l=null,P):A===null||_e(A)?n(A):(e.consume(A),N)}function I(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||it(A)?j(A):(e.consume(A),I)}function P(A){return A===47||A===62||Re(A)?k(A):n(A)}function M(A){return A===62?(e.consume(A),U):n(A)}function U(A){return A===null||_e(A)?E(A):Re(A)?(e.consume(A),U):n(A)}function E(A){return A===45&&o===2?(e.consume(A),J):A===60&&o===1?(e.consume(A),W):A===62&&o===4?(e.consume(A),F):A===63&&o===3?(e.consume(A),T):A===93&&o===5?(e.consume(A),Y):_e(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(wE,$,D)(A)):A===null||_e(A)?(e.exit("htmlFlowData"),D(A)):(e.consume(A),E)}function D(A){return e.check(kE,w,$)(A)}function w(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return A===null||_e(A)?D(A):(e.enter("htmlFlowData"),E(A))}function J(A){return A===45?(e.consume(A),T):E(A)}function W(A){return A===47?(e.consume(A),s="",q):E(A)}function q(A){if(A===62){const te=s.toLowerCase();return Kl.includes(te)?(e.consume(A),F):E(A)}return Tt(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),q):E(A)}function Y(A){return A===93?(e.consume(A),T):E(A)}function T(A){return A===62?(e.consume(A),F):A===45&&o===2?(e.consume(A),T):E(A)}function F(A){return A===null||_e(A)?(e.exit("htmlFlowData"),$(A)):(e.consume(A),F)}function $(A){return e.exit("htmlFlow"),t(A)}}function CE(e,t,n){const r=this;return o;function o(s){return _e(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 EE(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Zo,t,n)}}const NE={name:"htmlText",tokenize:jE};function jE(e,t,n){const r=this;let o,i,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),j):T===63?(e.consume(T),k):Tt(T)?(e.consume(T),I):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),i=0,y):Tt(T)?(e.consume(T),b):n(T)}function d(T){return T===45?(e.consume(T),f):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),p):_e(T)?(s=h,W(T)):(e.consume(T),h)}function p(T){return T===45?(e.consume(T),f):h(T)}function f(T){return T===62?J(T):T===45?p(T):h(T)}function y(T){const F="CDATA[";return T===F.charCodeAt(i++)?(e.consume(T),i===F.length?m:y):n(T)}function m(T){return T===null?n(T):T===93?(e.consume(T),x):_e(T)?(s=m,W(T)):(e.consume(T),m)}function x(T){return T===93?(e.consume(T),g):m(T)}function g(T){return T===62?J(T):T===93?(e.consume(T),g):m(T)}function b(T){return T===null||T===62?J(T):_e(T)?(s=b,W(T)):(e.consume(T),b)}function k(T){return T===null?n(T):T===63?(e.consume(T),S):_e(T)?(s=k,W(T)):(e.consume(T),k)}function S(T){return T===62?J(T):k(T)}function j(T){return Tt(T)?(e.consume(T),C):n(T)}function C(T){return T===45||dt(T)?(e.consume(T),C):N(T)}function N(T){return _e(T)?(s=N,W(T)):Re(T)?(e.consume(T),N):J(T)}function I(T){return T===45||dt(T)?(e.consume(T),I):T===47||T===62||it(T)?P(T):n(T)}function P(T){return T===47?(e.consume(T),J):T===58||T===95||Tt(T)?(e.consume(T),M):_e(T)?(s=P,W(T)):Re(T)?(e.consume(T),P):J(T)}function M(T){return T===45||T===46||T===58||T===95||dt(T)?(e.consume(T),M):U(T)}function U(T){return T===61?(e.consume(T),E):_e(T)?(s=U,W(T)):Re(T)?(e.consume(T),U):P(T)}function E(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,D):_e(T)?(s=E,W(T)):Re(T)?(e.consume(T),E):(e.consume(T),w)}function D(T){return T===o?(e.consume(T),o=void 0,O):T===null?n(T):_e(T)?(s=D,W(T)):(e.consume(T),D)}function w(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||it(T)?P(T):(e.consume(T),w)}function O(T){return T===47||T===62||it(T)?P(T):n(T)}function J(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function W(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return Re(T)?Me(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):Y(T)}function Y(T){return e.enter("htmlTextData"),s(T)}}const aa={name:"labelEnd",resolveAll:IE,resolveTo:RE,tokenize:PE},TE={tokenize:OE},AE={tokenize:DE},zE={tokenize:ME};function IE(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 RE(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=pt(a,e.slice(i+1,i+r+3)),a=pt(a,[["enter",d,t]]),a=pt(a,sa(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=pt(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=pt(a,e.slice(s+1)),a=pt(a,[["exit",l,t]]),Pt(e,i,e.length,a),e}function PE(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(TE,d,s?d:h)(p):p===91?e.attempt(AE,d,s?u:h)(p):s?d(p):h(p)}function u(p){return e.attempt(zE,d,h)(p)}function d(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function OE(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 it(h)?ur(e,i)(h):i(h)}function i(h){return h===41?d(h):Bh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return it(h)?ur(e,l)(h):d(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?Zh(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return it(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 DE(e,t,n){const r=this;return o;function o(a){return Uh.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 ME(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 LE={name:"labelStartImage",resolveAll:aa.resolveAll,tokenize:FE};function FE(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 $E={name:"labelStartLink",resolveAll:aa.resolveAll,tokenize:BE};function BE(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 mi={name:"lineEnding",tokenize:UE};function UE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const Kr={name:"thematicBreak",tokenize:ZE};function ZE(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||_e(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 rt={continuation:{tokenize:qE},exit:GE,name:"list",tokenize:HE},VE={partial:!0,tokenize:JE},WE={partial:!0,tokenize:KE};function HE(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 y=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:es(f)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Kr,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 es(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(Zo,r.interrupt?n:d,e.attempt(VE,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 qE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Zo,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(WE,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Me(e,e.attempt(rt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function KE(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 GE(e){e.exit(this.containerState.type)}function JE(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 Gl={name:"setextUnderline",resolveTo:YE,tokenize:XE};function YE(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 XE(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||_e(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const QE={tokenize:eN};function eN(e){const t=this,n=e.attempt(Zo,r,e.attempt(this.parser.constructs.flowInitial,o,Me(e,e.attempt(this.parser.constructs.flow,o,e.attempt(iE,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 tN={resolveAll:Wh()},nN=Vh("string"),rN=Vh("text");function Vh(e){return{resolveAll:Wh(e==="text"?oN: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 Wh(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 oN(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 iN={42:rt,43:rt,45:rt,48:rt,49:rt,50:rt,51:rt,52:rt,53:rt,54:rt,55:rt,56:rt,57:rt,62:Mh},sN={91:uE},aN={[-2]:pi,[-1]:pi,32:pi},lN={35:gE,42:Kr,45:[Gl,Kr],60:bE,61:Gl,95:Kr,96:ql,126:ql},cN={38:Fh,92:Lh},uN={[-5]:mi,[-4]:mi,[-3]:mi,33:LE,38:Fh,42:ts,60:[$C,NE],91:$E,92:[pE,Lh],93:aa,95:ts,96:QC},dN={null:[ts,tN]},fN={null:[42,95]},hN={null:[]},pN=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fN,contentInitial:sN,disable:hN,document:iN,flow:lN,flowInitial:aN,insideSpan:dN,string:cN,text:uN},Symbol.toStringTag,{value:"Module"}));function mN(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:N(j),check:N(C),consume:b,enter:k,exit:S,interrupt:N(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:y,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(U){return s=pt(s,U),x(),s[s.length-1]!==null?[]:(I(t,0),u.events=sa(i,u.events,u),u.events)}function p(U,E){return xN(f(U),E)}function f(U){return gN(s,U)}function y(){const{_bufferIndex:U,_index:E,line:D,column:w,offset:O}=r;return{_bufferIndex:U,_index:E,line:D,column:w,offset:O}}function m(U){o[U.line]=U.column,M()}function x(){let U;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<E.length;)g(E.charCodeAt(r._bufferIndex));else g(E)}}function g(U){d=d(U)}function b(U){_e(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,M()):U!==-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=U}function k(U,E){const D=E||{};return D.type=U,D.start=y(),u.events.push(["enter",D,u]),a.push(D),D}function S(U){const E=a.pop();return E.end=y(),u.events.push(["exit",E,u]),E}function j(U,E){I(U,E.from)}function C(U,E){E.restore()}function N(U,E){return D;function D(w,O,J){let W,q,Y,T;return Array.isArray(w)?$(w):"tokenize"in w?$([w]):F(w);function F(le){return Q;function Q(ce){const de=ce!==null&&le[ce],ge=ce!==null&&le.null,xe=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return $(xe)(ce)}}function $(le){return W=le,q=0,le.length===0?J:A(le[q])}function A(le){return Q;function Q(ce){return T=P(),Y=le,le.partial||(u.currentConstruct=le),le.name&&u.parser.constructs.disable.null.includes(le.name)?G():le.tokenize.call(E?Object.assign(Object.create(u),E):u,l,te,G)(ce)}}function te(le){return U(Y,T),O}function G(le){return T.restore(),++q<W.length?A(W[q]):J}}}function I(U,E){U.resolveAll&&!i.includes(U)&&i.push(U),U.resolve&&Pt(u.events,E,u.events.length-E,U.resolve(u.events.slice(E),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function P(){const U=y(),E=u.previous,D=u.currentConstruct,w=u.events.length,O=Array.from(a);return{from:w,restore:J};function J(){r=U,u.previous=E,u.currentConstruct=D,u.events.length=w,a=O,M()}}function M(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function gN(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 xN(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=`
|
|
84
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},s2="DialogDescriptionWarning",a2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ld(s2).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},l2=Cd,c2=jd,u2=Td,d2=Ad,f2=zd,h2=Rd,p2=Dd;function m2(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function g2(e){const[t,n]=v.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 x2=["top","right","bottom","left"],Yt=Math.min,ut=Math.max,io=Math.round,Lr=Math.floor,It=e=>({x:e,y:e}),y2={left:"right",right:"left",bottom:"top",top:"bottom"},v2={start:"end",end:"start"};function Mi(e,t,n){return ut(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 Ls(e){return e==="x"?"y":"x"}function Fs(e){return e==="y"?"height":"width"}const b2=new Set(["top","bottom"]);function At(e){return b2.has(Ut(e))?"y":"x"}function $s(e){return Ls(At(e))}function w2(e,t,n){n===void 0&&(n=!1);const r=qn(e),o=$s(e),i=Fs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=so(s)),[s,so(s)]}function k2(e){const t=so(e);return[Li(e),t,Li(t)]}function Li(e){return e.replace(/start|end/g,t=>v2[t])}const ml=["left","right"],gl=["right","left"],_2=["top","bottom"],S2=["bottom","top"];function C2(e,t,n){switch(e){case"top":case"bottom":return n?t?gl:ml:t?ml:gl;case"left":case"right":return t?_2:S2;default:return[]}}function E2(e,t,n,r){const o=qn(e);let i=C2(Ut(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Li)))),i}function so(e){return e.replace(/left|right|bottom|top/g,t=>y2[t])}function j2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fd(e){return typeof e!="number"?j2(e):{top:e,right:e,bottom:e,left:e}}function ao(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 xl(e,t,n){let{reference:r,floating:o}=e;const i=At(t),s=$s(t),a=Fs(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 N2(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),y=Fd(f),x=a[p?h==="floating"?"reference":"floating":h],g=ao(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),b=h==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},N=ao(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:k,strategy:l}):b);return{top:(g.top-N.top+y.top)/S.y,bottom:(N.bottom-g.bottom+y.bottom)/S.y,left:(g.left-N.left+y.left)/S.x,right:(N.right-g.right+y.right)/S.x}}const T2=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}=xl(u,r,l),p=r,f={},y=0;for(let x=0;x<a.length;x++){var m;const{name:g,fn:b}=a[x],{x:k,y:S,data:N,reset:C}=await b({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:N2},elements:{reference:e,floating:t}});d=k??d,h=S??h,f={...f,[g]:{...f[g],...N}},C&&y<=50&&(y++,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}=xl(u,p,l)),x=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:f}},A2=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=Fd(d),p={x:n,y:r},f=$s(o),y=Fs(f),m=await s.getDimensions(u),x=f==="y",g=x?"top":"left",b=x?"bottom":"right",k=x?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[f]-p[f]-i.floating[y],N=p[f]-i.reference[f],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let j=C?C[k]:0;(!j||!await(s.isElement==null?void 0:s.isElement(C)))&&(j=a.floating[k]||i.floating[y]);const I=S/2-N/2,P=j/2-m[y]/2-1,M=Yt(h[g],P),U=Yt(h[b],P),E=M,D=j-m[y]-U,w=j/2-m[y]/2+I,O=Mi(E,w,D),J=!l.arrow&&qn(o)!=null&&w!==O&&i.reference[y]/2-(w<E?M:U)-m[y]/2<0,W=J?w<E?w-E:w-D:0;return{[f]:p[f]+W,data:{[f]:O,centerOffset:w-O-W,...J&&{alignmentOffset:W}},reset:J}}}),z2=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:y="none",flipAlignment:m=!0,...x}=Bt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ut(o),b=At(a),k=Ut(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=p||(k||!m?[so(a)]:k2(a)),C=y!=="none";!p&&C&&N.push(...E2(a,m,y,S));const j=[a,...N],I=await l.detectOverflow(t,x),P=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(I[g]),h){const w=w2(o,s,S);P.push(I[w[0]],I[w[1]])}if(M=[...M,{placement:o,overflows:P}],!P.every(w=>w<=0)){var U,E;const w=(((U=i.flip)==null?void 0:U.index)||0)+1,O=j[w];if(O&&(!(h==="alignment"?b!==At(O):!1)||M.every(q=>At(q.placement)===b?q.overflows[0]>0:!0)))return{data:{index:w,overflows:M},reset:{placement:O}};let J=(E=M.filter(W=>W.overflows[0]<=0).sort((W,q)=>W.overflows[1]-q.overflows[1])[0])==null?void 0:E.placement;if(!J)switch(f){case"bestFit":{var D;const W=(D=M.filter(q=>{if(C){const Y=At(q.placement);return Y===b||Y==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(Y=>Y>0).reduce((Y,T)=>Y+T,0)]).sort((q,Y)=>q[1]-Y[1])[0])==null?void 0:D[0];W&&(J=W);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function yl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vl(e){return x2.some(t=>e[t]>=0)}const I2=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=yl(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vl(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=yl(s,n.floating);return{data:{escapedOffsets:a,escaped:vl(a)}}}default:return{}}}}},$d=new Set(["left","top"]);async function R2(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=$d.has(s)?-1:1,d=i&&l?-1:1,h=Bt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof y=="number"&&(f=a==="end"?y*-1:y),l?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const P2=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 R2(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}}}}},O2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:b,y:k}=g;return{x:b,y:k}}},...u}=Bt(e,t),d={x:n,y:r},h=await i.detectOverflow(t,u),p=At(Ut(o)),f=Ls(p);let y=d[f],m=d[p];if(s){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",k=y+h[g],S=y-h[b];y=Mi(k,y,S)}if(a){const g=p==="y"?"top":"left",b=p==="y"?"bottom":"right",k=m+h[g],S=m-h[b];m=Mi(k,m,S)}const x=l.fn({...t,[f]:y,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:s,[p]:a}}}}}},D2=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=Ls(h);let f=d[p],y=d[h];const m=Bt(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const k=p==="y"?"height":"width",S=i.reference[p]-i.floating[k]+x.mainAxis,N=i.reference[p]+i.reference[k]-x.mainAxis;f<S?f=S:f>N&&(f=N)}if(u){var g,b;const k=p==="y"?"width":"height",S=$d.has(Ut(o)),N=i.reference[h]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[h])||0)+(S?0:x.crossAxis),C=i.reference[h]+i.reference[k]+(S?0:((b=s.offset)==null?void 0:b[h])||0)-(S?x.crossAxis:0);y<N?y=N:y>C&&(y=C)}return{[p]:f,[h]:y}}}},M2=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:y,height:m}=i.floating;let x,g;h==="top"||h==="bottom"?(x=h,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,x=p==="end"?"top":"bottom");const b=m-d.top-d.bottom,k=y-d.left-d.right,S=Yt(m-d[x],b),N=Yt(y-d[g],k),C=!t.middlewareData.shift;let j=S,I=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=b),C&&!p){const M=ut(d.left,0),U=ut(d.right,0),E=ut(d.top,0),D=ut(d.bottom,0);f?I=y-2*(M!==0||U!==0?M+U:ut(d.left,d.right)):j=m-2*(E!==0||D!==0?E+D:ut(d.top,d.bottom))}await l({...t,availableWidth:I,availableHeight:j});const P=await s.getDimensions(a.floating);return y!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<"u"}function Kn(e){return Bd(e)?(e.nodeName||"").toLowerCase():"#document"}function ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ot(e){var t;return(t=(Bd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bd(e){return Ao()?e instanceof Node||e instanceof ht(e).Node:!1}function _t(e){return Ao()?e instanceof Element||e instanceof ht(e).Element:!1}function Rt(e){return Ao()?e instanceof HTMLElement||e instanceof ht(e).HTMLElement:!1}function bl(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ht(e).ShadowRoot}const L2=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)&&!L2.has(o)}const F2=new Set(["table","td","th"]);function $2(e){return F2.has(Kn(e))}const B2=[":popover-open",":modal"];function zo(e){return B2.some(t=>{try{return e.matches(t)}catch{return!1}})}const U2=["transform","translate","scale","rotate","perspective"],Z2=["transform","translate","scale","rotate","perspective","filter"],V2=["paint","layout","strict","content"];function Bs(e){const t=Us(),n=_t(e)?St(e):e;return U2.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)||Z2.some(r=>(n.willChange||"").includes(r))||V2.some(r=>(n.contain||"").includes(r))}function W2(e){let t=Xt(e);for(;Rt(t)&&!Ln(t);){if(Bs(t))return t;if(zo(t))return null;t=Xt(t)}return null}function Us(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const H2=new Set(["html","body","#document"]);function Ln(e){return H2.has(Kn(e))}function St(e){return ht(e).getComputedStyle(e)}function Io(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||bl(e)&&e.host||Ot(e);return bl(t)?t.host:t}function Ud(e){const t=Xt(e);return Ln(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rt(t)&&br(t)?t:Ud(t)}function mr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ud(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ht(o);if(i){const a=Fi(s);return t.concat(s,s.visualViewport||[],br(o)?o:[],a&&n?mr(a):[])}return t.concat(o,mr(o,[],n))}function Fi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Zd(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=io(n)!==i||io(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Zs(e){return _t(e)?e:e.contextElement}function zn(e){const t=Zs(e);if(!Rt(t))return It(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Zd(t);let s=(i?io(n.width):n.width)/r,a=(i?io(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const q2=It(0);function Vd(e){const t=ht(e);return!Us()||!t.visualViewport?q2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function K2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ht(e)?!1:t}function cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Zs(e);let s=It(1);t&&(r?_t(r)&&(s=zn(r)):s=zn(e));const a=K2(i,n,r)?Vd(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=ht(i),f=r&&_t(r)?ht(r):r;let y=p,m=Fi(y);for(;m&&r&&f!==y;){const x=zn(m),g=m.getBoundingClientRect(),b=St(m),k=g.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,S=g.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,h*=x.y,l+=k,u+=S,y=ht(m),m=Fi(y)}}return ao({width:d,height:h,x:l,y:u})}function Ro(e,t){const n=Io(e).scrollLeft;return t?t.left+n:cn(Ot(e)).left+n}function Wd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ro(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function G2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Ot(r),a=t?zo(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=Io(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?Wd(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 J2(e){return Array.from(e.getClientRects())}function Y2(e){const t=Ot(e),n=Io(e),r=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ro(e);const a=-n.scrollTop;return St(r).direction==="rtl"&&(s+=ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const wl=25;function X2(e,t){const n=ht(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=Us();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Ro(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,y=Math.abs(r.clientWidth-h.clientWidth-f);y<=wl&&(i-=y)}else u<=wl&&(i+=u);return{width:i,height:s,x:a,y:l}}const Q2=new Set(["absolute","fixed"]);function ek(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 kl(e,t,n){let r;if(t==="viewport")r=X2(e,n);else if(t==="document")r=Y2(Ot(e));else if(_t(t))r=ek(t,n);else{const o=Vd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ao(r)}function Hd(e,t){const n=Xt(e);return n===t||!_t(n)||Ln(n)?!1:St(n).position==="fixed"||Hd(n,t)}function tk(e,t){const n=t.get(e);if(n)return n;let r=mr(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=Bs(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Q2.has(o.position)||br(s)&&!l&&Hd(e,s))?r=r.filter(d=>d!==s):o=a,s=Xt(s)}return t.set(e,r),r}function nk(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?zo(t)?[]:tk(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=kl(t,d,o);return u.top=ut(h.top,u.top),u.right=Yt(h.right,u.right),u.bottom=Yt(h.bottom,u.bottom),u.left=ut(h.left,u.left),u},kl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rk(e){const{width:t,height:n}=Zd(e);return{width:t,height:n}}function ok(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=Ro(o)}if(r||!r&&!i)if((Kn(t)!=="body"||br(o))&&(a=Io(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?Wd(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 li(e){return St(e).position==="static"}function _l(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 qd(e,t){const n=ht(e);if(zo(e))return n;if(!Rt(e)){let o=Xt(e);for(;o&&!Ln(o);){if(_t(o)&&!li(o))return o;o=Xt(o)}return n}let r=_l(e,t);for(;r&&$2(r)&&li(r);)r=_l(r,t);return r&&Ln(r)&&li(r)&&!Bs(r)?n:r||W2(e)||n}const ik=async function(e){const t=this.getOffsetParent||qd,n=this.getDimensions,r=await n(e.floating);return{reference:ok(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sk(e){return St(e).direction==="rtl"}const ak={convertOffsetParentRelativeRectToViewportRelativeRect:G2,getDocumentElement:Ot,getClippingRect:nk,getOffsetParent:qd,getElementRects:ik,getClientRects:J2,getDimensions:rk,getScale:zn,isElement:_t,isRTL:sk};function Kd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lk(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 y=Lr(h),m=Lr(o.clientWidth-(d+p)),x=Lr(o.clientHeight-(h+f)),g=Lr(d),k={rootMargin:-y+"px "+-m+"px "+-x+"px "+-g+"px",threshold:ut(0,Yt(1,l))||1};let S=!0;function N(C){const j=C[0].intersectionRatio;if(j!==l){if(!S)return s();j?s(!1,j):r=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!Kd(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(N,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(N,k)}n.observe(e)}return s(!0),i}function ck(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=Zs(e),d=o||i?[...u?mr(u):[],...mr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const h=u&&a?lk(u,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let y,m=l?cn(e):null;l&&x();function x(){const g=cn(e);m&&!Kd(m,g)&&n(),m=g,y=requestAnimationFrame(x)}return n(),()=>{var g;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),h?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(y)}}const uk=P2,dk=O2,fk=z2,hk=M2,pk=I2,Sl=A2,mk=D2,gk=(e,t,n)=>{const r=new Map,o={platform:ak,...n},i={...o.platform,_c:r};return T2(e,t,{...o,platform:i})};var xk=typeof document<"u",yk=function(){},qr=xk?v.useLayoutEffect:yk;function lo(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(!lo(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)&&!lo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Gd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cl(e,t){const n=Gd(e);return Math.round(t*n)/n}function ci(e){const t=v.useRef(e);return qr(()=>{t.current=e}),t}function vk(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=v.useState(r);lo(p,r)||f(r);const[y,m]=v.useState(null),[x,g]=v.useState(null),b=v.useCallback(q=>{q!==C.current&&(C.current=q,m(q))},[]),k=v.useCallback(q=>{q!==j.current&&(j.current=q,g(q))},[]),S=i||y,N=s||x,C=v.useRef(null),j=v.useRef(null),I=v.useRef(d),P=l!=null,M=ci(l),U=ci(o),E=ci(u),D=v.useCallback(()=>{if(!C.current||!j.current)return;const q={placement:t,strategy:n,middleware:p};U.current&&(q.platform=U.current),gk(C.current,j.current,q).then(Y=>{const T={...Y,isPositioned:E.current!==!1};w.current&&!lo(I.current,T)&&(I.current=T,yr.flushSync(()=>{h(T)}))})},[p,t,n,U,E]);qr(()=>{u===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,h(q=>({...q,isPositioned:!1})))},[u]);const w=v.useRef(!1);qr(()=>(w.current=!0,()=>{w.current=!1}),[]),qr(()=>{if(S&&(C.current=S),N&&(j.current=N),S&&N){if(M.current)return M.current(S,N,D);D()}},[S,N,D,M,P]);const O=v.useMemo(()=>({reference:C,floating:j,setReference:b,setFloating:k}),[b,k]),J=v.useMemo(()=>({reference:S,floating:N}),[S,N]),W=v.useMemo(()=>{const q={position:n,left:0,top:0};if(!J.floating)return q;const Y=Cl(J.floating,d.x),T=Cl(J.floating,d.y);return a?{...q,transform:"translate("+Y+"px, "+T+"px)",...Gd(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:T}},[n,a,J.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:D,refs:O,elements:J,floatingStyles:W}),[d,D,O,J,W])}const bk=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?Sl({element:r.current,padding:o}).fn(n):{}:r?Sl({element:r,padding:o}).fn(n):{}}}},wk=(e,t)=>({...uk(e),options:[e,t]}),kk=(e,t)=>({...dk(e),options:[e,t]}),_k=(e,t)=>({...mk(e),options:[e,t]}),Sk=(e,t)=>({...fk(e),options:[e,t]}),Ck=(e,t)=>({...hk(e),options:[e,t]}),Ek=(e,t)=>({...pk(e),options:[e,t]}),jk=(e,t)=>({...bk(e),options:[e,t]});var Nk="Arrow",Jd=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return c.jsx(Ce.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"})})});Jd.displayName=Nk;var Tk=Jd,Vs="Popper",[Yd,Po]=Wt(Vs),[Ak,Xd]=Yd(Vs),Qd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.useState(null);return c.jsx(Ak,{scope:t,anchor:r,onAnchorChange:o,children:n})};Qd.displayName=Vs;var ef="PopperAnchor",tf=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Xd(ef,n),s=v.useRef(null),a=Pe(t,s),l=v.useRef(null);return v.useEffect(()=>{const u=l.current;l.current=r?.current||s.current,u!==l.current&&i.onAnchorChange(l.current)}),r?null:c.jsx(Ce.div,{...o,ref:a})});tf.displayName=ef;var Ws="PopperContent",[zk,Ik]=Yd(Ws),nf=v.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:y,...m}=e,x=Xd(Ws,n),[g,b]=v.useState(null),k=Pe(t,Q=>b(Q)),[S,N]=v.useState(null),C=g2(S),j=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},U=Array.isArray(u)?u:[u],E=U.length>0,D={padding:M,boundary:U.filter(Pk),altBoundary:E},{refs:w,floatingStyles:O,placement:J,isPositioned:W,middlewareData:q}=vk({strategy:"fixed",placement:P,whileElementsMounted:(...Q)=>ck(...Q,{animationFrame:f==="always"}),elements:{reference:x.anchor},middleware:[wk({mainAxis:o+I,alignmentAxis:s}),l&&kk({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?_k():void 0,...D}),l&&Sk({...D}),Ck({...D,apply:({elements:Q,rects:ce,availableWidth:de,availableHeight:ge})=>{const{width:xe,height:je}=ce.reference,Oe=Q.floating.style;Oe.setProperty("--radix-popper-available-width",`${de}px`),Oe.setProperty("--radix-popper-available-height",`${ge}px`),Oe.setProperty("--radix-popper-anchor-width",`${xe}px`),Oe.setProperty("--radix-popper-anchor-height",`${je}px`)}}),S&&jk({element:S,padding:a}),Ok({arrowWidth:j,arrowHeight:I}),p&&Ek({strategy:"referenceHidden",...D})]}),[Y,T]=sf(J),F=et(y);Ke(()=>{W&&F?.()},[W,F]);const $=q.arrow?.x,A=q.arrow?.y,te=q.arrow?.centerOffset!==0,[G,le]=v.useState();return Ke(()=>{g&&le(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:W?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(zk,{scope:n,placedSide:Y,onArrowChange:N,arrowX:$,arrowY:A,shouldHideArrow:te,children:c.jsx(Ce.div,{"data-side":Y,"data-align":T,...m,ref:k,style:{...m.style,animation:W?void 0:"none"}})})})});nf.displayName=Ws;var rf="PopperArrow",Rk={top:"bottom",right:"left",bottom:"top",left:"right"},of=v.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Ik(rf,r),s=Rk[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(Tk,{...o,ref:n,style:{...o.style,display:"block"}})})});of.displayName=rf;function Pk(e){return e!==null}var Ok=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]=sf(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2;let y="",m="";return u==="bottom"?(y=s?h:`${p}px`,m=`${-l}px`):u==="top"?(y=s?h:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,m=s?h:`${f}px`):u==="left"&&(y=`${r.floating.width+l}px`,m=s?h:`${f}px`),{data:{x:y,y:m}}}});function sf(e){const[t,n="center"]=e.split("-");return[t,n]}var af=Qd,lf=tf,cf=nf,uf=of,ui="rovingFocusGroup.onEntryFocus",Dk={bubbles:!1,cancelable:!0},wr="RovingFocusGroup",[$i,df,Mk]=sd(wr),[Lk,ff]=Wt(wr,[Mk]),[Fk,$k]=Lk(wr),hf=v.forwardRef((e,t)=>c.jsx($i.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx($i.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Bk,{...e,ref:t})})}));hf.displayName=wr;var Bk=v.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=v.useRef(null),f=Pe(t,p),y=Co(i),[m,x]=an({prop:s,defaultProp:a??null,onChange:l,caller:wr}),[g,b]=v.useState(!1),k=et(u),S=df(n),N=v.useRef(!1),[C,j]=v.useState(0);return v.useEffect(()=>{const I=p.current;if(I)return I.addEventListener(ui,k),()=>I.removeEventListener(ui,k)},[k]),c.jsx(Fk,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(I=>x(I),[x]),onItemShiftTab:v.useCallback(()=>b(!0),[]),onFocusableItemAdd:v.useCallback(()=>j(I=>I+1),[]),onFocusableItemRemove:v.useCallback(()=>j(I=>I-1),[]),children:c.jsx(Ce.div,{tabIndex:g||C===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{N.current=!0}),onFocus:ke(e.onFocus,I=>{const P=!N.current;if(I.target===I.currentTarget&&P&&!g){const M=new CustomEvent(ui,Dk);if(I.currentTarget.dispatchEvent(M),!M.defaultPrevented){const U=S().filter(J=>J.focusable),E=U.find(J=>J.active),D=U.find(J=>J.id===m),O=[E,D,...U].filter(Boolean).map(J=>J.ref.current);gf(O,d)}}N.current=!1}),onBlur:ke(e.onBlur,()=>b(!1))})})}),pf="RovingFocusGroupItem",mf=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=zt(),u=i||l,d=$k(pf,n),h=d.currentTabStopId===u,p=df(n),{onFocusableItemAdd:f,onFocusableItemRemove:y,currentTabStopId:m}=d;return v.useEffect(()=>{if(r)return f(),()=>y()},[r,f,y]),c.jsx($i.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ke(e.onMouseDown,x=>{r?d.onItemFocus(u):x.preventDefault()}),onFocus:ke(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:ke(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=Vk(x,d.orientation,d.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();const S=k.indexOf(x.currentTarget);k=d.loop?Wk(k,S+1):k.slice(S+1)}setTimeout(()=>gf(k))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});mf.displayName=pf;var Uk={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Vk(e,t,n){const r=Zk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Uk[r]}function gf(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Hk=hf,qk=mf;function Bi(e,[t,n]){return Math.min(n,Math.max(t,e))}function Kk(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Hs="ScrollArea",[xf]=Wt(Hs),[Gk,yt]=xf(Hs),yf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=v.useState(null),[u,d]=v.useState(null),[h,p]=v.useState(null),[f,y]=v.useState(null),[m,x]=v.useState(null),[g,b]=v.useState(0),[k,S]=v.useState(0),[N,C]=v.useState(!1),[j,I]=v.useState(!1),P=Pe(t,U=>l(U)),M=Co(o);return c.jsx(Gk,{scope:n,type:r,dir:M,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:x,scrollbarYEnabled:j,onScrollbarYEnabledChange:I,onCornerWidthChange:b,onCornerHeightChange:S,children:c.jsx(Ce.div,{dir:M,...s,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});yf.displayName=Hs;var vf="ScrollAreaViewport",bf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=yt(vf,n),a=v.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(Ce.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})})]})});bf.displayName=vf;var Dt="ScrollAreaScrollbar",wf=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yt(Dt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return v.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?c.jsx(Jk,{...r,ref:t,forceMount:n}):o.type==="scroll"?c.jsx(Yk,{...r,ref:t,forceMount:n}):o.type==="auto"?c.jsx(kf,{...r,ref:t,forceMount:n}):o.type==="always"?c.jsx(qs,{...r,ref:t}):null});wf.displayName=Dt;var Jk=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yt(Dt,e.__scopeScrollArea),[i,s]=v.useState(!1);return v.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(xt,{present:n||i,children:c.jsx(kf,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Yk=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yt(Dt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Do(()=>l("SCROLL_END"),100),[a,l]=Kk("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 v.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,l]),v.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(xt,{present:n||a!=="hidden",children:c.jsx(qs,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),kf=v.forwardRef((e,t)=>{const n=yt(Dt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=v.useState(!1),a=e.orientation==="horizontal",l=Do(()=>{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(xt,{present:r||i,children:c.jsx(qs,{"data-state":i?"visible":"hidden",...o,ref:t})})}),qs=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=yt(Dt,e.__scopeScrollArea),i=v.useRef(null),s=v.useRef(0),[a,l]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=jf(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 r_(p,s.current,a,f)}return n==="horizontal"?c.jsx(Xk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,f=El(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(Qk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,f=El(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}),Xk=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=yt(Dt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),u=Pe(t,l,i.onScrollbarXChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(Sf,{"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":Oo(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),Tf(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:uo(s.paddingLeft),paddingEnd:uo(s.paddingRight)}})}})}),Qk=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=yt(Dt,e.__scopeScrollArea),[s,a]=v.useState(),l=v.useRef(null),u=Pe(t,l,i.onScrollbarYChange);return v.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),c.jsx(Sf,{"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":Oo(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),Tf(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:uo(s.paddingTop),paddingEnd:uo(s.paddingBottom)}})}})}),[e_,_f]=xf(Dt),Sf=v.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=yt(Dt,n),[y,m]=v.useState(null),x=Pe(t,P=>m(P)),g=v.useRef(null),b=v.useRef(""),k=f.viewport,S=r.content-r.viewport,N=et(d),C=et(l),j=Do(h,10);function I(P){if(g.current){const M=P.clientX-g.current.left,U=P.clientY-g.current.top;u({x:M,y:U})}}return v.useEffect(()=>{const P=M=>{const U=M.target;y?.contains(U)&&N(M,S)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[k,y,S,N]),v.useEffect(C,[r,C]),Fn(y,j),Fn(f.content,j),c.jsx(e_,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:et(i),onThumbPointerUp:et(s),onThumbPositionChange:C,onThumbPointerDown:et(a),children:c.jsx(Ce.div,{...p,ref:x,style:{position:"absolute",...p.style},onPointerDown:ke(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),g.current=y.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),I(P))}),onPointerMove:ke(e.onPointerMove,I),onPointerUp:ke(e.onPointerUp,P=>{const M=P.target;M.hasPointerCapture(P.pointerId)&&M.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=b.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),co="ScrollAreaThumb",Cf=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_f(co,e.__scopeScrollArea);return c.jsx(xt,{present:n||o.hasThumb,children:c.jsx(t_,{ref:t,...r})})}),t_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=yt(co,n),s=_f(co,n),{onThumbPositionChange:a}=s,l=Pe(t,h=>s.onThumbChange(h)),u=v.useRef(void 0),d=Do(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(d(),!u.current){const f=o_(h,a);u.current=f,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,d,a]),c.jsx(Ce.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:ke(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),y=h.clientX-f.left,m=h.clientY-f.top;s.onThumbPointerDown({x:y,y:m})}),onPointerUp:ke(e.onPointerUp,s.onThumbPointerUp)})});Cf.displayName=co;var Ks="ScrollAreaCorner",Ef=v.forwardRef((e,t)=>{const n=yt(Ks,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(n_,{...e,ref:t}):null});Ef.displayName=Ks;var n_=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=yt(Ks,n),[i,s]=v.useState(0),[a,l]=v.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(Ce.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 uo(e){return e?parseInt(e,10):0}function jf(e,t){const n=e/t;return isNaN(n)?0:n}function Oo(e){const t=jf(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function r_(e,t,n,r="ltr"){const o=Oo(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 Nf([l,u],h)(e)}function El(e,t,n="ltr"){const r=Oo(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=Bi(e,l);return Nf([0,s],[0,a])(u)}function Nf(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 Tf(e,t){return e>0&&e<t}var o_=(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 Do(e,t){const n=et(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Fn(e,t){const n=et(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 i_=yf,s_=bf,a_=Ef,l_=[" ","Enter","ArrowUp","ArrowDown"],c_=[" ","Enter"],un="Select",[Mo,Lo,u_]=sd(un),[Gn]=Wt(un,[u_,Po]),Fo=Po(),[d_,tn]=Gn(un),[f_,h_]=Gn(un),Af=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:y}=e,m=Fo(t),[x,g]=v.useState(null),[b,k]=v.useState(null),[S,N]=v.useState(!1),C=Co(u),[j,I]=an({prop:r,defaultProp:o??!1,onChange:i,caller:un}),[P,M]=an({prop:s,defaultProp:a,onChange:l,caller:un}),U=v.useRef(null),E=x?y||!!x.closest("form"):!0,[D,w]=v.useState(new Set),O=Array.from(D).map(J=>J.props.value).join(";");return c.jsx(af,{...m,children:c.jsxs(d_,{required:f,scope:t,trigger:x,onTriggerChange:g,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:zt(),value:P,onValueChange:M,open:j,onOpenChange:I,dir:C,triggerPointerDownPosRef:U,disabled:p,children:[c.jsx(Mo.Provider,{scope:t,children:c.jsx(f_,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(J=>{w(W=>new Set(W).add(J))},[]),onNativeOptionRemove:v.useCallback(J=>{w(W=>{const q=new Set(W);return q.delete(J),q})},[]),children:n})}),E?c.jsxs(Xf,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:P,onChange:J=>M(J.target.value),disabled:p,form:y,children:[P===void 0?c.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};Af.displayName=un;var zf="SelectTrigger",If=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Fo(n),s=tn(zf,n),a=s.disabled||r,l=Pe(t,s.onTriggerChange),u=Lo(n),d=v.useRef("touch"),[h,p,f]=eh(m=>{const x=u().filter(k=>!k.disabled),g=x.find(k=>k.value===s.value),b=th(x,m,g);b!==void 0&&s.onValueChange(b.value)}),y=m=>{a||(s.onOpenChange(!0),f()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(lf,{asChild:!0,...i,children:c.jsx(Ce.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":Qf(s.value)?"":void 0,...o,ref:l,onClick:ke(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&y(m)}),onPointerDown:ke(o.onPointerDown,m=>{d.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:ke(o.onKeyDown,m=>{const x=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(x&&m.key===" ")&&l_.includes(m.key)&&(y(),m.preventDefault())})})})});If.displayName=zf;var Rf="SelectValue",Pf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=tn(Rf,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=Pe(t,l.onValueNodeChange);return Ke(()=>{u(d)},[u,d]),c.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:Qf(l.value)?c.jsx(c.Fragment,{children:s}):i})});Pf.displayName=Rf;var p_="SelectIcon",Of=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Of.displayName=p_;var m_="SelectPortal",Df=e=>c.jsx(jo,{asChild:!0,...e});Df.displayName=m_;var dn="SelectContent",Mf=v.forwardRef((e,t)=>{const n=tn(dn,e.__scopeSelect),[r,o]=v.useState();if(Ke(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?yr.createPortal(c.jsx(Lf,{scope:e.__scopeSelect,children:c.jsx(Mo.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(Ff,{...e,ref:t})});Mf.displayName=dn;var bt=10,[Lf,nn]=Gn(dn),g_="SelectContentImpl",x_=Mn("SelectContent.RemoveScroll"),Ff=v.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:y,hideWhenDetached:m,avoidCollisions:x,...g}=e,b=tn(dn,n),[k,S]=v.useState(null),[N,C]=v.useState(null),j=Pe(t,Q=>S(Q)),[I,P]=v.useState(null),[M,U]=v.useState(null),E=Lo(n),[D,w]=v.useState(!1),O=v.useRef(!1);v.useEffect(()=>{if(k)return _d(k)},[k]),pd();const J=v.useCallback(Q=>{const[ce,...de]=E().map(je=>je.ref.current),[ge]=de.slice(-1),xe=document.activeElement;for(const je of Q)if(je===xe||(je?.scrollIntoView({block:"nearest"}),je===ce&&N&&(N.scrollTop=0),je===ge&&N&&(N.scrollTop=N.scrollHeight),je?.focus(),document.activeElement!==xe))return},[E,N]),W=v.useCallback(()=>J([I,k]),[J,I,k]);v.useEffect(()=>{D&&W()},[D,W]);const{onOpenChange:q,triggerPointerDownPosRef:Y}=b;v.useEffect(()=>{if(k){let Q={x:0,y:0};const ce=ge=>{Q={x:Math.abs(Math.round(ge.pageX)-(Y.current?.x??0)),y:Math.abs(Math.round(ge.pageY)-(Y.current?.y??0))}},de=ge=>{Q.x<=10&&Q.y<=10?ge.preventDefault():k.contains(ge.target)||q(!1),document.removeEventListener("pointermove",ce),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",de,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",de,{capture:!0})}}},[k,q,Y]),v.useEffect(()=>{const Q=()=>q(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[q]);const[T,F]=eh(Q=>{const ce=E().filter(xe=>!xe.disabled),de=ce.find(xe=>xe.ref.current===document.activeElement),ge=th(ce,Q,de);ge&&setTimeout(()=>ge.ref.current.focus())}),$=v.useCallback((Q,ce,de)=>{const ge=!O.current&&!de;(b.value!==void 0&&b.value===ce||ge)&&(P(Q),ge&&(O.current=!0))},[b.value]),A=v.useCallback(()=>k?.focus(),[k]),te=v.useCallback((Q,ce,de)=>{const ge=!O.current&&!de;(b.value!==void 0&&b.value===ce||ge)&&U(Q)},[b.value]),G=r==="popper"?Ui:$f,le=G===Ui?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:y,hideWhenDetached:m,avoidCollisions:x}:{};return c.jsx(Lf,{scope:n,content:k,viewport:N,onViewportChange:C,itemRefCallback:$,selectedItem:I,onItemLeave:A,itemTextRefCallback:te,focusSelectedItem:W,selectedItemText:M,position:r,isPositioned:D,searchRef:T,children:c.jsx(Ps,{as:x_,allowPinchZoom:!0,children:c.jsx(Rs,{asChild:!0,trapped:b.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:ke(o,Q=>{b.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:c.jsx(Eo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:c.jsx(G,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:Q=>Q.preventDefault(),...g,...le,onPlaced:()=>w(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ke(g.onKeyDown,Q=>{const ce=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ce&&Q.key.length===1&&F(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ge=E().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const xe=Q.target,je=ge.indexOf(xe);ge=ge.slice(je+1)}setTimeout(()=>J(ge)),Q.preventDefault()}})})})})})})});Ff.displayName=g_;var y_="SelectItemAlignedPosition",$f=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=tn(dn,n),s=nn(dn,n),[a,l]=v.useState(null),[u,d]=v.useState(null),h=Pe(t,j=>d(j)),p=Lo(n),f=v.useRef(!1),y=v.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:g,focusSelectedItem:b}=s,k=v.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&m&&x&&g){const j=i.trigger.getBoundingClientRect(),I=u.getBoundingClientRect(),P=i.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(i.dir!=="rtl"){const xe=M.left-I.left,je=P.left-xe,Oe=j.left-je,_=j.width+Oe,Z=Math.max(_,I.width),B=window.innerWidth-bt,R=Bi(je,[bt,Math.max(bt,B-Z)]);a.style.minWidth=_+"px",a.style.left=R+"px"}else{const xe=I.right-M.right,je=window.innerWidth-P.right-xe,Oe=window.innerWidth-j.right-je,_=j.width+Oe,Z=Math.max(_,I.width),B=window.innerWidth-bt,R=Bi(je,[bt,Math.max(bt,B-Z)]);a.style.minWidth=_+"px",a.style.right=R+"px"}const U=p(),E=window.innerHeight-bt*2,D=m.scrollHeight,w=window.getComputedStyle(u),O=parseInt(w.borderTopWidth,10),J=parseInt(w.paddingTop,10),W=parseInt(w.borderBottomWidth,10),q=parseInt(w.paddingBottom,10),Y=O+J+D+q+W,T=Math.min(x.offsetHeight*5,Y),F=window.getComputedStyle(m),$=parseInt(F.paddingTop,10),A=parseInt(F.paddingBottom,10),te=j.top+j.height/2-bt,G=E-te,le=x.offsetHeight/2,Q=x.offsetTop+le,ce=O+J+Q,de=Y-ce;if(ce<=te){const xe=U.length>0&&x===U[U.length-1].ref.current;a.style.bottom="0px";const je=u.clientHeight-m.offsetTop-m.offsetHeight,Oe=Math.max(G,le+(xe?A:0)+je+W),_=ce+Oe;a.style.height=_+"px"}else{const xe=U.length>0&&x===U[0].ref.current;a.style.top="0px";const Oe=Math.max(te,O+m.offsetTop+(xe?$:0)+le)+de;a.style.height=Oe+"px",m.scrollTop=ce-te+m.offsetTop}a.style.margin=`${bt}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=E+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[p,i.trigger,i.valueNode,a,u,m,x,g,i.dir,r]);Ke(()=>k(),[k]);const[S,N]=v.useState();Ke(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const C=v.useCallback(j=>{j&&y.current===!0&&(k(),b?.(),y.current=!1)},[k,b]);return c.jsx(b_,{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(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$f.displayName=y_;var v_="SelectPopperPosition",Ui=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=bt,...i}=e,s=Fo(n);return c.jsx(cf,{...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)"}})});Ui.displayName=v_;var[b_,Gs]=Gn(dn,{}),Zi="SelectViewport",Bf=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=nn(Zi,n),s=Gs(Zi,n),a=Pe(t,i.onViewportChange),l=v.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(Mo.Slot,{scope:n,children:c.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ke(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 y=window.innerHeight-bt*2,m=parseFloat(h.style.minHeight),x=parseFloat(h.style.height),g=Math.max(m,x);if(g<y){const b=g+f,k=Math.min(y,b),S=b-k;h.style.height=k+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});Bf.displayName=Zi;var Uf="SelectGroup",[w_,k_]=Gn(Uf),__=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=zt();return c.jsx(w_,{scope:n,id:o,children:c.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});__.displayName=Uf;var Zf="SelectLabel",S_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=k_(Zf,n);return c.jsx(Ce.div,{id:o.id,...r,ref:t})});S_.displayName=Zf;var fo="SelectItem",[C_,Vf]=Gn(fo),Wf=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=tn(fo,n),l=nn(fo,n),u=a.value===r,[d,h]=v.useState(i??""),[p,f]=v.useState(!1),y=Pe(t,b=>l.itemRefCallback?.(b,r,o)),m=zt(),x=v.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(C_,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:v.useCallback(b=>{h(k=>k||(b?.textContent??"").trim())},[]),children:c.jsx(Mo.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ce.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:y,onFocus:ke(s.onFocus,()=>f(!0)),onBlur:ke(s.onBlur,()=>f(!1)),onClick:ke(s.onClick,()=>{x.current!=="mouse"&&g()}),onPointerUp:ke(s.onPointerUp,()=>{x.current==="mouse"&&g()}),onPointerDown:ke(s.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:ke(s.onPointerMove,b=>{x.current=b.pointerType,o?l.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(s.onPointerLeave,b=>{b.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ke(s.onKeyDown,b=>{l.searchRef?.current!==""&&b.key===" "||(c_.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});Wf.displayName=fo;var lr="SelectItemText",Hf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=tn(lr,n),a=nn(lr,n),l=Vf(lr,n),u=h_(lr,n),[d,h]=v.useState(null),p=Pe(t,g=>h(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),f=d?.textContent,y=v.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return Ke(()=>(m(y),()=>x(y)),[m,x,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ce.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?yr.createPortal(i.children,s.valueNode):null]})});Hf.displayName=lr;var qf="SelectItemIndicator",Kf=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Vf(qf,n).isSelected?c.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});Kf.displayName=qf;var Vi="SelectScrollUpButton",Gf=v.forwardRef((e,t)=>{const n=nn(Vi,e.__scopeSelect),r=Gs(Vi,e.__scopeSelect),[o,i]=v.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(Yf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Gf.displayName=Vi;var Wi="SelectScrollDownButton",Jf=v.forwardRef((e,t)=>{const n=nn(Wi,e.__scopeSelect),r=Gs(Wi,e.__scopeSelect),[o,i]=v.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(Yf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Jf.displayName=Wi;var Yf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nn("SelectScrollButton",n),s=v.useRef(null),a=Lo(n),l=v.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),Ke(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ke(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:ke(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:ke(o.onPointerLeave,()=>{l()})})}),E_="SelectSeparator",j_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});j_.displayName=E_;var Hi="SelectArrow",N_=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Fo(n),i=tn(Hi,n),s=nn(Hi,n);return i.open&&s.position==="popper"?c.jsx(uf,{...o,...r,ref:t}):null});N_.displayName=Hi;var T_="SelectBubbleInput",Xf=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=v.useRef(null),i=Pe(r,o),s=m2(t);return v.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(Ce.select,{...n,style:{...od,...n.style},ref:i,defaultValue:t})});Xf.displayName=T_;function Qf(e){return e===""||e===void 0}function eh(e){const t=et(e),n=v.useRef(""),r=v.useRef(0),o=v.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=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function th(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=A_(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 A_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var z_=Af,I_=If,R_=Pf,P_=Of,O_=Df,D_=Mf,M_=Bf,L_=Wf,F_=Hf,$_=Kf,B_=Gf,U_=Jf,Z_="Separator",jl="horizontal",V_=["horizontal","vertical"],nh=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=jl,...o}=e,i=W_(r)?r:jl,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return c.jsx(Ce.div,{"data-orientation":i,...a,...o,ref:t})});nh.displayName=Z_;function W_(e){return V_.includes(e)}var H_=nh,$o="Tabs",[q_]=Wt($o,[ff]),rh=ff(),[K_,Js]=q_($o),oh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=Co(a),[h,p]=an({prop:r,onChange:o,defaultProp:i??"",caller:$o});return c.jsx(K_,{scope:n,baseId:zt(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l,children:c.jsx(Ce.div,{dir:d,"data-orientation":s,...u,ref:t})})});oh.displayName=$o;var ih="TabsList",sh=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Js(ih,n),s=rh(n);return c.jsx(Hk,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:c.jsx(Ce.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});sh.displayName=ih;var ah="TabsTrigger",lh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Js(ah,n),a=rh(n),l=dh(s.baseId,r),u=fh(s.baseId,r),d=r===s.value;return c.jsx(qk,{asChild:!0,...a,focusable:!o,active:d,children:c.jsx(Ce.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:ke(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:ke(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})})});lh.displayName=ah;var ch="TabsContent",uh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Js(ch,n),l=dh(a.baseId,r),u=fh(a.baseId,r),d=r===a.value,h=v.useRef(d);return v.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(xt,{present:o||d,children:({present:p})=>c.jsx(Ce.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})})});uh.displayName=ch;function dh(e,t){return`${e}-trigger-${t}`}function fh(e,t){return`${e}-content-${t}`}var G_=oh,J_=sh,Y_=lh,X_=uh,[Bo]=Wt("Tooltip",[Po]),Uo=Po(),hh="TooltipProvider",Q_=700,qi="tooltip.open",[eS,Ys]=Bo(hh),ph=e=>{const{__scopeTooltip:t,delayDuration:n=Q_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=v.useRef(!0),a=v.useRef(!1),l=v.useRef(0);return v.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(eS,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:i})};ph.displayName=hh;var gr="Tooltip",[tS,kr]=Bo(gr),mh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Ys(gr,e.__scopeTooltip),u=Uo(t),[d,h]=v.useState(null),p=zt(),f=v.useRef(0),y=s??l.disableHoverableContent,m=a??l.delayDuration,x=v.useRef(!1),[g,b]=an({prop:r,defaultProp:o??!1,onChange:j=>{j?(l.onOpen(),document.dispatchEvent(new CustomEvent(qi))):l.onClose(),i?.(j)},caller:gr}),k=v.useMemo(()=>g?x.current?"delayed-open":"instant-open":"closed",[g]),S=v.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,b(!0)},[b]),N=v.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),C=v.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,b(!0),f.current=0},m)},[m,b]);return v.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(af,{...u,children:c.jsx(tS,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:d,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{l.isOpenDelayedRef.current?C():S()},[l.isOpenDelayedRef,C,S]),onTriggerLeave:v.useCallback(()=>{y?N():(window.clearTimeout(f.current),f.current=0)},[N,y]),onOpen:S,onClose:N,disableHoverableContent:y,children:n})})};mh.displayName=gr;var Ki="TooltipTrigger",gh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=kr(Ki,n),i=Ys(Ki,n),s=Uo(n),a=v.useRef(null),l=Pe(t,a,o.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),h=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),c.jsx(lf,{asChild:!0,...s,children:c.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ke(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ke(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ke(e.onBlur,o.onClose),onClick:ke(e.onClick,o.onClose)})})});gh.displayName=Ki;var Xs="TooltipPortal",[nS,rS]=Bo(Xs,{forceMount:void 0}),xh=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=kr(Xs,t);return c.jsx(nS,{scope:t,forceMount:n,children:c.jsx(xt,{present:n||i.open,children:c.jsx(jo,{asChild:!0,container:o,children:r})})})};xh.displayName=Xs;var $n="TooltipContent",yh=v.forwardRef((e,t)=>{const n=rS($n,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=kr($n,e.__scopeTooltip);return c.jsx(xt,{present:r||s.open,children:s.disableHoverableContent?c.jsx(vh,{side:o,...i,ref:t}):c.jsx(oS,{side:o,...i,ref:t})})}),oS=v.forwardRef((e,t)=>{const n=kr($n,e.__scopeTooltip),r=Ys($n,e.__scopeTooltip),o=v.useRef(null),i=Pe(t,o),[s,a]=v.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:h}=r,p=v.useCallback(()=>{a(null),h(!1)},[h]),f=v.useCallback((y,m)=>{const x=y.currentTarget,g={x:y.clientX,y:y.clientY},b=lS(g,x.getBoundingClientRect()),k=cS(g,b),S=uS(m.getBoundingClientRect()),N=fS([...k,...S]);a(N),h(!0)},[h]);return v.useEffect(()=>()=>p(),[p]),v.useEffect(()=>{if(l&&d){const y=x=>f(x,d),m=x=>f(x,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",m)}}},[l,d,f,p]),v.useEffect(()=>{if(s){const y=m=>{const x=m.target,g={x:m.clientX,y:m.clientY},b=l?.contains(x)||d?.contains(x),k=!dS(g,s);b?p():k&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,s,u,p]),c.jsx(vh,{...e,ref:i})}),[iS,sS]=Bo(gr,{isInside:!1}),aS=N1("TooltipContent"),vh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=kr($n,n),u=Uo(n),{onClose:d}=l;return v.useEffect(()=>(document.addEventListener(qi,d),()=>document.removeEventListener(qi,d)),[d]),v.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(Eo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:c.jsxs(cf,{"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(aS,{children:r}),c.jsx(iS,{scope:n,isInside:!0,children:c.jsx(O1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});yh.displayName=$n;var bh="TooltipArrow",wh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Uo(n);return sS(bh,n).isInside?null:c.jsx(uf,{...o,...r,ref:t})});wh.displayName=bh;function lS(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 cS(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 uS(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 dS(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 fS(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),hS(t)}function hS(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 pS=ph,mS=mh,gS=gh,xS=xh,yS=yh,vS=wh;const bS=Ts("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 tt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?E1:"span";return c.jsx(o,{"data-slot":"badge","data-variant":t,className:me(bS({variant:t}),e),...r})}const wS={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function Nl(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function kS({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:me("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(mt,{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(tt,{variant:"outline",className:me("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:wS[s]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(_o,{className:"size-3"}),c.jsxs("span",{className:"font-mono tabular-nums",children:[Nl(t)," - ",Nl(n)]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[c.jsx(Du,{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(vr,{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 _S(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function SS(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 CS(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 ES="x-anthropic-billing-header:";function jS(e){return e.trimStart().toLowerCase().startsWith(ES)}function Tl(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function NS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function TS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Tl(e,"type"),n=Tl(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:jS(n)}function AS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!NS(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(TS(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 zS=Ts("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 nt({className:e,variant:t,size:n,...r}){return c.jsx("button",{"data-slot":"button",className:me(zS({variant:t,size:n,className:e})),...r})}function IS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const RS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,PS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OS={};function Al(e,t){return(OS.jsx?PS:RS).test(e)}const DS=/[ \t\n\f\r]/g;function MS(e){return typeof e=="object"?e.type==="text"?zl(e.value):!1:zl(e)}function zl(e){return e.replace(DS,"")===""}class _r{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_r.prototype.normal={};_r.prototype.property={};_r.prototype.space=void 0;function kh(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new _r(n,r,t)}function Gi(e){return e.toLowerCase()}class at{constructor(t,n){this.attribute=n,this.property=t}}at.prototype.attribute="";at.prototype.booleanish=!1;at.prototype.boolean=!1;at.prototype.commaOrSpaceSeparated=!1;at.prototype.commaSeparated=!1;at.prototype.defined=!1;at.prototype.mustUseProperty=!1;at.prototype.number=!1;at.prototype.overloadedBoolean=!1;at.prototype.property="";at.prototype.spaceSeparated=!1;at.prototype.space=void 0;let LS=0;const Ee=mn(),We=mn(),Ji=mn(),oe=mn(),De=mn(),In=mn(),ct=mn();function mn(){return 2**++LS}const Yi=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ee,booleanish:We,commaOrSpaceSeparated:ct,commaSeparated:In,number:oe,overloadedBoolean:Ji,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),di=Object.keys(Yi);class Qs extends at{constructor(t,n,r,o){let i=-1;if(super(t,n),Il(this,"space",o),typeof r=="number")for(;++i<di.length;){const s=di[i];Il(this,di[i],(r&Yi[s])===Yi[s])}}}Qs.prototype.defined=!0;function Il(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 Qs(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Gi(r)]=r,n[Gi(i.attribute)]=r}return new _r(t,n,e.space)}const _h=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 Sh(e,t){return t in e?e[t]:t}function Ch(e,t){return Sh(e,t.toLowerCase())}const FS=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:Ee,allowPaymentRequest:Ee,allowUserMedia:Ee,alt:null,as:null,async:Ee,autoCapitalize:null,autoComplete:De,autoFocus:Ee,autoPlay:Ee,blocking:De,capture:null,charSet:null,checked:Ee,cite:null,className:De,cols:oe,colSpan:null,content:null,contentEditable:We,controls:Ee,controlsList:De,coords:oe|In,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ee,defer:Ee,dir:null,dirName:null,disabled:Ee,download:Ji,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ee,formTarget:null,headers:De,height:oe,hidden:Ji,high:oe,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:Ee,inputMode:null,integrity:null,is:null,isMap:Ee,itemId:null,itemProp:De,itemRef:De,itemScope:Ee,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ee,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:Ee,muted:Ee,name:null,nonce:null,noModule:Ee,noValidate:Ee,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:Ee,optimum:oe,pattern:null,ping:De,placeholder:null,playsInline:Ee,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ee,referrerPolicy:null,rel:De,required:Ee,reversed:Ee,rows:oe,rowSpan:oe,sandbox:De,scope:null,scoped:Ee,seamless:Ee,selected:Ee,shadowRootClonable:Ee,shadowRootDelegatesFocus:Ee,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:Ee,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:Ee,declare:Ee,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:Ee,noHref:Ee,noShade:Ee,noWrap:Ee,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:Ee,disableRemotePlayback:Ee,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:Ch}),$S=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:ct,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:Ee,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:ct,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:ct,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ct,rev:ct,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ct,requiredFeatures:ct,requiredFonts:ct,requiredFormats:ct,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:ct,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:ct,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:ct,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:Sh}),Eh=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()}}),jh=Jn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ch}),Nh=Jn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),BS={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"},US=/[A-Z]/g,Rl=/-[a-z]/g,ZS=/^data[-\w.:]+$/i;function VS(e,t){const n=Gi(t);let r=t,o=at;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ZS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Rl,HS);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Rl.test(i)){let s=i.replace(US,WS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Qs}return new o(r,t)}function WS(e){return"-"+e.toLowerCase()}function HS(e){return e.charAt(1).toUpperCase()}const qS=kh([_h,FS,Eh,jh,Nh],"html"),ea=kh([_h,$S,Eh,jh,Nh],"svg");function KS(e){return e.join(" ").trim()}var kn={},fi,Pl;function GS(){if(Pl)return fi;Pl=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 y(x,g){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];g=g||{};var b=1,k=1;function S(w){var O=w.match(t);O&&(b+=O.length);var J=w.lastIndexOf(l);k=~J?w.length-J:k+w.length}function N(){var w={line:b,column:k};return function(O){return O.position=new C(w),P(),O}}function C(w){this.start=w,this.end={line:b,column:k},this.source=g.source}C.prototype.content=x;function j(w){var O=new Error(g.source+":"+b+":"+k+": "+w);if(O.reason=w,O.filename=g.source,O.line=b,O.column=k,O.source=x,!g.silent)throw O}function I(w){var O=w.exec(x);if(O){var J=O[0];return S(J),x=x.slice(J.length),O}}function P(){I(n)}function M(w){var O;for(w=w||[];O=U();)O!==!1&&w.push(O);return w}function U(){var w=N();if(!(u!=x.charAt(0)||d!=x.charAt(1))){for(var O=2;h!=x.charAt(O)&&(d!=x.charAt(O)||u!=x.charAt(O+1));)++O;if(O+=2,h===x.charAt(O-1))return j("End of comment missing");var J=x.slice(2,O-2);return k+=2,S(J),x=x.slice(O),k+=2,w({type:p,comment:J})}}function E(){var w=N(),O=I(r);if(O){if(U(),!I(o))return j("property missing ':'");var J=I(i),W=w({type:f,property:m(O[0].replace(e,h)),value:J?m(J[0].replace(e,h)):h});return I(s),W}}function D(){var w=[];M(w);for(var O;O=E();)O!==!1&&(w.push(O),M(w));return w}return P(),D()}function m(x){return x?x.replace(a,h):h}return fi=y,fi}var Ol;function JS(){if(Ol)return kn;Ol=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(GS());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={},Dl;function YS(){if(Dl)return tr;Dl=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,Ml;function XS(){if(Ml)return nr;Ml=1;var e=nr&&nr.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(JS()),n=YS();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 QS=XS();const eC=ds(QS),Th=Ah("end"),ta=Ah("start");function Ah(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 tC(e){const t=ta(e),n=Th(e);if(t&&n)return{start:t,end:n}}function cr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ll(e.position):"start"in e||"end"in e?Ll(e):"line"in e||"column"in e?Xi(e):""}function Xi(e){return Fl(e&&e.line)+":"+Fl(e&&e.column)}function Ll(e){return Xi(e&&e.start)+"-"+Xi(e&&e.end)}function Fl(e){return e&&typeof e=="number"?e:1}class Xe 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}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const na={}.hasOwnProperty,nC=new Map,rC=/[A-Z]/g,oC=new Set(["table","tbody","thead","tfoot","tr"]),iC=new Set(["td","th"]),zh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sC(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=pC(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=hC(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"?ea:qS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=Ih(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Ih(e,t,n){if(t.type==="element")return aC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return lC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return uC(e,t,n);if(t.type==="mdxjsEsm")return cC(e,t);if(t.type==="root")return dC(e,t,n);if(t.type==="text")return fC(e,t)}function aC(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=ea,e.schema=o),e.ancestors.push(t);const i=Ph(e,t.tagName,!1),s=mC(e,t);let a=oa(e,t);return oC.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!MS(l):!0})),Rh(e,s,i,t),ra(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function lC(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)}xr(e,t.position)}function cC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xr(e,t.position)}function uC(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=ea,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Ph(e,t.name,!0),s=gC(e,t),a=oa(e,t);return Rh(e,s,i,t),ra(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function dC(e,t,n){const r={};return ra(r,oa(e,t)),e.create(t,e.Fragment,r,n)}function fC(e,t){return t.value}function Rh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ra(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function hC(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 pC(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=ta(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 mC(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&na.call(t.properties,o)){const i=xC(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&iC.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 gC(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 xr(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 xr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function oa(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:nC;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=Ih(e,i,s);a!==void 0&&n.push(a)}return n}function xC(e,t,n){const r=VS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?IS(n):KS(n)),r.property==="style"){let o=typeof n=="object"?n:yC(e,String(n));return e.stylePropertyNameCase==="css"&&(o=vC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?BS[r.property]||r.property:r.attribute,n]}}function yC(e,t){try{return eC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Xe("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=zh+"#cannot-parse-style-attribute",o}}function Ph(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=Al(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=Al(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return na.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);xr(e)}function xr(e,t){const n=new Xe("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=zh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function vC(e){const t={};let n;for(n in e)na.call(e,n)&&(t[bC(n)]=e[n]);return t}function bC(e){let t=e.replace(rC,wC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function wC(e){return"-"+e.toLowerCase()}const hi={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"]},kC={};function _C(e,t){const n=kC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Oh(e,r,o)}function Oh(e,t,n){if(SC(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 $l(e.children,t,n)}return Array.isArray(e)?$l(e,t,n):""}function $l(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Oh(e[o],t,n);return r.join("")}function SC(e){return!!(e&&typeof e=="object")}const Bl=document.createElement("i");function ia(e){const t="&"+e+";";Bl.innerHTML=t;const n=Bl.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 pt(e,t){return e.length>0?(Pt(e,e.length,0,t),e):t}const Ul={}.hasOwnProperty;function CC(e){const t={};let n=-1;for(;++n<e.length;)EC(t,e[n]);return t}function EC(e,t){let n;for(n in t){const o=(Ul.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){Ul.call(o,s)||(o[s]=[]);const a=i[s];jC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function jC(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 Dh(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]/),dt=rn(/[\dA-Za-z]/),NC=rn(/[#-'*+\--9=?A-Z^-~]/);function Qi(e){return e!==null&&(e<32||e===127)}const es=rn(/\d/),TC=rn(/[\dA-Fa-f]/),AC=rn(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function it(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}const zC=rn(new RegExp("\\p{P}|\\p{S}","u")),IC=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&&dt(e.charCodeAt(n+1))&&dt(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 RC={tokenize:PC};function PC(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 _e(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const OC={tokenize:DC},Zl={tokenize:MC};function DC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(k)}return u(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const S=t.events.length;let N=S,C;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){C=t.events[N][1].end;break}g(r);let j=S;for(;j<t.events.length;)t.events[j][1].end={...C},j++;return Pt(t.events,N+1,0,t.events.slice(S)),t.events.length=j,u(k)}return a(k)}function u(k){if(r===n.length){if(!o)return p(k);if(o.currentConstruct&&o.currentConstruct.concrete)return y(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zl,d,h)(k)}function d(k){return o&&b(),g(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,y(k)}function p(k){return t.containerState={},e.attempt(Zl,f,y)(k)}function f(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function y(k){if(k===null){o&&b(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(k)}function m(k){if(k===null){x(e.exit("chunkFlow"),!0),g(0),e.consume(k);return}return _e(k)?(e.consume(k),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),m)}function x(k,S){const N=t.sliceStream(k);if(S&&N.push(null),k.previous=i,i&&(i.next=k),i=k,o.defineSkip(k.start),o.write(N),t.parser.lazy[k.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 j=t.events.length;let I=j,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=j;C<t.events.length;)t.events[C][1].end={...M},C++;Pt(t.events,I+1,0,t.events.slice(j)),t.events.length=C}}function g(k){let S=n.length;for(;S-- >k;){const N=n[S];t.containerState=N[1],N[0].exit.call(t,e)}n.length=k}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function MC(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 Vl(e){if(e===null||it(e)||IC(e))return 1;if(zC(e))return 2}function sa(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 ts={name:"attention",resolveAll:LC,tokenize:FC};function LC(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};Wl(h,-l),Wl(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=pt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=pt(u,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=pt(u,sa(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=pt(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=pt(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 FC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Vl(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=Vl(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 Wl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const $C={name:"autolink",tokenize:BC};function BC(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||dt(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||dt(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||Qi(f)?n(f):(e.consume(f),l)}function u(f){return f===64?(e.consume(f),d):NC(f)?(e.consume(f),u):n(f)}function d(f){return dt(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||dt(f))&&r++<63){const y=f===45?p:h;return e.consume(f),y}return n(f)}}const Zo={partial:!0,tokenize:UC};function UC(e,t,n){return r;function r(i){return Re(i)?Me(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||_e(i)?t(i):n(i)}}const Mh={continuation:{tokenize:VC},exit:WC,name:"blockQuote",tokenize:ZC};function ZC(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 VC(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(Mh,t,n)(s)}}function WC(e){e.exit("blockQuote")}const Lh={name:"characterEscape",tokenize:HC};function HC(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 AC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Fh={name:"characterReference",tokenize:qC};function qC(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=dt,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=TC,d):(e.enter("characterReferenceValue"),i=7,s=es,d(h))}function d(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===dt&&!ia(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 Hl={partial:!0,tokenize:GC},ql={concrete:!0,name:"codeFenced",tokenize:KC};function KC(e,t,n){const r=this,o={partial:!0,tokenize:N};let i=0,s=0,a;return l;function l(C){return u(C)}function u(C){const j=r.events[r.events.length-1];return i=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[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||_e(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(Hl,m,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||_e(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||_e(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===null||_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===a?n(C):(e.consume(C),y)}function m(C){return e.attempt(o,S,x)(C)}function x(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return i>0&&Re(C)?Me(e,b,"linePrefix",i+1)(C):b(C)}function b(C){return C===null||_e(C)?e.check(Hl,m,S)(C):(e.enter("codeFlowValue"),k(C))}function k(C){return C===null||_e(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),k)}function S(C){return e.exit("codeFenced"),t(C)}function N(C,j,I){let P=0;return M;function M(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),U}function U(O){return C.enter("codeFencedFence"),Re(O)?Me(C,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):E(O)}function E(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,w,"whitespace")(O):w(O)):I(O)}function w(O){return O===null||_e(O)?(C.exit("codeFencedFence"),j(O)):I(O)}}}function GC(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 pi={name:"codeIndented",tokenize:YC},JC={partial:!0,tokenize:XC};function YC(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):_e(u)?e.attempt(JC,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||_e(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function XC(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):_e(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):_e(s)?o(s):n(s)}}const QC={name:"codeText",previous:tE,resolve:eE,tokenize:nE};function eE(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 tE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nE(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)):_e(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||_e(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 rE{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 $h(e){const t={};let n=-1,r,o,i,s,a,l,u;const d=new rE(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,oE(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 oE(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,y=0,m=0;const x=[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,x.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):x.pop(),p=x.length;p--;){const g=a.slice(x[p],x[p+1]),b=i.pop();l.push([b,b+g.length-1]),e.splice(b,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[y+l[p][0]]=y+l[p][1],y+=l[p][1]-l[p][0]-1;return u}const iE={resolve:aE,tokenize:lE},sE={partial:!0,tokenize:cE};function aE(e){return $h(e),e}function lE(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):_e(a)?e.check(sE,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 cE(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||_e(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 Bh(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||Qi(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||_e(g)?n(g):(e.consume(g),g===92?y:f)}function y(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!d&&(g===null||g===41||it(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||Qi(g)?n(g):(e.consume(g),g===92?x:m)}function x(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function Uh(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):_e(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||_e(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 Zh(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):_e(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||_e(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 _e(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 uE={name:"definition",tokenize:fE},dE={partial:!0,tokenize:hE};function fE(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return Uh.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 it(f)?ur(e,u)(f):u(f)}function u(f){return Bh(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(dE,h,h)(f)}function h(f){return Re(f)?Me(e,p,"whitespace")(f):p(f)}function p(f){return f===null||_e(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function hE(e,t,n){return r;function r(a){return it(a)?ur(e,o)(a):n(a)}function o(a){return Zh(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||_e(a)?t(a):n(a)}}const pE={name:"hardBreakEscape",tokenize:mE};function mE(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return _e(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const gE={name:"headingAtx",resolve:xE,tokenize:yE};function xE(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 yE(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||it(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||_e(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||it(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const vE=["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"],Kl=["pre","script","style","textarea"],bE={concrete:!0,name:"htmlFlow",resolveTo:_E,tokenize:SE},wE={partial:!0,tokenize:EE},kE={partial:!0,tokenize:CE};function _E(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 SE(e,t,n){const r=this;let o,i,s,a,l;return u;function u(A){return d(A)}function d(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),p):A===47?(e.consume(A),i=!0,m):A===63?(e.consume(A),o=3,r.interrupt?t:T):Tt(A)?(e.consume(A),s=String.fromCharCode(A),x):n(A)}function p(A){return A===45?(e.consume(A),o=2,f):A===91?(e.consume(A),o=5,a=0,y):Tt(A)?(e.consume(A),o=4,r.interrupt?t:T):n(A)}function f(A){return A===45?(e.consume(A),r.interrupt?t:T):n(A)}function y(A){const te="CDATA[";return A===te.charCodeAt(a++)?(e.consume(A),a===te.length?r.interrupt?t:E:y):n(A)}function m(A){return Tt(A)?(e.consume(A),s=String.fromCharCode(A),x):n(A)}function x(A){if(A===null||A===47||A===62||it(A)){const te=A===47,G=s.toLowerCase();return!te&&!i&&Kl.includes(G)?(o=1,r.interrupt?t(A):E(A)):vE.includes(s.toLowerCase())?(o=6,te?(e.consume(A),g):r.interrupt?t(A):E(A)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):i?b(A):k(A))}return A===45||dt(A)?(e.consume(A),s+=String.fromCharCode(A),x):n(A)}function g(A){return A===62?(e.consume(A),r.interrupt?t:E):n(A)}function b(A){return Re(A)?(e.consume(A),b):M(A)}function k(A){return A===47?(e.consume(A),M):A===58||A===95||Tt(A)?(e.consume(A),S):Re(A)?(e.consume(A),k):M(A)}function S(A){return A===45||A===46||A===58||A===95||dt(A)?(e.consume(A),S):N(A)}function N(A){return A===61?(e.consume(A),C):Re(A)?(e.consume(A),N):k(A)}function C(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,j):Re(A)?(e.consume(A),C):I(A)}function j(A){return A===l?(e.consume(A),l=null,P):A===null||_e(A)?n(A):(e.consume(A),j)}function I(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||it(A)?N(A):(e.consume(A),I)}function P(A){return A===47||A===62||Re(A)?k(A):n(A)}function M(A){return A===62?(e.consume(A),U):n(A)}function U(A){return A===null||_e(A)?E(A):Re(A)?(e.consume(A),U):n(A)}function E(A){return A===45&&o===2?(e.consume(A),J):A===60&&o===1?(e.consume(A),W):A===62&&o===4?(e.consume(A),F):A===63&&o===3?(e.consume(A),T):A===93&&o===5?(e.consume(A),Y):_e(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(wE,$,D)(A)):A===null||_e(A)?(e.exit("htmlFlowData"),D(A)):(e.consume(A),E)}function D(A){return e.check(kE,w,$)(A)}function w(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return A===null||_e(A)?D(A):(e.enter("htmlFlowData"),E(A))}function J(A){return A===45?(e.consume(A),T):E(A)}function W(A){return A===47?(e.consume(A),s="",q):E(A)}function q(A){if(A===62){const te=s.toLowerCase();return Kl.includes(te)?(e.consume(A),F):E(A)}return Tt(A)&&s.length<8?(e.consume(A),s+=String.fromCharCode(A),q):E(A)}function Y(A){return A===93?(e.consume(A),T):E(A)}function T(A){return A===62?(e.consume(A),F):A===45&&o===2?(e.consume(A),T):E(A)}function F(A){return A===null||_e(A)?(e.exit("htmlFlowData"),$(A)):(e.consume(A),F)}function $(A){return e.exit("htmlFlow"),t(A)}}function CE(e,t,n){const r=this;return o;function o(s){return _e(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 EE(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Zo,t,n)}}const jE={name:"htmlText",tokenize:NE};function NE(e,t,n){const r=this;let o,i,s;return a;function a(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),l}function l(T){return T===33?(e.consume(T),u):T===47?(e.consume(T),N):T===63?(e.consume(T),k):Tt(T)?(e.consume(T),I):n(T)}function u(T){return T===45?(e.consume(T),d):T===91?(e.consume(T),i=0,y):Tt(T)?(e.consume(T),b):n(T)}function d(T){return T===45?(e.consume(T),f):n(T)}function h(T){return T===null?n(T):T===45?(e.consume(T),p):_e(T)?(s=h,W(T)):(e.consume(T),h)}function p(T){return T===45?(e.consume(T),f):h(T)}function f(T){return T===62?J(T):T===45?p(T):h(T)}function y(T){const F="CDATA[";return T===F.charCodeAt(i++)?(e.consume(T),i===F.length?m:y):n(T)}function m(T){return T===null?n(T):T===93?(e.consume(T),x):_e(T)?(s=m,W(T)):(e.consume(T),m)}function x(T){return T===93?(e.consume(T),g):m(T)}function g(T){return T===62?J(T):T===93?(e.consume(T),g):m(T)}function b(T){return T===null||T===62?J(T):_e(T)?(s=b,W(T)):(e.consume(T),b)}function k(T){return T===null?n(T):T===63?(e.consume(T),S):_e(T)?(s=k,W(T)):(e.consume(T),k)}function S(T){return T===62?J(T):k(T)}function N(T){return Tt(T)?(e.consume(T),C):n(T)}function C(T){return T===45||dt(T)?(e.consume(T),C):j(T)}function j(T){return _e(T)?(s=j,W(T)):Re(T)?(e.consume(T),j):J(T)}function I(T){return T===45||dt(T)?(e.consume(T),I):T===47||T===62||it(T)?P(T):n(T)}function P(T){return T===47?(e.consume(T),J):T===58||T===95||Tt(T)?(e.consume(T),M):_e(T)?(s=P,W(T)):Re(T)?(e.consume(T),P):J(T)}function M(T){return T===45||T===46||T===58||T===95||dt(T)?(e.consume(T),M):U(T)}function U(T){return T===61?(e.consume(T),E):_e(T)?(s=U,W(T)):Re(T)?(e.consume(T),U):P(T)}function E(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),o=T,D):_e(T)?(s=E,W(T)):Re(T)?(e.consume(T),E):(e.consume(T),w)}function D(T){return T===o?(e.consume(T),o=void 0,O):T===null?n(T):_e(T)?(s=D,W(T)):(e.consume(T),D)}function w(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||it(T)?P(T):(e.consume(T),w)}function O(T){return T===47||T===62||it(T)?P(T):n(T)}function J(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function W(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return Re(T)?Me(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):Y(T)}function Y(T){return e.enter("htmlTextData"),s(T)}}const aa={name:"labelEnd",resolveAll:IE,resolveTo:RE,tokenize:PE},TE={tokenize:OE},AE={tokenize:DE},zE={tokenize:ME};function IE(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 RE(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=pt(a,e.slice(i+1,i+r+3)),a=pt(a,[["enter",d,t]]),a=pt(a,sa(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=pt(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=pt(a,e.slice(s+1)),a=pt(a,[["exit",l,t]]),Pt(e,i,e.length,a),e}function PE(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(TE,d,s?d:h)(p):p===91?e.attempt(AE,d,s?u:h)(p):s?d(p):h(p)}function u(p){return e.attempt(zE,d,h)(p)}function d(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function OE(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 it(h)?ur(e,i)(h):i(h)}function i(h){return h===41?d(h):Bh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return it(h)?ur(e,l)(h):d(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?Zh(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return it(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 DE(e,t,n){const r=this;return o;function o(a){return Uh.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 ME(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 LE={name:"labelStartImage",resolveAll:aa.resolveAll,tokenize:FE};function FE(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 $E={name:"labelStartLink",resolveAll:aa.resolveAll,tokenize:BE};function BE(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 mi={name:"lineEnding",tokenize:UE};function UE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const Kr={name:"thematicBreak",tokenize:ZE};function ZE(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||_e(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 rt={continuation:{tokenize:qE},exit:GE,name:"list",tokenize:HE},VE={partial:!0,tokenize:JE},WE={partial:!0,tokenize:KE};function HE(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 y=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:es(f)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Kr,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 es(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(Zo,r.interrupt?n:d,e.attempt(VE,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 qE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Zo,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(WE,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Me(e,e.attempt(rt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function KE(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 GE(e){e.exit(this.containerState.type)}function JE(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 Gl={name:"setextUnderline",resolveTo:YE,tokenize:XE};function YE(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 XE(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||_e(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const QE={tokenize:ej};function ej(e){const t=this,n=e.attempt(Zo,r,e.attempt(this.parser.constructs.flowInitial,o,Me(e,e.attempt(this.parser.constructs.flow,o,e.attempt(iE,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 tj={resolveAll:Wh()},nj=Vh("string"),rj=Vh("text");function Vh(e){return{resolveAll:Wh(e==="text"?oj: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 Wh(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 oj(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 ij={42:rt,43:rt,45:rt,48:rt,49:rt,50:rt,51:rt,52:rt,53:rt,54:rt,55:rt,56:rt,57:rt,62:Mh},sj={91:uE},aj={[-2]:pi,[-1]:pi,32:pi},lj={35:gE,42:Kr,45:[Gl,Kr],60:bE,61:Gl,95:Kr,96:ql,126:ql},cj={38:Fh,92:Lh},uj={[-5]:mi,[-4]:mi,[-3]:mi,33:LE,38:Fh,42:ts,60:[$C,jE],91:$E,92:[pE,Lh],93:aa,95:ts,96:QC},dj={null:[ts,tj]},fj={null:[42,95]},hj={null:[]},pj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fj,contentInitial:sj,disable:hj,document:ij,flow:lj,flowInitial:aj,insideSpan:dj,string:cj,text:uj},Symbol.toStringTag,{value:"Module"}));function mj(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:j(N),check:j(C),consume:b,enter:k,exit:S,interrupt:j(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:y,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(U){return s=pt(s,U),x(),s[s.length-1]!==null?[]:(I(t,0),u.events=sa(i,u.events,u),u.events)}function p(U,E){return xj(f(U),E)}function f(U){return gj(s,U)}function y(){const{_bufferIndex:U,_index:E,line:D,column:w,offset:O}=r;return{_bufferIndex:U,_index:E,line:D,column:w,offset:O}}function m(U){o[U.line]=U.column,M()}function x(){let U;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<E.length;)g(E.charCodeAt(r._bufferIndex));else g(E)}}function g(U){d=d(U)}function b(U){_e(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,M()):U!==-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=U}function k(U,E){const D=E||{};return D.type=U,D.start=y(),u.events.push(["enter",D,u]),a.push(D),D}function S(U){const E=a.pop();return E.end=y(),u.events.push(["exit",E,u]),E}function N(U,E){I(U,E.from)}function C(U,E){E.restore()}function j(U,E){return D;function D(w,O,J){let W,q,Y,T;return Array.isArray(w)?$(w):"tokenize"in w?$([w]):F(w);function F(le){return Q;function Q(ce){const de=ce!==null&&le[ce],ge=ce!==null&&le.null,xe=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return $(xe)(ce)}}function $(le){return W=le,q=0,le.length===0?J:A(le[q])}function A(le){return Q;function Q(ce){return T=P(),Y=le,le.partial||(u.currentConstruct=le),le.name&&u.parser.constructs.disable.null.includes(le.name)?G():le.tokenize.call(E?Object.assign(Object.create(u),E):u,l,te,G)(ce)}}function te(le){return U(Y,T),O}function G(le){return T.restore(),++q<W.length?A(W[q]):J}}}function I(U,E){U.resolveAll&&!i.includes(U)&&i.push(U),U.resolve&&Pt(u.events,E,u.events.length-E,U.resolve(u.events.slice(E),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function P(){const U=y(),E=u.previous,D=u.currentConstruct,w=u.events.length,O=Array.from(a);return{from:w,restore:J};function J(){r=U,u.previous=E,u.currentConstruct=D,u.events.length=w,a=O,M()}}function M(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function gj(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 xj(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
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 yN(e){const r={constructs:CC([pN,...(e||{}).extensions||[]]),content:o(RC),defined:[],document:o(OC),flow:o(QE),lazy:{},string:o(nN),text:o(rN)};return r;function o(i){return s;function s(a){return mN(r,i,a)}}}function vN(e){for(;!$h(e););return e}const Jl=/[\0\t\n\r]/g;function bN(){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(Jl.lastIndex=h,u=Jl.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 wN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kN(e){return e.replace(wN,_N)}function _N(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Dh(n.slice(i?2:1),i?16:10)}return ia(n)||e}const Hh={}.hasOwnProperty;function SN(e,t,n){return typeof t!="string"&&(n=t,t=void 0),CN(n)(vN(yN(n).document().write(bN()(e,t,!0))))}function CN(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(L),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Z),blockQuote:i(ge),characterEscape:P,characterReference:P,codeFenced:i(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(xe,s),codeText:i(Ne,s),codeTextData:P,data:P,codeFlowValue:P,definition:i(Oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(_),hardBreakEscape:i(B),hardBreakTrailing:i(B),htmlFlow:i(R,s),htmlFlowData:P,htmlText:i(R,s),htmlTextData:P,image:i(z),label:s,link:i(L),listItem:i(re),listItemValue:p,listOrdered:i(ee,h),listUnordered:i(ee),paragraph:i(H),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Z),strong:i(se),thematicBreak:i(ae)},exit:{atxHeading:l(),atxHeadingSequence:j,autolink:l(),autolinkEmail:de,autolinkProtocol:ce,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:le,characterReference:Q,codeFenced:l(x),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:y,codeFlowValue:M,codeIndented:l(g),codeText:l(O),codeTextData:M,data:M,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(D),htmlFlowData:M,htmlText:l(w),htmlTextData:M,image:l(W),label:Y,labelText:q,lineEnding:U,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:T,resourceTitleString:F,resource:$,setextHeading:l(I),setextHeadingLineSequence:N,setextHeadingText:C,strong:l(),thematicBreak:l()}};qh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(V){let ne={type:"root",children:[]};const ue={stack:[ne],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},we=[];let Ae=-1;for(;++Ae<V.length;)if(V[Ae][1].type==="listOrdered"||V[Ae][1].type==="listUnordered")if(V[Ae][0]==="enter")we.push(Ae);else{const Ze=we.pop();Ae=o(V,Ze,Ae)}for(Ae=-1;++Ae<V.length;){const Ze=t[V[Ae][0]];Hh.call(Ze,V[Ae][1].type)&&Ze[V[Ae][1].type].call(Object.assign({sliceSerialize:V[Ae][2].sliceSerialize},ue),V[Ae][1])}if(ue.tokenStack.length>0){const Ze=ue.tokenStack[ue.tokenStack.length-1];(Ze[1]||Yl).call(ue,void 0,Ze[0])}for(ne.position={start:qt(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:qt(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)ne=t.transforms[Ae](ne)||ne;return ne}function o(V,ne,ue){let we=ne-1,Ae=-1,Ze=!1,lt,Ie,Et,Mt;for(;++we<=ue;){const Be=V[we];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?Ae++:Ae--,Mt=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(lt&&!Mt&&!Ae&&!Et&&(Et=we),Mt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mt=void 0}if(!Ae&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||Ae===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(lt){let Lt=we;for(Ie=void 0;Lt--;){const vt=V[Lt];if(vt[1].type==="lineEnding"||vt[1].type==="lineEndingBlank"){if(vt[0]==="exit")continue;Ie&&(V[Ie][1].type="lineEndingBlank",Ze=!0),vt[1].type="lineEnding",Ie=Lt}else if(!(vt[1].type==="linePrefix"||vt[1].type==="blockQuotePrefix"||vt[1].type==="blockQuotePrefixWhitespace"||vt[1].type==="blockQuoteMarker"||vt[1].type==="listItemIndent"))break}Et&&(!Ie||Et<Ie)&&(lt._spread=!0),lt.end=Object.assign({},Ie?V[Ie][1].start:Be[1].end),V.splice(Ie||we,0,["exit",lt,Be[2]]),we++,ue++}if(Be[1].type==="listItemPrefix"){const Lt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};lt=Lt,V.splice(we,0,["enter",Lt,Be[2]]),we++,ue++,Et=void 0,Mt=!0}}}return V[ne][1]._spread=Ze,ue}function i(V,ne){return ue;function ue(we){a.call(this,V(we),we),ne&&ne.call(this,we)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(V,ne,ue){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([ne,ue||void 0]),V.position={start:qt(ne.start),end:void 0}}function l(V){return ne;function ne(ue){V&&V.call(this,ue),u.call(this,ue)}}function u(V,ne){const ue=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==V.type&&(ne?ne.call(this,V,we[0]):(we[1]||Yl).call(this,V,we[0]));else throw new Error("Cannot close `"+V.type+"` ("+cr({start:V.start,end:V.end})+"): it’s not open");ue.position.end=qt(V.end)}function d(){return _C(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(V){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function f(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=V}function y(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=V}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V.replace(/(\r?\n|\r)$/g,"")}function b(V){const ne=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ne,ue.identifier=Rn(this.sliceSerialize(V)).toLowerCase()}function k(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.title=V}function S(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.url=V}function j(V){const ne=this.stack[this.stack.length-1];if(!ne.depth){const ue=this.sliceSerialize(V).length;ne.depth=ue}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function N(V){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function P(V){const ue=this.stack[this.stack.length-1].children;let we=ue[ue.length-1];(!we||we.type!=="text")&&(we=fe(),we.position={start:qt(V.start),end:void 0},ue.push(we)),this.stack.push(we)}function M(V){const ne=this.stack.pop();ne.value+=this.sliceSerialize(V),ne.position.end=qt(V.end)}function U(V){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=ne.children[ne.children.length-1];ue.position.end=qt(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(P.call(this,V),M.call(this,V))}function E(){this.data.atHardBreak=!0}function D(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V}function w(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V}function O(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V}function J(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ne,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function W(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ne,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function q(V){const ne=this.sliceSerialize(V),ue=this.stack[this.stack.length-2];ue.label=kN(ne),ue.identifier=Rn(ne).toLowerCase()}function Y(){const V=this.stack[this.stack.length-1],ne=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const we=V.children;ue.children=we}else ue.alt=ne}function T(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.url=V}function F(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.title=V}function $(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function te(V){const ne=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ne,ue.identifier=Rn(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function G(V){this.data.characterReferenceType=V.type}function le(V){const ne=this.sliceSerialize(V),ue=this.data.characterReferenceType;let we;ue?(we=Dh(ne,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=ia(ne);const Ae=this.stack[this.stack.length-1];Ae.value+=we}function Q(V){const ne=this.stack.pop();ne.position.end=qt(V.end)}function ce(V){M.call(this,V);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(V)}function de(V){M.call(this,V);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(V)}function ge(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ne(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _(){return{type:"emphasis",children:[]}}function Z(){return{type:"heading",depth:0,children:[]}}function B(){return{type:"break"}}function R(){return{type:"html",value:""}}function z(){return{type:"image",title:null,url:"",alt:null}}function L(){return{type:"link",title:null,url:"",children:[]}}function ee(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function re(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function H(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function fe(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function qt(e){return{line:e.line,column:e.column,offset:e.offset}}function qh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qh(e,r):EN(e,r)}}function EN(e,t){let n;for(n in t)if(Hh.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 Yl(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 NN(e){const t=this;t.parser=n;function n(r){return SN(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jN(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 TN(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
88
|
-
`}]}function
|
|
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
|
|
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 yj(e){const r={constructs:CC([pj,...(e||{}).extensions||[]]),content:o(RC),defined:[],document:o(OC),flow:o(QE),lazy:{},string:o(nj),text:o(rj)};return r;function o(i){return s;function s(a){return mj(r,i,a)}}}function vj(e){for(;!$h(e););return e}const Jl=/[\0\t\n\r]/g;function bj(){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(Jl.lastIndex=h,u=Jl.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 wj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kj(e){return e.replace(wj,_j)}function _j(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return Dh(n.slice(i?2:1),i?16:10)}return ia(n)||e}const Hh={}.hasOwnProperty;function Sj(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Cj(n)(vj(yj(n).document().write(bj()(e,t,!0))))}function Cj(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(L),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Z),blockQuote:i(ge),characterEscape:P,characterReference:P,codeFenced:i(xe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(xe,s),codeText:i(je,s),codeTextData:P,data:P,codeFlowValue:P,definition:i(Oe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(_),hardBreakEscape:i(B),hardBreakTrailing:i(B),htmlFlow:i(R,s),htmlFlowData:P,htmlText:i(R,s),htmlTextData:P,image:i(z),label:s,link:i(L),listItem:i(re),listItemValue:p,listOrdered:i(ee,h),listUnordered:i(ee),paragraph:i(H),reference:A,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Z),strong:i(se),thematicBreak:i(ae)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:de,autolinkProtocol:ce,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:le,characterReference:Q,codeFenced:l(x),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:y,codeFlowValue:M,codeIndented:l(g),codeText:l(O),codeTextData:M,data:M,definition:l(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(D),htmlFlowData:M,htmlText:l(w),htmlTextData:M,image:l(W),label:Y,labelText:q,lineEnding:U,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:te,resourceDestinationString:T,resourceTitleString:F,resource:$,setextHeading:l(I),setextHeadingLineSequence:j,setextHeadingText:C,strong:l(),thematicBreak:l()}};qh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(V){let ne={type:"root",children:[]};const ue={stack:[ne],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},we=[];let Ae=-1;for(;++Ae<V.length;)if(V[Ae][1].type==="listOrdered"||V[Ae][1].type==="listUnordered")if(V[Ae][0]==="enter")we.push(Ae);else{const Ze=we.pop();Ae=o(V,Ze,Ae)}for(Ae=-1;++Ae<V.length;){const Ze=t[V[Ae][0]];Hh.call(Ze,V[Ae][1].type)&&Ze[V[Ae][1].type].call(Object.assign({sliceSerialize:V[Ae][2].sliceSerialize},ue),V[Ae][1])}if(ue.tokenStack.length>0){const Ze=ue.tokenStack[ue.tokenStack.length-1];(Ze[1]||Yl).call(ue,void 0,Ze[0])}for(ne.position={start:qt(V.length>0?V[0][1].start:{line:1,column:1,offset:0}),end:qt(V.length>0?V[V.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae<t.transforms.length;)ne=t.transforms[Ae](ne)||ne;return ne}function o(V,ne,ue){let we=ne-1,Ae=-1,Ze=!1,lt,Ie,Et,Mt;for(;++we<=ue;){const Be=V[we];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?Ae++:Ae--,Mt=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(lt&&!Mt&&!Ae&&!Et&&(Et=we),Mt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Mt=void 0}if(!Ae&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||Ae===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(lt){let Lt=we;for(Ie=void 0;Lt--;){const vt=V[Lt];if(vt[1].type==="lineEnding"||vt[1].type==="lineEndingBlank"){if(vt[0]==="exit")continue;Ie&&(V[Ie][1].type="lineEndingBlank",Ze=!0),vt[1].type="lineEnding",Ie=Lt}else if(!(vt[1].type==="linePrefix"||vt[1].type==="blockQuotePrefix"||vt[1].type==="blockQuotePrefixWhitespace"||vt[1].type==="blockQuoteMarker"||vt[1].type==="listItemIndent"))break}Et&&(!Ie||Et<Ie)&&(lt._spread=!0),lt.end=Object.assign({},Ie?V[Ie][1].start:Be[1].end),V.splice(Ie||we,0,["exit",lt,Be[2]]),we++,ue++}if(Be[1].type==="listItemPrefix"){const Lt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};lt=Lt,V.splice(we,0,["enter",Lt,Be[2]]),we++,ue++,Et=void 0,Mt=!0}}}return V[ne][1]._spread=Ze,ue}function i(V,ne){return ue;function ue(we){a.call(this,V(we),we),ne&&ne.call(this,we)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(V,ne,ue){this.stack[this.stack.length-1].children.push(V),this.stack.push(V),this.tokenStack.push([ne,ue||void 0]),V.position={start:qt(ne.start),end:void 0}}function l(V){return ne;function ne(ue){V&&V.call(this,ue),u.call(this,ue)}}function u(V,ne){const ue=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==V.type&&(ne?ne.call(this,V,we[0]):(we[1]||Yl).call(this,V,we[0]));else throw new Error("Cannot close `"+V.type+"` ("+cr({start:V.start,end:V.end})+"): it’s not open");ue.position.end=qt(V.end)}function d(){return _C(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(V){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(V),10),this.data.expectingFirstListItemValue=void 0}}function f(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=V}function y(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=V}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V.replace(/(\r?\n|\r)$/g,"")}function b(V){const ne=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ne,ue.identifier=Rn(this.sliceSerialize(V)).toLowerCase()}function k(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.title=V}function S(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.url=V}function N(V){const ne=this.stack[this.stack.length-1];if(!ne.depth){const ue=this.sliceSerialize(V).length;ne.depth=ue}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function j(V){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(V).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function P(V){const ue=this.stack[this.stack.length-1].children;let we=ue[ue.length-1];(!we||we.type!=="text")&&(we=fe(),we.position={start:qt(V.start),end:void 0},ue.push(we)),this.stack.push(we)}function M(V){const ne=this.stack.pop();ne.value+=this.sliceSerialize(V),ne.position.end=qt(V.end)}function U(V){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=ne.children[ne.children.length-1];ue.position.end=qt(V.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(P.call(this,V),M.call(this,V))}function E(){this.data.atHardBreak=!0}function D(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V}function w(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V}function O(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.value=V}function J(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ne,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function W(){const V=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";V.type+="Reference",V.referenceType=ne,delete V.url,delete V.title}else delete V.identifier,delete V.label;this.data.referenceType=void 0}function q(V){const ne=this.sliceSerialize(V),ue=this.stack[this.stack.length-2];ue.label=kj(ne),ue.identifier=Rn(ne).toLowerCase()}function Y(){const V=this.stack[this.stack.length-1],ne=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const we=V.children;ue.children=we}else ue.alt=ne}function T(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.url=V}function F(){const V=this.resume(),ne=this.stack[this.stack.length-1];ne.title=V}function $(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function te(V){const ne=this.resume(),ue=this.stack[this.stack.length-1];ue.label=ne,ue.identifier=Rn(this.sliceSerialize(V)).toLowerCase(),this.data.referenceType="full"}function G(V){this.data.characterReferenceType=V.type}function le(V){const ne=this.sliceSerialize(V),ue=this.data.characterReferenceType;let we;ue?(we=Dh(ne,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=ia(ne);const Ae=this.stack[this.stack.length-1];Ae.value+=we}function Q(V){const ne=this.stack.pop();ne.position.end=qt(V.end)}function ce(V){M.call(this,V);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(V)}function de(V){M.call(this,V);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(V)}function ge(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function je(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _(){return{type:"emphasis",children:[]}}function Z(){return{type:"heading",depth:0,children:[]}}function B(){return{type:"break"}}function R(){return{type:"html",value:""}}function z(){return{type:"image",title:null,url:"",alt:null}}function L(){return{type:"link",title:null,url:"",children:[]}}function ee(V){return{type:"list",ordered:V.type==="listOrdered",start:null,spread:V._spread,children:[]}}function re(V){return{type:"listItem",spread:V._spread,checked:null,children:[]}}function H(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function fe(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function qt(e){return{line:e.line,column:e.column,offset:e.offset}}function qh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qh(e,r):Ej(e,r)}}function Ej(e,t){let n;for(n in t)if(Hh.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 Yl(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 jj(e){const t=this;t.parser=n;function n(r){return Sj(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Nj(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 Tj(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
88
|
+
`}]}function Aj(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 zj(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ij(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rj(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 Pj(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 Oj(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Kh(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 Dj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kh(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 Mj(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 Lj(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 Fj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kh(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 $j(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 Bj(e,t,n){const r=e.all(t),o=n?Uj(n):Gh(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
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
|
|
91
|
+
`});const u={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,u),e.applyData(t,u)}function Uj(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=Gh(n[r])}return t}function Gh(e){const t=e.spread;return t??e.children.length>1}function Zj(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 Vj(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Wj(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Hj(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qj(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=ta(t.children[1]),l=Th(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 Kj(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 y={type:"element",tagName:i,properties:p,children:[]};h&&(y.children=e.all(h),e.patch(h,y),y=e.applyData(h,y)),u.push(y)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function Gj(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xl=9,Ql=32;function Jj(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(ec(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(ec(t.slice(o),o>0,!1)),i.join("")}function ec(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===Xl||i===Ql;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===Xl||i===Ql;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Yj(e,t){const n={type:"text",value:Jj(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Xj(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Qj={blockquote:Nj,break:Tj,code:Aj,delete:zj,emphasis:Ij,footnoteReference:Rj,heading:Pj,html:Oj,imageReference:Dj,image:Mj,inlineCode:Lj,linkReference:Fj,link:$j,listItem:Bj,list:Zj,paragraph:Vj,root:Wj,strong:Hj,table:qj,tableCell:Gj,tableRow:Kj,text:Yj,thematicBreak:Xj,toml:Fr,yaml:Fr,definition:Fr,footnoteDefinition:Fr};function Fr(){}const Jh=-1,Vo=0,dr=1,ho=2,la=3,ca=4,ua=5,da=6,Yh=7,Xh=8,tc=typeof self=="object"?self:globalThis,eN=(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 Vo:case Jh:return n(s,o);case dr:{const a=n([],o);for(const l of s)a.push(r(l));return a}case ho:{const a=n({},o);for(const[l,u]of s)a[r(l)]=r(u);return a}case la:return n(new Date(s),o);case ca:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case ua:{const a=n(new Map,o);for(const[l,u]of s)a.set(r(l),r(u));return a}case da:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case Yh:{const{name:a,message:l}=s;return n(new tc[a](l),o)}case Xh: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 tc[i](s),o)};return r},nc=e=>eN(new Map,e)(0),_n="",{toString:tN}={},{keys:nN}=Object,or=e=>{const t=typeof e;if(t!=="object"||!e)return[Vo,t];const n=tN.call(e).slice(8,-1);switch(n){case"Array":return[dr,_n];case"Object":return[ho,_n];case"Date":return[la,_n];case"RegExp":return[ca,_n];case"Map":return[ua,_n];case"Set":return[da,_n];case"DataView":return[dr,n]}return n.includes("Array")?[dr,n]:n.includes("Error")?[Yh,n]:[ho,n]},$r=([e,t])=>e===Vo&&(t==="function"||t==="symbol"),rN=(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 Vo:{let d=s;switch(l){case"bigint":a=Xh,d=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([Jh],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 ho:{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 nN(s))(e||!$r(or(s[p])))&&d.push([i(p),i(s[p])]);return h}case la:return o([a,s.toISOString()],s);case ca:{const{source:d,flags:h}=s;return o([a,{source:d,flags:h}],s)}case ua:{const d=[],h=o([a,d],s);for(const[p,f]of s)(e||!($r(or(p))||$r(or(f))))&&d.push([i(p),i(f)]);return h}case da:{const d=[],h=o([a,d],s);for(const p of s)(e||!$r(or(p)))&&d.push(i(p));return h}}const{message:u}=s;return o([a,{name:l,message:u}],s)};return i},rc=(e,{json:t,lossy:n}={})=>{const r=[];return rN(!(t||n),!!t,new Map,r)(e),r},po=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?nc(rc(e,t)):structuredClone(e):(e,t)=>nc(rc(e,t));function oN(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 iN(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function sN(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||oN,r=e.options.footnoteBackLabel||iN,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 y=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){y.length>0&&y.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,f);typeof b=="string"&&(b={type:"text",value:b}),y.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(b)?b:[b]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...y)}else d.push(...y);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:{...po(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
92
92
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
93
|
-
`}]}}const Qh=(function(e){if(e==null)return
|
|
93
|
+
`}]}}const Qh=(function(e){if(e==null)return uN;if(typeof e=="function")return Wo(e);if(typeof e=="object")return Array.isArray(e)?aN(e):lN(e);if(typeof e=="string")return cN(e);throw new Error("Expected function, string, or object as test")});function aN(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qh(e[n]);return Wo(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function lN(e){const t=e;return Wo(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function cN(e){return Wo(t);function t(n){return n&&n.type===e}}function Wo(e){return t;function t(n,r,o){return!!(dN(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function uN(){return!0}function dN(e){return e!==null&&typeof e=="object"&&"type"in e}const ep=[],fN=!0,oc=!1,hN="skip";function pN(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=Qh(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=ep,y,m,x;if((!t||i(l,u,d[d.length-1]||void 0))&&(f=mN(n(l,d)),f[0]===oc))return f;if("children"in l&&l.children){const g=l;if(g.children&&f[0]!==hN)for(m=(r?g.children.length:-1)+s,x=d.concat(g);m>-1&&m<g.children.length;){const b=g.children[m];if(y=a(b,m,x)(),y[0]===oc)return y;m=typeof y[1]=="number"?y[1]:m+s}}return f}}}function mN(e){return Array.isArray(e)?e:typeof e=="number"?[fN,e]:e==null?ep:[e]}function tp(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),pN(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 ns={}.hasOwnProperty,gN={};function xN(e,t){const n=t||gN,r=new Map,o=new Map,i=new Map,s={...Qj,...n.handlers},a={all:u,applyData:vN,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:yN,wrap:wN};return tp(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(ns.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,...x}=d,g=po(x);return g.children=a.all(d),g}return po(d)}return(a.options.unknownHandler||bN)(a,d,h)}function u(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const y=a.one(p[f],d);if(y){if(f&&p[f-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=ic(y.value)),!Array.isArray(y)&&y.type==="element")){const m=y.children[0];m&&m.type==="text"&&(m.value=ic(m.value))}Array.isArray(y)?h.push(...y):h.push(y)}}}return h}}function yN(e,t){e.position&&(t.position=tC(e))}function vN(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,po(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function bN(e,t){const n=t.data||{},r="value"in t&&!(ns.call(n,"hProperties")||ns.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 wN(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
94
94
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
95
95
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
96
|
-
`}),n}function ic(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sc(e,t){const n=
|
|
97
|
-
`},o),i}function kj(e,t){return e&&"run"in e?async function(n,r){const o=sc(n,{file:r,...t});await e.run(o,r)}:function(n,r){return sc(n,{file:r,...e||t})}}function ac(e){if(e)throw e}var gi,lc;function _j(){if(lc)return gi;lc=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 gi=function l(){var u,d,h,p,f,y,m=arguments[0],x=1,g=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},x=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});x<g;++x)if(u=arguments[x],u!=null)for(d in u)h=a(m,d),p=a(u,d),m!==p&&(b&&p&&(i(p)||(f=o(p)))?(f?(f=!1,y=h&&o(h)?h:[]):y=h&&i(h)?h:{},s(m,{name:d,newValue:l(b,y,p)})):typeof p<"u"&&s(m,{name:d,newValue:p}));return m},gi}var Sj=_j();const xi=ds(Sj);function rs(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 Cj(){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?Ej(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 Ej(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:Nj,dirname:jj,extname:Tj,join:Aj,sep:"/"};function Nj(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sr(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 jj(e){if(Sr(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 Tj(e){Sr(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 Aj(...e){let t=-1,n;for(;++t<e.length;)Sr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zj(n)}function zj(e){Sr(e);const t=e.codePointAt(0)===47;let n=Ij(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ij(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 Sr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rj={cwd:Pj};function Pj(){return"/"}function os(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Oj(e){if(typeof e=="string")e=new URL(e);else if(!os(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 Dj(e)}function Dj(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 yi=["history","path","basename","stem","extname","dirname"];class np{constructor(t){let n;t?os(t)?n={path:t}:typeof t=="string"||Mj(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Rj.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<yi.length;){const i=yi[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)yi.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Nt.basename(this.path):void 0}set basename(t){bi(t,"basename"),vi(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){cc(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(vi(t,"extname"),cc(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){os(t)&&(t=Oj(t)),bi(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){bi(t,"stem"),vi(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 Qe(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 vi(e,t){if(e&&e.includes(Nt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Nt.sep+"`")}function bi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Lj=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),Fj={}.hasOwnProperty;class fa extends Lj{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=Cj()}copy(){const t=new fa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_i("data",this.frozen),this.namespace[t]=n,this):Fj.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_i("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=Br(t),r=this.parser||this.Parser;return wi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wi("process",this.parser||this.Parser),ki("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Br(t),l=r.parse(a);r.run(l,a,function(d,h,p){if(d||!h||!p)return u(d);const f=h,y=r.stringify(f,p);Uj(y)?p.value=y:p.result=y,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(),wi("processSync",this.parser||this.Parser),ki("processSync",this.compiler||this.Compiler),this.process(t,o),dc("processSync","process",n),r;function o(i,s){n=!0,ac(i),r=s}}run(t,n,r){uc(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=Br(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),dc("runSync","run",r),o;function i(s,a){ac(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Br(n),o=this.compiler||this.Compiler;return ki("stringify",o),uc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(_i("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=xi(!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,...y]=d;const m=r[p][1];rs(m)&&rs(f)&&(f=xi(!0,m,f)),r[p]=[u,f,...y]}}}}const $j=new fa().freeze();function wi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ki(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _i(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 uc(e){if(!rs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Br(e){return Bj(e)?e:new np(e)}function Bj(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uj(e){return typeof e=="string"||Zj(e)}function Zj(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Vj="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fc=[],hc={allowDangerousHtml:!0},Wj=/^(https?|ircs?|mailto|xmpp)$/i,Hj=[{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=qj(e),n=Kj(e);return Gj(t.runSync(t.parse(n),n),e)}function qj(e){const t=e.rehypePlugins||fc,n=e.remarkPlugins||fc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hc}:hc;return $j().use(NN).use(n).use(kj,r).use(t)}function Kj(e){const t=e.children||"",n=new np;return typeof t=="string"&&(n.value=t),n}function Gj(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||Jj;for(const d of Hj)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Vj+d.id,void 0);return tp(e,u),sC(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 hi)if(Object.hasOwn(hi,f)&&Object.hasOwn(d.properties,f)){const y=d.properties[f],m=hi[f];(m===null||m.includes(d.tagName))&&(d.properties[f]=l(String(y||""),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 Jj(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||Wj.test(e.slice(0,t))?e:""}function pc({delayDuration:e=0,...t}){return c.jsx(pS,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Yj({...e}){return c.jsx(mS,{"data-slot":"tooltip",...e})}function Xj({...e}){return c.jsx(gS,{"data-slot":"tooltip-trigger",...e})}function Qj({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(xS,{children:c.jsxs(yS,{"data-slot":"tooltip-content",sideOffset:t,className:me("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(vS,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function rp(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 mo(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function e3(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function ha(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=e3(e,t);return[t,Zn(n)]}):[]}function mc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const gc=120;function t3({text:e}){const[t,n]=v.useState(!1);return e.length>gc?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(Yj,{delayDuration:300,children:[c.jsxs(Xj,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[c.jsx("span",{children:e.slice(0,gc)}),c.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),c.jsxs(Qj,{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 op({value:e}){if(e===null)return c.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return c.jsx(t3,{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 xc({value:e}){const[t,n]=v.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 n3({value:e}){const[t,n]=v.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 r3(e){return mo(e)?ha(e).some(([,t])=>mo(t)):!1}function o3({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(kv,{className:"size-3.5 text-muted-foreground"}):c.jsx(bv,{className:"size-3.5 text-muted-foreground"})})}function ip({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=v.useState(n<r),[a,l]=v.useState(0),[u,d]=v.useState(null),[h,p]=v.useState(!1),f=mo(t),y=rp(t),m=y==="array"?"[":"{",x=y==="array"?"]":"}";function g(k){k.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 b=u??r;return c.jsxs("div",{className:me(n>0&&"border-l border-border/50 ml-2"),children:[c.jsxs("div",{className:me("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?k=>{(k.key==="Enter"||k.key===" ")&&(k.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(mt,{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:me("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:[" ",mc(t)," ",mc(t)===1?"item":"items"," ",x]})]}):c.jsx("span",{className:"min-w-0",children:c.jsx(op,{value:t})}),f&&r3(t)&&c.jsx(o3,{allExpanded:h,onClick:g}),c.jsx(n3,{value:t})]}),f&&i&&c.jsxs("div",{className:"pl-4",children:[ha(t).map(([k,S])=>c.jsx(ip,{name:k,value:S,level:n+1,defaultExpandDepth:b,isArrayItem:y==="array"},k)),c.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:x})]},a)]})}function Ho({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!mo(e))return c.jsx(pc,{children:c.jsx("div",{className:me("font-mono text-xs leading-relaxed",n),children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(op,{value:e}),r&&c.jsx(xc,{value:e})]})})});const s=rp(e)==="array";return c.jsx(pc,{children:c.jsxs("div",{className:me("font-mono text-xs leading-relaxed",n),children:[r&&c.jsx(xc,{value:e}),ha(e).map(([a,l])=>c.jsx(ip,{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(Ho,{data:Zn(r),defaultExpandDepth:t,className:n})}catch{return c.jsx("pre",{className:me("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(G_,{"data-slot":"tabs","data-orientation":t,orientation:t,className:me("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const i3=Ts("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(J_,{"data-slot":"tabs-list","data-variant":t,className:me(i3({variant:t}),e),...n})}function Ge({className:e,...t}){return c.jsx(Y_,{"data-slot":"tabs-trigger",className:me("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(X_,{"data-slot":"tabs-content",className:me("flex-1 outline-none",e),...t})}class sp{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=b=>{if(b=this.postProcess(b,r),o){setTimeout(function(){o(b)},0);return}else return b},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 y=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&y+1>=a)return s(this.buildValues(f[0].lastComponent,n,t));let m=-1/0,x=1/0;const g=()=>{for(let b=Math.max(m,-u);b<=Math.min(x,u);b+=2){let k;const S=f[b-1],j=f[b+1];S&&(f[b-1]=void 0);let C=!1;if(j){const I=j.oldPos-b;C=j&&0<=I&&I<a}const N=S&&S.oldPos+1<l;if(!C&&!N){f[b]=void 0;continue}if(!N||C&&S.oldPos<j.oldPos?k=this.addToPath(j,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),y=this.extractCommon(k,n,t,b,r),k.oldPos+1>=l&&y+1>=a)return s(this.buildValues(k.lastComponent,n,t))||!0;f[b]=k,k.oldPos+1>=l&&(x=Math.min(x,b-1)),y+1>=a&&(m=Math.max(m,b+1))}u++};if(o)(function b(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);g()||b()},0)})();else for(;u<=d&&Date.now()<=p;){const b=g();if(b)return b}}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 y=r[u+f];return y.length>p.length?y: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 s3 extends sp{constructor(){super(...arguments),this.tokenize=lp}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
96
|
+
`}),n}function ic(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sc(e,t){const n=xN(e,t),r=n.one(e,void 0),o=sN(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 kN(e,t){return e&&"run"in e?async function(n,r){const o=sc(n,{file:r,...t});await e.run(o,r)}:function(n,r){return sc(n,{file:r,...e||t})}}function ac(e){if(e)throw e}var gi,lc;function _N(){if(lc)return gi;lc=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 gi=function l(){var u,d,h,p,f,y,m=arguments[0],x=1,g=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},x=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});x<g;++x)if(u=arguments[x],u!=null)for(d in u)h=a(m,d),p=a(u,d),m!==p&&(b&&p&&(i(p)||(f=o(p)))?(f?(f=!1,y=h&&o(h)?h:[]):y=h&&i(h)?h:{},s(m,{name:d,newValue:l(b,y,p)})):typeof p<"u"&&s(m,{name:d,newValue:p}));return m},gi}var SN=_N();const xi=ds(SN);function rs(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 CN(){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?EN(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 EN(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 jt={basename:jN,dirname:NN,extname:TN,join:AN,sep:"/"};function jN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Sr(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 NN(e){if(Sr(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 TN(e){Sr(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 AN(...e){let t=-1,n;for(;++t<e.length;)Sr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zN(n)}function zN(e){Sr(e);const t=e.codePointAt(0)===47;let n=IN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function IN(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 Sr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const RN={cwd:PN};function PN(){return"/"}function os(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ON(e){if(typeof e=="string")e=new URL(e);else if(!os(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 DN(e)}function DN(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 yi=["history","path","basename","stem","extname","dirname"];class np{constructor(t){let n;t?os(t)?n={path:t}:typeof t=="string"||MN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":RN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<yi.length;){const i=yi[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)yi.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?jt.basename(this.path):void 0}set basename(t){bi(t,"basename"),vi(t,"basename"),this.path=jt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?jt.dirname(this.path):void 0}set dirname(t){cc(this.basename,"dirname"),this.path=jt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?jt.extname(this.path):void 0}set extname(t){if(vi(t,"extname"),cc(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=jt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){os(t)&&(t=ON(t)),bi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?jt.basename(this.path,this.extname):void 0}set stem(t){bi(t,"stem"),vi(t,"stem"),this.path=jt.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 Xe(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 vi(e,t){if(e&&e.includes(jt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+jt.sep+"`")}function bi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function MN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const LN=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),FN={}.hasOwnProperty;class fa extends LN{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=CN()}copy(){const t=new fa;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(xi(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_i("data",this.frozen),this.namespace[t]=n,this):FN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_i("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=Br(t),r=this.parser||this.Parser;return wi("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wi("process",this.parser||this.Parser),ki("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Br(t),l=r.parse(a);r.run(l,a,function(d,h,p){if(d||!h||!p)return u(d);const f=h,y=r.stringify(f,p);UN(y)?p.value=y:p.result=y,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(),wi("processSync",this.parser||this.Parser),ki("processSync",this.compiler||this.Compiler),this.process(t,o),dc("processSync","process",n),r;function o(i,s){n=!0,ac(i),r=s}}run(t,n,r){uc(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=Br(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),dc("runSync","run",r),o;function i(s,a){ac(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Br(n),o=this.compiler||this.Compiler;return ki("stringify",o),uc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(_i("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=xi(!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,...y]=d;const m=r[p][1];rs(m)&&rs(f)&&(f=xi(!0,m,f)),r[p]=[u,f,...y]}}}}const $N=new fa().freeze();function wi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ki(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _i(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 uc(e){if(!rs(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Br(e){return BN(e)?e:new np(e)}function BN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function UN(e){return typeof e=="string"||ZN(e)}function ZN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",fc=[],hc={allowDangerousHtml:!0},WN=/^(https?|ircs?|mailto|xmpp)$/i,HN=[{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=qN(e),n=KN(e);return GN(t.runSync(t.parse(n),n),e)}function qN(e){const t=e.rehypePlugins||fc,n=e.remarkPlugins||fc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hc}:hc;return $N().use(jj).use(n).use(kN,r).use(t)}function KN(e){const t=e.children||"",n=new np;return typeof t=="string"&&(n.value=t),n}function GN(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||JN;for(const d of HN)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+VN+d.id,void 0);return tp(e,u),sC(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 hi)if(Object.hasOwn(hi,f)&&Object.hasOwn(d.properties,f)){const y=d.properties[f],m=hi[f];(m===null||m.includes(d.tagName))&&(d.properties[f]=l(String(y||""),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 JN(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||WN.test(e.slice(0,t))?e:""}function pc({delayDuration:e=0,...t}){return c.jsx(pS,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function YN({...e}){return c.jsx(mS,{"data-slot":"tooltip",...e})}function XN({...e}){return c.jsx(gS,{"data-slot":"tooltip-trigger",...e})}function QN({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(xS,{children:c.jsxs(yS,{"data-slot":"tooltip-content",sideOffset:t,className:me("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(vS,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function rp(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 mo(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function e3(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function ha(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=e3(e,t);return[t,Zn(n)]}):[]}function mc(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const gc=120;function t3({text:e}){const[t,n]=v.useState(!1);return e.length>gc?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(YN,{delayDuration:300,children:[c.jsxs(XN,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[c.jsx("span",{children:e.slice(0,gc)}),c.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),c.jsxs(QN,{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 op({value:e}){if(e===null)return c.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return c.jsx(t3,{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 xc({value:e}){const[t,n]=v.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 n3({value:e}){const[t,n]=v.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 r3(e){return mo(e)?ha(e).some(([,t])=>mo(t)):!1}function o3({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(kv,{className:"size-3.5 text-muted-foreground"}):c.jsx(bv,{className:"size-3.5 text-muted-foreground"})})}function ip({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=v.useState(n<r),[a,l]=v.useState(0),[u,d]=v.useState(null),[h,p]=v.useState(!1),f=mo(t),y=rp(t),m=y==="array"?"[":"{",x=y==="array"?"]":"}";function g(k){k.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 b=u??r;return c.jsxs("div",{className:me(n>0&&"border-l border-border/50 ml-2"),children:[c.jsxs("div",{className:me("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?k=>{(k.key==="Enter"||k.key===" ")&&(k.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(mt,{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:me("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:[" ",mc(t)," ",mc(t)===1?"item":"items"," ",x]})]}):c.jsx("span",{className:"min-w-0",children:c.jsx(op,{value:t})}),f&&r3(t)&&c.jsx(o3,{allExpanded:h,onClick:g}),c.jsx(n3,{value:t})]}),f&&i&&c.jsxs("div",{className:"pl-4",children:[ha(t).map(([k,S])=>c.jsx(ip,{name:k,value:S,level:n+1,defaultExpandDepth:b,isArrayItem:y==="array"},k)),c.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:x})]},a)]})}function Ho({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!mo(e))return c.jsx(pc,{children:c.jsx("div",{className:me("font-mono text-xs leading-relaxed",n),children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(op,{value:e}),r&&c.jsx(xc,{value:e})]})})});const s=rp(e)==="array";return c.jsx(pc,{children:c.jsxs("div",{className:me("font-mono text-xs leading-relaxed",n),children:[r&&c.jsx(xc,{value:e}),ha(e).map(([a,l])=>c.jsx(ip,{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(Ho,{data:Zn(r),defaultExpandDepth:t,className:n})}catch{return c.jsx("pre",{className:me("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 jn({className:e,orientation:t="horizontal",...n}){return c.jsx(G_,{"data-slot":"tabs","data-orientation":t,orientation:t,className:me("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const i3=Ts("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 Nn({className:e,variant:t="default",...n}){return c.jsx(J_,{"data-slot":"tabs-list","data-variant":t,className:me(i3({variant:t}),e),...n})}function Ge({className:e,...t}){return c.jsx(Y_,{"data-slot":"tabs-trigger",className:me("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(X_,{"data-slot":"tabs-content",className:me("flex-1 outline-none",e),...t})}class sp{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=b=>{if(b=this.postProcess(b,r),o){setTimeout(function(){o(b)},0);return}else return b},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 y=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&y+1>=a)return s(this.buildValues(f[0].lastComponent,n,t));let m=-1/0,x=1/0;const g=()=>{for(let b=Math.max(m,-u);b<=Math.min(x,u);b+=2){let k;const S=f[b-1],N=f[b+1];S&&(f[b-1]=void 0);let C=!1;if(N){const I=N.oldPos-b;C=N&&0<=I&&I<a}const j=S&&S.oldPos+1<l;if(!C&&!j){f[b]=void 0;continue}if(!j||C&&S.oldPos<N.oldPos?k=this.addToPath(N,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),y=this.extractCommon(k,n,t,b,r),k.oldPos+1>=l&&y+1>=a)return s(this.buildValues(k.lastComponent,n,t))||!0;f[b]=k,k.oldPos+1>=l&&(x=Math.min(x,b-1)),y+1>=a&&(m=Math.max(m,b+1))}u++};if(o)(function b(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);g()||b()},0)})();else for(;u<=d&&Date.now()<=p;){const b=g();if(b)return b}}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 y=r[u+f];return y.length>p.length?y: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 s3 extends sp{constructor(){super(...arguments),this.tokenize=lp}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
98
98
|
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
99
99
|
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
100
100
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
@@ -102,4 +102,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
102
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 l3 extends sp{constructor(){super(...arguments),this.tokenize=lp}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(is(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 c3=new l3;function u3(e,t,n){return c3.diff(e,t,n)}function is(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]=is(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]=is(e[l],t,n,r,l);t.pop(),n.pop()}else s=e;return s}function yc(e){return e===void 0?[]:Object.entries(e).map(t=>[t[0].toLowerCase(),t[1]]).sort(([t],[n])=>t.localeCompare(n))}function vc([e,t]){return`${e}: ${t}`}function ss(e){const t=[];let n=0,r=0;for(const o of e){const i=o.value.split(`
|
|
103
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 d3(e,t){const n=yc(e).map(vc).join(`
|
|
104
104
|
`),r=yc(t).map(vc).join(`
|
|
105
|
-
`);if(n===r)return{lines:[],isEmpty:!0};const o=ap(n,r);return{lines:ss(o),isEmpty:!1}}function bc(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function f3(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=bc(n),i=bc(r);if(o!==null&&i!==null){const a=u3(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:ss(a),isEmpty:!1}}const s=ap(n,r);return{lines:ss(s),isEmpty:!1}}const h3=22,Si=1e4;function p3(e){return e==="added"?"+":e==="removed"?"-":" "}function m3(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 wc({result:e,emptyLabel:t}){const[n,r]=v.useState("unified"),o=v.useRef(null),i=zu({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>h3,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>Si,l=a?e.lines.slice(0,Si):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 ${Si.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:me("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(Fu,{className:"size-3"}),"Unified"]}),c.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:me("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(Pu,{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(g3,{virtualizer:i,lines:l}):c.jsx(v3,{lines:l})})]})}function g3({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:me("flex items-start gap-3 px-2",m3(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:me("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:p3(r.kind)}),c.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function x3(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 y3(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 v3({lines:e}){const t=x3(e);return c.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>c.jsxs("div",{className:me("grid grid-cols-2 font-mono text-xs",y3(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:me("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:me("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 b3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",w3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",k3="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",_3="/assets/minimax-BPMzvuL-.jpeg",S3="/assets/alibaba-TTwafVwX.svg",C3="/assets/qwen-CONDcHqt.png",E3="/assets/zhipuai-BPNAnxo-.svg",N3={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function j3(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(N3))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const gn={width:24,height:24,objectFit:"contain"},T3=ot.memo(({className:e})=>c.jsx("img",{src:b3,alt:"Anthropic",className:e,style:gn})),A3=ot.memo(({className:e})=>c.jsx("img",{src:w3,alt:"OpenAI",className:e,style:{...gn,background:"white",borderRadius:"4px"}})),z3=ot.memo(({className:e})=>c.jsx("img",{src:k3,alt:"DeepSeek",className:e,style:gn})),I3=ot.memo(({className:e})=>c.jsx("img",{src:_3,alt:"MiniMax",className:e,style:gn})),R3=ot.memo(({className:e})=>c.jsx("img",{src:S3,alt:"Alibaba",className:e,style:gn})),P3=ot.memo(({className:e})=>c.jsx("img",{src:C3,alt:"Qwen",className:e,style:gn})),O3=ot.memo(({className:e})=>c.jsx("img",{src:E3,alt:"ZhipuAI",className:e,style:gn}));function D3({provider:e,className:t}){switch(e){case"anthropic":return c.jsx(T3,{className:t});case"openai":return c.jsx(A3,{className:t});case"deepseek":return c.jsx(z3,{className:t});case"minimax":return c.jsx(I3,{className:t});case"alibaba":return c.jsx(R3,{className:t});case"qwen":return c.jsx(P3,{className:t});case"zhipuai":return c.jsx(O3,{className:t});case"unknown":return null}}function M3(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const kc={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 _c({trend:e}){if(e===null)return null;const t=e.direction==="up",n=t?dv:cv,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 L3=v.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1,cacheTrend:i=null,isSelected:s=!1,onToggleSelect:a}){const l=td(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:me("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:me("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(D3,{provider:j3(e.model),className:"size-4 shrink-0"}),c.jsx(Ye,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&c.jsx(Ye,{variant:"outline",className:me("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(Ye,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):l==="pending"?c.jsx(Ye,{variant:"outline",className:me("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",kc[l]),children:c.jsx(to,{className:"size-3 animate-spin"})}):c.jsx(Ye,{variant:"outline",className:me("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",kc[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(_o,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums",children:M3(e.elapsedMs)})]}),u&&c.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[c.jsx(vr,{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(_c,{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(_c,{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(Du,{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(jb,{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(Wv,{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(kb,{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($v,{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(ob,{className:"size-3 text-muted-foreground/60 shrink-0"}),c.jsx("span",{className:"flex-1 min-w-0"}),n?c.jsx(mt,{className:"size-4 text-muted-foreground shrink-0"}):c.jsx(kt,{className:"size-4 text-muted-foreground shrink-0"})]})});function pa({...e}){return c.jsx(l2,{"data-slot":"dialog",...e})}function F3({...e}){return c.jsx(c2,{"data-slot":"dialog-trigger",...e})}function $3({...e}){return c.jsx(u2,{"data-slot":"dialog-portal",...e})}function B3({className:e,...t}){return c.jsx(d2,{"data-slot":"dialog-overlay",className:me("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 ma({className:e,children:t,...n}){return c.jsxs($3,{children:[c.jsx(B3,{}),c.jsxs(f2,{"data-slot":"dialog-content",className:me("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(p2,{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(Ns,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ga({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-header",className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function xa({className:e,...t}){return c.jsx(h2,{"data-slot":"dialog-title",className:me("text-lg font-semibold leading-none tracking-tight",e),...t})}function cp({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(H_,{"data-slot":"separator",decorative:n,orientation:t,className:me("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 qo({...e}){return c.jsx(G1,{"data-slot":"collapsible",...e})}function Ko({...e}){return c.jsx(cd,{"data-slot":"collapsible-trigger",...e})}function Go({...e}){return c.jsx(ud,{"data-slot":"collapsible-content",...e})}function ya({className:e,children:t,...n}){return c.jsxs(i_,{"data-slot":"scroll-area",className:me("relative",e),...n,children:[c.jsx(s_,{"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(U3,{}),c.jsx(a_,{})]})}function U3({className:e,orientation:t="vertical",...n}){return c.jsx(wf,{"data-slot":"scroll-area-scrollbar",orientation:t,className:me("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(Cf,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function Z3(e){return c.jsx(c.Fragment,{})}function V3({text:e}){const[t,n]=v.useState(!1);return c.jsxs(qo,{open:t,onOpenChange:n,children:[c.jsxs(Ko,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?c.jsx(mt,{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(Go,{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 W3=/<think>([\s\S]*?)<\/think>/gi,H3=/<think>([\s\S]*?)<\/think>/i;function up(e){const t=H3.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(W3,"").trim();return{thinking:n,remainingText:r}}function q3({text:e}){if(e.includes("<system-reminder>"))return c.jsx(V3,{text:e});const{thinking:t,remainingText:n}=up(e);return c.jsxs("div",{className:"space-y-2",children:[t!==null&&c.jsx(go,{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 go({thinking:e}){const[t,n]=v.useState(!1);return c.jsx(qo,{open:t,onOpenChange:n,children:c.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[c.jsxs(Ko,{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(hv,{className:"size-3.5 text-purple-400 shrink-0"}),c.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),c.jsxs(Ye,{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(mt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(Go,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(ya,{className:"max-h-[60vh]",children:c.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function K3({name:e,input:t}){const[n,r]=v.useState(!1);return c.jsx(qo,{open:n,onOpenChange:r,children:c.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[c.jsxs(Ko,{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($u,{className:"size-3.5 text-blue-400 shrink-0"}),c.jsx(Ye,{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(mt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(Go,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(ya,{className:"max-h-[60vh]",children:c.jsx(Ho,{data:Zn(t),defaultExpandDepth:2})})})})]})})}function G3({block:e}){switch(e.type){case"text":return c.jsx(q3,{text:e.text});case"thinking":case"think":return c.jsx(go,{thinking:e.thinking});case"tool_use":return c.jsx(K3,{name:e.name,input:e.input});default:return Z3()}}function J3({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(Ye,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&c.jsxs(Ye,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[c.jsx(Ru,{className:"size-2.5"}),e.stop_reason]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(vr,{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(G3,{block:t},n)),e.content.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function Y3(e){if(e===void 0||e==="")return{};try{return JSON.parse(e)}catch{return null}}function X3({call:e}){const[t,n]=v.useState(!1),r=e.function.name??"(unnamed tool)",o=Y3(e.function.arguments);return c.jsx(qo,{open:t,onOpenChange:n,children:c.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[c.jsxs(Ko,{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($u,{className:"size-3.5 text-blue-400 shrink-0"}),c.jsx(Ye,{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(mt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(Go,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(ya,{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(Ho,{data:Zn(o),defaultExpandDepth:2})})})})]})})}function Q3({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(Ye,{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(Ye,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[c.jsx(Ru,{className:"size-2.5"}),t.finish_reason]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(vr,{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(go,{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(go,{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(X3,{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 e5(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function t5(e,t){return e5(t)?c.jsx(Q3,{response:t}):c.jsx(J3,{response:t})}function n5(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 r5(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=td(e),n=n5(t);return e===null?c.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):c.jsxs("span",{className:me("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&c.jsx(yb,{className:"size-3"}),e]})}function Sc({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 o5({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 Gr({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(Sc,{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(Sc,{text:e})})]});const d=e!==null?r5(e,a):null;return d!==null?c.jsxs("div",{className:"space-y-2",children:[c.jsx(ir,{status:t}),t5(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(vr,{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(o5,{text:e??""})]})}const i5=ie({success:Xe(),error:K().optional(),responseStatus:ve().optional(),responseText:K().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),elapsedMs:ve().optional(),streaming:Xe().optional()});function s5({log:e,open:t,onOpenChange:n}){const[r,o]=v.useState(()=>e.rawRequestBody??"{}"),[i,s]=v.useState(null),[a,l]=v.useState(!1),[u,d]=v.useState(null);async function h(){l(!0),d(null),s(null);try{const y=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=i5.safeParse(y);if(!m.success){d("Invalid response from server"),l(!1);return}const x=m.data;s(x),x.success||d(x.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(pa,{open:t,onOpenChange:p,children:c.jsxs(ma,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[c.jsx(ga,{children:c.jsxs(xa,{className:"flex items-center gap-2",children:[c.jsx(Mu,{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(nt,{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(Gr,{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(Gr,{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(Gr,{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 a5({logId:e,truncated:t}){const[n,r]=v.useState(!1),[o,i]=v.useState({status:"idle"}),[s,a]=v.useState(new Set);v.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=v.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(to,{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(mt,{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(Ho,{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(mt,{className:"size-3"}):c.jsx(kt,{className:"size-3"}),c.jsx("span",{children:"Raw SSE Events"}),c.jsxs(Ye,{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 Cc(e,t,n){return e==="anthropic"&&t==="full"&&n}function l5(e,t){return e==="full"&&t}function c5(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function Ci({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 Ec({active:e,onClick:t}){return c.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:me("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(Ou,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const dp=v.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r,cacheTrend:o=null,isSelected:i=!1,onToggleSelect:s}){const[a,l]=v.useState(!1),[u,d]=v.useState(!1),[h,p]=v.useState(!1),[f,y]=v.useState(!1),[m,x]=v.useState(!1),[g,b]=v.useState(!1),[k,S]=v.useState(!1),j=v.useMemo(()=>Ii(e.rawRequestBody),[e.rawRequestBody]),N=v.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:AS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,I=v.useMemo(()=>d3(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),P=v.useMemo(()=>f3(e.rawRequestBody,N),[e.rawRequestBody,N]);function M(D){D.stopPropagation(),N!==null&&window.navigator.clipboard.writeText(N).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})}function U(D){D.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})}function E(D){D.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{y(!0),setTimeout(()=>y(!1),2e3)})}return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:me("border border-border rounded-lg mb-3 overflow-hidden",i&&"border-l-2 border-l-amber-400"),children:[c.jsx(L3,{log:e,parsedRequest:j,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"}),Cc(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"})]}),Cc(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(Ci,{text:e.rawRequestBody,label:"Copy Raw Request",copied:h,onCopy:U})}),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:[c5(e.apiFormat,t,r,e.rawRequestBody!==null)&&c.jsx(Ec,{active:k,onClick:D=>{D.stopPropagation(),S(!k)}}),c.jsxs(nt,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:D=>{D.stopPropagation(),x(!0)},children:[c.jsx(Mu,{className:"size-3 mr-1"}),"Replay"]}),c.jsx(Ci,{text:N,label:"Copy Request",copied:u,onCopy:M})]}),k?c.jsx(wc,{result:P,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):N!==null?c.jsx(sn,{text:N,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:l5(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&c.jsx(Ec,{active:g,onClick:D=>{D.stopPropagation(),b(!g)}})}),g?c.jsx(wc,{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],[w])=>D.localeCompare(w)).map(([D,w])=>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:w,children:w})]},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],[w])=>D.localeCompare(w)).map(([D,w])=>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:w,children:w})]},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(Ci,{text:e.responseText,label:"Copy Response",copied:f,onCopy:E})}),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(a5,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),c.jsx(Je,{value:"parsed",children:c.jsx("div",{className:"px-4 py-3",children:c.jsx(Gr,{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(s5,{log:e,open:m,onOpenChange:x})]})});function u5(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 d5=v.memo(function({group:e,viewMode:t="simple",strip:n,cacheTrends:r,selectedSet:o,onToggleSelect:i}){const[s,a]=v.useState(!1),l=u5(e.logs),u=e.logs[0]?.timestamp??new Date().toISOString(),d=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),h=SS(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(kS,{conversationId:p,startTime:u,endTime:d,totalCalls:e.logs.length,totalInputTokens:l.totalInputTokens,totalOutputTokens:l.totalOutputTokens,apiFormat:_S(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 f5({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:me("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 Nc({...e}){return c.jsx(z_,{"data-slot":"select",...e})}function jc({...e}){return c.jsx(R_,{"data-slot":"select-value",...e})}function Tc({className:e,size:t="default",children:n,...r}){return c.jsxs(I_,{"data-slot":"select-trigger","data-size":t,className:me("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(P_,{asChild:!0,children:c.jsx(mt,{className:"size-4 opacity-50"})})]})}function Ac({className:e,children:t,position:n="popper",align:r="center",...o}){return c.jsx(O_,{children:c.jsxs(D_,{"data-slot":"select-content",className:me("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(h5,{}),c.jsx(M_,{className:me("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(p5,{})]})})}function Ur({className:e,children:t,...n}){return c.jsxs(L_,{"data-slot":"select-item",className:me("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($_,{children:c.jsx(Vt,{className:"size-4"})})}),c.jsx(F_,{children:t})]})}function h5({className:e,...t}){return c.jsx(B_,{"data-slot":"select-scroll-up-button",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(yv,{className:"size-4"})})}function p5({className:e,...t}){return c.jsx(U_,{"data-slot":"select-scroll-down-button",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(mt,{className:"size-4"})})}const m5=ie({name:K(),apiKey:K(),format:ft(["anthropic","openai"]),anthropicBaseUrl:K(),openaiBaseUrl:K(),models:ze(K()),sourceTool:ft(["claude-code","opencode"]),alreadyExists:Xe()}),g5=ie({providers:ze(m5),warnings:ze(K()).optional()}),x5=ie({success:Xe().optional(),imported:ve().optional(),message:K().optional(),errors:ze(K()).optional()});function y5({open:e,onOpenChange:t,onImportComplete:n}){const[r,o]=v.useState(!1),[i,s]=v.useState(null),[a,l]=v.useState([]),[u,d]=v.useState([]),[h,p]=v.useState(new Set),[f,y]=v.useState(!1),[m,x]=v.useState(null),[g,b]=v.useState(null),k=v.useCallback(()=>{o(!0),s(null),d([]),l([]),p(new Set),x(null),b(null),fetch("/api/providers/scan").then(N=>N.ok?N.json().then(I=>{const P=g5.safeParse(I);if(!P.success){s(`Invalid response: ${P.error.message}`);return}l(P.data.providers),d(P.data.warnings??[]);const M=new Set;P.data.providers.forEach((U,E)=>{U.alreadyExists||M.add(E)}),p(M)}):N.text().then(I=>{s(`Scan failed (${N.status}): ${I}`)})).catch(N=>{s(N instanceof Error?N.message:String(N))}).finally(()=>{o(!1)})},[]);v.useEffect(()=>{e&&k()},[e,k]);const S=v.useCallback(N=>{p(I=>{const P=new Set(I);return P.has(N)?P.delete(N):P.add(N),P})},[]),j=v.useCallback(()=>{const N=a.filter((M,U)=>h.has(U));if(N.length===0)return;y(!0),b(null),x(null);const I=new Date().toISOString(),P=N.map(M=>({id:window.crypto.randomUUID(),name:M.name,apiKey:M.apiKey,format:M.format,anthropicBaseUrl:M.anthropicBaseUrl,openaiBaseUrl:M.openaiBaseUrl,models:M.models,createdAt:I,updatedAt:I}));fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providers:P})}).then(M=>M.json()).then(M=>{const U=x5.safeParse(M);if(!U.success){b(`Invalid response: ${U.error.message}`);return}const E=U.data;E.errors!==void 0&&E.errors.length>0&&E.message!==void 0?x(E.message):x(`Imported ${E.imported??N.length} provider(s)`),n()}).catch(M=>{b(M instanceof Error?M.message:String(M))}).finally(()=>{y(!1)})},[a,h,n]),C=a.some(N=>!N.alreadyExists);return c.jsx(pa,{open:e,onOpenChange:t,children:c.jsxs(ma,{className:"max-w-xl max-h-[80vh] overflow-hidden flex flex-col",children:[c.jsxs(ga,{children:[c.jsx(xa,{children:"Import from External Tools"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Detect provider configurations from Claude Code and OpenCode."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto space-y-3",children:[r&&c.jsxs("div",{className:"flex items-center justify-center py-8 gap-2 text-muted-foreground",children:[c.jsx(to,{className:"size-4 animate-spin"}),c.jsx("span",{className:"text-sm",children:"Scanning for external providers..."})]}),i!==null&&c.jsxs("div",{className:"flex items-center gap-2 text-destructive text-sm py-4",children:[c.jsx(pr,{className:"size-4"}),i]}),!r&&i===null&&a.length===0&&c.jsxs("p",{className:"text-sm text-muted-foreground py-8 text-center",children:["No external provider configurations found.",c.jsx("br",{}),c.jsx("span",{className:"text-xs",children:"Supported tools: Claude Code (~/.claude/settings.json), OpenCode (~/.config/opencode/opencode.json)"})]}),!r&&a.map((N,I)=>c.jsxs("label",{className:"flex items-start gap-3 p-3 border rounded-md cursor-pointer hover:bg-muted/50 has-[:disabled]:opacity-50 has-[:disabled]:cursor-not-allowed",children:[c.jsx("input",{type:"checkbox",checked:h.has(I),disabled:N.alreadyExists||f,onChange:()=>S(I),className:"mt-0.5 size-4"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium truncate",children:N.name}),c.jsx(Ye,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:N.format}),c.jsx(Ye,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:N.sourceTool}),N.alreadyExists&&c.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Already added"})]}),c.jsxs("div",{className:"text-xs text-muted-foreground mt-1 truncate",children:[N.models.slice(0,4).join(", "),N.models.length>4?` +${N.models.length-4} more`:""]}),c.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:N.format==="anthropic"?N.anthropicBaseUrl:N.openaiBaseUrl}),c.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 font-mono",children:N.apiKey.length>8?`${N.apiKey.slice(0,4)}••••${N.apiKey.slice(-4)}`:"••••"})]})]},`${N.sourceTool}-${N.name}`)),u.length>0&&c.jsx("div",{className:"text-xs text-muted-foreground space-y-1 border-t pt-2",children:u.map((N,I)=>c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(pr,{className:"size-3"}),N]},I))}),m!==null&&c.jsx("div",{className:"text-sm text-green-500 border-t pt-2",children:m}),g!==null&&c.jsx("div",{className:"text-sm text-destructive border-t pt-2",children:g})]}),c.jsxs("div",{className:"flex items-center justify-between pt-3 border-t",children:[c.jsxs(nt,{variant:"outline",size:"sm",onClick:k,disabled:r,children:[c.jsx(to,{className:`size-3 mr-1 ${r?"animate-spin":""}`}),"Rescan"]}),c.jsxs(nt,{size:"sm",onClick:j,disabled:!C||h.size===0||f,children:[c.jsx(ks,{className:"size-3 mr-1"}),f?"Importing...":`Import Selected (${h.size})`]})]})]})})}function fp(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}const v5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function b5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function w5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function k5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return c.jsx(_o,{...t});case"network_unreachable":return c.jsx(Sb,{...t});case"connection_refused":return c.jsx(Eb,{...t});case"auth_failed":return c.jsx(Xv,{...t});case"rate_limited":return c.jsx(Uv,{...t});case"server_error":return c.jsx(db,{...t});case"invalid_response":return c.jsx(Nv,{...t});case"unknown":return c.jsx(pr,{...t});default:return c.jsx(pr,{...t})}}function Zr({result:e}){const[t,n]=v.useState(!1);if(!b5(e))return w5(e)?c.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[c.jsx(Cs,{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(Lu,{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(Cv,{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:[k5(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(_s,{className:"size-3"}):c.jsx(Ss,{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 _5(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 S5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,isHighlighted:o,onEdit:i,onDelete:s,onTest:a}){const[l,u]=v.useState(!1),[d,h]=v.useState(!1),[p,f]=v.useState(!1),y=v.useRef(null),m=v.useRef(void 0);t?.testedAt!==void 0&&t.testedAt!==m.current&&(m.current=t.testedAt,y.current=null);const x=v.useCallback(()=>{f(k=>{const S=!k;return S&&y.current===null&&t?.models!==void 0&&(y.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 b=e.apiDocsUrl??Object.entries(v5).find(([k])=>e.name.toLowerCase().includes(k))?.[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:"个人"})]}),b!==void 0&&c.jsxs("a",{href:b,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(Dv,{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(k=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:k},k))}),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(k=>!k),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":l?"Hide API key":"Show API key",children:l?c.jsx(_s,{className:"size-4"}):c.jsx(Ss,{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(Zr,{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(Zr,{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(_o,{className:"size-3"}),c.jsxs("span",{children:["Tested ",_5(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:x,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(([k,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:k}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&c.jsx("td",{className:"py-1 px-2",children:c.jsx(Zr,{result:S.anthropic.nonStreaming})}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&c.jsx("td",{className:"py-1 px-2",children:c.jsx(Zr,{result:S.openai.nonStreaming})})]},k))})]})})]}),c.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[a!==void 0&&c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>a(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[c.jsx(Lu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>i(e),className:"text-xs h-7 gap-1",disabled:n??!1,children:[c.jsx(Es,{className:"size-3"}),"Edit"]}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",disabled:n??!1,children:[c.jsx(gb,{className:"size-3"}),"Delete"]})]})]})}const C5={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"}},zc=["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"],Ic=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function E5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=v.useState(e?.name??""),[i,s]=v.useState(e?.apiKey??""),[a,l]=v.useState(!1),[u,d]=v.useState(!1),h=e?.models,[p,f]=v.useState(h!==void 0&&h.length>0?h:[""]),[y,m]=v.useState("anthropic"),[x,g]=v.useState(e?.anthropicBaseUrl??""),[b,k]=v.useState(e?.openaiBaseUrl??""),[S,j]=v.useState(e?.apiDocsUrl??""),[C,N]=v.useState(e?.source),[I,P]=v.useState({}),[M,U]=v.useState(!1),[E,D]=v.useState(null),w=v.useRef([]);v.useEffect(()=>{if(E===null)return;const G=E;function le(Q){if(!(Q.target instanceof Node))return;const ce=w.current[G];ce!=null&&!ce.contains(Q.target)&&D(null)}return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[E]);const[O,J]=v.useState(!1),[W,q]=v.useState(!1),Y=r.toLowerCase().includes("minimax"),T=r.toLowerCase().includes("alibaba");function F(){navigator.clipboard.writeText(i).catch(()=>{}),d(!0),setTimeout(()=>d(!1),2e3)}v.useEffect(()=>{e&&(o(e.name),s(e.apiKey),f((e.models?.length??0)>0?e.models:[""]),g(e.anthropicBaseUrl??""),k(e.openaiBaseUrl??""),j(e.apiDocsUrl??""),N(e.source),J(!1),q(!1))},[e]),v.useEffect(()=>{const G=r.toLowerCase();for(const[le,Q]of Object.entries(C5))if(G.includes(le)){Q.format==="anthropic"&&!O?g(Q.baseUrl):Q.format==="openai"&&!W&&k(Q.baseUrl),Q.apiDocsUrl!==void 0&&!S&&j(Q.apiDocsUrl),le==="minimax"&&p.length===1&&p[0]===""&&f([zc[0]??""]),le==="alibaba"&&p.length===1&&p[0]===""&&f([Ic[0]??""]);break}},[r]);function $(){const G={};return r.trim()||(G.name="Name is required"),i.trim()||(G.apiKey="API key is required"),(p.length===0||p.every(le=>!le.trim()))&&(G.models="At least one model is required"),x.trim()&&!A(x.trim())&&(G.anthropicBaseUrl="Invalid URL format"),b.trim()&&!A(b.trim())&&(G.openaiBaseUrl="Invalid URL format"),!x.trim()&&!b.trim()&&(G.format="At least one format URL (Anthropic or OpenAI) is required"),P(G),Object.keys(G).length===0}function A(G){try{return new URL(G),!0}catch{return!1}}function te(G){if(G.preventDefault(),!!$()){U(!0);try{t({name:r.trim(),apiKey:i.trim(),models:p.map(le=>le.trim()).filter(le=>le!==""),anthropicBaseUrl:x.trim()||void 0,openaiBaseUrl:b.trim()||void 0,apiDocsUrl:S.trim()||void 0,source:C})}finally{U(!1)}}}return c.jsxs("form",{onSubmit:te,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:G=>o(G.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:G=>N(G.target.value==="company"||G.target.value==="personal"?G.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:G=>s(G.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(G=>!G),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(_s,{className:"size-4"}):c.jsx(Ss,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:F,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((G,le)=>c.jsxs("div",{ref:Q=>{w.current[le]=Q},className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{type:"text",value:G,onChange:Q=>{f(ce=>{const de=[...ce];return de[le]=Q.target.value,de})},placeholder:Y||T?"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"}),(Y||T)&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>D(E===le?null:le),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(mt,{className:"size-4"})}),E===le&&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:(Y?zc:Ic).map(Q=>c.jsx("button",{type:"button",onClick:()=>{f(ce=>{const de=[...ce];return de[le]=Q,de}),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,de)=>de!==le)),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"})]})})]},le)),c.jsx("button",{type:"button",onClick:()=>f(G=>[...G,""]),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 ${y==="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 ${y==="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})]}),y==="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:x,onChange:G=>{J(!0),g(G.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."})]}),y==="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:b,onChange:G=>{q(!0),k(G.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:G=>j(G.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(nt,{type:"button",variant:"outline",onClick:n,disabled:M,children:"Cancel"}),c.jsx(nt,{type:"submit",disabled:M,children:M?"Saving...":e?"Update Provider":"Add Provider"})]})]})}const as=ie({id:K(),name:K(),apiKey:K(),model:K().optional(),models:ze(K()).min(1),format:ft(["anthropic","openai"]).optional(),baseUrl:K().optional(),anthropicBaseUrl:K().optional(),openaiBaseUrl:K().optional(),authHeader:ft(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:K().optional(),source:ft(["company","personal"]).optional(),createdAt:K(),updatedAt:K()}),N5=ft(["timeout","network_unreachable","connection_refused","auth_failed","rate_limited","server_error","invalid_response","unknown"]),j5=ie({message:K(),type:N5,details:K().optional(),hint:K().optional()}),T5=ie({type:ft(["text","thinking"]),text:K().optional(),thinking:K().optional()}),A5=ie({success:Xe(),error:j5.optional(),model:K().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),cacheCreationInputTokens:ve().optional(),cacheReadInputTokens:ve().optional(),latencyMs:ve().optional(),content:ze(T5).optional(),rawResponse:K().optional(),streaming:Xe().optional(),streamingChunks:ie({chunks:ze(Nu),truncated:Xe().default(!1)}).optional(),requestHeaders:$t(K(),K()).optional()}),Rc=Zt([A5,ie({notConfigured:Se(!0)}),ie({testing:Se(!0)})]),xo=ie({nonStreaming:Rc,streaming:Rc}),z5=ie({anthropic:xo,openai:xo}),I5=ie({anthropic:xo,openai:xo,models:$t(K(),z5).optional(),testedAt:K().optional()});function R5(){return{anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}}}function Pc(e,t){const n=()=>({nonStreaming:{success:!1,error:{message:e,type:t}},streaming:{notConfigured:!0}});return{anthropic:n(),openai:n()}}const P5=ie({providerConfig:K()}),O5=ie({success:Xe().optional(),imported:ve().optional(),message:K().optional(),errors:ze(K()).optional()}),D5=30,Ei="Network error: could not reach the server. Is the proxy running?";function Oc(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 M5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[u,d]=v.useState(!1),[h,p]=v.useState(),[f,y]=v.useState(null),[m,x]=v.useState({}),[g,b]=v.useState(new Set),[k,S]=v.useState({}),[j,C]=v.useState(null),[N,I]=v.useState(!1),[P,M]=v.useState(null),[U,E]=v.useState(!1),[D,w]=v.useState("all"),O=v.useRef(null),J=v.useRef(null),W=e??[],q=v.useMemo(()=>{const Z=D==="all"?W:W.filter(B=>B.source===D);return D==="all"?[...Z].sort((B,R)=>{const z={personal:0,company:1};return(z[B.source??""]??2)-(z[R.source??""]??2)}):Z},[W,D]),Y=n??m,T=r??g,F=o??k,$=l?(Z,B)=>l(Z,B):(Z,B)=>{S(B===void 0?R=>{const z={...R};return delete z[Z],z}:R=>({...R,[Z]:B}))};v.useEffect(()=>{(async()=>{try{const Z=await fetch("/api/config/paths");if(Z.ok){const B=await Sn(Z,P5);C(B.providerConfig)}}catch{}})()},[]);const A=v.useCallback(Z=>{J.current!==null&&clearTimeout(J.current),M(Z),O.current?.scrollTo({top:O.current.scrollHeight,behavior:"smooth"}),J.current=setTimeout(()=>{M(null),J.current=null},2e3)},[]);v.useEffect(()=>()=>{J.current!==null&&clearTimeout(J.current)},[]);const te=v.useCallback(()=>{i?.().catch(()=>{})},[i]),G=v.useCallback((Z,B)=>{s?s(Z,B):x(R=>({...R,[Z]:B}))},[s]),le=v.useCallback((Z,B)=>{if(a){a(Z,B);return}b(R=>{const z=new Set(R);return B?z.add(Z):z.delete(Z),z})},[a]),Q=v.useCallback(async Z=>{G(Z,R5()),le(Z,!0);const B=new AbortController;let R=D5;$(Z,R);const z=setInterval(()=>{R--,$(Z,R),R<=0&&(clearInterval(z),B.abort())},1e3);try{const L=await fetch(`/api/providers/${Z}/test`,{method:"POST",signal:B.signal});if(L.ok){const ee=await Sn(L,I5);G(Z,ee)}else G(Z,Pc(`HTTP ${L.status}: ${L.statusText}`,"server_error"))}catch(L){L instanceof Error&&L.name==="AbortError"&&G(Z,Pc("Request timed out","timeout"))}finally{clearInterval(z),$(Z,void 0),le(Z,!1)}},[$,G,le]);function ce(Z){(async()=>{try{const B=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Oc(Z))});if(!B.ok){y(await Vr(B,"Failed to add provider"));return}const R=await Sn(B,as);d(!1),A(R.id),te(),await Q(R.id)}catch{y(Ei)}})()}function de(Z){h&&(async()=>{try{const B=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Oc(Z))});if(!B.ok){y(await Vr(B,"Failed to update provider"));return}const R=await Sn(B,as);p(void 0),A(R.id),te(),((Z.apiKey??"")!==(h.apiKey??"")||JSON.stringify(Z.models)!==JSON.stringify(h.models)||(Z.anthropicBaseUrl??"")!==(h.anthropicBaseUrl??"")||(Z.openaiBaseUrl??"")!==(h.openaiBaseUrl??""))&&await Q(R.id)}catch{y(Ei)}})()}function ge(Z){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let B;try{B=await fetch(`/api/providers/${Z}`,{method:"DELETE"})}catch{y(Ei);return}if(!B.ok){y(await Vr(B,"Failed to delete provider"));return}te()})()}const xe=v.useRef(null);function Ne(Z){const B="/api/providers/export";(async()=>{try{const R=await fetch(B);if(!R.ok){y("Failed to export providers");return}const z=await R.blob(),L=URL.createObjectURL(z),ee=document.createElement("a");ee.href=L,ee.download=R.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(L)}catch{y("Failed to export providers")}})()}function Oe(){xe.current?.click()}function _(Z){const B=Z.target.files?.[0];B&&(async()=>{try{const R=await B.text(),z=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),L=await Sn(z,O5);z.ok&&L.imported!==void 0&&L.imported>0?(te(),y(null)):L.errors&&L.errors.length>0?y(L.errors.join("; ")):y(L.message??"Import failed")}catch{y("Failed to import providers")}Z.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(E5,{provider:h,onSubmit:h?de:ce,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(nt,{variant:"outline",size:"sm",onClick:()=>Ne(),className:"gap-1 hover:bg-muted",children:[c.jsx(ks,{className:"size-3"}),"Export"]}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:Oe,className:"gap-1 hover:bg-muted",children:[c.jsx(bb,{className:"size-3"}),"Import"]}),c.jsx("input",{type:"file",ref:xe,accept:".json",onChange:_,style:{display:"none"}}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>E(!0),className:"gap-1",children:[c.jsx(cb,{className:"size-3"}),"Scan"]}),c.jsxs(nt,{onClick:()=>d(!0),size:"sm",className:"gap-1",children:[c.jsx(no,{className:"size-4"}),"Add Provider"]})]})]}),j!==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:j,children:j}),c.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(j).then(()=>{I(!0),setTimeout(()=>I(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:N?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(pr,{className:"size-4 shrink-0"}),f]}),W.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(nt,{onClick:()=>d(!0),variant:"outline",size:"sm",children:[c.jsx(no,{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(Z=>c.jsx("button",{type:"button",onClick:()=>w(Z),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${D===Z?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:Z==="all"?"All":Z==="personal"?"Personal":"Company"},Z))}),c.jsx("div",{ref:O,className:"space-y-3",children:q.map(Z=>c.jsx(S5,{provider:Z,testResults:Y[Z.id],isTesting:T.has(Z.id),testingTimeLeft:F[Z.id],isHighlighted:Z.id===P,onEdit:B=>p(B),onDelete:ge,onTest:B=>{Q(B)}},Z.id))})]}),c.jsx(y5,{open:U,onOpenChange:E,onImportComplete:()=>{i!==void 0&&i()}})]})}async function L5(e){return ws(e,as.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function F5(){const e=Bc("/api/providers",L5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function $5(){const[e,t]=v.useState(!1),[n,r]=v.useState("providers"),{providers:o,isLoading:i,mutate:s}=F5(),[a,l]=v.useState({}),[u,d]=v.useState(new Set),[h,p]=v.useState({}),f=v.useCallback((x,g)=>{l(b=>({...b,[x]:g}))},[]),y=v.useCallback((x,g)=>{d(b=>{const k=new Set(b);return g?k.add(x):k.delete(x),k})},[]),m=v.useCallback((x,g)=>{p(b=>{if(g===void 0){const k={...b};return delete k[x],k}return{...b,[x]:g}})},[]);return c.jsxs(pa,{open:e,onOpenChange:t,children:[c.jsx(F3,{asChild:!0,children:c.jsxs(nt,{variant:"ghost",size:"icon",className:"size-8",children:[c.jsx(hb,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Settings"})]})}),c.jsxs(ma,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[c.jsx(ga,{children:c.jsx(xa,{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(M5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:u,externalTestingTimeLeft:h,onProvidersMutate:()=>s(),onTestResultsChange:f,onTestingProvidersChange:y,onTestingTimeLeftChange:m})}),c.jsx(Je,{value:"proxy",children:c.jsx(B5,{})})]})]})]})]})}function B5(){const{strip:e,isLoading:t,setStrip:n}=Tu(),[r,o]=v.useState(null),[i,s]=v.useState(!1),a=v.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 U5(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:Dc(i.cacheCreationInputTokens,s.cacheCreationInputTokens),read:Dc(i.cacheReadInputTokens,s.cacheReadInputTokens)})}}return t}function Dc(e,t){return t===null||e===null?null:t>e?{direction:"up",delta:t-e}:t<e?{direction:"down",delta:e-t}:null}const Z5="";function sr(e){if(e.length===0)return Z5;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 V5(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mc(e){if(typeof e=="string")try{return yo(JSON.parse(e))}catch{return{kind:"primitive",value:e}}return yo(e)}function yo(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=>yo(t))};if(V5(e)){const t={};for(const n of Object.keys(e).sort())t[n]=yo(e[n]);return{kind:"object",value:t}}return{kind:"primitive",value:null}}function W5(e,t){const n=[];return ls([],e,t,n),n}function ls(e,t,n,r){const o=sr(e);if(cs(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;ls([...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||ls([...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 cs(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||!cs(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||!cs(i,s))return!1}return!0}return!1}function wt(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 Jr(e,t=2){return JSON.stringify(us(e),null,t)}function us(e){switch(e.kind){case"primitive":return e.value;case"array":return e.value.map(us);case"object":{const t={};for(const[n,r]of Object.entries(e.value))t[n]=us(r);return t}}}function Lc(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 Fc(e){return e.kind==="equal"&&(e.value.kind==="object"||e.value.kind==="array")}function H5(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r!==void 0&&Fc(r)){const o=Lc(r.path);let i=n+1;for(;i<e.length;){const s=e[i];if(s===void 0||!Fc(s)||Lc(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:no,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:Cs,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:Es,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:Pv,accent:"text-muted-foreground/70",bg:"bg-muted/20 hover:bg-muted/30",border:"border-l-muted-foreground/20",label:"EQUAL"}};function q5({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:me("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:me("size-3 transition-transform shrink-0",t&&"rotate-90")}),c.jsx(u.icon,{className:me("size-3 shrink-0",u.accent)}),c.jsx("span",{className:"font-mono truncate flex-1",title:`${i} … ${s}`,children:a}),c.jsx("span",{className:me("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:Jr(d.value),defaultExpandDepth:2})]},d.path))})]})}function K5({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:wt(e.left,400),tone:"text-rose-700 dark:text-rose-300 line-through"},{text:wt(e.right,400),tone:"text-emerald-700 dark:text-emerald-300"}]:e.kind==="removed"?[{text:wt(e.value,400),tone:"text-rose-700 dark:text-rose-300 line-through"}]:e.kind==="added"?[{text:wt(e.value,400),tone:"text-emerald-700 dark:text-emerald-300"}]:[{text:wt(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:me("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:me("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:me("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:me("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:me("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:me("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:me("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(G5,{op:e}):null})]})}function G5({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:Jr(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:Jr(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:Jr(e.right),defaultExpandDepth:2})]})]})}function J5({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:me("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(Cs,{className:"size-3"}),e.removed," removed"]}),c.jsxs("button",{type:"button",onClick:()=>t("added"),disabled:e.added===0,className:me("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(no,{className:"size-3"}),e.added," added"]}),c.jsxs("button",{type:"button",onClick:()=>t("changed"),disabled:e.changed===0,className:me("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(Es,{className:"size-3"}),e.changed," changed"]})]})}function Y5({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:me("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(Fu,{className:"size-3"}),"Unified"]}),c.jsxs("button",{type:"button",onClick:()=>t("split"),"aria-pressed":e==="split",className:me("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(Pu,{className:"size-3"}),"Split"]})]})}function $c({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(Ye,{variant:"outline",className:me("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 X5({left:e,right:t,onClose:n}){const r=v.useMemo(()=>{const C=Mc(Ii(e.rawRequestBody)??e.rawRequestBody),N=Mc(Ii(t.rawRequestBody)??t.rawRequestBody);return W5(C,N)},[e.rawRequestBody,t.rawRequestBody]),o=v.useMemo(()=>H5(r),[r]),i=v.useMemo(()=>{let C=0,N=0,I=0;for(const P of o)if(P.kind==="single")switch(P.op.kind){case"added":C++;break;case"removed":N++;break;case"changed":I++;break}return{added:C,removed:N,changed:I}},[o]),[s,a]=v.useState(new Set),l=C=>{a(N=>{const I=new Set(N);return I.has(C)?I.delete(C):I.add(C),I})},[u,d]=v.useState(new Set),h=C=>{d(N=>{const I=new Set(N);return I.has(C)?I.delete(C):I.add(C),I})};v.useEffect(()=>{d(new Set)},[e.id,t.id]);const[p,f]=v.useState("unified"),y=v.useRef(null),[m,x]=v.useState(null),g=v.useRef(null),b=C=>{window.navigator.clipboard.writeText(C).then(()=>{x(C),g.current!==null&&clearTimeout(g.current),g.current=setTimeout(()=>x(null),1500)})};v.useEffect(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);const k=C=>{const N=o.findIndex(M=>M.kind==="single"&&M.op.kind===C);if(N===-1)return;const I=y.current;if(I===null)return;const P=I.querySelector(`[data-diff-idx="${N}"]`);P!==null&&P.scrollIntoView({behavior:"smooth",block:"center"})};v.useEffect(()=>{const C=I=>{I.key==="Escape"&&n()};document.addEventListener("keydown",C);const N=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",C),document.body.style.overflow=N}},[n]);const S=Bn(e)===Bn(t),j=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:me("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($c,{log:e,side:"left"}),c.jsx($c,{log:t,side:"right"})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(Y5,{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(Ns,{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."}),j?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(J5,{counts:i,onJumpTo:k}),c.jsx("div",{ref:y,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,N)=>{if(C.kind==="equal-run")return c.jsx(q5,{ops:C.ops,expanded:s.has(N),onToggle:()=>l(N)},`r${N}`);const I=C.op;return c.jsx(K5,{op:I,idx:N,copiedPath:m,onCopyPath:b,expanded:u.has(N),onToggle:()=>h(N)},`o${N}`)})}):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:wt(i.value,200)}),c.jsx("span",{className:"font-mono text-xs break-all opacity-60",children:wt(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:["+ ",wt(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:["− ",wt(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:wt(i.left,400)}),c.jsx("div",{className:"font-mono text-emerald-300/90 break-all",children:wt(i.right,400)})]})]},o)})]})}function eT(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function tT(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 nT({command:e}){const[t,n]=v.useState(!1),r=v.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 rT({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}=tT(e),[f,y]=v.useState(!0),[m,x]=v.useState(!1),[g,b]=v.useState([]),[k,S]=v.useState(!1),[j,C]=v.useState(null),N=v.useCallback(async()=>{x(!0);try{await Ob(e)}finally{x(!1)}},[e]),I=v.useRef(null),P=v.useCallback(T=>{b(F=>{if(F.includes(T))return F.filter(A=>A!==T);if(F.length<2)return[...F,T];const $=F[1];return $===void 0?F:[$,T]})},[]);v.useEffect(()=>{b([]),S(!1)},[r,o]);const M=v.useMemo(()=>new Set(g),[g]),U=v.useCallback(()=>{if(g.length!==2)return;const[T,F]=g;if(T===void 0||F===void 0)return;const $=e.find(te=>te.id===T),A=e.find(te=>te.id===F);$===void 0||A===void 0||(C([$,A]),S(!0))},[g,e]),E=v.useCallback(()=>{S(!1)},[]),D=v.useCallback(()=>{b([])},[]),w=v.useMemo(()=>{if(g.length!==2)return null;const[T,F]=g;if(T===void 0||F===void 0)return null;const $=e.find(le=>le.id===T),A=e.find(le=>le.id===F);if($===void 0||A===void 0)return null;const te=Bn($)===Bn(A);let G="";if($.timestamp!==null&&A.timestamp!==null){const le=Date.parse($.timestamp),Q=Date.parse(A.timestamp);if(!Number.isNaN(le)&&!Number.isNaN(Q)){const ce=Math.abs(Q-le);G=O(ce)}}return{logA:$,logB:A,sameSession:te,elapsed:G}},[g,e]);function O(T){if(T<1e3)return`${T}ms`;const F=Math.floor(T/1e3);if(F<60)return`${F}s`;const $=Math.floor(F/60);return $<60?`${$}m`:`${Math.floor($/60)}h${$%60}m`}const J=v.useMemo(()=>CS(e),[e]),W=v.useMemo(()=>U5(J),[J]),q=e.length>0&&f&&!(J.length===1&&J[0]?.logs.length===e.length),Y=zu({count:q?J.length:e.length,getScrollElement:()=>I.current,estimateSize:()=>150,measureElement:typeof window<"u"?T=>T.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(f5,{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",Mb.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($5,{}),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:()=>{N()},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(ks,{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(Nc,{value:r,onValueChange:i,children:[c.jsx(Tc,{className:"flex-1 max-w-[400px] text-xs",children:c.jsx(jc,{placeholder:"All sessions"})}),c.jsxs(Ac,{children:[c.jsx(Ur,{value:"__all__",children:"All sessions"}),t.map(T=>c.jsx(Ur,{value:T,children:eT(T)},T))]})]}),c.jsxs(Nc,{value:o,onValueChange:s,children:[c.jsx(Tc,{className:"text-xs",children:c.jsx(jc,{placeholder:"All models"})}),c.jsxs(Ac,{children:[c.jsx(Ur,{value:"__all__",children:"All models"}),n.map(T=>c.jsx(Ur,{value:T,children:T},T))]})]}),c.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[c.jsx("button",{type:"button",onClick:()=>y(!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(qv,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:()=>y(!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(Gv,{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(nT,{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:`${Y.getTotalSize()}px`,width:"100%",position:"relative"},children:Y.getVirtualItems().map(T=>{if(q){const F=J[T.index];return F===void 0?null:c.jsx("div",{"data-index":T.index,ref:Y.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:c.jsx(d5,{group:F,viewMode:l,strip:d,cacheTrends:W,selectedSet:M,onToggleSelect:P})},F.id)}else{const F=e[T.index];return F===void 0?null:c.jsx("div",{"data-index":T.index,ref:Y.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:c.jsx(dp,{log:F,viewMode:l,strip:d,cacheTrend:W.get(F.id)??null,isSelected:M.has(F.id),onToggleSelect:P})},F.id)}})})})}),w!==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(Ou,{className:"size-4 text-amber-400 shrink-0"}),c.jsxs("span",{className:"text-muted-foreground font-mono",children:["#",w.logA.id," ↔ #",w.logB.id," · ",w.sameSession?"same session":"different sessions",w.elapsed!==""&&` · ${w.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(Ns,{className:"size-3"}),"Clear"]}),c.jsx("button",{type:"button",onClick:U,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"})]}),k&&j!==null&&c.jsx(X5,{left:j[0],right:j[1],onClose:E})]})}ie({logs:ze(zi),total:ve(),offset:ve(),limit:ve()});const oT=Zt([ie({type:Se("init"),logs:ze(zi)}),ie({type:Se("update"),log:zi})]);function iT(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function sT(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function aT(){const[e,t]=v.useState([]),[n,r]=v.useState([]),[o,i]=v.useState([]),[s,a]=v.useState("__all__"),[l,u]=v.useState("__all__"),[d,h]=v.useState("simple"),[p,f]=v.useState(null),y=v.useRef(null),m=v.useRef(null),x=v.useCallback(async()=>{try{const[S,j]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&j.ok){const C=await S.json(),N=await j.json(),I=ze(K()).safeParse(C),P=ze(K()).safeParse(N);I.success&&r(I.data),P.success&&i(P.data)}}catch{}},[]),g=v.useCallback(()=>{y.current&&y.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const j=new EventSource(`/api/logs/stream?${S}`);y.current=j,j.onmessage=C=>{try{const N=String(C.data),I=JSON.parse(N),P=oT.safeParse(I);if(!P.success){f("Failed to parse SSE data");return}const M=P.data;M.type==="init"?(t(M.logs),r(iT(M.logs)),i(sT(M.logs)),f(null)):M.type==="update"&&(t(U=>{const E=s==="__all__"||M.log.sessionId===s,D=l==="__all__"||M.log.model===l;return!E||!D?U:U.findIndex(O=>O.id===M.log.id)>=0?U.map(O=>O.id===M.log.id?M.log:O):[...U,M.log]}),r(U=>{const E=M.log.sessionId;return E!=null&&E!==""?U.includes(E)?U:[...U,E]:U}),i(U=>{const E=M.log.model;return E!=null&&E!==""?U.includes(E)?U:[...U,E]:U}))}catch{f("Failed to parse SSE data")}},j.onerror=()=>{f("SSE connection lost, reconnecting..."),j.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},x()},[s,l,x]);v.useEffect(()=>(g(),()=>{y.current&&(y.current.close(),y.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const b=v.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:k}=Tu();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(rT,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:u,onClearAll:b,viewMode:d,onViewModeChange:h,strip:k})]})}const uT=aT;export{uT as component};
|
|
105
|
+
`);if(n===r)return{lines:[],isEmpty:!0};const o=ap(n,r);return{lines:ss(o),isEmpty:!1}}function bc(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function f3(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=bc(n),i=bc(r);if(o!==null&&i!==null){const a=u3(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:ss(a),isEmpty:!1}}const s=ap(n,r);return{lines:ss(s),isEmpty:!1}}const h3=22,Si=1e4;function p3(e){return e==="added"?"+":e==="removed"?"-":" "}function m3(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 wc({result:e,emptyLabel:t}){const[n,r]=v.useState("unified"),o=v.useRef(null),i=zu({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>h3,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>Si,l=a?e.lines.slice(0,Si):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 ${Si.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:me("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(Fu,{className:"size-3"}),"Unified"]}),c.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:me("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(Pu,{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(g3,{virtualizer:i,lines:l}):c.jsx(v3,{lines:l})})]})}function g3({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:me("flex items-start gap-3 px-2",m3(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:me("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:p3(r.kind)}),c.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function x3(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 y3(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 v3({lines:e}){const t=x3(e);return c.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>c.jsxs("div",{className:me("grid grid-cols-2 font-mono text-xs",y3(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:me("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:me("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 b3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='0%206.603%201192.672%201193.397'%20width='2500'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m233.96%20800.215%20234.684-131.678%203.947-11.436-3.947-6.363h-11.436l-39.221-2.416-134.094-3.624-116.296-4.832-112.67-6.04-28.35-6.04-26.577-35.035%202.738-17.477%2023.84-16.027%2034.147%202.98%2075.463%205.155%20113.235%207.812%2082.147%204.832%20121.692%2012.644h19.329l2.738-7.812-6.604-4.832-5.154-4.832-117.182-79.41-126.845-83.92-66.443-48.321-35.92-24.484-18.12-22.953-7.813-50.093%2032.618-35.92%2043.812%202.98%2011.195%202.98%2044.375%2034.147%2094.792%2073.37%20123.786%2091.167%2018.12%2015.06%207.249-5.154.886-3.624-8.135-13.61-67.329-121.692-71.838-123.785-31.974-51.302-8.456-30.765c-2.98-12.645-5.154-23.275-5.154-36.242l37.127-50.416%2020.537-6.604%2049.53%206.604%2020.86%2018.121%2030.765%2070.39%2049.852%20110.818%2077.315%20150.684%2022.631%2044.698%2012.08%2041.396%204.51%2012.645h7.813v-7.248l6.362-84.886%2011.759-104.215%2011.436-134.094%203.946-37.772%2018.685-45.262%2037.127-24.482%2028.994%2013.852%2023.839%2034.148-3.303%2022.067-14.174%2092.134-27.785%20144.323-18.121%2096.644h10.55l12.08-12.08%2048.887-64.913%2082.147-102.685%2036.242-40.752%2042.282-45.02%2027.14-21.423h51.303l37.772%2056.135-16.913%2057.986-52.832%2067.007-43.812%2056.779-62.82%2084.563-39.22%2067.651%203.623%205.396%209.343-.886%20141.906-30.201%2076.671-13.852%2091.49-15.705%2041.396%2019.329%204.51%2019.65-16.269%2040.189-97.852%2024.16-114.764%2022.954-170.9%2040.43-2.093%201.53%202.416%202.98%2076.993%207.248%2032.94%201.771h80.617l150.12%2011.195%2039.222%2025.933%2023.517%2031.732-3.946%2024.16-60.403%2030.766-81.503-19.33-190.228-45.26-65.235-16.27h-9.02v5.397l54.362%2053.154%2099.624%2089.96%20124.752%20115.973%206.362%2028.671-16.027%2022.63-16.912-2.415-109.611-82.47-42.282-37.127-95.758-80.618h-6.363v8.456l22.067%2032.296%20116.537%20175.167%206.04%2053.719-8.456%2017.476-30.201%2010.55-33.181-6.04-68.215-95.758-70.39-107.84-56.778-96.644-6.926%203.947-33.503%20360.886-15.705%2018.443-36.243%2013.852-30.201-22.953-16.027-37.127%2016.027-73.37%2019.329-95.758%2015.704-76.107%2014.175-94.55%208.456-31.41-.563-2.094-6.927.886-71.275%2097.852-108.402%20146.497-85.772%2091.812-20.537%208.134-35.597-18.443%203.301-32.94%2019.893-29.315%20118.712-151.007%2071.597-93.583%2046.228-54.04-.322-7.813h-2.738l-315.302%20204.725-56.135%207.248-24.16-22.63%202.98-37.128%2011.435-12.08%2094.792-65.236-.322.323z'%20fill='%23d97757'/%3e%3c/svg%3e",w3="data:image/svg+xml,%3csvg%20height='2500'%20viewBox='-1%20-.1%20949.1%20959.8'%20width='2474'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m925.8%20456.3c10.4%2023.2%2017%2048%2019.7%2073.3%202.6%2025.3%201.3%2050.9-4.1%2075.8-5.3%2024.9-14.5%2048.8-27.3%2070.8-8.4%2014.7-18.3%2028.5-29.7%2041.2-11.3%2012.6-23.9%2024-37.6%2034-13.8%2010-28.5%2018.4-44.1%2025.3-15.5%206.8-31.7%2012-48.3%2015.4-7.8%2024.2-19.4%2047.1-34.4%2067.7-14.9%2020.6-33%2038.7-53.6%2053.6-20.6%2015-43.4%2026.6-67.6%2034.4-24.2%207.9-49.5%2011.8-75%2011.8-16.9.1-33.9-1.7-50.5-5.1-16.5-3.5-32.7-8.8-48.2-15.7s-30.2-15.5-43.9-25.5c-13.6-10-26.2-21.5-37.4-34.2-25%205.4-50.6%206.7-75.9%204.1-25.3-2.7-50.1-9.3-73.4-19.7-23.2-10.3-44.7-24.3-63.6-41.4s-35-37.1-47.7-59.1c-8.5-14.7-15.5-30.2-20.8-46.3s-8.8-32.7-10.6-49.6c-1.8-16.8-1.7-33.8.1-50.7%201.8-16.8%205.5-33.4%2010.8-49.5-17-18.9-31-40.4-41.4-63.6-10.3-23.3-17-48-19.6-73.3-2.7-25.3-1.3-50.9%204-75.8s14.5-48.8%2027.3-70.8c8.4-14.7%2018.3-28.6%2029.6-41.2s24-24%2037.7-34%2028.5-18.5%2044-25.3c15.6-6.9%2031.8-12%2048.4-15.4%207.8-24.3%2019.4-47.1%2034.3-67.7%2015-20.6%2033.1-38.7%2053.7-53.7%2020.6-14.9%2043.4-26.5%2067.6-34.4%2024.2-7.8%2049.5-11.8%2075-11.7%2016.9-.1%2033.9%201.6%2050.5%205.1s32.8%208.7%2048.3%2015.6c15.5%207%2030.2%2015.5%2043.9%2025.5%2013.7%2010.1%2026.3%2021.5%2037.5%2034.2%2024.9-5.3%2050.5-6.6%2075.8-4s50%209.3%2073.3%2019.6c23.2%2010.4%2044.7%2024.3%2063.6%2041.4%2018.9%2017%2035%2036.9%2047.7%2059%208.5%2014.6%2015.5%2030.1%2020.8%2046.3%205.3%2016.1%208.9%2032.7%2010.6%2049.6%201.8%2016.9%201.8%2033.9-.1%2050.8-1.8%2016.9-5.5%2033.5-10.8%2049.6%2017.1%2018.9%2031%2040.3%2041.4%2063.6zm-333.2%20426.9c21.8-9%2041.6-22.3%2058.3-39s30-36.5%2039-58.4c9-21.8%2013.7-45.2%2013.7-68.8v-223q-.1-.3-.2-.7-.1-.3-.3-.6-.2-.3-.5-.5-.3-.3-.6-.4l-80.7-46.6v269.4c0%202.7-.4%205.5-1.1%208.1-.7%202.7-1.7%205.2-3.1%207.6s-3%204.6-5%206.5a32.1%2032.1%200%200%201%20-6.5%205l-191.1%20110.3c-1.6%201-4.3%202.4-5.7%203.2%207.9%206.7%2016.5%2012.6%2025.5%2017.8%209.1%205.2%2018.5%209.6%2028.3%2013.2%209.8%203.5%2019.9%206.2%2030.1%208%2010.3%201.8%2020.7%202.7%2031.1%202.7%2023.6%200%2047-4.7%2068.8-13.8zm-455.1-151.4c11.9%2020.5%2027.6%2038.3%2046.3%2052.7%2018.8%2014.4%2040.1%2024.9%2062.9%2031s46.6%207.7%2070%204.6%2045.9-10.7%2066.4-22.5l193.2-111.5.5-.5q.2-.2.3-.6.2-.3.3-.6v-94l-233.2%20134.9c-2.4%201.4-4.9%202.4-7.5%203.2-2.7.7-5.4%201-8.2%201-2.7%200-5.4-.3-8.1-1-2.6-.8-5.2-1.8-7.6-3.2l-191.1-110.4c-1.7-1-4.2-2.5-5.6-3.4-1.8%2010.3-2.7%2020.7-2.7%2031.1s1%2020.8%202.8%2031.1c1.8%2010.2%204.6%2020.3%208.1%2030.1%203.6%209.8%208%2019.2%2013.2%2028.2zm-50.2-417c-11.8%2020.5-19.4%2043.1-22.5%2066.5s-1.5%2047.1%204.6%2070c6.1%2022.8%2016.6%2044.1%2031%2062.9%2014.4%2018.7%2032.3%2034.4%2052.7%2046.2l193.1%20111.6q.3.1.7.2h.7q.4%200%20.7-.2.3-.1.6-.3l81-46.8-233.2-134.6c-2.3-1.4-4.5-3.1-6.5-5a32.1%2032.1%200%200%201%20-5-6.5c-1.3-2.4-2.4-4.9-3.1-7.6-.7-2.6-1.1-5.3-1-8.1v-227.1c-9.8%203.6-19.3%208-28.3%2013.2-9%205.3-17.5%2011.3-25.5%2018-7.9%206.7-15.3%2014.1-22%2022.1-6.7%207.9-12.6%2016.5-17.8%2025.5zm663.3%20154.4c2.4%201.4%204.6%203%206.6%205%201.9%201.9%203.6%204.1%205%206.5%201.3%202.4%202.4%205%203.1%207.6.6%202.7%201%205.4.9%208.2v227.1c32.1-11.8%2060.1-32.5%2080.8-59.7%2020.8-27.2%2033.3-59.7%2036.2-93.7s-3.9-68.2-19.7-98.5-39.9-55.5-69.5-72.5l-193.1-111.6q-.3-.1-.7-.2h-.7q-.3.1-.7.2-.3.1-.6.3l-80.6%2046.6%20233.2%20134.7zm80.5-121h-.1v.1zm-.1-.1c5.8-33.6%201.9-68.2-11.3-99.7-13.1-31.5-35-58.6-63-78.2-28-19.5-61-30.7-95.1-32.2-34.2-1.4-68%206.9-97.6%2023.9l-193.1%20111.5q-.3.2-.5.5l-.4.6q-.1.3-.2.7-.1.3-.1.7v93.2l233.2-134.7c2.4-1.4%205-2.4%207.6-3.2%202.7-.7%205.4-1%208.1-1%202.8%200%205.5.3%208.2%201%202.6.8%205.1%201.8%207.5%203.2l191.1%20110.4c1.7%201%204.2%202.4%205.6%203.3zm-505.3-103.2c0-2.7.4-5.4%201.1-8.1.7-2.6%201.7-5.2%203.1-7.6%201.4-2.3%203-4.5%205-6.5%201.9-1.9%204.1-3.6%206.5-4.9l191.1-110.3c1.8-1.1%204.3-2.5%205.7-3.2-26.2-21.9-58.2-35.9-92.1-40.2-33.9-4.4-68.3%201-99.2%2015.5-31%2014.5-57.2%2037.6-75.5%2066.4-18.3%2028.9-28%2062.3-28%2096.5v223q.1.4.2.7.1.3.3.6.2.3.5.6.2.2.6.4l80.7%2046.6zm43.8%20294.7%20103.9%2060%20103.9-60v-119.9l-103.8-60-103.9%2060z'/%3e%3c/svg%3e",k3="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",_3="/assets/minimax-BPMzvuL-.jpeg",S3="/assets/alibaba-TTwafVwX.svg",C3="/assets/qwen-CONDcHqt.png",E3="/assets/zhipuai-BPNAnxo-.svg",j3={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function N3(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(j3))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const gn={width:24,height:24,objectFit:"contain"},T3=ot.memo(({className:e})=>c.jsx("img",{src:b3,alt:"Anthropic",className:e,style:gn})),A3=ot.memo(({className:e})=>c.jsx("img",{src:w3,alt:"OpenAI",className:e,style:{...gn,background:"white",borderRadius:"4px"}})),z3=ot.memo(({className:e})=>c.jsx("img",{src:k3,alt:"DeepSeek",className:e,style:gn})),I3=ot.memo(({className:e})=>c.jsx("img",{src:_3,alt:"MiniMax",className:e,style:gn})),R3=ot.memo(({className:e})=>c.jsx("img",{src:S3,alt:"Alibaba",className:e,style:gn})),P3=ot.memo(({className:e})=>c.jsx("img",{src:C3,alt:"Qwen",className:e,style:gn})),O3=ot.memo(({className:e})=>c.jsx("img",{src:E3,alt:"ZhipuAI",className:e,style:gn}));function D3({provider:e,className:t}){switch(e){case"anthropic":return c.jsx(T3,{className:t});case"openai":return c.jsx(A3,{className:t});case"deepseek":return c.jsx(z3,{className:t});case"minimax":return c.jsx(I3,{className:t});case"alibaba":return c.jsx(R3,{className:t});case"qwen":return c.jsx(P3,{className:t});case"zhipuai":return c.jsx(O3,{className:t});case"unknown":return null}}function M3(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const kc={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 _c({trend:e}){if(e===null)return null;const t=e.direction==="up",n=t?dv:cv,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 L3=v.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1,cacheTrend:i=null,isSelected:s=!1,onToggleSelect:a}){const l=td(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:me("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:me("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(D3,{provider:N3(e.model),className:"size-4 shrink-0"}),c.jsx(tt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&c.jsx(tt,{variant:"outline",className:me("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(tt,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):l==="pending"?c.jsx(tt,{variant:"outline",className:me("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",kc[l]),children:c.jsx(to,{className:"size-3 animate-spin"})}):c.jsx(tt,{variant:"outline",className:me("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",kc[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(_o,{className:"size-3"}),c.jsx("span",{className:"font-mono tabular-nums",children:M3(e.elapsedMs)})]}),u&&c.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[c.jsx(vr,{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(_c,{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(_c,{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(Du,{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(Nb,{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(Wv,{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(kb,{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($v,{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(ob,{className:"size-3 text-muted-foreground/60 shrink-0"}),c.jsx("span",{className:"flex-1 min-w-0"}),n?c.jsx(mt,{className:"size-4 text-muted-foreground shrink-0"}):c.jsx(kt,{className:"size-4 text-muted-foreground shrink-0"})]})});function pa({...e}){return c.jsx(l2,{"data-slot":"dialog",...e})}function F3({...e}){return c.jsx(c2,{"data-slot":"dialog-trigger",...e})}function $3({...e}){return c.jsx(u2,{"data-slot":"dialog-portal",...e})}function B3({className:e,...t}){return c.jsx(d2,{"data-slot":"dialog-overlay",className:me("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 ma({className:e,children:t,...n}){return c.jsxs($3,{children:[c.jsx(B3,{}),c.jsxs(f2,{"data-slot":"dialog-content",className:me("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(p2,{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(js,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ga({className:e,...t}){return c.jsx("div",{"data-slot":"dialog-header",className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function xa({className:e,...t}){return c.jsx(h2,{"data-slot":"dialog-title",className:me("text-lg font-semibold leading-none tracking-tight",e),...t})}function cp({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(H_,{"data-slot":"separator",decorative:n,orientation:t,className:me("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 qo({...e}){return c.jsx(G1,{"data-slot":"collapsible",...e})}function Ko({...e}){return c.jsx(cd,{"data-slot":"collapsible-trigger",...e})}function Go({...e}){return c.jsx(ud,{"data-slot":"collapsible-content",...e})}function ya({className:e,children:t,...n}){return c.jsxs(i_,{"data-slot":"scroll-area",className:me("relative",e),...n,children:[c.jsx(s_,{"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(U3,{}),c.jsx(a_,{})]})}function U3({className:e,orientation:t="vertical",...n}){return c.jsx(wf,{"data-slot":"scroll-area-scrollbar",orientation:t,className:me("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(Cf,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function Z3(e){return c.jsx(c.Fragment,{})}function V3({text:e}){const[t,n]=v.useState(!1);return c.jsxs(qo,{open:t,onOpenChange:n,children:[c.jsxs(Ko,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?c.jsx(mt,{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(Go,{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 W3=/<think>([\s\S]*?)<\/think>/gi,H3=/<think>([\s\S]*?)<\/think>/i;function up(e){const t=H3.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(W3,"").trim();return{thinking:n,remainingText:r}}function q3({text:e}){if(e.includes("<system-reminder>"))return c.jsx(V3,{text:e});const{thinking:t,remainingText:n}=up(e);return c.jsxs("div",{className:"space-y-2",children:[t!==null&&c.jsx(go,{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 go({thinking:e}){const[t,n]=v.useState(!1);return c.jsx(qo,{open:t,onOpenChange:n,children:c.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[c.jsxs(Ko,{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(hv,{className:"size-3.5 text-purple-400 shrink-0"}),c.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),c.jsxs(tt,{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(mt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(Go,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(ya,{className:"max-h-[60vh]",children:c.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function K3({name:e,input:t}){const[n,r]=v.useState(!1);return c.jsx(qo,{open:n,onOpenChange:r,children:c.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[c.jsxs(Ko,{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($u,{className:"size-3.5 text-blue-400 shrink-0"}),c.jsx(tt,{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(mt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(Go,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(ya,{className:"max-h-[60vh]",children:c.jsx(Ho,{data:Zn(t),defaultExpandDepth:2})})})})]})})}function G3({block:e}){switch(e.type){case"text":return c.jsx(q3,{text:e.text});case"thinking":case"think":return c.jsx(go,{thinking:e.thinking});case"tool_use":return c.jsx(K3,{name:e.name,input:e.input});default:return Z3()}}function J3({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(tt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&c.jsxs(tt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[c.jsx(Ru,{className:"size-2.5"}),e.stop_reason]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(vr,{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(G3,{block:t},n)),e.content.length===0&&c.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function Y3(e){if(e===void 0||e==="")return{};try{return JSON.parse(e)}catch{return null}}function X3({call:e}){const[t,n]=v.useState(!1),r=e.function.name??"(unnamed tool)",o=Y3(e.function.arguments);return c.jsx(qo,{open:t,onOpenChange:n,children:c.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[c.jsxs(Ko,{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($u,{className:"size-3.5 text-blue-400 shrink-0"}),c.jsx(tt,{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(mt,{className:"size-3 text-muted-foreground"}):c.jsx(kt,{className:"size-3 text-muted-foreground"})]}),c.jsx(Go,{children:c.jsx("div",{className:"px-3 pb-2",children:c.jsx(ya,{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(Ho,{data:Zn(o),defaultExpandDepth:2})})})})]})})}function Q3({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(tt,{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(tt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[c.jsx(Ru,{className:"size-2.5"}),t.finish_reason]}),c.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[c.jsx(vr,{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(go,{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(go,{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(X3,{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 e5(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function t5(e,t){return e5(t)?c.jsx(Q3,{response:t}):c.jsx(J3,{response:t})}function n5(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 r5(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=td(e),n=n5(t);return e===null?c.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):c.jsxs("span",{className:me("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&c.jsx(yb,{className:"size-3"}),e]})}function Sc({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 o5({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 Gr({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(Sc,{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(Sc,{text:e})})]});const d=e!==null?r5(e,a):null;return d!==null?c.jsxs("div",{className:"space-y-2",children:[c.jsx(ir,{status:t}),t5(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(vr,{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(o5,{text:e??""})]})}const i5=ie({success:Ye(),error:K().optional(),responseStatus:ve().optional(),responseText:K().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),elapsedMs:ve().optional(),streaming:Ye().optional()});function s5({log:e,open:t,onOpenChange:n}){const[r,o]=v.useState(()=>e.rawRequestBody??"{}"),[i,s]=v.useState(null),[a,l]=v.useState(!1),[u,d]=v.useState(null);async function h(){l(!0),d(null),s(null);try{const y=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=i5.safeParse(y);if(!m.success){d("Invalid response from server"),l(!1);return}const x=m.data;s(x),x.success||d(x.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(pa,{open:t,onOpenChange:p,children:c.jsxs(ma,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[c.jsx(ga,{children:c.jsxs(xa,{className:"flex items-center gap-2",children:[c.jsx(Mu,{className:"size-4"}),"Replay Request #",e.id]})}),c.jsxs(jn,{defaultValue:"modified",children:[c.jsxs(Nn,{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(nt,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&c.jsxs(jn,{defaultValue:"parsed",children:[c.jsxs(Nn,{children:[c.jsx(Ge,{value:"parsed",children:"Response"}),c.jsx(Ge,{value:"raw",children:"Raw Response"})]}),c.jsx(Je,{value:"parsed",children:c.jsx(Gr,{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(jn,{defaultValue:"parsed",children:[c.jsxs(Nn,{children:[c.jsx(Ge,{value:"parsed",children:"Response"}),c.jsx(Ge,{value:"raw",children:"Raw Response"})]}),c.jsx(Je,{value:"parsed",children:c.jsx(Gr,{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(jn,{defaultValue:"parsed",children:[c.jsxs(Nn,{children:[c.jsx(Ge,{value:"parsed",children:"Response"}),c.jsx(Ge,{value:"raw",children:"Raw Response"})]}),c.jsx(Je,{value:"parsed",children:c.jsx(Gr,{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 a5({logId:e,truncated:t}){const[n,r]=v.useState(!1),[o,i]=v.useState({status:"idle"}),[s,a]=v.useState(new Set);v.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=v.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(to,{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(mt,{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(Ho,{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(mt,{className:"size-3"}):c.jsx(kt,{className:"size-3"}),c.jsx("span",{children:"Raw SSE Events"}),c.jsxs(tt,{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 Cc(e,t,n){return e==="anthropic"&&t==="full"&&n}function l5(e,t){return e==="full"&&t}function c5(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function Ci({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 Ec({active:e,onClick:t}){return c.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:me("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(Ou,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const dp=v.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r,cacheTrend:o=null,isSelected:i=!1,onToggleSelect:s}){const[a,l]=v.useState(!1),[u,d]=v.useState(!1),[h,p]=v.useState(!1),[f,y]=v.useState(!1),[m,x]=v.useState(!1),[g,b]=v.useState(!1),[k,S]=v.useState(!1),N=v.useMemo(()=>Ii(e.rawRequestBody),[e.rawRequestBody]),j=v.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:AS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,I=v.useMemo(()=>d3(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),P=v.useMemo(()=>f3(e.rawRequestBody,j),[e.rawRequestBody,j]);function M(D){D.stopPropagation(),j!==null&&window.navigator.clipboard.writeText(j).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})}function U(D){D.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})}function E(D){D.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{y(!0),setTimeout(()=>y(!1),2e3)})}return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:me("border border-border rounded-lg mb-3 overflow-hidden",i&&"border-l-2 border-l-amber-400"),children:[c.jsx(L3,{log:e,parsedRequest:N,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(jn,{defaultValue:"request",children:[c.jsxs(Nn,{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"}),Cc(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"})]}),Cc(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(Ci,{text:e.rawRequestBody,label:"Copy Raw Request",copied:h,onCopy:U})}),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:[c5(e.apiFormat,t,r,e.rawRequestBody!==null)&&c.jsx(Ec,{active:k,onClick:D=>{D.stopPropagation(),S(!k)}}),c.jsxs(nt,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:D=>{D.stopPropagation(),x(!0)},children:[c.jsx(Mu,{className:"size-3 mr-1"}),"Replay"]}),c.jsx(Ci,{text:j,label:"Copy Request",copied:u,onCopy:M})]}),k?c.jsx(wc,{result:P,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):j!==null?c.jsx(sn,{text:j,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:l5(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&c.jsx(Ec,{active:g,onClick:D=>{D.stopPropagation(),b(!g)}})}),g?c.jsx(wc,{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],[w])=>D.localeCompare(w)).map(([D,w])=>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:w,children:w})]},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],[w])=>D.localeCompare(w)).map(([D,w])=>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:w,children:w})]},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(Ci,{text:e.responseText,label:"Copy Response",copied:f,onCopy:E})}),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(a5,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),c.jsx(Je,{value:"parsed",children:c.jsx("div",{className:"px-4 py-3",children:c.jsx(Gr,{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(s5,{log:e,open:m,onOpenChange:x})]})});function u5(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 d5=v.memo(function({group:e,viewMode:t="simple",strip:n,cacheTrends:r,selectedSet:o,onToggleSelect:i}){const[s,a]=v.useState(!1),l=u5(e.logs),u=e.logs[0]?.timestamp??new Date().toISOString(),d=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),h=SS(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(kS,{conversationId:p,startTime:u,endTime:d,totalCalls:e.logs.length,totalInputTokens:l.totalInputTokens,totalOutputTokens:l.totalOutputTokens,apiFormat:_S(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 f5({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:me("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 jc({...e}){return c.jsx(z_,{"data-slot":"select",...e})}function Nc({...e}){return c.jsx(R_,{"data-slot":"select-value",...e})}function Tc({className:e,size:t="default",children:n,...r}){return c.jsxs(I_,{"data-slot":"select-trigger","data-size":t,className:me("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(P_,{asChild:!0,children:c.jsx(mt,{className:"size-4 opacity-50"})})]})}function Ac({className:e,children:t,position:n="popper",align:r="center",...o}){return c.jsx(O_,{children:c.jsxs(D_,{"data-slot":"select-content",className:me("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(h5,{}),c.jsx(M_,{className:me("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(p5,{})]})})}function Ur({className:e,children:t,...n}){return c.jsxs(L_,{"data-slot":"select-item",className:me("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($_,{children:c.jsx(Vt,{className:"size-4"})})}),c.jsx(F_,{children:t})]})}function h5({className:e,...t}){return c.jsx(B_,{"data-slot":"select-scroll-up-button",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(yv,{className:"size-4"})})}function p5({className:e,...t}){return c.jsx(U_,{"data-slot":"select-scroll-down-button",className:me("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(mt,{className:"size-4"})})}function m5(){return c.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"size-6 shrink-0",children:[c.jsx("title",{children:"Claude Code"}),c.jsx("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"})]})}function g5(){return c.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"size-6 shrink-0",children:[c.jsx("title",{children:"OpenCode"}),c.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})]})}const x5=ie({name:K(),apiKey:K(),format:ft(["anthropic","openai"]),anthropicBaseUrl:K(),openaiBaseUrl:K(),models:ze(K()),sourceTool:ft(["claude-code","opencode"]),alreadyExists:Ye()}),y5=ie({providers:ze(x5),warnings:ze(K()).optional()}),v5=ie({success:Ye().optional(),imported:ve().optional(),message:K().optional(),errors:ze(K()).optional()}),b5={"claude-code":m5,opencode:g5};function w5({open:e,onOpenChange:t,onImportComplete:n}){const[r,o]=v.useState(!1),[i,s]=v.useState(null),[a,l]=v.useState([]),[u,d]=v.useState([]),[h,p]=v.useState(new Set),[f,y]=v.useState(!1),[m,x]=v.useState(null),[g,b]=v.useState(null),k=v.useCallback(()=>{o(!0),s(null),d([]),l([]),p(new Set),x(null),b(null),fetch("/api/providers/scan").then(j=>j.ok?j.json().then(I=>{const P=y5.safeParse(I);if(!P.success){s(`Invalid response: ${P.error.message}`);return}l(P.data.providers),d(P.data.warnings??[]);const M=new Set;P.data.providers.forEach((U,E)=>{U.alreadyExists||M.add(E)}),p(M)}):j.text().then(I=>{s(`Scan failed (${j.status}): ${I}`)})).catch(j=>{s(j instanceof Error?j.message:String(j))}).finally(()=>{o(!1)})},[]);v.useEffect(()=>{e&&k()},[e,k]);const S=v.useCallback(j=>{p(I=>{const P=new Set(I);return P.has(j)?P.delete(j):P.add(j),P})},[]),N=v.useCallback(()=>{const j=a.filter((M,U)=>h.has(U));if(j.length===0)return;y(!0),b(null),x(null);const I=new Date().toISOString(),P=j.map(M=>({id:window.crypto.randomUUID(),name:M.name,apiKey:M.apiKey,format:M.format,anthropicBaseUrl:M.anthropicBaseUrl,openaiBaseUrl:M.openaiBaseUrl,models:M.models,createdAt:I,updatedAt:I}));fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providers:P})}).then(M=>M.json()).then(M=>{const U=v5.safeParse(M);if(!U.success){b(`Invalid response: ${U.error.message}`);return}const E=U.data;E.errors!==void 0&&E.errors.length>0&&E.message!==void 0?x(E.message):x(`Imported ${E.imported??j.length} provider(s)`),n()}).catch(M=>{b(M instanceof Error?M.message:String(M))}).finally(()=>{y(!1)})},[a,h,n]),C=a.some(j=>!j.alreadyExists);return c.jsx(pa,{open:e,onOpenChange:t,children:c.jsxs(ma,{className:"max-w-xl max-h-[80vh] overflow-hidden flex flex-col",children:[c.jsxs(ga,{children:[c.jsx(xa,{children:"Import from External Tools"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Detect provider configurations from Claude Code and OpenCode."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto space-y-3",children:[r&&c.jsxs("div",{className:"flex items-center justify-center py-8 gap-2 text-muted-foreground",children:[c.jsx(to,{className:"size-4 animate-spin"}),c.jsx("span",{className:"text-sm",children:"Scanning for external providers..."})]}),i!==null&&c.jsxs("div",{className:"flex items-center gap-2 text-destructive text-sm py-4",children:[c.jsx(pr,{className:"size-4"}),i]}),!r&&i===null&&a.length===0&&c.jsxs("p",{className:"text-sm text-muted-foreground py-8 text-center",children:["No external provider configurations found.",c.jsx("br",{}),c.jsx("span",{className:"text-xs",children:"Supported tools: Claude Code (~/.claude/settings.json), OpenCode (~/.config/opencode/opencode.json)"})]}),!r&&a.map((j,I)=>c.jsxs("label",{className:`flex items-start gap-3 p-3 border rounded-md ${j.alreadyExists?"":"cursor-pointer hover:bg-muted/50"}`,children:[!j.alreadyExists&&c.jsx("input",{type:"checkbox",checked:h.has(I),disabled:f,onChange:()=>S(I),className:"mt-0.5 size-4"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[(()=>{const P=b5[j.sourceTool];return P===void 0?null:c.jsx(P,{})})(),j.alreadyExists&&c.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Already added"})]}),c.jsxs("div",{className:"text-xs text-muted-foreground mt-1 truncate",children:[j.models.slice(0,4).join(", "),j.models.length>4?` +${j.models.length-4} more`:""]}),c.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:j.format==="anthropic"?j.anthropicBaseUrl:j.openaiBaseUrl}),c.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 font-mono",children:j.apiKey.length>8?`${j.apiKey.slice(0,4)}••••${j.apiKey.slice(-4)}`:"••••"})]})]},`${j.sourceTool}-${j.name}`)),u.length>0&&c.jsx("div",{className:"text-xs text-muted-foreground space-y-1 border-t pt-2",children:u.map((j,I)=>c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(pr,{className:"size-3"}),j]},I))}),m!==null&&c.jsx("div",{className:"text-sm text-green-500 border-t pt-2",children:m}),g!==null&&c.jsx("div",{className:"text-sm text-destructive border-t pt-2",children:g})]}),c.jsxs("div",{className:"flex items-center justify-between pt-3 border-t",children:[c.jsxs(nt,{variant:"outline",size:"sm",onClick:k,disabled:r,children:[c.jsx(to,{className:`size-3 mr-1 ${r?"animate-spin":""}`}),"Rescan"]}),c.jsxs(nt,{size:"sm",onClick:N,disabled:!C||h.size===0||f,children:[c.jsx(ks,{className:"size-3 mr-1"}),f?"Importing...":`Import Selected (${h.size})`]})]})]})})}function fp(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}const k5={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function _5(e){return Object.prototype.hasOwnProperty.call(e,"success")}function S5(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function C5(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return c.jsx(_o,{...t});case"network_unreachable":return c.jsx(Sb,{...t});case"connection_refused":return c.jsx(Eb,{...t});case"auth_failed":return c.jsx(Xv,{...t});case"rate_limited":return c.jsx(Uv,{...t});case"server_error":return c.jsx(db,{...t});case"invalid_response":return c.jsx(jv,{...t});case"unknown":return c.jsx(pr,{...t});default:return c.jsx(pr,{...t})}}function Zr({result:e}){const[t,n]=v.useState(!1);if(!_5(e))return S5(e)?c.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[c.jsx(Cs,{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(Lu,{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(Cv,{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:[C5(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(_s,{className:"size-3"}):c.jsx(Ss,{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 E5(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 j5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,isHighlighted:o,onEdit:i,onDelete:s,onTest:a}){const[l,u]=v.useState(!1),[d,h]=v.useState(!1),[p,f]=v.useState(!1),y=v.useRef(null),m=v.useRef(void 0);t?.testedAt!==void 0&&t.testedAt!==m.current&&(m.current=t.testedAt,y.current=null);const x=v.useCallback(()=>{f(k=>{const S=!k;return S&&y.current===null&&t?.models!==void 0&&(y.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 b=e.apiDocsUrl??Object.entries(k5).find(([k])=>e.name.toLowerCase().includes(k))?.[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:"个人"})]}),b!==void 0&&c.jsxs("a",{href:b,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(Dv,{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(k=>c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:k},k))}),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(k=>!k),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":l?"Hide API key":"Show API key",children:l?c.jsx(_s,{className:"size-4"}):c.jsx(Ss,{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(Zr,{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(Zr,{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(_o,{className:"size-3"}),c.jsxs("span",{children:["Tested ",E5(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:x,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(([k,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:k}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&c.jsx("td",{className:"py-1 px-2",children:c.jsx(Zr,{result:S.anthropic.nonStreaming})}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&c.jsx("td",{className:"py-1 px-2",children:c.jsx(Zr,{result:S.openai.nonStreaming})})]},k))})]})})]}),c.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[a!==void 0&&c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>a(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[c.jsx(Lu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>i(e),className:"text-xs h-7 gap-1",disabled:n??!1,children:[c.jsx(Es,{className:"size-3"}),"Edit"]}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",disabled:n??!1,children:[c.jsx(gb,{className:"size-3"}),"Delete"]})]})]})}const N5={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"}},zc=["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"],Ic=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function T5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=v.useState(e?.name??""),[i,s]=v.useState(e?.apiKey??""),[a,l]=v.useState(!1),[u,d]=v.useState(!1),h=e?.models,[p,f]=v.useState(h!==void 0&&h.length>0?h:[""]),[y,m]=v.useState("anthropic"),[x,g]=v.useState(e?.anthropicBaseUrl??""),[b,k]=v.useState(e?.openaiBaseUrl??""),[S,N]=v.useState(e?.apiDocsUrl??""),[C,j]=v.useState(e?.source),[I,P]=v.useState({}),[M,U]=v.useState(!1),[E,D]=v.useState(null),w=v.useRef([]);v.useEffect(()=>{if(E===null)return;const G=E;function le(Q){if(!(Q.target instanceof Node))return;const ce=w.current[G];ce!=null&&!ce.contains(Q.target)&&D(null)}return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[E]);const[O,J]=v.useState(!1),[W,q]=v.useState(!1),Y=r.toLowerCase().includes("minimax"),T=r.toLowerCase().includes("alibaba");function F(){navigator.clipboard.writeText(i).catch(()=>{}),d(!0),setTimeout(()=>d(!1),2e3)}v.useEffect(()=>{e&&(o(e.name),s(e.apiKey),f((e.models?.length??0)>0?e.models:[""]),g(e.anthropicBaseUrl??""),k(e.openaiBaseUrl??""),N(e.apiDocsUrl??""),j(e.source),J(!1),q(!1))},[e]),v.useEffect(()=>{const G=r.toLowerCase();for(const[le,Q]of Object.entries(N5))if(G.includes(le)){Q.format==="anthropic"&&!O?g(Q.baseUrl):Q.format==="openai"&&!W&&k(Q.baseUrl),Q.apiDocsUrl!==void 0&&!S&&N(Q.apiDocsUrl),le==="minimax"&&p.length===1&&p[0]===""&&f([zc[0]??""]),le==="alibaba"&&p.length===1&&p[0]===""&&f([Ic[0]??""]);break}},[r]);function $(){const G={};return r.trim()||(G.name="Name is required"),i.trim()||(G.apiKey="API key is required"),(p.length===0||p.every(le=>!le.trim()))&&(G.models="At least one model is required"),x.trim()&&!A(x.trim())&&(G.anthropicBaseUrl="Invalid URL format"),b.trim()&&!A(b.trim())&&(G.openaiBaseUrl="Invalid URL format"),!x.trim()&&!b.trim()&&(G.format="At least one format URL (Anthropic or OpenAI) is required"),P(G),Object.keys(G).length===0}function A(G){try{return new URL(G),!0}catch{return!1}}function te(G){if(G.preventDefault(),!!$()){U(!0);try{t({name:r.trim(),apiKey:i.trim(),models:p.map(le=>le.trim()).filter(le=>le!==""),anthropicBaseUrl:x.trim()||void 0,openaiBaseUrl:b.trim()||void 0,apiDocsUrl:S.trim()||void 0,source:C})}finally{U(!1)}}}return c.jsxs("form",{onSubmit:te,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:G=>o(G.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:G=>j(G.target.value==="company"||G.target.value==="personal"?G.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:G=>s(G.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(G=>!G),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(_s,{className:"size-4"}):c.jsx(Ss,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:F,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((G,le)=>c.jsxs("div",{ref:Q=>{w.current[le]=Q},className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{type:"text",value:G,onChange:Q=>{f(ce=>{const de=[...ce];return de[le]=Q.target.value,de})},placeholder:Y||T?"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"}),(Y||T)&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>D(E===le?null:le),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(mt,{className:"size-4"})}),E===le&&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:(Y?zc:Ic).map(Q=>c.jsx("button",{type:"button",onClick:()=>{f(ce=>{const de=[...ce];return de[le]=Q,de}),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,de)=>de!==le)),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"})]})})]},le)),c.jsx("button",{type:"button",onClick:()=>f(G=>[...G,""]),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 ${y==="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 ${y==="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})]}),y==="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:x,onChange:G=>{J(!0),g(G.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."})]}),y==="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:b,onChange:G=>{q(!0),k(G.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:G=>N(G.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(nt,{type:"button",variant:"outline",onClick:n,disabled:M,children:"Cancel"}),c.jsx(nt,{type:"submit",disabled:M,children:M?"Saving...":e?"Update Provider":"Add Provider"})]})]})}const as=ie({id:K(),name:K(),apiKey:K(),model:K().optional(),models:ze(K()).min(1),format:ft(["anthropic","openai"]).optional(),baseUrl:K().optional(),anthropicBaseUrl:K().optional(),openaiBaseUrl:K().optional(),authHeader:ft(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:K().optional(),source:ft(["company","personal"]).optional(),createdAt:K(),updatedAt:K()}),A5=ft(["timeout","network_unreachable","connection_refused","auth_failed","rate_limited","server_error","invalid_response","unknown"]),z5=ie({message:K(),type:A5,details:K().optional(),hint:K().optional()}),I5=ie({type:ft(["text","thinking"]),text:K().optional(),thinking:K().optional()}),R5=ie({success:Ye(),error:z5.optional(),model:K().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),cacheCreationInputTokens:ve().optional(),cacheReadInputTokens:ve().optional(),latencyMs:ve().optional(),content:ze(I5).optional(),rawResponse:K().optional(),streaming:Ye().optional(),streamingChunks:ie({chunks:ze(ju),truncated:Ye().default(!1)}).optional(),requestHeaders:$t(K(),K()).optional()}),Rc=Zt([R5,ie({notConfigured:Se(!0)}),ie({testing:Se(!0)})]),xo=ie({nonStreaming:Rc,streaming:Rc}),P5=ie({anthropic:xo,openai:xo}),O5=ie({anthropic:xo,openai:xo,models:$t(K(),P5).optional(),testedAt:K().optional()});function D5(){return{anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}}}function Pc(e,t){const n=()=>({nonStreaming:{success:!1,error:{message:e,type:t}},streaming:{notConfigured:!0}});return{anthropic:n(),openai:n()}}const M5=ie({providerConfig:K()}),L5=ie({success:Ye().optional(),imported:ve().optional(),message:K().optional(),errors:ze(K()).optional()}),F5=30,Ei="Network error: could not reach the server. Is the proxy running?";function Oc(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 $5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[u,d]=v.useState(!1),[h,p]=v.useState(),[f,y]=v.useState(null),[m,x]=v.useState({}),[g,b]=v.useState(new Set),[k,S]=v.useState({}),[N,C]=v.useState(null),[j,I]=v.useState(!1),[P,M]=v.useState(null),[U,E]=v.useState(!1),[D,w]=v.useState("all"),O=v.useRef(null),J=v.useRef(null),W=e??[],q=v.useMemo(()=>{const Z=D==="all"?W:W.filter(B=>B.source===D);return D==="all"?[...Z].sort((B,R)=>{const z={personal:0,company:1};return(z[B.source??""]??2)-(z[R.source??""]??2)}):Z},[W,D]),Y=n??m,T=r??g,F=o??k,$=l?(Z,B)=>l(Z,B):(Z,B)=>{S(B===void 0?R=>{const z={...R};return delete z[Z],z}:R=>({...R,[Z]:B}))};v.useEffect(()=>{(async()=>{try{const Z=await fetch("/api/config/paths");if(Z.ok){const B=await Sn(Z,M5);C(B.providerConfig)}}catch{}})()},[]);const A=v.useCallback(Z=>{J.current!==null&&clearTimeout(J.current),M(Z),O.current?.scrollTo({top:O.current.scrollHeight,behavior:"smooth"}),J.current=setTimeout(()=>{M(null),J.current=null},2e3)},[]);v.useEffect(()=>()=>{J.current!==null&&clearTimeout(J.current)},[]);const te=v.useCallback(()=>{i?.().catch(()=>{})},[i]),G=v.useCallback((Z,B)=>{s?s(Z,B):x(R=>({...R,[Z]:B}))},[s]),le=v.useCallback((Z,B)=>{if(a){a(Z,B);return}b(R=>{const z=new Set(R);return B?z.add(Z):z.delete(Z),z})},[a]),Q=v.useCallback(async Z=>{G(Z,D5()),le(Z,!0);const B=new AbortController;let R=F5;$(Z,R);const z=setInterval(()=>{R--,$(Z,R),R<=0&&(clearInterval(z),B.abort())},1e3);try{const L=await fetch(`/api/providers/${Z}/test`,{method:"POST",signal:B.signal});if(L.ok){const ee=await Sn(L,O5);G(Z,ee)}else G(Z,Pc(`HTTP ${L.status}: ${L.statusText}`,"server_error"))}catch(L){L instanceof Error&&L.name==="AbortError"&&G(Z,Pc("Request timed out","timeout"))}finally{clearInterval(z),$(Z,void 0),le(Z,!1)}},[$,G,le]);function ce(Z){(async()=>{try{const B=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Oc(Z))});if(!B.ok){y(await Vr(B,"Failed to add provider"));return}const R=await Sn(B,as);d(!1),A(R.id),te(),await Q(R.id)}catch{y(Ei)}})()}function de(Z){h&&(async()=>{try{const B=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Oc(Z))});if(!B.ok){y(await Vr(B,"Failed to update provider"));return}const R=await Sn(B,as);p(void 0),A(R.id),te(),((Z.apiKey??"")!==(h.apiKey??"")||JSON.stringify(Z.models)!==JSON.stringify(h.models)||(Z.anthropicBaseUrl??"")!==(h.anthropicBaseUrl??"")||(Z.openaiBaseUrl??"")!==(h.openaiBaseUrl??""))&&await Q(R.id)}catch{y(Ei)}})()}function ge(Z){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let B;try{B=await fetch(`/api/providers/${Z}`,{method:"DELETE"})}catch{y(Ei);return}if(!B.ok){y(await Vr(B,"Failed to delete provider"));return}te()})()}const xe=v.useRef(null);function je(Z){const B="/api/providers/export";(async()=>{try{const R=await fetch(B);if(!R.ok){y("Failed to export providers");return}const z=await R.blob(),L=URL.createObjectURL(z),ee=document.createElement("a");ee.href=L,ee.download=R.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(ee),ee.click(),document.body.removeChild(ee),URL.revokeObjectURL(L)}catch{y("Failed to export providers")}})()}function Oe(){xe.current?.click()}function _(Z){const B=Z.target.files?.[0];B&&(async()=>{try{const R=await B.text(),z=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)}),L=await Sn(z,L5);z.ok&&L.imported!==void 0&&L.imported>0?(te(),y(null)):L.errors&&L.errors.length>0?y(L.errors.join("; ")):y(L.message??"Import failed")}catch{y("Failed to import providers")}Z.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(T5,{provider:h,onSubmit:h?de:ce,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(nt,{variant:"outline",size:"sm",onClick:()=>je(),className:"gap-1 hover:bg-muted",children:[c.jsx(ks,{className:"size-3"}),"Export"]}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:Oe,className:"gap-1 hover:bg-muted",children:[c.jsx(bb,{className:"size-3"}),"Import"]}),c.jsx("input",{type:"file",ref:xe,accept:".json",onChange:_,style:{display:"none"}}),c.jsxs(nt,{variant:"outline",size:"sm",onClick:()=>E(!0),className:"gap-1",children:[c.jsx(cb,{className:"size-3"}),"Scan"]}),c.jsxs(nt,{onClick:()=>d(!0),size:"sm",className:"gap-1",children:[c.jsx(no,{className:"size-4"}),"Add Provider"]})]})]}),N!==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:N,children:N}),c.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(N).then(()=>{I(!0),setTimeout(()=>I(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:j?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(pr,{className:"size-4 shrink-0"}),f]}),W.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(nt,{onClick:()=>d(!0),variant:"outline",size:"sm",children:[c.jsx(no,{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(Z=>c.jsx("button",{type:"button",onClick:()=>w(Z),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${D===Z?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:Z==="all"?"All":Z==="personal"?"Personal":"Company"},Z))}),c.jsx("div",{ref:O,className:"space-y-3",children:q.map(Z=>c.jsx(j5,{provider:Z,testResults:Y[Z.id],isTesting:T.has(Z.id),testingTimeLeft:F[Z.id],isHighlighted:Z.id===P,onEdit:B=>p(B),onDelete:ge,onTest:B=>{Q(B)}},Z.id))})]}),c.jsx(w5,{open:U,onOpenChange:E,onImportComplete:()=>{i!==void 0&&i()}})]})}async function B5(e){return ws(e,as.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function U5(){const e=Bc("/api/providers",B5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function Z5(){const[e,t]=v.useState(!1),[n,r]=v.useState("providers"),{providers:o,isLoading:i,mutate:s}=U5(),[a,l]=v.useState({}),[u,d]=v.useState(new Set),[h,p]=v.useState({}),f=v.useCallback((x,g)=>{l(b=>({...b,[x]:g}))},[]),y=v.useCallback((x,g)=>{d(b=>{const k=new Set(b);return g?k.add(x):k.delete(x),k})},[]),m=v.useCallback((x,g)=>{p(b=>{if(g===void 0){const k={...b};return delete k[x],k}return{...b,[x]:g}})},[]);return c.jsxs(pa,{open:e,onOpenChange:t,children:[c.jsx(F3,{asChild:!0,children:c.jsxs(nt,{variant:"ghost",size:"icon",className:"size-8",children:[c.jsx(hb,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Settings"})]})}),c.jsxs(ma,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[c.jsx(ga,{children:c.jsx(xa,{children:"Settings"})}),c.jsxs(jn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[c.jsxs(Nn,{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($5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:u,externalTestingTimeLeft:h,onProvidersMutate:()=>s(),onTestResultsChange:f,onTestingProvidersChange:y,onTestingTimeLeftChange:m})}),c.jsx(Je,{value:"proxy",children:c.jsx(V5,{})})]})]})]})]})}function V5(){const{strip:e,isLoading:t,setStrip:n}=Tu(),[r,o]=v.useState(null),[i,s]=v.useState(!1),a=v.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 W5(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:Dc(i.cacheCreationInputTokens,s.cacheCreationInputTokens),read:Dc(i.cacheReadInputTokens,s.cacheReadInputTokens)})}}return t}function Dc(e,t){return t===null||e===null?null:t>e?{direction:"up",delta:t-e}:t<e?{direction:"down",delta:e-t}:null}const H5="";function sr(e){if(e.length===0)return H5;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 q5(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Mc(e){if(typeof e=="string")try{return yo(JSON.parse(e))}catch{return{kind:"primitive",value:e}}return yo(e)}function yo(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=>yo(t))};if(q5(e)){const t={};for(const n of Object.keys(e).sort())t[n]=yo(e[n]);return{kind:"object",value:t}}return{kind:"primitive",value:null}}function K5(e,t){const n=[];return ls([],e,t,n),n}function ls(e,t,n,r){const o=sr(e);if(cs(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;ls([...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||ls([...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 cs(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||!cs(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||!cs(i,s))return!1}return!0}return!1}function wt(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 Jr(e,t=2){return JSON.stringify(us(e),null,t)}function us(e){switch(e.kind){case"primitive":return e.value;case"array":return e.value.map(us);case"object":{const t={};for(const[n,r]of Object.entries(e.value))t[n]=us(r);return t}}}function Lc(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 Fc(e){return e.kind==="equal"&&(e.value.kind==="object"||e.value.kind==="array")}function G5(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r!==void 0&&Fc(r)){const o=Lc(r.path);let i=n+1;for(;i<e.length;){const s=e[i];if(s===void 0||!Fc(s)||Lc(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:no,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:Cs,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:Es,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:Pv,accent:"text-muted-foreground/70",bg:"bg-muted/20 hover:bg-muted/30",border:"border-l-muted-foreground/20",label:"EQUAL"}};function J5({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:me("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:me("size-3 transition-transform shrink-0",t&&"rotate-90")}),c.jsx(u.icon,{className:me("size-3 shrink-0",u.accent)}),c.jsx("span",{className:"font-mono truncate flex-1",title:`${i} … ${s}`,children:a}),c.jsx("span",{className:me("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:Jr(d.value),defaultExpandDepth:2})]},d.path))})]})}function Y5({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:wt(e.left,400),tone:"text-rose-700 dark:text-rose-300 line-through"},{text:wt(e.right,400),tone:"text-emerald-700 dark:text-emerald-300"}]:e.kind==="removed"?[{text:wt(e.value,400),tone:"text-rose-700 dark:text-rose-300 line-through"}]:e.kind==="added"?[{text:wt(e.value,400),tone:"text-emerald-700 dark:text-emerald-300"}]:[{text:wt(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:me("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:me("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:me("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:me("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:me("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:me("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:me("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(X5,{op:e}):null})]})}function X5({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:Jr(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:Jr(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:Jr(e.right),defaultExpandDepth:2})]})]})}function Q5({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:me("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(Cs,{className:"size-3"}),e.removed," removed"]}),c.jsxs("button",{type:"button",onClick:()=>t("added"),disabled:e.added===0,className:me("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(no,{className:"size-3"}),e.added," added"]}),c.jsxs("button",{type:"button",onClick:()=>t("changed"),disabled:e.changed===0,className:me("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(Es,{className:"size-3"}),e.changed," changed"]})]})}function eT({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:me("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(Fu,{className:"size-3"}),"Unified"]}),c.jsxs("button",{type:"button",onClick:()=>t("split"),"aria-pressed":e==="split",className:me("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(Pu,{className:"size-3"}),"Split"]})]})}function $c({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(tt,{variant:"outline",className:me("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 tT({left:e,right:t,onClose:n}){const r=v.useMemo(()=>{const C=Mc(Ii(e.rawRequestBody)??e.rawRequestBody),j=Mc(Ii(t.rawRequestBody)??t.rawRequestBody);return K5(C,j)},[e.rawRequestBody,t.rawRequestBody]),o=v.useMemo(()=>G5(r),[r]),i=v.useMemo(()=>{let C=0,j=0,I=0;for(const P of o)if(P.kind==="single")switch(P.op.kind){case"added":C++;break;case"removed":j++;break;case"changed":I++;break}return{added:C,removed:j,changed:I}},[o]),[s,a]=v.useState(new Set),l=C=>{a(j=>{const I=new Set(j);return I.has(C)?I.delete(C):I.add(C),I})},[u,d]=v.useState(new Set),h=C=>{d(j=>{const I=new Set(j);return I.has(C)?I.delete(C):I.add(C),I})};v.useEffect(()=>{d(new Set)},[e.id,t.id]);const[p,f]=v.useState("unified"),y=v.useRef(null),[m,x]=v.useState(null),g=v.useRef(null),b=C=>{window.navigator.clipboard.writeText(C).then(()=>{x(C),g.current!==null&&clearTimeout(g.current),g.current=setTimeout(()=>x(null),1500)})};v.useEffect(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);const k=C=>{const j=o.findIndex(M=>M.kind==="single"&&M.op.kind===C);if(j===-1)return;const I=y.current;if(I===null)return;const P=I.querySelector(`[data-diff-idx="${j}"]`);P!==null&&P.scrollIntoView({behavior:"smooth",block:"center"})};v.useEffect(()=>{const C=I=>{I.key==="Escape"&&n()};document.addEventListener("keydown",C);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",C),document.body.style.overflow=j}},[n]);const S=Bn(e)===Bn(t),N=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:me("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($c,{log:e,side:"left"}),c.jsx($c,{log:t,side:"right"})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsx(eT,{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(js,{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."}),N?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(Q5,{counts:i,onJumpTo:k}),c.jsx("div",{ref:y,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,j)=>{if(C.kind==="equal-run")return c.jsx(J5,{ops:C.ops,expanded:s.has(j),onToggle:()=>l(j)},`r${j}`);const I=C.op;return c.jsx(Y5,{op:I,idx:j,copiedPath:m,onCopyPath:b,expanded:u.has(j),onToggle:()=>h(j)},`o${j}`)})}):c.jsx(nT,{grouped:o,left:e,right:t})})]})]})]})}function nT({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:wt(i.value,200)}),c.jsx("span",{className:"font-mono text-xs break-all opacity-60",children:wt(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:["+ ",wt(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:["− ",wt(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:wt(i.left,400)}),c.jsx("div",{className:"font-mono text-emerald-300/90 break-all",children:wt(i.right,400)})]})]},o)})]})}function rT(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function oT(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 iT({command:e}){const[t,n]=v.useState(!1),r=v.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 sT({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}=oT(e),[f,y]=v.useState(!0),[m,x]=v.useState(!1),[g,b]=v.useState([]),[k,S]=v.useState(!1),[N,C]=v.useState(null),j=v.useCallback(async()=>{x(!0);try{await Ob(e)}finally{x(!1)}},[e]),I=v.useRef(null),P=v.useCallback(T=>{b(F=>{if(F.includes(T))return F.filter(A=>A!==T);if(F.length<2)return[...F,T];const $=F[1];return $===void 0?F:[$,T]})},[]);v.useEffect(()=>{b([]),S(!1)},[r,o]);const M=v.useMemo(()=>new Set(g),[g]),U=v.useCallback(()=>{if(g.length!==2)return;const[T,F]=g;if(T===void 0||F===void 0)return;const $=e.find(te=>te.id===T),A=e.find(te=>te.id===F);$===void 0||A===void 0||(C([$,A]),S(!0))},[g,e]),E=v.useCallback(()=>{S(!1)},[]),D=v.useCallback(()=>{b([])},[]),w=v.useMemo(()=>{if(g.length!==2)return null;const[T,F]=g;if(T===void 0||F===void 0)return null;const $=e.find(le=>le.id===T),A=e.find(le=>le.id===F);if($===void 0||A===void 0)return null;const te=Bn($)===Bn(A);let G="";if($.timestamp!==null&&A.timestamp!==null){const le=Date.parse($.timestamp),Q=Date.parse(A.timestamp);if(!Number.isNaN(le)&&!Number.isNaN(Q)){const ce=Math.abs(Q-le);G=O(ce)}}return{logA:$,logB:A,sameSession:te,elapsed:G}},[g,e]);function O(T){if(T<1e3)return`${T}ms`;const F=Math.floor(T/1e3);if(F<60)return`${F}s`;const $=Math.floor(F/60);return $<60?`${$}m`:`${Math.floor($/60)}h${$%60}m`}const J=v.useMemo(()=>CS(e),[e]),W=v.useMemo(()=>W5(J),[J]),q=e.length>0&&f&&!(J.length===1&&J[0]?.logs.length===e.length),Y=zu({count:q?J.length:e.length,getScrollElement:()=>I.current,estimateSize:()=>150,measureElement:typeof window<"u"?T=>T.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(f5,{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",Mb.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(Z5,{}),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:()=>{j()},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(ks,{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(jc,{value:r,onValueChange:i,children:[c.jsx(Tc,{className:"flex-1 max-w-[400px] text-xs",children:c.jsx(Nc,{placeholder:"All sessions"})}),c.jsxs(Ac,{children:[c.jsx(Ur,{value:"__all__",children:"All sessions"}),t.map(T=>c.jsx(Ur,{value:T,children:rT(T)},T))]})]}),c.jsxs(jc,{value:o,onValueChange:s,children:[c.jsx(Tc,{className:"text-xs",children:c.jsx(Nc,{placeholder:"All models"})}),c.jsxs(Ac,{children:[c.jsx(Ur,{value:"__all__",children:"All models"}),n.map(T=>c.jsx(Ur,{value:T,children:T},T))]})]}),c.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[c.jsx("button",{type:"button",onClick:()=>y(!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(qv,{className:"size-4"})}),c.jsx("button",{type:"button",onClick:()=>y(!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(Gv,{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(iT,{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:`${Y.getTotalSize()}px`,width:"100%",position:"relative"},children:Y.getVirtualItems().map(T=>{if(q){const F=J[T.index];return F===void 0?null:c.jsx("div",{"data-index":T.index,ref:Y.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:c.jsx(d5,{group:F,viewMode:l,strip:d,cacheTrends:W,selectedSet:M,onToggleSelect:P})},F.id)}else{const F=e[T.index];return F===void 0?null:c.jsx("div",{"data-index":T.index,ref:Y.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:c.jsx(dp,{log:F,viewMode:l,strip:d,cacheTrend:W.get(F.id)??null,isSelected:M.has(F.id),onToggleSelect:P})},F.id)}})})})}),w!==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(Ou,{className:"size-4 text-amber-400 shrink-0"}),c.jsxs("span",{className:"text-muted-foreground font-mono",children:["#",w.logA.id," ↔ #",w.logB.id," · ",w.sameSession?"same session":"different sessions",w.elapsed!==""&&` · ${w.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(js,{className:"size-3"}),"Clear"]}),c.jsx("button",{type:"button",onClick:U,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"})]}),k&&N!==null&&c.jsx(tT,{left:N[0],right:N[1],onClose:E})]})}ie({logs:ze(zi),total:ve(),offset:ve(),limit:ve()});const aT=Zt([ie({type:Se("init"),logs:ze(zi)}),ie({type:Se("update"),log:zi})]);function lT(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function cT(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function uT(){const[e,t]=v.useState([]),[n,r]=v.useState([]),[o,i]=v.useState([]),[s,a]=v.useState("__all__"),[l,u]=v.useState("__all__"),[d,h]=v.useState("simple"),[p,f]=v.useState(null),y=v.useRef(null),m=v.useRef(null),x=v.useCallback(async()=>{try{const[S,N]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&N.ok){const C=await S.json(),j=await N.json(),I=ze(K()).safeParse(C),P=ze(K()).safeParse(j);I.success&&r(I.data),P.success&&i(P.data)}}catch{}},[]),g=v.useCallback(()=>{y.current&&y.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const N=new EventSource(`/api/logs/stream?${S}`);y.current=N,N.onmessage=C=>{try{const j=String(C.data),I=JSON.parse(j),P=aT.safeParse(I);if(!P.success){f("Failed to parse SSE data");return}const M=P.data;M.type==="init"?(t(M.logs),r(lT(M.logs)),i(cT(M.logs)),f(null)):M.type==="update"&&(t(U=>{const E=s==="__all__"||M.log.sessionId===s,D=l==="__all__"||M.log.model===l;return!E||!D?U:U.findIndex(O=>O.id===M.log.id)>=0?U.map(O=>O.id===M.log.id?M.log:O):[...U,M.log]}),r(U=>{const E=M.log.sessionId;return E!=null&&E!==""?U.includes(E)?U:[...U,E]:U}),i(U=>{const E=M.log.model;return E!=null&&E!==""?U.includes(E)?U:[...U,E]:U}))}catch{f("Failed to parse SSE data")}},N.onerror=()=>{f("SSE connection lost, reconnecting..."),N.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},x()},[s,l,x]);v.useEffect(()=>(g(),()=>{y.current&&(y.current.close(),y.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const b=v.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:k}=Tu();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(sT,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:u,onClearAll:b,viewMode:d,onViewModeChange:h,strip:k})]})}const hT=uT;export{hT as component};
|