@tonyclaw/llm-inspector 1.14.8 → 1.15.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-CMuJQyt1.js +105 -0
- package/.output/public/assets/index-DciyfYBk.css +1 -0
- package/.output/public/assets/{main-CJ4MreBr.js → main-BLYgekFx.js} +1 -1
- package/.output/server/_libs/lucide-react.mjs +85 -111
- package/.output/server/_libs/radix-ui__react-id.mjs +1 -1
- package/.output/server/_ssr/{index-9uTJ4xYR.mjs → index-P66uoVEU.mjs} +677 -304
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{router-BKnjB_zi.mjs → router-DpLCKk51.mjs} +45 -14
- package/.output/server/{_tanstack-start-manifest_v-IsglLVKy.mjs → _tanstack-start-manifest_v-C9Wq6YdJ.mjs} +1 -1
- package/.output/server/index.mjs +22 -22
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +99 -180
- package/src/components/proxy-viewer/ConversationGroup.tsx +70 -66
- package/src/components/proxy-viewer/ConversationHeader.tsx +15 -39
- package/src/components/proxy-viewer/LogEntry.tsx +68 -9
- package/src/components/proxy-viewer/LogEntryHeader.tsx +62 -75
- package/src/components/proxy-viewer/ThreadConnector.tsx +78 -65
- package/src/components/proxy-viewer/TurnGroup.tsx +83 -0
- package/src/components/ui/crab-variants.tsx +456 -0
- package/src/lib/stopReason.ts +7 -6
- package/src/proxy/formats/anthropic/handler.ts +2 -5
- package/src/proxy/formats/openai/handler.ts +33 -7
- package/src/proxy/formats/openai/schemas.ts +1 -0
- package/src/proxy/formats/openai/stream.ts +24 -0
- package/src/proxy/handler.ts +8 -2
- package/src/proxy/schemas.ts +6 -3
- package/styles/globals.css +38 -0
- package/.output/public/assets/index-CdnotuLh.js +0 -105
- package/.output/public/assets/index-vP91146S.css +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import{u as Jc,a as Ap,r as v,b as Sr,j as l,R as at,c as Yc,d as Ip,e as zr,g as ki}from"./main-BLYgekFx.js";function Q(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,d=Object.keys(u);for(let h=0;h<d.length;h++){const p=d[h];p in a||(a[p]=u[p].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class On extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xc extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Qc={};function Qt(e){return Qc}function eu(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 Ls(e,t){return typeof t=="bigint"?t.toString():t}function jo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function _i(e){return e==null}function Si(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function zp(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 c=r.match(/\d?e-(\d?)/);c?.[1]&&(o=Number.parseInt(c[1]))}const s=n>o?n:o,i=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return i%a/10**s}const ja=Symbol("evaluating");function Ae(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ja)return r===void 0&&(r=ja,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function yn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function rn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Ea(e){return JSON.stringify(e)}function Rp(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const tu="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Pp=jo(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Bn(e){if(xr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(xr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function nu(e){return Bn(e)?{...e}:Array.isArray(e)?[...e]:e}const Op=new Set(["string","number","symbol"]);function $n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function on(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ye(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Dp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Mp={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 Lp(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 s=rn(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return yn(this,"shape",i),i},checks:[]});return on(e,s)}function Fp(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 s=rn(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return yn(this,"shape",i),i},checks:[]});return on(e,s)}function Bp(e,t){if(!Bn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=rn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return yn(this,"shape",s),s}});return on(e,o)}function $p(e,t){if(!Bn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=rn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yn(this,"shape",r),r}});return on(e,n)}function Up(e,t){const n=rn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yn(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return on(e,n)}function Zp(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 i=rn(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return yn(this,"shape",c),c},checks:[]});return on(t,i)}function Vp(e,t,n){const r=rn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return yn(this,"shape",s),s}});return on(t,r)}function In(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 zn(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Rr(e){return typeof e=="string"?e:e?.message}function en(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=Rr(e.inst?._zod.def?.error?.(e))??Rr(t?.error?.(e))??Rr(n.customError?.(e))??Rr(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ci(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const ru=(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,Ls,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ou=Q("$ZodError",ru),su=Q("$ZodError",ru,{Parent:Error});function Wp(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 Hp(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>r({issues:i}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return r(e),n}const ji=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new On;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>en(c,s,Qt())));throw tu(a,o?.callee),a}return i.value},Ei=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>en(c,s,Qt())));throw tu(a,o?.callee),a}return i.value},Eo=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new On;return s.issues.length?{success:!1,error:new(e??ou)(s.issues.map(i=>en(i,o,Qt())))}:{success:!0,data:s.value}},qp=Eo(su),No=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>en(i,o,Qt())))}:{success:!0,data:s.value}},Kp=No(su),Gp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ji(e)(t,n,o)},Jp=e=>(t,n,r)=>ji(e)(t,n,r),Yp=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ei(e)(t,n,o)},Xp=e=>async(t,n,r)=>Ei(e)(t,n,r),Qp=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Eo(e)(t,n,o)},em=e=>(t,n,r)=>Eo(e)(t,n,r),tm=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return No(e)(t,n,o)},nm=e=>async(t,n,r)=>No(e)(t,n,r),rm=/^[cC][^\s-]{8,}$/,om=/^[0-9a-z]+$/,sm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,im=/^[0-9a-vA-V]{20}$/,am=/^[A-Za-z0-9]{27}$/,lm=/^[a-zA-Z0-9_-]{21}$/,cm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,um=/^([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})$/,Na=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)$/,dm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fm="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hm(){return new RegExp(fm,"u")}const pm=/^(?:(?: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])$/,mm=/^(([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}|:))$/,gm=/^((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])$/,xm=/^(([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])$/,ym=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iu=/^[A-Za-z0-9_-]*$/,vm=/^\+[1-9]\d{6,14}$/,au="(?:(?:\\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])))",bm=new RegExp(`^${au}$`);function lu(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 wm(e){return new RegExp(`^${lu(e)}$`)}function km(e){const t=lu({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(`^${au}T(?:${r})$`)}const _m=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Sm=/^-?\d+$/,cu=/^-?\d+(?:\.\d+)?$/,Cm=/^(?:true|false)$/i,jm=/^null$/i,Em=/^[^A-Z]*$/,Nm=/^[^a-z]*$/,ut=Q("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uu={number:"number",bigint:"bigint",object:"date"},du=Q("$ZodCheckLessThan",(e,t)=>{ut.init(e,t);const n=uu[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(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})}}),fu=Q("$ZodCheckGreaterThan",(e,t)=>{ut.init(e,t);const n=uu[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(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})}}),Tm=Q("$ZodCheckMultipleOf",(e,t)=>{ut.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):zp(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})}}),Am=Q("$ZodCheckNumberFormat",(e,t)=>{ut.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,s]=Mp[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,n&&(a.pattern=Sm)}),e._zod.check=i=>{const a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.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}):i.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&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Im=Q("$ZodCheckMaxLength",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!_i(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 i=Ci(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zm=Q("$ZodCheckMinLength",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!_i(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 i=Ci(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Rm=Q("$ZodCheckLengthEquals",(e,t)=>{var n;ut.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!_i(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,s=o.length;if(s===t.length)return;const i=Ci(o),a=s>t.length;r.issues.push({origin:i,...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})}}),To=Q("$ZodCheckStringFormat",(e,t)=>{var n,r;ut.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.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=()=>{})}),Pm=Q("$ZodCheckRegex",(e,t)=>{To.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})}}),Om=Q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Em),To.init(e,t)}),Dm=Q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Nm),To.init(e,t)}),Mm=Q("$ZodCheckIncludes",(e,t)=>{ut.init(e,t);const n=$n(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.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})}}),Lm=Q("$ZodCheckStartsWith",(e,t)=>{ut.init(e,t);const n=new RegExp(`^${$n(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})}}),Fm=Q("$ZodCheckEndsWith",(e,t)=>{ut.init(e,t);const n=new RegExp(`.*${$n(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})}}),Bm=Q("$ZodCheckOverwrite",(e,t)=>{ut.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class $m{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2
|
+
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
|
|
3
|
+
`))}}const Um={major:4,minor:3,patch:6},Ue=Q("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Um;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let u=In(i),d;for(const h of a){if(h._zod.def.when){if(!h._zod.def.when(i))continue}else if(u)continue;const p=i.issues.length,f=h._zod.check(i);if(f instanceof Promise&&c?.async===!1)throw new On;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,i.issues.length!==p&&(u||(u=In(i,p)))});else{if(i.issues.length===p)continue;u||(u=In(i,p))}}return d?d.then(()=>i):i},s=(i,a,c)=>{if(In(i))return i.aborted=!0,i;const u=o(a,r,c);if(u instanceof Promise){if(c.async===!1)throw new On;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new On;return c.then(u=>o(u,r,a))}return o(c,r,a)}}Ae(e,"~standard",()=>({validate:o=>{try{const s=qp(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Kp(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Ni=Q("$ZodString",(e,t)=>{Ue.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_m(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}}),Ve=Q("$ZodStringFormat",(e,t)=>{To.init(e,t),Ni.init(e,t)}),Zm=Q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=um),Ve.init(e,t)}),Vm=Q("$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=Na(r))}else t.pattern??(t.pattern=Na());Ve.init(e,t)}),Wm=Q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=dm),Ve.init(e,t)}),Hm=Q("$ZodURL",(e,t)=>{Ve.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})}}}),qm=Q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=hm()),Ve.init(e,t)}),Km=Q("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=lm),Ve.init(e,t)}),Gm=Q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=rm),Ve.init(e,t)}),Jm=Q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=om),Ve.init(e,t)}),Ym=Q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=sm),Ve.init(e,t)}),Xm=Q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=im),Ve.init(e,t)}),Qm=Q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=am),Ve.init(e,t)}),eg=Q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=km(t)),Ve.init(e,t)}),tg=Q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=bm),Ve.init(e,t)}),ng=Q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=wm(t)),Ve.init(e,t)}),rg=Q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cm),Ve.init(e,t)}),og=Q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pm),Ve.init(e,t),e._zod.bag.format="ipv4"}),sg=Q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mm),Ve.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})}}}),ig=Q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=gm),Ve.init(e,t)}),ag=Q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=xm),Ve.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>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 hu(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const lg=Q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ym),Ve.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{hu(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function cg(e){if(!iu.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return hu(n)}const ug=Q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iu),Ve.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{cg(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),dg=Q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vm),Ve.init(e,t)});function fg(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 hg=Q("$ZodJWT",(e,t)=>{Ve.init(e,t),e._zod.check=n=>{fg(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),pu=Q("$ZodNumber",(e,t)=>{Ue.init(e,t),e._zod.pattern=e._zod.bag.pattern??cu,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 s=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,...s?{received:s}:{}}),n}}),pg=Q("$ZodNumberFormat",(e,t)=>{Am.init(e,t),pu.init(e,t)}),mg=Q("$ZodBoolean",(e,t)=>{Ue.init(e,t),e._zod.pattern=Cm,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}}),gg=Q("$ZodNull",(e,t)=>{Ue.init(e,t),e._zod.pattern=jm,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}}),xg=Q("$ZodUnknown",(e,t)=>{Ue.init(e,t),e._zod.parse=n=>n}),yg=Q("$ZodNever",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Ta(e,t,n){e.issues.length&&t.issues.push(...zn(n,e.issues)),t.value[n]=e.value}const vg=Q("$ZodArray",(e,t)=>{Ue.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 s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(u=>Ta(u,n,i))):Ta(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function ro(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...zn(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function mu(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=Dp(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function gu(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,d=c.optout==="optional";for(const h in t){if(a.has(h))continue;if(u==="never"){i.push(h);continue}const p=c.run({value:t[h],issues:[]},r);p instanceof Promise?e.push(p.then(f=>ro(f,n,h,t,d))):ro(p,n,h,t,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const bg=Q("$ZodObject",(e,t)=>{if(Ue.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=jo(()=>mu(t));Ae(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(const h of d.values)c[u].add(h)}}return c});const o=xr,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const d=[],h=i.shape;for(const p of i.keys){const f=h[p],x=f._zod.optout==="optional",m=f._zod.run({value:u[p],issues:[]},c);m instanceof Promise?d.push(m.then(y=>ro(y,a,p,u,x))):ro(m,a,p,u,x)}return s?gu(d,u,a,c,r.value,e):d.length?Promise.all(d).then(()=>a):a}}),wg=Q("$ZodObjectJIT",(e,t)=>{bg.init(e,t);const n=e._zod.parse,r=jo(()=>mu(t)),o=p=>{const f=new $m(["shape","payload","ctx"]),x=r.value,m=k=>{const S=Ea(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],j=Ea(k),E=p[k]?._zod?.optout==="optional";f.write(`const ${S} = ${m(k)};`),E?f.write(`
|
|
4
|
+
if (${S}.issues.length) {
|
|
5
|
+
if (${j} in input) {
|
|
6
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
7
|
+
...iss,
|
|
8
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (${S}.value === undefined) {
|
|
14
|
+
if (${j} in input) {
|
|
15
|
+
newResult[${j}] = undefined;
|
|
16
|
+
}
|
|
17
|
+
} else {
|
|
18
|
+
newResult[${j}] = ${S}.value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
`):f.write(`
|
|
22
|
+
if (${S}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${j}, ...iss.path] : [${j}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (${S}.value === undefined) {
|
|
30
|
+
if (${j} in input) {
|
|
31
|
+
newResult[${j}] = undefined;
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
newResult[${j}] = ${S}.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");const b=f.compile();return(k,S)=>b(p,k,S)};let s;const i=xr,a=!Qc.jitless,u=a&&Pp.value,d=t.catchall;let h;e._zod.parse=(p,f)=>{h??(h=r.value);const x=p.value;return i(x)?a&&u&&f?.async===!1&&f.jitless!==!0?(s||(s=o(t.shape)),p=s(p,f),d?gu([],x,p,f,h,e):p):n(p,f):(p.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),p)}});function Aa(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!In(s));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(s=>s.issues.map(i=>en(i,r,Qt())))}),t)}const xu=Q("$ZodUnion",(e,t)=>{Ue.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(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Si(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return r(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Aa(c,o,e,s)):Aa(a,o,e,s)}}),kg=Q("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xu.init(e,t);const n=e._zod.parse;Ae(e._zod,"propValues",()=>{const o={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(const u of c)o[a].add(u)}}return o});const r=jo(()=>{const o=t.options,s=new Map;for(const i of o){const a=i._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(o,s)=>{const i=o.value;if(!xr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;const a=r.value.get(i?.[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),o)}}),_g=Q("$ZodIntersection",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Ia(n,c,u)):Ia(n,s,i)}});function Fs(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(Bn(e)&&Bn(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=Fs(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.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],s=t[r],i=Fs(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ia(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 c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),In(e))return e;const i=Fs(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Sg=Q("$ZodRecord",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Bn(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],i=t.keyType._zod.values;if(i){n.value={};const a=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const d=t.valueType._zod.run({value:o[u],issues:[]},r);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...zn(u,h.issues)),n.value[u]=h.value})):(d.issues.length&&n.issues.push(...zn(u,d.issues)),n.value[u]=d.value)}let c;for(const u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&cu.test(a)&&c.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&&(c=h)}if(c.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(h=>en(h,r,Qt())),input:a,path:[a],inst:e});continue}const d=t.valueType._zod.run({value:o[a],issues:[]},r);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...zn(a,h.issues)),n.value[c.value]=h.value})):(d.issues.length&&n.issues.push(...zn(a,d.issues)),n.value[c.value]=d.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Cg=Q("$ZodEnum",(e,t)=>{Ue.init(e,t);const n=eu(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>Op.has(typeof o)).map(o=>typeof o=="string"?$n(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),jg=Q("$ZodLiteral",(e,t)=>{if(Ue.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"?$n(r):r?$n(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),Eg=Q("$ZodTransform",(e,t)=>{Ue.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Xc(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new On;return n.value=o,n}});function za(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const yu=Q("$ZodOptional",(e,t)=>{Ue.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(`^(${Si(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(s=>za(s,n.value)):za(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Ng=Q("$ZodExactOptional",(e,t)=>{yu.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)}),Tg=Q("$ZodNullable",(e,t)=>{Ue.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(`^(${Si(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)}),Ag=Q("$ZodDefault",(e,t)=>{Ue.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(s=>Ra(s,t)):Ra(o,t)}});function Ra(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ig=Q("$ZodPrefault",(e,t)=>{Ue.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))}),zg=Q("$ZodNonOptional",(e,t)=>{Ue.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(s=>Pa(s,e)):Pa(o,e)}});function Pa(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 Rg=Q("$ZodCatch",(e,t)=>{Ue.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(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>en(i,r,Qt()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>en(s,r,Qt()))},input:n.value}),n.issues=[]),n)}}),Pg=Q("$ZodPipe",(e,t)=>{Ue.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 s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>Pr(i,t.in,r)):Pr(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Pr(s,t.out,r)):Pr(o,t.out,r)}});function Pr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Og=Q("$ZodReadonly",(e,t)=>{Ue.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(Oa):Oa(o)}});function Oa(e){return e.value=Object.freeze(e.value),e}const Dg=Q("$ZodLazy",(e,t)=>{Ue.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)}),Mg=Q("$ZodCustom",(e,t)=>{ut.init(e,t),Ue.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(s=>Da(s,n,r,e));Da(o,n,r,e)}});function Da(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(yr(o))}}var Ma;class Lg{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 Fg(){return new Lg}(Ma=globalThis).__zod_globalRegistry??(Ma.__zod_globalRegistry=Fg());const fr=globalThis.__zod_globalRegistry;function Bg(e,t){return new e({type:"string",...ye(t)})}function $g(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ye(t)})}function La(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ye(t)})}function Ug(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ye(t)})}function Zg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ye(t)})}function Vg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ye(t)})}function Wg(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ye(t)})}function Hg(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ye(t)})}function qg(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ye(t)})}function Kg(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ye(t)})}function Gg(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ye(t)})}function Jg(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ye(t)})}function Yg(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ye(t)})}function Xg(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ye(t)})}function Qg(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ye(t)})}function ex(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ye(t)})}function tx(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ye(t)})}function nx(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ye(t)})}function rx(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ye(t)})}function ox(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ye(t)})}function sx(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ye(t)})}function ix(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ye(t)})}function ax(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ye(t)})}function lx(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ye(t)})}function cx(e,t){return new e({type:"string",format:"date",check:"string_format",...ye(t)})}function ux(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ye(t)})}function dx(e,t){return new e({type:"string",format:"duration",check:"string_format",...ye(t)})}function fx(e,t){return new e({type:"number",checks:[],...ye(t)})}function hx(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ye(t)})}function px(e,t){return new e({type:"boolean",...ye(t)})}function mx(e,t){return new e({type:"null",...ye(t)})}function gx(e){return new e({type:"unknown"})}function xx(e,t){return new e({type:"never",...ye(t)})}function Fa(e,t){return new du({check:"less_than",...ye(t),value:e,inclusive:!1})}function as(e,t){return new du({check:"less_than",...ye(t),value:e,inclusive:!0})}function Ba(e,t){return new fu({check:"greater_than",...ye(t),value:e,inclusive:!1})}function ls(e,t){return new fu({check:"greater_than",...ye(t),value:e,inclusive:!0})}function $a(e,t){return new Tm({check:"multiple_of",...ye(t),value:e})}function vu(e,t){return new Im({check:"max_length",...ye(t),maximum:e})}function oo(e,t){return new zm({check:"min_length",...ye(t),minimum:e})}function bu(e,t){return new Rm({check:"length_equals",...ye(t),length:e})}function yx(e,t){return new Pm({check:"string_format",format:"regex",...ye(t),pattern:e})}function vx(e){return new Om({check:"string_format",format:"lowercase",...ye(e)})}function bx(e){return new Dm({check:"string_format",format:"uppercase",...ye(e)})}function wx(e,t){return new Mm({check:"string_format",format:"includes",...ye(t),includes:e})}function kx(e,t){return new Lm({check:"string_format",format:"starts_with",...ye(t),prefix:e})}function _x(e,t){return new Fm({check:"string_format",format:"ends_with",...ye(t),suffix:e})}function Gn(e){return new Bm({check:"overwrite",tx:e})}function Sx(e){return Gn(t=>t.normalize(e))}function Cx(){return Gn(e=>e.trim())}function jx(){return Gn(e=>e.toLowerCase())}function Ex(){return Gn(e=>e.toUpperCase())}function Nx(){return Gn(e=>Rp(e))}function Tx(e,t,n){return new e({type:"array",element:t,...ye(n)})}function Ax(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ye(n)})}function Ix(e){const t=zx(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(yr(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(yr(o))}},e(n.value,n)));return t}function zx(e,t){const n=new ut({check:"custom",...ye(t)});return n._zod.check=e,n}function wu(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??fr,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 Ke(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{const p=i.schema,f=t.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(e,t,p,d)}const h=e._zod.parent;h&&(i.ref||(i.ref=h),Ke(h,t,d),t.seen.get(h).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&ot(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function ku(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 i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[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,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(i[0])?.id,p=e.external.uri??(x=>x);if(h)return{ref:p(h)};const f=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=f,{defId:f,ref:`${p("__shared")}#/${a}/${f}`}}if(i[1]===n)return{ref:"#"};const u=`#/${a}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);const d=a.schema;for(const h in d)delete d[h];d.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
|
+
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function _u(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){r(d);const p=e.seen.get(d),f=p.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(f)):Object.assign(c,f),Object.assign(c,u),i._zod.parent===d)for(const m in c)m==="$ref"||m==="allOf"||m in u||delete c[m];if(f.$ref&&p.def)for(const m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}const h=i._zod.parent;if(h&&h!==d){r(h);const p=e.seen.get(h);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(const f in c)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(c[f])===JSON.stringify(p.def[f])&&delete c[f]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[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 i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:so(t,"input",e.processors),output:so(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function ot(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 ot(r.element,n);if(r.type==="set")return ot(r.valueType,n);if(r.type==="lazy")return ot(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 ot(r.innerType,n);if(r.type==="intersection")return ot(r.left,n)||ot(r.right,n);if(r.type==="record"||r.type==="map")return ot(r.keyType,n)||ot(r.valueType,n);if(r.type==="pipe")return ot(r.in,n)||ot(r.out,n);if(r.type==="object"){for(const o in r.shape)if(ot(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(ot(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(ot(o,n))return!0;return!!(r.rest&&ot(r.rest,n))}return!1}const Rx=(e,t={})=>n=>{const r=wu({...n,processors:t});return Ke(e,r),ku(r,e),_u(r,e)},so=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=wu({...o??{},target:s,io:t,processors:n});return Ke(e,i),ku(i,e),_u(i,e)},Px={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ox=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=Px[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Dx=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),typeof s=="number"&&(o.minimum=s,typeof d=="number"&&t.target!=="draft-04"&&(d>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof i=="number"&&(o.maximum=i,typeof u=="number"&&t.target!=="draft-04"&&(u<=i?delete o.maximum:delete o.exclusiveMaximum)),typeof c=="number"&&(o.multipleOf=c)},Mx=(e,t,n,r)=>{n.type="boolean"},Lx=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Fx=(e,t,n,r)=>{n.not={}},Bx=(e,t,n,r)=>{},$x=(e,t,n,r)=>{const o=e._zod.def,s=eu(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},Ux=(e,t,n,r)=>{const o=e._zod.def,s=[];for(const i of o.values)if(i===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){const i=s[0];n.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[i]:n.const=i}else s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),s.every(i=>typeof i=="boolean")&&(n.type="boolean"),s.every(i=>i===null)&&(n.type="null"),n.enum=s},Zx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Vx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Wx=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ke(s.element,t,{...r,path:[...r.path,"items"]})},Hx=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=Ke(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const d=s.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ke(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},qx=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Ke(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},Kx=(e,t,n,r)=>{const o=e._zod.def,s=Ke(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=Ke(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},Gx=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object";const i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){const d=Ke(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const h of c)o.patternProperties[h.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ke(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Ke(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=i._zod.values;if(u){const d=[...u].filter(h=>typeof h=="string"||typeof h=="number");d.length>0&&(o.required=d)}},Jx=(e,t,n,r)=>{const o=e._zod.def,s=Ke(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},Yx=(e,t,n,r)=>{const o=e._zod.def;Ke(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Xx=(e,t,n,r)=>{const o=e._zod.def;Ke(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},Qx=(e,t,n,r)=>{const o=e._zod.def;Ke(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},e0=(e,t,n,r)=>{const o=e._zod.def;Ke(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},t0=(e,t,n,r)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ke(s,t,r);const i=t.seen.get(e);i.ref=s},n0=(e,t,n,r)=>{const o=e._zod.def;Ke(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Su=(e,t,n,r)=>{const o=e._zod.def;Ke(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},r0=(e,t,n,r)=>{const o=e._zod.innerType;Ke(o,t,r);const s=t.seen.get(e);s.ref=o},o0=Q("ZodISODateTime",(e,t)=>{eg.init(e,t),He.init(e,t)});function s0(e){return lx(o0,e)}const i0=Q("ZodISODate",(e,t)=>{tg.init(e,t),He.init(e,t)});function a0(e){return cx(i0,e)}const l0=Q("ZodISOTime",(e,t)=>{ng.init(e,t),He.init(e,t)});function c0(e){return ux(l0,e)}const u0=Q("ZodISODuration",(e,t)=>{rg.init(e,t),He.init(e,t)});function d0(e){return dx(u0,e)}const f0=(e,t)=>{ou.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Hp(e,n)},flatten:{value:n=>Wp(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ls,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ls,2)}},isEmpty:{get(){return e.issues.length===0}}})},wt=Q("ZodError",f0,{Parent:Error}),h0=ji(wt),p0=Ei(wt),m0=Eo(wt),g0=No(wt),x0=Gp(wt),y0=Jp(wt),v0=Yp(wt),b0=Xp(wt),w0=Qp(wt),k0=em(wt),_0=tm(wt),S0=nm(wt),Ze=Q("ZodType",(e,t)=>(Ue.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:so(e,"input"),output:so(e,"output")}}),e.toJSONSchema=Rx(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(rn(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)=>on(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>h0(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>m0(e,n,r),e.parseAsync=async(n,r)=>p0(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>g0(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>x0(e,n,r),e.decode=(n,r)=>y0(e,n,r),e.encodeAsync=async(n,r)=>v0(e,n,r),e.decodeAsync=async(n,r)=>b0(e,n,r),e.safeEncode=(n,r)=>w0(e,n,r),e.safeDecode=(n,r)=>k0(e,n,r),e.safeEncodeAsync=async(n,r)=>_0(e,n,r),e.safeDecodeAsync=async(n,r)=>S0(e,n,r),e.refine=(n,r)=>e.check(b1(n,r)),e.superRefine=n=>e.check(w1(n)),e.overwrite=n=>e.check(Gn(n)),e.optional=()=>Wa(e),e.exactOptional=()=>s1(e),e.nullable=()=>Ha(e),e.nullish=()=>Wa(Ha(e)),e.nonoptional=n=>d1(e,n),e.array=()=>Oe(e),e.or=n=>Kt([e,n]),e.and=n=>Q0(e,n),e.transform=n=>qa(e,r1(n)),e.default=n=>l1(e,n),e.prefault=n=>u1(e,n),e.catch=n=>h1(e,n),e.pipe=n=>qa(e,n),e.readonly=()=>g1(e),e.describe=n=>{const r=e.clone();return fr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return fr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return fr.get(e);const r=e.clone();return fr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Cu=Q("_ZodString",(e,t)=>{Ni.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(r,o,s)=>Ox(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(yx(...r)),e.includes=(...r)=>e.check(wx(...r)),e.startsWith=(...r)=>e.check(kx(...r)),e.endsWith=(...r)=>e.check(_x(...r)),e.min=(...r)=>e.check(oo(...r)),e.max=(...r)=>e.check(vu(...r)),e.length=(...r)=>e.check(bu(...r)),e.nonempty=(...r)=>e.check(oo(1,...r)),e.lowercase=r=>e.check(vx(r)),e.uppercase=r=>e.check(bx(r)),e.trim=()=>e.check(Cx()),e.normalize=(...r)=>e.check(Sx(...r)),e.toLowerCase=()=>e.check(jx()),e.toUpperCase=()=>e.check(Ex()),e.slugify=()=>e.check(Nx())}),C0=Q("ZodString",(e,t)=>{Ni.init(e,t),Cu.init(e,t),e.email=n=>e.check($g(j0,n)),e.url=n=>e.check(Hg(E0,n)),e.jwt=n=>e.check(ax(U0,n)),e.emoji=n=>e.check(qg(N0,n)),e.guid=n=>e.check(La(Ua,n)),e.uuid=n=>e.check(Ug(Or,n)),e.uuidv4=n=>e.check(Zg(Or,n)),e.uuidv6=n=>e.check(Vg(Or,n)),e.uuidv7=n=>e.check(Wg(Or,n)),e.nanoid=n=>e.check(Kg(T0,n)),e.guid=n=>e.check(La(Ua,n)),e.cuid=n=>e.check(Gg(A0,n)),e.cuid2=n=>e.check(Jg(I0,n)),e.ulid=n=>e.check(Yg(z0,n)),e.base64=n=>e.check(ox(F0,n)),e.base64url=n=>e.check(sx(B0,n)),e.xid=n=>e.check(Xg(R0,n)),e.ksuid=n=>e.check(Qg(P0,n)),e.ipv4=n=>e.check(ex(O0,n)),e.ipv6=n=>e.check(tx(D0,n)),e.cidrv4=n=>e.check(nx(M0,n)),e.cidrv6=n=>e.check(rx(L0,n)),e.e164=n=>e.check(ix($0,n)),e.datetime=n=>e.check(s0(n)),e.date=n=>e.check(a0(n)),e.time=n=>e.check(c0(n)),e.duration=n=>e.check(d0(n))});function q(e){return Bg(C0,e)}const He=Q("ZodStringFormat",(e,t)=>{Ve.init(e,t),Cu.init(e,t)}),j0=Q("ZodEmail",(e,t)=>{Wm.init(e,t),He.init(e,t)}),Ua=Q("ZodGUID",(e,t)=>{Zm.init(e,t),He.init(e,t)}),Or=Q("ZodUUID",(e,t)=>{Vm.init(e,t),He.init(e,t)}),E0=Q("ZodURL",(e,t)=>{Hm.init(e,t),He.init(e,t)}),N0=Q("ZodEmoji",(e,t)=>{qm.init(e,t),He.init(e,t)}),T0=Q("ZodNanoID",(e,t)=>{Km.init(e,t),He.init(e,t)}),A0=Q("ZodCUID",(e,t)=>{Gm.init(e,t),He.init(e,t)}),I0=Q("ZodCUID2",(e,t)=>{Jm.init(e,t),He.init(e,t)}),z0=Q("ZodULID",(e,t)=>{Ym.init(e,t),He.init(e,t)}),R0=Q("ZodXID",(e,t)=>{Xm.init(e,t),He.init(e,t)}),P0=Q("ZodKSUID",(e,t)=>{Qm.init(e,t),He.init(e,t)}),O0=Q("ZodIPv4",(e,t)=>{og.init(e,t),He.init(e,t)}),D0=Q("ZodIPv6",(e,t)=>{sg.init(e,t),He.init(e,t)}),M0=Q("ZodCIDRv4",(e,t)=>{ig.init(e,t),He.init(e,t)}),L0=Q("ZodCIDRv6",(e,t)=>{ag.init(e,t),He.init(e,t)}),F0=Q("ZodBase64",(e,t)=>{lg.init(e,t),He.init(e,t)}),B0=Q("ZodBase64URL",(e,t)=>{ug.init(e,t),He.init(e,t)}),$0=Q("ZodE164",(e,t)=>{dg.init(e,t),He.init(e,t)}),U0=Q("ZodJWT",(e,t)=>{hg.init(e,t),He.init(e,t)}),ju=Q("ZodNumber",(e,t)=>{pu.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(r,o,s)=>Dx(e,r,o),e.gt=(r,o)=>e.check(Ba(r,o)),e.gte=(r,o)=>e.check(ls(r,o)),e.min=(r,o)=>e.check(ls(r,o)),e.lt=(r,o)=>e.check(Fa(r,o)),e.lte=(r,o)=>e.check(as(r,o)),e.max=(r,o)=>e.check(as(r,o)),e.int=r=>e.check(Za(r)),e.safe=r=>e.check(Za(r)),e.positive=r=>e.check(Ba(0,r)),e.nonnegative=r=>e.check(ls(0,r)),e.negative=r=>e.check(Fa(0,r)),e.nonpositive=r=>e.check(as(0,r)),e.multipleOf=(r,o)=>e.check($a(r,o)),e.step=(r,o)=>e.check($a(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ve(e){return fx(ju,e)}const Z0=Q("ZodNumberFormat",(e,t)=>{pg.init(e,t),ju.init(e,t)});function Za(e){return hx(Z0,e)}const V0=Q("ZodBoolean",(e,t)=>{mg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mx(e,n,r)});function nt(e){return px(V0,e)}const W0=Q("ZodNull",(e,t)=>{gg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lx(e,n,r)});function Bs(e){return mx(W0,e)}const H0=Q("ZodUnknown",(e,t)=>{xg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bx()});function Va(){return gx(H0)}const q0=Q("ZodNever",(e,t)=>{yg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fx(e,n,r)});function K0(e){return xx(q0,e)}const G0=Q("ZodArray",(e,t)=>{vg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wx(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(oo(n,r)),e.nonempty=n=>e.check(oo(1,n)),e.max=(n,r)=>e.check(vu(n,r)),e.length=(n,r)=>e.check(bu(n,r)),e.unwrap=()=>e.element});function Oe(e,t){return Tx(G0,e,t)}const J0=Q("ZodObject",(e,t)=>{wg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hx(e,n,r,o),Ae(e,"shape",()=>t.shape),e.keyof=()=>lt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Va()}),e.loose=()=>e.clone({...e._zod.def,catchall:Va()}),e.strict=()=>e.clone({...e._zod.def,catchall:K0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Bp(e,n),e.safeExtend=n=>$p(e,n),e.merge=n=>Up(e,n),e.pick=n=>Lp(e,n),e.omit=n=>Fp(e,n),e.partial=(...n)=>Zp(Nu,e,n[0]),e.required=(...n)=>Vp(Tu,e,n[0])});function ae(e,t){const n={type:"object",shape:e??{},...ye(t)};return new J0(n)}const Eu=Q("ZodUnion",(e,t)=>{xu.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qx(e,n,r,o),e.options=t.options});function Kt(e,t){return new Eu({type:"union",options:e,...ye(t)})}const Y0=Q("ZodDiscriminatedUnion",(e,t)=>{Eu.init(e,t),kg.init(e,t)});function vn(e,t,n){return new Y0({type:"union",options:t,discriminator:e,...ye(n)})}const X0=Q("ZodIntersection",(e,t)=>{_g.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kx(e,n,r,o)});function Q0(e,t){return new X0({type:"intersection",left:e,right:t})}const e1=Q("ZodRecord",(e,t)=>{Sg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gx(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function Wt(e,t,n){return new e1({type:"record",keyType:e,valueType:t,...ye(n)})}const $s=Q("ZodEnum",(e,t)=>{Cg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(r,o,s)=>$x(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 s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new $s({...t,checks:[],...ye(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new $s({...t,checks:[],...ye(o),entries:s})}});function lt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new $s({type:"enum",entries:n,...ye(t)})}const t1=Q("ZodLiteral",(e,t)=>{jg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ux(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Se(e,t){return new t1({type:"literal",values:Array.isArray(e)?e:[e],...ye(t)})}const n1=Q("ZodTransform",(e,t)=>{Eg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vx(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Xc(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(yr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(yr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function r1(e){return new n1({type:"transform",transform:e})}const Nu=Q("ZodOptional",(e,t)=>{yu.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Su(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Wa(e){return new Nu({type:"optional",innerType:e})}const o1=Q("ZodExactOptional",(e,t)=>{Ng.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Su(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function s1(e){return new o1({type:"optional",innerType:e})}const i1=Q("ZodNullable",(e,t)=>{Tg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ha(e){return new i1({type:"nullable",innerType:e})}const a1=Q("ZodDefault",(e,t)=>{Ag.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function l1(e,t){return new a1({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():nu(t)}})}const c1=Q("ZodPrefault",(e,t)=>{Ig.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function u1(e,t){return new c1({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():nu(t)}})}const Tu=Q("ZodNonOptional",(e,t)=>{zg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yx(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function d1(e,t){return new Tu({type:"nonoptional",innerType:e,...ye(t)})}const f1=Q("ZodCatch",(e,t)=>{Rg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>e0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function h1(e,t){return new f1({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const p1=Q("ZodPipe",(e,t)=>{Pg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>t0(e,n,r,o),e.in=t.in,e.out=t.out});function qa(e,t){return new p1({type:"pipe",in:e,out:t})}const m1=Q("ZodReadonly",(e,t)=>{Og.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>n0(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function g1(e){return new m1({type:"readonly",innerType:e})}const x1=Q("ZodLazy",(e,t)=>{Dg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>r0(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function y1(e){return new x1({type:"lazy",getter:e})}const v1=Q("ZodCustom",(e,t)=>{Mg.init(e,t),Ze.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zx(e,n)});function b1(e,t={}){return Ax(v1,e,t)}function w1(e){return Ix(e)}const Un=y1(()=>Kt([q(),ve(),nt(),Bs(),Oe(Un),Wt(q(),Un)])),Ti=ae({type:q(),ttl:q().optional(),scope:q().optional()}),Ai=ae({type:Se("text"),text:q(),cache_control:Ti.optional()}),Au=ae({type:Se("thinking"),thinking:q(),signature:q().optional()}),k1=ae({type:Se("think"),thinking:q(),signature:q().optional()}),_1=ae({type:Se("base64"),media_type:q(),data:q()}),Iu=ae({type:Se("image"),source:_1}),zu=ae({type:Se("tool_use"),id:q(),name:q(),input:Wt(q(),Un)}),S1=vn("type",[Ai,Iu]),C1=ae({type:Se("tool_result"),tool_use_id:q().optional(),content:Kt([q(),Oe(S1)]),is_error:nt().optional()}),j1=vn("type",[Ai,Au,Iu,zu,C1]),E1=Kt([q(),Oe(j1)]),N1=ae({role:lt(["user","assistant"]),content:E1}),T1=ae({type:Se("text"),text:q(),cache_control:Ti.optional()}),A1=ae({type:q(),properties:Wt(q(),Wt(q(),Un)).optional(),required:Oe(q()).optional(),additionalProperties:nt().optional(),$schema:q().optional()}),I1=ae({name:q(),description:q().optional(),input_schema:A1.optional(),cache_control:Ti.optional()}),z1=vn("type",[ae({type:Se("enabled"),budget_tokens:ve()}),ae({type:Se("disabled")}),ae({type:Se("adaptive")})]),R1=ae({model:q(),messages:Oe(N1),system:Oe(T1).optional(),tools:Oe(I1).optional(),max_tokens:ve().optional(),temperature:ve().optional(),stream:nt().optional(),thinking:z1.optional(),metadata:ae({user_id:q().optional()}).optional()}),Ii=vn("type",[Ai,Au,k1,zu]),P1=ae({input_tokens:ve().nullable().optional(),output_tokens:ve().nullable().optional(),cache_creation_input_tokens:ve().nullable().optional(),cache_read_input_tokens:ve().nullable().optional()}).passthrough(),O1=ae({id:q(),type:Se("message"),model:q(),role:Se("assistant"),content:Oe(Ii),stop_reason:q().nullable(),stop_sequence:q().nullable().optional(),usage:P1}).passthrough(),D1=ae({type:Se("message_start"),message:ae({id:q(),type:Se("message"),model:q(),role:Se("assistant"),content:Oe(Ii),stop_reason:Bs(),stop_sequence:Bs(),usage:ae({input_tokens:ve(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()})}),M1=ae({type:Se("content_block_start"),index:ve(),content_block:Ii}),L1=vn("type",[ae({type:Se("text_delta"),text:q()}),ae({type:Se("input_json_delta"),partial_json:q()}),ae({type:Se("thinking_delta"),thinking:q()}),ae({type:Se("signature_delta"),signature:q()})]),F1=ae({type:Se("content_block_delta"),index:ve(),delta:L1}),B1=ae({type:Se("content_block_stop"),index:ve()}),$1=ae({type:Se("message_delta"),delta:ae({stop_reason:q().nullable(),stop_sequence:q().nullable().optional()}),usage:ae({output_tokens:ve(),input_tokens:ve().optional(),cache_creation_input_tokens:ve().optional(),cache_read_input_tokens:ve().optional()}).passthrough()}),U1=ae({type:Se("message_stop")}),Z1=ae({type:Se("ping")}),V1=ae({type:Se("error"),error:ae({type:q(),message:q()})});vn("type",[D1,M1,F1,B1,$1,U1,Z1,V1]);const W1=R1,Ru=O1,H1=Kt([q(),Oe(vn("type",[ae({type:Se("text"),text:q()}),ae({type:Se("image_url"),image_url:ae({url:q(),detail:q().optional()})})]))]),Pu=ae({role:lt(["system","user","assistant","tool"]),content:H1,name:q().optional(),reasoning_content:q().optional(),thinking:q().optional(),think:q().optional()}),q1=ae({name:q(),arguments:q()}),Ou=ae({index:ve().optional(),id:q().optional(),type:Se("function").optional(),function:ae({name:q().optional(),arguments:q().optional()})});Pu.extend({content:Kt([q(),Oe(ae({type:Se("text"),text:q()}))]).optional(),function_call:q1.optional(),tool_calls:Oe(Ou).optional()});const K1=ae({type:Se("function"),function:ae({name:q(),description:q().optional(),parameters:Wt(q(),Un)})}),Ka=ae({model:q(),messages:Oe(Pu),temperature:ve().optional(),max_tokens:ve().optional(),stream:nt().optional(),tools:Oe(K1).optional(),tool_choice:Kt([lt(["auto","none","required"]),ae({type:Se("auto")}),ae({type:Se("none")}),ae({type:Se("function"),function:ae({name:q()})})]).optional(),user:q().optional()}),Du=ae({role:lt(["assistant"]).optional(),content:q().nullable().optional(),reasoning_content:q().nullable().optional(),thinking:q().nullable().optional(),think:q().nullable().optional(),function_call:ae({name:q().optional(),arguments:q().optional()}).nullable().optional(),tool_calls:Oe(ae({index:ve(),id:q().optional(),type:Se("function").optional(),function:ae({name:q().optional(),arguments:q().optional()})})).nullable().optional()}),G1=ae({index:ve(),message:ae({role:lt(["assistant"]),content:q().nullable(),reasoning_content:q().optional(),thinking:q().optional(),think:q().optional(),function_call:ae({name:q(),arguments:q()}).nullable().optional(),tool_calls:Oe(Ou).optional()}).optional(),delta:Du.optional(),finish_reason:q().nullable()}),J1=ae({id:q(),object:Se("chat.completion"),created:ve(),model:q(),choices:Oe(G1),usage:ae({prompt_tokens:ve().nullable().optional(),completion_tokens:ve().nullable().optional(),total_tokens:ve().nullable().optional()}).passthrough(),service_tier:q().nullable().optional(),system_fingerprint:q().nullable().optional()}).passthrough();ae({id:q(),object:Se("chat.completion.chunk"),created:ve(),model:q(),choices:Oe(ae({index:ve(),delta:Du,finish_reason:q().nullable().optional()})),usage:ae({prompt_tokens:ve().nullable().optional(),completion_tokens:ve().nullable().optional(),total_tokens:ve().nullable().optional()}).passthrough().nullable().optional()}).passthrough();function Mu(e){try{const t=JSON.parse(e),n=J1.safeParse(t);return n.success?n.data:null}catch{return null}}const Lu=ae({index:ve(),timestamp:ve(),type:q(),data:Un}),Y1=ae({chunks:Oe(Lu),truncated:nt().optional().default(!1)}),Us=ae({id:ve(),timestamp:q(),method:q(),path:q(),model:q().nullable(),sessionId:q().nullable(),rawRequestBody:q().nullable(),responseStatus:ve().nullable(),responseText:q().nullable(),inputTokens:ve().nullable(),outputTokens:ve().nullable(),cacheCreationInputTokens:ve().nullable(),cacheReadInputTokens:ve().nullable(),elapsedMs:ve().nullable(),streaming:nt(),userAgent:q().nullable(),origin:q().nullable(),rawHeaders:Wt(q(),q()).optional(),headers:Wt(q(),q()).optional(),apiFormat:lt(["anthropic","openai","unknown"]).default("unknown"),isTest:nt().optional().default(!1),providerName:q().nullable().optional(),clientPort:ve().nullable().optional(),clientPid:ve().nullable().optional(),clientCwd:q().nullable().optional(),clientProjectFolder:q().nullable().optional(),streamingChunks:Y1.optional(),streamingChunksPath:q().nullable().optional(),error:q().nullable().optional()});ae({model:q()});ae({model:q().optional(),metadata:ae({user_id:q().optional()}).passthrough().optional()});function io(e){if(e===null)return null;try{const t=JSON.parse(e),n=W1.safeParse(t);return n.success?n.data:null}catch{return null}}const X1=ae({error:q()});async function An(e,t){const n=await e.json();return t.parse(n)}async function Jr(e,t){try{const n=await e.json(),r=X1.safeParse(n);return r.success?r.data.error:t}catch{return t}}async function zi(e,t,n,r){const o=await fetch(e,n);if(!o.ok){const s=r?.(o)??`Request failed with status ${o.status}`;throw new Error(await Jr(o,s))}return An(o,t)}const Fu=ae({stripClaudeCodeBillingHeader:nt()}),Zs="/api/config";async function Q1(e){return zi(e,Fu,void 0,t=>`Failed to fetch ${e}: ${t.status}`)}async function ey(e){return zi(Zs,Fu,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)},t=>`PATCH failed with status ${t.status}`)}function Bu(){const e=Jc(Zs,Q1,{revalidateOnFocus:!1,revalidateIfStale:!1}),{mutate:t}=Ap(),n=e.data?.stripClaudeCodeBillingHeader??!1,r=async o=>{await t(Zs,ey({stripClaudeCodeBillingHeader:o}),{optimisticData:{stripClaudeCodeBillingHeader:o},rollbackOnError:!0,revalidate:!1})};return{strip:n,isLoading:e.isLoading,isError:e.error!==void 0,setStrip:r}}function ty(e,t,n){const r=new Array(e);return new Proxy(r,{get(o,s,i){if(typeof s=="string"){const a=s.charCodeAt(0);if(a>=48&&a<=57){const c=+s;if(Number.isInteger(c)&&c>=0&&c<e){let u=o[c];if(!u){const d=t[c*2];u=o[c]={index:c,key:n(c),start:d,size:t[c*2+1],end:d+t[c*2+1],lane:0}}return u}}if(s==="length")return e}return Reflect.get(o,s,i)}})}function _n(e,t,n){let r=n.initialDeps??[],o,s=!0;function i(){const a=e();return(a.length!==r.length||a.some((u,d)=>r[d]!==u))&&(r=a,o=t(...a),n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(o),s=!1),o}return i.updateDeps=a=>{r=a},i}function Ga(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Ja=(e,t)=>Math.abs(e-t)<1.01,ny=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}};let or;const Ya=()=>{if(or!==void 0)return or;if(typeof navigator>"u")return or=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return or=!0;const e=navigator.maxTouchPoints;return or=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Xa=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ry=e=>e,oy=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 s=0;s<r;s++)o[s]=t+s;return o},sy=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=i=>{const{width:a,height:c}=i;t({width:Math.round(a),height:Math.round(c)})};if(o(Xa(n)),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(i=>{const a=()=>{const c=i[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(Xa(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},ao={passive:!0},iy=typeof window>"u"?!0:"onscrollend"in window,ay=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const s=e.options.useScrollendEvent&&iy;let i=0;const a=s?null:ny(o,()=>t(i,!1),e.options.isScrollingResetDelay),c=h=>()=>{i=n(r),a?.(),t(i,h)},u=c(!0),d=c(!1);return r.addEventListener("scroll",u,ao),s&&r.addEventListener("scrollend",d,ao),()=>{r.removeEventListener("scroll",u),s&&r.removeEventListener("scrollend",d)}},ly=(e,t)=>ay(e,t,n=>{const{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop}),cy=(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"]},uy=(e,{adjustments:t=0,behavior:n},r)=>{var o,s;(s=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},dy=uy;class fy{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(s=>{const i=()=>{const a=s.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[u,d]of this.elementsCache)if(d===a){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var s;return(s=r())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=r())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r,o;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ry,rangeExtractor:oy,onChange:()=>{},measureElement:cy,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate"};for(const u in n){const d=n[u];d!==void 0&&(s[u]=d)}const i=this.options;let a=null,c=null;if(i!==void 0&&i.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const u=i.count,d=s.count,h=this.getMeasurements(),p=u>0?((r=h[0])==null?void 0:r.key)??i.getItemKey(0):null,f=u>0?((o=h[u-1])==null?void 0:o.key)??i.getItemKey(u-1):null;if(d!==u||u>0&&d>0&&(s.getItemKey(0)!==p||s.getItemKey(d-1)!==f)){const y=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??h[0]:null;y&&(a=[y.key,this.getScrollOffset()-y.start]);const g=s.followOnAppend===!0?"auto":s.followOnAppend||null;g&&d>u&&this.isAtEnd(i.scrollEndThreshold)&&(u===0||s.getItemKey(d-1)!==f)&&(c=g)}}this.options=s,(a||c)&&(this.pendingScrollAnchor=[a?.[0]??null,a?.[1]??0,c])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=_n(()=>(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(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this._intendedScrollOffset!==null&&Math.abs(s-this._intendedScrollOffset)<1.5&&(s=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const s=this.scrollElement,i=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Ya()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};s.addEventListener("touchstart",i,ao),s.addEventListener("touchend",a,ao),this.unsubs.push(()=>{s.removeEventListener("touchstart",i),s.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[s,i,a]=o;if(s!==null){const{count:c,getItemKey:u}=this.options;let d=0;for(;d<c&&u(d)!==s;)d++;const h=d<c?this.getMeasurements()[d]:void 0;if(h){const p=h.start+i-this.getScrollOffset();Ja(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,s=new Map;for(let i=r-1;i>=0;i--){const a=n[i];if(o.has(a.lane))continue;const c=s.get(a.lane);if(c==null||a.end>c.end?s.set(a.lane,a):a.end<c.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=_n(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,o,s,i,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=_n(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a,laneAssignmentMode:c},u)=>{const d=this.itemSizeCache;if(!i)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=s(k),j=d.get(S),C=typeof j=="number"?j:this.options.estimateSize(k);y[k*2]=g,y[k*2+1]=C,g+=C+x}const b=ty(n,y,s);return this.measurementsCache=b,b}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=s(x),y=this.laneAssignments.get(x);let g,b;const k=c==="estimate"||d.has(m);if(y!==void 0&&this.options.lanes>1){g=y;const E=f[g],T=E!==void 0?p[E]:void 0;b=T?T.end+this.options.gap:r+o}else{const E=this.options.lanes===1?p[x-1]:this.getFurthestMeasurement(p,x);b=E?E.end+this.options.gap:r+o,g=E?E.lane:x%this.options.lanes,this.options.lanes>1&&k&&this.laneAssignments.set(x,g)}const S=d.get(m),j=typeof S=="number"?S:this.options.estimateSize(x),C=b+j;p[x]={index:x,start:b,size:j,end:C,key:m,lane:g},f[g]=x}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=_n(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,s)=>this.range=n.length>0&&r>0?hy({measurements:n,outerSize:r,scrollOffset:o,lanes:s,flat:s===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=_n(()=>{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,s,i)=>s===null||i===null?[]:n({startIndex:s,endIndex:i,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 s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,o-s),a=Math.min(this.options.count-1,o+s);return n>=i&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,a)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(a))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),s=this.elementsCache.get(o);s!==n&&(s&&this.observer.unobserve(s),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,s;if(n<0||n>=this.options.count)return;let i,a,c;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)c=this.options.getItemKey(n),a=u[n*2],i=u[n*2+1];else{const p=this.measurementsCache[n];if(!p)return;c=p.key,a=p.start,i=p.size}const d=this.itemSizeCache.get(c)??i,h=r-d;if(h!==0){const p=this.options.anchorTo==="end"&&((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,f=p?this.getTotalSize():0,x=((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:c,start:a,size:i,end:a+i,lane:0},h,this):a<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!=="backward");(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(c,r),this.itemSizeCacheVersion++,p?this.applyScrollAdjustment(this.getTotalSize()-f):x&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=_n(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let s=0,i=n.length;s<i;s++){const a=n[s],c=r[a];o.push(c)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const o=this._flatMeasurements,s=this.options.lanes===1&&o!=null,i=$u(0,r.length-1,s?a=>o[a*2]:a=>Ga(r[a]).start,n);return Ga(r[i])},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 s=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+s?"end":"start"),r==="center"?n+=(o-s)/2:r==="end"&&(n-=s);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(),s=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const s=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{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 s=this.getOffsetForIndex(n,r);if(!s)return;const[i,a]=s,c=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:c,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,s=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:s,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 s=r.length-1,i=this._flatMeasurements;i!=null?o=i[s*2]+i[s*2+1]:o=((n=r[s])==null?void 0:n.end)??0}else{const s=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&s.some(a=>a===null);){const a=r[i];s[a.lane]===null&&(s[a.lane]=a.end),i--}o=Math.max(...s.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&&(Ya()&&(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,s=1,i=o!==this.scrollState.lastTargetOffset;if(!i&&Ja(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,i){const a=this.getSize()||600,c=Math.abs(o-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&c>a;this.scrollState.lastTargetOffset=o,u||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const $u=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,s=n(o);if(s<r)e=o+1;else if(s>r)t=o-1;else return o}return e>0?e-1:0};function hy({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:o}){const s=e.length-1,i=o?d=>o[d*2]:d=>e[d].start,a=o?d=>o[d*2]+o[d*2+1]:d=>e[d].end;if(e.length<=r)return{startIndex:0,endIndex:s};let c=$u(0,s,i,n),u=c;if(r===1)for(;u<s&&a(u)<n+t;)u++;else if(r>1){const d=Array(r).fill(0);for(;u<s&&d.some(p=>p<n+t);){const p=e[u];d[p.lane]=p.end,u++}const h=Array(r).fill(n+t);for(;c>=0&&h.some(p=>p>=n);){const p=e[c];h[p.lane]=p.start,c--}c=Math.max(0,c-c%r),u=Math.min(s,u+(r-1-u%r))}return{startIndex:c,endIndex:u}}const Qa=typeof document<"u"?v.useLayoutEffect:v.useEffect;function py({useFlushSync:e=!0,...t}){const n=v.useReducer(s=>s+1,0)[1],r={...t,onChange:(s,i)=>{var a;e&&i?Sr.flushSync(n):n(),(a=t.onChange)==null||a.call(t,s,i)}},[o]=v.useState(()=>new fy(r));return o.setOptions(r),Qa(()=>o._didMount(),[]),Qa(()=>o._willUpdate()),o}function Uu(e){return py({observeElementRect:sy,observeElementOffset:ly,scrollToFn:dy,...e})}const Zu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const my=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const gy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const el=e=>{const t=gy(e);return t.charAt(0).toUpperCase()+t.slice(1)};var xy={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 yy=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const vy=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>v.createElement("svg",{ref:c,...xy,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Zu("lucide",o),...!s&&!yy(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,d])=>v.createElement(u,d)),...Array.isArray(s)?s:[s]]));const ke=(e,t)=>{const n=v.forwardRef(({className:r,...o},s)=>v.createElement(vy,{ref:s,iconNode:t,className:Zu(`lucide-${my(el(e))}`,`lucide-${e}`,r),...o}));return n.displayName=el(e),n};const by=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],wy=ke("arrow-down",by);const ky=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],_y=ke("arrow-up",ky);const Sy=[["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"}]],Cy=ke("brain",Sy);const jy=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sn=ke("check",jy);const Ey=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],yt=ke("chevron-down",Ey);const Ny=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bt=ke("chevron-right",Ny);const Ty=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ay=ke("chevron-up",Ty);const Iy=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],zy=ke("chevrons-down",Iy);const Ry=[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]],Py=ke("chevrons-up",Ry);const Oy=[["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"}]],vr=ke("circle-alert",Oy);const Dy=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],My=ke("circle-check-big",Dy);const Ly=[["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"}]],Fy=ke("circle-question-mark",Ly);const By=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],Vu=ke("circle-stop",By);const $y=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ao=ke("clock",$y);const Uy=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Wu=ke("columns-2",Uy);const Zy=[["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"}]],bn=ke("copy",Zy);const Vy=[["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"}]],Ri=ke("download",Vy);const Wy=[["line",{x1:"5",x2:"19",y1:"9",y2:"9",key:"1nwqeh"}],["line",{x1:"5",x2:"19",y1:"15",y2:"15",key:"g8yjpy"}]],Hy=ke("equal",Wy);const qy=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Ky=ke("external-link",qy);const Gy=[["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"}]],Pi=ke("eye-off",Gy);const Jy=[["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"}]],Oi=ke("eye",Jy);const Yy=[["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"}]],Xy=ke("file-terminal",Yy);const Qy=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],ev=ke("gauge",Qy);const tv=[["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"}]],Hu=ke("git-compare-arrows",tv);const nv=[["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"}]],rv=ke("globe",nv);const ov=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],br=ke("loader-circle",ov);const sv=[["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"}]],iv=ke("lock",sv);const av=[["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"}]],qu=ke("message-square",av);const lv=[["path",{d:"M5 12h14",key:"1ays0h"}]],Di=ke("minus",lv);const cv=[["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"}]],Mi=ke("pencil",cv);const uv=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lo=ke("plus",uv);const dv=[["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"}]],fv=ke("radio",dv);const hv=[["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"}]],Ku=ke("rotate-ccw",hv);const pv=[["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"}]],Gu=ke("rotate-cw",pv);const mv=[["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"}]],Ju=ke("rows-3",mv);const gv=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],xv=ke("scan",gv);const yv=[["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=ke("server",yv);const bv=[["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"}]],wv=ke("settings",bv);const kv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Yu=ke("terminal",kv);const _v=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Sv=ke("trash-2",_v);const Cv=[["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"}]],jv=ke("triangle-alert",Cv);const Ev=[["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"}]],Nv=ke("upload",Ev);const Tv=[["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"}]],Av=ke("user",Tv);const Iv=[["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"}]],zv=ke("wifi-off",Iv);const Rv=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Pv=ke("wifi",Rv);const Ov=[["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"}]],tl=ke("wrench",Ov);const Dv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xu=ke("x",Dv);const Mv=[["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"}]],Cr=ke("zap",Mv);function nl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qu(...e){return t=>{let n=!1;const r=e.map(o=>{const s=nl(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():nl(e[o],null)}}}}function Le(...e){return v.useCallback(Qu(...e),e)}function Zn(e){const t=Fv(e),n=v.forwardRef((r,o)=>{const{children:s,...i}=r,a=v.Children.toArray(s),c=a.find($v);if(c){const u=c.props.children,d=a.map(h=>h===c?v.Children.count(u)>1?v.Children.only(null):v.isValidElement(u)?u.props.children:null:h);return l.jsx(t,{...i,ref:o,children:v.isValidElement(u)?v.cloneElement(u,void 0,d):null})}return l.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var Lv=Zn("Slot");function Fv(e){const t=v.forwardRef((n,r)=>{const{children:o,...s}=n;if(v.isValidElement(o)){const i=Zv(o),a=Uv(s,o.props);return o.type!==v.Fragment&&(a.ref=r?Qu(r,i):i),v.cloneElement(o,a)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ed=Symbol("radix.slottable");function Bv(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ed,t}function $v(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ed}function Uv(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function Zv(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 Vv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ce=Vv.reduce((e,t)=>{const n=Zn(`Primitive.${t}`),r=v.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wv(e,t){e&&Sr.flushSync(()=>e.dispatchEvent(t))}var td=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"}),Hv="VisuallyHidden",nd=v.forwardRef((e,t)=>l.jsx(Ce.span,{...e,ref:t,style:{...td,...e.style}}));nd.displayName=Hv;var qv=nd;function Kv(e,t){const n=v.createContext(t),r=s=>{const{children:i,...a}=s,c=v.useMemo(()=>a,Object.values(a));return l.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=v.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Gt(e,t=[]){let n=[];function r(s,i){const a=v.createContext(i),c=n.length;n=[...n,i];const u=h=>{const{scope:p,children:f,...x}=h,m=p?.[e]?.[c]||a,y=v.useMemo(()=>x,Object.values(x));return l.jsx(m.Provider,{value:y,children:f})};u.displayName=s+"Provider";function d(h,p){const f=p?.[e]?.[c]||a,x=v.useContext(f);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>v.createContext(i));return function(a){const c=a?.[e]||s;return v.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,Gv(o,...t)]}function Gv(...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(s){const i=r.reduce((a,{useScope:c,scopeName:u})=>{const h=c(s)[`__scope${u}`];return{...a,...h}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function rd(e){const t=e+"CollectionProvider",[n,r]=Gt(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:y,children:g}=m,b=at.useRef(null),k=at.useRef(new Map).current;return l.jsx(o,{scope:y,itemMap:k,collectionRef:b,children:g})};i.displayName=t;const a=e+"CollectionSlot",c=Zn(a),u=at.forwardRef((m,y)=>{const{scope:g,children:b}=m,k=s(a,g),S=Le(y,k.collectionRef);return l.jsx(c,{ref:S,children:b})});u.displayName=a;const d=e+"CollectionItemSlot",h="data-radix-collection-item",p=Zn(d),f=at.forwardRef((m,y)=>{const{scope:g,children:b,...k}=m,S=at.useRef(null),j=Le(y,S),C=s(d,g);return at.useEffect(()=>(C.itemMap.set(S,{ref:S,...k}),()=>{C.itemMap.delete(S)})),l.jsx(p,{[h]:"",ref:j,children:b})});f.displayName=d;function x(m){const y=s(e+"CollectionConsumer",m);return at.useCallback(()=>{const b=y.collectionRef.current;if(!b)return[];const k=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((C,E)=>k.indexOf(C.ref.current)-k.indexOf(E.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:u,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?v.useLayoutEffect:()=>{},Jv=Yc[" useInsertionEffect ".trim().toString()]||Qe;function hn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Yv({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const d=v.useRef(e!==void 0);v.useEffect(()=>{const h=d.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const u=v.useCallback(d=>{if(a){const h=Xv(d)?d(e):d;h!==e&&i.current?.(h)}else s(d)},[a,e,s,i]);return[c,u]}function Yv({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),o=v.useRef(n),s=v.useRef(t);return Jv(()=>{s.current=t},[t]),v.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function Xv(e){return typeof e=="function"}function Qv(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var kt=e=>{const{present:t,children:n}=e,r=eb(t),o=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),s=Le(r.ref,tb(o));return typeof n=="function"||r.isPresent?v.cloneElement(o,{ref:s}):null};kt.displayName="Presence";function eb(e){const[t,n]=v.useState(),r=v.useRef(null),o=v.useRef(e),s=v.useRef("none"),i=e?"mounted":"unmounted",[a,c]=Qv(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=Dr(r.current);s.current=a==="mounted"?u:"none"},[a]),Qe(()=>{const u=r.current,d=o.current;if(d!==e){const p=s.current,f=Dr(u);e?c("MOUNT"):f==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&p!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Qe(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=f=>{const m=Dr(r.current).includes(CSS.escape(f.animationName));if(f.target===t&&m&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=f=>{f.target===t&&(s.current=Dr(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:v.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Dr(e){return e?.animationName||"none"}function tb(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 nb=Yc[" useId ".trim().toString()]||(()=>{}),rb=0;function Dt(e){const[t,n]=v.useState(nb());return Qe(()=>{n(r=>r??String(rb++))},[e]),e||(t?`radix-${t}`:"")}var Io="Collapsible",[ob]=Gt(Io),[sb,Li]=ob(Io),od=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:i,...a}=e,[c,u]=hn({prop:r,defaultProp:o??!1,onChange:i,caller:Io});return l.jsx(sb,{scope:n,disabled:s,contentId:Dt(),open:c,onOpenToggle:v.useCallback(()=>u(d=>!d),[u]),children:l.jsx(Ce.div,{"data-state":Bi(c),"data-disabled":s?"":void 0,...a,ref:t})})});od.displayName=Io;var sd="CollapsibleTrigger",id=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Li(sd,n);return l.jsx(Ce.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Bi(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:we(e.onClick,o.onOpenToggle)})});id.displayName=sd;var Fi="CollapsibleContent",ad=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Li(Fi,e.__scopeCollapsible);return l.jsx(kt,{present:n||o.open,children:({present:s})=>l.jsx(ib,{...r,ref:t,present:s})})});ad.displayName=Fi;var ib=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,i=Li(Fi,n),[a,c]=v.useState(r),u=v.useRef(null),d=Le(t,u),h=v.useRef(0),p=h.current,f=v.useRef(0),x=f.current,m=i.open||a,y=v.useRef(m),g=v.useRef(void 0);return v.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),Qe(()=>{const b=u.current;if(b){g.current=g.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const k=b.getBoundingClientRect();h.current=k.height,f.current=k.width,y.current||(b.style.transitionDuration=g.current.transitionDuration,b.style.animationName=g.current.animationName),c(r)}},[i.open,r]),l.jsx(Ce.div,{"data-state":Bi(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&o})});function Bi(e){return e?"open":"closed"}var ab=od,lb=v.createContext(void 0);function zo(e){const t=v.useContext(lb);return e||t||"ltr"}function st(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function cb(e,t=globalThis?.document){const n=st(e);v.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ub="DismissableLayer",Vs="dismissableLayer.update",db="dismissableLayer.pointerDownOutside",fb="dismissableLayer.focusOutside",rl,ld=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ro=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,u=v.useContext(ld),[d,h]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,f]=v.useState({}),x=Le(t,E=>h(E)),m=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),b=d?m.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=g,j=mb(E=>{const T=E.target,R=[...u.branches].some(M=>M.contains(T));!S||R||(o?.(E),i?.(E),E.defaultPrevented||a?.())},p),C=gb(E=>{const T=E.target;[...u.branches].some(M=>M.contains(T))||(s?.(E),i?.(E),E.defaultPrevented||a?.())},p);return cb(E=>{b===u.layers.size-1&&(r?.(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},p),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ol(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=rl)}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ol())},[d,u]),v.useEffect(()=>{const E=()=>f({});return document.addEventListener(Vs,E),()=>document.removeEventListener(Vs,E)},[]),l.jsx(Ce.div,{...c,ref:x,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,C.onFocusCapture),onBlurCapture:we(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,j.onPointerDownCapture)})});Ro.displayName=ub;var hb="DismissableLayerBranch",pb=v.forwardRef((e,t)=>{const n=v.useContext(ld),r=v.useRef(null),o=Le(t,r);return v.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(Ce.div,{...e,ref:o})});pb.displayName=hb;function mb(e,t=globalThis?.document){const n=st(e),r=v.useRef(!1),o=v.useRef(()=>{});return v.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){cd(db,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function gb(e,t=globalThis?.document){const n=st(e),r=v.useRef(!1);return v.useEffect(()=>{const o=s=>{s.target&&!r.current&&cd(fb,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ol(){const e=new CustomEvent(Vs);document.dispatchEvent(e)}function cd(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Wv(o,s):o.dispatchEvent(s)}var cs="focusScope.autoFocusOnMount",us="focusScope.autoFocusOnUnmount",sl={bubbles:!1,cancelable:!0},xb="FocusScope",$i=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=v.useState(null),u=st(o),d=st(s),h=v.useRef(null),p=Le(t,m=>c(m)),f=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let m=function(k){if(f.paused||!a)return;const S=k.target;a.contains(S)?h.current=S:Xt(h.current,{select:!0})},y=function(k){if(f.paused||!a)return;const S=k.relatedTarget;S!==null&&(a.contains(S)||Xt(h.current,{select:!0}))},g=function(k){if(document.activeElement===document.body)for(const j of k)j.removedNodes.length>0&&Xt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(g);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,f.paused]),v.useEffect(()=>{if(a){al.add(f);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(cs,sl);a.addEventListener(cs,u),a.dispatchEvent(g),g.defaultPrevented||(yb(_b(ud(a)),{select:!0}),document.activeElement===m&&Xt(a))}return()=>{a.removeEventListener(cs,u),setTimeout(()=>{const g=new CustomEvent(us,sl);a.addEventListener(us,d),a.dispatchEvent(g),g.defaultPrevented||Xt(m??document.body,{select:!0}),a.removeEventListener(us,d),al.remove(f)},0)}}},[a,u,d,f]);const x=v.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 b=m.currentTarget,[k,S]=vb(b);k&&S?!m.shiftKey&&g===S?(m.preventDefault(),n&&Xt(k,{select:!0})):m.shiftKey&&g===k&&(m.preventDefault(),n&&Xt(S,{select:!0})):g===b&&m.preventDefault()}},[n,r,f.paused]);return l.jsx(Ce.div,{tabIndex:-1,...i,ref:p,onKeyDown:x})});$i.displayName=xb;function yb(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Xt(r,{select:t}),document.activeElement!==n)return}function vb(e){const t=ud(e),n=il(t,e),r=il(t.reverse(),e);return[n,r]}function ud(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 il(e,t){for(const n of e)if(!bb(n,{upTo:t}))return n}function bb(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 wb(e){return e instanceof HTMLInputElement&&"select"in e}function Xt(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wb(e)&&t&&e.select()}}var al=kb();function kb(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ll(e,t),e.unshift(t)},remove(t){e=ll(e,t),e[0]?.resume()}}}function ll(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _b(e){return e.filter(t=>t.tagName!=="A")}var Sb="Portal",Po=v.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=v.useState(!1);Qe(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?Ip.createPortal(l.jsx(Ce.div,{...r,ref:t}),i):null});Po.displayName=Sb;var ds=0;function dd(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cl()),document.body.insertAdjacentElement("beforeend",e[1]??cl()),ds++,()=>{ds===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ds--}},[])}function cl(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Rt=function(){return Rt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Rt.apply(this,arguments)};function fd(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 Cb(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Yr="right-scroll-bar-position",Xr="width-before-scroll-bar",jb="with-scroll-bars-hidden",Eb="--removed-body-scroll-bar-size";function fs(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nb(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Tb=typeof window<"u"?v.useLayoutEffect:v.useEffect,ul=new WeakMap;function Ab(e,t){var n=Nb(null,function(r){return e.forEach(function(o){return fs(o,r)})});return Tb(function(){var r=ul.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||fs(a,null)}),s.forEach(function(a){o.has(a)||fs(a,i)})}ul.set(n,e)},[e]),n}function Ib(e){return e}function zb(e,t){t===void 0&&(t=Ib);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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function Rb(e){e===void 0&&(e={});var t=zb(null);return t.options=Rt({async:!0,ssr:!1},e),t}var hd=function(e){var t=e.sideCar,n=fd(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Rt({},n))};hd.isSideCarExport=!0;function Pb(e,t){return e.useMedium(t),hd}var pd=Rb(),hs=function(){},Oo=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:hs,onWheelCapture:hs,onTouchMoveCapture:hs}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,p=e.sideCar,f=e.noRelative,x=e.noIsolation,m=e.inert,y=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,k=e.gapMode,S=fd(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=p,C=Ab([n,t]),E=Rt(Rt({},S),o);return v.createElement(v.Fragment,null,d&&v.createElement(j,{sideCar:pd,removeScrollBar:u,shards:h,noRelative:f,noIsolation:x,inert:m,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:k}),i?v.cloneElement(v.Children.only(a),Rt(Rt({},E),{ref:C})):v.createElement(b,Rt({},E,{className:c,ref:C}),a))});Oo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Oo.classNames={fullWidth:Xr,zeroRight:Yr};var Ob=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Db(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ob();return t&&e.setAttribute("nonce",t),e}function Mb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lb(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Fb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Db())&&(Mb(t,n),Lb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Bb=function(){var e=Fb();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},md=function(){var e=Bb(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},$b={left:0,top:0,right:0,gap:0},ps=function(e){return parseInt(e||"",10)||0},Ub=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[ps(n),ps(r),ps(o)]},Zb=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $b;var t=Ub(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])}},Vb=md(),Dn="data-scroll-locked",Wb=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
40
|
+
.`.concat(jb,` {
|
|
41
|
+
overflow: hidden `).concat(r,`;
|
|
42
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
43
|
+
}
|
|
44
|
+
body[`).concat(Dn,`] {
|
|
45
|
+
overflow: hidden `).concat(r,`;
|
|
46
|
+
overscroll-behavior: contain;
|
|
47
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
48
|
+
padding-left: `.concat(o,`px;
|
|
49
|
+
padding-top: `).concat(s,`px;
|
|
50
|
+
padding-right: `).concat(i,`px;
|
|
51
|
+
margin-left:0;
|
|
52
|
+
margin-top:0;
|
|
53
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
54
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.`).concat(Yr,` {
|
|
58
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.`).concat(Xr,` {
|
|
62
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.`).concat(Yr," .").concat(Yr,` {
|
|
66
|
+
right: 0 `).concat(r,`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.`).concat(Xr," .").concat(Xr,` {
|
|
70
|
+
margin-right: 0 `).concat(r,`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
body[`).concat(Dn,`] {
|
|
74
|
+
`).concat(Eb,": ").concat(a,`px;
|
|
75
|
+
}
|
|
76
|
+
`)},dl=function(){var e=parseInt(document.body.getAttribute(Dn)||"0",10);return isFinite(e)?e:0},Hb=function(){v.useEffect(function(){return document.body.setAttribute(Dn,(dl()+1).toString()),function(){var e=dl()-1;e<=0?document.body.removeAttribute(Dn):document.body.setAttribute(Dn,e.toString())}},[])},qb=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Hb();var s=v.useMemo(function(){return Zb(o)},[o]);return v.createElement(Vb,{styles:Wb(s,!t,o,n?"":"!important")})},Ws=!1;if(typeof window<"u")try{var Mr=Object.defineProperty({},"passive",{get:function(){return Ws=!0,!0}});window.addEventListener("test",Mr,Mr),window.removeEventListener("test",Mr,Mr)}catch{Ws=!1}var Sn=Ws?{passive:!1}:!1,Kb=function(e){return e.tagName==="TEXTAREA"},gd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Kb(e)&&n[t]==="visible")},Gb=function(e){return gd(e,"overflowY")},Jb=function(e){return gd(e,"overflowX")},fl=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=xd(e,r);if(o){var s=yd(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Yb=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Xb=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xd=function(e,t){return e==="v"?Gb(t):Jb(t)},yd=function(e,t){return e==="v"?Yb(t):Xb(t)},Qb=function(e,t){return e==="h"&&t==="rtl"?-1:1},e2=function(e,t,n,r,o){var s=Qb(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,h=0,p=0;do{if(!a)break;var f=yd(e,a),x=f[0],m=f[1],y=f[2],g=m-y-s*x;(x||g)&&xd(e,a)&&(h+=g,p+=x);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(h)<1||!d&&Math.abs(p)<1)&&(u=!0),u},Lr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},hl=function(e){return[e.deltaX,e.deltaY]},pl=function(e){return e&&"current"in e?e.current:e},t2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},n2=function(e){return`
|
|
77
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
78
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
79
|
+
`)},r2=0,Cn=[];function o2(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(r2++)[0],s=v.useState(md)[0],i=v.useRef(e);v.useEffect(function(){i.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Cb([e.lockRef.current],(e.shards||[]).map(pl),!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=v.useCallback(function(m,y){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var g=Lr(m),b=n.current,k="deltaX"in m?m.deltaX:b[0]-g[0],S="deltaY"in m?m.deltaY:b[1]-g[1],j,C=m.target,E=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in m&&E==="h"&&C.type==="range")return!1;var T=window.getSelection(),R=T&&T.anchorNode,M=R?R===C||R.contains(C):!1;if(M)return!1;var B=fl(E,C);if(!B)return!0;if(B?j=E:(j=E==="v"?"h":"v",B=fl(E,C)),!B)return!1;if(!r.current&&"changedTouches"in m&&(k||S)&&(r.current=j),!j)return!0;var N=r.current||j;return e2(N,y,m,N==="h"?k:S)},[]),c=v.useCallback(function(m){var y=m;if(!(!Cn.length||Cn[Cn.length-1]!==s)){var g="deltaY"in y?hl(y):Lr(y),b=t.current.filter(function(j){return j.name===y.type&&(j.target===y.target||y.target===j.shadowParent)&&t2(j.delta,g)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var k=(i.current.shards||[]).map(pl).filter(Boolean).filter(function(j){return j.contains(y.target)}),S=k.length>0?a(y,k[0]):!i.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),u=v.useCallback(function(m,y,g,b){var k={name:m,delta:y,target:g,should:b,shadowParent:s2(g)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),d=v.useCallback(function(m){n.current=Lr(m),r.current=void 0},[]),h=v.useCallback(function(m){u(m.type,hl(m),m.target,a(m,e.lockRef.current))},[]),p=v.useCallback(function(m){u(m.type,Lr(m),m.target,a(m,e.lockRef.current))},[]);v.useEffect(function(){return Cn.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Sn),document.addEventListener("touchmove",c,Sn),document.addEventListener("touchstart",d,Sn),function(){Cn=Cn.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,Sn),document.removeEventListener("touchmove",c,Sn),document.removeEventListener("touchstart",d,Sn)}},[]);var f=e.removeScrollBar,x=e.inert;return v.createElement(v.Fragment,null,x?v.createElement(s,{styles:n2(o)}):null,f?v.createElement(qb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function s2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const i2=Pb(pd,o2);var Ui=v.forwardRef(function(e,t){return v.createElement(Oo,Rt({},e,{ref:t,sideCar:i2}))});Ui.classNames=Oo.classNames;var a2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jn=new WeakMap,Fr=new WeakMap,Br={},ms=0,vd=function(e){return e&&(e.host||vd(e.parentNode))},l2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=vd(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})},c2=function(e,t,n,r){var o=l2(t,Array.isArray(e)?e:[e]);Br[n]||(Br[n]=new WeakMap);var s=Br[n],i=[],a=new Set,c=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))d(p);else try{var f=p.getAttribute(r),x=f!==null&&f!=="false",m=(jn.get(p)||0)+1,y=(s.get(p)||0)+1;jn.set(p,m),s.set(p,y),i.push(p),m===1&&x&&Fr.set(p,!0),y===1&&p.setAttribute(n,"true"),x||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return d(t),a.clear(),ms++,function(){i.forEach(function(h){var p=jn.get(h)-1,f=s.get(h)-1;jn.set(h,p),s.set(h,f),p||(Fr.has(h)||h.removeAttribute(r),Fr.delete(h)),f||h.removeAttribute(n)}),ms--,ms||(jn=new WeakMap,jn=new WeakMap,Fr=new WeakMap,Br={})}},bd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=a2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),c2(r,o,n,"aria-hidden")):function(){return null}},Do="Dialog",[wd]=Gt(Do),[u2,At]=wd(Do),kd=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=v.useRef(null),c=v.useRef(null),[u,d]=hn({prop:r,defaultProp:o??!1,onChange:s,caller:Do});return l.jsx(u2,{scope:t,triggerRef:a,contentRef:c,contentId:Dt(),titleId:Dt(),descriptionId:Dt(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(h=>!h),[d]),modal:i,children:n})};kd.displayName=Do;var _d="DialogTrigger",Sd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(_d,n),s=Le(t,o.triggerRef);return l.jsx(Ce.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Wi(o.open),...r,ref:s,onClick:we(e.onClick,o.onOpenToggle)})});Sd.displayName=_d;var Zi="DialogPortal",[d2,Cd]=wd(Zi,{forceMount:void 0}),jd=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=At(Zi,t);return l.jsx(d2,{scope:t,forceMount:n,children:v.Children.map(r,i=>l.jsx(kt,{present:n||s.open,children:l.jsx(Po,{asChild:!0,container:o,children:i})}))})};jd.displayName=Zi;var co="DialogOverlay",Ed=v.forwardRef((e,t)=>{const n=Cd(co,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=At(co,e.__scopeDialog);return s.modal?l.jsx(kt,{present:r||s.open,children:l.jsx(h2,{...o,ref:t})}):null});Ed.displayName=co;var f2=Zn("DialogOverlay.RemoveScroll"),h2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(co,n);return l.jsx(Ui,{as:f2,allowPinchZoom:!0,shards:[o.contentRef],children:l.jsx(Ce.div,{"data-state":Wi(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),pn="DialogContent",Nd=v.forwardRef((e,t)=>{const n=Cd(pn,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=At(pn,e.__scopeDialog);return l.jsx(kt,{present:r||s.open,children:s.modal?l.jsx(p2,{...o,ref:t}):l.jsx(m2,{...o,ref:t})})});Nd.displayName=pn;var p2=v.forwardRef((e,t)=>{const n=At(pn,e.__scopeDialog),r=v.useRef(null),o=Le(t,n.contentRef,r);return v.useEffect(()=>{const s=r.current;if(s)return bd(s)},[]),l.jsx(Td,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:we(e.onFocusOutside,s=>s.preventDefault())})}),m2=v.forwardRef((e,t)=>{const n=At(pn,e.__scopeDialog),r=v.useRef(!1),o=v.useRef(!1);return l.jsx(Td,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Td=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=At(pn,n),c=v.useRef(null),u=Le(t,c);return dd(),l.jsxs(l.Fragment,{children:[l.jsx($i,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:l.jsx(Ro,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Wi(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(x2,{titleId:a.titleId}),l.jsx(v2,{contentRef:c,descriptionId:a.descriptionId})]})]})}),Vi="DialogTitle",Ad=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(Vi,n);return l.jsx(Ce.h2,{id:o.titleId,...r,ref:t})});Ad.displayName=Vi;var Id="DialogDescription",g2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(Id,n);return l.jsx(Ce.p,{id:o.descriptionId,...r,ref:t})});g2.displayName=Id;var zd="DialogClose",Rd=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=At(zd,n);return l.jsx(Ce.button,{type:"button",...r,ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))})});Rd.displayName=zd;function Wi(e){return e?"open":"closed"}var Pd="DialogTitleWarning",[z4,Od]=Kv(Pd,{contentName:pn,titleName:Vi,docsSlug:"dialog"}),x2=({titleId:e})=>{const t=Od(Pd),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
80
|
+
|
|
81
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
82
|
+
|
|
83
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},y2="DialogDescriptionWarning",v2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Od(y2).contentName}}.`;return v.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},b2=kd,w2=Sd,k2=jd,_2=Ed,S2=Nd,C2=Ad,j2=Rd;function E2(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function N2(e){const[t,n]=v.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 s=o[0];let i,a;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const T2=["top","right","bottom","left"],tn=Math.min,pt=Math.max,uo=Math.round,$r=Math.floor,Mt=e=>({x:e,y:e}),A2={left:"right",right:"left",bottom:"top",top:"bottom"},I2={start:"end",end:"start"};function Hs(e,t,n){return pt(e,tn(t,n))}function Ht(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Jn(e){return e.split("-")[1]}function Hi(e){return e==="x"?"y":"x"}function qi(e){return e==="y"?"height":"width"}const z2=new Set(["top","bottom"]);function Ot(e){return z2.has(qt(e))?"y":"x"}function Ki(e){return Hi(Ot(e))}function R2(e,t,n){n===void 0&&(n=!1);const r=Jn(e),o=Ki(e),s=qi(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=fo(i)),[i,fo(i)]}function P2(e){const t=fo(e);return[qs(e),t,qs(t)]}function qs(e){return e.replace(/start|end/g,t=>I2[t])}const ml=["left","right"],gl=["right","left"],O2=["top","bottom"],D2=["bottom","top"];function M2(e,t,n){switch(e){case"top":case"bottom":return n?t?gl:ml:t?ml:gl;case"left":case"right":return t?O2:D2;default:return[]}}function L2(e,t,n,r){const o=Jn(e);let s=M2(qt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(qs)))),s}function fo(e){return e.replace(/left|right|bottom|top/g,t=>A2[t])}function F2(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dd(e){return typeof e!="number"?F2(e):{top:e,right:e,bottom:e,left:e}}function ho(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xl(e,t,n){let{reference:r,floating:o}=e;const s=Ot(t),i=Ki(t),a=qi(i),c=qt(t),u=s==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(c){case"top":f={x:d,y:r.y-o.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-o.width,y:h};break;default:f={x:r.x,y:r.y}}switch(Jn(t)){case"start":f[i]-=p*(n&&u?-1:1);break;case"end":f[i]+=p*(n&&u?-1:1);break}return f}async function B2(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=Ht(t,e),x=Dd(f),y=a[p?h==="floating"?"reference":"floating":h],g=ho(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:c})),b=h==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},j=ho(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:k,strategy:c}):b);return{top:(g.top-j.top+x.top)/S.y,bottom:(j.bottom-g.bottom+x.bottom)/S.y,left:(g.left-j.left+x.left)/S.x,right:(j.right-g.right+x.right)/S.x}}const $2=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=xl(u,r,c),p=r,f={},x=0;for(let y=0;y<a.length;y++){var m;const{name:g,fn:b}=a[y],{x:k,y:S,data:j,reset:C}=await b({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...i,detectOverflow:(m=i.detectOverflow)!=null?m:B2},elements:{reference:e,floating:t}});d=k??d,h=S??h,f={...f,[g]:{...f[g],...j}},C&&x<=50&&(x++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:h}=xl(u,p,c)),y=-1)}return{x:d,y:h,placement:p,strategy:o,middlewareData:f}},U2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:u,padding:d=0}=Ht(e,t)||{};if(u==null)return{};const h=Dd(d),p={x:n,y:r},f=Ki(o),x=qi(f),m=await i.getDimensions(u),y=f==="y",g=y?"top":"left",b=y?"bottom":"right",k=y?"clientHeight":"clientWidth",S=s.reference[x]+s.reference[f]-p[f]-s.floating[x],j=p[f]-s.reference[f],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=C?C[k]:0;(!E||!await(i.isElement==null?void 0:i.isElement(C)))&&(E=a.floating[k]||s.floating[x]);const T=S/2-j/2,R=E/2-m[x]/2-1,M=tn(h[g],R),B=tn(h[b],R),N=M,O=E-m[x]-B,w=E/2-m[x]/2+T,D=Hs(N,w,O),X=!c.arrow&&Jn(o)!=null&&w!==D&&s.reference[x]/2-(w<N?M:B)-m[x]/2<0,W=X?w<N?w-N:w-O:0;return{[f]:p[f]+W,data:{[f]:D,centerOffset:w-D-W,...X&&{alignmentOffset:W}},reset:X}}}),Z2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...y}=Ht(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=qt(o),b=Ot(a),k=qt(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=p||(k||!m?[fo(a)]:P2(a)),C=x!=="none";!p&&C&&j.push(...L2(a,m,x,S));const E=[a,...j],T=await c.detectOverflow(t,y),R=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&R.push(T[g]),h){const w=R2(o,i,S);R.push(T[w[0]],T[w[1]])}if(M=[...M,{placement:o,overflows:R}],!R.every(w=>w<=0)){var B,N;const w=(((B=s.flip)==null?void 0:B.index)||0)+1,D=E[w];if(D&&(!(h==="alignment"?b!==Ot(D):!1)||M.every(H=>Ot(H.placement)===b?H.overflows[0]>0:!0)))return{data:{index:w,overflows:M},reset:{placement:D}};let X=(N=M.filter(W=>W.overflows[0]<=0).sort((W,H)=>W.overflows[1]-H.overflows[1])[0])==null?void 0:N.placement;if(!X)switch(f){case"bestFit":{var O;const W=(O=M.filter(H=>{if(C){const Y=Ot(H.placement);return Y===b||Y==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Y=>Y>0).reduce((Y,A)=>Y+A,0)]).sort((H,Y)=>H[1]-Y[1])[0])==null?void 0:O[0];W&&(X=W);break}case"initialPlacement":X=a;break}if(o!==X)return{reset:{placement:X}}}return{}}}};function yl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vl(e){return T2.some(t=>e[t]>=0)}const V2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Ht(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=yl(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:vl(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=yl(i,n.floating);return{data:{escapedOffsets:a,escaped:vl(a)}}}default:return{}}}}},Md=new Set(["left","top"]);async function W2(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=qt(n),a=Jn(n),c=Ot(n)==="y",u=Md.has(i)?-1:1,d=s&&c?-1:1,h=Ht(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),c?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const H2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await W2(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},q2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:g=>{let{x:b,y:k}=g;return{x:b,y:k}}},...u}=Ht(e,t),d={x:n,y:r},h=await s.detectOverflow(t,u),p=Ot(qt(o)),f=Hi(p);let x=d[f],m=d[p];if(i){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",k=x+h[g],S=x-h[b];x=Hs(k,x,S)}if(a){const g=p==="y"?"top":"left",b=p==="y"?"bottom":"right",k=m+h[g],S=m-h[b];m=Hs(k,m,S)}const y=c.fn({...t,[f]:x,[p]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:i,[p]:a}}}}}},K2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:u=!0}=Ht(e,t),d={x:n,y:r},h=Ot(o),p=Hi(h);let f=d[p],x=d[h];const m=Ht(a,t),y=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const k=p==="y"?"height":"width",S=s.reference[p]-s.floating[k]+y.mainAxis,j=s.reference[p]+s.reference[k]-y.mainAxis;f<S?f=S:f>j&&(f=j)}if(u){var g,b;const k=p==="y"?"width":"height",S=Md.has(qt(o)),j=s.reference[h]-s.floating[k]+(S&&((g=i.offset)==null?void 0:g[h])||0)+(S?0:y.crossAxis),C=s.reference[h]+s.reference[k]+(S?0:((b=i.offset)==null?void 0:b[h])||0)-(S?y.crossAxis:0);x<j?x=j:x>C&&(x=C)}return{[p]:f,[h]:x}}}},G2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...u}=Ht(e,t),d=await i.detectOverflow(t,u),h=qt(o),p=Jn(o),f=Ot(o)==="y",{width:x,height:m}=s.floating;let y,g;h==="top"||h==="bottom"?(y=h,g=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=h,y=p==="end"?"top":"bottom");const b=m-d.top-d.bottom,k=x-d.left-d.right,S=tn(m-d[y],b),j=tn(x-d[g],k),C=!t.middlewareData.shift;let E=S,T=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=b),C&&!p){const M=pt(d.left,0),B=pt(d.right,0),N=pt(d.top,0),O=pt(d.bottom,0);f?T=x-2*(M!==0||B!==0?M+B:pt(d.left,d.right)):E=m-2*(N!==0||O!==0?N+O:pt(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:E});const R=await i.getDimensions(a.floating);return x!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Mo(){return typeof window<"u"}function Yn(e){return Ld(e)?(e.nodeName||"").toLowerCase():"#document"}function gt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bt(e){var t;return(t=(Ld(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ld(e){return Mo()?e instanceof Node||e instanceof gt(e).Node:!1}function Nt(e){return Mo()?e instanceof Element||e instanceof gt(e).Element:!1}function Lt(e){return Mo()?e instanceof HTMLElement||e instanceof gt(e).HTMLElement:!1}function bl(e){return!Mo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gt(e).ShadowRoot}const J2=new Set(["inline","contents"]);function jr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!J2.has(o)}const Y2=new Set(["table","td","th"]);function X2(e){return Y2.has(Yn(e))}const Q2=[":popover-open",":modal"];function Lo(e){return Q2.some(t=>{try{return e.matches(t)}catch{return!1}})}const ew=["transform","translate","scale","rotate","perspective"],tw=["transform","translate","scale","rotate","perspective","filter"],nw=["paint","layout","strict","content"];function Gi(e){const t=Ji(),n=Nt(e)?Tt(e):e;return ew.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)||tw.some(r=>(n.willChange||"").includes(r))||nw.some(r=>(n.contain||"").includes(r))}function rw(e){let t=nn(e);for(;Lt(t)&&!Vn(t);){if(Gi(t))return t;if(Lo(t))return null;t=nn(t)}return null}function Ji(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ow=new Set(["html","body","#document"]);function Vn(e){return ow.has(Yn(e))}function Tt(e){return gt(e).getComputedStyle(e)}function Fo(e){return Nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nn(e){if(Yn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bl(e)&&e.host||Bt(e);return bl(t)?t.host:t}function Fd(e){const t=nn(e);return Vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&jr(t)?t:Fd(t)}function wr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Fd(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=gt(o);if(s){const a=Ks(i);return t.concat(i,i.visualViewport||[],jr(o)?o:[],a&&n?wr(a):[])}return t.concat(o,wr(o,[],n))}function Ks(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bd(e){const t=Tt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Lt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=uo(n)!==s||uo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Yi(e){return Nt(e)?e:e.contextElement}function Mn(e){const t=Yi(e);if(!Lt(t))return Mt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Bd(t);let i=(s?uo(n.width):n.width)/r,a=(s?uo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const sw=Mt(0);function $d(e){const t=gt(e);return!Ji()||!t.visualViewport?sw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gt(e)?!1:t}function mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Yi(e);let i=Mt(1);t&&(r?Nt(r)&&(i=Mn(r)):i=Mn(e));const a=iw(s,n,r)?$d(s):Mt(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,h=o.height/i.y;if(s){const p=gt(s),f=r&&Nt(r)?gt(r):r;let x=p,m=Ks(x);for(;m&&r&&f!==x;){const y=Mn(m),g=m.getBoundingClientRect(),b=Tt(m),k=g.left+(m.clientLeft+parseFloat(b.paddingLeft))*y.x,S=g.top+(m.clientTop+parseFloat(b.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,h*=y.y,c+=k,u+=S,x=gt(m),m=Ks(x)}}return ho({width:d,height:h,x:c,y:u})}function Bo(e,t){const n=Fo(e).scrollLeft;return t?t.left+n:mn(Bt(e)).left+n}function Ud(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bo(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function aw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Bt(r),a=t?Lo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=Mt(1);const d=Mt(0),h=Lt(r);if((h||!h&&!s)&&((Yn(r)!=="body"||jr(i))&&(c=Fo(r)),Lt(r))){const f=mn(r);u=Mn(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const p=i&&!h&&!s?Ud(i,c):Mt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-c.scrollTop*u.y+d.y+p.y}}function lw(e){return Array.from(e.getClientRects())}function cw(e){const t=Bt(e),n=Fo(e),r=e.ownerDocument.body,o=pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Bo(e);const a=-n.scrollTop;return Tt(r).direction==="rtl"&&(i+=pt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const wl=25;function uw(e,t){const n=gt(e),r=Bt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const d=Ji();(!d||d&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=Bo(r);if(u<=0){const d=r.ownerDocument,h=d.body,p=getComputedStyle(h),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(r.clientWidth-h.clientWidth-f);x<=wl&&(s-=x)}else u<=wl&&(s+=u);return{width:s,height:i,x:a,y:c}}const dw=new Set(["absolute","fixed"]);function fw(e,t){const n=mn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Lt(e)?Mn(e):Mt(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function kl(e,t,n){let r;if(t==="viewport")r=uw(e,n);else if(t==="document")r=cw(Bt(e));else if(Nt(t))r=fw(t,n);else{const o=$d(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ho(r)}function Zd(e,t){const n=nn(e);return n===t||!Nt(n)||Vn(n)?!1:Tt(n).position==="fixed"||Zd(n,t)}function hw(e,t){const n=t.get(e);if(n)return n;let r=wr(e,[],!1).filter(a=>Nt(a)&&Yn(a)!=="body"),o=null;const s=Tt(e).position==="fixed";let i=s?nn(e):e;for(;Nt(i)&&!Vn(i);){const a=Tt(i),c=Gi(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&dw.has(o.position)||jr(i)&&!c&&Zd(e,i))?r=r.filter(d=>d!==i):o=a,i=nn(i)}return t.set(e,r),r}function pw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Lo(t)?[]:hw(t,this._c):[].concat(n),r],a=i[0],c=i.reduce((u,d)=>{const h=kl(t,d,o);return u.top=pt(h.top,u.top),u.right=tn(h.right,u.right),u.bottom=tn(h.bottom,u.bottom),u.left=pt(h.left,u.left),u},kl(t,a,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function mw(e){const{width:t,height:n}=Bd(e);return{width:t,height:n}}function gw(e,t,n){const r=Lt(t),o=Bt(t),s=n==="fixed",i=mn(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=Mt(0);function u(){c.x=Bo(o)}if(r||!r&&!s)if((Yn(t)!=="body"||jr(o))&&(a=Fo(t)),r){const f=mn(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?Ud(o,a):Mt(0),h=i.left+a.scrollLeft-c.x-d.x,p=i.top+a.scrollTop-c.y-d.y;return{x:h,y:p,width:i.width,height:i.height}}function gs(e){return Tt(e).position==="static"}function _l(e,t){if(!Lt(e)||Tt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bt(e)===n&&(n=n.ownerDocument.body),n}function Vd(e,t){const n=gt(e);if(Lo(e))return n;if(!Lt(e)){let o=nn(e);for(;o&&!Vn(o);){if(Nt(o)&&!gs(o))return o;o=nn(o)}return n}let r=_l(e,t);for(;r&&X2(r)&&gs(r);)r=_l(r,t);return r&&Vn(r)&&gs(r)&&!Gi(r)?n:r||rw(e)||n}const xw=async function(e){const t=this.getOffsetParent||Vd,n=this.getDimensions,r=await n(e.floating);return{reference:gw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yw(e){return Tt(e).direction==="rtl"}const vw={convertOffsetParentRelativeRectToViewportRelativeRect:aw,getDocumentElement:Bt,getClippingRect:pw,getOffsetParent:Vd,getElementRects:xw,getClientRects:lw,getDimensions:mw,getScale:Mn,isElement:Nt,isRTL:yw};function Wd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bw(e,t){let n=null,r;const o=Bt(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=u;if(a||t(),!p||!f)return;const x=$r(h),m=$r(o.clientWidth-(d+p)),y=$r(o.clientHeight-(h+f)),g=$r(d),k={rootMargin:-x+"px "+-m+"px "+-y+"px "+-g+"px",threshold:pt(0,tn(1,c))||1};let S=!0;function j(C){const E=C[0].intersectionRatio;if(E!==c){if(!S)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Wd(u,e.getBoundingClientRect())&&i(),S=!1}try{n=new IntersectionObserver(j,{...k,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,k)}n.observe(e)}return i(!0),s}function ww(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=Yi(e),d=o||s?[...u?wr(u):[],...wr(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const h=u&&a?bw(u,n):null;let p=-1,f=null;i&&(f=new ResizeObserver(g=>{let[b]=g;b&&b.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=f)==null||k.observe(t)})),n()}),u&&!c&&f.observe(u),f.observe(t));let x,m=c?mn(e):null;c&&y();function y(){const g=mn(e);m&&!Wd(m,g)&&n(),m=g,x=requestAnimationFrame(y)}return n(),()=>{var g;d.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),h?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(x)}}const kw=H2,_w=q2,Sw=Z2,Cw=G2,jw=V2,Sl=U2,Ew=K2,Nw=(e,t,n)=>{const r=new Map,o={platform:vw,...n},s={...o.platform,_c:r};return $2(e,t,{...o,platform:s})};var Tw=typeof document<"u",Aw=function(){},Qr=Tw?v.useLayoutEffect:Aw;function po(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(!po(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 s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!po(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Hd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cl(e,t){const n=Hd(e);return Math.round(t*n)/n}function xs(e){const t=v.useRef(e);return Qr(()=>{t.current=e}),t}function Iw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:u}=e,[d,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=v.useState(r);po(p,r)||f(r);const[x,m]=v.useState(null),[y,g]=v.useState(null),b=v.useCallback(H=>{H!==C.current&&(C.current=H,m(H))},[]),k=v.useCallback(H=>{H!==E.current&&(E.current=H,g(H))},[]),S=s||x,j=i||y,C=v.useRef(null),E=v.useRef(null),T=v.useRef(d),R=c!=null,M=xs(c),B=xs(o),N=xs(u),O=v.useCallback(()=>{if(!C.current||!E.current)return;const H={placement:t,strategy:n,middleware:p};B.current&&(H.platform=B.current),Nw(C.current,E.current,H).then(Y=>{const A={...Y,isPositioned:N.current!==!1};w.current&&!po(T.current,A)&&(T.current=A,Sr.flushSync(()=>{h(A)}))})},[p,t,n,B,N]);Qr(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[u]);const w=v.useRef(!1);Qr(()=>(w.current=!0,()=>{w.current=!1}),[]),Qr(()=>{if(S&&(C.current=S),j&&(E.current=j),S&&j){if(M.current)return M.current(S,j,O);O()}},[S,j,O,M,R]);const D=v.useMemo(()=>({reference:C,floating:E,setReference:b,setFloating:k}),[b,k]),X=v.useMemo(()=>({reference:S,floating:j}),[S,j]),W=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!X.floating)return H;const Y=Cl(X.floating,d.x),A=Cl(X.floating,d.y);return a?{...H,transform:"translate("+Y+"px, "+A+"px)",...Hd(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:A}},[n,a,X.floating,d.x,d.y]);return v.useMemo(()=>({...d,update:O,refs:D,elements:X,floatingStyles:W}),[d,O,D,X,W])}const zw=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Sl({element:r.current,padding:o}).fn(n):{}:r?Sl({element:r,padding:o}).fn(n):{}}}},Rw=(e,t)=>({...kw(e),options:[e,t]}),Pw=(e,t)=>({..._w(e),options:[e,t]}),Ow=(e,t)=>({...Ew(e),options:[e,t]}),Dw=(e,t)=>({...Sw(e),options:[e,t]}),Mw=(e,t)=>({...Cw(e),options:[e,t]}),Lw=(e,t)=>({...jw(e),options:[e,t]}),Fw=(e,t)=>({...zw(e),options:[e,t]});var Bw="Arrow",qd=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return l.jsx(Ce.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});qd.displayName=Bw;var $w=qd,Xi="Popper",[Kd,$o]=Gt(Xi),[Uw,Gd]=Kd(Xi),Jd=e=>{const{__scopePopper:t,children:n}=e,[r,o]=v.useState(null);return l.jsx(Uw,{scope:t,anchor:r,onAnchorChange:o,children:n})};Jd.displayName=Xi;var Yd="PopperAnchor",Xd=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=Gd(Yd,n),i=v.useRef(null),a=Le(t,i),c=v.useRef(null);return v.useEffect(()=>{const u=c.current;c.current=r?.current||i.current,u!==c.current&&s.onAnchorChange(c.current)}),r?null:l.jsx(Ce.div,{...o,ref:a})});Xd.displayName=Yd;var Qi="PopperContent",[Zw,Vw]=Kd(Qi),Qd=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:f="optimized",onPlaced:x,...m}=e,y=Gd(Qi,n),[g,b]=v.useState(null),k=Le(t,te=>b(te)),[S,j]=v.useState(null),C=N2(S),E=C?.width??0,T=C?.height??0,R=r+(s!=="center"?"-"+s:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(u)?u:[u],N=B.length>0,O={padding:M,boundary:B.filter(Hw),altBoundary:N},{refs:w,floatingStyles:D,placement:X,isPositioned:W,middlewareData:H}=Iw({strategy:"fixed",placement:R,whileElementsMounted:(...te)=>ww(...te,{animationFrame:f==="always"}),elements:{reference:y.anchor},middleware:[Rw({mainAxis:o+T,alignmentAxis:i}),c&&Pw({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Ow():void 0,...O}),c&&Dw({...O}),Mw({...O,apply:({elements:te,rects:ce,availableWidth:fe,availableHeight:ge})=>{const{width:xe,height:Ee}=ce.reference,Fe=te.floating.style;Fe.setProperty("--radix-popper-available-width",`${fe}px`),Fe.setProperty("--radix-popper-available-height",`${ge}px`),Fe.setProperty("--radix-popper-anchor-width",`${xe}px`),Fe.setProperty("--radix-popper-anchor-height",`${Ee}px`)}}),S&&Fw({element:S,padding:a}),qw({arrowWidth:E,arrowHeight:T}),p&&Lw({strategy:"referenceHidden",...O})]}),[Y,A]=nf(X),V=st(x);Qe(()=>{W&&V?.()},[W,V]);const Z=H.arrow?.x,I=H.arrow?.y,oe=H.arrow?.centerOffset!==0,[J,de]=v.useState();return Qe(()=>{g&&de(window.getComputedStyle(g).zIndex)},[g]),l.jsx("div",{ref:w.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:W?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(Zw,{scope:n,placedSide:Y,onArrowChange:j,arrowX:Z,arrowY:I,shouldHideArrow:oe,children:l.jsx(Ce.div,{"data-side":Y,"data-align":A,...m,ref:k,style:{...m.style,animation:W?void 0:"none"}})})})});Qd.displayName=Qi;var ef="PopperArrow",Ww={top:"bottom",right:"left",bottom:"top",left:"right"},tf=v.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Vw(ef,r),i=Ww[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx($w,{...o,ref:n,style:{...o.style,display:"block"}})})});tf.displayName=ef;function Hw(e){return e!==null}var qw=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=nf(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+c/2;let x="",m="";return u==="bottom"?(x=i?h:`${p}px`,m=`${-c}px`):u==="top"?(x=i?h:`${p}px`,m=`${r.floating.height+c}px`):u==="right"?(x=`${-c}px`,m=i?h:`${f}px`):u==="left"&&(x=`${r.floating.width+c}px`,m=i?h:`${f}px`),{data:{x,y:m}}}});function nf(e){const[t,n="center"]=e.split("-");return[t,n]}var rf=Jd,of=Xd,sf=Qd,af=tf,ys="rovingFocusGroup.onEntryFocus",Kw={bubbles:!1,cancelable:!0},Er="RovingFocusGroup",[Gs,lf,Gw]=rd(Er),[Jw,cf]=Gt(Er,[Gw]),[Yw,Xw]=Jw(Er),uf=v.forwardRef((e,t)=>l.jsx(Gs.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Gs.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Qw,{...e,ref:t})})}));uf.displayName=Er;var Qw=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,p=v.useRef(null),f=Le(t,p),x=zo(s),[m,y]=hn({prop:i,defaultProp:a??null,onChange:c,caller:Er}),[g,b]=v.useState(!1),k=st(u),S=lf(n),j=v.useRef(!1),[C,E]=v.useState(0);return v.useEffect(()=>{const T=p.current;if(T)return T.addEventListener(ys,k),()=>T.removeEventListener(ys,k)},[k]),l.jsx(Yw,{scope:n,orientation:r,dir:x,loop:o,currentTabStopId:m,onItemFocus:v.useCallback(T=>y(T),[y]),onItemShiftTab:v.useCallback(()=>b(!0),[]),onFocusableItemAdd:v.useCallback(()=>E(T=>T+1),[]),onFocusableItemRemove:v.useCallback(()=>E(T=>T-1),[]),children:l.jsx(Ce.div,{tabIndex:g||C===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{j.current=!0}),onFocus:we(e.onFocus,T=>{const R=!j.current;if(T.target===T.currentTarget&&R&&!g){const M=new CustomEvent(ys,Kw);if(T.currentTarget.dispatchEvent(M),!M.defaultPrevented){const B=S().filter(X=>X.focusable),N=B.find(X=>X.active),O=B.find(X=>X.id===m),D=[N,O,...B].filter(Boolean).map(X=>X.ref.current);hf(D,d)}}j.current=!1}),onBlur:we(e.onBlur,()=>b(!1))})})}),df="RovingFocusGroupItem",ff=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,c=Dt(),u=s||c,d=Xw(df,n),h=d.currentTabStopId===u,p=lf(n),{onFocusableItemAdd:f,onFocusableItemRemove:x,currentTabStopId:m}=d;return v.useEffect(()=>{if(r)return f(),()=>x()},[r,f,x]),l.jsx(Gs.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:l.jsx(Ce.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:we(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:we(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:we(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=nk(y,d.orientation,d.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=d.loop?rk(k,S+1):k.slice(S+1)}setTimeout(()=>hf(k))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:m!=null}):i})})});ff.displayName=df;var ek={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tk(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nk(e,t,n){const r=tk(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ek[r]}function hf(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function rk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ok=uf,sk=ff;function Js(e,[t,n]){return Math.min(n,Math.max(t,e))}function ik(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var ea="ScrollArea",[pf]=Gt(ea),[ak,_t]=pf(ea),mf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[a,c]=v.useState(null),[u,d]=v.useState(null),[h,p]=v.useState(null),[f,x]=v.useState(null),[m,y]=v.useState(null),[g,b]=v.useState(0),[k,S]=v.useState(0),[j,C]=v.useState(!1),[E,T]=v.useState(!1),R=Le(t,B=>c(B)),M=zo(o);return l.jsx(ak,{scope:n,type:r,dir:M,scrollHideDelay:s,scrollArea:a,viewport:u,onViewportChange:d,content:h,onContentChange:p,scrollbarX:f,onScrollbarXChange:x,scrollbarXEnabled:j,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:S,children:l.jsx(Ce.div,{dir:M,...i,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});mf.displayName=ea;var gf="ScrollAreaViewport",xf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=_t(gf,n),a=v.useRef(null),c=Le(t,a,i.onViewportChange);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(Ce.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});xf.displayName=gf;var $t="ScrollAreaScrollbar",yf=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_t($t,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,a=e.orientation==="horizontal";return v.useEffect(()=>(a?s(!0):i(!0),()=>{a?s(!1):i(!1)}),[a,s,i]),o.type==="hover"?l.jsx(lk,{...r,ref:t,forceMount:n}):o.type==="scroll"?l.jsx(ck,{...r,ref:t,forceMount:n}):o.type==="auto"?l.jsx(vf,{...r,ref:t,forceMount:n}):o.type==="always"?l.jsx(ta,{...r,ref:t}):null});yf.displayName=$t;var lk=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_t($t,e.__scopeScrollArea),[s,i]=v.useState(!1);return v.useEffect(()=>{const a=o.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),l.jsx(kt,{present:n||s,children:l.jsx(vf,{"data-state":s?"visible":"hidden",...r,ref:t})})}),ck=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_t($t,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Zo(()=>c("SCROLL_END"),100),[a,c]=ik("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,c]),v.useEffect(()=>{const u=o.viewport,d=s?"scrollLeft":"scrollTop";if(u){let h=u[d];const p=()=>{const f=u[d];h!==f&&(c("SCROLL"),i()),h=f};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,s,c,i]),l.jsx(kt,{present:n||a!=="hidden",children:l.jsx(ta,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:we(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),vf=v.forwardRef((e,t)=>{const n=_t($t,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=v.useState(!1),a=e.orientation==="horizontal",c=Zo(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;i(a?u:d)}},10);return Wn(n.viewport,c),Wn(n.content,c),l.jsx(kt,{present:r||s,children:l.jsx(ta,{"data-state":s?"visible":"hidden",...o,ref:t})})}),ta=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=_t($t,e.__scopeScrollArea),s=v.useRef(null),i=v.useRef(0),[a,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Sf(a.viewport,a.content),d={...r,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function h(p,f){return mk(p,i.current,a,f)}return n==="horizontal"?l.jsx(uk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollLeft,f=jl(p,a,o.dir);s.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"?l.jsx(dk,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollTop,f=jl(p,a);s.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}),uk=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=_t($t,e.__scopeScrollArea),[i,a]=v.useState(),c=v.useRef(null),u=Le(t,c,s.onScrollbarXChange);return v.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(wf,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Uo(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(s.viewport){const p=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),jf(p,h)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:go(i.paddingLeft),paddingEnd:go(i.paddingRight)}})}})}),dk=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=_t($t,e.__scopeScrollArea),[i,a]=v.useState(),c=v.useRef(null),u=Le(t,c,s.onScrollbarYChange);return v.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),l.jsx(wf,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Uo(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(s.viewport){const p=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),jf(p,h)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:go(i.paddingTop),paddingEnd:go(i.paddingBottom)}})}})}),[fk,bf]=pf($t),wf=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...p}=e,f=_t($t,n),[x,m]=v.useState(null),y=Le(t,R=>m(R)),g=v.useRef(null),b=v.useRef(""),k=f.viewport,S=r.content-r.viewport,j=st(d),C=st(c),E=Zo(h,10);function T(R){if(g.current){const M=R.clientX-g.current.left,B=R.clientY-g.current.top;u({x:M,y:B})}}return v.useEffect(()=>{const R=M=>{const B=M.target;x?.contains(B)&&j(M,S)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[k,x,S,j]),v.useEffect(C,[r,C]),Wn(x,E),Wn(f.content,E),l.jsx(fk,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:st(s),onThumbPointerUp:st(i),onThumbPositionChange:C,onThumbPointerDown:st(a),children:l.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(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),T(R))}),onPointerMove:we(e.onPointerMove,T),onPointerUp:we(e.onPointerUp,R=>{const M=R.target;M.hasPointerCapture(R.pointerId)&&M.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=b.current,f.viewport&&(f.viewport.style.scrollBehavior=""),g.current=null})})})}),mo="ScrollAreaThumb",kf=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=bf(mo,e.__scopeScrollArea);return l.jsx(kt,{present:n||o.hasThumb,children:l.jsx(hk,{ref:t,...r})})}),hk=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=_t(mo,n),i=bf(mo,n),{onThumbPositionChange:a}=i,c=Le(t,h=>i.onThumbChange(h)),u=v.useRef(void 0),d=Zo(()=>{u.current&&(u.current(),u.current=void 0)},100);return v.useEffect(()=>{const h=s.viewport;if(h){const p=()=>{if(d(),!u.current){const f=gk(h,a);u.current=f,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[s.viewport,d,a]),l.jsx(Ce.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:c,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;i.onThumbPointerDown({x,y:m})}),onPointerUp:we(e.onPointerUp,i.onThumbPointerUp)})});kf.displayName=mo;var na="ScrollAreaCorner",_f=v.forwardRef((e,t)=>{const n=_t(na,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(pk,{...e,ref:t}):null});_f.displayName=na;var pk=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=_t(na,n),[s,i]=v.useState(0),[a,c]=v.useState(0),u=!!(s&&a);return Wn(o.scrollbarX,()=>{const d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),c(d)}),Wn(o.scrollbarY,()=>{const d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),i(d)}),u?l.jsx(Ce.div,{...r,ref:t,style:{width:s,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function go(e){return e?parseInt(e,10):0}function Sf(e,t){const n=e/t;return isNaN(n)?0:n}function Uo(e){const t=Sf(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function mk(e,t,n,r="ltr"){const o=Uo(n),s=o/2,i=t||s,a=o-i,c=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return Cf([c,u],h)(e)}function jl(e,t,n="ltr"){const r=Uo(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,a=s-r,c=n==="ltr"?[0,i]:[i*-1,0],u=Js(e,c);return Cf([0,i],[0,a])(u)}function Cf(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 jf(e,t){return e>0&&e<t}var gk=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,a=n.top!==s.top;(i||a)&&t(),n=s,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Zo(e,t){const n=st(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Wn(e,t){const n=st(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 xk=mf,yk=xf,vk=_f,bk=[" ","Enter","ArrowUp","ArrowDown"],wk=[" ","Enter"],gn="Select",[Vo,Wo,kk]=rd(gn),[Xn]=Gt(gn,[kk,$o]),Ho=$o(),[_k,an]=Xn(gn),[Sk,Ck]=Xn(gn),Ef=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:p,required:f,form:x}=e,m=Ho(t),[y,g]=v.useState(null),[b,k]=v.useState(null),[S,j]=v.useState(!1),C=zo(u),[E,T]=hn({prop:r,defaultProp:o??!1,onChange:s,caller:gn}),[R,M]=hn({prop:i,defaultProp:a,onChange:c,caller:gn}),B=v.useRef(null),N=y?x||!!y.closest("form"):!0,[O,w]=v.useState(new Set),D=Array.from(O).map(X=>X.props.value).join(";");return l.jsx(rf,{...m,children:l.jsxs(_k,{required:f,scope:t,trigger:y,onTriggerChange:g,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:Dt(),value:R,onValueChange:M,open:E,onOpenChange:T,dir:C,triggerPointerDownPosRef:B,disabled:p,children:[l.jsx(Vo.Provider,{scope:t,children:l.jsx(Sk,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(X=>{w(W=>new Set(W).add(X))},[]),onNativeOptionRemove:v.useCallback(X=>{w(W=>{const H=new Set(W);return H.delete(X),H})},[]),children:n})}),N?l.jsxs(Gf,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:R,onChange:X=>M(X.target.value),disabled:p,form:x,children:[R===void 0?l.jsx("option",{value:""}):null,Array.from(O)]},D):null]})})};Ef.displayName=gn;var Nf="SelectTrigger",Tf=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Ho(n),i=an(Nf,n),a=i.disabled||r,c=Le(t,i.onTriggerChange),u=Wo(n),d=v.useRef("touch"),[h,p,f]=Yf(m=>{const y=u().filter(k=>!k.disabled),g=y.find(k=>k.value===i.value),b=Xf(y,m,g);b!==void 0&&i.onValueChange(b.value)}),x=m=>{a||(i.onOpenChange(!0),f()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(of,{asChild:!0,...s,children:l.jsx(Ce.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Jf(i.value)?"":void 0,...o,ref:c,onClick:we(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&x(m)}),onPointerDown:we(o.onPointerDown,m=>{d.current=m.pointerType;const y=m.target;y.hasPointerCapture(m.pointerId)&&y.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:we(o.onKeyDown,m=>{const y=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(y&&m.key===" ")&&bk.includes(m.key)&&(x(),m.preventDefault())})})})});Tf.displayName=Nf;var Af="SelectValue",If=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=an(Af,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,h=Le(t,c.onValueNodeChange);return Qe(()=>{u(d)},[u,d]),l.jsx(Ce.span,{...a,ref:h,style:{pointerEvents:"none"},children:Jf(c.value)?l.jsx(l.Fragment,{children:i}):s})});If.displayName=Af;var jk="SelectIcon",zf=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return l.jsx(Ce.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});zf.displayName=jk;var Ek="SelectPortal",Rf=e=>l.jsx(Po,{asChild:!0,...e});Rf.displayName=Ek;var xn="SelectContent",Pf=v.forwardRef((e,t)=>{const n=an(xn,e.__scopeSelect),[r,o]=v.useState();if(Qe(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Sr.createPortal(l.jsx(Of,{scope:e.__scopeSelect,children:l.jsx(Vo.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(Df,{...e,ref:t})});Pf.displayName=xn;var jt=10,[Of,ln]=Xn(xn),Nk="SelectContentImpl",Tk=Zn("SelectContent.RemoveScroll"),Df=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y,...g}=e,b=an(xn,n),[k,S]=v.useState(null),[j,C]=v.useState(null),E=Le(t,te=>S(te)),[T,R]=v.useState(null),[M,B]=v.useState(null),N=Wo(n),[O,w]=v.useState(!1),D=v.useRef(!1);v.useEffect(()=>{if(k)return bd(k)},[k]),dd();const X=v.useCallback(te=>{const[ce,...fe]=N().map(Ee=>Ee.ref.current),[ge]=fe.slice(-1),xe=document.activeElement;for(const Ee of te)if(Ee===xe||(Ee?.scrollIntoView({block:"nearest"}),Ee===ce&&j&&(j.scrollTop=0),Ee===ge&&j&&(j.scrollTop=j.scrollHeight),Ee?.focus(),document.activeElement!==xe))return},[N,j]),W=v.useCallback(()=>X([T,k]),[X,T,k]);v.useEffect(()=>{O&&W()},[O,W]);const{onOpenChange:H,triggerPointerDownPosRef:Y}=b;v.useEffect(()=>{if(k){let te={x:0,y:0};const ce=ge=>{te={x:Math.abs(Math.round(ge.pageX)-(Y.current?.x??0)),y:Math.abs(Math.round(ge.pageY)-(Y.current?.y??0))}},fe=ge=>{te.x<=10&&te.y<=10?ge.preventDefault():k.contains(ge.target)||H(!1),document.removeEventListener("pointermove",ce),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",fe,{capture:!0})}}},[k,H,Y]),v.useEffect(()=>{const te=()=>H(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[H]);const[A,V]=Yf(te=>{const ce=N().filter(xe=>!xe.disabled),fe=ce.find(xe=>xe.ref.current===document.activeElement),ge=Xf(ce,te,fe);ge&&setTimeout(()=>ge.ref.current.focus())}),Z=v.useCallback((te,ce,fe)=>{const ge=!D.current&&!fe;(b.value!==void 0&&b.value===ce||ge)&&(R(te),ge&&(D.current=!0))},[b.value]),I=v.useCallback(()=>k?.focus(),[k]),oe=v.useCallback((te,ce,fe)=>{const ge=!D.current&&!fe;(b.value!==void 0&&b.value===ce||ge)&&B(te)},[b.value]),J=r==="popper"?Ys:Mf,de=J===Ys?{side:a,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:f,sticky:x,hideWhenDetached:m,avoidCollisions:y}:{};return l.jsx(Of,{scope:n,content:k,viewport:j,onViewportChange:C,itemRefCallback:Z,selectedItem:T,onItemLeave:I,itemTextRefCallback:oe,focusSelectedItem:W,selectedItemText:M,position:r,isPositioned:O,searchRef:A,children:l.jsx(Ui,{as:Tk,allowPinchZoom:!0,children:l.jsx($i,{asChild:!0,trapped:b.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:we(o,te=>{b.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:l.jsx(Ro,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:l.jsx(J,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:te=>te.preventDefault(),...g,...de,onPlaced:()=>w(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:we(g.onKeyDown,te=>{const ce=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ce&&te.key.length===1&&V(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ge=N().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const xe=te.target,Ee=ge.indexOf(xe);ge=ge.slice(Ee+1)}setTimeout(()=>X(ge)),te.preventDefault()}})})})})})})});Df.displayName=Nk;var Ak="SelectItemAlignedPosition",Mf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=an(xn,n),i=ln(xn,n),[a,c]=v.useState(null),[u,d]=v.useState(null),h=Le(t,E=>d(E)),p=Wo(n),f=v.useRef(!1),x=v.useRef(!0),{viewport:m,selectedItem:y,selectedItemText:g,focusSelectedItem:b}=i,k=v.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&y&&g){const E=s.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),M=g.getBoundingClientRect();if(s.dir!=="rtl"){const xe=M.left-T.left,Ee=R.left-xe,Fe=E.left-Ee,_=E.width+Fe,ee=Math.max(_,T.width),K=window.innerWidth-jt,P=Js(Ee,[jt,Math.max(jt,K-ee)]);a.style.minWidth=_+"px",a.style.left=P+"px"}else{const xe=T.right-M.right,Ee=window.innerWidth-R.right-xe,Fe=window.innerWidth-E.right-Ee,_=E.width+Fe,ee=Math.max(_,T.width),K=window.innerWidth-jt,P=Js(Ee,[jt,Math.max(jt,K-ee)]);a.style.minWidth=_+"px",a.style.right=P+"px"}const B=p(),N=window.innerHeight-jt*2,O=m.scrollHeight,w=window.getComputedStyle(u),D=parseInt(w.borderTopWidth,10),X=parseInt(w.paddingTop,10),W=parseInt(w.borderBottomWidth,10),H=parseInt(w.paddingBottom,10),Y=D+X+O+H+W,A=Math.min(y.offsetHeight*5,Y),V=window.getComputedStyle(m),Z=parseInt(V.paddingTop,10),I=parseInt(V.paddingBottom,10),oe=E.top+E.height/2-jt,J=N-oe,de=y.offsetHeight/2,te=y.offsetTop+de,ce=D+X+te,fe=Y-ce;if(ce<=oe){const xe=B.length>0&&y===B[B.length-1].ref.current;a.style.bottom="0px";const Ee=u.clientHeight-m.offsetTop-m.offsetHeight,Fe=Math.max(J,de+(xe?I:0)+Ee+W),_=ce+Fe;a.style.height=_+"px"}else{const xe=B.length>0&&y===B[0].ref.current;a.style.top="0px";const Fe=Math.max(oe,D+m.offsetTop+(xe?Z:0)+de)+fe;a.style.height=Fe+"px",m.scrollTop=ce-oe+m.offsetTop}a.style.margin=`${jt}px 0`,a.style.minHeight=A+"px",a.style.maxHeight=N+"px",r?.(),requestAnimationFrame(()=>f.current=!0)}},[p,s.trigger,s.valueNode,a,u,m,y,g,s.dir,r]);Qe(()=>k(),[k]);const[S,j]=v.useState();Qe(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const C=v.useCallback(E=>{E&&x.current===!0&&(k(),b?.(),x.current=!1)},[k,b]);return l.jsx(zk,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:l.jsx(Ce.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Mf.displayName=Ak;var Ik="SelectPopperPosition",Ys=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=jt,...s}=e,i=Ho(n);return l.jsx(sf,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});Ys.displayName=Ik;var[zk,ra]=Xn(xn,{}),Xs="SelectViewport",Lf=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=ln(Xs,n),i=ra(Xs,n),a=Le(t,s.onViewportChange),c=v.useRef(0);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(Vo.Slot,{scope:n,children:l.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,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=i;if(p?.current&&h){const f=Math.abs(c.current-d.scrollTop);if(f>0){const x=window.innerHeight-jt*2,m=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),g=Math.max(m,y);if(g<x){const b=g+f,k=Math.min(x,b),S=b-k;h.style.height=k+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Lf.displayName=Xs;var Ff="SelectGroup",[Rk,Pk]=Xn(Ff),Ok=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Dt();return l.jsx(Rk,{scope:n,id:o,children:l.jsx(Ce.div,{role:"group","aria-labelledby":o,...r,ref:t})})});Ok.displayName=Ff;var Bf="SelectLabel",Dk=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pk(Bf,n);return l.jsx(Ce.div,{id:o.id,...r,ref:t})});Dk.displayName=Bf;var xo="SelectItem",[Mk,$f]=Xn(xo),Uf=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=an(xo,n),c=ln(xo,n),u=a.value===r,[d,h]=v.useState(s??""),[p,f]=v.useState(!1),x=Le(t,b=>c.itemRefCallback?.(b,r,o)),m=Dt(),y=v.useRef("touch"),g=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(Mk,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:v.useCallback(b=>{h(k=>k||(b?.textContent??"").trim())},[]),children:l.jsx(Vo.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:l.jsx(Ce.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:x,onFocus:we(i.onFocus,()=>f(!0)),onBlur:we(i.onBlur,()=>f(!1)),onClick:we(i.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:we(i.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:we(i.onPointerDown,b=>{y.current=b.pointerType}),onPointerMove:we(i.onPointerMove,b=>{y.current=b.pointerType,o?c.onItemLeave?.():y.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(i.onPointerLeave,b=>{b.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:we(i.onKeyDown,b=>{c.searchRef?.current!==""&&b.key===" "||(wk.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});Uf.displayName=xo;var hr="SelectItemText",Zf=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=an(hr,n),a=ln(hr,n),c=$f(hr,n),u=Ck(hr,n),[d,h]=v.useState(null),p=Le(t,g=>h(g),c.onItemTextChange,g=>a.itemTextRefCallback?.(g,c.value,c.disabled)),f=d?.textContent,x=v.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:y}=u;return Qe(()=>(m(x),()=>y(x)),[m,y,x]),l.jsxs(l.Fragment,{children:[l.jsx(Ce.span,{id:c.textId,...s,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Sr.createPortal(s.children,i.valueNode):null]})});Zf.displayName=hr;var Vf="SelectItemIndicator",Wf=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return $f(Vf,n).isSelected?l.jsx(Ce.span,{"aria-hidden":!0,...r,ref:t}):null});Wf.displayName=Vf;var Qs="SelectScrollUpButton",Hf=v.forwardRef((e,t)=>{const n=ln(Qs,e.__scopeSelect),r=ra(Qs,e.__scopeSelect),[o,s]=v.useState(!1),i=Le(t,r.onScrollButtonChange);return Qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Kf,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Hf.displayName=Qs;var ei="SelectScrollDownButton",qf=v.forwardRef((e,t)=>{const n=ln(ei,e.__scopeSelect),r=ra(ei,e.__scopeSelect),[o,s]=v.useState(!1),i=Le(t,r.onScrollButtonChange);return Qe(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?l.jsx(Kf,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});qf.displayName=ei;var Kf=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=ln("SelectScrollButton",n),i=v.useRef(null),a=Wo(n),c=v.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Qe(()=>{a().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[a]),l.jsx(Ce.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:we(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:we(o.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:we(o.onPointerLeave,()=>{c()})})}),Lk="SelectSeparator",Fk=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(Ce.div,{"aria-hidden":!0,...r,ref:t})});Fk.displayName=Lk;var ti="SelectArrow",Bk=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ho(n),s=an(ti,n),i=ln(ti,n);return s.open&&i.position==="popper"?l.jsx(af,{...o,...r,ref:t}):null});Bk.displayName=ti;var $k="SelectBubbleInput",Gf=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=v.useRef(null),s=Le(r,o),i=E2(t);return v.useEffect(()=>{const a=o.current;if(!a)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&d){const h=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(h)}},[i,t]),l.jsx(Ce.select,{...n,style:{...td,...n.style},ref:s,defaultValue:t})});Gf.displayName=$k;function Jf(e){return e===""||e===void 0}function Yf(e){const t=st(e),n=v.useRef(""),r=v.useRef(0),o=v.useCallback(i=>{const a=n.current+i;t(a),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(a)},[t]),s=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Xf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Uk(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Uk(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Zk=Ef,Vk=Tf,Wk=If,Hk=zf,qk=Rf,Kk=Pf,Gk=Lf,Jk=Uf,Yk=Zf,Xk=Wf,Qk=Hf,e_=qf,t_="Separator",El="horizontal",n_=["horizontal","vertical"],Qf=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=El,...o}=e,s=r_(r)?r:El,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return l.jsx(Ce.div,{"data-orientation":s,...a,...o,ref:t})});Qf.displayName=t_;function r_(e){return n_.includes(e)}var o_=Qf,qo="Tabs",[s_]=Gt(qo,[cf]),eh=cf(),[i_,oa]=s_(qo),th=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:c="automatic",...u}=e,d=zo(a),[h,p]=hn({prop:r,onChange:o,defaultProp:s??"",caller:qo});return l.jsx(i_,{scope:n,baseId:Dt(),value:h,onValueChange:p,orientation:i,dir:d,activationMode:c,children:l.jsx(Ce.div,{dir:d,"data-orientation":i,...u,ref:t})})});th.displayName=qo;var nh="TabsList",rh=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=oa(nh,n),i=eh(n);return l.jsx(ok,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(Ce.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});rh.displayName=nh;var oh="TabsTrigger",sh=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=oa(oh,n),a=eh(n),c=lh(i.baseId,r),u=ch(i.baseId,r),d=r===i.value;return l.jsx(sk,{asChild:!0,...a,focusable:!o,active:d,children:l.jsx(Ce.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:c,...s,ref:t,onMouseDown:we(e.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?i.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=i.activationMode!=="manual";!d&&!o&&h&&i.onValueChange(r)})})})});sh.displayName=oh;var ih="TabsContent",ah=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=oa(ih,n),c=lh(a.baseId,r),u=ch(a.baseId,r),d=r===a.value,h=v.useRef(d);return v.useEffect(()=>{const p=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(p)},[]),l.jsx(kt,{present:o||d,children:({present:p})=>l.jsx(Ce.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:p&&s})})});ah.displayName=ih;function lh(e,t){return`${e}-trigger-${t}`}function ch(e,t){return`${e}-content-${t}`}var a_=th,l_=rh,c_=sh,u_=ah,[Ko]=Gt("Tooltip",[$o]),Go=$o(),uh="TooltipProvider",d_=700,ni="tooltip.open",[f_,sa]=Ko(uh),dh=e=>{const{__scopeTooltip:t,delayDuration:n=d_,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=v.useRef(!0),a=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(f_,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:v.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};dh.displayName=uh;var kr="Tooltip",[h_,Nr]=Ko(kr),fh=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=sa(kr,e.__scopeTooltip),u=Go(t),[d,h]=v.useState(null),p=Dt(),f=v.useRef(0),x=i??c.disableHoverableContent,m=a??c.delayDuration,y=v.useRef(!1),[g,b]=hn({prop:r,defaultProp:o??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(ni))):c.onClose(),s?.(E)},caller:kr}),k=v.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),S=v.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y.current=!1,b(!0)},[b]),j=v.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),C=v.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{y.current=!0,b(!0),f.current=0},m)},[m,b]);return v.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),l.jsx(rf,{...u,children:l.jsx(h_,{scope:t,contentId:p,open:g,stateAttribute:k,trigger:d,onTriggerChange:h,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?C():S()},[c.isOpenDelayedRef,C,S]),onTriggerLeave:v.useCallback(()=>{x?j():(window.clearTimeout(f.current),f.current=0)},[j,x]),onOpen:S,onClose:j,disableHoverableContent:x,children:n})})};fh.displayName=kr;var ri="TooltipTrigger",hh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Nr(ri,n),s=sa(ri,n),i=Go(n),a=v.useRef(null),c=Le(t,a,o.onTriggerChange),u=v.useRef(!1),d=v.useRef(!1),h=v.useCallback(()=>u.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(of,{asChild:!0,...i,children:l.jsx(Ce.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:we(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:we(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:we(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:we(e.onBlur,o.onClose),onClick:we(e.onClick,o.onClose)})})});hh.displayName=ri;var ia="TooltipPortal",[p_,m_]=Ko(ia,{forceMount:void 0}),ph=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=Nr(ia,t);return l.jsx(p_,{scope:t,forceMount:n,children:l.jsx(kt,{present:n||s.open,children:l.jsx(Po,{asChild:!0,container:o,children:r})})})};ph.displayName=ia;var Hn="TooltipContent",mh=v.forwardRef((e,t)=>{const n=m_(Hn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Nr(Hn,e.__scopeTooltip);return l.jsx(kt,{present:r||i.open,children:i.disableHoverableContent?l.jsx(gh,{side:o,...s,ref:t}):l.jsx(g_,{side:o,...s,ref:t})})}),g_=v.forwardRef((e,t)=>{const n=Nr(Hn,e.__scopeTooltip),r=sa(Hn,e.__scopeTooltip),o=v.useRef(null),s=Le(t,o),[i,a]=v.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:h}=r,p=v.useCallback(()=>{a(null),h(!1)},[h]),f=v.useCallback((x,m)=>{const y=x.currentTarget,g={x:x.clientX,y:x.clientY},b=b_(g,y.getBoundingClientRect()),k=w_(g,b),S=k_(m.getBoundingClientRect()),j=S_([...k,...S]);a(j),h(!0)},[h]);return v.useEffect(()=>()=>p(),[p]),v.useEffect(()=>{if(c&&d){const x=y=>f(y,d),m=y=>f(y,c);return c.addEventListener("pointerleave",x),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",m)}}},[c,d,f,p]),v.useEffect(()=>{if(i){const x=m=>{const y=m.target,g={x:m.clientX,y:m.clientY},b=c?.contains(y)||d?.contains(y),k=!__(g,i);b?p():k&&(p(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,d,i,u,p]),l.jsx(gh,{...e,ref:s})}),[x_,y_]=Ko(kr,{isInside:!1}),v_=Bv("TooltipContent"),gh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,c=Nr(Hn,n),u=Go(n),{onClose:d}=c;return v.useEffect(()=>(document.addEventListener(ni,d),()=>document.removeEventListener(ni,d)),[d]),v.useEffect(()=>{if(c.trigger){const h=p=>{p.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),l.jsx(Ro,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:l.jsxs(sf,{"data-state":c.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(v_,{children:r}),l.jsx(x_,{scope:n,isInside:!0,children:l.jsx(qv,{id:c.contentId,role:"tooltip",children:o||r})})]})})});mh.displayName=Hn;var xh="TooltipArrow",yh=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Go(n);return y_(xh,n).isInside?null:l.jsx(af,{...o,...r,ref:t})});yh.displayName=xh;function b_(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function w_(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 k_(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 __(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,h=c.x,p=c.y;d>r!=p>r&&n<(h-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function S_(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),C_(t)}function C_(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 s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.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 s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.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 j_=dh,E_=fh,N_=hh,T_=ph,A_=mh,I_=yh;function vh(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=vh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bh(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=vh(e))&&(r&&(r+=" "),r+=t);return r}const z_=(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},R_=(e,t)=>({classGroupId:e,validator:t}),wh=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yo="-",Nl=[],P_="arbitrary..",O_=e=>{const t=M_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return D_(i);const a=i.split(yo),c=a[0]===""&&a.length>1?1:0;return kh(a,c,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const c=r[i],u=n[i];return c?u?z_(u,c):c:u||Nl}return n[i]||Nl}}},kh=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],s=n.nextPart.get(o);if(s){const u=kh(e,t+1,s);if(u)return u}const i=n.validators;if(i===null)return;const a=t===0?e.join(yo):e.slice(t).join(yo),c=i.length;for(let u=0;u<c;u++){const d=i[u];if(d.validator(a))return d.classGroupId}},D_=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?P_+r:void 0})(),M_=e=>{const{theme:t,classGroups:n}=e;return L_(n,t)},L_=(e,t)=>{const n=wh();for(const r in e){const o=e[r];aa(o,n,r,t)}return n},aa=(e,t,n,r)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];F_(i,t,n,r)}},F_=(e,t,n,r)=>{if(typeof e=="string"){B_(e,t,n);return}if(typeof e=="function"){$_(e,t,n,r);return}U_(e,t,n,r)},B_=(e,t,n)=>{const r=e===""?t:_h(t,e);r.classGroupId=n},$_=(e,t,n,r)=>{if(Z_(e)){aa(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(R_(n,e))},U_=(e,t,n,r)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,c]=o[i];aa(c,_h(t,a),n,r)}},_h=(e,t)=>{let n=e;const r=t.split(yo),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=wh(),n.nextPart.set(i,a)),n=a}return n},Z_=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,V_=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},oi="!",Tl=":",W_=[],Al=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),H_=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const s=[];let i=0,a=0,c=0,u;const d=o.length;for(let m=0;m<d;m++){const y=o[m];if(i===0&&a===0){if(y===Tl){s.push(o.slice(c,m)),c=m+1;continue}if(y==="/"){u=m;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const h=s.length===0?o:o.slice(c);let p=h,f=!1;h.endsWith(oi)?(p=h.slice(0,-1),f=!0):h.startsWith(oi)&&(p=h.slice(1),f=!0);const x=u&&u>c?u-c:void 0;return Al(s,f,p,x)};if(t){const o=t+Tl,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):Al(W_,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},q_=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",c=t.has(i);a||c?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},K_=e=>({cache:V_(e.cacheSize),parseClassName:H_(e),sortModifiers:q_(e),...O_(e)}),G_=/\s+/,J_=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(G_);let c="";for(let u=a.length-1;u>=0;u-=1){const d=a[u],{isExternal:h,modifiers:p,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:m}=n(d);if(h){c=d+(c.length>0?" "+c:c);continue}let y=!!m,g=r(y?x.substring(0,m):x);if(!g){if(!y){c=d+(c.length>0?" "+c:c);continue}if(g=r(x),!g){c=d+(c.length>0?" "+c:c);continue}y=!1}const b=p.length===0?"":p.length===1?p[0]:s(p).join(":"),k=f?b+oi:b,S=k+g;if(i.indexOf(S)>-1)continue;i.push(S);const j=o(g,y);for(let C=0;C<j.length;++C){const E=j[C];i.push(k+E)}c=d+(c.length>0?" "+c:c)}return c},Y_=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=Sh(n))&&(o&&(o+=" "),o+=r);return o},Sh=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Sh(e[r]))&&(n&&(n+=" "),n+=t);return n},X_=(e,...t)=>{let n,r,o,s;const i=c=>{const u=t.reduce((d,h)=>h(d),e());return n=K_(u),r=n.cache.get,o=n.cache.set,s=a,a(c)},a=c=>{const u=r(c);if(u)return u;const d=J_(c,n);return o(c,d),d};return s=i,(...c)=>s(Y_(...c))},Q_=[],Je=e=>{const t=n=>n[e]||Q_;return t.isThemeGetter=!0,t},Ch=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,eS=/^\d+\/\d+$/,tS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nS=/\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$/,rS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,En=e=>eS.test(e),Ne=e=>!!e&&!Number.isNaN(Number(e)),Jt=e=>!!e&&Number.isInteger(Number(e)),vs=e=>e.endsWith("%")&&Ne(e.slice(0,-1)),Vt=e=>tS.test(e),iS=()=>!0,aS=e=>nS.test(e)&&!rS.test(e),Eh=()=>!1,lS=e=>oS.test(e),cS=e=>sS.test(e),uS=e=>!pe(e)&&!me(e),dS=e=>Qn(e,Ah,Eh),pe=e=>Ch.test(e),dn=e=>Qn(e,Ih,aS),bs=e=>Qn(e,gS,Ne),Il=e=>Qn(e,Nh,Eh),fS=e=>Qn(e,Th,cS),Ur=e=>Qn(e,zh,lS),me=e=>jh.test(e),sr=e=>er(e,Ih),hS=e=>er(e,xS),zl=e=>er(e,Nh),pS=e=>er(e,Ah),mS=e=>er(e,Th),Zr=e=>er(e,zh,!0),Qn=(e,t,n)=>{const r=Ch.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},er=(e,t,n=!1)=>{const r=jh.exec(e);return r?r[1]?t(r[1]):n:!1},Nh=e=>e==="position"||e==="percentage",Th=e=>e==="image"||e==="url",Ah=e=>e==="length"||e==="size"||e==="bg-size",Ih=e=>e==="length",gS=e=>e==="number",xS=e=>e==="family-name",zh=e=>e==="shadow",yS=()=>{const e=Je("color"),t=Je("font"),n=Je("text"),r=Je("font-weight"),o=Je("tracking"),s=Je("leading"),i=Je("breakpoint"),a=Je("container"),c=Je("spacing"),u=Je("radius"),d=Je("shadow"),h=Je("inset-shadow"),p=Je("text-shadow"),f=Je("drop-shadow"),x=Je("blur"),m=Je("perspective"),y=Je("aspect"),g=Je("ease"),b=Je("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...S(),me,pe],C=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],T=()=>[me,pe,c],R=()=>[En,"full","auto",...T()],M=()=>[Jt,"none","subgrid",me,pe],B=()=>["auto",{span:["full",Jt,me,pe]},Jt,me,pe],N=()=>[Jt,"auto",me,pe],O=()=>["auto","min","max","fr",me,pe],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],X=()=>["auto",...T()],W=()=>[En,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],H=()=>[e,me,pe],Y=()=>[...S(),zl,Il,{position:[me,pe]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",pS,dS,{size:[me,pe]}],Z=()=>[vs,sr,dn],I=()=>["","none","full",u,me,pe],oe=()=>["",Ne,sr,dn],J=()=>["solid","dashed","dotted","double"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[Ne,vs,zl,Il],ce=()=>["","none",x,me,pe],fe=()=>["none",Ne,me,pe],ge=()=>["none",Ne,me,pe],xe=()=>[Ne,me,pe],Ee=()=>[En,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vt],breakpoint:[Vt],color:[iS],container:[Vt],"drop-shadow":[Vt],ease:["in","out","in-out"],font:[uS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vt],shadow:[Vt],spacing:["px",Ne],text:[Vt],"text-shadow":[Vt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",En,pe,me,y]}],container:["container"],columns:[{columns:[Ne,pe,me,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],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:[Jt,"auto",me,pe]}],basis:[{basis:[En,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,En,"auto","initial","none",pe]}],grow:[{grow:["",Ne,me,pe]}],shrink:[{shrink:["",Ne,me,pe]}],order:[{order:[Jt,"first","last","none",me,pe]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:X()}],mx:[{mx:X()}],my:[{my:X()}],ms:[{ms:X()}],me:[{me:X()}],mt:[{mt:X()}],mr:[{mr:X()}],mb:[{mb:X()}],ml:[{ml:X()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",n,sr,dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,me,bs]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vs,pe]}],"font-family":[{font:[hS,pe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,me,pe]}],"line-clamp":[{"line-clamp":[Ne,"none",me,bs]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",me,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",me,dn]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Ne,"auto",me,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me,pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Jt,me,pe],radial:["",me,pe],conic:[Jt,me,pe]},mS,fS]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,me,pe]}],"outline-w":[{outline:["",Ne,sr,dn]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",d,Zr,Ur]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,Zr,Ur]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Ne,dn]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",p,Zr,Ur]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Ne,me,pe]}],"mix-blend":[{"mix-blend":[...de(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[me,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,pe]}],filter:[{filter:["","none",me,pe]}],blur:[{blur:ce()}],brightness:[{brightness:[Ne,me,pe]}],contrast:[{contrast:[Ne,me,pe]}],"drop-shadow":[{"drop-shadow":["","none",f,Zr,Ur]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Ne,me,pe]}],"hue-rotate":[{"hue-rotate":[Ne,me,pe]}],invert:[{invert:["",Ne,me,pe]}],saturate:[{saturate:[Ne,me,pe]}],sepia:[{sepia:["",Ne,me,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,pe]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,me,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,me,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,me,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,me,pe]}],"backdrop-invert":[{"backdrop-invert":["",Ne,me,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,me,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,me,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,me,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",me,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",me,pe]}],ease:[{ease:["linear","initial",g,me,pe]}],delay:[{delay:[Ne,me,pe]}],animate:[{animate:["none",b,me,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,me,pe]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:ge()}],"scale-x":[{"scale-x":ge()}],"scale-y":[{"scale-y":ge()}],"scale-z":[{"scale-z":ge()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[me,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me,pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me,pe]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Ne,sr,dn,bs]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vS=X_(yS);function he(...e){return vS(bh(e))}function Ye(e){return e>=1048576?(e/1048576).toFixed(1).replace(/\.0$/,"")+"M":e>=1024?(e/1024).toFixed(1).replace(/\.0$/,"")+"K":e.toString()}function Rh(e){return e===null?"pending":e>=200&&e<300?"success":e>=400&&e<500?"client_error":e>=500?"server_error":"pending"}function Te({delayDuration:e=0,...t}){return l.jsx(j_,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Ie({...e}){return l.jsx(E_,{"data-slot":"tooltip",...e})}function ze({...e}){return l.jsx(N_,{"data-slot":"tooltip-trigger",...e})}function Re({className:e,sideOffset:t=0,children:n,...r}){return l.jsx(T_,{children:l.jsxs(A_,{"data-slot":"tooltip-content",sideOffset:t,className:he("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,l.jsx(I_,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Vr(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 ws={exports:{}};var Rl;function bS(){return Rl||(Rl=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(r,o,s){function i(u,d){if(!o[u]){if(!r[u]){var h=typeof Vr=="function"&&Vr;if(!d&&h)return h(u,!0);if(a)return a(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var f=o[u]={exports:{}};r[u][0].call(f.exports,function(x){var m=r[u][1][x];return i(m||x)},f,f.exports,n,r,o,s)}return o[u].exports}for(var a=typeof Vr=="function"&&Vr,c=0;c<s.length;c++)i(s[c]);return i})({1:[function(n,r,o){var s=n("./utils"),i=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(c){for(var u,d,h,p,f,x,m,y=[],g=0,b=c.length,k=b,S=s.getTypeOf(c)!=="string";g<c.length;)k=b-g,h=S?(u=c[g++],d=g<b?c[g++]:0,g<b?c[g++]:0):(u=c.charCodeAt(g++),d=g<b?c.charCodeAt(g++):0,g<b?c.charCodeAt(g++):0),p=u>>2,f=(3&u)<<4|d>>4,x=1<k?(15&d)<<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(c){var u,d,h,p,f,x,m=0,y=0,g="data:";if(c.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");var b,k=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&k--,c.charAt(c.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=i.uint8array?new Uint8Array(0|k):new Array(0|k);m<c.length;)u=a.indexOf(c.charAt(m++))<<2|(p=a.indexOf(c.charAt(m++)))>>4,d=(15&p)<<4|(f=a.indexOf(c.charAt(m++)))>>2,h=(3&f)<<6|(x=a.indexOf(c.charAt(m++))),b[y++]=u,f!==64&&(b[y++]=d),x!==64&&(b[y++]=h);return b}},{"./support":30,"./utils":32}],2:[function(n,r,o){var s=n("./external"),i=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function u(d,h,p,f,x){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=f,this.compressedContent=x}u.prototype={getContentWorker:function(){var d=new i(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),h=this;return d.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new i(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(d,h,p){return d.pipe(new a).pipe(new c("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression",h)},r.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,o){var s=n("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},o.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,o){var s=n("./utils"),i=(function(){for(var a,c=[],u=0;u<256;u++){a=u;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;c[u]=a}return c})();r.exports=function(a,c){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?(function(u,d,h,p){var f=i,x=p+h;u^=-1;for(var m=p;m<x;m++)u=u>>>8^f[255&(u^d[m])];return-1^u})(0|c,a,a.length,0):(function(u,d,h,p){var f=i,x=p+h;u^=-1;for(var m=p;m<x;m++)u=u>>>8^f[255&(u^d.charCodeAt(m))];return-1^u})(0|c,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 s=null;s=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:s}},{lie:37}],7:[function(n,r,o){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",i=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),u=s?"uint8array":"array";function d(h,p){c.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}o.magic="\b\0",a.inherits(d,c),d.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,h.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},o.compressWorker=function(h){return new d("Deflate",h)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,o){function s(f,x){var m,y="";for(m=0;m<x;m++)y+=String.fromCharCode(255&f),f>>>=8;return y}function i(f,x,m,y,g,b){var k,S,j=f.file,C=f.compression,E=b!==u.utf8encode,T=a.transformTo("string",b(j.name)),R=a.transformTo("string",u.utf8encode(j.name)),M=j.comment,B=a.transformTo("string",b(M)),N=a.transformTo("string",u.utf8encode(M)),O=R.length!==j.name.length,w=N.length!==M.length,D="",X="",W="",H=j.dir,Y=j.date,A={crc32:0,compressedSize:0,uncompressedSize:0};x&&!m||(A.crc32=f.crc32,A.compressedSize=f.compressedSize,A.uncompressedSize=f.uncompressedSize);var V=0;x&&(V|=8),E||!O&&!w||(V|=2048);var Z=0,I=0;H&&(Z|=16),g==="UNIX"?(I=798,Z|=(function(J,de){var te=J;return J||(te=de?16893:33204),(65535&te)<<16})(j.unixPermissions,H)):(I=20,Z|=(function(J){return 63&(J||0)})(j.dosPermissions)),k=Y.getUTCHours(),k<<=6,k|=Y.getUTCMinutes(),k<<=5,k|=Y.getUTCSeconds()/2,S=Y.getUTCFullYear()-1980,S<<=4,S|=Y.getUTCMonth()+1,S<<=5,S|=Y.getUTCDate(),O&&(X=s(1,1)+s(d(T),4)+R,D+="up"+s(X.length,2)+X),w&&(W=s(1,1)+s(d(B),4)+N,D+="uc"+s(W.length,2)+W);var oe="";return oe+=`
|
|
84
|
+
\0`,oe+=s(V,2),oe+=C.magic,oe+=s(k,2),oe+=s(S,2),oe+=s(A.crc32,4),oe+=s(A.compressedSize,4),oe+=s(A.uncompressedSize,4),oe+=s(T.length,2),oe+=s(D.length,2),{fileRecord:h.LOCAL_FILE_HEADER+oe+T+D,dirRecord:h.CENTRAL_FILE_HEADER+s(I,2)+oe+s(B.length,2)+"\0\0\0\0"+s(Z,4)+s(y,4)+T+D+B}}var a=n("../utils"),c=n("../stream/GenericWorker"),u=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(f,x,m,y){c.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,c),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,c.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=i(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=i(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+s(y.crc32,4)+s(y.compressedSize,4)+s(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,b,k,S,j){var C=a.transformTo("string",j(S));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(g,2)+s(g,2)+s(b,4)+s(k,4)+s(C.length,2)+C})(this.dirRecords.length,m,f,this.zipComment,this.encodeFileName);this.push({data:y,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(f){this._sources.push(f);var x=this;return f.on("data",function(m){x.processChunk(m)}),f.on("end",function(){x.closedSource(x.previous.streamInfo),x._sources.length?x.prepareNextSource():x.end()}),f.on("error",function(m){x.error(m)}),this},p.prototype.resume=function(){return!!c.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(!c.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(){c.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 s=n("../compressions"),i=n("./ZipFileWorker");o.generateWorker=function(a,c,u){var d=new i(c.streamFiles,u,c.platform,c.encodeFileName),h=0;try{a.forEach(function(p,f){h++;var x=(function(b,k){var S=b||k,j=s[S];if(!j)throw new Error(S+" is not a valid compression method !");return j})(f.options.compression,c.compression),m=f.options.compressionOptions||c.compressionOptions||{},y=f.dir,g=f.date;f._compressWorker(x,m).withStreamInfo("file",{name:p,dir:y,date:g,comment:f.comment||"",unixPermissions:f.unixPermissions,dosPermissions:f.dosPermissions}).pipe(d)}),d.entriesCount=h}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,o){function s(){if(!(this instanceof s))return new s;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 i=new s;for(var a in this)typeof this[a]!="function"&&(i[a]=this[a]);return i}}(s.prototype=n("./object")).loadAsync=n("./load"),s.support=n("./support"),s.defaults=n("./defaults"),s.version="3.10.1",s.loadAsync=function(i,a){return new s().loadAsync(i,a)},s.external=n("./external"),r.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,o){var s=n("./utils"),i=n("./external"),a=n("./utf8"),c=n("./zipEntries"),u=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function h(p){return new i.Promise(function(f,x){var m=p.decompressed.getContentWorker().pipe(new u);m.on("error",function(y){x(y)}).on("end",function(){m.streamInfo.crc32!==p.decompressed.crc32?x(new Error("Corrupted zip : CRC32 mismatch")):f()}).resume()})}r.exports=function(p,f){var x=this;return f=s.extend(f||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(p)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",p,!0,f.optimizedBinaryString,f.base64).then(function(m){var y=new c(f);return y.load(m),y}).then(function(m){var y=[i.Promise.resolve(m)],g=m.files;if(f.checkCRC32)for(var b=0;b<g.length;b++)y.push(h(g[b]));return i.Promise.all(y)}).then(function(m){for(var y=m.shift(),g=y.files,b=0;b<g.length;b++){var k=g[b],S=k.fileNameStr,j=s.resolve(k.fileNameStr);x.file(j,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:f.createFolders}),k.dir||(x.file(j).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 s=n("../utils"),i=n("../stream/GenericWorker");function a(c,u){i.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(u)}s.inherits(a,i),a.prototype._bindStream=function(c){var u=this;(this._stream=c).pause(),c.on("data",function(d){u.push({data:d,meta:{percent:0}})}).on("error",function(d){u.isPaused?this.generatedError=d:u.error(d)}).on("end",function(){u.isPaused?u._upstreamEnded=!0:u.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.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 s=n("readable-stream").Readable;function i(a,c,u){s.call(this,c),this._helper=a;var d=this;a.on("data",function(h,p){d.push(h)||d._helper.pause(),u&&u(p)}).on("error",function(h){d.emit("error",h)}).on("end",function(){d.push(null)})}n("../utils").inherits(i,s),i.prototype._read=function(){this._helper.resume()},r.exports=i},{"../utils":32,"readable-stream":16}],14:[function(n,r,o){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,i){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,i);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,i)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var i=new Buffer(s);return i.fill(0),i},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(n,r,o){function s(j,C,E){var T,R=a.getTypeOf(C),M=a.extend(E||{},d);M.date=M.date||new Date,M.compression!==null&&(M.compression=M.compression.toUpperCase()),typeof M.unixPermissions=="string"&&(M.unixPermissions=parseInt(M.unixPermissions,8)),M.unixPermissions&&16384&M.unixPermissions&&(M.dir=!0),M.dosPermissions&&16&M.dosPermissions&&(M.dir=!0),M.dir&&(j=g(j)),M.createFolders&&(T=y(j))&&b.call(this,T,!0);var B=R==="string"&&M.binary===!1&&M.base64===!1;E&&E.binary!==void 0||(M.binary=!B),(C instanceof h&&C.uncompressedSize===0||M.dir||!C||C.length===0)&&(M.base64=!1,M.binary=!0,C="",M.compression="STORE",R="string");var N=null;N=C instanceof h||C instanceof c?C:x.isNode&&x.isStream(C)?new m(j,C):a.prepareContent(j,C,M.binary,M.optimizedBinaryString,M.base64);var O=new p(j,N,M);this.files[j]=O}var i=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),u=n("./stream/StreamHelper"),d=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),f=n("./generate"),x=n("./nodejsUtils"),m=n("./nodejs/NodejsStreamInputAdapter"),y=function(j){j.slice(-1)==="/"&&(j=j.substring(0,j.length-1));var C=j.lastIndexOf("/");return 0<C?j.substring(0,C):""},g=function(j){return j.slice(-1)!=="/"&&(j+="/"),j},b=function(j,C){return C=C!==void 0?C:d.createFolders,j=g(j),this.files[j]||s.call(this,j,null,{dir:!0,createFolders:C}),this.files[j]};function k(j){return Object.prototype.toString.call(j)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(j){var C,E,T;for(C in this.files)T=this.files[C],(E=C.slice(this.root.length,C.length))&&C.slice(0,this.root.length)===this.root&&j(E,T)},filter:function(j){var C=[];return this.forEach(function(E,T){j(E,T)&&C.push(T)}),C},file:function(j,C,E){if(arguments.length!==1)return j=this.root+j,s.call(this,j,C,E),this;if(k(j)){var T=j;return this.filter(function(M,B){return!B.dir&&T.test(M)})}var R=this.files[this.root+j];return R&&!R.dir?R:null},folder:function(j){if(!j)return this;if(k(j))return this.filter(function(R,M){return M.dir&&j.test(R)});var C=this.root+j,E=b.call(this,C),T=this.clone();return T.root=E.name,T},remove:function(j){j=this.root+j;var C=this.files[j];if(C||(j.slice(-1)!=="/"&&(j+="/"),C=this.files[j]),C&&!C.dir)delete this.files[j];else for(var E=this.filter(function(R,M){return M.name.slice(0,j.length)===j}),T=0;T<E.length;T++)delete this.files[E[T].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(j){var C,E={};try{if((E=a.extend(j||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=E.type.toLowerCase(),E.compression=E.compression.toUpperCase(),E.type==="binarystring"&&(E.type="string"),!E.type)throw new Error("No output type specified.");a.checkSupport(E.type),E.platform!=="darwin"&&E.platform!=="freebsd"&&E.platform!=="linux"&&E.platform!=="sunos"||(E.platform="UNIX"),E.platform==="win32"&&(E.platform="DOS");var T=E.comment||this.comment||"";C=f.generateWorker(this,E,T)}catch(R){(C=new c("error")).error(R)}return new u(C,E.type||"string",E.mimeType)},generateAsync:function(j,C){return this.generateInternalStream(j).accumulate(C)},generateNodeStream:function(j,C){return(j=j||{}).type||(j.type="nodebuffer"),this.generateInternalStream(j).toNodejsStream(C)}};r.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,o){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data[this.zero+a]},i.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===u&&this.data[p+2]===d&&this.data[p+3]===h)return p-this.zero;return-1},i.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),u=a.charCodeAt(1),d=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return c===p[0]&&u===p[1]&&d===p[2]&&h===p[3]},i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],18:[function(n,r,o){var s=n("../utils");function i(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}i.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 c,u=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)u=(u<<8)+this.byteAt(c);return this.index+=a,u},readString:function(a){return s.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=i},{"../utils":32}],19:[function(n,r,o){var s=n("./Uint8ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,o){var s=n("./DataReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},i.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},i.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},i.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./DataReader":18}],21:[function(n,r,o){var s=n("./ArrayReader");function i(a){s.call(this,a)}n("../utils").inherits(i,s),i.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,o){var s=n("../utils"),i=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),u=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(h){var p=s.getTypeOf(h);return s.checkSupport(p),p!=="string"||i.uint8array?p==="nodebuffer"?new u(h):i.uint8array?new d(s.transformTo("uint8array",h)):new a(s.transformTo("array",h)):new c(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 s=n("./GenericWorker"),i=n("../utils");function a(c){s.call(this,"ConvertWorker to "+c),this.destType=c}i.inherits(a,s),a.prototype.processChunk=function(c){this.push({data:i.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,o){var s=n("./GenericWorker"),i=n("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,s),a.prototype.processChunk=function(c){this.streamInfo.crc32=i(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}s.inherits(a,i),a.prototype.processChunk=function(c){if(c){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+c.data.length}i.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,o){var s=n("../utils"),i=n("./GenericWorker");function a(c){i.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){u.dataIsReady=!0,u.data=d,u.max=d&&d.length||0,u.type=s.getTypeOf(d),u.isPaused||u._tickAndRepeat()},function(d){u.error(d)})}s.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,u);break;case"uint8array":c=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":c=this.data.slice(this.index,u)}return this.index=u,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,o){function s(i){this.name=i||"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}s.prototype={push:function(i){this.emit("data",i)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(i){this.emit("error",i)}return!0},error:function(i){return!this.isFinished&&(this.isPaused?this.generatedError=i:(this.isFinished=!0,this.emit("error",i),this.previous&&this.previous.error(i),this.cleanUp()),!0)},on:function(i,a){return this._listeners[i].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(i,a){if(this._listeners[i])for(var c=0;c<this._listeners[i].length;c++)this._listeners[i][c].call(this,a)},pipe:function(i){return i.registerPrevious(this)},registerPrevious:function(i){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=i.streamInfo,this.mergeStreamInfo(),this.previous=i;var a=this;return i.on("data",function(c){a.processChunk(c)}),i.on("end",function(){a.end()}),i.on("error",function(c){a.error(c)}),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 i=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),i=!0),this.previous&&this.previous.resume(),!i},flush:function(){},processChunk:function(i){this.push(i)},withStreamInfo:function(i,a){return this.extraStreamInfo[i]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var i in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,i)&&(this.streamInfo[i]=this.extraStreamInfo[i])},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 i="Worker "+this.name;return this.previous?this.previous+" -> "+i:i}},r.exports=s},{}],29:[function(n,r,o){var s=n("../utils"),i=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),u=n("../support"),d=n("../external"),h=null;if(u.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(x,m){return new d.Promise(function(y,g){var b=[],k=x._internalType,S=x._outputType,j=x._mimeType;x.on("data",function(C,E){b.push(C),m&&m(E)}).on("error",function(C){b=[],g(C)}).on("end",function(){try{var C=(function(E,T,R){switch(E){case"blob":return s.newBlob(s.transformTo("arraybuffer",T),R);case"base64":return c.encode(T);default:return s.transformTo(E,T)}})(S,(function(E,T){var R,M=0,B=null,N=0;for(R=0;R<T.length;R++)N+=T[R].length;switch(E){case"string":return T.join("");case"array":return Array.prototype.concat.apply([],T);case"uint8array":for(B=new Uint8Array(N),R=0;R<T.length;R++)B.set(T[R],M),M+=T[R].length;return B;case"nodebuffer":return Buffer.concat(T);default:throw new Error("concat : unsupported type '"+E+"'")}})(k,b),j);y(C)}catch(E){g(E)}b=[]}).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,s.checkSupport(g),this._worker=x.pipe(new i(g)),x.lock()}catch(b){this._worker=new a("error"),this._worker.error(b)}}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(){s.delay(m,arguments,y)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(x){if(s.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 s=new ArrayBuffer(0);try{o.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(s),o.blob=i.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 s=n("./utils"),i=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),u=new Array(256),d=0;d<256;d++)u[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;u[254]=u[254]=1;function h(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}o.utf8encode=function(f){return i.nodebuffer?a.newBufferFrom(f,"utf-8"):(function(x){var m,y,g,b,k,S=x.length,j=0;for(b=0;b<S;b++)(64512&(y=x.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=x.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),b++),j+=y<128?1:y<2048?2:y<65536?3:4;for(m=i.uint8array?new Uint8Array(j):new Array(j),b=k=0;k<j;b++)(64512&(y=x.charCodeAt(b)))==55296&&b+1<S&&(64512&(g=x.charCodeAt(b+1)))==56320&&(y=65536+(y-55296<<10)+(g-56320),b++),y<128?m[k++]=y:(y<2048?m[k++]=192|y>>>6:(y<65536?m[k++]=224|y>>>12:(m[k++]=240|y>>>18,m[k++]=128|y>>>12&63),m[k++]=128|y>>>6&63),m[k++]=128|63&y);return m})(f)},o.utf8decode=function(f){return i.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):(function(x){var m,y,g,b,k=x.length,S=new Array(2*k);for(m=y=0;m<k;)if((g=x[m++])<128)S[y++]=g;else if(4<(b=u[g]))S[y++]=65533,m+=b-1;else{for(g&=b===2?31:b===3?15:7;1<b&&m<k;)g=g<<6|63&x[m++],b--;1<b?S[y++]=65533:g<65536?S[y++]=g:(g-=65536,S[y++]=55296|g>>10&1023,S[y++]=56320|1023&g)}return S.length!==y&&(S.subarray?S=S.subarray(0,y):S.length=y),s.applyFromCharCode(S)})(f=s.transformTo(i.uint8array?"uint8array":"array",f))},s.inherits(h,c),h.prototype.processChunk=function(f){var x=s.transformTo(i.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var m=x;(x=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),x.set(m,this.leftOver.length)}else x=this.leftOver.concat(x);this.leftOver=null}var y=(function(b,k){var S;for((k=k||b.length)>b.length&&(k=b.length),S=k-1;0<=S&&(192&b[S])==128;)S--;return S<0||S===0?k:S+u[b[S]]>k?S:k})(x),g=x;y!==x.length&&(i.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,s.inherits(p,c),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 s=n("./support"),i=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function u(m){return m}function d(m,y){for(var g=0;g<m.length;++g)y[g]=255&m.charCodeAt(g);return y}n("setimmediate"),o.newBlob=function(m,y){o.checkSupport("blob");try{return new Blob([m],{type:y})}catch{try{var g=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return g.append(m),g.getBlob(y)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(m,y,g){var b=[],k=0,S=m.length;if(S<=g)return String.fromCharCode.apply(null,m);for(;k<S;)y==="array"||y==="nodebuffer"?b.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+g,S)))):b.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+g,S)))),k+=g;return b.join("")},stringifyByChar:function(m){for(var y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);return y},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function p(m){var y=65536,g=o.getTypeOf(m),b=!0;if(g==="uint8array"?b=h.applyCanBeUsed.uint8array:g==="nodebuffer"&&(b=h.applyCanBeUsed.nodebuffer),b)for(;1<y;)try{return h.stringifyByChunk(m,g,y)}catch{y=Math.floor(y/2)}return h.stringifyByChar(m)}function f(m,y){for(var g=0;g<m.length;g++)y[g]=m[g];return y}o.applyFromCharCode=p;var x={};x.string={string:u,array:function(m){return d(m,new Array(m.length))},arraybuffer:function(m){return x.string.uint8array(m).buffer},uint8array:function(m){return d(m,new Uint8Array(m.length))},nodebuffer:function(m){return d(m,a.allocBuffer(m.length))}},x.array={string:p,array:u,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(m)}},x.arraybuffer={string:function(m){return p(new Uint8Array(m))},array:function(m){return f(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:u,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return a.newBufferFrom(new Uint8Array(m))}},x.uint8array={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:u,nodebuffer:function(m){return a.newBufferFrom(m)}},x.nodebuffer={string:p,array:function(m){return f(m,new Array(m.length))},arraybuffer:function(m){return x.nodebuffer.uint8array(m).buffer},uint8array:function(m){return f(m,new Uint8Array(m.length))},nodebuffer:u},o.transformTo=function(m,y){if(y=y||"",!m)return y;o.checkSupport(m);var g=o.getTypeOf(y);return x[g][m](y)},o.resolve=function(m){for(var y=m.split("/"),g=[],b=0;b<y.length;b++){var k=y[b];k==="."||k===""&&b!==0&&b!==y.length-1||(k===".."?g.pop():g.push(k))}return g.join("/")},o.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":s.nodebuffer&&a.isBuffer(m)?"nodebuffer":s.uint8array&&m instanceof Uint8Array?"uint8array":s.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(m){if(!s[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(m){var y,g,b="";for(g=0;g<(m||"").length;g++)b+="\\x"+((y=m.charCodeAt(g))<16?"0":"")+y.toString(16).toUpperCase();return b},o.delay=function(m,y,g){setImmediate(function(){m.apply(g||null,y||[])})},o.inherits=function(m,y){function g(){}g.prototype=y.prototype,m.prototype=new g},o.extend=function(){var m,y,g={};for(m=0;m<arguments.length;m++)for(y in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],y)&&g[y]===void 0&&(g[y]=arguments[m][y]);return g},o.prepareContent=function(m,y,g,b,k){return c.Promise.resolve(y).then(function(S){return s.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new c.Promise(function(j,C){var E=new FileReader;E.onload=function(T){j(T.target.result)},E.onerror=function(T){C(T.target.error)},E.readAsArrayBuffer(S)}):S}).then(function(S){var j=o.getTypeOf(S);return j?(j==="arraybuffer"?S=o.transformTo("uint8array",S):j==="string"&&(k?S=i.decode(S):g&&b!==!0&&(S=(function(C){return d(C,s.uint8array?new Uint8Array(C.length):new Array(C.length))})(S))),S):c.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 s=n("./reader/readerFor"),i=n("./utils"),a=n("./signature"),c=n("./zipEntry"),u=n("./support");function d(h){this.files=[],this.loadOptions=h}d.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(p)+", expected "+i.pretty(h)+")")}},isSignature:function(h,p){var f=this.reader.index;this.reader.setIndex(h);var x=this.reader.readString(4)===p;return this.reader.setIndex(f),x},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=u.uint8array?"uint8array":"array",f=i.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 c({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===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.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=s(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,o){var s=n("./reader/readerFor"),i=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),u=n("./utf8"),d=n("./compressions"),h=n("./support");function p(f,x){this.options=f,this.loadOptions=x}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(f){var x,m;if(f.skip(22),this.fileNameLength=f.readInt(2),m=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((x=(function(y){for(var g in d)if(Object.prototype.hasOwnProperty.call(d,g)&&d[g].magic===y)return d[g];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.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=s(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var x,m,y,g=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4<g;)x=f.readInt(2),m=f.readInt(2),y=f.readData(m),this.extraFields[x]={id:x,length:m,value:y};f.setIndex(g)},handleUTF8:function(){var f=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=u.utf8decode(this.fileName),this.fileCommentStr=u.utf8decode(this.fileComment);else{var x=this.findExtraFieldUnicodePath();if(x!==null)this.fileNameStr=x;else{var m=i.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var y=this.findExtraFieldUnicodeComment();if(y!==null)this.fileCommentStr=y;else{var g=i.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(g)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var x=s(f.value);return x.readInt(1)!==1||c(this.fileName)!==x.readInt(4)?null:u.utf8decode(x.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var x=s(f.value);return x.readInt(1)!==1||c(this.fileComment)!==x.readInt(4)?null:u.utf8decode(x.readData(f.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,o){function s(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 i=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),u=n("./compressedObject"),d=n("./stream/GenericWorker");s.prototype={internalStream:function(x){var m=null,y="string";try{if(!x)throw new Error("No output type specified.");var g=(y=x.toLowerCase())==="string"||y==="text";y!=="binarystring"&&y!=="text"||(y="string"),m=this._decompressWorker();var b=!this._dataBinary;b&&!g&&(m=m.pipe(new c.Utf8EncodeWorker)),!b&&g&&(m=m.pipe(new c.Utf8DecodeWorker))}catch(k){(m=new d("error")).error(k)}return new i(m,y,"")},async:function(x,m){return this.internalStream(x).accumulate(m)},nodeStream:function(x,m){return this.internalStream(x||"nodebuffer").toNodejsStream(m)},_compressWorker:function(x,m){if(this._data instanceof u&&this._data.compression.magic===x.magic)return this._data.getCompressedWorker();var y=this._decompressWorker();return this._dataBinary||(y=y.pipe(new c.Utf8EncodeWorker)),u.createWorkerFrom(y,x,m)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<h.length;f++)s.prototype[h[f]]=p;r.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,o){(function(s){var i,a,c=s.MutationObserver||s.WebKitMutationObserver;if(c){var u=0,d=new c(x),h=s.document.createTextNode("");d.observe(h,{characterData:!0}),i=function(){h.data=u=++u%2}}else if(s.setImmediate||s.MessageChannel===void 0)i="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var m=s.document.createElement("script");m.onreadystatechange=function(){x(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},s.document.documentElement.appendChild(m)}:function(){setTimeout(x,0)};else{var p=new s.MessageChannel;p.port1.onmessage=x,i=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||i()}}).call(this,typeof zr<"u"?zr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,o){var s=n("immediate");function i(){}var a={},c=["REJECTED"],u=["FULFILLED"],d=["PENDING"];function h(g){if(typeof g!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,g!==i&&m(this,g)}function p(g,b,k){this.promise=g,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function f(g,b,k){s(function(){var S;try{S=b(k)}catch(j){return a.reject(g,j)}S===g?a.reject(g,new TypeError("Cannot resolve promise with itself")):a.resolve(g,S)})}function x(g){var b=g&&g.then;if(g&&(typeof g=="object"||typeof g=="function")&&typeof b=="function")return function(){b.apply(g,arguments)}}function m(g,b){var k=!1;function S(E){k||(k=!0,a.reject(g,E))}function j(E){k||(k=!0,a.resolve(g,E))}var C=y(function(){b(j,S)});C.status==="error"&&S(C.value)}function y(g,b){var k={};try{k.value=g(b),k.status="success"}catch(S){k.status="error",k.value=S}return k}(r.exports=h).prototype.finally=function(g){if(typeof g!="function")return this;var b=this.constructor;return this.then(function(k){return b.resolve(g()).then(function(){return k})},function(k){return b.resolve(g()).then(function(){throw k})})},h.prototype.catch=function(g){return this.then(null,g)},h.prototype.then=function(g,b){if(typeof g!="function"&&this.state===u||typeof b!="function"&&this.state===c)return this;var k=new this.constructor(i);return this.state!==d?f(k,this.state===u?g:b,this.outcome):this.queue.push(new p(k,g,b)),k},p.prototype.callFulfilled=function(g){a.resolve(this.promise,g)},p.prototype.otherCallFulfilled=function(g){f(this.promise,this.onFulfilled,g)},p.prototype.callRejected=function(g){a.reject(this.promise,g)},p.prototype.otherCallRejected=function(g){f(this.promise,this.onRejected,g)},a.resolve=function(g,b){var k=y(x,b);if(k.status==="error")return a.reject(g,k.value);var S=k.value;if(S)m(g,S);else{g.state=u,g.outcome=b;for(var j=-1,C=g.queue.length;++j<C;)g.queue[j].callFulfilled(b)}return g},a.reject=function(g,b){g.state=c,g.outcome=b;for(var k=-1,S=g.queue.length;++k<S;)g.queue[k].callRejected(b);return g},h.resolve=function(g){return g instanceof this?g:a.resolve(new this(i),g)},h.reject=function(g){var b=new this(i);return a.reject(b,g)},h.all=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var j=new Array(k),C=0,E=-1,T=new this(i);++E<k;)R(g[E],E);return T;function R(M,B){b.resolve(M).then(function(N){j[B]=N,++C!==k||S||(S=!0,a.resolve(T,j))},function(N){S||(S=!0,a.reject(T,N))})}},h.race=function(g){var b=this;if(Object.prototype.toString.call(g)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=g.length,S=!1;if(!k)return this.resolve([]);for(var j=-1,C=new this(i);++j<k;)E=g[j],b.resolve(E).then(function(T){S||(S=!0,a.resolve(C,T))},function(T){S||(S=!0,a.reject(C,T))});var E;return C}},{immediate:36}],38:[function(n,r,o){var s={};(0,n("./lib/utils/common").assign)(s,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,o){var s=n("./zlib/deflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),u=n("./zlib/zstream"),d=Object.prototype.toString,h=0,p=-1,f=0,x=8;function m(g){if(!(this instanceof m))return new m(g);this.options=i.assign({level:p,method:x,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},g||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var k=s.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(k!==h)throw new Error(c[k]);if(b.header&&s.deflateSetHeader(this.strm,b.header),b.dictionary){var S;if(S=typeof b.dictionary=="string"?a.string2buf(b.dictionary):d.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(k=s.deflateSetDictionary(this.strm,S))!==h)throw new Error(c[k]);this._dict_set=!0}}function y(g,b){var k=new m(b);if(k.push(g,!0),k.err)throw k.msg||c[k.err];return k.result}m.prototype.push=function(g,b){var k,S,j=this.strm,C=this.options.chunkSize;if(this.ended)return!1;S=b===~~b?b:b===!0?4:0,typeof g=="string"?j.input=a.string2buf(g):d.call(g)==="[object ArrayBuffer]"?j.input=new Uint8Array(g):j.input=g,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new i.Buf8(C),j.next_out=0,j.avail_out=C),(k=s.deflate(j,S))!==1&&k!==h)return this.onEnd(k),!(this.ended=!0);j.avail_out!==0&&(j.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(i.shrinkBuf(j.output,j.next_out))):this.onData(i.shrinkBuf(j.output,j.next_out)))}while((0<j.avail_in||j.avail_out===0)&&k!==1);return S===4?(k=s.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===h):S!==2||(this.onEnd(h),!(j.avail_out=0))},m.prototype.onData=function(g){this.chunks.push(g)},m.prototype.onEnd=function(g){g===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},o.Deflate=m,o.deflate=y,o.deflateRaw=function(g,b){return(b=b||{}).raw=!0,y(g,b)},o.gzip=function(g,b){return(b=b||{}).gzip=!0,y(g,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,o){var s=n("./zlib/inflate"),i=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),u=n("./zlib/messages"),d=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function f(m){if(!(this instanceof f))return new f(m);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},m||{});var y=this.options;y.raw&&0<=y.windowBits&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),!(0<=y.windowBits&&y.windowBits<16)||m&&m.windowBits||(y.windowBits+=32),15<y.windowBits&&y.windowBits<48&&(15&y.windowBits)==0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var g=s.inflateInit2(this.strm,y.windowBits);if(g!==c.Z_OK)throw new Error(u[g]);this.header=new h,s.inflateGetHeader(this.strm,this.header)}function x(m,y){var g=new f(y);if(g.push(m,!0),g.err)throw g.msg||u[g.err];return g.result}f.prototype.push=function(m,y){var g,b,k,S,j,C,E=this.strm,T=this.options.chunkSize,R=this.options.dictionary,M=!1;if(this.ended)return!1;b=y===~~y?y:y===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof m=="string"?E.input=a.binstring2buf(m):p.call(m)==="[object ArrayBuffer]"?E.input=new Uint8Array(m):E.input=m,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new i.Buf8(T),E.next_out=0,E.avail_out=T),(g=s.inflate(E,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&R&&(C=typeof R=="string"?a.string2buf(R):p.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,g=s.inflateSetDictionary(this.strm,C)),g===c.Z_BUF_ERROR&&M===!0&&(g=c.Z_OK,M=!1),g!==c.Z_STREAM_END&&g!==c.Z_OK)return this.onEnd(g),!(this.ended=!0);E.next_out&&(E.avail_out!==0&&g!==c.Z_STREAM_END&&(E.avail_in!==0||b!==c.Z_FINISH&&b!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(E.output,E.next_out),S=E.next_out-k,j=a.buf2string(E.output,k),E.next_out=S,E.avail_out=T-S,S&&i.arraySet(E.output,E.output,k,S,0),this.onData(j)):this.onData(i.shrinkBuf(E.output,E.next_out)))),E.avail_in===0&&E.avail_out===0&&(M=!0)}while((0<E.avail_in||E.avail_out===0)&&g!==c.Z_STREAM_END);return g===c.Z_STREAM_END&&(b=c.Z_FINISH),b===c.Z_FINISH?(g=s.inflateEnd(this.strm),this.onEnd(g),this.ended=!0,g===c.Z_OK):b!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(E.avail_out=0))},f.prototype.onData=function(m){this.chunks.push(m)},f.prototype.onEnd=function(m){m===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=i.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 s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(c){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var d=u.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var h in d)d.hasOwnProperty(h)&&(c[h]=d[h])}}return c},o.shrinkBuf=function(c,u){return c.length===u?c:c.subarray?c.subarray(0,u):(c.length=u,c)};var i={arraySet:function(c,u,d,h,p){if(u.subarray&&c.subarray)c.set(u.subarray(d,d+h),p);else for(var f=0;f<h;f++)c[p+f]=u[d+f]},flattenChunks:function(c){var u,d,h,p,f,x;for(u=h=0,d=c.length;u<d;u++)h+=c[u].length;for(x=new Uint8Array(h),u=p=0,d=c.length;u<d;u++)f=c[u],x.set(f,p),p+=f.length;return x}},a={arraySet:function(c,u,d,h,p){for(var f=0;f<h;f++)c[p+f]=u[d+f]},flattenChunks:function(c){return[].concat.apply([],c)}};o.setTyped=function(c){c?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,i)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(s)},{}],42:[function(n,r,o){var s=n("./common"),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new s.Buf8(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function d(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&i))return String.fromCharCode.apply(null,s.shrinkBuf(h,p));for(var f="",x=0;x<p;x++)f+=String.fromCharCode(h[x]);return f}c[254]=c[254]=1,o.string2buf=function(h){var p,f,x,m,y,g=h.length,b=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++),b+=f<128?1:f<2048?2:f<65536?3:4;for(p=new s.Buf8(b),m=y=0;y<b;m++)(64512&(f=h.charCodeAt(m)))==55296&&m+1<g&&(64512&(x=h.charCodeAt(m+1)))==56320&&(f=65536+(f-55296<<10)+(x-56320),m++),f<128?p[y++]=f:(f<2048?p[y++]=192|f>>>6:(f<65536?p[y++]=224|f>>>12:(p[y++]=240|f>>>18,p[y++]=128|f>>>12&63),p[y++]=128|f>>>6&63),p[y++]=128|63&f);return p},o.buf2binstring=function(h){return d(h,h.length)},o.binstring2buf=function(h){for(var p=new s.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,b=new Array(2*g);for(f=x=0;f<g;)if((m=h[f++])<128)b[x++]=m;else if(4<(y=c[m]))b[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?b[x++]=65533:m<65536?b[x++]=m:(m-=65536,b[x++]=55296|m>>10&1023,b[x++]=56320|1023&m)}return d(b,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+c[h[f]]>p?f:p}},{"./common":41}],43:[function(n,r,o){r.exports=function(s,i,a,c){for(var u=65535&s|0,d=s>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;d=d+(u=u+i[c++]|0)|0,--h;);u%=65521,d%=65521}return u|d<<16|0}},{}],44:[function(n,r,o){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,o){var s=(function(){for(var i,a=[],c=0;c<256;c++){i=c;for(var u=0;u<8;u++)i=1&i?3988292384^i>>>1:i>>>1;a[c]=i}return a})();r.exports=function(i,a,c,u){var d=s,h=u+c;i^=-1;for(var p=u;p<h;p++)i=i>>>8^d[255&(i^a[p])];return-1^i}},{}],46:[function(n,r,o){var s,i=n("../utils/common"),a=n("./trees"),c=n("./adler32"),u=n("./crc32"),d=n("./messages"),h=0,p=4,f=0,x=-2,m=-1,y=4,g=2,b=8,k=9,S=286,j=30,C=19,E=2*S+1,T=15,R=3,M=258,B=M+R+1,N=42,O=113,w=1,D=2,X=3,W=4;function H(_,ee){return _.msg=d[ee],ee}function Y(_){return(_<<1)-(4<_?9:0)}function A(_){for(var ee=_.length;0<=--ee;)_[ee]=0}function V(_){var ee=_.state,K=ee.pending;K>_.avail_out&&(K=_.avail_out),K!==0&&(i.arraySet(_.output,ee.pending_buf,ee.pending_out,K,_.next_out),_.next_out+=K,ee.pending_out+=K,_.total_out+=K,_.avail_out-=K,ee.pending-=K,ee.pending===0&&(ee.pending_out=0))}function Z(_,ee){a._tr_flush_block(_,0<=_.block_start?_.block_start:-1,_.strstart-_.block_start,ee),_.block_start=_.strstart,V(_.strm)}function I(_,ee){_.pending_buf[_.pending++]=ee}function oe(_,ee){_.pending_buf[_.pending++]=ee>>>8&255,_.pending_buf[_.pending++]=255&ee}function J(_,ee){var K,P,z=_.max_chain_length,L=_.strstart,$=_.prev_length,G=_.nice_match,F=_.strstart>_.w_size-B?_.strstart-(_.w_size-B):0,ne=_.window,le=_.w_mask,se=_.prev,U=_.strstart+M,re=ne[L+$-1],ue=ne[L+$];_.prev_length>=_.good_match&&(z>>=2),G>_.lookahead&&(G=_.lookahead);do if(ne[(K=ee)+$]===ue&&ne[K+$-1]===re&&ne[K]===ne[L]&&ne[++K]===ne[L+1]){L+=2,K++;do;while(ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&ne[++L]===ne[++K]&&L<U);if(P=M-(U-L),L=U-M,$<P){if(_.match_start=ee,G<=($=P))break;re=ne[L+$-1],ue=ne[L+$]}}while((ee=se[ee&le])>F&&--z!=0);return $<=_.lookahead?$:_.lookahead}function de(_){var ee,K,P,z,L,$,G,F,ne,le,se=_.w_size;do{if(z=_.window_size-_.lookahead-_.strstart,_.strstart>=se+(se-B)){for(i.arraySet(_.window,_.window,se,se,0),_.match_start-=se,_.strstart-=se,_.block_start-=se,ee=K=_.hash_size;P=_.head[--ee],_.head[ee]=se<=P?P-se:0,--K;);for(ee=K=se;P=_.prev[--ee],_.prev[ee]=se<=P?P-se:0,--K;);z+=se}if(_.strm.avail_in===0)break;if($=_.strm,G=_.window,F=_.strstart+_.lookahead,ne=z,le=void 0,le=$.avail_in,ne<le&&(le=ne),K=le===0?0:($.avail_in-=le,i.arraySet(G,$.input,$.next_in,le,F),$.state.wrap===1?$.adler=c($.adler,G,le,F):$.state.wrap===2&&($.adler=u($.adler,G,le,F)),$.next_in+=le,$.total_in+=le,le),_.lookahead+=K,_.lookahead+_.insert>=R)for(L=_.strstart-_.insert,_.ins_h=_.window[L],_.ins_h=(_.ins_h<<_.hash_shift^_.window[L+1])&_.hash_mask;_.insert&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[L+R-1])&_.hash_mask,_.prev[L&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=L,L++,_.insert--,!(_.lookahead+_.insert<R)););}while(_.lookahead<B&&_.strm.avail_in!==0)}function te(_,ee){for(var K,P;;){if(_.lookahead<B){if(de(_),_.lookahead<B&&ee===h)return w;if(_.lookahead===0)break}if(K=0,_.lookahead>=R&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+R-1])&_.hash_mask,K=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),K!==0&&_.strstart-K<=_.w_size-B&&(_.match_length=J(_,K)),_.match_length>=R)if(P=a._tr_tally(_,_.strstart-_.match_start,_.match_length-R),_.lookahead-=_.match_length,_.match_length<=_.max_lazy_match&&_.lookahead>=R){for(_.match_length--;_.strstart++,_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+R-1])&_.hash_mask,K=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart,--_.match_length!=0;);_.strstart++}else _.strstart+=_.match_length,_.match_length=0,_.ins_h=_.window[_.strstart],_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+1])&_.hash_mask;else P=a._tr_tally(_,0,_.window[_.strstart]),_.lookahead--,_.strstart++;if(P&&(Z(_,!1),_.strm.avail_out===0))return w}return _.insert=_.strstart<R-1?_.strstart:R-1,ee===p?(Z(_,!0),_.strm.avail_out===0?X:W):_.last_lit&&(Z(_,!1),_.strm.avail_out===0)?w:D}function ce(_,ee){for(var K,P,z;;){if(_.lookahead<B){if(de(_),_.lookahead<B&&ee===h)return w;if(_.lookahead===0)break}if(K=0,_.lookahead>=R&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+R-1])&_.hash_mask,K=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),_.prev_length=_.match_length,_.prev_match=_.match_start,_.match_length=R-1,K!==0&&_.prev_length<_.max_lazy_match&&_.strstart-K<=_.w_size-B&&(_.match_length=J(_,K),_.match_length<=5&&(_.strategy===1||_.match_length===R&&4096<_.strstart-_.match_start)&&(_.match_length=R-1)),_.prev_length>=R&&_.match_length<=_.prev_length){for(z=_.strstart+_.lookahead-R,P=a._tr_tally(_,_.strstart-1-_.prev_match,_.prev_length-R),_.lookahead-=_.prev_length-1,_.prev_length-=2;++_.strstart<=z&&(_.ins_h=(_.ins_h<<_.hash_shift^_.window[_.strstart+R-1])&_.hash_mask,K=_.prev[_.strstart&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=_.strstart),--_.prev_length!=0;);if(_.match_available=0,_.match_length=R-1,_.strstart++,P&&(Z(_,!1),_.strm.avail_out===0))return w}else if(_.match_available){if((P=a._tr_tally(_,0,_.window[_.strstart-1]))&&Z(_,!1),_.strstart++,_.lookahead--,_.strm.avail_out===0)return w}else _.match_available=1,_.strstart++,_.lookahead--}return _.match_available&&(P=a._tr_tally(_,0,_.window[_.strstart-1]),_.match_available=0),_.insert=_.strstart<R-1?_.strstart:R-1,ee===p?(Z(_,!0),_.strm.avail_out===0?X:W):_.last_lit&&(Z(_,!1),_.strm.avail_out===0)?w:D}function fe(_,ee,K,P,z){this.good_length=_,this.max_lazy=ee,this.nice_length=K,this.max_chain=P,this.func=z}function ge(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*E),this.dyn_dtree=new i.Buf16(2*(2*j+1)),this.bl_tree=new i.Buf16(2*(2*C+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 i.Buf16(T+1),this.heap=new i.Buf16(2*S+1),A(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*S+1),A(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xe(_){var ee;return _&&_.state?(_.total_in=_.total_out=0,_.data_type=g,(ee=_.state).pending=0,ee.pending_out=0,ee.wrap<0&&(ee.wrap=-ee.wrap),ee.status=ee.wrap?N:O,_.adler=ee.wrap===2?0:1,ee.last_flush=h,a._tr_init(ee),f):H(_,x)}function Ee(_){var ee=xe(_);return ee===f&&(function(K){K.window_size=2*K.w_size,A(K.head),K.max_lazy_match=s[K.level].max_lazy,K.good_match=s[K.level].good_length,K.nice_match=s[K.level].nice_length,K.max_chain_length=s[K.level].max_chain,K.strstart=0,K.block_start=0,K.lookahead=0,K.insert=0,K.match_length=K.prev_length=R-1,K.match_available=0,K.ins_h=0})(_.state),ee}function Fe(_,ee,K,P,z,L){if(!_)return x;var $=1;if(ee===m&&(ee=6),P<0?($=0,P=-P):15<P&&($=2,P-=16),z<1||k<z||K!==b||P<8||15<P||ee<0||9<ee||L<0||y<L)return H(_,x);P===8&&(P=9);var G=new ge;return(_.state=G).strm=_,G.wrap=$,G.gzhead=null,G.w_bits=P,G.w_size=1<<G.w_bits,G.w_mask=G.w_size-1,G.hash_bits=z+7,G.hash_size=1<<G.hash_bits,G.hash_mask=G.hash_size-1,G.hash_shift=~~((G.hash_bits+R-1)/R),G.window=new i.Buf8(2*G.w_size),G.head=new i.Buf16(G.hash_size),G.prev=new i.Buf16(G.w_size),G.lit_bufsize=1<<z+6,G.pending_buf_size=4*G.lit_bufsize,G.pending_buf=new i.Buf8(G.pending_buf_size),G.d_buf=1*G.lit_bufsize,G.l_buf=3*G.lit_bufsize,G.level=ee,G.strategy=L,G.method=K,Ee(_)}s=[new fe(0,0,0,0,function(_,ee){var K=65535;for(K>_.pending_buf_size-5&&(K=_.pending_buf_size-5);;){if(_.lookahead<=1){if(de(_),_.lookahead===0&&ee===h)return w;if(_.lookahead===0)break}_.strstart+=_.lookahead,_.lookahead=0;var P=_.block_start+K;if((_.strstart===0||_.strstart>=P)&&(_.lookahead=_.strstart-P,_.strstart=P,Z(_,!1),_.strm.avail_out===0)||_.strstart-_.block_start>=_.w_size-B&&(Z(_,!1),_.strm.avail_out===0))return w}return _.insert=0,ee===p?(Z(_,!0),_.strm.avail_out===0?X:W):(_.strstart>_.block_start&&(Z(_,!1),_.strm.avail_out),w)}),new fe(4,4,8,4,te),new fe(4,5,16,8,te),new fe(4,6,32,32,te),new fe(4,4,16,16,ce),new fe(8,16,32,32,ce),new fe(8,16,128,128,ce),new fe(8,32,128,256,ce),new fe(32,128,258,1024,ce),new fe(32,258,258,4096,ce)],o.deflateInit=function(_,ee){return Fe(_,ee,b,15,8,0)},o.deflateInit2=Fe,o.deflateReset=Ee,o.deflateResetKeep=xe,o.deflateSetHeader=function(_,ee){return _&&_.state?_.state.wrap!==2?x:(_.state.gzhead=ee,f):x},o.deflate=function(_,ee){var K,P,z,L;if(!_||!_.state||5<ee||ee<0)return _?H(_,x):x;if(P=_.state,!_.output||!_.input&&_.avail_in!==0||P.status===666&&ee!==p)return H(_,_.avail_out===0?-5:x);if(P.strm=_,K=P.last_flush,P.last_flush=ee,P.status===N)if(P.wrap===2)_.adler=0,I(P,31),I(P,139),I(P,8),P.gzhead?(I(P,(P.gzhead.text?1:0)+(P.gzhead.hcrc?2:0)+(P.gzhead.extra?4:0)+(P.gzhead.name?8:0)+(P.gzhead.comment?16:0)),I(P,255&P.gzhead.time),I(P,P.gzhead.time>>8&255),I(P,P.gzhead.time>>16&255),I(P,P.gzhead.time>>24&255),I(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),I(P,255&P.gzhead.os),P.gzhead.extra&&P.gzhead.extra.length&&(I(P,255&P.gzhead.extra.length),I(P,P.gzhead.extra.length>>8&255)),P.gzhead.hcrc&&(_.adler=u(_.adler,P.pending_buf,P.pending,0)),P.gzindex=0,P.status=69):(I(P,0),I(P,0),I(P,0),I(P,0),I(P,0),I(P,P.level===9?2:2<=P.strategy||P.level<2?4:0),I(P,3),P.status=O);else{var $=b+(P.w_bits-8<<4)<<8;$|=(2<=P.strategy||P.level<2?0:P.level<6?1:P.level===6?2:3)<<6,P.strstart!==0&&($|=32),$+=31-$%31,P.status=O,oe(P,$),P.strstart!==0&&(oe(P,_.adler>>>16),oe(P,65535&_.adler)),_.adler=1}if(P.status===69)if(P.gzhead.extra){for(z=P.pending;P.gzindex<(65535&P.gzhead.extra.length)&&(P.pending!==P.pending_buf_size||(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V(_),z=P.pending,P.pending!==P.pending_buf_size));)I(P,255&P.gzhead.extra[P.gzindex]),P.gzindex++;P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),P.gzindex===P.gzhead.extra.length&&(P.gzindex=0,P.status=73)}else P.status=73;if(P.status===73)if(P.gzhead.name){z=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V(_),z=P.pending,P.pending===P.pending_buf_size)){L=1;break}L=P.gzindex<P.gzhead.name.length?255&P.gzhead.name.charCodeAt(P.gzindex++):0,I(P,L)}while(L!==0);P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),L===0&&(P.gzindex=0,P.status=91)}else P.status=91;if(P.status===91)if(P.gzhead.comment){z=P.pending;do{if(P.pending===P.pending_buf_size&&(P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),V(_),z=P.pending,P.pending===P.pending_buf_size)){L=1;break}L=P.gzindex<P.gzhead.comment.length?255&P.gzhead.comment.charCodeAt(P.gzindex++):0,I(P,L)}while(L!==0);P.gzhead.hcrc&&P.pending>z&&(_.adler=u(_.adler,P.pending_buf,P.pending-z,z)),L===0&&(P.status=103)}else P.status=103;if(P.status===103&&(P.gzhead.hcrc?(P.pending+2>P.pending_buf_size&&V(_),P.pending+2<=P.pending_buf_size&&(I(P,255&_.adler),I(P,_.adler>>8&255),_.adler=0,P.status=O)):P.status=O),P.pending!==0){if(V(_),_.avail_out===0)return P.last_flush=-1,f}else if(_.avail_in===0&&Y(ee)<=Y(K)&&ee!==p)return H(_,-5);if(P.status===666&&_.avail_in!==0)return H(_,-5);if(_.avail_in!==0||P.lookahead!==0||ee!==h&&P.status!==666){var G=P.strategy===2?(function(F,ne){for(var le;;){if(F.lookahead===0&&(de(F),F.lookahead===0)){if(ne===h)return w;break}if(F.match_length=0,le=a._tr_tally(F,0,F.window[F.strstart]),F.lookahead--,F.strstart++,le&&(Z(F,!1),F.strm.avail_out===0))return w}return F.insert=0,ne===p?(Z(F,!0),F.strm.avail_out===0?X:W):F.last_lit&&(Z(F,!1),F.strm.avail_out===0)?w:D})(P,ee):P.strategy===3?(function(F,ne){for(var le,se,U,re,ue=F.window;;){if(F.lookahead<=M){if(de(F),F.lookahead<=M&&ne===h)return w;if(F.lookahead===0)break}if(F.match_length=0,F.lookahead>=R&&0<F.strstart&&(se=ue[U=F.strstart-1])===ue[++U]&&se===ue[++U]&&se===ue[++U]){re=F.strstart+M;do;while(se===ue[++U]&&se===ue[++U]&&se===ue[++U]&&se===ue[++U]&&se===ue[++U]&&se===ue[++U]&&se===ue[++U]&&se===ue[++U]&&U<re);F.match_length=M-(re-U),F.match_length>F.lookahead&&(F.match_length=F.lookahead)}if(F.match_length>=R?(le=a._tr_tally(F,1,F.match_length-R),F.lookahead-=F.match_length,F.strstart+=F.match_length,F.match_length=0):(le=a._tr_tally(F,0,F.window[F.strstart]),F.lookahead--,F.strstart++),le&&(Z(F,!1),F.strm.avail_out===0))return w}return F.insert=0,ne===p?(Z(F,!0),F.strm.avail_out===0?X:W):F.last_lit&&(Z(F,!1),F.strm.avail_out===0)?w:D})(P,ee):s[P.level].func(P,ee);if(G!==X&&G!==W||(P.status=666),G===w||G===X)return _.avail_out===0&&(P.last_flush=-1),f;if(G===D&&(ee===1?a._tr_align(P):ee!==5&&(a._tr_stored_block(P,0,0,!1),ee===3&&(A(P.head),P.lookahead===0&&(P.strstart=0,P.block_start=0,P.insert=0))),V(_),_.avail_out===0))return P.last_flush=-1,f}return ee!==p?f:P.wrap<=0?1:(P.wrap===2?(I(P,255&_.adler),I(P,_.adler>>8&255),I(P,_.adler>>16&255),I(P,_.adler>>24&255),I(P,255&_.total_in),I(P,_.total_in>>8&255),I(P,_.total_in>>16&255),I(P,_.total_in>>24&255)):(oe(P,_.adler>>>16),oe(P,65535&_.adler)),V(_),0<P.wrap&&(P.wrap=-P.wrap),P.pending!==0?f:1)},o.deflateEnd=function(_){var ee;return _&&_.state?(ee=_.state.status)!==N&&ee!==69&&ee!==73&&ee!==91&&ee!==103&&ee!==O&&ee!==666?H(_,x):(_.state=null,ee===O?H(_,-3):f):x},o.deflateSetDictionary=function(_,ee){var K,P,z,L,$,G,F,ne,le=ee.length;if(!_||!_.state||(L=(K=_.state).wrap)===2||L===1&&K.status!==N||K.lookahead)return x;for(L===1&&(_.adler=c(_.adler,ee,le,0)),K.wrap=0,le>=K.w_size&&(L===0&&(A(K.head),K.strstart=0,K.block_start=0,K.insert=0),ne=new i.Buf8(K.w_size),i.arraySet(ne,ee,le-K.w_size,K.w_size,0),ee=ne,le=K.w_size),$=_.avail_in,G=_.next_in,F=_.input,_.avail_in=le,_.next_in=0,_.input=ee,de(K);K.lookahead>=R;){for(P=K.strstart,z=K.lookahead-(R-1);K.ins_h=(K.ins_h<<K.hash_shift^K.window[P+R-1])&K.hash_mask,K.prev[P&K.w_mask]=K.head[K.ins_h],K.head[K.ins_h]=P,P++,--z;);K.strstart=P,K.lookahead=R-1,de(K)}return K.strstart+=K.lookahead,K.block_start=K.strstart,K.insert=K.lookahead,K.lookahead=0,K.match_length=K.prev_length=R-1,K.match_available=0,_.next_in=G,_.input=F,_.avail_in=$,K.wrap=L,f},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,o){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,o){r.exports=function(s,i){var a,c,u,d,h,p,f,x,m,y,g,b,k,S,j,C,E,T,R,M,B,N,O,w,D;a=s.state,c=s.next_in,w=s.input,u=c+(s.avail_in-5),d=s.next_out,D=s.output,h=d-(i-s.avail_out),p=d+(s.avail_out-257),f=a.dmax,x=a.wsize,m=a.whave,y=a.wnext,g=a.window,b=a.hold,k=a.bits,S=a.lencode,j=a.distcode,C=(1<<a.lenbits)-1,E=(1<<a.distbits)-1;e:do{k<15&&(b+=w[c++]<<k,k+=8,b+=w[c++]<<k,k+=8),T=S[b&C];t:for(;;){if(b>>>=R=T>>>24,k-=R,(R=T>>>16&255)===0)D[d++]=65535&T;else{if(!(16&R)){if((64&R)==0){T=S[(65535&T)+(b&(1<<R)-1)];continue t}if(32&R){a.mode=12;break e}s.msg="invalid literal/length code",a.mode=30;break e}M=65535&T,(R&=15)&&(k<R&&(b+=w[c++]<<k,k+=8),M+=b&(1<<R)-1,b>>>=R,k-=R),k<15&&(b+=w[c++]<<k,k+=8,b+=w[c++]<<k,k+=8),T=j[b&E];n:for(;;){if(b>>>=R=T>>>24,k-=R,!(16&(R=T>>>16&255))){if((64&R)==0){T=j[(65535&T)+(b&(1<<R)-1)];continue n}s.msg="invalid distance code",a.mode=30;break e}if(B=65535&T,k<(R&=15)&&(b+=w[c++]<<k,(k+=8)<R&&(b+=w[c++]<<k,k+=8)),f<(B+=b&(1<<R)-1)){s.msg="invalid distance too far back",a.mode=30;break e}if(b>>>=R,k-=R,(R=d-h)<B){if(m<(R=B-R)&&a.sane){s.msg="invalid distance too far back",a.mode=30;break e}if(O=g,(N=0)===y){if(N+=x-R,R<M){for(M-=R;D[d++]=g[N++],--R;);N=d-B,O=D}}else if(y<R){if(N+=x+y-R,(R-=y)<M){for(M-=R;D[d++]=g[N++],--R;);if(N=0,y<M){for(M-=R=y;D[d++]=g[N++],--R;);N=d-B,O=D}}}else if(N+=y-R,R<M){for(M-=R;D[d++]=g[N++],--R;);N=d-B,O=D}for(;2<M;)D[d++]=O[N++],D[d++]=O[N++],D[d++]=O[N++],M-=3;M&&(D[d++]=O[N++],1<M&&(D[d++]=O[N++]))}else{for(N=d-B;D[d++]=D[N++],D[d++]=D[N++],D[d++]=D[N++],2<(M-=3););M&&(D[d++]=D[N++],1<M&&(D[d++]=D[N++]))}break}}break}}while(c<u&&d<p);c-=M=k>>3,b&=(1<<(k-=M<<3))-1,s.next_in=c,s.next_out=d,s.avail_in=c<u?u-c+5:5-(c-u),s.avail_out=d<p?p-d+257:257-(d-p),a.hold=b,a.bits=k}},{}],49:[function(n,r,o){var s=n("../utils/common"),i=n("./adler32"),a=n("./crc32"),c=n("./inffast"),u=n("./inftrees"),d=1,h=2,p=0,f=-2,x=1,m=852,y=592;function g(N){return(N>>>24&255)+(N>>>8&65280)+((65280&N)<<8)+((255&N)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(N){var O;return N&&N.state?(O=N.state,N.total_in=N.total_out=O.total=0,N.msg="",O.wrap&&(N.adler=1&O.wrap),O.mode=x,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new s.Buf32(m),O.distcode=O.distdyn=new s.Buf32(y),O.sane=1,O.back=-1,p):f}function S(N){var O;return N&&N.state?((O=N.state).wsize=0,O.whave=0,O.wnext=0,k(N)):f}function j(N,O){var w,D;return N&&N.state?(D=N.state,O<0?(w=0,O=-O):(w=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15<O)?f:(D.window!==null&&D.wbits!==O&&(D.window=null),D.wrap=w,D.wbits=O,S(N))):f}function C(N,O){var w,D;return N?(D=new b,(N.state=D).window=null,(w=j(N,O))!==p&&(N.state=null),w):f}var E,T,R=!0;function M(N){if(R){var O;for(E=new s.Buf32(512),T=new s.Buf32(32),O=0;O<144;)N.lens[O++]=8;for(;O<256;)N.lens[O++]=9;for(;O<280;)N.lens[O++]=7;for(;O<288;)N.lens[O++]=8;for(u(d,N.lens,0,288,E,0,N.work,{bits:9}),O=0;O<32;)N.lens[O++]=5;u(h,N.lens,0,32,T,0,N.work,{bits:5}),R=!1}N.lencode=E,N.lenbits=9,N.distcode=T,N.distbits=5}function B(N,O,w,D){var X,W=N.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new s.Buf8(W.wsize)),D>=W.wsize?(s.arraySet(W.window,O,w-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(D<(X=W.wsize-W.wnext)&&(X=D),s.arraySet(W.window,O,w-D,X,W.wnext),(D-=X)?(s.arraySet(W.window,O,w-D,D,0),W.wnext=D,W.whave=W.wsize):(W.wnext+=X,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=X))),0}o.inflateReset=S,o.inflateReset2=j,o.inflateResetKeep=k,o.inflateInit=function(N){return C(N,15)},o.inflateInit2=C,o.inflate=function(N,O){var w,D,X,W,H,Y,A,V,Z,I,oe,J,de,te,ce,fe,ge,xe,Ee,Fe,_,ee,K,P,z=0,L=new s.Buf8(4),$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!N||!N.state||!N.output||!N.input&&N.avail_in!==0)return f;(w=N.state).mode===12&&(w.mode=13),H=N.next_out,X=N.output,A=N.avail_out,W=N.next_in,D=N.input,Y=N.avail_in,V=w.hold,Z=w.bits,I=Y,oe=A,ee=p;e:for(;;)switch(w.mode){case x:if(w.wrap===0){w.mode=13;break}for(;Z<16;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(2&w.wrap&&V===35615){L[w.check=0]=255&V,L[1]=V>>>8&255,w.check=a(w.check,L,2,0),Z=V=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&V)<<8)+(V>>8))%31){N.msg="incorrect header check",w.mode=30;break}if((15&V)!=8){N.msg="unknown compression method",w.mode=30;break}if(Z-=4,_=8+(15&(V>>>=4)),w.wbits===0)w.wbits=_;else if(_>w.wbits){N.msg="invalid window size",w.mode=30;break}w.dmax=1<<_,N.adler=w.check=1,w.mode=512&V?10:12,Z=V=0;break;case 2:for(;Z<16;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(w.flags=V,(255&w.flags)!=8){N.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){N.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=V>>8&1),512&w.flags&&(L[0]=255&V,L[1]=V>>>8&255,w.check=a(w.check,L,2,0)),Z=V=0,w.mode=3;case 3:for(;Z<32;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}w.head&&(w.head.time=V),512&w.flags&&(L[0]=255&V,L[1]=V>>>8&255,L[2]=V>>>16&255,L[3]=V>>>24&255,w.check=a(w.check,L,4,0)),Z=V=0,w.mode=4;case 4:for(;Z<16;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}w.head&&(w.head.xflags=255&V,w.head.os=V>>8),512&w.flags&&(L[0]=255&V,L[1]=V>>>8&255,w.check=a(w.check,L,2,0)),Z=V=0,w.mode=5;case 5:if(1024&w.flags){for(;Z<16;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}w.length=V,w.head&&(w.head.extra_len=V),512&w.flags&&(L[0]=255&V,L[1]=V>>>8&255,w.check=a(w.check,L,2,0)),Z=V=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(Y<(J=w.length)&&(J=Y),J&&(w.head&&(_=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,D,W,J,_)),512&w.flags&&(w.check=a(w.check,D,J,W)),Y-=J,W+=J,w.length-=J),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(Y===0)break e;for(J=0;_=D[W+J++],w.head&&_&&w.length<65536&&(w.head.name+=String.fromCharCode(_)),_&&J<Y;);if(512&w.flags&&(w.check=a(w.check,D,J,W)),Y-=J,W+=J,_)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(Y===0)break e;for(J=0;_=D[W+J++],w.head&&_&&w.length<65536&&(w.head.comment+=String.fromCharCode(_)),_&&J<Y;);if(512&w.flags&&(w.check=a(w.check,D,J,W)),Y-=J,W+=J,_)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;Z<16;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(V!==(65535&w.check)){N.msg="header crc mismatch",w.mode=30;break}Z=V=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),N.adler=w.check=0,w.mode=12;break;case 10:for(;Z<32;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}N.adler=w.check=g(V),Z=V=0,w.mode=11;case 11:if(w.havedict===0)return N.next_out=H,N.avail_out=A,N.next_in=W,N.avail_in=Y,w.hold=V,w.bits=Z,2;N.adler=w.check=1,w.mode=12;case 12:if(O===5||O===6)break e;case 13:if(w.last){V>>>=7&Z,Z-=7&Z,w.mode=27;break}for(;Z<3;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}switch(w.last=1&V,Z-=1,3&(V>>>=1)){case 0:w.mode=14;break;case 1:if(M(w),w.mode=20,O!==6)break;V>>>=2,Z-=2;break e;case 2:w.mode=17;break;case 3:N.msg="invalid block type",w.mode=30}V>>>=2,Z-=2;break;case 14:for(V>>>=7&Z,Z-=7&Z;Z<32;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if((65535&V)!=(V>>>16^65535)){N.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&V,Z=V=0,w.mode=15,O===6)break e;case 15:w.mode=16;case 16:if(J=w.length){if(Y<J&&(J=Y),A<J&&(J=A),J===0)break e;s.arraySet(X,D,W,J,H),Y-=J,W+=J,A-=J,H+=J,w.length-=J;break}w.mode=12;break;case 17:for(;Z<14;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(w.nlen=257+(31&V),V>>>=5,Z-=5,w.ndist=1+(31&V),V>>>=5,Z-=5,w.ncode=4+(15&V),V>>>=4,Z-=4,286<w.nlen||30<w.ndist){N.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;Z<3;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}w.lens[$[w.have++]]=7&V,V>>>=3,Z-=3}for(;w.have<19;)w.lens[$[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,K={bits:w.lenbits},ee=u(0,w.lens,0,19,w.lencode,0,w.work,K),w.lenbits=K.bits,ee){N.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;fe=(z=w.lencode[V&(1<<w.lenbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=Z);){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(ge<16)V>>>=ce,Z-=ce,w.lens[w.have++]=ge;else{if(ge===16){for(P=ce+2;Z<P;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(V>>>=ce,Z-=ce,w.have===0){N.msg="invalid bit length repeat",w.mode=30;break}_=w.lens[w.have-1],J=3+(3&V),V>>>=2,Z-=2}else if(ge===17){for(P=ce+3;Z<P;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}Z-=ce,_=0,J=3+(7&(V>>>=ce)),V>>>=3,Z-=3}else{for(P=ce+7;Z<P;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}Z-=ce,_=0,J=11+(127&(V>>>=ce)),V>>>=7,Z-=7}if(w.have+J>w.nlen+w.ndist){N.msg="invalid bit length repeat",w.mode=30;break}for(;J--;)w.lens[w.have++]=_}}if(w.mode===30)break;if(w.lens[256]===0){N.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,K={bits:w.lenbits},ee=u(d,w.lens,0,w.nlen,w.lencode,0,w.work,K),w.lenbits=K.bits,ee){N.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,K={bits:w.distbits},ee=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,K),w.distbits=K.bits,ee){N.msg="invalid distances set",w.mode=30;break}if(w.mode=20,O===6)break e;case 20:w.mode=21;case 21:if(6<=Y&&258<=A){N.next_out=H,N.avail_out=A,N.next_in=W,N.avail_in=Y,w.hold=V,w.bits=Z,c(N,oe),H=N.next_out,X=N.output,A=N.avail_out,W=N.next_in,D=N.input,Y=N.avail_in,V=w.hold,Z=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;fe=(z=w.lencode[V&(1<<w.lenbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=Z);){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(fe&&(240&fe)==0){for(xe=ce,Ee=fe,Fe=ge;fe=(z=w.lencode[Fe+((V&(1<<xe+Ee)-1)>>xe)])>>>16&255,ge=65535&z,!(xe+(ce=z>>>24)<=Z);){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}V>>>=xe,Z-=xe,w.back+=xe}if(V>>>=ce,Z-=ce,w.back+=ce,w.length=ge,fe===0){w.mode=26;break}if(32&fe){w.back=-1,w.mode=12;break}if(64&fe){N.msg="invalid literal/length code",w.mode=30;break}w.extra=15&fe,w.mode=22;case 22:if(w.extra){for(P=w.extra;Z<P;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}w.length+=V&(1<<w.extra)-1,V>>>=w.extra,Z-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;fe=(z=w.distcode[V&(1<<w.distbits)-1])>>>16&255,ge=65535&z,!((ce=z>>>24)<=Z);){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if((240&fe)==0){for(xe=ce,Ee=fe,Fe=ge;fe=(z=w.distcode[Fe+((V&(1<<xe+Ee)-1)>>xe)])>>>16&255,ge=65535&z,!(xe+(ce=z>>>24)<=Z);){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}V>>>=xe,Z-=xe,w.back+=xe}if(V>>>=ce,Z-=ce,w.back+=ce,64&fe){N.msg="invalid distance code",w.mode=30;break}w.offset=ge,w.extra=15&fe,w.mode=24;case 24:if(w.extra){for(P=w.extra;Z<P;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}w.offset+=V&(1<<w.extra)-1,V>>>=w.extra,Z-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){N.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(A===0)break e;if(J=oe-A,w.offset>J){if((J=w.offset-J)>w.whave&&w.sane){N.msg="invalid distance too far back",w.mode=30;break}de=J>w.wnext?(J-=w.wnext,w.wsize-J):w.wnext-J,J>w.length&&(J=w.length),te=w.window}else te=X,de=H-w.offset,J=w.length;for(A<J&&(J=A),A-=J,w.length-=J;X[H++]=te[de++],--J;);w.length===0&&(w.mode=21);break;case 26:if(A===0)break e;X[H++]=w.length,A--,w.mode=21;break;case 27:if(w.wrap){for(;Z<32;){if(Y===0)break e;Y--,V|=D[W++]<<Z,Z+=8}if(oe-=A,N.total_out+=oe,w.total+=oe,oe&&(N.adler=w.check=w.flags?a(w.check,X,oe,H-oe):i(w.check,X,oe,H-oe)),oe=A,(w.flags?V:g(V))!==w.check){N.msg="incorrect data check",w.mode=30;break}Z=V=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;Z<32;){if(Y===0)break e;Y--,V+=D[W++]<<Z,Z+=8}if(V!==(4294967295&w.total)){N.msg="incorrect length check",w.mode=30;break}Z=V=0}w.mode=29;case 29:ee=1;break e;case 30:ee=-3;break e;case 31:return-4;default:return f}return N.next_out=H,N.avail_out=A,N.next_in=W,N.avail_in=Y,w.hold=V,w.bits=Z,(w.wsize||oe!==N.avail_out&&w.mode<30&&(w.mode<27||O!==4))&&B(N,N.output,N.next_out,oe-N.avail_out)?(w.mode=31,-4):(I-=N.avail_in,oe-=N.avail_out,N.total_in+=I,N.total_out+=oe,w.total+=oe,w.wrap&&oe&&(N.adler=w.check=w.flags?a(w.check,X,oe,N.next_out-oe):i(w.check,X,oe,N.next_out-oe)),N.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(I==0&&oe===0||O===4)&&ee===p&&(ee=-5),ee)},o.inflateEnd=function(N){if(!N||!N.state)return f;var O=N.state;return O.window&&(O.window=null),N.state=null,p},o.inflateGetHeader=function(N,O){var w;return N&&N.state?(2&(w=N.state).wrap)==0?f:((w.head=O).done=!1,p):f},o.inflateSetDictionary=function(N,O){var w,D=O.length;return N&&N.state?(w=N.state).wrap!==0&&w.mode!==11?f:w.mode===11&&i(1,O,D,0)!==w.check?-3:B(N,O,D,D)?(w.mode=31,-4):(w.havedict=1,p):f},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,o){var s=n("../utils/common"),i=[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],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,h,p,f,x,m,y,g){var b,k,S,j,C,E,T,R,M,B=g.bits,N=0,O=0,w=0,D=0,X=0,W=0,H=0,Y=0,A=0,V=0,Z=null,I=0,oe=new s.Buf16(16),J=new s.Buf16(16),de=null,te=0;for(N=0;N<=15;N++)oe[N]=0;for(O=0;O<f;O++)oe[h[p+O]]++;for(X=B,D=15;1<=D&&oe[D]===0;D--);if(D<X&&(X=D),D===0)return x[m++]=20971520,x[m++]=20971520,g.bits=1,0;for(w=1;w<D&&oe[w]===0;w++);for(X<w&&(X=w),N=Y=1;N<=15;N++)if(Y<<=1,(Y-=oe[N])<0)return-1;if(0<Y&&(d===0||D!==1))return-1;for(J[1]=0,N=1;N<15;N++)J[N+1]=J[N]+oe[N];for(O=0;O<f;O++)h[p+O]!==0&&(y[J[h[p+O]]++]=O);if(E=d===0?(Z=de=y,19):d===1?(Z=i,I-=257,de=a,te-=257,256):(Z=c,de=u,-1),N=w,C=m,H=O=V=0,S=-1,j=(A=1<<(W=X))-1,d===1&&852<A||d===2&&592<A)return 1;for(;;){for(T=N-H,M=y[O]<E?(R=0,y[O]):y[O]>E?(R=de[te+y[O]],Z[I+y[O]]):(R=96,0),b=1<<N-H,w=k=1<<W;x[C+(V>>H)+(k-=b)]=T<<24|R<<16|M|0,k!==0;);for(b=1<<N-1;V&b;)b>>=1;if(b!==0?(V&=b-1,V+=b):V=0,O++,--oe[N]==0){if(N===D)break;N=h[p+y[O]]}if(X<N&&(V&j)!==S){for(H===0&&(H=X),C+=w,Y=1<<(W=N-H);W+H<D&&!((Y-=oe[W+H])<=0);)W++,Y<<=1;if(A+=1<<W,d===1&&852<A||d===2&&592<A)return 1;x[S=V&j]=X<<24|W<<16|C-m|0}}return V!==0&&(x[C+V]=N-H<<24|64<<16|0),g.bits=X,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 s=n("../utils/common"),i=0,a=1;function c(z){for(var L=z.length;0<=--L;)z[L]=0}var u=0,d=29,h=256,p=h+1+d,f=30,x=19,m=2*p+1,y=15,g=16,b=7,k=256,S=16,j=17,C=18,E=[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],T=[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],M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B=new Array(2*(p+2));c(B);var N=new Array(2*f);c(N);var O=new Array(512);c(O);var w=new Array(256);c(w);var D=new Array(d);c(D);var X,W,H,Y=new Array(f);function A(z,L,$,G,F){this.static_tree=z,this.extra_bits=L,this.extra_base=$,this.elems=G,this.max_length=F,this.has_stree=z&&z.length}function V(z,L){this.dyn_tree=z,this.max_code=0,this.stat_desc=L}function Z(z){return z<256?O[z]:O[256+(z>>>7)]}function I(z,L){z.pending_buf[z.pending++]=255&L,z.pending_buf[z.pending++]=L>>>8&255}function oe(z,L,$){z.bi_valid>g-$?(z.bi_buf|=L<<z.bi_valid&65535,I(z,z.bi_buf),z.bi_buf=L>>g-z.bi_valid,z.bi_valid+=$-g):(z.bi_buf|=L<<z.bi_valid&65535,z.bi_valid+=$)}function J(z,L,$){oe(z,$[2*L],$[2*L+1])}function de(z,L){for(var $=0;$|=1&z,z>>>=1,$<<=1,0<--L;);return $>>>1}function te(z,L,$){var G,F,ne=new Array(y+1),le=0;for(G=1;G<=y;G++)ne[G]=le=le+$[G-1]<<1;for(F=0;F<=L;F++){var se=z[2*F+1];se!==0&&(z[2*F]=de(ne[se]++,se))}}function ce(z){var L;for(L=0;L<p;L++)z.dyn_ltree[2*L]=0;for(L=0;L<f;L++)z.dyn_dtree[2*L]=0;for(L=0;L<x;L++)z.bl_tree[2*L]=0;z.dyn_ltree[2*k]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function fe(z){8<z.bi_valid?I(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function ge(z,L,$,G){var F=2*L,ne=2*$;return z[F]<z[ne]||z[F]===z[ne]&&G[L]<=G[$]}function xe(z,L,$){for(var G=z.heap[$],F=$<<1;F<=z.heap_len&&(F<z.heap_len&&ge(L,z.heap[F+1],z.heap[F],z.depth)&&F++,!ge(L,G,z.heap[F],z.depth));)z.heap[$]=z.heap[F],$=F,F<<=1;z.heap[$]=G}function Ee(z,L,$){var G,F,ne,le,se=0;if(z.last_lit!==0)for(;G=z.pending_buf[z.d_buf+2*se]<<8|z.pending_buf[z.d_buf+2*se+1],F=z.pending_buf[z.l_buf+se],se++,G===0?J(z,F,L):(J(z,(ne=w[F])+h+1,L),(le=E[ne])!==0&&oe(z,F-=D[ne],le),J(z,ne=Z(--G),$),(le=T[ne])!==0&&oe(z,G-=Y[ne],le)),se<z.last_lit;);J(z,k,L)}function Fe(z,L){var $,G,F,ne=L.dyn_tree,le=L.stat_desc.static_tree,se=L.stat_desc.has_stree,U=L.stat_desc.elems,re=-1;for(z.heap_len=0,z.heap_max=m,$=0;$<U;$++)ne[2*$]!==0?(z.heap[++z.heap_len]=re=$,z.depth[$]=0):ne[2*$+1]=0;for(;z.heap_len<2;)ne[2*(F=z.heap[++z.heap_len]=re<2?++re:0)]=1,z.depth[F]=0,z.opt_len--,se&&(z.static_len-=le[2*F+1]);for(L.max_code=re,$=z.heap_len>>1;1<=$;$--)xe(z,ne,$);for(F=U;$=z.heap[1],z.heap[1]=z.heap[z.heap_len--],xe(z,ne,1),G=z.heap[1],z.heap[--z.heap_max]=$,z.heap[--z.heap_max]=G,ne[2*F]=ne[2*$]+ne[2*G],z.depth[F]=(z.depth[$]>=z.depth[G]?z.depth[$]:z.depth[G])+1,ne[2*$+1]=ne[2*G+1]=F,z.heap[1]=F++,xe(z,ne,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(ue,be){var Pe,qe,ft,De,It,Ut,We=be.dyn_tree,Zt=be.max_code,Ct=be.stat_desc.static_tree,Np=be.stat_desc.has_stree,Tp=be.stat_desc.extra_bits,Ca=be.stat_desc.extra_base,rr=be.stat_desc.max_length,Ir=0;for(De=0;De<=y;De++)ue.bl_count[De]=0;for(We[2*ue.heap[ue.heap_max]+1]=0,Pe=ue.heap_max+1;Pe<m;Pe++)rr<(De=We[2*We[2*(qe=ue.heap[Pe])+1]+1]+1)&&(De=rr,Ir++),We[2*qe+1]=De,Zt<qe||(ue.bl_count[De]++,It=0,Ca<=qe&&(It=Tp[qe-Ca]),Ut=We[2*qe],ue.opt_len+=Ut*(De+It),Np&&(ue.static_len+=Ut*(Ct[2*qe+1]+It)));if(Ir!==0){do{for(De=rr-1;ue.bl_count[De]===0;)De--;ue.bl_count[De]--,ue.bl_count[De+1]+=2,ue.bl_count[rr]--,Ir-=2}while(0<Ir);for(De=rr;De!==0;De--)for(qe=ue.bl_count[De];qe!==0;)Zt<(ft=ue.heap[--Pe])||(We[2*ft+1]!==De&&(ue.opt_len+=(De-We[2*ft+1])*We[2*ft],We[2*ft+1]=De),qe--)}})(z,L),te(ne,re,z.bl_count)}function _(z,L,$){var G,F,ne=-1,le=L[1],se=0,U=7,re=4;for(le===0&&(U=138,re=3),L[2*($+1)+1]=65535,G=0;G<=$;G++)F=le,le=L[2*(G+1)+1],++se<U&&F===le||(se<re?z.bl_tree[2*F]+=se:F!==0?(F!==ne&&z.bl_tree[2*F]++,z.bl_tree[2*S]++):se<=10?z.bl_tree[2*j]++:z.bl_tree[2*C]++,ne=F,re=(se=0)===le?(U=138,3):F===le?(U=6,3):(U=7,4))}function ee(z,L,$){var G,F,ne=-1,le=L[1],se=0,U=7,re=4;for(le===0&&(U=138,re=3),G=0;G<=$;G++)if(F=le,le=L[2*(G+1)+1],!(++se<U&&F===le)){if(se<re)for(;J(z,F,z.bl_tree),--se!=0;);else F!==0?(F!==ne&&(J(z,F,z.bl_tree),se--),J(z,S,z.bl_tree),oe(z,se-3,2)):se<=10?(J(z,j,z.bl_tree),oe(z,se-3,3)):(J(z,C,z.bl_tree),oe(z,se-11,7));ne=F,re=(se=0)===le?(U=138,3):F===le?(U=6,3):(U=7,4)}}c(Y);var K=!1;function P(z,L,$,G){oe(z,(u<<1)+(G?1:0),3),(function(F,ne,le,se){fe(F),I(F,le),I(F,~le),s.arraySet(F.pending_buf,F.window,ne,le,F.pending),F.pending+=le})(z,L,$)}o._tr_init=function(z){K||((function(){var L,$,G,F,ne,le=new Array(y+1);for(F=G=0;F<d-1;F++)for(D[F]=G,L=0;L<1<<E[F];L++)w[G++]=F;for(w[G-1]=F,F=ne=0;F<16;F++)for(Y[F]=ne,L=0;L<1<<T[F];L++)O[ne++]=F;for(ne>>=7;F<f;F++)for(Y[F]=ne<<7,L=0;L<1<<T[F]-7;L++)O[256+ne++]=F;for($=0;$<=y;$++)le[$]=0;for(L=0;L<=143;)B[2*L+1]=8,L++,le[8]++;for(;L<=255;)B[2*L+1]=9,L++,le[9]++;for(;L<=279;)B[2*L+1]=7,L++,le[7]++;for(;L<=287;)B[2*L+1]=8,L++,le[8]++;for(te(B,p+1,le),L=0;L<f;L++)N[2*L+1]=5,N[2*L]=de(L,5);X=new A(B,E,h+1,p,y),W=new A(N,T,0,f,y),H=new A(new Array(0),R,0,x,b)})(),K=!0),z.l_desc=new V(z.dyn_ltree,X),z.d_desc=new V(z.dyn_dtree,W),z.bl_desc=new V(z.bl_tree,H),z.bi_buf=0,z.bi_valid=0,ce(z)},o._tr_stored_block=P,o._tr_flush_block=function(z,L,$,G){var F,ne,le=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(se){var U,re=4093624447;for(U=0;U<=31;U++,re>>>=1)if(1&re&&se.dyn_ltree[2*U]!==0)return i;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(U=32;U<h;U++)if(se.dyn_ltree[2*U]!==0)return a;return i})(z)),Fe(z,z.l_desc),Fe(z,z.d_desc),le=(function(se){var U;for(_(se,se.dyn_ltree,se.l_desc.max_code),_(se,se.dyn_dtree,se.d_desc.max_code),Fe(se,se.bl_desc),U=x-1;3<=U&&se.bl_tree[2*M[U]+1]===0;U--);return se.opt_len+=3*(U+1)+5+5+4,U})(z),F=z.opt_len+3+7>>>3,(ne=z.static_len+3+7>>>3)<=F&&(F=ne)):F=ne=$+5,$+4<=F&&L!==-1?P(z,L,$,G):z.strategy===4||ne===F?(oe(z,2+(G?1:0),3),Ee(z,B,N)):(oe(z,4+(G?1:0),3),(function(se,U,re,ue){var be;for(oe(se,U-257,5),oe(se,re-1,5),oe(se,ue-4,4),be=0;be<ue;be++)oe(se,se.bl_tree[2*M[be]+1],3);ee(se,se.dyn_ltree,U-1),ee(se,se.dyn_dtree,re-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,le+1),Ee(z,z.dyn_ltree,z.dyn_dtree)),ce(z),G&&fe(z)},o._tr_tally=function(z,L,$){return z.pending_buf[z.d_buf+2*z.last_lit]=L>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&L,z.pending_buf[z.l_buf+z.last_lit]=255&$,z.last_lit++,L===0?z.dyn_ltree[2*$]++:(z.matches++,L--,z.dyn_ltree[2*(w[$]+h+1)]++,z.dyn_dtree[2*Z(L)]++),z.last_lit===z.lit_bufsize-1},o._tr_align=function(z){oe(z,2,3),J(z,k,B),(function(L){L.bi_valid===16?(I(L,L.bi_buf),L.bi_buf=0,L.bi_valid=0):8<=L.bi_valid&&(L.pending_buf[L.pending++]=255&L.bi_buf,L.bi_buf>>=8,L.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(n,r,o){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,o){(function(s){(function(i,a){if(!i.setImmediate){var c,u,d,h,p=1,f={},x=!1,m=i.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(i);y=y&&y.setTimeout?y:i,c={}.toString.call(i.process)==="[object process]"?function(S){process.nextTick(function(){b(S)})}:(function(){if(i.postMessage&&!i.importScripts){var S=!0,j=i.onmessage;return i.onmessage=function(){S=!1},i.postMessage("","*"),i.onmessage=j,S}})()?(h="setImmediate$"+Math.random()+"$",i.addEventListener?i.addEventListener("message",k,!1):i.attachEvent("onmessage",k),function(S){i.postMessage(h+S,"*")}):i.MessageChannel?((d=new MessageChannel).port1.onmessage=function(S){b(S.data)},function(S){d.port2.postMessage(S)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(S){var j=m.createElement("script");j.onreadystatechange=function(){b(S),j.onreadystatechange=null,u.removeChild(j),j=null},u.appendChild(j)}):function(S){setTimeout(b,0,S)},y.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var j=new Array(arguments.length-1),C=0;C<j.length;C++)j[C]=arguments[C+1];var E={callback:S,args:j};return f[p]=E,c(p),p++},y.clearImmediate=g}function g(S){delete f[S]}function b(S){if(x)setTimeout(b,0,S);else{var j=f[S];if(j){x=!0;try{(function(C){var E=C.callback,T=C.args;switch(T.length){case 0:E();break;case 1:E(T[0]);break;case 2:E(T[0],T[1]);break;case 3:E(T[0],T[1],T[2]);break;default:E.apply(a,T)}})(j)}finally{g(S),x=!1}}}}function k(S){S.source===i&&typeof S.data=="string"&&S.data.indexOf(h)===0&&b(+S.data.slice(h.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof zr<"u"?zr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ws)),ws.exports}var wS=bS();const kS=ki(wS);async function _S(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 SS(e){const t=new kS;for(const i of e)i.rawRequestBody!==null&&t.file(`#${i.id}.Request.json`,i.rawRequestBody),i.responseText!==null&&t.file(`#${i.id}.Response.json`,i.responseText);const n=e.filter(i=>i.streaming);await Promise.allSettled(n.map(async i=>{const a=await _S(i.id);a!==null&&t.file(`#${i.id}.SSE.Response.json`,a)}));const r=await t.generateAsync({type:"blob"}),o=URL.createObjectURL(r),s=document.createElement("a");s.href=o,s.download=`llm-inspector-export-${new Date().toISOString().slice(0,10)}.zip`,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}const CS="1.15.0",jS={version:CS};function Pl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ph(e){if(e.responseText===null)return null;try{let t=JSON.parse(e.responseText);return typeof t=="string"&&(t=JSON.parse(t)),Pl(t)?typeof t.stop_reason=="string"?t.stop_reason==="end_turn"||t.stop_reason==="tool_use"?t.stop_reason:null:Array.isArray(t.choices)&&t.choices.length>0&&Pl(t.choices[0])&&typeof t.choices[0].finish_reason=="string"&&t.choices[0].finish_reason==="stop"?"stop":null:null}catch{return null}}function ES(e){return e==="end_turn"||e==="stop"}const Ol=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Dl=bh,la=(e,t)=>n=>{var r;if(t?.variants==null)return Dl(e,n?.class,n?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n?.[u],h=s?.[u];if(d===null)return null;const p=Ol(d)||Ol(h);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;return p===void 0||(u[h]=p),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:p,...f}=d;return Object.entries(f).every(x=>{let[m,y]=x;return Array.isArray(y)?y.includes({...s,...a}[m]):{...s,...a}[m]===y})?[...u,h,p]:u},[]);return Dl(e,i,c,n?.class,n?.className)},NS=la("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 xt({className:e,variant:t="default",asChild:n=!1,...r}){const o=n?Lv:"span";return l.jsx(o,{"data-slot":"badge","data-variant":t,className:he(NS({variant:t}),e),...r})}const TS={anthropic:"Anthropic",openai:"OpenAI",unknown:"Unknown"};function Ml(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function AS({conversationId:e,startTime:t,endTime:n,totalCalls:r,totalInputTokens:o,totalOutputTokens:s,apiFormat:i,expanded:a,onToggle:c,hideApiFormat:u=!1,isLoading:d=!1,userAgent:h}){return l.jsxs("div",{role:"button",tabIndex:0,className:he("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:c,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),c())},children:[a?l.jsx(yt,{className:"size-4 text-muted-foreground shrink-0"}):d?l.jsx(br,{className:"size-4 animate-spin text-muted-foreground shrink-0"}):l.jsx(bt,{className:"size-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-purple-400/90 font-mono text-xs font-semibold shrink-0",title:e,children:e.length>24?e.slice(0,12)+"…"+e.slice(-12):e}),h!=null&&h!==""&&l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:h,children:[l.jsx(Av,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",children:h})]}),!u&&l.jsx(xt,{variant:"outline",className:he("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",i==="openai"&&"border-blue-500/40 text-blue-400",i==="anthropic"&&"border-orange-500/40 text-orange-400",i==="unknown"&&"border-muted text-muted-foreground"),children:TS[i]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(Ao,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[Ml(t)," - ",Ml(n)]})]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(qu,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[r," call",r!==1?"s":""]})]}),l.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[l.jsx(Cr,{className:"size-3 text-muted-foreground"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[l.jsx("span",{className:"text-blue-400",children:Ye(o)})," / ",l.jsx("span",{className:"text-amber-400",children:Ye(s)})]})]}),l.jsx("span",{className:"flex-1 min-w-0"})]})}function IS(e){const t=e.find(n=>n.apiFormat!=="unknown");return t!==void 0?t.apiFormat:e[0]?.apiFormat??"unknown"}function zS(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 vo(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 RS(e){const t=new Map;for(const r of e){const o=vo(r),s=t.get(o);s!==void 0?s.push(r):t.set(o,[r])}const n=[];for(const[r,o]of t){const s=[...o].sort((i,a)=>i.timestamp.localeCompare(a.timestamp));n.push({id:r,conversationId:r,logs:s})}return n.sort((r,o)=>(r.logs[0]?.timestamp??"").localeCompare(o.logs[0]?.timestamp??"")),n}const PS="x-anthropic-billing-header:";function OS(e){return e.trimStart().toLowerCase().startsWith(PS)}function Ll(e,t){return Object.getOwnPropertyDescriptor(e,t)?.value}function DS(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:Object.prototype.hasOwnProperty.call(e,"system")}function MS(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Ll(e,"type"),n=Ll(e,"text");return typeof t!="string"||t!=="text"||typeof n!="string"?!1:OS(n)}function LS(e){let t;try{t=JSON.parse(e)}catch{return{body:e,removed:0}}if(!DS(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 s of n){if(MS(s)){o+=1;continue}r.push(s)}return o===0?{body:e,removed:0}:(r.length===0?delete t.system:t.system=r,{body:JSON.stringify(t),removed:o})}const FS=la("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 Xe({className:e,variant:t,size:n,...r}){return l.jsx("button",{"data-slot":"button",className:he(FS({variant:t,size:n,className:e})),...r})}function BS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const $S=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,US=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZS={};function Fl(e,t){return(ZS.jsx?US:$S).test(e)}const VS=/[ \t\n\f\r]/g;function WS(e){return typeof e=="object"?e.type==="text"?Bl(e.value):!1:Bl(e)}function Bl(e){return e.replace(VS,"")===""}class Tr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Tr.prototype.normal={};Tr.prototype.property={};Tr.prototype.space=void 0;function Oh(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Tr(n,r,t)}function si(e){return e.toLowerCase()}class dt{constructor(t,n){this.attribute=n,this.property=t}}dt.prototype.attribute="";dt.prototype.booleanish=!1;dt.prototype.boolean=!1;dt.prototype.commaOrSpaceSeparated=!1;dt.prototype.commaSeparated=!1;dt.prototype.defined=!1;dt.prototype.mustUseProperty=!1;dt.prototype.number=!1;dt.prototype.overloadedBoolean=!1;dt.prototype.property="";dt.prototype.spaceSeparated=!1;dt.prototype.space=void 0;let HS=0;const je=wn(),Ge=wn(),ii=wn(),ie=wn(),Be=wn(),Ln=wn(),ht=wn();function wn(){return 2**++HS}const ai=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:Ge,commaOrSpaceSeparated:ht,commaSeparated:Ln,number:ie,overloadedBoolean:ii,spaceSeparated:Be},Symbol.toStringTag,{value:"Module"})),ks=Object.keys(ai);class ca extends dt{constructor(t,n,r,o){let s=-1;if(super(t,n),$l(this,"space",o),typeof r=="number")for(;++s<ks.length;){const i=ks[s];$l(this,ks[s],(r&ai[i])===ai[i])}}}ca.prototype.defined=!0;function $l(e,t,n){n&&(e[t]=n)}function tr(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const s=new ca(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[si(r)]=r,n[si(s.attribute)]=r}return new Tr(t,n,e.space)}const Dh=tr({properties:{ariaActiveDescendant:null,ariaAtomic:Ge,ariaAutoComplete:null,ariaBusy:Ge,ariaChecked:Ge,ariaColCount:ie,ariaColIndex:ie,ariaColSpan:ie,ariaControls:Be,ariaCurrent:null,ariaDescribedBy:Be,ariaDetails:null,ariaDisabled:Ge,ariaDropEffect:Be,ariaErrorMessage:null,ariaExpanded:Ge,ariaFlowTo:Be,ariaGrabbed:Ge,ariaHasPopup:null,ariaHidden:Ge,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Be,ariaLevel:ie,ariaLive:null,ariaModal:Ge,ariaMultiLine:Ge,ariaMultiSelectable:Ge,ariaOrientation:null,ariaOwns:Be,ariaPlaceholder:null,ariaPosInSet:ie,ariaPressed:Ge,ariaReadOnly:Ge,ariaRelevant:null,ariaRequired:Ge,ariaRoleDescription:Be,ariaRowCount:ie,ariaRowIndex:ie,ariaRowSpan:ie,ariaSelected:Ge,ariaSetSize:ie,ariaSort:null,ariaValueMax:ie,ariaValueMin:ie,ariaValueNow:ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Mh(e,t){return t in e?e[t]:t}function Lh(e,t){return Mh(e,t.toLowerCase())}const qS=tr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ln,acceptCharset:Be,accessKey:Be,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:Be,autoFocus:je,autoPlay:je,blocking:Be,capture:null,charSet:null,checked:je,cite:null,className:Be,cols:ie,colSpan:null,content:null,contentEditable:Ge,controls:je,controlsList:Be,coords:ie|Ln,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:ii,draggable:Ge,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:Be,height:ie,hidden:ii,high:ie,href:null,hrefLang:null,htmlFor:Be,httpEquiv:Be,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:Be,itemRef:Be,itemScope:je,itemType:Be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:ie,manifest:null,max:null,maxLength:ie,media:null,method:null,min:null,minLength:ie,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:ie,pattern:null,ping:Be,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:Be,required:je,reversed:je,rows:ie,rowSpan:ie,sandbox:Be,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:ie,sizes:null,slot:null,span:ie,spellCheck:Ge,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ie,step:null,style:null,tabIndex:ie,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:Ge,width:ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Be,axis:null,background:null,bgColor:null,border:ie,borderColor:null,bottomMargin:ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:ie,leftMargin:ie,link:null,longDesc:null,lowSrc:null,marginHeight:ie,marginWidth:ie,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:ie,rules:null,scheme:null,scrolling:Ge,standby:null,summary:null,text:null,topMargin:ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:ie,security:null,unselectable:null},space:"html",transform:Lh}),KS=tr({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:ht,accentHeight:ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ie,amplitude:ie,arabicForm:null,ascent:ie,attributeName:null,attributeType:null,azimuth:ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ie,by:null,calcMode:null,capHeight:ie,className:Be,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:ie,diffuseConstant:ie,direction:null,display:null,dur:null,divisor:ie,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:ie,enableBackground:null,end:null,event:null,exponent:ie,externalResourcesRequired:null,fill:null,fillOpacity:ie,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:Ln,g2:Ln,glyphName:Ln,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ie,horizOriginX:ie,horizOriginY:ie,id:null,ideographic:ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ie,k:ie,k1:ie,k2:ie,k3:ie,k4:ie,kernelMatrix:ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ie,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:ie,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:ie,overlineThickness:ie,paintOrder:null,panose1:null,path:null,pathLength:ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ie,pointsAtY:ie,pointsAtZ:ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ht,rev:ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ht,requiredFeatures:ht,requiredFonts:ht,requiredFormats:ht,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:ie,specularExponent:ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ie,strikethroughThickness:ie,string:null,stroke:null,strokeDashArray:ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ie,strokeOpacity:ie,strokeWidth:null,style:null,surfaceScale:ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ht,tabIndex:ie,tableValues:null,target:null,targetX:ie,targetY:ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ie,underlineThickness:ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ie,values:null,vAlphabetic:ie,vMathematical:ie,vectorEffect:null,vHanging:ie,vIdeographic:ie,version:null,vertAdvY:ie,vertOriginX:ie,vertOriginY:ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Mh}),Fh=tr({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()}}),Bh=tr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Lh}),$h=tr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),GS={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"},JS=/[A-Z]/g,Ul=/-[a-z]/g,YS=/^data[-\w.:]+$/i;function XS(e,t){const n=si(t);let r=t,o=dt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&YS.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Ul,eC);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Ul.test(s)){let i=s.replace(JS,QS);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=ca}return new o(r,t)}function QS(e){return"-"+e.toLowerCase()}function eC(e){return e.charAt(1).toUpperCase()}const tC=Oh([Dh,qS,Fh,Bh,$h],"html"),ua=Oh([Dh,KS,Fh,Bh,$h],"svg");function nC(e){return e.join(" ").trim()}var Nn={},_s,Zl;function rC(){if(Zl)return _s;Zl=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
|
|
85
|
+
`,u="/",d="*",h="",p="comment",f="declaration";function x(y,g){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];g=g||{};var b=1,k=1;function S(w){var D=w.match(t);D&&(b+=D.length);var X=w.lastIndexOf(c);k=~X?w.length-X:k+w.length}function j(){var w={line:b,column:k};return function(D){return D.position=new C(w),R(),D}}function C(w){this.start=w,this.end={line:b,column:k},this.source=g.source}C.prototype.content=y;function E(w){var D=new Error(g.source+":"+b+":"+k+": "+w);if(D.reason=w,D.filename=g.source,D.line=b,D.column=k,D.source=y,!g.silent)throw D}function T(w){var D=w.exec(y);if(D){var X=D[0];return S(X),y=y.slice(X.length),D}}function R(){T(n)}function M(w){var D;for(w=w||[];D=B();)D!==!1&&w.push(D);return w}function B(){var w=j();if(!(u!=y.charAt(0)||d!=y.charAt(1))){for(var D=2;h!=y.charAt(D)&&(d!=y.charAt(D)||u!=y.charAt(D+1));)++D;if(D+=2,h===y.charAt(D-1))return E("End of comment missing");var X=y.slice(2,D-2);return k+=2,S(X),y=y.slice(D),k+=2,w({type:p,comment:X})}}function N(){var w=j(),D=T(r);if(D){if(B(),!T(o))return E("property missing ':'");var X=T(s),W=w({type:f,property:m(D[0].replace(e,h)),value:X?m(X[0].replace(e,h)):h});return T(i),W}}function O(){var w=[];M(w);for(var D;D=N();)D!==!1&&(w.push(D),M(w));return w}return R(),O()}function m(y){return y?y.replace(a,h):h}return _s=x,_s}var Vl;function oC(){if(Vl)return Nn;Vl=1;var e=Nn&&Nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.default=n;const t=e(rC());function n(r,o){let s=null;if(!r||typeof r!="string")return s;const i=(0,t.default)(r),a=typeof o=="function";return i.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;a?o(u,d,c):d&&(s=s||{},s[u]=d)}),s}return Nn}var ir={},Wl;function sC(){if(Wl)return ir;Wl=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(u){return!u||n.test(u)||e.test(u)},i=function(u,d){return d.toUpperCase()},a=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),s(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(o,a):u=u.replace(r,a),u.replace(t,i))};return ir.camelCase=c,ir}var ar,Hl;function iC(){if(Hl)return ar;Hl=1;var e=ar&&ar.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(oC()),n=sC();function r(o,s){var i={};return!o||typeof o!="string"||(0,t.default)(o,function(a,c){a&&c&&(i[(0,n.camelCase)(a,s)]=c)}),i}return r.default=r,ar=r,ar}var aC=iC();const lC=ki(aC),Uh=Zh("end"),da=Zh("start");function Zh(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 cC(e){const t=da(e),n=Uh(e);if(t&&n)return{start:t,end:n}}function pr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ql(e.position):"start"in e||"end"in e?ql(e):"line"in e||"column"in e?li(e):""}function li(e){return Kl(e&&e.line)+":"+Kl(e&&e.column)}function ql(e){return li(e&&e.start)+"-"+li(e&&e.end)}function Kl(e){return e&&typeof e=="number"?e:1}class rt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",s={},i=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(i=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.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=pr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rt.prototype.file="";rt.prototype.name="";rt.prototype.reason="";rt.prototype.message="";rt.prototype.stack="";rt.prototype.column=void 0;rt.prototype.line=void 0;rt.prototype.ancestors=void 0;rt.prototype.cause=void 0;rt.prototype.fatal=void 0;rt.prototype.place=void 0;rt.prototype.ruleId=void 0;rt.prototype.source=void 0;const fa={}.hasOwnProperty,uC=new Map,dC=/[A-Z]/g,fC=new Set(["table","tbody","thead","tfoot","tr"]),hC=new Set(["td","th"]),Vh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pC(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=kC(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=wC(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"?ua:tC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Wh(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function Wh(e,t,n){if(t.type==="element")return mC(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return gC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return yC(e,t,n);if(t.type==="mdxjsEsm")return xC(e,t);if(t.type==="root")return vC(e,t,n);if(t.type==="text")return bC(e,t)}function mC(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=ua,e.schema=o),e.ancestors.push(t);const s=qh(e,t.tagName,!1),i=_C(e,t);let a=pa(e,t);return fC.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!WS(c):!0})),Hh(e,i,s,t),ha(i,a),e.ancestors.pop(),e.schema=r,e.create(t,s,i,n)}function gC(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)}_r(e,t.position)}function xC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_r(e,t.position)}function yC(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=ua,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:qh(e,t.name,!0),i=SC(e,t),a=pa(e,t);return Hh(e,i,s,t),ha(i,a),e.ancestors.pop(),e.schema=r,e.create(t,s,i,n)}function vC(e,t,n){const r={};return ha(r,pa(e,t)),e.create(t,e.Fragment,r,n)}function bC(e,t){return t.value}function Hh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ha(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function wC(e,t,n){return r;function r(o,s,i,a){const u=Array.isArray(i.children)?n:t;return a?u(s,i,a):u(s,i)}}function kC(e,t){return n;function n(r,o,s,i){const a=Array.isArray(s.children),c=da(r);return t(o,s,i,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function _C(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&fa.call(t.properties,o)){const s=CC(e,o,t.properties[o]);if(s){const[i,a]=s;e.tableCellAlignToStyle&&i==="align"&&typeof a=="string"&&hC.has(t.tagName)?r=a:n[i]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function SC(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const i=s.expression;i.type;const a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else _r(e,t.position);else{const o=r.name;let s;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,s=e.evaluater.evaluateExpression(a.expression)}else _r(e,t.position);else s=r.value===null?!0:r.value;n[o]=s}return n}function pa(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:uC;for(;++r<t.children.length;){const s=t.children[r];let i;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=o.get(c)||0;i=c+"-"+u,o.set(c,u+1)}}const a=Wh(e,s,i);a!==void 0&&n.push(a)}return n}function CC(e,t,n){const r=XS(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?BS(n):nC(n)),r.property==="style"){let o=typeof n=="object"?n:jC(e,String(n));return e.stylePropertyNameCase==="css"&&(o=EC(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?GS[r.property]||r.property:r.attribute,n]}}function jC(e,t){try{return lC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new rt("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=Vh+"#cannot-parse-style-attribute",o}}function qh(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,i;for(;++s<o.length;){const a=Fl(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};i=i?{type:"MemberExpression",object:i,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=i}else r=Fl(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return fa.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);_r(e)}function _r(e,t){const n=new rt("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=Vh+"#cannot-handle-mdx-estrees-without-createevaluater",n}function EC(e){const t={};let n;for(n in e)fa.call(e,n)&&(t[NC(n)]=e[n]);return t}function NC(e){let t=e.replace(dC,TC);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function TC(e){return"-"+e.toLowerCase()}const Ss={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"]},AC={};function IC(e,t){const n=AC,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Kh(e,r,o)}function Kh(e,t,n){if(zC(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 Gl(e.children,t,n)}return Array.isArray(e)?Gl(e,t,n):""}function Gl(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Kh(e[o],t,n);return r.join("")}function zC(e){return!!(e&&typeof e=="object")}const Jl=document.createElement("i");function ma(e){const t="&"+e+";";Jl.innerHTML=t;const n=Jl.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ft(e,t,n,r){const o=e.length;let s=0,i;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);s<r.length;)i=r.slice(s,s+1e4),i.unshift(t,0),e.splice(...i),s+=1e4,t+=1e4}function vt(e,t){return e.length>0?(Ft(e,e.length,0,t),e):t}const Yl={}.hasOwnProperty;function RC(e){const t={};let n=-1;for(;++n<e.length;)PC(t,e[n]);return t}function PC(e,t){let n;for(n in t){const o=(Yl.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let i;if(s)for(i in s){Yl.call(o,i)||(o[i]=[]);const a=s[i];OC(o[i],Array.isArray(a)?a:a?[a]:[])}}}function OC(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ft(e,0,0,r)}function Gh(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 Fn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Pt=cn(/[A-Za-z]/),mt=cn(/[\dA-Za-z]/),DC=cn(/[#-'*+\--9=?A-Z^-~]/);function ci(e){return e!==null&&(e<32||e===127)}const ui=cn(/\d/),MC=cn(/[\dA-Fa-f]/),LC=cn(/[!-/:-@[-`{-~]/);function _e(e){return e!==null&&e<-2}function ct(e){return e!==null&&(e<0||e===32)}function Me(e){return e===-2||e===-1||e===32}const FC=cn(new RegExp("\\p{P}|\\p{S}","u")),BC=cn(/\s/);function cn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function nr(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let i="";if(s===37&&mt(e.charCodeAt(n+1))&&mt(e.charCodeAt(n+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(i=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(i=String.fromCharCode(s,a),o=1):i="�"}else i=String.fromCharCode(s);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function $e(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let s=0;return i;function i(c){return Me(c)?(e.enter(n),a(c)):t(c)}function a(c){return Me(c)&&s++<o?(e.consume(c),a):(e.exit(n),t(c))}}const $C={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"),$e(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),s(a)}function s(a){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,i(a)}function i(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return _e(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),i)}}const ZC={tokenize:VC},Xl={tokenize:WC};function VC(e){const t=this,n=[];let r=0,o,s,i;return a;function a(k){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(k)}return u(k)}function c(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const S=t.events.length;let j=S,C;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){C=t.events[j][1].end;break}g(r);let E=S;for(;E<t.events.length;)t.events[E][1].end={...C},E++;return Ft(t.events,j+1,0,t.events.slice(S)),t.events.length=E,u(k)}return a(k)}function u(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(Xl,d,h)(k)}function d(k){return o&&b(),g(r),p(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,i=t.now().offset,x(k)}function p(k){return t.containerState={},e.attempt(Xl,f,x)(k)}function f(k){return r++,n.push([t.currentConstruct,t.containerState]),p(k)}function x(k){if(k===null){o&&b(),g(0),e.consume(k);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),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 j=t.sliceStream(k);if(S&&j.push(null),k.previous=s,s&&(s.next=k),s=k,o.defineSkip(k.start),o.write(j),t.parser.lazy[k.start.line]){let C=o.events.length;for(;C--;)if(o.events[C][1].start.offset<i&&(!o.events[C][1].end||o.events[C][1].end.offset>i))return;const E=t.events.length;let T=E,R,M;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(R){M=t.events[T][1].end;break}R=!0}for(g(r),C=E;C<t.events.length;)t.events[C][1].end={...M},C++;Ft(t.events,T+1,0,t.events.slice(E)),t.events.length=C}}function g(k){let S=n.length;for(;S-- >k;){const j=n[S];t.containerState=j[1],j[0].exit.call(t,e)}n.length=k}function b(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function WC(e,t,n){return $e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ql(e){if(e===null||ct(e)||BC(e))return 1;if(FC(e))return 2}function ga(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const di={name:"attention",resolveAll:HC,tokenize:qC};function HC(e,t){let n=-1,r,o,s,i,a,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},p={...e[n][1].start};ec(h,-c),ec(p,c),i={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:c>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[r][1].end={...i.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=vt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=vt(u,[["enter",o,t],["enter",i,t],["exit",i,t],["enter",s,t]]),u=vt(u,ga(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=vt(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=vt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Ft(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function qC(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Ql(r);let s;return i;function i(c){return s=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===s)return e.consume(c),a;const u=e.exit("attentionSequence"),d=Ql(c),h=!d||d===2&&o||n.includes(c),p=!o||o===2&&d||n.includes(r);return u._open=!!(s===42?h:h&&(o||!p)),u._close=!!(s===42?p:p&&(d||!h)),t(c)}}function ec(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const KC={name:"autolink",tokenize:GC};function GC(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"),s}function s(f){return Pt(f)?(e.consume(f),i):f===64?n(f):u(f)}function i(f){return f===43||f===45||f===46||mt(f)?(r=1,a(f)):u(f)}function a(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||mt(f))&&r++<32?(e.consume(f),a):(r=0,u(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||ci(f)?n(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),d):DC(f)?(e.consume(f),u):n(f)}function d(f){return mt(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):p(f)}function p(f){if((f===45||mt(f))&&r++<63){const x=f===45?p:h;return e.consume(f),x}return n(f)}}const Jo={partial:!0,tokenize:JC};function JC(e,t,n){return r;function r(s){return Me(s)?$e(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||_e(s)?t(s):n(s)}}const Jh={continuation:{tokenize:XC},exit:QC,name:"blockQuote",tokenize:YC};function YC(e,t,n){const r=this;return o;function o(i){if(i===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),s}return n(i)}function s(i){return Me(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function XC(e,t,n){const r=this;return o;function o(i){return Me(i)?$e(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):s(i)}function s(i){return e.attempt(Jh,t,n)(i)}}function QC(e){e.exit("blockQuote")}const Yh={name:"characterEscape",tokenize:e5};function e5(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return LC(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Xh={name:"characterReference",tokenize:t5};function t5(e,t,n){const r=this;let o=0,s,i;return a;function a(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,i=mt,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,i=MC,d):(e.enter("characterReferenceValue"),s=7,i=ui,d(h))}function d(h){if(h===59&&o){const p=e.exit("characterReferenceValue");return i===mt&&!ma(r.sliceSerialize(p))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(h)&&o++<s?(e.consume(h),d):n(h)}}const tc={partial:!0,tokenize:r5},nc={concrete:!0,name:"codeFenced",tokenize:n5};function n5(e,t,n){const r=this,o={partial:!0,tokenize:j};let s=0,i=0,a;return c;function c(C){return u(C)}function u(C){const E=r.events[r.events.length-1];return s=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===a?(i++,e.consume(C),d):i<3?n(C):(e.exit("codeFencedFenceSequence"),Me(C)?$e(e,h,"whitespace")(C):h(C))}function h(C){return C===null||_e(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(tc,m,S)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===null||_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(C)):Me(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$e(e,f,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),p)}function f(C){return C===null||_e(C)?h(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||_e(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(C)):C===96&&C===a?n(C):(e.consume(C),x)}function m(C){return e.attempt(o,S,y)(C)}function y(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),g}function g(C){return s>0&&Me(C)?$e(e,b,"linePrefix",s+1)(C):b(C)}function b(C){return C===null||_e(C)?e.check(tc,m,S)(C):(e.enter("codeFlowValue"),k(C))}function k(C){return C===null||_e(C)?(e.exit("codeFlowValue"),b(C)):(e.consume(C),k)}function S(C){return e.exit("codeFenced"),t(C)}function j(C,E,T){let R=0;return M;function M(D){return C.enter("lineEnding"),C.consume(D),C.exit("lineEnding"),B}function B(D){return C.enter("codeFencedFence"),Me(D)?$e(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):N(D)}function N(D){return D===a?(C.enter("codeFencedFenceSequence"),O(D)):T(D)}function O(D){return D===a?(R++,C.consume(D),O):R>=i?(C.exit("codeFencedFenceSequence"),Me(D)?$e(C,w,"whitespace")(D):w(D)):T(D)}function w(D){return D===null||_e(D)?(C.exit("codeFencedFence"),E(D)):T(D)}}}function r5(e,t,n){const r=this;return o;function o(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s)}function s(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}const Cs={name:"codeIndented",tokenize:s5},o5={partial:!0,tokenize:i5};function s5(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),$e(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?i(u):n(u)}function i(u){return u===null?c(u):_e(u)?e.attempt(o5,i,c)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||_e(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),a)}function c(u){return e.exit("codeIndented"),t(u)}}function i5(e,t,n){const r=this;return o;function o(i){return r.parser.lazy[r.now().line]?n(i):_e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):$e(e,s,"linePrefix",5)(i)}function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):_e(i)?o(i):n(i)}}const a5={name:"codeText",previous:c5,resolve:l5,tokenize:u5};function l5(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 c5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u5(e,t,n){let r=0,o,s;return i;function i(h){return e.enter("codeText"),e.enter("codeTextSequence"),a(h)}function a(h){return h===96?(e.consume(h),r++,a):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(s=e.enter("codeTextSequence"),o=0,d(h)):_e(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||_e(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",u(h))}}class d5{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 s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&lr(this.left,r),s.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),lr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),lr(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);lr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);lr(this.left,n.reverse())}}}function lr(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 Qh(e){const t={};let n=-1,r,o,s,i,a,c,u;const d=new d5(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,f5(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,o=void 0;s--;)if(i=d.get(s),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),i[1].type="lineEnding",o=s);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},a=d.slice(o,n),a.unshift(r),d.splice(o,n-o+1,a))}}return Ft(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function f5(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const s=[];let i=n._tokenizer;i||(i=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const a=i.events,c=[],u={};let d,h,p=-1,f=n,x=0,m=0;const y=[m];for(;f;){for(;e.get(++o)[1]!==f;);s.push(o),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&i.defineSkip(f.start),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),f._isInFirstContentOfListItem&&(i._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(i.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]),b=s.pop();c.push([b,b+g.length-1]),e.splice(b,2,g)}for(c.reverse(),p=-1;++p<c.length;)u[x+c[p][0]]=x+c[p][1],x+=c[p][1]-c[p][0]-1;return u}const h5={resolve:m5,tokenize:g5},p5={partial:!0,tokenize:x5};function m5(e){return Qh(e),e}function g5(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?s(a):_e(a)?e.check(p5,i,s)(a):(e.consume(a),o)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function i(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function x5(e,t,n){const r=this;return o;function o(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),$e(e,s,"linePrefix")}function s(i){if(i===null||_e(i))return n(i);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(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ep(e,t,n,r,o,s,i,a,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(g){return g===60?(e.enter(r),e.enter(o),e.enter(s),e.consume(g),e.exit(s),p):g===null||g===32||g===41||ci(g)?n(g):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function p(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),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!d&&(g===null||g===41||ct(g))?(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(g)):d<u&&g===40?(e.consume(g),d++,m):g===41?(e.consume(g),d--,m):g===null||g===32||g===40||ci(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 tp(e,t,n,r,o,s){const i=this;let a=0,c;return u;function u(f){return e.enter(r),e.enter(o),e.consume(f),e.exit(o),e.enter(s),d}function d(f){return a>999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in i.parser.constructs?n(f):f===93?(e.exit(s),e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):_e(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||_e(f)||a++>999?(e.exit("chunkString"),d(f)):(e.consume(f),c||(c=!Me(f)),f===92?p:h)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,h):h(f)}}function np(e,t,n,r,o,s){let i;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),i=p===40?41:p,c):n(p)}function c(p){return p===i?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(s),u(p))}function u(p){return p===i?(e.exit(s),c(i)):p===null?n(p):_e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),$e(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===i||p===null||_e(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?h:d)}function h(p){return p===i||p===92?(e.consume(p),d):d(p)}}function mr(e,t){let n;return r;function r(o){return _e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Me(o)?$e(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const y5={name:"definition",tokenize:b5},v5={partial:!0,tokenize:w5};function b5(e,t,n){const r=this;let o;return s;function s(f){return e.enter("definition"),i(f)}function i(f){return tp.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return o=Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return ct(f)?mr(e,u)(f):u(f)}function u(f){return ep(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(v5,h,h)(f)}function h(f){return Me(f)?$e(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 w5(e,t,n){return r;function r(a){return ct(a)?mr(e,o)(a):n(a)}function o(a){return np(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Me(a)?$e(e,i,"whitespace")(a):i(a)}function i(a){return a===null||_e(a)?t(a):n(a)}}const k5={name:"hardBreakEscape",tokenize:_5};function _5(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return _e(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const S5={name:"headingAtx",resolve:C5,tokenize:j5};function C5(e,t){let n=e.length-2,r=3,o,s;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},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ft(e,r,n-r+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function j5(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),i(d)}function i(d){return d===35&&r++<6?(e.consume(d),i):d===null||ct(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||_e(d)?(e.exit("atxHeading"),t(d)):Me(d)?$e(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||ct(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const E5=["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"],rc=["pre","script","style","textarea"],N5={concrete:!0,name:"htmlFlow",resolveTo:I5,tokenize:z5},T5={partial:!0,tokenize:P5},A5={partial:!0,tokenize:R5};function I5(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 z5(e,t,n){const r=this;let o,s,i,a,c;return u;function u(I){return d(I)}function d(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),p):I===47?(e.consume(I),s=!0,m):I===63?(e.consume(I),o=3,r.interrupt?t:A):Pt(I)?(e.consume(I),i=String.fromCharCode(I),y):n(I)}function p(I){return I===45?(e.consume(I),o=2,f):I===91?(e.consume(I),o=5,a=0,x):Pt(I)?(e.consume(I),o=4,r.interrupt?t:A):n(I)}function f(I){return I===45?(e.consume(I),r.interrupt?t:A):n(I)}function x(I){const oe="CDATA[";return I===oe.charCodeAt(a++)?(e.consume(I),a===oe.length?r.interrupt?t:N:x):n(I)}function m(I){return Pt(I)?(e.consume(I),i=String.fromCharCode(I),y):n(I)}function y(I){if(I===null||I===47||I===62||ct(I)){const oe=I===47,J=i.toLowerCase();return!oe&&!s&&rc.includes(J)?(o=1,r.interrupt?t(I):N(I)):E5.includes(i.toLowerCase())?(o=6,oe?(e.consume(I),g):r.interrupt?t(I):N(I)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):s?b(I):k(I))}return I===45||mt(I)?(e.consume(I),i+=String.fromCharCode(I),y):n(I)}function g(I){return I===62?(e.consume(I),r.interrupt?t:N):n(I)}function b(I){return Me(I)?(e.consume(I),b):M(I)}function k(I){return I===47?(e.consume(I),M):I===58||I===95||Pt(I)?(e.consume(I),S):Me(I)?(e.consume(I),k):M(I)}function S(I){return I===45||I===46||I===58||I===95||mt(I)?(e.consume(I),S):j(I)}function j(I){return I===61?(e.consume(I),C):Me(I)?(e.consume(I),j):k(I)}function C(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),c=I,E):Me(I)?(e.consume(I),C):T(I)}function E(I){return I===c?(e.consume(I),c=null,R):I===null||_e(I)?n(I):(e.consume(I),E)}function T(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ct(I)?j(I):(e.consume(I),T)}function R(I){return I===47||I===62||Me(I)?k(I):n(I)}function M(I){return I===62?(e.consume(I),B):n(I)}function B(I){return I===null||_e(I)?N(I):Me(I)?(e.consume(I),B):n(I)}function N(I){return I===45&&o===2?(e.consume(I),X):I===60&&o===1?(e.consume(I),W):I===62&&o===4?(e.consume(I),V):I===63&&o===3?(e.consume(I),A):I===93&&o===5?(e.consume(I),Y):_e(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(T5,Z,O)(I)):I===null||_e(I)?(e.exit("htmlFlowData"),O(I)):(e.consume(I),N)}function O(I){return e.check(A5,w,Z)(I)}function w(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),D}function D(I){return I===null||_e(I)?O(I):(e.enter("htmlFlowData"),N(I))}function X(I){return I===45?(e.consume(I),A):N(I)}function W(I){return I===47?(e.consume(I),i="",H):N(I)}function H(I){if(I===62){const oe=i.toLowerCase();return rc.includes(oe)?(e.consume(I),V):N(I)}return Pt(I)&&i.length<8?(e.consume(I),i+=String.fromCharCode(I),H):N(I)}function Y(I){return I===93?(e.consume(I),A):N(I)}function A(I){return I===62?(e.consume(I),V):I===45&&o===2?(e.consume(I),A):N(I)}function V(I){return I===null||_e(I)?(e.exit("htmlFlowData"),Z(I)):(e.consume(I),V)}function Z(I){return e.exit("htmlFlow"),t(I)}}function R5(e,t,n){const r=this;return o;function o(i){return _e(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):n(i)}function s(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}function P5(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Jo,t,n)}}const O5={name:"htmlText",tokenize:D5};function D5(e,t,n){const r=this;let o,s,i;return a;function a(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),c}function c(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),j):A===63?(e.consume(A),k):Pt(A)?(e.consume(A),T):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),s=0,x):Pt(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),f):n(A)}function h(A){return A===null?n(A):A===45?(e.consume(A),p):_e(A)?(i=h,W(A)):(e.consume(A),h)}function p(A){return A===45?(e.consume(A),f):h(A)}function f(A){return A===62?X(A):A===45?p(A):h(A)}function x(A){const V="CDATA[";return A===V.charCodeAt(s++)?(e.consume(A),s===V.length?m:x):n(A)}function m(A){return A===null?n(A):A===93?(e.consume(A),y):_e(A)?(i=m,W(A)):(e.consume(A),m)}function y(A){return A===93?(e.consume(A),g):m(A)}function g(A){return A===62?X(A):A===93?(e.consume(A),g):m(A)}function b(A){return A===null||A===62?X(A):_e(A)?(i=b,W(A)):(e.consume(A),b)}function k(A){return A===null?n(A):A===63?(e.consume(A),S):_e(A)?(i=k,W(A)):(e.consume(A),k)}function S(A){return A===62?X(A):k(A)}function j(A){return Pt(A)?(e.consume(A),C):n(A)}function C(A){return A===45||mt(A)?(e.consume(A),C):E(A)}function E(A){return _e(A)?(i=E,W(A)):Me(A)?(e.consume(A),E):X(A)}function T(A){return A===45||mt(A)?(e.consume(A),T):A===47||A===62||ct(A)?R(A):n(A)}function R(A){return A===47?(e.consume(A),X):A===58||A===95||Pt(A)?(e.consume(A),M):_e(A)?(i=R,W(A)):Me(A)?(e.consume(A),R):X(A)}function M(A){return A===45||A===46||A===58||A===95||mt(A)?(e.consume(A),M):B(A)}function B(A){return A===61?(e.consume(A),N):_e(A)?(i=B,W(A)):Me(A)?(e.consume(A),B):R(A)}function N(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),o=A,O):_e(A)?(i=N,W(A)):Me(A)?(e.consume(A),N):(e.consume(A),w)}function O(A){return A===o?(e.consume(A),o=void 0,D):A===null?n(A):_e(A)?(i=O,W(A)):(e.consume(A),O)}function w(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||ct(A)?R(A):(e.consume(A),w)}function D(A){return A===47||A===62||ct(A)?R(A):n(A)}function X(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function W(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),H}function H(A){return Me(A)?$e(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):Y(A)}function Y(A){return e.enter("htmlTextData"),i(A)}}const xa={name:"labelEnd",resolveAll:B5,resolveTo:$5,tokenize:U5},M5={tokenize:Z5},L5={tokenize:V5},F5={tokenize:W5};function B5(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&&Ft(e,0,e.length,n),e}function $5(e,t){let n=e.length,r=0,o,s,i,a;for(;n--;)if(o=e[n][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(i=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[i][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[i-2][1].start}};return a=[["enter",c,t],["enter",u,t]],a=vt(a,e.slice(s+1,s+r+3)),a=vt(a,[["enter",d,t]]),a=vt(a,ga(t.parser.constructs.insideSpan.null,e.slice(s+r+4,i-3),t)),a=vt(a,[["exit",d,t],e[i-2],e[i-1],["exit",u,t]]),a=vt(a,e.slice(i+1)),a=vt(a,[["exit",c,t]]),Ft(e,s,e.length,a),e}function U5(e,t,n){const r=this;let o=r.events.length,s,i;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){s=r.events[o][1];break}return a;function a(p){return s?s._inactive?h(p):(i=r.parser.defined.includes(Fn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),c):n(p)}function c(p){return p===40?e.attempt(M5,d,i?d:h)(p):p===91?e.attempt(L5,d,i?u:h)(p):i?d(p):h(p)}function u(p){return e.attempt(F5,d,h)(p)}function d(p){return t(p)}function h(p){return s._balanced=!0,n(p)}}function Z5(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 ct(h)?mr(e,s)(h):s(h)}function s(h){return h===41?d(h):ep(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function i(h){return ct(h)?mr(e,c)(h):d(h)}function a(h){return n(h)}function c(h){return h===34||h===39||h===40?np(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return ct(h)?mr(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function V5(e,t,n){const r=this;return o;function o(a){return tp.call(r,e,s,i,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function i(a){return n(a)}}function W5(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const H5={name:"labelStartImage",resolveAll:xa.resolveAll,tokenize:q5};function q5(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),i):n(a)}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const K5={name:"labelStartLink",resolveAll:xa.resolveAll,tokenize:G5};function G5(e,t,n){const r=this;return o;function o(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),s}function s(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(i):t(i)}}const js={name:"lineEnding",tokenize:J5};function J5(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),$e(e,t,"linePrefix")}}const eo={name:"thematicBreak",tokenize:Y5};function Y5(e,t,n){let r=0,o;return s;function s(u){return e.enter("thematicBreak"),i(u)}function i(u){return o=u,a(u)}function a(u){return u===o?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||_e(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===o?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),Me(u)?$e(e,a,"whitespace")(u):a(u))}}const it={continuation:{tokenize:tj},exit:rj,name:"list",tokenize:ej},X5={partial:!0,tokenize:oj},Q5={partial:!0,tokenize:nj};function ej(e,t,n){const r=this,o=r.events[r.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,i=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:ui(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(eo,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return ui(f)&&++i<10?(e.consume(f),c):(!r.interrupt||i<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Jo,r.interrupt?n:d,e.attempt(X5,p,h))}function d(f){return r.containerState.initialBlankLine=!0,s++,p(f)}function h(f){return Me(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function tj(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Jo,o,s);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$e(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Me(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Q5,t,i)(a))}function i(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,$e(e,e.attempt(it,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function nj(e,t,n){const r=this;return $e(e,o,"listItemIndent",r.containerState.size+1);function o(s){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(s):n(s)}}function rj(e){e.exit(this.containerState.type)}function oj(e,t,n){const r=this;return $e(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const i=r.events[r.events.length-1];return!Me(s)&&i&&i[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const oc={name:"setextUnderline",resolveTo:sj,tokenize:ij};function sj(e,t){let n=e.length,r,o,s;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),!s&&e[n][1].type==="definition"&&(s=n);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",i,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=i,e.push(["exit",i,t]),e}function ij(e,t,n){const r=this;let o;return s;function s(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),o=u,i(u)):n(u)}function i(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Me(u)?$e(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||_e(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const aj={tokenize:lj};function lj(e){const t=this,n=e.attempt(Jo,r,e.attempt(this.parser.constructs.flowInitial,o,$e(e,e.attempt(this.parser.constructs.flow,o,e.attempt(h5,o)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cj={resolveAll:op()},uj=rp("string"),dj=rp("text");function rp(e){return{resolveAll:op(e==="text"?fj:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],s=n.attempt(o,i,a);return i;function i(d){return u(d)?s(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const h=o[d];let p=-1;if(h)for(;++p<h.length;){const f=h[p];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function op(e){return t;function t(n,r){let o=-1,s;for(;++o<=n.length;)s===void 0?n[o]&&n[o][1].type==="data"&&(s=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==s+2&&(n[s][1].end=n[o-1][1].end,n.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(n,r):n}}function fj(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 s=o.length,i=-1,a=0,c;for(;s--;){const u=o[s];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)a++,i--;if(i)break;i=-1}else if(u===-2)c=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?i:r.start._bufferIndex+i,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const hj={42:it,43:it,45:it,48:it,49:it,50:it,51:it,52:it,53:it,54:it,55:it,56:it,57:it,62:Jh},pj={91:y5},mj={[-2]:Cs,[-1]:Cs,32:Cs},gj={35:S5,42:eo,45:[oc,eo],60:N5,61:oc,95:eo,96:nc,126:nc},xj={38:Xh,92:Yh},yj={[-5]:js,[-4]:js,[-3]:js,33:H5,38:Xh,42:di,60:[KC,O5],91:K5,92:[k5,Yh],93:xa,95:di,96:a5},vj={null:[di,cj]},bj={null:[42,95]},wj={null:[]},kj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bj,contentInitial:pj,disable:wj,document:hj,flow:gj,flowInitial:mj,insideSpan:vj,string:xj,text:yj},Symbol.toStringTag,{value:"Module"}));function _j(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={},s=[];let i=[],a=[];const c={attempt:E(j),check:E(C),consume:b,enter:k,exit:S,interrupt:E(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:x,parser:e,previous:null,sliceSerialize:p,sliceStream:f,write:h};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function h(B){return i=vt(i,B),y(),i[i.length-1]!==null?[]:(T(t,0),u.events=ga(s,u.events,u),u.events)}function p(B,N){return Cj(f(B),N)}function f(B){return Sj(i,B)}function x(){const{_bufferIndex:B,_index:N,line:O,column:w,offset:D}=r;return{_bufferIndex:B,_index:N,line:O,column:w,offset:D}}function m(B){o[B.line]=B.column,M()}function y(){let B;for(;r._index<i.length;){const N=i[r._index];if(typeof N=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<N.length;)g(N.charCodeAt(r._bufferIndex));else g(N)}}function g(B){d=d(B)}function b(B){_e(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,M()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=B}function k(B,N){const O=N||{};return O.type=B,O.start=x(),u.events.push(["enter",O,u]),a.push(O),O}function S(B){const N=a.pop();return N.end=x(),u.events.push(["exit",N,u]),N}function j(B,N){T(B,N.from)}function C(B,N){N.restore()}function E(B,N){return O;function O(w,D,X){let W,H,Y,A;return Array.isArray(w)?Z(w):"tokenize"in w?Z([w]):V(w);function V(de){return te;function te(ce){const fe=ce!==null&&de[ce],ge=ce!==null&&de.null,xe=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return Z(xe)(ce)}}function Z(de){return W=de,H=0,de.length===0?X:I(de[H])}function I(de){return te;function te(ce){return A=R(),Y=de,de.partial||(u.currentConstruct=de),de.name&&u.parser.constructs.disable.null.includes(de.name)?J():de.tokenize.call(N?Object.assign(Object.create(u),N):u,c,oe,J)(ce)}}function oe(de){return B(Y,A),D}function J(de){return A.restore(),++H<W.length?I(W[H]):X}}}function T(B,N){B.resolveAll&&!s.includes(B)&&s.push(B),B.resolve&&Ft(u.events,N,u.events.length-N,B.resolve(u.events.slice(N),u)),B.resolveTo&&(u.events=B.resolveTo(u.events,u))}function R(){const B=x(),N=u.previous,O=u.currentConstruct,w=u.events.length,D=Array.from(a);return{from:w,restore:X};function X(){r=B,u.previous=N,u.currentConstruct=O,u.events.length=w,a=D,M()}}function M(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Sj(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,s)];else{if(i=e.slice(n,o),r>-1){const a=i[0];typeof a=="string"?i[0]=a.slice(r):i.shift()}s>0&&i.push(e[o].slice(0,s))}return i}function Cj(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const s=e[n];let i;if(typeof s=="string")i=s;else switch(s){case-5:{i="\r";break}case-4:{i=`
|
|
86
|
+
`;break}case-3:{i=`\r
|
|
87
|
+
`;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&o)continue;i=" ";break}default:i=String.fromCharCode(s)}o=s===-2,r.push(i)}return r.join("")}function jj(e){const r={constructs:RC([kj,...(e||{}).extensions||[]]),content:o($C),defined:[],document:o(ZC),flow:o(aj),lazy:{},string:o(uj),text:o(dj)};return r;function o(s){return i;function i(a){return _j(r,s,a)}}}function Ej(e){for(;!Qh(e););return e}const sc=/[\0\t\n\r]/g;function Nj(){let e=1,t="",n=!0,r;return o;function o(s,i,a){const c=[];let u,d,h,p,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(i||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(sc.lastIndex=h,u=sc.exec(s),p=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(p),!u){t=s.slice(h);break}if(f===10&&h===p&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<p&&(c.push(s.slice(h,p)),e+=p-h),f){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=p+1}return a&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Tj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Aj(e){return e.replace(Tj,Ij)}function Ij(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return Gh(n.slice(s?2:1),s?16:10)}return ma(n)||e}const sp={}.hasOwnProperty;function zj(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Rj(n)(Ej(jj(n).document().write(Nj()(e,t,!0))))}function Rj(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(L),autolinkProtocol:R,autolinkEmail:R,atxHeading:s(ee),blockQuote:s(ge),characterEscape:R,characterReference:R,codeFenced:s(xe),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:s(xe,i),codeText:s(Ee,i),codeTextData:R,data:R,codeFlowValue:R,definition:s(Fe),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:s(_),hardBreakEscape:s(K),hardBreakTrailing:s(K),htmlFlow:s(P,i),htmlFlowData:R,htmlText:s(P,i),htmlTextData:R,image:s(z),label:i,link:s(L),listItem:s(G),listItemValue:p,listOrdered:s($,h),listUnordered:s($),paragraph:s(F),reference:I,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:s(ee),strong:s(ne),thematicBreak:s(se)},exit:{atxHeading:c(),atxHeadingSequence:j,autolink:c(),autolinkEmail:fe,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:de,characterReference:te,codeFenced:c(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:c(g),codeText:c(D),codeTextData:M,data:M,definition:c(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:k,emphasis:c(),hardBreakEscape:c(N),hardBreakTrailing:c(N),htmlFlow:c(O),htmlFlowData:M,htmlText:c(w),htmlTextData:M,image:c(W),label:Y,labelText:H,lineEnding:B,link:c(X),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:A,resourceTitleString:V,resource:Z,setextHeading:c(T),setextHeadingLineSequence:E,setextHeadingText:C,strong:c(),thematicBreak:c()}};ip(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let re={type:"root",children:[]};const ue={stack:[re],tokenStack:[],config:t,enter:a,exit:u,buffer:i,resume:d,data:n},be=[];let Pe=-1;for(;++Pe<U.length;)if(U[Pe][1].type==="listOrdered"||U[Pe][1].type==="listUnordered")if(U[Pe][0]==="enter")be.push(Pe);else{const qe=be.pop();Pe=o(U,qe,Pe)}for(Pe=-1;++Pe<U.length;){const qe=t[U[Pe][0]];sp.call(qe,U[Pe][1].type)&&qe[U[Pe][1].type].call(Object.assign({sliceSerialize:U[Pe][2].sliceSerialize},ue),U[Pe][1])}if(ue.tokenStack.length>0){const qe=ue.tokenStack[ue.tokenStack.length-1];(qe[1]||ic).call(ue,void 0,qe[0])}for(re.position={start:Yt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Yt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Pe=-1;++Pe<t.transforms.length;)re=t.transforms[Pe](re)||re;return re}function o(U,re,ue){let be=re-1,Pe=-1,qe=!1,ft,De,It,Ut;for(;++be<=ue;){const We=U[be];switch(We[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{We[0]==="enter"?Pe++:Pe--,Ut=void 0;break}case"lineEndingBlank":{We[0]==="enter"&&(ft&&!Ut&&!Pe&&!It&&(It=be),Ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ut=void 0}if(!Pe&&We[0]==="enter"&&We[1].type==="listItemPrefix"||Pe===-1&&We[0]==="exit"&&(We[1].type==="listUnordered"||We[1].type==="listOrdered")){if(ft){let Zt=be;for(De=void 0;Zt--;){const Ct=U[Zt];if(Ct[1].type==="lineEnding"||Ct[1].type==="lineEndingBlank"){if(Ct[0]==="exit")continue;De&&(U[De][1].type="lineEndingBlank",qe=!0),Ct[1].type="lineEnding",De=Zt}else if(!(Ct[1].type==="linePrefix"||Ct[1].type==="blockQuotePrefix"||Ct[1].type==="blockQuotePrefixWhitespace"||Ct[1].type==="blockQuoteMarker"||Ct[1].type==="listItemIndent"))break}It&&(!De||It<De)&&(ft._spread=!0),ft.end=Object.assign({},De?U[De][1].start:We[1].end),U.splice(De||be,0,["exit",ft,We[2]]),be++,ue++}if(We[1].type==="listItemPrefix"){const Zt={type:"listItem",_spread:!1,start:Object.assign({},We[1].start),end:void 0};ft=Zt,U.splice(be,0,["enter",Zt,We[2]]),be++,ue++,It=void 0,Ut=!0}}}return U[re][1]._spread=qe,ue}function s(U,re){return ue;function ue(be){a.call(this,U(be),be),re&&re.call(this,be)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(U,re,ue){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([re,ue||void 0]),U.position={start:Yt(re.start),end:void 0}}function c(U){return re;function re(ue){U&&U.call(this,ue),u.call(this,ue)}}function u(U,re){const ue=this.stack.pop(),be=this.tokenStack.pop();if(be)be[0].type!==U.type&&(re?re.call(this,U,be[0]):(be[1]||ic).call(this,U,be[0]));else throw new Error("Cannot close `"+U.type+"` ("+pr({start:U.start,end:U.end})+"): it’s not open");ue.position.end=Yt(U.end)}function d(){return IC(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function p(U){if(this.data.expectingFirstListItemValue){const re=this.stack[this.stack.length-2];re.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function f(){const U=this.resume(),re=this.stack[this.stack.length-1];re.lang=U}function x(){const U=this.resume(),re=this.stack[this.stack.length-1];re.meta=U}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U.replace(/(\r?\n|\r)$/g,"")}function b(U){const re=this.resume(),ue=this.stack[this.stack.length-1];ue.label=re,ue.identifier=Fn(this.sliceSerialize(U)).toLowerCase()}function k(){const U=this.resume(),re=this.stack[this.stack.length-1];re.title=U}function S(){const U=this.resume(),re=this.stack[this.stack.length-1];re.url=U}function j(U){const re=this.stack[this.stack.length-1];if(!re.depth){const ue=this.sliceSerialize(U).length;re.depth=ue}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function E(U){const re=this.stack[this.stack.length-1];re.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function R(U){const ue=this.stack[this.stack.length-1].children;let be=ue[ue.length-1];(!be||be.type!=="text")&&(be=le(),be.position={start:Yt(U.start),end:void 0},ue.push(be)),this.stack.push(be)}function M(U){const re=this.stack.pop();re.value+=this.sliceSerialize(U),re.position.end=Yt(U.end)}function B(U){const re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=re.children[re.children.length-1];ue.position.end=Yt(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(re.type)&&(R.call(this,U),M.call(this,U))}function N(){this.data.atHardBreak=!0}function O(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U}function w(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U}function D(){const U=this.resume(),re=this.stack[this.stack.length-1];re.value=U}function X(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const re=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=re,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function W(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const re=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=re,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function H(U){const re=this.sliceSerialize(U),ue=this.stack[this.stack.length-2];ue.label=Aj(re),ue.identifier=Fn(re).toLowerCase()}function Y(){const U=this.stack[this.stack.length-1],re=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const be=U.children;ue.children=be}else ue.alt=re}function A(){const U=this.resume(),re=this.stack[this.stack.length-1];re.url=U}function V(){const U=this.resume(),re=this.stack[this.stack.length-1];re.title=U}function Z(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function oe(U){const re=this.resume(),ue=this.stack[this.stack.length-1];ue.label=re,ue.identifier=Fn(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function J(U){this.data.characterReferenceType=U.type}function de(U){const re=this.sliceSerialize(U),ue=this.data.characterReferenceType;let be;ue?(be=Gh(re,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):be=ma(re);const Pe=this.stack[this.stack.length-1];Pe.value+=be}function te(U){const re=this.stack.pop();re.position.end=Yt(U.end)}function ce(U){M.call(this,U);const re=this.stack[this.stack.length-1];re.url=this.sliceSerialize(U)}function fe(U){M.call(this,U);const re=this.stack[this.stack.length-1];re.url="mailto:"+this.sliceSerialize(U)}function ge(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function _(){return{type:"emphasis",children:[]}}function ee(){return{type:"heading",depth:0,children:[]}}function K(){return{type:"break"}}function P(){return{type:"html",value:""}}function z(){return{type:"image",title:null,url:"",alt:null}}function L(){return{type:"link",title:null,url:"",children:[]}}function $(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function G(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function F(){return{type:"paragraph",children:[]}}function ne(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}function Yt(e){return{line:e.line,column:e.column,offset:e.offset}}function ip(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ip(e,r):Pj(e,r)}}function Pj(e,t){let n;for(n in t)if(sp.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 ic(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+pr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+pr({start:t.start,end:t.end})+") is still open")}function Oj(e){const t=this;t.parser=n;function n(r){return zj(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Dj(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 Mj(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
88
|
+
`}]}function Lj(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 s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Fj(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bj(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $j(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=nr(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=s+1,a+=1,e.footnoteCounts.set(r,a);const c={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(i)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Uj(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 Zj(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ap(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),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&i.type==="text"?i.value+=r:o.push({type:"text",value:r}),o}function Vj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ap(e,t);const o={src:nr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function Wj(e,t){const n={src:nr(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 Hj(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 qj(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ap(e,t);const o={href:nr(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Kj(e,t){const n={href:nr(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 Gj(e,t,n){const r=e.all(t),o=n?Jj(n):lp(t),s={},i=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(o||a!==0||d.type!=="element"||d.tagName!=="p")&&i.push({type:"text",value:`
|
|
90
|
+
`}),d.type==="element"&&d.tagName==="p"&&!o?i.push(...d.children):i.push(d)}const c=r[r.length-1];c&&(o||c.type!=="element"||c.tagName!=="p")&&i.push({type:"text",value:`
|
|
91
|
+
`});const u={type:"element",tagName:"li",properties:s,children:i};return e.patch(t,u),e.applyData(t,u)}function Jj(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=lp(n[r])}return t}function lp(e){const t=e.spread;return t??e.children.length>1}function Yj(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 i=r[o];if(i.type==="element"&&i.tagName==="li"&&i.properties&&Array.isArray(i.properties.className)&&i.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Xj(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qj(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function e3(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t3(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const i={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],i),o.push(i)}if(n.length>0){const i={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=da(t.children[1]),c=Uh(t.children[t.children.length-1]);a&&c&&(i.position={start:a,end:c}),o.push(i)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function n3(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",i=n&&n.type==="table"?n.align:void 0,a=i?i.length:t.children.length;let c=-1;const u=[];for(;++c<a;){const h=t.children[c],p={},f=i?i[c]:void 0;f&&(p.align=f);let x={type:"element",tagName:s,properties:p,children:[]};h&&(x.children=e.all(h),e.patch(h,x),x=e.applyData(h,x)),u.push(x)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function r3(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ac=9,lc=32;function o3(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const s=[];for(;r;)s.push(cc(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return s.push(cc(t.slice(o),o>0,!1)),s.join("")}function cc(e,t,n){let r=0,o=e.length;if(t){let s=e.codePointAt(r);for(;s===ac||s===lc;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(o-1);for(;s===ac||s===lc;)o--,s=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function s3(e,t){const n={type:"text",value:o3(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function i3(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const a3={blockquote:Dj,break:Mj,code:Lj,delete:Fj,emphasis:Bj,footnoteReference:$j,heading:Uj,html:Zj,imageReference:Vj,image:Wj,inlineCode:Hj,linkReference:qj,link:Kj,listItem:Gj,list:Yj,paragraph:Xj,root:Qj,strong:e3,table:t3,tableCell:r3,tableRow:n3,text:s3,thematicBreak:i3,toml:Wr,yaml:Wr,definition:Wr,footnoteDefinition:Wr};function Wr(){}const cp=-1,Yo=0,gr=1,bo=2,ya=3,va=4,ba=5,wa=6,up=7,dp=8,uc=typeof self=="object"?self:globalThis,l3=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),r=o=>{if(e.has(o))return e.get(o);const[s,i]=t[o];switch(s){case Yo:case cp:return n(i,o);case gr:{const a=n([],o);for(const c of i)a.push(r(c));return a}case bo:{const a=n({},o);for(const[c,u]of i)a[r(c)]=r(u);return a}case ya:return n(new Date(i),o);case va:{const{source:a,flags:c}=i;return n(new RegExp(a,c),o)}case ba:{const a=n(new Map,o);for(const[c,u]of i)a.set(r(c),r(u));return a}case wa:{const a=n(new Set,o);for(const c of i)a.add(r(c));return a}case up:{const{name:a,message:c}=i;return n(new uc[a](c),o)}case dp:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:a}=new Uint8Array(i);return n(new DataView(a),i)}}return n(new uc[s](i),o)};return r},dc=e=>l3(new Map,e)(0),Tn="",{toString:c3}={},{keys:u3}=Object,cr=e=>{const t=typeof e;if(t!=="object"||!e)return[Yo,t];const n=c3.call(e).slice(8,-1);switch(n){case"Array":return[gr,Tn];case"Object":return[bo,Tn];case"Date":return[ya,Tn];case"RegExp":return[va,Tn];case"Map":return[ba,Tn];case"Set":return[wa,Tn];case"DataView":return[gr,n]}return n.includes("Array")?[gr,n]:n.includes("Error")?[up,n]:[bo,n]},Hr=([e,t])=>e===Yo&&(t==="function"||t==="symbol"),d3=(e,t,n,r)=>{const o=(i,a)=>{const c=r.push(i)-1;return n.set(a,c),c},s=i=>{if(n.has(i))return n.get(i);let[a,c]=cr(i);switch(a){case Yo:{let d=i;switch(c){case"bigint":a=dp,d=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return o([cp],i)}return o([a,d],i)}case gr:{if(c){let p=i;return c==="DataView"?p=new Uint8Array(i.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(i)),o([c,[...p]],i)}const d=[],h=o([a,d],i);for(const p of i)d.push(s(p));return h}case bo:{if(c)switch(c){case"BigInt":return o([c,i.toString()],i);case"Boolean":case"Number":case"String":return o([c,i.valueOf()],i)}if(t&&"toJSON"in i)return s(i.toJSON());const d=[],h=o([a,d],i);for(const p of u3(i))(e||!Hr(cr(i[p])))&&d.push([s(p),s(i[p])]);return h}case ya:return o([a,i.toISOString()],i);case va:{const{source:d,flags:h}=i;return o([a,{source:d,flags:h}],i)}case ba:{const d=[],h=o([a,d],i);for(const[p,f]of i)(e||!(Hr(cr(p))||Hr(cr(f))))&&d.push([s(p),s(f)]);return h}case wa:{const d=[],h=o([a,d],i);for(const p of i)(e||!Hr(cr(p)))&&d.push(s(p));return h}}const{message:u}=i;return o([a,{name:c,message:u}],i)};return s},fc=(e,{json:t,lossy:n}={})=>{const r=[];return d3(!(t||n),!!t,new Map,r)(e),r},wo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?dc(fc(e,t)):structuredClone(e):(e,t)=>dc(fc(e,t));function f3(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 h3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function p3(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||f3,r=e.options.footnoteBackLabel||h3,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),p=nr(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 b=typeof n=="string"?n:n(c,f);typeof b=="string"&&(b={type:"text",value:b}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=d[d.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...x)}else d.push(...x);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...wo(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
92
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
93
|
+
`}]}}const fp=(function(e){if(e==null)return y3;if(typeof e=="function")return Xo(e);if(typeof e=="object")return Array.isArray(e)?m3(e):g3(e);if(typeof e=="string")return x3(e);throw new Error("Expected function, string, or object as test")});function m3(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fp(e[n]);return Xo(r);function r(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function g3(e){const t=e;return Xo(n);function n(r){const o=r;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function x3(e){return Xo(t);function t(n){return n&&n.type===e}}function Xo(e){return t;function t(n,r,o){return!!(v3(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function y3(){return!0}function v3(e){return e!==null&&typeof e=="object"&&"type"in e}const hp=[],b3=!0,hc=!1,w3="skip";function k3(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const s=fp(o),i=r?-1:1;a(e,void 0,[])();function a(c,u,d){const h=c&&typeof c=="object"?c:{};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 ("+(c.type+(f?"<"+f+">":""))+")"})}return p;function p(){let f=hp,x,m,y;if((!t||s(c,u,d[d.length-1]||void 0))&&(f=_3(n(c,d)),f[0]===hc))return f;if("children"in c&&c.children){const g=c;if(g.children&&f[0]!==w3)for(m=(r?g.children.length:-1)+i,y=d.concat(g);m>-1&&m<g.children.length;){const b=g.children[m];if(x=a(b,m,y)(),x[0]===hc)return x;m=typeof x[1]=="number"?x[1]:m+i}}return f}}}function _3(e){return Array.isArray(e)?e:typeof e=="number"?[b3,e]:e==null?hp:[e]}function pp(e,t,n,r){let o,s,i;typeof t=="function"&&typeof n!="function"?(s=void 0,i=t,o=n):(s=t,i=n,o=r),k3(e,s,a,o);function a(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return i(c,h,d)}}const fi={}.hasOwnProperty,S3={};function C3(e,t){const n=t||S3,r=new Map,o=new Map,s=new Map,i={...a3,...n.handlers},a={all:u,applyData:E3,definitionById:r,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:i,one:c,options:n,patch:j3,wrap:T3};return pp(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:o,p=String(d.identifier).toUpperCase();h.has(p)||h.set(p,d)}}),a;function c(d,h){const p=d.type,f=a.handlers[p];if(fi.call(a.handlers,p)&&f)return f(a,d,h);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in d){const{children:m,...y}=d,g=wo(y);return g.children=a.all(d),g}return wo(d)}return(a.options.unknownHandler||N3)(a,d,h)}function u(d){const h=[];if("children"in d){const p=d.children;let f=-1;for(;++f<p.length;){const x=a.one(p[f],d);if(x){if(f&&p[f-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=pc(x.value)),!Array.isArray(x)&&x.type==="element")){const m=x.children[0];m&&m.type==="text"&&(m.value=pc(m.value))}Array.isArray(x)?h.push(...x):h.push(x)}}}return h}}function j3(e,t){e.position&&(t.position=cC(e))}function E3(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const i="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:i}}n.type==="element"&&s&&Object.assign(n.properties,wo(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function N3(e,t){const n=t.data||{},r="value"in t&&!(fi.call(n,"hProperties")||fi.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 T3(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
94
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
95
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
96
|
+
`}),n}function pc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function mc(e,t){const n=C3(e,t),r=n.one(e,void 0),o=p3(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
97
|
+
`},o),s}function A3(e,t){return e&&"run"in e?async function(n,r){const o=mc(n,{file:r,...t});await e.run(o,r)}:function(n,r){return mc(n,{file:r,...e||t})}}function gc(e){if(e)throw e}var Es,xc;function I3(){if(xc)return Es;xc=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!h)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},i=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},a=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return Es=function c(){var u,d,h,p,f,x,m=arguments[0],y=1,g=arguments.length,b=!1;for(typeof m=="boolean"&&(b=m,m=arguments[1]||{},y=2),(m==null||typeof m!="object"&&typeof m!="function")&&(m={});y<g;++y)if(u=arguments[y],u!=null)for(d in u)h=a(m,d),p=a(u,d),m!==p&&(b&&p&&(s(p)||(f=o(p)))?(f?(f=!1,x=h&&o(h)?h:[]):x=h&&s(h)?h:{},i(m,{name:d,newValue:c(b,x,p)})):typeof p<"u"&&i(m,{name:d,newValue:p}));return m},Es}var z3=I3();const Ns=ki(z3);function hi(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 R3(){const e=[],t={run:n,use:r};return t;function n(...o){let s=-1;const i=o.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);a(null,...o);function a(c,...u){const d=e[++s];let h=-1;if(c){i(c);return}for(;++h<o.length;)(u[h]===null||u[h]===void 0)&&(u[h]=o[h]);o=u,d?P3(d,a)(...u):i(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function P3(e,t){let n;return r;function r(...i){const a=e.length>i.length;let c;a&&i.push(o);try{c=e.apply(this,i)}catch(u){const d=u;if(a&&n)throw d;return o(d)}a||(c&&c.then&&typeof c.then=="function"?c.then(s,o):c instanceof Error?o(c):s(c))}function o(i,...a){n||(n=!0,t(i,...a))}function s(i){o(null,i)}}const zt={basename:O3,dirname:D3,extname:M3,join:L3,sep:"/"};function O3(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ar(e);let n=0,r=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let i=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=i));return n===r?r=i:r<0&&(r=e.length),e.slice(n,r)}function D3(e){if(Ar(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 M3(e){Ar(e);let t=e.length,n=-1,r=0,o=-1,s=0,i;for(;t--;){const a=e.codePointAt(t);if(a===47){if(i){r=t+1;break}continue}n<0&&(i=!0,n=t+1),a===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function L3(...e){let t=-1,n;for(;++t<e.length;)Ar(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":F3(n)}function F3(e){Ar(e);const t=e.codePointAt(0)===47;let n=B3(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function B3(e,t){let n="",r=0,o=-1,s=0,i=-1,a,c;for(;++i<=e.length;){if(i<e.length)a=e.codePointAt(i);else{if(a===47)break;a=47}if(a===47){if(!(o===i-1||s===1))if(o!==i-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),o=i,s=0;continue}}else if(n.length>0){n="",r=0,o=i,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,i):n=e.slice(o+1,i),r=i-o-1;o=i,s=0}else a===46&&s>-1?s++:s=-1}return n}function Ar(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $3={cwd:U3};function U3(){return"/"}function pi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Z3(e){if(typeof e=="string")e=new URL(e);else if(!pi(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 V3(e)}function V3(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 Ts=["history","path","basename","stem","extname","dirname"];class mp{constructor(t){let n;t?pi(t)?n={path:t}:typeof t=="string"||W3(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$3.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ts.length;){const s=Ts[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)Ts.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?zt.basename(this.path):void 0}set basename(t){Is(t,"basename"),As(t,"basename"),this.path=zt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zt.dirname(this.path):void 0}set dirname(t){yc(this.basename,"dirname"),this.path=zt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zt.extname(this.path):void 0}set extname(t){if(As(t,"extname"),yc(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=zt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){pi(t)&&(t=Z3(t)),Is(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zt.basename(this.path,this.extname):void 0}set stem(t){Is(t,"stem"),As(t,"stem"),this.path=zt.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 rt(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 As(e,t){if(e&&e.includes(zt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zt.sep+"`")}function Is(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function yc(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function W3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const H3=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),q3={}.hasOwnProperty;class ka extends H3{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=R3()}copy(){const t=new ka;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ns(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Ps("data",this.frozen),this.namespace[t]=n,this):q3.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Ps("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=qr(t),r=this.parser||this.Parser;return zs("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),zs("process",this.parser||this.Parser),Rs("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,i){const a=qr(t),c=r.parse(a);r.run(c,a,function(d,h,p){if(d||!h||!p)return u(d);const f=h,x=r.stringify(f,p);J3(x)?p.value=x:p.result=x,u(d,p)});function u(d,h){d||!h?i(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),zs("processSync",this.parser||this.Parser),Rs("processSync",this.compiler||this.Compiler),this.process(t,o),bc("processSync","process",n),r;function o(s,i){n=!0,gc(s),r=i}}run(t,n,r){vc(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(i,a){const c=qr(n);o.run(t,c,u);function u(d,h,p){const f=h||t;d?a(d):i?i(f):r(void 0,f,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,s),bc("runSync","run",r),o;function s(i,a){gc(i),o=a,r=!0}}stringify(t,n){this.freeze();const r=qr(n),o=this.compiler||this.Compiler;return Rs("stringify",o),vc(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Ps("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(o.settings=Ns(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,p=-1;for(;++h<r.length;)if(r[h][0]===u){p=h;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[f,...x]=d;const m=r[p][1];hi(m)&&hi(f)&&(f=Ns(!0,m,f)),r[p]=[u,f,...x]}}}}const K3=new ka().freeze();function zs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Rs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ps(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 vc(e){if(!hi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function bc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qr(e){return G3(e)?e:new mp(e)}function G3(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function J3(e){return typeof e=="string"||Y3(e)}function Y3(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const X3="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wc=[],kc={allowDangerousHtml:!0},Q3=/^(https?|ircs?|mailto|xmpp)$/i,eE=[{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 qn(e){const t=tE(e),n=nE(e);return rE(t.runSync(t.parse(n),n),e)}function tE(e){const t=e.rehypePlugins||wc,n=e.remarkPlugins||wc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kc}:kc;return K3().use(Oj).use(n).use(A3,r).use(t)}function nE(e){const t=e.children||"",n=new mp;return typeof t=="string"&&(n.value=t),n}function rE(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,s=t.disallowedElements,i=t.skipHtml,a=t.unwrapDisallowed,c=t.urlTransform||oE;for(const d of eE)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+X3+d.id,void 0);return pp(e,u),pC(e,{Fragment:l.Fragment,components:o,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,h,p){if(d.type==="raw"&&p&&typeof h=="number")return i?p.children.splice(h,1):p.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let f;for(f in Ss)if(Object.hasOwn(Ss,f)&&Object.hasOwn(d.properties,f)){const x=d.properties[f],m=Ss[f];(m===null||m.includes(d.tagName))&&(d.properties[f]=c(String(x||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(d,h,p)),f&&p&&typeof h=="number")return a&&d.children?p.children.splice(h,1,...d.children):p.children.splice(h,1),h}}}function oE(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||Q3.test(e.slice(0,t))?e:""}function gp(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 ko(e){return e!==null&&(Array.isArray(e)||typeof e=="object")}function sE(e,t){const n=Object.getOwnPropertyDescriptor(e,t);if(n!==void 0)return n.value}function _a(e){return Array.isArray(e)?e.map((t,n)=>[String(n),t]):typeof e=="object"&&e!==null?Object.keys(e).map(t=>{const n=sE(e,t);return[t,Kn(n)]}):[]}function _c(e){return Array.isArray(e)?e.length:typeof e=="object"&&e!==null?Object.keys(e).length:0}const Sc=120;function iE({text:e}){const[t,n]=v.useState(!1);return e.length>Sc?l.jsxs("span",{className:"text-emerald-400 break-all",children:['"',t?l.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:l.jsx(qn,{children:e})}):l.jsxs(Ie,{delayDuration:300,children:[l.jsxs(ze,{onClick:o=>{o.stopPropagation(),n(!0)},className:"text-left cursor-pointer",children:[l.jsx("span",{children:e.slice(0,Sc)}),l.jsx("span",{className:"text-emerald-400/50",children:"…"})]}),l.jsxs(Re,{side:"bottom",className:"max-w-md text-xs p-2 break-words whitespace-pre-wrap",children:[e.slice(0,500),e.length>500?"…":""]})]}),'"']}):l.jsxs("span",{className:"text-emerald-400 break-all",children:['"',l.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:l.jsx(qn,{children:e})}),'"']})}function xp({value:e}){if(e===null)return l.jsx("span",{className:"text-rose-400 italic",children:"null"});switch(typeof e){case"string":return l.jsx(iE,{text:e});case"number":return l.jsx("span",{className:"text-amber-400",children:e});case"boolean":return l.jsx("span",{className:"text-blue-400",children:e?"true":"false"});case"object":case"bigint":case"symbol":case"undefined":case"function":return l.jsx("span",{className:"text-muted-foreground",children:JSON.stringify(e)})}}function Cc({value:e}){const[t,n]=v.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return l.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?l.jsx(sn,{className:"size-3 text-green-500"}):l.jsx(bn,{className:"size-3"})})}function aE({value:e}){const[t,n]=v.useState(!1);function r(o){o.stopPropagation(),window.navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>{n(!0),setTimeout(()=>{n(!1)},2e3)})}return l.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?l.jsx(sn,{className:"size-3 text-green-500"}):l.jsx(bn,{className:"size-3 text-muted-foreground"})})}function lE(e){return ko(e)?_a(e).some(([,t])=>ko(t)):!1}function cE({allExpanded:e,onClick:t}){return l.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?l.jsx(Py,{className:"size-3.5 text-muted-foreground"}):l.jsx(zy,{className:"size-3.5 text-muted-foreground"})})}function yp({name:e,value:t,level:n,defaultExpandDepth:r,isArrayItem:o}){const[s,i]=v.useState(n<r),[a,c]=v.useState(0),[u,d]=v.useState(null),[h,p]=v.useState(!1),f=ko(t),x=gp(t),m=x==="array"?"[":"{",y=x==="array"?"]":"}";function g(k){k.stopPropagation(),h?(i(!1),d(0),c(S=>S+1),p(!1)):(i(!0),d(Number.POSITIVE_INFINITY),c(S=>S+1),p(!0))}const b=u??r;return l.jsxs("div",{className:he(n>0&&"border-l border-border/50 ml-2"),children:[l.jsxs("div",{className:he("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?()=>{s&&p(!1),i(!s)}:void 0,onKeyDown:f?k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),i(!s))}:void 0,role:f?"button":void 0,tabIndex:f?0:void 0,children:[f?l.jsx("span",{className:"w-4 h-5 flex items-center justify-center shrink-0",children:s?l.jsx(yt,{className:"size-3 text-muted-foreground"}):l.jsx(bt,{className:"size-3 text-muted-foreground"})}):l.jsx("span",{className:"w-4 shrink-0"}),l.jsx("span",{className:he("shrink-0",o?"text-muted-foreground":"text-cyan-400"),children:o?e:`"${e}"`}),l.jsx("span",{className:"text-muted-foreground shrink-0",children:f?"":":"}),f?l.jsxs("span",{className:"text-muted-foreground",children:[m,l.jsxs("span",{className:"text-muted-foreground/60 text-xs",children:[" ",_c(t)," ",_c(t)===1?"item":"items"," ",y]})]}):l.jsx("span",{className:"min-w-0",children:l.jsx(xp,{value:t})}),f&&lE(t)&&l.jsx(cE,{allExpanded:h,onClick:g}),l.jsx(aE,{value:t})]}),f&&s&&l.jsxs("div",{className:"pl-4",children:[_a(t).map(([k,S])=>l.jsx(yp,{name:k,value:S,level:n+1,defaultExpandDepth:b,isArrayItem:x==="array"},k)),l.jsx("div",{className:"text-muted-foreground py-0.5 px-1",children:y})]},a)]})}function Qo({data:e,defaultExpandDepth:t=2,className:n,showCopy:r=!1}){if(!ko(e))return l.jsx(Te,{children:l.jsx("div",{className:he("font-mono text-xs leading-relaxed",n),children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(xp,{value:e}),r&&l.jsx(Cc,{value:e})]})})});const i=gp(e)==="array";return l.jsx(Te,{children:l.jsxs("div",{className:he("font-mono text-xs leading-relaxed",n),children:[r&&l.jsx(Cc,{value:e}),_a(e).map(([a,c])=>l.jsx(yp,{name:a,value:c,level:0,defaultExpandDepth:t,isArrayItem:i},a))]})})}function fn({text:e,defaultExpandDepth:t=2,className:n}){try{const r=JSON.parse(e);return l.jsx(Qo,{data:Kn(r),defaultExpandDepth:t,className:n})}catch{return l.jsx("pre",{className:he("font-mono text-xs whitespace-pre-wrap break-words",n),children:e})}}function Kn(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=>Kn(n));const t={};for(const n of Object.keys(e)){const r=Object.getOwnPropertyDescriptor(e,n);t[n]=Kn(r?.value)}return t}case"bigint":case"symbol":case"function":case"undefined":return String(e)}return null}function Rn({className:e,orientation:t="horizontal",...n}){return l.jsx(a_,{"data-slot":"tabs","data-orientation":t,orientation:t,className:he("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const uE=la("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 Pn({className:e,variant:t="default",...n}){return l.jsx(l_,{"data-slot":"tabs-list","data-variant":t,className:he(uE({variant:t}),e),...n})}function et({className:e,...t}){return l.jsx(c_,{"data-slot":"tabs-trigger",className:he("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 tt({className:e,...t}){return l.jsx(u_,{"data-slot":"tabs-content",className:he("flex-1 outline-none",e),...t})}class vp{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const s=this.castInput(t,r),i=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(a,c,r,o)}diffWithOptionsObj(t,n,r,o){var s;const i=b=>{if(b=this.postProcess(b,r),o){setTimeout(function(){o(b)},0);return}else return b},a=n.length,c=t.length;let u=1,d=a+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const h=(s=r.timeout)!==null&&s!==void 0?s: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>=c&&x+1>=a)return i(this.buildValues(f[0].lastComponent,n,t));let m=-1/0,y=1/0;const g=()=>{for(let b=Math.max(m,-u);b<=Math.min(y,u);b+=2){let k;const S=f[b-1],j=f[b+1];S&&(f[b-1]=void 0);let C=!1;if(j){const T=j.oldPos-b;C=j&&0<=T&&T<a}const E=S&&S.oldPos+1<c;if(!C&&!E){f[b]=void 0;continue}if(!E||C&&S.oldPos<j.oldPos?k=this.addToPath(j,!0,!1,0,r):k=this.addToPath(S,!1,!0,1,r),x=this.extractCommon(k,n,t,b,r),k.oldPos+1>=c&&x+1>=a)return i(this.buildValues(k.lastComponent,n,t))||!0;f[b]=k,k.oldPos+1>=c&&(y=Math.min(y,b-1)),x+1>=a&&(m=Math.max(m,b+1))}u++};if(o)(function b(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);g()||b()},0)})();else for(;u<=d&&Date.now()<=p;){const b=g();if(b)return b}}addToPath(t,n,r,o,s){const i=t.lastComponent;return i&&!s.oneChangePerToken&&i.added===n&&i.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:i.count+1,added:n,removed:r,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:i}}}extractCommon(t,n,r,o,s){const i=n.length,a=r.length;let c=t.oldPos,u=c-o,d=0;for(;u+1<i&&c+1<a&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();const i=o.length;let a=0,c=0,u=0;for(;a<i;a++){const d=o[a];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let h=n.slice(c,c+d.count);h=h.map(function(p,f){const x=r[u+f];return x.length>p.length?x:p}),d.value=this.join(h)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return o}}class dE extends vp{constructor(){super(...arguments),this.tokenize=wp}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
|
98
|
+
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
|
|
99
|
+
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
|
100
|
+
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
101
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const fE=new dE;function bp(e,t,n){return fE.diff(e,t,n)}function wp(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 s=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}class hE extends vp{constructor(){super(...arguments),this.tokenize=wp}get useLongestToken(){return!0}castInput(t,n){const{undefinedReplacement:r,stringifyReplacer:o=(s,i)=>typeof i>"u"?r:i}=n;return typeof t=="string"?t:JSON.stringify(mi(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 pE=new hE;function mE(e,t,n){return pE.diff(e,t,n)}function mi(e,t,n,r,o){t=t||[],n=n||[],r&&(e=r(o===void 0?"":o,e));let s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];let i;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),i=new Array(e.length),n.push(i),s=0;s<e.length;s+=1)i[s]=mi(e[s],t,n,r,String(s));return t.pop(),n.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){t.push(e),i={},n.push(i);const a=[];let c;for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&a.push(c);for(a.sort(),s=0;s<a.length;s+=1)c=a[s],i[c]=mi(e[c],t,n,r,c);t.pop(),n.pop()}else i=e;return i}function jc(e){return e===void 0?[]:Object.entries(e).map(t=>[t[0].toLowerCase(),t[1]]).sort(([t],[n])=>t.localeCompare(n))}function Ec([e,t]){return`${e}: ${t}`}function gi(e){const t=[];let n=0,r=0;for(const o of e){const s=o.value.split(`
|
|
103
|
+
`);s.length>0&&s[s.length-1]===""&&s.pop();for(const i of s)o.added?(r+=1,t.push({kind:"added",text:i,oldLineNumber:null,newLineNumber:r})):o.removed?(n+=1,t.push({kind:"removed",text:i,oldLineNumber:n,newLineNumber:null})):(n+=1,r+=1,t.push({kind:"context",text:i,oldLineNumber:n,newLineNumber:r}))}return t}function gE(e,t){const n=jc(e).map(Ec).join(`
|
|
104
|
+
`),r=jc(t).map(Ec).join(`
|
|
105
|
+
`);if(n===r)return{lines:[],isEmpty:!0};const o=bp(n,r);return{lines:gi(o),isEmpty:!1}}function Nc(e){try{const t=JSON.parse(e);return t===null||typeof t=="string"||typeof t=="object"?t:null}catch{return null}}function xE(e,t){const n=e??"",r=t??"";if(n===r)return{lines:[],isEmpty:!0};const o=Nc(n),s=Nc(r);if(o!==null&&s!==null){const a=mE(o,s)??[];if(a.length===1){const c=a[0];if(c!==void 0&&!c.added&&!c.removed)return{lines:[],isEmpty:!0}}return{lines:gi(a),isEmpty:!1}}const i=bp(n,r);return{lines:gi(i),isEmpty:!1}}const yE=22,Os=1e4;function vE(e){return e==="added"?"+":e==="removed"?"-":" "}function bE(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 Tc({result:e,emptyLabel:t}){const[n,r]=v.useState("unified"),o=v.useRef(null),s=Uu({count:e.lines.length,getScrollElement:()=>o.current,estimateSize:()=>yE,overscan:10});if(e.isEmpty)return l.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 i=e.lines.length,a=i>Os,c=a?e.lines.slice(0,Os):e.lines;return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:[i.toLocaleString()," line",i===1?"":"s",a&&` (showing first ${Os.toLocaleString()})`]}),l.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[l.jsxs("button",{type:"button",onClick:()=>r("unified"),"aria-pressed":n==="unified",className:he("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:[l.jsx(Ju,{className:"size-3"}),"Unified"]}),l.jsxs("button",{type:"button",onClick:()=>r("split"),"aria-pressed":n==="split",className:he("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:[l.jsx(Wu,{className:"size-3"}),"Split"]})]})]}),l.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"?l.jsx(wE,{virtualizer:s,lines:c}):l.jsx(SE,{lines:c})})]})}function wE({virtualizer:e,lines:t}){return l.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:l.jsxs("div",{"data-index":n.index,ref:e.measureElement,className:he("flex items-start gap-3 px-2",bE(r.kind)),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${n.start}px)`},children:[l.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.oldLineNumber??""}),l.jsx("span",{className:"select-none text-muted-foreground/60 w-10 text-right tabular-nums",children:r.newLineNumber??""}),l.jsx("span",{className:he("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:vE(r.kind)}),l.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:r.text})]},n.key)})})}function kE(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=[],s=[];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&&s.push(a),n+=1}const i=Math.max(o.length,s.length);for(let a=0;a<i;a+=1){const c=o[a],u=s[a];c!==void 0&&u!==void 0?t.push({left:{text:c.text,lineNumber:c.oldLineNumber},right:{text:u.text,lineNumber:u.newLineNumber},kind:"changed"}):c!==void 0?t.push({left:{text:c.text,lineNumber:c.oldLineNumber},right:null,kind:"removed"}):u!==void 0&&t.push({left:null,right:{text:u.text,lineNumber:u.newLineNumber},kind:"added"})}}return t}function _E(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 SE({lines:e}){const t=kE(e);return l.jsx("div",{"data-testid":"diff-split",children:t.map((n,r)=>l.jsxs("div",{className:he("grid grid-cols-2 font-mono text-xs",_E(n.kind)),children:[l.jsxs("div",{className:"flex items-start gap-2 px-2 border-r border-border/50",children:[l.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.left?.lineNumber??""}),l.jsx("span",{className:he("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?"-":" "}),l.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.left?.text??""})]}),l.jsxs("div",{className:"flex items-start gap-2 px-2",children:[l.jsx("span",{className:"select-none text-muted-foreground/60 w-8 text-right tabular-nums",children:n.right?.lineNumber??""}),l.jsx("span",{className:he("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?"+":" "}),l.jsx("span",{className:"whitespace-pre-wrap break-all flex-1",children:n.right?.text??""})]})]},r))})}const CE="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",jE="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",EE="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",NE="/assets/minimax-BPMzvuL-.jpeg",TE="/assets/alibaba-TTwafVwX.svg",AE="/assets/qwen-CONDcHqt.png",IE="/assets/zhipuai-BPNAnxo-.svg",zE={"claude-":"anthropic","gpt-":"openai","o1-":"openai","o3-":"openai","deepseek-":"deepseek",MiniMax:"minimax",qwen:"qwen","glm-":"zhipuai"};function RE(e){if(e===null)return"unknown";const t=e.toLowerCase();for(const[n,r]of Object.entries(zE))if(t.startsWith(n.toLowerCase()))return r;return"unknown"}const kn={width:24,height:24,objectFit:"contain"},PE=at.memo(({className:e})=>l.jsx("img",{src:CE,alt:"Anthropic",className:e,style:kn})),OE=at.memo(({className:e})=>l.jsx("img",{src:jE,alt:"OpenAI",className:e,style:{...kn,background:"white",borderRadius:"4px"}})),DE=at.memo(({className:e})=>l.jsx("img",{src:EE,alt:"DeepSeek",className:e,style:kn})),ME=at.memo(({className:e})=>l.jsx("img",{src:NE,alt:"MiniMax",className:e,style:kn})),LE=at.memo(({className:e})=>l.jsx("img",{src:TE,alt:"Alibaba",className:e,style:kn})),FE=at.memo(({className:e})=>l.jsx("img",{src:AE,alt:"Qwen",className:e,style:kn})),BE=at.memo(({className:e})=>l.jsx("img",{src:IE,alt:"ZhipuAI",className:e,style:kn}));function $E({provider:e,className:t}){switch(e){case"anthropic":return l.jsx(PE,{className:t});case"openai":return l.jsx(OE,{className:t});case"deepseek":return l.jsx(DE,{className:t});case"minimax":return l.jsx(ME,{className:t});case"alibaba":return l.jsx(LE,{className:t});case"qwen":return l.jsx(FE,{className:t});case"zhipuai":return l.jsx(BE,{className:t});case"unknown":return null}}function UE(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}const Ac={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 Ic({trend:e}){if(e===null)return null;const t=e.direction==="up",n=t?_y:wy,r=t?"+":"-";return l.jsxs("span",{className:"flex items-center gap-0.5 text-muted-foreground tabular-nums",children:[l.jsx(n,{className:t?"size-3 text-emerald-400":"size-3 text-rose-400"}),l.jsxs("span",{className:"font-mono",children:[r,Ye(e.delta)]})]})}const ZE=v.memo(function({log:e,messageCount:t=null,toolCount:n=null,expanded:r,onToggle:o,responseToolNames:s=null,cacheTrend:i=null}){const a=Rh(e.responseStatus),c=e.inputTokens!==null||e.outputTokens!==null;return l.jsxs("div",{role:"button",tabIndex:0,className:he("flex items-center gap-2.5 px-3 py-2 cursor-pointer transition-colors","hover:bg-muted/50","select-none"),onClick:o,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o())},children:[l.jsxs("span",{className:"text-blue-400/80 font-mono text-xs font-semibold tabular-nums shrink-0",children:["#",e.id]}),e.model!==null&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("span",{className:"shrink-0",children:l.jsx($E,{provider:RE(e.model),className:"size-4"})})}),l.jsx(Re,{children:e.model})]})}),a!=="success"&&l.jsx(l.Fragment,{children:a==="server_error"?l.jsx(xt,{variant:"destructive",className:"text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",children:e.responseStatus}):a==="pending"?l.jsx(xt,{variant:"outline",className:he("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ac[a]),children:l.jsx(br,{className:"size-3 animate-spin"})}):l.jsx(xt,{variant:"outline",className:he("text-[10px] px-1.5 py-0 h-5 font-mono tabular-nums",Ac[a]),children:e.responseStatus})}),e.elapsedMs!==null&&l.jsxs("span",{className:"hidden xl:flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(Ao,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums",children:UE(e.elapsedMs)})]}),c&&l.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[l.jsx(Cr,{className:"size-3 text-muted-foreground"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[l.jsxs("span",{className:e.inputTokens!==null?"text-blue-400":"text-muted-foreground",children:["IN ",e.inputTokens!==null?Ye(e.inputTokens):"—"]})," / ",l.jsxs("span",{className:e.outputTokens!==null?"text-amber-400":"text-muted-foreground",children:["OUT ",e.outputTokens!==null?Ye(e.outputTokens):"—"]})]})]}),e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[l.jsx(Ic,{trend:i?.creation??null}),l.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ye(e.cacheCreationInputTokens)]})]})}),l.jsx(Re,{children:"Tokens cached for reuse, reducing future API cost"})]})}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"flex items-center gap-1 text-xs shrink-0",children:[l.jsx(Ic,{trend:i?.read??null}),l.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ye(e.cacheReadInputTokens)]})]})}),l.jsx(Re,{children:"Tokens served from cache, reducing API cost"})]})}),t!==null&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(qu,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums",children:t})]})}),l.jsx(Re,{children:"Number of messages in the conversation"})]})}),n!==null&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs shrink-0",children:[l.jsx(tl,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums",children:n})]})}),l.jsx(Re,{children:"Number of tools defined in the request"})]})}),s!==null&&s.length>0&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"flex items-center gap-1 text-amber-400/80 text-xs shrink-0",children:[l.jsx(tl,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums truncate max-w-[160px]",children:s.join(", ")})]})}),l.jsxs(Re,{children:["Tools called by model: ",s.join(", ")]})]})}),e.origin!==null&&l.jsxs("span",{className:"hidden xl:flex items-center gap-1 text-muted-foreground text-xs shrink-0",title:`Origin: ${e.origin}`,children:[l.jsx(rv,{className:"size-3"}),l.jsx("span",{className:"font-mono tabular-nums truncate max-w-[120px]",title:e.origin,children:e.origin})]}),(e.clientPid!==null||e.clientProjectFolder!==null)&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"hidden xl:flex items-center gap-1 text-purple-400/80 text-xs shrink-0",children:[l.jsx(Xy,{className:"size-3"}),e.clientProjectFolder!==null?l.jsx("span",{className:"font-mono tabular-nums",children:e.clientProjectFolder}):l.jsxs("span",{className:"font-mono tabular-nums",children:["PID ",e.clientPid]})]})}),l.jsx(Re,{children:e.clientCwd!==null?`PID: ${e.clientPid??"?"} CWD: ${e.clientCwd}`:`Process ID: ${e.clientPid??"?"}`})]})}),e.streaming&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx(fv,{className:"size-3 text-muted-foreground/60 shrink-0"})}),l.jsx(Re,{children:"Request used SSE streaming"})]})}),l.jsx("span",{className:"flex-1 min-w-0"}),r?l.jsx(yt,{className:"size-4 text-muted-foreground shrink-0"}):l.jsx(bt,{className:"size-4 text-muted-foreground shrink-0"})]})});function es({...e}){return l.jsx(b2,{"data-slot":"dialog",...e})}function VE({...e}){return l.jsx(w2,{"data-slot":"dialog-trigger",...e})}function WE({...e}){return l.jsx(k2,{"data-slot":"dialog-portal",...e})}function HE({className:e,...t}){return l.jsx(_2,{"data-slot":"dialog-overlay",className:he("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 ts({className:e,children:t,...n}){return l.jsxs(WE,{children:[l.jsx(HE,{}),l.jsxs(S2,{"data-slot":"dialog-content",className:he("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,l.jsxs(j2,{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:[l.jsx(Xu,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ns({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:he("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function rs({className:e,...t}){return l.jsx(C2,{"data-slot":"dialog-title",className:he("text-lg font-semibold leading-none tracking-tight",e),...t})}function kp({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return l.jsx(o_,{"data-slot":"separator",decorative:n,orientation:t,className:he("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 os({...e}){return l.jsx(ab,{"data-slot":"collapsible",...e})}function ss({...e}){return l.jsx(id,{"data-slot":"collapsible-trigger",...e})}function is({...e}){return l.jsx(ad,{"data-slot":"collapsible-content",...e})}function Sa({className:e,children:t,...n}){return l.jsxs(xk,{"data-slot":"scroll-area",className:he("relative",e),...n,children:[l.jsx(yk,{"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}),l.jsx(qE,{}),l.jsx(vk,{})]})}function qE({className:e,orientation:t="vertical",...n}){return l.jsx(yf,{"data-slot":"scroll-area-scrollbar",orientation:t,className:he("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:l.jsx(kf,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function KE(e){return l.jsx(l.Fragment,{})}function GE({text:e}){const[t,n]=v.useState(!1);return l.jsxs(os,{open:t,onOpenChange:n,children:[l.jsxs(ss,{className:"flex items-center gap-1.5 py-0.5 cursor-pointer hover:opacity-80 transition-opacity group",children:[t?l.jsx(yt,{className:"size-3 text-muted-foreground"}):l.jsx(bt,{className:"size-3 text-muted-foreground"}),l.jsx("span",{className:"text-muted-foreground text-xs italic select-none opacity-60",children:"[system-reminder]"})]}),l.jsx(is,{children:l.jsx("div",{className:"pl-4 pt-1",children:l.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:l.jsx(qn,{children:e})})})})]})}const JE=/<think>([\s\S]*?)<\/think>/gi,YE=/<think>([\s\S]*?)<\/think>/i;function _p(e){const t=YE.exec(e);if(!t||t[1]===void 0)return{thinking:null,remainingText:e};const n=t[1].trim(),r=e.replace(JE,"").trim();return{thinking:n,remainingText:r}}function XE({text:e}){if(e.includes("<system-reminder>"))return l.jsx(GE,{text:e});const{thinking:t,remainingText:n}=_p(e);return l.jsxs("div",{className:"space-y-2",children:[t!==null&&l.jsx(_o,{thinking:t}),n.length>0&&l.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:l.jsx(qn,{children:n})}),t===null&&n.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty text block"})]})}function _o({thinking:e}){const[t,n]=v.useState(!1);return l.jsx(os,{open:t,onOpenChange:n,children:l.jsxs("div",{className:"border-l-2 border-purple-500/40 my-1",children:[l.jsxs(ss,{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:[l.jsx(Cy,{className:"size-3.5 text-purple-400 shrink-0"}),l.jsx("span",{className:"text-xs font-medium text-purple-400",children:"Thinking"}),l.jsxs(xt,{variant:"ghost",className:"text-[10px] text-muted-foreground px-1.5 py-0 h-4 font-mono",children:[e.length.toLocaleString()," chars"]}),l.jsx("span",{className:"flex-1"}),t?l.jsx(yt,{className:"size-3 text-muted-foreground"}):l.jsx(bt,{className:"size-3 text-muted-foreground"})]}),l.jsx(is,{children:l.jsx("div",{className:"px-3 pb-2",children:l.jsx(Sa,{className:"max-h-[60vh]",children:l.jsx("pre",{className:"text-xs text-muted-foreground whitespace-pre-wrap font-mono leading-relaxed",children:e})})})})]})})}function QE({name:e,input:t}){const[n,r]=v.useState(!1);return l.jsx(os,{open:n,onOpenChange:r,children:l.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[l.jsxs(ss,{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:[l.jsx(Yu,{className:"size-3.5 text-blue-400 shrink-0"}),l.jsx(xt,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:e}),l.jsx("span",{className:"flex-1"}),n?l.jsx(yt,{className:"size-3 text-muted-foreground"}):l.jsx(bt,{className:"size-3 text-muted-foreground"})]}),l.jsx(is,{children:l.jsx("div",{className:"px-3 pb-2",children:l.jsx(Sa,{className:"max-h-[60vh]",children:l.jsx(Qo,{data:Kn(t),defaultExpandDepth:2})})})})]})})}function eN({block:e}){switch(e.type){case"text":return l.jsx(XE,{text:e.text});case"thinking":case"think":return l.jsx(_o,{thinking:e.thinking});case"tool_use":return l.jsx(QE,{name:e.name,input:e.input});default:return KE()}}function tN({response:e}){return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx(xt,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 font-mono",children:e.model}),e.stop_reason!==null&&l.jsxs(xt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[l.jsx(Vu,{className:"size-2.5"}),e.stop_reason]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[l.jsx(Cr,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[Ye(e.usage.input_tokens??0)," in /"," ",Ye(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&&l.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ye(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&&l.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ye(e.usage.cache_read_input_tokens)]})]})]}),l.jsx(kp,{className:"opacity-50"}),l.jsxs("div",{className:"space-y-2",children:[e.content.map((t,n)=>l.jsx(eN,{block:t},n)),e.content.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function nN(e){if(e===void 0||e==="")return{};try{return JSON.parse(e)}catch{return null}}function rN({call:e}){const[t,n]=v.useState(!1),r=e.function.name??"(unnamed tool)",o=nN(e.function.arguments);return l.jsx(os,{open:t,onOpenChange:n,children:l.jsxs("div",{className:"border-l-2 border-blue-500/40 my-1",children:[l.jsxs(ss,{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:[l.jsx(Yu,{className:"size-3.5 text-blue-400 shrink-0"}),l.jsx(xt,{variant:"outline",className:"text-[10px] font-mono px-1.5 py-0 h-4",children:r}),e.id!==void 0&&e.id!==""&&l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 truncate",children:e.id}),l.jsx("span",{className:"flex-1"}),t?l.jsx(yt,{className:"size-3 text-muted-foreground"}):l.jsx(bt,{className:"size-3 text-muted-foreground"})]}),l.jsx(is,{children:l.jsx("div",{className:"px-3 pb-2",children:l.jsx(Sa,{className:"max-h-[60vh]",children:o===null?l.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-words text-rose-300/90",children:e.function.arguments}):l.jsx(Qo,{data:Kn(o),defaultExpandDepth:2})})})})]})})}function oN({response:e}){const t=e.choices[0],n=t?.message,r=n?.tool_calls??[];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx(xt,{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&&l.jsxs(xt,{variant:"outline",className:"text-[10px] px-1.5 py-0 h-5 font-mono flex items-center gap-1",children:[l.jsx(Vu,{className:"size-2.5"}),t.finish_reason]}),l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[l.jsx(Cr,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[Ye(e.usage.prompt_tokens??0)," in /"," ",Ye(e.usage.completion_tokens??0)," out"]})]})]}),l.jsx(kp,{className:"opacity-50"}),l.jsxs("div",{className:"space-y-2",children:[n?.reasoning_content!==null&&n?.reasoning_content!==void 0&&n.reasoning_content.length>0&&l.jsx(_o,{thinking:n.reasoning_content}),n?.content!==null&&n?.content!==void 0&&n.content.length>0&&(()=>{const o=n.reasoning_content!==null&&n.reasoning_content!==void 0&&n.reasoning_content.length>0,{thinking:s,remainingText:i}=_p(n.content);return l.jsxs("div",{className:"space-y-2",children:[s!==null&&!o&&l.jsx(_o,{thinking:s}),i.length>0&&l.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:l.jsx(qn,{children:i})})]})})(),r.map((o,s)=>l.jsx(rN,{call:o},o.id??`tc-${s}`)),n?.function_call!==null&&n?.function_call!==void 0&&l.jsxs("div",{className:"border border-blue-500/30 rounded-md p-3 bg-blue-500/5",children:[l.jsx("div",{className:"text-xs text-blue-400 font-mono mb-1",children:"function_call"}),l.jsxs("div",{className:"font-mono text-xs",children:[l.jsx("span",{className:"text-blue-300",children:n.function_call.name}),l.jsxs("span",{className:"text-muted-foreground",children:["(",n.function_call.arguments,")"]})]})]}),(n?.content===null||n?.content===void 0||n.content.length===0)&&(n?.reasoning_content===null||n?.reasoning_content===void 0||n.reasoning_content.length===0)&&(n?.function_call===null||n?.function_call===void 0)&&r.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Empty response content"})]})]})}function sN(e){return typeof e!="object"||e===null?!1:Object.getOwnPropertyDescriptor(e,"object")?.value==="chat.completion"}function iN(e,t){return sN(t)?l.jsx(oN,{response:t}):l.jsx(tN,{response:t})}function aN(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 lN(e,t){try{let n=JSON.parse(e);if(typeof n=="string"&&(n=JSON.parse(n)),t==="openai"){const o=Mu(e);if(o)return o}const r=Ru.safeParse(n);return r.success?r.data:null}catch{return null}}function ur({status:e}){const t=Rh(e),n=aN(t);return e===null?l.jsx("span",{className:"text-xs text-muted-foreground italic",children:"pending"}):l.jsxs("span",{className:he("flex items-center gap-1 text-xs font-mono font-semibold",n),children:[t==="server_error"&&l.jsx(jv,{className:"size-3"}),e]})}function zc({text:e}){return l.jsx("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-3",children:l.jsx("pre",{className:"text-xs text-red-300 whitespace-pre-wrap font-mono leading-relaxed overflow-auto max-h-[60vh]",children:e})})}function cN({text:e}){return l.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:l.jsx(qn,{children:e})})}function to({responseText:e,responseStatus:t,streaming:n,inputTokens:r,outputTokens:o,cacheCreationInputTokens:s,cacheReadInputTokens:i,apiFormat:a,error:c}){if(e===null&&c===void 0)return l.jsxs("div",{className:"flex items-center gap-2 py-3",children:[l.jsx(ur,{status:t}),l.jsx("span",{className:"text-xs text-muted-foreground italic",children:"No response"})]});if(t!==null&&t>=400)return l.jsxs("div",{className:"space-y-2",children:[l.jsx(ur,{status:t}),l.jsx(zc,{text:e??""}),c!=null&&l.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[l.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),l.jsx("div",{className:"text-muted-foreground font-mono",children:c})]})]});if(c!=null)return l.jsxs("div",{className:"space-y-2",children:[l.jsx(ur,{status:t}),l.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[l.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),l.jsx("div",{className:"text-muted-foreground font-mono",children:c})]}),e!==null&&l.jsx("div",{className:"mt-2",children:l.jsx(zc,{text:e})})]});const d=e!==null?lN(e,a):null;return d!==null?l.jsxs("div",{className:"space-y-2",children:[l.jsx(ur,{status:t}),iN(a,d)]}):l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ur,{status:t}),n&&(r!==null||o!==null)&&l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground text-xs",children:[l.jsx(Cr,{className:"size-3"}),l.jsxs("span",{className:"font-mono tabular-nums",children:[r!==null?Ye(r):"—"," in /"," ",o!==null?Ye(o):"—"," out"]}),s!=null&&s>0&&l.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["Cache +",Ye(s)]}),i!=null&&i>0&&l.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["Cache ~",Ye(i)]})]})]}),l.jsx(cN,{text:e??""})]})}const uN=ae({success:nt(),error:q().optional(),responseStatus:ve().optional(),responseText:q().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),elapsedMs:ve().optional(),streaming:nt().optional()});function dN({log:e,open:t,onOpenChange:n}){const[r,o]=v.useState(()=>e.rawRequestBody??"{}"),[s,i]=v.useState(null),[a,c]=v.useState(!1),[u,d]=v.useState(null);async function h(){c(!0),d(null),i(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=uN.safeParse(x);if(!m.success){d("Invalid response from server"),c(!1);return}const y=m.data;i(y),y.success||d(y.error??"Replay failed")}catch(f){d(f instanceof Error?f.message:"Network error")}finally{c(!1)}}function p(){i(null),d(null),n(!1)}return l.jsx(es,{open:t,onOpenChange:p,children:l.jsxs(ts,{className:"max-w-4xl max-h-[85vh] overflow-auto",children:[l.jsx(ns,{children:l.jsxs(rs,{className:"flex items-center gap-2",children:[l.jsx(Ku,{className:"size-4"}),"Replay Request #",e.id]})}),l.jsxs(Rn,{defaultValue:"modified",children:[l.jsxs(Pn,{children:[l.jsx(et,{value:"modified",children:"Modified Request"}),l.jsx(et,{value:"original",children:"Original Response"}),s&&l.jsx(et,{value:"replay",children:"Replay Response"})]}),l.jsxs(tt,{value:"modified",className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Request Body (JSON)"}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.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})}),l.jsx(Re,{children:"Edit the request body before re-sending to the provider"})]})})]}),u!==null&&u!==""&&l.jsx("div",{className:"text-sm text-destructive bg-destructive/10 px-3 py-2 rounded-md",children:u}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Xe,{onClick:()=>{h()},disabled:a,children:a?"Replaying...":"Replay"})}),s&&s.success&&l.jsxs(Rn,{defaultValue:"parsed",children:[l.jsxs(Pn,{children:[l.jsx(et,{value:"parsed",children:"Response"}),l.jsx(et,{value:"raw",children:"Raw Response"})]}),l.jsx(tt,{value:"parsed",children:l.jsx(to,{responseText:s.responseText??null,responseStatus:s.responseStatus??null,streaming:s.streaming??!1,inputTokens:s.inputTokens??null,outputTokens:s.outputTokens??null,apiFormat:e.apiFormat})}),l.jsx(tt,{value:"raw",children:l.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:s.responseText??"No response"})})]})]}),l.jsx(tt,{value:"original",children:e.responseText!==null?l.jsxs(Rn,{defaultValue:"parsed",children:[l.jsxs(Pn,{children:[l.jsx(et,{value:"parsed",children:"Response"}),l.jsx(et,{value:"raw",children:"Raw Response"})]}),l.jsx(tt,{value:"parsed",children:l.jsx(to,{responseText:e.responseText,responseStatus:e.responseStatus,streaming:e.streaming,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheCreationInputTokens:e.cacheCreationInputTokens,cacheReadInputTokens:e.cacheReadInputTokens,apiFormat:e.apiFormat})}),l.jsx(tt,{value:"raw",children:l.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:e.responseText})})]}):l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No original response"})}),s&&s.success&&l.jsx(tt,{value:"replay",children:s.responseText!==null?l.jsxs(Rn,{defaultValue:"parsed",children:[l.jsxs(Pn,{children:[l.jsx(et,{value:"parsed",children:"Response"}),l.jsx(et,{value:"raw",children:"Raw Response"})]}),l.jsx(tt,{value:"parsed",children:l.jsx(to,{responseText:s.responseText??null,responseStatus:s.responseStatus??null,streaming:s.streaming??!1,inputTokens:s.inputTokens??null,outputTokens:s.outputTokens??null,apiFormat:e.apiFormat})}),l.jsx(tt,{value:"raw",children:l.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap bg-muted p-3 rounded-md max-h-96 overflow-auto",children:s.responseText})})]}):l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No replay response"})})]})]})})}function fN({logId:e,truncated:t}){const[n,r]=v.useState(!1),[o,s]=v.useState({status:"idle"}),[i,a]=v.useState(new Set);v.useEffect(()=>{if(!n||o.status!=="idle")return;let h=!1;return s({status:"loading"}),fetch(`/api/logs/${e}/chunks`).then(p=>p.ok?p.json():Promise.reject(new Error("Chunks not found"))).then(p=>{h||s({status:"success",chunks:p.chunks})}).catch(()=>{h||s({status:"error",message:"Chunk data unavailable"})}),()=>{h=!0}},[n,e]);const c=v.useMemo(()=>{if(o.status!=="success")return[];const h=new Map;for(const p of o.chunks){const f=h.get(p.index);f?f.push(p):h.set(p.index,[p])}return Array.from(h.entries()).map(([p,f])=>({index:p,chunks:f})).sort((p,f)=>p.index-f.index)},[o]),u=h=>{a(p=>{const f=new Set(p);return f.has(h)?f.delete(h):f.add(h),f})};function d(){return o.status==="idle"||o.status==="loading"?l.jsxs("div",{className:"flex items-center gap-2 py-2 text-xs text-muted-foreground",children:[l.jsx(br,{className:"size-3 animate-spin"}),l.jsx("span",{children:"Loading chunks..."})]}):o.status==="error"?l.jsx("div",{className:"py-2 text-xs text-muted-foreground italic",children:o.message}):l.jsxs("div",{className:"p-2 space-y-1",children:[l.jsxs("div",{className:"text-[10px] text-muted-foreground font-mono mb-2",children:[c.length," index group",c.length!==1?"s":""," available"]}),c.map(h=>{const p=i.has(h.index);return l.jsxs("div",{className:"rounded border border-border bg-background",children:[l.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full px-2 py-1.5 text-left hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>u(h.index),children:[p?l.jsx(yt,{className:"size-3 text-muted-foreground"}):l.jsx(bt,{className:"size-3 text-muted-foreground"}),l.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["[",h.index,"] ",h.chunks[0]?.type??""]}),l.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:[h.chunks.length," chunk",h.chunks.length!==1?"s":""]})]}),p&&l.jsx("div",{className:"px-2 pb-2 space-y-1",children:h.chunks.map(f=>l.jsxs("div",{className:"rounded border border-border bg-muted/20 p-2",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsxs("span",{className:"text-[10px] text-muted-foreground font-mono",children:["+",f.timestamp,"ms"]}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:f.type})]}),l.jsx(Qo,{data:f,defaultExpandDepth:1,showCopy:!0})]},f.index))})]},h.index)})]})}return l.jsxs("div",{className:"space-y-1",children:[l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.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?l.jsx(yt,{className:"size-3"}):l.jsx(bt,{className:"size-3"}),l.jsx("span",{children:"Raw SSE Events"}),l.jsxs(xt,{variant:"outline",className:"text-[9px] px-1 py-0 h-4 font-mono ml-1",children:[e,t===!0?"+":""]})]})}),l.jsx(Re,{children:"Server-Sent Events streaming chunks from the provider"})]})}),n===!0?l.jsx("div",{className:"rounded-md border border-border bg-muted/20 overflow-auto max-h-64",children:d()}):null]})}function Rc(e,t,n){return e==="anthropic"&&t==="full"&&n}function hN(e,t){return e==="full"&&t}function pN(e,t,n,r){return e==="anthropic"&&t==="full"&&n&&r}function Ds({text:e,label:t,copied:n,onCopy:r}){return e===null?null:l.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?l.jsxs(l.Fragment,{children:[l.jsx(sn,{className:"size-3 text-green-500"}),l.jsx("span",{className:"text-green-500",children:"Copied!"})]}):l.jsxs(l.Fragment,{children:[l.jsx(bn,{className:"size-3"}),l.jsx("span",{children:t})]})})}function Pc({active:e,onClick:t}){return l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("button",{type:"button",onClick:t,"aria-pressed":e,className:he("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"),children:[l.jsx(Hu,{className:"size-3"}),e?"Showing diff":"Diff with Raw"]})}),l.jsx(Re,{children:e?"Hide diff view":"Compare proxy output against the original raw version"})]})})}const mN=v.memo(function({log:e,viewMode:t="simple",strip:n,cacheTrend:r=null,onCompareWithPrevious:o}){const[s,i]=v.useState(!1),[a,c]=v.useState(!1),[u,d]=v.useState(!1),[h,p]=v.useState(!1),[f,x]=v.useState(!1),[m,y]=v.useState(!1),[g,b]=v.useState(!1),k=v.useMemo(()=>{if(e.rawRequestBody===null)return null;if(e.apiFormat==="anthropic"){const O=io(e.rawRequestBody);if(O!==null)return O.messages.length}else if(e.apiFormat==="openai")try{const O=Ka.safeParse(JSON.parse(e.rawRequestBody));if(O.success)return O.data.messages.length}catch{}return null},[e.rawRequestBody,e.apiFormat]),S=v.useMemo(()=>{if(e.rawRequestBody===null)return null;if(e.apiFormat==="anthropic"){const O=io(e.rawRequestBody);if(O!==null&&O.tools!==void 0&&O.tools.length>0)return O.tools.length}else if(e.apiFormat==="openai")try{const O=Ka.safeParse(JSON.parse(e.rawRequestBody));if(O.success&&O.data.tools!==void 0&&O.data.tools.length>0)return O.data.tools.length}catch{}return null},[e.rawRequestBody,e.apiFormat]),j=v.useMemo(()=>{if(e.responseText===null)return null;if(e.apiFormat==="openai"){const O=Mu(e.responseText);if(O!==null){const w=O.choices[0]?.message?.tool_calls;if(w!=null&&w.length>0)return w.map(D=>D.function?.name??"?").filter(D=>D!=="")}}else if(e.apiFormat==="anthropic")try{const O=Ru.safeParse(JSON.parse(e.responseText));if(O.success){const w=O.data.content.filter(D=>D.type==="tool_use").map(D=>D.name);if(w.length>0)return w}}catch{}return null},[e.responseText,e.apiFormat]),E=v.useMemo(()=>!n||e.apiFormat!=="anthropic"||e.rawRequestBody===null?null:LS(e.rawRequestBody).body,[e.rawRequestBody,e.apiFormat,n])??e.rawRequestBody,T=v.useMemo(()=>gE(e.rawHeaders,e.headers),[e.rawHeaders,e.headers]),R=v.useMemo(()=>xE(e.rawRequestBody,E),[e.rawRequestBody,E]);function M(O){O.stopPropagation(),E!==null&&window.navigator.clipboard.writeText(E).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)})}function B(O){O.stopPropagation(),e.rawRequestBody!==null&&window.navigator.clipboard.writeText(e.rawRequestBody).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})}function N(O){O.stopPropagation(),e.responseText!==null&&window.navigator.clipboard.writeText(e.responseText).then(()=>{p(!0),setTimeout(()=>p(!1),2e3)})}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"border border-border rounded-lg mb-3 overflow-hidden",children:[l.jsx(ZE,{log:e,messageCount:k,toolCount:S,expanded:s,onToggle:()=>i(!s),responseToolNames:j,cacheTrend:r}),s&&l.jsx("div",{onClick:O=>O.stopPropagation(),onKeyDown:O=>O.stopPropagation(),children:l.jsxs(Rn,{defaultValue:"request",children:[l.jsxs(Pn,{className:"mx-4 mt-2",children:[t==="full"&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx(et,{value:"raw-headers",children:"Raw Headers"})}),l.jsx(Re,{children:"HTTP headers received from the upstream provider"})]})}),t==="full"&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx(et,{value:"headers",children:"Headers"})}),l.jsx(Re,{children:"Request and response headers sent and received"})]})}),Rc(e.apiFormat,t,n)&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx(et,{value:"raw-request",children:"Raw Request"})}),l.jsx(Re,{children:"Exact HTTP request sent to the upstream provider"})]})}),l.jsx(et,{value:"request",children:"Request"}),t==="full"&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx(et,{value:"raw",children:"Raw Response"})}),l.jsx(Re,{children:"Exact HTTP response from the upstream provider"})]})}),l.jsx(et,{value:"parsed",children:"Response"})]}),Rc(e.apiFormat,t,n)&&l.jsx(tt,{value:"raw-request",children:l.jsxs("div",{className:"px-4 py-3",children:[l.jsx("div",{className:"flex justify-end mb-2",children:l.jsx(Ds,{text:e.rawRequestBody,label:"Copy Raw Request",copied:u,onCopy:B})}),e.rawRequestBody!==null?l.jsx(fn,{text:e.rawRequestBody,defaultExpandDepth:1}):l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),l.jsx(tt,{value:"request",children:l.jsxs("div",{className:"px-4 py-3",children:[l.jsxs("div",{className:"flex justify-end gap-2 mb-2",children:[pN(e.apiFormat,t,n,e.rawRequestBody!==null)&&l.jsx(Pc,{active:g,onClick:O=>{O.stopPropagation(),b(!g)}}),o!==void 0&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs(Xe,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:O=>{O.stopPropagation(),o()},children:[l.jsx(Hu,{className:"size-3 mr-1"}),"Diff with Previous"]})}),l.jsx(Re,{children:"Compare this request with the immediately preceding one"})]})}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs(Xe,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:O=>{O.stopPropagation(),x(!0)},children:[l.jsx(Ku,{className:"size-3 mr-1"}),"Replay"]})}),l.jsx(Re,{children:"Re-send this request to the provider"})]})}),l.jsx(Ds,{text:E,label:"Copy Request",copied:a,onCopy:M})]}),g?l.jsx(Tc,{result:R,emptyLabel:"No transformation applied — raw and sent request bodies are identical."}):E!==null?l.jsx(fn,{text:E,defaultExpandDepth:1}):l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No request body"})]})}),t==="full"&&l.jsx(tt,{value:"headers",children:l.jsxs("div",{className:"px-4 py-3",children:[l.jsx("div",{className:"flex justify-end gap-2 mb-2",children:hN(t,e.rawHeaders!==void 0&&Object.keys(e.rawHeaders).length>0)&&l.jsx(Pc,{active:m,onClick:O=>{O.stopPropagation(),y(!m)}})}),m?l.jsx(Tc,{result:T,emptyLabel:"No transformation applied — raw and processed headers are identical."}):e.headers&&Object.keys(e.headers).length>0?l.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.headers).sort(([O],[w])=>O.localeCompare(w)).map(([O,w])=>l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[O,":"]}),l.jsx("span",{className:"text-muted-foreground truncate",title:w,children:w})]},O))}):l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No headers captured"})]})}),t==="full"&&l.jsx(tt,{value:"raw-headers",children:l.jsx("div",{className:"px-4 py-3",children:e.rawHeaders&&Object.keys(e.rawHeaders).length>0?l.jsx("div",{className:"space-y-1 font-mono text-xs",children:Object.entries(e.rawHeaders).sort(([O],[w])=>O.localeCompare(w)).map(([O,w])=>l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-semibold shrink-0",children:[O,":"]}),l.jsx("span",{className:"text-muted-foreground truncate",title:w,children:w})]},O))}):l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No raw headers captured"})})}),l.jsx(tt,{value:"raw",children:l.jsxs("div",{className:"px-4 py-3 space-y-3",children:[e.error!==void 0&&e.error!==null&&l.jsxs("div",{className:"rounded border border-destructive/50 bg-destructive/10 p-3 text-xs",children:[l.jsx("div",{className:"font-semibold text-destructive mb-1",children:"SSE Error"}),l.jsx("div",{className:"text-muted-foreground font-mono",children:e.error})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx(Ds,{text:e.responseText,label:"Copy Response",copied:h,onCopy:N})}),e.responseText!==null?l.jsx(fn,{text:e.responseText,defaultExpandDepth:1}):l.jsx("p",{className:"text-xs text-muted-foreground italic",children:"No response"}),e.streaming===!0&&l.jsx(fN,{logId:e.id,truncated:e.streamingChunksPath!==null})]})}),l.jsx(tt,{value:"parsed",children:l.jsx("div",{className:"px-4 py-3",children:l.jsx(to,{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})})})]})})]}),l.jsx(dN,{log:e,open:f,onOpenChange:x})]})});function St({className:e,style:t,d:n,eyeStalks:r,eyes:o,legs:s,extras:i}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:t,className:he("inline-block size-5",e),children:[l.jsx("path",{d:n}),r,o,s,i]})}const un=l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),l.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),l.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),l.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]}),Sp=l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"16",x2:"5.5",y2:"18.5"}),l.jsx("line",{x1:"9.5",y1:"17",x2:"8.5",y2:"19.5"}),l.jsx("line",{x1:"14.5",y1:"17",x2:"15.5",y2:"19.5"}),l.jsx("line",{x1:"17",y1:"16",x2:"18.5",y2:"18.5"})]});function Cp({className:e}){return l.jsx(St,{className:e,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",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function gN({className:e}){return l.jsx(St,{className:e,d:"M4 13 C4 7 7.5 5.5 12 5.5 C16.5 5.5 20 7 20 13 C20 17.5 16.5 19 12 19 C7.5 19 4 17.5 4 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9.5",y1:"6.5",x2:"9.5",y2:"4.5"}),l.jsx("line",{x1:"14.5",y1:"6.5",x2:"14.5",y2:"4.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4",r:"1.1",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4",r:"1.1",fill:"currentColor",stroke:"none"})]}),legs:Sp,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C4 9.5 2.5 10 3 12 C3.5 13.5 4.5 13 5 12"}),l.jsx("path",{d:"M19 11 C20 9.5 21.5 10 21 12 C20.5 13.5 19.5 13 19 12"})]})})}function xN({className:e}){return l.jsx(St,{className:e,d:"M3 13.5 C3 8 7 6 12 6 C17 6 21 8 21 13.5 C21 17 17 19 12 19 C7 19 3 17 3 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"7",x2:"6.5",y2:"4.5"}),l.jsx("line",{x1:"17",y1:"7",x2:"17.5",y2:"4.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"6.5",cy:"4",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"17.5",cy:"4",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M4 12 C2.5 10.5 1 11 1.5 13 C2 14.5 3.5 14 4.5 13"}),l.jsx("path",{d:"M20 12 C21.5 10.5 23 11 22.5 13 C22 14.5 20.5 14 19.5 13"})]})})}function yN({className:e}){return l.jsx(St,{className:e,d:"M6 14 C6 8 9 5.5 12 5.5 C15 5.5 18 8 18 14 C18 18 15 20 12 20 C9 20 6 18 6 14 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"6.5",x2:"10",y2:"3.5"}),l.jsx("line",{x1:"14",y1:"6.5",x2:"14",y2:"3.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"10",cy:"3",r:"0.7",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14",cy:"3",r:"0.7",fill:"currentColor",stroke:"none"})]}),legs:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7",y1:"17",x2:"5",y2:"20.5"}),l.jsx("line",{x1:"9.5",y1:"18.5",x2:"8.5",y2:"21.5"}),l.jsx("line",{x1:"14.5",y1:"18.5",x2:"15.5",y2:"21.5"}),l.jsx("line",{x1:"17",y1:"17",x2:"19",y2:"20.5"})]}),extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M6.5 11 C5 8.5 3 9 3.5 11.5 C4 13.5 5 13 6 12"}),l.jsx("path",{d:"M17.5 11 C19 8.5 21 9 20.5 11.5 C20 13.5 19 13 18 12"})]})})}function vN({className:e}){return l.jsx(St,{className:e,d:"M5 13 C5 9 8 7 12 7 L13 4 L14 7 C16 7 19 9 19 13 C19 16 16 18 13 18 L12 21 L11 18 C8 18 5 16 5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function bN({className:e}){return l.jsx(St,{className:e,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",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("line",{x1:"13.5",y1:"4",x2:"15.5",y2:"5"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"})]})})}function wN({className:e}){return l.jsx(St,{className:e,d:"M5.5 13.5 C5.5 10 8.5 8 12 8 C15.5 8 18.5 10 18.5 13.5 C18.5 16 15.5 17.5 12 17.5 C8.5 17.5 5.5 16 5.5 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"8",x2:"10",y2:"6"}),l.jsx("line",{x1:"14",y1:"8",x2:"14",y2:"6"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9",y1:"6",x2:"11",y2:"6.5"}),l.jsx("line",{x1:"13",y1:"6",x2:"15",y2:"6.5"})]}),legs:Sp,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M6 11.5 C4.5 10.5 3 11 3.5 12.5 C4 13.5 5 13 5.5 12.5"}),l.jsx("path",{d:"M18 11.5 C19.5 10.5 21 11 20.5 12.5 C20 13.5 19 13 18.5 12.5"})]})})}function kN({className:e}){return l.jsx(St,{className:e,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",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.7",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.7",fill:"currentColor",stroke:"none"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("line",{x1:"8.5",y1:"4",x2:"10.5",y2:"4.5"}),l.jsx("line",{x1:"15.5",y1:"4",x2:"13.5",y2:"4.5"}),l.jsx("path",{d:"M9 15.5 C10 14.5 14 14.5 15 15.5"})]})})}function _N({className:e}){return l.jsx(St,{className:e,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",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9.5",cy:"4.5",r:"1.2",fill:"none",stroke:"currentColor"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"1.2",fill:"none",stroke:"currentColor"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("ellipse",{cx:"12",cy:"15",rx:"2",ry:"1.5",fill:"currentColor",stroke:"none"})]})})}function SN({className:e}){return l.jsx(St,{className:e,d:"M4.5 13 C4.5 8 7.5 6 12 6 C16.5 6 19.5 8 19.5 13 C19.5 17 16.5 18.5 12 18.5 C7.5 18.5 4.5 17 4.5 13 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"9.5",y1:"7",x2:"9",y2:"5"}),l.jsx("line",{x1:"14.5",y1:"7",x2:"15",y2:"5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"9",cy:"4.5",r:"1",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"15",cy:"4.5",r:"1",fill:"currentColor",stroke:"none"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9 2 9.5 2.5 12 C3 14 4 13 5 12"}),l.jsx("path",{d:"M19 11 C20.5 9 22 9.5 21.5 12 C21 14 20 13 19 12"}),l.jsx("path",{d:"M9 14.5 C10 16 14 16 15 14.5"}),l.jsx("circle",{cx:"7",cy:"13",r:"1",fill:"currentColor",stroke:"none",opacity:"0.3"}),l.jsx("circle",{cx:"17",cy:"13",r:"1",fill:"currentColor",stroke:"none",opacity:"0.3"})]})})}function CN({className:e}){return l.jsx(St,{className:e,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",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5.5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5.5"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"7.5",y1:"5.5",x2:"16.5",y2:"5.5"}),l.jsx("rect",{x:"7",y:"5",width:"4",height:"2",rx:"0.5",fill:"currentColor",stroke:"none"}),l.jsx("rect",{x:"13",y:"5",width:"4",height:"2",rx:"0.5",fill:"currentColor",stroke:"none"})]}),legs:un,extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("path",{d:"M9.5 15 C10.5 16 13.5 16 14.5 15"})]})})}function jN({className:e}){return l.jsx(St,{className:e,d:"M7 13.5 C7 10.5 9.5 9 12 9 C14.5 9 17 10.5 17 13.5 C17 16 14.5 17.5 12 17.5 C9.5 17.5 7 16 7 13.5 Z",eyeStalks:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"10.5",y1:"9.5",x2:"10.5",y2:"8"}),l.jsx("line",{x1:"13.5",y1:"9.5",x2:"13.5",y2:"8"})]}),eyes:l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"10.5",cy:"7.5",r:"0.8",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"13.5",cy:"7.5",r:"0.8",fill:"currentColor",stroke:"none"})]}),legs:l.jsxs(l.Fragment,{children:[l.jsx("line",{x1:"8",y1:"16",x2:"6.5",y2:"18"}),l.jsx("line",{x1:"10",y1:"17",x2:"9.5",y2:"19"}),l.jsx("line",{x1:"14",y1:"17",x2:"14.5",y2:"19"}),l.jsx("line",{x1:"16",y1:"16",x2:"17.5",y2:"18"})]}),extras:l.jsxs(l.Fragment,{children:[l.jsx("path",{d:"M7.5 12 C6.5 11 5.5 11.5 6 13 C6.5 14 7 13.5 7.5 13"}),l.jsx("path",{d:"M16.5 12 C17.5 11 18.5 11.5 18 13 C17.5 14 17 13.5 16.5 13"})]})})}const xi=[Cp,gN,xN,yN,vN,bN,wN,kN,_N,SN,CN,jN];function EN(e){return xi[Math.abs(e)%xi.length]??Cp}function NN({stopReason:e,isPending:t,isFirst:n,isTurnStart:r,crabIndex:o=0,collapsible:s=!1,collapsed:i=!1,onToggle:a}){const c=e==="end_turn"||e==="stop",u=t&&!c,d=v.useMemo(()=>EN(o),[o]);return l.jsxs("div",{className:"flex flex-col items-center w-6 shrink-0",children:[l.jsx("div",{className:"flex justify-center h-2.5",children:!n&&l.jsx("div",{className:"w-0.5 bg-muted-foreground/30"})}),s&&l.jsx("button",{type:"button",onClick:a,title:i?"Expand turn":"Collapse turn",className:"cursor-pointer flex justify-center py-0.5",children:i?l.jsx(bt,{className:"size-3 text-muted-foreground hover:text-foreground transition-colors"}):l.jsx(yt,{className:"size-3 text-muted-foreground hover:text-foreground transition-colors"})}),l.jsx("div",{className:"flex items-center justify-center py-0.5",children:c?l.jsx("span",{title:e==="end_turn"?"End of Turn (Anthropic)":"End of Turn (OpenAI)",children:l.jsx(d,{className:he("size-3.5 text-amber-400","animate-crab-settle","drop-shadow-[0_0_4px_rgba(251,191,36,0.5)]")})}):r?l.jsx("span",{title:"Start of turn",children:l.jsx(d,{className:he("size-3.5 text-emerald-400","animate-crab-appear","drop-shadow-[0_0_4px_rgba(52,211,153,0.5)]")})}):u?l.jsx("span",{title:"Processing…",children:l.jsx(d,{className:he("size-3.5 text-amber-300/80","animate-crab-crawl")})}):l.jsx(d,{className:"size-3.5 text-muted-foreground/40"})}),l.jsx("div",{className:"flex-1 flex justify-center min-h-1",children:c?l.jsx("div",{className:"w-0.5 bg-muted-foreground/10 h-4"}):l.jsx("div",{className:he("w-0.5 h-full",t?"border-dashed bg-transparent border-l-2 border-muted-foreground/20":"bg-muted-foreground/30")})})]})}function TN({logs:e,viewMode:t,strip:n,cacheTrends:r,onCompareWithPrevious:o,turnIndex:s=0}){const i=v.useMemo(()=>e.map(g=>Ph(g)),[e]),a=e.length-1,c=i[a]??null,u=c!==null?ES(c):!1,d=e[a]?.responseStatus===null,h=u&&!d,[p,f]=v.useState(!1),x=v.useCallback(()=>{h&&f(g=>!g)},[h]),m=v.useMemo(()=>{if(!p)return e;const g=e[a];return g!==void 0?[g]:[]},[e,p,a]),y=s%2===0?"bg-muted/10":"bg-muted/25";return l.jsx("div",{className:he("border rounded-lg",d?"border-amber-500/10":"border-transparent"),children:m.map((g,b)=>{const k=p?a:b,S=i[k]??null,j=S==="end_turn"||S==="stop";return l.jsxs("div",{className:"flex items-stretch",children:[l.jsx(NN,{stopReason:S,isPending:g.responseStatus===null,isFirst:k===0,isTurnStart:k===0,crabIndex:g.id%12,collapsible:h&&j&&e.length>1,collapsed:p,onToggle:x}),l.jsx("div",{className:he("flex-1 min-w-0 mb-2 rounded-lg",y),children:l.jsx(mN,{log:g,viewMode:t,strip:n,cacheTrend:r?.get(g.id)??null,onCompareWithPrevious:()=>o(g)})})]},g.id)})})}function AN(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 IN=v.memo(function({group:e,viewMode:t="simple",strip:n,cacheTrends:r,onCompareWithPrevious:o,standalone:s=!1}){const[i,a]=v.useState(s),c=AN(e.logs),u=e.logs[0]?.timestamp??new Date().toISOString(),d=e.logs[e.logs.length-1]?.timestamp??new Date().toISOString(),h=zS(e.logs),p=e.logs.some(g=>g.responseStatus===null),f=v.useMemo(()=>e.logs.map(g=>Ph(g)),[e.logs]),x=v.useMemo(()=>{const g=[];let b=0;for(let k=0;k<f.length;k++)k>0&&(f[k-1]==="end_turn"||f[k-1]==="stop")&&b++,g.push(b);return g},[f]),m=v.useMemo(()=>{const g=[];let b=[],k=0;for(let S=0;S<e.logs.length;S++){const j=x[S]??0,C=e.logs[S];C&&(j!==k?(b.length>0&&g.push({logs:b,turnIndex:k}),b=[C],k=j):b.push(C))}return b.length>0&&g.push({logs:b,turnIndex:k}),g},[e.logs,x]),y=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 l.jsxs("div",{className:"mb-4",children:[!s&&l.jsx(AS,{conversationId:y,startTime:u,endTime:d,totalCalls:e.logs.length,totalInputTokens:c.totalInputTokens,totalOutputTokens:c.totalOutputTokens,apiFormat:IS(e.logs),expanded:i,onToggle:()=>a(!i),hideApiFormat:h,isLoading:p,userAgent:e.logs[0]?.userAgent??null}),i&&l.jsx("div",{children:m.map(g=>l.jsx(TN,{logs:g.logs,viewMode:t,strip:n,cacheTrends:r,onCompareWithPrevious:o,turnIndex:g.turnIndex},g.turnIndex))})]})});function Oc({className:e}){return l.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:he("inline-block size-5",e),children:[l.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"}),l.jsx("path",{d:"M5 11 C3.5 9.5 1.5 10 2 12.5 C2.5 14 4 13.5 5 12.5"}),l.jsx("path",{d:"M19 11 C20.5 9.5 22.5 10 22 12.5 C21.5 14 20 13.5 19 12.5"}),l.jsx("line",{x1:"10",y1:"7",x2:"9.5",y2:"5"}),l.jsx("line",{x1:"14",y1:"7",x2:"14.5",y2:"5"}),l.jsx("circle",{cx:"9.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("circle",{cx:"14.5",cy:"4.5",r:"0.9",fill:"currentColor",stroke:"none"}),l.jsx("line",{x1:"6.5",y1:"16",x2:"4.5",y2:"19.5"}),l.jsx("line",{x1:"9",y1:"17.5",x2:"8",y2:"20.5"}),l.jsx("line",{x1:"15",y1:"17.5",x2:"16",y2:"20.5"}),l.jsx("line",{x1:"17.5",y1:"16",x2:"19.5",y2:"19.5"})]})}function Dc({...e}){return l.jsx(Zk,{"data-slot":"select",...e})}function Mc({...e}){return l.jsx(Wk,{"data-slot":"select-value",...e})}function Lc({className:e,size:t="default",children:n,...r}){return l.jsxs(Vk,{"data-slot":"select-trigger","data-size":t,className:he("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,l.jsx(Hk,{asChild:!0,children:l.jsx(yt,{className:"size-4 opacity-50"})})]})}function Fc({className:e,children:t,position:n="popper",align:r="center",...o}){return l.jsx(qk,{children:l.jsxs(Kk,{"data-slot":"select-content",className:he("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:[l.jsx(zN,{}),l.jsx(Gk,{className:he("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),l.jsx(RN,{})]})})}function Kr({className:e,children:t,...n}){return l.jsxs(Jk,{"data-slot":"select-item",className:he("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:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(Xk,{children:l.jsx(sn,{className:"size-4"})})}),l.jsx(Yk,{children:t})]})}function zN({className:e,...t}){return l.jsx(Qk,{"data-slot":"select-scroll-up-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Ay,{className:"size-4"})})}function RN({className:e,...t}){return l.jsx(e_,{"data-slot":"select-scroll-down-button",className:he("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(yt,{className:"size-4"})})}function PN(){return l.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"size-6 shrink-0",children:[l.jsx("title",{children:"Claude Code"}),l.jsx("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"})]})}function ON(){return l.jsxs("svg",{fill:"currentColor",fillRule:"evenodd",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"size-6 shrink-0",children:[l.jsx("title",{children:"OpenCode"}),l.jsx("path",{d:"M16 6H8v12h8V6zm4 16H4V2h16v20z"})]})}const DN=ae({name:q(),apiKey:q(),format:lt(["anthropic","openai"]),anthropicBaseUrl:q(),openaiBaseUrl:q(),models:Oe(q()),sourceTool:lt(["claude-code","opencode"]),alreadyExists:nt()}),MN=ae({providers:Oe(DN),warnings:Oe(q()).optional()}),LN=ae({success:nt().optional(),imported:ve().optional(),message:q().optional(),errors:Oe(q()).optional()}),FN={"claude-code":PN,opencode:ON};function BN({open:e,onOpenChange:t,onImportComplete:n}){const[r,o]=v.useState(!1),[s,i]=v.useState(null),[a,c]=v.useState([]),[u,d]=v.useState([]),[h,p]=v.useState(new Set),[f,x]=v.useState(!1),[m,y]=v.useState(null),[g,b]=v.useState(null),k=v.useCallback(()=>{o(!0),i(null),d([]),c([]),p(new Set),y(null),b(null),fetch("/api/providers/scan").then(E=>E.ok?E.json().then(T=>{const R=MN.safeParse(T);if(!R.success){i(`Invalid response: ${R.error.message}`);return}c(R.data.providers),d(R.data.warnings??[]);const M=new Set;R.data.providers.forEach((B,N)=>{B.alreadyExists||M.add(N)}),p(M)}):E.text().then(T=>{i(`Scan failed (${E.status}): ${T}`)})).catch(E=>{i(E instanceof Error?E.message:String(E))}).finally(()=>{o(!1)})},[]);v.useEffect(()=>{e&&k()},[e,k]);const S=v.useCallback(E=>{p(T=>{const R=new Set(T);return R.has(E)?R.delete(E):R.add(E),R})},[]),j=v.useCallback(()=>{const E=a.filter((M,B)=>h.has(B));if(E.length===0)return;x(!0),b(null),y(null);const T=new Date().toISOString(),R=E.map(M=>({id:window.crypto.randomUUID(),name:M.name,apiKey:M.apiKey,format:M.format,anthropicBaseUrl:M.anthropicBaseUrl,openaiBaseUrl:M.openaiBaseUrl,models:M.models,createdAt:T,updatedAt:T}));fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providers:R})}).then(M=>M.json()).then(M=>{const B=LN.safeParse(M);if(!B.success){b(`Invalid response: ${B.error.message}`);return}const N=B.data;c(O=>O.map((w,D)=>h.has(D)?{...w,alreadyExists:!0}:w)),p(new Set),N.errors!==void 0&&N.errors.length>0&&N.message!==void 0?y(N.message):y(`Imported ${N.imported??E.length} provider(s)`),n()}).catch(M=>{b(M instanceof Error?M.message:String(M))}).finally(()=>{x(!1)})},[a,h,n]),C=a.some(E=>!E.alreadyExists);return l.jsx(es,{open:e,onOpenChange:t,children:l.jsxs(ts,{className:"max-w-xl max-h-[80vh] overflow-hidden flex flex-col",children:[l.jsxs(ns,{children:[l.jsx(rs,{children:"Import from External Tools"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Detect provider configurations from Claude Code and OpenCode."})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto space-y-3",children:[r&&l.jsxs("div",{className:"flex items-center justify-center py-8 gap-2 text-muted-foreground",children:[l.jsx(br,{className:"size-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:"Scanning for external providers..."})]}),s!==null&&l.jsxs("div",{className:"flex items-center gap-2 text-destructive text-sm py-4",children:[l.jsx(vr,{className:"size-4"}),s]}),!r&&s===null&&a.length===0&&l.jsxs("p",{className:"text-sm text-muted-foreground py-8 text-center",children:["No external provider configurations found.",l.jsx("br",{}),l.jsx("span",{className:"text-xs",children:"Supported tools: Claude Code (~/.claude/settings.json), OpenCode (~/.config/opencode/opencode.json)"})]}),!r&&a.map((E,T)=>l.jsxs("label",{className:`flex items-start gap-3 p-3 border rounded-md ${E.alreadyExists?"":"cursor-pointer hover:bg-muted/50"}`,children:[!E.alreadyExists&&l.jsx("input",{type:"checkbox",checked:h.has(T),disabled:f,onChange:()=>S(T),className:"mt-0.5 size-4"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[(()=>{const R=FN[E.sourceTool];return R===void 0?null:l.jsx(R,{})})(),E.alreadyExists&&l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Already added"})]}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1 truncate",children:[E.models.slice(0,4).join(", "),E.models.length>4?` +${E.models.length-4} more`:""]}),l.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:E.format==="anthropic"?E.anthropicBaseUrl:E.openaiBaseUrl}),l.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 font-mono",children:E.apiKey.length>8?`${E.apiKey.slice(0,4)}••••${E.apiKey.slice(-4)}`:"••••"})]})]},`${E.sourceTool}-${E.name}`)),u.length>0&&l.jsx("div",{className:"text-xs text-muted-foreground space-y-1 border-t pt-2",children:u.map((E,T)=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(vr,{className:"size-3"}),E]},T))}),m!==null&&l.jsx("div",{className:"text-sm text-green-500 border-t pt-2",children:m}),g!==null&&l.jsx("div",{className:"text-sm text-destructive border-t pt-2",children:g})]}),l.jsxs("div",{className:"flex items-center justify-between pt-3 border-t",children:[l.jsxs(Xe,{variant:"outline",size:"sm",onClick:k,disabled:r,children:[l.jsx(br,{className:`size-3 mr-1 ${r?"animate-spin":""}`}),"Rescan"]}),l.jsxs(Xe,{size:"sm",onClick:j,disabled:!C||h.size===0||f,children:[l.jsx(Ri,{className:"size-3 mr-1"}),f?"Importing...":`Import Selected (${h.size})`]})]})]})})}function $N({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o="Confirm",variant:s="default",onConfirm:i}){return l.jsx(es,{open:e,onOpenChange:t,children:l.jsxs(ts,{children:[l.jsx(ns,{children:l.jsx(rs,{children:n})}),l.jsx("p",{className:"text-sm text-muted-foreground",children:r}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx(Xe,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Cancel"}),l.jsx(Xe,{variant:s,size:"sm",onClick:()=>{i(),t(!1)},children:o})]})]})})}function jp(e){return e.length<=8?"••••••••":e.slice(0,4)+"••••••••"+e.slice(-4)}const UN={deepseek:"https://api-docs.deepseek.com/zh-cn/"};function ZN(e){return Object.prototype.hasOwnProperty.call(e,"success")}function VN(e){return Object.prototype.hasOwnProperty.call(e,"notConfigured")}function WN(e){const t={className:"size-3",strokeWidth:2};switch(e){case"timeout":return l.jsx(Ao,{...t});case"network_unreachable":return l.jsx(zv,{...t});case"connection_refused":return l.jsx(Pv,{...t});case"auth_failed":return l.jsx(iv,{...t});case"rate_limited":return l.jsx(ev,{...t});case"server_error":return l.jsx(vv,{...t});case"invalid_response":return l.jsx(Fy,{...t});case"unknown":return l.jsx(vr,{...t});default:return l.jsx(vr,{...t})}}function Gr({result:e}){const[t,n]=v.useState(!1);if(!ZN(e))return VN(e)?l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[l.jsx(Di,{className:"size-3"}),l.jsx("span",{children:"Not configured"})]}):l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[l.jsx(Gu,{className:"size-3 animate-spin"}),l.jsx("span",{children:"Testing..."})]});if(e.success){const c=[];e.inputTokens!==void 0&&c.push(l.jsxs("span",{children:[e.inputTokens," in"]},"in")),e.outputTokens!==void 0&&c.push(l.jsxs("span",{children:[e.outputTokens," out"]},"out")),e.cacheCreationInputTokens!==void 0&&e.cacheCreationInputTokens>0&&c.push(l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"font-mono tabular-nums text-emerald-400",children:["+",e.cacheCreationInputTokens," cache"]})}),l.jsx(Re,{children:"Tokens cached for reuse, reducing future API cost"})]})},"cache-create")),e.cacheReadInputTokens!==void 0&&e.cacheReadInputTokens>0&&c.push(l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("span",{className:"font-mono tabular-nums text-purple-400",children:["~",e.cacheReadInputTokens," cached"]})}),l.jsx(Re,{children:"Tokens served from cache, reducing API cost"})]})},"cache-read"));const u=[];for(let d=0;d<c.length;d++)d>0&&u.push(", "),u.push(c[d]);return l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 shrink-0",children:[l.jsx(My,{className:"size-3"}),l.jsx("span",{children:"Connected"}),c.length>0&&l.jsxs("span",{className:"text-muted-foreground",children:["(",u,")"]})]})}),l.jsx(Re,{children:"Connection test passed"})]})})}const r=e.error,o=r?.message??"Connection failed",s=r?.hint,i=r?.details,a=r?.type??"unknown";return l.jsxs("div",{className:"flex flex-col gap-1 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600 max-w-[200px]",children:[WN(a),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("span",{className:"truncate",children:o})}),l.jsx(Re,{children:"Connection test failed"})]})}),i!==void 0&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>n(!t),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:t?l.jsx(Pi,{className:"size-3"}):l.jsx(Oi,{className:"size-3"})})}),l.jsx(Re,{children:t?"Hide error details":"Show detailed error information"})]})})]}),t&&i!==void 0&&l.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded p-2 max-w-[300px]",children:[s!==void 0&&l.jsx("div",{className:"mb-1",children:s}),l.jsx("div",{className:"font-mono whitespace-pre-wrap break-all text-red-400/80",children:i})]})]})}function HN(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n,o=Math.floor(r/1e3);if(o<60)return"just now";const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function qN({provider:e,testResults:t,isTesting:n,testingTimeLeft:r,isHighlighted:o,onEdit:s,onDelete:i,onTest:a}){const[c,u]=v.useState(!1),[d,h]=v.useState(!1),[p,f]=v.useState(!1),x=v.useRef(null),m=v.useRef(void 0);t?.testedAt!==void 0&&t.testedAt!==m.current&&(m.current=t.testedAt,x.current=null);const y=v.useCallback(()=>{f(k=>{const S=!k;return S&&x.current===null&&t?.models!==void 0&&(x.current=t.testedAt??"",fetch(`/api/providers/${e.id}/test/log`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})),S})},[e.id,t]);function g(){navigator.clipboard.writeText(e.apiKey).catch(()=>{}),h(!0),setTimeout(()=>h(!1),2e3)}const b=e.apiDocsUrl??Object.entries(UN).find(([k])=>e.name.toLowerCase().includes(k))?.[1];return l.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:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("span",{className:"font-medium truncate",children:e.name}),e.source==="company"&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400 shrink-0",children:"公司"})}),l.jsx(Re,{children:"Company-provided API key"})]})}),e.source==="personal"&&l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 shrink-0",children:"个人"})}),l.jsx(Re,{children:"Your personal API key"})]})})]}),b!==void 0&&l.jsxs("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1 text-xs",title:"View API documentation",children:[l.jsx(Ky,{className:"size-3"}),l.jsx("span",{className:"sr-only",children:"Docs"})]})]}),e.models!==void 0&&e.models.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1",children:e.models.map(k=>l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:k},k))}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded flex-1 truncate",children:c?e.apiKey:jp(e.apiKey)}),l.jsx("button",{type:"button",onClick:()=>u(k=>!k),className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":c?"Hide API key":"Show API key",children:c?l.jsx(Pi,{className:"size-4"}):l.jsx(Oi,{className:"size-4"})}),l.jsx("button",{type:"button",onClick:g,className:"text-muted-foreground hover:text-foreground transition-colors p-1","aria-label":"Copy API key",children:d?l.jsx(sn,{className:"size-4 text-green-500"}):l.jsx(bn,{className:"size-4"})})]}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[l.jsx("span",{className:"font-medium",children:"Anthropic:"})," ",l.jsx("span",{className:"truncate",children:e.anthropicBaseUrl})]}),t&&l.jsx(Gr,{result:t.anthropic.nonStreaming})]}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"text-xs text-muted-foreground min-w-0 flex-1",children:[l.jsx("span",{className:"font-medium",children:"OpenAI:"})," ",l.jsx("span",{className:"truncate",children:e.openaiBaseUrl})]}),t&&l.jsx(Gr,{result:t.openai.nonStreaming})]}),t?.testedAt!==void 0&&l.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[l.jsx(Ao,{className:"size-3"}),l.jsxs("span",{children:["Tested ",HN(t.testedAt)]})]}),t?.models!==void 0&&Object.keys(t.models).length>0&&l.jsxs("div",{className:"border-t pt-2",children:[l.jsxs("button",{type:"button",onClick:y,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:[l.jsx("span",{className:"font-mono",children:p?"▾":"▸"}),"Model Test Results (",Object.keys(t.models).length,")"]}),p&&l.jsx("div",{className:"mt-2 overflow-x-auto",children:l.jsxs("table",{className:"w-full text-xs border-collapse",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border",children:[l.jsx("th",{className:"text-left py-1 px-2 font-medium text-muted-foreground",children:"Model"}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&l.jsx("th",{className:"text-left py-1 px-2 font-medium text-muted-foreground",children:"Anthropic"}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&l.jsx("th",{className:"text-left py-1 px-2 font-medium text-muted-foreground",children:"OpenAI"})]})}),l.jsx("tbody",{children:Object.entries(t.models).map(([k,S])=>l.jsxs("tr",{className:"border-b border-border/50 last:border-0",children:[l.jsx("td",{className:"py-1 px-2 font-medium",children:k}),e.anthropicBaseUrl!==void 0&&e.anthropicBaseUrl!==""&&l.jsx("td",{className:"py-1 px-2",children:l.jsx(Gr,{result:S.anthropic.nonStreaming})}),e.openaiBaseUrl!==void 0&&e.openaiBaseUrl!==""&&l.jsx("td",{className:"py-1 px-2",children:l.jsx(Gr,{result:S.openai.nonStreaming})})]},k))})]})})]}),l.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[a!==void 0&&l.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>a(e.id),className:"text-xs h-7 gap-1",disabled:n??!1,children:[l.jsx(Gu,{className:`size-3 ${n??!1?"animate-spin":""}`}),n??!1?r!==void 0?`Testing (${r}s)`:"Testing...":"Test"]}),l.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>s(e),className:"text-xs h-7 gap-1",disabled:n??!1,children:[l.jsx(Mi,{className:"size-3"}),"Edit"]}),l.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>i(e.id),className:"text-xs h-7 gap-1 text-destructive hover:text-destructive",disabled:n??!1,children:[l.jsx(Sv,{className:"size-3"}),"Delete"]})]})]})}const KN={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"}},Bc=["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"],$c=["glm-5","glm-5.1","qwen3.6-plus","qwen3.7-max"];function GN({provider:e,onSubmit:t,onCancel:n}){const[r,o]=v.useState(e?.name??""),[s,i]=v.useState(e?.apiKey??""),[a,c]=v.useState(!1),[u,d]=v.useState(!1),h=e?.models,[p,f]=v.useState(h!==void 0&&h.length>0?h:[""]),[x,m]=v.useState("anthropic"),[y,g]=v.useState(e?.anthropicBaseUrl??""),[b,k]=v.useState(e?.openaiBaseUrl??""),[S,j]=v.useState(e?.apiDocsUrl??""),[C,E]=v.useState(e?.source),[T,R]=v.useState({}),[M,B]=v.useState(!1),[N,O]=v.useState(null),w=v.useRef([]);v.useEffect(()=>{if(N===null)return;const J=N;function de(te){if(!(te.target instanceof Node))return;const ce=w.current[J];ce!=null&&!ce.contains(te.target)&&O(null)}return document.addEventListener("mousedown",de),()=>document.removeEventListener("mousedown",de)},[N]);const[D,X]=v.useState(!1),[W,H]=v.useState(!1),Y=r.toLowerCase().includes("minimax"),A=r.toLowerCase().includes("alibaba");function V(){navigator.clipboard.writeText(s).catch(()=>{}),d(!0),setTimeout(()=>d(!1),2e3)}v.useEffect(()=>{e&&(o(e.name),i(e.apiKey),f((e.models?.length??0)>0?e.models:[""]),g(e.anthropicBaseUrl??""),k(e.openaiBaseUrl??""),j(e.apiDocsUrl??""),E(e.source),X(!1),H(!1))},[e]),v.useEffect(()=>{const J=r.toLowerCase();for(const[de,te]of Object.entries(KN))if(J.includes(de)){te.format==="anthropic"&&!D?g(te.baseUrl):te.format==="openai"&&!W&&k(te.baseUrl),te.apiDocsUrl!==void 0&&!S&&j(te.apiDocsUrl),de==="minimax"&&p.length===1&&p[0]===""&&f([Bc[0]??""]),de==="alibaba"&&p.length===1&&p[0]===""&&f([$c[0]??""]);break}},[r]);function Z(){const J={};return r.trim()||(J.name="Name is required"),s.trim()||(J.apiKey="API key is required"),(p.length===0||p.every(de=>!de.trim()))&&(J.models="At least one model is required"),y.trim()&&!I(y.trim())&&(J.anthropicBaseUrl="Invalid URL format"),b.trim()&&!I(b.trim())&&(J.openaiBaseUrl="Invalid URL format"),!y.trim()&&!b.trim()&&(J.format="At least one format URL (Anthropic or OpenAI) is required"),R(J),Object.keys(J).length===0}function I(J){try{return new URL(J),!0}catch{return!1}}function oe(J){if(J.preventDefault(),!!Z()){B(!0);try{t({name:r.trim(),apiKey:s.trim(),models:p.map(de=>de.trim()).filter(de=>de!==""),anthropicBaseUrl:y.trim()||void 0,openaiBaseUrl:b.trim()||void 0,apiDocsUrl:S.trim()||void 0,source:C})}finally{B(!1)}}}return l.jsxs("form",{onSubmit:oe,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{htmlFor:"provider-name",className:"text-sm font-medium",children:["Name ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx("input",{id:"provider-name",type:"text",value:r,onChange:J=>o(J.target.value),placeholder:"Provider Name",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),T.name!==void 0&&l.jsx("p",{className:"text-xs text-destructive",children:T.name})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"provider-source",className:"text-sm font-medium",children:"Token Source"}),l.jsxs("select",{id:"provider-source",value:C??"",onChange:J=>E(J.target.value==="company"||J.target.value==="personal"?J.target.value:void 0),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",children:[l.jsx("option",{value:"",children:"—"}),l.jsx("option",{value:"personal",children:"个人 (Personal)"}),l.jsx("option",{value:"company",children:"公司 (Company)"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Label whether this API key is company-provided or personal."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{htmlFor:"provider-apikey",className:"text-sm font-medium",children:["API Key ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{id:"provider-apikey",type:"text",value:a||s.length===0?s:jp(s),onChange:J=>i(J.target.value),onFocus:()=>{!a&&s.length>0&&c(!0)},placeholder:"sk-ant-...",readOnly:!a&&s.length>0,className:"flex-1 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),l.jsx("button",{type:"button",onClick:()=>c(J=>!J),className:"text-muted-foreground hover:text-foreground transition-colors p-1 shrink-0","aria-label":a?"Hide API key":"Show API key",children:a?l.jsx(Pi,{className:"size-4"}):l.jsx(Oi,{className:"size-4"})}),l.jsx("button",{type:"button",onClick:V,className:"text-muted-foreground hover:text-foreground transition-colors p-1 shrink-0","aria-label":"Copy API key",children:u?l.jsx(sn,{className:"size-4 text-green-500"}):l.jsx(bn,{className:"size-4"})})]}),T.apiKey!==void 0&&l.jsx("p",{className:"text-xs text-destructive",children:T.apiKey})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-sm font-medium",children:["Models ",l.jsx("span",{className:"text-destructive",children:"*"})]}),p.map((J,de)=>l.jsxs("div",{ref:te=>{w.current[de]=te},className:"flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{type:"text",value:J,onChange:te=>{f(ce=>{const fe=[...ce];return fe[de]=te.target.value,fe})},placeholder:Y||A?"Type or select a model...":"Model name",className:"w-full rounded-md border border-input bg-background px-4 py-3 pr-8 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),(Y||A)&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:()=>O(N===de?null:de),className:"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors p-1 z-10","aria-label":"Show model suggestions",children:l.jsx(yt,{className:"size-4"})}),N===de&&l.jsx("div",{className:"absolute left-0 right-0 top-full mt-1 z-50 bg-popover border border-border rounded-md shadow-md max-h-48 overflow-y-auto",children:(Y?Bc:$c).map(te=>l.jsx("button",{type:"button",onClick:()=>{f(ce=>{const fe=[...ce];return fe[de]=te,fe}),O(null)},className:"w-full text-left px-3 py-2 text-sm hover:bg-muted transition-colors",children:te},te))})]})]}),p.length>1&&l.jsx("button",{type:"button",onClick:()=>f(te=>te.filter((ce,fe)=>fe!==de)),className:"text-muted-foreground hover:text-destructive transition-colors p-1 shrink-0","aria-label":"Remove model",children:l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M3 6h18"}),l.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),l.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})]})})]},de)),l.jsx("button",{type:"button",onClick:()=>f(J=>[...J,""]),className:"text-xs text-primary hover:underline flex items-center gap-1",children:"+ Add Model"}),T.models!==void 0&&l.jsx("p",{className:"text-xs text-destructive",children:T.models})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex gap-1 border-b border-border",children:[l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>m("anthropic"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${x==="anthropic"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Anthropic Format"})}),l.jsx(Re,{children:"Anthropic Messages API protocol"})]})}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>m("openai"),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${x==="openai"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"OpenAI Format"})}),l.jsx(Re,{children:"OpenAI Chat Completions API protocol"})]})})]}),T.format!==void 0&&l.jsx("p",{className:"text-xs text-destructive",children:T.format})]}),x==="anthropic"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"provider-anthropic-base-url",className:"text-sm font-medium",children:"Anthropic Base URL"}),l.jsx("input",{id:"provider-anthropic-base-url",type:"text",value:y,onChange:J=>{X(!0),g(J.target.value)},placeholder:"https://api.anthropic.com",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),T.anthropicBaseUrl!==void 0&&l.jsx("p",{className:"text-xs text-destructive",children:T.anthropicBaseUrl}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Anthropic-compatible endpoint URL. Leave empty if this provider does not support Anthropic format."})]}),x==="openai"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"provider-openai-base-url",className:"text-sm font-medium",children:"OpenAI Base URL"}),l.jsx("input",{id:"provider-openai-base-url",type:"text",value:b,onChange:J=>{H(!0),k(J.target.value)},placeholder:"https://api.openai.com/v1",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:border-ring focus-visible:outline-ring focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50"}),T.openaiBaseUrl!==void 0&&l.jsx("p",{className:"text-xs text-destructive",children:T.openaiBaseUrl}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"OpenAI-compatible endpoint URL. Leave empty if this provider does not support OpenAI format."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"provider-api-docs-url",className:"text-sm font-medium",children:"API Docs URL"}),l.jsx("input",{id:"provider-api-docs-url",type:"text",value:S,onChange:J=>j(J.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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional API documentation URL. If not set, uses known provider docs."})]}),l.jsxs("div",{className:"sticky bottom-0 bg-card border-t flex gap-2 justify-end pt-2 pb-2",children:[l.jsx(Xe,{type:"button",variant:"outline",onClick:n,disabled:M,children:"Cancel"}),l.jsx(Xe,{type:"submit",disabled:M,children:M?"Saving...":e?"Update Provider":"Add Provider"})]})]})}const yi=ae({id:q(),name:q(),apiKey:q(),model:q().optional(),models:Oe(q()).min(1),format:lt(["anthropic","openai"]).optional(),baseUrl:q().optional(),anthropicBaseUrl:q().optional(),openaiBaseUrl:q().optional(),authHeader:lt(["bearer","x-api-key"]).optional().default("bearer"),apiDocsUrl:q().optional(),source:lt(["company","personal"]).optional(),createdAt:q(),updatedAt:q()}),JN=lt(["timeout","network_unreachable","connection_refused","auth_failed","rate_limited","server_error","invalid_response","unknown"]),YN=ae({message:q(),type:JN,details:q().optional(),hint:q().optional()}),XN=ae({type:lt(["text","thinking"]),text:q().optional(),thinking:q().optional()}),QN=ae({success:nt(),error:YN.optional(),model:q().optional(),inputTokens:ve().optional(),outputTokens:ve().optional(),cacheCreationInputTokens:ve().optional(),cacheReadInputTokens:ve().optional(),latencyMs:ve().optional(),content:Oe(XN).optional(),rawResponse:q().optional(),streaming:nt().optional(),streamingChunks:ae({chunks:Oe(Lu),truncated:nt().default(!1)}).optional(),requestHeaders:Wt(q(),q()).optional()}),Uc=Kt([QN,ae({notConfigured:Se(!0)}),ae({testing:Se(!0)})]),So=ae({nonStreaming:Uc,streaming:Uc}),e4=ae({anthropic:So,openai:So}),t4=ae({anthropic:So,openai:So,models:Wt(q(),e4).optional(),testedAt:q().optional()});function n4(){return{anthropic:{nonStreaming:{testing:!0},streaming:{testing:!0}},openai:{nonStreaming:{testing:!0},streaming:{testing:!0}}}}function Zc(e,t){const n=()=>({nonStreaming:{success:!1,error:{message:e,type:t}},streaming:{notConfigured:!0}});return{anthropic:n(),openai:n()}}const r4=ae({providerConfig:q()}),o4=ae({success:nt().optional(),imported:ve().optional(),message:q().optional(),errors:Oe(q()).optional()}),s4=30,Ms="Network error: could not reach the server. Is the proxy running?";function Vc(e){return{name:e.name,apiKey:e.apiKey,models:e.models,anthropicBaseUrl:(e.anthropicBaseUrl?.length??0)>0?e.anthropicBaseUrl:void 0,openaiBaseUrl:(e.openaiBaseUrl?.length??0)>0?e.openaiBaseUrl:void 0,apiDocsUrl:(e.apiDocsUrl?.length??0)>0?e.apiDocsUrl:void 0,source:e.source}}function i4({externalProviders:e,isLoading:t=!1,externalTestResults:n,externalTestingProviders:r,externalTestingTimeLeft:o,onProvidersMutate:s,onTestResultsChange:i,onTestingProvidersChange:a,onTestingTimeLeftChange:c}){const[u,d]=v.useState(!1),[h,p]=v.useState(),[f,x]=v.useState(null),[m,y]=v.useState({}),[g,b]=v.useState(new Set),[k,S]=v.useState({}),[j,C]=v.useState(null),[E,T]=v.useState(!1),[R,M]=v.useState(null),[B,N]=v.useState(!1),[O,w]=v.useState(!1),[D,X]=v.useState(null),[W,H]=v.useState("all"),Y=v.useRef(null),A=v.useRef(null),V=e??[],Z=v.useMemo(()=>{const $=W==="all"?V:V.filter(G=>G.source===W);return W==="all"?[...$].sort((G,F)=>{const ne={personal:0,company:1};return(ne[G.source??""]??2)-(ne[F.source??""]??2)}):$},[V,W]),I=n??m,oe=r??g,J=o??k,de=c?($,G)=>c($,G):($,G)=>{S(G===void 0?F=>{const ne={...F};return delete ne[$],ne}:F=>({...F,[$]:G}))};v.useEffect(()=>{(async()=>{try{const $=await fetch("/api/config/paths");if($.ok){const G=await An($,r4);C(G.providerConfig)}}catch{}})()},[]);const te=v.useCallback($=>{A.current!==null&&clearTimeout(A.current),M($),Y.current?.scrollTo({top:Y.current.scrollHeight,behavior:"smooth"}),A.current=setTimeout(()=>{M(null),A.current=null},2e3)},[]);v.useEffect(()=>()=>{A.current!==null&&clearTimeout(A.current)},[]);const ce=v.useCallback(()=>{s?.().catch(()=>{})},[s]),fe=v.useCallback(($,G)=>{i?i($,G):y(F=>({...F,[$]:G}))},[i]),ge=v.useCallback(($,G)=>{if(a){a($,G);return}b(F=>{const ne=new Set(F);return G?ne.add($):ne.delete($),ne})},[a]),xe=v.useCallback(async $=>{fe($,n4()),ge($,!0);const G=new AbortController;let F=s4;de($,F);const ne=setInterval(()=>{F--,de($,F),F<=0&&(clearInterval(ne),G.abort())},1e3);try{const le=await fetch(`/api/providers/${$}/test`,{method:"POST",signal:G.signal});if(le.ok){const se=await An(le,t4);fe($,se)}else fe($,Zc(`HTTP ${le.status}: ${le.statusText}`,"server_error"))}catch(le){le instanceof Error&&le.name==="AbortError"&&fe($,Zc("Request timed out","timeout"))}finally{clearInterval(ne),de($,void 0),ge($,!1)}},[de,fe,ge]);function Ee($){(async()=>{try{const G=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Vc($))});if(!G.ok){x(await Jr(G,"Failed to add provider"));return}const F=await An(G,yi);d(!1),te(F.id),ce(),await xe(F.id)}catch{x(Ms)}})()}function Fe($){h&&(async()=>{try{const G=await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Vc($))});if(!G.ok){x(await Jr(G,"Failed to update provider"));return}const F=await An(G,yi);p(void 0),te(F.id),ce(),(($.apiKey??"")!==(h.apiKey??"")||JSON.stringify($.models)!==JSON.stringify(h.models)||($.anthropicBaseUrl??"")!==(h.anthropicBaseUrl??"")||($.openaiBaseUrl??"")!==(h.openaiBaseUrl??""))&&await xe(F.id)}catch{x(Ms)}})()}function _($){X($),w(!0)}function ee(){const $=D;$!==null&&(async()=>{let G;try{G=await fetch(`/api/providers/${$}`,{method:"DELETE"})}catch{x(Ms);return}if(!G.ok){x(await Jr(G,"Failed to delete provider"));return}ce()})()}const K=v.useRef(null);function P($){const G="/api/providers/export";(async()=>{try{const F=await fetch(G);if(!F.ok){x("Failed to export providers");return}const ne=await F.blob(),le=URL.createObjectURL(ne),se=document.createElement("a");se.href=le,se.download=F.headers.get("Content-Disposition")?.match(/filename="(.+)"/)?.[1]??"providers.json",document.body.appendChild(se),se.click(),document.body.removeChild(se),URL.revokeObjectURL(le)}catch{x("Failed to export providers")}})()}function z(){K.current?.click()}function L($){const G=$.target.files?.[0];G&&(async()=>{try{const F=await G.text(),ne=await fetch("/api/providers/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F)}),le=await An(ne,o4);ne.ok&&le.imported!==void 0&&le.imported>0?(ce(),x(null)):le.errors&&le.errors.length>0?x(le.errors.join("; ")):x(le.message??"Import failed")}catch{x("Failed to import providers")}$.target.value=""})()}return t?l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading providers..."})}):u||h?l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"flex items-center justify-between sticky top-0 bg-background z-10 pb-2",children:l.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Provider":"Add New Provider"})}),l.jsx(GN,{provider:h,onSubmit:h?Fe:Ee,onCancel:()=>{d(!1),p(void 0)}})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between sticky top-0 z-10 bg-background pb-2",children:[l.jsx("h3",{className:"text-lg font-medium",children:"Providers"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>P(),className:"gap-1 hover:bg-muted",children:[l.jsx(Ri,{className:"size-3"}),"Export"]})}),l.jsx(Re,{children:"Download providers as JSON for backup or sharing"})]})}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs(Xe,{variant:"outline",size:"sm",onClick:z,className:"gap-1 hover:bg-muted",children:[l.jsx(Nv,{className:"size-3"}),"Import"]})}),l.jsx(Re,{children:"Import providers from an exported JSON file"})]})}),l.jsx("input",{type:"file",ref:K,accept:".json",onChange:L,style:{display:"none"}}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs(Xe,{variant:"outline",size:"sm",onClick:()=>N(!0),className:"gap-1",children:[l.jsx(xv,{className:"size-3"}),"Scan"]})}),l.jsx(Re,{children:"Detect and import provider configs from Claude Code and OpenCode"})]})}),l.jsxs(Xe,{onClick:()=>d(!0),size:"sm",className:"gap-1",children:[l.jsx(lo,{className:"size-4"}),"Add Provider"]})]})]}),j!==null&&l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/30 rounded-md px-3 py-2",children:[l.jsx("span",{className:"shrink-0",children:"Config:"}),l.jsx("span",{className:"font-mono truncate",title:j,children:j}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>{window.navigator.clipboard.writeText(j).then(()=>{T(!0),setTimeout(()=>T(!1),2e3)})},className:"shrink-0 ml-auto text-muted-foreground hover:text-foreground transition-colors",children:E?l.jsx(sn,{className:"size-3 text-green-500"}):l.jsx(bn,{className:"size-3"})})}),l.jsx(Re,{children:"Copy config file path to clipboard"})]})})]}),f!==null&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive bg-destructive/10 rounded-md px-3 py-2",children:[l.jsx(vr,{className:"size-4 shrink-0"}),f]}),V.length===0?l.jsxs("div",{className:"text-center py-12 space-y-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured yet."}),l.jsxs(Xe,{onClick:()=>d(!0),variant:"outline",size:"sm",children:[l.jsx(lo,{className:"size-4"}),"Add Your First Provider"]})]}):l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex gap-1 border-b border-border",children:["all","personal","company"].map($=>l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsx("button",{type:"button",onClick:()=>H($),className:`px-3 py-2 text-sm font-medium border-b-2 transition-colors ${W===$?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"}`,children:$==="all"?"All":$==="personal"?"Personal":"Company"})}),l.jsx(Re,{children:$==="all"?"Show all providers":$==="personal"?"Providers you configured yourself":"Providers set by your organization"})]})},$))}),l.jsx("div",{ref:Y,className:"space-y-3",children:Z.map($=>l.jsx(qN,{provider:$,testResults:I[$.id],isTesting:oe.has($.id),testingTimeLeft:J[$.id],isHighlighted:$.id===R,onEdit:G=>p(G),onDelete:_,onTest:G=>{xe(G)}},$.id))})]}),l.jsx(BN,{open:B,onOpenChange:N,onImportComplete:()=>{s!==void 0&&s()}}),l.jsx($N,{open:O,onOpenChange:w,title:"Delete Provider",description:"Are you sure you want to delete this provider? This action cannot be undone.",confirmLabel:"Delete",variant:"destructive",onConfirm:ee})]})}async function a4(e){return zi(e,yi.array(),void 0,t=>`Failed to fetch ${e}: ${t.status}`)}function l4(){const e=Jc("/api/providers",a4,{revalidateOnFocus:!1,revalidateIfStale:!1});return{providers:e.data??[],isLoading:e.isLoading,isError:e.error,mutate:e.mutate}}function c4(){const[e,t]=v.useState(!1),[n,r]=v.useState("providers"),{providers:o,isLoading:s,mutate:i}=l4(),[a,c]=v.useState({}),[u,d]=v.useState(new Set),[h,p]=v.useState({}),f=v.useCallback((y,g)=>{c(b=>({...b,[y]:g}))},[]),x=v.useCallback((y,g)=>{d(b=>{const k=new Set(b);return g?k.add(y):k.delete(y),k})},[]),m=v.useCallback((y,g)=>{p(b=>{if(g===void 0){const k={...b};return delete k[y],k}return{...b,[y]:g}})},[]);return l.jsxs(es,{open:e,onOpenChange:t,children:[l.jsx(VE,{asChild:!0,children:l.jsxs(Xe,{variant:"ghost",size:"icon",className:"size-8",children:[l.jsx(wv,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Settings"})]})}),l.jsxs(ts,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[l.jsx(ns,{children:l.jsx(rs,{children:"Settings"})}),l.jsxs(Rn,{value:n,onValueChange:r,className:"flex-1 overflow-hidden",children:[l.jsxs(Pn,{children:[l.jsx(et,{value:"providers",children:"Providers"}),l.jsx(et,{value:"proxy",children:"Proxy"})]}),l.jsxs("div",{className:"mt-4 overflow-y-auto flex-1 pr-3",children:[l.jsx(tt,{value:"providers",children:l.jsx(i4,{externalProviders:o,isLoading:s,externalTestResults:a,externalTestingProviders:u,externalTestingTimeLeft:h,onProvidersMutate:()=>i(),onTestResultsChange:f,onTestingProvidersChange:x,onTestingTimeLeftChange:m})}),l.jsx(tt,{value:"proxy",children:l.jsx(u4,{})})]})]})]})]})}function u4(){const{strip:e,isLoading:t,setStrip:n}=Bu(),[r,o]=v.useState(null),[s,i]=v.useState(!1),a=v.useCallback(async c=>{o(null),i(!0);try{await n(c)}catch(u){o(u instanceof Error?u.message:String(u))}finally{i(!1)}},[n]);return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Claude Code billing header"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["When enabled, the proxy strips the synthetic ",l.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 ",l.jsx("code",{children:"LLM_INSPECTOR_STRIP_CLAUDE_CODE_BILLING_HEADER"})," environment variable; your choice is persisted to ",l.jsx("code",{children:"config.json"})," and overrides the env var for subsequent requests."]})]}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("label",{className:"flex items-center gap-3",children:[l.jsx("input",{type:"checkbox",role:"switch",checked:e,disabled:t||s,onChange:c=>{a(c.currentTarget.checked)},className:"size-4 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50"}),l.jsx("span",{className:"text-sm",children:t?"Loading…":e?"Stripping enabled":"Stripping disabled"})]})}),l.jsx(Re,{children:"Strip Claude Code billing header to improve cache hit rates"})]})}),r!==null&&l.jsxs("p",{className:"text-xs text-destructive",children:["Failed to save: ",r]})]})}function d4(e){const t=new Map;for(const n of e){const r=n.logs;for(let o=1;o<r.length;o++){const s=r[o-1],i=r[o];s===void 0||i===void 0||t.set(i.id,{creation:Wc(s.cacheCreationInputTokens,i.cacheCreationInputTokens),read:Wc(s.cacheReadInputTokens,i.cacheReadInputTokens)})}}return t}function Wc(e,t){return t===null||e===null?null:t>e?{direction:"up",delta:t-e}:t<e?{direction:"down",delta:e-t}:null}const f4="";function dr(e){if(e.length===0)return f4;let t="";for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(typeof r=="number"?t+=`[${r}]`:n===0?t+=r:t+=`.${r}`)}return t}function h4(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Hc(e){if(typeof e=="string")try{return Co(JSON.parse(e))}catch{return{kind:"primitive",value:e}}return Co(e)}function Co(e){if(e===null)return{kind:"primitive",value:null};if(typeof e=="string")return{kind:"primitive",value:e};if(typeof e=="number")return{kind:"primitive",value:e};if(typeof e=="boolean")return{kind:"primitive",value:e};if(Array.isArray(e))return{kind:"array",value:e.map(t=>Co(t))};if(h4(e)){const t={};for(const n of Object.keys(e).sort())t[n]=Co(e[n]);return{kind:"object",value:t}}return{kind:"primitive",value:null}}function p4(e,t){const n=[];return vi([],e,t,n),n}function vi(e,t,n,r){const o=dr(e);if(bi(t,n)){r.push({kind:"equal",path:o,value:t});return}if(t.kind!==n.kind){r.push({kind:"changed",path:o,left:t,right:n});return}if(t.kind==="primitive"&&n.kind==="primitive"){r.push({kind:"changed",path:o,left:t,right:n});return}if(t.kind==="object"&&n.kind==="object"){const s=Object.keys(t.value),i=Object.keys(n.value),a=new Set(i);for(const c of s){const u=t.value[c];if(u!==void 0)if(!a.has(c))r.push({kind:"removed",path:dr([...e,c]),value:u});else{const d=n.value[c];if(d===void 0)continue;vi([...e,c],u,d,r)}}for(const c of i){if(s.includes(c))continue;const u=n.value[c];u!==void 0&&r.push({kind:"added",path:dr([...e,c]),value:u})}return}if(t.kind==="array"&&n.kind==="array"){const s=Math.min(t.value.length,n.value.length);for(let i=0;i<s;i++){const a=t.value[i],c=n.value[i];a===void 0||c===void 0||vi([...e,i],a,c,r)}for(let i=s;i<n.value.length;i++){const a=n.value[i];a!==void 0&&r.push({kind:"added",path:dr([...e,i]),value:a})}for(let i=s;i<t.value.length;i++){const a=t.value[i];a!==void 0&&r.push({kind:"removed",path:dr([...e,i]),value:a})}}}function bi(e,t){if(e.kind!==t.kind)return!1;if(e.kind==="primitive"&&t.kind==="primitive")return e.value===t.value;if(e.kind==="array"&&t.kind==="array"){if(e.value.length!==t.value.length)return!1;for(let n=0;n<e.value.length;n++){const r=e.value[n],o=t.value[n];if(r===void 0||o===void 0||!bi(r,o))return!1}return!0}if(e.kind==="object"&&t.kind==="object"){const n=Object.keys(e.value),r=Object.keys(t.value);if(n.length!==r.length)return!1;for(const o of n){const s=e.value[o],i=t.value[o];if(s===void 0||i===void 0||!bi(s,i))return!1}return!0}return!1}function Et(e,t=80){let n;switch(e.kind){case"primitive":n=e.value===null?"null":JSON.stringify(e.value);break;case"array":n=`[… ${e.value.length} items]`;break;case"object":n=`{… ${Object.keys(e.value).length} keys}`;break}return n.length>t&&(n=`${n.slice(0,t-1)}…`),n}function no(e,t=2){return JSON.stringify(wi(e),null,t)}function wi(e){switch(e.kind){case"primitive":return e.value;case"array":return e.value.map(wi);case"object":{const t={};for(const[n,r]of Object.entries(e.value))t[n]=wi(r);return t}}}function qc(e){if(e==="")return"";for(let t=e.length-1;t>=0;t--){const n=e[t];if(n==="."||n==="[")return e.substring(0,t)}return""}function Kc(e){return e.kind==="equal"&&(e.value.kind==="object"||e.value.kind==="array")}function m4(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(r!==void 0&&Kc(r)){const o=qc(r.path);let s=n+1;for(;s<e.length;){const i=e[s];if(i===void 0||!Kc(i)||qc(i.path)!==o)break;s++}if(s-n>1){const i=[];for(let a=n;a<s;a++){const c=e[a];c!==void 0&&c.kind==="equal"&&i.push(c)}t.push({kind:"equal-run",ops:i}),n=s;continue}}r!==void 0&&t.push({kind:"single",op:r}),n++}return t}const Ep={added:{icon:lo,accent:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-500/5 hover:bg-emerald-500/10",border:"border-l-emerald-500",label:"ADDED"},removed:{icon:Di,accent:"text-rose-600 dark:text-rose-400",bg:"bg-rose-500/5 hover:bg-rose-500/10",border:"border-l-rose-500",label:"REMOVED"},changed:{icon:Mi,accent:"text-amber-600 dark:text-amber-400",bg:"bg-amber-500/5 hover:bg-amber-500/10",border:"border-l-amber-500",label:"CHANGED"},equal:{icon:Hy,accent:"text-muted-foreground/70",bg:"bg-muted/20 hover:bg-muted/30",border:"border-l-muted-foreground/20",label:"EQUAL"}};function g4({ops:e,expanded:t,onToggle:n}){const r=e[0],o=e[e.length-1];if(r===void 0||o===void 0)return l.jsx("div",{className:"text-muted-foreground/40 text-xs",children:"—"});const s=r.path,i=o.path,a=e.length===1?s:`${s} … ${i}`,c=r.value.kind==="array"?`${e.length} equal arrays`:r.value.kind==="object"?`${e.length} equal objects`:"equal",u=Ep.equal;return l.jsxs("div",{className:he("border-l-4 rounded-sm",u.border,u.bg),children:[l.jsxs("button",{type:"button",onClick:n,className:"w-full text-left flex items-center gap-2 px-3 py-1.5 text-xs text-muted-foreground cursor-pointer",children:[l.jsx(bt,{className:he("size-3 transition-transform shrink-0",t&&"rotate-90")}),l.jsx(u.icon,{className:he("size-3 shrink-0",u.accent)}),l.jsx("span",{className:"font-mono truncate flex-1",title:`${s} … ${i}`,children:a}),l.jsx("span",{className:he("text-[10px] uppercase tracking-wider shrink-0",u.accent),children:u.label}),l.jsxs("span",{className:"text-muted-foreground/60 shrink-0",children:["(",c,")"]})]}),t&&l.jsx("div",{className:"ml-5 mt-1 mb-2 space-y-2 pr-2",children:e.map(d=>l.jsxs("div",{className:"border border-border/50 rounded p-2 bg-muted/20",children:[l.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-1",children:d.path}),l.jsx(fn,{text:no(d.value),defaultExpandDepth:2})]},d.path))})]})}function x4({op:e,idx:t,copiedPath:n,onCopyPath:r,expanded:o,onToggle:s}){const i=Ep[e.kind],a=i.icon,c=e.kind==="added"||e.kind==="removed"?e.value.kind==="object"||e.value.kind==="array":e.kind==="changed"?e.left.kind==="object"||e.left.kind==="array"||e.right.kind==="object"||e.right.kind==="array":!1,u=e.kind==="changed"?[{text:Et(e.left,400),tone:"text-rose-700 dark:text-rose-300 line-through"},{text:Et(e.right,400),tone:"text-emerald-700 dark:text-emerald-300"}]:e.kind==="removed"?[{text:Et(e.value,400),tone:"text-rose-700 dark:text-rose-300 line-through"}]:e.kind==="added"?[{text:Et(e.value,400),tone:"text-emerald-700 dark:text-emerald-300"}]:[{text:Et(e.value,400),tone:"text-muted-foreground"}],d=n===e.path&&e.path!=="";return l.jsxs("div",{"data-diff-idx":t,"data-diff-kind":e.kind,className:he("border-l-4 rounded-sm px-3 py-2 my-0.5 transition-colors",i.border,i.bg),children:[l.jsxs("button",{type:"button",onClick:s,disabled:!c,className:he("w-full flex items-center gap-2 text-xs text-left rounded-sm",c?"cursor-pointer":"cursor-default"),"aria-expanded":c?o:void 0,"aria-label":c?o?`Collapse ${e.path||"root"}`:`Expand ${e.path||"root"}`:void 0,children:[c?l.jsx(bt,{className:he("size-3 shrink-0 transition-transform",i.accent,o&&"rotate-90")}):l.jsx("span",{className:"size-3 shrink-0","aria-hidden":"true"}),l.jsx(a,{className:he("size-3.5 shrink-0",i.accent),strokeWidth:2.5}),l.jsx("span",{className:"font-mono truncate flex-1 min-w-0",title:e.path||"(root)",children:e.path===""?"(root)":e.path}),l.jsx("span",{className:he("text-[9px] font-bold uppercase tracking-wider shrink-0 px-1.5 py-0.5 rounded",i.accent,e.kind==="equal"?"bg-muted/40":"bg-background/60"),children:i.label}),e.path!==""&&l.jsx("span",{role:"button",tabIndex:0,onClick:h=>{h.stopPropagation(),r(e.path)},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.stopPropagation(),h.preventDefault(),r(e.path))},className:he("shrink-0 p-1 rounded transition-colors cursor-pointer inline-flex items-center justify-center",d?"text-emerald-500":"text-muted-foreground/50 hover:text-foreground hover:bg-muted"),"aria-label":d?"Copied":"Copy path",title:d?"Copied!":"Copy path",children:d?l.jsx(sn,{className:"size-3"}):l.jsx(bn,{className:"size-3"})})]}),u.map((h,p)=>l.jsx("div",{className:he("font-mono text-xs mt-1 break-all pl-5",h.tone),children:h.text},p)),l.jsx("div",{className:"overflow-hidden transition-all duration-200",style:{maxHeight:o&&c?"2000px":"0"},"aria-hidden":!o,children:o&&c&&e.kind!=="equal"?l.jsx(y4,{op:e}):null})]})}function y4({op:e}){if(e.kind==="added"||e.kind==="removed")return l.jsx("div",{className:"pl-5 mt-2 border border-border/50 rounded p-2 bg-muted/20",children:l.jsx(fn,{text:no(e.value),defaultExpandDepth:2})});const t=e.left.kind==="object"||e.left.kind==="array",n=e.right.kind==="object"||e.right.kind==="array";return!t&&!n?l.jsx("div",{className:"pl-5 mt-2 text-xs text-muted-foreground/70 italic",children:"Primitive values are shown inline above."}):l.jsxs("div",{className:"pl-5 mt-2 grid grid-cols-1 md:grid-cols-2 gap-2",children:[l.jsxs("div",{className:"border border-rose-500/30 rounded p-2 bg-rose-500/5",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-rose-500 mb-1",children:"Old"}),l.jsx(fn,{text:no(e.left),defaultExpandDepth:2})]}),l.jsxs("div",{className:"border border-emerald-500/30 rounded p-2 bg-emerald-500/5",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-500 mb-1",children:"New"}),l.jsx(fn,{text:no(e.right),defaultExpandDepth:2})]})]})}function v4({counts:e,onJumpTo:t}){const n=e.added+e.removed+e.changed;return l.jsxs("div",{className:"px-4 py-2 border-b border-border bg-muted/20 flex items-center gap-2 text-xs flex-wrap",children:[l.jsxs("span",{className:"text-muted-foreground font-medium",children:[n," ",n===1?"change":"changes"]}),l.jsxs("button",{type:"button",onClick:()=>t("removed"),disabled:e.removed===0,className:he("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border cursor-pointer transition-colors",e.removed>0?"border-rose-500/40 text-rose-600 dark:text-rose-400 bg-rose-500/10 hover:bg-rose-500/20":"border-border text-muted-foreground/40 cursor-not-allowed"),title:e.removed>0?"Jump to first removed":"No removals",children:[l.jsx(Di,{className:"size-3"}),e.removed," removed"]}),l.jsxs("button",{type:"button",onClick:()=>t("added"),disabled:e.added===0,className:he("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border cursor-pointer transition-colors",e.added>0?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 hover:bg-emerald-500/20":"border-border text-muted-foreground/40 cursor-not-allowed"),title:e.added>0?"Jump to first added":"No additions",children:[l.jsx(lo,{className:"size-3"}),e.added," added"]}),l.jsxs("button",{type:"button",onClick:()=>t("changed"),disabled:e.changed===0,className:he("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border cursor-pointer transition-colors",e.changed>0?"border-amber-500/40 text-amber-600 dark:text-amber-400 bg-amber-500/10 hover:bg-amber-500/20":"border-border text-muted-foreground/40 cursor-not-allowed"),title:e.changed>0?"Jump to first changed":"No changes",children:[l.jsx(Mi,{className:"size-3"}),e.changed," changed"]})]})}function b4({mode:e,onChange:t}){return l.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[l.jsxs("button",{type:"button",onClick:()=>t("unified"),"aria-pressed":e==="unified",className:he("flex items-center gap-1 px-2 py-1 text-xs transition-colors cursor-pointer",e==="unified"?"bg-muted text-foreground":"hover:bg-muted/50 text-muted-foreground"),title:"Unified view (single column, emphasized diffs)",children:[l.jsx(Ju,{className:"size-3"}),"Unified"]}),l.jsxs("button",{type:"button",onClick:()=>t("split"),"aria-pressed":e==="split",className:he("flex items-center gap-1 px-2 py-1 text-xs transition-colors border-l border-border cursor-pointer",e==="split"?"bg-muted text-foreground":"hover:bg-muted/50 text-muted-foreground"),title:"Split view (path | left | right)",children:[l.jsx(Wu,{className:"size-3"}),"Split"]})]})}function Gc({log:e,side:t}){const n=vo(e);return l.jsxs("div",{className:"flex-1 min-w-0 space-y-1 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xt,{variant:"outline",className:he("text-[10px] px-1.5 py-0 h-5 font-mono shrink-0",t==="left"?"border-rose-500/40 text-rose-400":"border-emerald-500/40 text-emerald-400"),children:t==="left"?"← Left":"Right →"}),l.jsxs("span",{className:"font-mono text-blue-400/80",children:["#",e.id]}),e.model!==null&&l.jsx("span",{className:"font-mono text-muted-foreground truncate",children:e.model})]}),l.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground font-mono",children:[e.cacheCreationInputTokens!==null&&e.cacheCreationInputTokens>0&&l.jsxs("span",{className:"text-emerald-400",children:["Cache +",Ye(e.cacheCreationInputTokens)]}),e.cacheReadInputTokens!==null&&e.cacheReadInputTokens>0&&l.jsxs("span",{className:"text-purple-400",children:["Cache ~",Ye(e.cacheReadInputTokens)]}),l.jsx("span",{className:"truncate",title:e.timestamp,children:e.timestamp})]}),l.jsxs("div",{className:"text-muted-foreground/70 font-mono truncate",title:n,children:["session: ",n]})]})}function w4({left:e,right:t,onClose:n}){const r=v.useMemo(()=>{const C=Hc(io(e.rawRequestBody)??e.rawRequestBody),E=Hc(io(t.rawRequestBody)??t.rawRequestBody);return p4(C,E)},[e.rawRequestBody,t.rawRequestBody]),o=v.useMemo(()=>m4(r),[r]),s=v.useMemo(()=>{let C=0,E=0,T=0;for(const R of o)if(R.kind==="single")switch(R.op.kind){case"added":C++;break;case"removed":E++;break;case"changed":T++;break}return{added:C,removed:E,changed:T}},[o]),[i,a]=v.useState(new Set),c=C=>{a(E=>{const T=new Set(E);return T.has(C)?T.delete(C):T.add(C),T})},[u,d]=v.useState(new Set),h=C=>{d(E=>{const T=new Set(E);return T.has(C)?T.delete(C):T.add(C),T})};v.useEffect(()=>{d(new Set)},[e.id,t.id]);const[p,f]=v.useState("unified"),x=v.useRef(null),[m,y]=v.useState(null),g=v.useRef(null),b=C=>{window.navigator.clipboard.writeText(C).then(()=>{y(C),g.current!==null&&clearTimeout(g.current),g.current=setTimeout(()=>y(null),1500)})};v.useEffect(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);const k=C=>{const E=o.findIndex(M=>M.kind==="single"&&M.op.kind===C);if(E===-1)return;const T=x.current;if(T===null)return;const R=T.querySelector(`[data-diff-idx="${E}"]`);R!==null&&R.scrollIntoView({behavior:"smooth",block:"center"})};v.useEffect(()=>{const C=T=>{T.key==="Escape"&&n()};document.addEventListener("keydown",C);const E=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",C),document.body.style.overflow=E}},[n]);const S=vo(e)===vo(t),j=r.length===1&&r[0]?.kind==="equal";return l.jsxs("div",{className:"fixed inset-0 z-50 flex justify-end",role:"dialog","aria-modal":"true","aria-label":"Compare two log requests",children:[l.jsx("button",{type:"button",onClick:n,"aria-label":"Close compare drawer",className:"absolute inset-0 bg-black/40 cursor-default",tabIndex:-1}),l.jsxs("div",{className:he("relative bg-background border-l border-border shadow-xl","w-full md:w-[70vw] max-w-[1100px] flex flex-col h-full"),onClick:C=>C.stopPropagation(),onKeyDown:C=>C.stopPropagation(),children:[l.jsxs("div",{className:"flex items-start gap-4 px-4 py-3 border-b border-border",children:[l.jsxs("div",{className:"flex-1 flex gap-4 min-w-0",children:[l.jsx(Gc,{log:e,side:"left"}),l.jsx(Gc,{log:t,side:"right"})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(b4,{mode:p,onChange:f}),l.jsx("button",{type:"button",onClick:n,"aria-label":"Close",className:"p-1 rounded text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer",children:l.jsx(Xu,{className:"size-4"})})]})]}),!S&&l.jsx("div",{className:"px-4 py-1.5 text-xs text-amber-400 bg-amber-500/10 border-b border-border",children:"Heads up: the two selected logs are from different sessions."}),j?l.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto flex items-center justify-center text-muted-foreground text-sm",children:"The two Request payloads are identical."}):l.jsxs(l.Fragment,{children:[l.jsx(v4,{counts:s,onJumpTo:k}),l.jsx("div",{ref:x,className:"flex-1 min-h-0 overflow-y-auto",children:p==="unified"?l.jsx("div",{className:"px-3 py-2 space-y-0.5",children:o.map((C,E)=>{if(C.kind==="equal-run")return l.jsx(g4,{ops:C.ops,expanded:i.has(E),onToggle:()=>c(E)},`r${E}`);const T=C.op;return l.jsx(x4,{op:T,idx:E,copiedPath:m,onCopyPath:b,expanded:u.has(E),onToggle:()=>h(E)},`o${E}`)})}):l.jsx(k4,{grouped:o,left:e,right:t})})]})]})]})}function k4({grouped:e,left:t,right:n}){return l.jsxs("div",{className:"grid grid-cols-[200px_1fr_1fr] gap-x-2 gap-y-0.5 px-3 py-2 text-xs",children:[l.jsxs("div",{className:"grid grid-cols-[200px_1fr_1fr] gap-x-2 col-span-3 pb-2 mb-2 border-b border-border text-[10px] uppercase tracking-wider text-muted-foreground",children:[l.jsx("span",{children:"Path"}),l.jsxs("span",{children:["Left (Log #",t.id,")"]}),l.jsxs("span",{children:["Right (Log #",n.id,")"]})]}),e.map((r,o)=>{if(r.kind==="equal-run")return l.jsxs("div",{className:"col-span-3 px-2 py-1 text-xs text-muted-foreground/60",children:[r.ops.length," equal siblings collapsed — switch to Unified to expand"]},o);const s=r.op;return s.kind==="equal"?l.jsxs("div",{className:"col-span-3 grid grid-cols-[200px_1fr_1fr] gap-x-2 px-2 py-0.5 text-muted-foreground",children:[l.jsx("span",{className:"font-mono text-xs truncate",title:s.path,children:s.path}),l.jsx("span",{className:"font-mono text-xs break-all opacity-60",children:Et(s.value,200)}),l.jsx("span",{className:"font-mono text-xs break-all opacity-60",children:Et(s.value,200)})]},o):s.kind==="added"?l.jsxs("div",{className:"col-span-3 px-2 py-1 rounded text-xs border-l-2 border-l-emerald-400/70 bg-emerald-500/5",children:[l.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-0.5",children:s.path}),l.jsxs("div",{className:"font-mono break-all text-emerald-300/90",children:["+ ",Et(s.value,400)]})]},o):s.kind==="removed"?l.jsxs("div",{className:"col-span-3 px-2 py-1 rounded text-xs border-l-2 border-l-rose-400/70 bg-rose-500/5",children:[l.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-0.5",children:s.path}),l.jsxs("div",{className:"font-mono break-all text-rose-300/90 line-through",children:["− ",Et(s.value,400)]})]},o):l.jsxs("div",{className:"col-span-3 px-2 py-1 rounded text-xs border-l-2 border-l-amber-400/70 bg-amber-500/5",children:[l.jsx("div",{className:"font-mono text-xs text-muted-foreground mb-1",children:s.path}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("div",{className:"font-mono text-rose-300/90 break-all line-through",children:Et(s.left,400)}),l.jsx("div",{className:"font-mono text-emerald-300/90 break-all",children:Et(s.right,400)})]})]},o)})]})}function _4(e){return e.length<=30?e:e.slice(0,12)+"…"+e.slice(-12)}function S4(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 C4({command:e}){const[t,n]=v.useState(!1),r=v.useCallback(()=>{window.navigator.clipboard.writeText(e).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},[e]);return l.jsxs("div",{className:"inline-flex items-center gap-2 bg-muted rounded-md px-3 py-2",children:[l.jsx("pre",{className:"text-blue-500 font-mono text-sm m-0",children:e}),l.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?l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:"M20 6 9 17l-5-5"})}):l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),l.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 j4({logs:e,sessions:t,models:n,selectedSession:r,selectedModel:o,onSessionChange:s,onModelChange:i,onClearAll:a,viewMode:c,onViewModeChange:u,strip:d}){const{totalIn:h,totalOut:p}=S4(e),[f,x]=v.useState(!1),[m,y]=v.useState(null),g=v.useCallback(async()=>{x(!0);try{await SS(e)}finally{x(!1)}},[e]),b=v.useRef(null);v.useEffect(()=>{y(null)},[r,o]);const k=v.useCallback(()=>{y(null)},[]),S=v.useCallback(T=>{const R=e.indexOf(T);if(R<=0)return;const M=e[R-1];M!==void 0&&y([M,T])},[e]),j=v.useMemo(()=>RS(e),[e]),C=v.useMemo(()=>d4(j),[j]),E=Uu({count:j.length,getScrollElement:()=>b.current,estimateSize:()=>150,measureElement:typeof window<"u"?T=>T.getBoundingClientRect().height:void 0,overscan:5});return l.jsxs("div",{className:"max-w-[1200px] mx-auto flex flex-col h-screen",style:{maxHeight:"100vh"},children:[l.jsxs("div",{className:"flex items-end px-6 pt-6 pb-3 relative",children:[l.jsxs("h1",{className:"text-lg font-bold flex items-end gap-2 absolute left-1/2 -translate-x-1/2 whitespace-nowrap",children:[l.jsxs("span",{className:"flex items-end gap-1 group cursor-default","aria-hidden":"true",children:[l.jsx(Oc,{className:"size-10 text-amber-500 transition-all duration-300 group-hover:scale-125 group-hover:-translate-y-1.5"}),l.jsx("span",{className:"flex items-end gap-0.5",children:xi.map((T,R)=>l.jsx(T,{className:`size-5 ${["text-amber-500","text-rose-500","text-sky-500","text-emerald-500","text-violet-500","text-orange-500","text-cyan-500","text-pink-500","text-lime-500","text-blue-500","text-yellow-500","text-fuchsia-500"][R]} transition-all duration-300 ease-out group-hover:scale-125 group-hover:-translate-y-1`,style:{transitionDelay:`${R*50}ms`}},R))})]}),l.jsxs("span",{className:"flex items-baseline gap-2",children:["LLM Inspector",l.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:["v",jS.version]})]})]}),l.jsx("div",{className:"ml-auto",children:l.jsx(c4,{})})]}),l.jsxs("div",{className:"flex items-center gap-3 px-6 mb-4",children:[l.jsxs(Dc,{value:r,onValueChange:s,children:[l.jsx(Lc,{className:"flex-1 max-w-[350px] text-xs",children:l.jsx(Mc,{placeholder:"All sessions"})}),l.jsxs(Fc,{children:[l.jsx(Kr,{value:"__all__",children:"All sessions"}),t.map(T=>l.jsx(Kr,{value:T,children:_4(T)},T))]})]}),l.jsxs(Dc,{value:o,onValueChange:i,children:[l.jsx(Lc,{className:"flex-1 max-w-[250px] text-xs",children:l.jsx(Mc,{placeholder:"All models"})}),l.jsxs(Fc,{children:[l.jsx(Kr,{value:"__all__",children:"All models"}),n.map(T=>l.jsx(Kr,{value:T,children:T},T))]})]}),l.jsx(Te,{children:l.jsxs(Ie,{children:[l.jsx(ze,{asChild:!0,children:l.jsxs("div",{className:"flex items-center border border-border rounded-md overflow-hidden",children:[l.jsx("button",{type:"button",onClick:()=>u("simple"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${c==="simple"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Simple"}),l.jsx("button",{type:"button",onClick:()=>u("full"),className:`px-2 py-1 cursor-pointer transition-colors text-xs ${c==="full"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:"Full"})]})}),l.jsx(Re,{children:"Simple shows parsed output; Full adds raw headers and tokens"})]})}),l.jsx("div",{className:"flex-1"}),l.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&&l.jsx("button",{type:"button",onClick:()=>{g()},disabled:f,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:f?l.jsx("span",{children:"Exporting..."}):l.jsxs(l.Fragment,{children:[l.jsx(Ri,{className:"size-3"}),l.jsx("span",{children:"Export"})]})}),l.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"})]}),l.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.length===0?l.jsxs("div",{className:"text-center text-muted-foreground py-16 space-y-4",children:[l.jsx(Oc,{className:"size-12 text-muted-foreground/20 mx-auto"}),l.jsx("p",{className:"text-sm",children:"No requests captured yet."}),l.jsx("p",{className:"text-xs",children:"Route AI coding tools through the proxy:"}),l.jsx(C4,{command:"LLM_BASE_URL=http://localhost:25947/proxy <your-tool>"})]}):l.jsx("div",{ref:b,className:"overflow-y-auto h-full",children:l.jsx("div",{style:{height:`${E.getTotalSize()}px`,width:"100%",position:"relative"},children:E.getVirtualItems().map(T=>{const R=j[T.index];return R===void 0?null:l.jsx("div",{"data-index":T.index,ref:E.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${T.start}px)`},children:l.jsx(IN,{group:R,viewMode:c,strip:d,cacheTrends:C,onCompareWithPrevious:S,standalone:j.length===1})},R.id)})})})}),m!==null&&l.jsx(w4,{left:m[0],right:m[1],onClose:k})]})}ae({logs:Oe(Us),total:ve(),offset:ve(),limit:ve()});const E4=Kt([ae({type:Se("init"),logs:Oe(Us)}),ae({type:Se("update"),log:Us})]);function N4(e){const t=new Set;for(const n of e)n.sessionId!==null&&n.sessionId!==""&&t.add(n.sessionId);return[...t]}function T4(e){const t=new Set;for(const n of e)n.model!==null&&n.model!==""&&t.add(n.model);return[...t]}function A4(){const[e,t]=v.useState([]),[n,r]=v.useState([]),[o,s]=v.useState([]),[i,a]=v.useState("__all__"),[c,u]=v.useState("__all__"),[d,h]=v.useState("simple"),[p,f]=v.useState(null),x=v.useRef(null),m=v.useRef(null),y=v.useCallback(async()=>{try{const[S,j]=await Promise.all([fetch("/api/sessions"),fetch("/api/models")]);if(S.ok&&j.ok){const C=await S.json(),E=await j.json(),T=Oe(q()).safeParse(C),R=Oe(q()).safeParse(E);T.success&&r(T.data),R.success&&s(R.data)}}catch{}},[]),g=v.useCallback(()=>{x.current&&x.current.close();const S=new URLSearchParams;i!=="__all__"&&S.set("sessionId",i),c!=="__all__"&&S.set("model",c);const j=new EventSource(`/api/logs/stream?${S}`);x.current=j,j.onmessage=C=>{try{const E=String(C.data),T=JSON.parse(E),R=E4.safeParse(T);if(!R.success){f("Failed to parse SSE data");return}const M=R.data;M.type==="init"?(t(M.logs),r(N4(M.logs)),s(T4(M.logs)),f(null)):M.type==="update"&&(t(B=>{const N=i==="__all__"||M.log.sessionId===i,O=c==="__all__"||M.log.model===c;return!N||!O?B:B.findIndex(D=>D.id===M.log.id)>=0?B.map(D=>D.id===M.log.id?M.log:D):[...B,M.log]}),r(B=>{const N=M.log.sessionId;return N!=null&&N!==""?B.includes(N)?B:[...B,N]:B}),s(B=>{const N=M.log.model;return N!=null&&N!==""?B.includes(N)?B:[...B,N]:B}))}catch{f("Failed to parse SSE data")}},j.onerror=()=>{f("SSE connection lost, reconnecting..."),j.close(),m.current!==null&&clearTimeout(m.current),m.current=setTimeout(g,3e3)},y()},[i,c,y]);v.useEffect(()=>(g(),()=>{x.current&&(x.current.close(),x.current=null),m.current!==null&&(clearTimeout(m.current),m.current=null)}),[g]);const b=v.useCallback(()=>{(async()=>{try{if(!(await fetch("/api/logs",{method:"DELETE"})).ok){f("Failed to clear logs");return}t([]),r([]),s([]),f(null)}catch(S){f(S instanceof Error?S.message:"Unknown error clearing logs")}})()},[]),{strip:k}=Bu();return l.jsxs(l.Fragment,{children:[p!==null&&l.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}),l.jsx(j4,{logs:e,sessions:n,models:o,selectedSession:i,selectedModel:c,onSessionChange:a,onModelChange:u,onClearAll:b,viewMode:d,onViewModeChange:h,strip:k})]})}const R4=A4;export{R4 as component};
|