@tonyclaw/llm-inspector 1.11.7 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{index-D8CKc4zg.js → index-DVgdkDgq.js} +31 -31
- package/.output/public/assets/index-DZx2yk8v.css +1 -0
- package/.output/public/assets/{main-7LuJWU4Q.js → main-BYCM7aJx.js} +3 -3
- package/.output/server/_libs/lucide-react.mjs +26 -14
- package/.output/server/_ssr/{index-i-uTB3Y3.mjs → index-DhChP_jV.mjs} +82 -18
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-CYFPDggE.mjs → router-PZjNwOcw.mjs} +2 -2
- package/.output/server/{_tanstack-start-manifest_v-jl5h5rzb.mjs → _tanstack-start-manifest_v-l1kWkG0h.mjs} +1 -1
- package/.output/server/index.mjs +25 -25
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +14 -2
- package/src/components/proxy-viewer/ConversationGroup.tsx +8 -0
- package/src/components/proxy-viewer/LogEntry.tsx +8 -0
- package/src/components/proxy-viewer/LogEntryHeader.tsx +32 -0
- package/src/components/proxy-viewer/cacheTrend.ts +50 -0
- package/.output/public/assets/index-DiYqfnSp.css +0 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import{u as pc,a as Wh,r as w,b as dr,c as br,g as qi,j as d,R as nt,d as mc,e as Hh}from"./main-7LuJWU4Q.js";function Y(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const p=u[h];p in a||(a[p]=c[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const c=n?.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Cn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const xc={};function Wt(e){return xc}function yc(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 fi(e,t){return typeof t=="bigint"?t.toString():t}function so(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Gi(e){return e==null}function Ki(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qh(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 Js=Symbol("evaluating");function Ae(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Js)return r===void 0&&(r=Js,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function cn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Ys(e){return JSON.stringify(e)}function Gh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const vc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Kh=so(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function An(e){if(ir(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ir(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function bc(e){return An(e)?{...e}:Array.isArray(e)?[...e]:e}const Jh=new Set(["string","number","symbol"]);function In(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function xe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Yh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Xh={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 Qh(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=Yt(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 cn(this,"shape",s),s},checks:[]});return Xt(e,i)}function ep(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=Yt(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 cn(this,"shape",s),s},checks:[]});return Xt(e,i)}function tp(e,t){if(!An(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=Yt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return cn(this,"shape",i),i}});return Xt(e,o)}function np(e,t){if(!An(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return cn(this,"shape",r),r}});return Xt(e,n)}function rp(e,t){const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return cn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Xt(e,n)}function op(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=Yt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return cn(this,"shape",l),l},checks:[]});return Xt(t,s)}function ip(e,t,n){const r=Yt(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 cn(this,"shape",i),i}});return Xt(t,r)}function wn(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 _n(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function wr(e){return typeof e=="string"?e:e?.message}function Ht(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=wr(e.inst?._zod.def?.error?.(e))??wr(t?.error?.(e))??wr(n.customError?.(e))??wr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ji(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function sr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const wc=(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,fi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_c=Y("$ZodError",wc),kc=Y("$ZodError",wc,{Parent:Error});function sp(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 ap(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 Yi=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 Cn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Ht(l,i,Wt())));throw vc(a,o?.callee),a}return s.value},Xi=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=>Ht(l,i,Wt())));throw vc(a,o?.callee),a}return s.value},ao=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 Cn;return i.issues.length?{success:!1,error:new(e??_c)(i.issues.map(s=>Ht(s,o,Wt())))}:{success:!0,data:i.value}},lp=ao(kc),lo=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=>Ht(s,o,Wt())))}:{success:!0,data:i.value}},cp=lo(kc),up=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yi(e)(t,n,o)},dp=e=>(t,n,r)=>Yi(e)(t,n,r),fp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xi(e)(t,n,o)},hp=e=>async(t,n,r)=>Xi(e)(t,n,r),pp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ao(e)(t,n,o)},mp=e=>(t,n,r)=>ao(e)(t,n,r),gp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lo(e)(t,n,o)},xp=e=>async(t,n,r)=>lo(e)(t,n,r),yp=/^[cC][^\s-]{8,}$/,vp=/^[0-9a-z]+$/,bp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wp=/^[0-9a-vA-V]{20}$/,_p=/^[A-Za-z0-9]{27}$/,kp=/^[a-zA-Z0-9_-]{21}$/,Sp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Cp=/^([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})$/,Xs=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)$/,Ep=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Np="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tp(){return new RegExp(Np,"u")}const jp=/^(?:(?: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])$/,Ap=/^(([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}|:))$/,Ip=/^((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])$/,zp=/^(([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])$/,Pp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sc=/^[A-Za-z0-9_-]*$/,Rp=/^\+[1-9]\d{6,14}$/,Cc="(?:(?:\\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])))",Op=new RegExp(`^${Cc}$`);function Ec(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 Dp(e){return new RegExp(`^${Ec(e)}$`)}function Mp(e){const t=Ec({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(`^${Cc}T(?:${r})$`)}const Lp=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Fp=/^-?\d+$/,Nc=/^-?\d+(?:\.\d+)?$/,$p=/^(?:true|false)$/i,Bp=/^null$/i,Up=/^[^A-Z]*$/,Zp=/^[^a-z]*$/,ot=Y("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tc={number:"number",bigint:"bigint",object:"date"},jc=Y("$ZodCheckLessThan",(e,t)=>{ot.init(e,t);const n=Tc[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ac=Y("$ZodCheckGreaterThan",(e,t)=>{ot.init(e,t);const n=Tc[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})}}),Vp=Y("$ZodCheckMultipleOf",(e,t)=>{ot.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):qh(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})}}),Wp=Y("$ZodCheckNumberFormat",(e,t)=>{ot.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=Xh[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=Fp)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Hp=Y("$ZodCheckMaxLength",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Gi(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=Ji(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),qp=Y("$ZodCheckMinLength",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Gi(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=Ji(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Gp=Y("$ZodCheckLengthEquals",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Gi(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=Ji(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})}}),co=Y("$ZodCheckStringFormat",(e,t)=>{var n,r;ot.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=()=>{})}),Kp=Y("$ZodCheckRegex",(e,t)=>{co.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})}}),Jp=Y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Up),co.init(e,t)}),Yp=Y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Zp),co.init(e,t)}),Xp=Y("$ZodCheckIncludes",(e,t)=>{ot.init(e,t);const n=In(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})}}),Qp=Y("$ZodCheckStartsWith",(e,t)=>{ot.init(e,t);const n=new RegExp(`^${In(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})}}),em=Y("$ZodCheckEndsWith",(e,t)=>{ot.init(e,t);const n=new RegExp(`.*${In(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})}}),tm=Y("$ZodCheckOverwrite",(e,t)=>{ot.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 gc,a as qh,r as w,b as dr,c as br,g as qi,j as d,R as nt,d as xc,e as Gh}from"./main-BYCM7aJx.js";function Y(e,t,n){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const c=s.prototype,u=Object.keys(c);for(let h=0;h<u.length;h++){const p=u[h];p in a||(a[p]=c[p].bind(a))}}const o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const c=n?.Parent?new i:this;r(c,a),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class Cn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class yc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const vc={};function Wt(e){return vc}function bc(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 fi(e,t){return typeof t=="bigint"?t.toString():t}function so(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Gi(e){return e==null}function Ki(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Kh(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 Js=Symbol("evaluating");function Ae(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Js)return r===void 0&&(r=Js,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function cn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Yt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Ys(e){return JSON.stringify(e)}function Jh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wc="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Yh=so(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function An(e){if(ir(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ir(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _c(e){return An(e)?{...e}:Array.isArray(e)?[...e]:e}const Xh=new Set(["string","number","symbol"]);function In(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xt(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function xe(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 Qh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ep={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 tp(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=Yt(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 cn(this,"shape",s),s},checks:[]});return Xt(e,i)}function np(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=Yt(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 cn(this,"shape",s),s},checks:[]});return Xt(e,i)}function rp(e,t){if(!An(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=Yt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return cn(this,"shape",i),i}});return Xt(e,o)}function op(e,t){if(!An(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return cn(this,"shape",r),r}});return Xt(e,n)}function ip(e,t){const n=Yt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return cn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Xt(e,n)}function sp(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=Yt(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(const c in a)l[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return cn(this,"shape",l),l},checks:[]});return Xt(t,s)}function ap(e,t,n){const r=Yt(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 cn(this,"shape",i),i}});return Xt(t,r)}function wn(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 _n(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function wr(e){return typeof e=="string"?e:e?.message}function Ht(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=wr(e.inst?._zod.def?.error?.(e))??wr(t?.error?.(e))??wr(n.customError?.(e))??wr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ji(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function sr(...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,fi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sc=Y("$ZodError",kc),Cc=Y("$ZodError",kc,{Parent:Error});function lp(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 cp(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 Yi=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 Cn;if(s.issues.length){const a=new(o?.Err??e)(s.issues.map(l=>Ht(l,i,Wt())));throw wc(a,o?.callee),a}return s.value},Xi=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=>Ht(l,i,Wt())));throw wc(a,o?.callee),a}return s.value},ao=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 Cn;return i.issues.length?{success:!1,error:new(e??Sc)(i.issues.map(s=>Ht(s,o,Wt())))}:{success:!0,data:i.value}},up=ao(Cc),lo=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=>Ht(s,o,Wt())))}:{success:!0,data:i.value}},dp=lo(Cc),fp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yi(e)(t,n,o)},hp=e=>(t,n,r)=>Yi(e)(t,n,r),pp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xi(e)(t,n,o)},mp=e=>async(t,n,r)=>Xi(e)(t,n,r),gp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ao(e)(t,n,o)},xp=e=>(t,n,r)=>ao(e)(t,n,r),yp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lo(e)(t,n,o)},vp=e=>async(t,n,r)=>lo(e)(t,n,r),bp=/^[cC][^\s-]{8,}$/,wp=/^[0-9a-z]+$/,_p=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kp=/^[0-9a-vA-V]{20}$/,Sp=/^[A-Za-z0-9]{27}$/,Cp=/^[a-zA-Z0-9_-]{21}$/,Ep=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Np=/^([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})$/,Xs=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)$/,Tp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ap(){return new RegExp(jp,"u")}const Ip=/^(?:(?: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])$/,zp=/^(([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}|:))$/,Pp=/^((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])$/,Rp=/^(([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])$/,Op=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ec=/^[A-Za-z0-9_-]*$/,Dp=/^\+[1-9]\d{6,14}$/,Nc="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Mp=new RegExp(`^${Nc}$`);function Tc(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 Lp(e){return new RegExp(`^${Tc(e)}$`)}function Fp(e){const t=Tc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Nc}T(?:${r})$`)}const $p=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Bp=/^-?\d+$/,jc=/^-?\d+(?:\.\d+)?$/,Up=/^(?:true|false)$/i,Zp=/^null$/i,Vp=/^[^A-Z]*$/,Wp=/^[^a-z]*$/,ot=Y("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ac={number:"number",bigint:"bigint",object:"date"},Ic=Y("$ZodCheckLessThan",(e,t)=>{ot.init(e,t);const n=Ac[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})}}),zc=Y("$ZodCheckGreaterThan",(e,t)=>{ot.init(e,t);const n=Ac[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})}}),Hp=Y("$ZodCheckMultipleOf",(e,t)=>{ot.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):Kh(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})}}),qp=Y("$ZodCheckNumberFormat",(e,t)=>{ot.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=ep[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=Bp)}),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})}}),Gp=Y("$ZodCheckMaxLength",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Gi(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=Ji(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Kp=Y("$ZodCheckMinLength",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Gi(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=Ji(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Jp=Y("$ZodCheckLengthEquals",(e,t)=>{var n;ot.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Gi(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=Ji(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})}}),co=Y("$ZodCheckStringFormat",(e,t)=>{var n,r;ot.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=()=>{})}),Yp=Y("$ZodCheckRegex",(e,t)=>{co.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xp=Y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Vp),co.init(e,t)}),Qp=Y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Wp),co.init(e,t)}),em=Y("$ZodCheckIncludes",(e,t)=>{ot.init(e,t);const n=In(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})}}),tm=Y("$ZodCheckStartsWith",(e,t)=>{ot.init(e,t);const n=new RegExp(`^${In(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})}}),nm=Y("$ZodCheckEndsWith",(e,t)=>{ot.init(e,t);const n=new RegExp(`.*${In(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})}}),rm=Y("$ZodCheckOverwrite",(e,t)=>{ot.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class om{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 im={major:4,minor:3,patch:6},Le=Y("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=im;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const i of o._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,a,l)=>{let c=wn(s),u;for(const h of a){if(h._zod.def.when){if(!h._zod.def.when(s))continue}else if(c)continue;const p=s.issues.length,f=h._zod.check(s);if(f instanceof Promise&&l?.async===!1)throw new Cn;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,s.issues.length!==p&&(c||(c=wn(s,p)))});else{if(s.issues.length===p)continue;c||(c=wn(s,p))}}return u?u.then(()=>s):s},i=(s,a,l)=>{if(wn(s))return s.aborted=!0,s;const c=o(a,r,l);if(c instanceof Promise){if(l.async===!1)throw new Cn;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){const c=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(u=>i(u,s,a)):i(c,s,a)}const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new Cn;return l.then(c=>o(c,r,a))}return o(l,r,a)}}Ae(e,"~standard",()=>({validate:o=>{try{const i=up(e,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return dp(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Qi=Y("$ZodString",(e,t)=>{Le.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$p(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=Y("$ZodStringFormat",(e,t)=>{co.init(e,t),Qi.init(e,t)}),sm=Y("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Np),$e.init(e,t)}),am=Y("$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=Xs(r))}else t.pattern??(t.pattern=Xs());$e.init(e,t)}),lm=Y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Tp),$e.init(e,t)}),cm=Y("$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})}}}),um=Y("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ap()),$e.init(e,t)}),dm=Y("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Cp),$e.init(e,t)}),fm=Y("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bp),$e.init(e,t)}),hm=Y("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=wp),$e.init(e,t)}),pm=Y("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_p),$e.init(e,t)}),mm=Y("$ZodXID",(e,t)=>{t.pattern??(t.pattern=kp),$e.init(e,t)}),gm=Y("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Sp),$e.init(e,t)}),xm=Y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Fp(t)),$e.init(e,t)}),ym=Y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Mp),$e.init(e,t)}),vm=Y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Lp(t)),$e.init(e,t)}),bm=Y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ep),$e.init(e,t)}),wm=Y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ip),$e.init(e,t),e._zod.bag.format="ipv4"}),_m=Y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zp),$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})}}}),km=Y("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Pp),$e.init(e,t)}),Sm=Y("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Rp),$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 Pc(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Cm=Y("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Op),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Pc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Em(e){if(!Ec.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Pc(n)}const Nm=Y("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ec),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Em(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Tm=Y("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dp),$e.init(e,t)});function jm(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 Am=Y("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=n=>{jm(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Rc=Y("$ZodNumber",(e,t)=>{Le.init(e,t),e._zod.pattern=e._zod.bag.pattern??jc,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}}),Im=Y("$ZodNumberFormat",(e,t)=>{qp.init(e,t),Rc.init(e,t)}),zm=Y("$ZodBoolean",(e,t)=>{Le.init(e,t),e._zod.pattern=Up,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}}),Pm=Y("$ZodNull",(e,t)=>{Le.init(e,t),e._zod.pattern=Zp,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}}),Rm=Y("$ZodUnknown",(e,t)=>{Le.init(e,t),e._zod.parse=n=>n}),Om=Y("$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 Qs(e,t,n){e.issues.length&&t.issues.push(..._n(n,e.issues)),t.value[n]=e.value}const Dm=Y("$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(c=>Qs(c,n,s))):Qs(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function Zr(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(..._n(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Oc(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=Qh(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dc(e,t,n,r,o,i){const s=[],a=o.keySet,l=o.catchall._zod,c=l.def.type,u=l.optout==="optional";for(const h in t){if(a.has(h))continue;if(c==="never"){s.push(h);continue}const p=l.run({value:t[h],issues:[]},r);p instanceof Promise?e.push(p.then(f=>Zr(f,n,h,t,u))):Zr(p,n,h,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const Mm=Y("$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=so(()=>Oc(t));Ae(e._zod,"propValues",()=>{const a=t.shape,l={};for(const c in a){const u=a[c]._zod;if(u.values){l[c]??(l[c]=new Set);for(const h of u.values)l[c].add(h)}}return l});const o=ir,i=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};const u=[],h=s.shape;for(const p of s.keys){const f=h[p],x=f._zod.optout==="optional",m=f._zod.run({value:c[p],issues:[]},l);m instanceof Promise?u.push(m.then(y=>Zr(y,a,p,c,x))):Zr(m,a,p,c,x)}return i?Dc(u,c,a,l,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),Lm=Y("$ZodObjectJIT",(e,t)=>{Mm.init(e,t);const n=e._zod.parse,r=so(()=>Oc(t)),o=p=>{const f=new om(["shape","payload","ctx"]),x=r.value,m=k=>{const S=Ys(k);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};f.write("const input = payload.value;");const y=Object.create(null);let g=0;for(const k of x.keys)y[k]=`key_${g++}`;f.write("const newResult = {};");for(const k of x.keys){const S=y[k],E=Ys(k),T=p[k]?._zod?.optout==="optional";f.write(`const ${S} = ${m(k)};`),T?f.write(`
|
|
4
4
|
if (${S}.issues.length) {
|
|
5
|
-
if (${
|
|
5
|
+
if (${E} in input) {
|
|
6
6
|
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
7
7
|
...iss,
|
|
8
|
-
path: iss.path ? [${
|
|
8
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
9
9
|
})));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
if (${S}.value === undefined) {
|
|
14
|
-
if (${
|
|
15
|
-
newResult[${
|
|
14
|
+
if (${E} in input) {
|
|
15
|
+
newResult[${E}] = undefined;
|
|
16
16
|
}
|
|
17
17
|
} else {
|
|
18
|
-
newResult[${
|
|
18
|
+
newResult[${E}] = ${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 ? [${E}, ...iss.path] : [${E}]
|
|
26
26
|
})));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
if (${S}.value === undefined) {
|
|
30
|
-
if (${
|
|
31
|
-
newResult[${
|
|
30
|
+
if (${E} in input) {
|
|
31
|
+
newResult[${E}] = undefined;
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
|
-
newResult[${
|
|
34
|
+
newResult[${E}] = ${S}.value;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");const v=f.compile();return(k,S)=>v(p,k,S)};let i;const s=ir,a=!xc.jitless,c=a&&Kh.value,u=t.catchall;let h;e._zod.parse=(p,f)=>{h??(h=r.value);const x=p.value;return s(x)?a&&c&&f?.async===!1&&f.jitless!==!0?(i||(i=o(t.shape)),p=i(p,f),u?Rc([],x,p,f,h,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function ea(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=>!wn(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=>Ht(s,r,Wt())))}),t)}const Oc=Y("$ZodUnion",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ae(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ae(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ae(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ki(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>ea(l,o,e,i)):ea(a,o,e,i)}}),Mm=Y("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Oc.init(e,t);const n=e._zod.parse;Ae(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const c of l)o[a].add(c)}}return o});const r=so(()=>{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(!ir(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)}}),Lm=Y("$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,c])=>ta(n,l,c)):ta(n,i,s)}});function hi(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(An(e)&&An(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=hi(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=hi(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 ta(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}),wn(e))return e;const s=hi(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 Fm=Y("$ZodRecord",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!An(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},r);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&n.issues.push(..._n(c,h.issues)),n.value[c]=h.value})):(u.issues.length&&n.issues.push(..._n(c,u.issues)),n.value[c]=u.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Nc.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=>Ht(h,r,Wt())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:o[a],issues:[]},r);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&n.issues.push(..._n(a,h.issues)),n.value[l.value]=h.value})):(u.issues.length&&n.issues.push(..._n(a,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),$m=Y("$ZodEnum",(e,t)=>{Le.init(e,t);const n=yc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Jh.has(typeof o)).map(o=>typeof o=="string"?In(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}}),Bm=Y("$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"?In(r):r?In(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Um=Y("$ZodTransform",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new gc(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 Cn;return n.value=o,n}});function na(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Dc=Y("$ZodOptional",(e,t)=>{Le.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ki(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=>na(i,n.value)):na(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Zm=Y("$ZodExactOptional",(e,t)=>{Dc.init(e,t),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Vm=Y("$ZodNullable",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ki(n.source)}|null)$`):void 0}),Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Wm=Y("$ZodDefault",(e,t)=>{Le.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ra(i,t)):ra(o,t)}});function ra(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Hm=Y("$ZodPrefault",(e,t)=>{Le.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),qm=Y("$ZodNonOptional",(e,t)=>{Le.init(e,t),Ae(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>oa(i,e)):oa(o,e)}});function oa(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Gm=Y("$ZodCatch",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ht(s,r,Wt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Ht(i,r,Wt()))},input:n.value}),n.issues=[]),n)}}),Km=Y("$ZodPipe",(e,t)=>{Le.init(e,t),Ae(e._zod,"values",()=>t.in._zod.values),Ae(e._zod,"optin",()=>t.in._zod.optin),Ae(e._zod,"optout",()=>t.out._zod.optout),Ae(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>_r(s,t.in,r)):_r(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>_r(i,t.out,r)):_r(o,t.out,r)}});function _r(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Jm=Y("$ZodReadonly",(e,t)=>{Le.init(e,t),Ae(e._zod,"propValues",()=>t.innerType._zod.propValues),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"optin",()=>t.innerType?._zod?.optin),Ae(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ia):ia(o)}});function ia(e){return e.value=Object.freeze(e.value),e}const Ym=Y("$ZodLazy",(e,t)=>{Le.init(e,t),Ae(e._zod,"innerType",()=>t.getter()),Ae(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ae(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ae(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ae(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),Xm=Y("$ZodCustom",(e,t)=>{ot.init(e,t),Le.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>sa(i,n,r,e));sa(o,n,r,e)}});function sa(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(sr(o))}}var aa;class Qm{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 eg(){return new Qm}(aa=globalThis).__zod_globalRegistry??(aa.__zod_globalRegistry=eg());const er=globalThis.__zod_globalRegistry;function tg(e,t){return new e({type:"string",...xe(t)})}function ng(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...xe(t)})}function la(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...xe(t)})}function rg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(t)})}function og(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(t)})}function ig(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(t)})}function sg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(t)})}function ag(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...xe(t)})}function lg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(t)})}function cg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(t)})}function ug(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(t)})}function dg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(t)})}function fg(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(t)})}function hg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...xe(t)})}function pg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(t)})}function mg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(t)})}function gg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(t)})}function xg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(t)})}function yg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(t)})}function vg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...xe(t)})}function bg(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(t)})}function wg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...xe(t)})}function _g(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(t)})}function kg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(t)})}function Sg(e,t){return new e({type:"string",format:"date",check:"string_format",...xe(t)})}function Cg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...xe(t)})}function Eg(e,t){return new e({type:"string",format:"duration",check:"string_format",...xe(t)})}function Ng(e,t){return new e({type:"number",checks:[],...xe(t)})}function Tg(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(t)})}function jg(e,t){return new e({type:"boolean",...xe(t)})}function Ag(e,t){return new e({type:"null",...xe(t)})}function Ig(e){return new e({type:"unknown"})}function zg(e,t){return new e({type:"never",...xe(t)})}function ca(e,t){return new jc({check:"less_than",...xe(t),value:e,inclusive:!1})}function Ro(e,t){return new jc({check:"less_than",...xe(t),value:e,inclusive:!0})}function ua(e,t){return new Ac({check:"greater_than",...xe(t),value:e,inclusive:!1})}function Oo(e,t){return new Ac({check:"greater_than",...xe(t),value:e,inclusive:!0})}function da(e,t){return new Vp({check:"multiple_of",...xe(t),value:e})}function Mc(e,t){return new Hp({check:"max_length",...xe(t),maximum:e})}function Vr(e,t){return new qp({check:"min_length",...xe(t),minimum:e})}function Lc(e,t){return new Gp({check:"length_equals",...xe(t),length:e})}function Pg(e,t){return new Kp({check:"string_format",format:"regex",...xe(t),pattern:e})}function Rg(e){return new Jp({check:"string_format",format:"lowercase",...xe(e)})}function Og(e){return new Yp({check:"string_format",format:"uppercase",...xe(e)})}function Dg(e,t){return new Xp({check:"string_format",format:"includes",...xe(t),includes:e})}function Mg(e,t){return new Qp({check:"string_format",format:"starts_with",...xe(t),prefix:e})}function Lg(e,t){return new em({check:"string_format",format:"ends_with",...xe(t),suffix:e})}function Ln(e){return new tm({check:"overwrite",tx:e})}function Fg(e){return Ln(t=>t.normalize(e))}function $g(){return Ln(e=>e.trim())}function Bg(){return Ln(e=>e.toLowerCase())}function Ug(){return Ln(e=>e.toUpperCase())}function Zg(){return Ln(e=>Gh(e))}function Vg(e,t,n){return new e({type:"array",element:t,...xe(n)})}function Wg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...xe(n)})}function Hg(e){const t=qg(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(sr(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(sr(o))}},e(n.value,n)));return t}function qg(e,t){const n=new ot({check:"custom",...xe(t)});return n._zod.check=e,n}function Fc(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??er,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ve(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{const p=s.schema,f=t.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(e,t,p,u)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),Ve(h,t,u),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Xe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function $c(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,p=e.external.uri??(x=>x);if(h)return{ref:p(h)};const f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===n)return{ref:"#"};const c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const u=a.schema;for(const h in u)delete u[h];u.$ref=l};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
37
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");const v=f.compile();return(k,S)=>v(p,k,S)};let i;const s=ir,a=!vc.jitless,c=a&&Yh.value,u=t.catchall;let h;e._zod.parse=(p,f)=>{h??(h=r.value);const x=p.value;return s(x)?a&&c&&f?.async===!1&&f.jitless!==!0?(i||(i=o(t.shape)),p=i(p,f),u?Dc([],x,p,f,h,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function ea(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=>!wn(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=>Ht(s,r,Wt())))}),t)}const Mc=Y("$ZodUnion",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Ae(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ae(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Ae(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>Ki(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(l=>ea(l,o,e,i)):ea(a,o,e,i)}}),Fm=Y("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Mc.init(e,t);const n=e._zod.parse;Ae(e._zod,"propValues",()=>{const o={};for(const i of t.options){const s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,l]of Object.entries(s)){o[a]||(o[a]=new Set);for(const c of l)o[a].add(c)}}return o});const r=so(()=>{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(!ir(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)}}),$m=Y("$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,c])=>ta(n,l,c)):ta(n,i,s)}});function hi(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(An(e)&&An(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=hi(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=hi(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 ta(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}),wn(e))return e;const s=hi(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 Bm=Y("$ZodRecord",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!An(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);const u=t.valueType._zod.run({value:o[c],issues:[]},r);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&n.issues.push(..._n(c,h.issues)),n.value[c]=h.value})):(u.issues.length&&n.issues.push(..._n(c,u.issues)),n.value[c]=u.value)}let l;for(const c in o)a.has(c)||(l=l??[],l.push(c));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&jc.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=>Ht(h,r,Wt())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:o[a],issues:[]},r);u instanceof Promise?i.push(u.then(h=>{h.issues.length&&n.issues.push(..._n(a,h.issues)),n.value[l.value]=h.value})):(u.issues.length&&n.issues.push(..._n(a,u.issues)),n.value[l.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Um=Y("$ZodEnum",(e,t)=>{Le.init(e,t);const n=bc(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Xh.has(typeof o)).map(o=>typeof o=="string"?In(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}}),Zm=Y("$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"?In(r):r?In(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}}),Vm=Y("$ZodTransform",(e,t)=>{Le.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new yc(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 Cn;return n.value=o,n}});function na(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Lc=Y("$ZodOptional",(e,t)=>{Le.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ki(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=>na(i,n.value)):na(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Wm=Y("$ZodExactOptional",(e,t)=>{Lc.init(e,t),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Hm=Y("$ZodNullable",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ki(n.source)}|null)$`):void 0}),Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),qm=Y("$ZodDefault",(e,t)=>{Le.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>ra(i,t)):ra(o,t)}});function ra(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gm=Y("$ZodPrefault",(e,t)=>{Le.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Km=Y("$ZodNonOptional",(e,t)=>{Le.init(e,t),Ae(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>oa(i,e)):oa(o,e)}});function oa(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 Jm=Y("$ZodCatch",(e,t)=>{Le.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Ht(s,r,Wt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>Ht(i,r,Wt()))},input:n.value}),n.issues=[]),n)}}),Ym=Y("$ZodPipe",(e,t)=>{Le.init(e,t),Ae(e._zod,"values",()=>t.in._zod.values),Ae(e._zod,"optin",()=>t.in._zod.optin),Ae(e._zod,"optout",()=>t.out._zod.optout),Ae(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(s=>_r(s,t.in,r)):_r(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>_r(i,t.out,r)):_r(o,t.out,r)}});function _r(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Xm=Y("$ZodReadonly",(e,t)=>{Le.init(e,t),Ae(e._zod,"propValues",()=>t.innerType._zod.propValues),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"optin",()=>t.innerType?._zod?.optin),Ae(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(ia):ia(o)}});function ia(e){return e.value=Object.freeze(e.value),e}const Qm=Y("$ZodLazy",(e,t)=>{Le.init(e,t),Ae(e._zod,"innerType",()=>t.getter()),Ae(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ae(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ae(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ae(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),eg=Y("$ZodCustom",(e,t)=>{ot.init(e,t),Le.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>sa(i,n,r,e));sa(o,n,r,e)}});function sa(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(sr(o))}}var aa;class tg{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 ng(){return new tg}(aa=globalThis).__zod_globalRegistry??(aa.__zod_globalRegistry=ng());const er=globalThis.__zod_globalRegistry;function rg(e,t){return new e({type:"string",...xe(t)})}function og(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...xe(t)})}function la(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...xe(t)})}function ig(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(t)})}function sg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(t)})}function ag(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(t)})}function lg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(t)})}function cg(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...xe(t)})}function ug(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(t)})}function dg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(t)})}function fg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(t)})}function hg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(t)})}function pg(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(t)})}function mg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...xe(t)})}function gg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(t)})}function xg(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(t)})}function yg(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(t)})}function vg(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(t)})}function bg(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(t)})}function wg(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...xe(t)})}function _g(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(t)})}function kg(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...xe(t)})}function Sg(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(t)})}function Cg(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(t)})}function Eg(e,t){return new e({type:"string",format:"date",check:"string_format",...xe(t)})}function Ng(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...xe(t)})}function Tg(e,t){return new e({type:"string",format:"duration",check:"string_format",...xe(t)})}function jg(e,t){return new e({type:"number",checks:[],...xe(t)})}function Ag(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(t)})}function Ig(e,t){return new e({type:"boolean",...xe(t)})}function zg(e,t){return new e({type:"null",...xe(t)})}function Pg(e){return new e({type:"unknown"})}function Rg(e,t){return new e({type:"never",...xe(t)})}function ca(e,t){return new Ic({check:"less_than",...xe(t),value:e,inclusive:!1})}function Ro(e,t){return new Ic({check:"less_than",...xe(t),value:e,inclusive:!0})}function ua(e,t){return new zc({check:"greater_than",...xe(t),value:e,inclusive:!1})}function Oo(e,t){return new zc({check:"greater_than",...xe(t),value:e,inclusive:!0})}function da(e,t){return new Hp({check:"multiple_of",...xe(t),value:e})}function Fc(e,t){return new Gp({check:"max_length",...xe(t),maximum:e})}function Vr(e,t){return new Kp({check:"min_length",...xe(t),minimum:e})}function $c(e,t){return new Jp({check:"length_equals",...xe(t),length:e})}function Og(e,t){return new Yp({check:"string_format",format:"regex",...xe(t),pattern:e})}function Dg(e){return new Xp({check:"string_format",format:"lowercase",...xe(e)})}function Mg(e){return new Qp({check:"string_format",format:"uppercase",...xe(e)})}function Lg(e,t){return new em({check:"string_format",format:"includes",...xe(t),includes:e})}function Fg(e,t){return new tm({check:"string_format",format:"starts_with",...xe(t),prefix:e})}function $g(e,t){return new nm({check:"string_format",format:"ends_with",...xe(t),suffix:e})}function Ln(e){return new rm({check:"overwrite",tx:e})}function Bg(e){return Ln(t=>t.normalize(e))}function Ug(){return Ln(e=>e.trim())}function Zg(){return Ln(e=>e.toLowerCase())}function Vg(){return Ln(e=>e.toUpperCase())}function Wg(){return Ln(e=>Jh(e))}function Hg(e,t,n){return new e({type:"array",element:t,...xe(n)})}function qg(e,t,n){return new e({type:"custom",check:"custom",fn:t,...xe(n)})}function Gg(e){const t=Kg(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(sr(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(sr(o))}},e(n.value,n)));return t}function Kg(e,t){const n=new ot({check:"custom",...xe(t)});return n._zod.check=e,n}function Bc(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??er,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ve(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,u);else{const p=s.schema,f=t.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(e,t,p,u)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),Ve(h,t,u),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Xe(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Uc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const s of e.seen.entries()){const a=e.metadataRegistry.get(s[0])?.id;if(a){const l=r.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}const o=s=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(s[0])?.id,p=e.external.uri??(x=>x);if(h)return{ref:p(h)};const f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(s[1]===n)return{ref:"#"};const c=`#/${a}/`,u=s[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:c+u}},i=s=>{if(s[1].schema.$ref)return;const a=s[1],{ref:l,defId:c}=o(s);a.def={...a.schema},c&&(a.defId=c);const u=a.schema;for(const h in u)delete u[h];u.$ref=l};if(e.cycles==="throw")for(const s of e.seen.entries()){const a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
38
|
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Bc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const a=e.seen.get(s);if(a.ref===null)return;const l=a.def??a.schema,c={...l},u=a.ref;if(a.ref=null,u){r(u);const p=e.seen.get(u),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,c),s._zod.parent===u)for(const m in l)m==="$ref"||m==="allOf"||m in c||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!==u){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:Wr(t,"input",e.processors),output:Wr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Xe(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Xe(r.element,n);if(r.type==="set")return Xe(r.valueType,n);if(r.type==="lazy")return Xe(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Xe(r.innerType,n);if(r.type==="intersection")return Xe(r.left,n)||Xe(r.right,n);if(r.type==="record"||r.type==="map")return Xe(r.keyType,n)||Xe(r.valueType,n);if(r.type==="pipe")return Xe(r.in,n)||Xe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Xe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Xe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Xe(o,n))return!0;return!!(r.rest&&Xe(r.rest,n))}return!1}const Gg=(e,t={})=>n=>{const r=Fc({...n,processors:t});return Ve(e,r),$c(r,e),Bc(r,e)},Wr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=Fc({...o??{},target:i,io:t,processors:n});return Ve(e,s),$c(s,e),Bc(s,e)},Kg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Jg=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Kg[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Yg=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof s=="number"&&(o.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},Xg=(e,t,n,r)=>{n.type="boolean"},Qg=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},e0=(e,t,n,r)=>{n.not={}},t0=(e,t,n,r)=>{},n0=(e,t,n,r)=>{const o=e._zod.def,i=yc(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},r0=(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},o0=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},i0=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},s0=(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"]})},a0=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const c in s)o.properties[c]=Ve(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Ve(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},l0=(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},c0=(e,t,n,r)=>{const o=e._zod.def,i=Ve(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ve(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},u0=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=Ve(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of l)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ve(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Ve(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},d0=(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"}]},f0=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},h0=(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))},p0=(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)))},m0=(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},g0=(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},x0=(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},Uc=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},y0=(e,t,n,r)=>{const o=e._zod.innerType;Ve(o,t,r);const i=t.seen.get(e);i.ref=o},v0=Y("ZodISODateTime",(e,t)=>{mm.init(e,t),Ue.init(e,t)});function b0(e){return kg(v0,e)}const w0=Y("ZodISODate",(e,t)=>{gm.init(e,t),Ue.init(e,t)});function _0(e){return Sg(w0,e)}const k0=Y("ZodISOTime",(e,t)=>{xm.init(e,t),Ue.init(e,t)});function S0(e){return Cg(k0,e)}const C0=Y("ZodISODuration",(e,t)=>{ym.init(e,t),Ue.init(e,t)});function E0(e){return Eg(C0,e)}const N0=(e,t)=>{_c.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>ap(e,n)},flatten:{value:n=>sp(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,fi,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,fi,2)}},isEmpty:{get(){return e.issues.length===0}}})},pt=Y("ZodError",N0,{Parent:Error}),T0=Yi(pt),j0=Xi(pt),A0=ao(pt),I0=lo(pt),z0=up(pt),P0=dp(pt),R0=fp(pt),O0=hp(pt),D0=pp(pt),M0=mp(pt),L0=gp(pt),F0=xp(pt),Fe=Y("ZodType",(e,t)=>(Le.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Wr(e,"input"),output:Wr(e,"output")}}),e.toJSONSchema=Gg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Yt(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)=>Xt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>T0(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>A0(e,n,r),e.parseAsync=async(n,r)=>j0(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>I0(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>z0(e,n,r),e.decode=(n,r)=>P0(e,n,r),e.encodeAsync=async(n,r)=>R0(e,n,r),e.decodeAsync=async(n,r)=>O0(e,n,r),e.safeEncode=(n,r)=>D0(e,n,r),e.safeDecode=(n,r)=>M0(e,n,r),e.safeEncodeAsync=async(n,r)=>L0(e,n,r),e.safeDecodeAsync=async(n,r)=>F0(e,n,r),e.refine=(n,r)=>e.check(Ox(n,r)),e.superRefine=n=>e.check(Dx(n)),e.overwrite=n=>e.check(Ln(n)),e.optional=()=>ma(e),e.exactOptional=()=>bx(e),e.nullable=()=>ga(e),e.nullish=()=>ma(ga(e)),e.nonoptional=n=>Ex(e,n),e.array=()=>Me(e),e.or=n=>$t([e,n]),e.and=n=>px(e,n),e.transform=n=>xa(e,yx(n)),e.default=n=>kx(e,n),e.prefault=n=>Cx(e,n),e.catch=n=>Tx(e,n),e.pipe=n=>xa(e,n),e.readonly=()=>Ix(e),e.describe=n=>{const r=e.clone();return er.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return er.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return er.get(e);const r=e.clone();return er.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Zc=Y("_ZodString",(e,t)=>{Qi.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Jg(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(Pg(...r)),e.includes=(...r)=>e.check(Dg(...r)),e.startsWith=(...r)=>e.check(Mg(...r)),e.endsWith=(...r)=>e.check(Lg(...r)),e.min=(...r)=>e.check(Vr(...r)),e.max=(...r)=>e.check(Mc(...r)),e.length=(...r)=>e.check(Lc(...r)),e.nonempty=(...r)=>e.check(Vr(1,...r)),e.lowercase=r=>e.check(Rg(r)),e.uppercase=r=>e.check(Og(r)),e.trim=()=>e.check($g()),e.normalize=(...r)=>e.check(Fg(...r)),e.toLowerCase=()=>e.check(Bg()),e.toUpperCase=()=>e.check(Ug()),e.slugify=()=>e.check(Zg())}),$0=Y("ZodString",(e,t)=>{Qi.init(e,t),Zc.init(e,t),e.email=n=>e.check(ng(B0,n)),e.url=n=>e.check(ag(U0,n)),e.jwt=n=>e.check(_g(rx,n)),e.emoji=n=>e.check(lg(Z0,n)),e.guid=n=>e.check(la(fa,n)),e.uuid=n=>e.check(rg(kr,n)),e.uuidv4=n=>e.check(og(kr,n)),e.uuidv6=n=>e.check(ig(kr,n)),e.uuidv7=n=>e.check(sg(kr,n)),e.nanoid=n=>e.check(cg(V0,n)),e.guid=n=>e.check(la(fa,n)),e.cuid=n=>e.check(ug(W0,n)),e.cuid2=n=>e.check(dg(H0,n)),e.ulid=n=>e.check(fg(q0,n)),e.base64=n=>e.check(vg(ex,n)),e.base64url=n=>e.check(bg(tx,n)),e.xid=n=>e.check(hg(G0,n)),e.ksuid=n=>e.check(pg(K0,n)),e.ipv4=n=>e.check(mg(J0,n)),e.ipv6=n=>e.check(gg(Y0,n)),e.cidrv4=n=>e.check(xg(X0,n)),e.cidrv6=n=>e.check(yg(Q0,n)),e.e164=n=>e.check(wg(nx,n)),e.datetime=n=>e.check(b0(n)),e.date=n=>e.check(_0(n)),e.time=n=>e.check(S0(n)),e.duration=n=>e.check(E0(n))});function G(e){return tg($0,e)}const Ue=Y("ZodStringFormat",(e,t)=>{$e.init(e,t),Zc.init(e,t)}),B0=Y("ZodEmail",(e,t)=>{sm.init(e,t),Ue.init(e,t)}),fa=Y("ZodGUID",(e,t)=>{om.init(e,t),Ue.init(e,t)}),kr=Y("ZodUUID",(e,t)=>{im.init(e,t),Ue.init(e,t)}),U0=Y("ZodURL",(e,t)=>{am.init(e,t),Ue.init(e,t)}),Z0=Y("ZodEmoji",(e,t)=>{lm.init(e,t),Ue.init(e,t)}),V0=Y("ZodNanoID",(e,t)=>{cm.init(e,t),Ue.init(e,t)}),W0=Y("ZodCUID",(e,t)=>{um.init(e,t),Ue.init(e,t)}),H0=Y("ZodCUID2",(e,t)=>{dm.init(e,t),Ue.init(e,t)}),q0=Y("ZodULID",(e,t)=>{fm.init(e,t),Ue.init(e,t)}),G0=Y("ZodXID",(e,t)=>{hm.init(e,t),Ue.init(e,t)}),K0=Y("ZodKSUID",(e,t)=>{pm.init(e,t),Ue.init(e,t)}),J0=Y("ZodIPv4",(e,t)=>{vm.init(e,t),Ue.init(e,t)}),Y0=Y("ZodIPv6",(e,t)=>{bm.init(e,t),Ue.init(e,t)}),X0=Y("ZodCIDRv4",(e,t)=>{wm.init(e,t),Ue.init(e,t)}),Q0=Y("ZodCIDRv6",(e,t)=>{_m.init(e,t),Ue.init(e,t)}),ex=Y("ZodBase64",(e,t)=>{km.init(e,t),Ue.init(e,t)}),tx=Y("ZodBase64URL",(e,t)=>{Cm.init(e,t),Ue.init(e,t)}),nx=Y("ZodE164",(e,t)=>{Em.init(e,t),Ue.init(e,t)}),rx=Y("ZodJWT",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),Vc=Y("ZodNumber",(e,t)=>{zc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Yg(e,r,o),e.gt=(r,o)=>e.check(ua(r,o)),e.gte=(r,o)=>e.check(Oo(r,o)),e.min=(r,o)=>e.check(Oo(r,o)),e.lt=(r,o)=>e.check(ca(r,o)),e.lte=(r,o)=>e.check(Ro(r,o)),e.max=(r,o)=>e.check(Ro(r,o)),e.int=r=>e.check(ha(r)),e.safe=r=>e.check(ha(r)),e.positive=r=>e.check(ua(0,r)),e.nonnegative=r=>e.check(Oo(0,r)),e.negative=r=>e.check(ca(0,r)),e.nonpositive=r=>e.check(Ro(0,r)),e.multipleOf=(r,o)=>e.check(da(r,o)),e.step=(r,o)=>e.check(da(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ye(e){return Ng(Vc,e)}const ox=Y("ZodNumberFormat",(e,t)=>{jm.init(e,t),Vc.init(e,t)});function ha(e){return Tg(ox,e)}const ix=Y("ZodBoolean",(e,t)=>{Am.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xg(e,n,r)});function et(e){return jg(ix,e)}const sx=Y("ZodNull",(e,t)=>{Im.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qg(e,n,r)});function pi(e){return Ag(sx,e)}const ax=Y("ZodUnknown",(e,t)=>{zm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>t0()});function pa(){return Ig(ax)}const lx=Y("ZodNever",(e,t)=>{Pm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>e0(e,n,r)});function cx(e){return zg(lx,e)}const ux=Y("ZodArray",(e,t)=>{Rm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>s0(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Vr(n,r)),e.nonempty=n=>e.check(Vr(1,n)),e.max=(n,r)=>e.check(Mc(n,r)),e.length=(n,r)=>e.check(Lc(n,r)),e.unwrap=()=>e.element});function Me(e,t){return Vg(ux,e,t)}const dx=Y("ZodObject",(e,t)=>{Dm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>a0(e,n,r,o),Ae(e,"shape",()=>t.shape),e.keyof=()=>jt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:pa()}),e.loose=()=>e.clone({...e._zod.def,catchall:pa()}),e.strict=()=>e.clone({...e._zod.def,catchall:cx()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tp(e,n),e.safeExtend=n=>np(e,n),e.merge=n=>rp(e,n),e.pick=n=>Qh(e,n),e.omit=n=>ep(e,n),e.partial=(...n)=>op(Hc,e,n[0]),e.required=(...n)=>ip(qc,e,n[0])});function ce(e,t){const n={type:"object",shape:e??{},...xe(t)};return new dx(n)}const Wc=Y("ZodUnion",(e,t)=>{Oc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>l0(e,n,r,o),e.options=t.options});function $t(e,t){return new Wc({type:"union",options:e,...xe(t)})}const fx=Y("ZodDiscriminatedUnion",(e,t)=>{Wc.init(e,t),Mm.init(e,t)});function un(e,t,n){return new fx({type:"union",options:t,discriminator:e,...xe(n)})}const hx=Y("ZodIntersection",(e,t)=>{Lm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>c0(e,n,r,o)});function px(e,t){return new hx({type:"intersection",left:e,right:t})}const mx=Y("ZodRecord",(e,t)=>{Fm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>u0(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function qt(e,t,n){return new mx({type:"record",keyType:e,valueType:t,...xe(n)})}const mi=Y("ZodEnum",(e,t)=>{$m.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>n0(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 mi({...t,checks:[],...xe(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 mi({...t,checks:[],...xe(o),entries:i})}});function jt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new mi({type:"enum",entries:n,...xe(t)})}const gx=Y("ZodLiteral",(e,t)=>{Bm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>r0(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Te(e,t){return new gx({type:"literal",values:Array.isArray(e)?e:[e],...xe(t)})}const xx=Y("ZodTransform",(e,t)=>{Um.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>i0(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new gc(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(sr(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(sr(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function yx(e){return new xx({type:"transform",transform:e})}const Hc=Y("ZodOptional",(e,t)=>{Dc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ma(e){return new Hc({type:"optional",innerType:e})}const vx=Y("ZodExactOptional",(e,t)=>{Zm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function bx(e){return new vx({type:"optional",innerType:e})}const wx=Y("ZodNullable",(e,t)=>{Vm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>d0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ga(e){return new wx({type:"nullable",innerType:e})}const _x=Y("ZodDefault",(e,t)=>{Wm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>h0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kx(e,t){return new _x({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():bc(t)}})}const Sx=Y("ZodPrefault",(e,t)=>{Hm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>p0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Cx(e,t){return new Sx({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():bc(t)}})}const qc=Y("ZodNonOptional",(e,t)=>{qm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>f0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ex(e,t){return new qc({type:"nonoptional",innerType:e,...xe(t)})}const Nx=Y("ZodCatch",(e,t)=>{Gm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>m0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tx(e,t){return new Nx({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const jx=Y("ZodPipe",(e,t)=>{Km.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>g0(e,n,r,o),e.in=t.in,e.out=t.out});function xa(e,t){return new jx({type:"pipe",in:e,out:t})}const Ax=Y("ZodReadonly",(e,t)=>{Jm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ix(e){return new Ax({type:"readonly",innerType:e})}const zx=Y("ZodLazy",(e,t)=>{Ym.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>y0(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function Px(e){return new zx({type:"lazy",getter:e})}const Rx=Y("ZodCustom",(e,t)=>{Xm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>o0(e,n)});function Ox(e,t={}){return Wg(Rx,e,t)}function Dx(e){return Hg(e)}const zn=Px(()=>$t([G(),ye(),et(),pi(),Me(zn),qt(G(),zn)])),es=ce({type:G(),ttl:G().optional(),scope:G().optional()}),ts=ce({type:Te("text"),text:G(),cache_control:es.optional()}),Gc=ce({type:Te("thinking"),thinking:G(),signature:G().optional()}),Mx=ce({type:Te("think"),thinking:G(),signature:G().optional()}),Lx=ce({type:Te("base64"),media_type:G(),data:G()}),Kc=ce({type:Te("image"),source:Lx}),Jc=ce({type:Te("tool_use"),id:G(),name:G(),input:qt(G(),zn)}),Fx=un("type",[ts,Kc]),$x=ce({type:Te("tool_result"),tool_use_id:G().optional(),content:$t([G(),Me(Fx)]),is_error:et().optional()}),Bx=un("type",[ts,Gc,Kc,Jc,$x]),Ux=$t([G(),Me(Bx)]),Zx=ce({role:jt(["user","assistant"]),content:Ux}),Vx=ce({type:Te("text"),text:G(),cache_control:es.optional()}),Wx=ce({type:G(),properties:qt(G(),qt(G(),zn)).optional(),required:Me(G()).optional(),additionalProperties:et().optional(),$schema:G().optional()}),Hx=ce({name:G(),description:G().optional(),input_schema:Wx.optional(),cache_control:es.optional()}),qx=un("type",[ce({type:Te("enabled"),budget_tokens:ye()}),ce({type:Te("disabled")}),ce({type:Te("adaptive")})]),Gx=ce({model:G(),messages:Me(Zx),system:Me(Vx).optional(),tools:Me(Hx).optional(),max_tokens:ye().optional(),temperature:ye().optional(),stream:et().optional(),thinking:qx.optional(),metadata:ce({user_id:G().optional()}).optional()}),ns=un("type",[ts,Gc,Mx,Jc]),Kx=ce({input_tokens:ye().nullable().optional(),output_tokens:ye().nullable().optional(),cache_creation_input_tokens:ye().nullable().optional(),cache_read_input_tokens:ye().nullable().optional()}).passthrough(),Jx=ce({id:G(),type:Te("message"),model:G(),role:Te("assistant"),content:Me(ns),stop_reason:G().nullable(),stop_sequence:G().nullable().optional(),usage:Kx}).passthrough(),Yx=ce({type:Te("message_start"),message:ce({id:G(),type:Te("message"),model:G(),role:Te("assistant"),content:Me(ns),stop_reason:pi(),stop_sequence:pi(),usage:ce({input_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()})}),Xx=ce({type:Te("content_block_start"),index:ye(),content_block:ns}),Qx=un("type",[ce({type:Te("text_delta"),text:G()}),ce({type:Te("input_json_delta"),partial_json:G()}),ce({type:Te("thinking_delta"),thinking:G()}),ce({type:Te("signature_delta"),signature:G()})]),ey=ce({type:Te("content_block_delta"),index:ye(),delta:Qx}),ty=ce({type:Te("content_block_stop"),index:ye()}),ny=ce({type:Te("message_delta"),delta:ce({stop_reason:G().nullable(),stop_sequence:G().nullable().optional()}),usage:ce({output_tokens:ye(),input_tokens:ye().optional(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()}),ry=ce({type:Te("message_stop")}),oy=ce({type:Te("ping")}),iy=ce({type:Te("error"),error:ce({type:G(),message:G()})});un("type",[Yx,Xx,ey,ty,ny,ry,oy,iy]);const sy=Gx,ay=Jx,ly=$t([G(),Me(un("type",[ce({type:Te("text"),text:G()}),ce({type:Te("image_url"),image_url:ce({url:G(),detail:G().optional()})})]))]),Yc=ce({role:jt(["system","user","assistant","tool"]),content:ly,name:G().optional(),reasoning_content:G().optional(),thinking:G().optional(),think:G().optional()}),cy=ce({name:G(),arguments:G()});Yc.extend({content:$t([G(),Me(ce({type:Te("text"),text:G()}))]).optional(),function_call:cy.optional()});const uy=ce({type:Te("function"),function:ce({name:G(),description:G().optional(),parameters:qt(G(),zn)})});ce({model:G(),messages:Me(Yc),temperature:ye().optional(),max_tokens:ye().optional(),stream:et().optional(),tools:Me(uy).optional(),tool_choice:$t([ce({type:Te("auto")}),ce({type:Te("none")}),ce({type:Te("function"),function:ce({name:G()})})]).optional(),user:G().optional()});const Xc=ce({role:jt(["assistant"]).optional(),content:G().nullable().optional(),reasoning_content:G().nullable().optional(),thinking:G().nullable().optional(),think:G().nullable().optional(),function_call:ce({name:G().optional(),arguments:G().optional()}).nullable().optional(),tool_calls:Me(ce({index:ye(),id:G().optional(),type:Te("function").optional(),function:ce({name:G().optional(),arguments:G().optional()})})).nullable().optional()}),dy=ce({index:ye(),message:ce({role:jt(["assistant"]),content:G().nullable(),reasoning_content:G().optional(),thinking:G().optional(),think:G().optional(),function_call:ce({name:G(),arguments:G()}).nullable().optional()}).optional(),delta:Xc.optional(),finish_reason:G().nullable()}),fy=ce({id:G(),object:Te("chat.completion"),created:ye(),model:G(),choices:Me(dy),usage:ce({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough(),service_tier:G().nullable().optional(),system_fingerprint:G().nullable().optional()}).passthrough();ce({id:G(),object:Te("chat.completion.chunk"),created:ye(),model:G(),choices:Me(ce({index:ye(),delta:Xc,finish_reason:G().nullable().optional()})),usage:ce({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function hy(e){try{const t=JSON.parse(e),n=fy.safeParse(t);return n.success?n.data:null}catch{return null}}const Qc=ce({index:ye(),timestamp:ye(),type:G(),data:zn}),py=ce({chunks:Me(Qc),truncated:et().optional().default(!1)}),gi=ce({id:ye(),timestamp:G(),method:G(),path:G(),model:G().nullable(),sessionId:G().nullable(),rawRequestBody:G().nullable(),responseStatus:ye().nullable(),responseText:G().nullable(),inputTokens:ye().nullable(),outputTokens:ye().nullable(),cacheCreationInputTokens:ye().nullable(),cacheReadInputTokens:ye().nullable(),elapsedMs:ye().nullable(),streaming:et(),userAgent:G().nullable(),origin:G().nullable(),rawHeaders:qt(G(),G()).optional(),headers:qt(G(),G()).optional(),apiFormat:jt(["anthropic","openai","unknown"]).default("unknown"),isTest:et().optional().default(!1),providerName:G().nullable().optional(),clientPort:ye().nullable().optional(),clientPid:ye().nullable().optional(),clientCwd:G().nullable().optional(),clientProjectFolder:G().nullable().optional(),streamingChunks:py.optional(),streamingChunksPath:G().nullable().optional(),error:G().nullable().optional()});ce({model:G()});ce({model:G().optional(),metadata:ce({user_id:G().optional()}).passthrough().optional()});function my(e){if(e===null)return null;try{const t=JSON.parse(e),n=sy.safeParse(t);return n.success?n.data:null}catch{return null}}const gy=ce({error:G()});async function bn(e,t){const n=await e.json();return t.parse(n)}async function Mr(e,t){try{const n=await e.json(),r=gy.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function rs(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 Mr(o,i))}return bn(o,t)}const eu=ce({stripClaudeCodeBillingHeader:et()}),xi="/api/config";async function xy(e){return rs(e,eu,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function yy(e){return rs(xi,eu,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function tu(){const e=pc(xi,xy,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=Wh(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(xi,yy({stripClaudeCodeBillingHeader:o}),{optimisticData:{stripClaudeCodeBillingHeader:o},rollbackOnError:!0,revalidate:!1})};return{strip:n,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:r}}function vy(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,i,s){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let c=o[l];if(!c){const u=t[l*2];c=o[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function hn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((c,u)=>r[u]!==c))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function ya(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const va=(e,t)=>Math.abs(e-t)<1.01,by=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let qn;const ba=()=>{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,_y=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},ky=(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 c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(wa(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Hr={passive:!0},Sy=typeof window>"u"?!0:"onscrollend"in window,Cy=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Sy;let s=0;const a=i?null:by(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=h=>()=>{s=n(r),a?.(),t(s,h)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Hr),i&&r.addEventListener("scrollend",u,Hr),()=>{r.removeEventListener("scroll",c),i&&r.removeEventListener("scrollend",u)}},Ey=(e,t)=>Cy(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),Ny=(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"]},Ty=(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})},jy=Ty;class Ay{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{const a=i.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[c,u]of this.elementsCache)if(u===a){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wy,rangeExtractor:_y,onChange:()=>{},measureElement:Ny,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate"};for(const c in n){const u=n[c];u!==void 0&&(i[c]=u)}const s=this.options;let a=null,l=null;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const c=s.count,u=i.count,h=this.getMeasurements(),p=c>0?((r=h[0])==null?void 0:r.key)??s.getItemKey(0):null,f=c>0?((o=h[c-1])==null?void 0:o.key)??s.getItemKey(c-1):null;if(u!==c||c>0&&u>0&&(i.getItemKey(0)!==p||i.getItemKey(u-1)!==f)){const y=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;y&&(a=[y.key,this.getScrollOffset()-y.start]);const g=i.followOnAppend===!0?"auto":i.followOnAppend||null;g&&u>c&&this.isAtEnd(s.scrollEndThreshold)&&(c===0||i.getItemKey(u-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=hn(()=>(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,!(!ba()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,Hr),i.addEventListener("touchend",a,Hr),this.unsubs.push(()=>{i.removeEventListener("touchstart",s),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,s,a]=o;if(i!==null){const{count:l,getItemKey:c}=this.options;let u=0;for(;u<l&&c(u)!==i;)u++;const h=u<l?this.getMeasurements()[u]:void 0;if(h){const p=h.start+s-this.getScrollOffset();va(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=hn(()=>[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=hn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const x=this.options.gap,m=n*2;let y=this._flatMeasurements;if(!y||y.length<m){const k=new Float64Array(m);y&&h>0&&k.set(y.subarray(0,h*2)),y=k,this._flatMeasurements=y}let g;if(h===0)g=r+o;else{const k=h-1;g=y[k*2]+y[k*2+1]+x}for(let k=h;k<n;k++){const S=i(k),C=u.get(S),N=typeof C=="number"?C:this.options.estimateSize(k);y[k*2]=g,y[k*2+1]=N,g+=N+x}const v=vy(n,y,i);return this.measurementsCache=v,v}const p=this.measurementsCache.slice(0,h),f=new Array(a).fill(void 0);for(let x=0;x<h;x++){const m=p[x];m&&(f[m.lane]=x)}for(let x=h;x<n;x++){const m=i(x),y=this.laneAssignments.get(x);let g,v;const k=l==="estimate"||u.has(m);if(y!==void 0&&this.options.lanes>1){g=y;const A=f[g],R=A!==void 0?p[A]:void 0;v=R?R.end+this.options.gap:r+o}else{const A=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);v=A?A.end+this.options.gap:r+o,g=A?A.lane:x%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(x,g)}const S=u.get(m),C=typeof S=="number"?S:this.options.estimateSize(x),N=v+C;p[x]={index:x,start:v,size:C,end:N,key:m,lane:g},f[g]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=hn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Iy({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=hn(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return n>=s&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,a)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,i;if(n<0||n>=this.options.count)return;let s,a,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),a=c[n*2],s=c[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const u=this.itemSizeCache.get(l)??s,h=r-u;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,f=p?this.getTotalSize():0,x=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:a,size:s,end:a+s,lane:0},h,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-f):x&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=hn(()=>[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=nu(0,r.length-1,i?a=>o[a*2]:a=>ya(r[a]).start,n);return ya(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&&(ba()&&(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&&va(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const a=this.getSize()||600,l=Math.abs(o-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,c||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const nu=(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 Iy({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?u=>o[u*2]:u=>e[u].start,a=o?u=>o[u*2]+o[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=nu(0,i,s,n),c=l;if(r===1)for(;c<i&&a(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<i&&u.some(p=>p<n+t);){const p=e[c];u[p.lane]=p.end,c++}const 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),c=Math.min(i,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const _a=typeof document<"u"?w.useLayoutEffect:w.useEffect;function zy({useFlushSync:e=!0,...t}){const n=w.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?dr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=w.useState(()=>new Ay(r));return o.setOptions(r),_a(()=>o._didMount(),[]),_a(()=>o._willUpdate()),o}function ru(e){return zy({observeElementRect:ky,observeElementOffset:Ey,scrollToFn:jy,...e})}const ou=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Py=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Ry=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const ka=e=>{const t=Ry(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Oy={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 Dy=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const My=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>w.createElement("svg",{ref:l,...Oy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ou("lucide",o),...!i&&!Dy(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,u])=>w.createElement(c,u)),...Array.isArray(i)?i:[i]]));const ke=(e,t)=>{const n=w.forwardRef(({className:r,...o},i)=>w.createElement(My,{ref:i,iconNode:t,className:ou(`lucide-${Py(ka(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ka(e),n};const Ly=[["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"}]],Fy=ke("brain",Ly);const $y=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=ke("check",$y);const By=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],At=ke("chevron-down",By);const Uy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gt=ke("chevron-right",Uy);const Zy=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Vy=ke("chevron-up",Zy);const Wy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],Hy=ke("chevrons-down",Wy);const qy=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],Gy=ke("chevrons-up",qy);const Ky=[["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"}]],yi=ke("circle-alert",Ky);const Jy=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Yy=ke("circle-check-big",Jy);const Xy=[["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"}]],Qy=ke("circle-question-mark",Xy);const ev=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],iu=ke("circle-stop",ev);const tv=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=ke("clock",tv);const nv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],rv=ke("columns-2",nv);const ov=[["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"}]],uo=ke("copy",ov);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"}]],su=ke("download",iv);const sv=[["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"}]],av=ke("external-link",sv);const lv=[["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"}]],au=ke("eye-off",lv);const cv=[["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"}]],lu=ke("eye",cv);const uv=[["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"}]],dv=ke("file-terminal",uv);const fv=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],hv=ke("gauge",fv);const pv=[["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"}]],mv=ke("git-compare-arrows",pv);const gv=[["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"}]],xv=ke("globe",gv);const yv=[["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"}]],vv=ke("layout-grid",yv);const bv=[["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"}]],wv=ke("list",bv);const _v=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cu=ke("loader-circle",_v);const kv=[["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"}]],Sv=ke("lock",kv);const Cv=[["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"}]],uu=ke("message-square",Cv);const Ev=[["path",{d:"M5 12h14",key:"1ays0h"}]],Nv=ke("minus",Ev);const Tv=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],jv=ke("pencil",Tv);const Av=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Sa=ke("plus",Av);const Iv=[["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"}]],zv=ke("radio",Iv);const Pv=[["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"}]],du=ke("rotate-ccw",Pv);const Rv=[["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"}]],fu=ke("rotate-cw",Rv);const Ov=[["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"}]],Dv=ke("rows-3",Ov);const Mv=[["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"}]],Lv=ke("server",Mv);const Fv=[["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"}]],$v=ke("settings",Fv);const Bv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Uv=ke("terminal",Bv);const Zv=[["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"}]],Vv=ke("trash-2",Zv);const Wv=[["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"}]],Hv=ke("triangle-alert",Wv);const qv=[["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"}]],Gv=ke("upload",qv);const Kv=[["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"}]],Jv=ke("user",Kv);const Yv=[["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"}]],Xv=ke("wifi-off",Yv);const Qv=[["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=ke("wifi",Qv);const tb=[["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=ke("wrench",tb);const rb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ob=ke("x",rb);const ib=[["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"}]],hr=ke("zap",ib);function Sr(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 Do={exports:{}};var Ca;function sb(){return Ca||(Ca=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var h=typeof Sr=="function"&&Sr;if(!u&&h)return h(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var f=o[c]={exports:{}};r[c][0].call(f.exports,function(x){var m=r[c][1][x];return s(m||x)},f,f.exports,n,r,o,i)}return o[c].exports}for(var a=typeof Sr=="function"&&Sr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,h,p,f,x,m,y=[],g=0,v=l.length,k=v,S=i.getTypeOf(l)!=="string";g<l.length;)k=v-g,h=S?(c=l[g++],u=g<v?l[g++]:0,g<v?l[g++]:0):(c=l.charCodeAt(g++),u=g<v?l.charCodeAt(g++):0,g<v?l.charCodeAt(g++):0),p=c>>2,f=(3&c)<<4|u>>4,x=1<k?(15&u)<<2|h>>6:64,m=2<k?63&h:64,y.push(a.charAt(p)+a.charAt(f)+a.charAt(x)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,h,p,f,x,m=0,y=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(f=a.indexOf(l.charAt(m++)))>>2,h=(3&f)<<6|(x=a.indexOf(l.charAt(m++))),v[y++]=c,f!==64&&(v[y++]=u),x!==64&&(v[y++]=h);return v}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,h,p,f,x){this.compressedSize=u,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=x}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return u.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,h,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,u,h,p){var f=s,x=p+h;c^=-1;for(var m=p;m<x;m++)c=c>>>8^f[255&(c^u[m])];return-1^c})(0|l,a,a.length,0):(function(c,u,h,p){var f=s,x=p+h;c^=-1;for(var m=p;m<x;m++)c=c>>>8^f[255&(c^u.charCodeAt(m))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,h.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},o.compressWorker=function(h){return new u("Deflate",h)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(f,x){var m,y="";for(m=0;m<x;m++)y+=String.fromCharCode(255&f),f>>>=8;return y}function s(f,x,m,y,g,v){var k,S,C=f.file,N=f.compression,A=v!==c.utf8encode,R=a.transformTo("string",v(C.name)),O=a.transformTo("string",c.utf8encode(C.name)),P=C.comment,L=a.transformTo("string",v(P)),E=a.transformTo("string",c.utf8encode(P)),M=O.length!==C.name.length,_=E.length!==P.length,D="",J="",Z="",W=C.dir,q=C.date,j={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(j.crc32=f.crc32,j.compressedSize=f.compressedSize,j.uncompressedSize=f.uncompressedSize);var U=0;x&&(U|=8),A||!M&&!_||(U|=2048);var B=0,T=0;W&&(B|=16),g==="UNIX"?(T=798,B|=(function(re,ve){var ie=re;return re||(ie=ve?16893:33204),(65535&ie)<<16})(C.unixPermissions,W)):(T=20,B|=(function(re){return 63&(re||0)})(C.dosPermissions)),k=q.getUTCHours(),k<<=6,k|=q.getUTCMinutes(),k<<=5,k|=q.getUTCSeconds()/2,S=q.getUTCFullYear()-1980,S<<=4,S|=q.getUTCMonth()+1,S<<=5,S|=q.getUTCDate(),M&&(J=i(1,1)+i(u(R),4)+O,D+="up"+i(J.length,2)+J),_&&(Z=i(1,1)+i(u(L),4)+E,D+="uc"+i(Z.length,2)+Z);var ee="";return ee+=`
|
|
40
|
-
\0`,ee+=i(U,2),ee+=N.magic,ee+=i(k,2),ee+=i(S,2),ee+=i(j.crc32,4),ee+=i(j.compressedSize,4),ee+=i(j.uncompressedSize,4),ee+=i(R.length,2),ee+=i(D.length,2),{fileRecord:h.LOCAL_FILE_HEADER+ee+R+D,dirRecord:h.CENTRAL_FILE_HEADER+i(T,2)+ee+i(L.length,2)+"\0\0\0\0"+i(B,4)+i(y,4)+R+D+L}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),h=n("../signature");function p(f,x,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(f){var x=f.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var x=this.streamFiles&&!f.file.dir;if(x){var m=s(f,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var x=this.streamFiles&&!f.file.dir,m=s(f,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(y){return h.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-f,y=(function(g,v,k,S,C){var N=a.transformTo("string",C(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(v,4)+i(k,4)+i(N.length,2)+N})(this.dirRecords.length,m,f,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(f){this._sources.push(f);var x=this;return f.on("data",function(m){x.processChunk(m)}),f.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),f.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(f){var x=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var m=0;m<x.length;m++)try{x[m].error(f)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,x=0;x<f.length;x++)f[x].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),h=0;try{a.forEach(function(p,f){h++;var x=(function(v,k){var S=v||k,C=i[S];if(!C)throw new Error(S+" is not a valid compression method !");return C})(f.options.compression,l.compression),m=f.options.compressionOptions||l.compressionOptions||{},y=f.dir,g=f.date;f._compressWorker(x,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(u)}),u.entriesCount=h}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function h(p){return new s.Promise(function(f,x){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){x(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var x=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,f.optimizedBinaryString,f.base64).then(function(m){var y=new l(f);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var v=0;v<g.length;v++)y.push(h(g[v]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,v=0;v<g.length;v++){var k=g[v],S=k.fileNameStr,C=i.resolve(k.fileNameStr);x.file(C,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(x.file(C).unsafeOriginalName=S)}return y.zipComment.length&&(x.comment=y.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(h,p){u.push(h)||u._helper.pause(),c&&c(p)}).on("error",function(h){u.emit("error",h)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(C,N,A){var R,O=a.getTypeOf(N),P=a.extend(A||{},u);P.date=P.date||new Date,P.compression!==null&&(P.compression=P.compression.toUpperCase()),typeof P.unixPermissions=="string"&&(P.unixPermissions=parseInt(P.unixPermissions,8)),P.unixPermissions&&16384&P.unixPermissions&&(P.dir=!0),P.dosPermissions&&16&P.dosPermissions&&(P.dir=!0),P.dir&&(C=g(C)),P.createFolders&&(R=y(C))&&v.call(this,R,!0);var L=O==="string"&&P.binary===!1&&P.base64===!1;A&&A.binary!==void 0||(P.binary=!L),(N instanceof h&&N.uncompressedSize===0||P.dir||!N||N.length===0)&&(P.base64=!1,P.binary=!0,N="",P.compression="STORE",O="string");var E=null;E=N instanceof h||N instanceof l?N:x.isNode&&x.isStream(N)?new m(C,N):a.prepareContent(C,N,P.binary,P.optimizedBinaryString,P.base64);var M=new p(C,E,P);this.files[C]=M}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),f=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var N=C.lastIndexOf("/");return 0<N?C.substring(0,N):""},g=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},v=function(C,N){return N=N!==void 0?N:u.createFolders,C=g(C),this.files[C]||i.call(this,C,null,{dir:!0,createFolders:N}),this.files[C]};function k(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var N,A,R;for(N in this.files)R=this.files[N],(A=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&C(A,R)},filter:function(C){var N=[];return this.forEach(function(A,R){C(A,R)&&N.push(R)}),N},file:function(C,N,A){if(arguments.length!==1)return C=this.root+C,i.call(this,C,N,A),this;if(k(C)){var R=C;return this.filter(function(P,L){return!L.dir&&R.test(P)})}var O=this.files[this.root+C];return O&&!O.dir?O:null},folder:function(C){if(!C)return this;if(k(C))return this.filter(function(O,P){return P.dir&&C.test(O)});var N=this.root+C,A=v.call(this,N),R=this.clone();return R.root=A.name,R},remove:function(C){C=this.root+C;var N=this.files[C];if(N||(C.slice(-1)!=="/"&&(C+="/"),N=this.files[C]),N&&!N.dir)delete this.files[C];else for(var A=this.filter(function(O,P){return P.name.slice(0,C.length)===C}),R=0;R<A.length;R++)delete this.files[A[R].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(C){var N,A={};try{if((A=a.extend(C||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");a.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var R=A.comment||this.comment||"";N=f.generateWorker(this,A,R)}catch(O){(N=new l("error")).error(O)}return new c(N,A.type||"string",A.mimeType)},generateAsync:function(C,N){return this.generateInternalStream(C).accumulate(N)},generateNodeStream:function(C,N){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(N)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===h)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===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,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(h){var p=i.getTypeOf(h);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(h):s.uint8array?new u(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 c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),h=null;if(c.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new u.Promise(function(y,g){var v=[],k=x._internalType,S=x._outputType,C=x._mimeType;x.on("data",function(N,A){v.push(N),m&&m(A)}).on("error",function(N){v=[],g(N)}).on("end",function(){try{var N=(function(A,R,O){switch(A){case"blob":return i.newBlob(i.transformTo("arraybuffer",R),O);case"base64":return l.encode(R);default:return i.transformTo(A,R)}})(S,(function(A,R){var O,P=0,L=null,E=0;for(O=0;O<R.length;O++)E+=R[O].length;switch(A){case"string":return R.join("");case"array":return Array.prototype.concat.apply([],R);case"uint8array":for(L=new Uint8Array(E),O=0;O<R.length;O++)L.set(R[O],P),P+=R[O].length;return L;case"nodebuffer":return Buffer.concat(R);default:throw new Error("concat : unsupported type '"+A+"'")}})(k,v),C);y(N)}catch(A){g(A)}v=[]}).resume()})}function f(x,m,y){var g=m;switch(m){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=m,this._mimeType=y,i.checkSupport(g),this._worker=x.pipe(new s(g)),x.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}f.prototype={accumulate:function(x){return p(this,x)},on:function(x,m){var y=this;return x==="data"?this._worker.on(x,function(g){m.call(y,g.data,g.meta)}):this._worker.on(x,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(x){var m,y,g,v,k,S=x.length,C=0;for(v=0;v<S;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),C+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(C):new Array(C),v=k=0;k<C;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(x){var m,y,g,v,k=x.length,S=new Array(2*k);for(m=y=0;m<k;)if((g=x[m++])<128)S[y++]=g;else if(4<(v=c[g]))S[y++]=65533,m+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&m<k;)g=g<<6|63&x[m++],v--;1<v?S[y++]=65533:g<65536?S[y++]=g:(g-=65536,S[y++]=55296|g>>10&1023,S[y++]=56320|1023&g)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),i.applyFromCharCode(S)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(h,l),h.prototype.processChunk=function(f){var x=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var y=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+c[v[S]]>k?S:k})(x),g=x;y!==x.length&&(s.uint8array?(g=x.subarray(0,y),this.leftOver=x.subarray(y,x.length)):(g=x.slice(0,y),this.leftOver=x.slice(y,x.length))),this.push({data:o.utf8decode(g),meta: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 c(m){return m}function u(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,g){var v=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)y==="array"||y==="nodebuffer"?v.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):v.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return v.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,g=o.getTypeOf(m),v=!0;if(g==="uint8array"?v=h.applyCanBeUsed.uint8array:g==="nodebuffer"&&(v=h.applyCanBeUsed.nodebuffer),v)for(;1<y;)try{return h.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function f(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var x={};x.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},x.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return f(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return x[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],v=0;v<y.length;v++){var k=y[v];k==="."||k===""&&v!==0&&v!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,v="";for(g=0;g<(m||"").length;g++)v+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return v},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},o.prepareContent=function(m,y,g,v,k){return l.Promise.resolve(y).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,N){var A=new FileReader;A.onload=function(R){C(R.target.result)},A.onerror=function(R){N(R.target.error)},A.readAsArrayBuffer(S)}):S}).then(function(S){var C=o.getTypeOf(S);return C?(C==="arraybuffer"?S=o.transformTo("uint8array",S):C==="string"&&(k?S=s.decode(S):g&&v!==!0&&(S=(function(N){return u(N,i.uint8array?new Uint8Array(N.length):new Array(N.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(h){this.files=[],this.loadOptions=h}u.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(h)+")")}},isSignature:function(h,p){var f=this.reader.index;this.reader.setIndex(h);var x=this.reader.readString(4)===p;return this.reader.setIndex(f),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",f=s.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(f)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,f,x=this.zip64EndOfCentralSize-44;0<x;)h=this.reader.readInt(2),p=this.reader.readInt(4),f=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:f}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(h=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var x=p-f;if(0<x)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(h){this.reader=i(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),h=n("./support");function p(f,x){this.options=f,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var x,m;if(f.skip(22),this.fileNameLength=f.readInt(2),m=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(y){for(var g in u)if(Object.prototype.hasOwnProperty.call(u,g)&&u[g].magic===y)return u[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var x=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(x),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var x,m,y,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)x=f.readInt(2),m=f.readInt(2),y=f.readData(m),this.extraFields[x]={id:x,length:m,value:y};f.setIndex(g)},handleUTF8:function(){var f=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var x=i(f.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:c.utf8decode(x.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var x=i(f.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:c.utf8decode(x.readData(f.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(x,m,y){this.name=x,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(x){var m=null,y="string";try{if(!x)throw new Error("No output type specified.");var g=(y=x.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var v=!this._dataBinary;v&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!v&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new u("error")).error(k)}return new s(m,y,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof c&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,x,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var 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 c=0,u=new l(x),h=i.document.createTextNode("");u.observe(h,{characterData:!0}),s=function(){h.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new i.MessageChannel;p.port1.onmessage=x,s=function(){p.port2.postMessage(0)}}var f=[];function x(){var m,y;a=!0;for(var g=f.length;g;){for(y=f,f=[],m=-1;++m<g;)y[m]();g=f.length}a=!1}r.exports=function(m){f.push(m)!==1||a||s()}}).call(this,typeof br<"u"?br:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function h(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function p(g,v,k){this.promise=g,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,v,k){i(function(){var S;try{S=v(k)}catch(C){return a.reject(g,C)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function x(g){var v=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof v=="function")return function(){v.apply(g,arguments)}}function m(g,v){var k=!1;function S(A){k||(k=!0,a.reject(g,A))}function C(A){k||(k=!0,a.resolve(g,A))}var N=y(function(){v(C,S)});N.status==="error"&&S(N.value)}function y(g,v){var k={};try{k.value=g(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=h).prototype.finally=function(g){if(typeof g!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(g()).then(function(){return k})},function(k){return v.resolve(g()).then(function(){throw k})})},h.prototype.catch=function(g){return this.then(null,g)},h.prototype.then=function(g,v){if(typeof g!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==u?f(k,this.state===c?g:v,this.outcome):this.queue.push(new p(k,g,v)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){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,v){var k=y(x,v);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=c,g.outcome=v;for(var C=-1,N=g.queue.length;++C<N;)g.queue[C].callFulfilled(v)}return g},a.reject=function(g,v){g.state=l,g.outcome=v;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(v);return g},h.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},h.reject=function(g){var v=new this(s);return a.reject(v,g)},h.all=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=new Array(k),N=0,A=-1,R=new this(s);++A<k;)O(g[A],A);return R;function O(P,L){v.resolve(P).then(function(E){C[L]=E,++N!==k||S||(S=!0,a.resolve(R,C))},function(E){S||(S=!0,a.reject(R,E))})}},h.race=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var C=-1,N=new this(s);++C<k;)A=g[C],v.resolve(A).then(function(R){S||(S=!0,a.resolve(N,R))},function(R){S||(S=!0,a.reject(N,R))});var A;return N}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,h=0,p=-1,f=0,x=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==h)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):u.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[k]);this._dict_set=!0}}function y(g,v){var k=new m(v);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,v){var k,S,C=this.strm,N=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof g=="string"?C.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?C.input=new Uint8Array(g):C.input=g,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(N),C.next_out=0,C.avail_out=N),(k=i.deflate(C,S))!==1&&k!==h)return this.onEnd(k),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===h):S!==2||(this.onEnd(h),!(C.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,v){return(v=v||{}).raw=!0,y(g,v)},o.gzip=function(g,v){return(v=v||{}).gzip=!0,y(g,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function f(m){if(!(this instanceof f))return new f(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function x(m,y){var g=new f(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}f.prototype.push=function(m,y){var g,v,k,S,C,N,A=this.strm,R=this.options.chunkSize,O=this.options.dictionary,P=!1;if(this.ended)return!1;v=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?A.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?A.input=new Uint8Array(m):A.input=m,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new s.Buf8(R),A.next_out=0,A.avail_out=R),(g=i.inflate(A,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&O&&(N=typeof O=="string"?a.string2buf(O):p.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,g=i.inflateSetDictionary(this.strm,N)),g===l.Z_BUF_ERROR&&P===!0&&(g=l.Z_OK,P=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);A.next_out&&(A.avail_out!==0&&g!==l.Z_STREAM_END&&(A.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(A.output,A.next_out),S=A.next_out-k,C=a.buf2string(A.output,k),A.next_out=S,A.avail_out=R-S,S&&s.arraySet(A.output,A.output,k,S,0),this.onData(C)):this.onData(s.shrinkBuf(A.output,A.next_out)))),A.avail_in===0&&A.avail_out===0&&(P=!0)}while((0<A.avail_in||A.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(A.avail_out=0))},f.prototype.onData=function(m){this.chunks.push(m)},f.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=f,o.inflate=x,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,x(m,y)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var h in u)u.hasOwnProperty(h)&&(l[h]=u[h])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,h,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+h),p);else for(var f=0;f<h;f++)l[p+f]=c[u+f]},flattenChunks:function(l){var c,u,h,p,f,x;for(c=h=0,u=l.length;c<u;c++)h+=l[c].length;for(x=new Uint8Array(h),c=p=0,u=l.length;c<u;c++)f=l[c],x.set(f,p),p+=f.length;return x}},a={arraySet:function(l,c,u,h,p){for(var f=0;f<h;f++)l[p+f]=c[u+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),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(h,p));for(var f="",x=0;x<p;x++)f+=String.fromCharCode(h[x]);return f}l[254]=l[254]=1,o.string2buf=function(h){var p,f,x,m,y,g=h.length,v=0;for(m=0;m<g;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),v+=f<128?1:f<2048?2:f<65536?3:4;for(p=new i.Buf8(v),m=y=0;y<v;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),f<128?p[y++]=f:(f<2048?p[y++]=192|f>>>6:(f<65536?p[y++]=224|f>>>12:(p[y++]=240|f>>>18,p[y++]=128|f>>>12&63),p[y++]=128|f>>>6&63),p[y++]=128|63&f);return p},o.buf2binstring=function(h){return u(h,h.length)},o.binstring2buf=function(h){for(var p=new i.Buf8(h.length),f=0,x=p.length;f<x;f++)p[f]=h.charCodeAt(f);return p},o.buf2string=function(h,p){var f,x,m,y,g=p||h.length,v=new Array(2*g);for(f=x=0;f<g;)if((m=h[f++])<128)v[x++]=m;else if(4<(y=l[m]))v[x++]=65533,f+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&f<g;)m=m<<6|63&h[f++],y--;1<y?v[x++]=65533:m<65536?v[x++]=m:(m-=65536,v[x++]=55296|m>>10&1023,v[x++]=56320|1023&m)}return u(v,x)},o.utf8border=function(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 c=65535&i|0,u=i>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--h;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=i,h=c+l;s^=-1;for(var p=c;p<h;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),h=0,p=4,f=0,x=-2,m=-1,y=4,g=2,v=8,k=9,S=286,C=30,N=19,A=2*S+1,R=15,O=3,P=258,L=P+O+1,E=42,M=113,_=1,D=2,J=3,Z=4;function W(b,K){return b.msg=u[K],K}function q(b){return(b<<1)-(4<b?9:0)}function j(b){for(var K=b.length;0<=--K;)b[K]=0}function U(b){var K=b.state,H=K.pending;H>b.avail_out&&(H=b.avail_out),H!==0&&(s.arraySet(b.output,K.pending_buf,K.pending_out,H,b.next_out),b.next_out+=H,K.pending_out+=H,b.total_out+=H,b.avail_out-=H,K.pending-=H,K.pending===0&&(K.pending_out=0))}function B(b,K){a._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,K),b.block_start=b.strstart,U(b.strm)}function T(b,K){b.pending_buf[b.pending++]=K}function ee(b,K){b.pending_buf[b.pending++]=K>>>8&255,b.pending_buf[b.pending++]=255&K}function re(b,K){var H,z,I=b.max_chain_length,F=b.strstart,X=b.prev_length,ne=b.nice_match,V=b.strstart>b.w_size-L?b.strstart-(b.w_size-L):0,ae=b.window,fe=b.w_mask,le=b.prev,$=b.strstart+P,Q=ae[F+X-1],ue=ae[F+X];b.prev_length>=b.good_match&&(I>>=2),ne>b.lookahead&&(ne=b.lookahead);do if(ae[(H=K)+X]===ue&&ae[H+X-1]===Q&&ae[H]===ae[F]&&ae[++H]===ae[F+1]){F+=2,H++;do;while(ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&F<$);if(z=P-($-F),F=$-P,X<z){if(b.match_start=K,ne<=(X=z))break;Q=ae[F+X-1],ue=ae[F+X]}}while((K=le[K&fe])>V&&--I!=0);return X<=b.lookahead?X:b.lookahead}function ve(b){var K,H,z,I,F,X,ne,V,ae,fe,le=b.w_size;do{if(I=b.window_size-b.lookahead-b.strstart,b.strstart>=le+(le-L)){for(s.arraySet(b.window,b.window,le,le,0),b.match_start-=le,b.strstart-=le,b.block_start-=le,K=H=b.hash_size;z=b.head[--K],b.head[K]=le<=z?z-le:0,--H;);for(K=H=le;z=b.prev[--K],b.prev[K]=le<=z?z-le:0,--H;);I+=le}if(b.strm.avail_in===0)break;if(X=b.strm,ne=b.window,V=b.strstart+b.lookahead,ae=I,fe=void 0,fe=X.avail_in,ae<fe&&(fe=ae),H=fe===0?0:(X.avail_in-=fe,s.arraySet(ne,X.input,X.next_in,fe,V),X.state.wrap===1?X.adler=l(X.adler,ne,fe,V):X.state.wrap===2&&(X.adler=c(X.adler,ne,fe,V)),X.next_in+=fe,X.total_in+=fe,fe),b.lookahead+=H,b.lookahead+b.insert>=O)for(F=b.strstart-b.insert,b.ins_h=b.window[F],b.ins_h=(b.ins_h<<b.hash_shift^b.window[F+1])&b.hash_mask;b.insert&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[F+O-1])&b.hash_mask,b.prev[F&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=F,F++,b.insert--,!(b.lookahead+b.insert<O)););}while(b.lookahead<L&&b.strm.avail_in!==0)}function ie(b,K){for(var H,z;;){if(b.lookahead<L){if(ve(b),b.lookahead<L&&K===h)return _;if(b.lookahead===0)break}if(H=0,b.lookahead>=O&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+O-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),H!==0&&b.strstart-H<=b.w_size-L&&(b.match_length=re(b,H)),b.match_length>=O)if(z=a._tr_tally(b,b.strstart-b.match_start,b.match_length-O),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=O){for(b.match_length--;b.strstart++,b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+O-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart,--b.match_length!=0;);b.strstart++}else b.strstart+=b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+1])&b.hash_mask;else z=a._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(z&&(B(b,!1),b.strm.avail_out===0))return _}return b.insert=b.strstart<O-1?b.strstart:O-1,K===p?(B(b,!0),b.strm.avail_out===0?J:Z):b.last_lit&&(B(b,!1),b.strm.avail_out===0)?_:D}function de(b,K){for(var H,z,I;;){if(b.lookahead<L){if(ve(b),b.lookahead<L&&K===h)return _;if(b.lookahead===0)break}if(H=0,b.lookahead>=O&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+O-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),b.prev_length=b.match_length,b.prev_match=b.match_start,b.match_length=O-1,H!==0&&b.prev_length<b.max_lazy_match&&b.strstart-H<=b.w_size-L&&(b.match_length=re(b,H),b.match_length<=5&&(b.strategy===1||b.match_length===O&&4096<b.strstart-b.match_start)&&(b.match_length=O-1)),b.prev_length>=O&&b.match_length<=b.prev_length){for(I=b.strstart+b.lookahead-O,z=a._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-O),b.lookahead-=b.prev_length-1,b.prev_length-=2;++b.strstart<=I&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+O-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),--b.prev_length!=0;);if(b.match_available=0,b.match_length=O-1,b.strstart++,z&&(B(b,!1),b.strm.avail_out===0))return _}else if(b.match_available){if((z=a._tr_tally(b,0,b.window[b.strstart-1]))&&B(b,!1),b.strstart++,b.lookahead--,b.strm.avail_out===0)return _}else b.match_available=1,b.strstart++,b.lookahead--}return b.match_available&&(z=a._tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0),b.insert=b.strstart<O-1?b.strstart:O-1,K===p?(B(b,!0),b.strm.avail_out===0?J:Z):b.last_lit&&(B(b,!1),b.strm.avail_out===0)?_:D}function ge(b,K,H,z,I){this.good_length=b,this.max_lazy=K,this.nice_length=H,this.max_chain=z,this.func=I}function te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*A),this.dyn_dtree=new s.Buf16(2*(2*C+1)),this.bl_tree=new s.Buf16(2*(2*N+1)),j(this.dyn_ltree),j(this.dyn_dtree),j(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(R+1),this.heap=new s.Buf16(2*S+1),j(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),j(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function oe(b){var K;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=g,(K=b.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?E:M,b.adler=K.wrap===2?0:1,K.last_flush=h,a._tr_init(K),f):W(b,x)}function me(b){var K=oe(b);return K===f&&(function(H){H.window_size=2*H.w_size,j(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=O-1,H.match_available=0,H.ins_h=0})(b.state),K}function Ee(b,K,H,z,I,F){if(!b)return x;var X=1;if(K===m&&(K=6),z<0?(X=0,z=-z):15<z&&(X=2,z-=16),I<1||k<I||H!==v||z<8||15<z||K<0||9<K||F<0||y<F)return W(b,x);z===8&&(z=9);var ne=new te;return(b.state=ne).strm=b,ne.wrap=X,ne.gzhead=null,ne.w_bits=z,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=I+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+O-1)/O),ne.window=new s.Buf8(2*ne.w_size),ne.head=new s.Buf16(ne.hash_size),ne.prev=new s.Buf16(ne.w_size),ne.lit_bufsize=1<<I+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new s.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=K,ne.strategy=F,ne.method=H,me(b)}i=[new ge(0,0,0,0,function(b,K){var H=65535;for(H>b.pending_buf_size-5&&(H=b.pending_buf_size-5);;){if(b.lookahead<=1){if(ve(b),b.lookahead===0&&K===h)return _;if(b.lookahead===0)break}b.strstart+=b.lookahead,b.lookahead=0;var z=b.block_start+H;if((b.strstart===0||b.strstart>=z)&&(b.lookahead=b.strstart-z,b.strstart=z,B(b,!1),b.strm.avail_out===0)||b.strstart-b.block_start>=b.w_size-L&&(B(b,!1),b.strm.avail_out===0))return _}return b.insert=0,K===p?(B(b,!0),b.strm.avail_out===0?J:Z):(b.strstart>b.block_start&&(B(b,!1),b.strm.avail_out),_)}),new ge(4,4,8,4,ie),new ge(4,5,16,8,ie),new ge(4,6,32,32,ie),new ge(4,4,16,16,de),new ge(8,16,32,32,de),new ge(8,16,128,128,de),new ge(8,32,128,256,de),new ge(32,128,258,1024,de),new ge(32,258,258,4096,de)],o.deflateInit=function(b,K){return Ee(b,K,v,15,8,0)},o.deflateInit2=Ee,o.deflateReset=me,o.deflateResetKeep=oe,o.deflateSetHeader=function(b,K){return b&&b.state?b.state.wrap!==2?x:(b.state.gzhead=K,f):x},o.deflate=function(b,K){var H,z,I,F;if(!b||!b.state||5<K||K<0)return b?W(b,x):x;if(z=b.state,!b.output||!b.input&&b.avail_in!==0||z.status===666&&K!==p)return W(b,b.avail_out===0?-5:x);if(z.strm=b,H=z.last_flush,z.last_flush=K,z.status===E)if(z.wrap===2)b.adler=0,T(z,31),T(z,139),T(z,8),z.gzhead?(T(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(z.gzhead.extra?4:0)+(z.gzhead.name?8:0)+(z.gzhead.comment?16:0)),T(z,255&z.gzhead.time),T(z,z.gzhead.time>>8&255),T(z,z.gzhead.time>>16&255),T(z,z.gzhead.time>>24&255),T(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),T(z,255&z.gzhead.os),z.gzhead.extra&&z.gzhead.extra.length&&(T(z,255&z.gzhead.extra.length),T(z,z.gzhead.extra.length>>8&255)),z.gzhead.hcrc&&(b.adler=c(b.adler,z.pending_buf,z.pending,0)),z.gzindex=0,z.status=69):(T(z,0),T(z,0),T(z,0),T(z,0),T(z,0),T(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),T(z,3),z.status=M);else{var X=v+(z.w_bits-8<<4)<<8;X|=(2<=z.strategy||z.level<2?0:z.level<6?1:z.level===6?2:3)<<6,z.strstart!==0&&(X|=32),X+=31-X%31,z.status=M,ee(z,X),z.strstart!==0&&(ee(z,b.adler>>>16),ee(z,65535&b.adler)),b.adler=1}if(z.status===69)if(z.gzhead.extra){for(I=z.pending;z.gzindex<(65535&z.gzhead.extra.length)&&(z.pending!==z.pending_buf_size||(z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),U(b),I=z.pending,z.pending!==z.pending_buf_size));)T(z,255&z.gzhead.extra[z.gzindex]),z.gzindex++;z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),z.gzindex===z.gzhead.extra.length&&(z.gzindex=0,z.status=73)}else z.status=73;if(z.status===73)if(z.gzhead.name){I=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),U(b),I=z.pending,z.pending===z.pending_buf_size)){F=1;break}F=z.gzindex<z.gzhead.name.length?255&z.gzhead.name.charCodeAt(z.gzindex++):0,T(z,F)}while(F!==0);z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),F===0&&(z.gzindex=0,z.status=91)}else z.status=91;if(z.status===91)if(z.gzhead.comment){I=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),U(b),I=z.pending,z.pending===z.pending_buf_size)){F=1;break}F=z.gzindex<z.gzhead.comment.length?255&z.gzhead.comment.charCodeAt(z.gzindex++):0,T(z,F)}while(F!==0);z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),F===0&&(z.status=103)}else z.status=103;if(z.status===103&&(z.gzhead.hcrc?(z.pending+2>z.pending_buf_size&&U(b),z.pending+2<=z.pending_buf_size&&(T(z,255&b.adler),T(z,b.adler>>8&255),b.adler=0,z.status=M)):z.status=M),z.pending!==0){if(U(b),b.avail_out===0)return z.last_flush=-1,f}else if(b.avail_in===0&&q(K)<=q(H)&&K!==p)return W(b,-5);if(z.status===666&&b.avail_in!==0)return W(b,-5);if(b.avail_in!==0||z.lookahead!==0||K!==h&&z.status!==666){var ne=z.strategy===2?(function(V,ae){for(var fe;;){if(V.lookahead===0&&(ve(V),V.lookahead===0)){if(ae===h)return _;break}if(V.match_length=0,fe=a._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,fe&&(B(V,!1),V.strm.avail_out===0))return _}return V.insert=0,ae===p?(B(V,!0),V.strm.avail_out===0?J:Z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?_:D})(z,K):z.strategy===3?(function(V,ae){for(var fe,le,$,Q,ue=V.window;;){if(V.lookahead<=P){if(ve(V),V.lookahead<=P&&ae===h)return _;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=O&&0<V.strstart&&(le=ue[$=V.strstart-1])===ue[++$]&&le===ue[++$]&&le===ue[++$]){Q=V.strstart+P;do;while(le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&$<Q);V.match_length=P-(Q-$),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=O?(fe=a._tr_tally(V,1,V.match_length-O),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(fe=a._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),fe&&(B(V,!1),V.strm.avail_out===0))return _}return V.insert=0,ae===p?(B(V,!0),V.strm.avail_out===0?J:Z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?_:D})(z,K):i[z.level].func(z,K);if(ne!==J&&ne!==Z||(z.status=666),ne===_||ne===J)return b.avail_out===0&&(z.last_flush=-1),f;if(ne===D&&(K===1?a._tr_align(z):K!==5&&(a._tr_stored_block(z,0,0,!1),K===3&&(j(z.head),z.lookahead===0&&(z.strstart=0,z.block_start=0,z.insert=0))),U(b),b.avail_out===0))return z.last_flush=-1,f}return K!==p?f:z.wrap<=0?1:(z.wrap===2?(T(z,255&b.adler),T(z,b.adler>>8&255),T(z,b.adler>>16&255),T(z,b.adler>>24&255),T(z,255&b.total_in),T(z,b.total_in>>8&255),T(z,b.total_in>>16&255),T(z,b.total_in>>24&255)):(ee(z,b.adler>>>16),ee(z,65535&b.adler)),U(b),0<z.wrap&&(z.wrap=-z.wrap),z.pending!==0?f:1)},o.deflateEnd=function(b){var K;return b&&b.state?(K=b.state.status)!==E&&K!==69&&K!==73&&K!==91&&K!==103&&K!==M&&K!==666?W(b,x):(b.state=null,K===M?W(b,-3):f):x},o.deflateSetDictionary=function(b,K){var H,z,I,F,X,ne,V,ae,fe=K.length;if(!b||!b.state||(F=(H=b.state).wrap)===2||F===1&&H.status!==E||H.lookahead)return x;for(F===1&&(b.adler=l(b.adler,K,fe,0)),H.wrap=0,fe>=H.w_size&&(F===0&&(j(H.head),H.strstart=0,H.block_start=0,H.insert=0),ae=new s.Buf8(H.w_size),s.arraySet(ae,K,fe-H.w_size,H.w_size,0),K=ae,fe=H.w_size),X=b.avail_in,ne=b.next_in,V=b.input,b.avail_in=fe,b.next_in=0,b.input=K,ve(H);H.lookahead>=O;){for(z=H.strstart,I=H.lookahead-(O-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[z+O-1])&H.hash_mask,H.prev[z&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=z,z++,--I;);H.strstart=z,H.lookahead=O-1,ve(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=O-1,H.match_available=0,b.next_in=ne,b.input=V,b.avail_in=X,H.wrap=F,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,c,u,h,p,f,x,m,y,g,v,k,S,C,N,A,R,O,P,L,E,M,_,D;a=i.state,l=i.next_in,_=i.input,c=l+(i.avail_in-5),u=i.next_out,D=i.output,h=u-(s-i.avail_out),p=u+(i.avail_out-257),f=a.dmax,x=a.wsize,m=a.whave,y=a.wnext,g=a.window,v=a.hold,k=a.bits,S=a.lencode,C=a.distcode,N=(1<<a.lenbits)-1,A=(1<<a.distbits)-1;e:do{k<15&&(v+=_[l++]<<k,k+=8,v+=_[l++]<<k,k+=8),R=S[v&N];t:for(;;){if(v>>>=O=R>>>24,k-=O,(O=R>>>16&255)===0)D[u++]=65535&R;else{if(!(16&O)){if((64&O)==0){R=S[(65535&R)+(v&(1<<O)-1)];continue t}if(32&O){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}P=65535&R,(O&=15)&&(k<O&&(v+=_[l++]<<k,k+=8),P+=v&(1<<O)-1,v>>>=O,k-=O),k<15&&(v+=_[l++]<<k,k+=8,v+=_[l++]<<k,k+=8),R=C[v&A];n:for(;;){if(v>>>=O=R>>>24,k-=O,!(16&(O=R>>>16&255))){if((64&O)==0){R=C[(65535&R)+(v&(1<<O)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(L=65535&R,k<(O&=15)&&(v+=_[l++]<<k,(k+=8)<O&&(v+=_[l++]<<k,k+=8)),f<(L+=v&(1<<O)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=O,k-=O,(O=u-h)<L){if(m<(O=L-O)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=g,(E=0)===y){if(E+=x-O,O<P){for(P-=O;D[u++]=g[E++],--O;);E=u-L,M=D}}else if(y<O){if(E+=x+y-O,(O-=y)<P){for(P-=O;D[u++]=g[E++],--O;);if(E=0,y<P){for(P-=O=y;D[u++]=g[E++],--O;);E=u-L,M=D}}}else if(E+=y-O,O<P){for(P-=O;D[u++]=g[E++],--O;);E=u-L,M=D}for(;2<P;)D[u++]=M[E++],D[u++]=M[E++],D[u++]=M[E++],P-=3;P&&(D[u++]=M[E++],1<P&&(D[u++]=M[E++]))}else{for(E=u-L;D[u++]=D[E++],D[u++]=D[E++],D[u++]=D[E++],2<(P-=3););P&&(D[u++]=D[E++],1<P&&(D[u++]=D[E++]))}break}}break}}while(l<c&&u<p);l-=P=k>>3,v&=(1<<(k-=P<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=v,a.bits=k}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,h=2,p=0,f=-2,x=1,m=852,y=592;function g(E){return(E>>>24&255)+(E>>>8&65280)+((65280&E)<<8)+((255&E)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(E){var M;return E&&E.state?(M=E.state,E.total_in=E.total_out=M.total=0,E.msg="",M.wrap&&(E.adler=1&M.wrap),M.mode=x,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(m),M.distcode=M.distdyn=new i.Buf32(y),M.sane=1,M.back=-1,p):f}function S(E){var M;return E&&E.state?((M=E.state).wsize=0,M.whave=0,M.wnext=0,k(E)):f}function C(E,M){var _,D;return E&&E.state?(D=E.state,M<0?(_=0,M=-M):(_=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?f:(D.window!==null&&D.wbits!==M&&(D.window=null),D.wrap=_,D.wbits=M,S(E))):f}function N(E,M){var _,D;return E?(D=new v,(E.state=D).window=null,(_=C(E,M))!==p&&(E.state=null),_):f}var A,R,O=!0;function P(E){if(O){var M;for(A=new i.Buf32(512),R=new i.Buf32(32),M=0;M<144;)E.lens[M++]=8;for(;M<256;)E.lens[M++]=9;for(;M<280;)E.lens[M++]=7;for(;M<288;)E.lens[M++]=8;for(c(u,E.lens,0,288,A,0,E.work,{bits:9}),M=0;M<32;)E.lens[M++]=5;c(h,E.lens,0,32,R,0,E.work,{bits:5}),O=!1}E.lencode=A,E.lenbits=9,E.distcode=R,E.distbits=5}function L(E,M,_,D){var J,Z=E.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new i.Buf8(Z.wsize)),D>=Z.wsize?(i.arraySet(Z.window,M,_-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(D<(J=Z.wsize-Z.wnext)&&(J=D),i.arraySet(Z.window,M,_-D,J,Z.wnext),(D-=J)?(i.arraySet(Z.window,M,_-D,D,0),Z.wnext=D,Z.whave=Z.wsize):(Z.wnext+=J,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=J))),0}o.inflateReset=S,o.inflateReset2=C,o.inflateResetKeep=k,o.inflateInit=function(E){return N(E,15)},o.inflateInit2=N,o.inflate=function(E,M){var _,D,J,Z,W,q,j,U,B,T,ee,re,ve,ie,de,ge,te,oe,me,Ee,b,K,H,z,I=0,F=new i.Buf8(4),X=[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;(_=E.state).mode===12&&(_.mode=13),W=E.next_out,J=E.output,j=E.avail_out,Z=E.next_in,D=E.input,q=E.avail_in,U=_.hold,B=_.bits,T=q,ee=j,K=p;e:for(;;)switch(_.mode){case x:if(_.wrap===0){_.mode=13;break}for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(2&_.wrap&&U===35615){F[_.check=0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0),B=U=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&U)<<8)+(U>>8))%31){E.msg="incorrect header check",_.mode=30;break}if((15&U)!=8){E.msg="unknown compression method",_.mode=30;break}if(B-=4,b=8+(15&(U>>>=4)),_.wbits===0)_.wbits=b;else if(b>_.wbits){E.msg="invalid window size",_.mode=30;break}_.dmax=1<<b,E.adler=_.check=1,_.mode=512&U?10:12,B=U=0;break;case 2:for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(_.flags=U,(255&_.flags)!=8){E.msg="unknown compression method",_.mode=30;break}if(57344&_.flags){E.msg="unknown header flags set",_.mode=30;break}_.head&&(_.head.text=U>>8&1),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=3;case 3:for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.head&&(_.head.time=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,F[2]=U>>>16&255,F[3]=U>>>24&255,_.check=a(_.check,F,4,0)),B=U=0,_.mode=4;case 4:for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.head&&(_.head.xflags=255&U,_.head.os=U>>8),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=5;case 5:if(1024&_.flags){for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.length=U,_.head&&(_.head.extra_len=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(q<(re=_.length)&&(re=q),re&&(_.head&&(b=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),i.arraySet(_.head.extra,D,Z,re,b)),512&_.flags&&(_.check=a(_.check,D,re,Z)),q-=re,Z+=re,_.length-=re),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(q===0)break e;for(re=0;b=D[Z+re++],_.head&&b&&_.length<65536&&(_.head.name+=String.fromCharCode(b)),b&&re<q;);if(512&_.flags&&(_.check=a(_.check,D,re,Z)),q-=re,Z+=re,b)break e}else _.head&&(_.head.name=null);_.length=0,_.mode=8;case 8:if(4096&_.flags){if(q===0)break e;for(re=0;b=D[Z+re++],_.head&&b&&_.length<65536&&(_.head.comment+=String.fromCharCode(b)),b&&re<q;);if(512&_.flags&&(_.check=a(_.check,D,re,Z)),q-=re,Z+=re,b)break e}else _.head&&(_.head.comment=null);_.mode=9;case 9:if(512&_.flags){for(;B<16;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U!==(65535&_.check)){E.msg="header crc mismatch",_.mode=30;break}B=U=0}_.head&&(_.head.hcrc=_.flags>>9&1,_.head.done=!0),E.adler=_.check=0,_.mode=12;break;case 10:for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}E.adler=_.check=g(U),B=U=0,_.mode=11;case 11:if(_.havedict===0)return E.next_out=W,E.avail_out=j,E.next_in=Z,E.avail_in=q,_.hold=U,_.bits=B,2;E.adler=_.check=1,_.mode=12;case 12:if(M===5||M===6)break e;case 13:if(_.last){U>>>=7&B,B-=7&B,_.mode=27;break}for(;B<3;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}switch(_.last=1&U,B-=1,3&(U>>>=1)){case 0:_.mode=14;break;case 1:if(P(_),_.mode=20,M!==6)break;U>>>=2,B-=2;break e;case 2:_.mode=17;break;case 3:E.msg="invalid block type",_.mode=30}U>>>=2,B-=2;break;case 14:for(U>>>=7&B,B-=7&B;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if((65535&U)!=(U>>>16^65535)){E.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&U,B=U=0,_.mode=15,M===6)break e;case 15:_.mode=16;case 16:if(re=_.length){if(q<re&&(re=q),j<re&&(re=j),re===0)break e;i.arraySet(J,D,Z,re,W),q-=re,Z+=re,j-=re,W+=re,_.length-=re;break}_.mode=12;break;case 17:for(;B<14;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(_.nlen=257+(31&U),U>>>=5,B-=5,_.ndist=1+(31&U),U>>>=5,B-=5,_.ncode=4+(15&U),U>>>=4,B-=4,286<_.nlen||30<_.ndist){E.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;B<3;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.lens[X[_.have++]]=7&U,U>>>=3,B-=3}for(;_.have<19;)_.lens[X[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,H={bits:_.lenbits},K=c(0,_.lens,0,19,_.lencode,0,_.work,H),_.lenbits=H.bits,K){E.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;ge=(I=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,te=65535&I,!((de=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(te<16)U>>>=de,B-=de,_.lens[_.have++]=te;else{if(te===16){for(z=de+2;B<z;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U>>>=de,B-=de,_.have===0){E.msg="invalid bit length repeat",_.mode=30;break}b=_.lens[_.have-1],re=3+(3&U),U>>>=2,B-=2}else if(te===17){for(z=de+3;B<z;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}B-=de,b=0,re=3+(7&(U>>>=de)),U>>>=3,B-=3}else{for(z=de+7;B<z;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}B-=de,b=0,re=11+(127&(U>>>=de)),U>>>=7,B-=7}if(_.have+re>_.nlen+_.ndist){E.msg="invalid bit length repeat",_.mode=30;break}for(;re--;)_.lens[_.have++]=b}}if(_.mode===30)break;if(_.lens[256]===0){E.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,H={bits:_.lenbits},K=c(u,_.lens,0,_.nlen,_.lencode,0,_.work,H),_.lenbits=H.bits,K){E.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,H={bits:_.distbits},K=c(h,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,H),_.distbits=H.bits,K){E.msg="invalid distances set",_.mode=30;break}if(_.mode=20,M===6)break e;case 20:_.mode=21;case 21:if(6<=q&&258<=j){E.next_out=W,E.avail_out=j,E.next_in=Z,E.avail_in=q,_.hold=U,_.bits=B,l(E,ee),W=E.next_out,J=E.output,j=E.avail_out,Z=E.next_in,D=E.input,q=E.avail_in,U=_.hold,B=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;ge=(I=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,te=65535&I,!((de=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(ge&&(240&ge)==0){for(oe=de,me=ge,Ee=te;ge=(I=_.lencode[Ee+((U&(1<<oe+me)-1)>>oe)])>>>16&255,te=65535&I,!(oe+(de=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}U>>>=oe,B-=oe,_.back+=oe}if(U>>>=de,B-=de,_.back+=de,_.length=te,ge===0){_.mode=26;break}if(32&ge){_.back=-1,_.mode=12;break}if(64&ge){E.msg="invalid literal/length code",_.mode=30;break}_.extra=15&ge,_.mode=22;case 22:if(_.extra){for(z=_.extra;B<z;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.length+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;ge=(I=_.distcode[U&(1<<_.distbits)-1])>>>16&255,te=65535&I,!((de=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if((240&ge)==0){for(oe=de,me=ge,Ee=te;ge=(I=_.distcode[Ee+((U&(1<<oe+me)-1)>>oe)])>>>16&255,te=65535&I,!(oe+(de=I>>>24)<=B);){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}U>>>=oe,B-=oe,_.back+=oe}if(U>>>=de,B-=de,_.back+=de,64&ge){E.msg="invalid distance code",_.mode=30;break}_.offset=te,_.extra=15&ge,_.mode=24;case 24:if(_.extra){for(z=_.extra;B<z;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}_.offset+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){E.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(j===0)break e;if(re=ee-j,_.offset>re){if((re=_.offset-re)>_.whave&&_.sane){E.msg="invalid distance too far back",_.mode=30;break}ve=re>_.wnext?(re-=_.wnext,_.wsize-re):_.wnext-re,re>_.length&&(re=_.length),ie=_.window}else ie=J,ve=W-_.offset,re=_.length;for(j<re&&(re=j),j-=re,_.length-=re;J[W++]=ie[ve++],--re;);_.length===0&&(_.mode=21);break;case 26:if(j===0)break e;J[W++]=_.length,j--,_.mode=21;break;case 27:if(_.wrap){for(;B<32;){if(q===0)break e;q--,U|=D[Z++]<<B,B+=8}if(ee-=j,E.total_out+=ee,_.total+=ee,ee&&(E.adler=_.check=_.flags?a(_.check,J,ee,W-ee):s(_.check,J,ee,W-ee)),ee=j,(_.flags?U:g(U))!==_.check){E.msg="incorrect data check",_.mode=30;break}B=U=0}_.mode=28;case 28:if(_.wrap&&_.flags){for(;B<32;){if(q===0)break e;q--,U+=D[Z++]<<B,B+=8}if(U!==(4294967295&_.total)){E.msg="incorrect length check",_.mode=30;break}B=U=0}_.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;default:return f}return E.next_out=W,E.avail_out=j,E.next_in=Z,E.avail_in=q,_.hold=U,_.bits=B,(_.wsize||ee!==E.avail_out&&_.mode<30&&(_.mode<27||M!==4))&&L(E,E.output,E.next_out,ee-E.avail_out)?(_.mode=31,-4):(T-=E.avail_in,ee-=E.avail_out,E.total_in+=T,E.total_out+=ee,_.total+=ee,_.wrap&&ee&&(E.adler=_.check=_.flags?a(_.check,J,ee,E.next_out-ee):s(_.check,J,ee,E.next_out-ee)),E.data_type=_.bits+(_.last?64:0)+(_.mode===12?128:0)+(_.mode===20||_.mode===15?256:0),(T==0&&ee===0||M===4)&&K===p&&(K=-5),K)},o.inflateEnd=function(E){if(!E||!E.state)return f;var M=E.state;return M.window&&(M.window=null),E.state=null,p},o.inflateGetHeader=function(E,M){var _;return E&&E.state?(2&(_=E.state).wrap)==0?f:((_.head=M).done=!1,p):f},o.inflateSetDictionary=function(E,M){var _,D=M.length;return E&&E.state?(_=E.state).wrap!==0&&_.mode!==11?f:_.mode===11&&s(1,M,D,0)!==_.check?-3:L(E,M,D,D)?(_.mode=31,-4):(_.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],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,h,p,f,x,m,y,g){var v,k,S,C,N,A,R,O,P,L=g.bits,E=0,M=0,_=0,D=0,J=0,Z=0,W=0,q=0,j=0,U=0,B=null,T=0,ee=new i.Buf16(16),re=new i.Buf16(16),ve=null,ie=0;for(E=0;E<=15;E++)ee[E]=0;for(M=0;M<f;M++)ee[h[p+M]]++;for(J=L,D=15;1<=D&&ee[D]===0;D--);if(D<J&&(J=D),D===0)return x[m++]=20971520,x[m++]=20971520,g.bits=1,0;for(_=1;_<D&&ee[_]===0;_++);for(J<_&&(J=_),E=q=1;E<=15;E++)if(q<<=1,(q-=ee[E])<0)return-1;if(0<q&&(u===0||D!==1))return-1;for(re[1]=0,E=1;E<15;E++)re[E+1]=re[E]+ee[E];for(M=0;M<f;M++)h[p+M]!==0&&(y[re[h[p+M]]++]=M);if(A=u===0?(B=ve=y,19):u===1?(B=s,T-=257,ve=a,ie-=257,256):(B=l,ve=c,-1),E=_,N=m,W=M=U=0,S=-1,C=(j=1<<(Z=J))-1,u===1&&852<j||u===2&&592<j)return 1;for(;;){for(R=E-W,P=y[M]<A?(O=0,y[M]):y[M]>A?(O=ve[ie+y[M]],B[T+y[M]]):(O=96,0),v=1<<E-W,_=k=1<<Z;x[N+(U>>W)+(k-=v)]=R<<24|O<<16|P|0,k!==0;);for(v=1<<E-1;U&v;)v>>=1;if(v!==0?(U&=v-1,U+=v):U=0,M++,--ee[E]==0){if(E===D)break;E=h[p+y[M]]}if(J<E&&(U&C)!==S){for(W===0&&(W=J),N+=_,q=1<<(Z=E-W);Z+W<D&&!((q-=ee[Z+W])<=0);)Z++,q<<=1;if(j+=1<<Z,u===1&&852<j||u===2&&592<j)return 1;x[S=U&C]=J<<24|Z<<16|N-m|0}}return U!==0&&(x[N+U]=E-W<<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(I){for(var F=I.length;0<=--F;)I[F]=0}var c=0,u=29,h=256,p=h+1+u,f=30,x=19,m=2*p+1,y=15,g=16,v=7,k=256,S=16,C=17,N=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],R=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],L=new Array(2*(p+2));l(L);var E=new Array(2*f);l(E);var M=new Array(512);l(M);var _=new Array(256);l(_);var D=new Array(u);l(D);var J,Z,W,q=new Array(f);function j(I,F,X,ne,V){this.static_tree=I,this.extra_bits=F,this.extra_base=X,this.elems=ne,this.max_length=V,this.has_stree=I&&I.length}function U(I,F){this.dyn_tree=I,this.max_code=0,this.stat_desc=F}function B(I){return I<256?M[I]:M[256+(I>>>7)]}function T(I,F){I.pending_buf[I.pending++]=255&F,I.pending_buf[I.pending++]=F>>>8&255}function ee(I,F,X){I.bi_valid>g-X?(I.bi_buf|=F<<I.bi_valid&65535,T(I,I.bi_buf),I.bi_buf=F>>g-I.bi_valid,I.bi_valid+=X-g):(I.bi_buf|=F<<I.bi_valid&65535,I.bi_valid+=X)}function re(I,F,X){ee(I,X[2*F],X[2*F+1])}function ve(I,F){for(var X=0;X|=1&I,I>>>=1,X<<=1,0<--F;);return X>>>1}function ie(I,F,X){var ne,V,ae=new Array(y+1),fe=0;for(ne=1;ne<=y;ne++)ae[ne]=fe=fe+X[ne-1]<<1;for(V=0;V<=F;V++){var le=I[2*V+1];le!==0&&(I[2*V]=ve(ae[le]++,le))}}function de(I){var F;for(F=0;F<p;F++)I.dyn_ltree[2*F]=0;for(F=0;F<f;F++)I.dyn_dtree[2*F]=0;for(F=0;F<x;F++)I.bl_tree[2*F]=0;I.dyn_ltree[2*k]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function ge(I){8<I.bi_valid?T(I,I.bi_buf):0<I.bi_valid&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function te(I,F,X,ne){var V=2*F,ae=2*X;return I[V]<I[ae]||I[V]===I[ae]&&ne[F]<=ne[X]}function oe(I,F,X){for(var ne=I.heap[X],V=X<<1;V<=I.heap_len&&(V<I.heap_len&&te(F,I.heap[V+1],I.heap[V],I.depth)&&V++,!te(F,ne,I.heap[V],I.depth));)I.heap[X]=I.heap[V],X=V,V<<=1;I.heap[X]=ne}function me(I,F,X){var ne,V,ae,fe,le=0;if(I.last_lit!==0)for(;ne=I.pending_buf[I.d_buf+2*le]<<8|I.pending_buf[I.d_buf+2*le+1],V=I.pending_buf[I.l_buf+le],le++,ne===0?re(I,V,F):(re(I,(ae=_[V])+h+1,F),(fe=A[ae])!==0&&ee(I,V-=D[ae],fe),re(I,ae=B(--ne),X),(fe=R[ae])!==0&&ee(I,ne-=q[ae],fe)),le<I.last_lit;);re(I,k,F)}function Ee(I,F){var X,ne,V,ae=F.dyn_tree,fe=F.stat_desc.static_tree,le=F.stat_desc.has_stree,$=F.stat_desc.elems,Q=-1;for(I.heap_len=0,I.heap_max=m,X=0;X<$;X++)ae[2*X]!==0?(I.heap[++I.heap_len]=Q=X,I.depth[X]=0):ae[2*X+1]=0;for(;I.heap_len<2;)ae[2*(V=I.heap[++I.heap_len]=Q<2?++Q:0)]=1,I.depth[V]=0,I.opt_len--,le&&(I.static_len-=fe[2*V+1]);for(F.max_code=Q,X=I.heap_len>>1;1<=X;X--)oe(I,ae,X);for(V=$;X=I.heap[1],I.heap[1]=I.heap[I.heap_len--],oe(I,ae,1),ne=I.heap[1],I.heap[--I.heap_max]=X,I.heap[--I.heap_max]=ne,ae[2*V]=ae[2*X]+ae[2*ne],I.depth[V]=(I.depth[X]>=I.depth[ne]?I.depth[X]:I.depth[ne])+1,ae[2*X+1]=ae[2*ne+1]=V,I.heap[1]=V++,oe(I,ae,1),2<=I.heap_len;);I.heap[--I.heap_max]=I.heap[1],(function(ue,be){var Ie,Ze,st,ze,_t,Ot,Be=be.dyn_tree,Dt=be.max_code,xt=be.stat_desc.static_tree,Zh=be.stat_desc.has_stree,Vh=be.stat_desc.extra_bits,Ks=be.stat_desc.extra_base,Hn=be.stat_desc.max_length,vr=0;for(ze=0;ze<=y;ze++)ue.bl_count[ze]=0;for(Be[2*ue.heap[ue.heap_max]+1]=0,Ie=ue.heap_max+1;Ie<m;Ie++)Hn<(ze=Be[2*Be[2*(Ze=ue.heap[Ie])+1]+1]+1)&&(ze=Hn,vr++),Be[2*Ze+1]=ze,Dt<Ze||(ue.bl_count[ze]++,_t=0,Ks<=Ze&&(_t=Vh[Ze-Ks]),Ot=Be[2*Ze],ue.opt_len+=Ot*(ze+_t),Zh&&(ue.static_len+=Ot*(xt[2*Ze+1]+_t)));if(vr!==0){do{for(ze=Hn-1;ue.bl_count[ze]===0;)ze--;ue.bl_count[ze]--,ue.bl_count[ze+1]+=2,ue.bl_count[Hn]--,vr-=2}while(0<vr);for(ze=Hn;ze!==0;ze--)for(Ze=ue.bl_count[ze];Ze!==0;)Dt<(st=ue.heap[--Ie])||(Be[2*st+1]!==ze&&(ue.opt_len+=(ze-Be[2*st+1])*Be[2*st],Be[2*st+1]=ze),Ze--)}})(I,F),ie(ae,Q,I.bl_count)}function b(I,F,X){var ne,V,ae=-1,fe=F[1],le=0,$=7,Q=4;for(fe===0&&($=138,Q=3),F[2*(X+1)+1]=65535,ne=0;ne<=X;ne++)V=fe,fe=F[2*(ne+1)+1],++le<$&&V===fe||(le<Q?I.bl_tree[2*V]+=le:V!==0?(V!==ae&&I.bl_tree[2*V]++,I.bl_tree[2*S]++):le<=10?I.bl_tree[2*C]++:I.bl_tree[2*N]++,ae=V,Q=(le=0)===fe?($=138,3):V===fe?($=6,3):($=7,4))}function K(I,F,X){var ne,V,ae=-1,fe=F[1],le=0,$=7,Q=4;for(fe===0&&($=138,Q=3),ne=0;ne<=X;ne++)if(V=fe,fe=F[2*(ne+1)+1],!(++le<$&&V===fe)){if(le<Q)for(;re(I,V,I.bl_tree),--le!=0;);else V!==0?(V!==ae&&(re(I,V,I.bl_tree),le--),re(I,S,I.bl_tree),ee(I,le-3,2)):le<=10?(re(I,C,I.bl_tree),ee(I,le-3,3)):(re(I,N,I.bl_tree),ee(I,le-11,7));ae=V,Q=(le=0)===fe?($=138,3):V===fe?($=6,3):($=7,4)}}l(q);var H=!1;function z(I,F,X,ne){ee(I,(c<<1)+(ne?1:0),3),(function(V,ae,fe,le){ge(V),T(V,fe),T(V,~fe),i.arraySet(V.pending_buf,V.window,ae,fe,V.pending),V.pending+=fe})(I,F,X)}o._tr_init=function(I){H||((function(){var F,X,ne,V,ae,fe=new Array(y+1);for(V=ne=0;V<u-1;V++)for(D[V]=ne,F=0;F<1<<A[V];F++)_[ne++]=V;for(_[ne-1]=V,V=ae=0;V<16;V++)for(q[V]=ae,F=0;F<1<<R[V];F++)M[ae++]=V;for(ae>>=7;V<f;V++)for(q[V]=ae<<7,F=0;F<1<<R[V]-7;F++)M[256+ae++]=V;for(X=0;X<=y;X++)fe[X]=0;for(F=0;F<=143;)L[2*F+1]=8,F++,fe[8]++;for(;F<=255;)L[2*F+1]=9,F++,fe[9]++;for(;F<=279;)L[2*F+1]=7,F++,fe[7]++;for(;F<=287;)L[2*F+1]=8,F++,fe[8]++;for(ie(L,p+1,fe),F=0;F<f;F++)E[2*F+1]=5,E[2*F]=ve(F,5);J=new j(L,A,h+1,p,y),Z=new j(E,R,0,f,y),W=new j(new Array(0),O,0,x,v)})(),H=!0),I.l_desc=new U(I.dyn_ltree,J),I.d_desc=new U(I.dyn_dtree,Z),I.bl_desc=new U(I.bl_tree,W),I.bi_buf=0,I.bi_valid=0,de(I)},o._tr_stored_block=z,o._tr_flush_block=function(I,F,X,ne){var V,ae,fe=0;0<I.level?(I.strm.data_type===2&&(I.strm.data_type=(function(le){var $,Q=4093624447;for($=0;$<=31;$++,Q>>>=1)if(1&Q&&le.dyn_ltree[2*$]!==0)return s;if(le.dyn_ltree[18]!==0||le.dyn_ltree[20]!==0||le.dyn_ltree[26]!==0)return a;for($=32;$<h;$++)if(le.dyn_ltree[2*$]!==0)return a;return s})(I)),Ee(I,I.l_desc),Ee(I,I.d_desc),fe=(function(le){var $;for(b(le,le.dyn_ltree,le.l_desc.max_code),b(le,le.dyn_dtree,le.d_desc.max_code),Ee(le,le.bl_desc),$=x-1;3<=$&&le.bl_tree[2*P[$]+1]===0;$--);return le.opt_len+=3*($+1)+5+5+4,$})(I),V=I.opt_len+3+7>>>3,(ae=I.static_len+3+7>>>3)<=V&&(V=ae)):V=ae=X+5,X+4<=V&&F!==-1?z(I,F,X,ne):I.strategy===4||ae===V?(ee(I,2+(ne?1:0),3),me(I,L,E)):(ee(I,4+(ne?1:0),3),(function(le,$,Q,ue){var be;for(ee(le,$-257,5),ee(le,Q-1,5),ee(le,ue-4,4),be=0;be<ue;be++)ee(le,le.bl_tree[2*P[be]+1],3);K(le,le.dyn_ltree,$-1),K(le,le.dyn_dtree,Q-1)})(I,I.l_desc.max_code+1,I.d_desc.max_code+1,fe+1),me(I,I.dyn_ltree,I.dyn_dtree)),de(I),ne&&ge(I)},o._tr_tally=function(I,F,X){return I.pending_buf[I.d_buf+2*I.last_lit]=F>>>8&255,I.pending_buf[I.d_buf+2*I.last_lit+1]=255&F,I.pending_buf[I.l_buf+I.last_lit]=255&X,I.last_lit++,F===0?I.dyn_ltree[2*X]++:(I.matches++,F--,I.dyn_ltree[2*(_[X]+h+1)]++,I.dyn_dtree[2*B(F)]++),I.last_lit===I.lit_bufsize-1},o._tr_align=function(I){ee(I,2,3),re(I,k,L),(function(F){F.bi_valid===16?(T(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(I)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,h,p=1,f={},x=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,C=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=C,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){u.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(S){var C=m.createElement("script");C.onreadystatechange=function(){v(S),C.onreadystatechange=null,c.removeChild(C),C=null},c.appendChild(C)}):function(S){setTimeout(v,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var C=new Array(arguments.length-1),N=0;N<C.length;N++)C[N]=arguments[N+1];var A={callback:S,args:C};return f[p]=A,l(p),p++},y.clearImmediate=g}function g(S){delete f[S]}function v(S){if(x)setTimeout(v,0,S);else{var C=f[S];if(C){x=!0;try{(function(N){var A=N.callback,R=N.args;switch(R.length){case 0:A();break;case 1:A(R[0]);break;case 2:A(R[0],R[1]);break;case 3:A(R[0],R[1],R[2]);break;default:A.apply(a,R)}})(C)}finally{g(S),x=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&v(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof br<"u"?br:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Do)),Do.exports}var ab=sb();const lb=qi(ab);async function cb(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 ub(e){const t=new lb;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 cb(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.11.7",fb={version:db};function hu(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=hu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=hu(e))&&(r&&(r+=" "),r+=t);return r}const hb=(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},pb=(e,t)=>({classGroupId:e,validator:t}),mu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qr="-",Ea=[],mb="arbitrary..",gb=e=>{const t=yb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return xb(s);const a=s.split(qr),l=a[0]===""&&a.length>1?1:0;return gu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],c=n[s];return l?c?hb(c,l):l:c||Ea}return n[s]||Ea}}},gu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=gu(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(qr):e.slice(t).join(qr),l=s.length;for(let c=0;c<l;c++){const u=s[c];if(u.validator(a))return u.classGroupId}},xb=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?mb+r:void 0})(),yb=e=>{const{theme:t,classGroups:n}=e;return vb(n,t)},vb=(e,t)=>{const n=mu();for(const r in e){const o=e[r];is(o,n,r,t)}return n},is=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];bb(s,t,n,r)}},bb=(e,t,n,r)=>{if(typeof e=="string"){wb(e,t,n);return}if(typeof e=="function"){_b(e,t,n,r);return}kb(e,t,n,r)},wb=(e,t,n)=>{const r=e===""?t:xu(t,e);r.classGroupId=n},_b=(e,t,n,r)=>{if(Sb(e)){is(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pb(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];is(l,xu(t,a),n,r)}},xu=(e,t)=>{let n=e;const r=t.split(qr),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=mu(),n.nextPart.set(s,a)),n=a}return n},Sb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Cb=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)}}},vi="!",Na=":",Eb=[],Ta=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Nb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;const u=o.length;for(let m=0;m<u;m++){const y=o[m];if(s===0&&a===0){if(y===Na){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,f=!1;h.endsWith(vi)?(p=h.slice(0,-1),f=!0):h.startsWith(vi)&&(p=h.slice(1),f=!0);const x=c&&c>l?c-l:void 0;return Ta(i,f,p,x)};if(t){const o=t+Na,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Ta(Eb,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Tb=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}},jb=e=>({cache:Cb(e.cacheSize),parseClassName:Nb(e),sortModifiers:Tb(e),...gb(e)}),Ab=/\s+/,Ib=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Ab);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:m}=n(u);if(h){l=u+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?x.substring(0,m):x);if(!g){if(!y){l=u+(l.length>0?" "+l:l);continue}if(g=r(x),!g){l=u+(l.length>0?" "+l:l);continue}y=!1}const v=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=f?v+vi:v,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(g,y);for(let N=0;N<C.length;++N){const A=C[N];s.push(k+A)}l=u+(l.length>0?" "+l:l)}return l},zb=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=yu(n))&&(o&&(o+=" "),o+=r);return o},yu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=yu(e[r]))&&(n&&(n+=" "),n+=t);return n},Pb=(e,...t)=>{let n,r,o,i;const s=l=>{const c=t.reduce((u,h)=>h(u),e());return n=jb(c),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=Ib(l,n);return o(l,u),u};return i=s,(...l)=>i(zb(...l))},Rb=[],He=e=>{const t=n=>n[e]||Rb;return t.isThemeGetter=!0,t},vu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,bu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ob=/^\d+\/\d+$/,Db=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mb=/\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$/,Lb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pn=e=>Ob.test(e),je=e=>!!e&&!Number.isNaN(Number(e)),Ut=e=>!!e&&Number.isInteger(Number(e)),Mo=e=>e.endsWith("%")&&je(e.slice(0,-1)),Mt=e=>Db.test(e),Bb=()=>!0,Ub=e=>Mb.test(e)&&!Lb.test(e),wu=()=>!1,Zb=e=>Fb.test(e),Vb=e=>$b.test(e),Wb=e=>!he(e)&&!pe(e),Hb=e=>Fn(e,Su,wu),he=e=>vu.test(e),nn=e=>Fn(e,Cu,Ub),Lo=e=>Fn(e,Yb,je),ja=e=>Fn(e,_u,wu),qb=e=>Fn(e,ku,Vb),Cr=e=>Fn(e,Eu,Zb),pe=e=>bu.test(e),Gn=e=>$n(e,Cu),Gb=e=>$n(e,Xb),Aa=e=>$n(e,_u),Kb=e=>$n(e,Su),Jb=e=>$n(e,ku),Er=e=>$n(e,Eu,!0),Fn=(e,t,n)=>{const r=vu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$n=(e,t,n=!1)=>{const r=bu.exec(e);return r?r[1]?t(r[1]):n:!1},_u=e=>e==="position"||e==="percentage",ku=e=>e==="image"||e==="url",Su=e=>e==="length"||e==="size"||e==="bg-size",Cu=e=>e==="length",Yb=e=>e==="number",Xb=e=>e==="family-name",Eu=e=>e==="shadow",Qb=()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),s=He("breakpoint"),a=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),h=He("inset-shadow"),p=He("text-shadow"),f=He("drop-shadow"),x=He("blur"),m=He("perspective"),y=He("aspect"),g=He("ease"),v=He("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),pe,he],N=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],R=()=>[pe,he,l],O=()=>[pn,"full","auto",...R()],P=()=>[Ut,"none","subgrid",pe,he],L=()=>["auto",{span:["full",Ut,pe,he]},Ut,pe,he],E=()=>[Ut,"auto",pe,he],M=()=>["auto","min","max","fr",pe,he],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...R()],Z=()=>[pn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],W=()=>[e,pe,he],q=()=>[...S(),Aa,ja,{position:[pe,he]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",Kb,Hb,{size:[pe,he]}],B=()=>[Mo,Gn,nn],T=()=>["","none","full",c,pe,he],ee=()=>["",je,Gn,nn],re=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[je,Mo,Aa,ja],de=()=>["","none",x,pe,he],ge=()=>["none",je,pe,he],te=()=>["none",je,pe,he],oe=()=>[je,pe,he],me=()=>[pn,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mt],breakpoint:[Mt],color:[Bb],container:[Mt],"drop-shadow":[Mt],ease:["in","out","in-out"],font:[Wb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mt],shadow:[Mt],spacing:["px",je],text:[Mt],"text-shadow":[Mt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pn,he,pe,y]}],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:C()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Ut,"auto",pe,he]}],basis:[{basis:[pn,"full","auto",a,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[je,pn,"auto","initial","none",he]}],grow:[{grow:["",je,pe,he]}],shrink:[{shrink:["",je,pe,he]}],order:[{order:[Ut,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:L()}],"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":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],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":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Gn,nn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pe,Lo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mo,he]}],"font-family":[{font:[Gb,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,Lo]}],leading:[{leading:[i,...R()]}],"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:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[je,"from-font","auto",pe,nn]}],"text-decoration-color":[{decoration:W()}],"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:R()}],"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:q()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ut,pe,he],radial:["",pe,he],conic:[Ut,pe,he]},Jb,qb]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[je,pe,he]}],"outline-w":[{outline:["",je,Gn,nn]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",u,Er,Cr]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",h,Er,Cr]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[je,nn]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",p,Er,Cr]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[je,pe,he]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[je]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:de()}],brightness:[{brightness:[je,pe,he]}],contrast:[{contrast:[je,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",f,Er,Cr]}],"drop-shadow-color":[{"drop-shadow":W()}],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":de()}],"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":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"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",v,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,pe,he]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",...W()]}],"stroke-w":[{stroke:[je,Gn,nn,Lo]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},e1=Pb(Qb);function Se(...e){return e1(pu(e))}function Je(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Nu(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ia=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,za=pu,ss=(e,t)=>n=>{var r;if(t?.variants==null)return za(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],h=i?.[c];if(u===null)return null;const p=Ia(u)||Ia(h);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[h,p]=u;return p===void 0||(c[h]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:h,className:p,...f}=u;return Object.entries(f).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,h,p]:c},[]);return za(e,s,l,n?.class,n?.className)};function Pa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tu(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Pa(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():Pa(e[o],null)}}}}function Re(...e){return w.useCallback(Tu(...e),e)}function Pn(e){const t=n1(e),n=w.forwardRef((r,o)=>{const{children:i,...s}=r,a=w.Children.toArray(i),l=a.find(o1);if(l){const c=l.props.children,u=a.map(h=>h===l?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:h);return d.jsx(t,{...s,ref:o,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var t1=Pn("Slot");function n1(e){const t=w.forwardRef((n,r)=>{const{children:o,...i}=n;if(w.isValidElement(o)){const s=s1(o),a=i1(i,o.props);return o.type!==w.Fragment&&(a.ref=r?Tu(r,s):s),w.cloneElement(o,a)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ju=Symbol("radix.slottable");function r1(e){const t=({children:n})=>d.jsx(d.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ju,t}function o1(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ju}function i1(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 s1(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=a1.reduce((e,t)=>{const n=Pn(`Primitive.${t}`),r=w.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l1(e,t){e&&dr.flushSync(()=>e.dispatchEvent(t))}var Au=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"}),c1="VisuallyHidden",Iu=w.forwardRef((e,t)=>d.jsx(Ce.span,{...e,ref:t,style:{...Au,...e.style}}));Iu.displayName=c1;var u1=Iu;function d1(e,t){const n=w.createContext(t),r=i=>{const{children:s,...a}=i,l=w.useMemo(()=>a,Object.values(a));return d.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=w.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 Bt(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];const c=h=>{const{scope:p,children:f,...x}=h,m=p?.[e]?.[l]||a,y=w.useMemo(()=>x,Object.values(x));return d.jsx(m.Provider,{value:y,children:f})};c.displayName=i+"Provider";function u(h,p){const f=p?.[e]?.[l]||a,x=w.useContext(f);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=a?.[e]||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,f1(o,...t)]}function f1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(i)[`__scope${c}`];return{...a,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function zu(e){const t=e+"CollectionProvider",[n,r]=Bt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:g}=m,v=nt.useRef(null),k=nt.useRef(new Map).current;return d.jsx(o,{scope:y,itemMap:k,collectionRef:v,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Pn(a),c=nt.forwardRef((m,y)=>{const{scope:g,children:v}=m,k=i(a,g),S=Re(y,k.collectionRef);return d.jsx(l,{ref:S,children:v})});c.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=Pn(u),f=nt.forwardRef((m,y)=>{const{scope:g,children:v,...k}=m,S=nt.useRef(null),C=Re(y,S),N=i(u,g);return nt.useEffect(()=>(N.itemMap.set(S,{ref:S,...k}),()=>{N.itemMap.delete(S)})),d.jsx(p,{[h]:"",ref:C,children:v})});f.displayName=u;function x(m){const y=i(e+"CollectionConsumer",m);return nt.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,A)=>k.indexOf(N.ref.current)-k.indexOf(A.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},x,r]}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qe=globalThis?.document?w.useLayoutEffect:()=>{},h1=mc[" useInsertionEffect ".trim().toString()]||qe;function rn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=p1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=w.useRef(e!==void 0);w.useEffect(()=>{const h=u.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.`),u.current=a},[a,r])}const c=w.useCallback(u=>{if(a){const h=m1(u)?u(e):u;h!==e&&s.current?.(h)}else i(u)},[a,e,i,s]);return[l,c]}function p1({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),o=w.useRef(n),i=w.useRef(t);return h1(()=>{i.current=t},[t]),w.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function m1(e){return typeof e=="function"}function g1(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var mt=e=>{const{present:t,children:n}=e,r=x1(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Re(r.ref,y1(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};mt.displayName="Presence";function x1(e){const[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=g1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Nr(r.current);i.current=a==="mounted"?c:"none"},[a]),qe(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,f=Nr(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qe(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,h=f=>{const m=Nr(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=f=>{f.target===t&&(i.current=Nr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Nr(e){return e?.animationName||"none"}function y1(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=mc[" useId ".trim().toString()]||(()=>{}),b1=0;function Nt(e){const[t,n]=w.useState(v1());return qe(()=>{n(r=>r??String(b1++))},[e]),e||(t?`radix-${t}`:"")}var fo="Collapsible",[w1]=Bt(fo),[_1,as]=w1(fo),Pu=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,c]=rn({prop:r,defaultProp:o??!1,onChange:s,caller:fo});return d.jsx(_1,{scope:n,disabled:i,contentId:Nt(),open:l,onOpenToggle:w.useCallback(()=>c(u=>!u),[c]),children:d.jsx(Ce.div,{"data-state":cs(l),"data-disabled":i?"":void 0,...a,ref:t})})});Pu.displayName=fo;var Ru="CollapsibleTrigger",Ou=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=as(Ru,n);return d.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":cs(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:we(e.onClick,o.onOpenToggle)})});Ou.displayName=Ru;var ls="CollapsibleContent",Du=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=as(ls,e.__scopeCollapsible);return d.jsx(mt,{present:n||o.open,children:({present:i})=>d.jsx(k1,{...r,ref:t,present:i})})});Du.displayName=ls;var k1=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=as(ls,n),[a,l]=w.useState(r),c=w.useRef(null),u=Re(t,c),h=w.useRef(0),p=h.current,f=w.useRef(0),x=f.current,m=s.open||a,y=w.useRef(m),g=w.useRef(void 0);return w.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),qe(()=>{const v=c.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const k=v.getBoundingClientRect();h.current=k.height,f.current=k.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),l(r)}},[s.open,r]),d.jsx(Ce.div,{"data-state":cs(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function cs(e){return e?"open":"closed"}var S1=Pu,C1=w.createContext(void 0);function ho(e){const t=w.useContext(C1);return e||t||"ltr"}function Qe(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>t.current?.(...n),[])}function E1(e,t=globalThis?.document){const n=Qe(e);w.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 N1="DismissableLayer",bi="dismissableLayer.update",T1="dismissableLayer.pointerDownOutside",j1="dismissableLayer.focusOutside",Ra,Mu=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=w.useContext(Mu),[u,h]=w.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=w.useState({}),x=Re(t,A=>h(A)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),v=u?m.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,C=z1(A=>{const R=A.target,O=[...c.branches].some(P=>P.contains(R));!S||O||(o?.(A),s?.(A),A.defaultPrevented||a?.())},p),N=P1(A=>{const R=A.target;[...c.branches].some(P=>P.contains(R))||(i?.(A),s?.(A),A.defaultPrevented||a?.())},p);return E1(A=>{v===c.layers.size-1&&(r?.(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},p),w.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ra=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Oa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ra)}},[u,p,n,c]),w.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Oa())},[u,c]),w.useEffect(()=>{const A=()=>f({});return document.addEventListener(bi,A),()=>document.removeEventListener(bi,A)},[]),d.jsx(Ce.div,{...l,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,N.onFocusCapture),onBlurCapture:we(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,C.onPointerDownCapture)})});po.displayName=N1;var A1="DismissableLayerBranch",I1=w.forwardRef((e,t)=>{const n=w.useContext(Mu),r=w.useRef(null),o=Re(t,r);return w.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(Ce.div,{...e,ref:o})});I1.displayName=A1;function z1(e,t=globalThis?.document){const n=Qe(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Lu(T1,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function P1(e,t=globalThis?.document){const n=Qe(e),r=w.useRef(!1);return w.useEffect(()=>{const o=i=>{i.target&&!r.current&&Lu(j1,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 Oa(){const e=new CustomEvent(bi);document.dispatchEvent(e)}function Lu(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?l1(o,i):o.dispatchEvent(i)}var Fo="focusScope.autoFocusOnMount",$o="focusScope.autoFocusOnUnmount",Da={bubbles:!1,cancelable:!0},R1="FocusScope",us=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=w.useState(null),c=Qe(o),u=Qe(i),h=w.useRef(null),p=Re(t,m=>l(m)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let m=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?h.current=S:Vt(h.current,{select:!0})},y=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Vt(h.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&Vt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,f.paused]),w.useEffect(()=>{if(a){La.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Fo,Da);a.addEventListener(Fo,c),a.dispatchEvent(g),g.defaultPrevented||(O1($1(Fu(a)),{select:!0}),document.activeElement===m&&Vt(a))}return()=>{a.removeEventListener(Fo,c),setTimeout(()=>{const g=new CustomEvent($o,Da);a.addEventListener($o,u),a.dispatchEvent(g),g.defaultPrevented||Vt(m??document.body,{select:!0}),a.removeEventListener($o,u),La.remove(f)},0)}}},[a,c,u,f]);const x=w.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[k,S]=D1(v);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Vt(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Vt(S,{select:!0})):g===v&&m.preventDefault()}},[n,r,f.paused]);return d.jsx(Ce.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});us.displayName=R1;function O1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vt(r,{select:t}),document.activeElement!==n)return}function D1(e){const t=Fu(e),n=Ma(t,e),r=Ma(t.reverse(),e);return[n,r]}function Fu(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 Ma(e,t){for(const n of e)if(!M1(n,{upTo:t}))return n}function M1(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 L1(e){return e instanceof HTMLInputElement&&"select"in e}function Vt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&L1(e)&&t&&e.select()}}var La=F1();function F1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Fa(e,t),e.unshift(t)},remove(t){e=Fa(e,t),e[0]?.resume()}}}function Fa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $1(e){return e.filter(t=>t.tagName!=="A")}var B1="Portal",mo=w.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=w.useState(!1);qe(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Hh.createPortal(d.jsx(Ce.div,{...r,ref:t}),s):null});mo.displayName=B1;var Bo=0;function $u(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$a()),document.body.insertAdjacentElement("beforeend",e[1]??$a()),Bo++,()=>{Bo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bo--}},[])}function $a(){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 St=function(){return St=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},St.apply(this,arguments)};function Bu(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 U1(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 Lr="right-scroll-bar-position",Fr="width-before-scroll-bar",Z1="with-scroll-bars-hidden",V1="--removed-body-scroll-bar-size";function Uo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function W1(e,t){var n=w.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 H1=typeof window<"u"?w.useLayoutEffect:w.useEffect,Ba=new WeakMap;function q1(e,t){var n=W1(null,function(r){return e.forEach(function(o){return Uo(o,r)})});return H1(function(){var r=Ba.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Uo(a,null)}),i.forEach(function(a){o.has(a)||Uo(a,s)})}Ba.set(n,e)},[e]),n}function G1(e){return e}function K1(e,t){t===void 0&&(t=G1);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function J1(e){e===void 0&&(e={});var t=K1(null);return t.options=St({async:!0,ssr:!1},e),t}var Uu=function(e){var t=e.sideCar,n=Bu(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 w.createElement(r,St({},n))};Uu.isSideCarExport=!0;function Y1(e,t){return e.useMedium(t),Uu}var Zu=J1(),Zo=function(){},go=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,f=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,k=e.gapMode,S=Bu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,N=q1([n,t]),A=St(St({},S),o);return w.createElement(w.Fragment,null,u&&w.createElement(C,{sideCar:Zu,removeScrollBar:c,shards:h,noRelative:f,noIsolation:x,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:k}),s?w.cloneElement(w.Children.only(a),St(St({},A),{ref:N})):w.createElement(v,St({},A,{className:l,ref:N}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Fr,zeroRight:Lr};var X1=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Q1(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=X1();return t&&e.setAttribute("nonce",t),e}function ew(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function tw(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=Q1())&&(ew(t,n),tw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},rw=function(){var e=nw();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vu=function(){var e=rw(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ow={left:0,top:0,right:0,gap:0},Vo=function(e){return parseInt(e||"",10)||0},iw=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[Vo(n),Vo(r),Vo(o)]},sw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ow;var t=iw(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},aw=Vu(),En="data-scroll-locked",lw=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
41
|
-
.`.concat(
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const s of e.seen.entries()){const a=s[1];if(t===s[0]){i(s);continue}if(e.external){const c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Zc(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=s=>{const a=e.seen.get(s);if(a.ref===null)return;const l=a.def??a.schema,c={...l},u=a.ref;if(a.ref=null,u){r(u);const p=e.seen.get(u),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,c),s._zod.parent===u)for(const m in l)m==="$ref"||m==="allOf"||m in c||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!==u){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:Wr(t,"input",e.processors),output:Wr(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Xe(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Xe(r.element,n);if(r.type==="set")return Xe(r.valueType,n);if(r.type==="lazy")return Xe(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Xe(r.innerType,n);if(r.type==="intersection")return Xe(r.left,n)||Xe(r.right,n);if(r.type==="record"||r.type==="map")return Xe(r.keyType,n)||Xe(r.valueType,n);if(r.type==="pipe")return Xe(r.in,n)||Xe(r.out,n);if(r.type==="object"){for(const o in r.shape)if(Xe(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(Xe(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(Xe(o,n))return!0;return!!(r.rest&&Xe(r.rest,n))}return!1}const Jg=(e,t={})=>n=>{const r=Bc({...n,processors:t});return Ve(e,r),Uc(r,e),Zc(r,e)},Wr=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=Bc({...o??{},target:i,io:t,processors:n});return Ve(e,s),Uc(s,e),Zc(s,e)},Yg={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xg=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:s,format:a,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=Yg[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Qg=(e,t,n,r)=>{const o=n,{minimum:i,maximum:s,format:a,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof s=="number"&&(o.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},e0=(e,t,n,r)=>{n.type="boolean"},t0=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},n0=(e,t,n,r)=>{n.not={}},r0=(e,t,n,r)=>{},o0=(e,t,n,r)=>{const o=e._zod.def,i=bc(o.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},i0=(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},s0=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},a0=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},l0=(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"]})},c0=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const c in s)o.properties[c]=Ve(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const u=i.shape[c]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));l.size>0&&(o.required=Array.from(l)),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Ve(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},u0=(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},d0=(e,t,n,r)=>{const o=e._zod.def,i=Ve(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Ve(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,l=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=l},f0=(e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,l=s._zod.bag?.patterns;if(i.mode==="loose"&&l&&l.size>0){const u=Ve(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of l)o.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ve(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Ve(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const u=[...c].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(o.required=u)}},h0=(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"}]},p0=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},m0=(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))},g0=(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)))},x0=(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},y0=(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},v0=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Vc=(e,t,n,r)=>{const o=e._zod.def;Ve(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},b0=(e,t,n,r)=>{const o=e._zod.innerType;Ve(o,t,r);const i=t.seen.get(e);i.ref=o},w0=Y("ZodISODateTime",(e,t)=>{xm.init(e,t),Ue.init(e,t)});function _0(e){return Cg(w0,e)}const k0=Y("ZodISODate",(e,t)=>{ym.init(e,t),Ue.init(e,t)});function S0(e){return Eg(k0,e)}const C0=Y("ZodISOTime",(e,t)=>{vm.init(e,t),Ue.init(e,t)});function E0(e){return Ng(C0,e)}const N0=Y("ZodISODuration",(e,t)=>{bm.init(e,t),Ue.init(e,t)});function T0(e){return Tg(N0,e)}const j0=(e,t)=>{Sc.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>cp(e,n)},flatten:{value:n=>lp(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,fi,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,fi,2)}},isEmpty:{get(){return e.issues.length===0}}})},pt=Y("ZodError",j0,{Parent:Error}),A0=Yi(pt),I0=Xi(pt),z0=ao(pt),P0=lo(pt),R0=fp(pt),O0=hp(pt),D0=pp(pt),M0=mp(pt),L0=gp(pt),F0=xp(pt),$0=yp(pt),B0=vp(pt),Fe=Y("ZodType",(e,t)=>(Le.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Wr(e,"input"),output:Wr(e,"output")}}),e.toJSONSchema=Jg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Yt(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)=>Xt(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>A0(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>z0(e,n,r),e.parseAsync=async(n,r)=>I0(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>P0(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)=>D0(e,n,r),e.decodeAsync=async(n,r)=>M0(e,n,r),e.safeEncode=(n,r)=>L0(e,n,r),e.safeDecode=(n,r)=>F0(e,n,r),e.safeEncodeAsync=async(n,r)=>$0(e,n,r),e.safeDecodeAsync=async(n,r)=>B0(e,n,r),e.refine=(n,r)=>e.check(Mx(n,r)),e.superRefine=n=>e.check(Lx(n)),e.overwrite=n=>e.check(Ln(n)),e.optional=()=>ma(e),e.exactOptional=()=>_x(e),e.nullable=()=>ga(e),e.nullish=()=>ma(ga(e)),e.nonoptional=n=>Tx(e,n),e.array=()=>Me(e),e.or=n=>$t([e,n]),e.and=n=>gx(e,n),e.transform=n=>xa(e,bx(n)),e.default=n=>Cx(e,n),e.prefault=n=>Nx(e,n),e.catch=n=>Ax(e,n),e.pipe=n=>xa(e,n),e.readonly=()=>Px(e),e.describe=n=>{const r=e.clone();return er.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return er.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return er.get(e);const r=e.clone();return er.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Wc=Y("_ZodString",(e,t)=>{Qi.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Xg(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Og(...r)),e.includes=(...r)=>e.check(Lg(...r)),e.startsWith=(...r)=>e.check(Fg(...r)),e.endsWith=(...r)=>e.check($g(...r)),e.min=(...r)=>e.check(Vr(...r)),e.max=(...r)=>e.check(Fc(...r)),e.length=(...r)=>e.check($c(...r)),e.nonempty=(...r)=>e.check(Vr(1,...r)),e.lowercase=r=>e.check(Dg(r)),e.uppercase=r=>e.check(Mg(r)),e.trim=()=>e.check(Ug()),e.normalize=(...r)=>e.check(Bg(...r)),e.toLowerCase=()=>e.check(Zg()),e.toUpperCase=()=>e.check(Vg()),e.slugify=()=>e.check(Wg())}),U0=Y("ZodString",(e,t)=>{Qi.init(e,t),Wc.init(e,t),e.email=n=>e.check(og(Z0,n)),e.url=n=>e.check(cg(V0,n)),e.jwt=n=>e.check(Sg(ix,n)),e.emoji=n=>e.check(ug(W0,n)),e.guid=n=>e.check(la(fa,n)),e.uuid=n=>e.check(ig(kr,n)),e.uuidv4=n=>e.check(sg(kr,n)),e.uuidv6=n=>e.check(ag(kr,n)),e.uuidv7=n=>e.check(lg(kr,n)),e.nanoid=n=>e.check(dg(H0,n)),e.guid=n=>e.check(la(fa,n)),e.cuid=n=>e.check(fg(q0,n)),e.cuid2=n=>e.check(hg(G0,n)),e.ulid=n=>e.check(pg(K0,n)),e.base64=n=>e.check(wg(nx,n)),e.base64url=n=>e.check(_g(rx,n)),e.xid=n=>e.check(mg(J0,n)),e.ksuid=n=>e.check(gg(Y0,n)),e.ipv4=n=>e.check(xg(X0,n)),e.ipv6=n=>e.check(yg(Q0,n)),e.cidrv4=n=>e.check(vg(ex,n)),e.cidrv6=n=>e.check(bg(tx,n)),e.e164=n=>e.check(kg(ox,n)),e.datetime=n=>e.check(_0(n)),e.date=n=>e.check(S0(n)),e.time=n=>e.check(E0(n)),e.duration=n=>e.check(T0(n))});function G(e){return rg(U0,e)}const Ue=Y("ZodStringFormat",(e,t)=>{$e.init(e,t),Wc.init(e,t)}),Z0=Y("ZodEmail",(e,t)=>{lm.init(e,t),Ue.init(e,t)}),fa=Y("ZodGUID",(e,t)=>{sm.init(e,t),Ue.init(e,t)}),kr=Y("ZodUUID",(e,t)=>{am.init(e,t),Ue.init(e,t)}),V0=Y("ZodURL",(e,t)=>{cm.init(e,t),Ue.init(e,t)}),W0=Y("ZodEmoji",(e,t)=>{um.init(e,t),Ue.init(e,t)}),H0=Y("ZodNanoID",(e,t)=>{dm.init(e,t),Ue.init(e,t)}),q0=Y("ZodCUID",(e,t)=>{fm.init(e,t),Ue.init(e,t)}),G0=Y("ZodCUID2",(e,t)=>{hm.init(e,t),Ue.init(e,t)}),K0=Y("ZodULID",(e,t)=>{pm.init(e,t),Ue.init(e,t)}),J0=Y("ZodXID",(e,t)=>{mm.init(e,t),Ue.init(e,t)}),Y0=Y("ZodKSUID",(e,t)=>{gm.init(e,t),Ue.init(e,t)}),X0=Y("ZodIPv4",(e,t)=>{wm.init(e,t),Ue.init(e,t)}),Q0=Y("ZodIPv6",(e,t)=>{_m.init(e,t),Ue.init(e,t)}),ex=Y("ZodCIDRv4",(e,t)=>{km.init(e,t),Ue.init(e,t)}),tx=Y("ZodCIDRv6",(e,t)=>{Sm.init(e,t),Ue.init(e,t)}),nx=Y("ZodBase64",(e,t)=>{Cm.init(e,t),Ue.init(e,t)}),rx=Y("ZodBase64URL",(e,t)=>{Nm.init(e,t),Ue.init(e,t)}),ox=Y("ZodE164",(e,t)=>{Tm.init(e,t),Ue.init(e,t)}),ix=Y("ZodJWT",(e,t)=>{Am.init(e,t),Ue.init(e,t)}),Hc=Y("ZodNumber",(e,t)=>{Rc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Qg(e,r,o),e.gt=(r,o)=>e.check(ua(r,o)),e.gte=(r,o)=>e.check(Oo(r,o)),e.min=(r,o)=>e.check(Oo(r,o)),e.lt=(r,o)=>e.check(ca(r,o)),e.lte=(r,o)=>e.check(Ro(r,o)),e.max=(r,o)=>e.check(Ro(r,o)),e.int=r=>e.check(ha(r)),e.safe=r=>e.check(ha(r)),e.positive=r=>e.check(ua(0,r)),e.nonnegative=r=>e.check(Oo(0,r)),e.negative=r=>e.check(ca(0,r)),e.nonpositive=r=>e.check(Ro(0,r)),e.multipleOf=(r,o)=>e.check(da(r,o)),e.step=(r,o)=>e.check(da(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ye(e){return jg(Hc,e)}const sx=Y("ZodNumberFormat",(e,t)=>{Im.init(e,t),Hc.init(e,t)});function ha(e){return Ag(sx,e)}const ax=Y("ZodBoolean",(e,t)=>{zm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>e0(e,n,r)});function et(e){return Ig(ax,e)}const lx=Y("ZodNull",(e,t)=>{Pm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>t0(e,n,r)});function pi(e){return zg(lx,e)}const cx=Y("ZodUnknown",(e,t)=>{Rm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>r0()});function pa(){return Pg(cx)}const ux=Y("ZodNever",(e,t)=>{Om.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>n0(e,n,r)});function dx(e){return Rg(ux,e)}const fx=Y("ZodArray",(e,t)=>{Dm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>l0(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Vr(n,r)),e.nonempty=n=>e.check(Vr(1,n)),e.max=(n,r)=>e.check(Fc(n,r)),e.length=(n,r)=>e.check($c(n,r)),e.unwrap=()=>e.element});function Me(e,t){return Hg(fx,e,t)}const hx=Y("ZodObject",(e,t)=>{Lm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>c0(e,n,r,o),Ae(e,"shape",()=>t.shape),e.keyof=()=>jt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:pa()}),e.loose=()=>e.clone({...e._zod.def,catchall:pa()}),e.strict=()=>e.clone({...e._zod.def,catchall:dx()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>rp(e,n),e.safeExtend=n=>op(e,n),e.merge=n=>ip(e,n),e.pick=n=>tp(e,n),e.omit=n=>np(e,n),e.partial=(...n)=>sp(Gc,e,n[0]),e.required=(...n)=>ap(Kc,e,n[0])});function ce(e,t){const n={type:"object",shape:e??{},...xe(t)};return new hx(n)}const qc=Y("ZodUnion",(e,t)=>{Mc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>u0(e,n,r,o),e.options=t.options});function $t(e,t){return new qc({type:"union",options:e,...xe(t)})}const px=Y("ZodDiscriminatedUnion",(e,t)=>{qc.init(e,t),Fm.init(e,t)});function un(e,t,n){return new px({type:"union",options:t,discriminator:e,...xe(n)})}const mx=Y("ZodIntersection",(e,t)=>{$m.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>d0(e,n,r,o)});function gx(e,t){return new mx({type:"intersection",left:e,right:t})}const xx=Y("ZodRecord",(e,t)=>{Bm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>f0(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function qt(e,t,n){return new xx({type:"record",keyType:e,valueType:t,...xe(n)})}const mi=Y("ZodEnum",(e,t)=>{Um.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(r,o,i)=>o0(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 mi({...t,checks:[],...xe(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 mi({...t,checks:[],...xe(o),entries:i})}});function jt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new mi({type:"enum",entries:n,...xe(t)})}const yx=Y("ZodLiteral",(e,t)=>{Zm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>i0(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Te(e,t){return new yx({type:"literal",values:Array.isArray(e)?e:[e],...xe(t)})}const vx=Y("ZodTransform",(e,t)=>{Vm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>a0(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new yc(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(sr(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(sr(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function bx(e){return new vx({type:"transform",transform:e})}const Gc=Y("ZodOptional",(e,t)=>{Lc.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ma(e){return new Gc({type:"optional",innerType:e})}const wx=Y("ZodExactOptional",(e,t)=>{Wm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _x(e){return new wx({type:"optional",innerType:e})}const kx=Y("ZodNullable",(e,t)=>{Hm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>h0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ga(e){return new kx({type:"nullable",innerType:e})}const Sx=Y("ZodDefault",(e,t)=>{qm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>m0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Cx(e,t){return new Sx({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_c(t)}})}const Ex=Y("ZodPrefault",(e,t)=>{Gm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>g0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Nx(e,t){return new Ex({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_c(t)}})}const Kc=Y("ZodNonOptional",(e,t)=>{Km.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>p0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Tx(e,t){return new Kc({type:"nonoptional",innerType:e,...xe(t)})}const jx=Y("ZodCatch",(e,t)=>{Jm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>x0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ax(e,t){return new jx({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ix=Y("ZodPipe",(e,t)=>{Ym.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>y0(e,n,r,o),e.in=t.in,e.out=t.out});function xa(e,t){return new Ix({type:"pipe",in:e,out:t})}const zx=Y("ZodReadonly",(e,t)=>{Xm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>v0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Px(e){return new zx({type:"readonly",innerType:e})}const Rx=Y("ZodLazy",(e,t)=>{Qm.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>b0(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function Ox(e){return new Rx({type:"lazy",getter:e})}const Dx=Y("ZodCustom",(e,t)=>{eg.init(e,t),Fe.init(e,t),e._zod.processJSONSchema=(n,r,o)=>s0(e,n)});function Mx(e,t={}){return qg(Dx,e,t)}function Lx(e){return Gg(e)}const zn=Ox(()=>$t([G(),ye(),et(),pi(),Me(zn),qt(G(),zn)])),es=ce({type:G(),ttl:G().optional(),scope:G().optional()}),ts=ce({type:Te("text"),text:G(),cache_control:es.optional()}),Jc=ce({type:Te("thinking"),thinking:G(),signature:G().optional()}),Fx=ce({type:Te("think"),thinking:G(),signature:G().optional()}),$x=ce({type:Te("base64"),media_type:G(),data:G()}),Yc=ce({type:Te("image"),source:$x}),Xc=ce({type:Te("tool_use"),id:G(),name:G(),input:qt(G(),zn)}),Bx=un("type",[ts,Yc]),Ux=ce({type:Te("tool_result"),tool_use_id:G().optional(),content:$t([G(),Me(Bx)]),is_error:et().optional()}),Zx=un("type",[ts,Jc,Yc,Xc,Ux]),Vx=$t([G(),Me(Zx)]),Wx=ce({role:jt(["user","assistant"]),content:Vx}),Hx=ce({type:Te("text"),text:G(),cache_control:es.optional()}),qx=ce({type:G(),properties:qt(G(),qt(G(),zn)).optional(),required:Me(G()).optional(),additionalProperties:et().optional(),$schema:G().optional()}),Gx=ce({name:G(),description:G().optional(),input_schema:qx.optional(),cache_control:es.optional()}),Kx=un("type",[ce({type:Te("enabled"),budget_tokens:ye()}),ce({type:Te("disabled")}),ce({type:Te("adaptive")})]),Jx=ce({model:G(),messages:Me(Wx),system:Me(Hx).optional(),tools:Me(Gx).optional(),max_tokens:ye().optional(),temperature:ye().optional(),stream:et().optional(),thinking:Kx.optional(),metadata:ce({user_id:G().optional()}).optional()}),ns=un("type",[ts,Jc,Fx,Xc]),Yx=ce({input_tokens:ye().nullable().optional(),output_tokens:ye().nullable().optional(),cache_creation_input_tokens:ye().nullable().optional(),cache_read_input_tokens:ye().nullable().optional()}).passthrough(),Xx=ce({id:G(),type:Te("message"),model:G(),role:Te("assistant"),content:Me(ns),stop_reason:G().nullable(),stop_sequence:G().nullable().optional(),usage:Yx}).passthrough(),Qx=ce({type:Te("message_start"),message:ce({id:G(),type:Te("message"),model:G(),role:Te("assistant"),content:Me(ns),stop_reason:pi(),stop_sequence:pi(),usage:ce({input_tokens:ye(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()})}),ey=ce({type:Te("content_block_start"),index:ye(),content_block:ns}),ty=un("type",[ce({type:Te("text_delta"),text:G()}),ce({type:Te("input_json_delta"),partial_json:G()}),ce({type:Te("thinking_delta"),thinking:G()}),ce({type:Te("signature_delta"),signature:G()})]),ny=ce({type:Te("content_block_delta"),index:ye(),delta:ty}),ry=ce({type:Te("content_block_stop"),index:ye()}),oy=ce({type:Te("message_delta"),delta:ce({stop_reason:G().nullable(),stop_sequence:G().nullable().optional()}),usage:ce({output_tokens:ye(),input_tokens:ye().optional(),cache_creation_input_tokens:ye().optional(),cache_read_input_tokens:ye().optional()}).passthrough()}),iy=ce({type:Te("message_stop")}),sy=ce({type:Te("ping")}),ay=ce({type:Te("error"),error:ce({type:G(),message:G()})});un("type",[Qx,ey,ny,ry,oy,iy,sy,ay]);const ly=Jx,cy=Xx,uy=$t([G(),Me(un("type",[ce({type:Te("text"),text:G()}),ce({type:Te("image_url"),image_url:ce({url:G(),detail:G().optional()})})]))]),Qc=ce({role:jt(["system","user","assistant","tool"]),content:uy,name:G().optional(),reasoning_content:G().optional(),thinking:G().optional(),think:G().optional()}),dy=ce({name:G(),arguments:G()});Qc.extend({content:$t([G(),Me(ce({type:Te("text"),text:G()}))]).optional(),function_call:dy.optional()});const fy=ce({type:Te("function"),function:ce({name:G(),description:G().optional(),parameters:qt(G(),zn)})});ce({model:G(),messages:Me(Qc),temperature:ye().optional(),max_tokens:ye().optional(),stream:et().optional(),tools:Me(fy).optional(),tool_choice:$t([ce({type:Te("auto")}),ce({type:Te("none")}),ce({type:Te("function"),function:ce({name:G()})})]).optional(),user:G().optional()});const eu=ce({role:jt(["assistant"]).optional(),content:G().nullable().optional(),reasoning_content:G().nullable().optional(),thinking:G().nullable().optional(),think:G().nullable().optional(),function_call:ce({name:G().optional(),arguments:G().optional()}).nullable().optional(),tool_calls:Me(ce({index:ye(),id:G().optional(),type:Te("function").optional(),function:ce({name:G().optional(),arguments:G().optional()})})).nullable().optional()}),hy=ce({index:ye(),message:ce({role:jt(["assistant"]),content:G().nullable(),reasoning_content:G().optional(),thinking:G().optional(),think:G().optional(),function_call:ce({name:G(),arguments:G()}).nullable().optional()}).optional(),delta:eu.optional(),finish_reason:G().nullable()}),py=ce({id:G(),object:Te("chat.completion"),created:ye(),model:G(),choices:Me(hy),usage:ce({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough(),service_tier:G().nullable().optional(),system_fingerprint:G().nullable().optional()}).passthrough();ce({id:G(),object:Te("chat.completion.chunk"),created:ye(),model:G(),choices:Me(ce({index:ye(),delta:eu,finish_reason:G().nullable().optional()})),usage:ce({prompt_tokens:ye().nullable().optional(),completion_tokens:ye().nullable().optional(),total_tokens:ye().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function my(e){try{const t=JSON.parse(e),n=py.safeParse(t);return n.success?n.data:null}catch{return null}}const tu=ce({index:ye(),timestamp:ye(),type:G(),data:zn}),gy=ce({chunks:Me(tu),truncated:et().optional().default(!1)}),gi=ce({id:ye(),timestamp:G(),method:G(),path:G(),model:G().nullable(),sessionId:G().nullable(),rawRequestBody:G().nullable(),responseStatus:ye().nullable(),responseText:G().nullable(),inputTokens:ye().nullable(),outputTokens:ye().nullable(),cacheCreationInputTokens:ye().nullable(),cacheReadInputTokens:ye().nullable(),elapsedMs:ye().nullable(),streaming:et(),userAgent:G().nullable(),origin:G().nullable(),rawHeaders:qt(G(),G()).optional(),headers:qt(G(),G()).optional(),apiFormat:jt(["anthropic","openai","unknown"]).default("unknown"),isTest:et().optional().default(!1),providerName:G().nullable().optional(),clientPort:ye().nullable().optional(),clientPid:ye().nullable().optional(),clientCwd:G().nullable().optional(),clientProjectFolder:G().nullable().optional(),streamingChunks:gy.optional(),streamingChunksPath:G().nullable().optional(),error:G().nullable().optional()});ce({model:G()});ce({model:G().optional(),metadata:ce({user_id:G().optional()}).passthrough().optional()});function xy(e){if(e===null)return null;try{const t=JSON.parse(e),n=ly.safeParse(t);return n.success?n.data:null}catch{return null}}const yy=ce({error:G()});async function bn(e,t){const n=await e.json();return t.parse(n)}async function Mr(e,t){try{const n=await e.json(),r=yy.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function rs(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 Mr(o,i))}return bn(o,t)}const nu=ce({stripClaudeCodeBillingHeader:et()}),xi="/api/config";async function vy(e){return rs(e,nu,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function by(e){return rs(xi,nu,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function ru(){const e=gc(xi,vy,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=qh(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(xi,by({stripClaudeCodeBillingHeader:o}),{optimisticData:{stripClaudeCodeBillingHeader:o},rollbackOnError:!0,revalidate:!1})};return{strip:n,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:r}}function wy(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,i,s){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let c=o[l];if(!c){const u=t[l*2];c=o[l]={index:l,key:n(l),start:u,size:t[l*2+1],end:u+t[l*2+1],lane:0}}return c}}if(i==="length")return e}return Reflect.get(o,i,s)}})}function hn(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){const a=e();return(a.length!==r.length||a.some((c,u)=>r[u]!==c))&&(r=a,o=t(...a),n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1),o}return s.updateDeps=a=>{r=a},s}function ya(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const va=(e,t)=>Math.abs(e-t)<1.01,_y=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let qn;const ba=()=>{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}},ky=e=>e,Sy=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},Cy=(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 c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(wa(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Hr={passive:!0},Ey=typeof window>"u"?!0:"onscrollend"in window,Ny=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const i=e.options.useScrollendEvent&&Ey;let s=0;const a=i?null:_y(o,()=>t(s,!1),e.options.isScrollingResetDelay),l=h=>()=>{s=n(r),a?.(),t(s,h)},c=l(!0),u=l(!1);return r.addEventListener("scroll",c,Hr),i&&r.addEventListener("scrollend",u,Hr),()=>{r.removeEventListener("scroll",c),i&&r.removeEventListener("scrollend",u)}},Ty=(e,t)=>Ny(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),jy=(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"]},Ay=(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})},Iy=Ay;class zy{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{const a=i.target,l=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[c,u]of this.elementsCache)if(u===a){this.elementsCache.delete(c);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ky,rangeExtractor:Sy,onChange:()=>{},measureElement:jy,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate"};for(const c in n){const u=n[c];u!==void 0&&(i[c]=u)}const s=this.options;let a=null,l=null;if(s!==void 0&&s.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const c=s.count,u=i.count,h=this.getMeasurements(),p=c>0?((r=h[0])==null?void 0:r.key)??s.getItemKey(0):null,f=c>0?((o=h[c-1])==null?void 0:o.key)??s.getItemKey(c-1):null;if(u!==c||c>0&&u>0&&(i.getItemKey(0)!==p||i.getItemKey(u-1)!==f)){const y=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;y&&(a=[y.key,this.getScrollOffset()-y.start]);const g=i.followOnAppend===!0?"auto":i.followOnAppend||null;g&&u>c&&this.isAtEnd(s.scrollEndThreshold)&&(c===0||i.getItemKey(u-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=hn(()=>(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,!(!ba()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",s,Hr),i.addEventListener("touchend",a,Hr),this.unsubs.push(()=>{i.removeEventListener("touchstart",s),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled){const[i,s,a]=o;if(i!==null){const{count:l,getItemKey:c}=this.options;let u=0;for(;u<l&&c(u)!==i;)u++;const h=u<l?this.getMeasurements()[u]:void 0;if(h){const p=h.start+s-this.getScrollOffset();va(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=hn(()=>[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=hn(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a,laneAssignmentMode:l},c)=>{const u=this.itemSizeCache;if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){const x=this.options.gap,m=n*2;let y=this._flatMeasurements;if(!y||y.length<m){const k=new Float64Array(m);y&&h>0&&k.set(y.subarray(0,h*2)),y=k,this._flatMeasurements=y}let g;if(h===0)g=r+o;else{const k=h-1;g=y[k*2]+y[k*2+1]+x}for(let k=h;k<n;k++){const S=i(k),E=u.get(S),N=typeof E=="number"?E:this.options.estimateSize(k);y[k*2]=g,y[k*2+1]=N,g+=N+x}const v=wy(n,y,i);return this.measurementsCache=v,v}const p=this.measurementsCache.slice(0,h),f=new Array(a).fill(void 0);for(let x=0;x<h;x++){const m=p[x];m&&(f[m.lane]=x)}for(let x=h;x<n;x++){const m=i(x),y=this.laneAssignments.get(x);let g,v;const k=l==="estimate"||u.has(m);if(y!==void 0&&this.options.lanes>1){g=y;const T=f[g],P=T!==void 0?p[T]:void 0;v=P?P.end+this.options.gap:r+o}else{const T=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);v=T?T.end+this.options.gap:r+o,g=T?T.lane:x%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(x,g)}const S=u.get(m),E=typeof S=="number"?S:this.options.estimateSize(x),N=v+E;p[x]={index:x,start:v,size:E,end:N,key:m,lane:g},f[g]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=hn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?Py({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=hn(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),s=Math.max(0,o-i),a=Math.min(this.options.count-1,o+i);return n>=s&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,a)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,i;if(n<0||n>=this.options.count)return;let s,a,l;const c=this._flatMeasurements;if(this.options.lanes===1&&c!==null)l=this.options.getItemKey(n),a=c[n*2],s=c[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;l=p.key,a=p.start,s=p.size}const u=this.itemSizeCache.get(l)??s,h=r-u;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,f=p?this.getTotalSize():0,x=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:a,size:s,end:a+s,lane:0},h,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-f):x&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=hn(()=>[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=ou(0,r.length-1,i?a=>o[a*2]:a=>ya(r[a]).start,n);return ya(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&&(ba()&&(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&&va(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,s){const a=this.getSize()||600,l=Math.abs(o-this.getScrollOffset()),c=this.scrollState.behavior==="smooth"&&l>a;this.scrollState.lastTargetOffset=o,c||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:c?"smooth":"auto"})}this.scheduleScrollReconcile()}}const ou=(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 Py({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const i=e.length-1,s=o?u=>o[u*2]:u=>e[u].start,a=o?u=>o[u*2]+o[u*2+1]:u=>e[u].end;if(e.length<=r)return{startIndex:0,endIndex:i};let l=ou(0,i,s,n),c=l;if(r===1)for(;c<i&&a(c)<n+t;)c++;else if(r>1){const u=Array(r).fill(0);for(;c<i&&u.some(p=>p<n+t);){const p=e[c];u[p.lane]=p.end,c++}const 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),c=Math.min(i,c+(r-1-c%r))}return{startIndex:l,endIndex:c}}const _a=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ry({useFlushSync:e=!0,...t}){const n=w.useReducer(i=>i+1,0)[1],r={...t,onChange:(i,s)=>{var a;e&&s?dr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,i,s)}},[o]=w.useState(()=>new zy(r));return o.setOptions(r),_a(()=>o._didMount(),[]),_a(()=>o._willUpdate()),o}function iu(e){return Ry({observeElementRect:Cy,observeElementOffset:Ty,scrollToFn:Iy,...e})}const su=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const Oy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Dy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const ka=e=>{const t=Dy(e);return t.charAt(0).toUpperCase()+t.slice(1)};var My={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 Ly=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Fy=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>w.createElement("svg",{ref:l,...My,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:su("lucide",o),...!i&&!Ly(a)&&{"aria-hidden":"true"},...a},[...s.map(([c,u])=>w.createElement(c,u)),...Array.isArray(i)?i:[i]]));const _e=(e,t)=>{const n=w.forwardRef(({className:r,...o},i)=>w.createElement(Fy,{ref:i,iconNode:t,className:su(`lucide-${Oy(ka(e))}`,`lucide-${e}`,r),...o}));return n.displayName=ka(e),n};const $y=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],By=_e("arrow-down",$y);const Uy=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Zy=_e("arrow-up",Uy);const Vy=[["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"}]],Wy=_e("brain",Vy);const Hy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=_e("check",Hy);const qy=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],At=_e("chevron-down",qy);const Gy=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Gt=_e("chevron-right",Gy);const Ky=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Jy=_e("chevron-up",Ky);const Yy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],Xy=_e("chevrons-down",Yy);const Qy=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],ev=_e("chevrons-up",Qy);const tv=[["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"}]],yi=_e("circle-alert",tv);const nv=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rv=_e("circle-check-big",nv);const ov=[["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"}]],iv=_e("circle-question-mark",ov);const sv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],au=_e("circle-stop",sv);const av=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],os=_e("clock",av);const lv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],cv=_e("columns-2",lv);const uv=[["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"}]],uo=_e("copy",uv);const dv=[["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"}]],lu=_e("download",dv);const fv=[["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"}]],hv=_e("external-link",fv);const pv=[["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"}]],cu=_e("eye-off",pv);const mv=[["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"}]],uu=_e("eye",mv);const gv=[["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"}]],xv=_e("file-terminal",gv);const yv=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],vv=_e("gauge",yv);const bv=[["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"}]],wv=_e("git-compare-arrows",bv);const _v=[["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"}]],kv=_e("globe",_v);const Sv=[["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"}]],Cv=_e("layout-grid",Sv);const Ev=[["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"}]],Nv=_e("list",Ev);const Tv=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],du=_e("loader-circle",Tv);const jv=[["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"}]],Av=_e("lock",jv);const Iv=[["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"}]],fu=_e("message-square",Iv);const zv=[["path",{d:"M5 12h14",key:"1ays0h"}]],Pv=_e("minus",zv);const Rv=[["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"}]],Ov=_e("pencil",Rv);const Dv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Sa=_e("plus",Dv);const Mv=[["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"}]],Lv=_e("radio",Mv);const Fv=[["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"}]],hu=_e("rotate-ccw",Fv);const $v=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],pu=_e("rotate-cw",$v);const Bv=[["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"}]],Uv=_e("rows-3",Bv);const Zv=[["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"}]],Vv=_e("server",Zv);const Wv=[["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"}]],Hv=_e("settings",Wv);const qv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Gv=_e("terminal",qv);const Kv=[["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"}]],Jv=_e("trash-2",Kv);const Yv=[["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"}]],Xv=_e("triangle-alert",Yv);const Qv=[["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"}]],eb=_e("upload",Qv);const tb=[["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"}]],nb=_e("user",tb);const rb=[["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"}]],ob=_e("wifi-off",rb);const ib=[["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"}]],sb=_e("wifi",ib);const ab=[["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"}]],lb=_e("wrench",ab);const cb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ub=_e("x",cb);const db=[["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"}]],hr=_e("zap",db);function Sr(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 Do={exports:{}};var Ca;function fb(){return Ca||(Ca=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,i){function s(c,u){if(!o[c]){if(!r[c]){var h=typeof Sr=="function"&&Sr;if(!u&&h)return h(c,!0);if(a)return a(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var f=o[c]={exports:{}};r[c][0].call(f.exports,function(x){var m=r[c][1][x];return s(m||x)},f,f.exports,n,r,o,i)}return o[c].exports}for(var a=typeof Sr=="function"&&Sr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(n,r,o){var i=n("./utils"),s=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,u,h,p,f,x,m,y=[],g=0,v=l.length,k=v,S=i.getTypeOf(l)!=="string";g<l.length;)k=v-g,h=S?(c=l[g++],u=g<v?l[g++]:0,g<v?l[g++]:0):(c=l.charCodeAt(g++),u=g<v?l.charCodeAt(g++):0,g<v?l.charCodeAt(g++):0),p=c>>2,f=(3&c)<<4|u>>4,x=1<k?(15&u)<<2|h>>6:64,m=2<k?63&h:64,y.push(a.charAt(p)+a.charAt(f)+a.charAt(x)+a.charAt(m));return y.join("")},o.decode=function(l){var c,u,h,p,f,x,m=0,y=0,g="data:";if(l.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);m<l.length;)c=a.indexOf(l.charAt(m++))<<2|(p=a.indexOf(l.charAt(m++)))>>4,u=(15&p)<<4|(f=a.indexOf(l.charAt(m++)))>>2,h=(3&f)<<6|(x=a.indexOf(l.charAt(m++))),v[y++]=c,f!==64&&(v[y++]=u),x!==64&&(v[y++]=h);return v}},{"./support":30,"./utils":32}],2:[function(n,r,o){var i=n("./external"),s=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,h,p,f,x){this.compressedSize=u,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=x}c.prototype={getContentWorker:function(){var u=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),h=this;return u.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,h,p){return u.pipe(new a).pipe(new l("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",h)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var i=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var i=n("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var u=0;u<8;u++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();r.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,u,h,p){var f=s,x=p+h;c^=-1;for(var m=p;m<x;m++)c=c>>>8^f[255&(c^u[m])];return-1^c})(0|l,a,a.length,0):(function(c,u,h,p){var f=s,x=p+h;c^=-1;for(var m=p;m<x;m++)c=c>>>8^f[255&(c^u.charCodeAt(m))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(n,r,o){var i=null;i=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:i}},{lie:37}],7:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),a=n("./utils"),l=n("./stream/GenericWorker"),c=i?"uint8array":"array";function u(h,p){l.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(u,l),u.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,h.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},o.compressWorker=function(h){return new u("Deflate",h)},o.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function i(f,x){var m,y="";for(m=0;m<x;m++)y+=String.fromCharCode(255&f),f>>>=8;return y}function s(f,x,m,y,g,v){var k,S,E=f.file,N=f.compression,T=v!==c.utf8encode,P=a.transformTo("string",v(E.name)),R=a.transformTo("string",c.utf8encode(E.name)),D=E.comment,M=a.transformTo("string",v(D)),C=a.transformTo("string",c.utf8encode(D)),L=R.length!==E.name.length,_=C.length!==D.length,O="",J="",Z="",W=E.dir,q=E.date,A={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(A.crc32=f.crc32,A.compressedSize=f.compressedSize,A.uncompressedSize=f.uncompressedSize);var U=0;x&&(U|=8),T||!L&&!_||(U|=2048);var B=0,j=0;W&&(B|=16),g==="UNIX"?(j=798,B|=(function(re,ve){var ie=re;return re||(ie=ve?16893:33204),(65535&ie)<<16})(E.unixPermissions,W)):(j=20,B|=(function(re){return 63&(re||0)})(E.dosPermissions)),k=q.getUTCHours(),k<<=6,k|=q.getUTCMinutes(),k<<=5,k|=q.getUTCSeconds()/2,S=q.getUTCFullYear()-1980,S<<=4,S|=q.getUTCMonth()+1,S<<=5,S|=q.getUTCDate(),L&&(J=i(1,1)+i(u(P),4)+R,O+="up"+i(J.length,2)+J),_&&(Z=i(1,1)+i(u(M),4)+C,O+="uc"+i(Z.length,2)+Z);var ee="";return ee+=`
|
|
40
|
+
\0`,ee+=i(U,2),ee+=N.magic,ee+=i(k,2),ee+=i(S,2),ee+=i(A.crc32,4),ee+=i(A.compressedSize,4),ee+=i(A.uncompressedSize,4),ee+=i(P.length,2),ee+=i(O.length,2),{fileRecord:h.LOCAL_FILE_HEADER+ee+P+O,dirRecord:h.CENTRAL_FILE_HEADER+i(j,2)+ee+i(M.length,2)+"\0\0\0\0"+i(B,4)+i(y,4)+P+O+M}}var a=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),h=n("../signature");function p(f,x,m,y){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=x,this.zipPlatform=m,this.encodeFileName=y,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(f){var x=f.meta.percent||0,m=this.entriesCount,y=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:m?(x+100*(m-y-1))/m:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var x=this.streamFiles&&!f.file.dir;if(x){var m=s(f,x,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var x=this.streamFiles&&!f.file.dir,m=s(f,x,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),x)this.push({data:(function(y){return h.DATA_DESCRIPTOR+i(y.crc32,4)+i(y.compressedSize,4)+i(y.uncompressedSize,4)})(f),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,x=0;x<this.dirRecords.length;x++)this.push({data:this.dirRecords[x],meta:{percent:100}});var m=this.bytesWritten-f,y=(function(g,v,k,S,E){var N=a.transformTo("string",E(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(g,2)+i(g,2)+i(v,4)+i(k,4)+i(N.length,2)+N})(this.dirRecords.length,m,f,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(f){this._sources.push(f);var x=this;return f.on("data",function(m){x.processChunk(m)}),f.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),f.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(f){var x=this._sources;if(!l.prototype.error.call(this,f))return!1;for(var m=0;m<x.length;m++)try{x[m].error(f)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var f=this._sources,x=0;x<f.length;x++)f[x].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,o){var i=n("../compressions"),s=n("./ZipFileWorker");o.generateWorker=function(a,l,c){var u=new s(l.streamFiles,c,l.platform,l.encodeFileName),h=0;try{a.forEach(function(p,f){h++;var x=(function(v,k){var S=v||k,E=i[S];if(!E)throw new Error(S+" is not a valid compression method !");return E})(f.options.compression,l.compression),m=f.options.compressionOptions||l.compressionOptions||{},y=f.dir,g=f.date;f._compressWorker(x,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(u)}),u.entriesCount=h}catch(p){u.error(p)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=n("./object")).loadAsync=n("./load"),i.support=n("./support"),i.defaults=n("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=n("./external"),r.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var i=n("./utils"),s=n("./external"),a=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function h(p){return new s.Promise(function(f,x){var m=p.decompressed.getContentWorker().pipe(new c);m.on("error",function(y){x(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var x=this;return f=i.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),u.isNode&&u.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",p,!0,f.optimizedBinaryString,f.base64).then(function(m){var y=new l(f);return y.load(m),y}).then(function(m){var y=[s.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var v=0;v<g.length;v++)y.push(h(g[v]));return s.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,v=0;v<g.length;v++){var k=g[v],S=k.fileNameStr,E=i.resolve(k.fileNameStr);x.file(E,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||(x.file(E).unsafeOriginalName=S)}return y.zipComment.length&&(x.comment=y.zipComment),x})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,o){var i=n("../utils"),s=n("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,o){var i=n("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var u=this;a.on("data",function(h,p){u.push(h)||u._helper.pause(),c&&c(p)}).on("error",function(h){u.emit("error",h)}).on("end",function(){u.push(null)})}n("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(n,r,o){function i(E,N,T){var P,R=a.getTypeOf(N),D=a.extend(T||{},u);D.date=D.date||new Date,D.compression!==null&&(D.compression=D.compression.toUpperCase()),typeof D.unixPermissions=="string"&&(D.unixPermissions=parseInt(D.unixPermissions,8)),D.unixPermissions&&16384&D.unixPermissions&&(D.dir=!0),D.dosPermissions&&16&D.dosPermissions&&(D.dir=!0),D.dir&&(E=g(E)),D.createFolders&&(P=y(E))&&v.call(this,P,!0);var M=R==="string"&&D.binary===!1&&D.base64===!1;T&&T.binary!==void 0||(D.binary=!M),(N instanceof h&&N.uncompressedSize===0||D.dir||!N||N.length===0)&&(D.base64=!1,D.binary=!0,N="",D.compression="STORE",R="string");var C=null;C=N instanceof h||N instanceof l?N:x.isNode&&x.isStream(N)?new m(E,N):a.prepareContent(E,N,D.binary,D.optimizedBinaryString,D.base64);var L=new p(E,C,D);this.files[E]=L}var s=n("./utf8"),a=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),f=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(E){E.slice(-1)==="/"&&(E=E.substring(0,E.length-1));var N=E.lastIndexOf("/");return 0<N?E.substring(0,N):""},g=function(E){return E.slice(-1)!=="/"&&(E+="/"),E},v=function(E,N){return N=N!==void 0?N:u.createFolders,E=g(E),this.files[E]||i.call(this,E,null,{dir:!0,createFolders:N}),this.files[E]};function k(E){return Object.prototype.toString.call(E)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(E){var N,T,P;for(N in this.files)P=this.files[N],(T=N.slice(this.root.length,N.length))&&N.slice(0,this.root.length)===this.root&&E(T,P)},filter:function(E){var N=[];return this.forEach(function(T,P){E(T,P)&&N.push(P)}),N},file:function(E,N,T){if(arguments.length!==1)return E=this.root+E,i.call(this,E,N,T),this;if(k(E)){var P=E;return this.filter(function(D,M){return!M.dir&&P.test(D)})}var R=this.files[this.root+E];return R&&!R.dir?R:null},folder:function(E){if(!E)return this;if(k(E))return this.filter(function(R,D){return D.dir&&E.test(R)});var N=this.root+E,T=v.call(this,N),P=this.clone();return P.root=T.name,P},remove:function(E){E=this.root+E;var N=this.files[E];if(N||(E.slice(-1)!=="/"&&(E+="/"),N=this.files[E]),N&&!N.dir)delete this.files[E];else for(var T=this.filter(function(R,D){return D.name.slice(0,E.length)===E}),P=0;P<T.length;P++)delete this.files[T[P].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(E){var N,T={};try{if((T=a.extend(E||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=T.type.toLowerCase(),T.compression=T.compression.toUpperCase(),T.type==="binarystring"&&(T.type="string"),!T.type)throw new Error("No output type specified.");a.checkSupport(T.type),T.platform!=="darwin"&&T.platform!=="freebsd"&&T.platform!=="linux"&&T.platform!=="sunos"||(T.platform="UNIX"),T.platform==="win32"&&(T.platform="DOS");var P=T.comment||this.comment||"";N=f.generateWorker(this,T,P)}catch(R){(N=new l("error")).error(R)}return new c(N,T.type||"string",T.mimeType)},generateAsync:function(E,N){return this.generateInternalStream(E).accumulate(N)},generateNodeStream:function(E,N){return(E=E||{}).type||(E.type="nodebuffer"),this.generateInternalStream(E).toNodejsStream(N)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===u&&this.data[p+3]===h)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),u=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&u===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,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,o){var i=n("./Uint8ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var i=n("./DataReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var i=n("./ArrayReader");function s(a){i.call(this,a)}n("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var i=n("../utils"),s=n("../support"),a=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");r.exports=function(h){var p=i.getTypeOf(h);return i.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(h):s.uint8array?new u(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 c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var i=n("../utils"),s=n("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=i.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=i},{}],29:[function(n,r,o){var i=n("../utils"),s=n("./ConvertWorker"),a=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),h=null;if(c.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new u.Promise(function(y,g){var v=[],k=x._internalType,S=x._outputType,E=x._mimeType;x.on("data",function(N,T){v.push(N),m&&m(T)}).on("error",function(N){v=[],g(N)}).on("end",function(){try{var N=(function(T,P,R){switch(T){case"blob":return i.newBlob(i.transformTo("arraybuffer",P),R);case"base64":return l.encode(P);default:return i.transformTo(T,P)}})(S,(function(T,P){var R,D=0,M=null,C=0;for(R=0;R<P.length;R++)C+=P[R].length;switch(T){case"string":return P.join("");case"array":return Array.prototype.concat.apply([],P);case"uint8array":for(M=new Uint8Array(C),R=0;R<P.length;R++)M.set(P[R],D),D+=P[R].length;return M;case"nodebuffer":return Buffer.concat(P);default:throw new Error("concat : unsupported type '"+T+"'")}})(k,v),E);y(N)}catch(T){g(T)}v=[]}).resume()})}function f(x,m,y){var g=m;switch(m){case"blob":case"arraybuffer":g="uint8array";break;case"base64":g="string"}try{this._internalType=g,this._outputType=m,this._mimeType=y,i.checkSupport(g),this._worker=x.pipe(new s(g)),x.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}f.prototype={accumulate:function(x){return p(this,x)},on:function(x,m){var y=this;return x==="data"?this._worker.on(x,function(g){m.call(y,g.data,g.meta)}):this._worker.on(x,function(){i.delay(m,arguments,y)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},x)}},r.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!n("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,o){for(var i=n("./utils"),s=n("./support"),a=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}o.utf8encode=function(f){return s.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(x){var m,y,g,v,k,S=x.length,E=0;for(v=0;v<S;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),E+=y<128?1:y<2048?2:y<65536?3:4;for(m=s.uint8array?new Uint8Array(E):new Array(E),v=k=0;k<E;v++)(64512&(y=x.charCodeAt(v)))==55296&&v+1<S&&(64512&(g=x.charCodeAt(v+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),v++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m})(f)},o.utf8decode=function(f){return s.nodebuffer?i.transformTo("nodebuffer",f).toString("utf-8"):(function(x){var m,y,g,v,k=x.length,S=new Array(2*k);for(m=y=0;m<k;)if((g=x[m++])<128)S[y++]=g;else if(4<(v=c[g]))S[y++]=65533,m+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&m<k;)g=g<<6|63&x[m++],v--;1<v?S[y++]=65533:g<65536?S[y++]=g:(g-=65536,S[y++]=55296|g>>10&1023,S[y++]=56320|1023&g)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),i.applyFromCharCode(S)})(f=i.transformTo(s.uint8array?"uint8array":"array",f))},i.inherits(h,l),h.prototype.processChunk=function(f){var x=i.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var y=(function(v,k){var S;for((k=k||v.length)>v.length&&(k=v.length),S=k-1;0<=S&&(192&v[S])==128;)S--;return S<0||S===0?k:S+c[v[S]]>k?S:k})(x),g=x;y!==x.length&&(s.uint8array?(g=x.subarray(0,y),this.leftOver=x.subarray(y,x.length)):(g=x.slice(0,y),this.leftOver=x.slice(y,x.length))),this.push({data:o.utf8decode(g),meta: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 c(m){return m}function u(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,g){var v=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)y==="array"||y==="nodebuffer"?v.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):v.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return v.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,g=o.getTypeOf(m),v=!0;if(g==="uint8array"?v=h.applyCanBeUsed.uint8array:g==="nodebuffer"&&(v=h.applyCanBeUsed.nodebuffer),v)for(;1<y;)try{return h.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function f(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var x={};x.string={string:c,array:function(m){return u(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return u(m,new Uint8Array(m.length))},nodebuffer:function(m){return u(m,a.allocBuffer(m.length))}},x.array={string:p,array:c,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return f(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:c,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:c,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:c},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return x[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],v=0;v<y.length;v++){var k=y[v];k==="."||k===""&&v!==0&&v!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(m)?"nodebuffer":i.uint8array&&m instanceof Uint8Array?"uint8array":i.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!i[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,v="";for(g=0;g<(m||"").length;g++)v+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return v},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},o.prepareContent=function(m,y,g,v,k){return l.Promise.resolve(y).then(function(S){return i.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new l.Promise(function(E,N){var T=new FileReader;T.onload=function(P){E(P.target.result)},T.onerror=function(P){N(P.target.error)},T.readAsArrayBuffer(S)}):S}).then(function(S){var E=o.getTypeOf(S);return E?(E==="arraybuffer"?S=o.transformTo("uint8array",S):E==="string"&&(k?S=s.decode(S):g&&v!==!0&&(S=(function(N){return u(N,i.uint8array?new Uint8Array(N.length):new Array(N.length))})(S))),S):l.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(h){this.files=[],this.loadOptions=h}u.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(h)+")")}},isSignature:function(h,p){var f=this.reader.index;this.reader.setIndex(h);var x=this.reader.readString(4)===p;return this.reader.setIndex(f),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",f=s.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(f)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,f,x=this.zip64EndOfCentralSize-44;0<x;)h=this.reader.readInt(2),p=this.reader.readInt(4),f=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:f}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(h=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var f=this.centralDirOffset+this.centralDirSize;this.zip64&&(f+=20,f+=12+this.zip64EndOfCentralSize);var x=p-f;if(0<x)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=x);else if(x<0)throw new Error("Corrupted zip: missing "+Math.abs(x)+" bytes.")},prepareReader:function(h){this.reader=i(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var i=n("./reader/readerFor"),s=n("./utils"),a=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),h=n("./support");function p(f,x){this.options=f,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var x,m;if(f.skip(22),this.fileNameLength=f.readInt(2),m=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(y){for(var g in u)if(Object.prototype.hasOwnProperty.call(u,g)&&u[g].magic===y)return u[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,x,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var x=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(x),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var x,m,y,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)x=f.readInt(2),m=f.readInt(2),y=f.readData(m),this.extraFields[x]={id:x,length:m,value:y};f.setIndex(g)},handleUTF8:function(){var f=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var x=i(f.value);return x.readInt(1)!==1||l(this.fileName)!==x.readInt(4)?null:c.utf8decode(x.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var x=i(f.value);return x.readInt(1)!==1||l(this.fileComment)!==x.readInt(4)?null:c.utf8decode(x.readData(f.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function i(x,m,y){this.name=x,this.dir=y.dir,this.date=y.date,this.comment=y.comment,this.unixPermissions=y.unixPermissions,this.dosPermissions=y.dosPermissions,this._data=m,this._dataBinary=y.binary,this.options={compression:y.compression,compressionOptions:y.compressionOptions}}var s=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");i.prototype={internalStream:function(x){var m=null,y="string";try{if(!x)throw new Error("No output type specified.");var g=(y=x.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var v=!this._dataBinary;v&&!g&&(m=m.pipe(new l.Utf8EncodeWorker)),!v&&g&&(m=m.pipe(new l.Utf8DecodeWorker))}catch(k){(m=new u("error")).error(k)}return new s(m,y,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof c&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(y,x,m)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new a(this._data)}};for(var 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 c=0,u=new l(x),h=i.document.createTextNode("");u.observe(h,{characterData:!0}),s=function(){h.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var m=i.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},i.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new i.MessageChannel;p.port1.onmessage=x,s=function(){p.port2.postMessage(0)}}var f=[];function x(){var m,y;a=!0;for(var g=f.length;g;){for(y=f,f=[],m=-1;++m<g;)y[m]();g=f.length}a=!1}r.exports=function(m){f.push(m)!==1||a||s()}}).call(this,typeof br<"u"?br:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var i=n("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function h(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,g!==s&&m(this,g)}function p(g,v,k){this.promise=g,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,v,k){i(function(){var S;try{S=v(k)}catch(E){return a.reject(g,E)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function x(g){var v=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof v=="function")return function(){v.apply(g,arguments)}}function m(g,v){var k=!1;function S(T){k||(k=!0,a.reject(g,T))}function E(T){k||(k=!0,a.resolve(g,T))}var N=y(function(){v(E,S)});N.status==="error"&&S(N.value)}function y(g,v){var k={};try{k.value=g(v),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=h).prototype.finally=function(g){if(typeof g!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(g()).then(function(){return k})},function(k){return v.resolve(g()).then(function(){throw k})})},h.prototype.catch=function(g){return this.then(null,g)},h.prototype.then=function(g,v){if(typeof g!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==u?f(k,this.state===c?g:v,this.outcome):this.queue.push(new p(k,g,v)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){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,v){var k=y(x,v);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=c,g.outcome=v;for(var E=-1,N=g.queue.length;++E<N;)g.queue[E].callFulfilled(v)}return g},a.reject=function(g,v){g.state=l,g.outcome=v;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(v);return g},h.resolve=function(g){return g instanceof this?g:a.resolve(new this(s),g)},h.reject=function(g){var v=new this(s);return a.reject(v,g)},h.all=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var E=new Array(k),N=0,T=-1,P=new this(s);++T<k;)R(g[T],T);return P;function R(D,M){v.resolve(D).then(function(C){E[M]=C,++N!==k||S||(S=!0,a.resolve(P,E))},function(C){S||(S=!0,a.reject(P,C))})}},h.race=function(g){var v=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var E=-1,N=new this(s);++E<k;)T=g[E],v.resolve(T).then(function(P){S||(S=!0,a.resolve(N,P))},function(P){S||(S=!0,a.reject(N,P))});var T;return N}},{immediate:36}],38:[function(n,r,o){var i={};(0,n("./lib/utils/common").assign)(i,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var i=n("./zlib/deflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,h=0,p=-1,f=0,x=8;function m(g){if(!(this instanceof m))return new m(g);this.options=s.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==h)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var S;if(S=typeof v.dictionary=="string"?a.string2buf(v.dictionary):u.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,S))!==h)throw new Error(l[k]);this._dict_set=!0}}function y(g,v){var k=new m(v);if(k.push(g,!0),k.err)throw k.msg||l[k.err];return k.result}m.prototype.push=function(g,v){var k,S,E=this.strm,N=this.options.chunkSize;if(this.ended)return!1;S=v===~~v?v:v===!0?4:0,typeof g=="string"?E.input=a.string2buf(g):u.call(g)==="[object ArrayBuffer]"?E.input=new Uint8Array(g):E.input=g,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new s.Buf8(N),E.next_out=0,E.avail_out=N),(k=i.deflate(E,S))!==1&&k!==h)return this.onEnd(k),!(this.ended=!0);E.avail_out!==0&&(E.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(E.output,E.next_out))):this.onData(s.shrinkBuf(E.output,E.next_out)))}while((0<E.avail_in||E.avail_out===0)&&k!==1);return S===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===h):S!==2||(this.onEnd(h),!(E.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,v){return(v=v||{}).raw=!0,y(g,v)},o.gzip=function(g,v){return(v=v||{}).gzip=!0,y(g,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var i=n("./zlib/inflate"),s=n("./utils/common"),a=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function f(m){if(!(this instanceof f))return new f(m);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var g=i.inflateInit2(this.strm,y.windowBits);if(g!==l.Z_OK)throw new Error(c[g]);this.header=new h,i.inflateGetHeader(this.strm,this.header)}function x(m,y){var g=new f(y);if(g.push(m,!0),g.err)throw g.msg||c[g.err];return g.result}f.prototype.push=function(m,y){var g,v,k,S,E,N,T=this.strm,P=this.options.chunkSize,R=this.options.dictionary,D=!1;if(this.ended)return!1;v=y===~~y?y:y===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof m=="string"?T.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?T.input=new Uint8Array(m):T.input=m,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new s.Buf8(P),T.next_out=0,T.avail_out=P),(g=i.inflate(T,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&R&&(N=typeof R=="string"?a.string2buf(R):p.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,g=i.inflateSetDictionary(this.strm,N)),g===l.Z_BUF_ERROR&&D===!0&&(g=l.Z_OK,D=!1),g!==l.Z_STREAM_END&&g!==l.Z_OK)return this.onEnd(g),!(this.ended=!0);T.next_out&&(T.avail_out!==0&&g!==l.Z_STREAM_END&&(T.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(T.output,T.next_out),S=T.next_out-k,E=a.buf2string(T.output,k),T.next_out=S,T.avail_out=P-S,S&&s.arraySet(T.output,T.output,k,S,0),this.onData(E)):this.onData(s.shrinkBuf(T.output,T.next_out)))),T.avail_in===0&&T.avail_out===0&&(D=!0)}while((0<T.avail_in||T.avail_out===0)&&g!==l.Z_STREAM_END);return g===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(g=i.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(T.avail_out=0))},f.prototype.onData=function(m){this.chunks.push(m)},f.prototype.onEnd=function(m){m===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},o.Inflate=f,o.inflate=x,o.inflateRaw=function(m,y){return(y=y||{}).raw=!0,x(m,y)},o.ungzip=x},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var h in u)u.hasOwnProperty(h)&&(l[h]=u[h])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,u,h,p){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+h),p);else for(var f=0;f<h;f++)l[p+f]=c[u+f]},flattenChunks:function(l){var c,u,h,p,f,x;for(c=h=0,u=l.length;c<u;c++)h+=l[c].length;for(x=new Uint8Array(h),c=p=0,u=l.length;c<u;c++)f=l[c],x.set(f,p),p+=f.length;return x}},a={arraySet:function(l,c,u,h,p){for(var f=0;f<h;f++)l[p+f]=c[u+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),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(h,p));for(var f="",x=0;x<p;x++)f+=String.fromCharCode(h[x]);return f}l[254]=l[254]=1,o.string2buf=function(h){var p,f,x,m,y,g=h.length,v=0;for(m=0;m<g;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),v+=f<128?1:f<2048?2:f<65536?3:4;for(p=new i.Buf8(v),m=y=0;y<v;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),f<128?p[y++]=f:(f<2048?p[y++]=192|f>>>6:(f<65536?p[y++]=224|f>>>12:(p[y++]=240|f>>>18,p[y++]=128|f>>>12&63),p[y++]=128|f>>>6&63),p[y++]=128|63&f);return p},o.buf2binstring=function(h){return u(h,h.length)},o.binstring2buf=function(h){for(var p=new i.Buf8(h.length),f=0,x=p.length;f<x;f++)p[f]=h.charCodeAt(f);return p},o.buf2string=function(h,p){var f,x,m,y,g=p||h.length,v=new Array(2*g);for(f=x=0;f<g;)if((m=h[f++])<128)v[x++]=m;else if(4<(y=l[m]))v[x++]=65533,f+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&f<g;)m=m<<6|63&h[f++],y--;1<y?v[x++]=65533:m<65536?v[x++]=m:(m-=65536,v[x++]=55296|m>>10&1023,v[x++]=56320|1023&m)}return u(v,x)},o.utf8border=function(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 c=65535&i|0,u=i>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;u=u+(c=c+s[l++]|0)|0,--h;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();r.exports=function(s,a,l,c){var u=i,h=c+l;s^=-1;for(var p=c;p<h;p++)s=s>>>8^u[255&(s^a[p])];return-1^s}},{}],46:[function(n,r,o){var i,s=n("../utils/common"),a=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),h=0,p=4,f=0,x=-2,m=-1,y=4,g=2,v=8,k=9,S=286,E=30,N=19,T=2*S+1,P=15,R=3,D=258,M=D+R+1,C=42,L=113,_=1,O=2,J=3,Z=4;function W(b,K){return b.msg=u[K],K}function q(b){return(b<<1)-(4<b?9:0)}function A(b){for(var K=b.length;0<=--K;)b[K]=0}function U(b){var K=b.state,H=K.pending;H>b.avail_out&&(H=b.avail_out),H!==0&&(s.arraySet(b.output,K.pending_buf,K.pending_out,H,b.next_out),b.next_out+=H,K.pending_out+=H,b.total_out+=H,b.avail_out-=H,K.pending-=H,K.pending===0&&(K.pending_out=0))}function B(b,K){a._tr_flush_block(b,0<=b.block_start?b.block_start:-1,b.strstart-b.block_start,K),b.block_start=b.strstart,U(b.strm)}function j(b,K){b.pending_buf[b.pending++]=K}function ee(b,K){b.pending_buf[b.pending++]=K>>>8&255,b.pending_buf[b.pending++]=255&K}function re(b,K){var H,z,I=b.max_chain_length,F=b.strstart,X=b.prev_length,ne=b.nice_match,V=b.strstart>b.w_size-M?b.strstart-(b.w_size-M):0,ae=b.window,fe=b.w_mask,le=b.prev,$=b.strstart+D,Q=ae[F+X-1],ue=ae[F+X];b.prev_length>=b.good_match&&(I>>=2),ne>b.lookahead&&(ne=b.lookahead);do if(ae[(H=K)+X]===ue&&ae[H+X-1]===Q&&ae[H]===ae[F]&&ae[++H]===ae[F+1]){F+=2,H++;do;while(ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&ae[++F]===ae[++H]&&F<$);if(z=D-($-F),F=$-D,X<z){if(b.match_start=K,ne<=(X=z))break;Q=ae[F+X-1],ue=ae[F+X]}}while((K=le[K&fe])>V&&--I!=0);return X<=b.lookahead?X:b.lookahead}function ve(b){var K,H,z,I,F,X,ne,V,ae,fe,le=b.w_size;do{if(I=b.window_size-b.lookahead-b.strstart,b.strstart>=le+(le-M)){for(s.arraySet(b.window,b.window,le,le,0),b.match_start-=le,b.strstart-=le,b.block_start-=le,K=H=b.hash_size;z=b.head[--K],b.head[K]=le<=z?z-le:0,--H;);for(K=H=le;z=b.prev[--K],b.prev[K]=le<=z?z-le:0,--H;);I+=le}if(b.strm.avail_in===0)break;if(X=b.strm,ne=b.window,V=b.strstart+b.lookahead,ae=I,fe=void 0,fe=X.avail_in,ae<fe&&(fe=ae),H=fe===0?0:(X.avail_in-=fe,s.arraySet(ne,X.input,X.next_in,fe,V),X.state.wrap===1?X.adler=l(X.adler,ne,fe,V):X.state.wrap===2&&(X.adler=c(X.adler,ne,fe,V)),X.next_in+=fe,X.total_in+=fe,fe),b.lookahead+=H,b.lookahead+b.insert>=R)for(F=b.strstart-b.insert,b.ins_h=b.window[F],b.ins_h=(b.ins_h<<b.hash_shift^b.window[F+1])&b.hash_mask;b.insert&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[F+R-1])&b.hash_mask,b.prev[F&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=F,F++,b.insert--,!(b.lookahead+b.insert<R)););}while(b.lookahead<M&&b.strm.avail_in!==0)}function ie(b,K){for(var H,z;;){if(b.lookahead<M){if(ve(b),b.lookahead<M&&K===h)return _;if(b.lookahead===0)break}if(H=0,b.lookahead>=R&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+R-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),H!==0&&b.strstart-H<=b.w_size-M&&(b.match_length=re(b,H)),b.match_length>=R)if(z=a._tr_tally(b,b.strstart-b.match_start,b.match_length-R),b.lookahead-=b.match_length,b.match_length<=b.max_lazy_match&&b.lookahead>=R){for(b.match_length--;b.strstart++,b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+R-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart,--b.match_length!=0;);b.strstart++}else b.strstart+=b.match_length,b.match_length=0,b.ins_h=b.window[b.strstart],b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+1])&b.hash_mask;else z=a._tr_tally(b,0,b.window[b.strstart]),b.lookahead--,b.strstart++;if(z&&(B(b,!1),b.strm.avail_out===0))return _}return b.insert=b.strstart<R-1?b.strstart:R-1,K===p?(B(b,!0),b.strm.avail_out===0?J:Z):b.last_lit&&(B(b,!1),b.strm.avail_out===0)?_:O}function de(b,K){for(var H,z,I;;){if(b.lookahead<M){if(ve(b),b.lookahead<M&&K===h)return _;if(b.lookahead===0)break}if(H=0,b.lookahead>=R&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+R-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),b.prev_length=b.match_length,b.prev_match=b.match_start,b.match_length=R-1,H!==0&&b.prev_length<b.max_lazy_match&&b.strstart-H<=b.w_size-M&&(b.match_length=re(b,H),b.match_length<=5&&(b.strategy===1||b.match_length===R&&4096<b.strstart-b.match_start)&&(b.match_length=R-1)),b.prev_length>=R&&b.match_length<=b.prev_length){for(I=b.strstart+b.lookahead-R,z=a._tr_tally(b,b.strstart-1-b.prev_match,b.prev_length-R),b.lookahead-=b.prev_length-1,b.prev_length-=2;++b.strstart<=I&&(b.ins_h=(b.ins_h<<b.hash_shift^b.window[b.strstart+R-1])&b.hash_mask,H=b.prev[b.strstart&b.w_mask]=b.head[b.ins_h],b.head[b.ins_h]=b.strstart),--b.prev_length!=0;);if(b.match_available=0,b.match_length=R-1,b.strstart++,z&&(B(b,!1),b.strm.avail_out===0))return _}else if(b.match_available){if((z=a._tr_tally(b,0,b.window[b.strstart-1]))&&B(b,!1),b.strstart++,b.lookahead--,b.strm.avail_out===0)return _}else b.match_available=1,b.strstart++,b.lookahead--}return b.match_available&&(z=a._tr_tally(b,0,b.window[b.strstart-1]),b.match_available=0),b.insert=b.strstart<R-1?b.strstart:R-1,K===p?(B(b,!0),b.strm.avail_out===0?J:Z):b.last_lit&&(B(b,!1),b.strm.avail_out===0)?_:O}function ge(b,K,H,z,I){this.good_length=b,this.max_lazy=K,this.nice_length=H,this.max_chain=z,this.func=I}function te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*T),this.dyn_dtree=new s.Buf16(2*(2*E+1)),this.bl_tree=new s.Buf16(2*(2*N+1)),A(this.dyn_ltree),A(this.dyn_dtree),A(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(P+1),this.heap=new s.Buf16(2*S+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*S+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function oe(b){var K;return b&&b.state?(b.total_in=b.total_out=0,b.data_type=g,(K=b.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?C:L,b.adler=K.wrap===2?0:1,K.last_flush=h,a._tr_init(K),f):W(b,x)}function me(b){var K=oe(b);return K===f&&(function(H){H.window_size=2*H.w_size,A(H.head),H.max_lazy_match=i[H.level].max_lazy,H.good_match=i[H.level].good_length,H.nice_match=i[H.level].nice_length,H.max_chain_length=i[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=R-1,H.match_available=0,H.ins_h=0})(b.state),K}function Ee(b,K,H,z,I,F){if(!b)return x;var X=1;if(K===m&&(K=6),z<0?(X=0,z=-z):15<z&&(X=2,z-=16),I<1||k<I||H!==v||z<8||15<z||K<0||9<K||F<0||y<F)return W(b,x);z===8&&(z=9);var ne=new te;return(b.state=ne).strm=b,ne.wrap=X,ne.gzhead=null,ne.w_bits=z,ne.w_size=1<<ne.w_bits,ne.w_mask=ne.w_size-1,ne.hash_bits=I+7,ne.hash_size=1<<ne.hash_bits,ne.hash_mask=ne.hash_size-1,ne.hash_shift=~~((ne.hash_bits+R-1)/R),ne.window=new s.Buf8(2*ne.w_size),ne.head=new s.Buf16(ne.hash_size),ne.prev=new s.Buf16(ne.w_size),ne.lit_bufsize=1<<I+6,ne.pending_buf_size=4*ne.lit_bufsize,ne.pending_buf=new s.Buf8(ne.pending_buf_size),ne.d_buf=1*ne.lit_bufsize,ne.l_buf=3*ne.lit_bufsize,ne.level=K,ne.strategy=F,ne.method=H,me(b)}i=[new ge(0,0,0,0,function(b,K){var H=65535;for(H>b.pending_buf_size-5&&(H=b.pending_buf_size-5);;){if(b.lookahead<=1){if(ve(b),b.lookahead===0&&K===h)return _;if(b.lookahead===0)break}b.strstart+=b.lookahead,b.lookahead=0;var z=b.block_start+H;if((b.strstart===0||b.strstart>=z)&&(b.lookahead=b.strstart-z,b.strstart=z,B(b,!1),b.strm.avail_out===0)||b.strstart-b.block_start>=b.w_size-M&&(B(b,!1),b.strm.avail_out===0))return _}return b.insert=0,K===p?(B(b,!0),b.strm.avail_out===0?J:Z):(b.strstart>b.block_start&&(B(b,!1),b.strm.avail_out),_)}),new ge(4,4,8,4,ie),new ge(4,5,16,8,ie),new ge(4,6,32,32,ie),new ge(4,4,16,16,de),new ge(8,16,32,32,de),new ge(8,16,128,128,de),new ge(8,32,128,256,de),new ge(32,128,258,1024,de),new ge(32,258,258,4096,de)],o.deflateInit=function(b,K){return Ee(b,K,v,15,8,0)},o.deflateInit2=Ee,o.deflateReset=me,o.deflateResetKeep=oe,o.deflateSetHeader=function(b,K){return b&&b.state?b.state.wrap!==2?x:(b.state.gzhead=K,f):x},o.deflate=function(b,K){var H,z,I,F;if(!b||!b.state||5<K||K<0)return b?W(b,x):x;if(z=b.state,!b.output||!b.input&&b.avail_in!==0||z.status===666&&K!==p)return W(b,b.avail_out===0?-5:x);if(z.strm=b,H=z.last_flush,z.last_flush=K,z.status===C)if(z.wrap===2)b.adler=0,j(z,31),j(z,139),j(z,8),z.gzhead?(j(z,(z.gzhead.text?1:0)+(z.gzhead.hcrc?2:0)+(z.gzhead.extra?4:0)+(z.gzhead.name?8:0)+(z.gzhead.comment?16:0)),j(z,255&z.gzhead.time),j(z,z.gzhead.time>>8&255),j(z,z.gzhead.time>>16&255),j(z,z.gzhead.time>>24&255),j(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),j(z,255&z.gzhead.os),z.gzhead.extra&&z.gzhead.extra.length&&(j(z,255&z.gzhead.extra.length),j(z,z.gzhead.extra.length>>8&255)),z.gzhead.hcrc&&(b.adler=c(b.adler,z.pending_buf,z.pending,0)),z.gzindex=0,z.status=69):(j(z,0),j(z,0),j(z,0),j(z,0),j(z,0),j(z,z.level===9?2:2<=z.strategy||z.level<2?4:0),j(z,3),z.status=L);else{var X=v+(z.w_bits-8<<4)<<8;X|=(2<=z.strategy||z.level<2?0:z.level<6?1:z.level===6?2:3)<<6,z.strstart!==0&&(X|=32),X+=31-X%31,z.status=L,ee(z,X),z.strstart!==0&&(ee(z,b.adler>>>16),ee(z,65535&b.adler)),b.adler=1}if(z.status===69)if(z.gzhead.extra){for(I=z.pending;z.gzindex<(65535&z.gzhead.extra.length)&&(z.pending!==z.pending_buf_size||(z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),U(b),I=z.pending,z.pending!==z.pending_buf_size));)j(z,255&z.gzhead.extra[z.gzindex]),z.gzindex++;z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),z.gzindex===z.gzhead.extra.length&&(z.gzindex=0,z.status=73)}else z.status=73;if(z.status===73)if(z.gzhead.name){I=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),U(b),I=z.pending,z.pending===z.pending_buf_size)){F=1;break}F=z.gzindex<z.gzhead.name.length?255&z.gzhead.name.charCodeAt(z.gzindex++):0,j(z,F)}while(F!==0);z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),F===0&&(z.gzindex=0,z.status=91)}else z.status=91;if(z.status===91)if(z.gzhead.comment){I=z.pending;do{if(z.pending===z.pending_buf_size&&(z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),U(b),I=z.pending,z.pending===z.pending_buf_size)){F=1;break}F=z.gzindex<z.gzhead.comment.length?255&z.gzhead.comment.charCodeAt(z.gzindex++):0,j(z,F)}while(F!==0);z.gzhead.hcrc&&z.pending>I&&(b.adler=c(b.adler,z.pending_buf,z.pending-I,I)),F===0&&(z.status=103)}else z.status=103;if(z.status===103&&(z.gzhead.hcrc?(z.pending+2>z.pending_buf_size&&U(b),z.pending+2<=z.pending_buf_size&&(j(z,255&b.adler),j(z,b.adler>>8&255),b.adler=0,z.status=L)):z.status=L),z.pending!==0){if(U(b),b.avail_out===0)return z.last_flush=-1,f}else if(b.avail_in===0&&q(K)<=q(H)&&K!==p)return W(b,-5);if(z.status===666&&b.avail_in!==0)return W(b,-5);if(b.avail_in!==0||z.lookahead!==0||K!==h&&z.status!==666){var ne=z.strategy===2?(function(V,ae){for(var fe;;){if(V.lookahead===0&&(ve(V),V.lookahead===0)){if(ae===h)return _;break}if(V.match_length=0,fe=a._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++,fe&&(B(V,!1),V.strm.avail_out===0))return _}return V.insert=0,ae===p?(B(V,!0),V.strm.avail_out===0?J:Z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?_:O})(z,K):z.strategy===3?(function(V,ae){for(var fe,le,$,Q,ue=V.window;;){if(V.lookahead<=D){if(ve(V),V.lookahead<=D&&ae===h)return _;if(V.lookahead===0)break}if(V.match_length=0,V.lookahead>=R&&0<V.strstart&&(le=ue[$=V.strstart-1])===ue[++$]&&le===ue[++$]&&le===ue[++$]){Q=V.strstart+D;do;while(le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&le===ue[++$]&&$<Q);V.match_length=D-(Q-$),V.match_length>V.lookahead&&(V.match_length=V.lookahead)}if(V.match_length>=R?(fe=a._tr_tally(V,1,V.match_length-R),V.lookahead-=V.match_length,V.strstart+=V.match_length,V.match_length=0):(fe=a._tr_tally(V,0,V.window[V.strstart]),V.lookahead--,V.strstart++),fe&&(B(V,!1),V.strm.avail_out===0))return _}return V.insert=0,ae===p?(B(V,!0),V.strm.avail_out===0?J:Z):V.last_lit&&(B(V,!1),V.strm.avail_out===0)?_:O})(z,K):i[z.level].func(z,K);if(ne!==J&&ne!==Z||(z.status=666),ne===_||ne===J)return b.avail_out===0&&(z.last_flush=-1),f;if(ne===O&&(K===1?a._tr_align(z):K!==5&&(a._tr_stored_block(z,0,0,!1),K===3&&(A(z.head),z.lookahead===0&&(z.strstart=0,z.block_start=0,z.insert=0))),U(b),b.avail_out===0))return z.last_flush=-1,f}return K!==p?f:z.wrap<=0?1:(z.wrap===2?(j(z,255&b.adler),j(z,b.adler>>8&255),j(z,b.adler>>16&255),j(z,b.adler>>24&255),j(z,255&b.total_in),j(z,b.total_in>>8&255),j(z,b.total_in>>16&255),j(z,b.total_in>>24&255)):(ee(z,b.adler>>>16),ee(z,65535&b.adler)),U(b),0<z.wrap&&(z.wrap=-z.wrap),z.pending!==0?f:1)},o.deflateEnd=function(b){var K;return b&&b.state?(K=b.state.status)!==C&&K!==69&&K!==73&&K!==91&&K!==103&&K!==L&&K!==666?W(b,x):(b.state=null,K===L?W(b,-3):f):x},o.deflateSetDictionary=function(b,K){var H,z,I,F,X,ne,V,ae,fe=K.length;if(!b||!b.state||(F=(H=b.state).wrap)===2||F===1&&H.status!==C||H.lookahead)return x;for(F===1&&(b.adler=l(b.adler,K,fe,0)),H.wrap=0,fe>=H.w_size&&(F===0&&(A(H.head),H.strstart=0,H.block_start=0,H.insert=0),ae=new s.Buf8(H.w_size),s.arraySet(ae,K,fe-H.w_size,H.w_size,0),K=ae,fe=H.w_size),X=b.avail_in,ne=b.next_in,V=b.input,b.avail_in=fe,b.next_in=0,b.input=K,ve(H);H.lookahead>=R;){for(z=H.strstart,I=H.lookahead-(R-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[z+R-1])&H.hash_mask,H.prev[z&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=z,z++,--I;);H.strstart=z,H.lookahead=R-1,ve(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=R-1,H.match_available=0,b.next_in=ne,b.input=V,b.avail_in=X,H.wrap=F,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,c,u,h,p,f,x,m,y,g,v,k,S,E,N,T,P,R,D,M,C,L,_,O;a=i.state,l=i.next_in,_=i.input,c=l+(i.avail_in-5),u=i.next_out,O=i.output,h=u-(s-i.avail_out),p=u+(i.avail_out-257),f=a.dmax,x=a.wsize,m=a.whave,y=a.wnext,g=a.window,v=a.hold,k=a.bits,S=a.lencode,E=a.distcode,N=(1<<a.lenbits)-1,T=(1<<a.distbits)-1;e:do{k<15&&(v+=_[l++]<<k,k+=8,v+=_[l++]<<k,k+=8),P=S[v&N];t:for(;;){if(v>>>=R=P>>>24,k-=R,(R=P>>>16&255)===0)O[u++]=65535&P;else{if(!(16&R)){if((64&R)==0){P=S[(65535&P)+(v&(1<<R)-1)];continue t}if(32&R){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}D=65535&P,(R&=15)&&(k<R&&(v+=_[l++]<<k,k+=8),D+=v&(1<<R)-1,v>>>=R,k-=R),k<15&&(v+=_[l++]<<k,k+=8,v+=_[l++]<<k,k+=8),P=E[v&T];n:for(;;){if(v>>>=R=P>>>24,k-=R,!(16&(R=P>>>16&255))){if((64&R)==0){P=E[(65535&P)+(v&(1<<R)-1)];continue n}i.msg="invalid distance code",a.mode=30;break e}if(M=65535&P,k<(R&=15)&&(v+=_[l++]<<k,(k+=8)<R&&(v+=_[l++]<<k,k+=8)),f<(M+=v&(1<<R)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=R,k-=R,(R=u-h)<M){if(m<(R=M-R)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(L=g,(C=0)===y){if(C+=x-R,R<D){for(D-=R;O[u++]=g[C++],--R;);C=u-M,L=O}}else if(y<R){if(C+=x+y-R,(R-=y)<D){for(D-=R;O[u++]=g[C++],--R;);if(C=0,y<D){for(D-=R=y;O[u++]=g[C++],--R;);C=u-M,L=O}}}else if(C+=y-R,R<D){for(D-=R;O[u++]=g[C++],--R;);C=u-M,L=O}for(;2<D;)O[u++]=L[C++],O[u++]=L[C++],O[u++]=L[C++],D-=3;D&&(O[u++]=L[C++],1<D&&(O[u++]=L[C++]))}else{for(C=u-M;O[u++]=O[C++],O[u++]=O[C++],O[u++]=O[C++],2<(D-=3););D&&(O[u++]=O[C++],1<D&&(O[u++]=O[C++]))}break}}break}}while(l<c&&u<p);l-=D=k>>3,v&=(1<<(k-=D<<3))-1,i.next_in=l,i.next_out=u,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=u<p?p-u+257:257-(u-p),a.hold=v,a.bits=k}},{}],49:[function(n,r,o){var i=n("../utils/common"),s=n("./adler32"),a=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,h=2,p=0,f=-2,x=1,m=852,y=592;function g(C){return(C>>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(C){var L;return C&&C.state?(L=C.state,C.total_in=C.total_out=L.total=0,C.msg="",L.wrap&&(C.adler=1&L.wrap),L.mode=x,L.last=0,L.havedict=0,L.dmax=32768,L.head=null,L.hold=0,L.bits=0,L.lencode=L.lendyn=new i.Buf32(m),L.distcode=L.distdyn=new i.Buf32(y),L.sane=1,L.back=-1,p):f}function S(C){var L;return C&&C.state?((L=C.state).wsize=0,L.whave=0,L.wnext=0,k(C)):f}function E(C,L){var _,O;return C&&C.state?(O=C.state,L<0?(_=0,L=-L):(_=1+(L>>4),L<48&&(L&=15)),L&&(L<8||15<L)?f:(O.window!==null&&O.wbits!==L&&(O.window=null),O.wrap=_,O.wbits=L,S(C))):f}function N(C,L){var _,O;return C?(O=new v,(C.state=O).window=null,(_=E(C,L))!==p&&(C.state=null),_):f}var T,P,R=!0;function D(C){if(R){var L;for(T=new i.Buf32(512),P=new i.Buf32(32),L=0;L<144;)C.lens[L++]=8;for(;L<256;)C.lens[L++]=9;for(;L<280;)C.lens[L++]=7;for(;L<288;)C.lens[L++]=8;for(c(u,C.lens,0,288,T,0,C.work,{bits:9}),L=0;L<32;)C.lens[L++]=5;c(h,C.lens,0,32,P,0,C.work,{bits:5}),R=!1}C.lencode=T,C.lenbits=9,C.distcode=P,C.distbits=5}function M(C,L,_,O){var J,Z=C.state;return Z.window===null&&(Z.wsize=1<<Z.wbits,Z.wnext=0,Z.whave=0,Z.window=new i.Buf8(Z.wsize)),O>=Z.wsize?(i.arraySet(Z.window,L,_-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize):(O<(J=Z.wsize-Z.wnext)&&(J=O),i.arraySet(Z.window,L,_-O,J,Z.wnext),(O-=J)?(i.arraySet(Z.window,L,_-O,O,0),Z.wnext=O,Z.whave=Z.wsize):(Z.wnext+=J,Z.wnext===Z.wsize&&(Z.wnext=0),Z.whave<Z.wsize&&(Z.whave+=J))),0}o.inflateReset=S,o.inflateReset2=E,o.inflateResetKeep=k,o.inflateInit=function(C){return N(C,15)},o.inflateInit2=N,o.inflate=function(C,L){var _,O,J,Z,W,q,A,U,B,j,ee,re,ve,ie,de,ge,te,oe,me,Ee,b,K,H,z,I=0,F=new i.Buf8(4),X=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!C||!C.state||!C.output||!C.input&&C.avail_in!==0)return f;(_=C.state).mode===12&&(_.mode=13),W=C.next_out,J=C.output,A=C.avail_out,Z=C.next_in,O=C.input,q=C.avail_in,U=_.hold,B=_.bits,j=q,ee=A,K=p;e:for(;;)switch(_.mode){case x:if(_.wrap===0){_.mode=13;break}for(;B<16;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(2&_.wrap&&U===35615){F[_.check=0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0),B=U=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&U)<<8)+(U>>8))%31){C.msg="incorrect header check",_.mode=30;break}if((15&U)!=8){C.msg="unknown compression method",_.mode=30;break}if(B-=4,b=8+(15&(U>>>=4)),_.wbits===0)_.wbits=b;else if(b>_.wbits){C.msg="invalid window size",_.mode=30;break}_.dmax=1<<b,C.adler=_.check=1,_.mode=512&U?10:12,B=U=0;break;case 2:for(;B<16;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(_.flags=U,(255&_.flags)!=8){C.msg="unknown compression method",_.mode=30;break}if(57344&_.flags){C.msg="unknown header flags set",_.mode=30;break}_.head&&(_.head.text=U>>8&1),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=3;case 3:for(;B<32;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}_.head&&(_.head.time=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,F[2]=U>>>16&255,F[3]=U>>>24&255,_.check=a(_.check,F,4,0)),B=U=0,_.mode=4;case 4:for(;B<16;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}_.head&&(_.head.xflags=255&U,_.head.os=U>>8),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0,_.mode=5;case 5:if(1024&_.flags){for(;B<16;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}_.length=U,_.head&&(_.head.extra_len=U),512&_.flags&&(F[0]=255&U,F[1]=U>>>8&255,_.check=a(_.check,F,2,0)),B=U=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(q<(re=_.length)&&(re=q),re&&(_.head&&(b=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),i.arraySet(_.head.extra,O,Z,re,b)),512&_.flags&&(_.check=a(_.check,O,re,Z)),q-=re,Z+=re,_.length-=re),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(q===0)break e;for(re=0;b=O[Z+re++],_.head&&b&&_.length<65536&&(_.head.name+=String.fromCharCode(b)),b&&re<q;);if(512&_.flags&&(_.check=a(_.check,O,re,Z)),q-=re,Z+=re,b)break e}else _.head&&(_.head.name=null);_.length=0,_.mode=8;case 8:if(4096&_.flags){if(q===0)break e;for(re=0;b=O[Z+re++],_.head&&b&&_.length<65536&&(_.head.comment+=String.fromCharCode(b)),b&&re<q;);if(512&_.flags&&(_.check=a(_.check,O,re,Z)),q-=re,Z+=re,b)break e}else _.head&&(_.head.comment=null);_.mode=9;case 9:if(512&_.flags){for(;B<16;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(U!==(65535&_.check)){C.msg="header crc mismatch",_.mode=30;break}B=U=0}_.head&&(_.head.hcrc=_.flags>>9&1,_.head.done=!0),C.adler=_.check=0,_.mode=12;break;case 10:for(;B<32;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}C.adler=_.check=g(U),B=U=0,_.mode=11;case 11:if(_.havedict===0)return C.next_out=W,C.avail_out=A,C.next_in=Z,C.avail_in=q,_.hold=U,_.bits=B,2;C.adler=_.check=1,_.mode=12;case 12:if(L===5||L===6)break e;case 13:if(_.last){U>>>=7&B,B-=7&B,_.mode=27;break}for(;B<3;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}switch(_.last=1&U,B-=1,3&(U>>>=1)){case 0:_.mode=14;break;case 1:if(D(_),_.mode=20,L!==6)break;U>>>=2,B-=2;break e;case 2:_.mode=17;break;case 3:C.msg="invalid block type",_.mode=30}U>>>=2,B-=2;break;case 14:for(U>>>=7&B,B-=7&B;B<32;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if((65535&U)!=(U>>>16^65535)){C.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&U,B=U=0,_.mode=15,L===6)break e;case 15:_.mode=16;case 16:if(re=_.length){if(q<re&&(re=q),A<re&&(re=A),re===0)break e;i.arraySet(J,O,Z,re,W),q-=re,Z+=re,A-=re,W+=re,_.length-=re;break}_.mode=12;break;case 17:for(;B<14;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(_.nlen=257+(31&U),U>>>=5,B-=5,_.ndist=1+(31&U),U>>>=5,B-=5,_.ncode=4+(15&U),U>>>=4,B-=4,286<_.nlen||30<_.ndist){C.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;B<3;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}_.lens[X[_.have++]]=7&U,U>>>=3,B-=3}for(;_.have<19;)_.lens[X[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,H={bits:_.lenbits},K=c(0,_.lens,0,19,_.lencode,0,_.work,H),_.lenbits=H.bits,K){C.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;ge=(I=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,te=65535&I,!((de=I>>>24)<=B);){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(te<16)U>>>=de,B-=de,_.lens[_.have++]=te;else{if(te===16){for(z=de+2;B<z;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(U>>>=de,B-=de,_.have===0){C.msg="invalid bit length repeat",_.mode=30;break}b=_.lens[_.have-1],re=3+(3&U),U>>>=2,B-=2}else if(te===17){for(z=de+3;B<z;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}B-=de,b=0,re=3+(7&(U>>>=de)),U>>>=3,B-=3}else{for(z=de+7;B<z;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}B-=de,b=0,re=11+(127&(U>>>=de)),U>>>=7,B-=7}if(_.have+re>_.nlen+_.ndist){C.msg="invalid bit length repeat",_.mode=30;break}for(;re--;)_.lens[_.have++]=b}}if(_.mode===30)break;if(_.lens[256]===0){C.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,H={bits:_.lenbits},K=c(u,_.lens,0,_.nlen,_.lencode,0,_.work,H),_.lenbits=H.bits,K){C.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,H={bits:_.distbits},K=c(h,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,H),_.distbits=H.bits,K){C.msg="invalid distances set",_.mode=30;break}if(_.mode=20,L===6)break e;case 20:_.mode=21;case 21:if(6<=q&&258<=A){C.next_out=W,C.avail_out=A,C.next_in=Z,C.avail_in=q,_.hold=U,_.bits=B,l(C,ee),W=C.next_out,J=C.output,A=C.avail_out,Z=C.next_in,O=C.input,q=C.avail_in,U=_.hold,B=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;ge=(I=_.lencode[U&(1<<_.lenbits)-1])>>>16&255,te=65535&I,!((de=I>>>24)<=B);){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(ge&&(240&ge)==0){for(oe=de,me=ge,Ee=te;ge=(I=_.lencode[Ee+((U&(1<<oe+me)-1)>>oe)])>>>16&255,te=65535&I,!(oe+(de=I>>>24)<=B);){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}U>>>=oe,B-=oe,_.back+=oe}if(U>>>=de,B-=de,_.back+=de,_.length=te,ge===0){_.mode=26;break}if(32&ge){_.back=-1,_.mode=12;break}if(64&ge){C.msg="invalid literal/length code",_.mode=30;break}_.extra=15&ge,_.mode=22;case 22:if(_.extra){for(z=_.extra;B<z;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}_.length+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;ge=(I=_.distcode[U&(1<<_.distbits)-1])>>>16&255,te=65535&I,!((de=I>>>24)<=B);){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if((240&ge)==0){for(oe=de,me=ge,Ee=te;ge=(I=_.distcode[Ee+((U&(1<<oe+me)-1)>>oe)])>>>16&255,te=65535&I,!(oe+(de=I>>>24)<=B);){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}U>>>=oe,B-=oe,_.back+=oe}if(U>>>=de,B-=de,_.back+=de,64&ge){C.msg="invalid distance code",_.mode=30;break}_.offset=te,_.extra=15&ge,_.mode=24;case 24:if(_.extra){for(z=_.extra;B<z;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}_.offset+=U&(1<<_.extra)-1,U>>>=_.extra,B-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){C.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(A===0)break e;if(re=ee-A,_.offset>re){if((re=_.offset-re)>_.whave&&_.sane){C.msg="invalid distance too far back",_.mode=30;break}ve=re>_.wnext?(re-=_.wnext,_.wsize-re):_.wnext-re,re>_.length&&(re=_.length),ie=_.window}else ie=J,ve=W-_.offset,re=_.length;for(A<re&&(re=A),A-=re,_.length-=re;J[W++]=ie[ve++],--re;);_.length===0&&(_.mode=21);break;case 26:if(A===0)break e;J[W++]=_.length,A--,_.mode=21;break;case 27:if(_.wrap){for(;B<32;){if(q===0)break e;q--,U|=O[Z++]<<B,B+=8}if(ee-=A,C.total_out+=ee,_.total+=ee,ee&&(C.adler=_.check=_.flags?a(_.check,J,ee,W-ee):s(_.check,J,ee,W-ee)),ee=A,(_.flags?U:g(U))!==_.check){C.msg="incorrect data check",_.mode=30;break}B=U=0}_.mode=28;case 28:if(_.wrap&&_.flags){for(;B<32;){if(q===0)break e;q--,U+=O[Z++]<<B,B+=8}if(U!==(4294967295&_.total)){C.msg="incorrect length check",_.mode=30;break}B=U=0}_.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;default:return f}return C.next_out=W,C.avail_out=A,C.next_in=Z,C.avail_in=q,_.hold=U,_.bits=B,(_.wsize||ee!==C.avail_out&&_.mode<30&&(_.mode<27||L!==4))&&M(C,C.output,C.next_out,ee-C.avail_out)?(_.mode=31,-4):(j-=C.avail_in,ee-=C.avail_out,C.total_in+=j,C.total_out+=ee,_.total+=ee,_.wrap&&ee&&(C.adler=_.check=_.flags?a(_.check,J,ee,C.next_out-ee):s(_.check,J,ee,C.next_out-ee)),C.data_type=_.bits+(_.last?64:0)+(_.mode===12?128:0)+(_.mode===20||_.mode===15?256:0),(j==0&&ee===0||L===4)&&K===p&&(K=-5),K)},o.inflateEnd=function(C){if(!C||!C.state)return f;var L=C.state;return L.window&&(L.window=null),C.state=null,p},o.inflateGetHeader=function(C,L){var _;return C&&C.state?(2&(_=C.state).wrap)==0?f:((_.head=L).done=!1,p):f},o.inflateSetDictionary=function(C,L){var _,O=L.length;return C&&C.state?(_=C.state).wrap!==0&&_.mode!==11?f:_.mode===11&&s(1,L,O,0)!==_.check?-3:M(C,L,O,O)?(_.mode=31,-4):(_.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],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(u,h,p,f,x,m,y,g){var v,k,S,E,N,T,P,R,D,M=g.bits,C=0,L=0,_=0,O=0,J=0,Z=0,W=0,q=0,A=0,U=0,B=null,j=0,ee=new i.Buf16(16),re=new i.Buf16(16),ve=null,ie=0;for(C=0;C<=15;C++)ee[C]=0;for(L=0;L<f;L++)ee[h[p+L]]++;for(J=M,O=15;1<=O&&ee[O]===0;O--);if(O<J&&(J=O),O===0)return x[m++]=20971520,x[m++]=20971520,g.bits=1,0;for(_=1;_<O&&ee[_]===0;_++);for(J<_&&(J=_),C=q=1;C<=15;C++)if(q<<=1,(q-=ee[C])<0)return-1;if(0<q&&(u===0||O!==1))return-1;for(re[1]=0,C=1;C<15;C++)re[C+1]=re[C]+ee[C];for(L=0;L<f;L++)h[p+L]!==0&&(y[re[h[p+L]]++]=L);if(T=u===0?(B=ve=y,19):u===1?(B=s,j-=257,ve=a,ie-=257,256):(B=l,ve=c,-1),C=_,N=m,W=L=U=0,S=-1,E=(A=1<<(Z=J))-1,u===1&&852<A||u===2&&592<A)return 1;for(;;){for(P=C-W,D=y[L]<T?(R=0,y[L]):y[L]>T?(R=ve[ie+y[L]],B[j+y[L]]):(R=96,0),v=1<<C-W,_=k=1<<Z;x[N+(U>>W)+(k-=v)]=P<<24|R<<16|D|0,k!==0;);for(v=1<<C-1;U&v;)v>>=1;if(v!==0?(U&=v-1,U+=v):U=0,L++,--ee[C]==0){if(C===O)break;C=h[p+y[L]]}if(J<C&&(U&E)!==S){for(W===0&&(W=J),N+=_,q=1<<(Z=C-W);Z+W<O&&!((q-=ee[Z+W])<=0);)Z++,q<<=1;if(A+=1<<Z,u===1&&852<A||u===2&&592<A)return 1;x[S=U&E]=J<<24|Z<<16|N-m|0}}return U!==0&&(x[N+U]=C-W<<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(I){for(var F=I.length;0<=--F;)I[F]=0}var c=0,u=29,h=256,p=h+1+u,f=30,x=19,m=2*p+1,y=15,g=16,v=7,k=256,S=16,E=17,N=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],P=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],M=new Array(2*(p+2));l(M);var C=new Array(2*f);l(C);var L=new Array(512);l(L);var _=new Array(256);l(_);var O=new Array(u);l(O);var J,Z,W,q=new Array(f);function A(I,F,X,ne,V){this.static_tree=I,this.extra_bits=F,this.extra_base=X,this.elems=ne,this.max_length=V,this.has_stree=I&&I.length}function U(I,F){this.dyn_tree=I,this.max_code=0,this.stat_desc=F}function B(I){return I<256?L[I]:L[256+(I>>>7)]}function j(I,F){I.pending_buf[I.pending++]=255&F,I.pending_buf[I.pending++]=F>>>8&255}function ee(I,F,X){I.bi_valid>g-X?(I.bi_buf|=F<<I.bi_valid&65535,j(I,I.bi_buf),I.bi_buf=F>>g-I.bi_valid,I.bi_valid+=X-g):(I.bi_buf|=F<<I.bi_valid&65535,I.bi_valid+=X)}function re(I,F,X){ee(I,X[2*F],X[2*F+1])}function ve(I,F){for(var X=0;X|=1&I,I>>>=1,X<<=1,0<--F;);return X>>>1}function ie(I,F,X){var ne,V,ae=new Array(y+1),fe=0;for(ne=1;ne<=y;ne++)ae[ne]=fe=fe+X[ne-1]<<1;for(V=0;V<=F;V++){var le=I[2*V+1];le!==0&&(I[2*V]=ve(ae[le]++,le))}}function de(I){var F;for(F=0;F<p;F++)I.dyn_ltree[2*F]=0;for(F=0;F<f;F++)I.dyn_dtree[2*F]=0;for(F=0;F<x;F++)I.bl_tree[2*F]=0;I.dyn_ltree[2*k]=1,I.opt_len=I.static_len=0,I.last_lit=I.matches=0}function ge(I){8<I.bi_valid?j(I,I.bi_buf):0<I.bi_valid&&(I.pending_buf[I.pending++]=I.bi_buf),I.bi_buf=0,I.bi_valid=0}function te(I,F,X,ne){var V=2*F,ae=2*X;return I[V]<I[ae]||I[V]===I[ae]&&ne[F]<=ne[X]}function oe(I,F,X){for(var ne=I.heap[X],V=X<<1;V<=I.heap_len&&(V<I.heap_len&&te(F,I.heap[V+1],I.heap[V],I.depth)&&V++,!te(F,ne,I.heap[V],I.depth));)I.heap[X]=I.heap[V],X=V,V<<=1;I.heap[X]=ne}function me(I,F,X){var ne,V,ae,fe,le=0;if(I.last_lit!==0)for(;ne=I.pending_buf[I.d_buf+2*le]<<8|I.pending_buf[I.d_buf+2*le+1],V=I.pending_buf[I.l_buf+le],le++,ne===0?re(I,V,F):(re(I,(ae=_[V])+h+1,F),(fe=T[ae])!==0&&ee(I,V-=O[ae],fe),re(I,ae=B(--ne),X),(fe=P[ae])!==0&&ee(I,ne-=q[ae],fe)),le<I.last_lit;);re(I,k,F)}function Ee(I,F){var X,ne,V,ae=F.dyn_tree,fe=F.stat_desc.static_tree,le=F.stat_desc.has_stree,$=F.stat_desc.elems,Q=-1;for(I.heap_len=0,I.heap_max=m,X=0;X<$;X++)ae[2*X]!==0?(I.heap[++I.heap_len]=Q=X,I.depth[X]=0):ae[2*X+1]=0;for(;I.heap_len<2;)ae[2*(V=I.heap[++I.heap_len]=Q<2?++Q:0)]=1,I.depth[V]=0,I.opt_len--,le&&(I.static_len-=fe[2*V+1]);for(F.max_code=Q,X=I.heap_len>>1;1<=X;X--)oe(I,ae,X);for(V=$;X=I.heap[1],I.heap[1]=I.heap[I.heap_len--],oe(I,ae,1),ne=I.heap[1],I.heap[--I.heap_max]=X,I.heap[--I.heap_max]=ne,ae[2*V]=ae[2*X]+ae[2*ne],I.depth[V]=(I.depth[X]>=I.depth[ne]?I.depth[X]:I.depth[ne])+1,ae[2*X+1]=ae[2*ne+1]=V,I.heap[1]=V++,oe(I,ae,1),2<=I.heap_len;);I.heap[--I.heap_max]=I.heap[1],(function(ue,be){var Ie,Ze,st,ze,_t,Ot,Be=be.dyn_tree,Dt=be.max_code,xt=be.stat_desc.static_tree,Wh=be.stat_desc.has_stree,Hh=be.stat_desc.extra_bits,Ks=be.stat_desc.extra_base,Hn=be.stat_desc.max_length,vr=0;for(ze=0;ze<=y;ze++)ue.bl_count[ze]=0;for(Be[2*ue.heap[ue.heap_max]+1]=0,Ie=ue.heap_max+1;Ie<m;Ie++)Hn<(ze=Be[2*Be[2*(Ze=ue.heap[Ie])+1]+1]+1)&&(ze=Hn,vr++),Be[2*Ze+1]=ze,Dt<Ze||(ue.bl_count[ze]++,_t=0,Ks<=Ze&&(_t=Hh[Ze-Ks]),Ot=Be[2*Ze],ue.opt_len+=Ot*(ze+_t),Wh&&(ue.static_len+=Ot*(xt[2*Ze+1]+_t)));if(vr!==0){do{for(ze=Hn-1;ue.bl_count[ze]===0;)ze--;ue.bl_count[ze]--,ue.bl_count[ze+1]+=2,ue.bl_count[Hn]--,vr-=2}while(0<vr);for(ze=Hn;ze!==0;ze--)for(Ze=ue.bl_count[ze];Ze!==0;)Dt<(st=ue.heap[--Ie])||(Be[2*st+1]!==ze&&(ue.opt_len+=(ze-Be[2*st+1])*Be[2*st],Be[2*st+1]=ze),Ze--)}})(I,F),ie(ae,Q,I.bl_count)}function b(I,F,X){var ne,V,ae=-1,fe=F[1],le=0,$=7,Q=4;for(fe===0&&($=138,Q=3),F[2*(X+1)+1]=65535,ne=0;ne<=X;ne++)V=fe,fe=F[2*(ne+1)+1],++le<$&&V===fe||(le<Q?I.bl_tree[2*V]+=le:V!==0?(V!==ae&&I.bl_tree[2*V]++,I.bl_tree[2*S]++):le<=10?I.bl_tree[2*E]++:I.bl_tree[2*N]++,ae=V,Q=(le=0)===fe?($=138,3):V===fe?($=6,3):($=7,4))}function K(I,F,X){var ne,V,ae=-1,fe=F[1],le=0,$=7,Q=4;for(fe===0&&($=138,Q=3),ne=0;ne<=X;ne++)if(V=fe,fe=F[2*(ne+1)+1],!(++le<$&&V===fe)){if(le<Q)for(;re(I,V,I.bl_tree),--le!=0;);else V!==0?(V!==ae&&(re(I,V,I.bl_tree),le--),re(I,S,I.bl_tree),ee(I,le-3,2)):le<=10?(re(I,E,I.bl_tree),ee(I,le-3,3)):(re(I,N,I.bl_tree),ee(I,le-11,7));ae=V,Q=(le=0)===fe?($=138,3):V===fe?($=6,3):($=7,4)}}l(q);var H=!1;function z(I,F,X,ne){ee(I,(c<<1)+(ne?1:0),3),(function(V,ae,fe,le){ge(V),j(V,fe),j(V,~fe),i.arraySet(V.pending_buf,V.window,ae,fe,V.pending),V.pending+=fe})(I,F,X)}o._tr_init=function(I){H||((function(){var F,X,ne,V,ae,fe=new Array(y+1);for(V=ne=0;V<u-1;V++)for(O[V]=ne,F=0;F<1<<T[V];F++)_[ne++]=V;for(_[ne-1]=V,V=ae=0;V<16;V++)for(q[V]=ae,F=0;F<1<<P[V];F++)L[ae++]=V;for(ae>>=7;V<f;V++)for(q[V]=ae<<7,F=0;F<1<<P[V]-7;F++)L[256+ae++]=V;for(X=0;X<=y;X++)fe[X]=0;for(F=0;F<=143;)M[2*F+1]=8,F++,fe[8]++;for(;F<=255;)M[2*F+1]=9,F++,fe[9]++;for(;F<=279;)M[2*F+1]=7,F++,fe[7]++;for(;F<=287;)M[2*F+1]=8,F++,fe[8]++;for(ie(M,p+1,fe),F=0;F<f;F++)C[2*F+1]=5,C[2*F]=ve(F,5);J=new A(M,T,h+1,p,y),Z=new A(C,P,0,f,y),W=new A(new Array(0),R,0,x,v)})(),H=!0),I.l_desc=new U(I.dyn_ltree,J),I.d_desc=new U(I.dyn_dtree,Z),I.bl_desc=new U(I.bl_tree,W),I.bi_buf=0,I.bi_valid=0,de(I)},o._tr_stored_block=z,o._tr_flush_block=function(I,F,X,ne){var V,ae,fe=0;0<I.level?(I.strm.data_type===2&&(I.strm.data_type=(function(le){var $,Q=4093624447;for($=0;$<=31;$++,Q>>>=1)if(1&Q&&le.dyn_ltree[2*$]!==0)return s;if(le.dyn_ltree[18]!==0||le.dyn_ltree[20]!==0||le.dyn_ltree[26]!==0)return a;for($=32;$<h;$++)if(le.dyn_ltree[2*$]!==0)return a;return s})(I)),Ee(I,I.l_desc),Ee(I,I.d_desc),fe=(function(le){var $;for(b(le,le.dyn_ltree,le.l_desc.max_code),b(le,le.dyn_dtree,le.d_desc.max_code),Ee(le,le.bl_desc),$=x-1;3<=$&&le.bl_tree[2*D[$]+1]===0;$--);return le.opt_len+=3*($+1)+5+5+4,$})(I),V=I.opt_len+3+7>>>3,(ae=I.static_len+3+7>>>3)<=V&&(V=ae)):V=ae=X+5,X+4<=V&&F!==-1?z(I,F,X,ne):I.strategy===4||ae===V?(ee(I,2+(ne?1:0),3),me(I,M,C)):(ee(I,4+(ne?1:0),3),(function(le,$,Q,ue){var be;for(ee(le,$-257,5),ee(le,Q-1,5),ee(le,ue-4,4),be=0;be<ue;be++)ee(le,le.bl_tree[2*D[be]+1],3);K(le,le.dyn_ltree,$-1),K(le,le.dyn_dtree,Q-1)})(I,I.l_desc.max_code+1,I.d_desc.max_code+1,fe+1),me(I,I.dyn_ltree,I.dyn_dtree)),de(I),ne&&ge(I)},o._tr_tally=function(I,F,X){return I.pending_buf[I.d_buf+2*I.last_lit]=F>>>8&255,I.pending_buf[I.d_buf+2*I.last_lit+1]=255&F,I.pending_buf[I.l_buf+I.last_lit]=255&X,I.last_lit++,F===0?I.dyn_ltree[2*X]++:(I.matches++,F--,I.dyn_ltree[2*(_[X]+h+1)]++,I.dyn_dtree[2*B(F)]++),I.last_lit===I.lit_bufsize-1},o._tr_align=function(I){ee(I,2,3),re(I,k,M),(function(F){F.bi_valid===16?(j(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(I)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,u,h,p=1,f={},x=!1,m=s.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(s);y=y&&y.setTimeout?y:s,l={}.toString.call(s.process)==="[object process]"?function(S){process.nextTick(function(){v(S)})}:(function(){if(s.postMessage&&!s.importScripts){var S=!0,E=s.onmessage;return s.onmessage=function(){S=!1},s.postMessage("","*"),s.onmessage=E,S}})()?(h="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(S){s.postMessage(h+S,"*")}):s.MessageChannel?((u=new MessageChannel).port1.onmessage=function(S){v(S.data)},function(S){u.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(c=m.documentElement,function(S){var E=m.createElement("script");E.onreadystatechange=function(){v(S),E.onreadystatechange=null,c.removeChild(E),E=null},c.appendChild(E)}):function(S){setTimeout(v,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var E=new Array(arguments.length-1),N=0;N<E.length;N++)E[N]=arguments[N+1];var T={callback:S,args:E};return f[p]=T,l(p),p++},y.clearImmediate=g}function g(S){delete f[S]}function v(S){if(x)setTimeout(v,0,S);else{var E=f[S];if(E){x=!0;try{(function(N){var T=N.callback,P=N.args;switch(P.length){case 0:T();break;case 1:T(P[0]);break;case 2:T(P[0],P[1]);break;case 3:T(P[0],P[1],P[2]);break;default:T.apply(a,P)}})(E)}finally{g(S),x=!1}}}}function k(S){S.source===s&&typeof S.data=="string"&&S.data.indexOf(h)===0&&v(+S.data.slice(h.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof br<"u"?br:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Do)),Do.exports}var hb=fb();const pb=qi(hb);async function mb(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 gb(e){const t=new pb;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 mb(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 xb="1.12.0",yb={version:xb};function mu(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=mu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=mu(e))&&(r&&(r+=" "),r+=t);return r}const vb=(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},bb=(e,t)=>({classGroupId:e,validator:t}),xu=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qr="-",Ea=[],wb="arbitrary..",_b=e=>{const t=Sb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return kb(s);const a=s.split(qr),l=a[0]===""&&a.length>1?1:0;return yu(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=r[s],c=n[s];return l?c?vb(c,l):l:c||Ea}return n[s]||Ea}}},yu=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const c=yu(e,t+1,i);if(c)return c}const s=n.validators;if(s===null)return;const a=t===0?e.join(qr):e.slice(t).join(qr),l=s.length;for(let c=0;c<l;c++){const u=s[c];if(u.validator(a))return u.classGroupId}},kb=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?wb+r:void 0})(),Sb=e=>{const{theme:t,classGroups:n}=e;return Cb(n,t)},Cb=(e,t)=>{const n=xu();for(const r in e){const o=e[r];is(o,n,r,t)}return n},is=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Eb(s,t,n,r)}},Eb=(e,t,n,r)=>{if(typeof e=="string"){Nb(e,t,n);return}if(typeof e=="function"){Tb(e,t,n,r);return}jb(e,t,n,r)},Nb=(e,t,n)=>{const r=e===""?t:vu(t,e);r.classGroupId=n},Tb=(e,t,n,r)=>{if(Ab(e)){is(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(bb(n,e))},jb=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];is(l,vu(t,a),n,r)}},vu=(e,t)=>{let n=e;const r=t.split(qr),o=r.length;for(let i=0;i<o;i++){const s=r[i];let a=n.nextPart.get(s);a||(a=xu(),n.nextPart.set(s,a)),n=a}return n},Ab=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ib=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)}}},vi="!",Na=":",zb=[],Ta=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Pb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,a=0,l=0,c;const u=o.length;for(let m=0;m<u;m++){const y=o[m];if(s===0&&a===0){if(y===Na){i.push(o.slice(l,m)),l=m+1;continue}if(y==="/"){c=m;continue}}y==="["?s++:y==="]"?s--:y==="("?a++:y===")"&&a--}const h=i.length===0?o:o.slice(l);let p=h,f=!1;h.endsWith(vi)?(p=h.slice(0,-1),f=!0):h.startsWith(vi)&&(p=h.slice(1),f=!0);const x=c&&c>l?c-l:void 0;return Ta(i,f,p,x)};if(t){const o=t+Na,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):Ta(zb,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Rb=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}},Ob=e=>({cache:Ib(e.cacheSize),parseClassName:Pb(e),sortModifiers:Rb(e),..._b(e)}),Db=/\s+/,Mb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Db);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:m}=n(u);if(h){l=u+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?x.substring(0,m):x);if(!g){if(!y){l=u+(l.length>0?" "+l:l);continue}if(g=r(x),!g){l=u+(l.length>0?" "+l:l);continue}y=!1}const v=p.length===0?"":p.length===1?p[0]:i(p).join(":"),k=f?v+vi:v,S=k+g;if(s.indexOf(S)>-1)continue;s.push(S);const E=o(g,y);for(let N=0;N<E.length;++N){const T=E[N];s.push(k+T)}l=u+(l.length>0?" "+l:l)}return l},Lb=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=bu(n))&&(o&&(o+=" "),o+=r);return o},bu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=bu(e[r]))&&(n&&(n+=" "),n+=t);return n},Fb=(e,...t)=>{let n,r,o,i;const s=l=>{const c=t.reduce((u,h)=>h(u),e());return n=Ob(c),r=n.cache.get,o=n.cache.set,i=a,a(l)},a=l=>{const c=r(l);if(c)return c;const u=Mb(l,n);return o(l,u),u};return i=s,(...l)=>i(Lb(...l))},$b=[],He=e=>{const t=n=>n[e]||$b;return t.isThemeGetter=!0,t},wu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_u=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bb=/^\d+\/\d+$/,Ub=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zb=/\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$/,Vb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pn=e=>Bb.test(e),je=e=>!!e&&!Number.isNaN(Number(e)),Ut=e=>!!e&&Number.isInteger(Number(e)),Mo=e=>e.endsWith("%")&&je(e.slice(0,-1)),Mt=e=>Ub.test(e),qb=()=>!0,Gb=e=>Zb.test(e)&&!Vb.test(e),ku=()=>!1,Kb=e=>Wb.test(e),Jb=e=>Hb.test(e),Yb=e=>!he(e)&&!pe(e),Xb=e=>Fn(e,Eu,ku),he=e=>wu.test(e),nn=e=>Fn(e,Nu,Gb),Lo=e=>Fn(e,r1,je),ja=e=>Fn(e,Su,ku),Qb=e=>Fn(e,Cu,Jb),Cr=e=>Fn(e,Tu,Kb),pe=e=>_u.test(e),Gn=e=>$n(e,Nu),e1=e=>$n(e,o1),Aa=e=>$n(e,Su),t1=e=>$n(e,Eu),n1=e=>$n(e,Cu),Er=e=>$n(e,Tu,!0),Fn=(e,t,n)=>{const r=wu.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},$n=(e,t,n=!1)=>{const r=_u.exec(e);return r?r[1]?t(r[1]):n:!1},Su=e=>e==="position"||e==="percentage",Cu=e=>e==="image"||e==="url",Eu=e=>e==="length"||e==="size"||e==="bg-size",Nu=e=>e==="length",r1=e=>e==="number",o1=e=>e==="family-name",Tu=e=>e==="shadow",i1=()=>{const e=He("color"),t=He("font"),n=He("text"),r=He("font-weight"),o=He("tracking"),i=He("leading"),s=He("breakpoint"),a=He("container"),l=He("spacing"),c=He("radius"),u=He("shadow"),h=He("inset-shadow"),p=He("text-shadow"),f=He("drop-shadow"),x=He("blur"),m=He("perspective"),y=He("aspect"),g=He("ease"),v=He("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...S(),pe,he],N=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],P=()=>[pe,he,l],R=()=>[pn,"full","auto",...P()],D=()=>[Ut,"none","subgrid",pe,he],M=()=>["auto",{span:["full",Ut,pe,he]},Ut,pe,he],C=()=>[Ut,"auto",pe,he],L=()=>["auto","min","max","fr",pe,he],_=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],J=()=>["auto",...P()],Z=()=>[pn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],W=()=>[e,pe,he],q=()=>[...S(),Aa,ja,{position:[pe,he]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",t1,Xb,{size:[pe,he]}],B=()=>[Mo,Gn,nn],j=()=>["","none","full",c,pe,he],ee=()=>["",je,Gn,nn],re=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[je,Mo,Aa,ja],de=()=>["","none",x,pe,he],ge=()=>["none",je,pe,he],te=()=>["none",je,pe,he],oe=()=>[je,pe,he],me=()=>[pn,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mt],breakpoint:[Mt],color:[qb],container:[Mt],"drop-shadow":[Mt],ease:["in","out","in-out"],font:[Yb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mt],shadow:[Mt],spacing:["px",je],text:[Mt],"text-shadow":[Mt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",pn,he,pe,y]}],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:E()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[Ut,"auto",pe,he]}],basis:[{basis:[pn,"full","auto",a,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[je,pn,"auto","initial","none",he]}],grow:[{grow:["",je,pe,he]}],shrink:[{shrink:["",je,pe,he]}],order:[{order:[Ut,"first","last","none",pe,he]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[..._(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",..._()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":_()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m: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":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],w:[{w:[a,"screen",...Z()]}],"min-w":[{"min-w":[a,"screen","none",...Z()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,Gn,nn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pe,Lo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mo,he]}],"font-family":[{font:[e1,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,Lo]}],leading:[{leading:[i,...P()]}],"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:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[je,"from-font","auto",pe,nn]}],"text-decoration-color":[{decoration:W()}],"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:P()}],"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:q()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ut,pe,he],radial:["",pe,he],conic:[Ut,pe,he]},n1,Qb]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[je,pe,he]}],"outline-w":[{outline:["",je,Gn,nn]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",u,Er,Cr]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",h,Er,Cr]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[je,nn]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",p,Er,Cr]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[je,pe,he]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[pe,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[je]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,he]}],filter:[{filter:["","none",pe,he]}],blur:[{blur:de()}],brightness:[{brightness:[je,pe,he]}],contrast:[{contrast:[je,pe,he]}],"drop-shadow":[{"drop-shadow":["","none",f,Er,Cr]}],"drop-shadow-color":[{"drop-shadow":W()}],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":de()}],"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":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",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",v,pe,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,pe,he]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[pe,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,he]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[je,Gn,nn,Lo]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},s1=Fb(i1);function Se(...e){return s1(gu(e))}function Je(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function ju(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}const Ia=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,za=gu,ss=(e,t)=>n=>{var r;if(t?.variants==null)return za(e,n?.class,n?.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n?.[c],h=i?.[c];if(u===null)return null;const p=Ia(u)||Ia(h);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[h,p]=u;return p===void 0||(c[h]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:h,className:p,...f}=u;return Object.entries(f).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...i,...a}[m]):{...i,...a}[m]===y})?[...c,h,p]:c},[]);return za(e,s,l,n?.class,n?.className)};function Pa(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Au(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Pa(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():Pa(e[o],null)}}}}function Re(...e){return w.useCallback(Au(...e),e)}function Pn(e){const t=l1(e),n=w.forwardRef((r,o)=>{const{children:i,...s}=r,a=w.Children.toArray(i),l=a.find(u1);if(l){const c=l.props.children,u=a.map(h=>h===l?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:h);return d.jsx(t,{...s,ref:o,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return d.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var a1=Pn("Slot");function l1(e){const t=w.forwardRef((n,r)=>{const{children:o,...i}=n;if(w.isValidElement(o)){const s=f1(o),a=d1(i,o.props);return o.type!==w.Fragment&&(a.ref=r?Au(r,s):s),w.cloneElement(o,a)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Iu=Symbol("radix.slottable");function c1(e){const t=({children:n})=>d.jsx(d.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Iu,t}function u1(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iu}function d1(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 f1(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 h1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=h1.reduce((e,t)=>{const n=Pn(`Primitive.${t}`),r=w.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function p1(e,t){e&&dr.flushSync(()=>e.dispatchEvent(t))}var zu=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"}),m1="VisuallyHidden",Pu=w.forwardRef((e,t)=>d.jsx(Ce.span,{...e,ref:t,style:{...zu,...e.style}}));Pu.displayName=m1;var g1=Pu;function x1(e,t){const n=w.createContext(t),r=i=>{const{children:s,...a}=i,l=w.useMemo(()=>a,Object.values(a));return d.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=w.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 Bt(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];const c=h=>{const{scope:p,children:f,...x}=h,m=p?.[e]?.[l]||a,y=w.useMemo(()=>x,Object.values(x));return d.jsx(m.Provider,{value:y,children:f})};c.displayName=i+"Provider";function u(h,p){const f=p?.[e]?.[l]||a,x=w.useContext(f);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=a?.[e]||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,y1(o,...t)]}function y1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const h=l(i)[`__scope${c}`];return{...a,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ru(e){const t=e+"CollectionProvider",[n,r]=Bt(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:g}=m,v=nt.useRef(null),k=nt.useRef(new Map).current;return d.jsx(o,{scope:y,itemMap:k,collectionRef:v,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=Pn(a),c=nt.forwardRef((m,y)=>{const{scope:g,children:v}=m,k=i(a,g),S=Re(y,k.collectionRef);return d.jsx(l,{ref:S,children:v})});c.displayName=a;const u=e+"CollectionItemSlot",h="data-radix-collection-item",p=Pn(u),f=nt.forwardRef((m,y)=>{const{scope:g,children:v,...k}=m,S=nt.useRef(null),E=Re(y,S),N=i(u,g);return nt.useEffect(()=>(N.itemMap.set(S,{ref:S,...k}),()=>{N.itemMap.delete(S)})),d.jsx(p,{[h]:"",ref:E,children:v})});f.displayName=u;function x(m){const y=i(e+"CollectionConsumer",m);return nt.useCallback(()=>{const v=y.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((N,T)=>k.indexOf(N.ref.current)-k.indexOf(T.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:f},x,r]}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var qe=globalThis?.document?w.useLayoutEffect:()=>{},v1=xc[" useInsertionEffect ".trim().toString()]||qe;function rn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=b1({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=w.useRef(e!==void 0);w.useEffect(()=>{const h=u.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.`),u.current=a},[a,r])}const c=w.useCallback(u=>{if(a){const h=w1(u)?u(e):u;h!==e&&s.current?.(h)}else i(u)},[a,e,i,s]);return[l,c]}function b1({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),o=w.useRef(n),i=w.useRef(t);return v1(()=>{i.current=t},[t]),w.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function w1(e){return typeof e=="function"}function _1(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var mt=e=>{const{present:t,children:n}=e,r=k1(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Re(r.ref,S1(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};mt.displayName="Presence";function k1(e){const[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=_1(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Nr(r.current);i.current=a==="mounted"?c:"none"},[a]),qe(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,f=Nr(c);e?l("MOUNT"):f==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&p!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),qe(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,h=f=>{const m=Nr(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=f=>{f.target===t&&(i.current=Nr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Nr(e){return e?.animationName||"none"}function S1(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 C1=xc[" useId ".trim().toString()]||(()=>{}),E1=0;function Nt(e){const[t,n]=w.useState(C1());return qe(()=>{n(r=>r??String(E1++))},[e]),e||(t?`radix-${t}`:"")}var fo="Collapsible",[N1]=Bt(fo),[T1,as]=N1(fo),Ou=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l,c]=rn({prop:r,defaultProp:o??!1,onChange:s,caller:fo});return d.jsx(T1,{scope:n,disabled:i,contentId:Nt(),open:l,onOpenToggle:w.useCallback(()=>c(u=>!u),[c]),children:d.jsx(Ce.div,{"data-state":cs(l),"data-disabled":i?"":void 0,...a,ref:t})})});Ou.displayName=fo;var Du="CollapsibleTrigger",Mu=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=as(Du,n);return d.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":cs(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:we(e.onClick,o.onOpenToggle)})});Mu.displayName=Du;var ls="CollapsibleContent",Lu=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=as(ls,e.__scopeCollapsible);return d.jsx(mt,{present:n||o.open,children:({present:i})=>d.jsx(j1,{...r,ref:t,present:i})})});Lu.displayName=ls;var j1=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=as(ls,n),[a,l]=w.useState(r),c=w.useRef(null),u=Re(t,c),h=w.useRef(0),p=h.current,f=w.useRef(0),x=f.current,m=s.open||a,y=w.useRef(m),g=w.useRef(void 0);return w.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),qe(()=>{const v=c.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const k=v.getBoundingClientRect();h.current=k.height,f.current=k.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),l(r)}},[s.open,r]),d.jsx(Ce.div,{"data-state":cs(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!m,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function cs(e){return e?"open":"closed"}var A1=Ou,I1=w.createContext(void 0);function ho(e){const t=w.useContext(I1);return e||t||"ltr"}function Qe(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>t.current?.(...n),[])}function z1(e,t=globalThis?.document){const n=Qe(e);w.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 P1="DismissableLayer",bi="dismissableLayer.update",R1="dismissableLayer.pointerDownOutside",O1="dismissableLayer.focusOutside",Ra,Fu=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),po=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=w.useContext(Fu),[u,h]=w.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=w.useState({}),x=Re(t,T=>h(T)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),v=u?m.indexOf(u):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=g,E=L1(T=>{const P=T.target,R=[...c.branches].some(D=>D.contains(P));!S||R||(o?.(T),s?.(T),T.defaultPrevented||a?.())},p),N=F1(T=>{const P=T.target;[...c.branches].some(D=>D.contains(P))||(i?.(T),s?.(T),T.defaultPrevented||a?.())},p);return z1(T=>{v===c.layers.size-1&&(r?.(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},p),w.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ra=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Oa(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ra)}},[u,p,n,c]),w.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Oa())},[u,c]),w.useEffect(()=>{const T=()=>f({});return document.addEventListener(bi,T),()=>document.removeEventListener(bi,T)},[]),d.jsx(Ce.div,{...l,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,N.onFocusCapture),onBlurCapture:we(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,E.onPointerDownCapture)})});po.displayName=P1;var D1="DismissableLayerBranch",M1=w.forwardRef((e,t)=>{const n=w.useContext(Fu),r=w.useRef(null),o=Re(t,r);return w.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(Ce.div,{...e,ref:o})});M1.displayName=D1;function L1(e,t=globalThis?.document){const n=Qe(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){$u(R1,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F1(e,t=globalThis?.document){const n=Qe(e),r=w.useRef(!1);return w.useEffect(()=>{const o=i=>{i.target&&!r.current&&$u(O1,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 Oa(){const e=new CustomEvent(bi);document.dispatchEvent(e)}function $u(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?p1(o,i):o.dispatchEvent(i)}var Fo="focusScope.autoFocusOnMount",$o="focusScope.autoFocusOnUnmount",Da={bubbles:!1,cancelable:!0},$1="FocusScope",us=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=w.useState(null),c=Qe(o),u=Qe(i),h=w.useRef(null),p=Re(t,m=>l(m)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let m=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?h.current=S:Vt(h.current,{select:!0})},y=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Vt(h.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const E of k)E.removedNodes.length>0&&Vt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),v.disconnect()}}},[r,a,f.paused]),w.useEffect(()=>{if(a){La.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Fo,Da);a.addEventListener(Fo,c),a.dispatchEvent(g),g.defaultPrevented||(B1(H1(Bu(a)),{select:!0}),document.activeElement===m&&Vt(a))}return()=>{a.removeEventListener(Fo,c),setTimeout(()=>{const g=new CustomEvent($o,Da);a.addEventListener($o,u),a.dispatchEvent(g),g.defaultPrevented||Vt(m??document.body,{select:!0}),a.removeEventListener($o,u),La.remove(f)},0)}}},[a,c,u,f]);const x=w.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(y&&g){const v=m.currentTarget,[k,S]=U1(v);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Vt(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Vt(S,{select:!0})):g===v&&m.preventDefault()}},[n,r,f.paused]);return d.jsx(Ce.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});us.displayName=$1;function B1(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vt(r,{select:t}),document.activeElement!==n)return}function U1(e){const t=Bu(e),n=Ma(t,e),r=Ma(t.reverse(),e);return[n,r]}function Bu(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 Ma(e,t){for(const n of e)if(!Z1(n,{upTo:t}))return n}function Z1(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 V1(e){return e instanceof HTMLInputElement&&"select"in e}function Vt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&V1(e)&&t&&e.select()}}var La=W1();function W1(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Fa(e,t),e.unshift(t)},remove(t){e=Fa(e,t),e[0]?.resume()}}}function Fa(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function H1(e){return e.filter(t=>t.tagName!=="A")}var q1="Portal",mo=w.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=w.useState(!1);qe(()=>i(!0),[]);const s=n||o&&globalThis?.document?.body;return s?Gh.createPortal(d.jsx(Ce.div,{...r,ref:t}),s):null});mo.displayName=q1;var Bo=0;function Uu(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$a()),document.body.insertAdjacentElement("beforeend",e[1]??$a()),Bo++,()=>{Bo===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bo--}},[])}function $a(){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 St=function(){return St=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},St.apply(this,arguments)};function Zu(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 G1(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 Lr="right-scroll-bar-position",Fr="width-before-scroll-bar",K1="with-scroll-bars-hidden",J1="--removed-body-scroll-bar-size";function Uo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Y1(e,t){var n=w.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 X1=typeof window<"u"?w.useLayoutEffect:w.useEffect,Ba=new WeakMap;function Q1(e,t){var n=Y1(null,function(r){return e.forEach(function(o){return Uo(o,r)})});return X1(function(){var r=Ba.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||Uo(a,null)}),i.forEach(function(a){o.has(a)||Uo(a,s)})}Ba.set(n,e)},[e]),n}function ew(e){return e}function tw(e,t){t===void 0&&(t=ew);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function nw(e){e===void 0&&(e={});var t=tw(null);return t.options=St({async:!0,ssr:!1},e),t}var Vu=function(e){var t=e.sideCar,n=Zu(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 w.createElement(r,St({},n))};Vu.isSideCarExport=!0;function rw(e,t){return e.useMedium(t),Vu}var Wu=nw(),Zo=function(){},go=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Zo,onWheelCapture:Zo,onTouchMoveCapture:Zo}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,h=e.shards,p=e.sideCar,f=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,k=e.gapMode,S=Zu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,N=Q1([n,t]),T=St(St({},S),o);return w.createElement(w.Fragment,null,u&&w.createElement(E,{sideCar:Wu,removeScrollBar:c,shards:h,noRelative:f,noIsolation:x,inert:m,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:k}),s?w.cloneElement(w.Children.only(a),St(St({},T),{ref:N})):w.createElement(v,St({},T,{className:l,ref:N}),a))});go.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};go.classNames={fullWidth:Fr,zeroRight:Lr};var ow=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iw(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ow();return t&&e.setAttribute("nonce",t),e}function sw(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function aw(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lw=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iw())&&(sw(t,n),aw(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cw=function(){var e=lw();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hu=function(){var e=cw(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},uw={left:0,top:0,right:0,gap:0},Vo=function(e){return parseInt(e||"",10)||0},dw=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[Vo(n),Vo(r),Vo(o)]},fw=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uw;var t=dw(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])}},hw=Hu(),En="data-scroll-locked",pw=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
41
|
+
.`.concat(K1,` {
|
|
42
42
|
overflow: hidden `).concat(r,`;
|
|
43
43
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
44
44
|
}
|
|
@@ -72,34 +72,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
body[`).concat(En,`] {
|
|
75
|
-
`).concat(
|
|
75
|
+
`).concat(J1,": ").concat(a,`px;
|
|
76
76
|
}
|
|
77
|
-
`)},Ua=function(){var e=parseInt(document.body.getAttribute(En)||"0",10);return isFinite(e)?e:0},
|
|
77
|
+
`)},Ua=function(){var e=parseInt(document.body.getAttribute(En)||"0",10);return isFinite(e)?e:0},mw=function(){w.useEffect(function(){return document.body.setAttribute(En,(Ua()+1).toString()),function(){var e=Ua()-1;e<=0?document.body.removeAttribute(En):document.body.setAttribute(En,e.toString())}},[])},gw=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;mw();var i=w.useMemo(function(){return fw(o)},[o]);return w.createElement(hw,{styles:pw(i,!t,o,n?"":"!important")})},wi=!1;if(typeof window<"u")try{var Tr=Object.defineProperty({},"passive",{get:function(){return wi=!0,!0}});window.addEventListener("test",Tr,Tr),window.removeEventListener("test",Tr,Tr)}catch{wi=!1}var mn=wi?{passive:!1}:!1,xw=function(e){return e.tagName==="TEXTAREA"},qu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!xw(e)&&n[t]==="visible")},yw=function(e){return qu(e,"overflowY")},vw=function(e){return qu(e,"overflowX")},Za=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Gu(e,r);if(o){var i=Ku(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bw=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ww=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gu=function(e,t){return e==="v"?yw(t):vw(t)},Ku=function(e,t){return e==="v"?bw(t):ww(t)},_w=function(e,t){return e==="h"&&t==="rtl"?-1:1},kw=function(e,t,n,r,o){var i=_w(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,h=0,p=0;do{if(!a)break;var f=Ku(e,a),x=f[0],m=f[1],y=f[2],g=m-y-i*x;(x||g)&&Gu(e,a)&&(h+=g,p+=x);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(h)<1||!u&&Math.abs(p)<1)&&(c=!0),c},jr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Va=function(e){return[e.deltaX,e.deltaY]},Wa=function(e){return e&&"current"in e?e.current:e},Sw=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Cw=function(e){return`
|
|
78
78
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
79
79
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
80
|
-
`)},
|
|
80
|
+
`)},Ew=0,gn=[];function Nw(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(Ew++)[0],i=w.useState(Hu)[0],s=w.useRef(e);w.useEffect(function(){s.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=G1([e.lockRef.current],(e.shards||[]).map(Wa),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var g=jr(m),v=n.current,k="deltaX"in m?m.deltaX:v[0]-g[0],S="deltaY"in m?m.deltaY:v[1]-g[1],E,N=m.target,T=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in m&&T==="h"&&N.type==="range")return!1;var P=window.getSelection(),R=P&&P.anchorNode,D=R?R===N||R.contains(N):!1;if(D)return!1;var M=Za(T,N);if(!M)return!0;if(M?E=T:(E=T==="v"?"h":"v",M=Za(T,N)),!M)return!1;if(!r.current&&"changedTouches"in m&&(k||S)&&(r.current=E),!E)return!0;var C=r.current||E;return kw(C,y,m,C==="h"?k:S)},[]),l=w.useCallback(function(m){var y=m;if(!(!gn.length||gn[gn.length-1]!==i)){var g="deltaY"in y?Va(y):jr(y),v=t.current.filter(function(E){return E.name===y.type&&(E.target===y.target||y.target===E.shadowParent)&&Sw(E.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var k=(s.current.shards||[]).map(Wa).filter(Boolean).filter(function(E){return E.contains(y.target)}),S=k.length>0?a(y,k[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=w.useCallback(function(m,y,g,v){var k={name:m,delta:y,target:g,should:v,shadowParent:Tw(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),u=w.useCallback(function(m){n.current=jr(m),r.current=void 0},[]),h=w.useCallback(function(m){c(m.type,Va(m),m.target,a(m,e.lockRef.current))},[]),p=w.useCallback(function(m){c(m.type,jr(m),m.target,a(m,e.lockRef.current))},[]);w.useEffect(function(){return gn.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,mn),document.addEventListener("touchmove",l,mn),document.addEventListener("touchstart",u,mn),function(){gn=gn.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,mn),document.removeEventListener("touchmove",l,mn),document.removeEventListener("touchstart",u,mn)}},[]);var f=e.removeScrollBar,x=e.inert;return w.createElement(w.Fragment,null,x?w.createElement(i,{styles:Cw(o)}):null,f?w.createElement(gw,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Tw(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jw=rw(Wu,Nw);var ds=w.forwardRef(function(e,t){return w.createElement(go,St({},e,{ref:t,sideCar:jw}))});ds.classNames=go.classNames;var Aw=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xn=new WeakMap,Ar=new WeakMap,Ir={},Wo=0,Ju=function(e){return e&&(e.host||Ju(e.parentNode))},Iw=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ju(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})},zw=function(e,t,n,r){var o=Iw(t,Array.isArray(e)?e:[e]);Ir[n]||(Ir[n]=new WeakMap);var i=Ir[n],s=[],a=new Set,l=new Set(o),c=function(h){!h||a.has(h)||(a.add(h),c(h.parentNode))};o.forEach(c);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))u(p);else try{var f=p.getAttribute(r),x=f!==null&&f!=="false",m=(xn.get(p)||0)+1,y=(i.get(p)||0)+1;xn.set(p,m),i.set(p,y),s.push(p),m===1&&x&&Ar.set(p,!0),y===1&&p.setAttribute(n,"true"),x||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return u(t),a.clear(),Wo++,function(){s.forEach(function(h){var p=xn.get(h)-1,f=i.get(h)-1;xn.set(h,p),i.set(h,f),p||(Ar.has(h)||h.removeAttribute(r),Ar.delete(h)),f||h.removeAttribute(n)}),Wo--,Wo||(xn=new WeakMap,xn=new WeakMap,Ar=new WeakMap,Ir={})}},Yu=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Aw(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),zw(r,o,n,"aria-hidden")):function(){return null}},xo="Dialog",[Xu]=Bt(xo),[Pw,wt]=Xu(xo),Qu=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=w.useRef(null),l=w.useRef(null),[c,u]=rn({prop:r,defaultProp:o??!1,onChange:i,caller:xo});return d.jsx(Pw,{scope:t,triggerRef:a,contentRef:l,contentId:Nt(),titleId:Nt(),descriptionId:Nt(),open:c,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(h=>!h),[u]),modal:s,children:n})};Qu.displayName=xo;var ed="DialogTrigger",td=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(ed,n),i=Re(t,o.triggerRef);return d.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ps(o.open),...r,ref:i,onClick:we(e.onClick,o.onOpenToggle)})});td.displayName=ed;var fs="DialogPortal",[Rw,nd]=Xu(fs,{forceMount:void 0}),rd=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=wt(fs,t);return d.jsx(Rw,{scope:t,forceMount:n,children:w.Children.map(r,s=>d.jsx(mt,{present:n||i.open,children:d.jsx(mo,{asChild:!0,container:o,children:s})}))})};rd.displayName=fs;var Gr="DialogOverlay",od=w.forwardRef((e,t)=>{const n=nd(Gr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(Gr,e.__scopeDialog);return i.modal?d.jsx(mt,{present:r||i.open,children:d.jsx(Dw,{...o,ref:t})}):null});od.displayName=Gr;var Ow=Pn("DialogOverlay.RemoveScroll"),Dw=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(Gr,n);return d.jsx(ds,{as:Ow,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(Ce.div,{"data-state":ps(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),on="DialogContent",id=w.forwardRef((e,t)=>{const n=nd(on,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=wt(on,e.__scopeDialog);return d.jsx(mt,{present:r||i.open,children:i.modal?d.jsx(Mw,{...o,ref:t}):d.jsx(Lw,{...o,ref:t})})});id.displayName=on;var Mw=w.forwardRef((e,t)=>{const n=wt(on,e.__scopeDialog),r=w.useRef(null),o=Re(t,n.contentRef,r);return w.useEffect(()=>{const i=r.current;if(i)return Yu(i)},[]),d.jsx(sd,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault())})}),Lw=w.forwardRef((e,t)=>{const n=wt(on,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return d.jsx(sd,{...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()}})}),sd=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=wt(on,n),l=w.useRef(null),c=Re(t,l);return Uu(),d.jsxs(d.Fragment,{children:[d.jsx(us,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:d.jsx(po,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":ps(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx($w,{titleId:a.titleId}),d.jsx(Uw,{contentRef:l,descriptionId:a.descriptionId})]})]})}),hs="DialogTitle",ad=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(hs,n);return d.jsx(Ce.h2,{id:o.titleId,...r,ref:t})});ad.displayName=hs;var ld="DialogDescription",Fw=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(ld,n);return d.jsx(Ce.p,{id:o.descriptionId,...r,ref:t})});Fw.displayName=ld;var cd="DialogClose",ud=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=wt(cd,n);return d.jsx(Ce.button,{type:"button",...r,ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))})});ud.displayName=cd;function ps(e){return e?"open":"closed"}var dd="DialogTitleWarning",[N5,fd]=x1(dd,{contentName:on,titleName:hs,docsSlug:"dialog"}),$w=({titleId:e})=>{const t=fd(dd),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 w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ow="DialogDescriptionWarning",Dw=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ud(Ow).contentName}}.`;return w.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Mw=Yu,Lw=Qu,Fw=td,$w=nd,Bw=rd,Uw=id,Zw=ld;function Vw(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ww(e){const[t,n]=w.useState(void 0);return qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Hw=["top","right","bottom","left"],Kt=Math.min,lt=Math.max,Kr=Math.round,zr=Math.floor,Tt=e=>({x:e,y:e}),qw={left:"right",right:"left",bottom:"top",top:"bottom"},Gw={start:"end",end:"start"};function _i(e,t,n){return lt(e,Kt(t,n))}function Lt(e,t){return typeof e=="function"?e(t):e}function Ft(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function ms(e){return e==="x"?"y":"x"}function gs(e){return e==="y"?"height":"width"}const Kw=new Set(["top","bottom"]);function Et(e){return Kw.has(Ft(e))?"y":"x"}function xs(e){return ms(Et(e))}function Jw(e,t,n){n===void 0&&(n=!1);const r=Bn(e),o=xs(e),i=gs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function Yw(e){const t=Jr(e);return[ki(e),t,ki(t)]}function ki(e){return e.replace(/start|end/g,t=>Gw[t])}const Ha=["left","right"],qa=["right","left"],Xw=["top","bottom"],Qw=["bottom","top"];function e2(e,t,n){switch(e){case"top":case"bottom":return n?t?qa:Ha:t?Ha:qa;case"left":case"right":return t?Xw:Qw;default:return[]}}function t2(e,t,n,r){const o=Bn(e);let i=e2(Ft(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ki)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>qw[t])}function n2(e){return{top:0,right:0,bottom:0,left:0,...e}}function dd(e){return typeof e!="number"?n2(e):{top:e,right:e,bottom:e,left:e}}function Yr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ga(e,t,n){let{reference:r,floating:o}=e;const i=Et(t),s=xs(t),a=gs(s),l=Ft(t),c=i==="y",u=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:u,y:r.y-o.height};break;case"bottom":f={x:u,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(Bn(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1);break}return f}async function r2(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=Lt(t,e),x=dd(f),y=a[p?h==="floating"?"reference":"floating":h],g=Yr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=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},C=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:l}):v);return{top:(g.top-C.top+x.top)/S.y,bottom:(C.bottom-g.bottom+x.bottom)/S.y,left:(g.left-C.left+x.left)/S.x,right:(C.right-g.right+x.right)/S.x}}const o2=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:h}=Ga(c,r,l),p=r,f={},x=0;for(let y=0;y<a.length;y++){var m;const{name:g,fn:v}=a[y],{x:k,y:S,data:C,reset:N}=await v({x:u,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:r2},elements:{reference:e,floating:t}});u=k??u,h=S??h,f={...f,[g]:{...f[g],...C}},N&&x<=50&&(x++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(c=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:h}=Ga(c,p,l)),y=-1)}return{x:u,y:h,placement:p,strategy:o,middlewareData:f}},i2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Lt(e,t)||{};if(c==null)return{};const h=dd(u),p={x:n,y:r},f=xs(o),x=gs(f),m=await s.getDimensions(c),y=f==="y",g=y?"top":"left",v=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[f]-p[f]-i.floating[x],C=p[f]-i.reference[f],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=N?N[k]:0;(!A||!await(s.isElement==null?void 0:s.isElement(N)))&&(A=a.floating[k]||i.floating[x]);const R=S/2-C/2,O=A/2-m[x]/2-1,P=Kt(h[g],O),L=Kt(h[v],O),E=P,M=A-m[x]-L,_=A/2-m[x]/2+R,D=_i(E,_,M),J=!l.arrow&&Bn(o)!=null&&_!==D&&i.reference[x]/2-(_<E?P:L)-m[x]/2<0,Z=J?_<E?_-E:_-M:0;return{[f]:p[f]+Z,data:{[f]:D,centerOffset:_-D-Z,...J&&{alignmentOffset:Z}},reset:J}}}),s2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=Lt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ft(o),v=Et(a),k=Ft(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(k||!m?[Jr(a)]:Yw(a)),N=x!=="none";!p&&N&&C.push(...t2(a,m,x,S));const A=[a,...C],R=await l.detectOverflow(t,y),O=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&O.push(R[g]),h){const _=Jw(o,s,S);O.push(R[_[0]],R[_[1]])}if(P=[...P,{placement:o,overflows:O}],!O.every(_=>_<=0)){var L,E;const _=(((L=i.flip)==null?void 0:L.index)||0)+1,D=A[_];if(D&&(!(h==="alignment"?v!==Et(D):!1)||P.every(W=>Et(W.placement)===v?W.overflows[0]>0:!0)))return{data:{index:_,overflows:P},reset:{placement:D}};let J=(E=P.filter(Z=>Z.overflows[0]<=0).sort((Z,W)=>Z.overflows[1]-W.overflows[1])[0])==null?void 0:E.placement;if(!J)switch(f){case"bestFit":{var M;const Z=(M=P.filter(W=>{if(N){const q=Et(W.placement);return q===v||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,j)=>q+j,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:M[0];Z&&(J=Z);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function Ka(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ja(e){return Hw.some(t=>e[t]>=0)}const a2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Lt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Ka(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ja(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Ka(s,n.floating);return{data:{escapedOffsets:a,escaped:Ja(a)}}}default:return{}}}}},fd=new Set(["left","top"]);async function l2(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ft(n),a=Bn(n),l=Et(n)==="y",c=fd.has(s)?-1:1,u=i&&l?-1:1,h=Lt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(f=a==="end"?x*-1:x),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}const c2=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 l2(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}}}}},u2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:k}=g;return{x:v,y:k}}},...c}=Lt(e,t),u={x:n,y:r},h=await i.detectOverflow(t,c),p=Et(Ft(o)),f=ms(p);let x=u[f],m=u[p];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",k=x+h[g],S=x-h[v];x=_i(k,x,S)}if(a){const g=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=m+h[g],S=m-h[v];m=_i(k,m,S)}const y=l.fn({...t,[f]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:s,[p]:a}}}}}},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:c=!0}=Lt(e,t),u={x:n,y:r},h=Et(o),p=ms(h);let f=u[p],x=u[h];const m=Lt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const k=p==="y"?"height":"width",S=i.reference[p]-i.floating[k]+y.mainAxis,C=i.reference[p]+i.reference[k]-y.mainAxis;f<S?f=S:f>C&&(f=C)}if(c){var g,v;const k=p==="y"?"width":"height",S=fd.has(Ft(o)),C=i.reference[h]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[h])||0)+(S?0:y.crossAxis),N=i.reference[h]+i.reference[k]+(S?0:((v=s.offset)==null?void 0:v[h])||0)-(S?y.crossAxis:0);x<C?x=C:x>N&&(x=N)}return{[p]:f,[h]:x}}}},f2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Lt(e,t),u=await s.detectOverflow(t,c),h=Ft(o),p=Bn(o),f=Et(o)==="y",{width:x,height:m}=i.floating;let y,g;h==="top"||h==="bottom"?(y=h,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,y=p==="end"?"top":"bottom");const v=m-u.top-u.bottom,k=x-u.left-u.right,S=Kt(m-u[y],v),C=Kt(x-u[g],k),N=!t.middlewareData.shift;let A=S,R=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=v),N&&!p){const P=lt(u.left,0),L=lt(u.right,0),E=lt(u.top,0),M=lt(u.bottom,0);f?R=x-2*(P!==0||L!==0?P+L:lt(u.left,u.right)):A=m-2*(E!==0||M!==0?E+M:lt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:A});const O=await s.getDimensions(a.floating);return x!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function yo(){return typeof window<"u"}function Un(e){return hd(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pt(e){var t;return(t=(hd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hd(e){return yo()?e instanceof Node||e instanceof dt(e).Node:!1}function vt(e){return yo()?e instanceof Element||e instanceof dt(e).Element:!1}function It(e){return yo()?e instanceof HTMLElement||e instanceof dt(e).HTMLElement:!1}function Ya(e){return!yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot}const h2=new Set(["inline","contents"]);function pr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!h2.has(o)}const p2=new Set(["table","td","th"]);function m2(e){return p2.has(Un(e))}const g2=[":popover-open",":modal"];function vo(e){return g2.some(t=>{try{return e.matches(t)}catch{return!1}})}const x2=["transform","translate","scale","rotate","perspective"],y2=["transform","translate","scale","rotate","perspective","filter"],v2=["paint","layout","strict","content"];function ys(e){const t=vs(),n=vt(e)?bt(e):e;return x2.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)||y2.some(r=>(n.willChange||"").includes(r))||v2.some(r=>(n.contain||"").includes(r))}function b2(e){let t=Jt(e);for(;It(t)&&!Rn(t);){if(ys(t))return t;if(vo(t))return null;t=Jt(t)}return null}function vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const w2=new Set(["html","body","#document"]);function Rn(e){return w2.has(Un(e))}function bt(e){return dt(e).getComputedStyle(e)}function bo(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ya(e)&&e.host||Pt(e);return Ya(t)?t.host:t}function pd(e){const t=Jt(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:It(t)&&pr(t)?t:pd(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=pd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=dt(o);if(i){const a=Si(s);return t.concat(s,s.visualViewport||[],pr(o)?o:[],a&&n?ar(a):[])}return t.concat(o,ar(o,[],n))}function Si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function md(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=It(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Kr(n)!==i||Kr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function bs(e){return vt(e)?e:e.contextElement}function Nn(e){const t=bs(e);if(!It(t))return Tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=md(t);let s=(i?Kr(n.width):n.width)/r,a=(i?Kr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const _2=Tt(0);function gd(e){const t=dt(e);return!vs()||!t.visualViewport?_2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function k2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dt(e)?!1:t}function sn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=bs(e);let s=Tt(1);t&&(r?vt(r)&&(s=Nn(r)):s=Nn(e));const a=k2(i,n,r)?gd(i):Tt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(i){const p=dt(i),f=r&&vt(r)?dt(r):r;let x=p,m=Si(x);for(;m&&r&&f!==x;){const y=Nn(m),g=m.getBoundingClientRect(),v=bt(m),k=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,h*=y.y,l+=k,c+=S,x=dt(m),m=Si(x)}}return Yr({width:u,height:h,x:l,y:c})}function wo(e,t){const n=bo(e).scrollLeft;return t?t.left+n:sn(Pt(e)).left+n}function xd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function S2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Pt(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Tt(1);const u=Tt(0),h=It(r);if((h||!h&&!i)&&((Un(r)!=="body"||pr(s))&&(l=bo(r)),It(r))){const f=sn(r);c=Nn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const p=s&&!h&&!i?xd(s,l):Tt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function C2(e){return Array.from(e.getClientRects())}function E2(e){const t=Pt(e),n=bo(e),r=e.ownerDocument.body,o=lt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=lt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wo(e);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=lt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Xa=25;function N2(e,t){const n=dt(e),r=Pt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=vs();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wo(r);if(c<=0){const u=r.ownerDocument,h=u.body,p=getComputedStyle(h),f=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-f);x<=Xa&&(i-=x)}else c<=Xa&&(i+=c);return{width:i,height:s,x:a,y:l}}const T2=new Set(["absolute","fixed"]);function j2(e,t){const n=sn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=It(e)?Nn(e):Tt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Qa(e,t,n){let r;if(t==="viewport")r=N2(e,n);else if(t==="document")r=E2(Pt(e));else if(vt(t))r=j2(t,n);else{const o=gd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yr(r)}function yd(e,t){const n=Jt(e);return n===t||!vt(n)||Rn(n)?!1:bt(n).position==="fixed"||yd(n,t)}function A2(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>vt(a)&&Un(a)!=="body"),o=null;const i=bt(e).position==="fixed";let s=i?Jt(e):e;for(;vt(s)&&!Rn(s);){const a=bt(s),l=ys(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&T2.has(o.position)||pr(s)&&!l&&yd(e,s))?r=r.filter(u=>u!==s):o=a,s=Jt(s)}return t.set(e,r),r}function I2(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:A2(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const h=Qa(t,u,o);return c.top=lt(h.top,c.top),c.right=Kt(h.right,c.right),c.bottom=Kt(h.bottom,c.bottom),c.left=lt(h.left,c.left),c},Qa(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function z2(e){const{width:t,height:n}=md(e);return{width:t,height:n}}function P2(e,t,n){const r=It(t),o=Pt(t),i=n==="fixed",s=sn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Tt(0);function c(){l.x=wo(o)}if(r||!r&&!i)if((Un(t)!=="body"||pr(o))&&(a=bo(t)),r){const f=sn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?xd(o,a):Tt(0),h=s.left+a.scrollLeft-l.x-u.x,p=s.top+a.scrollTop-l.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function Ho(e){return bt(e).position==="static"}function el(e,t){if(!It(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pt(e)===n&&(n=n.ownerDocument.body),n}function vd(e,t){const n=dt(e);if(vo(e))return n;if(!It(e)){let o=Jt(e);for(;o&&!Rn(o);){if(vt(o)&&!Ho(o))return o;o=Jt(o)}return n}let r=el(e,t);for(;r&&m2(r)&&Ho(r);)r=el(r,t);return r&&Rn(r)&&Ho(r)&&!ys(r)?n:r||b2(e)||n}const R2=async function(e){const t=this.getOffsetParent||vd,n=this.getDimensions,r=await n(e.floating);return{reference:P2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function O2(e){return bt(e).direction==="rtl"}const D2={convertOffsetParentRelativeRectToViewportRelativeRect:S2,getDocumentElement:Pt,getClippingRect:I2,getOffsetParent:vd,getElementRects:R2,getClientRects:C2,getDimensions:z2,getScale:Nn,isElement:vt,isRTL:O2};function bd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function M2(e,t){let n=null,r;const o=Pt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:h,width:p,height:f}=c;if(a||t(),!p||!f)return;const x=zr(h),m=zr(o.clientWidth-(u+p)),y=zr(o.clientHeight-(h+f)),g=zr(u),k={rootMargin:-x+"px "+-m+"px "+-y+"px "+-g+"px",threshold:lt(0,Kt(1,l))||1};let S=!0;function C(N){const A=N[0].intersectionRatio;if(A!==l){if(!S)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!bd(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,k)}n.observe(e)}return s(!0),i}function L2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=bs(e),u=o||i?[...c?ar(c):[],...ar(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const h=c&&a?M2(c,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let x,m=l?sn(e):null;l&&y();function y(){const g=sn(e);m&&!bd(m,g)&&n(),m=g,x=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(x)}}const F2=c2,$2=u2,B2=s2,U2=f2,Z2=a2,tl=i2,V2=d2,W2=(e,t,n)=>{const r=new Map,o={platform:D2,...n},i={...o.platform,_c:r};return o2(e,t,{...o,platform:i})};var H2=typeof document<"u",q2=function(){},$r=H2?w.useLayoutEffect:q2;function Xr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Xr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nl(e,t){const n=wd(e);return Math.round(t*n)/n}function qo(e){const t=w.useRef(e);return $r(()=>{t.current=e}),t}function G2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,h]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=w.useState(r);Xr(p,r)||f(r);const[x,m]=w.useState(null),[y,g]=w.useState(null),v=w.useCallback(W=>{W!==N.current&&(N.current=W,m(W))},[]),k=w.useCallback(W=>{W!==A.current&&(A.current=W,g(W))},[]),S=i||x,C=s||y,N=w.useRef(null),A=w.useRef(null),R=w.useRef(u),O=l!=null,P=qo(l),L=qo(o),E=qo(c),M=w.useCallback(()=>{if(!N.current||!A.current)return;const W={placement:t,strategy:n,middleware:p};L.current&&(W.platform=L.current),W2(N.current,A.current,W).then(q=>{const j={...q,isPositioned:E.current!==!1};_.current&&!Xr(R.current,j)&&(R.current=j,dr.flushSync(()=>{h(j)}))})},[p,t,n,L,E]);$r(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(W=>({...W,isPositioned:!1})))},[c]);const _=w.useRef(!1);$r(()=>(_.current=!0,()=>{_.current=!1}),[]),$r(()=>{if(S&&(N.current=S),C&&(A.current=C),S&&C){if(P.current)return P.current(S,C,M);M()}},[S,C,M,P,O]);const D=w.useMemo(()=>({reference:N,floating:A,setReference:v,setFloating:k}),[v,k]),J=w.useMemo(()=>({reference:S,floating:C}),[S,C]),Z=w.useMemo(()=>{const W={position:n,left:0,top:0};if(!J.floating)return W;const q=nl(J.floating,u.x),j=nl(J.floating,u.y);return a?{...W,transform:"translate("+q+"px, "+j+"px)",...wd(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:j}},[n,a,J.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:M,refs:D,elements:J,floatingStyles:Z}),[u,M,D,J,Z])}const K2=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?tl({element:r.current,padding:o}).fn(n):{}:r?tl({element:r,padding:o}).fn(n):{}}}},J2=(e,t)=>({...F2(e),options:[e,t]}),Y2=(e,t)=>({...$2(e),options:[e,t]}),X2=(e,t)=>({...V2(e),options:[e,t]}),Q2=(e,t)=>({...B2(e),options:[e,t]}),e_=(e,t)=>({...U2(e),options:[e,t]}),t_=(e,t)=>({...Z2(e),options:[e,t]}),n_=(e,t)=>({...K2(e),options:[e,t]});var r_="Arrow",_d=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return d.jsx(Ce.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});_d.displayName=r_;var o_=_d,ws="Popper",[kd,_o]=Bt(ws),[i_,Sd]=kd(ws),Cd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=w.useState(null);return d.jsx(i_,{scope:t,anchor:r,onAnchorChange:o,children:n})};Cd.displayName=ws;var Ed="PopperAnchor",Nd=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Sd(Ed,n),s=w.useRef(null),a=Re(t,s),l=w.useRef(null);return w.useEffect(()=>{const c=l.current;l.current=r?.current||s.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:d.jsx(Ce.div,{...o,ref:a})});Nd.displayName=Ed;var _s="PopperContent",[s_,a_]=kd(_s),Td=w.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:x,...m}=e,y=Sd(_s,n),[g,v]=w.useState(null),k=Re(t,ie=>v(ie)),[S,C]=w.useState(null),N=Ww(S),A=N?.width??0,R=N?.height??0,O=r+(i!=="center"?"-"+i:""),P=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(c)?c:[c],E=L.length>0,M={padding:P,boundary:L.filter(c_),altBoundary:E},{refs:_,floatingStyles:D,placement:J,isPositioned:Z,middlewareData:W}=G2({strategy:"fixed",placement:O,whileElementsMounted:(...ie)=>L2(...ie,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[J2({mainAxis:o+R,alignmentAxis:s}),l&&Y2({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?X2():void 0,...M}),l&&Q2({...M}),e_({...M,apply:({elements:ie,rects:de,availableWidth:ge,availableHeight:te})=>{const{width:oe,height:me}=de.reference,Ee=ie.floating.style;Ee.setProperty("--radix-popper-available-width",`${ge}px`),Ee.setProperty("--radix-popper-available-height",`${te}px`),Ee.setProperty("--radix-popper-anchor-width",`${oe}px`),Ee.setProperty("--radix-popper-anchor-height",`${me}px`)}}),S&&n_({element:S,padding:a}),u_({arrowWidth:A,arrowHeight:R}),p&&t_({strategy:"referenceHidden",...M})]}),[q,j]=Id(J),U=Qe(x);qe(()=>{Z&&U?.()},[Z,U]);const B=W.arrow?.x,T=W.arrow?.y,ee=W.arrow?.centerOffset!==0,[re,ve]=w.useState();return qe(()=>{g&&ve(window.getComputedStyle(g).zIndex)},[g]),d.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:Z?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(s_,{scope:n,placedSide:q,onArrowChange:C,arrowX:B,arrowY:T,shouldHideArrow:ee,children:d.jsx(Ce.div,{"data-side":q,"data-align":j,...m,ref:k,style:{...m.style,animation:Z?void 0:"none"}})})})});Td.displayName=_s;var jd="PopperArrow",l_={top:"bottom",right:"left",bottom:"top",left:"right"},Ad=w.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=a_(jd,r),s=l_[i.placedSide];return d.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:d.jsx(o_,{...o,ref:n,style:{...o.style,display:"block"}})})});Ad.displayName=jd;function c_(e){return e!==null}var u_=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=Id(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2;let x="",m="";return c==="bottom"?(x=s?h:`${p}px`,m=`${-l}px`):c==="top"?(x=s?h:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,m=s?h:`${f}px`):c==="left"&&(x=`${r.floating.width+l}px`,m=s?h:`${f}px`),{data:{x,y:m}}}});function Id(e){const[t,n="center"]=e.split("-");return[t,n]}var zd=Cd,Pd=Nd,Rd=Td,Od=Ad,Go="rovingFocusGroup.onEntryFocus",d_={bubbles:!1,cancelable:!0},mr="RovingFocusGroup",[Ci,Dd,f_]=zu(mr),[h_,Md]=Bt(mr,[f_]),[p_,m_]=h_(mr),Ld=w.forwardRef((e,t)=>d.jsx(Ci.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ci.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(g_,{...e,ref:t})})}));Ld.displayName=mr;var g_=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=e,p=w.useRef(null),f=Re(t,p),x=ho(i),[m,y]=rn({prop:s,defaultProp:a??null,onChange:l,caller:mr}),[g,v]=w.useState(!1),k=Qe(c),S=Dd(n),C=w.useRef(!1),[N,A]=w.useState(0);return w.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(Go,k),()=>R.removeEventListener(Go,k)},[k]),d.jsx(p_,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(R=>y(R),[y]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>A(R=>R+1),[]),onFocusableItemRemove:w.useCallback(()=>A(R=>R-1),[]),children:d.jsx(Ce.div,{tabIndex:g||N===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{C.current=!0}),onFocus:we(e.onFocus,R=>{const O=!C.current;if(R.target===R.currentTarget&&O&&!g){const P=new CustomEvent(Go,d_);if(R.currentTarget.dispatchEvent(P),!P.defaultPrevented){const L=S().filter(J=>J.focusable),E=L.find(J=>J.active),M=L.find(J=>J.id===m),D=[E,M,...L].filter(Boolean).map(J=>J.ref.current);Bd(D,u)}}C.current=!1}),onBlur:we(e.onBlur,()=>v(!1))})})}),Fd="RovingFocusGroupItem",$d=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=Nt(),c=i||l,u=m_(Fd,n),h=u.currentTabStopId===c,p=Dd(n),{onFocusableItemAdd:f,onFocusableItemRemove:x,currentTabStopId:m}=u;return w.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),d.jsx(Ci.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:d.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:we(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:we(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:we(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=v_(y,u.orientation,u.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();const S=k.indexOf(y.currentTarget);k=u.loop?b_(k,S+1):k.slice(S+1)}setTimeout(()=>Bd(k))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});$d.displayName=Fd;var x_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function v_(e,t,n){const r=y_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return x_[r]}function Bd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function b_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var w_=Ld,__=$d;function Ei(e,[t,n]){return Math.min(n,Math.max(t,e))}function k_(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var ks="ScrollArea",[Ud]=Bt(ks),[S_,gt]=Ud(ks),Zd=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=w.useState(null),[c,u]=w.useState(null),[h,p]=w.useState(null),[f,x]=w.useState(null),[m,y]=w.useState(null),[g,v]=w.useState(0),[k,S]=w.useState(0),[C,N]=w.useState(!1),[A,R]=w.useState(!1),O=Re(t,L=>l(L)),P=ho(o);return d.jsx(S_,{scope:n,type:r,dir:P,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:R,onCornerWidthChange:v,onCornerHeightChange:S,children:d.jsx(Ce.div,{dir:P,...s,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Zd.displayName=ks;var Vd="ScrollAreaViewport",Wd=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=gt(Vd,n),a=w.useRef(null),l=Re(t,a,s.onViewportChange);return d.jsxs(d.Fragment,{children:[d.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}),d.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:d.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Wd.displayName=Vd;var Rt="ScrollAreaScrollbar",Hd=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return w.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?d.jsx(C_,{...r,ref:t,forceMount:n}):o.type==="scroll"?d.jsx(E_,{...r,ref:t,forceMount:n}):o.type==="auto"?d.jsx(qd,{...r,ref:t,forceMount:n}):o.type==="always"?d.jsx(Ss,{...r,ref:t}):null});Hd.displayName=Rt;var C_=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),[i,s]=w.useState(!1);return w.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),d.jsx(mt,{present:n||i,children:d.jsx(qd,{"data-state":i?"visible":"hidden",...r,ref:t})})}),E_=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=So(()=>l("SCROLL_END"),100),[a,l]=k_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),w.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let h=c[u];const p=()=>{const f=c[u];h!==f&&(l("SCROLL"),s()),h=f};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),d.jsx(mt,{present:n||a!=="hidden",children:d.jsx(Ss,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:we(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),qd=w.forwardRef((e,t)=>{const n=gt(Rt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=w.useState(!1),a=e.orientation==="horizontal",l=So(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return On(n.viewport,l),On(n.content,l),d.jsx(mt,{present:r||i,children:d.jsx(Ss,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Ss=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=gt(Rt,e.__scopeScrollArea),i=w.useRef(null),s=w.useRef(0),[a,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=Xd(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,f){return z_(p,s.current,a,f)}return n==="horizontal"?d.jsx(N_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,f=rl(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"?d.jsx(T_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,f=rl(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}),N_=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=Re(t,l,i.onScrollbarXChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx(Kd,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),ef(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eo(s.paddingLeft),paddingEnd:eo(s.paddingRight)}})}})}),T_=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=Re(t,l,i.onScrollbarYChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx(Kd,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),ef(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eo(s.paddingTop),paddingEnd:eo(s.paddingBottom)}})}})}),[j_,Gd]=Ud(Rt),Kd=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:h,...p}=e,f=gt(Rt,n),[x,m]=w.useState(null),y=Re(t,O=>m(O)),g=w.useRef(null),v=w.useRef(""),k=f.viewport,S=r.content-r.viewport,C=Qe(u),N=Qe(l),A=So(h,10);function R(O){if(g.current){const P=O.clientX-g.current.left,L=O.clientY-g.current.top;c({x:P,y:L})}}return w.useEffect(()=>{const O=P=>{const L=P.target;x?.contains(L)&&C(P,S)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[k,x,S,C]),w.useEffect(N,[r,N]),On(x,A),On(f.content,A),d.jsx(j_,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:N,onThumbPointerDown:Qe(a),children:d.jsx(Ce.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:we(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),g.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),R(O))}),onPointerMove:we(e.onPointerMove,R),onPointerUp:we(e.onPointerUp,O=>{const P=O.target;P.hasPointerCapture(O.pointerId)&&P.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),Qr="ScrollAreaThumb",Jd=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Gd(Qr,e.__scopeScrollArea);return d.jsx(mt,{present:n||o.hasThumb,children:d.jsx(A_,{ref:t,...r})})}),A_=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=gt(Qr,n),s=Gd(Qr,n),{onThumbPositionChange:a}=s,l=Re(t,h=>s.onThumbChange(h)),c=w.useRef(void 0),u=So(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(u(),!c.current){const f=P_(h,a);c.current=f,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,u,a]),d.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:we(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),x=h.clientX-f.left,m=h.clientY-f.top;s.onThumbPointerDown({x,y:m})}),onPointerUp:we(e.onPointerUp,s.onThumbPointerUp)})});Jd.displayName=Qr;var Cs="ScrollAreaCorner",Yd=w.forwardRef((e,t)=>{const n=gt(Cs,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.jsx(I_,{...e,ref:t}):null});Yd.displayName=Cs;var I_=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=gt(Cs,n),[i,s]=w.useState(0),[a,l]=w.useState(0),c=!!(i&&a);return On(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),On(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),s(u)}),c?d.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 eo(e){return e?parseInt(e,10):0}function Xd(e,t){const n=e/t;return isNaN(n)?0:n}function ko(e){const t=Xd(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function z_(e,t,n,r="ltr"){const o=ko(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,h=r==="ltr"?[0,u]:[u*-1,0];return Qd([l,c],h)(e)}function rl(e,t,n="ltr"){const r=ko(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ei(e,l);return Qd([0,s],[0,a])(c)}function Qd(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 ef(e,t){return e>0&&e<t}var P_=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function So(e,t){const n=Qe(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function On(e,t){const n=Qe(t);qe(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var R_=Zd,O_=Wd,D_=Yd,M_=[" ","Enter","ArrowUp","ArrowDown"],L_=[" ","Enter"],an="Select",[Co,Eo,F_]=zu(an),[Zn]=Bt(an,[F_,_o]),No=_o(),[$_,Qt]=Zn(an),[B_,U_]=Zn(an),tf=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:h,disabled:p,required:f,form:x}=e,m=No(t),[y,g]=w.useState(null),[v,k]=w.useState(null),[S,C]=w.useState(!1),N=ho(c),[A,R]=rn({prop:r,defaultProp:o??!1,onChange:i,caller:an}),[O,P]=rn({prop:s,defaultProp:a,onChange:l,caller:an}),L=w.useRef(null),E=y?x||!!y.closest("form"):!0,[M,_]=w.useState(new Set),D=Array.from(M).map(J=>J.props.value).join(";");return d.jsx(zd,{...m,children:d.jsxs($_,{required:f,scope:t,trigger:y,onTriggerChange:g,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Nt(),value:O,onValueChange:P,open:A,onOpenChange:R,dir:N,triggerPointerDownPosRef:L,disabled:p,children:[d.jsx(Co.Provider,{scope:t,children:d.jsx(B_,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(J=>{_(Z=>new Set(Z).add(J))},[]),onNativeOptionRemove:w.useCallback(J=>{_(Z=>{const W=new Set(Z);return W.delete(J),W})},[]),children:n})}),E?d.jsxs(Sf,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:O,onChange:J=>P(J.target.value),disabled:p,form:x,children:[O===void 0?d.jsx("option",{value:""}):null,Array.from(M)]},D):null]})})};tf.displayName=an;var nf="SelectTrigger",rf=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=No(n),s=Qt(nf,n),a=s.disabled||r,l=Re(t,s.onTriggerChange),c=Eo(n),u=w.useRef("touch"),[h,p,f]=Ef(m=>{const y=c().filter(k=>!k.disabled),g=y.find(k=>k.value===s.value),v=Nf(y,m,g);v!==void 0&&s.onValueChange(v.value)}),x=m=>{a||(s.onOpenChange(!0),f()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return d.jsx(Pd,{asChild:!0,...i,children:d.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":Cf(s.value)?"":void 0,...o,ref:l,onClick:we(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&x(m)}),onPointerDown:we(o.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:we(o.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&M_.includes(m.key)&&(x(),m.preventDefault())})})})});rf.displayName=nf;var of="SelectValue",sf=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Qt(of,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,h=Re(t,l.onValueNodeChange);return qe(()=>{c(u)},[c,u]),d.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:Cf(l.value)?d.jsx(d.Fragment,{children:s}):i})});sf.displayName=of;var Z_="SelectIcon",af=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});af.displayName=Z_;var V_="SelectPortal",lf=e=>d.jsx(mo,{asChild:!0,...e});lf.displayName=V_;var ln="SelectContent",cf=w.forwardRef((e,t)=>{const n=Qt(ln,e.__scopeSelect),[r,o]=w.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?dr.createPortal(d.jsx(uf,{scope:e.__scopeSelect,children:d.jsx(Co.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(df,{...e,ref:t})});cf.displayName=ln;var yt=10,[uf,en]=Zn(ln),W_="SelectContentImpl",H_=Pn("SelectContent.RemoveScroll"),df=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y,...g}=e,v=Qt(ln,n),[k,S]=w.useState(null),[C,N]=w.useState(null),A=Re(t,ie=>S(ie)),[R,O]=w.useState(null),[P,L]=w.useState(null),E=Eo(n),[M,_]=w.useState(!1),D=w.useRef(!1);w.useEffect(()=>{if(k)return Ku(k)},[k]),$u();const J=w.useCallback(ie=>{const[de,...ge]=E().map(me=>me.ref.current),[te]=ge.slice(-1),oe=document.activeElement;for(const me of ie)if(me===oe||(me?.scrollIntoView({block:"nearest"}),me===de&&C&&(C.scrollTop=0),me===te&&C&&(C.scrollTop=C.scrollHeight),me?.focus(),document.activeElement!==oe))return},[E,C]),Z=w.useCallback(()=>J([R,k]),[J,R,k]);w.useEffect(()=>{M&&Z()},[M,Z]);const{onOpenChange:W,triggerPointerDownPosRef:q}=v;w.useEffect(()=>{if(k){let ie={x:0,y:0};const de=te=>{ie={x:Math.abs(Math.round(te.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(te.pageY)-(q.current?.y??0))}},ge=te=>{ie.x<=10&&ie.y<=10?te.preventDefault():k.contains(te.target)||W(!1),document.removeEventListener("pointermove",de),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",ge,{capture:!0})}}},[k,W,q]),w.useEffect(()=>{const ie=()=>W(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[W]);const[j,U]=Ef(ie=>{const de=E().filter(oe=>!oe.disabled),ge=de.find(oe=>oe.ref.current===document.activeElement),te=Nf(de,ie,ge);te&&setTimeout(()=>te.ref.current.focus())}),B=w.useCallback((ie,de,ge)=>{const te=!D.current&&!ge;(v.value!==void 0&&v.value===de||te)&&(O(ie),te&&(D.current=!0))},[v.value]),T=w.useCallback(()=>k?.focus(),[k]),ee=w.useCallback((ie,de,ge)=>{const te=!D.current&&!ge;(v.value!==void 0&&v.value===de||te)&&L(ie)},[v.value]),re=r==="popper"?Ni:ff,ve=re===Ni?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y}:{};return d.jsx(uf,{scope:n,content:k,viewport:C,onViewportChange:N,itemRefCallback:B,selectedItem:R,onItemLeave:T,itemTextRefCallback:ee,focusSelectedItem:Z,selectedItemText:P,position:r,isPositioned:M,searchRef:j,children:d.jsx(ds,{as:H_,allowPinchZoom:!0,children:d.jsx(us,{asChild:!0,trapped:v.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:we(o,ie=>{v.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:d.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:d.jsx(re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ie=>ie.preventDefault(),...g,...ve,onPlaced:()=>_(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:we(g.onKeyDown,ie=>{const de=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!de&&ie.key.length===1&&U(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let te=E().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const oe=ie.target,me=te.indexOf(oe);te=te.slice(me+1)}setTimeout(()=>J(te)),ie.preventDefault()}})})})})})})});df.displayName=W_;var q_="SelectItemAlignedPosition",ff=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Qt(ln,n),s=en(ln,n),[a,l]=w.useState(null),[c,u]=w.useState(null),h=Re(t,A=>u(A)),p=Eo(n),f=w.useRef(!1),x=w.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=s,k=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&g){const A=i.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),P=g.getBoundingClientRect();if(i.dir!=="rtl"){const oe=P.left-R.left,me=O.left-oe,Ee=A.left-me,b=A.width+Ee,K=Math.max(b,R.width),H=window.innerWidth-yt,z=Ei(me,[yt,Math.max(yt,H-K)]);a.style.minWidth=b+"px",a.style.left=z+"px"}else{const oe=R.right-P.right,me=window.innerWidth-O.right-oe,Ee=window.innerWidth-A.right-me,b=A.width+Ee,K=Math.max(b,R.width),H=window.innerWidth-yt,z=Ei(me,[yt,Math.max(yt,H-K)]);a.style.minWidth=b+"px",a.style.right=z+"px"}const L=p(),E=window.innerHeight-yt*2,M=m.scrollHeight,_=window.getComputedStyle(c),D=parseInt(_.borderTopWidth,10),J=parseInt(_.paddingTop,10),Z=parseInt(_.borderBottomWidth,10),W=parseInt(_.paddingBottom,10),q=D+J+M+W+Z,j=Math.min(y.offsetHeight*5,q),U=window.getComputedStyle(m),B=parseInt(U.paddingTop,10),T=parseInt(U.paddingBottom,10),ee=A.top+A.height/2-yt,re=E-ee,ve=y.offsetHeight/2,ie=y.offsetTop+ve,de=D+J+ie,ge=q-de;if(de<=ee){const oe=L.length>0&&y===L[L.length-1].ref.current;a.style.bottom="0px";const me=c.clientHeight-m.offsetTop-m.offsetHeight,Ee=Math.max(re,ve+(oe?T:0)+me+Z),b=de+Ee;a.style.height=b+"px"}else{const oe=L.length>0&&y===L[0].ref.current;a.style.top="0px";const Ee=Math.max(ee,D+m.offsetTop+(oe?B:0)+ve)+ge;a.style.height=Ee+"px",m.scrollTop=de-ee+m.offsetTop}a.style.margin=`${yt}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=E+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[p,i.trigger,i.valueNode,a,c,m,y,g,i.dir,r]);qe(()=>k(),[k]);const[S,C]=w.useState();qe(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const N=w.useCallback(A=>{A&&x.current===!0&&(k(),v?.(),x.current=!1)},[k,v]);return d.jsx(K_,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:N,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:d.jsx(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ff.displayName=q_;var G_="SelectPopperPosition",Ni=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yt,...i}=e,s=No(n);return d.jsx(Rd,{...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)"}})});Ni.displayName=G_;var[K_,Es]=Zn(ln,{}),Ti="SelectViewport",hf=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=en(Ti,n),s=Es(Ti,n),a=Re(t,i.onViewportChange),l=w.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(Co.Slot,{scope:n,children:d.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:we(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p?.current&&h){const f=Math.abs(l.current-u.scrollTop);if(f>0){const x=window.innerHeight-yt*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),g=Math.max(m,y);if(g<x){const v=g+f,k=Math.min(x,v),S=v-k;h.style.height=k+"px",h.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});hf.displayName=Ti;var pf="SelectGroup",[J_,Y_]=Zn(pf),X_=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Nt();return d.jsx(J_,{scope:n,id:o,children:d.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});X_.displayName=pf;var mf="SelectLabel",Q_=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Y_(mf,n);return d.jsx(Ce.div,{id:o.id,...r,ref:t})});Q_.displayName=mf;var to="SelectItem",[ek,gf]=Zn(to),xf=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Qt(to,n),l=en(to,n),c=a.value===r,[u,h]=w.useState(i??""),[p,f]=w.useState(!1),x=Re(t,v=>l.itemRefCallback?.(v,r,o)),m=Nt(),y=w.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 d.jsx(ek,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:w.useCallback(v=>{h(k=>k||(v?.textContent??"").trim())},[]),children:d.jsx(Co.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:d.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:we(s.onFocus,()=>f(!0)),onBlur:we(s.onBlur,()=>f(!1)),onClick:we(s.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:we(s.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:we(s.onPointerDown,v=>{y.current=v.pointerType}),onPointerMove:we(s.onPointerMove,v=>{y.current=v.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:we(s.onKeyDown,v=>{l.searchRef?.current!==""&&v.key===" "||(L_.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});xf.displayName=to;var tr="SelectItemText",yf=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Qt(tr,n),a=en(tr,n),l=gf(tr,n),c=U_(tr,n),[u,h]=w.useState(null),p=Re(t,g=>h(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),f=u?.textContent,x=w.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return qe(()=>(m(x),()=>y(x)),[m,y,x]),d.jsxs(d.Fragment,{children:[d.jsx(Ce.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?dr.createPortal(i.children,s.valueNode):null]})});yf.displayName=tr;var vf="SelectItemIndicator",bf=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return gf(vf,n).isSelected?d.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});bf.displayName=vf;var ji="SelectScrollUpButton",wf=w.forwardRef((e,t)=>{const n=en(ji,e.__scopeSelect),r=Es(ji,e.__scopeSelect),[o,i]=w.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(kf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});wf.displayName=ji;var Ai="SelectScrollDownButton",_f=w.forwardRef((e,t)=>{const n=en(Ai,e.__scopeSelect),r=Es(Ai,e.__scopeSelect),[o,i]=w.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(kf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});_f.displayName=Ai;var kf=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=en("SelectScrollButton",n),s=w.useRef(null),a=Eo(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),qe(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),d.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:we(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(o.onPointerLeave,()=>{l()})})}),tk="SelectSeparator",nk=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});nk.displayName=tk;var Ii="SelectArrow",rk=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=No(n),i=Qt(Ii,n),s=en(Ii,n);return i.open&&s.position==="popper"?d.jsx(Od,{...o,...r,ref:t}):null});rk.displayName=Ii;var ok="SelectBubbleInput",Sf=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=w.useRef(null),i=Re(r,o),s=Vw(t);return w.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const h=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(h)}},[s,t]),d.jsx(Ce.select,{...n,style:{...Au,...n.style},ref:i,defaultValue:t})});Sf.displayName=ok;function Cf(e){return e===""||e===void 0}function Ef(e){const t=Qe(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;t(a),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function Nf(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=ik(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function ik(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var sk=tf,ak=rf,lk=sf,ck=af,uk=lf,dk=cf,fk=hf,hk=xf,pk=yf,mk=bf,gk=wf,xk=_f,yk="Separator",ol="horizontal",vk=["horizontal","vertical"],Tf=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=ol,...o}=e,i=bk(r)?r:ol,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return d.jsx(Ce.div,{"data-orientation":i,...a,...o,ref:t})});Tf.displayName=yk;function bk(e){return vk.includes(e)}var wk=Tf,To="Tabs",[_k]=Bt(To,[Md]),jf=Md(),[kk,Ns]=_k(To),Af=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ho(a),[h,p]=rn({prop:r,onChange:o,defaultProp:i??"",caller:To});return d.jsx(kk,{scope:n,baseId:Nt(),value:h,onValueChange:p,orientation:s,dir:u,activationMode:l,children:d.jsx(Ce.div,{dir:u,"data-orientation":s,...c,ref:t})})});Af.displayName=To;var If="TabsList",zf=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ns(If,n),s=jf(n);return d.jsx(w_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:d.jsx(Ce.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});zf.displayName=If;var Pf="TabsTrigger",Rf=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Ns(Pf,n),a=jf(n),l=Mf(s.baseId,r),c=Lf(s.baseId,r),u=r===s.value;return d.jsx(__,{asChild:!0,...a,focusable:!o,active:u,children:d.jsx(Ce.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:we(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=s.activationMode!=="manual";!u&&!o&&h&&s.onValueChange(r)})})})});Rf.displayName=Pf;var Of="TabsContent",Df=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Ns(Of,n),l=Mf(a.baseId,r),c=Lf(a.baseId,r),u=r===a.value,h=w.useRef(u);return w.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(mt,{present:o||u,children:({present:p})=>d.jsx(Ce.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});Df.displayName=Of;function Mf(e,t){return`${e}-trigger-${t}`}function Lf(e,t){return`${e}-content-${t}`}var Sk=Af,Ck=zf,Ek=Rf,Nk=Df,[jo]=Bt("Tooltip",[_o]),Ao=_o(),Ff="TooltipProvider",Tk=700,zi="tooltip.open",[jk,Ts]=jo(Ff),$f=e=>{const{__scopeTooltip:t,delayDuration:n=Tk,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=w.useRef(!0),a=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(jk,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:w.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};$f.displayName=Ff;var lr="Tooltip",[Ak,gr]=jo(lr),Bf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Ts(lr,e.__scopeTooltip),c=Ao(t),[u,h]=w.useState(null),p=Nt(),f=w.useRef(0),x=s??l.disableHoverableContent,m=a??l.delayDuration,y=w.useRef(!1),[g,v]=rn({prop:r,defaultProp:o??!1,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(zi))):l.onClose(),i?.(A)},caller:lr}),k=w.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),S=w.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y.current=!1,v(!0)},[v]),C=w.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),N=w.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=!0,v(!0),f.current=0},m)},[m,v]);return w.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(zd,{...c,children:d.jsx(Ak,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:u,onTriggerChange:h,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayedRef.current?N():S()},[l.isOpenDelayedRef,N,S]),onTriggerLeave:w.useCallback(()=>{x?C():(window.clearTimeout(f.current),f.current=0)},[C,x]),onOpen:S,onClose:C,disableHoverableContent:x,children:n})})};Bf.displayName=lr;var Pi="TooltipTrigger",Uf=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gr(Pi,n),i=Ts(Pi,n),s=Ao(n),a=w.useRef(null),l=Re(t,a,o.onTriggerChange),c=w.useRef(!1),u=w.useRef(!1),h=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),d.jsx(Pd,{asChild:!0,...s,children:d.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:we(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:we(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:we(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:we(e.onBlur,o.onClose),onClick:we(e.onClick,o.onClose)})})});Uf.displayName=Pi;var js="TooltipPortal",[Ik,zk]=jo(js,{forceMount:void 0}),Zf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=gr(js,t);return d.jsx(Ik,{scope:t,forceMount:n,children:d.jsx(mt,{present:n||i.open,children:d.jsx(mo,{asChild:!0,container:o,children:r})})})};Zf.displayName=js;var Dn="TooltipContent",Vf=w.forwardRef((e,t)=>{const n=zk(Dn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=gr(Dn,e.__scopeTooltip);return d.jsx(mt,{present:r||s.open,children:s.disableHoverableContent?d.jsx(Wf,{side:o,...i,ref:t}):d.jsx(Pk,{side:o,...i,ref:t})})}),Pk=w.forwardRef((e,t)=>{const n=gr(Dn,e.__scopeTooltip),r=Ts(Dn,e.__scopeTooltip),o=w.useRef(null),i=Re(t,o),[s,a]=w.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:h}=r,p=w.useCallback(()=>{a(null),h(!1)},[h]),f=w.useCallback((x,m)=>{const y=x.currentTarget,g={x:x.clientX,y:x.clientY},v=Mk(g,y.getBoundingClientRect()),k=Lk(g,v),S=Fk(m.getBoundingClientRect()),C=Bk([...k,...S]);a(C),h(!0)},[h]);return w.useEffect(()=>()=>p(),[p]),w.useEffect(()=>{if(l&&u){const x=y=>f(y,u),m=y=>f(y,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,f,p]),w.useEffect(()=>{if(s){const x=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},v=l?.contains(y)||u?.contains(y),k=!$k(g,s);v?p():k&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,s,c,p]),d.jsx(Wf,{...e,ref:i})}),[Rk,Ok]=jo(lr,{isInside:!1}),Dk=r1("TooltipContent"),Wf=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=gr(Dn,n),c=Ao(n),{onClose:u}=l;return w.useEffect(()=>(document.addEventListener(zi,u),()=>document.removeEventListener(zi,u)),[u]),w.useEffect(()=>{if(l.trigger){const h=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,u]),d.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:d.jsxs(Rd,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(Dk,{children:r}),d.jsx(Rk,{scope:n,isInside:!0,children:d.jsx(u1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Vf.displayName=Dn;var Hf="TooltipArrow",qf=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ao(n);return Ok(Hf,n).isInside?null:d.jsx(Od,{...o,...r,ref:t})});qf.displayName=Hf;function Mk(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 Lk(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 Fk(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 $k(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,h=l.x,p=l.y;u>r!=p>r&&n<(h-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function Bk(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),Uk(t)}function Uk(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 Zk=$f,Vk=Bf,Wk=Uf,Hk=Zf,qk=Vf,Gk=qf;const Kk=ss("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 ct({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?t1:"span";return d.jsx(o,{"data-slot":"badge","data-variant":t,className:Se(Kk({variant:t}),e),...r})}const Jk={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function il(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Yk({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,apiFormat:s,expanded:a,onToggle:l,hideApiFormat:c=!1}){return d.jsxs("div",{role:"button",tabIndex:0,className:Se("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:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())},children:[a?d.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):d.jsx(Gt,{className:"size-4 text-muted-foreground shrink-0"}),d.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}),!c&&d.jsx(ct,{variant:"outline",className:Se("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:Jk[s]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(os,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[il(t)," - ",il(n)]})]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(uu,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),d.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[d.jsx(hr,{className:"size-3 text-muted-foreground"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[d.jsx("span",{className:"text-blue-400",children:Je(o)})," / ",d.jsx("span",{className:"text-amber-400",children:Je(i)})]})]}),d.jsx("span",{className:"flex-1 min-w-0"})]})}function Xk(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function Qk(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 eS(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 tS(e){const t=new Map;for(const r of e){const o=eS(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 nS="x-anthropic-billing-header:";function rS(e){return e.trimStart().toLowerCase().startsWith(nS)}function sl(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function oS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function iS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=sl(e,"type"),n=sl(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:rS(n)}function sS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!oS(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(iS(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 aS=ss("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ht({className:e,variant:t,size:n,...r}){return d.jsx("button",{"data-slot":"button",className:Se(aS({variant:t,size:n,className:e})),...r})}function lS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dS={};function al(e,t){return(dS.jsx?uS:cS).test(e)}const fS=/[ \t\n\f\r]/g;function hS(e){return typeof e=="object"?e.type==="text"?ll(e.value):!1:ll(e)}function ll(e){return e.replace(fS,"")===""}class xr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xr.prototype.normal={};xr.prototype.property={};xr.prototype.space=void 0;function Gf(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new xr(n,r,t)}function Ri(e){return e.toLowerCase()}class it{constructor(t,n){this.attribute=n,this.property=t}}it.prototype.attribute="";it.prototype.booleanish=!1;it.prototype.boolean=!1;it.prototype.commaOrSpaceSeparated=!1;it.prototype.commaSeparated=!1;it.prototype.defined=!1;it.prototype.mustUseProperty=!1;it.prototype.number=!1;it.prototype.overloadedBoolean=!1;it.prototype.property="";it.prototype.spaceSeparated=!1;it.prototype.space=void 0;let pS=0;const Ne=dn(),We=dn(),Oi=dn(),se=dn(),Oe=dn(),Tn=dn(),at=dn();function dn(){return 2**++pS}const Di=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:We,commaOrSpaceSeparated:at,commaSeparated:Tn,number:se,overloadedBoolean:Oi,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Ko=Object.keys(Di);class As extends it{constructor(t,n,r,o){let i=-1;if(super(t,n),cl(this,"space",o),typeof r=="number")for(;++i<Ko.length;){const s=Ko[i];cl(this,Ko[i],(r&Di[s])===Di[s])}}}As.prototype.defined=!0;function cl(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new As(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ri(r)]=r,n[Ri(i.attribute)]=r}return new xr(t,n,e.space)}const Kf=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Oe,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:se,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Oe,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:We,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Jf(e,t){return t in e?e[t]:t}function Yf(e,t){return Jf(e,t.toLowerCase())}const mS=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tn,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:Ne,allowPaymentRequest:Ne,allowUserMedia:Ne,alt:null,as:null,async:Ne,autoCapitalize:null,autoComplete:Oe,autoFocus:Ne,autoPlay:Ne,blocking:Oe,capture:null,charSet:null,checked:Ne,cite:null,className:Oe,cols:se,colSpan:null,content:null,contentEditable:We,controls:Ne,controlsList:Oe,coords:se|Tn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ne,defer:Ne,dir:null,dirName:null,disabled:Ne,download:Oi,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ne,formTarget:null,headers:Oe,height:se,hidden:Oi,high:se,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:Ne,inputMode:null,integrity:null,is:null,isMap:Ne,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:Ne,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ne,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Ne,muted:Ne,name:null,nonce:null,noModule:Ne,noValidate:Ne,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ne,optimum:se,pattern:null,ping:Oe,placeholder:null,playsInline:Ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ne,referrerPolicy:null,rel:Oe,required:Ne,reversed:Ne,rows:se,rowSpan:se,sandbox:Oe,scope:null,scoped:Ne,seamless:Ne,selected:Ne,shadowRootClonable:Ne,shadowRootDelegatesFocus:Ne,shadowRootMode:null,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Ne,useMap:null,value:We,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ne,declare:Ne,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Ne,noHref:Ne,noShade:Ne,noWrap:Ne,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ne,disableRemotePlayback:Ne,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:Yf}),gS=Vn({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:at,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:Oe,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Tn,g2:Tn,glyphName:Tn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:at,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:at,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:at,rev:at,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:at,requiredFeatures:at,requiredFonts:at,requiredFormats:at,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:at,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:at,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:at,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Jf}),Xf=Vn({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()}}),Qf=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Yf}),eh=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),xS={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"},yS=/[A-Z]/g,ul=/-[a-z]/g,vS=/^data[-\w.:]+$/i;function bS(e,t){const n=Ri(t);let r=t,o=it;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&vS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ul,_S);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ul.test(i)){let s=i.replace(yS,wS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=As}return new o(r,t)}function wS(e){return"-"+e.toLowerCase()}function _S(e){return e.charAt(1).toUpperCase()}const kS=Gf([Kf,mS,Xf,Qf,eh],"html"),Is=Gf([Kf,gS,Xf,Qf,eh],"svg");function SS(e){return e.join(" ").trim()}var yn={},Jo,dl;function CS(){if(dl)return Jo;dl=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
|
-
`,c="/",u="*",h="",p="comment",f="declaration";function x(y,g){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];g=g||{};var v=1,k=1;function S(_){var D=_.match(t);D&&(v+=D.length);var J=_.lastIndexOf(l);k=~J?_.length-J:k+_.length}function C(){var _={line:v,column:k};return function(D){return D.position=new N(_),O(),D}}function N(_){this.start=_,this.end={line:v,column:k},this.source=g.source}N.prototype.content=y;function A(_){var D=new Error(g.source+":"+v+":"+k+": "+_);if(D.reason=_,D.filename=g.source,D.line=v,D.column=k,D.source=y,!g.silent)throw D}function R(_){var D=_.exec(y);if(D){var J=D[0];return S(J),y=y.slice(J.length),D}}function O(){R(n)}function P(_){var D;for(_=_||[];D=L();)D!==!1&&_.push(D);return _}function L(){var _=C();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var D=2;h!=y.charAt(D)&&(u!=y.charAt(D)||c!=y.charAt(D+1));)++D;if(D+=2,h===y.charAt(D-1))return A("End of comment missing");var J=y.slice(2,D-2);return k+=2,S(J),y=y.slice(D),k+=2,_({type:p,comment:J})}}function E(){var _=C(),D=R(r);if(D){if(L(),!R(o))return A("property missing ':'");var J=R(i),Z=_({type:f,property:m(D[0].replace(e,h)),value:J?m(J[0].replace(e,h)):h});return R(s),Z}}function M(){var _=[];P(_);for(var D;D=E();)D!==!1&&(_.push(D),P(_));return _}return O(),M()}function m(y){return y?y.replace(a,h):h}return Jo=x,Jo}var fl;function ES(){if(fl)return yn;fl=1;var e=yn&&yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yn,"__esModule",{value:!0}),yn.default=n;const t=e(CS());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),a=typeof o=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return yn}var Kn={},hl;function NS(){if(hl)return Kn;hl=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,a):c=c.replace(r,a),c.replace(t,s))};return Kn.camelCase=l,Kn}var Jn,pl;function TS(){if(pl)return Jn;pl=1;var e=Jn&&Jn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(ES()),n=NS();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,Jn=r,Jn}var jS=TS();const AS=qi(jS),th=nh("end"),zs=nh("start");function nh(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 IS(e){const t=zs(e),n=th(e);if(t&&n)return{start:t,end:n}}function nr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ml(e.position):"start"in e||"end"in e?ml(e):"line"in e||"column"in e?Mi(e):""}function Mi(e){return gl(e&&e.line)+":"+gl(e&&e.column)}function ml(e){return Mi(e&&e.start)+"-"+Mi(e&&e.end)}function gl(e){return e&&typeof e=="number"?e:1}class Ye extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=nr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const Ps={}.hasOwnProperty,zS=new Map,PS=/[A-Z]/g,RS=new Set(["table","tbody","thead","tfoot","tr"]),OS=new Set(["td","th"]),rh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function DS(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=VS(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=ZS(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"?Is:kS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=oh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function oh(e,t,n){if(t.type==="element")return MS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return LS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $S(e,t,n);if(t.type==="mdxjsEsm")return FS(e,t);if(t.type==="root")return BS(e,t,n);if(t.type==="text")return US(e,t)}function MS(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Is,e.schema=o),e.ancestors.push(t);const i=sh(e,t.tagName,!1),s=WS(e,t);let a=Os(e,t);return RS.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!hS(l):!0})),ih(e,s,i,t),Rs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function LS(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)}cr(e,t.position)}function FS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cr(e,t.position)}function $S(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Is,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:sh(e,t.name,!0),s=HS(e,t),a=Os(e,t);return ih(e,s,i,t),Rs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function BS(e,t,n){const r={};return Rs(r,Os(e,t)),e.create(t,e.Fragment,r,n)}function US(e,t){return t.value}function ih(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Rs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ZS(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function VS(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=zs(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 WS(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Ps.call(t.properties,o)){const i=qS(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&OS.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 HS(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 cr(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 cr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Os(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:zS;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=oh(e,i,s);a!==void 0&&n.push(a)}return n}function qS(e,t,n){const r=bS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?lS(n):SS(n)),r.property==="style"){let o=typeof n=="object"?n:GS(e,String(n));return e.stylePropertyNameCase==="css"&&(o=KS(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?xS[r.property]||r.property:r.attribute,n]}}function GS(e,t){try{return AS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ye("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=rh+"#cannot-parse-style-attribute",o}}function sh(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 Ps.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);cr(e)}function cr(e,t){const n=new Ye("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=rh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function KS(e){const t={};let n;for(n in e)Ps.call(e,n)&&(t[JS(n)]=e[n]);return t}function JS(e){let t=e.replace(PS,YS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function YS(e){return"-"+e.toLowerCase()}const Yo={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"]},XS={};function QS(e,t){const n=XS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ah(e,r,o)}function ah(e,t,n){if(eC(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 xl(e.children,t,n)}return Array.isArray(e)?xl(e,t,n):""}function xl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ah(e[o],t,n);return r.join("")}function eC(e){return!!(e&&typeof e=="object")}const yl=document.createElement("i");function Ds(e){const t="&"+e+";";yl.innerHTML=t;const n=yl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function zt(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function ft(e,t){return e.length>0?(zt(e,e.length,0,t),e):t}const vl={}.hasOwnProperty;function tC(e){const t={};let n=-1;for(;++n<e.length;)nC(t,e[n]);return t}function nC(e,t){let n;for(n in t){const o=(vl.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){vl.call(o,s)||(o[s]=[]);const a=i[s];rC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function rC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);zt(e,0,0,r)}function lh(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 jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ct=tn(/[A-Za-z]/),ut=tn(/[\dA-Za-z]/),oC=tn(/[#-'*+\--9=?A-Z^-~]/);function Li(e){return e!==null&&(e<32||e===127)}const Fi=tn(/\d/),iC=tn(/[\dA-Fa-f]/),sC=tn(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const aC=tn(new RegExp("\\p{P}|\\p{S}","u")),lC=tn(/\s/);function tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ut(e.charCodeAt(n+1))&&ut(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function De(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return Pe(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const cC={tokenize:uC};function uC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),De(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return _e(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const dC={tokenize:fC},bl={tokenize:hC};function fC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(k)}return c(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&v();const S=t.events.length;let C=S,N;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){N=t.events[C][1].end;break}g(r);let A=S;for(;A<t.events.length;)t.events[A][1].end={...N},A++;return zt(t.events,C+1,0,t.events.slice(S)),t.events.length=A,c(k)}return a(k)}function c(k){if(r===n.length){if(!o)return p(k);if(o.currentConstruct&&o.currentConstruct.concrete)return x(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bl,u,h)(k)}function u(k){return o&&v(),g(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(k)}function p(k){return t.containerState={},e.attempt(bl,f,x)(k)}function f(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function x(k){if(k===null){o&&v(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(k)}function m(k){if(k===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(k);return}return _e(k)?(e.consume(k),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),m)}function y(k,S){const C=t.sliceStream(k);if(S&&C.push(null),k.previous=i,i&&(i.next=k),i=k,o.defineSkip(k.start),o.write(C),t.parser.lazy[k.start.line]){let N=o.events.length;for(;N--;)if(o.events[N][1].start.offset<s&&(!o.events[N][1].end||o.events[N][1].end.offset>s))return;const A=t.events.length;let R=A,O,P;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(O){P=t.events[R][1].end;break}O=!0}for(g(r),N=A;N<t.events.length;)t.events[N][1].end={...P},N++;zt(t.events,R+1,0,t.events.slice(A)),t.events.length=N}}function g(k){let S=n.length;for(;S-- >k;){const C=n[S];t.containerState=C[1],C[0].exit.call(t,e)}n.length=k}function v(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function hC(e,t,n){return De(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wl(e){if(e===null||rt(e)||lC(e))return 1;if(aC(e))return 2}function Ms(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 $i={name:"attention",resolveAll:pC,tokenize:mC};function pC(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};_l(h,-l),_l(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},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ft(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ft(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=ft(c,Ms(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ft(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ft(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,zt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function mC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=wl(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=wl(l),h=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?h:h&&(o||!p)),c._close=!!(i===42?p:p&&(u||!h)),t(l)}}function _l(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const gC={name:"autolink",tokenize:xC};function xC(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 Ct(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||ut(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||ut(f))&&r++<32?(e.consume(f),a):(r=0,c(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||Li(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):oC(f)?(e.consume(f),c):n(f)}function u(f){return ut(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||ut(f))&&r++<63){const x=f===45?p:h;return e.consume(f),x}return n(f)}}const Io={partial:!0,tokenize:yC};function yC(e,t,n){return r;function r(i){return Pe(i)?De(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||_e(i)?t(i):n(i)}}const ch={continuation:{tokenize:bC},exit:wC,name:"blockQuote",tokenize:vC};function vC(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 Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function bC(e,t,n){const r=this;return o;function o(s){return Pe(s)?De(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(ch,t,n)(s)}}function wC(e){e.exit("blockQuote")}const uh={name:"characterEscape",tokenize:_C};function _C(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 sC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const dh={name:"characterReference",tokenize:kC};function kC(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"),c):(e.enter("characterReferenceValue"),i=31,s=ut,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=iC,u):(e.enter("characterReferenceValue"),i=7,s=Fi,u(h))}function u(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===ut&&!Ds(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),u):n(h)}}const kl={partial:!0,tokenize:CC},Sl={concrete:!0,name:"codeFenced",tokenize:SC};function SC(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(N){return c(N)}function c(N){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(N)}function u(N){return N===a?(s++,e.consume(N),u):s<3?n(N):(e.exit("codeFencedFenceSequence"),Pe(N)?De(e,h,"whitespace")(N):h(N))}function h(N){return N===null||_e(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(kl,m,S)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||_e(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Pe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,f,"whitespace")(N)):N===96&&N===a?n(N):(e.consume(N),p)}function f(N){return N===null||_e(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||_e(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===a?n(N):(e.consume(N),x)}function m(N){return e.attempt(o,S,y)(N)}function y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),g}function g(N){return i>0&&Pe(N)?De(e,v,"linePrefix",i+1)(N):v(N)}function v(N){return N===null||_e(N)?e.check(kl,m,S)(N):(e.enter("codeFlowValue"),k(N))}function k(N){return N===null||_e(N)?(e.exit("codeFlowValue"),v(N)):(e.consume(N),k)}function S(N){return e.exit("codeFenced"),t(N)}function C(N,A,R){let O=0;return P;function P(D){return N.enter("lineEnding"),N.consume(D),N.exit("lineEnding"),L}function L(D){return N.enter("codeFencedFence"),Pe(D)?De(N,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):E(D)}function E(D){return D===a?(N.enter("codeFencedFenceSequence"),M(D)):R(D)}function M(D){return D===a?(O++,N.consume(D),M):O>=s?(N.exit("codeFencedFenceSequence"),Pe(D)?De(N,_,"whitespace")(D):_(D)):R(D)}function _(D){return D===null||_e(D)?(N.exit("codeFencedFence"),A(D)):R(D)}}}function CC(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 Xo={name:"codeIndented",tokenize:NC},EC={partial:!0,tokenize:TC};function NC(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),De(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):_e(c)?e.attempt(EC,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||_e(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function TC(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):De(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):_e(s)?o(s):n(s)}}const jC={name:"codeText",previous:IC,resolve:AC,tokenize:zC};function AC(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 IC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zC(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,u(h)):_e(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||_e(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",c(h))}}class PC{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&&Yn(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),Yn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yn(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);Yn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yn(this.left,n.reverse())}}}function Yn(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 fh(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new PC(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,RC(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return zt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function RC(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,h,p=-1,f=n,x=0,m=0;const y=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),h&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const g=a.slice(y[p],y[p+1]),v=i.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),p=-1;++p<l.length;)c[x+l[p][0]]=x+l[p][1],x+=l[p][1]-l[p][0]-1;return c}const OC={resolve:MC,tokenize:LC},DC={partial:!0,tokenize:FC};function MC(e){return fh(e),e}function LC(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(DC,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 FC(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),De(e,i,"linePrefix")}function i(s){if(s===null||_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 hh(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=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||Li(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?x:f)}function x(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!u&&(g===null||g===41||rt(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,m):g===41?(e.consume(g),u--,m):g===null||g===32||g===40||Li(g)?n(g):(e.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function ph(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(o),e.consume(f),e.exit(o),e.enter(i),u}function u(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"),u):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||_e(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Pe(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,h):h(f)}}function mh(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):_e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||_e(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:u)}function h(p){return p===s||p===92?(e.consume(p),u):u(p)}}function rr(e,t){let n;return r;function r(o){return _e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Pe(o)?De(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const $C={name:"definition",tokenize:UC},BC={partial:!0,tokenize:ZC};function UC(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return ph.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=jn(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 rt(f)?rr(e,c)(f):c(f)}function c(f){return hh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(BC,h,h)(f)}function h(f){return Pe(f)?De(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 ZC(e,t,n){return r;function r(a){return rt(a)?rr(e,o)(a):n(a)}function o(a){return mh(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Pe(a)?De(e,s,"whitespace")(a):s(a)}function s(a){return a===null||_e(a)?t(a):n(a)}}const VC={name:"hardBreakEscape",tokenize:WC};function WC(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 HC={name:"headingAtx",resolve:qC,tokenize:GC};function qC(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zt(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function GC(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||rt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||_e(u)?(e.exit("atxHeading"),t(u)):Pe(u)?De(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||rt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const KC=["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"],Cl=["pre","script","style","textarea"],JC={concrete:!0,name:"htmlFlow",resolveTo:QC,tokenize:eE},YC={partial:!0,tokenize:nE},XC={partial:!0,tokenize:tE};function QC(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 eE(e,t,n){const r=this;let o,i,s,a,l;return c;function c(T){return u(T)}function u(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),p):T===47?(e.consume(T),i=!0,m):T===63?(e.consume(T),o=3,r.interrupt?t:j):Ct(T)?(e.consume(T),s=String.fromCharCode(T),y):n(T)}function p(T){return T===45?(e.consume(T),o=2,f):T===91?(e.consume(T),o=5,a=0,x):Ct(T)?(e.consume(T),o=4,r.interrupt?t:j):n(T)}function f(T){return T===45?(e.consume(T),r.interrupt?t:j):n(T)}function x(T){const ee="CDATA[";return T===ee.charCodeAt(a++)?(e.consume(T),a===ee.length?r.interrupt?t:E:x):n(T)}function m(T){return Ct(T)?(e.consume(T),s=String.fromCharCode(T),y):n(T)}function y(T){if(T===null||T===47||T===62||rt(T)){const ee=T===47,re=s.toLowerCase();return!ee&&!i&&Cl.includes(re)?(o=1,r.interrupt?t(T):E(T)):KC.includes(s.toLowerCase())?(o=6,ee?(e.consume(T),g):r.interrupt?t(T):E(T)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):i?v(T):k(T))}return T===45||ut(T)?(e.consume(T),s+=String.fromCharCode(T),y):n(T)}function g(T){return T===62?(e.consume(T),r.interrupt?t:E):n(T)}function v(T){return Pe(T)?(e.consume(T),v):P(T)}function k(T){return T===47?(e.consume(T),P):T===58||T===95||Ct(T)?(e.consume(T),S):Pe(T)?(e.consume(T),k):P(T)}function S(T){return T===45||T===46||T===58||T===95||ut(T)?(e.consume(T),S):C(T)}function C(T){return T===61?(e.consume(T),N):Pe(T)?(e.consume(T),C):k(T)}function N(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,A):Pe(T)?(e.consume(T),N):R(T)}function A(T){return T===l?(e.consume(T),l=null,O):T===null||_e(T)?n(T):(e.consume(T),A)}function R(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||rt(T)?C(T):(e.consume(T),R)}function O(T){return T===47||T===62||Pe(T)?k(T):n(T)}function P(T){return T===62?(e.consume(T),L):n(T)}function L(T){return T===null||_e(T)?E(T):Pe(T)?(e.consume(T),L):n(T)}function E(T){return T===45&&o===2?(e.consume(T),J):T===60&&o===1?(e.consume(T),Z):T===62&&o===4?(e.consume(T),U):T===63&&o===3?(e.consume(T),j):T===93&&o===5?(e.consume(T),q):_e(T)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(YC,B,M)(T)):T===null||_e(T)?(e.exit("htmlFlowData"),M(T)):(e.consume(T),E)}function M(T){return e.check(XC,_,B)(T)}function _(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),D}function D(T){return T===null||_e(T)?M(T):(e.enter("htmlFlowData"),E(T))}function J(T){return T===45?(e.consume(T),j):E(T)}function Z(T){return T===47?(e.consume(T),s="",W):E(T)}function W(T){if(T===62){const ee=s.toLowerCase();return Cl.includes(ee)?(e.consume(T),U):E(T)}return Ct(T)&&s.length<8?(e.consume(T),s+=String.fromCharCode(T),W):E(T)}function q(T){return T===93?(e.consume(T),j):E(T)}function j(T){return T===62?(e.consume(T),U):T===45&&o===2?(e.consume(T),j):E(T)}function U(T){return T===null||_e(T)?(e.exit("htmlFlowData"),B(T)):(e.consume(T),U)}function B(T){return e.exit("htmlFlow"),t(T)}}function tE(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 nE(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Io,t,n)}}const rE={name:"htmlText",tokenize:oE};function oE(e,t,n){const r=this;let o,i,s;return a;function a(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),l}function l(j){return j===33?(e.consume(j),c):j===47?(e.consume(j),C):j===63?(e.consume(j),k):Ct(j)?(e.consume(j),R):n(j)}function c(j){return j===45?(e.consume(j),u):j===91?(e.consume(j),i=0,x):Ct(j)?(e.consume(j),v):n(j)}function u(j){return j===45?(e.consume(j),f):n(j)}function h(j){return j===null?n(j):j===45?(e.consume(j),p):_e(j)?(s=h,Z(j)):(e.consume(j),h)}function p(j){return j===45?(e.consume(j),f):h(j)}function f(j){return j===62?J(j):j===45?p(j):h(j)}function x(j){const U="CDATA[";return j===U.charCodeAt(i++)?(e.consume(j),i===U.length?m:x):n(j)}function m(j){return j===null?n(j):j===93?(e.consume(j),y):_e(j)?(s=m,Z(j)):(e.consume(j),m)}function y(j){return j===93?(e.consume(j),g):m(j)}function g(j){return j===62?J(j):j===93?(e.consume(j),g):m(j)}function v(j){return j===null||j===62?J(j):_e(j)?(s=v,Z(j)):(e.consume(j),v)}function k(j){return j===null?n(j):j===63?(e.consume(j),S):_e(j)?(s=k,Z(j)):(e.consume(j),k)}function S(j){return j===62?J(j):k(j)}function C(j){return Ct(j)?(e.consume(j),N):n(j)}function N(j){return j===45||ut(j)?(e.consume(j),N):A(j)}function A(j){return _e(j)?(s=A,Z(j)):Pe(j)?(e.consume(j),A):J(j)}function R(j){return j===45||ut(j)?(e.consume(j),R):j===47||j===62||rt(j)?O(j):n(j)}function O(j){return j===47?(e.consume(j),J):j===58||j===95||Ct(j)?(e.consume(j),P):_e(j)?(s=O,Z(j)):Pe(j)?(e.consume(j),O):J(j)}function P(j){return j===45||j===46||j===58||j===95||ut(j)?(e.consume(j),P):L(j)}function L(j){return j===61?(e.consume(j),E):_e(j)?(s=L,Z(j)):Pe(j)?(e.consume(j),L):O(j)}function E(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),o=j,M):_e(j)?(s=E,Z(j)):Pe(j)?(e.consume(j),E):(e.consume(j),_)}function M(j){return j===o?(e.consume(j),o=void 0,D):j===null?n(j):_e(j)?(s=M,Z(j)):(e.consume(j),M)}function _(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||rt(j)?O(j):(e.consume(j),_)}function D(j){return j===47||j===62||rt(j)?O(j):n(j)}function J(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function Z(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),W}function W(j){return Pe(j)?De(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):q(j)}function q(j){return e.enter("htmlTextData"),s(j)}}const Ls={name:"labelEnd",resolveAll:lE,resolveTo:cE,tokenize:uE},iE={tokenize:dE},sE={tokenize:fE},aE={tokenize:hE};function lE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&zt(e,0,e.length,n),e}function cE(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=ft(a,e.slice(i+1,i+r+3)),a=ft(a,[["enter",u,t]]),a=ft(a,Ms(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=ft(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ft(a,e.slice(s+1)),a=ft(a,[["exit",l,t]]),zt(e,i,e.length,a),e}function uE(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(jn(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(iE,u,s?u:h)(p):p===91?e.attempt(sE,u,s?c:h)(p):s?u(p):h(p)}function c(p){return e.attempt(aE,u,h)(p)}function u(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function dE(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 rt(h)?rr(e,i)(h):i(h)}function i(h){return h===41?u(h):hh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return rt(h)?rr(e,l)(h):u(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?mh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return rt(h)?rr(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function fE(e,t,n){const r=this;return o;function o(a){return ph.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function hE(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 pE={name:"labelStartImage",resolveAll:Ls.resolveAll,tokenize:mE};function mE(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const gE={name:"labelStartLink",resolveAll:Ls.resolveAll,tokenize:xE};function xE(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 Qo={name:"lineEnding",tokenize:yE};function yE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Br={name:"thematicBreak",tokenize:vE};function vE(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||_e(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Pe(c)?De(e,a,"whitespace")(c):a(c))}}const tt={continuation:{tokenize:kE},exit:CE,name:"list",tokenize:_E},bE={partial:!0,tokenize:EE},wE={partial:!0,tokenize:SE};function _E(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(f){const x=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Fi(f)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Br,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Fi(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"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Io,r.interrupt?n:u,e.attempt(bE,p,h))}function u(f){return r.containerState.initialBlankLine=!0,i++,p(f)}function h(f){return Pe(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 kE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Io,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Pe(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,De(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function SE(e,t,n){const r=this;return De(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function CE(e){e.exit(this.containerState.type)}function EE(e,t,n){const r=this;return De(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Pe(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const El={name:"setextUnderline",resolveTo:NE,tokenize:TE};function NE(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 TE(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Pe(c)?De(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||_e(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const jE={tokenize:AE};function AE(e){const t=this,n=e.attempt(Io,r,e.attempt(this.parser.constructs.flowInitial,o,De(e,e.attempt(this.parser.constructs.flow,o,e.attempt(OC,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 IE={resolveAll:xh()},zE=gh("string"),PE=gh("text");function gh(e){return{resolveAll:xh(e==="text"?RE:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const h=o[u];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 xh(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 RE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const OE={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:ch},DE={91:$C},ME={[-2]:Xo,[-1]:Xo,32:Xo},LE={35:HC,42:Br,45:[El,Br],60:JC,61:El,95:Br,96:Sl,126:Sl},FE={38:dh,92:uh},$E={[-5]:Qo,[-4]:Qo,[-3]:Qo,33:pE,38:dh,42:$i,60:[gC,rE],91:gE,92:[VC,uh],93:Ls,95:$i,96:jC},BE={null:[$i,IE]},UE={null:[42,95]},ZE={null:[]},VE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:UE,contentInitial:DE,disable:ZE,document:OE,flow:LE,flowInitial:ME,insideSpan:BE,string:FE,text:$E},Symbol.toStringTag,{value:"Module"}));function WE(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:A(C),check:A(N),consume:v,enter:k,exit:S,interrupt:A(N,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function h(L){return s=ft(s,L),y(),s[s.length-1]!==null?[]:(R(t,0),c.events=Ms(i,c.events,c),c.events)}function p(L,E){return qE(f(L),E)}function f(L){return HE(s,L)}function x(){const{_bufferIndex:L,_index:E,line:M,column:_,offset:D}=r;return{_bufferIndex:L,_index:E,line:M,column:_,offset:D}}function m(L){o[L.line]=L.column,P()}function y(){let L;for(;r._index<s.length;){const E=s[r._index];if(typeof E=="string")for(L=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<E.length;)g(E.charCodeAt(r._bufferIndex));else g(E)}}function g(L){u=u(L)}function v(L){_e(L)?(r.line++,r.column=1,r.offset+=L===-3?2:1,P()):L!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=L}function k(L,E){const M=E||{};return M.type=L,M.start=x(),c.events.push(["enter",M,c]),a.push(M),M}function S(L){const E=a.pop();return E.end=x(),c.events.push(["exit",E,c]),E}function C(L,E){R(L,E.from)}function N(L,E){E.restore()}function A(L,E){return M;function M(_,D,J){let Z,W,q,j;return Array.isArray(_)?B(_):"tokenize"in _?B([_]):U(_);function U(ve){return ie;function ie(de){const ge=de!==null&&ve[de],te=de!==null&&ve.null,oe=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(te)?te:te?[te]:[]];return B(oe)(de)}}function B(ve){return Z=ve,W=0,ve.length===0?J:T(ve[W])}function T(ve){return ie;function ie(de){return j=O(),q=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?re():ve.tokenize.call(E?Object.assign(Object.create(c),E):c,l,ee,re)(de)}}function ee(ve){return L(q,j),D}function re(ve){return j.restore(),++W<Z.length?T(Z[W]):J}}}function R(L,E){L.resolveAll&&!i.includes(L)&&i.push(L),L.resolve&&zt(c.events,E,c.events.length-E,L.resolve(c.events.slice(E),c)),L.resolveTo&&(c.events=L.resolveTo(c.events,c))}function O(){const L=x(),E=c.previous,M=c.currentConstruct,_=c.events.length,D=Array.from(a);return{from:_,restore:J};function J(){r=L,c.previous=E,c.currentConstruct=M,c.events.length=_,a=D,P()}}function P(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function HE(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 qE(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 w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Bw="DialogDescriptionWarning",Uw=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fd(Bw).contentName}}.`;return w.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Zw=Qu,Vw=td,Ww=rd,Hw=od,qw=id,Gw=ad,Kw=ud;function Jw(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Yw(e){const[t,n]=w.useState(void 0);return qe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Xw=["top","right","bottom","left"],Kt=Math.min,lt=Math.max,Kr=Math.round,zr=Math.floor,Tt=e=>({x:e,y:e}),Qw={left:"right",right:"left",bottom:"top",top:"bottom"},e2={start:"end",end:"start"};function _i(e,t,n){return lt(e,Kt(t,n))}function Lt(e,t){return typeof e=="function"?e(t):e}function Ft(e){return e.split("-")[0]}function Bn(e){return e.split("-")[1]}function ms(e){return e==="x"?"y":"x"}function gs(e){return e==="y"?"height":"width"}const t2=new Set(["top","bottom"]);function Et(e){return t2.has(Ft(e))?"y":"x"}function xs(e){return ms(Et(e))}function n2(e,t,n){n===void 0&&(n=!1);const r=Bn(e),o=xs(e),i=gs(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jr(s)),[s,Jr(s)]}function r2(e){const t=Jr(e);return[ki(e),t,ki(t)]}function ki(e){return e.replace(/start|end/g,t=>e2[t])}const Ha=["left","right"],qa=["right","left"],o2=["top","bottom"],i2=["bottom","top"];function s2(e,t,n){switch(e){case"top":case"bottom":return n?t?qa:Ha:t?Ha:qa;case"left":case"right":return t?o2:i2;default:return[]}}function a2(e,t,n,r){const o=Bn(e);let i=s2(Ft(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ki)))),i}function Jr(e){return e.replace(/left|right|bottom|top/g,t=>Qw[t])}function l2(e){return{top:0,right:0,bottom:0,left:0,...e}}function hd(e){return typeof e!="number"?l2(e):{top:e,right:e,bottom:e,left:e}}function Yr(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ga(e,t,n){let{reference:r,floating:o}=e;const i=Et(t),s=xs(t),a=gs(s),l=Ft(t),c=i==="y",u=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:u,y:r.y-o.height};break;case"bottom":f={x:u,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(Bn(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1);break}return f}async function c2(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=Lt(t,e),x=hd(f),y=a[p?h==="floating"?"reference":"floating":h],g=Yr(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=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},E=Yr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:l}):v);return{top:(g.top-E.top+x.top)/S.y,bottom:(E.bottom-g.bottom+x.bottom)/S.y,left:(g.left-E.left+x.left)/S.x,right:(E.right-g.right+x.right)/S.x}}const u2=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:h}=Ga(c,r,l),p=r,f={},x=0;for(let y=0;y<a.length;y++){var m;const{name:g,fn:v}=a[y],{x:k,y:S,data:E,reset:N}=await v({x:u,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:c2},elements:{reference:e,floating:t}});u=k??u,h=S??h,f={...f,[g]:{...f[g],...E}},N&&x<=50&&(x++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(c=N.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):N.rects),{x:u,y:h}=Ga(c,p,l)),y=-1)}return{x:u,y:h,placement:p,strategy:o,middlewareData:f}},d2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Lt(e,t)||{};if(c==null)return{};const h=hd(u),p={x:n,y:r},f=xs(o),x=gs(f),m=await s.getDimensions(c),y=f==="y",g=y?"top":"left",v=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[f]-p[f]-i.floating[x],E=p[f]-i.reference[f],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let T=N?N[k]:0;(!T||!await(s.isElement==null?void 0:s.isElement(N)))&&(T=a.floating[k]||i.floating[x]);const P=S/2-E/2,R=T/2-m[x]/2-1,D=Kt(h[g],R),M=Kt(h[v],R),C=D,L=T-m[x]-M,_=T/2-m[x]/2+P,O=_i(C,_,L),J=!l.arrow&&Bn(o)!=null&&_!==O&&i.reference[x]/2-(_<C?D:M)-m[x]/2<0,Z=J?_<C?_-C:_-L:0;return{[f]:p[f]+Z,data:{[f]:O,centerOffset:_-O-Z,...J&&{alignmentOffset:Z}},reset:J}}}),f2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=Lt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=Ft(o),v=Et(a),k=Ft(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=p||(k||!m?[Jr(a)]:r2(a)),N=x!=="none";!p&&N&&E.push(...a2(a,m,x,S));const T=[a,...E],P=await l.detectOverflow(t,y),R=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&R.push(P[g]),h){const _=n2(o,s,S);R.push(P[_[0]],P[_[1]])}if(D=[...D,{placement:o,overflows:R}],!R.every(_=>_<=0)){var M,C;const _=(((M=i.flip)==null?void 0:M.index)||0)+1,O=T[_];if(O&&(!(h==="alignment"?v!==Et(O):!1)||D.every(W=>Et(W.placement)===v?W.overflows[0]>0:!0)))return{data:{index:_,overflows:D},reset:{placement:O}};let J=(C=D.filter(Z=>Z.overflows[0]<=0).sort((Z,W)=>Z.overflows[1]-W.overflows[1])[0])==null?void 0:C.placement;if(!J)switch(f){case"bestFit":{var L;const Z=(L=D.filter(W=>{if(N){const q=Et(W.placement);return q===v||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,A)=>q+A,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:L[0];Z&&(J=Z);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function Ka(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ja(e){return Xw.some(t=>e[t]>=0)}const h2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Lt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Ka(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ja(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Ka(s,n.floating);return{data:{escapedOffsets:a,escaped:Ja(a)}}}default:return{}}}}},pd=new Set(["left","top"]);async function p2(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ft(n),a=Bn(n),l=Et(n)==="y",c=pd.has(s)?-1:1,u=i&&l?-1:1,h=Lt(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:x}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof x=="number"&&(f=a==="end"?x*-1:x),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}const m2=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 p2(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}}}}},g2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:k}=g;return{x:v,y:k}}},...c}=Lt(e,t),u={x:n,y:r},h=await i.detectOverflow(t,c),p=Et(Ft(o)),f=ms(p);let x=u[f],m=u[p];if(s){const g=f==="y"?"top":"left",v=f==="y"?"bottom":"right",k=x+h[g],S=x-h[v];x=_i(k,x,S)}if(a){const g=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=m+h[g],S=m-h[v];m=_i(k,m,S)}const y=l.fn({...t,[f]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:s,[p]:a}}}}}},x2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Lt(e,t),u={x:n,y:r},h=Et(o),p=ms(h);let f=u[p],x=u[h];const m=Lt(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const k=p==="y"?"height":"width",S=i.reference[p]-i.floating[k]+y.mainAxis,E=i.reference[p]+i.reference[k]-y.mainAxis;f<S?f=S:f>E&&(f=E)}if(c){var g,v;const k=p==="y"?"width":"height",S=pd.has(Ft(o)),E=i.reference[h]-i.floating[k]+(S&&((g=s.offset)==null?void 0:g[h])||0)+(S?0:y.crossAxis),N=i.reference[h]+i.reference[k]+(S?0:((v=s.offset)==null?void 0:v[h])||0)-(S?y.crossAxis:0);x<E?x=E:x>N&&(x=N)}return{[p]:f,[h]:x}}}},y2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Lt(e,t),u=await s.detectOverflow(t,c),h=Ft(o),p=Bn(o),f=Et(o)==="y",{width:x,height:m}=i.floating;let y,g;h==="top"||h==="bottom"?(y=h,g=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,y=p==="end"?"top":"bottom");const v=m-u.top-u.bottom,k=x-u.left-u.right,S=Kt(m-u[y],v),E=Kt(x-u[g],k),N=!t.middlewareData.shift;let T=S,P=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=v),N&&!p){const D=lt(u.left,0),M=lt(u.right,0),C=lt(u.top,0),L=lt(u.bottom,0);f?P=x-2*(D!==0||M!==0?D+M:lt(u.left,u.right)):T=m-2*(C!==0||L!==0?C+L:lt(u.top,u.bottom))}await l({...t,availableWidth:P,availableHeight:T});const R=await s.getDimensions(a.floating);return x!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function yo(){return typeof window<"u"}function Un(e){return md(e)?(e.nodeName||"").toLowerCase():"#document"}function dt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pt(e){var t;return(t=(md(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function md(e){return yo()?e instanceof Node||e instanceof dt(e).Node:!1}function vt(e){return yo()?e instanceof Element||e instanceof dt(e).Element:!1}function It(e){return yo()?e instanceof HTMLElement||e instanceof dt(e).HTMLElement:!1}function Ya(e){return!yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof dt(e).ShadowRoot}const v2=new Set(["inline","contents"]);function pr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!v2.has(o)}const b2=new Set(["table","td","th"]);function w2(e){return b2.has(Un(e))}const _2=[":popover-open",":modal"];function vo(e){return _2.some(t=>{try{return e.matches(t)}catch{return!1}})}const k2=["transform","translate","scale","rotate","perspective"],S2=["transform","translate","scale","rotate","perspective","filter"],C2=["paint","layout","strict","content"];function ys(e){const t=vs(),n=vt(e)?bt(e):e;return k2.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)||S2.some(r=>(n.willChange||"").includes(r))||C2.some(r=>(n.contain||"").includes(r))}function E2(e){let t=Jt(e);for(;It(t)&&!Rn(t);){if(ys(t))return t;if(vo(t))return null;t=Jt(t)}return null}function vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const N2=new Set(["html","body","#document"]);function Rn(e){return N2.has(Un(e))}function bt(e){return dt(e).getComputedStyle(e)}function bo(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ya(e)&&e.host||Pt(e);return Ya(t)?t.host:t}function gd(e){const t=Jt(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:It(t)&&pr(t)?t:gd(t)}function ar(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=gd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=dt(o);if(i){const a=Si(s);return t.concat(s,s.visualViewport||[],pr(o)?o:[],a&&n?ar(a):[])}return t.concat(o,ar(o,[],n))}function Si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xd(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=It(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Kr(n)!==i||Kr(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function bs(e){return vt(e)?e:e.contextElement}function Nn(e){const t=bs(e);if(!It(t))return Tt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=xd(t);let s=(i?Kr(n.width):n.width)/r,a=(i?Kr(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const T2=Tt(0);function yd(e){const t=dt(e);return!vs()||!t.visualViewport?T2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function j2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==dt(e)?!1:t}function sn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=bs(e);let s=Tt(1);t&&(r?vt(r)&&(s=Nn(r)):s=Nn(e));const a=j2(i,n,r)?yd(i):Tt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,h=o.height/s.y;if(i){const p=dt(i),f=r&&vt(r)?dt(r):r;let x=p,m=Si(x);for(;m&&r&&f!==x;){const y=Nn(m),g=m.getBoundingClientRect(),v=bt(m),k=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(v.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,h*=y.y,l+=k,c+=S,x=dt(m),m=Si(x)}}return Yr({width:u,height:h,x:l,y:c})}function wo(e,t){const n=bo(e).scrollLeft;return t?t.left+n:sn(Pt(e)).left+n}function vd(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function A2(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Pt(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Tt(1);const u=Tt(0),h=It(r);if((h||!h&&!i)&&((Un(r)!=="body"||pr(s))&&(l=bo(r)),It(r))){const f=sn(r);c=Nn(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const p=s&&!h&&!i?vd(s,l):Tt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function I2(e){return Array.from(e.getClientRects())}function z2(e){const t=Pt(e),n=bo(e),r=e.ownerDocument.body,o=lt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=lt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+wo(e);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=lt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Xa=25;function P2(e,t){const n=dt(e),r=Pt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=vs();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=wo(r);if(c<=0){const u=r.ownerDocument,h=u.body,p=getComputedStyle(h),f=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-f);x<=Xa&&(i-=x)}else c<=Xa&&(i+=c);return{width:i,height:s,x:a,y:l}}const R2=new Set(["absolute","fixed"]);function O2(e,t){const n=sn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=It(e)?Nn(e):Tt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Qa(e,t,n){let r;if(t==="viewport")r=P2(e,n);else if(t==="document")r=z2(Pt(e));else if(vt(t))r=O2(t,n);else{const o=yd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Yr(r)}function bd(e,t){const n=Jt(e);return n===t||!vt(n)||Rn(n)?!1:bt(n).position==="fixed"||bd(n,t)}function D2(e,t){const n=t.get(e);if(n)return n;let r=ar(e,[],!1).filter(a=>vt(a)&&Un(a)!=="body"),o=null;const i=bt(e).position==="fixed";let s=i?Jt(e):e;for(;vt(s)&&!Rn(s);){const a=bt(s),l=ys(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&R2.has(o.position)||pr(s)&&!l&&bd(e,s))?r=r.filter(u=>u!==s):o=a,s=Jt(s)}return t.set(e,r),r}function M2(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:D2(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const h=Qa(t,u,o);return c.top=lt(h.top,c.top),c.right=Kt(h.right,c.right),c.bottom=Kt(h.bottom,c.bottom),c.left=lt(h.left,c.left),c},Qa(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function L2(e){const{width:t,height:n}=xd(e);return{width:t,height:n}}function F2(e,t,n){const r=It(t),o=Pt(t),i=n==="fixed",s=sn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Tt(0);function c(){l.x=wo(o)}if(r||!r&&!i)if((Un(t)!=="body"||pr(o))&&(a=bo(t)),r){const f=sn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?vd(o,a):Tt(0),h=s.left+a.scrollLeft-l.x-u.x,p=s.top+a.scrollTop-l.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function Ho(e){return bt(e).position==="static"}function el(e,t){if(!It(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pt(e)===n&&(n=n.ownerDocument.body),n}function wd(e,t){const n=dt(e);if(vo(e))return n;if(!It(e)){let o=Jt(e);for(;o&&!Rn(o);){if(vt(o)&&!Ho(o))return o;o=Jt(o)}return n}let r=el(e,t);for(;r&&w2(r)&&Ho(r);)r=el(r,t);return r&&Rn(r)&&Ho(r)&&!ys(r)?n:r||E2(e)||n}const $2=async function(e){const t=this.getOffsetParent||wd,n=this.getDimensions,r=await n(e.floating);return{reference:F2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function B2(e){return bt(e).direction==="rtl"}const U2={convertOffsetParentRelativeRectToViewportRelativeRect:A2,getDocumentElement:Pt,getClippingRect:M2,getOffsetParent:wd,getElementRects:$2,getClientRects:I2,getDimensions:L2,getScale:Nn,isElement:vt,isRTL:B2};function _d(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Z2(e,t){let n=null,r;const o=Pt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:h,width:p,height:f}=c;if(a||t(),!p||!f)return;const x=zr(h),m=zr(o.clientWidth-(u+p)),y=zr(o.clientHeight-(h+f)),g=zr(u),k={rootMargin:-x+"px "+-m+"px "+-y+"px "+-g+"px",threshold:lt(0,Kt(1,l))||1};let S=!0;function E(N){const T=N[0].intersectionRatio;if(T!==l){if(!S)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!_d(c,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(E,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,k)}n.observe(e)}return s(!0),i}function V2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=bs(e),u=o||i?[...c?ar(c):[],...ar(t)]:[];u.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const h=c&&a?Z2(c,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[v]=g;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let x,m=l?sn(e):null;l&&y();function y(){const g=sn(e);m&&!_d(m,g)&&n(),m=g,x=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(x)}}const W2=m2,H2=g2,q2=f2,G2=y2,K2=h2,tl=d2,J2=x2,Y2=(e,t,n)=>{const r=new Map,o={platform:U2,...n},i={...o.platform,_c:r};return u2(e,t,{...o,platform:i})};var X2=typeof document<"u",Q2=function(){},$r=X2?w.useLayoutEffect:Q2;function Xr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xr(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Xr(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function kd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nl(e,t){const n=kd(e);return Math.round(t*n)/n}function qo(e){const t=w.useRef(e);return $r(()=>{t.current=e}),t}function e_(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,h]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=w.useState(r);Xr(p,r)||f(r);const[x,m]=w.useState(null),[y,g]=w.useState(null),v=w.useCallback(W=>{W!==N.current&&(N.current=W,m(W))},[]),k=w.useCallback(W=>{W!==T.current&&(T.current=W,g(W))},[]),S=i||x,E=s||y,N=w.useRef(null),T=w.useRef(null),P=w.useRef(u),R=l!=null,D=qo(l),M=qo(o),C=qo(c),L=w.useCallback(()=>{if(!N.current||!T.current)return;const W={placement:t,strategy:n,middleware:p};M.current&&(W.platform=M.current),Y2(N.current,T.current,W).then(q=>{const A={...q,isPositioned:C.current!==!1};_.current&&!Xr(P.current,A)&&(P.current=A,dr.flushSync(()=>{h(A)}))})},[p,t,n,M,C]);$r(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(W=>({...W,isPositioned:!1})))},[c]);const _=w.useRef(!1);$r(()=>(_.current=!0,()=>{_.current=!1}),[]),$r(()=>{if(S&&(N.current=S),E&&(T.current=E),S&&E){if(D.current)return D.current(S,E,L);L()}},[S,E,L,D,R]);const O=w.useMemo(()=>({reference:N,floating:T,setReference:v,setFloating:k}),[v,k]),J=w.useMemo(()=>({reference:S,floating:E}),[S,E]),Z=w.useMemo(()=>{const W={position:n,left:0,top:0};if(!J.floating)return W;const q=nl(J.floating,u.x),A=nl(J.floating,u.y);return a?{...W,transform:"translate("+q+"px, "+A+"px)",...kd(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:A}},[n,a,J.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:L,refs:O,elements:J,floatingStyles:Z}),[u,L,O,J,Z])}const t_=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?tl({element:r.current,padding:o}).fn(n):{}:r?tl({element:r,padding:o}).fn(n):{}}}},n_=(e,t)=>({...W2(e),options:[e,t]}),r_=(e,t)=>({...H2(e),options:[e,t]}),o_=(e,t)=>({...J2(e),options:[e,t]}),i_=(e,t)=>({...q2(e),options:[e,t]}),s_=(e,t)=>({...G2(e),options:[e,t]}),a_=(e,t)=>({...K2(e),options:[e,t]}),l_=(e,t)=>({...t_(e),options:[e,t]});var c_="Arrow",Sd=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return d.jsx(Ce.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Sd.displayName=c_;var u_=Sd,ws="Popper",[Cd,_o]=Bt(ws),[d_,Ed]=Cd(ws),Nd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=w.useState(null);return d.jsx(d_,{scope:t,anchor:r,onAnchorChange:o,children:n})};Nd.displayName=ws;var Td="PopperAnchor",jd=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Ed(Td,n),s=w.useRef(null),a=Re(t,s),l=w.useRef(null);return w.useEffect(()=>{const c=l.current;l.current=r?.current||s.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:d.jsx(Ce.div,{...o,ref:a})});jd.displayName=Td;var _s="PopperContent",[f_,h_]=Cd(_s),Ad=w.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:x,...m}=e,y=Ed(_s,n),[g,v]=w.useState(null),k=Re(t,ie=>v(ie)),[S,E]=w.useState(null),N=Yw(S),T=N?.width??0,P=N?.height??0,R=r+(i!=="center"?"-"+i:""),D=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(c)?c:[c],C=M.length>0,L={padding:D,boundary:M.filter(m_),altBoundary:C},{refs:_,floatingStyles:O,placement:J,isPositioned:Z,middlewareData:W}=e_({strategy:"fixed",placement:R,whileElementsMounted:(...ie)=>V2(...ie,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[n_({mainAxis:o+P,alignmentAxis:s}),l&&r_({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?o_():void 0,...L}),l&&i_({...L}),s_({...L,apply:({elements:ie,rects:de,availableWidth:ge,availableHeight:te})=>{const{width:oe,height:me}=de.reference,Ee=ie.floating.style;Ee.setProperty("--radix-popper-available-width",`${ge}px`),Ee.setProperty("--radix-popper-available-height",`${te}px`),Ee.setProperty("--radix-popper-anchor-width",`${oe}px`),Ee.setProperty("--radix-popper-anchor-height",`${me}px`)}}),S&&l_({element:S,padding:a}),g_({arrowWidth:T,arrowHeight:P}),p&&a_({strategy:"referenceHidden",...L})]}),[q,A]=Pd(J),U=Qe(x);qe(()=>{Z&&U?.()},[Z,U]);const B=W.arrow?.x,j=W.arrow?.y,ee=W.arrow?.centerOffset!==0,[re,ve]=w.useState();return qe(()=>{g&&ve(window.getComputedStyle(g).zIndex)},[g]),d.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:Z?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(f_,{scope:n,placedSide:q,onArrowChange:E,arrowX:B,arrowY:j,shouldHideArrow:ee,children:d.jsx(Ce.div,{"data-side":q,"data-align":A,...m,ref:k,style:{...m.style,animation:Z?void 0:"none"}})})})});Ad.displayName=_s;var Id="PopperArrow",p_={top:"bottom",right:"left",bottom:"top",left:"right"},zd=w.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=h_(Id,r),s=p_[i.placedSide];return d.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:d.jsx(u_,{...o,ref:n,style:{...o.style,display:"block"}})})});zd.displayName=Id;function m_(e){return e!==null}var g_=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=Pd(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2;let x="",m="";return c==="bottom"?(x=s?h:`${p}px`,m=`${-l}px`):c==="top"?(x=s?h:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,m=s?h:`${f}px`):c==="left"&&(x=`${r.floating.width+l}px`,m=s?h:`${f}px`),{data:{x,y:m}}}});function Pd(e){const[t,n="center"]=e.split("-");return[t,n]}var Rd=Nd,Od=jd,Dd=Ad,Md=zd,Go="rovingFocusGroup.onEntryFocus",x_={bubbles:!1,cancelable:!0},mr="RovingFocusGroup",[Ci,Ld,y_]=Ru(mr),[v_,Fd]=Bt(mr,[y_]),[b_,w_]=v_(mr),$d=w.forwardRef((e,t)=>d.jsx(Ci.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Ci.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(__,{...e,ref:t})})}));$d.displayName=mr;var __=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...h}=e,p=w.useRef(null),f=Re(t,p),x=ho(i),[m,y]=rn({prop:s,defaultProp:a??null,onChange:l,caller:mr}),[g,v]=w.useState(!1),k=Qe(c),S=Ld(n),E=w.useRef(!1),[N,T]=w.useState(0);return w.useEffect(()=>{const P=p.current;if(P)return P.addEventListener(Go,k),()=>P.removeEventListener(Go,k)},[k]),d.jsx(b_,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(P=>y(P),[y]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:w.useCallback(()=>T(P=>P-1),[]),children:d.jsx(Ce.div,{tabIndex:g||N===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{E.current=!0}),onFocus:we(e.onFocus,P=>{const R=!E.current;if(P.target===P.currentTarget&&R&&!g){const D=new CustomEvent(Go,x_);if(P.currentTarget.dispatchEvent(D),!D.defaultPrevented){const M=S().filter(J=>J.focusable),C=M.find(J=>J.active),L=M.find(J=>J.id===m),O=[C,L,...M].filter(Boolean).map(J=>J.ref.current);Zd(O,u)}}E.current=!1}),onBlur:we(e.onBlur,()=>v(!1))})})}),Bd="RovingFocusGroupItem",Ud=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,children:s,...a}=e,l=Nt(),c=i||l,u=w_(Bd,n),h=u.currentTabStopId===c,p=Ld(n),{onFocusableItemAdd:f,onFocusableItemRemove:x,currentTabStopId:m}=u;return w.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),d.jsx(Ci.ItemSlot,{scope:n,id:c,focusable:r,active:o,children:d.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:we(e.onMouseDown,y=>{r?u.onItemFocus(c):y.preventDefault()}),onFocus:we(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:we(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=C_(y,u.orientation,u.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let k=p().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();const S=k.indexOf(y.currentTarget);k=u.loop?E_(k,S+1):k.slice(S+1)}setTimeout(()=>Zd(k))}}),children:typeof s=="function"?s({isCurrentTabStop:h,hasTabStop:m!=null}):s})})});Ud.displayName=Bd;var k_={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function C_(e,t,n){const r=S_(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return k_[r]}function Zd(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function E_(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var N_=$d,T_=Ud;function Ei(e,[t,n]){return Math.min(n,Math.max(t,e))}function j_(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var ks="ScrollArea",[Vd]=Bt(ks),[A_,gt]=Vd(ks),Wd=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=w.useState(null),[c,u]=w.useState(null),[h,p]=w.useState(null),[f,x]=w.useState(null),[m,y]=w.useState(null),[g,v]=w.useState(0),[k,S]=w.useState(0),[E,N]=w.useState(!1),[T,P]=w.useState(!1),R=Re(t,M=>l(M)),D=ho(o);return d.jsx(A_,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:x,scrollbarXEnabled:E,onScrollbarXEnabledChange:N,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:v,onCornerHeightChange:S,children:d.jsx(Ce.div,{dir:D,...s,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Wd.displayName=ks;var Hd="ScrollAreaViewport",qd=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=gt(Hd,n),a=w.useRef(null),l=Re(t,a,s.onViewportChange);return d.jsxs(d.Fragment,{children:[d.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}),d.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:d.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});qd.displayName=Hd;var Rt="ScrollAreaScrollbar",Gd=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return w.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?d.jsx(I_,{...r,ref:t,forceMount:n}):o.type==="scroll"?d.jsx(z_,{...r,ref:t,forceMount:n}):o.type==="auto"?d.jsx(Kd,{...r,ref:t,forceMount:n}):o.type==="always"?d.jsx(Ss,{...r,ref:t}):null});Gd.displayName=Rt;var I_=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),[i,s]=w.useState(!1);return w.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),d.jsx(mt,{present:n||i,children:d.jsx(Kd,{"data-state":i?"visible":"hidden",...r,ref:t})})}),z_=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gt(Rt,e.__scopeScrollArea),i=e.orientation==="horizontal",s=So(()=>l("SCROLL_END"),100),[a,l]=j_("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return w.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),w.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let h=c[u];const p=()=>{const f=c[u];h!==f&&(l("SCROLL"),s()),h=f};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),d.jsx(mt,{present:n||a!=="hidden",children:d.jsx(Ss,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:we(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Kd=w.forwardRef((e,t)=>{const n=gt(Rt,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=w.useState(!1),a=e.orientation==="horizontal",l=So(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return On(n.viewport,l),On(n.content,l),d.jsx(mt,{present:r||i,children:d.jsx(Ss,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Ss=w.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=gt(Rt,e.__scopeScrollArea),i=w.useRef(null),s=w.useRef(0),[a,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=ef(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function h(p,f){return L_(p,s.current,a,f)}return n==="horizontal"?d.jsx(P_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,f=rl(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"?d.jsx(R_,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,f=rl(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}),P_=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=Re(t,l,i.onScrollbarXChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx(Yd,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),nf(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:eo(s.paddingLeft),paddingEnd:eo(s.paddingRight)}})}})}),R_=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gt(Rt,e.__scopeScrollArea),[s,a]=w.useState(),l=w.useRef(null),c=Re(t,l,i.onScrollbarYChange);return w.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),d.jsx(Yd,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ko(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),nf(p,h)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:eo(s.paddingTop),paddingEnd:eo(s.paddingBottom)}})}})}),[O_,Jd]=Vd(Rt),Yd=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:h,...p}=e,f=gt(Rt,n),[x,m]=w.useState(null),y=Re(t,R=>m(R)),g=w.useRef(null),v=w.useRef(""),k=f.viewport,S=r.content-r.viewport,E=Qe(u),N=Qe(l),T=So(h,10);function P(R){if(g.current){const D=R.clientX-g.current.left,M=R.clientY-g.current.top;c({x:D,y:M})}}return w.useEffect(()=>{const R=D=>{const M=D.target;x?.contains(M)&&E(D,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[k,x,S,E]),w.useEffect(N,[r,N]),On(x,T),On(f.content,T),d.jsx(O_,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Qe(i),onThumbPointerUp:Qe(s),onThumbPositionChange:N,onThumbPointerDown:Qe(a),children:d.jsx(Ce.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:we(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),g.current=x.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),P(R))}),onPointerMove:we(e.onPointerMove,P),onPointerUp:we(e.onPointerUp,R=>{const D=R.target;D.hasPointerCapture(R.pointerId)&&D.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),Qr="ScrollAreaThumb",Xd=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Jd(Qr,e.__scopeScrollArea);return d.jsx(mt,{present:n||o.hasThumb,children:d.jsx(D_,{ref:t,...r})})}),D_=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=gt(Qr,n),s=Jd(Qr,n),{onThumbPositionChange:a}=s,l=Re(t,h=>s.onThumbChange(h)),c=w.useRef(void 0),u=So(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(u(),!c.current){const f=F_(h,a);c.current=f,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,u,a]),d.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:we(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),x=h.clientX-f.left,m=h.clientY-f.top;s.onThumbPointerDown({x,y:m})}),onPointerUp:we(e.onPointerUp,s.onThumbPointerUp)})});Xd.displayName=Qr;var Cs="ScrollAreaCorner",Qd=w.forwardRef((e,t)=>{const n=gt(Cs,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.jsx(M_,{...e,ref:t}):null});Qd.displayName=Cs;var M_=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=gt(Cs,n),[i,s]=w.useState(0),[a,l]=w.useState(0),c=!!(i&&a);return On(o.scrollbarX,()=>{const u=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(u),l(u)}),On(o.scrollbarY,()=>{const u=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(u),s(u)}),c?d.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 eo(e){return e?parseInt(e,10):0}function ef(e,t){const n=e/t;return isNaN(n)?0:n}function ko(e){const t=ef(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function L_(e,t,n,r="ltr"){const o=ko(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,h=r==="ltr"?[0,u]:[u*-1,0];return tf([l,c],h)(e)}function rl(e,t,n="ltr"){const r=ko(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=Ei(e,l);return tf([0,s],[0,a])(c)}function tf(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 nf(e,t){return e>0&&e<t}var F_=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function So(e,t){const n=Qe(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function On(e,t){const n=Qe(t);qe(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var $_=Wd,B_=qd,U_=Qd,Z_=[" ","Enter","ArrowUp","ArrowDown"],V_=[" ","Enter"],an="Select",[Co,Eo,W_]=Ru(an),[Zn]=Bt(an,[W_,_o]),No=_o(),[H_,Qt]=Zn(an),[q_,G_]=Zn(an),rf=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:h,disabled:p,required:f,form:x}=e,m=No(t),[y,g]=w.useState(null),[v,k]=w.useState(null),[S,E]=w.useState(!1),N=ho(c),[T,P]=rn({prop:r,defaultProp:o??!1,onChange:i,caller:an}),[R,D]=rn({prop:s,defaultProp:a,onChange:l,caller:an}),M=w.useRef(null),C=y?x||!!y.closest("form"):!0,[L,_]=w.useState(new Set),O=Array.from(L).map(J=>J.props.value).join(";");return d.jsx(Rd,{...m,children:d.jsxs(H_,{required:f,scope:t,trigger:y,onTriggerChange:g,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:Nt(),value:R,onValueChange:D,open:T,onOpenChange:P,dir:N,triggerPointerDownPosRef:M,disabled:p,children:[d.jsx(Co.Provider,{scope:t,children:d.jsx(q_,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(J=>{_(Z=>new Set(Z).add(J))},[]),onNativeOptionRemove:w.useCallback(J=>{_(Z=>{const W=new Set(Z);return W.delete(J),W})},[]),children:n})}),C?d.jsxs(Ef,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:h,value:R,onChange:J=>D(J.target.value),disabled:p,form:x,children:[R===void 0?d.jsx("option",{value:""}):null,Array.from(L)]},O):null]})})};rf.displayName=an;var of="SelectTrigger",sf=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=No(n),s=Qt(of,n),a=s.disabled||r,l=Re(t,s.onTriggerChange),c=Eo(n),u=w.useRef("touch"),[h,p,f]=Tf(m=>{const y=c().filter(k=>!k.disabled),g=y.find(k=>k.value===s.value),v=jf(y,m,g);v!==void 0&&s.onValueChange(v.value)}),x=m=>{a||(s.onOpenChange(!0),f()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return d.jsx(Od,{asChild:!0,...i,children:d.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":Nf(s.value)?"":void 0,...o,ref:l,onClick:we(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&x(m)}),onPointerDown:we(o.onPointerDown,m=>{u.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:we(o.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&Z_.includes(m.key)&&(x(),m.preventDefault())})})})});sf.displayName=of;var af="SelectValue",lf=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Qt(af,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,h=Re(t,l.onValueNodeChange);return qe(()=>{c(u)},[c,u]),d.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:Nf(l.value)?d.jsx(d.Fragment,{children:s}):i})});lf.displayName=af;var K_="SelectIcon",cf=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});cf.displayName=K_;var J_="SelectPortal",uf=e=>d.jsx(mo,{asChild:!0,...e});uf.displayName=J_;var ln="SelectContent",df=w.forwardRef((e,t)=>{const n=Qt(ln,e.__scopeSelect),[r,o]=w.useState();if(qe(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?dr.createPortal(d.jsx(ff,{scope:e.__scopeSelect,children:d.jsx(Co.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),i):null}return d.jsx(hf,{...e,ref:t})});df.displayName=ln;var yt=10,[ff,en]=Zn(ln),Y_="SelectContentImpl",X_=Pn("SelectContent.RemoveScroll"),hf=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y,...g}=e,v=Qt(ln,n),[k,S]=w.useState(null),[E,N]=w.useState(null),T=Re(t,ie=>S(ie)),[P,R]=w.useState(null),[D,M]=w.useState(null),C=Eo(n),[L,_]=w.useState(!1),O=w.useRef(!1);w.useEffect(()=>{if(k)return Yu(k)},[k]),Uu();const J=w.useCallback(ie=>{const[de,...ge]=C().map(me=>me.ref.current),[te]=ge.slice(-1),oe=document.activeElement;for(const me of ie)if(me===oe||(me?.scrollIntoView({block:"nearest"}),me===de&&E&&(E.scrollTop=0),me===te&&E&&(E.scrollTop=E.scrollHeight),me?.focus(),document.activeElement!==oe))return},[C,E]),Z=w.useCallback(()=>J([P,k]),[J,P,k]);w.useEffect(()=>{L&&Z()},[L,Z]);const{onOpenChange:W,triggerPointerDownPosRef:q}=v;w.useEffect(()=>{if(k){let ie={x:0,y:0};const de=te=>{ie={x:Math.abs(Math.round(te.pageX)-(q.current?.x??0)),y:Math.abs(Math.round(te.pageY)-(q.current?.y??0))}},ge=te=>{ie.x<=10&&ie.y<=10?te.preventDefault():k.contains(te.target)||W(!1),document.removeEventListener("pointermove",de),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",ge,{capture:!0})}}},[k,W,q]),w.useEffect(()=>{const ie=()=>W(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[W]);const[A,U]=Tf(ie=>{const de=C().filter(oe=>!oe.disabled),ge=de.find(oe=>oe.ref.current===document.activeElement),te=jf(de,ie,ge);te&&setTimeout(()=>te.ref.current.focus())}),B=w.useCallback((ie,de,ge)=>{const te=!O.current&&!ge;(v.value!==void 0&&v.value===de||te)&&(R(ie),te&&(O.current=!0))},[v.value]),j=w.useCallback(()=>k?.focus(),[k]),ee=w.useCallback((ie,de,ge)=>{const te=!O.current&&!ge;(v.value!==void 0&&v.value===de||te)&&M(ie)},[v.value]),re=r==="popper"?Ni:pf,ve=re===Ni?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y}:{};return d.jsx(ff,{scope:n,content:k,viewport:E,onViewportChange:N,itemRefCallback:B,selectedItem:P,onItemLeave:j,itemTextRefCallback:ee,focusSelectedItem:Z,selectedItemText:D,position:r,isPositioned:L,searchRef:A,children:d.jsx(ds,{as:X_,allowPinchZoom:!0,children:d.jsx(us,{asChild:!0,trapped:v.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:we(o,ie=>{v.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:d.jsx(po,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:d.jsx(re,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ie=>ie.preventDefault(),...g,...ve,onPlaced:()=>_(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:we(g.onKeyDown,ie=>{const de=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!de&&ie.key.length===1&&U(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let te=C().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(te=te.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const oe=ie.target,me=te.indexOf(oe);te=te.slice(me+1)}setTimeout(()=>J(te)),ie.preventDefault()}})})})})})})});hf.displayName=Y_;var Q_="SelectItemAlignedPosition",pf=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Qt(ln,n),s=en(ln,n),[a,l]=w.useState(null),[c,u]=w.useState(null),h=Re(t,T=>u(T)),p=Eo(n),f=w.useRef(!1),x=w.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=s,k=w.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&m&&y&&g){const T=i.trigger.getBoundingClientRect(),P=c.getBoundingClientRect(),R=i.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(i.dir!=="rtl"){const oe=D.left-P.left,me=R.left-oe,Ee=T.left-me,b=T.width+Ee,K=Math.max(b,P.width),H=window.innerWidth-yt,z=Ei(me,[yt,Math.max(yt,H-K)]);a.style.minWidth=b+"px",a.style.left=z+"px"}else{const oe=P.right-D.right,me=window.innerWidth-R.right-oe,Ee=window.innerWidth-T.right-me,b=T.width+Ee,K=Math.max(b,P.width),H=window.innerWidth-yt,z=Ei(me,[yt,Math.max(yt,H-K)]);a.style.minWidth=b+"px",a.style.right=z+"px"}const M=p(),C=window.innerHeight-yt*2,L=m.scrollHeight,_=window.getComputedStyle(c),O=parseInt(_.borderTopWidth,10),J=parseInt(_.paddingTop,10),Z=parseInt(_.borderBottomWidth,10),W=parseInt(_.paddingBottom,10),q=O+J+L+W+Z,A=Math.min(y.offsetHeight*5,q),U=window.getComputedStyle(m),B=parseInt(U.paddingTop,10),j=parseInt(U.paddingBottom,10),ee=T.top+T.height/2-yt,re=C-ee,ve=y.offsetHeight/2,ie=y.offsetTop+ve,de=O+J+ie,ge=q-de;if(de<=ee){const oe=M.length>0&&y===M[M.length-1].ref.current;a.style.bottom="0px";const me=c.clientHeight-m.offsetTop-m.offsetHeight,Ee=Math.max(re,ve+(oe?j:0)+me+Z),b=de+Ee;a.style.height=b+"px"}else{const oe=M.length>0&&y===M[0].ref.current;a.style.top="0px";const Ee=Math.max(ee,O+m.offsetTop+(oe?B:0)+ve)+ge;a.style.height=Ee+"px",m.scrollTop=de-ee+m.offsetTop}a.style.margin=`${yt}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=C+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[p,i.trigger,i.valueNode,a,c,m,y,g,i.dir,r]);qe(()=>k(),[k]);const[S,E]=w.useState();qe(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const N=w.useCallback(T=>{T&&x.current===!0&&(k(),v?.(),x.current=!1)},[k,v]);return d.jsx(tk,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:N,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:d.jsx(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});pf.displayName=Q_;var ek="SelectPopperPosition",Ni=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=yt,...i}=e,s=No(n);return d.jsx(Dd,{...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)"}})});Ni.displayName=ek;var[tk,Es]=Zn(ln,{}),Ti="SelectViewport",mf=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=en(Ti,n),s=Es(Ti,n),a=Re(t,i.onViewportChange),l=w.useRef(0);return d.jsxs(d.Fragment,{children:[d.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}),d.jsx(Co.Slot,{scope:n,children:d.jsx(Ce.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:we(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=s;if(p?.current&&h){const f=Math.abs(l.current-u.scrollTop);if(f>0){const x=window.innerHeight-yt*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),g=Math.max(m,y);if(g<x){const v=g+f,k=Math.min(x,v),S=v-k;h.style.height=k+"px",h.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});mf.displayName=Ti;var gf="SelectGroup",[nk,rk]=Zn(gf),ok=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Nt();return d.jsx(nk,{scope:n,id:o,children:d.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ok.displayName=gf;var xf="SelectLabel",ik=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=rk(xf,n);return d.jsx(Ce.div,{id:o.id,...r,ref:t})});ik.displayName=xf;var to="SelectItem",[sk,yf]=Zn(to),vf=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Qt(to,n),l=en(to,n),c=a.value===r,[u,h]=w.useState(i??""),[p,f]=w.useState(!1),x=Re(t,v=>l.itemRefCallback?.(v,r,o)),m=Nt(),y=w.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 d.jsx(sk,{scope:n,value:r,disabled:o,textId:m,isSelected:c,onItemTextChange:w.useCallback(v=>{h(k=>k||(v?.textContent??"").trim())},[]),children:d.jsx(Co.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:d.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:x,onFocus:we(s.onFocus,()=>f(!0)),onBlur:we(s.onBlur,()=>f(!1)),onClick:we(s.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:we(s.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:we(s.onPointerDown,v=>{y.current=v.pointerType}),onPointerMove:we(s.onPointerMove,v=>{y.current=v.pointerType,o?l.onItemLeave?.():y.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,v=>{v.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:we(s.onKeyDown,v=>{l.searchRef?.current!==""&&v.key===" "||(V_.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});vf.displayName=to;var tr="SelectItemText",bf=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Qt(tr,n),a=en(tr,n),l=yf(tr,n),c=G_(tr,n),[u,h]=w.useState(null),p=Re(t,g=>h(g),l.onItemTextChange,g=>a.itemTextRefCallback?.(g,l.value,l.disabled)),f=u?.textContent,x=w.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=c;return qe(()=>(m(x),()=>y(x)),[m,y,x]),d.jsxs(d.Fragment,{children:[d.jsx(Ce.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?dr.createPortal(i.children,s.valueNode):null]})});bf.displayName=tr;var wf="SelectItemIndicator",_f=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yf(wf,n).isSelected?d.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});_f.displayName=wf;var ji="SelectScrollUpButton",kf=w.forwardRef((e,t)=>{const n=en(ji,e.__scopeSelect),r=Es(ji,e.__scopeSelect),[o,i]=w.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(Cf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});kf.displayName=ji;var Ai="SelectScrollDownButton",Sf=w.forwardRef((e,t)=>{const n=en(Ai,e.__scopeSelect),r=Es(Ai,e.__scopeSelect),[o,i]=w.useState(!1),s=Re(t,r.onScrollButtonChange);return qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?d.jsx(Cf,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});Sf.displayName=Ai;var Cf=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=en("SelectScrollButton",n),s=w.useRef(null),a=Eo(n),l=w.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),qe(()=>{a().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),d.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:we(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(o.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(o.onPointerLeave,()=>{l()})})}),ak="SelectSeparator",lk=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});lk.displayName=ak;var Ii="SelectArrow",ck=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=No(n),i=Qt(Ii,n),s=en(Ii,n);return i.open&&s.position==="popper"?d.jsx(Md,{...o,...r,ref:t}):null});ck.displayName=Ii;var uk="SelectBubbleInput",Ef=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=w.useRef(null),i=Re(r,o),s=Jw(t);return w.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const h=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(h)}},[s,t]),d.jsx(Ce.select,{...n,style:{...zu,...n.style},ref:i,defaultValue:t})});Ef.displayName=uk;function Nf(e){return e===""||e===void 0}function Tf(e){const t=Qe(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(s=>{const a=n.current+s;t(a),(function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function jf(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=dk(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function dk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fk=rf,hk=sf,pk=lf,mk=cf,gk=uf,xk=df,yk=mf,vk=vf,bk=bf,wk=_f,_k=kf,kk=Sf,Sk="Separator",ol="horizontal",Ck=["horizontal","vertical"],Af=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=ol,...o}=e,i=Ek(r)?r:ol,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return d.jsx(Ce.div,{"data-orientation":i,...a,...o,ref:t})});Af.displayName=Sk;function Ek(e){return Ck.includes(e)}var Nk=Af,To="Tabs",[Tk]=Bt(To,[Fd]),If=Fd(),[jk,Ns]=Tk(To),zf=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=ho(a),[h,p]=rn({prop:r,onChange:o,defaultProp:i??"",caller:To});return d.jsx(jk,{scope:n,baseId:Nt(),value:h,onValueChange:p,orientation:s,dir:u,activationMode:l,children:d.jsx(Ce.div,{dir:u,"data-orientation":s,...c,ref:t})})});zf.displayName=To;var Pf="TabsList",Rf=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ns(Pf,n),s=If(n);return d.jsx(N_,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:d.jsx(Ce.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});Rf.displayName=Pf;var Of="TabsTrigger",Df=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Ns(Of,n),a=If(n),l=Ff(s.baseId,r),c=$f(s.baseId,r),u=r===s.value;return d.jsx(T_,{asChild:!0,...a,focusable:!o,active:u,children:d.jsx(Ce.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:we(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=s.activationMode!=="manual";!u&&!o&&h&&s.onValueChange(r)})})})});Df.displayName=Of;var Mf="TabsContent",Lf=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Ns(Mf,n),l=Ff(a.baseId,r),c=$f(a.baseId,r),u=r===a.value,h=w.useRef(u);return w.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),d.jsx(mt,{present:o||u,children:({present:p})=>d.jsx(Ce.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&i})})});Lf.displayName=Mf;function Ff(e,t){return`${e}-trigger-${t}`}function $f(e,t){return`${e}-content-${t}`}var Ak=zf,Ik=Rf,zk=Df,Pk=Lf,[jo]=Bt("Tooltip",[_o]),Ao=_o(),Bf="TooltipProvider",Rk=700,zi="tooltip.open",[Ok,Ts]=jo(Bf),Uf=e=>{const{__scopeTooltip:t,delayDuration:n=Rk,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=w.useRef(!0),a=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(Ok,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:w.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Uf.displayName=Bf;var lr="Tooltip",[Dk,gr]=jo(lr),Zf=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Ts(lr,e.__scopeTooltip),c=Ao(t),[u,h]=w.useState(null),p=Nt(),f=w.useRef(0),x=s??l.disableHoverableContent,m=a??l.delayDuration,y=w.useRef(!1),[g,v]=rn({prop:r,defaultProp:o??!1,onChange:T=>{T?(l.onOpen(),document.dispatchEvent(new CustomEvent(zi))):l.onClose(),i?.(T)},caller:lr}),k=w.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),S=w.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y.current=!1,v(!0)},[v]),E=w.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),N=w.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=!0,v(!0),f.current=0},m)},[m,v]);return w.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),d.jsx(Rd,{...c,children:d.jsx(Dk,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:u,onTriggerChange:h,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayedRef.current?N():S()},[l.isOpenDelayedRef,N,S]),onTriggerLeave:w.useCallback(()=>{x?E():(window.clearTimeout(f.current),f.current=0)},[E,x]),onOpen:S,onClose:E,disableHoverableContent:x,children:n})})};Zf.displayName=lr;var Pi="TooltipTrigger",Vf=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=gr(Pi,n),i=Ts(Pi,n),s=Ao(n),a=w.useRef(null),l=Re(t,a,o.onTriggerChange),c=w.useRef(!1),u=w.useRef(!1),h=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),d.jsx(Od,{asChild:!0,...s,children:d.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:we(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:we(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:we(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:we(e.onBlur,o.onClose),onClick:we(e.onClick,o.onClose)})})});Vf.displayName=Pi;var js="TooltipPortal",[Mk,Lk]=jo(js,{forceMount:void 0}),Wf=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=gr(js,t);return d.jsx(Mk,{scope:t,forceMount:n,children:d.jsx(mt,{present:n||i.open,children:d.jsx(mo,{asChild:!0,container:o,children:r})})})};Wf.displayName=js;var Dn="TooltipContent",Hf=w.forwardRef((e,t)=>{const n=Lk(Dn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=gr(Dn,e.__scopeTooltip);return d.jsx(mt,{present:r||s.open,children:s.disableHoverableContent?d.jsx(qf,{side:o,...i,ref:t}):d.jsx(Fk,{side:o,...i,ref:t})})}),Fk=w.forwardRef((e,t)=>{const n=gr(Dn,e.__scopeTooltip),r=Ts(Dn,e.__scopeTooltip),o=w.useRef(null),i=Re(t,o),[s,a]=w.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:h}=r,p=w.useCallback(()=>{a(null),h(!1)},[h]),f=w.useCallback((x,m)=>{const y=x.currentTarget,g={x:x.clientX,y:x.clientY},v=Zk(g,y.getBoundingClientRect()),k=Vk(g,v),S=Wk(m.getBoundingClientRect()),E=qk([...k,...S]);a(E),h(!0)},[h]);return w.useEffect(()=>()=>p(),[p]),w.useEffect(()=>{if(l&&u){const x=y=>f(y,u),m=y=>f(y,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",m)}}},[l,u,f,p]),w.useEffect(()=>{if(s){const x=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},v=l?.contains(y)||u?.contains(y),k=!Hk(g,s);v?p():k&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,s,c,p]),d.jsx(qf,{...e,ref:i})}),[$k,Bk]=jo(lr,{isInside:!1}),Uk=c1("TooltipContent"),qf=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=gr(Dn,n),c=Ao(n),{onClose:u}=l;return w.useEffect(()=>(document.addEventListener(zi,u),()=>document.removeEventListener(zi,u)),[u]),w.useEffect(()=>{if(l.trigger){const h=p=>{p.target?.contains(l.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,u]),d.jsx(po,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:u,children:d.jsxs(Dd,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(Uk,{children:r}),d.jsx($k,{scope:n,isInside:!0,children:d.jsx(g1,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Hf.displayName=Dn;var Gf="TooltipArrow",Kf=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ao(n);return Bk(Gf,n).isInside?null:d.jsx(Md,{...o,...r,ref:t})});Kf.displayName=Gf;function Zk(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 Vk(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 Wk(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 Hk(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,h=l.x,p=l.y;u>r!=p>r&&n<(h-c)*(r-u)/(p-u)+c&&(o=!o)}return o}function qk(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),Gk(t)}function Gk(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 Kk=Uf,Jk=Zf,Yk=Vf,Xk=Wf,Qk=Hf,eS=Kf;const tS=ss("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 ct({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?a1:"span";return d.jsx(o,{"data-slot":"badge","data-variant":t,className:Se(tS({variant:t}),e),...r})}const nS={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function il(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function rS({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:i,apiFormat:s,expanded:a,onToggle:l,hideApiFormat:c=!1}){return d.jsxs("div",{role:"button",tabIndex:0,className:Se("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:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),l())},children:[a?d.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):d.jsx(Gt,{className:"size-4 text-muted-foreground shrink-0"}),d.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}),!c&&d.jsx(ct,{variant:"outline",className:Se("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:nS[s]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(os,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[il(t)," - ",il(n)]})]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(fu,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),d.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[d.jsx(hr,{className:"size-3 text-muted-foreground"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[d.jsx("span",{className:"text-blue-400",children:Je(o)})," / ",d.jsx("span",{className:"text-amber-400",children:Je(i)})]})]}),d.jsx("span",{className:"flex-1 min-w-0"})]})}function oS(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function iS(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 sS(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 aS(e){const t=new Map;for(const r of e){const o=sS(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 lS="x-anthropic-billing-header:";function cS(e){return e.trimStart().toLowerCase().startsWith(lS)}function sl(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function uS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function dS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=sl(e,"type"),n=sl(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:cS(n)}function fS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!uS(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(dS(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 hS=ss("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function ht({className:e,variant:t,size:n,...r}){return d.jsx("button",{"data-slot":"button",className:Se(hS({variant:t,size:n,className:e})),...r})}function pS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xS={};function al(e,t){return(xS.jsx?gS:mS).test(e)}const yS=/[ \t\n\f\r]/g;function vS(e){return typeof e=="object"?e.type==="text"?ll(e.value):!1:ll(e)}function ll(e){return e.replace(yS,"")===""}class xr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xr.prototype.normal={};xr.prototype.property={};xr.prototype.space=void 0;function Jf(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new xr(n,r,t)}function Ri(e){return e.toLowerCase()}class it{constructor(t,n){this.attribute=n,this.property=t}}it.prototype.attribute="";it.prototype.booleanish=!1;it.prototype.boolean=!1;it.prototype.commaOrSpaceSeparated=!1;it.prototype.commaSeparated=!1;it.prototype.defined=!1;it.prototype.mustUseProperty=!1;it.prototype.number=!1;it.prototype.overloadedBoolean=!1;it.prototype.property="";it.prototype.spaceSeparated=!1;it.prototype.space=void 0;let bS=0;const Ne=dn(),We=dn(),Oi=dn(),se=dn(),Oe=dn(),Tn=dn(),at=dn();function dn(){return 2**++bS}const Di=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ne,booleanish:We,commaOrSpaceSeparated:at,commaSeparated:Tn,number:se,overloadedBoolean:Oi,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Ko=Object.keys(Di);class As extends it{constructor(t,n,r,o){let i=-1;if(super(t,n),cl(this,"space",o),typeof r=="number")for(;++i<Ko.length;){const s=Ko[i];cl(this,Ko[i],(r&Di[s])===Di[s])}}}As.prototype.defined=!0;function cl(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new As(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Ri(r)]=r,n[Ri(i.attribute)]=r}return new xr(t,n,e.space)}const Yf=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:We,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:Oe,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:se,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:Oe,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:We,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Xf(e,t){return t in e?e[t]:t}function Qf(e,t){return Xf(e,t.toLowerCase())}const wS=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Tn,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:Ne,allowPaymentRequest:Ne,allowUserMedia:Ne,alt:null,as:null,async:Ne,autoCapitalize:null,autoComplete:Oe,autoFocus:Ne,autoPlay:Ne,blocking:Oe,capture:null,charSet:null,checked:Ne,cite:null,className:Oe,cols:se,colSpan:null,content:null,contentEditable:We,controls:Ne,controlsList:Oe,coords:se|Tn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ne,defer:Ne,dir:null,dirName:null,disabled:Ne,download:Oi,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ne,formTarget:null,headers:Oe,height:se,hidden:Oi,high:se,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:Ne,inputMode:null,integrity:null,is:null,isMap:Ne,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:Ne,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ne,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Ne,muted:Ne,name:null,nonce:null,noModule:Ne,noValidate:Ne,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ne,optimum:se,pattern:null,ping:Oe,placeholder:null,playsInline:Ne,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ne,referrerPolicy:null,rel:Oe,required:Ne,reversed:Ne,rows:se,rowSpan:se,sandbox:Oe,scope:null,scoped:Ne,seamless:Ne,selected:Ne,shadowRootClonable:Ne,shadowRootDelegatesFocus:Ne,shadowRootMode:null,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Ne,useMap:null,value:We,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ne,declare:Ne,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Ne,noHref:Ne,noShade:Ne,noWrap:Ne,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ne,disableRemotePlayback:Ne,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:Qf}),_S=Vn({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:at,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:Oe,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:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Ne,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,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:Tn,g2:Tn,glyphName:Tn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:at,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,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:se,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:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:at,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:at,rev:at,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:at,requiredFeatures:at,requiredFonts:at,requiredFormats:at,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:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:at,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:at,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:at,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Xf}),eh=Vn({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()}}),th=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qf}),nh=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),kS={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"},SS=/[A-Z]/g,ul=/-[a-z]/g,CS=/^data[-\w.:]+$/i;function ES(e,t){const n=Ri(t);let r=t,o=it;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&CS.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(ul,TS);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!ul.test(i)){let s=i.replace(SS,NS);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=As}return new o(r,t)}function NS(e){return"-"+e.toLowerCase()}function TS(e){return e.charAt(1).toUpperCase()}const jS=Jf([Yf,wS,eh,th,nh],"html"),Is=Jf([Yf,_S,eh,th,nh],"svg");function AS(e){return e.join(" ").trim()}var yn={},Jo,dl;function IS(){if(dl)return Jo;dl=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
|
+
`,c="/",u="*",h="",p="comment",f="declaration";function x(y,g){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];g=g||{};var v=1,k=1;function S(_){var O=_.match(t);O&&(v+=O.length);var J=_.lastIndexOf(l);k=~J?_.length-J:k+_.length}function E(){var _={line:v,column:k};return function(O){return O.position=new N(_),R(),O}}function N(_){this.start=_,this.end={line:v,column:k},this.source=g.source}N.prototype.content=y;function T(_){var O=new Error(g.source+":"+v+":"+k+": "+_);if(O.reason=_,O.filename=g.source,O.line=v,O.column=k,O.source=y,!g.silent)throw O}function P(_){var O=_.exec(y);if(O){var J=O[0];return S(J),y=y.slice(J.length),O}}function R(){P(n)}function D(_){var O;for(_=_||[];O=M();)O!==!1&&_.push(O);return _}function M(){var _=E();if(!(c!=y.charAt(0)||u!=y.charAt(1))){for(var O=2;h!=y.charAt(O)&&(u!=y.charAt(O)||c!=y.charAt(O+1));)++O;if(O+=2,h===y.charAt(O-1))return T("End of comment missing");var J=y.slice(2,O-2);return k+=2,S(J),y=y.slice(O),k+=2,_({type:p,comment:J})}}function C(){var _=E(),O=P(r);if(O){if(M(),!P(o))return T("property missing ':'");var J=P(i),Z=_({type:f,property:m(O[0].replace(e,h)),value:J?m(J[0].replace(e,h)):h});return P(s),Z}}function L(){var _=[];D(_);for(var O;O=C();)O!==!1&&(_.push(O),D(_));return _}return R(),L()}function m(y){return y?y.replace(a,h):h}return Jo=x,Jo}var fl;function zS(){if(fl)return yn;fl=1;var e=yn&&yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yn,"__esModule",{value:!0}),yn.default=n;const t=e(IS());function n(r,o){let i=null;if(!r||typeof r!="string")return i;const s=(0,t.default)(r),a=typeof o=="function";return s.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:u}=l;a?o(c,u,l):u&&(i=i||{},i[c]=u)}),i}return yn}var Kn={},hl;function PS(){if(hl)return Kn;hl=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,i=function(c){return!c||n.test(c)||e.test(c)},s=function(c,u){return u.toUpperCase()},a=function(c,u){return"".concat(u,"-")},l=function(c,u){return u===void 0&&(u={}),i(c)?c:(c=c.toLowerCase(),u.reactCompat?c=c.replace(o,a):c=c.replace(r,a),c.replace(t,s))};return Kn.camelCase=l,Kn}var Jn,pl;function RS(){if(pl)return Jn;pl=1;var e=Jn&&Jn.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(zS()),n=PS();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,Jn=r,Jn}var OS=RS();const DS=qi(OS),rh=oh("end"),zs=oh("start");function oh(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 MS(e){const t=zs(e),n=rh(e);if(t&&n)return{start:t,end:n}}function nr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ml(e.position):"start"in e||"end"in e?ml(e):"line"in e||"column"in e?Mi(e):""}function Mi(e){return gl(e&&e.line)+":"+gl(e&&e.column)}function ml(e){return Mi(e&&e.start)+"-"+Mi(e&&e.end)}function gl(e){return e&&typeof e=="number"?e:1}class Ye extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=nr(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ye.prototype.file="";Ye.prototype.name="";Ye.prototype.reason="";Ye.prototype.message="";Ye.prototype.stack="";Ye.prototype.column=void 0;Ye.prototype.line=void 0;Ye.prototype.ancestors=void 0;Ye.prototype.cause=void 0;Ye.prototype.fatal=void 0;Ye.prototype.place=void 0;Ye.prototype.ruleId=void 0;Ye.prototype.source=void 0;const Ps={}.hasOwnProperty,LS=new Map,FS=/[A-Z]/g,$S=new Set(["table","tbody","thead","tfoot","tr"]),BS=new Set(["td","th"]),ih="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function US(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=JS(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=KS(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"?Is:jS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=sh(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function sh(e,t,n){if(t.type==="element")return ZS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return VS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return HS(e,t,n);if(t.type==="mdxjsEsm")return WS(e,t);if(t.type==="root")return qS(e,t,n);if(t.type==="text")return GS(e,t)}function ZS(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Is,e.schema=o),e.ancestors.push(t);const i=lh(e,t.tagName,!1),s=YS(e,t);let a=Os(e,t);return $S.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!vS(l):!0})),ah(e,s,i,t),Rs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function VS(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)}cr(e,t.position)}function WS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);cr(e,t.position)}function HS(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=Is,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:lh(e,t.name,!0),s=XS(e,t),a=Os(e,t);return ah(e,s,i,t),Rs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function qS(e,t,n){const r={};return Rs(r,Os(e,t)),e.create(t,e.Fragment,r,n)}function GS(e,t){return t.value}function ah(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Rs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function KS(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function JS(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=zs(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 YS(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&Ps.call(t.properties,o)){const i=QS(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&BS.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 XS(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 cr(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 cr(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function Os(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:LS;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=sh(e,i,s);a!==void 0&&n.push(a)}return n}function QS(e,t,n){const r=ES(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pS(n):AS(n)),r.property==="style"){let o=typeof n=="object"?n:eC(e,String(n));return e.stylePropertyNameCase==="css"&&(o=tC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?kS[r.property]||r.property:r.attribute,n]}}function eC(e,t){try{return DS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Ye("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=ih+"#cannot-parse-style-attribute",o}}function lh(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 Ps.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);cr(e)}function cr(e,t){const n=new Ye("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ih+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tC(e){const t={};let n;for(n in e)Ps.call(e,n)&&(t[nC(n)]=e[n]);return t}function nC(e){let t=e.replace(FS,rC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rC(e){return"-"+e.toLowerCase()}const Yo={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"]},oC={};function iC(e,t){const n=oC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ch(e,r,o)}function ch(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 xl(e.children,t,n)}return Array.isArray(e)?xl(e,t,n):""}function xl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=ch(e[o],t,n);return r.join("")}function sC(e){return!!(e&&typeof e=="object")}const yl=document.createElement("i");function Ds(e){const t="&"+e+";";yl.innerHTML=t;const n=yl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function zt(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function ft(e,t){return e.length>0?(zt(e,e.length,0,t),e):t}const vl={}.hasOwnProperty;function aC(e){const t={};let n=-1;for(;++n<e.length;)lC(t,e[n]);return t}function lC(e,t){let n;for(n in t){const o=(vl.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){vl.call(o,s)||(o[s]=[]);const a=i[s];cC(o[s],Array.isArray(a)?a:a?[a]:[])}}}function cC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);zt(e,0,0,r)}function uh(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 jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ct=tn(/[A-Za-z]/),ut=tn(/[\dA-Za-z]/),uC=tn(/[#-'*+\--9=?A-Z^-~]/);function Li(e){return e!==null&&(e<32||e===127)}const Fi=tn(/\d/),dC=tn(/[\dA-Fa-f]/),fC=tn(/[!-/:-@[-`{-~]/);function ke(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function Pe(e){return e===-2||e===-1||e===32}const hC=tn(new RegExp("\\p{P}|\\p{S}","u")),pC=tn(/\s/);function tn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&ut(e.charCodeAt(n+1))&&ut(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function De(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return Pe(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const mC={tokenize:gC};function gC(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),De(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ke(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const xC={tokenize:yC},bl={tokenize:vC};function yC(e){const t=this,n=[];let r=0,o,i,s;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(k)}return c(k)}function l(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&v();const S=t.events.length;let E=S,N;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){N=t.events[E][1].end;break}g(r);let T=S;for(;T<t.events.length;)t.events[T][1].end={...N},T++;return zt(t.events,E+1,0,t.events.slice(S)),t.events.length=T,c(k)}return a(k)}function c(k){if(r===n.length){if(!o)return p(k);if(o.currentConstruct&&o.currentConstruct.concrete)return x(k);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bl,u,h)(k)}function u(k){return o&&v(),g(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(k)}function p(k){return t.containerState={},e.attempt(bl,f,x)(k)}function f(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function x(k){if(k===null){o&&v(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),m(k)}function m(k){if(k===null){y(e.exit("chunkFlow"),!0),g(0),e.consume(k);return}return ke(k)?(e.consume(k),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),m)}function y(k,S){const E=t.sliceStream(k);if(S&&E.push(null),k.previous=i,i&&(i.next=k),i=k,o.defineSkip(k.start),o.write(E),t.parser.lazy[k.start.line]){let N=o.events.length;for(;N--;)if(o.events[N][1].start.offset<s&&(!o.events[N][1].end||o.events[N][1].end.offset>s))return;const T=t.events.length;let P=T,R,D;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(R){D=t.events[P][1].end;break}R=!0}for(g(r),N=T;N<t.events.length;)t.events[N][1].end={...D},N++;zt(t.events,P+1,0,t.events.slice(T)),t.events.length=N}}function g(k){let S=n.length;for(;S-- >k;){const E=n[S];t.containerState=E[1],E[0].exit.call(t,e)}n.length=k}function v(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function vC(e,t,n){return De(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wl(e){if(e===null||rt(e)||pC(e))return 1;if(hC(e))return 2}function Ms(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 $i={name:"attention",resolveAll:bC,tokenize:wC};function bC(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};_l(h,-l),_l(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},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ft(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ft(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=ft(c,Ms(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ft(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=ft(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,zt(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function wC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=wl(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=wl(l),h=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?h:h&&(o||!p)),c._close=!!(i===42?p:p&&(u||!h)),t(l)}}function _l(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _C={name:"autolink",tokenize:kC};function kC(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 Ct(f)?(e.consume(f),s):f===64?n(f):c(f)}function s(f){return f===43||f===45||f===46||ut(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||ut(f))&&r++<32?(e.consume(f),a):(r=0,c(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||Li(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):uC(f)?(e.consume(f),c):n(f)}function u(f){return ut(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||ut(f))&&r++<63){const x=f===45?p:h;return e.consume(f),x}return n(f)}}const Io={partial:!0,tokenize:SC};function SC(e,t,n){return r;function r(i){return Pe(i)?De(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||ke(i)?t(i):n(i)}}const dh={continuation:{tokenize:EC},exit:NC,name:"blockQuote",tokenize:CC};function CC(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 Pe(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function EC(e,t,n){const r=this;return o;function o(s){return Pe(s)?De(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(dh,t,n)(s)}}function NC(e){e.exit("blockQuote")}const fh={name:"characterEscape",tokenize:TC};function TC(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 fC(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const hh={name:"characterReference",tokenize:jC};function jC(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"),c):(e.enter("characterReferenceValue"),i=31,s=ut,u(h))}function c(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=dC,u):(e.enter("characterReferenceValue"),i=7,s=Fi,u(h))}function u(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return s===ut&&!Ds(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),u):n(h)}}const kl={partial:!0,tokenize:IC},Sl={concrete:!0,name:"codeFenced",tokenize:AC};function AC(e,t,n){const r=this,o={partial:!0,tokenize:E};let i=0,s=0,a;return l;function l(N){return c(N)}function c(N){const T=r.events[r.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(N)}function u(N){return N===a?(s++,e.consume(N),u):s<3?n(N):(e.exit("codeFencedFenceSequence"),Pe(N)?De(e,h,"whitespace")(N):h(N))}function h(N){return N===null||ke(N)?(e.exit("codeFencedFence"),r.interrupt?t(N):e.check(kl,m,S)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(N))}function p(N){return N===null||ke(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(N)):Pe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),De(e,f,"whitespace")(N)):N===96&&N===a?n(N):(e.consume(N),p)}function f(N){return N===null||ke(N)?h(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||ke(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(N)):N===96&&N===a?n(N):(e.consume(N),x)}function m(N){return e.attempt(o,S,y)(N)}function y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),g}function g(N){return i>0&&Pe(N)?De(e,v,"linePrefix",i+1)(N):v(N)}function v(N){return N===null||ke(N)?e.check(kl,m,S)(N):(e.enter("codeFlowValue"),k(N))}function k(N){return N===null||ke(N)?(e.exit("codeFlowValue"),v(N)):(e.consume(N),k)}function S(N){return e.exit("codeFenced"),t(N)}function E(N,T,P){let R=0;return D;function D(O){return N.enter("lineEnding"),N.consume(O),N.exit("lineEnding"),M}function M(O){return N.enter("codeFencedFence"),Pe(O)?De(N,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):C(O)}function C(O){return O===a?(N.enter("codeFencedFenceSequence"),L(O)):P(O)}function L(O){return O===a?(R++,N.consume(O),L):R>=s?(N.exit("codeFencedFenceSequence"),Pe(O)?De(N,_,"whitespace")(O):_(O)):P(O)}function _(O){return O===null||ke(O)?(N.exit("codeFencedFence"),T(O)):P(O)}}}function IC(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 Xo={name:"codeIndented",tokenize:PC},zC={partial:!0,tokenize:RC};function PC(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),De(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):ke(c)?e.attempt(zC,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ke(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function RC(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):ke(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):De(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ke(s)?o(s):n(s)}}const OC={name:"codeText",previous:MC,resolve:DC,tokenize:LC};function DC(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 MC(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LC(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,u(h)):ke(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(h))}function c(h){return h===null||h===32||h===96||ke(h)?(e.exit("codeTextData"),l(h)):(e.consume(h),c)}function u(h){return h===96?(e.consume(h),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(i.type="codeTextData",c(h))}}class FC{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&&Yn(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),Yn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Yn(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);Yn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Yn(this.left,n.reverse())}}}function Yn(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 ph(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new FC(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,$C(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return zt(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function $C(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,h,p=-1,f=n,x=0,m=0;const y=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),h&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),p=y.length;p--;){const g=a.slice(y[p],y[p+1]),v=i.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),p=-1;++p<l.length;)c[x+l[p][0]]=x+l[p][1],x+=l[p][1]-l[p][0]-1;return c}const BC={resolve:ZC,tokenize:VC},UC={partial:!0,tokenize:WC};function ZC(e){return ph(e),e}function VC(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):ke(a)?e.check(UC,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 WC(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),De(e,i,"linePrefix")}function i(s){if(s===null||ke(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function mh(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=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||Li(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||ke(g)?n(g):(e.consume(g),g===92?x:f)}function x(g){return g===60||g===62||g===92?(e.consume(g),f):f(g)}function m(g){return!u&&(g===null||g===41||rt(g))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(g)):u<c&&g===40?(e.consume(g),u++,m):g===41?(e.consume(g),u--,m):g===null||g===32||g===40||Li(g)?n(g):(e.consume(g),g===92?y:m)}function y(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function gh(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(o),e.consume(f),e.exit(o),e.enter(i),u}function u(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):ke(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||ke(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!Pe(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,h):h(f)}}function xh(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):ke(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),De(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||ke(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?h:u)}function h(p){return p===s||p===92?(e.consume(p),u):u(p)}}function rr(e,t){let n;return r;function r(o){return ke(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Pe(o)?De(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const HC={name:"definition",tokenize:GC},qC={partial:!0,tokenize:KC};function GC(e,t,n){const r=this;let o;return i;function i(f){return e.enter("definition"),s(f)}function s(f){return gh.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=jn(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 rt(f)?rr(e,c)(f):c(f)}function c(f){return mh(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(qC,h,h)(f)}function h(f){return Pe(f)?De(e,p,"whitespace")(f):p(f)}function p(f){return f===null||ke(f)?(e.exit("definition"),r.parser.defined.push(o),t(f)):n(f)}}function KC(e,t,n){return r;function r(a){return rt(a)?rr(e,o)(a):n(a)}function o(a){return xh(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Pe(a)?De(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ke(a)?t(a):n(a)}}const JC={name:"hardBreakEscape",tokenize:YC};function YC(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return ke(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const XC={name:"headingAtx",resolve:QC,tokenize:eE};function QC(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zt(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function eE(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||rt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ke(u)?(e.exit("atxHeading"),t(u)):Pe(u)?De(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||rt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const tE=["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"],Cl=["pre","script","style","textarea"],nE={concrete:!0,name:"htmlFlow",resolveTo:iE,tokenize:sE},rE={partial:!0,tokenize:lE},oE={partial:!0,tokenize:aE};function iE(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 c;function c(j){return u(j)}function u(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),p):j===47?(e.consume(j),i=!0,m):j===63?(e.consume(j),o=3,r.interrupt?t:A):Ct(j)?(e.consume(j),s=String.fromCharCode(j),y):n(j)}function p(j){return j===45?(e.consume(j),o=2,f):j===91?(e.consume(j),o=5,a=0,x):Ct(j)?(e.consume(j),o=4,r.interrupt?t:A):n(j)}function f(j){return j===45?(e.consume(j),r.interrupt?t:A):n(j)}function x(j){const ee="CDATA[";return j===ee.charCodeAt(a++)?(e.consume(j),a===ee.length?r.interrupt?t:C:x):n(j)}function m(j){return Ct(j)?(e.consume(j),s=String.fromCharCode(j),y):n(j)}function y(j){if(j===null||j===47||j===62||rt(j)){const ee=j===47,re=s.toLowerCase();return!ee&&!i&&Cl.includes(re)?(o=1,r.interrupt?t(j):C(j)):tE.includes(s.toLowerCase())?(o=6,ee?(e.consume(j),g):r.interrupt?t(j):C(j)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(j):i?v(j):k(j))}return j===45||ut(j)?(e.consume(j),s+=String.fromCharCode(j),y):n(j)}function g(j){return j===62?(e.consume(j),r.interrupt?t:C):n(j)}function v(j){return Pe(j)?(e.consume(j),v):D(j)}function k(j){return j===47?(e.consume(j),D):j===58||j===95||Ct(j)?(e.consume(j),S):Pe(j)?(e.consume(j),k):D(j)}function S(j){return j===45||j===46||j===58||j===95||ut(j)?(e.consume(j),S):E(j)}function E(j){return j===61?(e.consume(j),N):Pe(j)?(e.consume(j),E):k(j)}function N(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),l=j,T):Pe(j)?(e.consume(j),N):P(j)}function T(j){return j===l?(e.consume(j),l=null,R):j===null||ke(j)?n(j):(e.consume(j),T)}function P(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||rt(j)?E(j):(e.consume(j),P)}function R(j){return j===47||j===62||Pe(j)?k(j):n(j)}function D(j){return j===62?(e.consume(j),M):n(j)}function M(j){return j===null||ke(j)?C(j):Pe(j)?(e.consume(j),M):n(j)}function C(j){return j===45&&o===2?(e.consume(j),J):j===60&&o===1?(e.consume(j),Z):j===62&&o===4?(e.consume(j),U):j===63&&o===3?(e.consume(j),A):j===93&&o===5?(e.consume(j),q):ke(j)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(rE,B,L)(j)):j===null||ke(j)?(e.exit("htmlFlowData"),L(j)):(e.consume(j),C)}function L(j){return e.check(oE,_,B)(j)}function _(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),O}function O(j){return j===null||ke(j)?L(j):(e.enter("htmlFlowData"),C(j))}function J(j){return j===45?(e.consume(j),A):C(j)}function Z(j){return j===47?(e.consume(j),s="",W):C(j)}function W(j){if(j===62){const ee=s.toLowerCase();return Cl.includes(ee)?(e.consume(j),U):C(j)}return Ct(j)&&s.length<8?(e.consume(j),s+=String.fromCharCode(j),W):C(j)}function q(j){return j===93?(e.consume(j),A):C(j)}function A(j){return j===62?(e.consume(j),U):j===45&&o===2?(e.consume(j),A):C(j)}function U(j){return j===null||ke(j)?(e.exit("htmlFlowData"),B(j)):(e.consume(j),U)}function B(j){return e.exit("htmlFlow"),t(j)}}function aE(e,t,n){const r=this;return o;function o(s){return ke(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 lE(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Io,t,n)}}const cE={name:"htmlText",tokenize:uE};function uE(e,t,n){const r=this;let o,i,s;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),c):A===47?(e.consume(A),E):A===63?(e.consume(A),k):Ct(A)?(e.consume(A),P):n(A)}function c(A){return A===45?(e.consume(A),u):A===91?(e.consume(A),i=0,x):Ct(A)?(e.consume(A),v):n(A)}function u(A){return A===45?(e.consume(A),f):n(A)}function h(A){return A===null?n(A):A===45?(e.consume(A),p):ke(A)?(s=h,Z(A)):(e.consume(A),h)}function p(A){return A===45?(e.consume(A),f):h(A)}function f(A){return A===62?J(A):A===45?p(A):h(A)}function x(A){const U="CDATA[";return A===U.charCodeAt(i++)?(e.consume(A),i===U.length?m:x):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),y):ke(A)?(s=m,Z(A)):(e.consume(A),m)}function y(A){return A===93?(e.consume(A),g):m(A)}function g(A){return A===62?J(A):A===93?(e.consume(A),g):m(A)}function v(A){return A===null||A===62?J(A):ke(A)?(s=v,Z(A)):(e.consume(A),v)}function k(A){return A===null?n(A):A===63?(e.consume(A),S):ke(A)?(s=k,Z(A)):(e.consume(A),k)}function S(A){return A===62?J(A):k(A)}function E(A){return Ct(A)?(e.consume(A),N):n(A)}function N(A){return A===45||ut(A)?(e.consume(A),N):T(A)}function T(A){return ke(A)?(s=T,Z(A)):Pe(A)?(e.consume(A),T):J(A)}function P(A){return A===45||ut(A)?(e.consume(A),P):A===47||A===62||rt(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),J):A===58||A===95||Ct(A)?(e.consume(A),D):ke(A)?(s=R,Z(A)):Pe(A)?(e.consume(A),R):J(A)}function D(A){return A===45||A===46||A===58||A===95||ut(A)?(e.consume(A),D):M(A)}function M(A){return A===61?(e.consume(A),C):ke(A)?(s=M,Z(A)):Pe(A)?(e.consume(A),M):R(A)}function C(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),o=A,L):ke(A)?(s=C,Z(A)):Pe(A)?(e.consume(A),C):(e.consume(A),_)}function L(A){return A===o?(e.consume(A),o=void 0,O):A===null?n(A):ke(A)?(s=L,Z(A)):(e.consume(A),L)}function _(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||rt(A)?R(A):(e.consume(A),_)}function O(A){return A===47||A===62||rt(A)?R(A):n(A)}function J(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function Z(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),W}function W(A){return Pe(A)?De(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):q(A)}function q(A){return e.enter("htmlTextData"),s(A)}}const Ls={name:"labelEnd",resolveAll:pE,resolveTo:mE,tokenize:gE},dE={tokenize:xE},fE={tokenize:yE},hE={tokenize:vE};function pE(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&zt(e,0,e.length,n),e}function mE(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=ft(a,e.slice(i+1,i+r+3)),a=ft(a,[["enter",u,t]]),a=ft(a,Ms(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=ft(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ft(a,e.slice(s+1)),a=ft(a,[["exit",l,t]]),zt(e,i,e.length,a),e}function gE(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(jn(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(dE,u,s?u:h)(p):p===91?e.attempt(fE,u,s?c:h)(p):s?u(p):h(p)}function c(p){return e.attempt(hE,u,h)(p)}function u(p){return t(p)}function h(p){return i._balanced=!0,n(p)}}function xE(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 rt(h)?rr(e,i)(h):i(h)}function i(h){return h===41?u(h):mh(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return rt(h)?rr(e,l)(h):u(h)}function a(h){return n(h)}function l(h){return h===34||h===39||h===40?xh(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):u(h)}function c(h){return rt(h)?rr(e,u)(h):u(h)}function u(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function yE(e,t,n){const r=this;return o;function o(a){return gh.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function vE(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 bE={name:"labelStartImage",resolveAll:Ls.resolveAll,tokenize:wE};function wE(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:Ls.resolveAll,tokenize:kE};function kE(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 Qo={name:"lineEnding",tokenize:SE};function SE(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),De(e,t,"linePrefix")}}const Br={name:"thematicBreak",tokenize:CE};function CE(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ke(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Pe(c)?De(e,a,"whitespace")(c):a(c))}}const tt={continuation:{tokenize:jE},exit:IE,name:"list",tokenize:TE},EE={partial:!0,tokenize:zE},NE={partial:!0,tokenize:AE};function TE(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(f){const x=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Fi(f)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Br,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Fi(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"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Io,r.interrupt?n:u,e.attempt(EE,p,h))}function u(f){return r.containerState.initialBlankLine=!0,i++,p(f)}function h(f){return Pe(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 jE(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Io,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,De(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Pe(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(NE,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,De(e,e.attempt(tt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function AE(e,t,n){const r=this;return De(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function IE(e){e.exit(this.containerState.type)}function zE(e,t,n){const r=this;return De(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Pe(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const El={name:"setextUnderline",resolveTo:PE,tokenize:RE};function PE(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 RE(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,h;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){h=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Pe(c)?De(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ke(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const OE={tokenize:DE};function DE(e){const t=this,n=e.attempt(Io,r,e.attempt(this.parser.constructs.flowInitial,o,De(e,e.attempt(this.parser.constructs.flow,o,e.attempt(BC,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 ME={resolveAll:vh()},LE=yh("string"),FE=yh("text");function yh(e){return{resolveAll:vh(e==="text"?$E:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const h=o[u];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 vh(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 $E(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const BE={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:dh},UE={91:HC},ZE={[-2]:Xo,[-1]:Xo,32:Xo},VE={35:XC,42:Br,45:[El,Br],60:nE,61:El,95:Br,96:Sl,126:Sl},WE={38:hh,92:fh},HE={[-5]:Qo,[-4]:Qo,[-3]:Qo,33:bE,38:hh,42:$i,60:[_C,cE],91:_E,92:[JC,fh],93:Ls,95:$i,96:OC},qE={null:[$i,ME]},GE={null:[42,95]},KE={null:[]},JE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:GE,contentInitial:UE,disable:KE,document:BE,flow:VE,flowInitial:ZE,insideSpan:qE,string:WE,text:HE},Symbol.toStringTag,{value:"Module"}));function YE(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:T(E),check:T(N),consume:v,enter:k,exit:S,interrupt:T(N,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function h(M){return s=ft(s,M),y(),s[s.length-1]!==null?[]:(P(t,0),c.events=Ms(i,c.events,c),c.events)}function p(M,C){return QE(f(M),C)}function f(M){return XE(s,M)}function x(){const{_bufferIndex:M,_index:C,line:L,column:_,offset:O}=r;return{_bufferIndex:M,_index:C,line:L,column:_,offset:O}}function m(M){o[M.line]=M.column,D()}function y(){let M;for(;r._index<s.length;){const C=s[r._index];if(typeof C=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<C.length;)g(C.charCodeAt(r._bufferIndex));else g(C)}}function g(M){u=u(M)}function v(M){ke(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,D()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function k(M,C){const L=C||{};return L.type=M,L.start=x(),c.events.push(["enter",L,c]),a.push(L),L}function S(M){const C=a.pop();return C.end=x(),c.events.push(["exit",C,c]),C}function E(M,C){P(M,C.from)}function N(M,C){C.restore()}function T(M,C){return L;function L(_,O,J){let Z,W,q,A;return Array.isArray(_)?B(_):"tokenize"in _?B([_]):U(_);function U(ve){return ie;function ie(de){const ge=de!==null&&ve[de],te=de!==null&&ve.null,oe=[...Array.isArray(ge)?ge:ge?[ge]:[],...Array.isArray(te)?te:te?[te]:[]];return B(oe)(de)}}function B(ve){return Z=ve,W=0,ve.length===0?J:j(ve[W])}function j(ve){return ie;function ie(de){return A=R(),q=ve,ve.partial||(c.currentConstruct=ve),ve.name&&c.parser.constructs.disable.null.includes(ve.name)?re():ve.tokenize.call(C?Object.assign(Object.create(c),C):c,l,ee,re)(de)}}function ee(ve){return M(q,A),O}function re(ve){return A.restore(),++W<Z.length?j(Z[W]):J}}}function P(M,C){M.resolveAll&&!i.includes(M)&&i.push(M),M.resolve&&zt(c.events,C,c.events.length-C,M.resolve(c.events.slice(C),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function R(){const M=x(),C=c.previous,L=c.currentConstruct,_=c.events.length,O=Array.from(a);return{from:_,restore:J};function J(){r=M,c.previous=C,c.currentConstruct=L,c.events.length=_,a=O,D()}}function D(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function XE(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 QE(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 GE(e){const r={constructs:tC([VE,...(e||{}).extensions||[]]),content:o(cC),defined:[],document:o(dC),flow:o(jE),lazy:{},string:o(zE),text:o(PE)};return r;function o(i){return s;function s(a){return WE(r,i,a)}}}function KE(e){for(;!fh(e););return e}const Nl=/[\0\t\n\r]/g;function JE(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,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(Nl.lastIndex=h,c=Nl.exec(i),p=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(p),!c){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(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const YE=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function XE(e){return e.replace(YE,QE)}function QE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return lh(n.slice(i?2:1),i?16:10)}return Ds(n)||e}const yh={}.hasOwnProperty;function e3(e,t,n){return typeof t!="string"&&(n=t,t=void 0),t3(n)(KE(GE(n).document().write(JE()(e,t,!0))))}function t3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(F),autolinkProtocol:O,autolinkEmail:O,atxHeading:i(K),blockQuote:i(te),characterEscape:O,characterReference:O,codeFenced:i(oe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(oe,s),codeText:i(me,s),codeTextData:O,data:O,codeFlowValue:O,definition:i(Ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(b),hardBreakEscape:i(H),hardBreakTrailing:i(H),htmlFlow:i(z,s),htmlFlowData:O,htmlText:i(z,s),htmlTextData:O,image:i(I),label:s,link:i(F),listItem:i(ne),listItemValue:p,listOrdered:i(X,h),listUnordered:i(X),paragraph:i(V),reference:T,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(K),strong:i(ae),thematicBreak:i(le)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ge,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ve,characterReference:ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:x,codeFlowValue:P,codeIndented:l(g),codeText:l(D),codeTextData:P,data:P,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(E),hardBreakTrailing:l(E),htmlFlow:l(M),htmlFlowData:P,htmlText:l(_),htmlTextData:P,image:l(Z),label:q,labelText:W,lineEnding:L,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:j,resourceTitleString:U,resource:B,setextHeading:l(R),setextHeadingLineSequence:A,setextHeadingText:N,strong:l(),thematicBreak:l()}};vh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let Q={type:"root",children:[]};const ue={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},be=[];let Ie=-1;for(;++Ie<$.length;)if($[Ie][1].type==="listOrdered"||$[Ie][1].type==="listUnordered")if($[Ie][0]==="enter")be.push(Ie);else{const Ze=be.pop();Ie=o($,Ze,Ie)}for(Ie=-1;++Ie<$.length;){const Ze=t[$[Ie][0]];yh.call(Ze,$[Ie][1].type)&&Ze[$[Ie][1].type].call(Object.assign({sliceSerialize:$[Ie][2].sliceSerialize},ue),$[Ie][1])}if(ue.tokenStack.length>0){const Ze=ue.tokenStack[ue.tokenStack.length-1];(Ze[1]||Tl).call(ue,void 0,Ze[0])}for(Q.position={start:Zt($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Zt($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)Q=t.transforms[Ie](Q)||Q;return Q}function o($,Q,ue){let be=Q-1,Ie=-1,Ze=!1,st,ze,_t,Ot;for(;++be<=ue;){const Be=$[be];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?Ie++:Ie--,Ot=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(st&&!Ot&&!Ie&&!_t&&(_t=be),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!Ie&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||Ie===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(st){let Dt=be;for(ze=void 0;Dt--;){const xt=$[Dt];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;ze&&($[ze][1].type="lineEndingBlank",Ze=!0),xt[1].type="lineEnding",ze=Dt}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}_t&&(!ze||_t<ze)&&(st._spread=!0),st.end=Object.assign({},ze?$[ze][1].start:Be[1].end),$.splice(ze||be,0,["exit",st,Be[2]]),be++,ue++}if(Be[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};st=Dt,$.splice(be,0,["enter",Dt,Be[2]]),be++,ue++,_t=void 0,Ot=!0}}}return $[Q][1]._spread=Ze,ue}function i($,Q){return ue;function ue(be){a.call(this,$(be),be),Q&&Q.call(this,be)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,Q,ue){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([Q,ue||void 0]),$.position={start:Zt(Q.start),end:void 0}}function l($){return Q;function Q(ue){$&&$.call(this,ue),c.call(this,ue)}}function c($,Q){const ue=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==$.type&&(Q?Q.call(this,$,be[0]):(be[1]||Tl).call(this,$,be[0]));else throw new Error("Cannot close `"+$.type+"` ("+nr({start:$.start,end:$.end})+"): it’s not open");ue.position.end=Zt($.end)}function u(){return QS(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function f(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=$}function x(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=$}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$.replace(/(\r?\n|\r)$/g,"")}function v($){const Q=this.resume(),ue=this.stack[this.stack.length-1];ue.label=Q,ue.identifier=jn(this.sliceSerialize($)).toLowerCase()}function k(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.title=$}function S(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.url=$}function C($){const Q=this.stack[this.stack.length-1];if(!Q.depth){const ue=this.sliceSerialize($).length;Q.depth=ue}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function A($){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function O($){const ue=this.stack[this.stack.length-1].children;let be=ue[ue.length-1];(!be||be.type!=="text")&&(be=fe(),be.position={start:Zt($.start),end:void 0},ue.push(be)),this.stack.push(be)}function P($){const Q=this.stack.pop();Q.value+=this.sliceSerialize($),Q.position.end=Zt($.end)}function L($){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=Q.children[Q.children.length-1];ue.position.end=Zt($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(O.call(this,$),P.call(this,$))}function E(){this.data.atHardBreak=!0}function M(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function _(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function D(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function J(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Q,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function Z(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Q,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function W($){const Q=this.sliceSerialize($),ue=this.stack[this.stack.length-2];ue.label=XE(Q),ue.identifier=jn(Q).toLowerCase()}function q(){const $=this.stack[this.stack.length-1],Q=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const be=$.children;ue.children=be}else ue.alt=Q}function j(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.url=$}function U(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.title=$}function B(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function ee($){const Q=this.resume(),ue=this.stack[this.stack.length-1];ue.label=Q,ue.identifier=jn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function re($){this.data.characterReferenceType=$.type}function ve($){const Q=this.sliceSerialize($),ue=this.data.characterReferenceType;let be;ue?(be=lh(Q,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=Ds(Q);const Ie=this.stack[this.stack.length-1];Ie.value+=be}function ie($){const Q=this.stack.pop();Q.position.end=Zt($.end)}function de($){P.call(this,$);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize($)}function ge($){P.call(this,$);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize($)}function te(){return{type:"blockquote",children:[]}}function oe(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function b(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function z(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function X($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ne($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function V(){return{type:"paragraph",children:[]}}function ae(){return{type:"strong",children:[]}}function fe(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function Zt(e){return{line:e.line,column:e.column,offset:e.offset}}function vh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?vh(e,r):n3(e,r)}}function n3(e,t){let n;for(n in t)if(yh.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 Tl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is still open")}function r3(e){const t=this;t.parser=n;function n(r){return e3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function o3(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 i3(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 e3(e){const r={constructs:aC([JE,...(e||{}).extensions||[]]),content:o(mC),defined:[],document:o(xC),flow:o(OE),lazy:{},string:o(LE),text:o(FE)};return r;function o(i){return s;function s(a){return YE(r,i,a)}}}function t3(e){for(;!ph(e););return e}const Nl=/[\0\t\n\r]/g;function n3(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,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(Nl.lastIndex=h,c=Nl.exec(i),p=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(p),!c){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(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const r3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function o3(e){return e.replace(r3,i3)}function i3(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return uh(n.slice(i?2:1),i?16:10)}return Ds(n)||e}const bh={}.hasOwnProperty;function s3(e,t,n){return typeof t!="string"&&(n=t,t=void 0),a3(n)(t3(e3(n).document().write(n3()(e,t,!0))))}function a3(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(F),autolinkProtocol:R,autolinkEmail:R,atxHeading:i(K),blockQuote:i(te),characterEscape:R,characterReference:R,codeFenced:i(oe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(oe,s),codeText:i(me,s),codeTextData:R,data:R,codeFlowValue:R,definition:i(Ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(b),hardBreakEscape:i(H),hardBreakTrailing:i(H),htmlFlow:i(z,s),htmlFlowData:R,htmlText:i(z,s),htmlTextData:R,image:i(I),label:s,link:i(F),listItem:i(ne),listItemValue:p,listOrdered:i(X,h),listUnordered:i(X),paragraph:i(V),reference:j,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(K),strong:i(ae),thematicBreak:i(le)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:ge,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ve,characterReference:ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:x,codeFlowValue:D,codeIndented:l(g),codeText:l(O),codeTextData:D,data:D,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:k,emphasis:l(),hardBreakEscape:l(C),hardBreakTrailing:l(C),htmlFlow:l(L),htmlFlowData:D,htmlText:l(_),htmlTextData:D,image:l(Z),label:q,labelText:W,lineEnding:M,link:l(J),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:A,resourceTitleString:U,resource:B,setextHeading:l(P),setextHeadingLineSequence:T,setextHeadingText:N,strong:l(),thematicBreak:l()}};wh(t,(e||{}).mdastExtensions||[]);const n={};return r;function r($){let Q={type:"root",children:[]};const ue={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},be=[];let Ie=-1;for(;++Ie<$.length;)if($[Ie][1].type==="listOrdered"||$[Ie][1].type==="listUnordered")if($[Ie][0]==="enter")be.push(Ie);else{const Ze=be.pop();Ie=o($,Ze,Ie)}for(Ie=-1;++Ie<$.length;){const Ze=t[$[Ie][0]];bh.call(Ze,$[Ie][1].type)&&Ze[$[Ie][1].type].call(Object.assign({sliceSerialize:$[Ie][2].sliceSerialize},ue),$[Ie][1])}if(ue.tokenStack.length>0){const Ze=ue.tokenStack[ue.tokenStack.length-1];(Ze[1]||Tl).call(ue,void 0,Ze[0])}for(Q.position={start:Zt($.length>0?$[0][1].start:{line:1,column:1,offset:0}),end:Zt($.length>0?$[$.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)Q=t.transforms[Ie](Q)||Q;return Q}function o($,Q,ue){let be=Q-1,Ie=-1,Ze=!1,st,ze,_t,Ot;for(;++be<=ue;){const Be=$[be];switch(Be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Be[0]==="enter"?Ie++:Ie--,Ot=void 0;break}case"lineEndingBlank":{Be[0]==="enter"&&(st&&!Ot&&!Ie&&!_t&&(_t=be),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=void 0}if(!Ie&&Be[0]==="enter"&&Be[1].type==="listItemPrefix"||Ie===-1&&Be[0]==="exit"&&(Be[1].type==="listUnordered"||Be[1].type==="listOrdered")){if(st){let Dt=be;for(ze=void 0;Dt--;){const xt=$[Dt];if(xt[1].type==="lineEnding"||xt[1].type==="lineEndingBlank"){if(xt[0]==="exit")continue;ze&&($[ze][1].type="lineEndingBlank",Ze=!0),xt[1].type="lineEnding",ze=Dt}else if(!(xt[1].type==="linePrefix"||xt[1].type==="blockQuotePrefix"||xt[1].type==="blockQuotePrefixWhitespace"||xt[1].type==="blockQuoteMarker"||xt[1].type==="listItemIndent"))break}_t&&(!ze||_t<ze)&&(st._spread=!0),st.end=Object.assign({},ze?$[ze][1].start:Be[1].end),$.splice(ze||be,0,["exit",st,Be[2]]),be++,ue++}if(Be[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},Be[1].start),end:void 0};st=Dt,$.splice(be,0,["enter",Dt,Be[2]]),be++,ue++,_t=void 0,Ot=!0}}}return $[Q][1]._spread=Ze,ue}function i($,Q){return ue;function ue(be){a.call(this,$(be),be),Q&&Q.call(this,be)}}function s(){this.stack.push({type:"fragment",children:[]})}function a($,Q,ue){this.stack[this.stack.length-1].children.push($),this.stack.push($),this.tokenStack.push([Q,ue||void 0]),$.position={start:Zt(Q.start),end:void 0}}function l($){return Q;function Q(ue){$&&$.call(this,ue),c.call(this,ue)}}function c($,Q){const ue=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==$.type&&(Q?Q.call(this,$,be[0]):(be[1]||Tl).call(this,$,be[0]));else throw new Error("Cannot close `"+$.type+"` ("+nr({start:$.start,end:$.end})+"): it’s not open");ue.position.end=Zt($.end)}function u(){return iC(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p($){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize($),10),this.data.expectingFirstListItemValue=void 0}}function f(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=$}function x(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=$}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$.replace(/(\r?\n|\r)$/g,"")}function v($){const Q=this.resume(),ue=this.stack[this.stack.length-1];ue.label=Q,ue.identifier=jn(this.sliceSerialize($)).toLowerCase()}function k(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.title=$}function S(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.url=$}function E($){const Q=this.stack[this.stack.length-1];if(!Q.depth){const ue=this.sliceSerialize($).length;Q.depth=ue}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function T($){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize($).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function R($){const ue=this.stack[this.stack.length-1].children;let be=ue[ue.length-1];(!be||be.type!=="text")&&(be=fe(),be.position={start:Zt($.start),end:void 0},ue.push(be)),this.stack.push(be)}function D($){const Q=this.stack.pop();Q.value+=this.sliceSerialize($),Q.position.end=Zt($.end)}function M($){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=Q.children[Q.children.length-1];ue.position.end=Zt($.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(R.call(this,$),D.call(this,$))}function C(){this.data.atHardBreak=!0}function L(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function _(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function O(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.value=$}function J(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Q,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function Z(){const $=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";$.type+="Reference",$.referenceType=Q,delete $.url,delete $.title}else delete $.identifier,delete $.label;this.data.referenceType=void 0}function W($){const Q=this.sliceSerialize($),ue=this.stack[this.stack.length-2];ue.label=o3(Q),ue.identifier=jn(Q).toLowerCase()}function q(){const $=this.stack[this.stack.length-1],Q=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const be=$.children;ue.children=be}else ue.alt=Q}function A(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.url=$}function U(){const $=this.resume(),Q=this.stack[this.stack.length-1];Q.title=$}function B(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function ee($){const Q=this.resume(),ue=this.stack[this.stack.length-1];ue.label=Q,ue.identifier=jn(this.sliceSerialize($)).toLowerCase(),this.data.referenceType="full"}function re($){this.data.characterReferenceType=$.type}function ve($){const Q=this.sliceSerialize($),ue=this.data.characterReferenceType;let be;ue?(be=uh(Q,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=Ds(Q);const Ie=this.stack[this.stack.length-1];Ie.value+=be}function ie($){const Q=this.stack.pop();Q.position.end=Zt($.end)}function de($){D.call(this,$);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize($)}function ge($){D.call(this,$);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize($)}function te(){return{type:"blockquote",children:[]}}function oe(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function b(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function H(){return{type:"break"}}function z(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function F(){return{type:"link",title:null,url:"",children:[]}}function X($){return{type:"list",ordered:$.type==="listOrdered",start:null,spread:$._spread,children:[]}}function ne($){return{type:"listItem",spread:$._spread,checked:null,children:[]}}function V(){return{type:"paragraph",children:[]}}function ae(){return{type:"strong",children:[]}}function fe(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function Zt(e){return{line:e.line,column:e.column,offset:e.offset}}function wh(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?wh(e,r):l3(e,r)}}function l3(e,t){let n;for(n in t)if(bh.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 Tl(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nr({start:t.start,end:t.end})+") is still open")}function c3(e){const t=this;t.parser=n;function n(r){return s3(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function u3(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 d3(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
88
|
+
`}]}function f3(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 h3(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p3(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m3(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Wn(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function g3(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 x3(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _h(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 y3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _h(e,t);const o={src:Wn(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 v3(e,t){const n={src:Wn(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 b3(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 w3(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _h(e,t);const o={href:Wn(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 _3(e,t){const n={href:Wn(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 k3(e,t,n){const r=e.all(t),o=n?S3(n):kh(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let h;u&&u.type==="element"&&u.tagName==="p"?h=u:(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 u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
|
|
90
90
|
`}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
|
|
91
|
-
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function
|
|
91
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function S3(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=kh(n[r])}return t}function kh(e){const t=e.spread;return t??e.children.length>1}function C3(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 E3(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function N3(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function T3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j3(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=zs(t.children[1]),l=rh(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 A3(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const h=t.children[l],p={},f=s?s[l]:void 0;f&&(p.align=f);let x={type:"element",tagName:i,properties:p,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),c.push(x)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function I3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const jl=9,Al=32;function z3(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Il(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Il(t.slice(o),o>0,!1)),i.join("")}function Il(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===jl||i===Al;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===jl||i===Al;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function P3(e,t){const n={type:"text",value:z3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function R3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const O3={blockquote:u3,break:d3,code:f3,delete:h3,emphasis:p3,footnoteReference:m3,heading:g3,html:x3,imageReference:y3,image:v3,inlineCode:b3,linkReference:w3,link:_3,listItem:k3,list:C3,paragraph:E3,root:N3,strong:T3,table:j3,tableCell:I3,tableRow:A3,text:P3,thematicBreak:R3,toml:Pr,yaml:Pr,definition:Pr,footnoteDefinition:Pr};function Pr(){}const Sh=-1,zo=0,or=1,no=2,Fs=3,$s=4,Bs=5,Us=6,Ch=7,Eh=8,zl=typeof self=="object"?self:globalThis,D3=(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 zo:case Sh:return n(s,o);case or:{const a=n([],o);for(const l of s)a.push(r(l));return a}case no:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case Fs:return n(new Date(s),o);case $s:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case Bs:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case Us:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case Ch:{const{name:a,message:l}=s;return n(new zl[a](l),o)}case Eh: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 zl[i](s),o)};return r},Pl=e=>D3(new Map,e)(0),vn="",{toString:M3}={},{keys:L3}=Object,Xn=e=>{const t=typeof e;if(t!=="object"||!e)return[zo,t];const n=M3.call(e).slice(8,-1);switch(n){case"Array":return[or,vn];case"Object":return[no,vn];case"Date":return[Fs,vn];case"RegExp":return[$s,vn];case"Map":return[Bs,vn];case"Set":return[Us,vn];case"DataView":return[or,n]}return n.includes("Array")?[or,n]:n.includes("Error")?[Ch,n]:[no,n]},Rr=([e,t])=>e===zo&&(t==="function"||t==="symbol"),F3=(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]=Xn(s);switch(a){case zo:{let u=s;switch(l){case"bigint":a=Eh,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([Sh],s)}return o([a,u],s)}case or:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],h=o([a,u],s);for(const p of s)u.push(i(p));return h}case no:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],h=o([a,u],s);for(const p of L3(s))(e||!Rr(Xn(s[p])))&&u.push([i(p),i(s[p])]);return h}case Fs:return o([a,s.toISOString()],s);case $s:{const{source:u,flags:h}=s;return o([a,{source:u,flags:h}],s)}case Bs:{const u=[],h=o([a,u],s);for(const[p,f]of s)(e||!(Rr(Xn(p))||Rr(Xn(f))))&&u.push([i(p),i(f)]);return h}case Us:{const u=[],h=o([a,u],s);for(const p of s)(e||!Rr(Xn(p)))&&u.push(i(p));return h}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},Rl=(e,{json:t,lossy:n}={})=>{const r=[];return F3(!(t||n),!!t,new Map,r)(e),r},ro=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Pl(Rl(e,t)):structuredClone(e):(e,t)=>Pl(Rl(e,t));function $3(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 B3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function U3(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$3,r=e.options.footnoteBackLabel||B3,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),h=String(c.identifier).toUpperCase(),p=Wn(h.toLowerCase());let f=0;const x=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){x.length>0&&x.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,f);typeof v=="string"&&(v={type:"text",value:v}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...x)}else u.push(...x);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ro(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
|
|
93
|
+
`}]}}const Nh=(function(e){if(e==null)return H3;if(typeof e=="function")return Po(e);if(typeof e=="object")return Array.isArray(e)?Z3(e):V3(e);if(typeof e=="string")return W3(e);throw new Error("Expected function, string, or object as test")});function Z3(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Nh(e[n]);return Po(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function V3(e){const t=e;return Po(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function W3(e){return Po(t);function t(n){return n&&n.type===e}}function Po(e){return t;function t(n,r,o){return!!(q3(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function H3(){return!0}function q3(e){return e!==null&&typeof e=="object"&&"type"in e}const Th=[],G3=!0,Ol=!1,K3="skip";function J3(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=Nh(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){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=Th,x,m,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(f=Y3(n(l,u)),f[0]===Ol))return f;if("children"in l&&l.children){const g=l;if(g.children&&f[0]!==K3)for(m=(r?g.children.length:-1)+s,y=u.concat(g);m>-1&&m<g.children.length;){const v=g.children[m];if(x=a(v,m,y)(),x[0]===Ol)return x;m=typeof x[1]=="number"?x[1]:m+s}}return f}}}function Y3(e){return Array.isArray(e)?e:typeof e=="number"?[G3,e]:e==null?Th:[e]}function jh(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),J3(e,i,a,o);function a(l,c){const u=c[c.length-1],h=u?u.children.indexOf(l):void 0;return s(l,h,u)}}const Bi={}.hasOwnProperty,X3={};function Q3(e,t){const n=t||X3,r=new Map,o=new Map,i=new Map,s={...O3,...n.handlers},a={all:c,applyData:tN,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:eN,wrap:rN};return jh(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const h=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();h.has(p)||h.set(p,u)}}),a;function l(u,h){const p=u.type,f=a.handlers[p];if(Bi.call(a.handlers,p)&&f)return f(a,u,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:m,...y}=u,g=ro(y);return g.children=a.all(u),g}return ro(u)}return(a.options.unknownHandler||nN)(a,u,h)}function c(u){const h=[];if("children"in u){const p=u.children;let f=-1;for(;++f<p.length;){const x=a.one(p[f],u);if(x){if(f&&p[f-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Dl(x.value)),!Array.isArray(x)&&x.type==="element")){const m=x.children[0];m&&m.type==="text"&&(m.value=Dl(m.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function eN(e,t){e.position&&(t.position=MS(e))}function tN(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,ro(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function nN(e,t){const n=t.data||{},r="value"in t&&!(Bi.call(n,"hProperties")||Bi.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 rN(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 Dl(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ml(e,t){const n=
|
|
97
|
-
`},o),i}function X3(e,t){return e&&"run"in e?async function(n,r){const o=Ml(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ml(n,{file:r,...e||t})}}function Ll(e){if(e)throw e}var ei,Fl;function Q3(){if(Fl)return ei;Fl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return ei=function l(){var c,u,h,p,f,x,m=arguments[0],y=1,g=arguments.length,v=!1;for(typeof m=="boolean"&&(v=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<g;++y)if(c=arguments[y],c!=null)for(u in c)h=a(m,u),p=a(c,u),m!==p&&(v&&p&&(i(p)||(f=o(p)))?(f?(f=!1,x=h&&o(h)?h:[]):x=h&&i(h)?h:{},s(m,{name:u,newValue:l(v,x,p)})):typeof p<"u"&&s(m,{name:u,newValue:p}));return m},ei}var eN=Q3();const ti=qi(eN);function Ui(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 tN(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let h=-1;if(l){s(l);return}for(;++h<o.length;)(c[h]===null||c[h]===void 0)&&(c[h]=o[h]);o=c,u?nN(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function nN(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const kt={basename:rN,dirname:oN,extname:iN,join:sN,sep:"/"};function rN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yr(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 oN(e){if(yr(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 iN(e){yr(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 sN(...e){let t=-1,n;for(;++t<e.length;)yr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":aN(n)}function aN(e){yr(e);const t=e.codePointAt(0)===47;let n=lN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function lN(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 yr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const cN={cwd:uN};function uN(){return"/"}function Zi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function dN(e){if(typeof e=="string")e=new URL(e);else if(!Zi(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 fN(e)}function fN(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 ni=["history","path","basename","stem","extname","dirname"];class Th{constructor(t){let n;t?Zi(t)?n={path:t}:typeof t=="string"||hN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":cN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ni.length;){const i=ni[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)ni.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?kt.basename(this.path):void 0}set basename(t){oi(t,"basename"),ri(t,"basename"),this.path=kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kt.dirname(this.path):void 0}set dirname(t){$l(this.basename,"dirname"),this.path=kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kt.extname(this.path):void 0}set extname(t){if(ri(t,"extname"),$l(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zi(t)&&(t=dN(t)),oi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kt.basename(this.path,this.extname):void 0}set stem(t){oi(t,"stem"),ri(t,"stem"),this.path=kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ye(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ri(e,t){if(e&&e.includes(kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kt.sep+"`")}function oi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $l(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const pN=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),mN={}.hasOwnProperty;class Zs extends pN{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=tN()}copy(){const t=new Zs;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ti(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ai("data",this.frozen),this.namespace[t]=n,this):mN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ai("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=Or(t),r=this.parser||this.Parser;return ii("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ii("process",this.parser||this.Parser),si("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Or(t),l=r.parse(a);r.run(l,a,function(u,h,p){if(u||!h||!p)return c(u);const f=h,x=r.stringify(f,p);yN(x)?p.value=x:p.result=x,c(u,p)});function c(u,h){u||!h?s(u):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),ii("processSync",this.parser||this.Parser),si("processSync",this.compiler||this.Compiler),this.process(t,o),Ul("processSync","process",n),r;function o(i,s){n=!0,Ll(i),r=s}}run(t,n,r){Bl(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=Or(n);o.run(t,l,c);function c(u,h,p){const f=h||t;u?a(u):s?s(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Ul("runSync","run",r),o;function i(s,a){Ll(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Or(n),o=this.compiler||this.Compiler;return si("stringify",o),Bl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ai("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;l(u,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=ti(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];i(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[f,...x]=u;const m=r[p][1];Ui(m)&&Ui(f)&&(f=ti(!0,m,f)),r[p]=[c,f,...x]}}}}const gN=new Zs().freeze();function ii(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function si(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ai(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 Bl(e){if(!Ui(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ul(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Or(e){return xN(e)?e:new Th(e)}function xN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function yN(e){return typeof e=="string"||vN(e)}function vN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zl=[],Vl={allowDangerousHtml:!0},wN=/^(https?|ircs?|mailto|xmpp)$/i,_N=[{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 Mn(e){const t=kN(e),n=SN(e);return CN(t.runSync(t.parse(n),n),e)}function kN(e){const t=e.rehypePlugins||Zl,n=e.remarkPlugins||Zl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vl}:Vl;return gN().use(r3).use(n).use(X3,r).use(t)}function SN(e){const t=e.children||"",n=new Th;return typeof t=="string"&&(n.value=t),n}function CN(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||EN;for(const u of _N)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+bN+u.id,void 0);return Nh(e,c),DS(e,{Fragment:d.Fragment,components:o,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,h,p){if(u.type==="raw"&&p&&typeof h=="number")return s?p.children.splice(h,1):p.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let f;for(f in Yo)if(Object.hasOwn(Yo,f)&&Object.hasOwn(u.properties,f)){const x=u.properties[f],m=Yo[f];(m===null||m.includes(u.tagName))&&(u.properties[f]=l(String(x||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(u,h,p)),f&&p&&typeof h=="number")return a&&u.children?p.children.splice(h,1,...u.children):p.children.splice(h,1),h}}}function EN(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 Wl({delayDuration:e=0,...t}){return d.jsx(Zk,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function NN({...e}){return d.jsx(Vk,{"data-slot":"tooltip",...e})}function TN({...e}){return d.jsx(Wk,{"data-slot":"tooltip-trigger",...e})}function jN({className:e,sideOffset:t=0,children:n,...r}){return d.jsx(Hk,{children:d.jsxs(qk,{"data-slot":"tooltip-content",sideOffset:t,className:Se("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,d.jsx(Gk,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function jh(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 oo(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function AN(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function Vs(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=AN(e,t);return[t,ur(n)]}):[]}function Hl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const ql=120;function IN({text:e}){const[t,n]=w.useState(!1);return e.length>ql?d.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?d.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:d.jsx(Mn,{children:e})}):d.jsxs(NN,{delayDuration:300,children:[d.jsxs(TN,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[d.jsx("span",{children:e.slice(0,ql)}),d.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),d.jsxs(jN,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):d.jsxs("span",{className:"text-emerald-400 break-all",children:['"',d.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:d.jsx(Mn,{children:e})}),'"']})}function Ah({value:e}){if(e===null)return d.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return d.jsx(IN,{text:e});case"number":return d.jsx("span",{className:"text-amber-400",children:e});case"boolean":return d.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return d.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Gl({value:e}){const[t,n]=w.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return d.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?d.jsx(fr,{className:"size-3 text-green-500"}):d.jsx(uo,{className:"size-3"})})}function zN({value:e}){const[t,n]=w.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return d.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?d.jsx(fr,{className:"size-3 text-green-500"}):d.jsx(uo,{className:"size-3 text-muted-foreground"})})}function PN(e){return oo(e)?Vs(e).some(([,t])=>oo(t)):!1}function RN({allExpanded:e,onClick:t}){return d.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?d.jsx(Gy,{className:"size-3.5 text-muted-foreground"}):d.jsx(Hy,{className:"size-3.5 text-muted-foreground"})})}function Ih({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=w.useState(n<r),[a,l]=w.useState(0),[c,u]=w.useState(null),[h,p]=w.useState(!1),f=oo(t),x=jh(t),m=x==="array"?"[":"{",y=x==="array"?"]":"}";function g(k){k.stopPropagation(),h?(s(!1),u(0),l(S=>S+1),p(!1)):(s(!0),u(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const v=c??r;return d.jsxs("div",{className:Se(n>0&&"border-l border-border/50 ml-2"),children:[d.jsxs("div",{className:Se("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?d.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"})}):d.jsx("span",{className:"w-4 shrink-0"}),d.jsx("span",{className:Se("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),d.jsx("span",{className:"text-muted-foreground shrink-0",children:f?"":":"}),f?d.jsxs("span",{className:"text-muted-foreground",children:[m,d.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",Hl(t)," ",Hl(t)===1?"item":"items"," ",y]})]}):d.jsx("span",{className:"min-w-0",children:d.jsx(Ah,{value:t})}),f&&PN(t)&&d.jsx(RN,{allExpanded:h,onClick:g}),d.jsx(zN,{value:t})]}),f&&i&&d.jsxs("div",{className:"pl-4",children:[Vs(t).map(([k,S])=>d.jsx(Ih,{name:k,value:S,level:n+1,defaultExpandDepth:v,isArrayItem:x==="array"},k)),d.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Ws({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!oo(e))return d.jsx(Wl,{children:d.jsx("div",{className:Se("font-mono text-xs leading-relaxed",n),children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Ah,{value:e}),r&&d.jsx(Gl,{value:e})]})})});const s=jh(e)==="array";return d.jsx(Wl,{children:d.jsxs("div",{className:Se("font-mono text-xs leading-relaxed",n),children:[r&&d.jsx(Gl,{value:e}),Vs(e).map(([a,l])=>d.jsx(Ih,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function li({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return d.jsx(Ws,{data:ur(r),defaultExpandDepth:t,className:n})}catch{return d.jsx("pre",{className:Se("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function ur(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=>ur(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=ur(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function kn({className:e,orientation:t="horizontal",...n}){return d.jsx(Sk,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Se("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const ON=ss("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 Sn({className:e,variant:t="default",...n}){return d.jsx(Ck,{"data-slot":"tabs-list","data-variant":t,className:Se(ON({variant:t}),e),...n})}function Ge({className:e,...t}){return d.jsx(Ek,{"data-slot":"tabs-trigger",className:Se("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 Ke({className:e,...t}){return d.jsx(Nk,{"data-slot":"tabs-content",className:Se("flex-1 outline-none",e),...t})}class zh{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=v=>{if(v=this.postProcess(v,r),o){setTimeout(function(){o(v)},0);return}else return v},a=n.length,l=t.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const h=(i=r.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+h,f=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&x+1>=a)return s(this.buildValues(f[0].lastComponent,n,t));let m=-1/0,y=1/0;const g=()=>{for(let v=Math.max(m,-c);v<=Math.min(y,c);v+=2){let k;const S=f[v-1],C=f[v+1];S&&(f[v-1]=void 0);let N=!1;if(C){const R=C.oldPos-v;N=C&&0<=R&&R<a}const A=S&&S.oldPos+1<l;if(!N&&!A){f[v]=void 0;continue}if(!A||N&&S.oldPos<C.oldPos?k=this.addToPath(C,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),x=this.extractCommon(k,n,t,v,r),k.oldPos+1>=l&&x+1>=a)return s(this.buildValues(k.lastComponent,n,t))||!0;f[v]=k,k.oldPos+1>=l&&(y=Math.min(y,v-1)),x+1>=a&&(m=Math.max(m,v+1))}c++};if(o)(function v(){setTimeout(function(){if(c>u||Date.now()>p)return o(void 0);g()||v()},0)})();else for(;c<=u&&Date.now()<=p;){const v=g();if(v)return v}}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,c=l-o,u=0;for(;c+1<s&&l+1<a&&this.equals(r[l+1],n[c+1],i);)c++,l++,u++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}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,c=0;for(;a<s;a++){const u=o[a];if(u.removed)u.value=this.join(r.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let h=n.slice(l,l+u.count);h=h.map(function(p,f){const x=r[c+f];return x.length>p.length?x:p}),u.value=this.join(h)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return o}}class DN extends zh{constructor(){super(...arguments),this.tokenize=Rh}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
96
|
+
`}),n}function Dl(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ml(e,t){const n=Q3(e,t),r=n.one(e,void 0),o=U3(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 oN(e,t){return e&&"run"in e?async function(n,r){const o=Ml(n,{file:r,...t});await e.run(o,r)}:function(n,r){return Ml(n,{file:r,...e||t})}}function Ll(e){if(e)throw e}var ei,Fl;function iN(){if(Fl)return ei;Fl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},i=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var u=e.call(c,"constructor"),h=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!h)return!1;var p;for(p in c);return typeof p>"u"||e.call(c,p)},s=function(c,u){n&&u.name==="__proto__"?n(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},a=function(c,u){if(u==="__proto__")if(e.call(c,u)){if(r)return r(c,u).value}else return;return c[u]};return ei=function l(){var c,u,h,p,f,x,m=arguments[0],y=1,g=arguments.length,v=!1;for(typeof m=="boolean"&&(v=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<g;++y)if(c=arguments[y],c!=null)for(u in c)h=a(m,u),p=a(c,u),m!==p&&(v&&p&&(i(p)||(f=o(p)))?(f?(f=!1,x=h&&o(h)?h:[]):x=h&&i(h)?h:{},s(m,{name:u,newValue:l(v,x,p)})):typeof p<"u"&&s(m,{name:u,newValue:p}));return m},ei}var sN=iN();const ti=qi(sN);function Ui(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 aN(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let h=-1;if(l){s(l);return}for(;++h<o.length;)(c[h]===null||c[h]===void 0)&&(c[h]=o[h]);o=c,u?lN(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function lN(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const kt={basename:cN,dirname:uN,extname:dN,join:fN,sep:"/"};function cN(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yr(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 uN(e){if(yr(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 dN(e){yr(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 fN(...e){let t=-1,n;for(;++t<e.length;)yr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":hN(n)}function hN(e){yr(e);const t=e.codePointAt(0)===47;let n=pN(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pN(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 yr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mN={cwd:gN};function gN(){return"/"}function Zi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function xN(e){if(typeof e=="string")e=new URL(e);else if(!Zi(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 yN(e)}function yN(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 ni=["history","path","basename","stem","extname","dirname"];class Ah{constructor(t){let n;t?Zi(t)?n={path:t}:typeof t=="string"||vN(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ni.length;){const i=ni[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)ni.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?kt.basename(this.path):void 0}set basename(t){oi(t,"basename"),ri(t,"basename"),this.path=kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kt.dirname(this.path):void 0}set dirname(t){$l(this.basename,"dirname"),this.path=kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kt.extname(this.path):void 0}set extname(t){if(ri(t,"extname"),$l(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Zi(t)&&(t=xN(t)),oi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kt.basename(this.path,this.extname):void 0}set stem(t){oi(t,"stem"),ri(t,"stem"),this.path=kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Ye(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function ri(e,t){if(e&&e.includes(kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kt.sep+"`")}function oi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $l(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function vN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bN=(function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),wN={}.hasOwnProperty;class Zs extends bN{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=aN()}copy(){const t=new Zs;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ti(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ai("data",this.frozen),this.namespace[t]=n,this):wN.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ai("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=Or(t),r=this.parser||this.Parser;return ii("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ii("process",this.parser||this.Parser),si("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Or(t),l=r.parse(a);r.run(l,a,function(u,h,p){if(u||!h||!p)return c(u);const f=h,x=r.stringify(f,p);SN(x)?p.value=x:p.result=x,c(u,p)});function c(u,h){u||!h?s(u):i?i(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),ii("processSync",this.parser||this.Parser),si("processSync",this.compiler||this.Compiler),this.process(t,o),Ul("processSync","process",n),r;function o(i,s){n=!0,Ll(i),r=s}}run(t,n,r){Bl(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=Or(n);o.run(t,l,c);function c(u,h,p){const f=h||t;u?a(u):s?s(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),Ul("runSync","run",r),o;function i(s,a){Ll(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Or(n),o=this.compiler||this.Compiler;return si("stringify",o),Bl(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(ai("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...h]=c;l(u,h)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=ti(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const h=c[u];i(h)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===c){p=h;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[f,...x]=u;const m=r[p][1];Ui(m)&&Ui(f)&&(f=ti(!0,m,f)),r[p]=[c,f,...x]}}}}const _N=new Zs().freeze();function ii(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function si(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ai(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 Bl(e){if(!Ui(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ul(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Or(e){return kN(e)?e:new Ah(e)}function kN(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function SN(e){return typeof e=="string"||CN(e)}function CN(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const EN="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zl=[],Vl={allowDangerousHtml:!0},NN=/^(https?|ircs?|mailto|xmpp)$/i,TN=[{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 Mn(e){const t=jN(e),n=AN(e);return IN(t.runSync(t.parse(n),n),e)}function jN(e){const t=e.rehypePlugins||Zl,n=e.remarkPlugins||Zl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vl}:Vl;return _N().use(c3).use(n).use(oN,r).use(t)}function AN(e){const t=e.children||"",n=new Ah;return typeof t=="string"&&(n.value=t),n}function IN(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||zN;for(const u of TN)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+EN+u.id,void 0);return jh(e,c),US(e,{Fragment:d.Fragment,components:o,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function c(u,h,p){if(u.type==="raw"&&p&&typeof h=="number")return s?p.children.splice(h,1):p.children[h]={type:"text",value:u.value},h;if(u.type==="element"){let f;for(f in Yo)if(Object.hasOwn(Yo,f)&&Object.hasOwn(u.properties,f)){const x=u.properties[f],m=Yo[f];(m===null||m.includes(u.tagName))&&(u.properties[f]=l(String(x||""),f,u))}}if(u.type==="element"){let f=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(u,h,p)),f&&p&&typeof h=="number")return a&&u.children?p.children.splice(h,1,...u.children):p.children.splice(h,1),h}}}function zN(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||NN.test(e.slice(0,t))?e:""}function Wl({delayDuration:e=0,...t}){return d.jsx(Kk,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function PN({...e}){return d.jsx(Jk,{"data-slot":"tooltip",...e})}function RN({...e}){return d.jsx(Yk,{"data-slot":"tooltip-trigger",...e})}function ON({className:e,sideOffset:t=0,children:n,...r}){return d.jsx(Xk,{children:d.jsxs(Qk,{"data-slot":"tooltip-content",sideOffset:t,className:Se("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,d.jsx(eS,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Ih(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 oo(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function DN(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function Vs(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=DN(e,t);return[t,ur(n)]}):[]}function Hl(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const ql=120;function MN({text:e}){const[t,n]=w.useState(!1);return e.length>ql?d.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?d.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:d.jsx(Mn,{children:e})}):d.jsxs(PN,{delayDuration:300,children:[d.jsxs(RN,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[d.jsx("span",{children:e.slice(0,ql)}),d.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),d.jsxs(ON,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):d.jsxs("span",{className:"text-emerald-400 break-all",children:['"',d.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:d.jsx(Mn,{children:e})}),'"']})}function zh({value:e}){if(e===null)return d.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return d.jsx(MN,{text:e});case"number":return d.jsx("span",{className:"text-amber-400",children:e});case"boolean":return d.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return d.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Gl({value:e}){const[t,n]=w.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return d.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?d.jsx(fr,{className:"size-3 text-green-500"}):d.jsx(uo,{className:"size-3"})})}function LN({value:e}){const[t,n]=w.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return d.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?d.jsx(fr,{className:"size-3 text-green-500"}):d.jsx(uo,{className:"size-3 text-muted-foreground"})})}function FN(e){return oo(e)?Vs(e).some(([,t])=>oo(t)):!1}function $N({allExpanded:e,onClick:t}){return d.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?d.jsx(ev,{className:"size-3.5 text-muted-foreground"}):d.jsx(Xy,{className:"size-3.5 text-muted-foreground"})})}function Ph({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[i,s]=w.useState(n<r),[a,l]=w.useState(0),[c,u]=w.useState(null),[h,p]=w.useState(!1),f=oo(t),x=Ih(t),m=x==="array"?"[":"{",y=x==="array"?"]":"}";function g(k){k.stopPropagation(),h?(s(!1),u(0),l(S=>S+1),p(!1)):(s(!0),u(Number.POSITIVE_INFINITY),l(S=>S+1),p(!0))}const v=c??r;return d.jsxs("div",{className:Se(n>0&&"border-l border-border/50 ml-2"),children:[d.jsxs("div",{className:Se("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?d.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:i?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"})}):d.jsx("span",{className:"w-4 shrink-0"}),d.jsx("span",{className:Se("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),d.jsx("span",{className:"text-muted-foreground shrink-0",children:f?"":":"}),f?d.jsxs("span",{className:"text-muted-foreground",children:[m,d.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",Hl(t)," ",Hl(t)===1?"item":"items"," ",y]})]}):d.jsx("span",{className:"min-w-0",children:d.jsx(zh,{value:t})}),f&&FN(t)&&d.jsx($N,{allExpanded:h,onClick:g}),d.jsx(LN,{value:t})]}),f&&i&&d.jsxs("div",{className:"pl-4",children:[Vs(t).map(([k,S])=>d.jsx(Ph,{name:k,value:S,level:n+1,defaultExpandDepth:v,isArrayItem:x==="array"},k)),d.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Ws({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!oo(e))return d.jsx(Wl,{children:d.jsx("div",{className:Se("font-mono text-xs leading-relaxed",n),children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(zh,{value:e}),r&&d.jsx(Gl,{value:e})]})})});const s=Ih(e)==="array";return d.jsx(Wl,{children:d.jsxs("div",{className:Se("font-mono text-xs leading-relaxed",n),children:[r&&d.jsx(Gl,{value:e}),Vs(e).map(([a,l])=>d.jsx(Ph,{name:a,value:l,level:0,defaultExpandDepth:t,isArrayItem:s},a))]})})}function li({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return d.jsx(Ws,{data:ur(r),defaultExpandDepth:t,className:n})}catch{return d.jsx("pre",{className:Se("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function ur(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=>ur(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=ur(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function kn({className:e,orientation:t="horizontal",...n}){return d.jsx(Ak,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Se("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const BN=ss("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 Sn({className:e,variant:t="default",...n}){return d.jsx(Ik,{"data-slot":"tabs-list","data-variant":t,className:Se(BN({variant:t}),e),...n})}function Ge({className:e,...t}){return d.jsx(zk,{"data-slot":"tabs-trigger",className:Se("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 Ke({className:e,...t}){return d.jsx(Pk,{"data-slot":"tabs-content",className:Se("flex-1 outline-none",e),...t})}class Rh{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=v=>{if(v=this.postProcess(v,r),o){setTimeout(function(){o(v)},0);return}else return v},a=n.length,l=t.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const h=(i=r.timeout)!==null&&i!==void 0?i:1/0,p=Date.now()+h,f=[{oldPos:-1,lastComponent:void 0}];let x=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&x+1>=a)return s(this.buildValues(f[0].lastComponent,n,t));let m=-1/0,y=1/0;const g=()=>{for(let v=Math.max(m,-c);v<=Math.min(y,c);v+=2){let k;const S=f[v-1],E=f[v+1];S&&(f[v-1]=void 0);let N=!1;if(E){const P=E.oldPos-v;N=E&&0<=P&&P<a}const T=S&&S.oldPos+1<l;if(!N&&!T){f[v]=void 0;continue}if(!T||N&&S.oldPos<E.oldPos?k=this.addToPath(E,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),x=this.extractCommon(k,n,t,v,r),k.oldPos+1>=l&&x+1>=a)return s(this.buildValues(k.lastComponent,n,t))||!0;f[v]=k,k.oldPos+1>=l&&(y=Math.min(y,v-1)),x+1>=a&&(m=Math.max(m,v+1))}c++};if(o)(function v(){setTimeout(function(){if(c>u||Date.now()>p)return o(void 0);g()||v()},0)})();else for(;c<=u&&Date.now()<=p;){const v=g();if(v)return v}}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,c=l-o,u=0;for(;c+1<s&&l+1<a&&this.equals(r[l+1],n[c+1],i);)c++,l++,u++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}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,c=0;for(;a<s;a++){const u=o[a];if(u.removed)u.value=this.join(r.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let h=n.slice(l,l+u.count);h=h.map(function(p,f){const x=r[c+f];return x.length>p.length?x:p}),u.value=this.join(h)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return o}}class UN extends Rh{constructor(){super(...arguments),this.tokenize=Dh}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(`
|
|
101
|
-
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const
|
|
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
|
|
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
|
|
101
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const ZN=new UN;function Oh(e,t,n){return ZN.diff(e,t,n)}function Dh(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
102
|
+
`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const i=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}class VN extends Rh{constructor(){super(...arguments),this.tokenize=Dh}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(Vi(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 WN=new VN;function HN(e,t,n){return WN.diff(e,t,n)}function Vi(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]=Vi(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]=Vi(e[l],t,n,r,l);t.pop(),n.pop()}else s=e;return s}function Kl(e){return e===void 0?[]:Object.entries(e).map(t=>[t[0].toLowerCase(),t[1]]).sort(([t],[n])=>t.localeCompare(n))}function Jl([e,t]){return`${e}: ${t}`}function Wi(e){const t=[];let n=0,r=0;for(const o of e){const i=o.value.split(`
|
|
103
|
+
`);i.length>0&&i[i.length-1]===""&&i.pop();for(const s of i)o.added?(r+=1,t.push({kind:"added",text:s,oldLineNumber:null,newLineNumber:r})):o.removed?(n+=1,t.push({kind:"removed",text:s,oldLineNumber:n,newLineNumber:null})):(n+=1,r+=1,t.push({kind:"context",text:s,oldLineNumber:n,newLineNumber:r}))}return t}function qN(e,t){const n=Kl(e).map(Jl).join(`
|
|
104
104
|
`),r=Kl(t).map(Jl).join(`
|
|
105
|
-
`);if(n===r)return{lines:[],isEmpty:!0};const o=Ph(n,r);return{lines:Wi(o),isEmpty:!1}}function Yl(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function UN(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=Yl(n),i=Yl(r);if(o!==null&&i!==null){const a=$N(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:Wi(a),isEmpty:!1}}const s=Ph(n,r);return{lines:Wi(s),isEmpty:!1}}const ZN=22,ci=1e4;function VN(e){return e==="added"?"+":e==="removed"?"-":" "}function WN(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 Xl({result:e,emptyLabel:t}){const[n,r]=w.useState("unified"),o=w.useRef(null),i=ru({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>ZN,overscan:10});if(e.isEmpty)return d.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>ci,l=a?e.lines.slice(0,ci):e.lines;return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[d.jsxs("span",{children:[s.toLocaleString()," line",s===1?"":"s",a&&` (showing first ${ci.toLocaleString()})`]}),d.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[d.jsxs("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":n==="unified",className:Se("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:[d.jsx(Dv,{className:"size-3"}),"Unified"]}),d.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:Se("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:[d.jsx(rv,{className:"size-3"}),"Split"]})]})]}),d.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"?d.jsx(HN,{virtualizer:i,lines:l}):d.jsx(KN,{lines:l})})]})}function HN({virtualizer:e,lines:t}){return d.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:d.jsxs("div",{"data-index":n.index,ref:e.measureElement,className:Se("flex items-start gap-3 px-2",WN(r.kind)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},children:[d.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.oldLineNumber??""}),d.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.newLineNumber??""}),d.jsx("span",{className:Se("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:VN(r.kind)}),d.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function qN(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],c=i[a];l!==void 0&&c!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:{text:c.text,lineNumber:c.newLineNumber},kind:"changed"}):l!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:null,kind:"removed"}):c!==void 0&&t.push({left:null,right:{text:c.text,lineNumber:c.newLineNumber},kind:"added"})}}return t}function GN(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 KN({lines:e}){const t=qN(e);return d.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>d.jsxs("div",{className:Se("grid grid-cols-2 font-mono text-xs",GN(n.kind)),children:[d.jsxs("div",{className:"flex items-start gap-2 px-2 border-r border-border/50",children:[d.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.left?.lineNumber??""}),d.jsx("span",{className:Se("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?"-":" "}),d.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.left?.text??""})]}),d.jsxs("div",{className:"flex items-start gap-2 px-2",children:[d.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.right?.lineNumber??""}),d.jsx("span",{className:Se("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?"+":" "}),d.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.right?.text??""})]})]},r))})}const JN="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",YN="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",XN="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",QN="/assets/minimax-BPMzvuL-.jpeg",eT="/assets/alibaba-TTwafVwX.svg",tT="/assets/qwen-CONDcHqt.png",nT="/assets/zhipuai-BPNAnxo-.svg",rT={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function oT(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(rT))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const fn={width:24,height:24,objectFit:"contain"},iT=nt.memo(({className:e})=>d.jsx("img",{src:JN,alt:"Anthropic",className:e,style:fn})),sT=nt.memo(({className:e})=>d.jsx("img",{src:YN,alt:"OpenAI",className:e,style:{...fn,background:"white",borderRadius:"4px"}})),aT=nt.memo(({className:e})=>d.jsx("img",{src:XN,alt:"DeepSeek",className:e,style:fn})),lT=nt.memo(({className:e})=>d.jsx("img",{src:QN,alt:"MiniMax",className:e,style:fn})),cT=nt.memo(({className:e})=>d.jsx("img",{src:eT,alt:"Alibaba",className:e,style:fn})),uT=nt.memo(({className:e})=>d.jsx("img",{src:tT,alt:"Qwen",className:e,style:fn})),dT=nt.memo(({className:e})=>d.jsx("img",{src:nT,alt:"ZhipuAI",className:e,style:fn}));function fT({provider:e,className:t}){switch(e){case"anthropic":return d.jsx(iT,{className:t});case"openai":return d.jsx(sT,{className:t});case"deepseek":return d.jsx(aT,{className:t});case"minimax":return d.jsx(lT,{className:t});case"alibaba":return d.jsx(cT,{className:t});case"qwen":return d.jsx(uT,{className:t});case"zhipuai":return d.jsx(dT,{className:t});case"unknown":return null}}function hT(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const Ql={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"},pT=w.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1}){const i=Nu(e.responseStatus),s=e.inputTokens!==null||e.outputTokens!==null,a=t!==null?t.messages.length:null,l=t!==null&&t.tools!==void 0&&t.tools.length>0?t.tools.length:null;return d.jsxs("div",{role:"button",tabIndex:0,className:Se("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:r,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),r())},children:[d.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",e.id]}),e.model!==null&&d.jsxs(d.Fragment,{children:[d.jsx(fT,{provider:oT(e.model),className:"size-4 shrink-0"}),d.jsx(ct,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&d.jsx(ct,{variant:"outline",className:Se("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"}),i==="server_error"?d.jsx(ct,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):i==="pending"?d.jsx(ct,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ql[i]),children:d.jsx(cu,{className:"size-3 animate-spin"})}):d.jsx(ct,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ql[i]),children:e.responseStatus}),e.elapsedMs!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(os,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums",children:hT(e.elapsedMs)})]}),s&&d.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[d.jsx(hr,{className:"size-3 text-muted-foreground"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[d.jsxs("span",{className:e.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",e.inputTokens!==null?Je(e.inputTokens):"—"]})," / ",d.jsxs("span",{className:e.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",e.outputTokens!==null?Je(e.outputTokens):"—"]})]})]}),e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&d.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:d.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(e.cacheCreationInputTokens)]})}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&d.jsx("span",{className:"flex items-center gap-1 text-xs shrink-0",children:d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.cacheReadInputTokens)]})}),a!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(uu,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums",children:a})]}),l!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(nb,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums",children:l})]}),e.origin!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${e.origin}`,children:[d.jsx(xv,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:e.origin,children:e.origin})]}),e.userAgent!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${e.userAgent}`,children:[d.jsx(Jv,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:e.userAgent,children:e.userAgent})]}),(e.clientPid!==null||e.clientProjectFolder!==null)&&d.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:[d.jsx(dv,{className:"size-3"}),e.clientProjectFolder!==null?d.jsx("span",{className:"font-mono tabular-nums",children:e.clientProjectFolder}):d.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",e.clientPid]})]}),e.streaming&&d.jsx(zv,{className:"size-3 text-muted-foreground/60 shrink-0"}),d.jsx("span",{className:"flex-1 min-w-0"}),n?d.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):d.jsx(Gt,{className:"size-4 text-muted-foreground shrink-0"})]})});function Oh({...e}){return d.jsx(Mw,{"data-slot":"dialog",...e})}function mT({...e}){return d.jsx(Lw,{"data-slot":"dialog-trigger",...e})}function gT({...e}){return d.jsx(Fw,{"data-slot":"dialog-portal",...e})}function xT({className:e,...t}){return d.jsx($w,{"data-slot":"dialog-overlay",className:Se("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 Dh({className:e,children:t,...n}){return d.jsxs(gT,{children:[d.jsx(xT,{}),d.jsxs(Bw,{"data-slot":"dialog-content",className:Se("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,d.jsxs(Zw,{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:[d.jsx(ob,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Mh({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function Lh({className:e,...t}){return d.jsx(Uw,{"data-slot":"dialog-title",className:Se("text-lg font-semibold leading-none tracking-tight",e),...t})}function Fh({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return d.jsx(wk,{"data-slot":"separator",decorative:n,orientation:t,className:Se("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 Hs({...e}){return d.jsx(S1,{"data-slot":"collapsible",...e})}function qs({...e}){return d.jsx(Ou,{"data-slot":"collapsible-trigger",...e})}function Gs({...e}){return d.jsx(Du,{"data-slot":"collapsible-content",...e})}function $h({className:e,children:t,...n}){return d.jsxs(R_,{"data-slot":"scroll-area",className:Se("relative",e),...n,children:[d.jsx(O_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),d.jsx(yT,{}),d.jsx(D_,{})]})}function yT({className:e,orientation:t="vertical",...n}){return d.jsx(Hd,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Se("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:d.jsx(Jd,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function vT(e){return d.jsx(d.Fragment,{})}function bT({text:e}){const[t,n]=w.useState(!1);return d.jsxs(Hs,{open:t,onOpenChange:n,children:[d.jsxs(qs,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"}),d.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),d.jsx(Gs,{children:d.jsx("div",{className:"pl-4 pt-1",children:d.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:d.jsx(Mn,{children:e})})})})]})}const wT=/<think>([\s\S]*?)<\/think>/gi,_T=/<think>([\s\S]*?)<\/think>/i;function Bh(e){const t=_T.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(wT,"").trim();return{thinking:n,remainingText:r}}function kT({text:e}){if(e.includes("<system-reminder>"))return d.jsx(bT,{text:e});const{thinking:t,remainingText:n}=Bh(e);return d.jsxs("div",{className:"space-y-2",children:[t!==null&&d.jsx(io,{thinking:t}),n.length>0&&d.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:d.jsx(Mn,{children:n})}),t===null&&n.length===0&&d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}function io({thinking:e}){const[t,n]=w.useState(!1);return d.jsx(Hs,{open:t,onOpenChange:n,children:d.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[d.jsxs(qs,{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:[d.jsx(Fy,{className:"size-3.5 text-purple-400 shrink-0"}),d.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),d.jsxs(ct,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),d.jsx("span",{className:"flex-1"}),t?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"})]}),d.jsx(Gs,{children:d.jsx("div",{className:"px-3 pb-2",children:d.jsx($h,{className:"max-h-[60vh]",children:d.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function ST({name:e,input:t}){const[n,r]=w.useState(!1);return d.jsx(Hs,{open:n,onOpenChange:r,children:d.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[d.jsxs(qs,{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:[d.jsx(Uv,{className:"size-3.5 text-blue-400 shrink-0"}),d.jsx(ct,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),d.jsx("span",{className:"flex-1"}),n?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"})]}),d.jsx(Gs,{children:d.jsx("div",{className:"px-3 pb-2",children:d.jsx($h,{className:"max-h-[60vh]",children:d.jsx(Ws,{data:ur(t),defaultExpandDepth:2})})})})]})})}function CT({block:e}){switch(e.type){case"text":return d.jsx(kT,{text:e.text});case"thinking":case"think":return d.jsx(io,{thinking:e.thinking});case"tool_use":return d.jsx(ST,{name:e.name,input:e.input});default:return vT()}}function ET({response:e}){return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(ct,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&d.jsxs(ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[d.jsx(iu,{className:"size-2.5"}),e.stop_reason]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[d.jsx(hr,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.input_tokens??0)," in /"," ",Je(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&&d.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(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&&d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.usage.cache_read_input_tokens)]})]})]}),d.jsx(Fh,{className:"opacity-50"}),d.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>d.jsx(CT,{block:t},n)),e.content.length===0&&d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function NT({response:e}){const t=e.choices[0],n=t?.message;return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(ct,{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&&d.jsxs(ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[d.jsx(iu,{className:"size-2.5"}),t.finish_reason]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[d.jsx(hr,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.prompt_tokens??0)," in /"," ",Je(e.usage.completion_tokens??0)," out"]})]})]}),d.jsx(Fh,{className:"opacity-50"}),d.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&d.jsx(io,{thinking:n.reasoning_content}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&(()=>{const r=n.reasoning_content!==null&&n.reasoning_content!==void 0&&n.reasoning_content.length>0,{thinking:o,remainingText:i}=Bh(n.content);return d.jsxs("div",{className:"space-y-2",children:[o!==null&&!r&&d.jsx(io,{thinking:o}),i.length>0&&d.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:d.jsx(Mn,{children:i})})]})})(),n?.function_call!==null&&n?.function_call!==void 0&&d.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[d.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),d.jsxs("div",{className:"font-mono text-xs",children:[d.jsx("span",{className:"text-blue-300",children:n.function_call.name}),d.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)&&d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function TT(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function jT(e,t){return TT(t)?d.jsx(NT,{response:t}):d.jsx(ET,{response:t})}function AT(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 IT(e,t){try{let n=JSON.parse(e);if(typeof n=="string"&&(n=JSON.parse(n)),t==="openai"){const o=hy(e);if(o)return o}const r=ay.safeParse(n);return r.success?r.data:null}catch{return null}}function Qn({status:e}){const t=Nu(e),n=AT(t);return e===null?d.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):d.jsxs("span",{className:Se("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&d.jsx(Hv,{className:"size-3"}),e]})}function ec({text:e}){return d.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:d.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function zT({text:e}){return d.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:d.jsx(Mn,{children:e})})}function Ur({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 d.jsxs("div",{className:"flex items-center gap-2 py-3",children:[d.jsx(Qn,{status:t}),d.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return d.jsxs("div",{className:"space-y-2",children:[d.jsx(Qn,{status:t}),d.jsx(ec,{text:e??""}),l!=null&&d.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[d.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),d.jsx("div",{className:"text-muted-foreground font-mono",children:l})]})]});if(l!=null)return d.jsxs("div",{className:"space-y-2",children:[d.jsx(Qn,{status:t}),d.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[d.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),d.jsx("div",{className:"text-muted-foreground font-mono",children:l})]}),e!==null&&d.jsx("div",{className:"mt-2",children:d.jsx(ec,{text:e})})]});const u=e!==null?IT(e,a):null;return u!==null?d.jsxs("div",{className:"space-y-2",children:[d.jsx(Qn,{status:t}),jT(a,u)]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Qn,{status:t}),n&&(r!==null||o!==null)&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[d.jsx(hr,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Je(r):"—"," in /"," ",o!==null?Je(o):"—"," out"]}),i!=null&&i>0&&d.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(i)]}),s!=null&&s>0&&d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(s)]})]})]}),d.jsx(zT,{text:e??""})]})}const PT=ce({success:et(),error:G().optional(),responseStatus:ye().optional(),responseText:G().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),elapsedMs:ye().optional(),streaming:et().optional()});function RT({log:e,open:t,onOpenChange:n}){const[r,o]=w.useState(()=>e.rawRequestBody??"{}"),[i,s]=w.useState(null),[a,l]=w.useState(!1),[c,u]=w.useState(null);async function h(){l(!0),u(null),s(null);try{const x=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=PT.safeParse(x);if(!m.success){u("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||u(y.error??"Replay failed")}catch(f){u(f instanceof Error?f.message:"Network error")}finally{l(!1)}}function p(){s(null),u(null),n(!1)}return d.jsx(Oh,{open:t,onOpenChange:p,children:d.jsxs(Dh,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[d.jsx(Mh,{children:d.jsxs(Lh,{className:"flex items-center gap-2",children:[d.jsx(du,{className:"size-4"}),"Replay Request #",e.id]})}),d.jsxs(kn,{defaultValue:"modified",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"modified",children:"Modified Request"}),d.jsx(Ge,{value:"original",children:"Original Response"}),i&&d.jsx(Ge,{value:"replay",children:"Replay Response"})]}),d.jsxs(Ke,{value:"modified",className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),d.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})]}),c!==null&&c!==""&&d.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:c}),d.jsx("div",{className:"flex justify-end",children:d.jsx(ht,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&d.jsxs(kn,{defaultValue:"parsed",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"parsed",children:"Response"}),d.jsx(Ge,{value:"raw",children:"Raw Response"})]}),d.jsx(Ke,{value:"parsed",children:d.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),d.jsx(Ke,{value:"raw",children:d.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"})})]})]}),d.jsx(Ke,{value:"original",children:e.responseText!==null?d.jsxs(kn,{defaultValue:"parsed",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"parsed",children:"Response"}),d.jsx(Ge,{value:"raw",children:"Raw Response"})]}),d.jsx(Ke,{value:"parsed",children:d.jsx(Ur,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),d.jsx(Ke,{value:"raw",children:d.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):d.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&d.jsx(Ke,{value:"replay",children:i.responseText!==null?d.jsxs(kn,{defaultValue:"parsed",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"parsed",children:"Response"}),d.jsx(Ge,{value:"raw",children:"Raw Response"})]}),d.jsx(Ke,{value:"parsed",children:d.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),d.jsx(Ke,{value:"raw",children:d.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):d.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function OT({logId:e,truncated:t}){const[n,r]=w.useState(!1),[o,i]=w.useState({status:"idle"}),[s,a]=w.useState(new Set);w.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=w.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]),c=h=>{a(p=>{const f=new Set(p);return f.has(h)?f.delete(h):f.add(h),f})};function u(){return o.status==="idle"||o.status==="loading"?d.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[d.jsx(cu,{className:"size-3 animate-spin"}),d.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?d.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):d.jsxs("div",{className:"p-2 space-y-1",children:[d.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 d.jsxs("div",{className:"rounded border border-border bg-background",children:[d.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>c(h.index),children:[p?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"}),d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",h.index,"] ",h.chunks[0]?.type??""]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[h.chunks.length," chunk",h.chunks.length!==1?"s":""]})]}),p&&d.jsx("div",{className:"px-2 pb-2 space-y-1",children:h.chunks.map(f=>d.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",f.timestamp,"ms"]}),d.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:f.type})]}),d.jsx(Ws,{data:f,defaultExpandDepth:1,showCopy:!0})]},f.index))})]},h.index)})]})}return d.jsxs("div",{className:"space-y-1",children:[d.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?d.jsx(At,{className:"size-3"}):d.jsx(Gt,{className:"size-3"}),d.jsx("span",{children:"Raw SSE Events"}),d.jsxs(ct,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?d.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:u()}):null]})}function tc(e,t,n){return e==="anthropic"&&t==="full"&&n}function DT(e,t){return e==="full"&&t}function MT(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function ui({text:e,label:t,copied:n,onCopy:r}){return e===null?null:d.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?d.jsxs(d.Fragment,{children:[d.jsx(fr,{className:"size-3 text-green-500"}),d.jsx("span",{className:"text-green-500",children:"Copied!"})]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{className:"size-3"}),d.jsx("span",{children:t})]})})}function nc({active:e,onClick:t}){return d.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:Se("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:[d.jsx(mv,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const Uh=w.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r}){const[o,i]=w.useState(!1),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,h]=w.useState(!1),[p,f]=w.useState(!1),[x,m]=w.useState(!1),[y,g]=w.useState(!1),v=w.useMemo(()=>my(e.rawRequestBody),[e.rawRequestBody]),S=w.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:sS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,C=w.useMemo(()=>BN(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),N=w.useMemo(()=>UN(e.rawRequestBody,S),[e.rawRequestBody,S]);function A(P){P.stopPropagation(),S!==null&&window.navigator.clipboard.writeText(S).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)})}function R(P){P.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)})}function O(P){P.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Se("border border-border rounded-lg mb-3 overflow-hidden"),children:[d.jsx(pT,{log:e,parsedRequest:v,expanded:o,onToggle:()=>i(!o),suppressApiFormatBadge:n}),o&&d.jsx("div",{onClick:P=>P.stopPropagation(),onKeyDown:P=>P.stopPropagation(),children:d.jsxs(kn,{defaultValue:"request",children:[d.jsxs(Sn,{className:"mx-4 mt-2",children:[t==="full"&&d.jsx(Ge,{value:"raw-headers",children:"Raw Headers"}),t==="full"&&d.jsx(Ge,{value:"headers",children:"Headers"}),tc(e.apiFormat,t,r)&&d.jsx(Ge,{value:"raw-request",children:"Raw Request"}),d.jsx(Ge,{value:"request",children:"Request"}),t==="full"&&d.jsx(Ge,{value:"raw",children:"Raw Response"}),d.jsx(Ge,{value:"parsed",children:"Response"})]}),tc(e.apiFormat,t,r)&&d.jsx(Ke,{value:"raw-request",children:d.jsxs("div",{className:"px-4 py-3",children:[d.jsx("div",{className:"flex justify-end mb-2",children:d.jsx(ui,{text:e.rawRequestBody,label:"Copy Raw Request",copied:l,onCopy:R})}),e.rawRequestBody!==null?d.jsx(li,{text:e.rawRequestBody,defaultExpandDepth:1}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),d.jsx(Ke,{value:"request",children:d.jsxs("div",{className:"px-4 py-3",children:[d.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[MT(e.apiFormat,t,r,e.rawRequestBody!==null)&&d.jsx(nc,{active:y,onClick:P=>{P.stopPropagation(),g(!y)}}),d.jsxs(ht,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:P=>{P.stopPropagation(),f(!0)},children:[d.jsx(du,{className:"size-3 mr-1"}),"Replay"]}),d.jsx(ui,{text:S,label:"Copy Request",copied:s,onCopy:A})]}),y?d.jsx(Xl,{result:N,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):S!==null?d.jsx(li,{text:S,defaultExpandDepth:1}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),t==="full"&&d.jsx(Ke,{value:"headers",children:d.jsxs("div",{className:"px-4 py-3",children:[d.jsx("div",{className:"flex justify-end gap-2 mb-2",children:DT(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&d.jsx(nc,{active:x,onClick:P=>{P.stopPropagation(),m(!x)}})}),x?d.jsx(Xl,{result:C,emptyLabel:"No transformation applied — raw and processed headers are identical."}):e.headers&&Object.keys(e.headers).length>0?d.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.headers).sort(([P],[L])=>P.localeCompare(L)).map(([P,L])=>d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[P,":"]}),d.jsx("span",{className:"text-muted-foreground truncate",title:L,children:L})]},P))}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})]})}),t==="full"&&d.jsx(Ke,{value:"raw-headers",children:d.jsx("div",{className:"px-4 py-3",children:e.rawHeaders&&Object.keys(e.rawHeaders).length>0?d.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.rawHeaders).sort(([P],[L])=>P.localeCompare(L)).map(([P,L])=>d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[P,":"]}),d.jsx("span",{className:"text-muted-foreground truncate",title:L,children:L})]},P))}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),d.jsx(Ke,{value:"raw",children:d.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.error!==void 0&&e.error!==null&&d.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[d.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),d.jsx("div",{className:"text-muted-foreground font-mono",children:e.error})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(ui,{text:e.responseText,label:"Copy Response",copied:u,onCopy:O})}),e.responseText!==null?d.jsx(li,{text:e.responseText,defaultExpandDepth:1}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),e.streaming===!0&&d.jsx(OT,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),d.jsx(Ke,{value:"parsed",children:d.jsx("div",{className:"px-4 py-3",children:d.jsx(Ur,{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})})})]})})]}),d.jsx(RT,{log:e,open:p,onOpenChange:f})]})});function LT(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 FT=w.memo(function({group:e,viewMode:t="simple",strip:n}){const[r,o]=w.useState(!1),i=LT(e.logs),s=e.logs[0]?.timestamp??new Date().toISOString(),a=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),l=Qk(e.logs),c=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 d.jsxs("div",{className:"mb-4",children:[d.jsx(Yk,{conversationId:c,startTime:s,endTime:a,totalCalls:e.logs.length,totalInputTokens:i.totalInputTokens,totalOutputTokens:i.totalOutputTokens,apiFormat:Xk(e.logs),expanded:r,onToggle:()=>o(!r),hideApiFormat:l}),r&&d.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:e.logs.map(u=>d.jsx(Uh,{log:u,viewMode:t,suppressApiFormatBadge:!l,strip:n},u.id))})]})});function $T({className:e}){return d.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:Se("inline-block size-5",e),children:[d.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"}),d.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),d.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),d.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),d.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"}),d.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),d.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),d.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),d.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),d.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]})}function rc({...e}){return d.jsx(sk,{"data-slot":"select",...e})}function oc({...e}){return d.jsx(lk,{"data-slot":"select-value",...e})}function ic({className:e,size:t="default",children:n,...r}){return d.jsxs(ak,{"data-slot":"select-trigger","data-size":t,className:Se("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,d.jsx(ck,{asChild:!0,children:d.jsx(At,{className:"size-4 opacity-50"})})]})}function sc({className:e,children:t,position:n="popper",align:r="center",...o}){return d.jsx(uk,{children:d.jsxs(dk,{"data-slot":"select-content",className:Se("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:[d.jsx(BT,{}),d.jsx(fk,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(UT,{})]})})}function Dr({className:e,children:t,...n}){return d.jsxs(hk,{"data-slot":"select-item",className:Se("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:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(mk,{children:d.jsx(fr,{className:"size-4"})})}),d.jsx(pk,{children:t})]})}function BT({className:e,...t}){return d.jsx(gk,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Vy,{className:"size-4"})})}function UT({className:e,...t}){return d.jsx(xk,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(At,{className:"size-4"})})}const ZT={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function VT(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}function WT(e){return Object.prototype.hasOwnProperty.call(e,"success")}function HT(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function qT(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return d.jsx(os,{...t});case"network_unreachable":return d.jsx(Xv,{...t});case"connection_refused":return d.jsx(eb,{...t});case"auth_failed":return d.jsx(Sv,{...t});case"rate_limited":return d.jsx(hv,{...t});case"server_error":return d.jsx(Lv,{...t});case"invalid_response":return d.jsx(Qy,{...t});case"unknown":return d.jsx(yi,{...t});default:return d.jsx(yi,{...t})}}function ac({result:e}){const[t,n]=w.useState(!1);if(!WT(e))return HT(e)?d.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[d.jsx(Nv,{className:"size-3"}),d.jsx("span",{children:"Not configured"})]}):d.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[d.jsx(fu,{className:"size-3 animate-spin"}),d.jsx("span",{children:"Testing..."})]});if(e.success){const l=[];e.inputTokens!==void 0&&l.push(d.jsxs("span",{children:[e.inputTokens," in"]},"in")),e.outputTokens!==void 0&&l.push(d.jsxs("span",{children:[e.outputTokens," out"]},"out")),e.cacheCreationInputTokens!==void 0&&e.cacheCreationInputTokens>0&&l.push(d.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(d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["~",e.cacheReadInputTokens," cached"]},"cache-read"));const c=[];for(let u=0;u<l.length;u++)u>0&&c.push(", "),c.push(l[u]);return d.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[d.jsx(Yy,{className:"size-3"}),d.jsx("span",{children:"Connected"}),l.length>0&&d.jsxs("span",{className:"text-muted-foreground",children:["(",c,")"]})]})}const r=e.error,o=r?.message??"Connection failed",i=r?.hint,s=r?.details,a=r?.type??"unknown";return d.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 max-w-[200px]",children:[qT(a),d.jsx("span",{className:"truncate",children:o}),s!==void 0&&d.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?d.jsx(au,{className:"size-3"}):d.jsx(lu,{className:"size-3"})})]}),t&&s!==void 0&&d.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded p-2 max-w-[300px]",children:[i!==void 0&&d.jsx("div",{className:"mb-1",children:i}),d.jsx("div",{className:"font-mono whitespace-pre-wrap break-all text-red-400/80",children:s})]})]})}function GT({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,isHighlighted:o,onEdit:i,onDelete:s,onTest:a}){const[l,c]=w.useState(!1),u=e.apiDocsUrl??Object.entries(ZT).find(([h])=>e.name.toLowerCase().includes(h))?.[1];return d.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:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsx("div",{className:"flex items-center gap-2 min-w-0",children:d.jsx("span",{className:"font-medium truncate",children:e.model!==void 0&&e.model!==""?`${e.model} (${e.name})`:e.name})}),u!==void 0&&d.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[d.jsx(av,{className:"size-3"}),d.jsx("span",{className:"sr-only",children:"Docs"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:l?e.apiKey:VT(e.apiKey)}),d.jsx("button",{type:"button",onClick:()=>c(h=>!h),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":l?"Hide API key":"Show API key",children:l?d.jsx(au,{className:"size-4"}):d.jsx(lu,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[d.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",d.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&d.jsx(ac,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[d.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",d.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&d.jsx(ac,{result:t.openai.nonStreaming})]}),d.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[a!==void 0&&d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>a(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[d.jsx(fu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>i(e),className:"text-xs h-7 gap-1",children:[d.jsx(jv,{className:"size-3"}),"Edit"]}),d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[d.jsx(Vv,{className:"size-3"}),"Delete"]})]})]})}const KT={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"}},lc=["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"],cc=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function JT({provider:e,onSubmit:t,onCancel:n}){const[r,o]=w.useState(e?.name??"Provider Name"),[i,s]=w.useState(e?.apiKey??""),[a,l]=w.useState(e?.model??""),[c,u]=w.useState(e?.format??"anthropic"),[h,p]=w.useState(e?.baseUrl??""),[f,x]=w.useState(e?.apiDocsUrl??""),[m,y]=w.useState({}),[g,v]=w.useState(!1),[k,S]=w.useState(!1),C=r.toLowerCase().includes("minimax"),N=r.toLowerCase().includes("alibaba");w.useEffect(()=>{e&&(o(e.name),s(e.apiKey),l(e.model??""),u(e.format??"anthropic"),p(e.baseUrl??""),x(e.apiDocsUrl??""),S(!1))},[e]),w.useEffect(()=>{const P=r.toLowerCase();for(const[L,E]of Object.entries(KT))if(P.includes(L)){k||(u(E.format),p(E.baseUrl)),E.apiDocsUrl!==void 0&&!f&&x(E.apiDocsUrl),L==="minimax"&&!a&&l(lc[0]??""),L==="alibaba"&&!a&&l(cc[0]??"");break}},[r]);function A(){const P={};return r.trim()||(P.name="Name is required"),i.trim()||(P.apiKey="API key is required"),a.trim()||(P.model="Model is required"),h.trim()?R(h.trim())||(P.baseUrl="Invalid URL format"):P.baseUrl="Base URL is required",y(P),Object.keys(P).length===0}function R(P){try{return new URL(P),!0}catch{return!1}}function O(P){if(P.preventDefault(),!!A()){v(!0);try{t({name:r.trim(),apiKey:i.trim(),model:a.trim()||void 0,format:c,baseUrl:h.trim()||void 0,apiDocsUrl:f.trim()||void 0})}finally{v(!1)}}}return d.jsxs("form",{onSubmit:O,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{id:"provider-name",type:"text",value:r,onChange:P=>o(P.target.value),placeholder:"Model Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.name!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{id:"provider-apikey",type:"password",value:i,onChange:P=>s(P.target.value),placeholder:"sk-ant-...",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.apiKey!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.apiKey})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-model",className:"text-sm font-medium",children:["Model ",d.jsx("span",{className:"text-destructive",children:"*"})]}),C||N?d.jsx("select",{id:"provider-model",value:a,onChange:P=>l(P.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:(C?lc:cc).map(P=>d.jsx("option",{value:P,children:P},P))}):d.jsx("input",{id:"provider-model",type:"text",value:a,onChange:P=>l(P.target.value),placeholder:"",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.model!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.model})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-format",className:"text-sm font-medium",children:["API Format ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsxs("select",{id:"provider-format",value:c,onChange:P=>u(P.target.value==="anthropic"?"anthropic":"openai"),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:"anthropic",children:"Anthropic (/v1/messages)"}),d.jsx("option",{value:"openai",children:"OpenAI (/v1/chat/completions)"})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:c==="anthropic"?"Use Anthropic format for /v1/messages endpoint":"Use OpenAI format for /v1/chat/completions endpoint"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-base-url",className:"text-sm font-medium",children:["Base URL ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{id:"provider-base-url",type:"text",value:h,onChange:P=>{S(!0),p(P.target.value)},placeholder:c==="anthropic"?"https://api.anthropic.com":"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.baseUrl!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.baseUrl}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Base URL for the provider API."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),d.jsx("input",{id:"provider-api-docs-url",type:"text",value:f,onChange:P=>x(P.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"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),d.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[d.jsx(ht,{type:"button",variant:"outline",onClick:n,disabled:g,children:"Cancel"}),d.jsx(ht,{type:"submit",disabled:g,children:g?"Saving...":e?"Update Provider":"Add Provider"})]})]})}const Hi=ce({id:G(),name:G(),apiKey:G(),model:G().optional(),format:jt(["anthropic","openai"]).optional(),baseUrl:G().optional(),anthropicBaseUrl:G().optional(),openaiBaseUrl:G().optional(),authHeader:jt(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:G().optional(),createdAt:G(),updatedAt:G()}),YT=jt(["timeout","network_unreachable","connection_refused","auth_failed","rate_limited","server_error","invalid_response","unknown"]),XT=ce({message:G(),type:YT,details:G().optional(),hint:G().optional()}),QT=ce({type:jt(["text","thinking"]),text:G().optional(),thinking:G().optional()}),e5=ce({success:et(),error:XT.optional(),model:G().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),cacheCreationInputTokens:ye().optional(),cacheReadInputTokens:ye().optional(),latencyMs:ye().optional(),content:Me(QT).optional(),rawResponse:G().optional(),streaming:et().optional(),streamingChunks:ce({chunks:Me(Qc),truncated:et().default(!1)}).optional(),requestHeaders:qt(G(),G()).optional()}),uc=$t([e5,ce({notConfigured:Te(!0)}),ce({testing:Te(!0)})]),dc=ce({nonStreaming:uc,streaming:uc}),t5=ce({anthropic:dc,openai:dc});function n5(){return{anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}}}function fc(e,t){const n=()=>({nonStreaming:{success:!1,error:{message:e,type:t}},streaming:{notConfigured:!0}});return{anthropic:n(),openai:n()}}const r5=ce({providerConfig:G()}),o5=ce({success:et().optional(),imported:ye().optional(),message:G().optional(),errors:Me(G()).optional()}),i5=30,di="Network error: could not reach the server. Is the proxy running?";function hc(e){return{name:e.name,apiKey:e.apiKey,model:e.model,format:e.format,anthropicBaseUrl:e.format==="anthropic"?e.baseUrl:void 0,openaiBaseUrl:e.format==="openai"?e.baseUrl:void 0}}function s5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[c,u]=w.useState(!1),[h,p]=w.useState(),[f,x]=w.useState(null),[m,y]=w.useState({}),[g,v]=w.useState(new Set),[k,S]=w.useState({}),[C,N]=w.useState(null),[A,R]=w.useState(!1),[O,P]=w.useState(null),L=w.useRef(null),E=w.useRef(null),M=e??[],_=n??m,D=r??g,J=o??k,Z=l?(te,oe)=>l(te,oe):(te,oe)=>{S(oe===void 0?me=>{const Ee={...me};return delete Ee[te],Ee}:me=>({...me,[te]:oe}))};w.useEffect(()=>{(async()=>{try{const te=await fetch("/api/config/paths");if(te.ok){const oe=await bn(te,r5);N(oe.providerConfig)}}catch{}})()},[]);const W=w.useCallback(te=>{E.current!==null&&clearTimeout(E.current),P(te),L.current?.scrollTo({top:L.current.scrollHeight,behavior:"smooth"}),E.current=setTimeout(()=>{P(null),E.current=null},2e3)},[]);w.useEffect(()=>()=>{E.current!==null&&clearTimeout(E.current)},[]);const q=w.useCallback(()=>{i?.().catch(()=>{})},[i]),j=w.useCallback((te,oe)=>{s?s(te,oe):y(me=>({...me,[te]:oe}))},[s]),U=w.useCallback((te,oe)=>{if(a){a(te,oe);return}v(me=>{const Ee=new Set(me);return oe?Ee.add(te):Ee.delete(te),Ee})},[a]),B=w.useCallback(async te=>{j(te,n5()),U(te,!0);const oe=new AbortController;let me=i5;Z(te,me);const Ee=setInterval(()=>{me--,Z(te,me),me<=0&&(clearInterval(Ee),oe.abort())},1e3);try{const b=await fetch(`/api/providers/${te}/test`,{method:"POST",signal:oe.signal});if(b.ok){const K=await bn(b,t5);j(te,K)}else j(te,fc(`HTTP ${b.status}: ${b.statusText}`,"server_error"))}catch(b){b instanceof Error&&b.name==="AbortError"&&j(te,fc("Request timed out","timeout"))}finally{clearInterval(Ee),Z(te,void 0),U(te,!1)}},[Z,j,U]);function T(te){(async()=>{let oe;try{oe=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(hc(te))})}catch{x(di);return}if(!oe.ok){x(await Mr(oe,"Failed to add provider"));return}const me=await bn(oe,Hi);u(!1),W(me.id),q(),await B(me.id)})()}function ee(te){h&&(async()=>{let oe;try{oe=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(hc(te))})}catch{x(di);return}if(!oe.ok){x(await Mr(oe,"Failed to update provider"));return}const me=await bn(oe,Hi);p(void 0),W(me.id),q(),await B(me.id)})()}function re(te){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let oe;try{oe=await fetch(`/api/providers/${te}`,{method:"DELETE"})}catch{x(di);return}if(!oe.ok){x(await Mr(oe,"Failed to delete provider"));return}q()})()}const ve=w.useRef(null);function ie(te){const oe="/api/providers/export";(async()=>{try{const me=await fetch(oe);if(!me.ok){x("Failed to export providers");return}const Ee=await me.blob(),b=URL.createObjectURL(Ee),K=document.createElement("a");K.href=b,K.download=me.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(b)}catch{x("Failed to export providers")}})()}function de(){ve.current?.click()}function ge(te){const oe=te.target.files?.[0];oe&&(async()=>{try{const me=await oe.text(),Ee=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(me)}),b=await bn(Ee,o5);Ee.ok&&b.imported!==void 0&&b.imported>0?(q(),x(null)):b.errors&&b.errors.length>0?x(b.errors.join("; ")):x(b.message??"Import failed")}catch{x("Failed to import providers")}te.target.value=""})()}return t?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):c||h?d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Provider":"Add New Provider"})}),d.jsx(JT,{provider:h,onSubmit:h?ee:T,onCancel:()=>{u(!1),p(void 0)}})]}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[d.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>ie(),className:"gap-1 hover:bg-muted",children:[d.jsx(su,{className:"size-3"}),"Export"]}),d.jsxs(ht,{variant:"outline",size:"sm",onClick:de,className:"gap-1 hover:bg-muted",children:[d.jsx(Gv,{className:"size-3"}),"Import"]}),d.jsx("input",{type:"file",ref:ve,accept:".json",onChange:ge,style:{display:"none"}}),d.jsxs(ht,{onClick:()=>u(!0),size:"sm",className:"gap-1",children:[d.jsx(Sa,{className:"size-4"}),"Add Provider"]})]})]}),C!==null&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[d.jsx("span",{className:"shrink-0",children:"Config:"}),d.jsx("span",{className:"font-mono truncate",title:C,children:C}),d.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(C).then(()=>{R(!0),setTimeout(()=>R(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:A?d.jsx(fr,{className:"size-3 text-green-500"}):d.jsx(uo,{className:"size-3"})})]}),f!==null&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[d.jsx(yi,{className:"size-4 shrink-0"}),f]}),M.length===0?d.jsxs("div",{className:"text-center py-12 space-y-3",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),d.jsxs(ht,{onClick:()=>u(!0),variant:"outline",size:"sm",children:[d.jsx(Sa,{className:"size-4"}),"Add Your First Provider"]})]}):d.jsx("div",{ref:L,className:"space-y-3",children:M.map(te=>d.jsx(GT,{provider:te,testResults:_[te.id],isTesting:D.has(te.id),testingTimeLeft:J[te.id],isHighlighted:te.id===O,onEdit:oe=>p(oe),onDelete:re,onTest:oe=>{B(oe)}},te.id))})]})}async function a5(e){return rs(e,Hi.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function l5(){const e=pc("/api/providers",a5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function c5(){const[e,t]=w.useState(!1),[n,r]=w.useState("providers"),{providers:o,isLoading:i,mutate:s}=l5(),[a,l]=w.useState({}),[c,u]=w.useState(new Set),[h,p]=w.useState({}),f=w.useCallback((y,g)=>{l(v=>({...v,[y]:g}))},[]),x=w.useCallback((y,g)=>{u(v=>{const k=new Set(v);return g?k.add(y):k.delete(y),k})},[]),m=w.useCallback((y,g)=>{p(v=>{if(g===void 0){const k={...v};return delete k[y],k}return{...v,[y]:g}})},[]);return d.jsxs(Oh,{open:e,onOpenChange:t,children:[d.jsx(mT,{asChild:!0,children:d.jsxs(ht,{variant:"ghost",size:"icon",className:"size-8",children:[d.jsx($v,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Settings"})]})}),d.jsxs(Dh,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[d.jsx(Mh,{children:d.jsx(Lh,{children:"Settings"})}),d.jsxs(kn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"providers",children:"Providers"}),d.jsx(Ge,{value:"proxy",children:"Proxy"})]}),d.jsxs("div",{className:"mt-4 overflow-y-auto flex-1",children:[d.jsx(Ke,{value:"providers",children:d.jsx(s5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:c,externalTestingTimeLeft:h,onProvidersMutate:()=>s(),onTestResultsChange:f,onTestingProvidersChange:x,onTestingTimeLeftChange:m})}),d.jsx(Ke,{value:"proxy",children:d.jsx(u5,{})})]})]})]})]})}function u5(){const{strip:e,isLoading:t,setStrip:n}=tu(),[r,o]=w.useState(null),[i,s]=w.useState(!1),a=w.useCallback(async l=>{o(null),s(!0);try{await n(l)}catch(c){o(c instanceof Error?c.message:String(c))}finally{s(!1)}},[n]);return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Claude Code billing header"}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["When enabled, the proxy strips the synthetic ",d.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 ",d.jsx("code",{children:"LLM_INSPECTOR_STRIP_CLAUDE_CODE_BILLING_HEADER"})," environment variable; your choice is persisted to ",d.jsx("code",{children:"config.json"})," and overrides the env var for subsequent requests."]})]}),d.jsxs("label",{className:"flex items-center gap-3",children:[d.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"}),d.jsx("span",{className:"text-sm",children:t?"Loading…":e?"Stripping enabled":"Stripping disabled"})]}),r!==null&&d.jsxs("p",{className:"text-xs text-destructive",children:["Failed to save: ",r]})]})}function d5(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function f5(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 h5({command:e}){const[t,n]=w.useState(!1),r=w.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return d.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[d.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),d.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?d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M20 6 9 17l-5-5"})}):d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),d.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 p5({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:c,strip:u}){const{totalIn:h,totalOut:p}=f5(e),[f,x]=w.useState(!0),[m,y]=w.useState(!1),g=w.useCallback(async()=>{y(!0);try{await ub(e)}finally{y(!1)}},[e]),v=w.useRef(null),k=w.useMemo(()=>tS(e),[e]),S=e.length>0&&f&&!(k.length===1&&k[0]?.logs.length===e.length),C=ru({count:S?k.length:e.length,getScrollElement:()=>v.current,estimateSize:()=>150,measureElement:typeof window<"u"?N=>N.getBoundingClientRect().height:void 0,overscan:5});return d.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[d.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[d.jsxs("h1",{className:"text-lg font-bold flex-1 flex items-center gap-2",children:[d.jsx($T,{className:"size-10 text-amber-500 self-center"}),d.jsxs("span",{className:"flex items-baseline gap-2",children:["LLM Inspector",d.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["v",fb.version]})]})]}),d.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[d.jsx("button",{type:"button",onClick:()=>c("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),d.jsx("button",{type:"button",onClick:()=>c("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]}),d.jsx(c5,{}),d.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&&d.jsx("button",{type:"button",onClick:()=>{g()},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?d.jsx("span",{children:"Exporting..."}):d.jsxs(d.Fragment,{children:[d.jsx(su,{className:"size-3"}),d.jsx("span",{children:"Export All"})]})}),d.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"})]}),d.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[d.jsxs(rc,{value:r,onValueChange:i,children:[d.jsx(ic,{className:"flex-1 max-w-[400px] text-xs",children:d.jsx(oc,{placeholder:"All sessions"})}),d.jsxs(sc,{children:[d.jsx(Dr,{value:"__all__",children:"All sessions"}),t.map(N=>d.jsx(Dr,{value:N,children:d5(N)},N))]})]}),d.jsxs(rc,{value:o,onValueChange:s,children:[d.jsx(ic,{className:"text-xs",children:d.jsx(oc,{placeholder:"All models"})}),d.jsxs(sc,{children:[d.jsx(Dr,{value:"__all__",children:"All models"}),n.map(N=>d.jsx(Dr,{value:N,children:N},N))]})]}),d.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[d.jsx("button",{type:"button",onClick:()=>x(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${f?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:d.jsx(vv,{className:"size-4"})}),d.jsx("button",{type:"button",onClick:()=>x(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${f?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:d.jsx(wv,{className:"size-4"})})]})]}),d.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?d.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[d.jsx("p",{className:"text-sm",children:"No requests captured yet."}),d.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),d.jsx(h5,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):d.jsx("div",{ref:v,className:"overflow-y-auto h-full",children:d.jsx("div",{style:{height:`${C.getTotalSize()}px`,width:"100%",position:"relative"},children:C.getVirtualItems().map(N=>{if(S){const A=k[N.index];return A===void 0?null:d.jsx("div",{"data-index":N.index,ref:C.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:d.jsx(FT,{group:A,viewMode:l,strip:u})},A.id)}else{const A=e[N.index];return A===void 0?null:d.jsx("div",{"data-index":N.index,ref:C.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:d.jsx(Uh,{log:A,viewMode:l,strip:u})},A.id)}})})})})]})}ce({logs:Me(gi),total:ye(),offset:ye(),limit:ye()});const m5=$t([ce({type:Te("init"),logs:Me(gi)}),ce({type:Te("update"),log:gi})]);function g5(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function x5(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function y5(){const[e,t]=w.useState([]),[n,r]=w.useState([]),[o,i]=w.useState([]),[s,a]=w.useState("__all__"),[l,c]=w.useState("__all__"),[u,h]=w.useState("simple"),[p,f]=w.useState(null),x=w.useRef(null),m=w.useRef(null),y=w.useCallback(async()=>{try{const[S,C]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&C.ok){const N=await S.json(),A=await C.json(),R=Me(G()).safeParse(N),O=Me(G()).safeParse(A);R.success&&r(R.data),O.success&&i(O.data)}}catch{}},[]),g=w.useCallback(()=>{x.current&&x.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const C=new EventSource(`/api/logs/stream?${S}`);x.current=C,C.onmessage=N=>{try{const A=String(N.data),R=JSON.parse(A),O=m5.safeParse(R);if(!O.success){f("Failed to parse SSE data");return}const P=O.data;P.type==="init"?(t(P.logs),r(g5(P.logs)),i(x5(P.logs)),f(null)):P.type==="update"&&(t(L=>{const E=s==="__all__"||P.log.sessionId===s,M=l==="__all__"||P.log.model===l;return!E||!M?L:L.findIndex(D=>D.id===P.log.id)>=0?L.map(D=>D.id===P.log.id?P.log:D):[...L,P.log]}),r(L=>{const E=P.log.sessionId;return E!=null&&E!==""?L.includes(E)?L:[...L,E]:L}),i(L=>{const E=P.log.model;return E!=null&&E!==""?L.includes(E)?L:[...L,E]:L}))}catch{f("Failed to parse SSE data")}},C.onerror=()=>{f("SSE connection lost, reconnecting..."),C.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},y()},[s,l,y]);w.useEffect(()=>(g(),()=>{x.current&&(x.current.close(),x.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const v=w.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 d.jsxs(d.Fragment,{children:[p!==null&&d.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}),d.jsx(p5,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:c,onClearAll:v,viewMode:u,onViewModeChange:h,strip:k})]})}const w5=y5;export{w5 as component};
|
|
105
|
+
`);if(n===r)return{lines:[],isEmpty:!0};const o=Oh(n,r);return{lines:Wi(o),isEmpty:!1}}function Yl(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function GN(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=Yl(n),i=Yl(r);if(o!==null&&i!==null){const a=HN(o,i)??[];if(a.length===1){const l=a[0];if(l!==void 0&&!l.added&&!l.removed)return{lines:[],isEmpty:!0}}return{lines:Wi(a),isEmpty:!1}}const s=Oh(n,r);return{lines:Wi(s),isEmpty:!1}}const KN=22,ci=1e4;function JN(e){return e==="added"?"+":e==="removed"?"-":" "}function YN(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 Xl({result:e,emptyLabel:t}){const[n,r]=w.useState("unified"),o=w.useRef(null),i=iu({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>KN,overscan:10});if(e.isEmpty)return d.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>ci,l=a?e.lines.slice(0,ci):e.lines;return d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[d.jsxs("span",{children:[s.toLocaleString()," line",s===1?"":"s",a&&` (showing first ${ci.toLocaleString()})`]}),d.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[d.jsxs("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":n==="unified",className:Se("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:[d.jsx(Uv,{className:"size-3"}),"Unified"]}),d.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:Se("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:[d.jsx(cv,{className:"size-3"}),"Split"]})]})]}),d.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"?d.jsx(XN,{virtualizer:i,lines:l}):d.jsx(tT,{lines:l})})]})}function XN({virtualizer:e,lines:t}){return d.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:d.jsxs("div",{"data-index":n.index,ref:e.measureElement,className:Se("flex items-start gap-3 px-2",YN(r.kind)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},children:[d.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.oldLineNumber??""}),d.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.newLineNumber??""}),d.jsx("span",{className:Se("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:JN(r.kind)}),d.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function QN(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],c=i[a];l!==void 0&&c!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:{text:c.text,lineNumber:c.newLineNumber},kind:"changed"}):l!==void 0?t.push({left:{text:l.text,lineNumber:l.oldLineNumber},right:null,kind:"removed"}):c!==void 0&&t.push({left:null,right:{text:c.text,lineNumber:c.newLineNumber},kind:"added"})}}return t}function eT(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 tT({lines:e}){const t=QN(e);return d.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>d.jsxs("div",{className:Se("grid grid-cols-2 font-mono text-xs",eT(n.kind)),children:[d.jsxs("div",{className:"flex items-start gap-2 px-2 border-r border-border/50",children:[d.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.left?.lineNumber??""}),d.jsx("span",{className:Se("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?"-":" "}),d.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.left?.text??""})]}),d.jsxs("div",{className:"flex items-start gap-2 px-2",children:[d.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.right?.lineNumber??""}),d.jsx("span",{className:Se("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?"+":" "}),d.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.right?.text??""})]})]},r))})}const nT="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",rT="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",oT="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",iT="/assets/minimax-BPMzvuL-.jpeg",sT="/assets/alibaba-TTwafVwX.svg",aT="/assets/qwen-CONDcHqt.png",lT="/assets/zhipuai-BPNAnxo-.svg",cT={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function uT(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(cT))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const fn={width:24,height:24,objectFit:"contain"},dT=nt.memo(({className:e})=>d.jsx("img",{src:nT,alt:"Anthropic",className:e,style:fn})),fT=nt.memo(({className:e})=>d.jsx("img",{src:rT,alt:"OpenAI",className:e,style:{...fn,background:"white",borderRadius:"4px"}})),hT=nt.memo(({className:e})=>d.jsx("img",{src:oT,alt:"DeepSeek",className:e,style:fn})),pT=nt.memo(({className:e})=>d.jsx("img",{src:iT,alt:"MiniMax",className:e,style:fn})),mT=nt.memo(({className:e})=>d.jsx("img",{src:sT,alt:"Alibaba",className:e,style:fn})),gT=nt.memo(({className:e})=>d.jsx("img",{src:aT,alt:"Qwen",className:e,style:fn})),xT=nt.memo(({className:e})=>d.jsx("img",{src:lT,alt:"ZhipuAI",className:e,style:fn}));function yT({provider:e,className:t}){switch(e){case"anthropic":return d.jsx(dT,{className:t});case"openai":return d.jsx(fT,{className:t});case"deepseek":return d.jsx(hT,{className:t});case"minimax":return d.jsx(pT,{className:t});case"alibaba":return d.jsx(mT,{className:t});case"qwen":return d.jsx(gT,{className:t});case"zhipuai":return d.jsx(xT,{className:t});case"unknown":return null}}function vT(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const Ql={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 ec({trend:e}){if(e===null)return null;const t=e.direction==="up",n=t?Zy:By,r=t?"+":"-";return d.jsxs("span",{className:"flex items-center gap-0.5 text-muted-foreground tabular-nums",children:[d.jsx(n,{className:t?"size-3 text-emerald-400":"size-3 text-rose-400"}),d.jsxs("span",{className:"font-mono",children:[r,Je(e.delta)]})]})}const bT=w.memo(function({log:e,parsedRequest:t,expanded:n,onToggle:r,suppressApiFormatBadge:o=!1,cacheTrend:i=null}){const s=ju(e.responseStatus),a=e.inputTokens!==null||e.outputTokens!==null,l=t!==null?t.messages.length:null,c=t!==null&&t.tools!==void 0&&t.tools.length>0?t.tools.length:null;return d.jsxs("div",{role:"button",tabIndex:0,className:Se("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:r,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),r())},children:[d.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",e.id]}),e.model!==null&&d.jsxs(d.Fragment,{children:[d.jsx(yT,{provider:uT(e.model),className:"size-4 shrink-0"}),d.jsx(ct,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model})]}),!o&&d.jsx(ct,{variant:"outline",className:Se("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"}),s==="server_error"?d.jsx(ct,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):s==="pending"?d.jsx(ct,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ql[s]),children:d.jsx(du,{className:"size-3 animate-spin"})}):d.jsx(ct,{variant:"outline",className:Se("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ql[s]),children:e.responseStatus}),e.elapsedMs!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(os,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums",children:vT(e.elapsedMs)})]}),a&&d.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[d.jsx(hr,{className:"size-3 text-muted-foreground"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[d.jsxs("span",{className:e.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",e.inputTokens!==null?Je(e.inputTokens):"—"]})," / ",d.jsxs("span",{className:e.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",e.outputTokens!==null?Je(e.outputTokens):"—"]})]})]}),e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&d.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[d.jsx(ec,{trend:i?.creation??null}),d.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(e.cacheCreationInputTokens)]})]}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&d.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[d.jsx(ec,{trend:i?.read??null}),d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.cacheReadInputTokens)]})]}),l!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(fu,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums",children:l})]}),c!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[d.jsx(lb,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums",children:c})]}),e.origin!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${e.origin}`,children:[d.jsx(kv,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:e.origin,children:e.origin})]}),e.userAgent!==null&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`User-Agent: ${e.userAgent}`,children:[d.jsx(nb,{className:"size-3"}),d.jsx("span",{className:"font-mono tabular-nums truncate max-w-[150px]",title:e.userAgent,children:e.userAgent})]}),(e.clientPid!==null||e.clientProjectFolder!==null)&&d.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:[d.jsx(xv,{className:"size-3"}),e.clientProjectFolder!==null?d.jsx("span",{className:"font-mono tabular-nums",children:e.clientProjectFolder}):d.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",e.clientPid]})]}),e.streaming&&d.jsx(Lv,{className:"size-3 text-muted-foreground/60 shrink-0"}),d.jsx("span",{className:"flex-1 min-w-0"}),n?d.jsx(At,{className:"size-4 text-muted-foreground shrink-0"}):d.jsx(Gt,{className:"size-4 text-muted-foreground shrink-0"})]})});function Mh({...e}){return d.jsx(Zw,{"data-slot":"dialog",...e})}function wT({...e}){return d.jsx(Vw,{"data-slot":"dialog-trigger",...e})}function _T({...e}){return d.jsx(Ww,{"data-slot":"dialog-portal",...e})}function kT({className:e,...t}){return d.jsx(Hw,{"data-slot":"dialog-overlay",className:Se("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 Lh({className:e,children:t,...n}){return d.jsxs(_T,{children:[d.jsx(kT,{}),d.jsxs(qw,{"data-slot":"dialog-content",className:Se("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,d.jsxs(Kw,{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:[d.jsx(ub,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Fh({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function $h({className:e,...t}){return d.jsx(Gw,{"data-slot":"dialog-title",className:Se("text-lg font-semibold leading-none tracking-tight",e),...t})}function Bh({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return d.jsx(Nk,{"data-slot":"separator",decorative:n,orientation:t,className:Se("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 Hs({...e}){return d.jsx(A1,{"data-slot":"collapsible",...e})}function qs({...e}){return d.jsx(Mu,{"data-slot":"collapsible-trigger",...e})}function Gs({...e}){return d.jsx(Lu,{"data-slot":"collapsible-content",...e})}function Uh({className:e,children:t,...n}){return d.jsxs($_,{"data-slot":"scroll-area",className:Se("relative",e),...n,children:[d.jsx(B_,{"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}),d.jsx(ST,{}),d.jsx(U_,{})]})}function ST({className:e,orientation:t="vertical",...n}){return d.jsx(Gd,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Se("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:d.jsx(Xd,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function CT(e){return d.jsx(d.Fragment,{})}function ET({text:e}){const[t,n]=w.useState(!1);return d.jsxs(Hs,{open:t,onOpenChange:n,children:[d.jsxs(qs,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"}),d.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),d.jsx(Gs,{children:d.jsx("div",{className:"pl-4 pt-1",children:d.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:d.jsx(Mn,{children:e})})})})]})}const NT=/<think>([\s\S]*?)<\/think>/gi,TT=/<think>([\s\S]*?)<\/think>/i;function Zh(e){const t=TT.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(NT,"").trim();return{thinking:n,remainingText:r}}function jT({text:e}){if(e.includes("<system-reminder>"))return d.jsx(ET,{text:e});const{thinking:t,remainingText:n}=Zh(e);return d.jsxs("div",{className:"space-y-2",children:[t!==null&&d.jsx(io,{thinking:t}),n.length>0&&d.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:d.jsx(Mn,{children:n})}),t===null&&n.length===0&&d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}function io({thinking:e}){const[t,n]=w.useState(!1);return d.jsx(Hs,{open:t,onOpenChange:n,children:d.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[d.jsxs(qs,{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:[d.jsx(Wy,{className:"size-3.5 text-purple-400 shrink-0"}),d.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),d.jsxs(ct,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),d.jsx("span",{className:"flex-1"}),t?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"})]}),d.jsx(Gs,{children:d.jsx("div",{className:"px-3 pb-2",children:d.jsx(Uh,{className:"max-h-[60vh]",children:d.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function AT({name:e,input:t}){const[n,r]=w.useState(!1);return d.jsx(Hs,{open:n,onOpenChange:r,children:d.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[d.jsxs(qs,{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:[d.jsx(Gv,{className:"size-3.5 text-blue-400 shrink-0"}),d.jsx(ct,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),d.jsx("span",{className:"flex-1"}),n?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"})]}),d.jsx(Gs,{children:d.jsx("div",{className:"px-3 pb-2",children:d.jsx(Uh,{className:"max-h-[60vh]",children:d.jsx(Ws,{data:ur(t),defaultExpandDepth:2})})})})]})})}function IT({block:e}){switch(e.type){case"text":return d.jsx(jT,{text:e.text});case"thinking":case"think":return d.jsx(io,{thinking:e.thinking});case"tool_use":return d.jsx(AT,{name:e.name,input:e.input});default:return CT()}}function zT({response:e}){return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(ct,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&d.jsxs(ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[d.jsx(au,{className:"size-2.5"}),e.stop_reason]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[d.jsx(hr,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.input_tokens??0)," in /"," ",Je(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&&d.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(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&&d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(e.usage.cache_read_input_tokens)]})]})]}),d.jsx(Bh,{className:"opacity-50"}),d.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>d.jsx(IT,{block:t},n)),e.content.length===0&&d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function PT({response:e}){const t=e.choices[0],n=t?.message;return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx(ct,{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&&d.jsxs(ct,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[d.jsx(au,{className:"size-2.5"}),t.finish_reason]}),d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[d.jsx(hr,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[Je(e.usage.prompt_tokens??0)," in /"," ",Je(e.usage.completion_tokens??0)," out"]})]})]}),d.jsx(Bh,{className:"opacity-50"}),d.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&d.jsx(io,{thinking:n.reasoning_content}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&(()=>{const r=n.reasoning_content!==null&&n.reasoning_content!==void 0&&n.reasoning_content.length>0,{thinking:o,remainingText:i}=Zh(n.content);return d.jsxs("div",{className:"space-y-2",children:[o!==null&&!r&&d.jsx(io,{thinking:o}),i.length>0&&d.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:d.jsx(Mn,{children:i})})]})})(),n?.function_call!==null&&n?.function_call!==void 0&&d.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[d.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),d.jsxs("div",{className:"font-mono text-xs",children:[d.jsx("span",{className:"text-blue-300",children:n.function_call.name}),d.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)&&d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function RT(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function OT(e,t){return RT(t)?d.jsx(PT,{response:t}):d.jsx(zT,{response:t})}function DT(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 MT(e,t){try{let n=JSON.parse(e);if(typeof n=="string"&&(n=JSON.parse(n)),t==="openai"){const o=my(e);if(o)return o}const r=cy.safeParse(n);return r.success?r.data:null}catch{return null}}function Qn({status:e}){const t=ju(e),n=DT(t);return e===null?d.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):d.jsxs("span",{className:Se("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&d.jsx(Xv,{className:"size-3"}),e]})}function tc({text:e}){return d.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:d.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function LT({text:e}){return d.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:d.jsx(Mn,{children:e})})}function Ur({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 d.jsxs("div",{className:"flex items-center gap-2 py-3",children:[d.jsx(Qn,{status:t}),d.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return d.jsxs("div",{className:"space-y-2",children:[d.jsx(Qn,{status:t}),d.jsx(tc,{text:e??""}),l!=null&&d.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[d.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),d.jsx("div",{className:"text-muted-foreground font-mono",children:l})]})]});if(l!=null)return d.jsxs("div",{className:"space-y-2",children:[d.jsx(Qn,{status:t}),d.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[d.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),d.jsx("div",{className:"text-muted-foreground font-mono",children:l})]}),e!==null&&d.jsx("div",{className:"mt-2",children:d.jsx(tc,{text:e})})]});const u=e!==null?MT(e,a):null;return u!==null?d.jsxs("div",{className:"space-y-2",children:[d.jsx(Qn,{status:t}),OT(a,u)]}):d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Qn,{status:t}),n&&(r!==null||o!==null)&&d.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[d.jsx(hr,{className:"size-3"}),d.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Je(r):"—"," in /"," ",o!==null?Je(o):"—"," out"]}),i!=null&&i>0&&d.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Je(i)]}),s!=null&&s>0&&d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Je(s)]})]})]}),d.jsx(LT,{text:e??""})]})}const FT=ce({success:et(),error:G().optional(),responseStatus:ye().optional(),responseText:G().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),elapsedMs:ye().optional(),streaming:et().optional()});function $T({log:e,open:t,onOpenChange:n}){const[r,o]=w.useState(()=>e.rawRequestBody??"{}"),[i,s]=w.useState(null),[a,l]=w.useState(!1),[c,u]=w.useState(null);async function h(){l(!0),u(null),s(null);try{const x=await(await fetch(`/api/logs/${e.id}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({modifiedBody:r})})).json(),m=FT.safeParse(x);if(!m.success){u("Invalid response from server"),l(!1);return}const y=m.data;s(y),y.success||u(y.error??"Replay failed")}catch(f){u(f instanceof Error?f.message:"Network error")}finally{l(!1)}}function p(){s(null),u(null),n(!1)}return d.jsx(Mh,{open:t,onOpenChange:p,children:d.jsxs(Lh,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[d.jsx(Fh,{children:d.jsxs($h,{className:"flex items-center gap-2",children:[d.jsx(hu,{className:"size-4"}),"Replay Request #",e.id]})}),d.jsxs(kn,{defaultValue:"modified",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"modified",children:"Modified Request"}),d.jsx(Ge,{value:"original",children:"Original Response"}),i&&d.jsx(Ge,{value:"replay",children:"Replay Response"})]}),d.jsxs(Ke,{value:"modified",className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),d.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})]}),c!==null&&c!==""&&d.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:c}),d.jsx("div",{className:"flex justify-end",children:d.jsx(ht,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),i&&i.success&&d.jsxs(kn,{defaultValue:"parsed",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"parsed",children:"Response"}),d.jsx(Ge,{value:"raw",children:"Raw Response"})]}),d.jsx(Ke,{value:"parsed",children:d.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),d.jsx(Ke,{value:"raw",children:d.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"})})]})]}),d.jsx(Ke,{value:"original",children:e.responseText!==null?d.jsxs(kn,{defaultValue:"parsed",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"parsed",children:"Response"}),d.jsx(Ge,{value:"raw",children:"Raw Response"})]}),d.jsx(Ke,{value:"parsed",children:d.jsx(Ur,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),d.jsx(Ke,{value:"raw",children:d.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):d.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),i&&i.success&&d.jsx(Ke,{value:"replay",children:i.responseText!==null?d.jsxs(kn,{defaultValue:"parsed",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"parsed",children:"Response"}),d.jsx(Ge,{value:"raw",children:"Raw Response"})]}),d.jsx(Ke,{value:"parsed",children:d.jsx(Ur,{responseText:i.responseText??null,responseStatus:i.responseStatus??null,streaming:i.streaming??!1,inputTokens:i.inputTokens??null,outputTokens:i.outputTokens??null,apiFormat:e.apiFormat})}),d.jsx(Ke,{value:"raw",children:d.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:i.responseText})})]}):d.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function BT({logId:e,truncated:t}){const[n,r]=w.useState(!1),[o,i]=w.useState({status:"idle"}),[s,a]=w.useState(new Set);w.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=w.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]),c=h=>{a(p=>{const f=new Set(p);return f.has(h)?f.delete(h):f.add(h),f})};function u(){return o.status==="idle"||o.status==="loading"?d.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[d.jsx(du,{className:"size-3 animate-spin"}),d.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?d.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):d.jsxs("div",{className:"p-2 space-y-1",children:[d.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 d.jsxs("div",{className:"rounded border border-border bg-background",children:[d.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>c(h.index),children:[p?d.jsx(At,{className:"size-3 text-muted-foreground"}):d.jsx(Gt,{className:"size-3 text-muted-foreground"}),d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",h.index,"] ",h.chunks[0]?.type??""]}),d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[h.chunks.length," chunk",h.chunks.length!==1?"s":""]})]}),p&&d.jsx("div",{className:"px-2 pb-2 space-y-1",children:h.chunks.map(f=>d.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",f.timestamp,"ms"]}),d.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:f.type})]}),d.jsx(Ws,{data:f,defaultExpandDepth:1,showCopy:!0})]},f.index))})]},h.index)})]})}return d.jsxs("div",{className:"space-y-1",children:[d.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?d.jsx(At,{className:"size-3"}):d.jsx(Gt,{className:"size-3"}),d.jsx("span",{children:"Raw SSE Events"}),d.jsxs(ct,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]}),n===!0?d.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:u()}):null]})}function nc(e,t,n){return e==="anthropic"&&t==="full"&&n}function UT(e,t){return e==="full"&&t}function ZT(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function ui({text:e,label:t,copied:n,onCopy:r}){return e===null?null:d.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?d.jsxs(d.Fragment,{children:[d.jsx(fr,{className:"size-3 text-green-500"}),d.jsx("span",{className:"text-green-500",children:"Copied!"})]}):d.jsxs(d.Fragment,{children:[d.jsx(uo,{className:"size-3"}),d.jsx("span",{children:t})]})})}function rc({active:e,onClick:t}){return d.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:Se("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:[d.jsx(wv,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}const Vh=w.memo(function({log:e,viewMode:t="simple",suppressApiFormatBadge:n=!1,strip:r,cacheTrend:o=null}){const[i,s]=w.useState(!1),[a,l]=w.useState(!1),[c,u]=w.useState(!1),[h,p]=w.useState(!1),[f,x]=w.useState(!1),[m,y]=w.useState(!1),[g,v]=w.useState(!1),k=w.useMemo(()=>xy(e.rawRequestBody),[e.rawRequestBody]),E=w.useMemo(()=>!r||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:fS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,r])??e.rawRequestBody,N=w.useMemo(()=>qN(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),T=w.useMemo(()=>GN(e.rawRequestBody,E),[e.rawRequestBody,E]);function P(M){M.stopPropagation(),E!==null&&window.navigator.clipboard.writeText(E).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})}function R(M){M.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)})}function D(M){M.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})}return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:Se("border border-border rounded-lg mb-3 overflow-hidden"),children:[d.jsx(bT,{log:e,parsedRequest:k,expanded:i,onToggle:()=>s(!i),suppressApiFormatBadge:n,cacheTrend:o}),i&&d.jsx("div",{onClick:M=>M.stopPropagation(),onKeyDown:M=>M.stopPropagation(),children:d.jsxs(kn,{defaultValue:"request",children:[d.jsxs(Sn,{className:"mx-4 mt-2",children:[t==="full"&&d.jsx(Ge,{value:"raw-headers",children:"Raw Headers"}),t==="full"&&d.jsx(Ge,{value:"headers",children:"Headers"}),nc(e.apiFormat,t,r)&&d.jsx(Ge,{value:"raw-request",children:"Raw Request"}),d.jsx(Ge,{value:"request",children:"Request"}),t==="full"&&d.jsx(Ge,{value:"raw",children:"Raw Response"}),d.jsx(Ge,{value:"parsed",children:"Response"})]}),nc(e.apiFormat,t,r)&&d.jsx(Ke,{value:"raw-request",children:d.jsxs("div",{className:"px-4 py-3",children:[d.jsx("div",{className:"flex justify-end mb-2",children:d.jsx(ui,{text:e.rawRequestBody,label:"Copy Raw Request",copied:c,onCopy:R})}),e.rawRequestBody!==null?d.jsx(li,{text:e.rawRequestBody,defaultExpandDepth:1}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),d.jsx(Ke,{value:"request",children:d.jsxs("div",{className:"px-4 py-3",children:[d.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[ZT(e.apiFormat,t,r,e.rawRequestBody!==null)&&d.jsx(rc,{active:g,onClick:M=>{M.stopPropagation(),v(!g)}}),d.jsxs(ht,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:M=>{M.stopPropagation(),x(!0)},children:[d.jsx(hu,{className:"size-3 mr-1"}),"Replay"]}),d.jsx(ui,{text:E,label:"Copy Request",copied:a,onCopy:P})]}),g?d.jsx(Xl,{result:T,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):E!==null?d.jsx(li,{text:E,defaultExpandDepth:1}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),t==="full"&&d.jsx(Ke,{value:"headers",children:d.jsxs("div",{className:"px-4 py-3",children:[d.jsx("div",{className:"flex justify-end gap-2 mb-2",children:UT(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&d.jsx(rc,{active:m,onClick:M=>{M.stopPropagation(),y(!m)}})}),m?d.jsx(Xl,{result:N,emptyLabel:"No transformation applied — raw and processed headers are identical."}):e.headers&&Object.keys(e.headers).length>0?d.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.headers).sort(([M],[C])=>M.localeCompare(C)).map(([M,C])=>d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[M,":"]}),d.jsx("span",{className:"text-muted-foreground truncate",title:C,children:C})]},M))}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})]})}),t==="full"&&d.jsx(Ke,{value:"raw-headers",children:d.jsx("div",{className:"px-4 py-3",children:e.rawHeaders&&Object.keys(e.rawHeaders).length>0?d.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.rawHeaders).sort(([M],[C])=>M.localeCompare(C)).map(([M,C])=>d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[M,":"]}),d.jsx("span",{className:"text-muted-foreground truncate",title:C,children:C})]},M))}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),d.jsx(Ke,{value:"raw",children:d.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.error!==void 0&&e.error!==null&&d.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[d.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),d.jsx("div",{className:"text-muted-foreground font-mono",children:e.error})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx(ui,{text:e.responseText,label:"Copy Response",copied:h,onCopy:D})}),e.responseText!==null?d.jsx(li,{text:e.responseText,defaultExpandDepth:1}):d.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),e.streaming===!0&&d.jsx(BT,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),d.jsx(Ke,{value:"parsed",children:d.jsx("div",{className:"px-4 py-3",children:d.jsx(Ur,{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})})})]})})]}),d.jsx($T,{log:e,open:f,onOpenChange:x})]})});function VT(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 WT=w.memo(function({group:e,viewMode:t="simple",strip:n,cacheTrends:r}){const[o,i]=w.useState(!1),s=VT(e.logs),a=e.logs[0]?.timestamp??new Date().toISOString(),l=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),c=iS(e.logs),u=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 d.jsxs("div",{className:"mb-4",children:[d.jsx(rS,{conversationId:u,startTime:a,endTime:l,totalCalls:e.logs.length,totalInputTokens:s.totalInputTokens,totalOutputTokens:s.totalOutputTokens,apiFormat:oS(e.logs),expanded:o,onToggle:()=>i(!o),hideApiFormat:c}),o&&d.jsx("div",{className:"pl-4 border-l-2 border-muted ml-3",children:e.logs.map(h=>d.jsx(Vh,{log:h,viewMode:t,suppressApiFormatBadge:!c,strip:n,cacheTrend:r?.get(h.id)??null},h.id))})]})});function HT({className:e}){return d.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:Se("inline-block size-5",e),children:[d.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"}),d.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),d.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),d.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),d.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"}),d.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),d.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),d.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),d.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),d.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),d.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]})}function oc({...e}){return d.jsx(fk,{"data-slot":"select",...e})}function ic({...e}){return d.jsx(pk,{"data-slot":"select-value",...e})}function sc({className:e,size:t="default",children:n,...r}){return d.jsxs(hk,{"data-slot":"select-trigger","data-size":t,className:Se("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,d.jsx(mk,{asChild:!0,children:d.jsx(At,{className:"size-4 opacity-50"})})]})}function ac({className:e,children:t,position:n="popper",align:r="center",...o}){return d.jsx(gk,{children:d.jsxs(xk,{"data-slot":"select-content",className:Se("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:[d.jsx(qT,{}),d.jsx(yk,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(GT,{})]})})}function Dr({className:e,children:t,...n}){return d.jsxs(vk,{"data-slot":"select-item",className:Se("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:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(wk,{children:d.jsx(fr,{className:"size-4"})})}),d.jsx(bk,{children:t})]})}function qT({className:e,...t}){return d.jsx(_k,{"data-slot":"select-scroll-up-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(Jy,{className:"size-4"})})}function GT({className:e,...t}){return d.jsx(kk,{"data-slot":"select-scroll-down-button",className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(At,{className:"size-4"})})}const KT={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function JT(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}function YT(e){return Object.prototype.hasOwnProperty.call(e,"success")}function XT(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function QT(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return d.jsx(os,{...t});case"network_unreachable":return d.jsx(ob,{...t});case"connection_refused":return d.jsx(sb,{...t});case"auth_failed":return d.jsx(Av,{...t});case"rate_limited":return d.jsx(vv,{...t});case"server_error":return d.jsx(Vv,{...t});case"invalid_response":return d.jsx(iv,{...t});case"unknown":return d.jsx(yi,{...t});default:return d.jsx(yi,{...t})}}function lc({result:e}){const[t,n]=w.useState(!1);if(!YT(e))return XT(e)?d.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[d.jsx(Pv,{className:"size-3"}),d.jsx("span",{children:"Not configured"})]}):d.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[d.jsx(pu,{className:"size-3 animate-spin"}),d.jsx("span",{children:"Testing..."})]});if(e.success){const l=[];e.inputTokens!==void 0&&l.push(d.jsxs("span",{children:[e.inputTokens," in"]},"in")),e.outputTokens!==void 0&&l.push(d.jsxs("span",{children:[e.outputTokens," out"]},"out")),e.cacheCreationInputTokens!==void 0&&e.cacheCreationInputTokens>0&&l.push(d.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(d.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["~",e.cacheReadInputTokens," cached"]},"cache-read"));const c=[];for(let u=0;u<l.length;u++)u>0&&c.push(", "),c.push(l[u]);return d.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[d.jsx(rv,{className:"size-3"}),d.jsx("span",{children:"Connected"}),l.length>0&&d.jsxs("span",{className:"text-muted-foreground",children:["(",c,")"]})]})}const r=e.error,o=r?.message??"Connection failed",i=r?.hint,s=r?.details,a=r?.type??"unknown";return d.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[d.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 max-w-[200px]",children:[QT(a),d.jsx("span",{className:"truncate",children:o}),s!==void 0&&d.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?d.jsx(cu,{className:"size-3"}):d.jsx(uu,{className:"size-3"})})]}),t&&s!==void 0&&d.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded p-2 max-w-[300px]",children:[i!==void 0&&d.jsx("div",{className:"mb-1",children:i}),d.jsx("div",{className:"font-mono whitespace-pre-wrap break-all text-red-400/80",children:s})]})]})}function e5({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,isHighlighted:o,onEdit:i,onDelete:s,onTest:a}){const[l,c]=w.useState(!1),u=e.apiDocsUrl??Object.entries(KT).find(([h])=>e.name.toLowerCase().includes(h))?.[1];return d.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:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsx("div",{className:"flex items-center gap-2 min-w-0",children:d.jsx("span",{className:"font-medium truncate",children:e.model!==void 0&&e.model!==""?`${e.model} (${e.name})`:e.name})}),u!==void 0&&d.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[d.jsx(hv,{className:"size-3"}),d.jsx("span",{className:"sr-only",children:"Docs"})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:l?e.apiKey:JT(e.apiKey)}),d.jsx("button",{type:"button",onClick:()=>c(h=>!h),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":l?"Hide API key":"Show API key",children:l?d.jsx(cu,{className:"size-4"}):d.jsx(uu,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[d.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",d.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&d.jsx(lc,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[d.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",d.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&d.jsx(lc,{result:t.openai.nonStreaming})]}),d.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[a!==void 0&&d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>a(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[d.jsx(pu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>i(e),className:"text-xs h-7 gap-1",children:[d.jsx(Ov,{className:"size-3"}),"Edit"]}),d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>s(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",children:[d.jsx(Jv,{className:"size-3"}),"Delete"]})]})]})}const t5={deepseek:{format:"openai",baseUrl:"https://api.deepseek.com"},minimax:{format:"anthropic",baseUrl:"https://api.minimaxi.com/anthropic",apiDocsUrl:"https://platform.minimaxi.com/docs/api-reference/api-overview"},alibaba:{format:"openai",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode"}},cc=["MiniMax M3","MiniMax M2.7","MiniMax M2.7-highspeed","MiniMax M2.5","MiniMax M2.5-highspeed","MiniMax M2.1","MiniMax M2.1-highspeed","MiniMax M2"],uc=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function n5({provider:e,onSubmit:t,onCancel:n}){const[r,o]=w.useState(e?.name??"Provider Name"),[i,s]=w.useState(e?.apiKey??""),[a,l]=w.useState(e?.model??""),[c,u]=w.useState(e?.format??"anthropic"),[h,p]=w.useState(e?.baseUrl??""),[f,x]=w.useState(e?.apiDocsUrl??""),[m,y]=w.useState({}),[g,v]=w.useState(!1),[k,S]=w.useState(!1),E=r.toLowerCase().includes("minimax"),N=r.toLowerCase().includes("alibaba");w.useEffect(()=>{e&&(o(e.name),s(e.apiKey),l(e.model??""),u(e.format??"anthropic"),p(e.baseUrl??""),x(e.apiDocsUrl??""),S(!1))},[e]),w.useEffect(()=>{const D=r.toLowerCase();for(const[M,C]of Object.entries(t5))if(D.includes(M)){k||(u(C.format),p(C.baseUrl)),C.apiDocsUrl!==void 0&&!f&&x(C.apiDocsUrl),M==="minimax"&&!a&&l(cc[0]??""),M==="alibaba"&&!a&&l(uc[0]??"");break}},[r]);function T(){const D={};return r.trim()||(D.name="Name is required"),i.trim()||(D.apiKey="API key is required"),a.trim()||(D.model="Model is required"),h.trim()?P(h.trim())||(D.baseUrl="Invalid URL format"):D.baseUrl="Base URL is required",y(D),Object.keys(D).length===0}function P(D){try{return new URL(D),!0}catch{return!1}}function R(D){if(D.preventDefault(),!!T()){v(!0);try{t({name:r.trim(),apiKey:i.trim(),model:a.trim()||void 0,format:c,baseUrl:h.trim()||void 0,apiDocsUrl:f.trim()||void 0})}finally{v(!1)}}}return d.jsxs("form",{onSubmit:R,className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{id:"provider-name",type:"text",value:r,onChange:D=>o(D.target.value),placeholder:"Model Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.name!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.name})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{id:"provider-apikey",type:"password",value:i,onChange:D=>s(D.target.value),placeholder:"sk-ant-...",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.apiKey!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.apiKey})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-model",className:"text-sm font-medium",children:["Model ",d.jsx("span",{className:"text-destructive",children:"*"})]}),E||N?d.jsx("select",{id:"provider-model",value:a,onChange:D=>l(D.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:(E?cc:uc).map(D=>d.jsx("option",{value:D,children:D},D))}):d.jsx("input",{id:"provider-model",type:"text",value:a,onChange:D=>l(D.target.value),placeholder:"",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.model!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.model})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-format",className:"text-sm font-medium",children:["API Format ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsxs("select",{id:"provider-format",value:c,onChange:D=>u(D.target.value==="anthropic"?"anthropic":"openai"),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[d.jsx("option",{value:"anthropic",children:"Anthropic (/v1/messages)"}),d.jsx("option",{value:"openai",children:"OpenAI (/v1/chat/completions)"})]}),d.jsx("p",{className:"text-xs text-muted-foreground",children:c==="anthropic"?"Use Anthropic format for /v1/messages endpoint":"Use OpenAI format for /v1/chat/completions endpoint"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("label",{htmlFor:"provider-base-url",className:"text-sm font-medium",children:["Base URL ",d.jsx("span",{className:"text-destructive",children:"*"})]}),d.jsx("input",{id:"provider-base-url",type:"text",value:h,onChange:D=>{S(!0),p(D.target.value)},placeholder:c==="anthropic"?"https://api.anthropic.com":"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),m.baseUrl!==void 0&&d.jsx("p",{className:"text-xs text-destructive",children:m.baseUrl}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Base URL for the provider API."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),d.jsx("input",{id:"provider-api-docs-url",type:"text",value:f,onChange:D=>x(D.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"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),d.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[d.jsx(ht,{type:"button",variant:"outline",onClick:n,disabled:g,children:"Cancel"}),d.jsx(ht,{type:"submit",disabled:g,children:g?"Saving...":e?"Update Provider":"Add Provider"})]})]})}const Hi=ce({id:G(),name:G(),apiKey:G(),model:G().optional(),format:jt(["anthropic","openai"]).optional(),baseUrl:G().optional(),anthropicBaseUrl:G().optional(),openaiBaseUrl:G().optional(),authHeader:jt(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:G().optional(),createdAt:G(),updatedAt:G()}),r5=jt(["timeout","network_unreachable","connection_refused","auth_failed","rate_limited","server_error","invalid_response","unknown"]),o5=ce({message:G(),type:r5,details:G().optional(),hint:G().optional()}),i5=ce({type:jt(["text","thinking"]),text:G().optional(),thinking:G().optional()}),s5=ce({success:et(),error:o5.optional(),model:G().optional(),inputTokens:ye().optional(),outputTokens:ye().optional(),cacheCreationInputTokens:ye().optional(),cacheReadInputTokens:ye().optional(),latencyMs:ye().optional(),content:Me(i5).optional(),rawResponse:G().optional(),streaming:et().optional(),streamingChunks:ce({chunks:Me(tu),truncated:et().default(!1)}).optional(),requestHeaders:qt(G(),G()).optional()}),dc=$t([s5,ce({notConfigured:Te(!0)}),ce({testing:Te(!0)})]),fc=ce({nonStreaming:dc,streaming:dc}),a5=ce({anthropic:fc,openai:fc});function l5(){return{anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}}}function hc(e,t){const n=()=>({nonStreaming:{success:!1,error:{message:e,type:t}},streaming:{notConfigured:!0}});return{anthropic:n(),openai:n()}}const c5=ce({providerConfig:G()}),u5=ce({success:et().optional(),imported:ye().optional(),message:G().optional(),errors:Me(G()).optional()}),d5=30,di="Network error: could not reach the server. Is the proxy running?";function pc(e){return{name:e.name,apiKey:e.apiKey,model:e.model,format:e.format,anthropicBaseUrl:e.format==="anthropic"?e.baseUrl:void 0,openaiBaseUrl:e.format==="openai"?e.baseUrl:void 0}}function f5({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:i,onTestResultsChange:s,onTestingProvidersChange:a,onTestingTimeLeftChange:l}){const[c,u]=w.useState(!1),[h,p]=w.useState(),[f,x]=w.useState(null),[m,y]=w.useState({}),[g,v]=w.useState(new Set),[k,S]=w.useState({}),[E,N]=w.useState(null),[T,P]=w.useState(!1),[R,D]=w.useState(null),M=w.useRef(null),C=w.useRef(null),L=e??[],_=n??m,O=r??g,J=o??k,Z=l?(te,oe)=>l(te,oe):(te,oe)=>{S(oe===void 0?me=>{const Ee={...me};return delete Ee[te],Ee}:me=>({...me,[te]:oe}))};w.useEffect(()=>{(async()=>{try{const te=await fetch("/api/config/paths");if(te.ok){const oe=await bn(te,c5);N(oe.providerConfig)}}catch{}})()},[]);const W=w.useCallback(te=>{C.current!==null&&clearTimeout(C.current),D(te),M.current?.scrollTo({top:M.current.scrollHeight,behavior:"smooth"}),C.current=setTimeout(()=>{D(null),C.current=null},2e3)},[]);w.useEffect(()=>()=>{C.current!==null&&clearTimeout(C.current)},[]);const q=w.useCallback(()=>{i?.().catch(()=>{})},[i]),A=w.useCallback((te,oe)=>{s?s(te,oe):y(me=>({...me,[te]:oe}))},[s]),U=w.useCallback((te,oe)=>{if(a){a(te,oe);return}v(me=>{const Ee=new Set(me);return oe?Ee.add(te):Ee.delete(te),Ee})},[a]),B=w.useCallback(async te=>{A(te,l5()),U(te,!0);const oe=new AbortController;let me=d5;Z(te,me);const Ee=setInterval(()=>{me--,Z(te,me),me<=0&&(clearInterval(Ee),oe.abort())},1e3);try{const b=await fetch(`/api/providers/${te}/test`,{method:"POST",signal:oe.signal});if(b.ok){const K=await bn(b,a5);A(te,K)}else A(te,hc(`HTTP ${b.status}: ${b.statusText}`,"server_error"))}catch(b){b instanceof Error&&b.name==="AbortError"&&A(te,hc("Request timed out","timeout"))}finally{clearInterval(Ee),Z(te,void 0),U(te,!1)}},[Z,A,U]);function j(te){(async()=>{let oe;try{oe=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(pc(te))})}catch{x(di);return}if(!oe.ok){x(await Mr(oe,"Failed to add provider"));return}const me=await bn(oe,Hi);u(!1),W(me.id),q(),await B(me.id)})()}function ee(te){h&&(async()=>{let oe;try{oe=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(pc(te))})}catch{x(di);return}if(!oe.ok){x(await Mr(oe,"Failed to update provider"));return}const me=await bn(oe,Hi);p(void 0),W(me.id),q(),await B(me.id)})()}function re(te){window.confirm("Are you sure you want to delete this provider?")&&(async()=>{let oe;try{oe=await fetch(`/api/providers/${te}`,{method:"DELETE"})}catch{x(di);return}if(!oe.ok){x(await Mr(oe,"Failed to delete provider"));return}q()})()}const ve=w.useRef(null);function ie(te){const oe="/api/providers/export";(async()=>{try{const me=await fetch(oe);if(!me.ok){x("Failed to export providers");return}const Ee=await me.blob(),b=URL.createObjectURL(Ee),K=document.createElement("a");K.href=b,K.download=me.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(K),K.click(),document.body.removeChild(K),URL.revokeObjectURL(b)}catch{x("Failed to export providers")}})()}function de(){ve.current?.click()}function ge(te){const oe=te.target.files?.[0];oe&&(async()=>{try{const me=await oe.text(),Ee=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(me)}),b=await bn(Ee,u5);Ee.ok&&b.imported!==void 0&&b.imported>0?(q(),x(null)):b.errors&&b.errors.length>0?x(b.errors.join("; ")):x(b.message??"Import failed")}catch{x("Failed to import providers")}te.target.value=""})()}return t?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):c||h?d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"flex items-center justify-between",children:d.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Provider":"Add New Provider"})}),d.jsx(n5,{provider:h,onSubmit:h?ee:j,onCancel:()=>{u(!1),p(void 0)}})]}):d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[d.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(ht,{variant:"outline",size:"sm",onClick:()=>ie(),className:"gap-1 hover:bg-muted",children:[d.jsx(lu,{className:"size-3"}),"Export"]}),d.jsxs(ht,{variant:"outline",size:"sm",onClick:de,className:"gap-1 hover:bg-muted",children:[d.jsx(eb,{className:"size-3"}),"Import"]}),d.jsx("input",{type:"file",ref:ve,accept:".json",onChange:ge,style:{display:"none"}}),d.jsxs(ht,{onClick:()=>u(!0),size:"sm",className:"gap-1",children:[d.jsx(Sa,{className:"size-4"}),"Add Provider"]})]})]}),E!==null&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[d.jsx("span",{className:"shrink-0",children:"Config:"}),d.jsx("span",{className:"font-mono truncate",title:E,children:E}),d.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(E).then(()=>{P(!0),setTimeout(()=>P(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:T?d.jsx(fr,{className:"size-3 text-green-500"}):d.jsx(uo,{className:"size-3"})})]}),f!==null&&d.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[d.jsx(yi,{className:"size-4 shrink-0"}),f]}),L.length===0?d.jsxs("div",{className:"text-center py-12 space-y-3",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),d.jsxs(ht,{onClick:()=>u(!0),variant:"outline",size:"sm",children:[d.jsx(Sa,{className:"size-4"}),"Add Your First Provider"]})]}):d.jsx("div",{ref:M,className:"space-y-3",children:L.map(te=>d.jsx(e5,{provider:te,testResults:_[te.id],isTesting:O.has(te.id),testingTimeLeft:J[te.id],isHighlighted:te.id===R,onEdit:oe=>p(oe),onDelete:re,onTest:oe=>{B(oe)}},te.id))})]})}async function h5(e){return rs(e,Hi.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function p5(){const e=gc("/api/providers",h5,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function m5(){const[e,t]=w.useState(!1),[n,r]=w.useState("providers"),{providers:o,isLoading:i,mutate:s}=p5(),[a,l]=w.useState({}),[c,u]=w.useState(new Set),[h,p]=w.useState({}),f=w.useCallback((y,g)=>{l(v=>({...v,[y]:g}))},[]),x=w.useCallback((y,g)=>{u(v=>{const k=new Set(v);return g?k.add(y):k.delete(y),k})},[]),m=w.useCallback((y,g)=>{p(v=>{if(g===void 0){const k={...v};return delete k[y],k}return{...v,[y]:g}})},[]);return d.jsxs(Mh,{open:e,onOpenChange:t,children:[d.jsx(wT,{asChild:!0,children:d.jsxs(ht,{variant:"ghost",size:"icon",className:"size-8",children:[d.jsx(Hv,{className:"size-4"}),d.jsx("span",{className:"sr-only",children:"Settings"})]})}),d.jsxs(Lh,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[d.jsx(Fh,{children:d.jsx($h,{children:"Settings"})}),d.jsxs(kn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[d.jsxs(Sn,{children:[d.jsx(Ge,{value:"providers",children:"Providers"}),d.jsx(Ge,{value:"proxy",children:"Proxy"})]}),d.jsxs("div",{className:"mt-4 overflow-y-auto flex-1",children:[d.jsx(Ke,{value:"providers",children:d.jsx(f5,{externalProviders:o,isLoading:i,externalTestResults:a,externalTestingProviders:c,externalTestingTimeLeft:h,onProvidersMutate:()=>s(),onTestResultsChange:f,onTestingProvidersChange:x,onTestingTimeLeftChange:m})}),d.jsx(Ke,{value:"proxy",children:d.jsx(g5,{})})]})]})]})]})}function g5(){const{strip:e,isLoading:t,setStrip:n}=ru(),[r,o]=w.useState(null),[i,s]=w.useState(!1),a=w.useCallback(async l=>{o(null),s(!0);try{await n(l)}catch(c){o(c instanceof Error?c.message:String(c))}finally{s(!1)}},[n]);return d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("h3",{className:"text-sm font-semibold",children:"Claude Code billing header"}),d.jsxs("p",{className:"text-xs text-muted-foreground",children:["When enabled, the proxy strips the synthetic ",d.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 ",d.jsx("code",{children:"LLM_INSPECTOR_STRIP_CLAUDE_CODE_BILLING_HEADER"})," environment variable; your choice is persisted to ",d.jsx("code",{children:"config.json"})," and overrides the env var for subsequent requests."]})]}),d.jsxs("label",{className:"flex items-center gap-3",children:[d.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"}),d.jsx("span",{className:"text-sm",children:t?"Loading…":e?"Stripping enabled":"Stripping disabled"})]}),r!==null&&d.jsxs("p",{className:"text-xs text-destructive",children:["Failed to save: ",r]})]})}function x5(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:mc(i.cacheCreationInputTokens,s.cacheCreationInputTokens),read:mc(i.cacheReadInputTokens,s.cacheReadInputTokens)})}}return t}function mc(e,t){return t===null||e===null?null:t>e?{direction:"up",delta:t-e}:t<e?{direction:"down",delta:e-t}:null}function y5(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function v5(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 b5({command:e}){const[t,n]=w.useState(!1),r=w.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return d.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[d.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),d.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?d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M20 6 9 17l-5-5"})}):d.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),d.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 w5({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:i,onModelChange:s,onClearAll:a,viewMode:l,onViewModeChange:c,strip:u}){const{totalIn:h,totalOut:p}=v5(e),[f,x]=w.useState(!0),[m,y]=w.useState(!1),g=w.useCallback(async()=>{y(!0);try{await gb(e)}finally{y(!1)}},[e]),v=w.useRef(null),k=w.useMemo(()=>aS(e),[e]),S=w.useMemo(()=>x5(k),[k]),E=e.length>0&&f&&!(k.length===1&&k[0]?.logs.length===e.length),N=iu({count:E?k.length:e.length,getScrollElement:()=>v.current,estimateSize:()=>150,measureElement:typeof window<"u"?T=>T.getBoundingClientRect().height:void 0,overscan:5});return d.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[d.jsxs("div",{className:"flex items-center gap-4 mb-4 px-6 pt-6",children:[d.jsxs("h1",{className:"text-lg font-bold flex-1 flex items-center gap-2",children:[d.jsx(HT,{className:"size-10 text-amber-500 self-center"}),d.jsxs("span",{className:"flex items-baseline gap-2",children:["LLM Inspector",d.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["v",yb.version]})]})]}),d.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[d.jsx("button",{type:"button",onClick:()=>c("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),d.jsx("button",{type:"button",onClick:()=>c("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${l==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]}),d.jsx(m5,{}),d.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&&d.jsx("button",{type:"button",onClick:()=>{g()},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?d.jsx("span",{children:"Exporting..."}):d.jsxs(d.Fragment,{children:[d.jsx(lu,{className:"size-3"}),d.jsx("span",{children:"Export All"})]})}),d.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"})]}),d.jsxs("div",{className:"flex gap-3 px-6 mb-4",children:[d.jsxs(oc,{value:r,onValueChange:i,children:[d.jsx(sc,{className:"flex-1 max-w-[400px] text-xs",children:d.jsx(ic,{placeholder:"All sessions"})}),d.jsxs(ac,{children:[d.jsx(Dr,{value:"__all__",children:"All sessions"}),t.map(T=>d.jsx(Dr,{value:T,children:y5(T)},T))]})]}),d.jsxs(oc,{value:o,onValueChange:s,children:[d.jsx(sc,{className:"text-xs",children:d.jsx(ic,{placeholder:"All models"})}),d.jsxs(ac,{children:[d.jsx(Dr,{value:"__all__",children:"All models"}),n.map(T=>d.jsx(Dr,{value:T,children:T},T))]})]}),d.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[d.jsx("button",{type:"button",onClick:()=>x(!0),className:`px-2 py-1.5 cursor-pointer transition-colors ${f?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grouped view",children:d.jsx(Cv,{className:"size-4"})}),d.jsx("button",{type:"button",onClick:()=>x(!1),className:`px-2 py-1.5 cursor-pointer transition-colors ${f?"text-muted-foreground hover:bg-muted/50":"bg-muted text-foreground"}`,title:"Flat view",children:d.jsx(Nv,{className:"size-4"})})]})]}),d.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?d.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[d.jsx("p",{className:"text-sm",children:"No requests captured yet."}),d.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),d.jsx(b5,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):d.jsx("div",{ref:v,className:"overflow-y-auto h-full",children:d.jsx("div",{style:{height:`${N.getTotalSize()}px`,width:"100%",position:"relative"},children:N.getVirtualItems().map(T=>{if(E){const P=k[T.index];return P===void 0?null:d.jsx("div",{"data-index":T.index,ref:N.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:d.jsx(WT,{group:P,viewMode:l,strip:u,cacheTrends:S})},P.id)}else{const P=e[T.index];return P===void 0?null:d.jsx("div",{"data-index":T.index,ref:N.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:d.jsx(Vh,{log:P,viewMode:l,strip:u,cacheTrend:S.get(P.id)??null})},P.id)}})})})})]})}ce({logs:Me(gi),total:ye(),offset:ye(),limit:ye()});const _5=$t([ce({type:Te("init"),logs:Me(gi)}),ce({type:Te("update"),log:gi})]);function k5(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function S5(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function C5(){const[e,t]=w.useState([]),[n,r]=w.useState([]),[o,i]=w.useState([]),[s,a]=w.useState("__all__"),[l,c]=w.useState("__all__"),[u,h]=w.useState("simple"),[p,f]=w.useState(null),x=w.useRef(null),m=w.useRef(null),y=w.useCallback(async()=>{try{const[S,E]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&E.ok){const N=await S.json(),T=await E.json(),P=Me(G()).safeParse(N),R=Me(G()).safeParse(T);P.success&&r(P.data),R.success&&i(R.data)}}catch{}},[]),g=w.useCallback(()=>{x.current&&x.current.close();const S=new URLSearchParams;s!=="__all__"&&S.set("sessionId",s),l!=="__all__"&&S.set("model",l);const E=new EventSource(`/api/logs/stream?${S}`);x.current=E,E.onmessage=N=>{try{const T=String(N.data),P=JSON.parse(T),R=_5.safeParse(P);if(!R.success){f("Failed to parse SSE data");return}const D=R.data;D.type==="init"?(t(D.logs),r(k5(D.logs)),i(S5(D.logs)),f(null)):D.type==="update"&&(t(M=>{const C=s==="__all__"||D.log.sessionId===s,L=l==="__all__"||D.log.model===l;return!C||!L?M:M.findIndex(O=>O.id===D.log.id)>=0?M.map(O=>O.id===D.log.id?D.log:O):[...M,D.log]}),r(M=>{const C=D.log.sessionId;return C!=null&&C!==""?M.includes(C)?M:[...M,C]:M}),i(M=>{const C=D.log.model;return C!=null&&C!==""?M.includes(C)?M:[...M,C]:M}))}catch{f("Failed to parse SSE data")}},E.onerror=()=>{f("SSE connection lost, reconnecting..."),E.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},y()},[s,l,y]);w.useEffect(()=>(g(),()=>{x.current&&(x.current.close(),x.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const v=w.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}=ru();return d.jsxs(d.Fragment,{children:[p!==null&&d.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}),d.jsx(w5,{logs:e,sessions:n,models:o,selectedSession:s,selectedModel:l,onSessionChange:a,onModelChange:c,onClearAll:v,viewMode:u,onViewModeChange:h,strip:k})]})}const T5=C5;export{T5 as component};
|