codexui-android 0.1.79 → 0.1.81

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.
@@ -0,0 +1,89 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-DlVMY4f_.js","assets/ThreadConversation-BsN7bN3q.css","assets/ReviewPane-Dee4Qknm.js","assets/ReviewPane-CyugWwTM.css","assets/SkillsHub-DUNP6fA0.js","assets/SkillsHub-Bg1Le103.css"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/**
3
+ * @vue/shared v3.5.32
4
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
+ * @license MIT
6
+ **/function df(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Lt={},ai=[],uo=()=>{},_g=()=>!1,uc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),dc=e=>e.startsWith("onUpdate:"),hn=Object.assign,ff=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xb=Object.prototype.hasOwnProperty,At=(e,t)=>xb.call(e,t),Ye=Array.isArray,li=e=>Ea(e)==="[object Map]",Ei=e=>Ea(e)==="[object Set]",hp=e=>Ea(e)==="[object Date]",tt=e=>typeof e=="function",Kt=e=>typeof e=="string",Wr=e=>typeof e=="symbol",Ct=e=>e!==null&&typeof e=="object",bg=e=>(Ct(e)||tt(e))&&tt(e.then)&&tt(e.catch),wg=Object.prototype.toString,Ea=e=>wg.call(e),Rb=e=>Ea(e).slice(8,-1),Sg=e=>Ea(e)==="[object Object]",pf=e=>Kt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xi=df(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fc=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Mb=/-\w/g,Yn=fc(e=>e.replace(Mb,t=>t.slice(1).toUpperCase())),Pb=/\B([A-Z])/g,is=fc(e=>e.replace(Pb,"-$1").toLowerCase()),pc=fc(e=>e.charAt(0).toUpperCase()+e.slice(1)),gu=fc(e=>e?`on${pc(e)}`:""),lo=(e,t)=>!Object.is(e,t),Al=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Tg=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},hc=e=>{const t=parseFloat(e);return isNaN(t)?e:t},$b=e=>{const t=Kt(e)?Number(e):NaN;return isNaN(t)?e:t};let mp;const mc=()=>mp||(mp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ko(e){if(Ye(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Kt(r)?Db(r):ko(r);if(o)for(const s in o)t[s]=o[s]}return t}else if(Kt(e)||Ct(e))return e}const Nb=/;(?![^(]*\))/g,Ob=/:([^]+)/,Lb=/\/\*[^]*?\*\//g;function Db(e){const t={};return e.replace(Lb,"").split(Nb).forEach(n=>{if(n){const r=n.split(Ob);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function pt(e){let t="";if(Kt(e))t=e;else if(Ye(e))for(let n=0;n<e.length;n++){const r=pt(e[n]);r&&(t+=r+" ")}else if(Ct(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const jb="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Fb=df(jb);function Eg(e){return!!e||e===""}function Bb(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ki(e[r],t[r]);return n}function ki(e,t){if(e===t)return!0;let n=hp(e),r=hp(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Wr(e),r=Wr(t),n||r)return e===t;if(n=Ye(e),r=Ye(t),n||r)return n&&r?Bb(e,t):!1;if(n=Ct(e),r=Ct(t),n||r){if(!n||!r)return!1;const o=Object.keys(e).length,s=Object.keys(t).length;if(o!==s)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!ki(e[i],t[i]))return!1}}return String(e)===String(t)}function hf(e,t){return e.findIndex(n=>ki(n,t))}const kg=e=>!!(e&&e.__v_isRef===!0),ge=e=>Kt(e)?e:e==null?"":Ye(e)||Ct(e)&&(e.toString===wg||!tt(e.toString))?kg(e)?ge(e.value):JSON.stringify(e,Ig,2):String(e),Ig=(e,t)=>kg(t)?Ig(e,t.value):li(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[vu(r,s)+" =>"]=o,n),{})}:Ei(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>vu(n))}:Wr(t)?vu(t):Ct(t)&&!Ye(t)&&!Sg(t)?String(t):t,vu=(e,t="")=>{var n;return Wr(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
7
+ * @vue/reactivity v3.5.32
8
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
+ * @license MIT
10
+ **/let or;class qb{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=or,!t&&or&&(this.index=(or.scopes||(or.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=or;try{return or=this,t()}finally{or=n}}}on(){++this._on===1&&(this.prevScope=or,or=this)}off(){this._on>0&&--this._on===0&&(or=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Ub(){return or}let jt;const yu=new WeakSet;class Ag{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,or&&or.active&&or.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,yu.has(this)&&(yu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||xg(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,gp(this),Rg(this);const t=jt,n=Ur;jt=this,Ur=!0;try{return this.fn()}finally{Mg(this),jt=t,Ur=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)vf(t);this.deps=this.depsTail=void 0,gp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?yu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){md(this)&&this.run()}get dirty(){return md(this)}}let Cg=0,Qi,Zi;function xg(e,t=!1){if(e.flags|=8,t){e.next=Zi,Zi=e;return}e.next=Qi,Qi=e}function mf(){Cg++}function gf(){if(--Cg>0)return;if(Zi){let t=Zi;for(Zi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Qi;){let t=Qi;for(Qi=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Rg(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Mg(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),vf(r),Hb(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function md(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Pg(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Pg(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===aa)||(e.globalVersion=aa,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!md(e))))return;e.flags|=2;const t=e.dep,n=jt,r=Ur;jt=e,Ur=!0;try{Rg(e);const o=e.fn(e._value);(t.version===0||lo(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{jt=n,Ur=r,Mg(e),e.flags&=-3}}function vf(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)vf(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Hb(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ur=!0;const $g=[];function Ro(){$g.push(Ur),Ur=!1}function Mo(){const e=$g.pop();Ur=e===void 0?!0:e}function gp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=jt;jt=void 0;try{t()}finally{jt=n}}}let aa=0;class Wb{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class yf{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!jt||!Ur||jt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==jt)n=this.activeLink=new Wb(jt,this),jt.deps?(n.prevDep=jt.depsTail,jt.depsTail.nextDep=n,jt.depsTail=n):jt.deps=jt.depsTail=n,Ng(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=jt.depsTail,n.nextDep=void 0,jt.depsTail.nextDep=n,jt.depsTail=n,jt.deps===n&&(jt.deps=r)}return n}trigger(t){this.version++,aa++,this.notify(t)}notify(t){mf();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{gf()}}}function Ng(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ng(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const gd=new WeakMap,Ms=Symbol(""),vd=Symbol(""),la=Symbol("");function $n(e,t,n){if(Ur&&jt){let r=gd.get(e);r||gd.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new yf),o.map=r,o.key=n),o.track()}}function To(e,t,n,r,o,s){const i=gd.get(e);if(!i){aa++;return}const a=l=>{l&&l.trigger()};if(mf(),t==="clear")i.forEach(a);else{const l=Ye(e),c=l&&pf(n);if(l&&n==="length"){const d=Number(r);i.forEach((f,m)=>{(m==="length"||m===la||!Wr(m)&&m>=d)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),c&&a(i.get(la)),t){case"add":l?c&&a(i.get("length")):(a(i.get(Ms)),li(e)&&a(i.get(vd)));break;case"delete":l||(a(i.get(Ms)),li(e)&&a(i.get(vd)));break;case"set":li(e)&&a(i.get(Ms));break}}gf()}function Ys(e){const t=Tt(e);return t===e?t:($n(t,"iterate",la),Er(e)?t:t.map(Vr))}function gc(e){return $n(e=Tt(e),"iterate",la),e}function io(e,t){return Po(e)?pi(Ps(e)?Vr(t):t):Vr(t)}const Vb={__proto__:null,[Symbol.iterator](){return _u(this,Symbol.iterator,e=>io(this,e))},concat(...e){return Ys(this).concat(...e.map(t=>Ye(t)?Ys(t):t))},entries(){return _u(this,"entries",e=>(e[1]=io(this,e[1]),e))},every(e,t){return go(this,"every",e,t,void 0,arguments)},filter(e,t){return go(this,"filter",e,t,n=>n.map(r=>io(this,r)),arguments)},find(e,t){return go(this,"find",e,t,n=>io(this,n),arguments)},findIndex(e,t){return go(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return go(this,"findLast",e,t,n=>io(this,n),arguments)},findLastIndex(e,t){return go(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return go(this,"forEach",e,t,void 0,arguments)},includes(...e){return bu(this,"includes",e)},indexOf(...e){return bu(this,"indexOf",e)},join(e){return Ys(this).join(e)},lastIndexOf(...e){return bu(this,"lastIndexOf",e)},map(e,t){return go(this,"map",e,t,void 0,arguments)},pop(){return Hi(this,"pop")},push(...e){return Hi(this,"push",e)},reduce(e,...t){return vp(this,"reduce",e,t)},reduceRight(e,...t){return vp(this,"reduceRight",e,t)},shift(){return Hi(this,"shift")},some(e,t){return go(this,"some",e,t,void 0,arguments)},splice(...e){return Hi(this,"splice",e)},toReversed(){return Ys(this).toReversed()},toSorted(e){return Ys(this).toSorted(e)},toSpliced(...e){return Ys(this).toSpliced(...e)},unshift(...e){return Hi(this,"unshift",e)},values(){return _u(this,"values",e=>io(this,e))}};function _u(e,t,n){const r=gc(e),o=r[t]();return r!==e&&!Er(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const zb=Array.prototype;function go(e,t,n,r,o,s){const i=gc(e),a=i!==e&&!Er(e),l=i[t];if(l!==zb[t]){const f=l.apply(e,s);return a?Vr(f):f}let c=n;i!==e&&(a?c=function(f,m){return n.call(this,io(e,f),m,e)}:n.length>2&&(c=function(f,m){return n.call(this,f,m,e)}));const d=l.call(i,c,r);return a&&o?o(d):d}function vp(e,t,n,r){const o=gc(e),s=o!==e&&!Er(e);let i=n,a=!1;o!==e&&(s?(a=r.length===0,i=function(c,d,f){return a&&(a=!1,c=io(e,c)),n.call(this,c,io(e,d),f,e)}):n.length>3&&(i=function(c,d,f){return n.call(this,c,d,f,e)}));const l=o[t](i,...r);return a?io(e,l):l}function bu(e,t,n){const r=Tt(e);$n(r,"iterate",la);const o=r[t](...n);return(o===-1||o===!1)&&wf(n[0])?(n[0]=Tt(n[0]),r[t](...n)):o}function Hi(e,t,n=[]){Ro(),mf();const r=Tt(e)[t].apply(e,n);return gf(),Mo(),r}const Gb=df("__proto__,__v_isRef,__isVue"),Og=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Wr));function Kb(e){Wr(e)||(e=String(e));const t=Tt(this);return $n(t,"has",e),t.hasOwnProperty(e)}class Lg{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(o?s?ow:Bg:s?Fg:jg).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Ye(t);if(!o){let l;if(i&&(l=Vb[n]))return l;if(n==="hasOwnProperty")return Kb}const a=Reflect.get(t,n,Dn(t)?t:r);if((Wr(n)?Og.has(n):Gb(n))||(o||$n(t,"get",n),s))return a;if(Dn(a)){const l=i&&pf(n)?a:a.value;return o&&Ct(l)?_d(l):l}return Ct(a)?o?_d(a):vc(a):a}}class Dg extends Lg{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=Ye(t)&&pf(n);if(!this._isShallow){const c=Po(s);if(!Er(r)&&!Po(r)&&(s=Tt(s),r=Tt(r)),!i&&Dn(s)&&!Dn(r))return c||(s.value=r),!0}const a=i?Number(n)<t.length:At(t,n),l=Reflect.set(t,n,r,Dn(t)?t:o);return t===Tt(o)&&(a?lo(r,s)&&To(t,"set",n,r):To(t,"add",n,r)),l}deleteProperty(t,n){const r=At(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&To(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!Wr(n)||!Og.has(n))&&$n(t,"has",n),r}ownKeys(t){return $n(t,"iterate",Ye(t)?"length":Ms),Reflect.ownKeys(t)}}class Yb extends Lg{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Jb=new Dg,Xb=new Yb,Qb=new Dg(!0);const yd=e=>e,dl=e=>Reflect.getPrototypeOf(e);function Zb(e,t,n){return function(...r){const o=this.__v_raw,s=Tt(o),i=li(s),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,c=o[e](...r),d=n?yd:t?pi:Vr;return!t&&$n(s,"iterate",l?vd:Ms),hn(Object.create(c),{next(){const{value:f,done:m}=c.next();return m?{value:f,done:m}:{value:a?[d(f[0]),d(f[1])]:d(f),done:m}}})}}function fl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ew(e,t){const n={get(o){const s=this.__v_raw,i=Tt(s),a=Tt(o);e||(lo(o,a)&&$n(i,"get",o),$n(i,"get",a));const{has:l}=dl(i),c=t?yd:e?pi:Vr;if(l.call(i,o))return c(s.get(o));if(l.call(i,a))return c(s.get(a));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&$n(Tt(o),"iterate",Ms),o.size},has(o){const s=this.__v_raw,i=Tt(s),a=Tt(o);return e||(lo(o,a)&&$n(i,"has",o),$n(i,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){const i=this,a=i.__v_raw,l=Tt(a),c=t?yd:e?pi:Vr;return!e&&$n(l,"iterate",Ms),a.forEach((d,f)=>o.call(s,c(d),c(f),i))}};return hn(n,e?{add:fl("add"),set:fl("set"),delete:fl("delete"),clear:fl("clear")}:{add(o){const s=Tt(this),i=dl(s),a=Tt(o),l=!t&&!Er(o)&&!Po(o)?a:o;return i.has.call(s,l)||lo(o,l)&&i.has.call(s,o)||lo(a,l)&&i.has.call(s,a)||(s.add(l),To(s,"add",l,l)),this},set(o,s){!t&&!Er(s)&&!Po(s)&&(s=Tt(s));const i=Tt(this),{has:a,get:l}=dl(i);let c=a.call(i,o);c||(o=Tt(o),c=a.call(i,o));const d=l.call(i,o);return i.set(o,s),c?lo(s,d)&&To(i,"set",o,s):To(i,"add",o,s),this},delete(o){const s=Tt(this),{has:i,get:a}=dl(s);let l=i.call(s,o);l||(o=Tt(o),l=i.call(s,o)),a&&a.call(s,o);const c=s.delete(o);return l&&To(s,"delete",o,void 0),c},clear(){const o=Tt(this),s=o.size!==0,i=o.clear();return s&&To(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Zb(o,e,t)}),n}function _f(e,t){const n=ew(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(At(n,o)&&o in r?n:r,o,s)}const tw={get:_f(!1,!1)},nw={get:_f(!1,!0)},rw={get:_f(!0,!1)};const jg=new WeakMap,Fg=new WeakMap,Bg=new WeakMap,ow=new WeakMap;function sw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function iw(e){return e.__v_skip||!Object.isExtensible(e)?0:sw(Rb(e))}function vc(e){return Po(e)?e:bf(e,!1,Jb,tw,jg)}function qg(e){return bf(e,!1,Qb,nw,Fg)}function _d(e){return bf(e,!0,Xb,rw,Bg)}function bf(e,t,n,r,o){if(!Ct(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=iw(e);if(s===0)return e;const i=o.get(e);if(i)return i;const a=new Proxy(e,s===2?r:n);return o.set(e,a),a}function Ps(e){return Po(e)?Ps(e.__v_raw):!!(e&&e.__v_isReactive)}function Po(e){return!!(e&&e.__v_isReadonly)}function Er(e){return!!(e&&e.__v_isShallow)}function wf(e){return e?!!e.__v_raw:!1}function Tt(e){const t=e&&e.__v_raw;return t?Tt(t):e}function aw(e){return!At(e,"__v_skip")&&Object.isExtensible(e)&&Tg(e,"__v_skip",!0),e}const Vr=e=>Ct(e)?vc(e):e,pi=e=>Ct(e)?_d(e):e;function Dn(e){return e?e.__v_isRef===!0:!1}function j(e){return Ug(e,!1)}function lw(e){return Ug(e,!0)}function Ug(e,t){return Dn(e)?e:new cw(e,t)}class cw{constructor(t,n){this.dep=new yf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Tt(t),this._value=n?t:Vr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Er(t)||Po(t);t=r?t:Tt(t),lo(t,n)&&(this._rawValue=t,this._value=r?t:Vr(t),this.dep.trigger())}}function He(e){return Dn(e)?e.value:e}const uw={get:(e,t,n)=>t==="__v_raw"?e:He(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return Dn(o)&&!Dn(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Hg(e){return Ps(e)?e:new Proxy(e,uw)}class dw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new yf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=aa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&jt!==this)return xg(this,!0),!0}get value(){const t=this.dep.track();return Pg(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function fw(e,t,n=!1){let r,o;return tt(e)?r=e:(r=e.get,o=e.set),new dw(r,o,n)}const pl={},Hl=new WeakMap;let Es;function pw(e,t=!1,n=Es){if(n){let r=Hl.get(n);r||Hl.set(n,r=[]),r.push(e)}}function hw(e,t,n=Lt){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:a,call:l}=n,c=Y=>o?Y:Er(Y)||o===!1||o===0?Eo(Y,1):Eo(Y);let d,f,m,v,T=!1,k=!1;if(Dn(e)?(f=()=>e.value,T=Er(e)):Ps(e)?(f=()=>c(e),T=!0):Ye(e)?(k=!0,T=e.some(Y=>Ps(Y)||Er(Y)),f=()=>e.map(Y=>{if(Dn(Y))return Y.value;if(Ps(Y))return c(Y);if(tt(Y))return l?l(Y,2):Y()})):tt(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){Ro();try{m()}finally{Mo()}}const Y=Es;Es=d;try{return l?l(e,3,[v]):e(v)}finally{Es=Y}}:f=uo,t&&o){const Y=f,ce=o===!0?1/0:o;f=()=>Eo(Y(),ce)}const H=Ub(),P=()=>{d.stop(),H&&H.active&&ff(H.effects,d)};if(s&&t){const Y=t;t=(...ce)=>{Y(...ce),P()}}let O=k?new Array(e.length).fill(pl):pl;const W=Y=>{if(!(!(d.flags&1)||!d.dirty&&!Y))if(t){const ce=d.run();if(o||T||(k?ce.some((re,Z)=>lo(re,O[Z])):lo(ce,O))){m&&m();const re=Es;Es=d;try{const Z=[ce,O===pl?void 0:k&&O[0]===pl?[]:O,v];O=ce,l?l(t,3,Z):t(...Z)}finally{Es=re}}}else d.run()};return a&&a(W),d=new Ag(f),d.scheduler=i?()=>i(W,!1):W,v=Y=>pw(Y,!1,d),m=d.onStop=()=>{const Y=Hl.get(d);if(Y){if(l)l(Y,4);else for(const ce of Y)ce();Hl.delete(d)}},t?r?W(!0):O=d.run():i?i(W.bind(null,!0),!0):d.run(),P.pause=d.pause.bind(d),P.resume=d.resume.bind(d),P.stop=P,P}function Eo(e,t=1/0,n){if(t<=0||!Ct(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Dn(e))Eo(e.value,t,n);else if(Ye(e))for(let r=0;r<e.length;r++)Eo(e[r],t,n);else if(Ei(e)||li(e))e.forEach(r=>{Eo(r,t,n)});else if(Sg(e)){for(const r in e)Eo(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Eo(e[r],t,n)}return e}/**
11
+ * @vue/runtime-core v3.5.32
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/function ka(e,t,n,r){try{return r?e(...r):e()}catch(o){Ia(o,t,n)}}function zr(e,t,n,r){if(tt(e)){const o=ka(e,t,n,r);return o&&bg(o)&&o.catch(s=>{Ia(s,t,n)}),o}if(Ye(e)){const o=[];for(let s=0;s<e.length;s++)o.push(zr(e[s],t,n,r));return o}}function Ia(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Lt;if(t){let a=t.parent;const l=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const d=a.ec;if(d){for(let f=0;f<d.length;f++)if(d[f](e,l,c)===!1)return}a=a.parent}if(s){Ro(),ka(s,null,10,[e,l,c]),Mo();return}}mw(e,n,o,r,i)}function mw(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Kn=[];let ro=-1;const ci=[];let Ko=null,ei=0;const Wg=Promise.resolve();let Wl=null;function Jt(e){const t=Wl||Wg;return e?t.then(this?e.bind(this):e):t}function gw(e){let t=ro+1,n=Kn.length;for(;t<n;){const r=t+n>>>1,o=Kn[r],s=ca(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Sf(e){if(!(e.flags&1)){const t=ca(e),n=Kn[Kn.length-1];!n||!(e.flags&2)&&t>=ca(n)?Kn.push(e):Kn.splice(gw(t),0,e),e.flags|=1,Vg()}}function Vg(){Wl||(Wl=Wg.then(Gg))}function vw(e){Ye(e)?ci.push(...e):Ko&&e.id===-1?Ko.splice(ei+1,0,e):e.flags&1||(ci.push(e),e.flags|=1),Vg()}function yp(e,t,n=ro+1){for(;n<Kn.length;n++){const r=Kn[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Kn.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function zg(e){if(ci.length){const t=[...new Set(ci)].sort((n,r)=>ca(n)-ca(r));if(ci.length=0,Ko){Ko.push(...t);return}for(Ko=t,ei=0;ei<Ko.length;ei++){const n=Ko[ei];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ko=null,ei=0}}const ca=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Gg(e){try{for(ro=0;ro<Kn.length;ro++){const t=Kn[ro];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ka(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ro<Kn.length;ro++){const t=Kn[ro];t&&(t.flags&=-2)}ro=-1,Kn.length=0,zg(),Wl=null,(Kn.length||ci.length)&&Gg()}}let In=null,Kg=null;function Vl(e){const t=In;return In=e,Kg=e&&e.type.__scopeId||null,t}function kt(e,t=In,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&Kl(-1);const s=Vl(t);let i;try{i=e(...o)}finally{Vl(s),r._d&&Kl(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Br(e,t){if(In===null)return e;const n=Sc(In),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,a,l=Lt]=t[o];s&&(tt(s)&&(s={mounted:s,updated:s}),s.deep&&Eo(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function ys(e,t,n,r){const o=e.dirs,s=t&&t.dirs;for(let i=0;i<o.length;i++){const a=o[i];s&&(a.oldValue=s[i].value);let l=a.dir[r];l&&(Ro(),zr(l,n,8,[e.el,a,e,t]),Mo())}}function Cl(e,t){if(kn){let n=kn.provides;const r=kn.parent&&kn.parent.provides;r===n&&(n=kn.provides=Object.create(r)),n[e]=t}}function Hr(e,t,n=!1){const r=xf();if(r||di){let o=di?di._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&tt(t)?t.call(r&&r.proxy):t}}const yw=Symbol.for("v-scx"),_w=()=>Hr(yw);function lt(e,t,n){return Yg(e,t,n)}function Yg(e,t,n=Lt){const{immediate:r,deep:o,flush:s,once:i}=n,a=hn({},n),l=t&&r||!t&&s!=="post";let c;if(hi){if(s==="sync"){const v=_w();c=v.__watcherHandles||(v.__watcherHandles=[])}else if(!l){const v=()=>{};return v.stop=uo,v.resume=uo,v.pause=uo,v}}const d=kn;a.call=(v,T,k)=>zr(v,d,T,k);let f=!1;s==="post"?a.scheduler=v=>{zn(v,d&&d.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(v,T)=>{T?v():Sf(v)}),a.augmentJob=v=>{t&&(v.flags|=4),f&&(v.flags|=2,d&&(v.id=d.uid,v.i=d))};const m=hw(e,t,a);return hi&&(c?c.push(m):l&&m()),m}function bw(e,t,n){const r=this.proxy,o=Kt(e)?e.includes(".")?Jg(r,e):()=>r[e]:e.bind(r,r);let s;tt(t)?s=t:(s=t.handler,n=t);const i=Ca(this),a=Yg(o,s.bind(r),n);return i(),a}function Jg(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}const _s=new WeakMap,Xg=Symbol("_vte"),Qg=e=>e.__isTeleport,Is=e=>e&&(e.disabled||e.disabled===""),ww=e=>e&&(e.defer||e.defer===""),_p=e=>typeof SVGElement<"u"&&e instanceof SVGElement,bp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,bd=(e,t)=>{const n=e&&e.to;return Kt(n)?t?t(n):null:n},Sw={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,a,l,c){const{mc:d,pc:f,pbc:m,o:{insert:v,querySelector:T,createText:k,createComment:H}}=c,P=Is(t.props);let{dynamicChildren:O}=t;const W=(re,Z,he)=>{re.shapeFlag&16&&d(re.children,Z,he,o,s,i,a,l)},Y=(re=t)=>{const Z=Is(re.props),he=re.target=bd(re.props,T),Ce=wd(he,re,k,v);he&&(i!=="svg"&&_p(he)?i="svg":i!=="mathml"&&bp(he)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(he),Z||(W(re,he,Ce),Yi(re,!1)))},ce=re=>{const Z=()=>{_s.get(re)===Z&&(_s.delete(re),Is(re.props)&&(W(re,n,re.anchor),Yi(re,!0)),Y(re))};_s.set(re,Z),zn(Z,s)};if(e==null){const re=t.el=k(""),Z=t.anchor=k("");if(v(re,n,r),v(Z,n,r),ww(t.props)||s&&s.pendingBranch){ce(t);return}P&&(W(t,n,Z),Yi(t,!0)),Y()}else{t.el=e.el;const re=t.anchor=e.anchor,Z=_s.get(e);if(Z){Z.flags|=8,_s.delete(e),ce(t);return}t.targetStart=e.targetStart;const he=t.target=e.target,Ce=t.targetAnchor=e.targetAnchor,Ae=Is(e.props),ue=Ae?n:he,V=Ae?re:Ce;if(i==="svg"||_p(he)?i="svg":(i==="mathml"||bp(he))&&(i="mathml"),O?(m(e.dynamicChildren,O,ue,o,s,i,a),Af(e,t,!0)):l||f(e,t,ue,V,o,s,i,a,!1),P)Ae?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):hl(t,n,re,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ae=t.target=bd(t.props,T);ae&&hl(t,ae,null,c,0)}else Ae&&hl(t,he,Ce,c,1);Yi(t,P)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:a,anchor:l,targetStart:c,targetAnchor:d,target:f,props:m}=e;let v=s||!Is(m);const T=_s.get(e);if(T&&(T.flags|=8,_s.delete(e),v=!1),f&&(o(c),o(d)),s&&o(l),i&16)for(let k=0;k<a.length;k++){const H=a[k];r(H,t,n,v,!!H.dynamicChildren)}},move:hl,hydrate:Tw};function hl(e,t,n,{o:{insert:r},m:o},s=2){s===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:c,props:d}=e,f=s===2;if(f&&r(i,t,n),(!f||Is(d))&&l&16)for(let m=0;m<c.length;m++)o(c[m],t,n,2);f&&r(a,t,n)}function Tw(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:c,createText:d}},f){function m(H,P){let O=P;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,H._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function v(H,P){P.anchor=f(i(H),P,a(H),n,r,o,s)}const T=t.target=bd(t.props,l),k=Is(t.props);if(T){const H=T._lpa||T.firstChild;t.shapeFlag&16&&(k?(v(e,t),m(T,H),t.targetAnchor||wd(T,t,d,c,a(e)===T?e:null)):(t.anchor=i(e),m(T,H),t.targetAnchor||wd(T,t,d,c),f(H&&i(H),t,T,n,r,o,s))),Yi(t,k)}else k&&t.shapeFlag&16&&(v(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const xl=Sw;function Yi(e,t){const n=e.ctx;if(n&&n.ut){let r,o;for(t?(r=e.el,o=e.anchor):(r=e.targetStart,o=e.targetAnchor);r&&r!==o;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function wd(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Xg]=i,e&&(r(s,e,o),r(i,e,o)),i}const so=Symbol("_leaveCb"),Wi=Symbol("_enterCb");function Ew(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return as(()=>{e.isMounted=!0}),Fs(()=>{e.isUnmounting=!0}),e}const wr=[Function,Array],Zg={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:wr,onEnter:wr,onAfterEnter:wr,onEnterCancelled:wr,onBeforeLeave:wr,onLeave:wr,onAfterLeave:wr,onLeaveCancelled:wr,onBeforeAppear:wr,onAppear:wr,onAfterAppear:wr,onAppearCancelled:wr},ev=e=>{const t=e.subTree;return t.component?ev(t.component):t},kw={name:"BaseTransition",props:Zg,setup(e,{slots:t}){const n=xf(),r=Ew();return()=>{const o=t.default&&rv(t.default(),!0);if(!o||!o.length)return;const s=tv(o),i=Tt(e),{mode:a}=i;if(r.isLeaving)return wu(s);const l=wp(s);if(!l)return wu(s);let c=Sd(l,i,r,n,f=>c=f);l.type!==On&&ua(l,c);let d=n.subTree&&wp(n.subTree);if(d&&d.type!==On&&!As(d,l)&&ev(n).type!==On){let f=Sd(d,i,r,n);if(ua(d,f),a==="out-in"&&l.type!==On)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,d=void 0},wu(s);a==="in-out"&&l.type!==On?f.delayLeave=(m,v,T)=>{const k=nv(r,d);k[String(d.key)]=d,m[so]=()=>{v(),m[so]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{T(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return s}}};function tv(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==On){t=n;break}}return t}const Iw=kw;function nv(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Sd(e,t,n,r,o){const{appear:s,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:d,onEnterCancelled:f,onBeforeLeave:m,onLeave:v,onAfterLeave:T,onLeaveCancelled:k,onBeforeAppear:H,onAppear:P,onAfterAppear:O,onAppearCancelled:W}=t,Y=String(e.key),ce=nv(n,e),re=(Ce,Ae)=>{Ce&&zr(Ce,r,9,Ae)},Z=(Ce,Ae)=>{const ue=Ae[1];re(Ce,Ae),Ye(Ce)?Ce.every(V=>V.length<=1)&&ue():Ce.length<=1&&ue()},he={mode:i,persisted:a,beforeEnter(Ce){let Ae=l;if(!n.isMounted)if(s)Ae=H||l;else return;Ce[so]&&Ce[so](!0);const ue=ce[Y];ue&&As(e,ue)&&ue.el[so]&&ue.el[so](),re(Ae,[Ce])},enter(Ce){if(ce[Y]===e)return;let Ae=c,ue=d,V=f;if(!n.isMounted)if(s)Ae=P||c,ue=O||d,V=W||f;else return;let ae=!1;Ce[Wi]=Fe=>{ae||(ae=!0,Fe?re(V,[Ce]):re(ue,[Ce]),he.delayedLeave&&he.delayedLeave(),Ce[Wi]=void 0)};const xe=Ce[Wi].bind(null,!1);Ae?Z(Ae,[Ce,xe]):xe()},leave(Ce,Ae){const ue=String(e.key);if(Ce[Wi]&&Ce[Wi](!0),n.isUnmounting)return Ae();re(m,[Ce]);let V=!1;Ce[so]=xe=>{V||(V=!0,Ae(),xe?re(k,[Ce]):re(T,[Ce]),Ce[so]=void 0,ce[ue]===e&&delete ce[ue])};const ae=Ce[so].bind(null,!1);ce[ue]=e,v?Z(v,[Ce,ae]):ae()},clone(Ce){const Ae=Sd(Ce,t,n,r,o);return o&&o(Ae),Ae}};return he}function wu(e){if(Aa(e))return e=ns(e),e.children=null,e}function wp(e){if(!Aa(e))return Qg(e.type)&&e.children?tv(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&tt(n.default))return n.default()}}function ua(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ua(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function rv(e,t=!1,n){let r=[],o=0;for(let s=0;s<e.length;s++){let i=e[s];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:s);i.type===Xe?(i.patchFlag&128&&o++,r=r.concat(rv(i.children,t,a))):(t||i.type!==On)&&r.push(a!=null?ns(i,{key:a}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function An(e,t){return tt(e)?hn({name:e.name},t,{setup:e}):e}function Tf(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Sp(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const zl=new WeakMap;function ea(e,t,n,r,o=!1){if(Ye(e)){e.forEach((k,H)=>ea(k,t&&(Ye(t)?t[H]:t),n,r,o));return}if(ui(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ea(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Sc(r.component):r.el,i=o?null:s,{i:a,r:l}=e,c=t&&t.r,d=a.refs===Lt?a.refs={}:a.refs,f=a.setupState,m=Tt(f),v=f===Lt?_g:k=>Sp(d,k)?!1:At(m,k),T=(k,H)=>!(H&&Sp(d,H));if(c!=null&&c!==l){if(Tp(t),Kt(c))d[c]=null,v(c)&&(f[c]=null);else if(Dn(c)){const k=t;T(c,k.k)&&(c.value=null),k.k&&(d[k.k]=null)}}if(tt(l))ka(l,a,12,[i,d]);else{const k=Kt(l),H=Dn(l);if(k||H){const P=()=>{if(e.f){const O=k?v(l)?f[l]:d[l]:T()||!e.k?l.value:d[e.k];if(o)Ye(O)&&ff(O,s);else if(Ye(O))O.includes(s)||O.push(s);else if(k)d[l]=[s],v(l)&&(f[l]=d[l]);else{const W=[s];T(l,e.k)&&(l.value=W),e.k&&(d[e.k]=W)}}else k?(d[l]=i,v(l)&&(f[l]=i)):H&&(T(l,e.k)&&(l.value=i),e.k&&(d[e.k]=i))};if(i){const O=()=>{P(),zl.delete(e)};O.id=-1,zl.set(e,O),zn(O,n)}else Tp(e),P()}}}function Tp(e){const t=zl.get(e);t&&(t.flags|=8,zl.delete(e))}const Ep=e=>e.nodeType===8;mc().requestIdleCallback;mc().cancelIdleCallback;function Aw(e,t){if(Ep(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Ep(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const ui=e=>!!e.type.__asyncLoader;function Su(e){tt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:o=200,hydrate:s,timeout:i,suspensible:a=!0,onError:l}=e;let c=null,d,f=0;const m=()=>(f++,c=null,v()),v=()=>{let T;return c||(T=c=t().catch(k=>{if(k=k instanceof Error?k:new Error(String(k)),l)return new Promise((H,P)=>{l(k,()=>H(m()),()=>P(k),f+1)});throw k}).then(k=>T!==c&&c?c:(k&&(k.__esModule||k[Symbol.toStringTag]==="Module")&&(k=k.default),d=k,k)))};return An({name:"AsyncComponentWrapper",__asyncLoader:v,__asyncHydrate(T,k,H){let P=!1;(k.bu||(k.bu=[])).push(()=>P=!0);const O=()=>{P||H()},W=s?()=>{const Y=s(O,ce=>Aw(T,ce));Y&&(k.bum||(k.bum=[])).push(Y)}:O;d?W():v().then(()=>!k.isUnmounted&&W())},get __asyncResolved(){return d},setup(){const T=kn;if(Tf(T),d)return()=>ml(d,T);const k=W=>{c=null,Ia(W,T,13,!r)};if(a&&T.suspense||hi)return v().then(W=>()=>ml(W,T)).catch(W=>(k(W),()=>r?ze(r,{error:W}):null));const H=j(!1),P=j(),O=j(!!o);return o&&setTimeout(()=>{O.value=!1},o),i!=null&&setTimeout(()=>{if(!H.value&&!P.value){const W=new Error(`Async component timed out after ${i}ms.`);k(W),P.value=W}},i),v().then(()=>{H.value=!0,T.parent&&Aa(T.parent.vnode)&&T.parent.update()}).catch(W=>{k(W),P.value=W}),()=>{if(H.value&&d)return ml(d,T);if(P.value&&r)return ze(r,{error:P.value});if(n&&!O.value)return ml(n,T)}}})}function ml(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=ze(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const Aa=e=>e.type.__isKeepAlive;function Cw(e,t){ov(e,"a",t)}function xw(e,t){ov(e,"da",t)}function ov(e,t,n=kn){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(yc(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Aa(o.parent.vnode)&&Rw(r,t,n,o),o=o.parent}}function Rw(e,t,n,r){const o=yc(t,e,r,!0);_c(()=>{ff(r[t],o)},n)}function yc(e,t,n=kn,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Ro();const a=Ca(n),l=zr(t,n,e,i);return a(),Mo(),l});return r?o.unshift(s):o.push(s),s}}const jo=e=>(t,n=kn)=>{(!hi||e==="sp")&&yc(e,(...r)=>t(...r),n)},Mw=jo("bm"),as=jo("m"),Pw=jo("bu"),$w=jo("u"),Fs=jo("bum"),_c=jo("um"),Nw=jo("sp"),Ow=jo("rtg"),Lw=jo("rtc");function Dw(e,t=kn){yc("ec",e,t)}const jw="components",sv=Symbol.for("v-ndc");function Ef(e){return Kt(e)?Fw(jw,e,!1)||e:e||sv}function Fw(e,t,n=!0,r=!1){const o=In||kn;if(o){const s=o.type;{const a=TS(s,!1);if(a&&(a===t||a===Yn(t)||a===pc(Yn(t))))return s}const i=kp(o[e]||s[e],t)||kp(o.appContext[e],t);return!i&&r?s:i}}function kp(e,t){return e&&(e[t]||e[Yn(t)]||e[pc(Yn(t))])}function Bt(e,t,n,r){let o;const s=n,i=Ye(e);if(i||Kt(e)){const a=i&&Ps(e);let l=!1,c=!1;a&&(l=!Er(e),c=Po(e),e=gc(e)),o=new Array(e.length);for(let d=0,f=e.length;d<f;d++)o[d]=t(l?c?pi(Vr(e[d])):Vr(e[d]):e[d],d,void 0,s)}else if(typeof e=="number"){o=new Array(e);for(let a=0;a<e;a++)o[a]=t(a+1,a,void 0,s)}else if(Ct(e))if(e[Symbol.iterator])o=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);o=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const d=a[l];o[l]=t(e[d],d,l,s)}}else o=[];return o}function co(e,t,n={},r,o){if(In.ce||In.parent&&ui(In.parent)&&In.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),A(),yt(Xe,null,[ze("slot",n,r)],c?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),A();const i=s&&iv(s(n)),a=n.key||i&&i.key,l=yt(Xe,{key:(a&&!Wr(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function iv(e){return e.some(t=>fa(t)?!(t.type===On||t.type===Xe&&!iv(t.children)):!0)?e:null}const Td=e=>e?Iv(e)?Sc(e):Td(e.parent):null,ta=hn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Td(e.parent),$root:e=>Td(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lv(e),$forceUpdate:e=>e.f||(e.f=()=>{Sf(e.update)}),$nextTick:e=>e.n||(e.n=Jt.bind(e.proxy)),$watch:e=>bw.bind(e)}),Tu=(e,t)=>e!==Lt&&!e.__isScriptSetup&&At(e,t),Bw={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:o,props:s,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const m=i[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(Tu(r,t))return i[t]=1,r[t];if(o!==Lt&&At(o,t))return i[t]=2,o[t];if(At(s,t))return i[t]=3,s[t];if(n!==Lt&&At(n,t))return i[t]=4,n[t];Ed&&(i[t]=0)}}const c=ta[t];let d,f;if(c)return t==="$attrs"&&$n(e.attrs,"get",""),c(e);if((d=a.__cssModules)&&(d=d[t]))return d;if(n!==Lt&&At(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,At(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return Tu(o,t)?(o[t]=n,!0):r!==Lt&&At(r,t)?(r[t]=n,!0):At(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:s,type:i}},a){let l;return!!(n[a]||e!==Lt&&a[0]!=="$"&&At(e,a)||Tu(t,a)||At(s,a)||At(r,a)||At(ta,a)||At(o.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:At(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function qw(){return Uw().slots}function Uw(e){const t=xf();return t.setupContext||(t.setupContext=Cv(t))}function Ip(e){return Ye(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ed=!0;function Hw(e){const t=lv(e),n=e.proxy,r=e.ctx;Ed=!1,t.beforeCreate&&Ap(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:a,provide:l,inject:c,created:d,beforeMount:f,mounted:m,beforeUpdate:v,updated:T,activated:k,deactivated:H,beforeDestroy:P,beforeUnmount:O,destroyed:W,unmounted:Y,render:ce,renderTracked:re,renderTriggered:Z,errorCaptured:he,serverPrefetch:Ce,expose:Ae,inheritAttrs:ue,components:V,directives:ae,filters:xe}=t;if(c&&Ww(c,r,null),i)for(const Me in i){const fe=i[Me];tt(fe)&&(r[Me]=fe.bind(n))}if(o){const Me=o.call(n,n);Ct(Me)&&(e.data=vc(Me))}if(Ed=!0,s)for(const Me in s){const fe=s[Me],De=tt(fe)?fe.bind(n,n):tt(fe.get)?fe.get.bind(n,n):uo,Be=!tt(fe)&&tt(fe.set)?fe.set.bind(n):uo,Re=se({get:De,set:Be});Object.defineProperty(r,Me,{enumerable:!0,configurable:!0,get:()=>Re.value,set:Ge=>Re.value=Ge})}if(a)for(const Me in a)av(a[Me],r,n,Me);if(l){const Me=tt(l)?l.call(n):l;Reflect.ownKeys(Me).forEach(fe=>{Cl(fe,Me[fe])})}d&&Ap(d,e,"c");function _e(Me,fe){Ye(fe)?fe.forEach(De=>Me(De.bind(n))):fe&&Me(fe.bind(n))}if(_e(Mw,f),_e(as,m),_e(Pw,v),_e($w,T),_e(Cw,k),_e(xw,H),_e(Dw,he),_e(Lw,re),_e(Ow,Z),_e(Fs,O),_e(_c,Y),_e(Nw,Ce),Ye(Ae))if(Ae.length){const Me=e.exposed||(e.exposed={});Ae.forEach(fe=>{Object.defineProperty(Me,fe,{get:()=>n[fe],set:De=>n[fe]=De,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===uo&&(e.render=ce),ue!=null&&(e.inheritAttrs=ue),V&&(e.components=V),ae&&(e.directives=ae),Ce&&Tf(e)}function Ww(e,t,n=uo){Ye(e)&&(e=kd(e));for(const r in e){const o=e[r];let s;Ct(o)?"default"in o?s=Hr(o.from||r,o.default,!0):s=Hr(o.from||r):s=Hr(o),Dn(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):t[r]=s}}function Ap(e,t,n){zr(Ye(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function av(e,t,n,r){let o=r.includes(".")?Jg(n,r):()=>n[r];if(Kt(e)){const s=t[e];tt(s)&&lt(o,s)}else if(tt(e))lt(o,e.bind(n));else if(Ct(e))if(Ye(e))e.forEach(s=>av(s,t,n,r));else{const s=tt(e.handler)?e.handler.bind(n):t[e.handler];tt(s)&&lt(o,s,e)}}function lv(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:i}}=e.appContext,a=s.get(t);let l;return a?l=a:!o.length&&!n&&!r?l=t:(l={},o.length&&o.forEach(c=>Gl(l,c,i,!0)),Gl(l,t,i)),Ct(t)&&s.set(t,l),l}function Gl(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&Gl(e,s,n,!0),o&&o.forEach(i=>Gl(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Vw[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Vw={data:Cp,props:xp,emits:xp,methods:Ji,computed:Ji,beforeCreate:Vn,created:Vn,beforeMount:Vn,mounted:Vn,beforeUpdate:Vn,updated:Vn,beforeDestroy:Vn,beforeUnmount:Vn,destroyed:Vn,unmounted:Vn,activated:Vn,deactivated:Vn,errorCaptured:Vn,serverPrefetch:Vn,components:Ji,directives:Ji,watch:Gw,provide:Cp,inject:zw};function Cp(e,t){return t?e?function(){return hn(tt(e)?e.call(this,this):e,tt(t)?t.call(this,this):t)}:t:e}function zw(e,t){return Ji(kd(e),kd(t))}function kd(e){if(Ye(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Vn(e,t){return e?[...new Set([].concat(e,t))]:t}function Ji(e,t){return e?hn(Object.create(null),e,t):t}function xp(e,t){return e?Ye(e)&&Ye(t)?[...new Set([...e,...t])]:hn(Object.create(null),Ip(e),Ip(t??{})):t}function Gw(e,t){if(!e)return t;if(!t)return e;const n=hn(Object.create(null),e);for(const r in t)n[r]=Vn(e[r],t[r]);return n}function cv(){return{app:null,config:{isNativeTag:_g,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Kw=0;function Yw(e,t){return function(r,o=null){tt(r)||(r=hn({},r)),o!=null&&!Ct(o)&&(o=null);const s=cv(),i=new WeakSet,a=[];let l=!1;const c=s.app={_uid:Kw++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:kS,get config(){return s.config},set config(d){},use(d,...f){return i.has(d)||(d&&tt(d.install)?(i.add(d),d.install(c,...f)):tt(d)&&(i.add(d),d(c,...f))),c},mixin(d){return s.mixins.includes(d)||s.mixins.push(d),c},component(d,f){return f?(s.components[d]=f,c):s.components[d]},directive(d,f){return f?(s.directives[d]=f,c):s.directives[d]},mount(d,f,m){if(!l){const v=c._ceVNode||ze(r,o);return v.appContext=s,m===!0?m="svg":m===!1&&(m=void 0),e(v,d,m),l=!0,c._container=d,d.__vue_app__=c,Sc(v.component)}},onUnmount(d){a.push(d)},unmount(){l&&(zr(a,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(d,f){return s.provides[d]=f,c},runWithContext(d){const f=di;di=c;try{return d()}finally{di=f}}};return c}}let di=null;const Jw=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Yn(t)}Modifiers`]||e[`${is(t)}Modifiers`];function Xw(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Lt;let o=n;const s=t.startsWith("update:"),i=s&&Jw(r,t.slice(7));i&&(i.trim&&(o=n.map(d=>Kt(d)?d.trim():d)),i.number&&(o=n.map(hc)));let a,l=r[a=gu(t)]||r[a=gu(Yn(t))];!l&&s&&(l=r[a=gu(is(t))]),l&&zr(l,e,6,o);const c=r[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,zr(c,e,6,o)}}const Qw=new WeakMap;function uv(e,t,n=!1){const r=n?Qw:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!tt(e)){const l=c=>{const d=uv(c,t,!0);d&&(a=!0,hn(i,d))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(Ct(e)&&r.set(e,null),null):(Ye(s)?s.forEach(l=>i[l]=null):hn(i,s),Ct(e)&&r.set(e,i),i)}function bc(e,t){return!e||!uc(t)?!1:(t=t.slice(2).replace(/Once$/,""),At(e,t[0].toLowerCase()+t.slice(1))||At(e,is(t))||At(e,t))}function Rp(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:c,renderCache:d,props:f,data:m,setupState:v,ctx:T,inheritAttrs:k}=e,H=Vl(e);let P,O;try{if(n.shapeFlag&4){const Y=o||r,ce=Y;P=ao(c.call(ce,Y,d,f,v,m,T)),O=a}else{const Y=t;P=ao(Y.length>1?Y(f,{attrs:a,slots:i,emit:l}):Y(f,null)),O=t.props?a:Zw(a)}}catch(Y){na.length=0,Ia(Y,e,1),P=ze(On)}let W=P;if(O&&k!==!1){const Y=Object.keys(O),{shapeFlag:ce}=W;Y.length&&ce&7&&(s&&Y.some(dc)&&(O=eS(O,s)),W=ns(W,O,!1,!0))}return n.dirs&&(W=ns(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition&&ua(W,n.transition),P=W,Vl(H),P}const Zw=e=>{let t;for(const n in e)(n==="class"||n==="style"||uc(n))&&((t||(t={}))[n]=e[n]);return t},eS=(e,t)=>{const n={};for(const r in e)(!dc(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function tS(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,c=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Mp(r,i,c):!!i;if(l&8){const d=t.dynamicProps;for(let f=0;f<d.length;f++){const m=d[f];if(dv(i,r,m)&&!bc(c,m))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Mp(r,i,c):!0:!!i;return!1}function Mp(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(dv(t,e,s)&&!bc(n,s))return!0}return!1}function dv(e,t,n){const r=e[n],o=t[n];return n==="style"&&Ct(r)&&Ct(o)?!ki(r,o):r!==o}function nS({vnode:e,parent:t,suspense:n},r){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=r,e=o),o===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const fv={},pv=()=>Object.create(fv),hv=e=>Object.getPrototypeOf(e)===fv;function rS(e,t,n,r=!1){const o={},s=pv();e.propsDefaults=Object.create(null),mv(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:qg(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function oS(e,t,n,r){const{props:o,attrs:s,vnode:{patchFlag:i}}=e,a=Tt(o),[l]=e.propsOptions;let c=!1;if((r||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let f=0;f<d.length;f++){let m=d[f];if(bc(e.emitsOptions,m))continue;const v=t[m];if(l)if(At(s,m))v!==s[m]&&(s[m]=v,c=!0);else{const T=Yn(m);o[T]=Id(l,a,T,v,e,!1)}else v!==s[m]&&(s[m]=v,c=!0)}}}else{mv(e,t,o,s)&&(c=!0);let d;for(const f in a)(!t||!At(t,f)&&((d=is(f))===f||!At(t,d)))&&(l?n&&(n[f]!==void 0||n[d]!==void 0)&&(o[f]=Id(l,a,f,void 0,e,!0)):delete o[f]);if(s!==a)for(const f in s)(!t||!At(t,f))&&(delete s[f],c=!0)}c&&To(e.attrs,"set","")}function mv(e,t,n,r){const[o,s]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Xi(l))continue;const c=t[l];let d;o&&At(o,d=Yn(l))?!s||!s.includes(d)?n[d]=c:(a||(a={}))[d]=c:bc(e.emitsOptions,l)||(!(l in r)||c!==r[l])&&(r[l]=c,i=!0)}if(s){const l=Tt(n),c=a||Lt;for(let d=0;d<s.length;d++){const f=s[d];n[f]=Id(o,l,f,c[f],e,!At(c,f))}}return i}function Id(e,t,n,r,o,s){const i=e[n];if(i!=null){const a=At(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&tt(l)){const{propsDefaults:c}=o;if(n in c)r=c[n];else{const d=Ca(o);r=c[n]=l.call(null,t),d()}}else r=l;o.ce&&o.ce._setProp(n,r)}i[0]&&(s&&!a?r=!1:i[1]&&(r===""||r===is(n))&&(r=!0))}return r}const sS=new WeakMap;function gv(e,t,n=!1){const r=n?sS:t.propsCache,o=r.get(e);if(o)return o;const s=e.props,i={},a=[];let l=!1;if(!tt(e)){const d=f=>{l=!0;const[m,v]=gv(f,t,!0);hn(i,m),v&&a.push(...v)};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!s&&!l)return Ct(e)&&r.set(e,ai),ai;if(Ye(s))for(let d=0;d<s.length;d++){const f=Yn(s[d]);Pp(f)&&(i[f]=Lt)}else if(s)for(const d in s){const f=Yn(d);if(Pp(f)){const m=s[d],v=i[f]=Ye(m)||tt(m)?{type:m}:hn({},m),T=v.type;let k=!1,H=!0;if(Ye(T))for(let P=0;P<T.length;++P){const O=T[P],W=tt(O)&&O.name;if(W==="Boolean"){k=!0;break}else W==="String"&&(H=!1)}else k=tt(T)&&T.name==="Boolean";v[0]=k,v[1]=H,(k||At(v,"default"))&&a.push(f)}}const c=[i,a];return Ct(e)&&r.set(e,c),c}function Pp(e){return e[0]!=="$"&&!Xi(e)}const kf=e=>e==="_"||e==="_ctx"||e==="$stable",If=e=>Ye(e)?e.map(ao):[ao(e)],iS=(e,t,n)=>{if(t._n)return t;const r=kt((...o)=>If(t(...o)),n);return r._c=!1,r},vv=(e,t,n)=>{const r=e._ctx;for(const o in e){if(kf(o))continue;const s=e[o];if(tt(s))t[o]=iS(o,s,r);else if(s!=null){const i=If(s);t[o]=()=>i}}},yv=(e,t)=>{const n=If(t);e.slots.default=()=>n},_v=(e,t,n)=>{for(const r in t)(n||!kf(r))&&(e[r]=t[r])},aS=(e,t,n)=>{const r=e.slots=pv();if(e.vnode.shapeFlag&32){const o=t._;o?(_v(r,t,n),n&&Tg(r,"_",o,!0)):vv(t,r)}else t&&yv(e,t)},lS=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,i=Lt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:_v(o,t,n):(s=!t.$stable,vv(t,o)),i=t}else t&&(yv(e,t),i={default:1});if(s)for(const a in o)!kf(a)&&i[a]==null&&delete o[a]},zn=pS;function cS(e){return uS(e)}function uS(e,t){const n=mc();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:c,setElementText:d,parentNode:f,nextSibling:m,setScopeId:v=uo,insertStaticContent:T}=e,k=(E,I,q,Q=null,ee=null,te=null,ie=void 0,pe=null,me=!!I.dynamicChildren)=>{if(E===I)return;E&&!As(E,I)&&(Q=J(E),Ge(E,ee,te,!0),E=null),I.patchFlag===-2&&(me=!1,I.dynamicChildren=null);const{type:ne,ref:Ue,shapeFlag:ke}=I;switch(ne){case wc:H(E,I,q,Q);break;case On:P(E,I,q,Q);break;case ku:E==null&&O(I,q,Q,ie);break;case Xe:V(E,I,q,Q,ee,te,ie,pe,me);break;default:ke&1?ce(E,I,q,Q,ee,te,ie,pe,me):ke&6?ae(E,I,q,Q,ee,te,ie,pe,me):(ke&64||ke&128)&&ne.process(E,I,q,Q,ee,te,ie,pe,me,ve)}Ue!=null&&ee?ea(Ue,E&&E.ref,te,I||E,!I):Ue==null&&E&&E.ref!=null&&ea(E.ref,null,te,E,!0)},H=(E,I,q,Q)=>{if(E==null)r(I.el=a(I.children),q,Q);else{const ee=I.el=E.el;I.children!==E.children&&c(ee,I.children)}},P=(E,I,q,Q)=>{E==null?r(I.el=l(I.children||""),q,Q):I.el=E.el},O=(E,I,q,Q)=>{[E.el,E.anchor]=T(E.children,I,q,Q,E.el,E.anchor)},W=({el:E,anchor:I},q,Q)=>{let ee;for(;E&&E!==I;)ee=m(E),r(E,q,Q),E=ee;r(I,q,Q)},Y=({el:E,anchor:I})=>{let q;for(;E&&E!==I;)q=m(E),o(E),E=q;o(I)},ce=(E,I,q,Q,ee,te,ie,pe,me)=>{if(I.type==="svg"?ie="svg":I.type==="math"&&(ie="mathml"),E==null)re(I,q,Q,ee,te,ie,pe,me);else{const ne=E.el&&E.el._isVueCE?E.el:null;try{ne&&ne._beginPatch(),Ce(E,I,ee,te,ie,pe,me)}finally{ne&&ne._endPatch()}}},re=(E,I,q,Q,ee,te,ie,pe)=>{let me,ne;const{props:Ue,shapeFlag:ke,transition:ye,dirs:$e}=E;if(me=E.el=i(E.type,te,Ue&&Ue.is,Ue),ke&8?d(me,E.children):ke&16&&he(E.children,me,null,Q,ee,Eu(E,te),ie,pe),$e&&ys(E,null,Q,"created"),Z(me,E,E.scopeId,ie,Q),Ue){for(const $ in Ue)$!=="value"&&!Xi($)&&s(me,$,null,Ue[$],te,Q);"value"in Ue&&s(me,"value",null,Ue.value,te),(ne=Ue.onVnodeBeforeMount)&&no(ne,Q,E)}$e&&ys(E,null,Q,"beforeMount");const x=dS(ee,ye);x&&ye.beforeEnter(me),r(me,I,q),((ne=Ue&&Ue.onVnodeMounted)||x||$e)&&zn(()=>{try{ne&&no(ne,Q,E),x&&ye.enter(me),$e&&ys(E,null,Q,"mounted")}finally{}},ee)},Z=(E,I,q,Q,ee)=>{if(q&&v(E,q),Q)for(let te=0;te<Q.length;te++)v(E,Q[te]);if(ee){let te=ee.subTree;if(I===te||Sv(te.type)&&(te.ssContent===I||te.ssFallback===I)){const ie=ee.vnode;Z(E,ie,ie.scopeId,ie.slotScopeIds,ee.parent)}}},he=(E,I,q,Q,ee,te,ie,pe,me=0)=>{for(let ne=me;ne<E.length;ne++){const Ue=E[ne]=pe?So(E[ne]):ao(E[ne]);k(null,Ue,I,q,Q,ee,te,ie,pe)}},Ce=(E,I,q,Q,ee,te,ie)=>{const pe=I.el=E.el;let{patchFlag:me,dynamicChildren:ne,dirs:Ue}=I;me|=E.patchFlag&16;const ke=E.props||Lt,ye=I.props||Lt;let $e;if(q&&bs(q,!1),($e=ye.onVnodeBeforeUpdate)&&no($e,q,I,E),Ue&&ys(I,E,q,"beforeUpdate"),q&&bs(q,!0),(ke.innerHTML&&ye.innerHTML==null||ke.textContent&&ye.textContent==null)&&d(pe,""),ne?Ae(E.dynamicChildren,ne,pe,q,Q,Eu(I,ee),te):ie||fe(E,I,pe,null,q,Q,Eu(I,ee),te,!1),me>0){if(me&16)ue(pe,ke,ye,q,ee);else if(me&2&&ke.class!==ye.class&&s(pe,"class",null,ye.class,ee),me&4&&s(pe,"style",ke.style,ye.style,ee),me&8){const x=I.dynamicProps;for(let $=0;$<x.length;$++){const D=x[$],X=ke[D],le=ye[D];(le!==X||D==="value")&&s(pe,D,X,le,ee,q)}}me&1&&E.children!==I.children&&d(pe,I.children)}else!ie&&ne==null&&ue(pe,ke,ye,q,ee);(($e=ye.onVnodeUpdated)||Ue)&&zn(()=>{$e&&no($e,q,I,E),Ue&&ys(I,E,q,"updated")},Q)},Ae=(E,I,q,Q,ee,te,ie)=>{for(let pe=0;pe<I.length;pe++){const me=E[pe],ne=I[pe],Ue=me.el&&(me.type===Xe||!As(me,ne)||me.shapeFlag&198)?f(me.el):q;k(me,ne,Ue,null,Q,ee,te,ie,!0)}},ue=(E,I,q,Q,ee)=>{if(I!==q){if(I!==Lt)for(const te in I)!Xi(te)&&!(te in q)&&s(E,te,I[te],null,ee,Q);for(const te in q){if(Xi(te))continue;const ie=q[te],pe=I[te];ie!==pe&&te!=="value"&&s(E,te,pe,ie,ee,Q)}"value"in q&&s(E,"value",I.value,q.value,ee)}},V=(E,I,q,Q,ee,te,ie,pe,me)=>{const ne=I.el=E?E.el:a(""),Ue=I.anchor=E?E.anchor:a("");let{patchFlag:ke,dynamicChildren:ye,slotScopeIds:$e}=I;$e&&(pe=pe?pe.concat($e):$e),E==null?(r(ne,q,Q),r(Ue,q,Q),he(I.children||[],q,Ue,ee,te,ie,pe,me)):ke>0&&ke&64&&ye&&E.dynamicChildren&&E.dynamicChildren.length===ye.length?(Ae(E.dynamicChildren,ye,q,ee,te,ie,pe),(I.key!=null||ee&&I===ee.subTree)&&Af(E,I,!0)):fe(E,I,q,Ue,ee,te,ie,pe,me)},ae=(E,I,q,Q,ee,te,ie,pe,me)=>{I.slotScopeIds=pe,E==null?I.shapeFlag&512?ee.ctx.activate(I,q,Q,ie,me):xe(I,q,Q,ee,te,ie,me):Fe(E,I,me)},xe=(E,I,q,Q,ee,te,ie)=>{const pe=E.component=_S(E,Q,ee);if(Aa(E)&&(pe.ctx.renderer=ve),bS(pe,!1,ie),pe.asyncDep){if(ee&&ee.registerDep(pe,_e,ie),!E.el){const me=pe.subTree=ze(On);P(null,me,I,q),E.placeholder=me.el}}else _e(pe,E,I,q,ee,te,ie)},Fe=(E,I,q)=>{const Q=I.component=E.component;if(tS(E,I,q))if(Q.asyncDep&&!Q.asyncResolved){Me(Q,I,q);return}else Q.next=I,Q.update();else I.el=E.el,Q.vnode=I},_e=(E,I,q,Q,ee,te,ie)=>{const pe=()=>{if(E.isMounted){let{next:ke,bu:ye,u:$e,parent:x,vnode:$}=E;{const Ne=bv(E);if(Ne){ke&&(ke.el=$.el,Me(E,ke,ie)),Ne.asyncDep.then(()=>{zn(()=>{E.isUnmounted||ne()},ee)});return}}let D=ke,X;bs(E,!1),ke?(ke.el=$.el,Me(E,ke,ie)):ke=$,ye&&Al(ye),(X=ke.props&&ke.props.onVnodeBeforeUpdate)&&no(X,x,ke,$),bs(E,!0);const le=Rp(E),Le=E.subTree;E.subTree=le,k(Le,le,f(Le.el),J(Le),E,ee,te),ke.el=le.el,D===null&&nS(E,le.el),$e&&zn($e,ee),(X=ke.props&&ke.props.onVnodeUpdated)&&zn(()=>no(X,x,ke,$),ee)}else{let ke;const{el:ye,props:$e}=I,{bm:x,m:$,parent:D,root:X,type:le}=E,Le=ui(I);bs(E,!1),x&&Al(x),!Le&&(ke=$e&&$e.onVnodeBeforeMount)&&no(ke,D,I),bs(E,!0);{X.ce&&X.ce._hasShadowRoot()&&X.ce._injectChildStyle(le,E.parent?E.parent.type:void 0);const Ne=E.subTree=Rp(E);k(null,Ne,q,Q,E,ee,te),I.el=Ne.el}if($&&zn($,ee),!Le&&(ke=$e&&$e.onVnodeMounted)){const Ne=I;zn(()=>no(ke,D,Ne),ee)}(I.shapeFlag&256||D&&ui(D.vnode)&&D.vnode.shapeFlag&256)&&E.a&&zn(E.a,ee),E.isMounted=!0,I=q=Q=null}};E.scope.on();const me=E.effect=new Ag(pe);E.scope.off();const ne=E.update=me.run.bind(me),Ue=E.job=me.runIfDirty.bind(me);Ue.i=E,Ue.id=E.uid,me.scheduler=()=>Sf(Ue),bs(E,!0),ne()},Me=(E,I,q)=>{I.component=E;const Q=E.vnode.props;E.vnode=I,E.next=null,oS(E,I.props,Q,q),lS(E,I.children,q),Ro(),yp(E),Mo()},fe=(E,I,q,Q,ee,te,ie,pe,me=!1)=>{const ne=E&&E.children,Ue=E?E.shapeFlag:0,ke=I.children,{patchFlag:ye,shapeFlag:$e}=I;if(ye>0){if(ye&128){Be(ne,ke,q,Q,ee,te,ie,pe,me);return}else if(ye&256){De(ne,ke,q,Q,ee,te,ie,pe,me);return}}$e&8?(Ue&16&&Ke(ne,ee,te),ke!==ne&&d(q,ke)):Ue&16?$e&16?Be(ne,ke,q,Q,ee,te,ie,pe,me):Ke(ne,ee,te,!0):(Ue&8&&d(q,""),$e&16&&he(ke,q,Q,ee,te,ie,pe,me))},De=(E,I,q,Q,ee,te,ie,pe,me)=>{E=E||ai,I=I||ai;const ne=E.length,Ue=I.length,ke=Math.min(ne,Ue);let ye;for(ye=0;ye<ke;ye++){const $e=I[ye]=me?So(I[ye]):ao(I[ye]);k(E[ye],$e,q,null,ee,te,ie,pe,me)}ne>Ue?Ke(E,ee,te,!0,!1,ke):he(I,q,Q,ee,te,ie,pe,me,ke)},Be=(E,I,q,Q,ee,te,ie,pe,me)=>{let ne=0;const Ue=I.length;let ke=E.length-1,ye=Ue-1;for(;ne<=ke&&ne<=ye;){const $e=E[ne],x=I[ne]=me?So(I[ne]):ao(I[ne]);if(As($e,x))k($e,x,q,null,ee,te,ie,pe,me);else break;ne++}for(;ne<=ke&&ne<=ye;){const $e=E[ke],x=I[ye]=me?So(I[ye]):ao(I[ye]);if(As($e,x))k($e,x,q,null,ee,te,ie,pe,me);else break;ke--,ye--}if(ne>ke){if(ne<=ye){const $e=ye+1,x=$e<Ue?I[$e].el:Q;for(;ne<=ye;)k(null,I[ne]=me?So(I[ne]):ao(I[ne]),q,x,ee,te,ie,pe,me),ne++}}else if(ne>ye)for(;ne<=ke;)Ge(E[ne],ee,te,!0),ne++;else{const $e=ne,x=ne,$=new Map;for(ne=x;ne<=ye;ne++){const wt=I[ne]=me?So(I[ne]):ao(I[ne]);wt.key!=null&&$.set(wt.key,ne)}let D,X=0;const le=ye-x+1;let Le=!1,Ne=0;const rt=new Array(le);for(ne=0;ne<le;ne++)rt[ne]=0;for(ne=$e;ne<=ke;ne++){const wt=E[ne];if(X>=le){Ge(wt,ee,te,!0);continue}let Rt;if(wt.key!=null)Rt=$.get(wt.key);else for(D=x;D<=ye;D++)if(rt[D-x]===0&&As(wt,I[D])){Rt=D;break}Rt===void 0?Ge(wt,ee,te,!0):(rt[Rt-x]=ne+1,Rt>=Ne?Ne=Rt:Le=!0,k(wt,I[Rt],q,null,ee,te,ie,pe,me),X++)}const Qe=Le?fS(rt):ai;for(D=Qe.length-1,ne=le-1;ne>=0;ne--){const wt=x+ne,Rt=I[wt],ct=I[wt+1],Qt=wt+1<Ue?ct.el||wv(ct):Q;rt[ne]===0?k(null,Rt,q,Qt,ee,te,ie,pe,me):Le&&(D<0||ne!==Qe[D]?Re(Rt,q,Qt,2):D--)}}},Re=(E,I,q,Q,ee=null)=>{const{el:te,type:ie,transition:pe,children:me,shapeFlag:ne}=E;if(ne&6){Re(E.component.subTree,I,q,Q);return}if(ne&128){E.suspense.move(I,q,Q);return}if(ne&64){ie.move(E,I,q,ve);return}if(ie===Xe){r(te,I,q);for(let ke=0;ke<me.length;ke++)Re(me[ke],I,q,Q);r(E.anchor,I,q);return}if(ie===ku){W(E,I,q);return}if(Q!==2&&ne&1&&pe)if(Q===0)pe.beforeEnter(te),r(te,I,q),zn(()=>pe.enter(te),ee);else{const{leave:ke,delayLeave:ye,afterLeave:$e}=pe,x=()=>{E.ctx.isUnmounted?o(te):r(te,I,q)},$=()=>{te._isLeaving&&te[so](!0),ke(te,()=>{x(),$e&&$e()})};ye?ye(te,x,$):$()}else r(te,I,q)},Ge=(E,I,q,Q=!1,ee=!1)=>{const{type:te,props:ie,ref:pe,children:me,dynamicChildren:ne,shapeFlag:Ue,patchFlag:ke,dirs:ye,cacheIndex:$e,memo:x}=E;if(ke===-2&&(ee=!1),pe!=null&&(Ro(),ea(pe,null,q,E,!0),Mo()),$e!=null&&(I.renderCache[$e]=void 0),Ue&256){I.ctx.deactivate(E);return}const $=Ue&1&&ye,D=!ui(E);let X;if(D&&(X=ie&&ie.onVnodeBeforeUnmount)&&no(X,I,E),Ue&6)st(E.component,q,Q);else{if(Ue&128){E.suspense.unmount(q,Q);return}$&&ys(E,null,I,"beforeUnmount"),Ue&64?E.type.remove(E,I,q,ve,Q):ne&&!ne.hasOnce&&(te!==Xe||ke>0&&ke&64)?Ke(ne,I,q,!1,!0):(te===Xe&&ke&384||!ee&&Ue&16)&&Ke(me,I,q),Q&&ot(E)}const le=x!=null&&$e==null;(D&&(X=ie&&ie.onVnodeUnmounted)||$||le)&&zn(()=>{X&&no(X,I,E),$&&ys(E,null,I,"unmounted"),le&&(E.el=null)},q)},ot=E=>{const{type:I,el:q,anchor:Q,transition:ee}=E;if(I===Xe){nt(q,Q);return}if(I===ku){Y(E);return}const te=()=>{o(q),ee&&!ee.persisted&&ee.afterLeave&&ee.afterLeave()};if(E.shapeFlag&1&&ee&&!ee.persisted){const{leave:ie,delayLeave:pe}=ee,me=()=>ie(q,te);pe?pe(E.el,te,me):me()}else te()},nt=(E,I)=>{let q;for(;E!==I;)q=m(E),o(E),E=q;o(I)},st=(E,I,q)=>{const{bum:Q,scope:ee,job:te,subTree:ie,um:pe,m:me,a:ne}=E;$p(me),$p(ne),Q&&Al(Q),ee.stop(),te&&(te.flags|=8,Ge(ie,E,I,q)),pe&&zn(pe,I),zn(()=>{E.isUnmounted=!0},I)},Ke=(E,I,q,Q=!1,ee=!1,te=0)=>{for(let ie=te;ie<E.length;ie++)Ge(E[ie],I,q,Q,ee)},J=E=>{if(E.shapeFlag&6)return J(E.component.subTree);if(E.shapeFlag&128)return E.suspense.next();const I=m(E.anchor||E.el),q=I&&I[Xg];return q?m(q):I};let be=!1;const we=(E,I,q)=>{let Q;E==null?I._vnode&&(Ge(I._vnode,null,null,!0),Q=I._vnode.component):k(I._vnode||null,E,I,null,null,null,q),I._vnode=E,be||(be=!0,yp(Q),zg(),be=!1)},ve={p:k,um:Ge,m:Re,r:ot,mt:xe,mc:he,pc:fe,pbc:Ae,n:J,o:e};return{render:we,hydrate:void 0,createApp:Yw(we)}}function Eu({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function bs({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function dS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Af(e,t,n=!1){const r=e.children,o=t.children;if(Ye(r)&&Ye(o))for(let s=0;s<r.length;s++){const i=r[s];let a=o[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[s]=So(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&Af(i,a)),a.type===wc&&(a.patchFlag===-1&&(a=o[s]=So(a)),a.el=i.el),a.type===On&&!a.el&&(a.el=i.el)}}function fS(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const c=e[r];if(c!==0){if(o=n[n.length-1],e[o]<c){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<c?s=a+1:i=a;c<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}function bv(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bv(t)}function $p(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function wv(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?wv(t.subTree):null}const Sv=e=>e.__isSuspense;function pS(e,t){t&&t.pendingBranch?Ye(e)?t.effects.push(...e):t.effects.push(e):vw(e)}const Xe=Symbol.for("v-fgt"),wc=Symbol.for("v-txt"),On=Symbol.for("v-cmt"),ku=Symbol.for("v-stc"),na=[];let dr=null;function A(e=!1){na.push(dr=e?null:[])}function hS(){na.pop(),dr=na[na.length-1]||null}let da=1;function Kl(e,t=!1){da+=e,e<0&&dr&&t&&(dr.hasOnce=!0)}function Tv(e){return e.dynamicChildren=da>0?dr||ai:null,hS(),da>0&&dr&&dr.push(e),e}function L(e,t,n,r,o,s){return Tv(y(e,t,n,r,o,s,!0))}function yt(e,t,n,r,o){return Tv(ze(e,t,n,r,o,!0))}function fa(e){return e?e.__v_isVNode===!0:!1}function As(e,t){return e.type===t.type&&e.key===t.key}const Ev=({key:e})=>e??null,Rl=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Kt(e)||Dn(e)||tt(e)?{i:In,r:e,k:t,f:!!n}:e:null);function y(e,t=null,n=null,r=0,o=null,s=e===Xe?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ev(t),ref:t&&Rl(t),scopeId:Kg,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:In};return a?(Cf(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Kt(n)?8:16),da>0&&!i&&dr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&dr.push(l),l}const ze=mS;function mS(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===sv)&&(e=On),fa(e)){const a=ns(e,t,!0);return n&&Cf(a,n),da>0&&!s&&dr&&(a.shapeFlag&6?dr[dr.indexOf(e)]=a:dr.push(a)),a.patchFlag=-2,a}if(ES(e)&&(e=e.__vccOpts),t){t=gS(t);let{class:a,style:l}=t;a&&!Kt(a)&&(t.class=pt(a)),Ct(l)&&(wf(l)&&!Ye(l)&&(l=hn({},l)),t.style=ko(l))}const i=Kt(e)?1:Sv(e)?128:Qg(e)?64:Ct(e)?4:tt(e)?2:0;return y(e,t,n,r,o,i,s,!0)}function gS(e){return e?wf(e)||hv(e)?hn({},e):e:null}function ns(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,c=t?kv(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Ev(c),ref:t&&t.ref?n&&s?Ye(s)?s.concat(Rl(t)):[s,Rl(t)]:Rl(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Xe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ns(e.ssContent),ssFallback:e.ssFallback&&ns(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&ua(d,l.clone(d)),d}function $s(e=" ",t=0){return ze(wc,null,e,t)}function Se(e="",t=!1){return t?(A(),yt(On,null,e)):ze(On,null,e)}function ao(e){return e==null||typeof e=="boolean"?ze(On):Ye(e)?ze(Xe,null,e.slice()):fa(e)?So(e):ze(wc,null,String(e))}function So(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ns(e)}function Cf(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ye(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Cf(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!hv(t)?t._ctx=In:o===3&&In&&(In.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else tt(t)?(t={default:t,_ctx:In},n=32):(t=String(t),r&64?(n=16,t=[$s(t)]):n=8);e.children=t,e.shapeFlag|=n}function kv(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=pt([t.class,r.class]));else if(o==="style")t.style=ko([t.style,r.style]);else if(uc(o)){const s=t[o],i=r[o];i&&s!==i&&!(Ye(s)&&s.includes(i))?t[o]=s?[].concat(s,i):i:i==null&&s==null&&!dc(o)&&(t[o]=i)}else o!==""&&(t[o]=r[o])}return t}function no(e,t,n,r=null){zr(e,t,7,[n,r])}const vS=cv();let yS=0;function _S(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||vS,s={uid:yS++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new qb(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:gv(r,o),emitsOptions:uv(r,o),emit:null,emitted:null,propsDefaults:Lt,inheritAttrs:r.inheritAttrs,ctx:Lt,data:Lt,props:Lt,attrs:Lt,slots:Lt,refs:Lt,setupState:Lt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=Xw.bind(null,s),e.ce&&e.ce(s),s}let kn=null;const xf=()=>kn||In;let Yl,Ad;{const e=mc(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};Yl=t("__VUE_INSTANCE_SETTERS__",n=>kn=n),Ad=t("__VUE_SSR_SETTERS__",n=>hi=n)}const Ca=e=>{const t=kn;return Yl(e),e.scope.on(),()=>{e.scope.off(),Yl(t)}},Np=()=>{kn&&kn.scope.off(),Yl(null)};function Iv(e){return e.vnode.shapeFlag&4}let hi=!1;function bS(e,t=!1,n=!1){t&&Ad(t);const{props:r,children:o}=e.vnode,s=Iv(e);rS(e,r,s,t),aS(e,o,n||t);const i=s?wS(e,t):void 0;return t&&Ad(!1),i}function wS(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Bw);const{setup:r}=n;if(r){Ro();const o=e.setupContext=r.length>1?Cv(e):null,s=Ca(e),i=ka(r,e,0,[e.props,o]),a=bg(i);if(Mo(),s(),(a||e.sp)&&!ui(e)&&Tf(e),a){if(i.then(Np,Np),t)return i.then(l=>{Op(e,l)}).catch(l=>{Ia(l,e,0)});e.asyncDep=i}else Op(e,i)}else Av(e)}function Op(e,t,n){tt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ct(t)&&(e.setupState=Hg(t)),Av(e)}function Av(e,t,n){const r=e.type;e.render||(e.render=r.render||uo);{const o=Ca(e);Ro();try{Hw(e)}finally{Mo(),o()}}}const SS={get(e,t){return $n(e,"get",""),e[t]}};function Cv(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,SS),slots:e.slots,emit:e.emit,expose:t}}function Sc(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hg(aw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ta)return ta[n](e)},has(t,n){return n in t||n in ta}})):e.proxy}function TS(e,t=!0){return tt(e)?e.displayName||e.name:e.name||t&&e.__name}function ES(e){return tt(e)&&"__vccOpts"in e}const se=(e,t)=>fw(e,t,hi);function Rf(e,t,n){try{Kl(-1);const r=arguments.length;return r===2?Ct(t)&&!Ye(t)?fa(t)?ze(e,null,[t]):ze(e,t):ze(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&fa(n)&&(n=[n]),ze(e,t,n))}finally{Kl(1)}}const kS="3.5.32";/**
15
+ * @vue/runtime-dom v3.5.32
16
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
+ * @license MIT
18
+ **/let Cd;const Lp=typeof window<"u"&&window.trustedTypes;if(Lp)try{Cd=Lp.createPolicy("vue",{createHTML:e=>e})}catch{}const xv=Cd?e=>Cd.createHTML(e):e=>e,IS="http://www.w3.org/2000/svg",AS="http://www.w3.org/1998/Math/MathML",bo=typeof document<"u"?document:null,Dp=bo&&bo.createElement("template"),CS={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?bo.createElementNS(IS,e):t==="mathml"?bo.createElementNS(AS,e):n?bo.createElement(e,{is:n}):bo.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>bo.createTextNode(e),createComment:e=>bo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bo.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{Dp.innerHTML=xv(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Dp.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ho="transition",Vi="animation",pa=Symbol("_vtc"),Rv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xS=hn({},Zg,Rv),RS=e=>(e.displayName="Transition",e.props=xS,e),Mv=RS((e,{slots:t})=>Rf(Iw,MS(e),t)),ws=(e,t=[])=>{Ye(e)?e.forEach(n=>n(...t)):e&&e(...t)},jp=e=>e?Ye(e)?e.some(t=>t.length>1):e.length>1:!1;function MS(e){const t={};for(const V in e)V in Rv||(t[V]=e[V]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:c=i,appearToClass:d=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:v=`${n}-leave-to`}=e,T=PS(o),k=T&&T[0],H=T&&T[1],{onBeforeEnter:P,onEnter:O,onEnterCancelled:W,onLeave:Y,onLeaveCancelled:ce,onBeforeAppear:re=P,onAppear:Z=O,onAppearCancelled:he=W}=t,Ce=(V,ae,xe,Fe)=>{V._enterCancelled=Fe,Ss(V,ae?d:a),Ss(V,ae?c:i),xe&&xe()},Ae=(V,ae)=>{V._isLeaving=!1,Ss(V,f),Ss(V,v),Ss(V,m),ae&&ae()},ue=V=>(ae,xe)=>{const Fe=V?Z:O,_e=()=>Ce(ae,V,xe);ws(Fe,[ae,_e]),Fp(()=>{Ss(ae,V?l:s),vo(ae,V?d:a),jp(Fe)||Bp(ae,r,k,_e)})};return hn(t,{onBeforeEnter(V){ws(P,[V]),vo(V,s),vo(V,i)},onBeforeAppear(V){ws(re,[V]),vo(V,l),vo(V,c)},onEnter:ue(!1),onAppear:ue(!0),onLeave(V,ae){V._isLeaving=!0;const xe=()=>Ae(V,ae);vo(V,f),V._enterCancelled?(vo(V,m),Hp(V)):(Hp(V),vo(V,m)),Fp(()=>{V._isLeaving&&(Ss(V,f),vo(V,v),jp(Y)||Bp(V,r,H,xe))}),ws(Y,[V,xe])},onEnterCancelled(V){Ce(V,!1,void 0,!0),ws(W,[V])},onAppearCancelled(V){Ce(V,!0,void 0,!0),ws(he,[V])},onLeaveCancelled(V){Ae(V),ws(ce,[V])}})}function PS(e){if(e==null)return null;if(Ct(e))return[Iu(e.enter),Iu(e.leave)];{const t=Iu(e);return[t,t]}}function Iu(e){return $b(e)}function vo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[pa]||(e[pa]=new Set)).add(t)}function Ss(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[pa];n&&(n.delete(t),n.size||(e[pa]=void 0))}function Fp(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let $S=0;function Bp(e,t,n,r){const o=e._endId=++$S,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=NS(e,t);if(!i)return r();const c=i+"end";let d=0;const f=()=>{e.removeEventListener(c,m),s()},m=v=>{v.target===e&&++d>=l&&f()};setTimeout(()=>{d<l&&f()},a+1),e.addEventListener(c,m)}function NS(e,t){const n=window.getComputedStyle(e),r=T=>(n[T]||"").split(", "),o=r(`${Ho}Delay`),s=r(`${Ho}Duration`),i=qp(o,s),a=r(`${Vi}Delay`),l=r(`${Vi}Duration`),c=qp(a,l);let d=null,f=0,m=0;t===Ho?i>0&&(d=Ho,f=i,m=s.length):t===Vi?c>0&&(d=Vi,f=c,m=l.length):(f=Math.max(i,c),d=f>0?i>c?Ho:Vi:null,m=d?d===Ho?s.length:l.length:0);const v=d===Ho&&/\b(?:transform|all)(?:,|$)/.test(r(`${Ho}Property`).toString());return{type:d,timeout:f,propCount:m,hasTransform:v}}function qp(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Up(n)+Up(e[r])))}function Up(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Hp(e){return(e?e.ownerDocument:document).body.offsetHeight}function OS(e,t,n){const r=e[pa];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Wp=Symbol("_vod"),LS=Symbol("_vsh"),DS=Symbol(""),jS=/(?:^|;)\s*display\s*:/;function FS(e,t,n){const r=e.style,o=Kt(n);let s=!1;if(n&&!o){if(t)if(Kt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ml(r,a,"")}else for(const i in t)n[i]==null&&Ml(r,i,"");for(const i in n)i==="display"&&(s=!0),Ml(r,i,n[i])}else if(o){if(t!==n){const i=r[DS];i&&(n+=";"+i),r.cssText=n,s=jS.test(n)}}else t&&e.removeAttribute("style");Wp in e&&(e[Wp]=s?r.display:"",e[LS]&&(r.display="none"))}const Vp=/\s*!important$/;function Ml(e,t,n){if(Ye(n))n.forEach(r=>Ml(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=BS(e,t);Vp.test(n)?e.setProperty(is(r),n.replace(Vp,""),"important"):e[r]=n}}const zp=["Webkit","Moz","ms"],Au={};function BS(e,t){const n=Au[t];if(n)return n;let r=Yn(t);if(r!=="filter"&&r in e)return Au[t]=r;r=pc(r);for(let o=0;o<zp.length;o++){const s=zp[o]+r;if(s in e)return Au[t]=s}return t}const Gp="http://www.w3.org/1999/xlink";function Kp(e,t,n,r,o,s=Fb(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Gp,t.slice(6,t.length)):e.setAttributeNS(Gp,t,n):n==null||s&&!Eg(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Wr(n)?String(n):n)}function Yp(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?xv(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Eg(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(o||t)}function Xo(e,t,n,r){e.addEventListener(t,n,r)}function qS(e,t,n,r){e.removeEventListener(t,n,r)}const Jp=Symbol("_vei");function US(e,t,n,r,o=null){const s=e[Jp]||(e[Jp]={}),i=s[t];if(r&&i)i.value=r;else{const[a,l]=HS(t);if(r){const c=s[t]=zS(r,o);Xo(e,a,c,l)}else i&&(qS(e,a,i,l),s[t]=void 0)}}const Xp=/(?:Once|Passive|Capture)$/;function HS(e){let t;if(Xp.test(e)){t={};let r;for(;r=e.match(Xp);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):is(e.slice(2)),t]}let Cu=0;const WS=Promise.resolve(),VS=()=>Cu||(WS.then(()=>Cu=0),Cu=Date.now());function zS(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;zr(GS(r,n.value),t,5,[r])};return n.value=e,n.attached=VS(),n}function GS(e,t){if(Ye(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const Qp=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,KS=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?OS(e,r,i):t==="style"?FS(e,n,r):uc(t)?dc(t)||US(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):YS(e,t,r,i))?(Yp(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Kp(e,t,r,i,s,t!=="value")):e._isVueCE&&(JS(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Kt(r)))?Yp(e,Yn(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Kp(e,t,r,i))};function YS(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Qp(t)&&tt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Qp(t)&&Kt(n)?!1:t in e}function JS(e,t){const n=e._def.props;if(!n)return!1;const r=Yn(t);return Array.isArray(n)?n.some(o=>Yn(o)===r):Object.keys(n).some(o=>Yn(o)===r)}const mi=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ye(t)?n=>Al(t,n):t};function XS(e){e.target.composing=!0}function Zp(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Io=Symbol("_assign");function eh(e,t,n){return t&&(e=e.trim()),n&&(e=hc(e)),e}const fo={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Io]=mi(o);const s=r||o.props&&o.props.type==="number";Xo(e,t?"change":"input",i=>{i.target.composing||e[Io](eh(e.value,n,s))}),(n||s)&&Xo(e,"change",()=>{e.value=eh(e.value,n,s)}),t||(Xo(e,"compositionstart",XS),Xo(e,"compositionend",Zp),Xo(e,"change",Zp))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[Io]=mi(i),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?hc(e.value):e.value,l=t??"";if(a===l)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===l)||(e.value=l)}},QS={deep:!0,created(e,t,n){e[Io]=mi(n),Xo(e,"change",()=>{const r=e._modelValue,o=ha(e),s=e.checked,i=e[Io];if(Ye(r)){const a=hf(r,o),l=a!==-1;if(s&&!l)i(r.concat(o));else if(!s&&l){const c=[...r];c.splice(a,1),i(c)}}else if(Ei(r)){const a=new Set(r);s?a.add(o):a.delete(o),i(a)}else i(Pv(e,s))})},mounted:th,beforeUpdate(e,t,n){e[Io]=mi(n),th(e,t,n)}};function th(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(Ye(t))o=hf(t,r.props.value)>-1;else if(Ei(t))o=t.has(r.props.value);else{if(t===n)return;o=ki(t,Pv(e,!0))}e.checked!==o&&(e.checked=o)}const s2={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Ei(t);Xo(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?hc(ha(i)):ha(i));e[Io](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Jt(()=>{e._assigning=!1})}),e[Io]=mi(r)},mounted(e,{value:t}){nh(e,t)},beforeUpdate(e,t,n){e[Io]=mi(n)},updated(e,{value:t}){e._assigning||nh(e,t)}};function nh(e,t){const n=e.multiple,r=Ye(t);if(!(n&&!r&&!Ei(t))){for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],a=ha(i);if(n)if(r){const l=typeof a;l==="string"||l==="number"?i.selected=t.some(c=>String(c)===String(a)):i.selected=hf(t,a)>-1}else i.selected=t.has(a);else if(ki(ha(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ha(e){return"_value"in e?e._value:e.value}function Pv(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ZS=["ctrl","shift","alt","meta"],eT={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ZS.some(n=>e[`${n}Key`]&&!t.includes(n))},_t=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((o,...s)=>{for(let i=0;i<t.length;i++){const a=eT[t[i]];if(a&&a(o,t))return}return e(o,...s)}))},tT={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Sn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=is(o.key);if(t.some(i=>i===s||tT[i]===s))return e(o)}))},nT=hn({patchProp:KS},CS);let rh;function rT(){return rh||(rh=cS(nT))}const oT=((...e)=>{const t=rT().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=iT(r);if(!o)return;const s=t._component;!tt(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,sT(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function sT(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function iT(e){return Kt(e)?document.querySelector(e):e}const Ve=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,mt=globalThis,Ns="10.48.0";function Bs(){return Tc(mt),mt}function Tc(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ns,t[Ns]=t[Ns]||{}}function Ii(e,t,n=mt){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ns]=r[Ns]||{};return o[e]||(o[e]=t())}const aT=["debug","info","warn","error","log","assert","trace"],lT="Sentry Logger ",Jl={};function Fo(e){if(!("console"in mt))return e();const t=mt.console,n={},r=Object.keys(Jl);r.forEach(o=>{const s=Jl[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function cT(){Pf().enabled=!0}function uT(){Pf().enabled=!1}function $v(){return Pf().enabled}function dT(...e){Mf("log",...e)}function fT(...e){Mf("warn",...e)}function pT(...e){Mf("error",...e)}function Mf(e,...t){Ve&&$v()&&Fo(()=>{mt.console[e](`${lT}[${e}]:`,...t)})}function Pf(){return Ve?Ii("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ie={enable:cT,disable:uT,isEnabled:$v,log:dT,warn:fT,error:pT},Nv=50,js="?",oh=/\(error: (.*)\)/,sh=/captureMessage|captureException/;function Ov(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const s=[],i=n.split(`
19
+ `);for(let a=r;a<i.length;a++){let l=i[a];l.length>1024&&(l=l.slice(0,1024));const c=oh.test(l)?l.replace(oh,"$1"):l;if(!c.includes("Error: ")){for(const d of t){const f=d(c);if(f){s.push(f);break}}if(s.length>=Nv+o)break}}return mT(s.slice(o))}}function hT(e){return Array.isArray(e)?Ov(...e):e}function mT(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(gl(t).function||"")&&t.pop(),t.reverse(),sh.test(gl(t).function||"")&&(t.pop(),sh.test(gl(t).function||"")&&t.pop()),t.slice(0,Nv).map(n=>({...n,filename:n.filename||gl(t).filename,function:n.function||js}))}function gl(e){return e[e.length-1]||{}}const xu="<anonymous>";function $o(e){try{return!e||typeof e!="function"?xu:e.name||xu}catch{return xu}}function ih(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Lv(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const Pl={},ah={};function ls(e,t){Pl[e]=Pl[e]||[],Pl[e].push(t)}function cs(e,t){if(!ah[e]){ah[e]=!0;try{t()}catch(n){Ve&&Ie.error(`Error while instrumenting ${e}`,n)}}}function kr(e,t){const n=e&&Pl[e];if(n)for(const r of n)try{r(t)}catch(o){Ve&&Ie.error(`Error while triggering instrumentation handler.
20
+ Type: ${e}
21
+ Name: ${$o(r)}
22
+ Error:`,o)}}let Ru=null;function Dv(e){const t="error";ls(t,e),cs(t,gT)}function gT(){Ru=mt.onerror,mt.onerror=function(e,t,n,r,o){return kr("error",{column:r,error:o,line:n,msg:e,url:t}),Ru?Ru.apply(this,arguments):!1},mt.onerror.__SENTRY_INSTRUMENTED__=!0}let Mu=null;function jv(e){const t="unhandledrejection";ls(t,e),cs(t,vT)}function vT(){Mu=mt.onunhandledrejection,mt.onunhandledrejection=function(e){return kr("unhandledrejection",e),Mu?Mu.apply(this,arguments):!0},mt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Fv=Object.prototype.toString;function Ec(e){switch(Fv.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return No(e,Error)}}function Ai(e,t){return Fv.call(e)===`[object ${t}]`}function Bv(e){return Ai(e,"ErrorEvent")}function lh(e){return Ai(e,"DOMError")}function yT(e){return Ai(e,"DOMException")}function Ao(e){return Ai(e,"String")}function $f(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function gi(e){return e===null||$f(e)||typeof e!="object"&&typeof e!="function"}function ma(e){return Ai(e,"Object")}function kc(e){return typeof Event<"u"&&No(e,Event)}function _T(e){return typeof Element<"u"&&No(e,Element)}function bT(e){return Ai(e,"RegExp")}function Ci(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function wT(e){return ma(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function No(e,t){try{return e instanceof t}catch{return!1}}function qv(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Nf(e){return typeof Request<"u"&&No(e,Request)}const Of=mt,ST=80;function xr(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let s=0,i=0;const a=" > ",l=a.length;let c;const d=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||ST;for(;n&&s++<r&&(c=TT(n,d),!(c==="html"||s>1&&i+o.length*l+c.length>=f));)o.push(c),i+=c.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function TT(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(Of.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t!=null&&t.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o!=null&&o.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const s=n.className;if(s&&Ao(s)){const i=s.split(/\s+/);for(const a of i)r.push(`.${a}`)}}for(const s of["aria-label","type","name","title","alt"]){const i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function xa(){try{return Of.document.location.href}catch{return""}}function Uv(e){if(!Of.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function fr(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&Hv(o,r);try{e[t]=o}catch{Ve&&Ie.log(`Failed to replace method "${t}" in object`,e)}}function sr(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Ve&&Ie.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Hv(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,sr(e,"__sentry_original__",t)}catch{}}function Lf(e){return e.__sentry_original__}function Wv(e){if(Ec(e))return{message:e.message,name:e.name,stack:e.stack,...uh(e)};if(kc(e)){const t={type:e.type,target:ch(e.target),currentTarget:ch(e.currentTarget),...uh(e)};return typeof CustomEvent<"u"&&No(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function ch(e){try{return _T(e)?xr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function uh(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function ET(e){const t=Object.keys(Wv(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Js;function Ra(e){if(Js!==void 0)return Js?Js(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=mt;return t in n&&typeof n[t]=="function"?(Js=n[t],Js(e)):(Js=null,e())}function Qo(){return Ra(()=>Math.random())}function Ma(){return Ra(()=>Date.now())}function xd(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function dh(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];try{qv(o)?n.push(Lv(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function $l(e,t,n=!1){return Ao(e)?bT(t)?t.test(e):Ao(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Zo(e,t=[],n=!1){return t.some(r=>$l(e,r,n))}function kT(){const e=mt;return e.crypto||e.msCrypto}let Pu;function IT(){return Qo()*16}function Ir(e=kT()){try{if(e!=null&&e.randomUUID)return Ra(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Pu||(Pu="10000000100040008000"+1e11),Pu.replace(/[018]/g,t=>(t^(IT()&15)>>t/4).toString(16))}function Vv(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Cs(e){const{message:t,event_id:n}=e;if(t)return t;const r=Vv(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Rd(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type="Error")}function vi(e,t){const n=Vv(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const s={...o==null?void 0:o.data,...t.data};n.mechanism.data=s}}function fh(e){if(AT(e))return!0;try{sr(e,"__sentry_captured__",!0)}catch{}return!1}function AT(e){try{return e.__sentry_captured__}catch{}}const zv=1e3;function qs(){return Ma()/zv}function CT(){const{performance:e}=mt;if(!(e!=null&&e.now)||!e.timeOrigin)return qs;const t=e.timeOrigin;return()=>(t+Ra(()=>e.now()))/zv}let ph;function rn(){return(ph??(ph=CT()))()}let $u=null;function xT(){var i;const{performance:e}=mt;if(!(e!=null&&e.now))return;const t=3e5,n=Ra(()=>e.now()),r=Ma(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-r)<t)return o;const s=(i=e.timing)==null?void 0:i.navigationStart;return typeof s=="number"&&Math.abs(s+n-r)<t?s:r-n}function Rr(){return $u===null&&($u=xT()),$u}function RT(e){const t=rn(),n={sid:Ir(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>PT(n)};return e&&yi(n,e),n}function yi(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||rn(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ir()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function MT(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),yi(e,n)}function PT(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Pa(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Pa(r[o],t[o],n-1));return r}function Oo(){return Ir()}function Co(){return Ir().substring(16)}const Md="_sentrySpan";function _i(e,t){t?sr(e,Md,t):delete e[Md]}function Xl(e){return e[Md]}const $T=100;class po{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Oo(),sampleRand:Qo()}}clone(){const t=new po;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,_i(t,Xl(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&yi(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof po?n.getScopeData():ma(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:l,level:c,fingerprint:d=[],propagationContext:f,conversationId:m}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),d.length&&(this._fingerprint=d),f&&(this._propagationContext=f),m&&(this._conversationId=m),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,_i(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Oo(),sampleRand:Qo()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:$T;if(r<=0)return this;const o={timestamp:qs(),...t,message:t.message?xd(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(s=this._client)==null||s.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Xl(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Pa(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||Ir();if(!this._client)return Ve&&Ie.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=(r==null?void 0:r.event_id)||Ir();if(!this._client)return Ve&&Ie.warn("No client configured on scope - will not capture message!"),o;const s=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||Ir();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Ve&&Ie.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function NT(){return Ii("defaultCurrentScope",()=>new po)}function OT(){return Ii("defaultIsolationScope",()=>new po)}const hh=e=>e instanceof Promise&&!e[Gv],Gv=Symbol("chained PromiseLike"),Kv=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return hh(r)&&hh(e)?r:LT(e,r)},LT=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Gv]:!0}),t};class DT{constructor(t,n){let r;t?r=t:r=new po;let o;n?o=n:o=new po,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return Ci(r)?Kv(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function bi(){const e=Bs(),t=Tc(e);return t.stack=t.stack||new DT(NT(),OT())}function jT(e){return bi().withScope(e)}function FT(e,t){const n=bi();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function mh(e){return bi().withScope(()=>e(bi().getIsolationScope()))}function BT(){return{withIsolationScope:mh,withScope:jT,withSetScope:FT,withSetIsolationScope:(e,t)=>mh(t),getCurrentScope:()=>bi().getScope(),getIsolationScope:()=>bi().getIsolationScope()}}function xi(e){const t=Tc(e);return t.acs?t.acs:BT()}function $t(){const e=Bs();return xi(e).getCurrentScope()}function Kr(){const e=Bs();return xi(e).getIsolationScope()}function qT(){return Ii("globalScope",()=>new po)}function Ic(...e){const t=Bs(),n=xi(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function xt(){return $t().getClient()}function UT(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Co()};return r&&(s.parent_span_id=r),s}const Tr="sentry.source",Df="sentry.sample_rate",Yv="sentry.previous_trace_sample_rate",Lo="sentry.op",Xt="sentry.origin",ga="sentry.idle_span_finish_reason",$a="sentry.measurement_unit",Na="sentry.measurement_value",gh="sentry.custom_span_name",jf="sentry.profile_id",Ri="sentry.exclusive_time",HT="sentry.link.type",WT="gen_ai.conversation.id",Jv=0,Ac=1,fn=2;function VT(e){if(e<400&&e>=100)return{code:Ac};if(e>=400&&e<500)switch(e){case 401:return{code:fn,message:"unauthenticated"};case 403:return{code:fn,message:"permission_denied"};case 404:return{code:fn,message:"not_found"};case 409:return{code:fn,message:"already_exists"};case 413:return{code:fn,message:"failed_precondition"};case 429:return{code:fn,message:"resource_exhausted"};case 499:return{code:fn,message:"cancelled"};default:return{code:fn,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:fn,message:"unimplemented"};case 503:return{code:fn,message:"unavailable"};case 504:return{code:fn,message:"deadline_exceeded"};default:return{code:fn,message:"internal_error"}}return{code:fn,message:"internal_error"}}function Xv(e,t){e.setAttribute("http.response.status_code",t);const n=VT(t);n.message!=="unknown_error"&&e.setStatus(n)}const Qv="_sentryScope",Zv="_sentryIsolationScope";function zT(e){try{const t=mt.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function GT(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function KT(e,t,n){e&&(sr(e,Zv,zT(n)),sr(e,Qv,t))}function Ql(e){const t=e;return{scope:t[Qv],isolationScope:GT(t[Zv])}}const Zl="sentry-",YT=8192;function ey(e){const t=XT(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(Zl)){const i=o.slice(Zl.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function JT(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${Zl}${r}`]=o),n),{});return QT(t)}function XT(e){if(!(!e||!Ao(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=vh(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):vh(e)}function vh(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function QT(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],o)=>{const s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${t},${s}`;return i.length>YT?(Ve&&Ie.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const ZT=/^o(\d+)\./,e0=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function t0(e){return e==="http"||e==="https"}function Mi(e,t=!1){const{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function n0(e){const t=e0.exec(e);if(!t){Fo(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let l="",c=a;const d=c.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),c=d.pop()),c){const f=c.match(/^\d+/);f&&(c=f[0])}return ty({host:s,pass:o,path:l,projectId:c,port:i,protocol:n,publicKey:r})}function ty(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function r0(e){if(!Ve)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(Ie.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?t0(r)?t&&isNaN(parseInt(t,10))?(Ie.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function o0(e){const t=e.match(ZT);return t==null?void 0:t[1]}function s0(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=o0(n)),r}function i0(e){const t=typeof e=="string"?n0(e):ty(e);if(!(!t||!r0(t)))return t}function va(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const ny=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function a0(e){if(!e)return;const t=e.match(ny);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function l0(e,t){const n=a0(e),r=ey(t);if(!(n!=null&&n.traceId))return{traceId:Oo(),sampleRand:Qo()};const o=c0(n,r);r&&(r.sample_rand=o.toString());const{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function ry(e=Oo(),t=Co(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function oy(e=Oo(),t=Co(),n){return`00-${e}-${t}-${n?"01":"00"}`}function c0(e,t){const n=va(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=va(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Qo()*r:r+Qo()*(1-r):Qo()}const sy=0,Cc=1;let yh=!1;function u0(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:l}=bt(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:l}}function d0(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:bt(e).parent_span_id,s=Ql(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||Co():t;return{parent_span_id:o,span_id:i,trace_id:n}}function f0(e){const{traceId:t,spanId:n}=e.spanContext(),r=us(e);return ry(t,n,r)}function p0(e){const{traceId:t,spanId:n}=e.spanContext(),r=us(e);return oy(t,n,r)}function iy(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Cc,attributes:s,...o}))}function h0(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Cc,attributes:o}))}function Os(e){return typeof e=="number"?_h(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?_h(e.getTime()):rn()}function _h(e){return e>9999999999?e/1e3:e}function bt(e){if(v0(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(g0(e)){const{attributes:r,startTime:o,name:s,endTime:i,status:a,links:l}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:m0(e),start_timestamp:Os(o),timestamp:Os(i)||void 0,status:ay(a),op:r[Lo],origin:r[Xt],links:iy(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function m0(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function g0(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function v0(e){return typeof e.getSpanJSON=="function"}function us(e){const{traceFlags:t}=e.spanContext();return t===Cc}function ay(e){if(!(!e||e.code===Jv))return e.code===Ac?"ok":e.message||"internal_error"}function y0(e){return!e||e.code===Ac||e.code===Jv||e.message==="cancelled"?"ok":"error"}const Ls="_sentryChildSpans",Pd="_sentryRootSpan";function ly(e,t){const n=e[Pd]||e;sr(t,Pd,n),e[Ls]?e[Ls].add(t):sr(e,Ls,new Set([t]))}function _0(e,t){e[Ls]&&e[Ls].delete(t)}function Nl(e){const t=new Set;function n(r){if(!t.has(r)&&us(r)){t.add(r);const o=r[Ls]?Array.from(r[Ls]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const Ln=b0;function b0(e){return e[Pd]||e}function ir(){const e=Bs(),t=xi(e);return t.getActiveSpan?t.getActiveSpan():Xl($t())}function $d(){yh||(Fo(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),yh=!0)}let bh=!1;function w0(){if(bh)return;function e(){const t=ir(),n=t&&Ln(t);if(n){const r="internal_error";Ve&&Ie.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:fn,message:r})}}e.tag="sentry_tracingErrorCallback",bh=!0,Dv(e),jv(e)}function Ar(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=xt())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function wh(e){Ie.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function ya(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(T0(n)){if($l(e.description,n))return Ve&&wh(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?$l(e.description,n.name):!0,o=n.op?e.op&&$l(e.op,n.op):!0;if(r&&o)return Ve&&wh(e),!0}return!1}function S0(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function T0(e){return typeof e=="string"||e instanceof RegExp}const Ff="production",cy="_frozenDsc";function Ol(e,t){sr(e,cy,t)}function uy(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Ff,release:n.release,public_key:r,trace_id:e,org_id:s0(t)};return t.emit("createDsc",o),o}function dy(e,t){const n=t.getPropagationContext();return n.dsc||uy(n.traceId,e)}function rs(e){var T;const t=xt();if(!t)return{};const n=Ln(e),r=bt(n),o=r.data,s=n.spanContext().traceState,i=(s==null?void 0:s.get("sentry.sample_rate"))??o[Df]??o[Yv];function a(k){return(typeof i=="number"||typeof i=="string")&&(k.sample_rate=`${i}`),k}const l=n[cy];if(l)return a(l);const c=s==null?void 0:s.get("sentry.dsc"),d=c&&ey(c);if(d)return a(d);const f=uy(e.spanContext().traceId,t),m=o[Tr]??o["sentry.span.source"],v=r.description;return m!=="url"&&v&&(f.transaction=v),Ar()&&(f.sampled=String(us(n)),f.sample_rand=(s==null?void 0:s.get("sentry.sample_rand"))??((T=Ql(n).scope)==null?void 0:T.getPropagationContext().sampleRand.toString())),a(f),t.emit("createDsc",f,n),f}class Cr{constructor(t={}){this._traceId=t.traceId||Oo(),this._spanId=t.spanId||Co(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:sy}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function fy(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function wo(e,t=100,n=1/0){try{return Nd("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function py(e,t=3,n=100*1024){const r=wo(e,t);return A0(r)>n?py(e,t-1,n):r}function Nd(e,t,n=1/0,r=1/0,o=C0()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=E0(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(l===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const c=t;if(c&&typeof c.toJSON=="function")try{const v=c.toJSON();return Nd("",v,l-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let f=0;const m=Wv(t);for(const v in m){if(!Object.prototype.hasOwnProperty.call(m,v))continue;if(f>=r){d[v]="[MaxProperties ~]";break}const T=m[v];d[v]=Nd(v,T,l-1,r,o),f++}return i(t),d}function E0(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(qv(t))return Lv(t);if(wT(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${$o(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=k0(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function k0(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function I0(e){return~-encodeURI(e).split(/%..|./).length}function A0(e){return I0(JSON.stringify(e))}function C0(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Us(e,t=[]){return[e,t]}function x0(e,t){const[n,r]=e;return[n,[...r,t]]}function Od(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function R0(e,t){return Od(e,(n,r)=>t.includes(r))}function Ld(e){const t=Tc(mt);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function M0(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Ld(r),s]:r.push(typeof s=="string"?Ld(s):s)}for(const s of n){const[i,a]=s;if(o(`
23
+ ${JSON.stringify(i)}
24
+ `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(wo(a))}o(l)}}return typeof r=="string"?r:P0(r)}function P0(e){const t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function $0(e){return[{type:"span"},e]}function N0(e){const t=typeof e.data=="string"?Ld(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const hy={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function O0(e){return e in hy}function Sh(e){return O0(e)?hy[e]:e}function my(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function L0(e,t,n,r){var s;const o=(s=e.sdkProcessingMetadata)==null?void 0:s.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Mi(r)},...o&&{trace:o}}}function D0(e,t){var r,o,s,i;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((o=e.sdk)==null?void 0:o.packages)||[],...t.packages||[]],settings:(s=e.sdk)!=null&&s.settings||t.settings?{...(i=e.sdk)==null?void 0:i.settings,...t.settings}:void 0},e}function j0(e,t,n,r){const o=my(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Mi(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Us(s,[i])}function F0(e,t,n,r){const o=my(n),s=e.type&&e.type!=="replay_event"?e.type:"event";D0(e,n==null?void 0:n.sdk);const i=L0(e,o,r,t);return delete e.sdkProcessingMetadata,Us(i,[[{type:s},e]])}function B0(e,t){function n(v){return!!v.trace_id&&!!v.public_key}const r=rs(e[0]),o=t==null?void 0:t.getDsn(),s=t==null?void 0:t.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:Mi(o)}},{beforeSendSpan:a,ignoreSpans:l}=(t==null?void 0:t.getOptions())||{},c=l!=null&&l.length?e.filter(v=>!ya(bt(v),l)):e,d=e.length-c.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const f=a?v=>{const T=bt(v),k=fy(a)?T:a(T);return k||($d(),T)}:bt,m=[];for(const v of c){const T=f(v);T&&m.push($0(T))}return Us(i,m)}function q0(e){if(!Ve)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=bt(e),{spanId:o}=e.spanContext(),s=us(e),i=Ln(e),a=i===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,c=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&c.push(`parent ID: ${r}`),!a){const{op:d,description:f}=bt(i);c.push(`root ID: ${i.spanContext().spanId}`),d&&c.push(`root op: ${d}`),f&&c.push(`root description: ${f}`)}Ie.log(`${l}
25
+ ${c.join(`
26
+ `)}`)}function U0(e){if(!Ve)return;const{description:t="< unknown name >",op:n="< unknown op >"}=bt(e),{spanId:r}=e.spanContext(),s=Ln(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;Ie.log(i)}function H0(e,t,n,r=ir()){const o=r&&Ln(r);o&&(Ve&&Ie.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Na]:t,[$a]:n}))}function Th(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[$a],s=r[Na];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function Oa(e){return e.getOptions().traceLifecycle==="stream"}const Eh=1e3;class xc{constructor(t={}){this._traceId=t.traceId||Oo(),this._spanId=t.spanId||Co(),this._startTime=t.startTimestamp||rn(),this._links=t.links,this._attributes={},this.setAttributes({[Xt]:"manual",[Lo]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Cc:sy}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=Os(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Tr,"custom"),this}end(t){this._endTime||(this._endTime=Os(t),U0(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Lo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ay(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Xt],profile_id:this._attributes[jf],exclusive_time:this._attributes[Ri],measurements:Th(this._events),is_segment:this._isStandaloneSpan&&Ln(this)===this||void 0,segment_id:this._isStandaloneSpan?Ln(this).spanContext().spanId:void 0,links:iy(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Ln(this),status:y0(this._status),attributes:this._attributes,links:h0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){Ve&&Ie.log("[Tracing] Adding an event to span:",t);const o=kh(n)?n:r||rn(),s=kh(n)?{}:n||{},i={name:t,time:Os(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=xt();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Ln(this)))return;if(this._isStandaloneSpan){this._sampled?V0(B0([this],t)):(Ve&&Ie.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Oa(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(Ql(this).scope||$t()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Ih(bt(this)))return;this._name||(Ve&&Ie.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=Ql(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const s=Nl(this).filter(f=>f!==this&&!W0(f)).map(f=>bt(f)).filter(Ih),i=this._attributes[Tr];delete this._attributes[gh],s.forEach(f=>{delete f.data[gh]});const a={contexts:{trace:u0(this)},spans:s.length>Eh?s.sort((f,m)=>f.start_timestamp-m.start_timestamp).slice(0,Eh):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:rs(this)},request:r,...i&&{transaction_info:{source:i}}},l=Th(this._events);return l&&Object.keys(l).length&&(Ve&&Ie.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}}function kh(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ih(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function W0(e){return e instanceof xc&&e.isStandaloneSpan()}function V0(e){const t=xt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function z0(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return G0(o,t,n,r)}function G0(e,t,n,r){return Ci(e)?Kv(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function K0(e,t,n){if(!Ar(e))return[!1];let r,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),r=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,r=!0);const s=va(o);if(s===void 0)return Ve&&Ie.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return Ve&&Ie.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];const i=n<s;return i||Ve&&Ie.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const Y0="__SENTRY_SUPPRESS_TRACING__";function Dd(e,t){const n=qf();if(n.startSpan)return n.startSpan(e,t);const r=vy(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return Ic(a,()=>X0(s)(()=>{const c=$t(),d=yy(c,s),m=e.onlyIfParent&&!d?new Cr:gy({parentSpan:d,spanArguments:r,forceTransaction:o,scope:c});return(!Z0(m)||!d)&&_i(c,m),z0(()=>t(m),()=>{const{status:v}=bt(m);m.isRecording()&&(!v||v==="ok")&&m.setStatus({code:fn,message:"internal_error"})},()=>{m.end()})}))}function os(e){const t=qf();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=vy(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>Ic(e.scope,i):o!==void 0?i=>Bf(o,i):i=>i())(()=>{const i=$t(),a=yy(i,o);return e.onlyIfParent&&!a?new Cr:gy({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function Bf(e,t){const n=qf();return n.withActiveSpan?n.withActiveSpan(e,t):Ic(r=>(_i(r,e||void 0),t(r)))}function gy({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ar()){const a=new Cr;if(n||!e){const l={sampled:"false",sample_rate:"0",transaction:t.name,...rs(a)};Ol(a,l)}return a}const o=xt();if(Q0(o,t))return Uf(r)||o==null||o.recordDroppedEvent("ignored","span"),new Cr({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const s=Kr();let i;if(e&&!n)i=J0(e,r,t),ly(e,i);else if(e){const a=rs(e),{traceId:l,spanId:c}=e.spanContext(),d=us(e);i=Ah({traceId:l,parentSpanId:c,...t},r,d),Ol(i,a)}else{const{traceId:a,dsc:l,parentSpanId:c,sampled:d}={...s.getPropagationContext(),...r.getPropagationContext()};i=Ah({traceId:a,parentSpanId:c,...t},r,d),l&&Ol(i,l)}return q0(i),KT(i,r,s),i}function vy(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Os(e.startTime),delete r.startTime,r}return n}function qf(){const e=Bs();return xi(e)}function Ah(e,t,n){var k;const r=xt(),o=(r==null?void 0:r.getOptions())||{},{name:s=""}=e,i={spanAttributes:{...e.attributes},spanName:s,parentSampled:n};r==null||r.emit("beforeSampling",i,{decision:!1});const a=i.parentSampled??n,l=i.spanAttributes,c=t.getPropagationContext(),d=Uf(t),[f,m,v]=d?[!1]:K0(o,{name:s,parentSampled:a,attributes:l,parentSampleRate:va((k=c.dsc)==null?void 0:k.sample_rate)},c.sampleRand),T=new xc({...e,attributes:{[Tr]:"custom",[Df]:m!==void 0&&v?m:void 0,...l},sampled:f});return!f&&r&&!d&&(Ve&&Ie.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Oa(r)?"span":"transaction")),r&&r.emit("spanStart",T),T}function J0(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=Uf(t),i=s?!1:us(e),a=i?new xc({...n,parentSpanId:r,traceId:o,sampled:i}):new Cr({traceId:o});ly(e,a);const l=xt();return l&&(Oa(l)&&a instanceof Cr&&(e instanceof Cr&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):s||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function yy(e,t){if(t)return t;if(t===null)return;const n=Xl(e);if(!n)return;const r=xt();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Ln(n):n}function X0(e){return e!==void 0?t=>Bf(e,t):t=>t()}function Q0(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!Oa(e)||!(n!=null&&n.length)?!1:ya({description:t.name||"",op:((r=t.attributes)==null?void 0:r[Lo])||t.op},n)}function Z0(e){return e instanceof Cr&&e.dropReason==="ignored"}function Uf(e){return e.getScopeData().sdkProcessingMetadata[Y0]===!0}const Ll={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},eE="heartbeatFailed",tE="idleTimeout",nE="finalTimeout",rE="externalFinish";function _y(e,t={}){const n=new Map;let r=!1,o,s=rE,i=!t.disableAutoFinish;const a=[],{idleTimeout:l=Ll.idleTimeout,finalTimeout:c=Ll.finalTimeout,childSpanTimeout:d=Ll.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:m=!0}=t,v=xt();if(!v||!Ar()){const Z=new Cr,he={sample_rate:"0",sampled:"false",...rs(Z)};return Ol(Z,he),Z}const T=$t(),k=ir(),H=oE(e);H.end=new Proxy(H.end,{apply(Z,he,Ce){if(f&&f(H),he instanceof Cr)return;const[Ae,...ue]=Ce,V=Ae||rn(),ae=Os(V),xe=Nl(H).filter(Be=>Be!==H),Fe=bt(H);if(!xe.length||!m)return re(ae),Reflect.apply(Z,he,[ae,...ue]);const _e=v.getOptions().ignoreSpans,Me=xe==null?void 0:xe.reduce((Be,Re)=>{const Ge=bt(Re);return!Ge.timestamp||_e&&ya(Ge,_e)?Be:Be?Math.max(Be,Ge.timestamp):Ge.timestamp},void 0),fe=Fe.start_timestamp,De=Math.min(fe?fe+c/1e3:1/0,Math.max(fe||-1/0,Math.min(ae,Me||1/0)));return re(De),Reflect.apply(Z,he,[De,...ue])}});function P(){o&&(clearTimeout(o),o=void 0)}function O(Z){P(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=tE,H.end(Z))},l)}function W(Z){o=setTimeout(()=>{!r&&i&&(s=eE,H.end(Z))},d)}function Y(Z){P(),n.set(Z,!0);const he=rn();W(he+d/1e3)}function ce(Z){if(n.has(Z)&&n.delete(Z),n.size===0){const he=rn();O(he+l/1e3)}}function re(Z){r=!0,n.clear(),a.forEach(xe=>xe()),_i(T,k);const he=bt(H),{start_timestamp:Ce}=he;if(!Ce)return;he.data[ga]||H.setAttribute(ga,s);const ue=he.status;(!ue||ue==="unknown")&&H.setStatus({code:Ac}),Ie.log(`[Tracing] Idle span "${he.op}" finished`);const V=Nl(H).filter(xe=>xe!==H);let ae=0;V.forEach(xe=>{xe.isRecording()&&(xe.setStatus({code:fn,message:"cancelled"}),xe.end(Z),Ve&&Ie.log("[Tracing] Cancelling span since span ended early",JSON.stringify(xe,void 0,2)));const Fe=bt(xe),{timestamp:_e=0,start_timestamp:Me=0}=Fe,fe=Me<=Z,De=(c+l)/1e3,Be=_e-Me<=De;if(Ve){const Re=JSON.stringify(xe,void 0,2);fe?Be||Ie.log("[Tracing] Discarding span since it finished after idle span final timeout",Re):Ie.log("[Tracing] Discarding span since it happened after idle span was finished",Re)}(!Be||!fe)&&(_0(H,xe),ae++)}),ae>0&&H.setAttribute("sentry.idle_span_discarded_spans",ae)}return a.push(v.on("spanStart",Z=>{if(r||Z===H||bt(Z).timestamp||Z instanceof xc&&Z.isStandaloneSpan())return;Nl(H).includes(Z)&&Y(Z.spanContext().spanId)})),a.push(v.on("spanEnd",Z=>{r||ce(Z.spanContext().spanId)})),a.push(v.on("idleSpanEnableAutoFinish",Z=>{Z===H&&(i=!0,O(),n.size&&W())})),t.disableAutoFinish||O(),setTimeout(()=>{r||(H.setStatus({code:fn,message:"deadline_exceeded"}),s=nE,H.end())},c),H}function oE(e){const t=os(e);return _i($t(),t),Ve&&Ie.log("[Tracing] Started span is an idle span"),t}function sE(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;iE(e,t),r&&cE(e,r),uE(e,n),aE(e,o),lE(e,s)}function Ch(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:d,eventProcessors:f,attachments:m,propagationContext:v,transactionName:T,span:k}=t;zi(e,"extra",n),zi(e,"tags",r),zi(e,"attributes",o),zi(e,"user",s),zi(e,"contexts",i),e.sdkProcessingMetadata=Pa(e.sdkProcessingMetadata,l,2),a&&(e.level=a),T&&(e.transactionName=T),k&&(e.span=k),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),m.length&&(e.attachments=[...e.attachments,...m]),e.propagationContext={...e.propagationContext,...v}}function zi(e,t,n){e[t]=Pa(e[t],n,1)}function by(e,t){const n=qT().getScopeData();return e&&Ch(n,e.getScopeData()),t&&Ch(n,t.getScopeData()),n}function iE(e,t){const{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function aE(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function lE(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function cE(e,t){e.contexts={trace:d0(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:rs(t),...e.sdkProcessingMetadata};const n=Ln(t),r=bt(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function uE(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}const Nu=0,xh=1,Rh=2;function La(e){return new _a(t=>{t(e)})}function Hf(e){return new _a((t,n)=>{n(e)})}class _a{constructor(t){this._state=Nu,this._handlers=[],this._runExecutor(t)}then(t,n){return new _a((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new _a((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Nu)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===xh&&n[1](this._value),this._state===Rh&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===Nu){if(Ci(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(xh,s)},o=s=>{n(Rh,s)};try{t(r,o)}catch(s){o(s)}}}function dE(e,t,n,r=0){try{const o=jd(t,n,e,r);return Ci(o)?o:La(o)}catch(o){return Hf(o)}}function jd(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return Ve&&s===null&&Ie.log(`Event processor "${o.id||"?"}" dropped event`),Ci(s)?s.then(i=>jd(i,t,n,r+1)):jd(s,t,n,r+1)}let yo,Mh,Ph,Wo;function fE(e){const t=mt._sentryDebugIds,n=mt._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(Wo&&r.length===Mh&&o.length===Ph)return Wo;Mh=r.length,Ph=o.length,Wo={},yo||(yo={});const s=(i,a)=>{for(const l of i){const c=a[l],d=yo==null?void 0:yo[l];if(d&&Wo&&c)Wo[d[0]]=c,yo&&(yo[l]=[d[0],c]);else if(c){const f=e(l);for(let m=f.length-1;m>=0;m--){const v=f[m],T=v==null?void 0:v.filename;if(T&&Wo&&yo){Wo[T]=c,yo[l]=[T,c];break}}}}};return t&&s(r,t),n&&s(o,n),Wo}function pE(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Ir(),timestamp:t.timestamp||qs()},c=n.integrations||e.integrations.map(P=>P.name);hE(l,e),vE(l,c),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&mE(l,e.stackParser);const d=_E(r,n.captureContext);n.mechanism&&vi(l,n.mechanism);const f=o?o.getEventProcessors():[],m=by(s,d),v=[...n.attachments||[],...m.attachments];v.length&&(n.attachments=v),sE(l,m);const T=[...f,...m.eventProcessors];return(n.data&&n.data.__sentry__===!0?La(l):dE(T,l,n)).then(P=>(P&&gE(P),typeof i=="number"&&i>0?yE(P,i,a):P))}function hE(e,t){var a,l;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Ff,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=xd(i.url,s)),s&&((l=(a=e.exception)==null?void 0:a.values)==null||l.forEach(c=>{c.value&&(c.value=xd(c.value,s))}))}function mE(e,t){var r,o;const n=fE(t);(o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(l=>{l.filename&&(l.debug_id=n[l.filename])})})}function gE(e){var r,o;const t={};if((o=(r=e.exception)==null?void 0:r.values)==null||o.forEach(s=>{var i,a;(a=(i=s.stacktrace)==null?void 0:i.frames)==null||a.forEach(l=>{l.debug_id&&(l.abs_path?t[l.abs_path]=l.debug_id:l.filename&&(t[l.filename]=l.debug_id),delete l.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function vE(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function yE(e,t,n){var o,s;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:wo(i.data,t,n)}}))},...e.user&&{user:wo(e.user,t,n)},...e.contexts&&{contexts:wo(e.contexts,t,n)},...e.extra&&{extra:wo(e.extra,t,n)}};return(o=e.contexts)!=null&&o.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=wo(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:wo(i.data,t,n)}}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=wo(e.contexts.flags,3,n)),r}function _E(e,t){if(!t)return e;const n=e?e.clone():new po;return n.update(t),n}function bE(e){if(e)return wE(e)?{captureContext:e}:TE(e)?{captureContext:e}:e}function wE(e){return e instanceof po||typeof e=="function"}const SE=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function TE(e){return Object.keys(e).some(t=>SE.includes(t))}function Wf(e,t){return $t().captureException(e,bE(t))}function wy(e,t){return $t().captureEvent(e,t)}function EE(e,t){Kr().setContext(e,t)}function kE(e,t){Kr().setTag(e,t)}function IE(){const e=xt();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function $h(e){const t=Kr(),{user:n}=by(t,$t()),{userAgent:r}=mt.navigator||{},o=RT({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&yi(s,{status:"exited"}),Sy(),t.setSession(o),o}function Sy(){const e=Kr(),n=$t().getSession()||e.getSession();n&&MT(n),Ty(),e.setSession()}function Ty(){const e=Kr(),t=xt(),n=e.getSession();n&&t&&t.captureSession(n)}function Ou(e=!1){if(e){Sy();return}Ty()}const AE="7";function CE(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function xE(e){return`${CE(e)}${e.projectId}/envelope/`}function RE(e,t){const n={sentry_version:AE};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function ME(e,t,n){return t||`${xE(e)}?${RE(e,n)}`}const Nh=[];function PE(e){const t={};return e.forEach(n=>{const{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function $E(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return PE(r)}function NE(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Ey(e,r,n)}),n}function Oh(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Ey(e,t,n){if(n[t.name]){Ve&&Ie.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Nh.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Nh.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}Ve&&Ie.log(`Integration installed: ${t.name}`)}function OE(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function LE(e,t,n,r){const o={};return t!=null&&t.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Mi(r)),Us(o,[OE(e)])}function Fd(e,t){const n=t??DE(e)??[];if(n.length===0)return;const r=e.getOptions(),o=LE(n,r._metadata,r.tunnel,e.getDsn());ky().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function DE(e){return ky().get(e)}function ky(){return Ii("clientToLogBufferMap",()=>new WeakMap)}function jE(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function FE(e,t,n,r){const o={};return t!=null&&t.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Mi(r)),Us(o,[jE(e)])}function Iy(e,t){const n=t??BE(e)??[];if(n.length===0)return;const r=e.getOptions(),o=FE(n,r._metadata,r.tunnel,e.getDsn());Ay().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function BE(e){return Ay().get(e)}function Ay(){return Ii("clientToMetricBufferMap",()=>new WeakMap)}function Cy(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Vf=Symbol.for("SentryBufferFullError");function zf(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return Hf(Vf);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return La(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const l=[a,new Promise(c=>Cy(setTimeout(()=>c(!1),i)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:s}}const qE=60*1e3;function UE(e,t=Ma()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?qE:r-t}function HE(e,t){return e[t]||e.all||0}function WE(e,t,n=Ma()){return HE(e,t)>n}function VE(e,{statusCode:t,headers:n},r=Ma()){const o={...e},s=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0:n["retry-after"];if(s)for(const a of s.trim().split(",")){const[l,c,,,d]=a.split(":",5),f=parseInt(l,10),m=(isNaN(f)?60:f)*1e3;if(!c)o.all=r+m;else for(const v of c.split(";"))v==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[v]=r+m):o[v]=r+m}else i?o.all=r+UE(i,r):t===429&&(o.all=r+60*1e3);return o}const xy=64;function zE(e,t,n=zf(e.bufferSize||xy)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(Od(i,(f,m)=>{const v=Sh(m);WE(r,v)?e.recordDroppedEvent("ratelimit_backoff",v):a.push(f)}),a.length===0)return Promise.resolve({});const l=Us(i[0],a),c=f=>{if(R0(l,["client_report"])){Ve&&Ie.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}Od(l,(m,v)=>{e.recordDroppedEvent(f,Sh(v))})},d=()=>t({body:M0(l)}).then(f=>f.statusCode===413?(Ve&&Ie.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),f):(Ve&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&Ie.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=VE(r,f),f),f=>{throw c("network_error"),Ve&&Ie.error("Encountered error running transport request:",f),f});return n.add(d).then(f=>f,f=>{if(f===Vf)return Ve&&Ie.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function GE(e,t,n){const r=[{type:"client_report"},{timestamp:qs(),discarded_events:e}];return Us(t?{dsn:t}:{},[r])}function Ry(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function KE(e){var l;const{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=((l=e.contexts)==null?void 0:l.trace)??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i==null?void 0:i[jf],exclusive_time:i==null?void 0:i[Ri],measurements:e.measurements,is_segment:!0}}function YE(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[jf]:e.profile_id},...e.exclusive_time&&{[Ri]:e.exclusive_time}}}},measurements:e.measurements}}const Lh="Not capturing exception because it's already been captured.",Dh="Discarded session because of missing or non-string release",My=Symbol.for("SentryInternalError"),Py=Symbol.for("SentryDoNotSendEventError"),JE=5e3;function Dl(e){return{message:e,[My]:!0}}function Lu(e){return{message:e,[Py]:!0}}function jh(e){return!!e&&typeof e=="object"&&My in e}function Fh(e){return!!e&&typeof e=="object"&&Py in e}function Bh(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,l=>{s+=r(l),s>=8e5?o(e):a||(a=!0,i=Cy(setTimeout(()=>{o(e)},JE)))}),e.on("flush",()=>{o(e)})}class XE{constructor(t){var r,o,s;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=zf(((r=t.transportOptions)==null?void 0:r.bufferSize)??xy),t.dsn?this._dsn=i0(t.dsn):Ve&&Ie.warn("No DSN provided, client will not send events."),this._dsn){const i=ME(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}this._options.enableLogs=this._options.enableLogs??((o=this._options._experiments)==null?void 0:o.enableLogs),this._options.enableLogs&&Bh(this,"afterCaptureLog","flushLogs",tk,Fd),(this._options.enableMetrics??((s=this._options._experiments)==null?void 0:s.enableMetrics)??!0)&&Bh(this,"afterCaptureMetric","flushMetrics",ek,Iy)}captureException(t,n,r){const o=Ir();if(fh(t))return Ve&&Ie.log(Lh),o;const s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){const s={event_id:Ir(),...r},i=$f(t)?t:String(t),a=gi(t),l=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>l.then(c=>this._captureEvent(c,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=Ir();if(n!=null&&n.originalException&&fh(n.originalException))return Ve&&Ie.log(Lh),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,l=i.capturedSpanIsolationScope,c=qh(t.type);return this._process(()=>this._captureEvent(t,s,a||r,l),c),s.event_id}captureSession(t){this.sendSession(t),yi(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){Fd(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Ey(this,t,this._integrations),n||Oh(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=F0(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=x0(r,N0(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=Ff}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){Ve&&Ie.warn(Dh);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){Ve&&Ie.warn(Dh);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=j0(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const o=`${t}:${n}`;Ve&&Ie.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return Ve&&Ie.error("Error while sending envelope:",n),{}}return Ve&&Ie.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=NE(this,t),Oh(this,t)}_updateSessionFromEvent(t,n){var l,c;let r=n.level==="fatal",o=!1;const s=(l=n.exception)==null?void 0:l.values;if(s){o=!0,r=!1;for(const d of s)if(((c=d.mechanism)==null?void 0:c.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(yi(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){const s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&(i!=null&&i.length)&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),pE(s,t,n,r,this,o).then(a=>{var c;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(c=a.contexts)==null?void 0:c.trace,...UT(r)},...a.contexts};const l=dy(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=$t(),o=Kr()){return Ve&&Bd(t)&&Ie.log(`Captured error event \`${Ry(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{Ve&&(Fh(s)?Ie.log(s.message):jh(s)?Ie.warn(s.message):Ie.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=$y(t),l=Bd(t),d=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:va(i);if(l&&typeof f=="number"&&Qo()>f)return this.recordDroppedEvent("sample_rate","error"),Hf(Lu(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const m=qh(t.type);return this._prepareEvent(t,n,r,o).then(v=>{var H;if(v===null)throw this.recordDroppedEvent("event_processor",m),Lu("An event processor returned `null`, will not send event.");if(((H=n.data)==null?void 0:H.__sentry__)===!0)return v;const k=ZE(this,s,v,n);return QE(k,d)}).then(v=>{var H;if(v===null){if(this.recordDroppedEvent("before_send",m),a){const O=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",O)}throw Lu(`${d} returned \`null\`, will not send event.`)}const T=r.getSession()||o.getSession();if(l&&T&&this._updateSessionFromEvent(T,v),a){const P=((H=v.sdkProcessingMetadata)==null?void 0:H.spanCountBeforeProcessing)||0,O=v.spans?v.spans.length:0,W=P-O;W>0&&this.recordDroppedEvent("before_send","span",W)}const k=v.transaction_info;if(a&&k&&v.transaction!==t.transaction){const P="custom";v.transaction_info={...k,source:P}}return this.sendEvent(v,n),v}).then(null,v=>{throw Fh(v)||jh(v)?v:(this.captureException(v,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:v}),Dl(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
27
+ Reason: ${v}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Vf&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){Ve&&Ie.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Ve&&Ie.log("No outcomes to send");return}if(!this._dsn){Ve&&Ie.log("No dsn provided, will not send outcomes");return}Ve&&Ie.log("Sending outcomes:",t);const n=GE(t,this._options.tunnel&&Mi(this._dsn));this.sendEnvelope(n)}}function qh(e){return e==="replay_event"?"replay":e||"error"}function QE(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Ci(e))return e.then(r=>{if(!ma(r)&&r!==null)throw Dl(n);return r},r=>{throw Dl(`${t} rejected with ${r}`)});if(!ma(e)&&e!==null)throw Dl(n);return e}function ZE(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!fy(t.beforeSendSpan)&&t.beforeSendSpan;let l=n;if(Bd(l)&&o)return o(l,r);if($y(l)){if(a||i){const c=KE(l);if(i!=null&&i.length&&ya(c,i))return null;if(a){const d=a(c);d?l=Pa(n,YE(d)):$d()}if(l.spans){const d=[],f=l.spans;for(const v of f){if(i!=null&&i.length&&ya(v,i)){S0(f,v);continue}if(a){const T=a(v);T?d.push(T):($d(),d.push(v))}else d.push(v)}const m=l.spans.length-d.length;m&&e.recordDroppedEvent("before_send","span",m),l.spans=d}}if(s){if(l.spans){const c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return s(l,r)}}return l}function Bd(e){return e.type===void 0}function $y(e){return e.type==="transaction"}function ek(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Ny(e.attributes)}function tk(e){let t=0;return e.message&&(t+=e.message.length*2),t+Ny(e.attributes)}function Ny(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Uh(n[0]):gi(n)?t+=Uh(n):t+=100}),t}function Uh(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function nk(e){return Ec(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Hh(e){return nk(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function rk(e,t){t.debug===!0&&(Ve?Ie.enable():Fo(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),$t().update(t.initialScope);const r=new e(t);return ok(r),r.init(),r}function ok(e){$t().setClient(e)}const sk="thismessage:/";function Oy(e){return"isRelative"in e}function Ly(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?sk:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const o=new URL(e,r);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function ik(e){if(Oy(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Ds(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function ak(e){return e.split(/[?#]/,1)[0]}function es(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",o=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const a=e.slice(s+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${o?",base64":""}${i?`,${i}`:""}`}return e}function lk(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Dy(e,t,n=[t],r="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:Ns})),o.version=Ns)}function jy(e={}){const t=e.client||xt();if(!IE()||!t)return{};const n=Bs(),r=xi(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||$t(),s=e.span||ir(),i=s?f0(s):ck(o),a=s?rs(s):dy(t,o),l=JT(a);if(!ny.test(i))return Ie.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:l};return e.propagateTraceparent&&(d.traceparent=s?p0(s):uk(o)),d}function ck(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return ry(t,r,n)}function uk(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return oy(t,r,n)}const dk=100;function pr(e,t){const n=xt(),r=Kr();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=dk}=n.getOptions();if(s<=0)return;const a={timestamp:qs(),...e},l=o?Fo(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let Wh;const fk="FunctionToString",Vh=new WeakMap,pk=(()=>({name:fk,setupOnce(){Wh=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Lf(this),n=Vh.has(xt())&&t!==void 0?t:this;return Wh.apply(n,e)}}catch{}},setup(e){Vh.set(e,!0)}})),hk=pk,mk=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],gk="EventFilters",vk=(e={})=>{let t;return{name:gk,setup(n){const r=n.getOptions();t=zh(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=zh(e,s)}return _k(n,t)?null:n}}},yk=((e={})=>({...vk(e),name:"InboundFilters"}));function zh(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:mk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function _k(e,t){if(e.type){if(e.type==="transaction"&&wk(e,t.ignoreTransactions))return Ve&&Ie.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
28
+ Event: ${Cs(e)}`),!0}else{if(bk(e,t.ignoreErrors))return Ve&&Ie.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
29
+ Event: ${Cs(e)}`),!0;if(kk(e))return Ve&&Ie.warn(`Event dropped due to not having an error message, error type or stacktrace.
30
+ Event: ${Cs(e)}`),!0;if(Sk(e,t.denyUrls))return Ve&&Ie.warn(`Event dropped due to being matched by \`denyUrls\` option.
31
+ Event: ${Cs(e)}.
32
+ Url: ${ec(e)}`),!0;if(!Tk(e,t.allowUrls))return Ve&&Ie.warn(`Event dropped due to not being matched by \`allowUrls\` option.
33
+ Event: ${Cs(e)}.
34
+ Url: ${ec(e)}`),!0}return!1}function bk(e,t){return t!=null&&t.length?Ry(e).some(n=>Zo(n,t)):!1}function wk(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?Zo(n,t):!1}function Sk(e,t){if(!(t!=null&&t.length))return!1;const n=ec(e);return n?Zo(n,t):!1}function Tk(e,t){if(!(t!=null&&t.length))return!0;const n=ec(e);return n?Zo(n,t):!0}function Ek(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function ec(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(s=>{var i,a,l;return((i=s.mechanism)==null?void 0:i.parent_id)===void 0&&((l=(a=s.stacktrace)==null?void 0:a.frames)==null?void 0:l.length)}),o=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return o?Ek(o):null}catch{return Ve&&Ie.error(`Cannot extract url for event ${Cs(e)}`),null}}function kk(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function Ik(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!No(s.originalException,Error))return;const i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=qd(e,t,r,s.originalException,n,o.exception.values,i,0))}function qd(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let l=[...s];if(No(r[o],Error)){Gh(i,a,r);const c=e(t,r[o]),d=l.length;Kh(c,o,d,a),l=qd(e,t,n,r[o],o,[c,...l],c,d)}return Fy(r)&&r.errors.forEach((c,d)=>{if(No(c,Error)){Gh(i,a,r);const f=e(t,c),m=l.length;Kh(f,`errors[${d}]`,m,a),l=qd(e,t,n,c,o,[f,...l],f,m)}}),l}function Fy(e){return Array.isArray(e.errors)}function Gh(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Fy(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Kh(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Ak(e){const t="console";ls(t,e),cs(t,Ck)}function Ck(){"console"in mt&&aT.forEach(function(e){e in mt.console&&fr(mt.console,e,function(t){return Jl[e]=t,function(...n){kr("console",{args:n,level:e});const o=Jl[e];o==null||o.apply(mt.console,n)}})})}function xk(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const Rk="Dedupe",Mk=(()=>{let e;return{name:Rk,processEvent(t){if(t.type)return t;try{if($k(t,e))return Ve&&Ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Pk=Mk;function $k(e,t){return t?!!(Nk(e,t)||Ok(e,t)):!1}function Nk(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!qy(e,t)||!By(e,t))}function Ok(e,t){const n=Yh(t),r=Yh(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!qy(e,t)||!By(e,t))}function By(e,t){let n=ih(e),r=ih(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const s=r[o],i=n[o];if(s.filename!==i.filename||s.lineno!==i.lineno||s.colno!==i.colno||s.function!==i.function)return!1}return!0}function qy(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Yh(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const Lk="ConversationId",Dk=(()=>({name:Lk,setup(e){e.on("spanStart",t=>{const n=$t().getScopeData(),r=Kr().getScopeData(),o=n.conversationId||r.conversationId;o&&t.setAttribute(WT,o)})}})),jk=Dk;function Fk(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Ar()&&t(i);if(e.endTimestamp){const v=e.fetchData.__span;if(!v)return;const T=r[v];T&&(a&&(Uk(T,e),Bk(T,e,o)),delete r[v]);return}const{spanOrigin:l="auto.http.browser",propagateTraceparent:c=!1}=typeof o=="object"?o:{spanOrigin:o},d=!!ir(),f=a&&d?os(Wk(i,s,l)):new Cr;if(e.fetchData.__span=f.spanContext().spanId,r[f.spanContext().spanId]=f,n(e.fetchData.url)){const v=e.args[0],T={...e.args[1]||{}},k=qk(v,T,Ar()&&d?f:void 0,c);k&&(e.args[1]=T,T.headers=k)}const m=xt();if(m){const v={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};m.emit("beforeOutgoingRequestSpan",f,v)}return f}function Bk(e,t,n){var o;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(o=t.response)==null?void 0:o.headers,error:t.error})}function qk(e,t,n,r){const o=jy({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const l=t.headers||(Nf(e)?e.headers:void 0);if(l)if(Hk(l)){const c=new Headers(l);if(c.get("sentry-trace")||c.set("sentry-trace",s),r&&a&&!c.get("traceparent")&&c.set("traceparent",a),i){const d=c.get("baggage");d?vl(d)||c.set("baggage",`${d},${i}`):c.set("baggage",i)}return c}else if(Array.isArray(l)){const c=[...l];l.find(f=>f[0]==="sentry-trace")||c.push(["sentry-trace",s]),r&&a&&!l.find(f=>f[0]==="traceparent")&&c.push(["traceparent",a]);const d=l.find(f=>f[0]==="baggage"&&vl(f[1]));return i&&!d&&c.push(["baggage",i]),c}else{const c="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,f="baggage"in l?l.baggage:void 0,m=f?Array.isArray(f)?[...f]:[f]:[],v=f&&(Array.isArray(f)?f.find(k=>vl(k)):vl(f));i&&!v&&m.push(i);const T={...l,"sentry-trace":c??s,baggage:m.length>0?m.join(","):void 0};return r&&a&&!d&&(T.traceparent=a),T}else return{...o}}function Uk(e,t){var n,r;if(t.response){Xv(e,t.response.status);const o=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(o){const s=parseInt(o);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:fn,message:"internal_error"});e.end()}function vl(e){return e.split(",").some(t=>t.trim().startsWith(Zl))}function Hk(e){return typeof Headers<"u"&&No(e,Headers)}function Wk(e,t,n){if(e.startsWith("data:")){const s=es(e);return{name:`${t} ${s}`,attributes:Jh(e,void 0,t,n)}}const r=Ly(e),o=r?ik(r):e;return{name:`${t} ${o}`,attributes:Jh(e,r,t,n)}}function Jh(e,t,n,r){const o={url:es(e),type:"fetch","http.method":n,[Xt]:r,[Lo]:"http.client"};return t&&(Oy(t)||(o["http.url"]=es(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function Uy(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const ba=mt;function Vk(){return"history"in ba&&!!ba.history}function zk(){if(!("fetch"in ba))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function Ud(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Gk(){var n;if(typeof EdgeRuntime=="string")return!0;if(!zk())return!1;if(Ud(ba.fetch))return!0;let e=!1;const t=ba.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=Ud(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){Ve&&Ie.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Hy(e,t){const n="fetch";ls(n,e),cs(n,()=>Wy(void 0,t))}function Kk(e){const t="fetch-body-resolved";ls(t,e),cs(t,()=>Wy(Jk))}function Wy(e,t=!1){t&&!Gk()||fr(mt,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=Xk(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:rn()*1e3,virtualError:o,headers:Qk(r)};return e||kr("fetch",{...a}),n.apply(mt,r).then(async l=>(e?e(l):kr("fetch",{...a,endTimestamp:rn()*1e3,response:l}),l),l=>{kr("fetch",{...a,endTimestamp:rn()*1e3,error:l}),Ec(l)&&l.stack===void 0&&(l.stack=o.stack,sr(l,"framesToPop",1));const c=xt(),d=(c==null?void 0:c.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const v=new URL(a.fetchData.url).host;d==="always"?l.message=`${l.message} (${v})`:sr(l,"__sentry_fetch_url_host__",v)}catch{}throw l})}})}async function Yk(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(i),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(o),r.releaseLock(),n.cancel().then(null,()=>{})}}function Jk(e){let t;try{t=e.clone()}catch{return}Yk(t,()=>{kr("fetch-body-resolved",{endTimestamp:rn()*1e3,response:e})})}function jl(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Xh(e){return typeof e=="string"?e:e?jl(e,"url")?e.url:e.toString?e.toString():"":""}function Xk(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Xh(n),method:jl(r,"method")?String(r.method).toUpperCase():Nf(n)&&jl(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Xh(t),method:jl(t,"method")?String(t.method).toUpperCase():"GET"}}function Qk(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Nf(t))return new Headers(t.headers)}catch{}}function Zk(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function eI(){return"npm"}function tI(){return!Zk()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function nI(){return typeof window<"u"&&(!tI()||rI())}function rI(){const e=mt.process;return(e==null?void 0:e.type)==="renderer"}const ut=mt;let Hd=0;function Vy(){return Hd>0}function oI(){Hd++,setTimeout(()=>{Hd--})}function wi(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(Lf(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>wi(i,t));return e.apply(this,s)}catch(s){throw oI(),Ic(i=>{i.addEventProcessor(a=>(t.mechanism&&(Rd(a,void 0),vi(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),Wf(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Hv(r,e),sr(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function Gf(){const e=xa(),{referrer:t}=ut.document||{},{userAgent:n}=ut.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function Kf(e,t){const n=Yf(e,t),r={type:cI(t),value:uI(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function sI(e,t,n,r){const o=xt(),s=o==null?void 0:o.getOptions().normalizeDepth,i=mI(t),a={__serialized__:py(t,s)};if(i)return{exception:{values:[Kf(e,i)]},extra:a};const l={exception:{values:[{type:kc(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:pI(t,{isUnhandledRejection:r})}]},extra:a};if(n){const c=Yf(e,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function Du(e,t){return{exception:{values:[Kf(e,t)]}}}function Yf(e,t){const n=t.stacktrace||t.stack||"",r=aI(t),o=lI(t);try{return e(n,r,o)}catch{}return[]}const iI=/Minified React error #\d+;/i;function aI(e){return e&&iI.test(e.message)?1:0}function lI(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function zy(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function cI(e){const t=e==null?void 0:e.name;return!t&&zy(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function uI(e){const t=e==null?void 0:e.message;return zy(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Hh(t.error):Hh(e):"No error message"}function dI(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=Jf(e,t,o,r);return vi(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),La(s)}function fI(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=Wd(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),La(i)}function Jf(e,t,n,r,o){let s;if(Bv(t)&&t.error)return Du(e,t.error);if(lh(t)||yT(t)){const i=t;if("stack"in t)s=Du(e,t);else{const a=i.name||(lh(i)?"DOMError":"DOMException"),l=i.message?`${a}: ${i.message}`:a;s=Wd(e,l,n,r),Rd(s,l)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return Ec(t)?Du(e,t):ma(t)||kc(t)?(s=sI(e,t,n,o),vi(s,{synthetic:!0}),s):(s=Wd(e,t,n,r),Rd(s,`${t}`),vi(s,{synthetic:!0}),s)}function Wd(e,t,n,r){const o={};if(r&&n){const s=Yf(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),vi(o,{synthetic:!0})}if($f(t)){const{__sentry_template_string__:s,__sentry_template_values__:i}=t;return o.logentry={message:s,params:i},o}return o.message=t,o}function pI(e,{isUnhandledRejection:t}){const n=ET(e),r=t?"promise rejection":"exception";return Bv(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:kc(e)?`Event \`${hI(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function hI(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function mI(e){return Object.values(e).find(t=>t instanceof Error)}class gI extends XE{constructor(t){var d;const n=vI(t),r=ut.SENTRY_SDK_SOURCE||eI();Dy(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:s,enableLogs:i,_experiments:a,enableMetrics:l}=this._options,c=l??(a==null?void 0:a.enableMetrics)??!0;ut.document&&(s||i||c)&&ut.document.addEventListener("visibilitychange",()=>{ut.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&Fd(this),c&&Iy(this))}),o&&this.on("beforeSendSession",lk)}eventFromException(t,n){return dI(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return fI(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}}function vI(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=ut.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Da=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,et=mt,yI=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",ja=(e,t,n,r)=>{let o,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(o??0),(s||o===void 0)&&(o=t.value,t.delta=s,t.rating=yI(t.value,n),e(t)))}},Fa=(e=!0)=>{var n,r;const t=(r=(n=et.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Pi=()=>{const e=Fa();return(e==null?void 0:e.activationStart)??0};function ts(e,t,n){et.document&&et.addEventListener(e,t,n)}function tc(e,t,n){et.document&&et.removeEventListener(e,t,n)}let fi=-1;const Gy=new Set,_I=()=>{var e,t;return((e=et.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=et.document)!=null&&t.prerendering)?0:1/0},Fl=e=>{if(bI(e)&&fi>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of Gy)t();isFinite(fi)||(fi=e.type==="visibilitychange"?e.timeStamp:0,tc("prerenderingchange",Fl,!0))}},Ba=()=>{var e;if(et.document&&fi<0){const t=Pi();fi=(et.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??_I(),ts("visibilitychange",Fl,!0),ts("pagehide",Fl,!0),ts("prerenderingchange",Fl,!0)}return{get firstHiddenTime(){return fi},onHidden(t){Gy.add(t)}}};function bI(e){var t;return e.type==="pagehide"||((t=et.document)==null?void 0:t.visibilityState)==="hidden"}const wI=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,qa=(e,t=-1)=>{var s,i;const n=Fa();let r="navigate";return n&&((s=et.document)!=null&&s.prerendering||Pi()>0?r="prerender":(i=et.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:wI(),navigationType:r}},ju=new WeakMap;function Xf(e,t){try{return ju.get(e)||ju.set(e,new t),ju.get(e)}catch{return new t}}class nc{constructor(){nc.prototype.__init.call(this),nc.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var o;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(o=this._onAfterProcessingUnexpectedShift)==null||o.call(this,t)}}const $i=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Qf=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Rc=e=>{var t;(t=et.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},SI=[1800,3e3],TI=(e,t={})=>{Rc(()=>{const n=Ba(),r=qa("FCP");let o;const i=$i("paint",a=>{for(const l of a)l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Pi(),0),r.entries.push(l),o(!0)))});i&&(o=ja(e,r,SI,t.reportAllChanges))})},EI=[.1,.25],kI=(e,t={})=>{TI(Qf(()=>{var l;const n=qa("CLS",0);let r;const o=Ba(),s=Xf(t,nc),i=c=>{for(const d of c)s._processEntry(d);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=$i("layout-shift",i);a&&(r=ja(e,n,EI,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(l=et==null?void 0:et.setTimeout)==null||l.call(et,r))}))};let Ky=0,Fu=1/0,yl=0;const II=e=>{e.forEach(t=>{t.interactionId&&(Fu=Math.min(Fu,t.interactionId),yl=Math.max(yl,t.interactionId),Ky=yl?(yl-Fu)/7+1:0)})};let Vd;const Yy=()=>Vd?Ky:performance.interactionCount||0,AI=()=>{"interactionCount"in performance||Vd||(Vd=$i("event",II,{type:"event",buffered:!0,durationThreshold:0}))},Bu=10;let Jy=0;const CI=()=>Yy()-Jy;class rc{constructor(){rc.prototype.__init.call(this),rc.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Jy=Yy(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(CI()/50));return this._longestInteractionList[t]}_processEntry(t){var o,s;if((o=this._onBeforeProcessingEntry)==null||o.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<Bu||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>Bu){const i=this._longestInteractionList.splice(Bu);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const Xy=e=>{var n;const t=et.requestIdleCallback||et.setTimeout;((n=et.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=Qf(e),ts("visibilitychange",e,{once:!0,capture:!0}),ts("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),tc("visibilitychange",e,{capture:!0}),tc("pagehide",e,{capture:!0})}))},xI=[200,500],RI=40,MI=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Ba();Rc(()=>{AI();const r=qa("INP");let o;const s=Xf(t,rc),i=l=>{Xy(()=>{for(const d of l)s._processEntry(d);const c=s._estimateP98LongestInteraction();c&&c._latency!==r.value&&(r.value=c._latency,r.entries=c.entries,o())})},a=$i("event",i,{durationThreshold:t.durationThreshold??RI});o=ja(e,r,xI,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class PI{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const $I=[2500,4e3],NI=(e,t={})=>{Rc(()=>{const n=Ba(),r=qa("LCP");let o;const s=Xf(t,PI),i=l=>{t.reportAllChanges||(l=l.slice(-1));for(const c of l)s._processEntry(c),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Pi(),0),r.entries=[c],o())},a=$i("largest-contentful-paint",i);if(a){o=ja(e,r,$I,t.reportAllChanges);const l=Qf(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),c=d=>{d.isTrusted&&(Xy(l),tc(d.type,c,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])ts(d,c,{capture:!0})}})},OI=[800,1800],zd=e=>{var t,n;(t=et.document)!=null&&t.prerendering?Rc(()=>zd(e)):((n=et.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>zd(e),!0):setTimeout(e)},LI=(e,t={})=>{const n=qa("TTFB"),r=ja(e,n,OI,t.reportAllChanges);zd(()=>{const o=Fa();o&&(n.value=Math.max(o.responseStart-Pi(),0),n.entries=[o],r(!0))})},ra={},oc={};let Qy,Zy,e_,t_;function n_(e,t=!1){return Mc("cls",e,FI,Qy,t)}function r_(e,t=!1){return Mc("lcp",e,BI,Zy,t)}function DI(e){return Mc("ttfb",e,qI,e_)}function jI(e){return Mc("inp",e,UI,t_)}function wa(e,t){return o_(e,t),oc[e]||(HI(e),oc[e]=!0),s_(e,t)}function Ua(e,t){const n=ra[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){Da&&Ie.error(`Error while triggering instrumentation handler.
35
+ Type: ${e}
36
+ Name: ${$o(r)}
37
+ Error:`,o)}}function FI(){return kI(e=>{Ua("cls",{metric:e}),Qy=e},{reportAllChanges:!0})}function BI(){return NI(e=>{Ua("lcp",{metric:e}),Zy=e},{reportAllChanges:!0})}function qI(){return LI(e=>{Ua("ttfb",{metric:e}),e_=e})}function UI(){return MI(e=>{Ua("inp",{metric:e}),t_=e})}function Mc(e,t,n,r,o=!1){o_(e,t);let s;return oc[e]||(s=n(),oc[e]=!0),r&&t({metric:r}),s_(e,t,o?s:void 0)}function HI(e){const t={};e==="event"&&(t.durationThreshold=0),$i(e,n=>{Ua(e,{entries:n})},t)}function o_(e,t){ra[e]=ra[e]||[],ra[e].push(t)}function s_(e,t,n){return()=>{n&&n();const r=ra[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function WI(e){return"duration"in e}const VI=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=et.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};ts("visibilitychange",t,{capture:!0,once:!0}),ts("pagehide",t,{capture:!0,once:!0})};function qu(e){return typeof e=="number"&&isFinite(e)}function ss(e,t,n,{...r}){const o=bt(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Bf(e,()=>{const s=os({startTime:t,...r});return s&&s.end(n),s})}function Zf(e){var H;const t=xt();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:l}=t.getOptions(),c=t.getIntegrationByName("Replay"),d=c==null?void 0:c.getReplayId(),f=$t(),m=f.getUser(),v=m!==void 0?m.email||m.id||m.ip_address:void 0;let T;try{T=f.getScopeData().contexts.profile.profile_id}catch{}const k={release:i,environment:a,user:v||void 0,profile_id:T||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(H=et.navigator)==null?void 0:H.userAgent,"client.address":l?"{{auto}}":void 0,...o};return os({name:n,attributes:k,startTime:s,experimental:{standalone:!0}})}function Pc(){return et.addEventListener&&et.performance}function pn(e){return e/1e3}function zI(e){let t="unknown",n="unknown",r="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=o}return r===e&&(t=r),{name:t,version:n}}function i_(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function a_(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}VI(()=>{o("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,l)=>{l!=null&&l.isRedirect||(o("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",a=>{n=a.spanContext().spanId,i()})}function GI(e){let t=0,n;if(!i_("layout-shift"))return;const r=n_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);a_(e,(o,s)=>{KI(t,n,s,o),r()})}function KI(e,t,n,r){var c;Da&&Ie.log(`Sending CLS span (${e})`);const o=t?pn((Rr()||0)+t.startTime):rn(),s=$t().getScopeData().transactionName,i=t?xr((c=t.sources[0])==null?void 0:c.node):"Layout shift",a={[Xt]:"auto.http.browser.cls",[Lo]:"ui.webvital.cls",[Ri]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,f)=>{a[`cls.source.${f+1}`]=xr(d.node)});const l=Zf({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("cls",{[$a]:"",[Na]:e}),l.end(o))}function YI(e){let t=0,n;if(!i_("largest-contentful-paint"))return;const r=r_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);a_(e,(o,s)=>{JI(t,n,s,o),r()})}function JI(e,t,n,r){Da&&Ie.log(`Sending LCP span (${e})`);const o=pn((Rr()||0)+((t==null?void 0:t.startTime)||0)),s=$t().getScopeData().transactionName,i=t?xr(t.element):"Largest contentful paint",a={[Xt]:"auto.http.browser.lcp",[Lo]:"ui.webvital.lcp",[Ri]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=xr(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const l=Zf({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[$a]:"millisecond",[Na]:e}),l.end(o))}function Sr(e){return e&&((Rr()||performance.timeOrigin)+e)/1e3}function l_(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=zI(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return Rr()||(n=Pc())!=null&&n.timeOrigin?XI({...t,"http.request.redirect_start":Sr(e.redirectStart),"http.request.redirect_end":Sr(e.redirectEnd),"http.request.worker_start":Sr(e.workerStart),"http.request.fetch_start":Sr(e.fetchStart),"http.request.domain_lookup_start":Sr(e.domainLookupStart),"http.request.domain_lookup_end":Sr(e.domainLookupEnd),"http.request.connect_start":Sr(e.connectStart),"http.request.secure_connection_start":Sr(e.secureConnectionStart),"http.request.connection_end":Sr(e.connectEnd),"http.request.request_start":Sr(e.requestStart),"http.request.response_start":Sr(e.responseStart),"http.request.response_end":Sr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function XI(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const QI=2147483647;let Qh=0,Fr={},rr,oi;function ZI({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Pc();if(r&&Rr()){r.mark&&et.performance.mark("sentry-tracing-init");const o=t?YI(n):oA(),s=sA(),i=e?GI(n):rA();return()=>{o==null||o(),s(),i==null||i()}}return()=>{}}function eA(){wa("longtask",({entries:e})=>{const t=ir();if(!t)return;const{op:n,start_timestamp:r}=bt(t);for(const o of e){const s=pn(Rr()+o.startTime),i=pn(o.duration);n==="navigation"&&r&&s<r||ss(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Xt]:"auto.ui.browser.metrics"}})}})}function tA(){new PerformanceObserver(t=>{const n=ir();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=pn(Rr()+r.startTime),{start_timestamp:s,op:i}=bt(n);if(i==="navigation"&&s&&o<s)continue;const a=pn(r.duration),l={[Xt]:"auto.ui.browser.metrics"},c=r.scripts[0],{invoker:d,invokerType:f,sourceURL:m,sourceFunctionName:v,sourceCharPosition:T}=c;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=f,m&&(l["code.filepath"]=m),v&&(l["code.function"]=v),T!==-1&&(l["browser.script.source_char_position"]=T),ss(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function nA(){wa("event",({entries:e})=>{const t=ir();if(t){for(const n of e)if(n.name==="click"){const r=pn(Rr()+n.startTime),o=pn(n.duration),s={name:xr(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Xt]:"auto.ui.browser.metrics"}},i=Uv(n.target);i&&(s.attributes["ui.component_name"]=i),ss(t,r,r+o,s)}}})}function rA(){return n_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Fr.cls={value:e.value,unit:""},oi=t)},!0)}function oA(){return r_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Fr.lcp={value:e.value,unit:"millisecond"},rr=t)},!0)}function sA(){return DI(({metric:e})=>{e.entries[e.entries.length-1]&&(Fr.ttfb={value:e.value,unit:"millisecond"})})}function iA(e,t){const n=Pc(),r=Rr();if(!(n!=null&&n.getEntries)||!r)return;const o=pn(r),s=n.getEntries(),{op:i,start_timestamp:a}=bt(e);s.slice(Qh).forEach(l=>{const c=pn(l.startTime),d=pn(Math.max(0,l.duration));if(!(i==="navigation"&&a&&o+c<a))switch(l.entryType){case"navigation":{uA(e,l,o);break}case"mark":case"paint":case"measure":{lA(e,l,c,d,o,t.ignorePerformanceApiSpans);const f=Ba(),m=l.startTime<f.firstHiddenTime;l.name==="first-paint"&&m&&(Fr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&m&&(Fr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{pA(e,l,l.name,c,d,o,t.ignoreResourceSpans);break}}}),Qh=Math.max(s.length-1,0),hA(e),i==="pageload"&&(vA(Fr),t.recordClsOnPageloadSpan||delete Fr.cls,t.recordLcpOnPageloadSpan||delete Fr.lcp,Object.entries(Fr).forEach(([l,c])=>{H0(l,c.value,c.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",Pi()),mA(e,t)),rr=void 0,oi=void 0,Fr={}}function aA(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function lA(e,t,n,r,o,s){if(aA(t)||["mark","measure"].includes(t.entryType)&&Zo(t.name,s))return;const i=Fa(!1),a=pn(i?i.requestStart:0),l=o+Math.max(n,a),c=o+n,d=c+r,f={[Xt]:"auto.resource.browser.metrics"};l!==c&&(f["sentry.browser.measure_happened_before_request"]=!0,f["sentry.browser.measure_start_time"]=l),cA(f,t),l<=d&&ss(e,l,d,{name:t.name,op:t.entryType,attributes:f})}function cA(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&gi(o))e[`sentry.browser.measure.detail.${r}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(o)}catch{}return}if(gi(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function uA(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{_l(e,t,r,n)}),_l(e,t,"secureConnection",n,"TLS/SSL"),_l(e,t,"fetch",n,"cache"),_l(e,t,"domainLookup",n,"DNS"),fA(e,t,n)}function _l(e,t,n,r,o=n){const s=dA(n),i=t[s],a=t[`${n}Start`];!a||!i||ss(e,r+pn(a),r+pn(i),{op:`browser.${o}`,name:t.name,attributes:{[Xt]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function dA(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function fA(e,t,n){const r=n+pn(t.requestStart),o=n+pn(t.responseEnd),s=n+pn(t.responseStart);t.responseEnd&&(ss(e,r,o,{op:"browser.request",name:t.name,attributes:{[Xt]:"auto.ui.browser.metrics"}}),ss(e,s,o,{op:"browser.response",name:t.name,attributes:{[Xt]:"auto.ui.browser.metrics"}}))}function pA(e,t,n,r,o,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i!=null&&i.includes(a))return;const l={[Xt]:"auto.resource.browser.metrics"},c=Ds(n);c.protocol&&(l["url.scheme"]=c.protocol.split(":").pop()),c.host&&(l["server.address"]=c.host),l["url.same_origin"]=n.includes(et.location.origin),gA(t,l,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...l,...l_(t)},f=s+r,m=f+o;ss(e,f,m,{name:n.replace(et.location.origin,""),op:a,attributes:d})}function hA(e){const t=et.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),qu(n.rtt)&&(Fr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),qu(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),qu(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function mA(e,t){rr&&t.recordLcpOnPageloadSpan&&(rr.element&&e.setAttribute("lcp.element",xr(rr.element)),rr.id&&e.setAttribute("lcp.id",rr.id),rr.url&&e.setAttribute("lcp.url",rr.url.trim().slice(0,200)),rr.loadTime!=null&&e.setAttribute("lcp.loadTime",rr.loadTime),rr.renderTime!=null&&e.setAttribute("lcp.renderTime",rr.renderTime),e.setAttribute("lcp.size",rr.size)),oi!=null&&oi.sources&&t.recordClsOnPageloadSpan&&oi.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,xr(n.node)))}function gA(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<QI||typeof s=="string")&&(t[o]=s)})}function vA(e){const t=Fa(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const yA=1e3;let Zh,Gd,Kd;function _A(e){ls("dom",e),cs("dom",bA)}function bA(){if(!et.document)return;const e=kr.bind(null,"dom"),t=em(e,!0);et.document.addEventListener("click",t,!1),et.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=et[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(fr(o,"addEventListener",function(a){return function(l,c,d){if(l==="click"||l=="keypress")try{const f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},m=f[l]=f[l]||{refCount:0};if(!m.handler){const v=em(e);m.handler=v,a.call(this,l,v,d)}m.refCount++}catch{}return a.call(this,l,c,d)}}),fr(o,"removeEventListener",function(a){return function(l,c,d){if(l==="click"||l=="keypress")try{const f=this.__sentry_instrumentation_handlers__||{},m=f[l];m&&(m.refCount--,m.refCount<=0&&(a.call(this,l,m.handler,d),m.handler=void 0,delete f[l]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,c,d)}}))})}function wA(e){if(e.type!==Gd)return!1;try{if(!e.target||e.target._sentryId!==Kd)return!1}catch{}return!0}function SA(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function em(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=TA(n);if(SA(n.type,r))return;sr(n,"_sentryCaptured",!0),r&&!r._sentryId&&sr(r,"_sentryId",Ir());const o=n.type==="keypress"?"input":n.type;wA(n)||(e({event:n,name:o,global:t}),Gd=n.type,Kd=r?r._sentryId:void 0),clearTimeout(Zh),Zh=et.setTimeout(()=>{Kd=void 0,Gd=void 0},yA)}}function TA(e){try{return e.target}catch{return null}}let bl;function ep(e){const t="history";ls(t,e),cs(t,EA)}function EA(){if(et.addEventListener("popstate",()=>{const t=et.location.href,n=bl;if(bl=t,n===t)return;kr("history",{from:n,to:t})}),!Vk())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=bl,s=kA(String(r));if(bl=s,o===s)return t.apply(this,n);kr("history",{from:o,to:s})}return t.apply(this,n)}}fr(et.history,"pushState",e),fr(et.history,"replaceState",e)}function kA(e){try{return new URL(e,et.location.origin).toString()}catch{return e}}const Bl={};function IA(e){const t=Bl[e];if(t)return t;let n=et[e];if(Ud(n))return Bl[e]=n.bind(et);const r=et.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const s=o.contentWindow;s!=null&&s[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){Da&&Ie.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Bl[e]=n.bind(et))}function AA(e){Bl[e]=void 0}const si="__sentry_xhr_v3__";function c_(e){ls("xhr",e),cs("xhr",CA)}function CA(){if(!et.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=rn()*1e3,i=Ao(r[0])?r[0].toUpperCase():void 0,a=xA(r[1]);if(!i||!a)return t.apply(n,r);n[si]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const c=n[si];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const d={endTimestamp:rn()*1e3,startTimestamp:s,xhr:n,virtualError:o};kr("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,d,f){return l(),c.apply(d,f)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,d,f){const[m,v]=f,T=d[si];return T&&Ao(m)&&Ao(v)&&(T.request_headers[m.toLowerCase()]=v),c.apply(d,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[si];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:rn()*1e3,xhr:n};return kr("xhr",s),t.apply(n,r)}})}function xA(e){if(Ao(e))return e;try{return e.toString()}catch{}}function RA(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Da&&Ie.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
38
+ `).reduce((n,r)=>{const[o,s]=r.split(": ");return s&&(n[o.toLowerCase()]=s),n},{}):{}}const Uu=[],ql=new Map,Xs=new Map,MA=60;function PA(){if(Pc()&&Rr()){const t=$A();return()=>{t()}}return()=>{}}const Yd={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function $A(){return jI(NA)}const NA=({metric:e})=>{if(e.value==null)return;const t=pn(e.value);if(t>MA)return;const n=e.entries.find(T=>T.duration===e.value&&Yd[T.name]);if(!n)return;const{interactionId:r}=n,o=Yd[n.name],s=pn(Rr()+n.startTime),i=ir(),a=i?Ln(i):void 0,l=r!=null?ql.get(r):void 0,c=(l==null?void 0:l.span)||a,d=c?bt(c).description:$t().getScopeData().transactionName,f=(l==null?void 0:l.elementName)||xr(n.target),m={[Xt]:"auto.http.browser.inp",[Lo]:`ui.interaction.${o}`,[Ri]:n.duration},v=Zf({name:f,transaction:d,attributes:m,startTime:s});v&&(v.addEvent("inp",{[$a]:"millisecond",[Na]:e.value}),v.end(s+t))};function OA(){const e=Object.keys(Yd);nI()&&e.forEach(o=>{et.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=xr(s),a=Math.round(o.timeStamp);if(Xs.set(a,i),Xs.size>50){const l=Xs.keys().next().value;l!==void 0&&Xs.delete(l)}}function n(o){const s=Math.round(o.startTime);let i=Xs.get(s);if(!i)for(let a=-5;a<=5;a++){const l=Xs.get(s+a);if(l){i=l;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=ir(),i=s&&Ln(s);o.forEach(a=>{if(!WI(a))return;const l=a.interactionId;if(l==null||ql.has(l))return;const c=a.target?xr(a.target):n(a);if(Uu.length>10){const d=Uu.shift();ql.delete(d)}Uu.push(l),ql.set(l,{span:i,elementName:c})})};wa("event",r),wa("first-input",r)}const LA=40;function DA(e,t=IA("fetch")){let n=0,r=0;async function o(s){const i=s.body.length;n+=i,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const l=await t(e.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw AA("fetch"),l}finally{n-=i,r--}}return zE(e,o,zf(e.bufferSize||LA))}const hr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,jA=30,FA=50;function Jd(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?js:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const BA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,qA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,UA=/\((\S*)(?::(\d+))(?::(\d+))\)/,HA=/at (.+?) ?\(data:(.+?),/,WA=e=>{var o;const t=e.match(HA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=BA.exec(e);if(n){const[,s,i,a]=n;return Jd(s,js,+i,+a)}const r=qA.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const l=UA.exec(r[2]);l&&(r[2]=l[1],r[3]=l[2],r[4]=l[3])}const[i,a]=u_(r[1]||js,r[2]);return Jd(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},VA=[jA,WA],zA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,GA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,KA=e=>{const t=zA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=GA.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||js;return[o,r]=u_(o,r),Jd(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},YA=[FA,KA],JA=[VA,YA],XA=Ov(...JA),u_=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:js,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},wl=1024,QA="Breadcrumbs",ZA=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:QA,setup(n){t.console&&Ak(rC(n)),t.dom&&_A(nC(n,t.dom)),t.xhr&&c_(oC(n)),t.fetch&&Hy(sC(n)),t.history&&ep(iC(n)),t.sentry&&n.on("beforeSendEvent",tC(n))}}}),eC=ZA;function tC(e){return function(n){xt()===e&&pr({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Cs(n)},{event:n})}}function nC(e,t){return function(r){if(xt()!==e)return;let o,s,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>wl&&(hr&&Ie.warn(`\`dom.maxStringLength\` cannot exceed ${wl}, but a value of ${a} was configured. Sentry will use ${wl} instead.`),a=wl),typeof i=="string"&&(i=[i]);try{const c=r.event,d=aC(c)?c.target:c;o=xr(d,{keyAttrs:i,maxStringLength:a}),s=Uv(d)}catch{o="<unknown>"}if(o.length===0)return;const l={category:`ui.${r.name}`,message:o};s&&(l.data={"ui.component_name":s}),pr(l,{event:r.event,name:r.name,global:r.global})}}function rC(e){return function(n){if(xt()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:xk(n.level),message:dh(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${dh(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;pr(r,{input:n.args,level:n.level})}}function oC(e){return function(n){if(xt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[si];if(!r||!o||!s)return;const{method:i,url:a,status_code:l,body:c}=s,d={method:i,url:a,status_code:l},f={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:o},m={category:"xhr",data:d,type:"http",level:Uy(l)};e.emit("beforeOutgoingRequestBreadcrumb",m,f),pr(m,f)}}function sC(e){return function(n){if(xt()!==e)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),pr(i,s)}else{const s=n.response,i={...n.fetchData,status_code:s==null?void 0:s.status},a={input:n.args,response:s,startTimestamp:r,endTimestamp:o},l={category:"fetch",data:i,type:"http",level:Uy(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),pr(l,a)}}}function iC(e){return function(n){if(xt()!==e)return;let r=n.from,o=n.to;const s=Ds(ut.location.href);let i=r?Ds(r):void 0;const a=Ds(o);i!=null&&i.path||(i=s),s.protocol===a.protocol&&s.host===a.host&&(o=a.relative),s.protocol===i.protocol&&s.host===i.host&&(r=i.relative),pr({category:"navigation",data:{from:r,to:o}})}}function aC(e){return!!e&&!!e.target}const lC="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),cC="BrowserApiErrors",uC=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:cC,setupOnce(){t.setTimeout&&fr(ut,"setTimeout",tm),t.setInterval&&fr(ut,"setInterval",tm),t.requestAnimationFrame&&fr(ut,"requestAnimationFrame",fC),t.XMLHttpRequest&&"XMLHttpRequest"in ut&&fr(XMLHttpRequest.prototype,"send",pC);const n=t.eventTarget;n&&(Array.isArray(n)?n:lC).forEach(o=>hC(o,t))}}}),dC=uC;function tm(e){return function(...t){const n=t[0];return t[0]=wi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${$o(e)}`}}),e.apply(this,t)}}function fC(e){return function(t){return e.apply(this,[wi(t,{mechanism:{data:{handler:$o(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function pC(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&fr(n,o,function(s){const i={mechanism:{data:{handler:$o(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=Lf(s);return a&&(i.mechanism.data.handler=$o(a)),wi(s,i)})}),e.apply(this,t)}}function hC(e,t){var o,s;const r=(o=ut[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(fr(r,"addEventListener",function(i){return function(a,l,c){try{mC(l)&&(l.handleEvent=wi(l.handleEvent,{mechanism:{data:{handler:$o(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&gC(this,a,l),i.apply(this,[a,wi(l,{mechanism:{data:{handler:$o(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),c])}}),fr(r,"removeEventListener",function(i){return function(a,l,c){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,c)}catch{}return i.call(this,a,l,c)}}))}function mC(e){return typeof e.handleEvent=="function"}function gC(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const vC=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof ut.document>"u"){hr&&Ie.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}$h({ignoreDuration:!0}),Ou();const n=Kr();let r=n.getUser();n.addScopeListener(o=>{const s=o.getUser();((r==null?void 0:r.id)!==(s==null?void 0:s.id)||(r==null?void 0:r.ip_address)!==(s==null?void 0:s.ip_address))&&(Ou(),r=s)}),t==="route"&&ep(({from:o,to:s})=>{o!==s&&($h({ignoreDuration:!0}),Ou())})}}},yC="CultureContext",_C=(()=>({name:yC,preprocessEvent(e){var n;const t=wC();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}})),bC=_C;function wC(){try{const e=ut.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const SC="GlobalHandlers",TC=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:SC,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(kC(n),nm("onerror")),t.onunhandledrejection&&(IC(n),nm("onunhandledrejection"))}}}),EC=TC;function kC(e){Dv(t=>{const{stackParser:n,attachStacktrace:r}=d_();if(xt()!==e||Vy())return;const{msg:o,url:s,line:i,column:a,error:l}=t,c=xC(Jf(n,l||o,void 0,r,!1),s,i,a);c.level="error",wy(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function IC(e){jv(t=>{const{stackParser:n,attachStacktrace:r}=d_();if(xt()!==e||Vy())return;const o=AC(t),s=gi(o)?CC(o):Jf(n,o,void 0,r,!0);s.level="error",wy(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function AC(e){if(gi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function CC(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function xC(e,t,n,r){const o=e.exception=e.exception||{},s=o.values=o.values||[],i=s[0]=s[0]||{},a=i.stacktrace=i.stacktrace||{},l=a.frames=a.frames||[];return l.length===0&&l.push({colno:r,lineno:n,filename:RC(t)??xa(),function:js,in_app:!0}),e}function nm(e){hr&&Ie.log(`Global Handler attached: ${e}`)}function d_(){const e=xt();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function RC(e){if(!(!Ao(e)||e.length===0))return e.startsWith("data:")?`<${es(e,!1)}>`:e}const MC=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!ut.navigator&&!ut.location&&!ut.document)return;const t=Gf(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),PC="cause",$C=5,NC="LinkedErrors",OC=((e={})=>{const t=e.limit||$C,n=e.key||PC;return{name:NC,preprocessEvent(r,o,s){const i=s.getOptions();Ik(Kf,i.stackParser,n,t,r,o)}}}),LC=OC;function DC(){return jC()?(hr&&Fo(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function jC(){var o;if(typeof ut.window>"u")return!1;const e=ut;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((o=t==null?void 0:t.runtime)!=null&&o.id))return!1;const n=xa();return!(ut===ut.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function f_(e){return[yk(),hk(),jk(),dC(),eC(),EC(),LC(),Pk(),MC(),bC(),vC()]}function FC(e={}){const t=!e.skipBrowserExtensionCheck&&DC();let n=e.defaultIntegrations==null?f_():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:hT(e.stackParser||XA),integrations:$E({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||DA};return rk(gI,r)}function BC(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function p_(e){try{return new URL(e,ut.location.origin).href}catch{return}}function qC(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function h_(e){try{return new Headers(e)}catch{return}}const rm=new WeakMap,Hu=new Map,m_={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function UC(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:l,onRequestSpanEnd:c}={...m_,...t},d=typeof s=="function"?s:T=>!0,f=T=>WC(T,a),m={},v=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(T=>(T.type==="transaction"&&T.spans&&T.spans.forEach(k=>{if(k.op==="http.client"){const H=Hu.get(k.span_id);H&&(k.timestamp=H/1e3,Hu.delete(k.span_id))}}),T)),o&&Kk(T=>{if(T.response){const k=rm.get(T.response);k&&T.endTimestamp&&Hu.set(k,T.endTimestamp)}}),Hy(T=>{const k=Fk(T,d,f,m,{propagateTraceparent:v,onRequestSpanEnd:c});if(T.response&&T.fetchData.__span&&rm.set(T.response,T.fetchData.__span),k){const H=p_(T.fetchData.url),P=H?Ds(H).host:void 0;k.setAttributes({"http.url":H?es(H):void 0,"server.address":P}),i&&om(k,e),l==null||l(k,{headers:T.headers})}})),r&&c_(T=>{var H;const k=VC(T,d,f,m,v,c);k&&(i&&om(k,e),l==null||l(k,{headers:h_((H=T.xhr.__sentry_xhr_v3__)==null?void 0:H.request_headers)}))})}const HC=300;function om(e,t){const{url:n}=bt(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(Oa(t)){const s=e.end.bind(e);e.end=i=>{const a=i??rn();let l=!1;const c=()=>{l||(l=!0,setTimeout(o),s(a),clearTimeout(d))};r=c;const d=setTimeout(c,HC)}}const o=wa("resource",({entries:s})=>{s.forEach(i=>{qC(i)&&i.name.endsWith(n)&&(e.setAttributes(l_(i)),r())})})}function WC(e,t){const n=xa();if(n){let r,o;try{r=new URL(e,n),o=new URL(n).origin}catch{return!1}const s=r.origin===o;return t?Zo(r.toString(),t)||s&&Zo(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?Zo(e,t):r}}function VC(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[si];if(!i||i.__sentry_own_request__||!a)return;const{url:l,method:c}=a,d=Ar()&&t(l);if(e.endTimestamp){const P=i.__sentry_xhr_span_id__;if(!P)return;const O=r[P];O&&(d&&a.status_code!==void 0&&(Xv(O,a.status_code),O.end(),s==null||s(O,{headers:h_(RA(i)),error:e.error})),delete r[P]);return}const f=p_(l),m=Ds(f||l),v=es(ak(l)),T=!!ir(),k=d&&T?os({name:`${c} ${v}`,attributes:{url:es(l),type:"xhr","http.method":c,"http.url":f?es(f):void 0,"server.address":m==null?void 0:m.host,[Xt]:"auto.http.browser",[Lo]:"http.client",...(m==null?void 0:m.search)&&{"http.query":m==null?void 0:m.search},...(m==null?void 0:m.hash)&&{"http.fragment":m==null?void 0:m.hash}}}):new Cr;i.__sentry_xhr_span_id__=k.spanContext().spanId,r[i.__sentry_xhr_span_id__]=k,n(l)&&zC(i,Ar()&&T?k:void 0,o);const H=xt();return H&&H.emit("beforeOutgoingRequestSpan",k,e),k}function zC(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=jy({span:t,propagateTraceparent:n});r&&GC(e,r,o,s)}function GC(e,t,n,r){var s;const o=(s=e.__sentry_xhr_v3__)==null?void 0:s.request_headers;if(!(o!=null&&o["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(o!=null&&o.traceparent)&&e.setRequestHeader("traceparent",r),n){const i=o==null?void 0:o.baggage;(!i||!BC(i))&&e.setRequestHeader("baggage",n)}}catch{}}function KC(){ut.document?ut.document.addEventListener("visibilitychange",()=>{const e=ir();if(!e)return;const t=Ln(e);if(ut.document.hidden&&t){const n="cancelled",{op:r,status:o}=bt(t);hr&&Ie.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:fn,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):hr&&Ie.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const YC=3600,g_="sentry_previous_trace",JC="sentry.previous_trace";function XC(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?ex():void 0;e.on("spanStart",i=>{if(Ln(i)!==i)return;const a=$t().getPropagationContext();o=QC(o,i,a),r&&ZC(o)});let s=!0;n&&e.on("beforeSampling",i=>{if(!o)return;const a=$t(),l=a.getPropagationContext();if(s&&l.parentSpanId){s=!1;return}a.setPropagationContext({...l,dsc:{...l.dsc,sample_rate:String(o.sampleRate),sampled:String(Xd(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=Xd(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[Yv]:o.sampleRate}})}function QC(e,t,n){const r=bt(t);function o(){var a,l;try{return Number((a=n.dsc)==null?void 0:a.sample_rate)??Number((l=r.data)==null?void 0:l[Df])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=YC&&(hr&&Ie.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[HT]:"previous_trace"}}),t.setAttribute(JC,`${i.traceId}-${i.spanId}-${Xd(i)?1:0}`)),s)}function ZC(e){try{ut.sessionStorage.setItem(g_,JSON.stringify(e))}catch(t){hr&&Ie.warn("Could not store previous trace in sessionStorage",t)}}function ex(){var e;try{const t=(e=ut.sessionStorage)==null?void 0:e.getItem(g_);return JSON.parse(t)}catch{return}}function Xd(e){return e.traceFlags===1}const tx="BrowserTracing",nx=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function rx(){const e=ut.navigator;return e!=null&&e.userAgent?nx.test(e.userAgent):!1}const ox={...Ll,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...m_},sm=((e={})=>{"enableElementTiming"in e&&Fo(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=ut.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:c,idleTimeout:d,finalTimeout:f,childSpanTimeout:m,markBackgroundSpan:v,traceFetch:T,traceXHR:k,trackFetchStreamPerformance:H,shouldCreateSpanForRequest:P,enableHTTPTimings:O,ignoreResourceSpans:W,ignorePerformanceApiSpans:Y,instrumentPageLoad:ce,instrumentNavigation:re,detectRedirects:Z,linkPreviousTrace:he,consistentTraceSampling:Ce,enableReportPageLoaded:Ae,onRequestSpanStart:ue,onRequestSpanEnd:V}={...ox,...e},ae=rx();let xe,Fe,_e;function Me(fe,De,Be=!0){const Re=De.op==="pageload",Ge=De.name,ot=c?c(De):De,nt=ot.attributes||{};if(Ge!==ot.name&&(nt[Tr]="custom",ot.attributes=nt),!Be){const J=qs();os({...ot,startTime:J}).end(J);return}t.name=ot.name,t.source=nt[Tr];const st=_y(ot,{idleTimeout:d,finalTimeout:f,childSpanTimeout:m,disableAutoFinish:Re,beforeSpanEnd:J=>{xe==null||xe(),iA(J,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:W,ignorePerformanceApiSpans:Y}),lm(fe,void 0);const be=$t(),we=be.getPropagationContext();be.setPropagationContext({...we,traceId:st.spanContext().traceId,sampled:us(st),dsc:rs(J)}),Re&&(_e=void 0)},trimIdleSpanEndTimestamp:!Ae});Re&&Ae&&(_e=st),lm(fe,st);function Ke(){n&&["interactive","complete"].includes(n.readyState)&&fe.emit("idleSpanEnableAutoFinish",st)}Re&&!Ae&&n&&(n.addEventListener("readystatechange",()=>{Ke()}),Ke())}return{name:tx,setup(fe){var Be;if(ae){hr&&Ie.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(w0(),xe=ZI({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:l||!1,client:fe}),r&&PA(),s&&mt.PerformanceObserver&&((Be=PerformanceObserver.supportedEntryTypes)!=null&&Be.includes("long-animation-frame"))?tA():o&&eA(),i&&nA(),Z&&n){const Re=()=>{Fe=rn()};addEventListener("click",Re,{capture:!0}),addEventListener("keydown",Re,{capture:!0,passive:!0})}function De(){const Re=Sa(fe);Re&&!bt(Re).timestamp&&(hr&&Ie.log(`[Tracing] Finishing current active span with op: ${bt(Re).op}`),Re.setAttribute(ga,"cancelled"),Re.end())}fe.on("startNavigationSpan",(Re,Ge)=>{if(xt()!==fe)return;if(Ge!=null&&Ge.isRedirect){hr&&Ie.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Me(fe,{op:"navigation.redirect",...Re},!1);return}Fe=void 0,De(),Kr().setPropagationContext({traceId:Oo(),sampleRand:Math.random(),propagationSpanId:Ar()?void 0:Co()});const ot=$t();ot.setPropagationContext({traceId:Oo(),sampleRand:Math.random(),propagationSpanId:Ar()?void 0:Co()}),ot.setSDKProcessingMetadata({normalizedRequest:void 0}),Me(fe,{op:"navigation",...Re,parentSpan:null,forceTransaction:!0})}),fe.on("startPageLoadSpan",(Re,Ge={})=>{if(xt()!==fe)return;De();const ot=Ge.sentryTrace||im("sentry-trace")||am("sentry-trace"),nt=Ge.baggage||im("baggage")||am("baggage"),st=l0(ot,nt),Ke=$t();Ke.setPropagationContext(st),Ar()||(Ke.getPropagationContext().propagationSpanId=Co()),Ke.setSDKProcessingMetadata({normalizedRequest:Gf()}),Me(fe,{op:"pageload",...Re})}),fe.on("endPageloadSpan",()=>{Ae&&_e&&(_e.setAttribute(ga,"reportPageLoaded"),_e.end())})},afterAllSetup(fe){if(ae)return;let De=xa();if(he!=="off"&&XC(fe,{linkPreviousTrace:he,consistentTraceSampling:Ce}),ut.location){if(ce){const Be=Rr();sx(fe,{name:ut.location.pathname,startTime:Be?Be/1e3:void 0,attributes:{[Tr]:"url",[Xt]:"auto.pageload.browser"}})}re&&ep(({to:Be,from:Re})=>{if(Re===void 0&&(De==null?void 0:De.indexOf(Be))!==-1){De=void 0;return}De=void 0;const Ge=Ly(Be),ot=Sa(fe),nt=ot&&Z&&ax(ot,Fe);v_(fe,{name:(Ge==null?void 0:Ge.pathname)||ut.location.pathname,attributes:{[Tr]:"url",[Xt]:"auto.navigation.browser"}},{url:Be,isRedirect:nt})})}v&&KC(),i&&ix(fe,d,f,m,t),r&&OA(),UC(fe,{traceFetch:T,traceXHR:k,trackFetchStreamPerformance:H,tracePropagationTargets:fe.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:P,enableHTTPTimings:O,onRequestSpanStart:ue,onRequestSpanEnd:V})}}});function sx(e,t,n){e.emit("startPageLoadSpan",t,n),$t().setTransactionName(t.name);const r=Sa(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function v_(e,t,n){const{url:r,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const s=$t();return s.setTransactionName(t.name),r&&!o&&s.setSDKProcessingMetadata({normalizedRequest:{...Gf(),url:r}}),Sa(e)}function im(e){const t=ut.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function am(e){var r,o,s;const t=(o=(r=ut.performance)==null?void 0:r.getEntriesByType)==null?void 0:o.call(r,"navigation")[0],n=(s=t==null?void 0:t.serverTiming)==null?void 0:s.find(i=>i.name===e);return n==null?void 0:n.description}function ix(e,t,n,r,o){const s=ut.document;let i;const a=()=>{const l="ui.action.click",c=Sa(e);if(c){const d=bt(c).op;if(["navigation","pageload"].includes(d)){hr&&Ie.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(ga,"interactionInterrupted"),i.end(),i=void 0),!o.name){hr&&Ie.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}i=_y({name:o.name,op:l,attributes:{[Tr]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const y_="_sentry_idleSpan";function Sa(e){return e[y_]}function lm(e,t){sr(e,y_,t)}const cm=1.5;function ax(e,t){const n=bt(e),r=qs(),o=n.start_timestamp;return!(r-o>cm||t&&r-t<=cm)}const __=["activate","mount"],b_=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,lx=/(?:^|[-_])(\w)/g,cx=e=>e.replace(lx,t=>t.toUpperCase()).replace(/[-_]/g,""),ux="<Root>",Wu="<Anonymous>",dx=(e,t)=>e.repeat(t),oa=(e,t)=>{if(!e)return Wu;if(e.$root===e)return ux;if(!e.$options)return Wu;const n=e.$options;let r=n.name||n._componentTag||n.__name;const o=n.__file;if(!r&&o){const s=o.match(/([^/\\]+)\.vue$/);s&&(r=s[1])}return(r?`<${cx(r)}>`:Wu)+(o&&t!==!1?` at ${o}`:"")},fx=e=>{if(e&&(e._isVue||e.__isVue)&&e.$parent){const t=[];let n=0;for(;e;){if(t.length>0){const o=t[t.length-1];if(o.constructor===e.constructor){n++,e=e.$parent;continue}else n>0&&(t[t.length-1]=[o,n],n=0)}t.push(e),e=e.$parent}return`
39
+
40
+ found in
41
+
42
+ ${t.map((o,s)=>`${(s===0?"---> ":dx(" ",5+s*2))+(Array.isArray(o)?`${oa(o[0])}... (${o[1]} recursive calls)`:oa(o))}`).join(`
43
+ `)}`}return`
44
+
45
+ (found in ${oa(e)})`},px=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,o,s)=>{var c;const i=oa(o,!1),a=o?fx(o):"",l={componentName:i,lifecycleHook:s,trace:a};if((t==null?void 0:t.attachProps)!==!1&&o&&((c=o.$options)!=null&&c.propsData?l.propsData=o.$options.propsData:o.$props&&(l.propsData=o.$props)),setTimeout(()=>{Wf(r,{captureContext:{contexts:{vue:l}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&e.config.errorHandler)n.call(e,r,o,s);else throw r}},um="ui.vue",hx={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function Vu(e,t,n){e.$_sentryRootComponentSpanTimer&&clearTimeout(e.$_sentryRootComponentSpanTimer),e.$_sentryRootComponentSpanTimer=setTimeout(()=>{var r;(r=e.$root)!=null&&r.$_sentryRootComponentSpan&&(e.$root.$_sentryRootComponentSpan.end(t),e.$root.$_sentryRootComponentSpan=void 0)},n)}function mx(e,t){function n(o){return o.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(o=>n(t)===n(o))}const gx=(e={})=>{const t=(e.hooks||[]).concat(__).filter((o,s,i)=>i.indexOf(o)===s),n={},r=e.timeout||2e3;for(const o of t){const s=hx[o];if(!s){b_&&Ie.warn(`Unknown hook: ${o}`);continue}for(const i of s)n[i]=function(){var m;const a=this.$root===this;a&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||os({name:"Application Render",op:`${um}.render`,attributes:{[Xt]:"auto.ui.vue"},onlyIfParent:!0}),Vu(this,rn(),r));const l=oa(this,!1);if(!(a||(Array.isArray(e.trackComponents)?mx(e.trackComponents,l):e.trackComponents))){Vu(this,rn(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=i===s[0],f=((m=this.$root)==null?void 0:m.$_sentryRootComponentSpan)||ir();if(d){if(f){const v=this.$_sentryComponentSpans[o];v&&v.end(),this.$_sentryComponentSpans[o]=os({name:`Vue ${l}`,op:`${um}.${o}`,attributes:{[Xt]:"auto.ui.vue"},onlyIfParent:!0})}}else{const v=this.$_sentryComponentSpans[o];if(!v)return;v.end(),Vu(this,rn(),r)}}}return n},vx=mt,yx={Vue:vx.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:__,timeout:2e3,trackComponents:!1}},_x="Vue",bx=(e={})=>({name:_x,setup(t){const n={...yx,...t.getOptions(),...e};if(!n.Vue&&!n.app){Fo(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(o=>dm(o,n)):n.Vue&&dm(n.Vue,n)}}),dm=(e,t)=>{var n;b_&&((n=e._instance)==null?void 0:n.isMounted)===!0&&Fo(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&px(e,t),Ar(t)&&e.mixin(gx(t.tracingOptions))};function wx(e={}){const t={defaultIntegrations:[...f_(),bx()],...e};return Dy(t,"vue"),FC(t)}function Sx(e,t,n){let r=!1;const o="mode"in e;e.onError(s=>Wf(s,{mechanism:{handled:!1}})),e.beforeEach((s,i,...a)=>{const l=r?void 0:Tx(),c={};for(const m of Object.keys(s.params))c[`url.path.parameter.${m}`]=s.params[m],c[`params.${m}`]=s.params[m];for(const m of Object.keys(s.query)){const v=s.query[m];v&&(c[`query.${m}`]=v)}let d=s.path,f="url";if(s.name&&t.routeLabel!=="path")d=s.name.toString(),f="custom";else if(s.matched.length>0){const m=s.matched.length-1;d=s.matched[m].path,f="route"}if($t().setTransactionName(d),t.instrumentPageLoad&&l&&(bt(l).data[Tr]!=="custom"&&(l.updateName(d),l.setAttribute(Tr,f)),l.setAttributes({...c,[Xt]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!l&&n({name:d,op:"navigation",attributes:{...c,[Xt]:"auto.navigation.vue",[Tr]:f}}),o){const m=a[0];typeof m=="function"&&m()}})}function Tx(){const e=ir(),t=e&&Ln(e);return t&&bt(t).op==="pageload"?t:void 0}function Ex(e={}){if(!e.router)return sm(e);const t=sm({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:o=!0,routeLabel:s="name"}=e;return{...t,afterAllSetup(i){t.afterAllSetup(i),Sx(n,{routeLabel:s,instrumentNavigation:r,instrumentPageLoad:o},l=>{v_(i,l)})}}}const kx="modulepreload",Ix=function(e){return"/"+e},fm={},zu=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(c=>{if(c=Ix(c),c in fm)return;fm[c]=!0;const d=c.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":kx,d||(m.as="script"),m.crossOrigin="",m.href=c,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((v,T)=>{m.addEventListener("load",v),m.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};/*!
46
+ * vue-router v4.6.4
47
+ * (c) 2025 Eduardo San Martin Morote
48
+ * @license MIT
49
+ */const ti=typeof document<"u";function w_(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ax(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&w_(e.default)}const It=Object.assign;function Gu(e,t){const n={};for(const r in t){const o=t[r];n[r]=Gr(o)?o.map(e):e(o)}return n}const sa=()=>{},Gr=Array.isArray;function pm(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const S_=/#/g,Cx=/&/g,xx=/\//g,Rx=/=/g,Mx=/\?/g,T_=/\+/g,Px=/%5B/g,$x=/%5D/g,E_=/%5E/g,Nx=/%60/g,k_=/%7B/g,Ox=/%7C/g,I_=/%7D/g,Lx=/%20/g;function tp(e){return e==null?"":encodeURI(""+e).replace(Ox,"|").replace(Px,"[").replace($x,"]")}function Dx(e){return tp(e).replace(k_,"{").replace(I_,"}").replace(E_,"^")}function Qd(e){return tp(e).replace(T_,"%2B").replace(Lx,"+").replace(S_,"%23").replace(Cx,"%26").replace(Nx,"`").replace(k_,"{").replace(I_,"}").replace(E_,"^")}function jx(e){return Qd(e).replace(Rx,"%3D")}function Fx(e){return tp(e).replace(S_,"%23").replace(Mx,"%3F")}function Bx(e){return Fx(e).replace(xx,"%2F")}function Ta(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const qx=/\/$/,Ux=e=>e.replace(qx,"");function Ku(e,t,n="/"){let r,o={},s="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),s=t.slice(l,a>0?a:t.length),o=e(s.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=zx(r??t,n),{fullPath:r+s+i,path:r,query:o,hash:Ta(i)}}function Hx(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function hm(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Wx(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Si(t.matched[r],n.matched[o])&&A_(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Si(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function A_(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Vx(e[n],t[n]))return!1;return!0}function Vx(e,t){return Gr(e)?mm(e,t):Gr(t)?mm(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function mm(e,t){return Gr(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function zx(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let s=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")s>1&&s--;else break;return n.slice(0,s).join("/")+"/"+r.slice(i).join("/")}const Vo={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Zd=(function(e){return e.pop="pop",e.push="push",e})({}),Yu=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Gx(e){if(!e)if(ti){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ux(e)}const Kx=/^[^#]+#/;function Yx(e,t){return e.replace(Kx,"#")+t}function Jx(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const $c=()=>({left:window.scrollX,top:window.scrollY});function Xx(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=Jx(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function gm(e,t){return(history.state?history.state.position-t:-1)+e}const ef=new Map;function Qx(e,t){ef.set(e,t)}function Zx(e){const t=ef.get(e);return ef.delete(e),t}function e1(e){return typeof e=="string"||e&&typeof e=="object"}function C_(e){return typeof e=="string"||typeof e=="symbol"}let Yt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const x_=Symbol("");Yt.MATCHER_NOT_FOUND+"",Yt.NAVIGATION_GUARD_REDIRECT+"",Yt.NAVIGATION_ABORTED+"",Yt.NAVIGATION_CANCELLED+"",Yt.NAVIGATION_DUPLICATED+"";function Ti(e,t){return It(new Error,{type:e,[x_]:!0},t)}function _o(e,t){return e instanceof Error&&x_ in e&&(t==null||!!(e.type&t))}const t1=["params","query","hash"];function n1(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of t1)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function r1(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const o=n[r].replace(T_," "),s=o.indexOf("="),i=Ta(s<0?o:o.slice(0,s)),a=s<0?null:Ta(o.slice(s+1));if(i in t){let l=t[i];Gr(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function vm(e){let t="";for(let n in e){const r=e[n];if(n=jx(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Gr(r)?r.map(o=>o&&Qd(o)):[r&&Qd(r)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+n,o!=null&&(t+="="+o))})}return t}function o1(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Gr(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const s1=Symbol(""),ym=Symbol(""),Nc=Symbol(""),np=Symbol(""),tf=Symbol("");function Gi(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Yo(e,t,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const c=m=>{m===!1?l(Ti(Yt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):e1(m)?l(Ti(Yt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(i&&r.enterCallbacks[o]===i&&typeof m=="function"&&i.push(m),a())},d=s(()=>e.call(r&&r.instances[o],t,n,c));let f=Promise.resolve(d);e.length<3&&(f=f.then(c)),f.catch(m=>l(m))})}function Ju(e,t,n,r,o=s=>s()){const s=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(w_(l)){const c=(l.__vccOpts||l)[t];c&&s.push(Yo(c,n,r,i,a,o))}else{let c=l();s.push(()=>c.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Ax(d)?d.default:d;i.mods[a]=d,i.components[a]=f;const m=(f.__vccOpts||f)[t];return m&&Yo(m,n,r,i,a,o)()}))}}return s}function i1(e,t){const n=[],r=[],o=[],s=Math.max(t.matched.length,e.matched.length);for(let i=0;i<s;i++){const a=t.matched[i];a&&(e.matched.find(c=>Si(c,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(c=>Si(c,l))||o.push(l))}return[n,r,o]}/*!
50
+ * vue-router v4.6.4
51
+ * (c) 2025 Eduardo San Martin Morote
52
+ * @license MIT
53
+ */let a1=()=>location.protocol+"//"+location.host;function R_(e,t){const{pathname:n,search:r,hash:o}=t,s=e.indexOf("#");if(s>-1){let i=o.includes(e.slice(s))?e.slice(s).length:1,a=o.slice(i);return a[0]!=="/"&&(a="/"+a),hm(a,"")}return hm(n,e)+r+o}function l1(e,t,n,r){let o=[],s=[],i=null;const a=({state:m})=>{const v=R_(e,location),T=n.value,k=t.value;let H=0;if(m){if(n.value=v,t.value=m,i&&i===T){i=null;return}H=k?m.position-k.position:0}else r(v);o.forEach(P=>{P(n.value,T,{delta:H,type:Zd.pop,direction:H?H>0?Yu.forward:Yu.back:Yu.unknown})})};function l(){i=n.value}function c(m){o.push(m);const v=()=>{const T=o.indexOf(m);T>-1&&o.splice(T,1)};return s.push(v),v}function d(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(It({},m.state,{scroll:$c()}),"")}}function f(){for(const m of s)m();s=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:l,listen:c,destroy:f}}function _m(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?$c():null}}function c1(e){const{history:t,location:n}=window,r={value:R_(e,n)},o={value:t.state};o.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(l,c,d){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:a1()+e+l;try{t[d?"replaceState":"pushState"](c,"",m),o.value=c}catch(v){console.error(v),n[d?"replace":"assign"](m)}}function i(l,c){s(l,It({},t.state,_m(o.value.back,l,o.value.forward,!0),c,{position:o.value.position}),!0),r.value=l}function a(l,c){const d=It({},o.value,t.state,{forward:l,scroll:$c()});s(d.current,d,!0),s(l,It({},_m(r.value,l,null),{position:d.position+1},c),!1),r.value=l}return{location:r,state:o,push:a,replace:i}}function u1(e){e=Gx(e);const t=c1(e),n=l1(e,t.state,t.location,t.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=It({location:"",base:e,go:r,createHref:Yx.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function d1(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),u1(e)}let Rs=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var dn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(dn||{});const f1={type:Rs.Static,value:""},p1=/[a-zA-Z0-9_]/;function h1(e){if(!e)return[[]];if(e==="/")return[[f1]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${n})/"${c}": ${v}`)}let n=dn.Static,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,l,c="",d="";function f(){c&&(n===dn.Static?s.push({type:Rs.Static,value:c}):n===dn.Param||n===dn.ParamRegExp||n===dn.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:Rs.Param,value:c,regexp:d,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),c="")}function m(){c+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==dn.ParamRegExp){r=n,n=dn.EscapeNext;continue}switch(n){case dn.Static:l==="/"?(c&&f(),i()):l===":"?(f(),n=dn.Param):m();break;case dn.EscapeNext:m(),n=r;break;case dn.Param:l==="("?n=dn.ParamRegExp:p1.test(l)?m():(f(),n=dn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case dn.ParamRegExp:l===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+l:n=dn.ParamRegExpEnd:d+=l;break;case dn.ParamRegExpEnd:f(),n=dn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,d="";break;default:t("Unknown state");break}}return n===dn.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),f(),i(),o}const bm="[^/]+?",m1={sensitive:!1,strict:!1,start:!0,end:!0};var Gn=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(Gn||{});const g1=/[.+*?^${}()[\]/\\]/g;function v1(e,t){const n=It({},m1,t),r=[];let o=n.start?"^":"";const s=[];for(const c of e){const d=c.length?[]:[Gn.Root];n.strict&&!c.length&&(o+="/");for(let f=0;f<c.length;f++){const m=c[f];let v=Gn.Segment+(n.sensitive?Gn.BonusCaseSensitive:0);if(m.type===Rs.Static)f||(o+="/"),o+=m.value.replace(g1,"\\$&"),v+=Gn.Static;else if(m.type===Rs.Param){const{value:T,repeatable:k,optional:H,regexp:P}=m;s.push({name:T,repeatable:k,optional:H});const O=P||bm;if(O!==bm){v+=Gn.BonusCustomRegExp;try{`${O}`}catch(Y){throw new Error(`Invalid custom RegExp for param "${T}" (${O}): `+Y.message)}}let W=k?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(W=H&&c.length<2?`(?:/${W})`:"/"+W),H&&(W+="?"),o+=W,v+=Gn.Dynamic,H&&(v+=Gn.BonusOptional),k&&(v+=Gn.BonusRepeatable),O===".*"&&(v+=Gn.BonusWildcard)}d.push(v)}r.push(d)}if(n.strict&&n.end){const c=r.length-1;r[c][r[c].length-1]+=Gn.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(c){const d=c.match(i),f={};if(!d)return null;for(let m=1;m<d.length;m++){const v=d[m]||"",T=s[m-1];f[T.name]=v&&T.repeatable?v.split("/"):v}return f}function l(c){let d="",f=!1;for(const m of e){(!f||!d.endsWith("/"))&&(d+="/"),f=!1;for(const v of m)if(v.type===Rs.Static)d+=v.value;else if(v.type===Rs.Param){const{value:T,repeatable:k,optional:H}=v,P=T in c?c[T]:"";if(Gr(P)&&!k)throw new Error(`Provided param "${T}" is an array but it is not repeatable (* or + modifiers)`);const O=Gr(P)?P.join("/"):P;if(!O)if(H)m.length<2&&(d.endsWith("/")?d=d.slice(0,-1):f=!0);else throw new Error(`Missing required param "${T}"`);d+=O}}return d||"/"}return{re:i,score:r,keys:s,parse:a,stringify:l}}function y1(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Gn.Static+Gn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Gn.Static+Gn.Segment?1:-1:0}function M_(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const s=y1(r[n],o[n]);if(s)return s;n++}if(Math.abs(o.length-r.length)===1){if(wm(r))return 1;if(wm(o))return-1}return o.length-r.length}function wm(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const _1={strict:!1,end:!0,sensitive:!1};function b1(e,t,n){const r=v1(h1(e.path),n),o=It(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function w1(e,t){const n=[],r=new Map;t=pm(_1,t);function o(f){return r.get(f)}function s(f,m,v){const T=!v,k=Tm(f);k.aliasOf=v&&v.record;const H=pm(t,f),P=[k];if("alias"in f){const Y=typeof f.alias=="string"?[f.alias]:f.alias;for(const ce of Y)P.push(Tm(It({},k,{components:v?v.record.components:k.components,path:ce,aliasOf:v?v.record:k})))}let O,W;for(const Y of P){const{path:ce}=Y;if(m&&ce[0]!=="/"){const re=m.record.path,Z=re[re.length-1]==="/"?"":"/";Y.path=m.record.path+(ce&&Z+ce)}if(O=b1(Y,m,H),v?v.alias.push(O):(W=W||O,W!==O&&W.alias.push(O),T&&f.name&&!Em(O)&&i(f.name)),P_(O)&&l(O),k.children){const re=k.children;for(let Z=0;Z<re.length;Z++)s(re[Z],O,v&&v.children[Z])}v=v||O}return W?()=>{i(W)}:sa}function i(f){if(C_(f)){const m=r.get(f);m&&(r.delete(f),n.splice(n.indexOf(m),1),m.children.forEach(i),m.alias.forEach(i))}else{const m=n.indexOf(f);m>-1&&(n.splice(m,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const m=E1(f,n);n.splice(m,0,f),f.record.name&&!Em(f)&&r.set(f.record.name,f)}function c(f,m){let v,T={},k,H;if("name"in f&&f.name){if(v=r.get(f.name),!v)throw Ti(Yt.MATCHER_NOT_FOUND,{location:f});H=v.record.name,T=It(Sm(m.params,v.keys.filter(W=>!W.optional).concat(v.parent?v.parent.keys.filter(W=>W.optional):[]).map(W=>W.name)),f.params&&Sm(f.params,v.keys.map(W=>W.name))),k=v.stringify(T)}else if(f.path!=null)k=f.path,v=n.find(W=>W.re.test(k)),v&&(T=v.parse(k),H=v.record.name);else{if(v=m.name?r.get(m.name):n.find(W=>W.re.test(m.path)),!v)throw Ti(Yt.MATCHER_NOT_FOUND,{location:f,currentLocation:m});H=v.record.name,T=It({},m.params,f.params),k=v.stringify(T)}const P=[];let O=v;for(;O;)P.unshift(O.record),O=O.parent;return{name:H,path:k,params:T,matched:P,meta:T1(P)}}e.forEach(f=>s(f));function d(){n.length=0,r.clear()}return{addRoute:s,resolve:c,removeRoute:i,clearRoutes:d,getRoutes:a,getRecordMatcher:o}}function Sm(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Tm(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:S1(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function S1(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Em(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function T1(e){return e.reduce((t,n)=>It(t,n.meta),{})}function E1(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;M_(e,t[s])<0?r=s:n=s+1}const o=k1(e);return o&&(r=t.lastIndexOf(o,r-1)),r}function k1(e){let t=e;for(;t=t.parent;)if(P_(t)&&M_(e,t)===0)return t}function P_({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function km(e){const t=Hr(Nc),n=Hr(np),r=se(()=>{const l=He(e.to);return t.resolve(l)}),o=se(()=>{const{matched:l}=r.value,{length:c}=l,d=l[c-1],f=n.matched;if(!d||!f.length)return-1;const m=f.findIndex(Si.bind(null,d));if(m>-1)return m;const v=Im(l[c-2]);return c>1&&Im(d)===v&&f[f.length-1].path!==v?f.findIndex(Si.bind(null,l[c-2])):m}),s=se(()=>o.value>-1&&R1(n.params,r.value.params)),i=se(()=>o.value>-1&&o.value===n.matched.length-1&&A_(n.params,r.value.params));function a(l={}){if(x1(l)){const c=t[He(e.replace)?"replace":"push"](He(e.to)).catch(sa);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:r,href:se(()=>r.value.href),isActive:s,isExactActive:i,navigate:a}}function I1(e){return e.length===1?e[0]:e}const A1=An({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:km,setup(e,{slots:t}){const n=vc(km(e)),{options:r}=Hr(Nc),o=se(()=>({[Am(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Am(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&I1(t.default(n));return e.custom?s:Rf("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),C1=A1;function x1(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function R1(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!Gr(o)||o.length!==r.length||r.some((s,i)=>s.valueOf()!==o[i].valueOf()))return!1}return!0}function Im(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Am=(e,t,n)=>e??t??n,M1=An({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Hr(tf),o=se(()=>e.route||r.value),s=Hr(ym,0),i=se(()=>{let c=He(s);const{matched:d}=o.value;let f;for(;(f=d[c])&&!f.components;)c++;return c}),a=se(()=>o.value.matched[i.value]);Cl(ym,se(()=>i.value+1)),Cl(s1,a),Cl(tf,o);const l=j();return lt(()=>[l.value,a.value,e.name],([c,d,f],[m,v,T])=>{d&&(d.instances[f]=c,v&&v!==d&&c&&c===m&&(d.leaveGuards.size||(d.leaveGuards=v.leaveGuards),d.updateGuards.size||(d.updateGuards=v.updateGuards))),c&&d&&(!v||!Si(d,v)||!m)&&(d.enterCallbacks[f]||[]).forEach(k=>k(c))},{flush:"post"}),()=>{const c=o.value,d=e.name,f=a.value,m=f&&f.components[d];if(!m)return Cm(n.default,{Component:m,route:c});const v=f.props[d],T=v?v===!0?c.params:typeof v=="function"?v(c):v:null,H=Rf(m,It({},T,t,{onVnodeUnmounted:P=>{P.component.isUnmounted&&(f.instances[d]=null)},ref:l}));return Cm(n.default,{Component:H,route:c})||H}}});function Cm(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const P1=M1;function $1(e){const t=w1(e.routes,e),n=e.parseQuery||r1,r=e.stringifyQuery||vm,o=e.history,s=Gi(),i=Gi(),a=Gi(),l=lw(Vo);let c=Vo;ti&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=Gu.bind(null,J=>""+J),f=Gu.bind(null,Bx),m=Gu.bind(null,Ta);function v(J,be){let we,ve;return C_(J)?(we=t.getRecordMatcher(J),ve=be):ve=J,t.addRoute(ve,we)}function T(J){const be=t.getRecordMatcher(J);be&&t.removeRoute(be)}function k(){return t.getRoutes().map(J=>J.record)}function H(J){return!!t.getRecordMatcher(J)}function P(J,be){if(be=It({},be||l.value),typeof J=="string"){const q=Ku(n,J,be.path),Q=t.resolve({path:q.path},be),ee=o.createHref(q.fullPath);return It(q,Q,{params:m(Q.params),hash:Ta(q.hash),redirectedFrom:void 0,href:ee})}let we;if(J.path!=null)we=It({},J,{path:Ku(n,J.path,be.path).path});else{const q=It({},J.params);for(const Q in q)q[Q]==null&&delete q[Q];we=It({},J,{params:f(q)}),be.params=f(be.params)}const ve=t.resolve(we,be),Ze=J.hash||"";ve.params=d(m(ve.params));const E=Hx(r,It({},J,{hash:Dx(Ze),path:ve.path})),I=o.createHref(E);return It({fullPath:E,hash:Ze,query:r===vm?o1(J.query):J.query||{}},ve,{redirectedFrom:void 0,href:I})}function O(J){return typeof J=="string"?Ku(n,J,l.value.path):It({},J)}function W(J,be){if(c!==J)return Ti(Yt.NAVIGATION_CANCELLED,{from:be,to:J})}function Y(J){return Z(J)}function ce(J){return Y(It(O(J),{replace:!0}))}function re(J,be){const we=J.matched[J.matched.length-1];if(we&&we.redirect){const{redirect:ve}=we;let Ze=typeof ve=="function"?ve(J,be):ve;return typeof Ze=="string"&&(Ze=Ze.includes("?")||Ze.includes("#")?Ze=O(Ze):{path:Ze},Ze.params={}),It({query:J.query,hash:J.hash,params:Ze.path!=null?{}:J.params},Ze)}}function Z(J,be){const we=c=P(J),ve=l.value,Ze=J.state,E=J.force,I=J.replace===!0,q=re(we,ve);if(q)return Z(It(O(q),{state:typeof q=="object"?It({},Ze,q.state):Ze,force:E,replace:I}),be||we);const Q=we;Q.redirectedFrom=be;let ee;return!E&&Wx(r,ve,we)&&(ee=Ti(Yt.NAVIGATION_DUPLICATED,{to:Q,from:ve}),Re(ve,ve,!0,!1)),(ee?Promise.resolve(ee):Ae(Q,ve)).catch(te=>_o(te)?_o(te,Yt.NAVIGATION_GUARD_REDIRECT)?te:Be(te):fe(te,Q,ve)).then(te=>{if(te){if(_o(te,Yt.NAVIGATION_GUARD_REDIRECT))return Z(It({replace:I},O(te.to),{state:typeof te.to=="object"?It({},Ze,te.to.state):Ze,force:E}),be||Q)}else te=V(Q,ve,!0,I,Ze);return ue(Q,ve,te),te})}function he(J,be){const we=W(J,be);return we?Promise.reject(we):Promise.resolve()}function Ce(J){const be=nt.values().next().value;return be&&typeof be.runWithContext=="function"?be.runWithContext(J):J()}function Ae(J,be){let we;const[ve,Ze,E]=i1(J,be);we=Ju(ve.reverse(),"beforeRouteLeave",J,be);for(const q of ve)q.leaveGuards.forEach(Q=>{we.push(Yo(Q,J,be))});const I=he.bind(null,J,be);return we.push(I),Ke(we).then(()=>{we=[];for(const q of s.list())we.push(Yo(q,J,be));return we.push(I),Ke(we)}).then(()=>{we=Ju(Ze,"beforeRouteUpdate",J,be);for(const q of Ze)q.updateGuards.forEach(Q=>{we.push(Yo(Q,J,be))});return we.push(I),Ke(we)}).then(()=>{we=[];for(const q of E)if(q.beforeEnter)if(Gr(q.beforeEnter))for(const Q of q.beforeEnter)we.push(Yo(Q,J,be));else we.push(Yo(q.beforeEnter,J,be));return we.push(I),Ke(we)}).then(()=>(J.matched.forEach(q=>q.enterCallbacks={}),we=Ju(E,"beforeRouteEnter",J,be,Ce),we.push(I),Ke(we))).then(()=>{we=[];for(const q of i.list())we.push(Yo(q,J,be));return we.push(I),Ke(we)}).catch(q=>_o(q,Yt.NAVIGATION_CANCELLED)?q:Promise.reject(q))}function ue(J,be,we){a.list().forEach(ve=>Ce(()=>ve(J,be,we)))}function V(J,be,we,ve,Ze){const E=W(J,be);if(E)return E;const I=be===Vo,q=ti?history.state:{};we&&(ve||I?o.replace(J.fullPath,It({scroll:I&&q&&q.scroll},Ze)):o.push(J.fullPath,Ze)),l.value=J,Re(J,be,we,I),Be()}let ae;function xe(){ae||(ae=o.listen((J,be,we)=>{if(!st.listening)return;const ve=P(J),Ze=re(ve,st.currentRoute.value);if(Ze){Z(It(Ze,{replace:!0,force:!0}),ve).catch(sa);return}c=ve;const E=l.value;ti&&Qx(gm(E.fullPath,we.delta),$c()),Ae(ve,E).catch(I=>_o(I,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_CANCELLED)?I:_o(I,Yt.NAVIGATION_GUARD_REDIRECT)?(Z(It(O(I.to),{force:!0}),ve).then(q=>{_o(q,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_DUPLICATED)&&!we.delta&&we.type===Zd.pop&&o.go(-1,!1)}).catch(sa),Promise.reject()):(we.delta&&o.go(-we.delta,!1),fe(I,ve,E))).then(I=>{I=I||V(ve,E,!1),I&&(we.delta&&!_o(I,Yt.NAVIGATION_CANCELLED)?o.go(-we.delta,!1):we.type===Zd.pop&&_o(I,Yt.NAVIGATION_ABORTED|Yt.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),ue(ve,E,I)}).catch(sa)}))}let Fe=Gi(),_e=Gi(),Me;function fe(J,be,we){Be(J);const ve=_e.list();return ve.length?ve.forEach(Ze=>Ze(J,be,we)):console.error(J),Promise.reject(J)}function De(){return Me&&l.value!==Vo?Promise.resolve():new Promise((J,be)=>{Fe.add([J,be])})}function Be(J){return Me||(Me=!J,xe(),Fe.list().forEach(([be,we])=>J?we(J):be()),Fe.reset()),J}function Re(J,be,we,ve){const{scrollBehavior:Ze}=e;if(!ti||!Ze)return Promise.resolve();const E=!we&&Zx(gm(J.fullPath,0))||(ve||!we)&&history.state&&history.state.scroll||null;return Jt().then(()=>Ze(J,be,E)).then(I=>I&&Xx(I)).catch(I=>fe(I,J,be))}const Ge=J=>o.go(J);let ot;const nt=new Set,st={currentRoute:l,listening:!0,addRoute:v,removeRoute:T,clearRoutes:t.clearRoutes,hasRoute:H,getRoutes:k,resolve:P,options:e,push:Y,replace:ce,go:Ge,back:()=>Ge(-1),forward:()=>Ge(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:_e.add,isReady:De,install(J){J.component("RouterLink",C1),J.component("RouterView",P1),J.config.globalProperties.$router=st,Object.defineProperty(J.config.globalProperties,"$route",{enumerable:!0,get:()=>He(l)}),ti&&!ot&&l.value===Vo&&(ot=!0,Y(o.location).catch(ve=>{}));const be={};for(const ve in Vo)Object.defineProperty(be,ve,{get:()=>l.value[ve],enumerable:!0});J.provide(Nc,st),J.provide(np,qg(be)),J.provide(tf,l);const we=J.unmount;nt.add(J),J.unmount=function(){nt.delete(J),nt.size<1&&(c=Vo,ae&&ae(),ae=null,l.value=Vo,ot=!1,Me=!1),we()}}};function Ke(J){return J.reduce((be,we)=>be.then(()=>Ce(we)),Promise.resolve())}return st}function N1(){return Hr(Nc)}function O1(e){return Hr(np)}const xm=768;function rp(){const e=j(typeof window<"u"?window.innerWidth<xm:!1);let t=null;function n(r){e.value=r.matches}return as(()=>{t=window.matchMedia(`(max-width: ${xm-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),_c(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const L1={key:0,class:"desktop-sidebar"},D1={class:"desktop-main"},Rm="codex-web-local.sidebar-width.v1",j1=260,F1=620,Mm=320,B1=An({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=rp();function r(c){return Math.min(F1,Math.max(j1,c))}function o(){if(typeof window>"u")return Mm;const c=window.localStorage.getItem(Rm),d=Number(c);return Number.isFinite(d)?r(d):Mm}const s=j(o()),i=se(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${s.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(c){typeof window>"u"||window.localStorage.setItem(Rm,String(c))}function l(c){c.preventDefault();const d=c.clientX,f=s.value,m=T=>{const k=T.clientX-d;s.value=r(f+k)},v=()=>{a(s.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",v)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",v)}return(c,d)=>(A(),L("div",{class:pt(["desktop-layout",{"is-mobile":He(n)}]),style:ko(i.value)},[He(n)?(A(),yt(xl,{key:0,to:"body"},[ze(Mv,{name:"drawer"},{default:kt(()=>[e.isSidebarCollapsed?Se("",!0):(A(),L("div",{key:0,class:"mobile-drawer-backdrop",onClick:d[1]||(d[1]=f=>c.$emit("close-sidebar"))},[y("aside",{class:"mobile-drawer",onClick:d[0]||(d[0]=_t(()=>{},["stop"]))},[co(c.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):Se("",!0),He(n)?Se("",!0):(A(),L(Xe,{key:1},[e.isSidebarCollapsed?Se("",!0):(A(),L("aside",L1,[co(c.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?Se("",!0):(A(),L("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),y("section",D1,[co(c.$slots,"content",{},void 0)])],6))}}),Et=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},q1=Et(B1,[["__scopeId","data-v-4c6dbcd7"]]);function Pm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class xo extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function op(e,t){const n=Pm(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=Pm(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:t}function Do(e,t,n){return e instanceof xo?e:e instanceof Error?new xo(e.message||t,{code:"unknown_error",method:n}):new xo(t,{code:"unknown_error",method:n})}function $_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function U1(e,t){const n={method:e,params:t??null};return Dd({name:`rpc ${e}`,op:"rpc.client"},async()=>{let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new xo(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let o=null;try{o=await r.json()}catch{o=null}if(!r.ok)throw new xo(op(o,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const s=o;if(!s||typeof s!="object"||!("result"in s))throw new xo(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result})}function H1(e){const t=$_(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function $m(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function W1(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null,o=0;const s=()=>{r!==null&&(window.clearTimeout(r),r=null)},i=(d,f)=>{if(n||r!==null)return;const m=Math.min(1e3*2**f,1e4);r=window.setTimeout(()=>{r=null,!n&&d()},m)},a=d=>{const f=H1(d);f&&e(f)},l=(d=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const f=new EventSource("/codex-api/events");let m=!1;f.onmessage=v=>{try{a(JSON.parse(v.data))}catch{}},f.addEventListener("ready",v=>{try{const T=v.data?JSON.parse(v.data):{ok:!0};$m(e,T)}catch{$m(e)}}),f.onerror=()=>{n||m||f.readyState===EventSource.CLOSED&&(m=!0,f.close(),i(()=>l(d+1),d))},t=()=>{m=!0,f.close()}},c=(d=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const f=window.location.protocol==="https:"?"wss:":"ws:",m=new WebSocket(`${f}//${window.location.host}/codex-api/ws`);let v=!1,T=!1,k=window.setTimeout(()=>{v||n||T||(T=!0,m.close(),l())},2500);m.onopen=()=>{v=!0,s(),k!==null&&(window.clearTimeout(k),k=null),pr({category:"ws",message:"WebSocket connected",level:"info"})},m.onmessage=H=>{try{a(JSON.parse(String(H.data)))}catch{}},m.onerror=()=>{},m.onclose=()=>{if(k!==null&&(window.clearTimeout(k),k=null),!(n||T)){if(o++,pr({category:"ws",message:`WebSocket closed (attempt ${d})`,data:{totalReconnects:o},level:"warning"}),kE("ws_reconnects",o),!v){l();return}i(()=>c(d+1),d)}},t=()=>{T=!0,k!==null&&(window.clearTimeout(k),k=null),m.close()}};return typeof WebSocket<"u"?c():l(),()=>{n=!0,s(),t==null||t()}}async function V1(e){let t;try{t=await fetch("/codex-api/server-requests/respond",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(r){throw new xo(r instanceof Error?r.message:"Failed to reply to server request",{code:"network_error",method:"server-requests/respond"})}let n=null;try{n=await t.json()}catch{n=null}if(!t.ok)throw new xo(op(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function z1(){const e=await fetch("/codex-api/server-requests/pending");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new xo(op(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=$_(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function G1(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function nn(e){return G1(e)}function K1(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function Y1(e){const t=nn(e).replace(/[\\/]+/gu,"/");return K1(t)?t.toLowerCase():t}function ni(e){const t=nn(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function Xu(e){const t=nn(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function Ha(e){return ni(e)||nn(e)||"unknown-project"}function Nm(e){return new Date(e*1e3).toISOString()}function J1(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const X1=/^##\s+(.+?):\s+(.+?)\s*$/,Q1=/^#\s*files mentioned by the user\s*:?\s*$/i;function Z1(e){var o,s;const t=e.split(`
54
+ `).findIndex(i=>Q1.test(i.trim()));if(t<0)return[];const n=e.split(`
55
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(X1);if(!l)break;const c=(o=l[1])==null?void 0:o.trim(),d=(s=l[2])==null?void 0:s.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");c&&d&&r.push({label:c,path:d})}return r}function eR(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const o=r.index+r[0].length;return e.slice(o).trim()}function tR(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],o=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&o.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:J1(l),isUnhandled:!0});const s=n.join(`
56
+ `),i=Z1(s);return{text:eR(s),images:r,fileAttachments:i,rawBlocks:o}}function nR(e){var s;const t=e.replace(/\r\n/g,`
57
+ `).trim();if(!t)return null;const n=t.split(`
58
+ `),r=[],o=[];for(const i of n){const a=i.trim();if(!a){r.length===0&&o.push("");continue}const l=a.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(l){const c=(l[1]??" ").toLowerCase(),d=(s=l[2])==null?void 0:s.trim();if(!d)continue;let f="pending";c==="x"&&(f="completed"),(c==="~"||c===">"||c==="-")&&(f="inProgress"),r.push({step:d,status:f});continue}o.push(a)}return r.length===0?null:{explanation:o.join(`
59
+ `).trim()||void 0,steps:r}}function Om(e){if(!e)return 0;const t=e.replace(/\r\n/g,`
60
+ `),n=t.endsWith(`
61
+ `)?t.slice(0,-1):t;return n?n.split(`
62
+ `).length:0}function rR(e){let t=0,n=0;for(const r of e.replace(/\r\n/g,`
63
+ `).split(`
64
+ `))if(r&&!(r.startsWith("+++")||r.startsWith("---")||r.startsWith("@@"))){if(r.startsWith("+")){t+=1;continue}r.startsWith("-")&&(n+=1)}return{addedLineCount:t,removedLineCount:n}}function N_(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function O_(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const o=r,s=typeof o.path=="string"?o.path:"",i=typeof o.diff=="string"?o.diff:"",a=o.kind,l=a==null?void 0:a.type;if(!s||l!=="add"&&l!=="delete"&&l!=="update")continue;const c=l==="update"&&typeof(a==null?void 0:a.move_path)=="string"?a.move_path:null,d=l==="update"?rR(i):l==="add"?{addedLineCount:Om(i),removedLineCount:0}:{addedLineCount:0,removedLineCount:Om(i)};n.push({path:s,operation:l,movedToPath:c,diff:i,...d})}return n}function oR(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=tR(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="plan"){const t=typeof e.text=="string"?e.text:"";return[{id:e.id,role:"assistant",text:t,messageType:"plan",plan:nR(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=sR(t.status),r=typeof t.command=="string"?t.command:"",o=typeof t.cwd=="string"?t.cwd:null,s=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:o,status:n,aggregatedOutput:s,exitCode:i}}]}if(e.type==="fileChange"){const t=O_(e.changes),n=N_(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function sR(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function iR(e){const t=e,n=[t.name,t.title,e.preview];for(const r of n)if(typeof r=="string"&&r.trim().length>0)return r.trim();return""}function aR(e){const t=iR(e);return t.length>0?t:"Untitled thread"}function sp(e){return(e==null?void 0:e.status)==="inProgress"}function lR(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return sp(r)}function cR(e){const t=e,n=nn(typeof t.cwd=="string"?t.cwd:e.cwd),r=Y1(n),o=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||r.includes("/.codex/worktrees/")||r.includes("/.git/worktrees/");return{id:e.id,title:aR(e),projectName:Ha(n),cwd:n,hasWorktree:o,createdAtIso:Nm(e.createdAt),updatedAtIso:Nm(e.updatedAt),preview:e.preview,unread:!1,inProgress:lR(e)}}function uR(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((o,s)=>new Date(s.updatedAtIso).getTime()-new Date(o.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const o=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-o})}function dR(e){const t=e.data.map(cR);return uR(t)}function Oc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const o=t[r],s=typeof(o==null?void 0:o.id)=="string"?o.id:void 0,i=Array.isArray(o.items)?o.items:[];for(const a of i)for(const l of oR(a))n.push({...l,turnId:s,turnIndex:r})}return n}function fR(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return sp(t.at(-1))}function L_(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(sp(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const pR=5e3;function Qu(e){return e&&e.length>0?e:null}function Zu(e){return e&&e.length>0?e:null}const Lm=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function Dm(e,t){const n=t.trim();if(!n)return"";const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),[o="",s=""]=e.split("/",2),i=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=o&&s?`${i}\\s*/\\s*${a}`:r;return n.replace(/^[★☆*\s:|\-]+/u,"").replace(/^(sponsor|star)\s+/i,"").replace(new RegExp(`^${r}\\s*[-:|]*\\s*`,"i"),"").replace(new RegExp(`^${l}\\s*[-:|]*\\s*`,"i"),"").replace(/^(sponsor|star)\s+/i,"").trim()}function Tn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function ht(e){return typeof e=="string"&&e.length>0?e:null}function Nn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function sc(e){return typeof e=="boolean"?e:null}function hR(e){return e==="payment_required"?e:null}function mR(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function jm(e){const t=Tn(e);if(!t)return null;const n=Nn(t.usedPercent??t.used_percent);if(n===null)return null;const r=Nn(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:Nn(t.resetsAt??t.resets_at)}}function gR(e){const t=Tn(e);if(!t)return null;const n=sc(t.hasCredits??t.has_credits),r=sc(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:ht(t.balance)}}function nf(e){const t=Tn(e);if(!t)return null;const n=jm(t.primary),r=jm(t.secondary),o=gR(t.credits);return!n&&!r&&!o?null:{limitId:ht(t.limitId??t.limit_id),limitName:ht(t.limitName??t.limit_name),primary:n,secondary:r,credits:o,planType:ht(t.planType??t.plan_type)}}function D_(e,t=null){const n=Tn(e);if(!n)return null;const r=ht(n.accountId),o=ht(n.quotaStatus),s=o==="loading"||o==="ready"||o==="error"?o:"idle";return r?{accountId:r,authMode:ht(n.authMode),email:ht(n.email),planType:ht(n.planType),lastRefreshedAtIso:ht(n.lastRefreshedAtIso)??"",lastActivatedAtIso:ht(n.lastActivatedAtIso),quotaSnapshot:nf(n.quotaSnapshot),quotaUpdatedAtIso:ht(n.quotaUpdatedAtIso),quotaStatus:s,quotaError:ht(n.quotaError),unavailableReason:hR(n.unavailableReason)??(mR(ht(n.quotaError))?"payment_required":null),isActive:sc(n.isActive)??r===t}:null}function j_(e){const t=Tn(e);if(!t)return null;const n=Tn(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=nf(n==null?void 0:n.codex);return r||nf(t.rateLimits??t.rate_limits)}async function sn(e,t){try{return await U1(e,t)}catch(n){throw Do(n,`RPC ${e} failed`,e)}}function F_(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n={};for(let r=0;r<t.length;r+=1){const o=t[r];typeof(o==null?void 0:o.id)!="string"||o.id.length===0||(n[o.id]=r)}return n}function vR(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function yR(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function _R(){const e=await sn("thread/list",{archived:!1,limit:100,sortKey:"updated_at",modelProviders:[]});return dR(e)}async function bR(e){try{const t=await fetch(`/codex-api/thread-live-state?threadId=${encodeURIComponent(e)}`);return t.ok?await t.json():null}catch{return null}}function wR(e){const t=e.conversationState;if(!t||!Array.isArray(t.turns)||t.turns.length===0)return null;const n={thread:{id:e.threadId,turns:t.turns}};return{messages:Oc(n),inProgress:e.isInProgress,activeTurnId:L_(n),turnIndexByTurnId:F_(n)}}async function SR(e){const t=await bR(e);if(t&&!t.liveStateError){const o=wR(t);if(o&&o.messages.length>0)return o}const n=await sn("thread/read",{threadId:e,includeTurns:!0});return{messages:Oc(n),inProgress:fR(n),activeTurnId:L_(n),turnIndexByTurnId:F_(n)}}async function TR(){try{return await _R()}catch(e){throw Do(e,"Failed to load thread groups","thread/list")}}async function Fm(e){try{return await SR(e)}catch(t){throw Do(t,`Failed to load thread ${e}`,"thread/read")}}function ER(e){const t=Tn(e);if(!t)return null;const n=ht(t.key),r=typeof t.text=="string"?t.text:"",o=ht(t.kind);return!n||!o||o!=="meta"&&o!=="hunk"&&o!=="add"&&o!=="remove"&&o!=="context"?null:{key:n,kind:o,text:r,oldLine:Nn(t.oldLine),newLine:Nn(t.newLine)}}function kR(e){const t=Tn(e);if(!t)return null;const n=ht(t.id),r=typeof t.header=="string"?t.header:"",o=typeof t.patch=="string"?t.patch:"";return n?{id:n,header:r,patch:o,addedLineCount:Nn(t.addedLineCount)??0,removedLineCount:Nn(t.removedLineCount)??0,oldStart:Nn(t.oldStart),oldLineCount:Nn(t.oldLineCount)??0,newStart:Nn(t.newStart),newLineCount:Nn(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(s=>ER(s)).filter(s=>s!==null):[]}:null}function IR(e){const t=Tn(e);if(!t)return null;const n=ht(t.id),r=ht(t.path),o=ht(t.absolutePath),s=ht(t.operation);return!n||!r||!o||!s||s!=="add"&&s!=="delete"&&s!=="update"&&s!=="rename"?null:{id:n,path:r,absolutePath:o,previousPath:ht(t.previousPath),previousAbsolutePath:ht(t.previousAbsolutePath),operation:s,addedLineCount:Nn(t.addedLineCount)??0,removedLineCount:Nn(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(i=>kR(i)).filter(i=>i!==null):[]}}function B_(e){const t=Tn(e),n=Tn(t==null?void 0:t.data),r=Tn(n==null?void 0:n.summary),o=ht(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",s=ht(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:ht(n==null?void 0:n.cwd)??"",gitRoot:ht(n==null?void 0:n.gitRoot),isGitRepo:sc(n==null?void 0:n.isGitRepo)??!1,scope:o,workspaceView:s,baseBranch:ht(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(i=>ht(i)).filter(i=>typeof i=="string"&&i.length>0):[],headBranch:ht(n==null?void 0:n.headBranch),mergeBaseSha:ht(n==null?void 0:n.mergeBaseSha),generatedAtIso:ht(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:Nn(r==null?void 0:r.fileCount)??0,addedLineCount:Nn(r==null?void 0:r.addedLineCount)??0,removedLineCount:Nn(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(i=>IR(i)).filter(i=>i!==null):[]}}function AR(e){var r;const t=e.trim();if(!t)return{absolutePath:null,startLine:null,endLine:null};const n=t.match(/^(.*?):(\d+)-(\d+)$/u);return n?{absolutePath:((r=n[1])==null?void 0:r.trim())||null,startLine:Number(n[2]),endLine:Number(n[3])}:{absolutePath:t||null,startLine:null,endLine:null}}function CR(e){var i;const t=e.replace(/\r\n/g,`
65
+ `).trim();if(!t)return{reviewText:"",summary:"",findings:[]};const n=t.search(/\n(?:Full review comments|Review comment):\n/iu),r=n>=0?t.slice(0,n).trim():t,o=n>=0?t.slice(n).trim():"",s=[];if(o){const l=o.replace(/^(?:Full review comments|Review comment):\n*/iu,"").trim().matchAll(/^- (.+?) — (.+)\n?((?: .*(?:\n|$))*)/gmu);let c=0;for(const d of l){const f=((i=d[1])==null?void 0:i.trim())??"",m=AR(d[2]??""),v=(d[0]??"").trim(),T=(d[3]??"").split(`
66
+ `).map(k=>k.replace(/^ /u,"")).join(`
67
+ `).trim();s.push({id:`finding:${c}`,title:f||`Finding ${c+1}`,body:T,path:m.absolutePath?m.absolutePath.split("/").filter(Boolean).slice(-1)[0]??m.absolutePath:null,absolutePath:m.absolutePath,startLine:m.startLine,endLine:m.endLine,rawText:v}),c+=1}}return{reviewText:t,summary:r,findings:s}}function Bm(e,t){const n=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let r=n.length-1;r>=0;r-=1){const o=n[r],s=Array.isArray(o==null?void 0:o.items)?o.items:[];for(let i=s.length-1;i>=0;i-=1){const a=s[i];if((a==null?void 0:a.type)!==t)continue;const l=typeof a.review=="string"?a.review.trim():"";if(l)return l}}return null}async function i2(e){const t=await sn("thread/read",{threadId:e,includeTurns:!0}),n=Bm(t,"exitedReviewMode");return{enteredReviewLabel:Bm(t,"enteredReviewMode"),result:n?CR(n):null}}function xR(e){return W1(e)}async function RR(e,t){await V1({id:e,...t})}async function MR(){return z1()}async function qm(){try{const e=await sn("account/rateLimits/read");return j_(e)}catch(e){throw Do(e,"Failed to load account rate limits","account/rateLimits/read")}}function ip(e){const t=Tn(e),n=ht(t==null?void 0:t.activeAccountId),r=Array.isArray(t==null?void 0:t.accounts)?t==null?void 0:t.accounts:[];return{activeAccountId:n,importedAccountId:ht(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(o=>D_(o,n)).filter(o=>o!==null)}}async function PR(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(Jn(t,"Failed to load accounts"));const n=Tn(t);return ip(n==null?void 0:n.data)}async function $R(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(Jn(t,"Failed to refresh accounts"));const n=Tn(t);return ip(n==null?void 0:n.data)}async function NR(e){const t=await fetch("/codex-api/accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Jn(n,"Failed to switch account"));const r=Tn(n),o=Tn(r==null?void 0:r.data),s=D_(o==null?void 0:o.account,ht(o==null?void 0:o.activeAccountId));if(!s)throw new Error("Failed to switch account");return s}async function OR(e){const t=await fetch("/codex-api/accounts/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(Jn(n,"Failed to remove account"));const r=Tn(n);return ip(r==null?void 0:r.data)}async function ed(e){const t=await sn("thread/resume",{threadId:e});return{model:ic(t)}}async function LR(e){await sn("thread/archive",{threadId:e})}async function DR(e,t){await sn("thread/name/set",{threadId:e,name:t})}async function td(e,t){const n=await sn("thread/rollback",{threadId:e,numTurns:t});return Oc(n)}async function jR(e,t,n){try{const r=await fetch("/codex-api/thread/rollback-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadId:e,turnId:t,cwd:n})});return r.ok?await r.json():{reverted:0,errors:["Server error"]}}catch{return{reverted:0,errors:["Network error"]}}}function rf(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}function FR(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.cwd;if(typeof r=="string"&&r.length>0)return r}return""}function ic(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function Um(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await sn("thread/start",n),o=rf(r);if(!o)throw new Error("thread/start did not return a thread id");return{threadId:o,model:ic(r)}}catch(n){throw Do(n,"Failed to start a new thread","thread/start")}}async function Hm(e,t,n){if(arguments.length<=1)try{const r=await sn("thread/fork",{threadId:e,persistExtendedHistory:!0}),o=rf(r);if(!o)throw new Error("thread/fork did not return a thread id");return{threadId:o,cwd:FR(r),model:ic(r),messages:Oc(r)}}catch(r){throw Do(r,`Failed to fork thread ${e}`,"thread/fork")}try{const r=e.trim();if(!r)throw new Error("thread/fork requires threadId");const o={threadId:r};typeof t=="string"&&t.trim().length>0&&(o.cwd=t.trim()),typeof n=="string"&&n.trim().length>0&&(o.model=n.trim());const s=await sn("thread/fork",o),i=rf(s);if(!i)throw new Error("thread/fork did not return a thread id");return{threadId:i,model:ic(s)}}catch(r){throw Do(r,`Failed to fork thread ${e}`,"thread/fork")}}function BR(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
68
+ `;for(const r of t)n+=`
69
+ ## ${r.label}: ${r.path}
70
+ `;return`${n}
71
+ ## My request for Codex:
72
+
73
+ ${e}
74
+ `}async function qR(e,t,n){var l;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?Qu(n):Zu(n)};let o=null;try{o=await U_()}catch{o=null}const s=(o==null?void 0:o.model.trim())??"";if(s)return{model:s,reasoningEffort:e==="plan"?Qu(n??(o==null?void 0:o.reasoningEffort)):Zu(n??(o==null?void 0:o.reasoningEffort))};let i=[];try{i=await q_()}catch{i=[]}const a=((l=i.find(c=>c.trim().length>0))==null?void 0:l.trim())??"";if(a)return{model:a,reasoningEffort:e==="plan"?Qu(n??(o==null?void 0:o.reasoningEffort)):Zu(n??(o==null?void 0:o.reasoningEffort))};throw new Error(`${e==="plan"?"Plan":"Default"} mode requires an available model. Wait for models to load and try again.`)}async function nd(e,t,n=[],r,o,s,i=[],a){var l;try{const c=(r==null?void 0:r.trim())??"",f=[{type:"text",text:BR(t,i)}];for(const k of n){const H=k.trim();H&&f.push({type:"image",url:H,image_url:H})}if(s)for(const k of s)f.push({type:"skill",name:k.name,path:k.path});const m=i.map(k=>({label:k.label,path:k.path,fsPath:k.fsPath})),v={threadId:e,input:f};if(m.length>0&&(v.attachments=m),c&&(v.model=c),typeof o=="string"&&o.length>0&&(v.effort=o),a){const k=await qR(a,c,o);v.collaborationMode={mode:a,settings:{model:k.model,reasoning_effort:k.reasoningEffort,developer_instructions:null}}}const T=await sn("turn/start",v);return typeof((l=T==null?void 0:T.turn)==null?void 0:l.id)=="string"?T.turn.id.trim():""}catch(c){throw Do(c,`Failed to start turn for thread ${e}`,"turn/start")}}async function UR(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await sn("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Do(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function HR(e){const t=e==="fast"?"fast":"standard";await sn("config/batchWrite",{edits:[{keyPath:"features.fast_mode",value:!0,mergeStrategy:"upsert"},{keyPath:"service_tier",value:t==="fast"?"fast":null,mergeStrategy:t==="fast"?"upsert":"replace"}],filePath:null,expectedVersion:null})}async function q_(){const e=await sn("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}try{const n=await fetch("/codex-api/provider-models",{signal:AbortSignal.timeout(pR)});let r=null;try{r=await n.json()}catch{r=null}if(n.ok&&Array.isArray(r==null?void 0:r.data))for(const o of r.data){if(typeof o!="string")continue;const s=o.trim();!s||t.includes(s)||t.push(s)}}catch{}return t}async function U_(){const e=await sn("config/read",{}),t=e.config.model??"",n=vR(e.config.model_reasoning_effort),r=yR(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}function WR(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function VR(){try{const e=await sn("collaborationMode/list",{}),t=new Set,n=[];for(const r of e.data){const o=r.mode;o!=="default"&&o!=="plan"||t.has(o)||(t.add(o),n.push({value:o,label:WR(r.name||o)||(o==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of Lm)t.has(r.value)||n.push(r);return n.sort((r,o)=>r.value===o.value?0:r.value==="default"?-1:1)}}catch{}return Lm}function zR(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=s=>{if(!Array.isArray(s))return[];const i=[];for(const a of s)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,o={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[s,i]of Object.entries(r)){const a=typeof s=="string"?nn(s):"";a.length>0&&typeof i=="string"&&(o[a]=i)}return{order:n(t.order).map(s=>nn(s)),labels:o,active:n(t.active).map(s=>nn(s))}}async function ks(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return zR(n.data)}async function GR(e,t){const n=(t??"").trim(),r=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e,baseBranch:n||void 0})}),o=await r.json();if(!r.ok||!o.data)throw new Error(o.error||"Failed to create worktree");return{...o.data,cwd:nn(o.data.cwd),gitRoot:nn(o.data.gitRoot)}}async function KR(e){const t=e.trim();if(!t)return[];const n=new URLSearchParams({sourceCwd:t}),r=await fetch(`/codex-api/worktree/branches?${n.toString()}`),o=await r.json();if(!r.ok)throw new Error(o.error||"Failed to load branches");const s=Array.isArray(o.data)?o.data:[],i=[],a=new Set;for(const l of s){if(!l||typeof l!="object"||Array.isArray(l))continue;const c=l,d=typeof c.value=="string"?c.value.trim():"",f=typeof c.label=="string"?c.label.trim():"";!d||a.has(d)||(a.add(d),i.push({value:d,label:f||d}))}return i}async function YR(e){const t=e.trim();if(!t)return{currentBranch:null,options:[]};const n=new URLSearchParams({cwd:t}),r=await fetch(`/codex-api/git/branches?${n.toString()}`),o=await r.json();if(!r.ok)throw new Error(o.error||"Failed to load Git branch state");const s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{},i=s.currentBranch,a=typeof i=="string"&&i.trim()?i.trim():null,l=Array.isArray(s.options)?s.options:[],c=[],d=new Set;for(const f of l){if(!f||typeof f!="object"||Array.isArray(f))continue;const m=f,v=typeof m.value=="string"?m.value.trim():"",T=typeof m.label=="string"?m.label.trim():"";!v||d.has(v)||(d.add(v),c.push({value:v,label:T||v}))}return a&&!d.has(a)&&c.unshift({value:a,label:a}),{currentBranch:a,options:c}}async function JR(e,t){var s;const n=await fetch("/codex-api/git/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e.trim(),branch:t.trim()})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to switch branch");const o=(s=r.data)==null?void 0:s.currentBranch;return typeof o=="string"&&o.trim()?o.trim():null}async function a2(e,t,n,r){const o=new URLSearchParams({cwd:e,scope:t,workspaceView:n});r&&r.trim()&&o.set("baseBranch",r.trim());const s=await fetch(`/codex-api/review/snapshot?${o.toString()}`),i=await s.json();if(!s.ok)throw new Error(Jn(i,"Failed to load review snapshot"));return B_(i)}async function l2(e){const t=await fetch("/codex-api/review/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(Jn(n,"Failed to apply review action"));return B_(n)}async function c2(e){const t=await fetch("/codex-api/review/git/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),n=await t.json();if(!t.ok)throw new Error(Jn(n,"Failed to initialize Git"))}async function u2(e,t,n,r){const o=t==="baseBranch"?{type:"baseBranch",branch:(r??"").trim()}:{type:"uncommittedChanges"};if(o.type==="baseBranch"&&!o.branch)throw new Error("Base branch is unavailable");await sn("review/start",{threadId:e,target:o,delivery:"inline"})}async function Wm(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function XR(e,t){const n=new URLSearchParams({path:e});(t==null?void 0:t.showHidden)===!0&&n.set("showHidden","1");const r=await fetch(`/codex-local-directories?${n.toString()}`),o=await H_(r);if(!r.ok){const l=Jn(o,"Failed to load local directories");throw new Error(l)}const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},i=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{},a=Array.isArray(i.entries)?i.entries:[];return{path:typeof i.path=="string"?nn(i.path):"",parentPath:typeof i.parentPath=="string"?nn(i.parentPath):"",entries:a.flatMap(l=>{if(!l||typeof l!="object"||Array.isArray(l))return[];const c=l,d=typeof c.name=="string"?c.name.trim():"",f=typeof c.path=="string"?nn(c.path):"";return d&&f?[{name:d,path:f}]:[]})}}async function H_(e){const t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{throw new Error(`Expected JSON response from ${e.url||"request"}`)}}async function rd(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function Vm(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=Jn(r,"Failed to open project root");throw new Error(a)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return typeof s.path=="string"?nn(s.path):""}async function QR(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await H_(t);if(!t.ok){const s=Jn(n,"Failed to create local directory");throw new Error(s)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},o=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return typeof o.path=="string"?nn(o.path):""}async function ZR(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Jn(r,"Failed to suggest project name");throw new Error(i)}const o=r&&typeof r=="object"&&!Array.isArray(r)?r:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{};return{name:typeof s.name=="string"?s.name.trim():"",path:typeof s.path=="string"?nn(s.path):""}}async function eM(e,t,n=20){const r=e.trim();if(!r)return[];const o=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),s=await o.json();if(!o.ok){const c=Jn(s,"Failed to search files");throw new Error(c)}const i=s&&typeof s=="object"&&!Array.isArray(s)?s:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const c of a){if(!c||typeof c!="object"||Array.isArray(c))continue;const f=c.path,m=typeof f=="string"?f.trim():"";m&&l.push({path:m})}return l}async function tM(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}async function nM(e){const t=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e})}),n=await t.json();if(!t.ok){const r=Jn(n,"Failed to connect Telegram bot");throw new Error(r)}}async function rM(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const o=Jn(t,"Failed to load Telegram status");throw new Error(o)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return{configured:r.configured===!0,active:r.active===!0,mappedChats:typeof r.mappedChats=="number"?r.mappedChats:0,mappedThreads:typeof r.mappedThreads=="number"?r.mappedThreads:0,lastError:typeof r.lastError=="string"?r.lastError:""}}function oM(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}async function sM(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const d=new Date;e==="search-daily"?d.setUTCDate(d.getUTCDate()-1):e==="search-weekly"?d.setUTCDate(d.getUTCDate()-7):d.setUTCDate(d.getUTCDate()-30);const f=new URLSearchParams({q:`created:>=${oM(d)}`,sort:"stars",order:"desc",per_page:String(n)}),m=await fetch(`https://api.github.com/search/repositories?${f.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!m.ok)throw new Error(`Failed to fetch GitHub search projects (${m.status})`);const v=await m.json(),T=v&&typeof v=="object"&&!Array.isArray(v)?v:{},k=Array.isArray(T.items)?T.items:[],H=[];for(const P of k){if(!P||typeof P!="object"||Array.isArray(P))continue;const O=P,W=typeof O.id=="number"?O.id:0,Y=typeof O.full_name=="string"?O.full_name.trim():"",ce=typeof O.html_url=="string"?O.html_url.trim():"";if(!W||!Y||!ce)continue;const[re="",Z=""]=Y.split("/",2);H.push({id:W,fullName:Y,owner:re,repo:Z,url:ce,description:Dm(Y,typeof O.description=="string"?O.description:""),language:typeof O.language=="string"?O.language.trim():"",stars:typeof O.stargazers_count=="number"?O.stargazers_count:0})}return H}const r=e==="trending-daily"?"daily":e==="trending-weekly"?"weekly":"monthly",o=new URLSearchParams({since:r,limit:String(n)}),s=await fetch(`/codex-api/github-trending?${o.toString()}`),i=await s.json();if(!s.ok){const d=Jn(i,"Failed to fetch GitHub trending projects");throw new Error(d)}const a=i&&typeof i=="object"&&!Array.isArray(i)?i:{},l=Array.isArray(a.data)?a.data:[],c=[];for(const d of l){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d,m=typeof f.id=="number"?f.id:0,v=typeof f.fullName=="string"?f.fullName.trim():"",T=typeof f.url=="string"?f.url.trim():"";if(!m||!v||!T)continue;const[k="",H=""]=v.split("/",2);c.push({id:m,fullName:v,owner:k,repo:H,url:T,description:Dm(v,typeof f.description=="string"?f.description:""),language:typeof f.language=="string"?f.language.trim():"",stars:typeof f.stars=="number"?f.stars:0})}return c}function Jn(e,t){const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=n.message;if(typeof r=="string"&&r.trim().length>0)return r;const o=n.error;return typeof o=="string"&&o.trim().length>0?o:t}async function iM(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function od(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function aM(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function lM(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function cM(e,t){var n;try{return((n=(await sn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function uM(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await sn("skills/list",t),r=[],o=new Set;for(const s of n.data)for(const i of s.skills)!i.name||o.has(i.path)||(o.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}const dM=6e4;async function sd(e){const t=new AbortController,n=setTimeout(()=>t.abort(),dM);try{const r=new FormData;r.append("file",e);const o=await fetch("/codex-api/upload-file",{method:"POST",body:r,signal:t.signal});return o.ok?(await o.json()).path??null:null}catch{return null}finally{clearTimeout(n)}}const fM={},pM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function hM(e,t){return A(),L("svg",pM,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ap=Et(fM,[["render",hM]]),mM={},gM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vM(e,t){return A(),L("svg",gM,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const yM=Et(mM,[["render",vM]]),_M={},bM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wM(e,t){return A(),L("svg",bM,[...t[0]||(t[0]=[y("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Ki=Et(_M,[["render",wM]]),SM={},TM={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function EM(e,t){return A(),L("svg",TM,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const ac=Et(SM,[["render",EM]]),kM={},IM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function AM(e,t){return A(),L("svg",IM,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const lp=Et(kM,[["render",AM]]),CM={},xM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function RM(e,t){return A(),L("svg",xM,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const MM=Et(CM,[["render",RM]]),PM={},$M={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function NM(e,t){return A(),L("svg",$M,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Ul=Et(PM,[["render",NM]]),OM={},LM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function DM(e,t){return A(),L("svg",LM,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const id=Et(OM,[["render",DM]]),jM={key:0,class:"sidebar-menu-row-left"},FM={class:"sidebar-menu-row-main"},BM={key:1,class:"sidebar-menu-row-right"},qM={key:0,class:"sidebar-menu-row-right-default"},UM={key:1,class:"sidebar-menu-row-right-hover"},HM=An({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=qw(),r=se(()=>!!n.left),o=se(()=>!!n.right),s=se(()=>!!n["right-hover"]),i=se(()=>o.value||s.value);return(a,l)=>(A(),yt(Ef(t.as),kv({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":s.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:kt(()=>[r.value?(A(),L("span",jM,[co(a.$slots,"left",{},void 0,!0)])):Se("",!0),y("span",FM,[co(a.$slots,"default",{},void 0,!0)]),i.value?(A(),L("span",BM,[o.value?(A(),L("span",qM,[co(a.$slots,"right",{},void 0,!0)])):Se("",!0),s.value?(A(),L("span",UM,[co(a.$slots,"right-hover",{},void 0,!0)])):Se("",!0)])):Se("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Ts=Et(HM,[["__scopeId","data-v-36239f39"]]),WM={class:"thread-tree-root"},VM={key:0,class:"pinned-section"},zM={class:"thread-list"},GM=["data-menu-open"],KM={class:"thread-left-stack"},YM=["data-state"],JM=["onClick"],XM=["onClick"],QM={class:"thread-row-title-wrap"},ZM={class:"thread-row-title-line"},eP={class:"thread-row-title"},tP=["data-state"],nP={class:"thread-row-time"},rP=["onClick"],oP=["aria-expanded"],sP=["data-active"],iP={key:0},aP=["data-active"],lP={key:0},cP={key:1,class:"thread-tree-no-results"},uP={key:2,class:"thread-tree-loading"},dP={key:3,class:"thread-list thread-list-global"},fP=["data-menu-open"],pP={class:"thread-left-stack"},hP=["data-state"],mP=["onClick"],gP=["onClick"],vP={class:"thread-row-title-wrap"},yP={class:"thread-row-title-line"},_P={class:"thread-row-title"},bP=["data-state"],wP={class:"thread-row-time"},SP=["onClick"],TP=["data-project-name","data-expanded","data-dragging"],EP={class:"project-icon-stack"},kP={class:"project-icon-folder"},IP={class:"project-icon-chevron"},AP=["data-dragging-handle","onMousedown"],CP={class:"project-title"},xP={class:"project-hover-controls"},RP=["onClick"],MP=["data-open-direction"],PP=["onClick"],$P=["onClick"],NP=["onInput"],OP=["aria-label","title","onClick"],LP={key:0,class:"thread-list"},DP=["data-menu-open"],jP={class:"thread-left-stack"},FP=["data-state"],BP=["onClick"],qP=["onClick"],UP={class:"thread-row-title-wrap"},HP={class:"thread-row-title-line"},WP={class:"thread-row-title"},VP=["data-state"],zP={class:"thread-row-time"},GP=["onClick"],KP=["onClick"],YP=["data-open-direction"],JP={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},XP=["onKeydown"],QP={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},ZP={class:"rename-thread-subtitle"},e$=4,zm=6,Gm="codex-web-local.thread-view-mode.v1",Km="codex-web-local.collapsed-projects.v1",t$=An({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-thread-files","rename-project","rename-thread","remove-project","reorder-project","export-thread","fork-thread"],setup(e,{emit:t}){const n=e,r=t,o=j({}),s=j({});let i=!1;const a=j([]),l=j(""),c=j(""),d=j({}),f=j({}),m=j({}),v=j("actions"),T=j(""),k=j(!1),H=j(""),P=j(""),O=j(null),W=j(!1),Y=j(""),ce=j(""),re=j(null),Z=j(null),he=j(null);let Ce=null,Ae=null;const ue=j(""),V=j({}),ae=new Map,xe=new Map,Fe=new Map,_e=new WeakMap,Me=j(null),fe=j(null),De=j(!1),Be=j(ot()),Re=typeof window<"u"?new ResizeObserver(S=>{for(const C of S){const N=C.target,z=_e.get(N);z&&Qn(z,N)}}):null;function Ge(){if(typeof window>"u")return{};try{const S=window.localStorage.getItem(Km);if(!S)return{};const C=JSON.parse(S);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function ot(){return typeof window>"u"?"project":window.localStorage.getItem(Gm)==="chronological"?"chronological":"project"}s.value=Ge(),lt(s,S=>{typeof window>"u"||window.localStorage.setItem(Km,JSON.stringify(S))},{deep:!0}),lt(Be,S=>{typeof window>"u"||window.localStorage.setItem(Gm,S)});const nt=se(()=>n.searchQuery.trim().toLowerCase()),st=se(()=>nt.value.length>0),Ke=se(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),J=se(()=>new Set(a.value));function be(S){if(!st.value)return!0;if(Ke.value)return Ke.value.has(S.id);const C=nt.value;return S.title.toLowerCase().includes(C)||S.preview.toLowerCase().includes(C)}const we=se(()=>st.value?n.groups.map(S=>({...S,threads:S.threads.filter(be)})).filter(S=>S.threads.length>0):n.groups),ve=se(()=>Be.value==="chronological"),Ze=se(()=>{const S=we.value,C=[];for(const N of S)for(const z of N.threads)J.value.has(z.id)||C.push(z);return C.sort((N,z)=>{const w=new Date(N.updatedAtIso||N.createdAtIso).getTime();return new Date(z.updatedAtIso||z.createdAtIso).getTime()-w})}),E=se(()=>{const S=new Map;for(const C of n.groups)for(const N of C.threads)S.set(N.id,N);return S});lt(a,S=>{i&&lM(S)}),lt(E,S=>{const C=a.value.filter(N=>S.has(N));C.length!==a.value.length&&(a.value=C)}),as(async()=>{const{threadIds:S}=await aM(),C=Array.isArray(S)?S.filter(N=>typeof N=="string").map(N=>N.trim()).filter((N,z,w)=>N.length>0&&w.indexOf(N)===z):[];C.length>0&&(a.value=C),i=!0});const I=se(()=>{const S=new Map;for(const C of n.groups)for(const N of C.threads)S.set(N.id,C.projectName);return S}),q=se(()=>{const S=new Map;for(const C of n.groups){const N=C.threads.filter(z=>!J.value.has(z.id));S.set(C.projectName,N)}return S}),Q=se(()=>{const S=new Map;for(const C of n.groups)for(const N of C.threads){const z=new Date(N.updatedAtIso||N.createdAtIso).getTime();S.set(N.id,z)}return S}),ee=se(()=>{const S=c.value;return S?E.value.get(S)??null:null}),te=se(()=>a.value.map(S=>E.value.get(S)??null).filter(S=>S!==null).filter(be)),ie=se(()=>{const S=he.value;if(!S||S.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(S.dropTargetIndexFull,n.groups.length)),N=C>S.fromIndex?C-1:C,z=Math.max(0,Math.min(N,n.groups.length-1));return z===S.fromIndex?null:z}),pe=se(()=>{const C=(st.value?we.value:n.groups).map(K=>K.projectName),N=he.value,z=ie.value;if(!N||z===null)return C;const w=[...C],[R]=w.splice(N.fromIndex,1);return R?(w.splice(z,0,R),w):C}),me=se(()=>{const S={};let C=0;for(const N of pe.value)S[N]=C,C+=Dt(N);return S}),ne=se(()=>{let S=0;for(const C of pe.value)S+=Dt(C);return{height:`${Math.max(0,S)}px`}});function Ue(S){if(Number.isNaN(S))return"n/a";const C=Math.abs(Date.now()-S);if(C<6e4)return"now";const N=Math.floor(C/6e4);if(N<60)return`${N}m`;const z=Math.floor(N/60);return z<24?`${z}h`:`${Math.floor(z/24)}d`}function ke(S){const C=Q.value.get(S.id);return Ue(typeof C=="number"?C:new Date(S.updatedAtIso||S.createdAtIso).getTime())}function ye(S){return J.value.has(S)}function $e(S){if(ye(S)){a.value=a.value.filter(C=>C!==S);return}a.value=[S,...a.value]}function x(S){r("select",S)}function $(S){r("export-thread",S),Qe()}function D(S){r("fork-thread",S),Qe()}function X(S){return`start new thread ${Ut(S)}`}function le(S){r("start-new-thread",S)}function Le(S){r("browse-thread-files",S),Qe()}function Ne(S,C){if(c.value===S){if(C){const N=C.relatedTarget,z=fe.value;if(N instanceof Node&&z&&z.contains(N))return}Qe()}}function rt(S){return c.value===S}function Qe(){c.value="",m.value={}}function wt(S){if(c.value===S){Qe();return}Ht(),De.value=!1,c.value=S,Jt(()=>{an(S)})}function Rt(S,C){S.preventDefault(),c.value=C}function ct(S,C){H.value=S,P.value=C,k.value=!0,Qe(),Jt(()=>{var N,z;(N=O.value)==null||N.focus(),(z=O.value)==null||z.select()})}function Qt(){k.value=!1,H.value="",P.value=""}function mn(){const S=H.value,C=P.value.trim();!S||!C||(r("rename-thread",{threadId:S,title:C}),Qt())}function ar(S,C){Y.value=S,ce.value=C,W.value=!0,Qe()}function Xn(){W.value=!1,Y.value="",ce.value=""}function mr(){const S=Y.value;S&&(a.value=a.value.filter(C=>C!==S),r("archive",S),Xn())}function Ut(S){return n.projectDisplayNameById[S]??S}function Zt(S){return l.value===S}function Ht(){l.value="",v.value="actions",T.value=""}function gr(){const S=!De.value;S&&(Ht(),Qe()),De.value=S}function Wt(S){Be.value=S,De.value=!1}function Yr(S){if(l.value===S){Ht();return}Qe(),De.value=!1,l.value=S,v.value="actions",T.value=Ut(S),Jt(()=>{dt(S)})}function jn(S){Qe(),l.value=S,v.value="rename",T.value=Ut(S),Jt(()=>{dt(S)})}function vr(S){r("rename-project",{projectName:S,displayName:T.value})}function Mr(S){r("remove-project",S),Ht()}function ho(S,C){if(!S.altKey||S.key!=="ArrowUp"&&S.key!=="ArrowDown")return;const N=n.groups.findIndex(R=>R.projectName===C);if(N<0)return;const z=S.key==="ArrowUp"?-1:1,w=Math.max(0,Math.min(N+z,n.groups.length-1));w!==N&&(S.preventDefault(),r("reorder-project",{projectName:C,toIndex:w}))}function Fn(S){return o.value[S]===!0}function en(S){return s.value[S]===!0}function Pr(S){o.value={...o.value,[S]:!Fn(S)}}function Cn(S){if(ue.value===S){ue.value="";return}s.value={...s.value,[S]:!en(S)}}function Dt(S){const C=V.value[S]??0,N=he.value,w=((N==null?void 0:N.projectName)===S?N.groupHeight:null)??C,R=en(S)?0:zm;return Math.max(0,w+R)}function lr(S,C){const N=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(N){xe.set(S,N);return}xe.delete(S)}function $r(S,C){const N=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(N){Fe.set(S,N);return}Fe.delete(S)}function gn(S){let C=S.parentElement;for(;C;){const N=window.getComputedStyle(C),z=N.overflowY||N.overflow;if(z==="auto"||z==="scroll"||z==="hidden"||z==="clip")return C.getBoundingClientRect();C=C.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Vt(S,C){const N=S.getBoundingClientRect(),z=gn(S),w=6,R=z.bottom-N.bottom,K=N.top-z.top;return R>=C+w?"down":K>R?"up":"down"}function Mt(S,C){const N=Fe.get(S);if(!N)return"down";const z=Vt(N,C);return f.value={...f.value,[S]:z},z}function vn(S){return f.value[S]??"down"}function dt(S){const C=xe.get(S);C&&(d.value={...d.value,[S]:Vt(C,112)})}function gt(S,C,N){return Math.min(Math.max(S,C),N)}function an(S){const C=Fe.get(S);if(!C)return;const N=fe.value,z=N==null?void 0:N.getBoundingClientRect(),w=(z==null?void 0:z.height)||(N==null?void 0:N.offsetHeight)||112,R=(z==null?void 0:z.width)||(N==null?void 0:N.offsetWidth)||160,K=Mt(S,w),Ee=C.getBoundingClientRect(),it=8,Ft=4,Gt=Math.max(it,window.innerWidth-R-it),Pt=gt(Ee.right-R,it,Gt),wn=gt(K==="up"?Ee.top-w-Ft:Ee.bottom+Ft,it,Math.max(it,window.innerHeight-w-it));m.value={left:`${Math.round(Pt)}px`,top:`${Math.round(wn)}px`}}function Bn(){const S=c.value;S&&an(S)}function cr(){window.addEventListener("resize",Bn),document.addEventListener("scroll",Bn,!0)}function qn(){window.removeEventListener("resize",Bn),document.removeEventListener("scroll",Bn,!0)}function xn(S){const C=l.value;if(!C)return!1;const N=xe.get(C);if(!N)return!1;if((typeof S.composedPath=="function"?S.composedPath():[]).includes(N))return!0;const w=S.target;return w instanceof Node?N.contains(w):!1}function ln(S){const C=c.value;if(!C)return!1;const N=Fe.get(C);if(!N)return!1;const z=typeof S.composedPath=="function"?S.composedPath():[];if(z.includes(N))return!0;const w=fe.value;if(w&&z.includes(w))return!0;const R=S.target;return R instanceof Node?!!(N.contains(R)||w&&w.contains(R)):!1}function Un(S){if(De.value){const C=Me.value,N=typeof S.composedPath=="function"?S.composedPath():[];!!C&&(N.includes(C)||S.target instanceof Node&&C.contains(S.target))||(De.value=!1)}l.value&&(xn(S)||Ht(),c.value&&(ln(S)||Qe()))}function ur(S){l.value&&!xn(S)&&Ht(),c.value&&!ln(S)&&Qe()}function Nr(){De.value&&(De.value=!1),l.value&&Ht(),c.value&&Qe()}function Hn(){window.addEventListener("pointerdown",Un,{capture:!0}),window.addEventListener("focusin",ur,{capture:!0}),window.addEventListener("blur",Nr)}function En(){window.removeEventListener("pointerdown",Un,{capture:!0}),window.removeEventListener("focusin",ur,{capture:!0}),window.removeEventListener("blur",Nr)}function Qn(S,C){const N=C.getBoundingClientRect().height;if(!Number.isFinite(N)||N<=0)return;const z=V.value[S];z!==void 0&&Math.abs(z-N)<.5||(V.value={...V.value,[S]:N})}function yn(S,C){const N=ae.get(S);N&&N!==C&&Re&&Re.unobserve(N);const z=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(z){ae.set(S,z),_e.set(z,S),Qn(S,z),Re==null||Re.observe(z);return}N&&(Re==null||Re.unobserve(N)),ae.delete(S)}function _n(S,C){if(S.button!==0||Z.value||he.value)return;const N=n.groups.findIndex(K=>K.projectName===C),z=ae.get(C);if(N<0||!z)return;const w=z.getBoundingClientRect(),R=en(C)?0:zm;Z.value={projectName:C,fromIndex:N,startClientX:S.clientX,startClientY:S.clientY,pointerOffsetY:S.clientY-w.top,groupLeft:w.left,groupWidth:w.width,groupHeight:w.height,groupOuterHeight:w.height+R},S.preventDefault(),Rn()}function Rn(){window.addEventListener("mousemove",yr),window.addEventListener("mouseup",Jr),window.addEventListener("keydown",Nt)}function bn(){window.removeEventListener("mousemove",yr),window.removeEventListener("mouseup",Jr),window.removeEventListener("keydown",Nt)}function yr(S){Ce={clientX:S.clientX,clientY:S.clientY},Wn()}function Jr(S){qe({clientX:S.clientX,clientY:S.clientY});const C=he.value;if(C&&ie.value!==null){const N=n.groups.findIndex(z=>z.projectName===C.projectName);if(N>=0){const z=ie.value;z!==N&&r("reorder-project",{projectName:C.projectName,toIndex:z})}}on()}function Nt(S){S.key==="Escape"&&(!Z.value&&!he.value||(S.preventDefault(),on()))}function on(){Ae!==null&&(window.cancelAnimationFrame(Ae),Ae=null),Ce=null,Z.value=null,he.value=null,ue.value="",bn()}function Wn(){Ae===null&&(Ae=window.requestAnimationFrame(()=>{if(Ae=null,!Ce)return;const S=Ce;Ce=null,qe(S)}))}function qe(S){const C=Z.value;if(!he.value&&C){const N=S.clientX-C.startClientX,z=S.clientY-C.startClientY;if(Math.hypot(N,z)<e$)return;Ht(),ue.value=C.projectName,he.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:S.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}he.value&&Te(S)}function Te(S){const C=he.value;if(!C)return;if(C.ghostTop=S.clientY-C.pointerOffsetY,!St(S)){C.dropTargetIndexFull=null;return}const N=S.clientY,z=re.value;if(!z){C.dropTargetIndexFull=null;return}const w=z.getBoundingClientRect(),R=new Map(n.groups.map((Ft,Gt)=>[Ft.projectName,Gt])),K=n.groups.map(Ft=>Ft.projectName).filter(Ft=>Ft!==C.projectName);let Ee=0,it=n.groups.length;for(const Ft of K){const Gt=R.get(Ft);if(Gt===void 0)continue;const Pt=Dt(Ft),wn=w.top+Ee+Pt/2;if(N<wn){it=Gt;break}Ee+=Pt}C.dropTargetIndexFull=it}function St(S){const C=re.value;if(!C)return!1;const N=C.getBoundingClientRect(),z=S.clientX>=N.left&&S.clientX<=N.right,w=S.clientY>=N.top-32&&S.clientY<=N.bottom+32;return z&&w}function Or(S){var C;return((C=he.value)==null?void 0:C.projectName)===S}function Lr(S){const C=he.value,N=me.value[S]??0,z=c.value?I.value.get(c.value)??"":"",w=l.value===S||z===S;return!C||C.projectName!==S?{position:"absolute",top:"0",left:"0",right:"0",zIndex:w?"40":"1",transform:`translate3d(0, ${N}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${C.groupLeft}px`,width:`${C.groupWidth}px`,height:`${C.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${C.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Zn(S){return q.value.get(S.projectName)??[]}function er(S){if(st.value)return Zn(S);if(en(S.projectName))return[];const C=Zn(S);return Fn(S.projectName)?C:C.slice(0,10)}function Xr(S){return st.value?!1:!en(S.projectName)&&Zn(S).length>10}function _r(S){return Zn(S).length>0}function Mn(S){return!!S.pendingRequestState||S.inProgress||S.unread}function qt(S){return S.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function zt(S){return S.pendingRequestState==="approval"?"awaiting-approval":S.pendingRequestState==="response"?"awaiting-response":S.inProgress?"working":S.unread?"unread":"idle"}lt(()=>n.groups.map(S=>S.projectName),S=>{var w,R;const C=((w=he.value)==null?void 0:w.projectName)??((R=Z.value)==null?void 0:R.projectName)??"";C&&!n.groups.some(K=>K.projectName===C)&&on();const N=new Set(S),z=Object.fromEntries(Object.entries(V.value).filter(([K])=>N.has(K)));Object.keys(z).length!==Object.keys(V.value).length&&(V.value=z)});const br=se(()=>De.value||l.value!==""||c.value!=="");return lt(br,S=>{if(S){Hn();return}En()}),lt(c,S=>{if(!S){qn();return}cr(),Jt(()=>{an(S)})}),Fs(()=>{for(const S of ae.values())Re==null||Re.unobserve(S);ae.clear(),xe.clear(),qn(),En(),on()}),(S,C)=>(A(),L("section",WM,[te.value.length>0?(A(),L("section",VM,[y("ul",zM,[(A(!0),L(Xe,null,Bt(te.value,N=>(A(),L("li",{key:N.id,class:"thread-row-item","data-menu-open":rt(N.id)?"true":"false"},[ze(Ts,{class:"thread-row","data-active":N.id===e.selectedThreadId,"data-pinned":ye(N.id),"data-menu-open":rt(N.id)?"true":"false","force-right-hover":rt(N.id),onMouseleave:z=>Ne(N.id,z),onContextmenu:z=>Rt(z,N.id)},{left:kt(()=>[y("span",KM,[Mn(N)?(A(),L("span",{key:0,class:"thread-status-indicator","data-state":zt(N)},null,8,YM)):Se("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:z=>$e(N.id)},[ze(id,{class:"thread-icon"})],8,JM)])]),right:kt(()=>[y("span",nP,ge(ke(N)),1)]),"right-hover":kt(()=>[y("div",{ref_for:!0,ref:z=>$r(N.id,z),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:_t(z=>wt(N.id),["stop"])},[ze(Ki,{class:"thread-icon"})],8,rP)],512)]),default:kt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:z=>x(N.id)},[y("span",QM,[y("span",ZM,[y("span",eP,ge(N.title),1),N.hasWorktree?(A(),yt(Ul,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):Se("",!0),N.pendingRequestState?(A(),L("span",{key:1,class:"thread-row-request-chip","data-state":N.pendingRequestState},ge(qt(N)),9,tP)):Se("",!0)])])],8,XM)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,GM))),128))])])):Se("",!0),ze(Ts,{as:"header",class:"thread-tree-header-row"},{right:kt(()=>[y("div",{ref_key:"organizeMenuWrapRef",ref:Me,class:"organize-menu-wrap"},[y("button",{class:"organize-menu-trigger",type:"button","aria-expanded":De.value,"aria-label":"Organize threads",title:"Organize threads",onClick:gr},[ze(Ki,{class:"thread-icon"})],8,oP),De.value?(A(),L("div",{key:0,class:"organize-menu-panel",onClick:C[2]||(C[2]=_t(()=>{},["stop"]))},[C[14]||(C[14]=y("p",{class:"organize-menu-title"},"Organize",-1)),y("button",{class:"organize-menu-item","data-active":Be.value==="project",type:"button",onClick:C[0]||(C[0]=N=>Wt("project"))},[C[12]||(C[12]=y("span",null,"By project",-1)),Be.value==="project"?(A(),L("span",iP,"✓")):Se("",!0)],8,sP),y("button",{class:"organize-menu-item","data-active":Be.value==="chronological",type:"button",onClick:C[1]||(C[1]=N=>Wt("chronological"))},[C[13]||(C[13]=y("span",null,"Chronological list",-1)),Be.value==="chronological"?(A(),L("span",lP,"✓")):Se("",!0)],8,aP)])):Se("",!0)],512)]),default:kt(()=>[C[15]||(C[15]=y("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),st.value&&we.value.length===0?(A(),L("p",cP,"No matching threads")):e.isLoading&&e.groups.length===0?(A(),L("p",uP,"Loading threads...")):ve.value?(A(),L("ul",dP,[(A(!0),L(Xe,null,Bt(Ze.value,N=>(A(),L("li",{key:N.id,class:"thread-row-item","data-menu-open":rt(N.id)?"true":"false"},[ze(Ts,{class:"thread-row","data-active":N.id===e.selectedThreadId,"data-pinned":ye(N.id),"data-menu-open":rt(N.id)?"true":"false","force-right-hover":rt(N.id),onMouseleave:z=>Ne(N.id,z),onContextmenu:z=>Rt(z,N.id)},{left:kt(()=>[y("span",pP,[Mn(N)?(A(),L("span",{key:0,class:"thread-status-indicator","data-state":zt(N)},null,8,hP)):Se("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:z=>$e(N.id)},[ze(id,{class:"thread-icon"})],8,mP)])]),right:kt(()=>[y("span",wP,ge(ke(N)),1)]),"right-hover":kt(()=>[y("div",{ref_for:!0,ref:z=>$r(N.id,z),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:_t(z=>wt(N.id),["stop"])},[ze(Ki,{class:"thread-icon"})],8,SP)],512)]),default:kt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:z=>x(N.id)},[y("span",vP,[y("span",yP,[y("span",_P,ge(N.title),1),N.hasWorktree?(A(),yt(Ul,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):Se("",!0),N.pendingRequestState?(A(),L("span",{key:1,class:"thread-row-request-chip","data-state":N.pendingRequestState},ge(qt(N)),9,bP)):Se("",!0)])])],8,gP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,fP))),128))])):(A(),L("div",{key:4,ref_key:"groupsContainerRef",ref:re,class:"thread-tree-groups",style:ko(ne.value)},[(A(!0),L(Xe,null,Bt(we.value,N=>(A(),L("article",{key:N.projectName,ref_for:!0,ref:z=>yn(N.projectName,z),class:"project-group","data-project-name":N.projectName,"data-expanded":!en(N.projectName),"data-dragging":Or(N.projectName),style:ko(Lr(N.projectName))},[ze(Ts,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:z=>Cn(N.projectName),onKeydown:[z=>ho(z,N.projectName),Sn(_t(z=>Cn(N.projectName),["prevent"]),["enter"]),Sn(_t(z=>Cn(N.projectName),["prevent"]),["space"])]},{left:kt(()=>[y("span",EP,[y("span",kP,[en(N.projectName)?(A(),yt(lp,{key:0,class:"thread-icon"})):(A(),yt(MM,{key:1,class:"thread-icon"}))]),y("span",IP,[en(N.projectName)?(A(),yt(yM,{key:0,class:"thread-icon"})):(A(),yt(ap,{key:1,class:"thread-icon"}))])])]),right:kt(()=>[y("div",xP,[y("div",{ref_for:!0,ref:z=>lr(N.projectName,z),class:"project-menu-wrap"},[y("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:_t(z=>Yr(N.projectName),["stop"])},[ze(Ki,{class:"thread-icon"})],8,RP),Zt(N.projectName)?(A(),L("div",{key:0,class:"project-menu-panel","data-open-direction":d.value[N.projectName]??"down",onClick:C[4]||(C[4]=_t(()=>{},["stop"]))},[v.value==="actions"?(A(),L(Xe,{key:0},[y("button",{class:"project-menu-item",type:"button",onClick:z=>jn(N.projectName)}," Edit name ",8,PP),y("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:z=>Mr(N.projectName)}," Remove ",8,$P)],64)):(A(),L(Xe,{key:1},[C[16]||(C[16]=y("label",{class:"project-menu-label"},"Project name",-1)),Br(y("input",{"onUpdate:modelValue":C[3]||(C[3]=z=>T.value=z),class:"project-menu-input",type:"text",onInput:z=>vr(N.projectName)},null,40,NP),[[fo,T.value]])],64))],8,MP)):Se("",!0)],512),y("button",{class:"thread-start-button",type:"button","aria-label":X(N.projectName),title:X(N.projectName),onClick:_t(z=>le(N.projectName),["stop"])},[ze(ac,{class:"thread-icon"})],8,OP)])]),default:kt(()=>[y("span",{class:"project-main-button","data-dragging-handle":Or(N.projectName),onMousedown:_t(z=>_n(z,N.projectName),["left"])},[y("span",CP,ge(Ut(N.projectName)),1)],40,AP)]),_:2},1032,["onClick","onKeydown"]),_r(N)?(A(),L("ul",LP,[(A(!0),L(Xe,null,Bt(er(N),z=>(A(),L("li",{key:z.id,class:"thread-row-item","data-menu-open":rt(z.id)?"true":"false"},[ze(Ts,{class:"thread-row","data-active":z.id===e.selectedThreadId,"data-pinned":ye(z.id),"data-menu-open":rt(z.id)?"true":"false","force-right-hover":rt(z.id),onMouseleave:w=>Ne(z.id,w),onContextmenu:w=>Rt(w,z.id)},{left:kt(()=>[y("span",jP,[Mn(z)?(A(),L("span",{key:0,class:"thread-status-indicator","data-state":zt(z)},null,8,FP)):Se("",!0),y("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:w=>$e(z.id)},[ze(id,{class:"thread-icon"})],8,BP)])]),right:kt(()=>[y("span",zP,ge(ke(z)),1)]),"right-hover":kt(()=>[y("div",{ref_for:!0,ref:w=>$r(z.id,w),class:"thread-menu-wrap"},[y("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:_t(w=>wt(z.id),["stop"])},[ze(Ki,{class:"thread-icon"})],8,GP)],512)]),default:kt(()=>[y("button",{class:"thread-main-button",type:"button",onClick:w=>x(z.id)},[y("span",UP,[y("span",HP,[y("span",WP,ge(z.title),1),z.hasWorktree?(A(),yt(Ul,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):Se("",!0),z.pendingRequestState?(A(),L("span",{key:1,class:"thread-row-request-chip","data-state":z.pendingRequestState},ge(qt(z)),9,VP)):Se("",!0)])])],8,qP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,DP))),128))])):(A(),yt(Ts,{key:1,as:"p",class:"project-empty-row"},{left:kt(()=>[...C[17]||(C[17]=[y("span",{class:"project-empty-spacer"},null,-1)])]),default:kt(()=>[C[18]||(C[18]=y("span",{class:"project-empty"},"No threads",-1))]),_:1})),Xr(N)?(A(),yt(Ts,{key:2,class:"thread-show-more-row"},{left:kt(()=>[...C[19]||(C[19]=[y("span",{class:"thread-show-more-spacer"},null,-1)])]),default:kt(()=>[y("button",{class:"thread-show-more-button",type:"button",onClick:z=>Pr(N.projectName)},ge(Fn(N.projectName)?"Show less":"Show more"),9,KP)]),_:2},1024)):Se("",!0)],12,TP))),128))],4)),(A(),yt(xl,{to:"body"},[ee.value?(A(),L("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:fe,class:"thread-menu-panel thread-menu-panel-fixed",style:ko(m.value),"data-open-direction":vn(ee.value.id),onClick:C[10]||(C[10]=_t(()=>{},["stop"]))},[y("button",{class:"thread-menu-item",type:"button",onClick:C[5]||(C[5]=N=>Le(ee.value.id))}," Browse files "),y("button",{class:"thread-menu-item",type:"button",onClick:C[6]||(C[6]=N=>$(ee.value.id))}," Export chat "),y("button",{class:"thread-menu-item",type:"button",onClick:C[7]||(C[7]=N=>D(ee.value.id))}," Create chat fork "),y("button",{class:"thread-menu-item",type:"button",onClick:C[8]||(C[8]=N=>ct(ee.value.id,ee.value.title))}," Rename thread "),y("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:C[9]||(C[9]=N=>ar(ee.value.id,ee.value.title))}," Delete thread ")],12,YP)):Se("",!0)])),(A(),yt(xl,{to:"body"},[k.value?(A(),L("div",{key:0,class:"rename-thread-overlay",onClick:_t(Qt,["self"])},[y("div",JP,[C[20]||(C[20]=y("h3",{class:"rename-thread-title"},"Rename thread",-1)),C[21]||(C[21]=y("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Br(y("input",{ref_key:"renameThreadInputRef",ref:O,"onUpdate:modelValue":C[11]||(C[11]=N=>P.value=N),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Sn(_t(mn,["prevent"]),["enter"]),Sn(_t(Qt,["prevent"]),["esc"])]},null,40,XP),[[fo,P.value]]),y("div",{class:"rename-thread-actions"},[y("button",{class:"rename-thread-button",type:"button",onClick:Qt},"Cancel"),y("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:mn},"Save")])])])):Se("",!0)])),(A(),yt(xl,{to:"body"},[W.value?(A(),L("div",{key:0,class:"rename-thread-overlay",onClick:_t(Xn,["self"])},[y("div",QP,[C[22]||(C[22]=y("h3",{class:"rename-thread-title"},"Delete thread?",-1)),y("p",ZP,' This will archive the thread "'+ge(ce.value)+'". You can find it later in archived threads. ',1),y("div",{class:"rename-thread-actions"},[y("button",{class:"rename-thread-button",type:"button",onClick:Xn},"Cancel"),y("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:mr},"Delete")])])])):Se("",!0)]))]))}}),n$=Et(t$,[["__scopeId","data-v-5a4523d9"]]),r$={class:"content-header"},o$={class:"content-leading"},s$={class:"content-title"},i$={class:"content-actions"},a$=An({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(A(),L("header",r$,[y("div",o$,[co(t.$slots,"leading",{},void 0)]),y("h1",s$,ge(e.title),1),y("div",i$,[co(t.$slots,"actions",{},void 0)])]))}}),l$=Et(a$,[["__scopeId","data-v-66ee223c"]]),Ym=.0025,ad=3,Jm=2,c$=256;function u$(e){var ue;const t=j("idle"),n=j(typeof navigator<"u"&&!!((ue=navigator.mediaDevices)!=null&&ue.getUserMedia)),r=j(0),o=j(null);let s=null,i=null,a=[],l=null,c=null,d=null,f=null,m=[],v=!1,T=!1,k=null;function H(){k&&(k.abort(),k=null),t.value==="transcribing"&&(t.value="idle")}function P(){const V=o.value;if(!V||typeof window>"u")return;const ae=V.getContext("2d");if(!ae)return;const xe=Math.max(1,Math.floor(V.clientWidth)),Fe=Math.max(1,Math.floor(V.clientHeight||36)),_e=window.devicePixelRatio||1,Me=Math.max(1,Math.floor(xe*_e)),fe=Math.max(1,Math.floor(Fe*_e));(V.width!==Me||V.height!==fe)&&(V.width=Me,V.height=fe),ae.setTransform(_e,0,0,_e,0,0),ae.clearRect(0,0,xe,Fe);const De=Math.max(12,Math.floor(xe/(ad+Jm))),Be=m.slice(-De),Re=Math.max(0,De-Be.length),Ge=Fe/2,ot=getComputedStyle(V).color||"#000000";for(let nt=0;nt<De;nt+=1){const st=Be[nt-Re]??0,J=Math.max(.08,Math.min(1,st*18))*Ge,be=nt*(ad+Jm);ae.globalAlpha=st<=Ym?.35:1,ae.fillStyle=ot,ae.fillRect(be,Ge-J,ad,J*2)}ae.globalAlpha=1}function O(){m=[],r.value=0,P()}function W(){d&&(d.disconnect(),d.onaudioprocess=null,d=null),c&&(c.disconnect(),c=null),l&&(l.close(),l=null),f=null}function Y(V){if(typeof window>"u")return;const ae=window.webkitAudioContext,xe=window.AudioContext??ae;xe&&(W(),O(),l=new xe,c=l.createMediaStreamSource(V),d=l.createScriptProcessor(2048,1,1),f=performance.now(),d.onaudioprocess=Fe=>{const _e=Fe.inputBuffer.getChannelData(0);let Me=0;for(let fe=0;fe<_e.length;fe+=1){const De=Math.abs(_e[fe]??0);Me+=De<Ym?0:De}m.push(Me/_e.length),m.length>c$&&m.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),P()},c.connect(d),d.connect(l.destination),P())}async function ce(){var V;if(t.value==="transcribing"&&H(),!(t.value!=="idle"||!n.value||v)){v=!0,T=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],s=new MediaRecorder(i),s.ondataavailable=ae=>{ae.data.size>0&&a.push(ae.data)},s.onstop=()=>{var Fe;const ae=a,xe=(s==null?void 0:s.mimeType)||((Fe=ae[0])==null?void 0:Fe.type)||"audio/webm";Ce(),he(ae,xe)},Y(i),s.start(250),t.value="recording",T&&re()}catch(ae){Ce(),t.value="idle",(V=e.onError)==null||V.call(e,ae)}finally{v=!1}}}function re(){if(v&&t.value==="idle"){T=!0;return}if(!(t.value!=="recording"||!s)&&s.state!=="inactive"){t.value="transcribing";try{s.requestData()}catch{}s.stop()}}function Z(){T=!1,H(),Ce(),t.value="idle"}async function he(V,ae){var _e,Me,fe,De,Be;if(V.length===0){(_e=e.onEmpty)==null||_e.call(e),t.value="idle";return}const xe=new Blob(V,{type:ae});t.value="transcribing";let Fe=null;try{const Re=ae.split(/[/;]/)[1]??"webm",Ge=new FormData;Ge.append("file",xe,`codex.${Re}`);const ot=((Me=e.getLanguage)==null?void 0:Me.call(e).trim())??"";ot&&ot.toLowerCase()!=="auto"&&Ge.append("language",ot),Fe=new AbortController,k=Fe;const nt=await fetch("/codex-api/transcribe",{method:"POST",body:Ge,signal:Fe.signal}),st=await nt.text();let Ke=null;try{Ke=st.trim()?JSON.parse(st):null}catch{Ke=null}if(!nt.ok){const be=(fe=Ke==null?void 0:Ke.error)==null?void 0:fe.trim(),we=st.trim();throw new Error(be||we||`Transcription failed: ${nt.status}`)}const J=((Ke==null?void 0:Ke.text)??"").trim();J.length>0?e.onTranscript(J):(De=e.onEmpty)==null||De.call(e)}catch(Re){if(Re instanceof DOMException&&Re.name==="AbortError")return;(Be=e.onError)==null||Be.call(e,Re)}finally{Fe&&k===Fe&&(k=null),t.value==="transcribing"&&(t.value="idle")}}function Ce(){W(),O(),s&&(s.ondataavailable=null,s.onstop=null,s=null),i&&(i.getTracks().forEach(V=>V.stop()),i=null),a=[]}Fs(()=>{Z()});function Ae(){if(t.value==="recording"){re();return}(t.value==="idle"||t.value==="transcribing")&&ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:o,startRecording:ce,stopRecording:re,toggleRecording:Ae,cancel:Z}}const d$={},f$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function p$(e,t){return A(),L("svg",f$,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const h$=Et(d$,[["render",p$]]),m$={},g$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function v$(e,t){return A(),L("svg",g$,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3L4 14h6l-1 7l9-11h-6z"},null,-1)])])}const y$=Et(m$,[["render",v$]]),_$={},b$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function w$(e,t){return A(),L("svg",b$,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const S$=Et(_$,[["render",w$]]),T$={},E$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function k$(e,t){return A(),L("svg",E$,[...t[0]||(t[0]=[y("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),y("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const Xm=Et(T$,[["render",k$]]),I$=["disabled"],A$={class:"composer-dropdown-value"},C$={class:"composer-dropdown-menu"},x$={key:0,class:"composer-dropdown-search-wrap"},R$=["placeholder","onKeydown"],M$={class:"composer-dropdown-options",role:"listbox"},P$=["onClick"],$$={key:0,class:"composer-dropdown-empty"},N$={key:1,class:"composer-dropdown-add-wrap"},O$=["placeholder","onKeydown"],L$=An({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},addActionMode:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add","add-action"],setup(e,{emit:t}){const n=e,r=t,o=j(null),s=j(null),i=j(null),a=j(!1),l=j(""),c=j(!1),d=j(""),f=se(()=>{var V;const ue=n.options.find(ae=>ae.value===n.modelValue);return ue?ue.label:((V=n.placeholder)==null?void 0:V.trim())||""}),m=se(()=>n.openDirection??"down"),v=se(()=>n.enableSearch===!0),T=se(()=>n.showAddAction===!0),k=se(()=>{var ue;return((ue=n.searchPlaceholder)==null?void 0:ue.trim())||"Quick search projects"}),H=se(()=>{var ue;return((ue=n.addActionLabel)==null?void 0:ue.trim())||"Add new project"}),P=se(()=>n.addActionMode??"inline"),O=se(()=>{var ue;return((ue=n.addPlaceholder)==null?void 0:ue.trim())||"Project name or absolute path"}),W=se(()=>{const ue=l.value.trim().toLowerCase();return ue?n.options.filter(V=>V.label.toLowerCase().includes(ue)||V.value.toLowerCase().includes(ue)):n.options});function Y(){n.disabled||(a.value=!a.value)}function ce(ue){r("update:modelValue",ue),a.value=!1,l.value=""}function re(){var ue;if(P.value==="event"){r("add-action"),a.value=!1,l.value="";return}c.value=!0,d.value=((ue=n.defaultAddValue)==null?void 0:ue.trim())||"",Jt(()=>{var V;return(V=i.value)==null?void 0:V.focus()})}function Z(){if(l.value.length>0){l.value="";return}a.value=!1}function he(){const ue=d.value.trim();ue&&(r("add",ue),c.value=!1,d.value="",a.value=!1,l.value="")}function Ce(){c.value=!1,d.value="",a.value=!1,l.value=""}function Ae(ue){if(!a.value)return;const V=o.value;if(!V)return;const ae=ue.target;ae instanceof Node&&(V.contains(ae)||(a.value=!1,l.value="",c.value=!1,d.value=""))}return lt(a,ue=>{if(!ue){c.value=!1,d.value="";return}v.value&&Jt(()=>{var V;return(V=s.value)==null?void 0:V.focus()})}),as(()=>{window.addEventListener("pointerdown",Ae)}),Fs(()=>{window.removeEventListener("pointerdown",Ae)}),(ue,V)=>(A(),L("div",{ref_key:"rootRef",ref:o,class:"composer-dropdown"},[y("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:Y},[e.selectedPrefixIcon?(A(),yt(Ef(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):Se("",!0),y("span",A$,ge(f.value),1),ze(ap,{class:"composer-dropdown-chevron"})],8,I$),a.value?(A(),L("div",{key:0,class:pt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":m.value==="up","composer-dropdown-menu-wrap-down":m.value==="down"}])},[y("div",C$,[v.value?(A(),L("div",x$,[Br(y("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":V[0]||(V[0]=ae=>l.value=ae),class:"composer-dropdown-search-input",type:"text",placeholder:k.value,onKeydown:Sn(_t(Z,["prevent"]),["esc"])},null,40,R$),[[fo,l.value]])])):Se("",!0),y("ul",M$,[(A(!0),L(Xe,null,Bt(W.value,ae=>(A(),L("li",{key:ae.value},[y("button",{class:pt(["composer-dropdown-option",{"is-selected":ae.value===e.modelValue}]),type:"button",onClick:xe=>ce(ae.value)},ge(ae.label),11,P$)]))),128)),W.value.length===0?(A(),L("li",$$," No matching projects ")):Se("",!0)]),T.value?(A(),L("div",N$,[c.value?(A(),L(Xe,{key:0},[Br(y("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":V[1]||(V[1]=ae=>d.value=ae),class:"composer-dropdown-add-input",type:"text",placeholder:O.value,onKeydown:[Sn(_t(he,["prevent"]),["enter"]),Sn(_t(Ce,["prevent"]),["esc"])]},null,40,O$),[[fo,d.value]]),y("div",{class:"composer-dropdown-add-actions"},[y("button",{type:"button",class:"composer-dropdown-add-btn",onClick:he},"Open"),y("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ce},"Cancel")])],64)):(A(),L("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:re},ge(H.value),1))])):Se("",!0)])],2)):Se("",!0)],512))}}),xs=Et(L$,[["__scopeId","data-v-ab273eac"]]),D$=["disabled"],j$={class:"search-dropdown-value"},F$={class:"search-dropdown-search-wrap"},B$=["placeholder","onKeydown"],q$={key:0,class:"search-dropdown-list",role:"listbox"},U$=["onClick","onPointerenter"],H$={class:"search-dropdown-option-check"},W$={class:"search-dropdown-option-label"},V$={key:0,class:"search-dropdown-option-desc"},z$={key:1,class:"search-dropdown-empty"},G$=An({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,o=j(null),s=j(null),i=j(null),a=j(!1),l=j(""),c=j(0),d=se(()=>n.openDirection??"down"),f=se(()=>new Set(n.selectedValues)),m=se(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const Y=n.options.find(ce=>ce.value===n.selectedValues[0]);return(Y==null?void 0:Y.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),v=se(()=>{const Y=l.value.toLowerCase().trim();return Y?n.options.filter(ce=>{var re;return ce.label.toLowerCase().includes(Y)||(((re=ce.description)==null?void 0:re.toLowerCase().includes(Y))??!1)}):n.options});function T(){const Y=s.value,ce=o.value;if(!Y||!ce||window.innerWidth>=640)return;const re=ce.getBoundingClientRect();d.value==="up"?(Y.style.setProperty("bottom",`${window.innerHeight-re.top+8}px`,"important"),Y.style.setProperty("top","auto","important")):(Y.style.setProperty("top",`${re.bottom+8}px`,"important"),Y.style.setProperty("bottom","auto","important"))}function k(){n.disabled||(a.value=!a.value,a.value&&(l.value="",c.value=0,Jt(()=>{var Y;Jt(()=>{T()}),(Y=i.value)==null||Y.focus()})))}function H(Y){r("toggle",Y.value,!f.value.has(Y.value)),a.value=!1}function P(Y){v.value.length!==0&&(c.value=(c.value+Y+v.value.length)%v.value.length)}function O(){const Y=v.value[c.value];Y&&H(Y)}function W(Y){if(!a.value)return;const ce=o.value;if(!ce)return;const re=Y.target;re instanceof Node&&(ce.contains(re)||(a.value=!1))}return lt(l,()=>{c.value=0}),as(()=>window.addEventListener("pointerdown",W)),Fs(()=>window.removeEventListener("pointerdown",W)),(Y,ce)=>(A(),L("div",{ref_key:"rootRef",ref:o,class:"search-dropdown"},[y("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:k},[y("span",j$,ge(m.value),1),ze(ap,{class:"search-dropdown-chevron"})],8,D$),a.value?(A(),L("div",{key:0,ref_key:"menuRef",ref:s,class:pt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[y("div",F$,[Br(y("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":ce[0]||(ce[0]=re=>l.value=re),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[ce[1]||(ce[1]=Sn(_t(re=>a.value=!1,["prevent"]),["escape"])),Sn(_t(O,["prevent"]),["enter"]),ce[2]||(ce[2]=Sn(_t(re=>P(1),["prevent"]),["arrow-down"])),ce[3]||(ce[3]=Sn(_t(re=>P(-1),["prevent"]),["arrow-up"]))]},null,40,B$),[[fo,l.value]])]),v.value.length>0?(A(),L("ul",q$,[(A(!0),L(Xe,null,Bt(v.value,(re,Z)=>(A(),L("li",{key:re.value},[y("button",{class:pt(["search-dropdown-option",{"is-selected":f.value.has(re.value),"is-highlighted":Z===c.value}]),type:"button",onClick:he=>H(re),onPointerenter:he=>c.value=Z},[y("span",H$,ge(f.value.has(re.value)?"✓":""),1),y("span",W$,ge(re.label),1),re.description?(A(),L("span",V$,ge(re.description),1)):Se("",!0)],42,U$)]))),128))])):(A(),L("div",z$,"No results"))],2)):Se("",!0)],512))}}),K$=Et(G$,[["__scopeId","data-v-3147b20f"]]),Y$={class:"skill-picker-header"},J$=["onKeydown"],X$={key:0,class:"skill-picker-list",role:"listbox"},Q$=["onClick","onPointerenter"],Z$={class:"skill-picker-name"},eN={key:0,class:"skill-picker-desc"},tN={key:1,class:"skill-picker-empty"},nN=An({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,o=j(null),s=j(null),i=j(""),a=j(0),l=se(()=>{const m=i.value.toLowerCase().trim();return m?n.skills.filter(v=>v.name.toLowerCase().includes(m)||v.description.toLowerCase().includes(m)):n.skills}),c=se(()=>{const m={};return n.anchorBottom!=null&&(m.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(m.left=`${n.anchorLeft}px`),m});function d(m){l.value.length!==0&&(a.value=(a.value+m+l.value.length)%l.value.length)}function f(){const m=l.value[a.value];m&&r("select",m)}return lt(()=>n.visible,m=>{m&&(i.value="",a.value=0,Jt(()=>{var v;return(v=s.value)==null?void 0:v.focus()}))}),lt(i,()=>{a.value=0}),(m,v)=>e.visible?(A(),L("div",{key:0,ref_key:"rootRef",ref:o,class:"skill-picker",style:ko(c.value)},[y("div",Y$,[Br(y("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":v[0]||(v[0]=T=>i.value=T),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[v[1]||(v[1]=Sn(_t(T=>m.$emit("close"),["prevent"]),["escape"])),Sn(_t(f,["prevent"]),["enter"]),v[2]||(v[2]=Sn(_t(T=>d(1),["prevent"]),["arrow-down"])),v[3]||(v[3]=Sn(_t(T=>d(-1),["prevent"]),["arrow-up"]))]},null,40,J$),[[fo,i.value]])]),l.value.length>0?(A(),L("ul",X$,[(A(!0),L(Xe,null,Bt(l.value,(T,k)=>(A(),L("li",{key:T.path},[y("button",{class:pt(["skill-picker-item",{"is-highlighted":k===a.value}]),type:"button",onClick:H=>m.$emit("select",T),onPointerenter:H=>a.value=k},[y("span",Z$,ge(T.name),1),T.description?(A(),L("span",eN,ge(T.description),1)):Se("",!0)],42,Q$)]))),128))])):(A(),L("div",tN,"No skills found"))],4)):Se("",!0)}}),rN=Et(nN,[["__scopeId","data-v-ff3fb7dc"]]),oN={key:0,class:"thread-composer-dictation-error"},sN={key:0,class:"thread-composer-attachments"},iN=["src","alt"],aN=["aria-label","disabled","onClick"],lN={key:1,class:"thread-composer-folder-chips"},cN=["title"],uN={class:"thread-composer-folder-chip-meta"},dN=["aria-label","disabled","onClick"],fN={key:2,class:"thread-composer-file-chips"},pN=["title"],hN=["aria-label","disabled","onClick"],mN={key:3,class:"thread-composer-skill-chips"},gN={class:"thread-composer-skill-chip-name"},vN=["aria-label","onClick"],yN={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},_N={key:1,class:"thread-composer-file-mentions"},bN=["onMousedown"],wN={key:1,class:"thread-composer-file-mention-icon-markdown"},SN={class:"thread-composer-file-mention-text"},TN={class:"thread-composer-file-mention-name"},EN={key:0,class:"thread-composer-file-mention-dir"},kN={key:1,class:"thread-composer-file-mention-empty"},IN=["placeholder","disabled"],AN=["disabled"],CN={key:0,class:"thread-composer-attach-menu"},xN=["disabled"],RN=["disabled"],MN=["disabled"],PN={class:"thread-composer-attach-mode"},$N={class:"thread-composer-attach-mode-buttons"},NN=["disabled"],ON=["disabled"],LN=["aria-checked","aria-label","disabled"],DN={class:"thread-composer-attach-setting-copy"},jN={class:"thread-composer-attach-setting-description"},FN=["aria-checked","aria-label","disabled"],BN={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},qN={key:1,class:"thread-composer-dictation-timer"},UN=["aria-label","title","disabled"],HN=["disabled"],WN=["aria-label","title","disabled"],VN=["disabled"],zN=["disabled"],GN=["disabled"],KN=2e3,YN="codex-web-local.thread-draft.v1.",JN=An({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-collaboration-mode","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,o=n,s=j(""),i=j([]),a=j([]),l=j([]),c=j([]),d=j(""),f=j(0),m=j(null),v=j(!1),{state:T,isSupported:k,recordingDurationMs:H,waveformCanvasRef:P,startRecording:O,stopRecording:W,toggleRecording:Y,cancel:ce}=u$({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:w=>{if(s.value=s.value?`${s.value}
75
+ ${w}`:w,d.value="",r.dictationAutoSend!==!1){const R=r.isTurnInProgress?ye.value:"steer";Le(R);return}Jt(()=>{var R;return(R=Ae.value)==null?void 0:R.focus()})},onEmpty:()=>{d.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:w=>{if(w instanceof DOMException&&w.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=w instanceof Error?w.message:"Dictation failed."}}),re=j(null),Z=j(null),he=j(null),Ce=j(null),Ae=j(null),{isMobile:ue}=rp(),V=j(!1),ae=j(!1),xe=j(null),Fe=j(""),_e=j([]),Me=j(!1),fe=j(0),De=j(0);let Be=0,Re=null,Ge=!1,ot=0,nt=0;const st=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let Ke="";const J=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}];function be(w){return w.trim().replace(/^gpt/i,"GPT")}const we=se(()=>r.models.map(w=>({value:w,label:be(w)}))),ve=se(()=>r.selectedCollaborationMode==="plan"),Ze=se(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),E=se(()=>r.skills??[]),I=se(()=>a.value.map(w=>w.path)),q=se(()=>(r.skills??[]).map(w=>({value:w.path,label:w.name,description:w.description}))),Q=se(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||Ze.value||f.value>0?!1:s.value.trim().length>0||i.value.length>0||l.value.length>0),ee=se(()=>s.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||c.value.length>0),te=se(()=>{const w=new Set;for(const R of c.value)for(const K of R.filePaths)w.add(K);return l.value.filter(R=>!w.has(R.fsPath))}),ie=se(()=>r.disabled||!r.activeThreadId),pe=se(()=>r.selectedModel.trim()==="gpt-5.4"),me=se(()=>r.selectedSpeedMode==="fast"&&pe.value),ne=se(()=>ie.value||r.isUpdatingSpeedMode===!0),Ue=se(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),ke=se(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),ye=j(ke.value),$e=se(()=>T.value==="recording"),x=se(()=>T.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),$=se(()=>T.value==="idle"?d.value.trim():""),D=se(()=>{const w=Math.max(0,Math.floor(H.value/1e3)),R=Math.floor(w/60),K=w%60;return`${R}:${String(K).padStart(2,"0")}`}),X=se(()=>r.activeThreadId?Ze.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),le=se(()=>s.value.trim().length>0||i.value.length>0||l.value.length>0);function Le(w="steer"){var K;const R=s.value.trim();if(Q.value){if(o("submit",{text:R,imageUrls:i.value.map(Ee=>Ee.url),fileAttachments:[...l.value],skills:a.value.map(Ee=>({name:Ee.name,path:Ee.path})),mode:w}),Qt(r.activeThreadId),Qe(),c.value=[],V.value=!1,ae.value=!1,St(),st||ue.value){(K=Ae.value)==null||K.blur();return}Jt(()=>{var Ee;return(Ee=Ae.value)==null?void 0:Ee.focus()})}}function Ne(w){ye.value=w}function rt(w){De.value+=1,s.value=w.text,i.value=w.imageUrls.map((R,K)=>({id:`queued-${Date.now()}-${K}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${K+1}`,url:R})),a.value=w.skills.map(R=>(r.skills??[]).find(K=>K.path===R.path)??{name:R.name,description:"",path:R.path}),l.value=w.fileAttachments.map(R=>({...R})),c.value=[],d.value="",m.value=null,f.value=0,V.value=!1,ae.value=!1,St(),nt+=1}function Qe(){rt({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function wt(w){return`${YN}${w}`}function Rt(w){if(typeof window>"u")return null;const R=w.trim();if(!R)return null;try{const K=window.localStorage.getItem(wt(R));if(!K)return null;const Ee=JSON.parse(K);return typeof Ee=="string"?{text:Ee,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof Ee.text=="string"?Ee.text:"",imageUrls:Array.isArray(Ee.imageUrls)?Ee.imageUrls.filter(it=>typeof it=="string"):[],fileAttachments:Array.isArray(Ee.fileAttachments)?Ee.fileAttachments.filter(it=>!!it&&typeof it.label=="string"&&typeof it.path=="string"&&typeof it.fsPath=="string"):[],skills:Array.isArray(Ee.skills)?Ee.skills.filter(it=>!!it&&typeof it.name=="string"&&typeof it.path=="string"):[]}}catch{return null}}function ct(w,R){if(typeof window>"u")return;const K=w.trim();if(K)try{if(R.text.trim().length>0||R.imageUrls.length>0||R.fileAttachments.length>0||R.skills.length>0){window.localStorage.setItem(wt(K),JSON.stringify(R));return}window.localStorage.removeItem(wt(K))}catch{}}function Qt(w){ct(w,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function mn(){return{text:s.value,imageUrls:i.value.map(w=>w.url),fileAttachments:l.value.map(w=>({...w})),skills:a.value.map(w=>({name:w.name,path:w.path}))}}function ar(){o("interrupt")}function Xn(w){o("update:selected-model",w)}function mr(){o("update:selected-collaboration-mode",ve.value?"default":"plan")}function Ut(w){o("update:selected-reasoning-effort",w)}function Zt(){ne.value||o("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function Ht(){r.dictationClickToToggle&&(d.value&&(d.value=""),Y())}function gr(w){if(r.dictationClickToToggle||(w.preventDefault(),Ge))return;Ge=!0;const R=w.currentTarget;if(R)try{R.setPointerCapture(w.pointerId)}catch{}d.value&&(d.value=""),window.addEventListener("pointerup",Wt),window.addEventListener("pointercancel",Wt),window.addEventListener("blur",Wt),O()}function Wt(){r.dictationClickToToggle||Ge&&(Ge=!1,window.removeEventListener("pointerup",Wt),window.removeEventListener("pointercancel",Wt),window.removeEventListener("blur",Wt),W())}function Yr(){ie.value||(V.value=!V.value)}function jn(){var w;(w=Z.value)==null||w.click()}function vr(){var w;(w=he.value)==null||w.click()}function Mr(){var w;(w=Ce.value)==null||w.click()}function ho(w){i.value=i.value.filter(R=>R.id!==w)}function Fn(w){a.value=a.value.filter(R=>R.path!==w)}function en(w){l.value=l.value.filter(R=>R.fsPath!==w)}function Pr(w){const R=c.value.find(Ee=>Ee.id===w);if(!R)return;const K=new Set(R.filePaths);l.value=l.value.filter(Ee=>!K.has(Ee.fsPath)),c.value=c.value.filter(Ee=>Ee.id!==w)}function Cn(w){return w.total<=0?0:Math.round(w.processed/w.total*100)}function Dt(w,R){const K=w.replace(/\\/g,"/");if(l.value.some(Ft=>Ft.fsPath===K))return;const Ee=K.split("/").filter(Boolean),it=(R==null?void 0:R.trim())||Ee[Ee.length-1]||K;l.value=[...l.value,{label:it,path:K,fsPath:K}]}function lr(w){return w.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(w.name)}function $r(w){return w?Array.from(w):[]}function gn(w){return w!==nt?!1:(f.value+=1,!0)}function Vt(w){w===nt&&(f.value=Math.max(0,f.value-1))}function Mt(w){if(w<=0)return;const R=m.value,K=R?R.succeeded+R.failed:0;if(!R||K>=R.total){m.value={total:w,succeeded:0,failed:0};return}m.value={...R,total:R.total+w}}function vn(w){const R=m.value;R&&(m.value={...R,succeeded:R.succeeded+(w==="success"?1:0),failed:R.failed+(w==="failure"?1:0)})}function dt(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function gt(w){const R=new Date,K=[R.getFullYear(),String(R.getMonth()+1).padStart(2,"0"),String(R.getDate()).padStart(2,"0"),String(R.getHours()).padStart(2,"0"),String(R.getMinutes()).padStart(2,"0"),String(R.getSeconds()).padStart(2,"0")].join("-"),Ee=w.type.startsWith("image/")&&w.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${K}.${Ee}`}function an(){const w=new Date;return`pasted-text-${[w.getFullYear(),String(w.getMonth()+1).padStart(2,"0"),String(w.getDate()).padStart(2,"0"),String(w.getHours()).padStart(2,"0"),String(w.getMinutes()).padStart(2,"0"),String(w.getSeconds()).padStart(2,"0")].join("-")}.txt`}function Bn(w){return w.name.trim()?w:new File([w],gt(w),{type:w.type||"image/png",lastModified:Date.now()})}function cr(w){return new Promise((R,K)=>{const Ee=new FileReader;Ee.onload=()=>{if(typeof Ee.result=="string"){R(Ee.result);return}K(new Error("Image read returned an unsupported result"))},Ee.onerror=()=>{K(Ee.error??new Error("Image read failed"))},Ee.readAsDataURL(w)})}async function qn(w,R){if(gn(R))try{const K=Bn(w),Ee=await cr(K);if(R!==nt)return;i.value=[...i.value,{id:dt(),name:K.name,url:Ee}],vn("success")}catch{R===nt&&vn("failure")}finally{Vt(R)}}async function xn(w,R){if(gn(R))try{const K=await sd(w);if(R!==nt)return;if(!K){vn("failure");return}Dt(K),vn("success")}catch{R===nt&&vn("failure")}finally{Vt(R)}}function ln(w){const R=$r(w);if(R.length===0)return;Mt(R.length),V.value=!1,ae.value=!1,St();const K=nt;for(const Ee of R)lr(Ee)?qn(Ee,K):xn(Ee,K)}function Un(){ot=0,v.value=!1}function ur(w){if(!w||w.length===0)return;const R=De.value;for(const K of Array.from(w))if(lr(K)){const Ee=new FileReader;Ee.onload=()=>{R===De.value&&typeof Ee.result=="string"&&i.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:K.name,url:Ee.result})},Ee.readAsDataURL(K)}else sd(K).then(Ee=>{R===De.value&&Ee&&Dt(Ee)}).catch(()=>{})}function Nr(w){return w?Array.from(w.types??[]).includes("Files"):!1}async function Hn(w){if(!w||w.length===0)return;const R=De.value,K=Array.from(w),it=(K[0].webkitRelativePath||K[0].name).split("/").filter(Boolean)[0]||"Folder",Ft=`${Date.now()}-${Math.random().toString(36).slice(2)}`;c.value=[...c.value,{id:Ft,name:it,total:K.length,processed:0,filePaths:[],isUploading:!0}];const Gt=Pt=>{R===De.value&&(c.value=c.value.map(wn=>wn.id===Ft?Pt(wn):wn))};for(const Pt of K)try{const wn=await sd(Pt);if(R!==De.value)return;if(wn){const Qr=Pt.webkitRelativePath||Pt.name;Dt(wn,Qr),Gt(ds=>({...ds,processed:ds.processed+1,filePaths:[...ds.filePaths,wn]}));continue}Gt(Qr=>({...Qr,processed:Qr.processed+1}))}catch{Gt(wn=>({...wn,processed:wn.processed+1}))}Gt(Pt=>({...Pt,isUploading:!1}))}function En(w){w&&(w.value="")}function Qn(w){const R=w.target;ur((R==null?void 0:R.files)??null),En(R),V.value=!1}function yn(w){const R=w.target;ur((R==null?void 0:R.files)??null),En(R),V.value=!1}function _n(w){const R=w.target;Hn((R==null?void 0:R.files)??null),En(R),V.value=!1}function Rn(w){ie.value||!Nr(w.dataTransfer)||(w.preventDefault(),ot+=1,v.value=!0)}function bn(w){ie.value||!Nr(w.dataTransfer)||(w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="copy"),v.value=!0)}function yr(w){v.value&&(w.preventDefault(),ot=Math.max(0,ot-1),ot===0&&Un())}function Jr(w){var R;ie.value||!Nr(w.dataTransfer)||(w.preventDefault(),Un(),ln(((R=w.dataTransfer)==null?void 0:R.files)??null))}function Nt(){!v.value&&ot===0||Un()}function on(w){var Ft,Gt;if(ie.value)return;const R=((Ft=w.clipboardData)==null?void 0:Ft.getData("text/plain"))??"";if(R.length>=KN){w.preventDefault();const Pt=new File([R],an(),{type:"text/plain",lastModified:Date.now()});ln([Pt]);return}const K=Array.from(((Gt=w.clipboardData)==null?void 0:Gt.items)??[]);if(K.length===0)return;const Ee=R.length>0,it=K.filter(Pt=>Pt.kind==="file"&&Pt.type.startsWith("image/")).map(Pt=>Pt.getAsFile()).filter(Pt=>Pt instanceof File);it.length!==0&&(Ee||w.preventDefault(),ln(it))}function Wn(){d.value&&(d.value="");const R=s.value.startsWith("/");R!==ae.value&&(ae.value=R),Or()}function qe(w){if(Me.value){if(w.key==="Escape"){w.preventDefault(),St();return}if(w.key==="ArrowDown"){w.preventDefault(),_e.value.length>0&&(fe.value=(fe.value+1)%_e.value.length);return}if(w.key==="ArrowUp"){if(w.preventDefault(),_e.value.length>0){const K=_e.value.length;fe.value=(fe.value+K-1)%K}return}if(w.key==="Enter"||w.key==="Tab"){w.preventDefault();const K=_e.value[fe.value];K?Zn(K):St();return}}if(r.sendWithEnter!==!1?w.key==="Enter"&&!w.shiftKey:w.key==="Enter"&&(w.metaKey||w.ctrlKey)){w.preventDefault(),Le(r.isTurnInProgress?ye.value:"steer");return}if(ae.value){if(w.key==="Escape"){w.preventDefault(),Te();return}if(w.key==="ArrowDown"||w.key==="ArrowUp"){w.preventDefault();return}}}function Te(){var w;ae.value=!1,(w=Ae.value)==null||w.focus()}function St(){Me.value=!1,xe.value=null,Fe.value="",_e.value=[],fe.value=0}function Or(){const w=Ae.value;if(!w){St();return}const R=w.selectionStart??s.value.length,Ee=s.value.slice(0,R).match(/(^|\s)(@[^\s@]*)$/);if(!Ee){St();return}const it=Ee[2]??"",Ft=it.length,Gt=R-Ft;xe.value=Gt,Fe.value=it.slice(1),Me.value=!0,Lr()}async function Lr(){if(!Me.value)return;const w=(r.cwd??"").trim();if(!w){_e.value=[];return}Re&&clearTimeout(Re);const R=++Be;Re=setTimeout(async()=>{try{const K=await eM(w,Fe.value,20);if(!Me.value||R!==Be)return;_e.value=K,fe.value=0}catch{if(!Me.value||R!==Be)return;_e.value=[]}},120)}function Zn(w){const R=Ae.value,K=xe.value;if(K!==null&&R){const Ee=R.selectionStart??s.value.length;s.value=`${s.value.slice(0,K)}${s.value.slice(Ee)}`.trimEnd()}Dt(w.path),St(),Jt(()=>R==null?void 0:R.focus())}function er(w){ce(),rt(w),Jt(()=>{var R;return(R=Ae.value)==null?void 0:R.focus()})}function Xr(w){const R=w.trim();R&&(ce(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
76
+ ${R}`:s.value=R,Jt(()=>{var K;return(K=Ae.value)==null?void 0:K.focus()}))}function _r(w){const R=w.lastIndexOf("/");return R<0?w:w.slice(R+1)}function Mn(w){const R=w.lastIndexOf("/");return R<=0?"":w.slice(0,R)}function qt(w){const R=_r(w),K=R.lastIndexOf(".");return K<=0?"":R.slice(K+1).toLowerCase()}function zt(w){const R=qt(w);return R==="ts"?"TS":R==="tsx"?"TSX":R==="js"?"JS":R==="jsx"?"JSX":R==="json"?"{}":""}function br(w){const R=qt(w);return R.startsWith("ts")?"ts":R.startsWith("js")?"js":R==="json"?"json":"default"}function S(w){const R=qt(w);return R==="md"||R==="mdx"}function C(w){var R;a.value.some(K=>K.path===w.path)||(a.value=[...a.value,w]),s.value=s.value.startsWith("/")?"":s.value,ae.value=!1,(R=Ae.value)==null||R.focus()}function N(w,R){if(R){const K=(r.skills??[]).find(Ee=>Ee.path===w);K&&!a.value.some(Ee=>Ee.path===w)&&(a.value=[...a.value,K])}else a.value=a.value.filter(K=>K.path!==w)}function z(w){if(!V.value)return;const R=re.value;if(!R)return;const K=w.target;!K||R.contains(K)||(V.value=!1)}return as(()=>{document.addEventListener("click",z),window.addEventListener("drop",Nt),window.addEventListener("dragend",Nt),window.addEventListener("blur",Nt)}),t({hydrateDraft:er,appendTextToDraft:Xr,hasUnsavedDraft:()=>ee.value}),Fs(()=>{document.removeEventListener("click",z),window.removeEventListener("drop",Nt),window.removeEventListener("dragend",Nt),window.removeEventListener("blur",Nt),window.removeEventListener("pointerup",Wt),window.removeEventListener("pointercancel",Wt),window.removeEventListener("blur",Wt),Re&&clearTimeout(Re)}),lt(()=>r.activeThreadId,w=>{ce(),Ke&&ct(Ke,mn()),Qe();const R=Rt(w);R&&(rt(R),Wn()),Ke=w.trim()},{immediate:!0}),lt([s,i,l,a],()=>{Ke&&ct(Ke,mn())},{deep:!0}),lt(()=>r.cwd,()=>{Me.value&&Lr()}),lt(ke,w=>{ye.value=w}),(w,R)=>(A(),L("form",{class:"thread-composer",onSubmit:R[4]||(R[4]=_t(K=>Le(e.isTurnInProgress?ye.value:"steer"),["prevent"]))},[$.value?(A(),L("p",oN,ge($.value),1)):Se("",!0),y("div",{class:pt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":v.value}])},[i.value.length>0?(A(),L("div",sN,[(A(!0),L(Xe,null,Bt(i.value,K=>(A(),L("div",{key:K.id,class:"thread-composer-attachment"},[y("img",{class:"thread-composer-attachment-image",src:K.url,alt:K.name||"Selected image"},null,8,iN),y("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${K.name||"image"}`,disabled:ie.value,onClick:Ee=>ho(K.id)}," x ",8,aN)]))),128))])):Se("",!0),c.value.length>0?(A(),L("div",lN,[(A(!0),L(Xe,null,Bt(c.value,K=>(A(),L("span",{key:K.id,class:"thread-composer-folder-chip"},[ze(lp,{class:"thread-composer-folder-chip-icon"}),y("span",{class:"thread-composer-folder-chip-name",title:K.name},ge(K.name),9,cN),y("span",uN,[K.isUploading?(A(),L(Xe,{key:0},[$s(ge(Cn(K))+"% uploading ("+ge(K.processed)+"/"+ge(K.total)+") ",1)],64)):(A(),L(Xe,{key:1},[$s(ge(K.filePaths.length)+" file"+ge(K.filePaths.length===1?"":"s"),1)],64))]),y("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${K.name}`,disabled:ie.value,onClick:Ee=>Pr(K.id)},"×",8,dN)]))),128))])):Se("",!0),te.value.length>0?(A(),L("div",fN,[(A(!0),L(Xe,null,Bt(te.value,K=>(A(),L("span",{key:K.fsPath,class:"thread-composer-file-chip"},[ze(ac,{class:"thread-composer-file-chip-icon"}),y("span",{class:"thread-composer-file-chip-name",title:K.fsPath},ge(K.label),9,pN),y("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${K.label}`,disabled:ie.value,onClick:Ee=>en(K.fsPath)},"×",8,hN)]))),128))])):Se("",!0),a.value.length>0?(A(),L("div",mN,[(A(!0),L(Xe,null,Bt(a.value,K=>(A(),L("span",{key:K.path,class:"thread-composer-skill-chip"},[y("span",gN,ge(K.name),1),y("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${K.name}`,onClick:Ee=>Fn(K.path)},"×",8,vN)]))),128))])):Se("",!0),y("div",{class:pt(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":v.value}]),onDragenter:Rn,onDragover:bn,onDragleave:yr,onDrop:Jr},[v.value?(A(),L("div",yN,[...R[5]||(R[5]=[y("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):Se("",!0),Me.value?(A(),L("div",_N,[_e.value.length>0?(A(!0),L(Xe,{key:0},Bt(_e.value,(K,Ee)=>(A(),L("button",{key:K.path,class:pt(["thread-composer-file-mention-row",{"is-active":Ee===fe.value}]),type:"button",onMousedown:_t(it=>Zn(K),["prevent"])},[zt(K.path)?(A(),L("span",{key:0,class:pt(["thread-composer-file-mention-icon-badge",`is-${br(K.path)}`])},ge(zt(K.path)),3)):S(K.path)?(A(),L("span",wN,"↓")):(A(),yt(ac,{key:2,class:"thread-composer-file-mention-icon-file"})),y("span",SN,[y("span",TN,ge(_r(K.path)),1),Mn(K.path)?(A(),L("span",EN,ge(Mn(K.path)),1)):Se("",!0)])],42,bN))),128)):(A(),L("div",kN,"No matching files"))])):Se("",!0),Br(y("textarea",{ref_key:"inputRef",ref:Ae,"onUpdate:modelValue":R[0]||(R[0]=K=>s.value=K),class:"thread-composer-input",placeholder:X.value,disabled:ie.value,onInput:Wn,onKeydown:qe,onPaste:on},null,40,IN),[[fo,s.value]]),ze(rN,{skills:E.value,visible:ae.value,"anchor-bottom":44,"anchor-left":0,onSelect:C,onClose:Te},null,8,["skills","visible"])],34),y("div",{class:pt(["thread-composer-controls",{"thread-composer-controls--recording":$e.value}])},[y("div",{ref_key:"attachMenuRootRef",ref:re,class:"thread-composer-attach"},[y("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:ie.value,onClick:Yr}," + ",8,AN),V.value?(A(),L("div",CN,[y("button",{class:"thread-composer-attach-item",type:"button",disabled:ie.value,onClick:jn}," Add photos & files ",8,xN),y("button",{class:"thread-composer-attach-item",type:"button",disabled:ie.value,onClick:Mr}," Add folder ",8,RN),y("button",{class:"thread-composer-attach-item",type:"button",disabled:ie.value,onClick:vr}," Take photo ",8,MN),R[9]||(R[9]=y("div",{class:"thread-composer-attach-separator"},null,-1)),y("div",PN,[R[6]||(R[6]=y("span",{class:"thread-composer-attach-mode-label"},"In-progress send",-1)),y("div",$N,[y("button",{class:pt(["thread-composer-attach-mode-button",{"is-active":ye.value==="steer"}]),type:"button",disabled:ie.value,onClick:R[1]||(R[1]=K=>Ne("steer"))}," Steer ",10,NN),y("button",{class:pt(["thread-composer-attach-mode-button",{"is-active":ye.value==="queue"}]),type:"button",disabled:ie.value,onClick:R[2]||(R[2]=K=>Ne("queue"))}," Queue ",10,ON)])]),R[10]||(R[10]=y("div",{class:"thread-composer-attach-separator"},null,-1)),pe.value?(A(),L("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`Fast mode ${e.selectedSpeedMode==="fast"?"enabled":"disabled"}`,disabled:ne.value,onClick:Zt},[y("span",DN,[R[7]||(R[7]=y("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),y("span",jN,ge(Ue.value),1)]),y("span",{class:pt(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":ne.value}])},null,2)],8,LN)):Se("",!0),y("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":ve.value,"aria-label":ve.value?"Disable plan mode":"Enable plan mode",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:mr},[R[8]||(R[8]=y("span",{class:"thread-composer-attach-setting-copy"},[y("span",{class:"thread-composer-attach-setting-label"},"Plan mode"),y("span",{class:"thread-composer-attach-setting-description"},"Agent proposes a plan before acting")],-1)),y("span",{class:pt(["thread-composer-attach-switch",{"is-on":ve.value}])},null,2)],8,FN)])):Se("",!0)],512),$e.value?Se("",!0):(A(),L(Xe,{key:0},[ze(xs,{class:"thread-composer-control","model-value":e.selectedModel,options:we.value,"selected-prefix-icon":me.value?y$:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Xn},null,8,["model-value","options","selected-prefix-icon","disabled"]),ze(K$,{class:"thread-composer-control",options:q.value,"selected-values":I.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:N},null,8,["options","selected-values","disabled"]),ze(xs,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:J,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Ut},null,8,["model-value","disabled"])],64)),y("div",{class:pt(["thread-composer-actions",{"thread-composer-actions--recording":$e.value}])},[He(T)==="recording"?(A(),L("div",BN,[y("canvas",{ref_key:"dictationWaveformCanvasRef",ref:P,class:"thread-composer-dictation-waveform"},null,512)])):Se("",!0),He(T)==="recording"?(A(),L("span",qN,ge(D.value),1)):Se("",!0),He(k)?(A(),L("button",{key:2,class:pt(["thread-composer-mic",{"thread-composer-mic--active":He(T)==="recording"}]),type:"button","aria-label":x.value,title:x.value,disabled:ie.value,onClick:Ht,onPointerdown:gr,onPointerup:Wt,onPointercancel:Wt},[He(T)==="recording"?(A(),yt(Xm,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(A(),yt(S$,{key:1,class:"thread-composer-mic-icon"}))],42,UN)):Se("",!0),e.isTurnInProgress&&!le.value?(A(),L("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:ar},[ze(Xm,{class:"thread-composer-stop-icon"})],8,HN)):(A(),L("button",{key:4,class:pt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&ye.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&ye.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${ye.value}`:"Send",disabled:!Q.value,onClick:R[3]||(R[3]=K=>Le(e.isTurnInProgress?ye.value:"steer"))},[ze(h$,{class:"thread-composer-submit-icon"})],10,WN))],2)],2)],2),y("input",{ref_key:"photoLibraryInputRef",ref:Z,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:ie.value,onChange:Qn},null,40,VN),y("input",{ref_key:"cameraCaptureInputRef",ref:he,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:ie.value,onChange:yn},null,40,zN),y("input",{ref_key:"folderPickerInputRef",ref:Ce,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:ie.value,onChange:_n},null,40,GN)],32))}}),Qm=Et(JN,[["__scopeId","data-v-25d88825"]]),XN={key:0,class:"thread-pending-request"},QN={class:"thread-pending-request-title"},ZN=["title"],eO={class:"thread-pending-request-approval"},tO={class:"thread-pending-request-options",role:"radiogroup","aria-label":"Approval choices"},nO=["aria-pressed","onClick"],rO={class:"thread-pending-request-option-index"},oO={class:"thread-pending-request-option-label"},sO={class:"thread-pending-request-footer thread-pending-request-footer--approval"},iO=["value"],aO={class:"thread-pending-request-header"},lO={class:"thread-pending-request-heading"},cO={class:"thread-pending-request-eyebrow"},uO={class:"thread-pending-request-title"},dO={key:0,class:"thread-pending-request-counter"},fO={key:0,class:"thread-pending-request-preview"},pO={class:"thread-pending-request-preview-code"},hO={key:1,class:"thread-pending-request-user-input"},mO={key:0,class:"thread-pending-request-question-description"},gO=["href"],vO={class:"thread-pending-request-question-title"},yO={key:0},_O={key:0,class:"thread-pending-request-question-text"},bO={key:1,class:"thread-pending-request-input-wrap"},wO=["type","value","onInput"],SO={key:2,class:"thread-pending-request-select-wrap"},TO=["value","onChange"],EO={key:0,value:""},kO={key:3,class:"thread-pending-request-select-wrap"},IO=["value","onChange"],AO={key:0,value:""},CO=["value"],xO={key:4,class:"thread-pending-request-question-options"},RO=["checked","onChange"],MO={class:"thread-pending-request-checkbox-label"},PO={key:2,class:"thread-pending-request-validation-error"},$O={class:"thread-pending-request-footer"},NO={key:2,class:"thread-pending-request-user-input"},OO={class:"thread-pending-request-question-title"},LO={key:0,class:"thread-pending-request-question-text"},DO={key:1,class:"thread-pending-request-question-options"},jO={class:"thread-pending-request-select-wrap"},FO=["value","onChange"],BO=["value"],qO={key:0,class:"thread-pending-request-question-description"},UO={key:2,class:"thread-pending-request-input-wrap"},HO=["value","onInput"],WO={class:"thread-pending-request-footer"},VO={key:3,class:"thread-pending-request-actions"},zO={key:4,class:"thread-pending-request-actions"},GO=An({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,o=j("accept"),s=j(""),i=j({}),a=j({}),l=j({}),c=j("");function d(x){return x!==null&&typeof x=="object"&&!Array.isArray(x)?x:null}function f(x){return typeof x=="string"?x.trim():""}function m(x){return typeof x=="string"?x:null}function v(x){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(x)?x:JSON.stringify(x)}function T(x){const D=(Array.isArray(x.commandActions)?x.commandActions:[]).map(X=>d(X)).map(X=>f(X==null?void 0:X.command)).find(X=>X.length>0);if(D)return D.replace(/\s+/g," ").trim();if(Array.isArray(x.command)){const X=x.command.filter(le=>typeof le=="string").map(le=>le.trim()).filter(le=>le.length>0);if(X.length>0)return X.map(le=>v(le)).join(" ")}return Z(f(x.command))}function k(x){return x.method==="item/commandExecution/requestApproval"||x.method==="execCommandApproval"}function H(x){return x.method==="item/fileChange/requestApproval"||x.method==="applyPatchApproval"}function P(x){return x.method==="item/permissions/requestApproval"}function O(x){return k(x)||H(x)||P(x)}function W(x){return x.method==="mcpServer/elicitation/request"}function Y(x){const $=d(x.params);return f($==null?void 0:$.reason)||f($==null?void 0:$.prompt)||f($==null?void 0:$.message)}function ce(x){return O(x)?"Awaiting approval":W(x)?"MCP server input required":x.method==="item/tool/requestUserInput"?"Awaiting response":x.method==="item/tool/call"?"Tool call waiting for response":x.method}function re(x){const $=Y(x);return $||(k(x)?"Do you want to run this command?":H(x)?"Do you want to make these changes?":P(x)?"Do you want to grant these permissions?":W(x)?"An MCP server needs your input before Codex can continue.":x.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function Z(x){var Le;const $=x.trim();if(!$)return"";const D=$.match(/-Command\s+(.+)$/i),X=((Le=D==null?void 0:D[1])==null?void 0:Le.trim())??$;return(X.startsWith('"')&&X.endsWith('"')?X.slice(1,-1):X).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function he(x){const $=d(x.params);if(!$)return"";if(k(x))return T($);if(H(x)){const D=f($.grantRoot)||f($.grant_root);if(D)return D.replace(/\s+/g," ").trim();const X=d($.fileChanges)??d($.changes);if(!X)return"";const le=Object.keys(X).map(Le=>Le.trim()).filter(Le=>Le.length>0);return le.length===0?"":le.slice(0,3).join(", ")}return P(x)?Ce($.permissions):W(x)?f($.serverName)||f($.url):""}function Ce(x){const $=d(x);if(!$)return"";const D=[],X=d($.fileSystem),le=d($.network),Le=Array.isArray(X==null?void 0:X.read)?X.read.filter(rt=>typeof rt=="string"):[],Ne=Array.isArray(X==null?void 0:X.write)?X.write.filter(rt=>typeof rt=="string"):[];return Le.length>0&&D.push(`Read: ${Le.join(", ")}`),Ne.length>0&&D.push(`Write: ${Ne.join(", ")}`),(le==null?void 0:le.enabled)===!0&&D.push("Network access"),D.join(" • ")}function Ae(x){return!x||!O(x)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const ue=se(()=>Ae(n.request));lt(()=>{var x;return((x=n.request)==null?void 0:x.id)??0},()=>{var x;s.value="",i.value={},a.value={},l.value={},c.value="",o.value=((x=ue.value[0])==null?void 0:x.id)??"accept"},{immediate:!0}),lt(ue,x=>{var $;o.value!=="decline"&&(x.some(D=>D.id===o.value)||(o.value=(($=x[0])==null?void 0:$.id)??"accept"))},{immediate:!0});function V(x,$){return`${String(x)}:${$}`}function ae(x){const $=d(x.params),D=Array.isArray($==null?void 0:$.questions)?$.questions:[],X=[];for(const le of D){const Le=d(le);if(!Le)continue;const Ne=f(Le.id);if(!Ne)continue;const rt=Array.isArray(Le.options)?Le.options.map(Qe=>d(Qe)).map(Qe=>({label:f(Qe==null?void 0:Qe.label),description:f(Qe==null?void 0:Qe.description)})).filter(Qe=>Qe.label.length>0):[];X.push({id:Ne,header:f(Le.header),question:f(Le.question),isOther:Le.isOther===!0,options:rt})}return X}function xe(x,$,D){const X=V(x,$),le=i.value[X];return typeof le=="string"&&le.length>0?le:D}function Fe(x,$){return a.value[V(x,$)]??""}function _e(x,$,D){const X=D.target;if(!(X instanceof HTMLSelectElement))return;const le=V(x,$);i.value={...i.value,[le]:X.value}}function Me(x,$,D){const X=D.target;if(!(X instanceof HTMLInputElement))return;const le=V(x,$);a.value={...a.value,[le]:X.value}}function fe(x,$,D){var le,Le;const X=xe(x,$,((le=D[0])==null?void 0:le.label)||"");return((Le=D.find(Ne=>Ne.label===X))==null?void 0:Le.description)??""}function De(x,$){return`${String(x)}:${$}`}function Be(x){var $;return f(($=d(x.params))==null?void 0:$.serverName)}function Re(x){var D;const $=f((D=d(x.params))==null?void 0:D.url);if(!$)return"";try{const X=new URL($),le=X.protocol.toLowerCase();return le==="https:"||le==="http:"?X.toString():""}catch{return""}}function Ge(x){const $=d(x.params),D=d($==null?void 0:$.requestedSchema),X=d(D==null?void 0:D.properties);if(!X)return[];const le=new Set(Array.isArray(D==null?void 0:D.required)?D.required.filter(Le=>typeof Le=="string"):[]);return Object.entries(X).map(([Le,Ne])=>ot(Le,d(Ne),le.has(Le))).filter(Le=>Le!==null)}function ot(x,$,D){if(!$)return null;const X=f($.title)||x,le=f($.description),Le=f($.type);if(Le==="boolean")return{key:x,label:X,description:le,required:D,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof $.default=="boolean"?$.default:null,hasExplicitDefault:typeof $.default=="boolean"};if(Le==="number"||Le==="integer")return{key:x,label:X,description:le,required:D,kind:"number",inputType:"number",options:[],defaultValue:typeof $.default=="number"?$.default:null,hasExplicitDefault:typeof $.default=="number"};const Ne=nt($);if(Le==="array")return{key:x,label:X,description:le,required:D,kind:"multiEnum",inputType:"checkbox",options:Ne,defaultValue:Array.isArray($.default)?$.default.filter(Qe=>typeof Qe=="string"):[],hasExplicitDefault:Array.isArray($.default)};const rt=m($.default);return Ne.length>0?{key:x,label:X,description:le,required:D,kind:"singleEnum",inputType:"select",options:Ne,defaultValue:rt,hasExplicitDefault:rt!==null}:{key:x,label:X,description:le,required:D,kind:"string",inputType:st($),options:[],defaultValue:rt,hasExplicitDefault:rt!==null}}function nt(x){const D=(Array.isArray(x.oneOf)?x.oneOf:Array.isArray(x.anyOf)?x.anyOf:[]).map(Ne=>d(Ne)).map(Ne=>({value:f(Ne==null?void 0:Ne.const),label:f(Ne==null?void 0:Ne.title)||f(Ne==null?void 0:Ne.const)})).filter(Ne=>Ne.value.length>0);if(D.length>0)return D;const X=d(x.items);if(X){const Ne=nt(X);if(Ne.length>0)return Ne}const le=Array.isArray(x.enum)?x.enum.filter(Ne=>typeof Ne=="string"):[],Le=Array.isArray(x.enumNames)?x.enumNames.filter(Ne=>typeof Ne=="string"):[];return le.map((Ne,rt)=>({value:Ne,label:Le[rt]||Ne}))}function st(x){const $=f(x.format);return $==="email"?"email":$==="uri"?"url":$==="date"?"date":$==="date-time"?"datetime-local":"text"}function Ke(x,$){const D=l.value[De(x,$.key)];return D!==void 0?D:$.defaultValue}function J(x,$){const D=Ke(x,$);return Array.isArray(D)?D.filter(X=>typeof X=="string"):[]}function be(x,$,D){const X=D.target;if(!(X instanceof HTMLInputElement)&&!(X instanceof HTMLSelectElement))return;const le=X.value,Le=($.kind==="number",le);l.value={...l.value,[De(x,$.key)]:le.length>0?Le:null},c.value=""}function we(x,$,D){const X=D.target;if(!(X instanceof HTMLSelectElement))return;let le=null;X.value==="true"?le=!0:X.value==="false"&&(le=!1),l.value={...l.value,[De(x,$.key)]:le},c.value=""}function ve(x,$,D,X){const le=X.target;if(!(le instanceof HTMLInputElement))return;const Le=new Set(J(x,$));le.checked?Le.add(D):Le.delete(D),l.value={...l.value,[De(x,$.key)]:Array.from(Le)},c.value=""}function Ze(x){return x===!0?"true":x===!1?"false":""}function E(x,$){const D=Ke(x,$);return $.kind==="multiEnum"?Array.isArray(D)&&D.length>0:$.kind==="boolean"?typeof D=="boolean":$.kind==="number"&&typeof D=="number"?!0:typeof D=="string"&&D.trim().length>0}function I(x){const $=Ge(x).filter(D=>D.required&&!E(x.id,D)).map(D=>D.label);return $.length===0?"":$.length===1?`Answer the required field: ${$[0]}.`:`Answer the required fields: ${$.join(", ")}.`}function q(x){const $={};for(const D of Ge(x)){const X=Ke(x.id,D);if(D.kind==="multiEnum"){const Le=Array.isArray(X)?X:[];(Le.length>0||D.required)&&($[D.key]=Le);continue}if(D.kind==="boolean"){typeof X=="boolean"&&($[D.key]=X);continue}if(D.kind==="number"){const Le=typeof X=="number"?X:Number(String(X).trim());Number.isNaN(Le)||($[D.key]=Le);continue}const le=String(X??"").trim();(le.length>0||D.required)&&($[D.key]=le)}return $}function Q(x){o.value=x}function ee(){o.value="decline"}function te(x){const $=x.target;$ instanceof HTMLInputElement&&(s.value=$.value,o.value="decline")}function ie(x,$){var D;if(P(x)){if($==="decline"||$==="cancel"){r("respondServerRequest",{id:x.id,error:{code:-32e3,message:$==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const X=d((D=d(x.params))==null?void 0:D.permissions)??{};r("respondServerRequest",{id:x.id,result:{permissions:X,scope:$==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:x.id,result:{decision:$}})}function pe(x){const $=s.value.trim(),D=$.length>0?"decline":o.value;if(P(x)){ie(x,D);return}r("respondServerRequest",{id:x.id,result:{decision:D},followUpMessageText:$||void 0})}function me(x,$){const D=d(x.params),X={action:$};if($==="accept"&&f(D==null?void 0:D.mode)==="form"){const le=I(x);if(le){c.value=le;return}X.content=q(x)}r("respondServerRequest",{id:x.id,result:X})}function ne(x){var X;const $=ae(x),D={};for(const le of $){const Le=xe(x.id,le.id,((X=le.options[0])==null?void 0:X.label)||""),Ne=Fe(x.id,le.id).trim(),rt=[Le,Ne].map(Qe=>Qe.trim()).filter(Qe=>Qe.length>0);D[le.id]={answers:rt}}r("respondServerRequest",{id:x.id,result:{answers:D}})}function Ue(x){r("respondServerRequest",{id:x.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function ke(x){r("respondServerRequest",{id:x.id,result:{success:!0,contentItems:[]}})}function ye(x){r("respondServerRequest",{id:x.id,result:{}})}function $e(x){r("respondServerRequest",{id:x.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(x,$)=>e.request?(A(),L("section",XN,[y("article",{class:pt(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[O(e.request)?(A(),L(Xe,{key:0},[y("p",QN,ge(re(e.request)),1),he(e.request)?(A(),L("p",{key:0,class:"thread-pending-request-command-line",title:he(e.request)},ge(he(e.request)),9,ZN)):Se("",!0),y("section",eO,[y("div",tO,[(A(!0),L(Xe,null,Bt(ue.value,(D,X)=>(A(),L("button",{key:D.id,type:"button",class:pt(["thread-pending-request-option",{"is-selected":o.value===D.id}]),"aria-pressed":o.value===D.id,onClick:le=>Q(D.id)},[y("span",rO,ge(X+1)+".",1),y("span",oO,ge(D.label),1)],10,nO))),128))]),y("footer",sO,[y("label",{class:pt(["thread-pending-request-inline-input",{"is-active":o.value==="decline"||s.value.length>0}])},[$[11]||($[11]=y("span",{class:"thread-pending-request-option-index"},"3.",-1)),y("input",{class:"thread-pending-request-inline-control",type:"text",value:s.value,placeholder:"No, and tell Codex what to do differently",onFocus:ee,onInput:te,onKeydown:$[0]||($[0]=Sn(_t(D=>pe(e.request),["prevent"]),["enter"]))},null,40,iO)],2),y("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[1]||($[1]=D=>ie(e.request,"cancel"))}," Skip "),y("button",{type:"button",class:"thread-pending-request-primary",onClick:$[2]||($[2]=D=>pe(e.request))}," Send ")])])],64)):(A(),L(Xe,{key:1},[y("header",aO,[y("div",lO,[y("p",cO,ge(ce(e.request)),1),y("p",uO,ge(re(e.request)),1)]),(e.requestCount??0)>1?(A(),L("span",dO,ge(e.requestCount??0)+" pending",1)):Se("",!0)]),he(e.request)?(A(),L("div",fO,[y("code",pO,ge(he(e.request)),1)])):Se("",!0),e.request.method==="mcpServer/elicitation/request"?(A(),L("section",hO,[Be(e.request)?(A(),L("p",mO," Server: "+ge(Be(e.request)),1)):Se("",!0),Re(e.request)?(A(),L("a",{key:1,class:"thread-pending-request-link",href:Re(e.request),target:"_blank",rel:"noopener noreferrer"}," Open authorization link ",8,gO)):Se("",!0),(A(!0),L(Xe,null,Bt(Ge(e.request),D=>(A(),L("div",{key:`${e.request.id}:${D.key}`,class:"thread-pending-request-question"},[y("p",vO,[$s(ge(D.label),1),D.required?(A(),L("span",yO," *")):Se("",!0)]),D.description?(A(),L("p",_O,ge(D.description),1)):Se("",!0),D.kind==="string"||D.kind==="number"?(A(),L("label",bO,[$[12]||($[12]=y("span",{class:"thread-pending-request-select-label"},"Value",-1)),y("input",{class:"thread-pending-request-input",type:D.inputType,value:String(Ke(e.request.id,D)??""),onInput:X=>be(e.request.id,D,X)},null,40,wO)])):D.kind==="boolean"?(A(),L("label",SO,[$[15]||($[15]=y("span",{class:"thread-pending-request-select-label"},"Choice",-1)),y("select",{class:"thread-pending-request-select",value:Ze(Ke(e.request.id,D)),onChange:X=>we(e.request.id,D,X)},[D.hasExplicitDefault?Se("",!0):(A(),L("option",EO,"Select true or false")),$[13]||($[13]=y("option",{value:"true"},"True",-1)),$[14]||($[14]=y("option",{value:"false"},"False",-1))],40,TO)])):D.kind==="singleEnum"?(A(),L("label",kO,[$[16]||($[16]=y("span",{class:"thread-pending-request-select-label"},"Choice",-1)),y("select",{class:"thread-pending-request-select",value:String(Ke(e.request.id,D)??""),onChange:X=>be(e.request.id,D,X)},[D.hasExplicitDefault?Se("",!0):(A(),L("option",AO,"Select an option")),(A(!0),L(Xe,null,Bt(D.options,X=>(A(),L("option",{key:`${e.request.id}:${D.key}:${X.value}`,value:X.value},ge(X.label),9,CO))),128))],40,IO)])):(A(),L("div",xO,[(A(!0),L(Xe,null,Bt(D.options,X=>(A(),L("label",{key:`${e.request.id}:${D.key}:${X.value}`,class:"thread-pending-request-checkbox-row"},[y("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:J(e.request.id,D).includes(X.value),onChange:le=>ve(e.request.id,D,X.value,le)},null,40,RO),y("span",MO,ge(X.label),1)]))),128))]))]))),128)),c.value?(A(),L("p",PO,ge(c.value),1)):Se("",!0),y("footer",$O,[y("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[3]||($[3]=D=>me(e.request,"cancel"))}," Cancel "),y("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[4]||($[4]=D=>me(e.request,"decline"))}," Decline "),y("button",{type:"button",class:"thread-pending-request-primary",onClick:$[5]||($[5]=D=>me(e.request,"accept"))}," Continue ")])])):e.request.method==="item/tool/requestUserInput"?(A(),L("section",NO,[(A(!0),L(Xe,null,Bt(ae(e.request),D=>{var X;return A(),L("div",{key:`${e.request.id}:${D.id}`,class:"thread-pending-request-question"},[y("p",OO,ge(D.header||D.question),1),D.question?(A(),L("p",LO,ge(D.question),1)):Se("",!0),D.options.length>0?(A(),L("div",DO,[y("label",jO,[$[17]||($[17]=y("span",{class:"thread-pending-request-select-label"},"Choice",-1)),y("select",{class:"thread-pending-request-select",value:xe(e.request.id,D.id,((X=D.options[0])==null?void 0:X.label)||""),onChange:le=>_e(e.request.id,D.id,le)},[(A(!0),L(Xe,null,Bt(D.options,le=>(A(),L("option",{key:`${e.request.id}:${D.id}:${le.label}`,value:le.label},ge(le.label),9,BO))),128))],40,FO)]),fe(e.request.id,D.id,D.options)?(A(),L("p",qO,ge(fe(e.request.id,D.id,D.options)),1)):Se("",!0)])):Se("",!0),D.isOther?(A(),L("label",UO,[$[18]||($[18]=y("span",{class:"thread-pending-request-select-label"},"Other answer",-1)),y("input",{class:"thread-pending-request-input",type:"text",value:Fe(e.request.id,D.id),placeholder:"Other answer",onInput:le=>Me(e.request.id,D.id,le)},null,40,HO)])):Se("",!0)])}),128)),y("footer",WO,[y("button",{type:"button",class:"thread-pending-request-primary",onClick:$[6]||($[6]=D=>ne(e.request))}," Send ")])])):e.request.method==="item/tool/call"?(A(),L("section",VO,[y("button",{type:"button",class:"thread-pending-request-primary",onClick:$[7]||($[7]=D=>Ue(e.request))}," Fail Tool Call "),y("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[8]||($[8]=D=>ke(e.request))}," Success (Empty) ")])):(A(),L("section",zO,[y("button",{type:"button",class:"thread-pending-request-primary",onClick:$[9]||($[9]=D=>ye(e.request))}," Return Empty Result "),y("button",{type:"button",class:"thread-pending-request-secondary",onClick:$[10]||($[10]=D=>$e(e.request))}," Reject Request ")]))],64))],2)])):Se("",!0)}}),KO=Et(GO,[["__scopeId","data-v-a033894d"]]),YO={key:0,class:"queued-messages"},JO={class:"queued-messages-inner"},XO={class:"queued-row-text"},QO={class:"queued-row-actions"},ZO=["onClick"],eL=["onClick"],tL=["onClick"],nL=An({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,c,d;const r=n.text.trim();if(r)return r;const o=[],s=((l=n.imageUrls)==null?void 0:l.length)??0,i=((c=n.fileAttachments)==null?void 0:c.length)??0,a=((d=n.skills)==null?void 0:d.length)??0;return s>0&&o.push(`${s} image${s===1?"":"s"}`),i>0&&o.push(`${i} file${i===1?"":"s"}`),a>0&&o.push(`${a} skill${a===1?"":"s"}`),o.join(", ")||"(empty queued message)"}return(n,r)=>e.messages.length>0?(A(),L("div",YO,[y("div",JO,[(A(!0),L(Xe,null,Bt(e.messages,o=>(A(),L("div",{key:o.id,class:"queued-row"},[r[1]||(r[1]=y("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),y("span",XO,ge(t(o)),1),y("div",QO,[y("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:s=>n.$emit("edit",o.id)},"Edit",8,ZO),y("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>n.$emit("steer",o.id)},"Steer",8,eL),y("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>n.$emit("delete",o.id)},[...r[0]||(r[0]=[y("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,tL)])]))),128))])])):Se("",!0)}}),rL=Et(nL,[["__scopeId","data-v-835c6739"]]),oL={key:0,class:"rate-limit-status","aria-live":"polite"},sL=["title"],iL={class:"rate-limit-card-header"},aL={class:"rate-limit-card-title"},lL={key:0,class:"rate-limit-card-plan"},cL={class:"rate-limit-card-metrics"},uL={key:0,class:"rate-limit-card-footer"},dL=An({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(P){var O,W;return((O=P.limitId)==null?void 0:O.trim())||((W=P.limitName)==null?void 0:W.trim())||"__default__"}function n(P){var O,W;return((O=P.limitName)==null?void 0:O.trim())||((W=P.limitId)==null?void 0:W.trim())||"Rate limits"}function r(P){const O=P.trim();return O?O.replace(/[_-]+/g," ").replace(/\b\w/g,W=>W.toUpperCase()):""}function o(P){return!P||P<=0?"Window":P%1440===0?`${P/1440}d`:P%60===0?`${P/60}h`:P<60?`${P}m`:`${Math.round(P/60*10)/10}h`}function s(P){const O=Math.max(0,Math.min(100,100-P));return`${Math.round(O)}% left`}function i(P){return`${Math.round(P)}%`}function a(P,O){return{key:O,label:`${o(P.windowDurationMins)} ${s(P.usedPercent)}`}}function l(P){const O=[];return P.primary&&O.push(a(P.primary,"primary")),P.secondary&&O.push(a(P.secondary,"secondary")),O}function c(P){if(!P)return"";const O=new Date(P*1e3),W=O.getMonth()+1,Y=String(O.getDate()).padStart(2,"0"),ce=String(O.getHours()).padStart(2,"0"),re=String(O.getMinutes()).padStart(2,"0");return`${W}.${Y} ${ce}:${re}`}function d(P){if(!(P!=null&&P.resetsAt))return"";const O=P.resetsAt*1e3-Date.now();if(O<=0)return"Resetting now";const W=Math.round(O/6e4);if(W<60)return`Resets in ${W}m`;const Y=Math.round(W/60);return Y<24?`Resets in ${Y}h`:`Resets in ${Math.round(Y/24)}d`}function f(P){return[P.primary,P.secondary].filter(O=>O!==null)}function m(P){const O=f(P);return O.length===0?null:[...O].sort((W,Y)=>{const ce=W.windowDurationMins??Number.MAX_SAFE_INTEGER,re=Y.windowDurationMins??Number.MAX_SAFE_INTEGER;return ce!==re?ce-re:(W.resetsAt??Number.MAX_SAFE_INTEGER)-(Y.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function v(P){const O=f(P);if(O.length===0)return"";const W=[...O].sort((ce,re)=>{const Z=ce.windowDurationMins??-1,he=re.windowDurationMins??-1;return Z!==he?he-Z:(re.resetsAt??-1)-(ce.resetsAt??-1)})[0],Y=c(W.resetsAt);return Y||""}function T(P){const O=P.credits;return O?O.unlimited?"Unlimited credits":O.balance?`Credits ${O.balance}`:O.hasCredits?"Credits available":"":""}function k(P){return[d(m(P)),v(P),T(P)].filter(O=>O.length>0)}function H(P){const O=[n(P)];for(const W of l(P))O.push(W.label);for(const W of f(P))O.push(`${o(W.windowDurationMins)} used ${i(W.usedPercent)}`);for(const W of k(P))O.push(W);return O.join(`
77
+ `)}return(P,O)=>e.snapshots.length>0?(A(),L("aside",oL,[(A(!0),L(Xe,null,Bt(e.snapshots,W=>(A(),L("div",{key:t(W),class:"rate-limit-card",title:H(W)},[y("div",iL,[y("span",aL,ge(n(W)),1),W.planType?(A(),L("span",lL,ge(r(W.planType)),1)):Se("",!0)]),y("div",cL,[(A(!0),L(Xe,null,Bt(l(W),Y=>(A(),L("span",{key:Y.key,class:"rate-limit-card-metric"},ge(Y.label),1))),128))]),k(W).length>0?(A(),L("div",uL,ge(k(W).join(" | ")),1)):Se("",!0)],8,sL))),128))])):Se("",!0)}}),fL=Et(dL,[["__scopeId","data-v-df88906b"]]),pL={class:"runtime-toggle",role:"radiogroup","aria-label":"Continue in"},hL=["aria-checked","onClick"],mL={class:"runtime-toggle-option-label"},gL=An({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=[{value:"local",label:"Local project",icon:lp},{value:"worktree",label:"New worktree",icon:Ul}];function o(s){n("update:modelValue",s)}return(s,i)=>(A(),L("div",pL,[(A(),L(Xe,null,Bt(r,a=>y("button",{key:a.value,class:pt(["runtime-toggle-option",{"is-selected":e.modelValue===a.value}]),type:"button",role:"radio","aria-checked":e.modelValue===a.value,onClick:l=>o(a.value)},[(A(),yt(Ef(a.icon),{class:"runtime-toggle-option-icon"})),y("span",mL,ge(a.label),1)],10,hL)),64))]))}}),vL=Et(gL,[["__scopeId","data-v-e8b0d0ac"]]),yL={},_L={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function bL(e,t){return A(),L("svg",_L,[...t[0]||(t[0]=[y("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),y("path",{d:"M9 4l0 16"},null,-1)])])}const wL=Et(yL,[["render",bL]]),SL={},TL={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function EL(e,t){return A(),L("svg",TL,[...t[0]||(t[0]=[y("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const kL=Et(SL,[["render",EL]]),IL={class:"sidebar-thread-controls"},AL=["aria-label","title"],CL=An({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(A(),L("div",IL,[y("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(A(),yt(kL,{key:0,class:"sidebar-thread-controls-icon"})):(A(),yt(wL,{key:1,class:"sidebar-thread-controls-icon"}))],8,AL),co(t.$slots,"default",{},void 0),e.showNewThreadButton?(A(),L("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[ze(ac,{class:"sidebar-thread-controls-icon"})])):Se("",!0)]))}}),Zm=Et(CL,[["__scopeId","data-v-46a10052"]]),xL={},RL={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function ML(e,t){return A(),L("svg",RL,[...t[0]||(t[0]=[y("circle",{cx:"11",cy:"11",r:"8"},null,-1),y("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const eg=Et(xL,[["render",ML]]),PL={},$L={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function NL(e,t){return A(),L("svg",$L,[...t[0]||(t[0]=[y("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[y("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),y("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const OL=Et(PL,[["render",NL]]),LL={},DL={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function jL(e,t){return A(),L("svg",DL,[...t[0]||(t[0]=[y("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const FL=Et(LL,[["render",jL]]);function oo(e){return e.flatMap(t=>t.threads)}const W_="codex-web-local.thread-read-state.v1",V_="codex-web-local.thread-scroll-state.v1",z_="codex-web-local.thread-token-usage.v1",of="codex-web-local.selected-thread-id.v1",sf="codex-web-local.selected-model-by-context.v1",G_="codex-web-local.selected-model-id.v1",K_="codex-web-local.project-order.v1",Y_="codex-web-local.project-display-name.v1",af="codex-web-local.collaboration-mode-by-context.v1",J_="codex-web-local.collaboration-mode.v1",Wa="__new-thread__",ld=220,BL=500,qL=3e3,tg=["none","minimal","low","medium","high","xhigh"],Qs="__global__",jr="gpt-5.2-codex";function UL(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(W_);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function ng(e){typeof window>"u"||window.localStorage.setItem(W_,JSON.stringify(e))}function lf(e){return e==="plan"?"plan":"default"}function lc(e){return typeof e=="string"?e.trim():""}function qr(){return Object.create(null)}function cd(e){const t=qr();for(const[n,r]of Object.entries(e))t[n]=r;return t}function ud(e,t){if(!(t in e))return e;const n=qr();for(const[r,o]of Object.entries(e))r!==t&&(n[r]=o);return n}function rg(e,t){let n=!1;const r=qr();for(const[o,s]of Object.entries(e)){if(o===Wa||t.has(o)){r[o]=s;continue}n=!0}return n?r:e}function cc(e){return e.trim()||Wa}function HL(){if(typeof window>"u")return qr();try{const n=window.localStorage.getItem(sf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return qr();const o=qr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=lc(i);a&&(o[s]=a)}return o}}catch{}const e=lc(window.localStorage.getItem(G_)),t=qr();return e&&(t[Wa]=e),t}function og(e,t){const n=cc(t),r=lc(e[n]);return r||lc(e[Wa])}function dd(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(sf):window.localStorage.setItem(sf,JSON.stringify(e)),window.localStorage.removeItem(G_)}catch{}}function WL(){if(typeof window>"u")return qr();try{const n=window.localStorage.getItem(af);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return qr();const o=qr();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=lf(i);a==="plan"&&(o[s]=a)}return o}}catch{}const e=lf(window.localStorage.getItem(J_)),t=qr();return e==="plan"&&(t[Wa]="plan"),t}function Sl(e,t){const n=cc(t);return lf(e[n])}function sg(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(af):window.localStorage.setItem(af,JSON.stringify(e)),window.localStorage.removeItem(J_)}catch{}}function ia(e,t,n){return Math.min(Math.max(e,t),n)}function VL(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=ia(t.scrollRatio,0,1)),n}function zL(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(V_);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=VL(o);s&&(n[r]=s)}return n}catch{return{}}}function ig(e){typeof window>"u"||window.localStorage.setItem(V_,JSON.stringify(e))}function ri(e){if(typeof e=="number"&&Number.isFinite(e))return Math.max(0,Math.trunc(e));if(typeof e=="string"&&e.trim().length>0){const t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.trunc(t))}return null}function ag(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:ri(t.totalTokens)??0,inputTokens:ri(t.inputTokens)??0,cachedInputTokens:ri(t.cachedInputTokens)??0,outputTokens:ri(t.outputTokens)??0,reasoningOutputTokens:ri(t.reasoningOutputTokens)??0}}function GL(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=ag(t.total),r=ag(t.last);if(!n||!r)return null;const o=ri(t.modelContextWindow),s=r.totalTokens,i=typeof o=="number"?Math.max(o-s,0):null,a=typeof o=="number"&&o>0?ia(Math.round((i??0)/o*100),0,100):null;return{total:n,last:r,modelContextWindow:o,currentContextTokens:s,remainingContextTokens:i,remainingContextPercent:a}}function KL(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(z_);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){if(!r)continue;const s=GL(o);s&&(n[r]=s)}return n}catch{return{}}}function lg(e){typeof window>"u"||window.localStorage.setItem(z_,JSON.stringify(e))}function YL(){return typeof window>"u"?"":window.localStorage.getItem(of)??""}function JL(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(of);return}window.localStorage.setItem(of,e)}}function XL(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(K_);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t){if(typeof r!="string"||r.length===0)continue;const o=Ha(r);o.length>0&&!n.includes(o)&&n.push(o)}return n}catch{return[]}}function Zs(e){typeof window>"u"||window.localStorage.setItem(K_,JSON.stringify(e))}function QL(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Y_);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,o]of Object.entries(t)){const s=typeof r=="string"?Ha(r):"";s.length>0&&typeof o=="string"&&(n[s]=o)}return n}catch{return{}}}function fd(e){typeof window>"u"||window.localStorage.setItem(Y_,JSON.stringify(e))}function Tl(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Jo(e,n)?e:n}function pd(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>n.get(o)??null).filter(o=>o!==null&&o.threads.length>0);for(const o of e)t.includes(o.projectName)||r.push(o);return r}function Jo(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1)if(n[o]!==r[o])return!1;return!0}function ZL(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[o]=r.splice(t,1);return r.splice(n,0,o),r}function eD(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function tD(e=[],t=[]){var n,r,o,s;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(((n=e[i])==null?void 0:n.step)!==((r=t[i])==null?void 0:r.step)||((o=e[i])==null?void 0:o.status)!==((s=t[i])==null?void 0:s.status))return!1;return!0}function nD(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&tD(e.steps,t.steps)}function El(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function cf(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Jo(e.images,t.images)&&oD(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&eD(e.commandExecution,t.commandExecution)&&nD(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex}function ii(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function rD(e,t,n={}){const r=new Map(e.map(d=>[d.id,d])),o=new Map(t.map(d=>[d.id,d])),s=t.map(d=>{const f=r.get(d.id);return f&&cf(f,d)?f:d});if(n.preserveMissing!==!0)return ii(e,s)?e:s;const i=e.map(d=>{const f=o.get(d.id);return!f||cf(d,f)?d:f}),a=new Set(e.map(d=>d.id)),l=s.filter(d=>!a.has(d.id)),c=[...i,...l];return ii(e,c)?e:c}function oD(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],o=t[n];if(r.path!==o.path||r.operation!==o.operation||r.movedToPath!==o.movedToPath||r.diff!==o.diff||r.addedLineCount!==o.addedLineCount||r.removedLineCount!==o.removedLineCount)return!1}return!0}function uf(e){return e.replace(/\s+/gu," ").trim()}function sD(e,t){const n=new Set(t.filter(o=>o.role==="assistant").map(o=>uf(o.text)).filter(o=>o.length>0));if(n.size===0)return e;const r=e.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;const s=uf(o.text);return s.length===0?!1:!n.has(s)});return r.length===e.length?e:r}function kl(e,t){const n=e.findIndex(s=>s.id===t.id);if(n<0)return[...e,t];const r=e[n];if(cf(r,t))return e;const o=[...e];return o.splice(n,1,t),o}const X_="worked";function zo(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function iD(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=t%60,s=[];n>0&&s.push(`${n}h`),(r>0||n>0)&&s.push(`${r}m`);const i=o>0||s.length===0?o:0;return s.push(`${i}s`),s.join(" ")}function aD(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function lD(e,t){if(!e&&!t)return!0;if(!e||!t||e.label!==t.label||e.details.length!==t.details.length)return!1;for(let n=0;n<e.details.length;n+=1)if(e.details[n]!==t.details[n])return!1;return!0}function cD(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${iD(e.durationMs)}`,messageType:X_,turnId:e.turnId}}function uD(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function dD(e,t){const n=cD(t),r=e.filter(i=>i.messageType!==X_),o=uD(r);if(o<0)return[...r,n];const s=[...r];return s.splice(o,0,n),s}function Ot(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function fD(e,t){if(t.size===0)return e;let n=!1;const r={};for(const[o,s]of Object.entries(e)){if(t.has(o)){n=!0;continue}r[o]=s}return n?r:e}function pD(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress&&e.pendingRequestState===t.pendingRequestState}function hD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function mD(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function un(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Il(e,t){const n=new Map(e.map(o=>[o.projectName,o])),r=t.map(o=>{const s=n.get(o.projectName),i=new Map((s==null?void 0:s.threads.map(l=>[l.id,l]))??[]),a=o.threads.map(l=>{const c=i.get(l.id);return c&&pD(c,l)?c:l});return s&&s.projectName===o.projectName&&hD(s.threads,a)?s:{projectName:o.projectName,threads:a}});return mD(e,r)?e:r}function gD(e,t,n){const r=new Set(oo(t).map(a=>a.id)),o=oo(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(o.length===0)return t;const s=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of o){if(s.get(a.projectName)){const c=i.findIndex(d=>d.projectName===a.projectName);c>=0&&(i[c]={projectName:i[c].projectName,threads:[a,...i[c].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function Go(e){return Ha(e)}function vD(e){const t=e.split(`
78
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function yD(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function _D(){const e=j([]),t=j([]),n=j(YL()),r=j({}),o=j({}),s=j({}),i=j({}),a=j({}),l=j({}),c=j({}),d=j({}),f=j({}),m=j({}),v=j([]),T=j([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),k=j(WL()),H=j(HL()),P=j(Sl(k.value,n.value)),O=j(og(H.value,n.value)),W=j("medium"),Y=j("standard"),ce=j(UL()),re=j(zL()),Z=j(XL()),he=j(QL()),Ce=j({}),Ae=j({}),ue=j({}),V=j({}),ae=j({}),xe=j({}),Fe=j({}),_e=j({}),Me=j({}),fe=j({}),De=j(null),Be=j(KL()),Re=j({}),Ge=j([]),ot=j([]),nt=j(!1),st=j(!1),Ke=j(!1),J=j(!1),be=j(!1),we=j(!1),ve=j(""),Ze=j(!1),E=j(!1);let I=null,q=null,Q=null;const ee=new Map;let te=null,ie=!1;const pe=new Set;let me=!1,ne=!1;const Ue=new Map,ke=new Set,ye=se(()=>oo(e.value)),$e=se(()=>ye.value.find(u=>u.id===n.value)??null),x=se(()=>re.value[n.value]??null),$=se(()=>{const u=[],p=n.value;return p&&Array.isArray(Me.value[p])&&u.push(...Me.value[p]),Array.isArray(Me.value[Qs])&&u.push(...Me.value[Qs]),u.sort((g,b)=>g.receivedAtIso.localeCompare(b.receivedAtIso))}),D=se(()=>{var F;const u=n.value;if(!u)return null;const p=xe.value[u],g=(i.value[u]??"").trim(),b=(((F=Fe.value[u])==null?void 0:F.message)??"").trim();return!p&&!g&&!b?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:g,errorText:b}}),X=se(()=>De.value),le=se(()=>{const u=n.value;return u?Be.value[u]??null:null}),Le=se(()=>{const u=n.value;if(!u)return[];const p=r.value[u]??[],g=o.value[u]??[],b=s.value[u]??[],F=a.value[u]??[],B=l.value[u]??[],U=[...p,...g,...F,...B,...b],G=ae.value[u];return G?dD(U,G):U});function Ne(u){return og(H.value,u).trim()}function rt(...u){const p=[...v.value];for(const g of u){const b=g.trim();b&&!p.includes(b)&&p.push(b)}Jo(v.value,p)||(v.value=p)}function Qe(u){n.value!==u&&(n.value=u,JL(u),O.value=Ne(u),rt(O.value),P.value=Sl(k.value,u),ne=!1)}function wt(u){const p=u.trim(),g=cc(n.value);if(p){const b=cd(H.value);b[g]=p,H.value=b}else H.value=ud(H.value,g);O.value=Ne(n.value),rt(O.value),dd(H.value),pr({category:"ui.model",message:`model → ${O.value}`,level:"info"})}function Rt(u,p){const g=u.trim();if(!g)return;const b=p.trim();if(b){const F=cd(H.value);F[g]=b,H.value=F}else H.value=ud(H.value,g);rt(b),n.value===g&&(O.value=Ne(n.value)),dd(H.value)}function ct(u,p){const g=u.trim();if(!g)return;if(!p){if(!(g in Be.value))return;Be.value=Ot(Be.value,g),lg(Be.value);return}const b=Be.value[g];b&&JSON.stringify(b)===JSON.stringify(p)||(Be.value={...Be.value,[g]:p},lg(Be.value))}function Qt(u){const p=u==="plan"?"plan":"default",g=cc(n.value);if(!(Sl(k.value,n.value)===p&&P.value===p)){if(P.value=p,p==="plan"){const F=cd(k.value);F[g]=p,k.value=F}else k.value=ud(k.value,g);sg(k.value)}}function mn(u){De.value=u}async function ar(u=n.value){u.trim()?Rt(u,jr):wt(jr),rt(jr)}function Xn(u,p){fe.value={...fe.value,[u]:p}}function mr(u){fe.value[u]&&(fe.value=Ot(fe.value,u))}async function Ut(u){if(ke.has(u))return;const p=fe.value[u];if(!(!p||p.fallbackRetried)){ke.add(u),Xn(u,{...p,fallbackRetried:!0});try{await ar(u);try{const g=await td(u,1);xn(u,g),Rn(u),ln(u,[]),_n(u),a.value[u]&&(a.value=Ot(a.value,u))}catch{}gt(u,null),ve.value="",Vt(u,null),dt(u,{label:"Thinking",details:Wt(jr,p.effort,p.collaborationMode)}),Mt(u,!0),ue.value[u]!==!0&&await ed(u),await nd(u,p.text,p.imageUrls,jr,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments,p.collaborationMode),ue.value={...ue.value,[u]:!0},vr(),pe.add(u),ie=!0,await Dr()}catch(g){const b=g instanceof Error?g.message:"Unknown application error";gt(u,b),ve.value=b,Mt(u,!1),dt(u,null)}finally{ke.delete(u)}}}function Zt(u){u&&!tg.includes(u)||(W.value=u)}async function Ht(u){const p=u==="fast"?"fast":"standard";if(be.value||Y.value===p)return;const g=Y.value;Y.value=p,be.value=!0,ve.value="";try{await HR(p)}catch(b){Y.value=g,ve.value=b instanceof Error?b.message:"Failed to update Fast mode"}finally{be.value=!1}}async function gr(){try{const u=await VR();T.value=u,u.some(p=>p.value===P.value)||Qt("default")}catch{}}function Wt(u,p,g=P.value){const b=u.trim()||"default",F=p||"default",B=g==="plan"?"Plan":"Default",U=Y.value==="fast"?"Fast":"Standard";return[`Mode: ${B}`,`Model: ${b}`,`Thinking: ${F}`,`Speed: ${U}`]}async function Yr(){try{const[u,p]=await Promise.all([q_(),U_()]),g=Ne(n.value),b=p.model.trim(),F=[...u];for(const B of[g,b])B&&!F.includes(B)&&F.push(B);v.value=F,g||(b&&F.includes(b)?wt(p.model):F.length>0?wt(F[0]):wt("")),p.reasoningEffort&&tg.includes(p.reasoningEffort)&&(W.value=p.reasoningEffort),Y.value=p.speedMode}catch{}}async function jn(){if(te){await te;return}te=(async()=>{try{ot.value=er(await qm())}catch{}finally{te=null}})(),await te}function vr(){if(typeof window>"u"){jn();return}Q!==null&&window.clearTimeout(Q),Q=window.setTimeout(()=>{Q=null,jn()},BL)}function Mr(u){if(!u||typeof window>"u")return;const p=ee.get(u);p!==void 0&&(window.clearTimeout(p),ee.delete(u))}function ho(u){if(!u||typeof window>"u")return;Mr(u);const p=window.setTimeout(()=>{ee.delete(u),pe.add(u),Dr()},qL);ee.set(u,p)}function Fn(u){const p=Re.value;return Object.keys(p).length===0?u:u.map(g=>({projectName:g.projectName,threads:g.threads.map(b=>{const F=p[b.id];return F?{...b,title:F}:b})}))}function en(u){return u?Array.isArray(Me.value[u])?Me.value[u]:[]:[]}function Pr(u){return u==="item/commandExecution/requestApproval"||u==="item/fileChange/requestApproval"||u==="item/permissions/requestApproval"||u==="execCommandApproval"||u==="applyPatchApproval"}function Cn(u){return u.some(p=>Pr(p.method))?"approval":u.length>0?"response":null}function Dt(){const p=Fn(t.value).map(g=>({projectName:g.projectName,threads:g.threads.map(b=>{const F=c.value[b.id]===!0,B=Cn(en(b.id)),U=n.value===b.id,G=ce.value[b.id],oe=m.value[b.id]===!0,je=!U&&!F&&(oe||G!==b.updatedAtIso);return{...b,inProgress:F,unread:je,pendingRequestState:B}})}));e.value=Il(e.value,p)}function lr(u,p,g){const b=new Date().toISOString(),F=nn(p),B=Ha(F),U={id:u,title:vD(g),projectName:B,cwd:F,hasWorktree:F.includes("/.codex/worktrees/")||F.includes("/.git/worktrees/"),createdAtIso:b,updatedAtIso:b,preview:g,unread:!1,inProgress:!1},G=t.value.findIndex(je=>je.projectName===B);if(G>=0){const We=t.value[G].threads.filter(tn=>tn.id!==u),ft={projectName:B,threads:[U,...We]},vt=[...t.value];vt.splice(G,1,ft),t.value=vt}else t.value=[{projectName:B,threads:[U]},...t.value];const oe=Tl(Z.value,t.value);Jo(Z.value,oe)||(Z.value=oe,Zs(Z.value)),Dt()}function $r(u){const p=new Set(u.map(G=>G.id)),g=rg(H.value,p);g!==H.value&&(H.value=g,O.value=Ne(n.value),rt(O.value),dd(g));const b=rg(k.value,p);b!==k.value&&(k.value=b,P.value=Sl(b,n.value),sg(b));const F=un(ce.value,p);F!==ce.value&&(ce.value=F,ng(F));const B=un(re.value,p);B!==re.value&&(re.value=B,ig(B)),Ae.value=un(Ae.value,p),Ce.value=un(Ce.value,p),ue.value=un(ue.value,p),V.value=un(V.value,p),r.value=un(r.value,p),s.value=un(s.value,p),i.value=un(i.value,p),a.value=un(a.value,p),l.value=un(l.value,p),ae.value=un(ae.value,p),xe.value=un(xe.value,p),Fe.value=un(Fe.value,p),_e.value=un(_e.value,p),Be.value=un(Be.value,p),m.value=un(m.value,p),c.value=un(c.value,p);const U={};for(const[G,oe]of Object.entries(Me.value))(G===Qs||p.has(G))&&(U[G]=oe);Me.value=U}function gn(u){const p=oo(t.value).find(g=>g.id===u);p&&(ce.value={...ce.value,[u]:p.updatedAtIso},ng(ce.value),m.value[u]&&(m.value=Ot(m.value,u)),Dt())}function Vt(u,p){if(!u)return;const g=ae.value[u];if(p){if(aD(g,p))return;ae.value={...ae.value,[u]:p}}else g&&(ae.value=Ot(ae.value,u))}function Mt(u,p){!u||c.value[u]===!0===p||(p?c.value={...c.value,[u]:!0}:c.value=Ot(c.value,u),Dt())}function vn(u){u&&u!==n.value&&m.value[u]!==!0&&(m.value={...m.value,[u]:!0},Dt())}function dt(u,p){if(!u)return;const g=xe.value[u];if(!p){g&&(xe.value=Ot(xe.value,u));return}const b=Qr(p.label)||"Thinking",F=p.details.map(G=>Qr(G)).filter(G=>G.length>0&&G!==b),B=Array.from(new Set([...(g==null?void 0:g.details)??[],...F])).slice(-3),U={label:b,details:B};lD(g,U)||(xe.value={...xe.value,[u]:U})}function gt(u,p,g={}){if(!u)return;const b=Fe.value[u],F=p?uf(p):"";if(!F){b&&(Fe.value=Ot(Fe.value,u));return}const B=g.transient===!0;(b==null?void 0:b.message)===F&&b.transient===B||(Fe.value={...Fe.value,[u]:{message:F,transient:B}})}function an(u){var p;u&&(p=Fe.value[u])!=null&&p.transient&&gt(u,null)}function Bn(){const u=Object.entries(Fe.value).filter(([,g])=>g==null?void 0:g.transient).map(([g])=>g);if(u.length===0)return;let p=Fe.value;for(const g of u)p=Ot(p,g);Fe.value=p}function cr(u){const p=oo(t.value).find(g=>g.id===u);return(p==null?void 0:p.updatedAtIso)??""}function qn(u,p){if(!u)return;const g={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(g.scrollRatio=ia(p.scrollRatio,0,1));const b=re.value[u];b&&b.scrollTop===g.scrollTop&&b.isAtBottom===g.isAtBottom&&b.scrollRatio===g.scrollRatio||(re.value={...re.value,[u]:g},ig(re.value))}function xn(u,p){const g=r.value[u]??[];ii(g,p)||(r.value={...r.value,[u]:p})}function ln(u,p){const g=s.value[u]??[];ii(g,p)||(s.value={...s.value,[u]:p})}function Un(u,p){const g=l.value[u]??[];ii(g,p)||(l.value={...l.value,[u]:p})}function ur(u,p){const g=o.value[u]??[];ii(g,p)||(o.value={...o.value,[u]:p})}function Nr(u,p){const g=o.value[u]??[],b=kl(g,p);ur(u,b)}function Hn(u,p){const g=s.value[u]??[],b=kl(g,p);ln(u,b)}function En(u,p){const g=l.value[u]??[],b=kl(g,p);Un(u,b)}function Qn(u,p){if(!u)return;const g=p.trim(),b=i.value[u]??"";if(g.length===0){if(!b)return;i.value=Ot(i.value,u);return}b!==g&&(i.value={...i.value,[u]:g})}function yn(u,p){if(!u)return;const g=i.value[u]??"";Qn(u,`${g}${p}`)}function _n(u){u&&u in i.value&&(i.value=Ot(i.value,u))}function Rn(u){u&&u in o.value&&(o.value=Ot(o.value,u))}function bn(u){u&&u in l.value&&(l.value=Ot(l.value,u))}function yr(u){u&&(Rn(u),_n(u),dt(u,null),a.value[u]&&(a.value=Ot(a.value,u)),_e.value[u]&&(_e.value=Ot(_e.value,u)),mr(u))}function Jr(u){return u==="completed"?"completed":u==="inProgress"||u==="in_progress"?"inProgress":"pending"}function Nt(u){var g;const p=[];(g=u.explanation)!=null&&g.trim()&&p.push(u.explanation.trim());for(const b of u.steps){const F=b.status==="completed"?"x":b.status==="inProgress"?"~":" ";p.push(`- [${F}] ${b.step}`)}return p.join(`
79
+ `).trim()}function on(u){if(u.method!=="turn/plan/updated")return null;const p=qe(u.params),g=qt(u),b=Te(p==null?void 0:p.turnId)||Te(p==null?void 0:p.turn_id),B=(Array.isArray(p==null?void 0:p.plan)?p==null?void 0:p.plan:[]).map(oe=>qe(oe)).map(oe=>({step:Te(oe==null?void 0:oe.step),status:Jr(oe==null?void 0:oe.status)})).filter(oe=>oe.step.length>0);if(!g||!b)return null;const G={explanation:Te(p==null?void 0:p.explanation).trim()||void 0,steps:B,isStreaming:!0};return{threadId:g,message:{id:`${b}:plan`,role:"assistant",text:Nt(G),messageType:"plan.live",plan:G}}}function Wn(u){if(u.method!=="item/plan/delta")return null;const p=qe(u.params),g=qt(u),b=Te(p==null?void 0:p.turnId)||Te(p==null?void 0:p.turn_id),F=Te(p==null?void 0:p.delta);if(!g||!b||!F)return null;const B=`${b}:plan`,U=(o.value[g]??[]).find(je=>je.id===B),G=`${(U==null?void 0:U.text)??""}${F}`,oe=U!=null&&U.plan?{...U.plan,isStreaming:!0}:void 0;return{threadId:g,message:{id:B,role:"assistant",text:G,messageType:"plan.live",plan:oe}}}function qe(u){return u!==null&&typeof u=="object"&&!Array.isArray(u)?u:null}function Te(u){return typeof u=="string"?u:""}function St(u){return typeof u=="number"&&Number.isFinite(u)?u:null}function Or(u){var p,g;return((p=u.limitId)==null?void 0:p.trim())||((g=u.limitName)==null?void 0:g.trim())||"__default__"}function Lr(u){const p=qe(u);if(!p)return null;const g=St(p.windowDurationMins);return{usedPercent:ia(St(p.usedPercent)??0,0,100),windowDurationMins:g,windowMinutes:g,resetsAt:St(p.resetsAt)}}function Zn(u){const p=qe(u);if(!p)return null;const g=qe(p.credits);return{limitId:Te(p.limitId)||null,limitName:Te(p.limitName)||null,primary:Lr(p.primary),secondary:Lr(p.secondary),credits:g?{hasCredits:g.hasCredits===!0,unlimited:g.unlimited===!0,balance:Te(g.balance)||null}:null,planType:Te(p.planType)||null}}function er(u){const p=qe(u);if(!p)return[];const g=[],b=new Set,F=U=>{if(!U)return;const G=Or(U);b.has(G)||(b.add(G),g.push(U))};F(Zn(p.rateLimits));const B=qe(p.rateLimitsByLimitId);if(B)for(const U of Object.values(B))F(Zn(U));return g}function Xr(u){const p=qe(u);if(!p)return null;const g=St(p.totalTokens??p.total_tokens),b=St(p.inputTokens??p.input_tokens),F=St(p.cachedInputTokens??p.cached_input_tokens),B=St(p.outputTokens??p.output_tokens),U=St(p.reasoningOutputTokens??p.reasoning_output_tokens);return g===null||b===null||F===null||B===null||U===null?null:{totalTokens:g,inputTokens:b,cachedInputTokens:F,outputTokens:B,reasoningOutputTokens:U}}function _r(u){const p=qe(u);if(!p)return null;const g=Xr(p.total),b=Xr(p.last);if(!g||!b)return null;const F=St(p.modelContextWindow??p.model_context_window),B=b.totalTokens,U=typeof F=="number"?Math.max(F-B,0):null,G=typeof F=="number"&&F>0?ia(Math.round((U??0)/F*100),0,100):null;return{total:g,last:b,modelContextWindow:F,currentContextTokens:B,remainingContextTokens:U,remainingContextPercent:G}}function Mn(u){if(u.method!=="thread/tokenUsage/updated")return null;const p=qe(u.params),g=qt(u),b=_r((p==null?void 0:p.tokenUsage)??(p==null?void 0:p.token_usage));return!g||!b?null:{threadId:g,usage:b}}function qt(u){const p=qe(u.params);if(!p)return"";const g=Te(p.threadId);if(g)return g;const b=Te(p.thread_id);if(b)return b;const F=Te(p.conversationId);if(F)return F;const B=Te(p.conversation_id);if(B)return B;const U=qe(p.thread),G=Te(U==null?void 0:U.id);if(G)return G;const oe=qe(p.turn),je=Te(oe==null?void 0:oe.threadId);if(je)return je;const We=Te(oe==null?void 0:oe.thread_id);return We||""}function zt(u){if(u.method!=="turn/completed")return"";const p=qe(u.params),g=qe(p==null?void 0:p.turn);if(!g||g.status!=="failed")return"";const b=qe(g.error);return Te(b==null?void 0:b.message)}function br(u){var b;if(u.method!=="error")return null;const p=qe(u.params),g=Te(p==null?void 0:p.message)||Te((b=qe(p==null?void 0:p.error))==null?void 0:b.message);return g?{message:g,transient:(p==null?void 0:p.willRetry)===!0}:null}function S(u){const p=qe(u);if(!p)return null;const g=p.id,b=Te(p.method),F=p.params;if(typeof g!="number"||!Number.isInteger(g)||!b)return null;const B=qe(F),U=C(b,B),G=Te(B==null?void 0:B.threadId)||Te(B==null?void 0:B.thread_id)||Te(B==null?void 0:B.conversationId)||Te(B==null?void 0:B.conversation_id)||Qs,oe=Te(B==null?void 0:B.turnId)||Te(B==null?void 0:B.turn_id),je=Te(B==null?void 0:B.itemId)||Te(B==null?void 0:B.item_id)||Te(B==null?void 0:B.callId)||Te(B==null?void 0:B.call_id),We=Te(p.receivedAtIso)||new Date().toISOString();return{id:g,method:U,threadId:G,turnId:oe,itemId:je,receivedAtIso:We,params:F??null}}function C(u,p){const g=u.trim();return g&&(g==="item/commandExecution/requestApproval"||g==="execCommandApproval"||g==="exec_approval_request"||N(p)?"item/commandExecution/requestApproval":g==="item/fileChange/requestApproval"||g==="applyPatchApproval"||g==="apply_patch_approval_request"||z(p)?"item/fileChange/requestApproval":g==="item/tool/requestUserInput"||g==="request_user_input"||w(p)?"item/tool/requestUserInput":g==="mcpServer/elicitation/request"||g==="elicitation_request"||K(p)?"mcpServer/elicitation/request":g==="item/permissions/requestApproval"||Ee(p)?"item/permissions/requestApproval":g==="item/tool/call"||g==="dynamic_tool_call_request"||R(p)?"item/tool/call":g)}function N(u){if(!u)return!1;const p=u.command;return Array.isArray(p)&&p.some(g=>typeof g=="string"&&g.trim().length>0)||typeof p=="string"&&p.trim().length>0?!0:Array.isArray(u.commandActions)}function z(u){return u?typeof u.grantRoot=="string"&&u.grantRoot.trim().length>0||typeof u.grant_root=="string"&&u.grant_root.trim().length>0||qe(u.fileChanges)?!0:qe(u.changes)!==null:!1}function w(u){return!!(u&&Array.isArray(u.questions))}function R(u){return u?typeof u.toolName=="string"||typeof u.tool_name=="string"||typeof u.name=="string"||Array.isArray(u.arguments):!1}function K(u){if(!u)return!1;const p=Te(u.mode);return typeof u.serverName=="string"&&typeof u.threadId=="string"&&typeof u.message=="string"&&(p==="form"||p==="url")}function Ee(u){return u?typeof u.threadId=="string"&&typeof u.turnId=="string"&&typeof u.itemId=="string"&&qe(u.permissions)!==null:!1}function it(u){if(u.method!=="item/tool/requestUserInput")return[];const p=qe(u.params),g=Array.isArray(p==null?void 0:p.questions)?p.questions:[],b=[];for(const F of g){const B=qe(F),U=Te(B==null?void 0:B.id).trim();U&&b.push(U)}return b}function Ft(u){const p=u.threadId||Qs,g=Me.value[p]??[],b=g.findIndex(B=>B.id===u.id),F=[...g];b>=0?F.splice(b,1,u):F.push(u),Me.value={...Me.value,[p]:F.sort((B,U)=>B.receivedAtIso.localeCompare(U.receivedAtIso))},Dt()}function Gt(u){const p={};for(const[g,b]of Object.entries(Me.value)){const F=b.filter(B=>B.id!==u);F.length>0&&(p[g]=F)}Me.value=p,Dt()}function Pt(u){const p={};for(const g of u){const b=g.threadId||Qs,F=p[b]??[];F.push(g),p[b]=F}for(const g of Object.values(p))g.sort((b,F)=>b.receivedAtIso.localeCompare(F.receivedAtIso));Me.value=p}function wn(u){if(u.method==="server/request"){const p=S(u.params);return p&&Ft(p),!0}if(u.method==="server/request/resolved"){const p=qe(u.params),g=p==null?void 0:p.id;return typeof g=="number"&&Number.isInteger(g)&&Gt(g),!0}return!1}function Qr(u){return u.replace(/\s+/gu," ").trim()}function ds(u){const p=qt(u);if(!p)return null;if(u.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(u.method==="item/started"){const g=qe(u.params),b=qe(g==null?void 0:g.item),F=Te(b==null?void 0:b.type).toLowerCase();if(F==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(F==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(F==="commandexecution"){const B=Te(b==null?void 0:b.command);return{threadId:p,activity:{label:"Running command",details:B?[B]:[]}}}if(F==="filechange"){const U=(Array.isArray(b==null?void 0:b.changes)?b.changes:[])[0],G=Te(U==null?void 0:U.path);return{threadId:p,activity:{label:"Applying changes",details:G?[G]:[]}}}}return u.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:u.method==="item/fileChange/outputDelta"?{threadId:p,activity:{label:"Applying changes",details:[]}}:u.method==="item/reasoning/summaryTextDelta"||u.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:u.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function Lc(u){if(u.method!=="turn/started")return null;const p=qe(u.params);if(!p)return null;const g=qt(u);if(!g)return null;const b=qe(p.turn),F=Te(b==null?void 0:b.id)||Te(p.turnId)||`${g}:unknown`;if(!F)return null;const B=zo(Te(b==null?void 0:b.startedAt))??zo(Te(p.startedAt))??zo(u.atIso)??Date.now();return{threadId:g,turnId:F,startedAtMs:B}}function Dc(u){if(u.method!=="turn/completed")return null;const p=qe(u.params);if(!p)return null;const g=qt(u);if(!g)return null;const b=qe(p.turn),F=Te(b==null?void 0:b.id)||Te(p.turnId)||`${g}:unknown`;if(!F)return null;const B=zo(Te(b==null?void 0:b.completedAt))??zo(Te(p.completedAt))??zo(u.atIso)??Date.now(),U=zo(Te(b==null?void 0:b.startedAt))??zo(Te(p.startedAt))??void 0;return{threadId:g,turnId:F,completedAtMs:B,startedAtMs:U}}function fs(u){return`${u}:live-reasoning`}function Ni(u){const p=r.value[u]??[];let g=-1;for(const b of p)typeof b.turnIndex=="number"&&Number.isFinite(b.turnIndex)&&(g=Math.max(g,b.turnIndex));return g+1}function Va(u,p,g){if(!u||!p||!Number.isInteger(g)||g<0)return;const b=V.value[u]??{};b[p]!==g&&(V.value={...V.value,[u]:{...b,[p]:g}})}function jc(u,p){const g=V.value[u]??{},b=Object.entries(g),F=Object.entries(p);b.length===F.length&&b.every(([B,U])=>p[B]===U)||(V.value={...V.value,[u]:{...p}})}function Fc(u){const p=l.value[u];if(!p||p.length===0)return;const g=V.value[u]??{};let b=!1;const F=p.map(B=>{if(typeof B.turnIndex=="number"||!B.turnId)return B;const U=g[B.turnId];return typeof U!="number"?B:(b=!0,{...B,turnIndex:U})});b&&(l.value={...l.value,[u]:F})}function za(u){const p=qe(u.params);if(!p)return"";if(u.method==="item/started"){const g=qe(p.item);return!g||g.type!=="reasoning"?"":Te(g.id)}return""}function Ga(u){const p=qe(u.params);if(!p)return null;if(u.method==="item/reasoning/summaryTextDelta"){const g=Te(p.itemId),b=Te(p.delta);return!g||!b?null:{messageId:fs(g),delta:b}}return null}function Bc(u){const p=qe(u.params);if(!p)return"";if(u.method==="item/reasoning/summaryPartAdded"){const g=Te(p.itemId);return g?fs(g):""}return""}function qc(u){const p=qe(u.params);if(!p)return"";if(u.method==="item/completed"){const g=qe(p.item);return!g||g.type!=="reasoning"?"":fs(Te(g.id))}return""}function Uc(u){const p=qe(u.params);if(!p)return"";if(u.method==="item/started"){const g=qe(p.item);return!g||g.type!=="agentMessage"?"":Te(g.id)}return""}function Ka(u){const p=qe(u.params);if(!p)return null;if(u.method==="item/agentMessage/delta"){const g=Te(p.itemId),b=Te(p.delta);return!g||!b?null:{messageId:g,delta:b}}return null}function Oi(u){const p=qe(u.params);if(!p)return null;if(u.method==="item/completed"){const g=qe(p.item);if(!g||g.type!=="agentMessage")return null;const b=Te(g.id),F=Te(g.text);return!b||!F?null:{id:b,role:"assistant",text:F,messageType:"agentMessage.live"}}return null}function Bo(u){var je;if(u.method!=="item/started")return null;const p=qe(u.params),g=qe(p==null?void 0:p.item);if(!g||g.type!=="commandExecution")return null;const b=Te(g.id),F=Te(g.command);if(!b)return null;const B=typeof g.cwd=="string"?g.cwd:null,U=qt(u),G=Te(p==null?void 0:p.turnId)||Te(p==null?void 0:p.turn_id),oe=U&&G?(je=V.value[U])==null?void 0:je[G]:void 0;return{id:b,role:"system",text:F,messageType:"commandExecution",commandExecution:{command:F,cwd:B,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:G||void 0,turnIndex:typeof oe=="number"?oe:void 0}}function Hc(u){if(u.method!=="item/commandExecution/outputDelta")return null;const p=qe(u.params);if(!p)return null;const g=Te(p.itemId),b=Te(p.delta);return!g||!b?null:{itemId:g,delta:b}}function Wc(u){var tn;if(u.method!=="item/completed")return null;const p=qe(u.params),g=qe(p==null?void 0:p.item);if(!g||g.type!=="commandExecution")return null;const b=Te(g.id),F=Te(g.command);if(!b)return null;const B=typeof g.cwd=="string"?g.cwd:null,U=Te(g.status),G=U==="failed"?"failed":U==="declined"?"declined":U==="interrupted"?"interrupted":"completed",oe=typeof g.aggregatedOutput=="string"?g.aggregatedOutput:"",je=typeof g.exitCode=="number"?g.exitCode:null,We=qt(u),ft=Te(p==null?void 0:p.turnId)||Te(p==null?void 0:p.turn_id),vt=We&&ft?(tn=V.value[We])==null?void 0:tn[ft]:void 0;return{id:b,role:"system",text:F,messageType:"commandExecution",commandExecution:{command:F,cwd:B,status:G,aggregatedOutput:oe,exitCode:je},turnId:ft||void 0,turnIndex:typeof vt=="number"?vt:void 0}}function Vc(u){var je;if(u.method!=="item/completed")return null;const p=qe(u.params),g=qe(p==null?void 0:p.item);if(!g||g.type!=="fileChange")return null;const b=Te(g.id);if(!b)return null;const F=Te(p==null?void 0:p.threadId),B=Te(p==null?void 0:p.turnId),U=F&&B?(je=V.value[F])==null?void 0:je[B]:void 0,G=O_(g.changes),oe=N_(g.status);return G.length===0||oe!=="completed"?null:{id:b,role:"system",text:"",messageType:"fileChange",fileChangeStatus:oe,fileChanges:G,turnId:B||void 0,turnIndex:typeof U=="number"?U:void 0}}function Li(u,p){const g=a.value[u]??[],b=kl(g,p);b!==g&&(a.value={...a.value,[u]:b})}function zc(u,p){const g=a.value[u];if(!g||g.length===0)return;const b=new Set(p.map(B=>B.id)),F=g.filter(B=>!b.has(B.id));F.length!==g.length&&(F.length===0?a.value=Ot(a.value,u):a.value={...a.value,[u]:F})}function Di(u,p){const g=l.value[u];if(!g||g.length===0)return;const b=new Set(p.map(G=>G.id)),F=new Set(p.filter(G=>G.messageType==="fileChange"&&typeof G.turnId=="string"&&G.turnId.length>0).map(G=>G.turnId)),B=new Set(p.filter(G=>G.messageType==="fileChange"&&typeof G.turnIndex=="number").map(G=>G.turnIndex)),U=g.filter(G=>!b.has(G.id)&&!(G.turnId&&F.has(G.turnId))&&!(typeof G.turnIndex=="number"&&B.has(G.turnIndex)));U.length!==g.length&&(U.length===0?l.value=Ot(l.value,u):l.value={...l.value,[u]:U})}function Gc(u){if(u.method==="item/agentMessage/delta")return!0;const p=qe(u.params);if(!p)return!1;if(u.method==="item/completed"){const g=qe(p.item);return(g==null?void 0:g.type)==="agentMessage"}return!1}function Kc(u){var mo,vs,Zr,qi,ll;if(wn(u))return;if(u.method==="account/rateLimits/updated"&&vr(),u.method==="thread/name/updated"){const Je=qe(u.params),cn=Te(Je==null?void 0:Je.threadId),eo=Te(Je==null?void 0:Je.threadName);cn&&eo&&(Re.value={...Re.value,[cn]:eo},Dt(),od(cn,eo))}if(u.method==="account/rateLimits/updated"){mn(j_(u.params));return}const p=Mn(u);if(p){ct(p.threadId,p.usage);return}const g=ds(u);g&&dt(g.threadId,g.activity);const b=qt(u),F=br(u);!F&&b&&an(b);const B=Lc(u);B&&(Ue.set(B.turnId,B),Va(B.threadId,B.turnId,Ni(B.threadId)),_e.value={..._e.value,[B.threadId]:B.turnId},Rn(B.threadId),bn(B.threadId),Vt(B.threadId,null),gt(B.threadId,null),Mt(B.threadId,!0),m.value[B.threadId]&&(m.value=Ot(m.value,B.threadId)));const U=Dc(u),G=zt(u),oe=(U==null?void 0:U.threadId)??qt(u),je=oe?Ne(oe):"",We=!!oe&&!!G&&je!==jr&&El(new Error(G));if(U){fe.value[U.threadId];const Je=Ue.get(U.turnId);Je&&Ue.delete(U.turnId);const cn=St((mo=qe(u.params))==null?void 0:mo.durationMs)??St((Zr=qe((vs=qe(u.params))==null?void 0:vs.turn))==null?void 0:Zr.durationMs)??(typeof U.startedAtMs=="number"?U.completedAtMs-U.startedAtMs:null)??(Je?U.completedAtMs-Je.startedAtMs:null),eo=typeof cn=="number"?Math.max(0,cn):0;Vt(U.threadId,{turnId:U.turnId,durationMs:eo}),_e.value[U.threadId]&&(_e.value=Ot(_e.value,U.threadId)),Mt(U.threadId,!1),dt(U.threadId,null),vn(U.threadId),We||(mr(U.threadId),tl(U.threadId))}if(G){const Je=(U==null?void 0:U.threadId)||qt(u);Je&&gt(Je,G),ve.value=G,Je&&We&&Ut(Je)}else U&&gt(U.threadId,null);if(F){const Je=b,cn=Je?Ne(Je):O.value.trim();Je&&gt(Je,F.message,{transient:F.transient}),ve.value=F.message,cn!==jr&&El(new Error(F.message))&&(Je?Ut(Je):ar())}const ft=on(u);ft&&(Nr(ft.threadId,ft.message),dt(ft.threadId,{label:"Planning",details:((qi=ft.message.plan)==null?void 0:qi.steps.map(Je=>Je.step).slice(0,2))??[]}));const vt=Wn(u);if(vt&&(Nr(vt.threadId,vt.message),dt(vt.threadId,{label:"Planning",details:[]})),!b||b!==n.value)return;Uc(u);const tn=Ka(u);if(tn){const Je=(s.value[b]??[]).find(eo=>eo.id===tn.messageId),cn=`${(Je==null?void 0:Je.text)??""}${tn.delta}`;Hn(b,{id:tn.messageId,role:"assistant",text:cn,messageType:"agentMessage.live"})}const zs=Oi(u);zs&&Hn(b,zs),za(u);const Gs=Ga(u);if(Gs&&yn(b,Gs.delta),Bc(u)){const Je=i.value[b]??"";Je.trim().length>0&&!Je.endsWith(`
80
+
81
+ `)&&Qn(b,`${Je}
82
+
83
+ `)}qc(u);const Uo=Bo(u);Uo&&(Li(b,Uo),dt(b,{label:"Running command",details:[((ll=Uo.commandExecution)==null?void 0:ll.command)??""]}));const hs=Hc(u);if(hs){const Je=(a.value[b]??[]).find(cn=>cn.id===hs.itemId);Je!=null&&Je.commandExecution&&Li(b,{...Je,commandExecution:{...Je.commandExecution,aggregatedOutput:`${Je.commandExecution.aggregatedOutput}${hs.delta}`}})}const ms=Wc(u);ms&&Li(b,ms);const gs=Vc(u);if(gs&&En(b,gs),Gc(u)&&(ne&&n.value&&qn(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),_n(b)),u.method==="turn/completed"){ne=!1,_n(b),a.value[b]&&(a.value=Ot(a.value,b));const Je=qt(u);Je&&(Mt(Je,!1),dt(Je,null),vn(Je),We||(mr(Je),tl(Je)))}}function Yc(u){if(u.method==="thread/tokenUsage/updated")return;const p=qt(u);p&&pe.add(p);const g=u.method;(g.startsWith("thread/")||g.startsWith("turn/")||g.startsWith("item/"))&&(ie=!0),!(q!==null||typeof window>"u")&&(q=window.setTimeout(()=>{q=null,Dr()},ld))}async function Jc(u){if(!me){me=!0;try{const p=await ks(),g=[];for(const b of p.order){const F=Go(b);g.includes(F)||g.push(F)}if(g.length>0){const b=Tl(g,u);Jo(Z.value,b)||(Z.value=b,Zs(Z.value))}if(Object.keys(p.labels).length>0){const b={...he.value};let F=!1;for(const[B,U]of Object.entries(p.labels)){const G=Go(B);b[G]!==U&&(b[G]=U,F=!0)}F&&(he.value=b,fd(b))}}catch{}}}async function Xc(){if(!(Object.keys(Re.value).length>0))try{const u=await iM();Object.keys(u.titles).length>0&&(Re.value=u.titles)}catch{}}async function Qc(u,p,g){if(Re.value[u])return;const b=p.trim();if(!b)return;const F=b.length>300?b.slice(0,300):b;try{const B=await cM(F,g);if(!B||Re.value[u])return;Re.value={...Re.value,[u]:B},Dt(),od(u,B)}catch{}}async function Ya(u){try{const p=await ks();if(p.order.length===0)return u;const g=new Set(p.order.map(b=>Go(b)));return u.filter(b=>g.has(b.projectName))}catch{return u}}async function ps(){var p;E.value||(nt.value=!0);const u=performance.now();try{const[g]=await Dd({name:"loadThreads",op:"ui.load.threads"},()=>Promise.all([TR(),Xc()]));await Jc(g);const b=await Ya(g),F=Tl(Z.value,b);Jo(Z.value,F)||(Z.value=F,Zs(Z.value));const B=pd(b,Z.value),U=gD(t.value,B,c.value);t.value=Il(t.value,U),c.value=un(c.value,new Set(oo(t.value).map(We=>We.id))),Dt(),E.value=!0;const G=oo(e.value);$r(G),G.some(We=>We.id===n.value)||Qe(((p=G[0])==null?void 0:p.id)??"");const je=Math.round(performance.now()-u);pr({category:"threads",message:`loaded ${G.length} threads in ${je}ms`,data:{projectCount:b.length},level:"info"})}finally{nt.value=!1}}async function tr(u,p={}){var B;if(!u)return;const g=Ae.value[u]===!0,b=p.silent!==!0&&!g;b&&(st.value=!0);const F=performance.now();try{const G=ue.value[u]!==!0?ed(u):null,oe=Fm(u),[je,We]=await Dd({name:"thread.loadMessages",op:"ui.load",attributes:{threadId:u,silent:p.silent??!1}},()=>Promise.all([G,oe]));je&&(Rt(u,je.model),ue.value={...ue.value,[u]:!0});const{messages:ft,inProgress:vt,activeTurnId:tn,turnIndexByTurnId:zs}=We;jc(u,zs),Fc(u);const Gs=r.value[u]??[],al=rD(Gs,ft,{preserveMissing:p.silent===!0});xn(u,al);const Uo=s.value[u]??[],hs=sD(Uo,ft);ln(u,hs),zc(u,ft),Di(u,ft),Ae.value={...Ae.value,[u]:!0};const ms=cr(u);ms&&(Ce.value={...Ce.value,[u]:ms}),Mt(u,vt),tn?_e.value={..._e.value,[u]:tn}:_e.value[u]&&(_e.value=Ot(_e.value,u)),vt||yr(u),gn(u);const gs=Math.round(performance.now()-F),mo=ye.value.find(Zr=>Zr.id===u),vs=((B=mo==null?void 0:mo.cwd)==null?void 0:B.split("/").pop())??"unknown";EE("thread",{id:u,messageCount:ft.length,loadMs:gs,projectFolder:vs}),pr({category:"thread",message:`loaded ${ft.length} msgs in ${gs}ms`,data:{threadId:u,projectFolder:vs},level:"info"})}finally{b&&(st.value=!1)}}async function Ja(u,p={}){u&&Ae.value[u]!==!0&&await tr(u,p)}async function qo(){var u,p;try{const g=((p=(u=$e.value)==null?void 0:u.cwd)==null?void 0:p.trim())??"";Ge.value=await uM(g?[g]:void 0)}catch{}}async function Xa(){try{mn(await qm())}catch{}}async function Zc(u={}){ve.value="";const p=u.includeSelectedThreadMessages!==!1,g=u.awaitAncillaryRefreshes===!0;try{await ps();const b=Promise.allSettled([Yr(),jn(),gr(),qo(),Xa()]).then(()=>{});p&&await tr(n.value),g&&await b}catch(b){ve.value=b instanceof Error?b.message:"Unknown application error"}}async function eu(u){Qe(u);try{await Promise.all([tr(u),qo()])}catch(p){ve.value=p instanceof Error?p.message:"Unknown application error"}}async function tu(u){try{await LR(u),await ps(),n.value===u&&await tr(n.value)}catch(p){ve.value=p instanceof Error?p.message:"Unknown application error"}}async function Qa(u,p){const g=p.trim();if(!(!u||!g))try{await DR(u,g),Re.value={...Re.value,[u]:g},Dt(),od(u,g)}catch(b){ve.value=b instanceof Error?b.message:"Unknown application error"}}async function nu(u){var U,G;const p=u.trim();if(!p)return"";const g=oo(t.value).find(oe=>oe.id===p),b=((U=g==null?void 0:g.cwd)==null?void 0:U.trim())??"",F=((G=g==null?void 0:g.title)==null?void 0:G.trim())??"Forked chat",B=Ne(p);ve.value="";try{const oe=await Hm(p,b||void 0,B||void 0),je=oe.threadId.trim();return je?(lr(je,b,F),Rt(je,oe.model),ue.value={...ue.value,[je]:!0},Qe(je),await ps(),await tr(je),je):""}catch(oe){return ve.value=oe instanceof Error?oe.message:"Unknown application error",""}}async function ru(u,p){var U;const g=u.trim();if(!g||!Number.isInteger(p)||p<0)return"";if(c.value[g]===!0)return ve.value="Finish the current turn before forking from a response.","";if(Ae.value[g]!==!0)try{await tr(g)}catch(G){return ve.value=G instanceof Error?G.message:"Unknown application error",""}const b=r.value[g]??[];let F=-1;for(const G of b)typeof G.turnIndex=="number"&&Number.isFinite(G.turnIndex)&&(F=Math.max(F,G.turnIndex));if(F>=0&&p>F)return"";const B=oo(t.value).find(G=>G.id===g)??null;try{ve.value="";const G=await Hm(g),oe=G.threadId.trim();if(!oe)return"";const je=G.cwd.trim()||((U=B==null?void 0:B.cwd)==null?void 0:U.trim())||"",We=yD((B==null?void 0:B.title)||(B==null?void 0:B.preview)||"Untitled thread");lr(oe,je,We),Rt(oe,G.model),xn(oe,G.messages),Ae.value={...Ae.value,[oe]:!0},ue.value={...ue.value,[oe]:!0},Rn(oe),ln(oe,[]),_n(oe),a.value[oe]&&(a.value=Ot(a.value,oe)),Vt(oe,null),dt(oe,null),gt(oe,null),Mt(oe,!1);const ft=F-p;if(ft>0){const vt=await td(oe,ft);xn(oe,vt)}return await Qa(oe,We),Qe(oe),ps().catch(()=>{}),oe}catch(G){return ve.value=G instanceof Error?G.message:"Unknown application error",""}}async function Za(u,p,g=[],b=[],F=[]){if(!u||!p.trim()||g.length>0||b.length>0||F.length>0)return!1;const U=(Me.value[u]??[]).filter(je=>je.method==="item/tool/requestUserInput");if(U.length!==1)return!1;const[G]=U,oe=it(G);return oe.length!==1?!1:Bi({id:G.id,result:{answers:{[oe[0]]:{answers:[p.trim()]}}}})}async function el(u,p=[],g=[],b="steer",F=[],B){if(be.value)return;const U=n.value,G=u.trim();if(!U||!G&&p.length===0&&F.length===0||await Za(U,G,p,g,F))return;pr({category:"ui.action",message:"send message",data:{threadId:U,hasImages:p.length>0,skillCount:g.length},level:"info"});const oe=c.value[U]===!0;if(oe&&b==="queue"){const je=d.value[U]??[],We=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ft=[...je],vt=typeof B=="number"?Math.max(0,Math.min(B,ft.length)):ft.length;ft.splice(vt,0,{id:We,text:G,imageUrls:p,skills:g,fileAttachments:F,collaborationMode:P.value}),d.value={...d.value,[U]:ft};return}if(oe){ne=!0,Ws(U,G,p,g,F).catch(je=>{const We=je instanceof Error?je.message:"Unknown application error";gt(U,We),ve.value=We});return}ve.value="",ne=!0,Vt(U,null),dt(U,{label:"Thinking",details:Wt(Ne(U),W.value,P.value)}),gt(U,null),Mt(U,!0);try{await Ws(U,G,p,g,F)}catch(je){ne=!1,Mt(U,!1),dt(U,null);const We=je instanceof Error?je.message:"Unknown application error";throw gt(U,We),ve.value=We,je}}async function Hs(u,p,g=[],b=[],F=[]){if(be.value)return"";const B=u.trim(),U=p.trim(),G=O.value.trim();if(!B&&g.length===0&&F.length===0)return"";Ke.value=!0,ve.value="";let oe="";try{try{const vt=await Um(U||void 0,G||void 0);oe=vt.threadId,Rt(oe,vt.model)}catch(vt){if(G&&G!==jr&&El(vt)){await ar();const tn=await Um(U||void 0,jr);oe=tn.threadId,Rt(oe,tn.model)}else throw vt}if(!oe)return"";lr(oe,U,B||"[Image]"),ue.value={...ue.value,[oe]:!0},Qe(oe),ne=!0,Vt(oe,null),dt(oe,{label:"Thinking",details:Wt(O.value,W.value,P.value)}),gt(oe,null),Mt(oe,!0);const je=oe,We=U||null,ft=B;return Ws(oe,B,g,b,F).catch(vt=>{ne=!1,Mt(oe,!1),dt(oe,null);const tn=vt instanceof Error?vt.message:"Unknown application error";gt(oe,tn),ve.value=tn}).finally(()=>{Ke.value=!1}),Qc(je,ft,We),oe}catch(je){ne=!1,oe&&(Mt(oe,!1),dt(oe,null));const We=je instanceof Error?je.message:"Unknown application error";throw oe&&gt(oe,We),ve.value=We,Ke.value=!1,je}}async function Ws(u,p,g=[],b=[],F=[]){const B=W.value,U=P.value,G=p.trim(),oe=b.map(We=>({name:We.name,path:We.path})),je=F.map(We=>({...We}));Xn(u,{text:G,imageUrls:[...g],skills:oe,fileAttachments:je,effort:B,collaborationMode:U,fallbackRetried:!1});try{if(ue.value[u]!==!0){const vt=await ed(u);Rt(u,vt.model)}const We=Ne(u);let ft="";try{ft=await nd(u,p,g,We||void 0,B||void 0,b.length>0?b:void 0,F,U)}catch(vt){if(We&&We!==jr&&El(vt))await ar(u),Xn(u,{text:G,imageUrls:[...g],skills:oe,fileAttachments:je,effort:B,collaborationMode:U,fallbackRetried:!0}),ft=await nd(u,p,g,jr,B||void 0,b.length>0?b:void 0,F,U);else throw vt}ft&&(_e.value={..._e.value,[u]:ft}),ue.value={...ue.value,[u]:!0},pe.add(u),ie=!0,await Dr(),ho(u)}catch(We){throw We}}async function tl(u){if(f.value[u]===!0)return;const p=d.value[u];if(!p||p.length===0)return;f.value={...f.value,[u]:!0};const[g,...b]=p;d.value=b.length>0?{...d.value,[u]:b}:Ot(d.value,u),Ke.value=!0,ve.value="",ne=!0,Vt(u,null),dt(u,{label:"Thinking",details:Wt(Ne(u),W.value,g.collaborationMode)}),gt(u,null),Mt(u,!0);try{Qt(g.collaborationMode),await Ws(u,g.text,g.imageUrls,g.skills,g.fileAttachments)}catch{Mt(u,!1),dt(u,null)}finally{f.value=Ot(f.value,u),Ke.value=!1}}async function ou(){const u=n.value;if(!u||c.value[u]!==!0)return;let p=_e.value[u];if(!p){const{activeTurnId:g}=await Fm(u);p=g,p&&(_e.value={..._e.value,[u]:p})}if(!p)throw new Error("Could not determine active turn id for interrupt");J.value=!0,ve.value="";try{await UR(u,p),Mt(u,!1),dt(u,null),gt(u,null),_e.value[u]&&(_e.value=Ot(_e.value,u)),pe.add(u),ie=!0,await Dr()}catch(g){const b=g instanceof Error?g.message:"Failed to interrupt active turn";gt(u,b),ve.value=b}finally{J.value=!1}}async function su(u){var G,oe;const p=n.value;if(!p||we.value||!u.trim())return;const g=r.value[p]??[],b=g.find(je=>je.turnId===u),F=typeof(b==null?void 0:b.turnIndex)=="number"?b.turnIndex:-1;if(F<0)return;const B=g.reduce((je,We)=>typeof We.turnIndex=="number"&&We.turnIndex>je?We.turnIndex:je,-1);if(B<0||F>B)return;const U=B-F+1;if(!(U<1)){we.value=!0,ve.value="";try{const je=((oe=(G=$e.value)==null?void 0:G.cwd)==null?void 0:oe.trim())??"";je&&await jR(p,u,je);const We=await td(p,U);xn(p,We),ln(p,[]),_n(p),a.value[p]&&(a.value=Ot(a.value,p)),Vt(p,null),dt(p,null),gt(p,null),ie=!0,await Dr()}catch(je){ve.value=je instanceof Error?je.message:"Failed to rollback thread"}finally{we.value=!1}}}let Vs=null;async function nl(u,p){try{const g=await ks(),b={...g.labels};let F=!1;for(const B of g.order){if(Go(B)!==u)continue;const U=p.trim();U.length===0?b[B]!==void 0&&(delete b[B],F=!0):b[B]!==U&&(b[B]=U,F=!0)}F&&await rd({order:g.order,labels:b,active:g.active})}catch{}}function ji(u,p){u.length===0||(he.value[u]??"")===p||(he.value={...he.value,[u]:p},fd(he.value),Vs!==null&&clearTimeout(Vs),Vs=setTimeout(()=>{Vs=null,nl(u,p)},500))}async function iu(u){var B;if(u.length===0)return;const p=Z.value.filter(U=>U!==u);if(Jo(Z.value,p)||(Z.value=p,Zs(Z.value)),t.value=t.value.filter(U=>U.projectName!==u),he.value[u]!==void 0){const U={...he.value};delete U[u],he.value=U,fd(U)}Dt();const g=oo(e.value);$r(g),g.some(U=>U.id===n.value)||Qe(((B=g[0])==null?void 0:B.id)??"");const F=new Set;try{const U=await ks();for(const G of U.order)Go(G)===u&&F.add(G);for(const G of U.active)Go(G)===u&&F.add(G);for(const G of Object.keys(U.labels))Go(G)===u&&F.add(G)}catch{}if(F.size>0)try{const U=await ks(),G=U.order.filter(We=>!F.has(We)),oe=U.active.filter(We=>!F.has(We)),je=oe.length===0&&G.length>0?[G[0]]:oe;await rd({order:G,labels:fD(U.labels,F),active:je});return}catch{}await Fi()}function au(u,p){if(u.length===0||t.value.length===0)return;const g=t.value.map(oe=>oe.projectName),b=g.indexOf(u);if(b===-1)return;const F=Math.max(0,Math.min(p,g.length-1)),B=ZL(g,b,F);if(B===g)return;const U=Tl(B,t.value);Z.value=U,Zs(Z.value);const G=pd(t.value,Z.value);t.value=Il(t.value,G),Dt(),Fi()}function rl(u){const p=u.trim();if(!p)return;const g=[p,...Z.value.filter(F=>F!==p)];if(Jo(Z.value,g))return;Z.value=g,Zs(Z.value);const b=pd(t.value,Z.value);t.value=Il(t.value,b),Dt(),Fi()}async function Fi(){var u,p;try{const g=await ks(),b=new Map;for(const U of g.order){const G=Go(U);b.has(G)||b.set(G,U)}for(const U of t.value){const G=((p=(u=U.threads[0])==null?void 0:u.cwd)==null?void 0:p.trim())??"";G&&b.set(U.projectName,G)}const F=[];for(const U of Z.value){const G=b.get(U);G&&!F.includes(G)&&F.push(G)}for(const U of g.order)F.includes(U)||F.push(U);const B=g.active.filter(U=>F.includes(U));B.length===0&&F.length>0&&B.push(F[0]),await rd({order:F,labels:g.labels,active:B})}catch{}}async function Dr(){if(Ze.value){typeof window<"u"&&q===null&&(q=window.setTimeout(()=>{q=null,Dr()},ld));return}Ze.value=!0;const u=ie,p=new Set(pe);ie=!1,pe.clear();try{u&&await ps();const g=n.value;if(!g)return;const b=p.has(g),F=c.value[g]===!0,B=cr(g),U=Ce.value[g]??"",G=B.length>0&&B!==U;(b||F||G||u)&&await tr(g,{silent:!0})}catch{}finally{Ze.value=!1,(ie||pe.size>0)&&typeof window<"u"&&q===null&&(q=window.setTimeout(()=>{q=null,Dr()},ld))}}async function lu(){await ol(),ie=!0,n.value&&pe.add(n.value),await Dr()}function cu(){typeof window>"u"||I||(ol(),I=xR(u=>{if(u.method==="ready"){Bn(),lu();return}Kc(u),Yc(u)}))}async function ol(){try{const p=(await MR()).map(g=>S(g)).filter(g=>g!==null);Pt(p)}catch{}}async function Bi(u){try{return await RR(u.id,{result:u.result,error:u.error}),Gt(u.id),!0}catch(p){return ve.value=p instanceof Error?p.message:"Failed to reply to server request",!1}}function uu(){if(I&&(I(),I=null),ie=!1,pe.clear(),Ue.clear(),q!==null&&typeof window<"u"&&(window.clearTimeout(q),q=null),Q!==null&&typeof window<"u"&&(window.clearTimeout(Q),Q=null),typeof window<"u")for(const u of ee.values())window.clearTimeout(u);ee.clear(),ne=!1,r.value={},o.value={},s.value={},i.value={},a.value={},l.value={},V.value={},xe.value={},ae.value={},Fe.value={},_e.value={},d.value={},f.value={},De.value=null,Be.value={}}const du=se(()=>{const u=n.value;return u?d.value[u]??[]:[]});function nr(u){const p=n.value;if(!p)return;const g=d.value[p];if(!g)return;const b=g.filter(F=>F.id!==u);d.value=b.length>0?{...d.value,[p]:b}:Ot(d.value,p)}function sl(u){const p=n.value;if(!p)return;const g=d.value[p];if(!g)return;const b=g.find(F=>F.id===u);b&&(nr(u),Qt(b.collaborationMode),el(b.text,b.imageUrls,b.skills,"steer",b.fileAttachments))}function il(u){Qe(u)}return{projectGroups:e,projectDisplayNameById:he,selectedThread:$e,selectedThreadTokenUsage:le,selectedThreadScrollState:x,selectedThreadServerRequests:$,selectedLiveOverlay:D,codexQuota:X,selectedThreadId:n,availableCollaborationModes:T,availableModelIds:v,selectedCollaborationMode:P,selectedModelId:O,selectedReasoningEffort:W,selectedSpeedMode:Y,installedSkills:Ge,accountRateLimitSnapshots:ot,messages:Le,isLoadingThreads:nt,isLoadingMessages:st,isSendingMessage:Ke,isInterruptingTurn:J,isUpdatingSpeedMode:be,isRollingBack:we,error:ve,refreshAll:Zc,refreshSkills:qo,selectThread:eu,loadMessages:tr,ensureThreadMessagesLoaded:Ja,setThreadScrollState:qn,archiveThreadById:tu,renameThreadById:Qa,forkThreadById:nu,forkThreadFromTurn:ru,rollbackSelectedThread:su,sendMessageToSelectedThread:el,sendMessageToNewThread:Hs,interruptSelectedThreadTurn:ou,selectedThreadQueuedMessages:du,removeQueuedMessage:nr,steerQueuedMessage:sl,setSelectedCollaborationMode:Qt,setSelectedModelId:wt,setSelectedReasoningEffort:Zt,updateSelectedSpeedMode:Ht,respondToPendingServerRequest:Bi,renameProject:ji,removeProject:iu,reorderProject:au,pinProjectToTop:rl,startPolling:cu,stopPolling:uu,primeSelectedThread:il}}const bD={class:"sidebar-root"},wD={class:"sidebar-scrollable"},SD=["aria-pressed"],TD={key:1,class:"sidebar-search-bar"},ED={key:0,class:"sidebar-settings-area"},kD={key:0,class:"sidebar-settings-panel"},ID={class:"sidebar-settings-account-section"},AD={class:"sidebar-settings-account-header"},CD={class:"sidebar-settings-account-header-main"},xD=["aria-expanded","title"],RD={class:"sidebar-settings-account-collapse-icon"},MD={class:"sidebar-settings-account-count"},PD=["disabled"],$D={key:0,class:"sidebar-settings-account-error"},ND={key:1,class:"sidebar-settings-account-empty"},OD={key:2,class:"sidebar-settings-account-list"},LD=["title","onMouseenter","onMouseleave"],DD={class:"sidebar-settings-account-main"},jD={class:"sidebar-settings-account-email"},FD={class:"sidebar-settings-account-meta"},BD={class:"sidebar-settings-account-quota"},qD={class:"sidebar-settings-account-id"},UD={class:"sidebar-settings-account-actions"},HD=["disabled","onClick"],WD=["disabled","onClick"],VD=["title"],zD=["title"],GD={class:"sidebar-settings-value"},KD=["title"],YD={class:"sidebar-settings-value"},JD=["title"],XD={class:"sidebar-settings-value"},QD=["title"],ZD=["title"],ej=["title"],tj=["title"],nj={class:"sidebar-settings-value"},rj=["data-state","title"],oj=["data-state"],sj={class:"sidebar-settings-context-meta"},ij={class:"sidebar-settings-rate-limits"},aj={class:"sidebar-settings-build-label","aria-label":"Worktree name and version"},lj={class:"sidebar-settings-button-version"},cj={class:"content-body"},uj={key:1,class:"content-grid content-grid-home"},dj={class:"new-thread-empty"},fj=["title"],pj={key:1,class:"new-thread-open-folder"},hj={class:"new-thread-open-folder-current"},mj=["title"],gj=["disabled"],vj={class:"new-thread-open-folder-actions"},yj={class:"new-thread-open-folder-toggle"},_j=["aria-pressed","disabled"],bj={key:0,class:"new-thread-open-folder-create"},wj={class:"new-thread-open-folder-create-composer"},Sj=["onKeydown"],Tj=["disabled"],Ej={key:0,class:"new-thread-open-folder-error"},kj={key:1,class:"new-thread-open-folder-error-actions"},Ij={class:"new-thread-open-folder-error"},Aj=["disabled"],Cj={key:2,class:"new-thread-open-folder-status"},xj={key:3,class:"new-thread-open-folder-status"},Rj={key:4,class:"new-thread-open-folder-list"},Mj=["title","disabled","onClick"],Pj={class:"new-thread-open-folder-item-name"},$j=["disabled","onClick"],Nj={key:2,class:"new-thread-branch-select"},Oj={class:"new-thread-branch-select-help"},Lj={class:"worktree-init-status-title"},Dj={class:"worktree-init-status-message"},jj={key:4,class:"new-thread-trending"},Fj={class:"new-thread-trending-header"},Bj={key:0,class:"new-thread-trending-empty"},qj={key:1,class:"new-thread-trending-empty"},Uj={key:2,class:"new-thread-trending-list"},Hj=["onClick"],Wj=["title"],Vj={class:"new-thread-trending-tip-name-owner"},zj={class:"new-thread-trending-tip-name-repo"},Gj={key:1,class:"new-thread-trending-tip-name-repo"},Kj={class:"new-thread-trending-tip-meta"},Yj={class:"new-thread-trending-tip-description"},Jj={class:"composer-with-queue"},Xj={key:2,class:"content-grid"},Qj={class:"content-thread"},Zj={class:"composer-with-queue"},cg="codex-web-local.sidebar-collapsed.v1",ug="codex-web-local.accounts-section-collapsed.v1",dg="codex-web-local.send-with-enter.v1",fg="codex-web-local.in-progress-send-mode.v1",pg="codex-web-local.dark-mode.v1",hg="codex-web-local.dictation-click-to-toggle.v1",mg="codex-web-local.dictation-auto-send.v1",gg="codex-web-local.dictation-language.v1",vg="codex-web-local.github-trending-projects.v1",yg="codex-web-local.chat-width.v1",e2=400,t2=An({__name:"App",setup(e){const t=Su(()=>zu(()=>import("./ThreadConversation-DlVMY4f_.js"),__vite__mapDeps([0,1]))),n=Su(()=>zu(()=>import("./ReviewPane-Dee4Qknm.js"),__vite__mapDeps([2,3]))),r=Su(()=>zu(()=>import("./SkillsHub-DUNP6fA0.js"),__vite__mapDeps([4,5]))),o="a77f",s="0.1.81",i={sendWithEnter:"When enabled, press Enter to send. When disabled, use Command+Enter to send.",inProgressSendMode:"If a turn is still running, choose whether a new prompt should steer the current turn or be queued.",appearance:"Switch between system theme, light mode, and dark mode.",chatWidth:"Choose how wide the conversation column and composer can grow on desktop screens.",dictationClickToToggle:"Use click-to-start and click-to-stop dictation instead of hold-to-talk.",dictationAutoSend:"Automatically send transcribed dictation when recording stops.",githubTrendingProjects:"Show or hide GitHub trending project cards on the new thread screen.",dictationLanguage:"Choose transcription language or keep auto-detect."},a={standard:{label:"Standard",columnMax:"45rem",cardMax:"76ch"},wide:{label:"Wide",columnMax:"72rem",cardMax:"88ch"},"extra-wide":{label:"Extra wide",columnMax:"96rem",cardMax:"96ch"}},l={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:c,projectDisplayNameById:d,selectedThread:f,selectedThreadTokenUsage:m,selectedThreadScrollState:v,selectedThreadServerRequests:T,selectedLiveOverlay:k,codexQuota:H,selectedThreadId:P,availableCollaborationModes:O,availableModelIds:W,selectedCollaborationMode:Y,selectedModelId:ce,selectedReasoningEffort:re,selectedSpeedMode:Z,installedSkills:he,accountRateLimitSnapshots:Ce,messages:Ae,isLoadingThreads:ue,isLoadingMessages:V,isSendingMessage:ae,isInterruptingTurn:xe,isUpdatingSpeedMode:Fe,refreshAll:_e,refreshSkills:Me,selectThread:fe,ensureThreadMessagesLoaded:De,setThreadScrollState:Be,archiveThreadById:Re,forkThreadById:Ge,renameThreadById:ot,forkThreadFromTurn:nt,sendMessageToSelectedThread:st,sendMessageToNewThread:Ke,interruptSelectedThreadTurn:J,selectedThreadQueuedMessages:be,removeQueuedMessage:we,steerQueuedMessage:ve,setSelectedCollaborationMode:Ze,setSelectedModelId:E,setSelectedReasoningEffort:I,updateSelectedSpeedMode:q,respondToPendingServerRequest:Q,renameProject:ee,removeProject:te,reorderProject:ie,pinProjectToTop:pe,startPolling:me,stopPolling:ne,primeSelectedThread:Ue,rollbackSelectedThread:ke}=_D(),ye=O1(),$e=N1(),{isMobile:x}=rp(),$=j(null),D=j(null),X=j(null),le=j([]),Le=j(!1),Ne=j("trending-daily"),rt=j(null),Qe=j(!1);let wt=!1;const Rt=j(!1),ct=j(""),Qt=j("local"),mn=j(""),ar=j([]),Xn=j(!1),mr=j({order:[],labels:{}}),Ut=j({phase:"idle",title:"",message:""}),Zt=j(Sb()),Ht=j(""),gr=j(!1),Wt=j(null),Yr=j(null);let jn=null;const vr=j("New Project (1)"),Mr=j(""),ho=j(!1),Fn=j(Eb()),en=j(!1),Pr=j([]),Cn=j(null),Dt=j(!1),lr=j(!1),$r=j(null),gn=j([]),Vt=j(!1),Mt=j(!1),vn=j(""),dt=j(""),gt=j(""),an=j(""),Bn=j(cl(dg,!0)),cr=j(ub()),qn=j(cb()),xn=j(db()),ln=j(cl(hg,!1)),Un=j(cl(mg,!0)),ur=j(bb()),Nr=se(()=>wb()),Hn=j(cl(vg,!1)),En=j(!1),Qn=j(""),yn=j(""),_n=j(!1),Rn=j(!1),bn=j(""),yr=j(""),Jr=j([]),Nt=j(""),on=j(!1),Wn=j(!1),qe=j(!1),Te=j(""),St=j({configured:!1,active:!1,mappedChats:0,mappedThreads:0,lastError:""}),Or=j(null),Lr=j(!1),Zn=j(!1);let er=null,Xr=!1,_r=0;const Mn=se(()=>{const h=ye.params.threadId;return typeof h=="string"?h:""}),qt=se(()=>{const h=new Set;for(const _ of c.value)for(const M of _.threads)h.add(M.id);return h}),zt=se(()=>ye.name==="home"),br=se(()=>ye.name==="skills"),S=se(()=>{var h;return br.value?"Skills":zt.value?"New thread":((h=f.value)==null?void 0:h.title)??"Choose a thread"}),C=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",N=se(()=>{var _,M;return(((M=(_=f.value)==null?void 0:_.title)==null?void 0:M.trim())??"")||C}),z=se(()=>Ae.value.filter(h=>{const _=Ib(h.messageType,h.role);return _==="worked"?!0:!(_==="turnActivity.live"||_==="turnError.live"||_==="agentReasoning.live")})),w=se(()=>k.value),R=se(()=>zt.value?"__new-thread__":P.value),K=se(()=>{const h=T.value;return h.length>0?h[h.length-1]:null}),Ee=se(()=>{var h,_;return zt.value?ct.value.trim():((_=(h=f.value)==null?void 0:h.cwd)==null?void 0:_.trim())??""}),it=se(()=>{var h;return!zt.value&&((h=f.value)==null?void 0:h.inProgress)===!0}),Ft=se(()=>!zt.value&&!br.value&&P.value.trim().length>0),Gt=se(()=>ae.value||xe.value||it.value||T.value.length>0);function Pt(h){return Number.isFinite(h)?new Intl.NumberFormat("en-US",{notation:h>=1e3?"compact":"standard",maximumFractionDigits:h>=1e5?0:1}).format(Math.max(0,Math.trunc(h))):"0"}function wn(h){if(!h)return"Waiting for Codex thread/tokenUsage/updated events for this thread.";const _=[`Current context usage: ${h.currentContextTokens.toLocaleString()} tokens`,`Cumulative thread usage: ${h.total.totalTokens.toLocaleString()} tokens`];return typeof h.modelContextWindow=="number"?(_.unshift(`Model context window: ${h.modelContextWindow.toLocaleString()} tokens`),_.push(`Remaining context: ${(h.remainingContextTokens??0).toLocaleString()} tokens`)):_.push("Model context window is unavailable in the latest usage event."),_.join(`
84
+ `)}const Qr=se(()=>{var _;const h=(_=m.value)==null?void 0:_.remainingContextPercent;return h===null||typeof h!="number"?"pending":h<=10?"danger":h<=25?"warning":"ok"}),ds=se(()=>{const h=m.value;return h?typeof h.remainingContextTokens=="number"?`${Pt(h.remainingContextTokens)} left`:`${Pt(h.currentContextTokens)} used`:"Awaiting data"}),Lc=se(()=>{const h=m.value;return h?typeof h.modelContextWindow=="number"?`${Pt(h.currentContextTokens)} used / ${Pt(h.modelContextWindow)}`:"Window size unavailable":"Updates after the next token usage event"}),Dc=se(()=>wn(m.value)),fs=se(()=>{var de,Pe;const h=[],_=new Set;for(const Oe of mr.value.order){const at=Oe.trim();!at||_.has(at)||(_.add(at),h.push({value:at,label:mr.value.labels[at]||ni(at)}))}for(const Oe of c.value){const at=((Pe=(de=Oe.threads[0])==null?void 0:de.cwd)==null?void 0:Pe.trim())??"";!at||_.has(at)||(_.add(at),h.push({value:at,label:d.value[Oe.projectName]??Oe.projectName}))}const M=ct.value.trim();return M&&!_.has(M)&&h.unshift({value:M,label:ni(M)}),h}),Ni=se(()=>{const h=mn.value.trim(),_=[...ar.value];return h&&!_.some(M=>M.value===h)&&_.unshift({value:h,label:h}),_}),Va=se(()=>{const h=mn.value.trim();if(!h)return"";const _=Ni.value.find(M=>M.value===h);return(_==null?void 0:_.label)??h}),jc=se(()=>Cn.value??"__detached_head__"),Fc=se(()=>{var de;const h=[{value:"__review__",label:en.value?"Review (Open)":"Review"}],_=new Set,M=((de=Cn.value)==null?void 0:de.trim())??"";M?(h.push({value:M,label:M}),_.add(M)):(h.push({value:"__detached_head__",label:"Detached HEAD"}),_.add("__detached_head__"));for(const Pe of Pr.value)!Pe.value||_.has(Pe.value)||(_.add(Pe.value),h.push(Pe));return h}),za=se(()=>bn.value.trim()),Ga=se(()=>{const h=Qn.value.trim();return!h||h==="."||h===".."?!1:!/[\\/]/u.test(h)}),Bc=se(()=>Ga.value&&za.value.trim().length>0&&!Nt.value),qc=se(()=>_n.value?"Creating…":"Create"),Uc=se(()=>{const h=bn.value.trim(),_=yr.value.trim();return!!(h&&_&&h!==_)}),Ka=se(()=>{const h=[];Uc.value&&h.push({key:`parent:${yr.value}`,name:"..",path:yr.value,kind:"parent"});for(const _ of Jr.value)h.push({key:`directory:${_.path}`,name:_.name,path:_.path,kind:"directory"});return h}),Oi=se(()=>{const h=Te.value.trim().toLowerCase();return h?Ka.value.filter(_=>_.kind==="parent"||_.name.toLowerCase().includes(h)):Ka.value}),Bo=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,Hc=se(()=>[{value:"search-daily",label:"Search daily"},{value:"search-weekly",label:"Search weekly"},{value:"search-monthly",label:"Search monthly"},{value:"trending-daily",label:"Trending daily"},{value:"trending-weekly",label:"Trending weekly"},{value:"trending-monthly",label:"Trending monthly"}]),Wc=se(()=>a[xn.value].label),Vc=se(()=>{const h=a[xn.value];return{"--chat-column-max":h.columnMax,"--chat-card-max":h.cardMax}}),Li=se(()=>{if(!St.value.configured)return"Not configured";const h=St.value.active?"Online":"Configured (offline)",_=`${St.value.mappedChats} chat(s), ${St.value.mappedThreads} thread(s)`,M=St.value.lastError?`, error: ${St.value.lastError}`:"";return`${h}, ${_}${M}`});as(()=>{window.addEventListener("keydown",sl),document.addEventListener("visibilitychange",il),window.addEventListener("pageshow",u),window.addEventListener("focus",p),ul(),Bo==null||Bo.addEventListener("change",ul),Ab(),eb(),Ui(),cn(),Di(),Hn.value&&fu()}),_c(()=>{window.removeEventListener("keydown",sl),document.removeEventListener("visibilitychange",il),window.removeEventListener("pageshow",u),window.removeEventListener("focus",p),Bo==null||Bo.removeEventListener("change",ul),er!==null&&(window.clearInterval(er),er=null),jn&&(clearTimeout(jn),jn=null),ne()}),lt(Ht,h=>{const _=h.trim();if(jn&&(clearTimeout(jn),jn=null),!_){Yr.value=null;return}jn=setTimeout(()=>{tM(_,1e3).then(M=>{Ht.value.trim()===_&&(Yr.value=M.threadIds)}).catch(()=>{Ht.value.trim()===_&&(Yr.value=null)})},220)}),lt(gn,()=>{if(typeof window>"u")return;if(!gn.value.some(_=>_.quotaStatus==="loading")){er!==null&&(window.clearInterval(er),er=null);return}er===null&&(er=window.setInterval(()=>{Xr||(Xr=!0,Hs({silent:!0}).finally(()=>{Xr=!1}))},1500))},{deep:!0});function zc(){Me()}async function Di(){try{St.value=await rM()}catch(h){const _=h instanceof Error?h.message:"Failed to load Telegram status";St.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,lastError:_}}}function Gc(){gr.value=!gr.value,gr.value?Jt(()=>{var h;return(h=Wt.value)==null?void 0:h.focus()}):Ht.value=""}function Kc(){var h;Ht.value="",(h=Wt.value)==null||h.focus()}function Yc(h){h.key==="Escape"&&(gr.value=!1,Ht.value="")}function Jc(h){h&&(ye.name==="thread"&&Mn.value===h||($e.push({name:"thread",params:{threadId:h}}),x.value&&nr(!0)))}async function Xc(h){h&&(P.value!==h&&(await fe(h),await $e.push({name:"thread",params:{threadId:h}})),await Jt(),sb())}function Qc(h){return h.length>8?h.slice(-8):h}function Ya(h){const _=[h.planType||"unknown"];return h.authMode&&_.unshift(h.authMode),_.join(" · ")}function ps(h){if(!h)return!1;const _=h.toLowerCase();return _.includes("payment required")||/\b402\b/.test(_)}function tr(h){return h.unavailableReason==="payment_required"||ps(h.quotaError)}function Ja(h){return Vt.value||Mt.value||vn.value.length>0||h.isActive&&vn.value!==h.accountId&&Gt.value}function qo(h){return dt.value===h.accountId}function Xa(h){return gt.value===h.accountId||qo(h)}function Zc(h){return tr(h)?"Unavailable":h.isActive?"Active":Mt.value?"Switching…":"Switch"}function eu(h){return vn.value===h.accountId?"Removing…":qo(h)?"Click again to remove":"Remove"}function tu(h){gt.value=h}function Qa(h){gt.value===h&&(gt.value=""),vn.value!==h&&dt.value===h&&(dt.value="")}function nu(h){const _=h.quotaSnapshot;if(!_)return null;const M=[_==null?void 0:_.primary,_==null?void 0:_.secondary].filter(Oe=>Oe!==null),de=M.find(Oe=>Oe.windowMinutes===10080);if(de)return de;const Pe=M.filter(Oe=>typeof Oe.windowMinutes=="number"&&Oe.windowMinutes>=10080).sort((Oe,at)=>(Oe.windowMinutes??0)-(at.windowMinutes??0))[0]??null;return Pe||(_.secondary??null)}function ru(h){if(typeof h!="number"||!Number.isFinite(h))return"";const _=new Date(h*1e3);return`${_.getMonth()+1}月${_.getDate()}日`}function Za(h){var Oe,at;if(tr(h))return h.quotaError||"402 Payment Required";const _=h.quotaSnapshot,M=nu(h),de=(_==null?void 0:_.primary)??(_==null?void 0:_.secondary)??null,Pe=M??de;if(Pe){const Pn=Math.max(0,Math.min(100,100-Math.round(Pe.usedPercent))),to=ru(Pe.resetsAt);return to?`${Pn}% weekly remaining · ${to}`:`${Pn}% weekly remaining`}return(Oe=_==null?void 0:_.credits)!=null&&Oe.unlimited?"Unlimited credits":(at=_==null?void 0:_.credits)!=null&&at.hasCredits&&_.credits.balance?`${_.credits.balance} credits`:h.quotaStatus==="loading"?"Loading quota…":h.quotaStatus==="error"?h.quotaError||"Quota unavailable":h.quotaStatus==="ready"||h.quotaStatus==="idle"?"Quota unavailable":"Fetching account details…"}function el(h){return[h.email||"Account",Ya(h),tr(h)?"Unavailable account":null,Za(h),`Workspace ${h.accountId}`].filter(Boolean).join(`
85
+ `)}async function Hs(h={}){try{const _=await PR();gn.value=_.accounts,_.accounts.some(M=>M.accountId===gt.value)||(gt.value=""),_.accounts.some(M=>M.accountId===dt.value)||(dt.value="")}catch(_){if(h.silent===!0)return;an.value=_ instanceof Error?_.message:"Failed to load accounts"}}async function Ws(){if(!(Vt.value||Mt.value)){an.value="",gt.value="",dt.value="",Vt.value=!0;try{const h=await $R();gn.value=h.accounts,ne(),me(),_e({includeSelectedThreadMessages:!0})}catch(h){an.value=h instanceof Error?h.message:"Failed to refresh accounts"}finally{Vt.value=!1}}}async function tl(h){if(!(Mt.value||Vt.value)){if(Gt.value){an.value="Finish the current turn and pending requests before switching accounts.";return}an.value="",gt.value="",dt.value="",Mt.value=!0;try{const _=await NR(h);gn.value=gn.value.map(M=>M.accountId===h?_:{...M,isActive:!1}),ne(),me(),_e({includeSelectedThreadMessages:!0}),Hs({silent:!0})}catch(_){an.value=_ instanceof Error?_.message:"Failed to switch account"}finally{Mt.value=!1}}}async function ou(h){if(Vt.value||Mt.value||vn.value.length>0)return;const _=gn.value.find(de=>de.accountId===h)??null;if(!_)return;if(dt.value!==h){dt.value=h;return}if(_.isActive&&Gt.value){an.value="Finish the current turn and pending requests before removing the active account.";return}const M=_.isActive;an.value="",dt.value="",vn.value=h;try{const de=await OR(h);gn.value=de.accounts,ne(),me(),M&&_e({includeSelectedThreadMessages:!0}),Hs({silent:!0})}catch(de){an.value=de instanceof Error?de.message:"Failed to remove account"}finally{vn.value=""}}function su(h){Re(h)}async function Vs(h){const _=await Ge(h);_&&(zt.value?await $e.replace({name:"thread",params:{threadId:_}}):await $e.push({name:"thread",params:{threadId:_}}),x.value&&nr(!0))}function nl(h){const _=h.trim().replace(/\\/gu,"/");return _?_.includes("/.codex/worktrees/")||_.includes("/.git/worktrees/"):!1}function ji(h,_=""){var Oe,at,Pn;const M=c.value.find(to=>to.projectName===h);if(!M)return _.trim();const de=M.threads.find(to=>!nl(to.cwd));return(((Oe=de==null?void 0:de.cwd)==null?void 0:Oe.trim())??((Pn=(at=M.threads[0])==null?void 0:at.cwd)==null?void 0:Pn.trim())??"")||_.trim()}function iu(h){var de,Pe;const _=c.value.find(Oe=>Oe.projectName===h),M=ji(h,((Pe=(de=_==null?void 0:_.threads[0])==null?void 0:de.cwd)==null?void 0:Pe.trim())??"");M&&(ct.value=M),x.value&&nr(!0),!zt.value&&$e.push({name:"home"})}function au(h){var M;let _="";for(const de of c.value){const Pe=de.threads.find(Oe=>Oe.id===h);if((M=Pe==null?void 0:Pe.cwd)!=null&&M.trim()){_=Pe.cwd.trim();break}}!_||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(_)}`,"_blank","noopener,noreferrer")}function rl(){var M;const h=f.value,_=h?ji(h.projectName,((M=h.cwd)==null?void 0:M.trim())??""):"";_&&(ct.value=_),x.value&&nr(!0),!zt.value&&$e.push({name:"home"})}function Fi(h){ee(h.projectName,h.displayName)}function Dr(h){ot(h.threadId,h.title)}async function lu(h){await te(h),await Ui(),cn()}function cu(h){ie(h.projectName,h.toIndex)}function ol(h){Be(h.threadId,h.state)}function Bi(h){uu(h)}async function uu(h){var de;const _=await Q(h),M=((de=h.followUpMessageText)==null?void 0:de.trim())??"";if(!(!_||!M||zt.value))try{await st(M,[],[],"steer",[])}catch{}}async function du(h){const _=await nt(h.threadId,h.turnIndex);_&&(await $e.push({name:"thread",params:{threadId:_}}),P.value!==_&&await fe(_),x.value&&nr(!0))}function nr(h){Zt.value!==h&&(Zt.value=h,Tb(h))}function sl(h){h.defaultPrevented||!h.ctrlKey&&!h.metaKey||h.shiftKey||h.altKey||h.key.toLowerCase()==="b"&&(h.preventDefault(),nr(!Zt.value))}function il(){if(!(typeof document>"u")&&x.value){if(document.visibilityState==="hidden"){Or.value=Date.now(),Lr.value=!1;return}g()}}function u(h){h.persisted&&g()}function p(){ye.name==="home"&&(Ui(),cn()),g()}function g(){typeof window>"u"||typeof document>"u"||!x.value||document.visibilityState!=="visible"||Lr.value||Or.value===null||Date.now()-Or.value<e2||(Lr.value=!0,Or.value=null,b())}async function b(){if(!Zn.value){Zn.value=!0;try{await _e({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await mu()}finally{Zn.value=!1}}}function F(h){const _=h.text;We();const M=rt.value,de=h.mode==="queue"&&M&&M.threadId===P.value?M.queueIndex:void 0;if(rt.value=null,zt.value){Cb(_,h.imageUrls,h.skills,h.fileAttachments);return}st(_,h.imageUrls,h.skills,h.mode,h.fileAttachments,de)}function B(h){const _=new Intl.NumberFormat().format(h.stars);return h.language?`${h.language} · ★ ${_}`:`★ ${_}`}function U(h){const M=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(h)?h:"trending-daily";Ne.value!==M&&(Ne.value=M)}function G(){if(typeof window>"u")return;const h=window.prompt("Telegram bot token");!h||!h.trim()||nM(h.trim()).then(()=>{window.alert("Telegram bot configured. Open the bot DM and send /start."),Di()}).catch(_=>{const M=_ instanceof Error?_.message:"Failed to connect Telegram bot";window.alert(M),Di()})}function oe(h){const _=$.value;_&&_.hydrateDraft({text:`Clone this GitHub project and run it: ${h.url}
86
+ Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function je(h){const _=be.value.findIndex(Oe=>Oe.id===h),M=_>=0?be.value[_]:void 0,de=D.value;if(!M||!de||de.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;rt.value=P.value?{threadId:P.value,queueIndex:_}:null;const Pe={text:M.text,imageUrls:[...M.imageUrls],fileAttachments:M.fileAttachments.map(Oe=>({...Oe})),skills:M.skills.map(Oe=>({...Oe}))};de.hydrateDraft(Pe),we(h)}function We(){if(!x.value||zt.value)return;const h=()=>{var _;(_=X.value)==null||_.jumpToLatest()};h(),Jt(()=>{h(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{h(),window.requestAnimationFrame(h)})})}function ft(h){ct.value=h.trim(),yn.value=""}function vt(h){mn.value=h.trim()}async function tn(h){const _=h.trim();if(!_||ye.name!=="thread"){Pr.value=[],Cn.value=null;return}Dt.value=!0;try{const M=await YR(_);Pr.value=M.options,Cn.value=M.currentBranch}catch{Pr.value=[],Cn.value=null}finally{Dt.value=!1}}function zs(h){if(h==="__review__"){en.value=!en.value;return}if(h==="__detached_head__"||lr.value)return;const _=h.trim();if(!_||_===(Cn.value??""))return;const M=Ee.value.trim();M&&(lr.value=!0,JR(M,_).then(de=>(Cn.value=de||_,en.value=!1,tn(M))).catch(de=>{const Pe=de instanceof Error?de.message:"Failed to switch branch";window.alert(Pe)}).finally(()=>{lr.value=!1}))}async function Gs(){const _=await Je()||Mr.value.trim()||"/",M=new URLSearchParams,de=vr.value.trim();de&&M.set("newProjectName",de);const Pe=M.toString();window.location.assign(`/codex-local-browse${encodeURI(_)}${Pe?`?${Pe}`:""}`)}async function al(){const h=ct.value.trim()||await Je();h&&(En.value=!1,Rn.value=!0,Te.value="",await Ks(h))}function Uo(){_r+=1,Rn.value=!1,on.value=!1,Nt.value="",Te.value="",Zr()}async function hs(h){!h||on.value||(Te.value="",await Ks(h))}function ms(){const h=bn.value.trim();!Rn.value||!h||Ks(h)}function gs(){const h=bn.value.trim();!Rn.value||!h||on.value||Ks(h)}async function mo(h=bn.value){const _=h.trim();if(_){Nt.value="",Wn.value=!0;try{const M=await Vm(_,{createIfMissing:!1,label:""});if(!M){Nt.value="Failed to open the selected folder.";return}ct.value=M,pe(ni(M)),await Ui(),await cn(),Uo()}catch(M){Nt.value=M instanceof Error?M.message:"Failed to open the selected folder."}finally{Wn.value=!1}}}async function vs(){if(yn.value="",En.value){Zr();return}if(!Rn.value){const h=ct.value.trim()||await Je();if(!h||(Rn.value=!0,Te.value="",await Ks(h),Nt.value))return}Nt.value||(Qn.value=vr.value,En.value=!0,Jt(()=>{var h;return(h=$r.value)==null?void 0:h.focus()}))}function Zr(){yn.value="",Qn.value="",En.value=!1}async function qi(){const h=Qn.value.trim();if(!h)return;if(yn.value="",Nt.value){yn.value="Reload the current folder before creating a new one.";return}_n.value=!0;const _=za.value.trim(),M=nb(tb(_,h));if(!M){yn.value="Unable to determine where the new folder should be created.",_n.value=!1;return}if(!Ga.value){yn.value="Enter a single folder name.",_n.value=!1;return}try{const de=await QR(M);if(!de){yn.value="Failed to create the folder.";return}yn.value="",Te.value="",await Ks(de),Zr()}catch(de){yn.value=de instanceof Error?de.message:"Failed to create folder."}finally{_n.value=!1}}async function ll(){var _;if(typeof window>"u")return!1;const h=((_=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:_.trim())??"";if(!h)return!1;try{const M=await Vm(h,{createIfMissing:!1,label:""});if(!M)return!1;ct.value=M,pe(ni(M)),await $e.replace({name:"home"}),await Ui();const de=new URL(window.location.href);return de.searchParams.delete("openProjectPath"),window.history.replaceState({},"",de.toString()),!0}catch{return!1}}async function Je(){const h=eo();if(h)return h;try{const _=await Wm();if(_)return Mr.value=_,_}catch{}return""}async function cn(){const h=eo();if(!h){vr.value="New Project (1)";return}try{const _=await ZR(h);vr.value=_.name||"New Project (1)"}catch{vr.value="New Project (1)"}}function eo(){var M,de;const h=ct.value.trim();if(h)return Xu(h);const _=((de=(M=fs.value[0])==null?void 0:M.value)==null?void 0:de.trim())??"";return _?Xu(_):Mr.value.trim()}async function eb(){try{Mr.value=await Wm()}catch{Mr.value=""}}async function Ui(){try{const h=await ks();mr.value={order:[...h.order],labels:{...h.labels}}}catch{mr.value={order:[],labels:{}}}}async function Ks(h){const _=++_r;bn.value=nn(h).trim(),Nt.value="",on.value=!0;try{const M=await XR(h,{showHidden:qe.value});if(_!==_r)return;bn.value=M.path,yr.value=M.parentPath,Jr.value=M.entries}catch(M){if(_!==_r)return;Nt.value=M instanceof Error?M.message:"Failed to load local folders.",yr.value=Xu(bn.value),Jr.value=[],Zr()}finally{_===_r&&(on.value=!1)}}async function fu(){Le.value=!0;try{le.value=await sM(Ne.value,6)}catch{le.value=[]}finally{Le.value=!1}}function tb(h,_){const M=nn(h).trim(),de=nn(_).trim().replace(/^[\\/]+/u,"");if(!M||!de)return"";const Pe=M.includes("\\")&&!M.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(M))return`${M.slice(0,2)}${Pe}${de}`;if(/^\/+$/u.test(M))return`/${de}`;const Oe=M.replace(/[\\/]+$/u,"");return Oe?`${Oe}${Pe}${de}`:""}function nb(h){const _=nn(h).trim();if(!_)return"";const M=_.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(M){const[,Pe,Oe,at=""]=M,Pn=pu(at.split(/[\\/]+/u));return Pn.length>0?`\\\\${Pe}\\${Oe}\\${Pn.join("\\")}`:`\\\\${Pe}\\${Oe}`}const de=_.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(de){const[,Pe,Oe=""]=de,at=_.includes("\\")&&!_.includes("/")?"\\":"/",Pn=pu(Oe.split(/[\\/]+/u));return Pn.length>0?`${Pe}${at}${Pn.join(at)}`:`${Pe}${at}`}if(_.startsWith("/")){const Pe=pu(_.split("/"));return Pe.length>0?`/${Pe.join("/")}`:"/"}return _}function pu(h){const _=[];for(const M of h){const de=M.trim();if(!(!de||de===".")){if(de===".."){_.length>0&&_.pop();continue}_.push(de)}}return _}function cp(h){E(h)}function up(h){I(h)}function dp(h){q(h)}function rb(){J()}function ob(h){const _=h.turnId.trim();if(_.length>0){const M=[...z.value].reverse().find(de=>{var Pe;return de.role==="user"&&(((Pe=de.turnId)==null?void 0:Pe.trim())??"")===_&&de.text.trim().length>0});M!=null&&M.text&&D.value&&D.value.appendTextToDraft(M.text)}ke(h.turnId)}function sb(){if(zt.value||br.value||typeof document>"u"||!f.value||z.value.length===0)return;const h=ib(),_=ab(),M=new Blob([h],{type:"text/markdown;charset=utf-8"}),de=URL.createObjectURL(M),Pe=document.createElement("a");Pe.href=de,Pe.download=_,document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),window.setTimeout(()=>URL.revokeObjectURL(de),0)}function ib(){var M,de,Pe;const h=[],_=((de=(M=f.value)==null?void 0:M.title)==null?void 0:de.trim())||"Untitled thread";h.push(`# ${lb(_)}`),h.push(""),h.push(`- Exported: ${new Date().toISOString()}`),h.push(`- Thread ID: ${((Pe=f.value)==null?void 0:Pe.id)??""}`),h.push(""),h.push("---"),h.push("");for(const Oe of z.value){const at=Oe.role?Oe.role.toUpperCase():"MESSAGE";h.push(`## ${at}`),h.push("");const Pn=Oe.text.trim();if(Pn&&(h.push(Pn),h.push("")),Oe.commandExecution&&(h.push("```text"),h.push(`command: ${Oe.commandExecution.command}`),h.push(`status: ${Oe.commandExecution.status}`),Oe.commandExecution.cwd&&h.push(`cwd: ${Oe.commandExecution.cwd}`),Oe.commandExecution.exitCode!==null&&h.push(`exitCode: ${Oe.commandExecution.exitCode}`),h.push(Oe.commandExecution.aggregatedOutput||"(no output)"),h.push("```"),h.push("")),Oe.fileAttachments&&Oe.fileAttachments.length>0){h.push("Attachments:");for(const to of Oe.fileAttachments)h.push(`- ${to.path}`);h.push("")}if(Oe.images&&Oe.images.length>0){h.push("Images:");for(const to of Oe.images)h.push(`- ${to}`);h.push("")}}return`${h.join(`
87
+ `).trimEnd()}
88
+ `}function ab(){var Pe,Oe;const M=(((Oe=(Pe=f.value)==null?void 0:Pe.title)==null?void 0:Oe.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",de=new Date().toISOString().replace(/[:.]/g,"-");return`${M}-${de}.md`}function lb(h){return h.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function cl(h,_){if(typeof window>"u")return _;const M=window.localStorage.getItem(h);return M===null?_:M==="1"}function cb(){if(typeof window>"u")return"system";const h=window.localStorage.getItem(pg);return h==="light"||h==="dark"?h:"system"}function ub(){return typeof window>"u"?"steer":window.localStorage.getItem(fg)==="queue"?"queue":"steer"}function db(){if(typeof window>"u")return"standard";const h=window.localStorage.getItem(yg);return h==="standard"||h==="wide"||h==="extra-wide"?h:"standard"}function fb(){Bn.value=!Bn.value,window.localStorage.setItem(dg,Bn.value?"1":"0")}function pb(){cr.value=cr.value==="steer"?"queue":"steer",window.localStorage.setItem(fg,cr.value)}function hb(){const h=["system","light","dark"],_=h.indexOf(qn.value);qn.value=h[(_+1)%h.length],window.localStorage.setItem(pg,qn.value),ul()}function mb(){const h=["standard","wide","extra-wide"],_=h.indexOf(xn.value);xn.value=h[(_+1)%h.length],window.localStorage.setItem(yg,xn.value)}function gb(){ln.value=!ln.value,window.localStorage.setItem(hg,ln.value?"1":"0")}function vb(){Un.value=!Un.value,window.localStorage.setItem(mg,Un.value?"1":"0")}function yb(){Hn.value=!Hn.value,window.localStorage.setItem(vg,Hn.value?"1":"0")}function _b(h){const M=hu(h.trim())||"auto";ur.value=M,window.localStorage.setItem(gg,M)}function bb(){var M;if(typeof window>"u")return"auto";const h=((M=window.localStorage.getItem(gg))==null?void 0:M.trim())||"auto";return hu(h)||"auto"}function wb(){const h=[{value:"auto",label:"Auto-detect"}],_=new Set(["auto"]);function M(Pe){const Oe=l[Pe]||Pe;return`${Oe.charAt(0).toUpperCase()+Oe.slice(1)} (${Pe})`}for(const Pe of typeof navigator<"u"?navigator.languages??[]:[]){const Oe=hu(Pe);!Oe||_.has(Oe)||(_.add(Oe),h.push({value:Oe,label:`Preferred: ${M(Oe)}`}))}for(const Pe of Object.keys(l))_.has(Pe)||(_.add(Pe),h.push({value:Pe,label:M(Pe)}));const de=ur.value.trim();return de&&!_.has(de)&&h.push({value:de,label:M(de)}),h}function hu(h){const _=h.trim().toLowerCase();if(!_||_==="auto")return"";if(_ in l)return _;const M=_.split("-")[0]??_;return M in l?M:""}function ul(){const h=document.documentElement;if(qn.value==="dark")h.classList.add("dark");else if(qn.value==="light")h.classList.remove("dark");else{const _=window.matchMedia("(prefers-color-scheme: dark)").matches;h.classList.toggle("dark",_)}}function Sb(){return typeof window>"u"?!1:window.localStorage.getItem(cg)==="1"}function Tb(h){typeof window>"u"||window.localStorage.setItem(cg,h?"1":"0")}function Eb(){if(typeof window>"u")return!0;const h=window.localStorage.getItem(ug);return h===null?!0:h==="1"}function kb(){Fn.value=!Fn.value,!(typeof window>"u")&&window.localStorage.setItem(ug,Fn.value?"1":"0")}function Ib(h,_){const M=(h??"").trim();return M.length>0?M:_.trim()||"message"}function fp(h){Ze(h)}async function Ab(){await $e.isReady(),ye.name==="thread"&&Mn.value&&Ue(Mn.value),me(),await _e({includeSelectedThreadMessages:!0}),Hs({silent:!0}),await ll(),Rt.value=!0,await mu()}async function mu(){if(Qe.value){wt=!0;return}Qe.value=!0;try{do{if(wt=!1,ye.name==="home"||ye.name==="skills"){P.value!==""&&await fe("");continue}if(ye.name==="thread"){const h=Mn.value;if(!h)continue;if(!qt.value.has(h)){await $e.replace({name:"home"});continue}P.value!==h?await fe(h):De(h,{silent:!0})}}while(wt)}finally{Qe.value=!1}}lt(()=>[ye.name,Mn.value,ue.value,qt.value.has(Mn.value),P.value],async()=>{Rt.value&&await mu()}),lt(()=>P.value,async h=>{if(Rt.value&&!Qe.value&&!(zt.value||br.value)){if(!h){ye.name!=="home"&&await $e.replace({name:"home"});return}ye.name==="thread"&&Mn.value===h||await $e.replace({name:"thread",params:{threadId:h}})}}),lt(()=>Ne.value,()=>{Hn.value&&fu()}),lt(()=>Hn.value,h=>{if(!h){le.value=[];return}fu()}),lt(()=>[Rt.value,ye.name,P.value],([h,_,M])=>{h&&_==="thread"&&M&&De(M,{silent:!0})}),lt(()=>fs.value,h=>{if(h.length===0){ct.value="";return}h.some(M=>M.value===ct.value)||(ct.value=h[0].value),cn()},{immediate:!0}),lt(()=>ct.value,()=>{Ut.value={phase:"idle",title:"",message:""},cn()}),lt(()=>[Qt.value,ct.value],([h,_])=>{h==="worktree"&&pp(_)},{immediate:!0}),lt(()=>Qt.value,h=>{var _;if(h==="local"){Ut.value={phase:"idle",title:"",message:""};const M=ct.value.trim();if(M&&nl(M)){const de=((_=f.value)==null?void 0:_.projectName)??ni(M),Pe=ji(de,"");Pe&&(ct.value=Pe)}return}pp(ct.value)}),lt(()=>ye.name,h=>{h!=="home"&&(Ut.value={phase:"idle",title:"",message:""}),h!=="thread"&&(en.value=!1)}),lt(()=>P.value,()=>{Ut.value={phase:"idle",title:"",message:""}}),lt(()=>[ye.name,Ee.value],([h,_])=>{if(h!=="thread"){Pr.value=[],Cn.value=null;return}tn(_)},{immediate:!0}),lt(N,h=>{typeof document>"u"||(document.title=h)},{immediate:!0}),lt(x,h=>{h&&!Zt.value&&nr(!0)});async function Cb(h,_=[],M=[],de=[]){try{Ut.value={phase:"idle",title:"",message:""};let Pe=ct.value;if(Qt.value==="worktree"){Ut.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const at=await GR(ct.value,mn.value);Pe=at.cwd,ct.value=at.cwd,Ut.value={phase:"idle",title:"",message:""}}catch{Ut.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Oe=await Ke(h,Pe,_,M,de);if(!Oe)return;await $e.replace({name:"thread",params:{threadId:Oe}}),We()}catch{}}async function pp(h){var M;const _=h.trim();if(!_){ar.value=[],mn.value="";return}Xn.value=!0;try{const de=await KR(_);ar.value=de;const Pe=mn.value.trim();if(!(Pe.length>0&&de.some(at=>at.value===Pe))){const at=de.find(Pn=>Pn.value.trim()==="main");mn.value=(at==null?void 0:at.value)??((M=de[0])==null?void 0:M.value)??""}}catch{ar.value=[],mn.value=""}finally{Xn.value=!1}}return(h,_)=>(A(),yt(q1,{"is-sidebar-collapsed":Zt.value,onCloseSidebar:_[11]||(_[11]=M=>nr(!0))},{sidebar:kt(()=>[y("section",bD,[y("div",wD,[Zt.value?Se("",!0):(A(),yt(Zm,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Zt.value,"show-new-thread-button":!0,onToggleSidebar:_[0]||(_[0]=M=>nr(!Zt.value)),onStartNewThread:rl},{default:kt(()=>[y("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":gr.value,"aria-label":"Search threads",title:"Search threads",onClick:Gc},[ze(eg,{class:"sidebar-search-toggle-icon"})],8,SD)]),_:1},8,["is-sidebar-collapsed"])),!Zt.value&&gr.value?(A(),L("div",TD,[ze(eg,{class:"sidebar-search-bar-icon"}),Br(y("input",{ref_key:"sidebarSearchInputRef",ref:Wt,"onUpdate:modelValue":_[1]||(_[1]=M=>Ht.value=M),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Yc},null,544),[[fo,Ht.value]]),Ht.value.length>0?(A(),L("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Kc},[ze(FL,{class:"sidebar-search-clear-icon"})])):Se("",!0)])):Se("",!0),Zt.value?Se("",!0):(A(),L("button",{key:2,class:pt(["sidebar-skills-link",{"is-active":br.value}]),type:"button",onClick:_[2]||(_[2]=M=>{He($e).push({name:"skills"}),He(x)&&nr(!0)})}," Skills Hub ",2)),Zt.value?Se("",!0):(A(),yt(n$,{key:3,groups:He(c),"project-display-name-by-id":He(d),"selected-thread-id":He(P),"is-loading":He(ue),"search-query":Ht.value,"search-matched-thread-ids":Yr.value,onSelect:Jc,onArchive:su,onStartNewThread:iu,onRenameProject:Fi,onBrowseThreadFiles:au,onRenameThread:Dr,onForkThread:Vs,onRemoveProject:lu,onReorderProject:cu,onExportThread:Xc},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),Zt.value?Se("",!0):(A(),L("div",ED,[ze(Mv,{name:"settings-panel"},{default:kt(()=>[ho.value?(A(),L("div",kD,[y("div",ID,[y("div",AD,[y("div",CD,[y("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!Fn.value,title:Fn.value?"Expand accounts":"Collapse accounts",onClick:kb},[y("span",RD,ge(Fn.value?"▸":"▾"),1)],8,xD),_[12]||(_[12]=y("span",{class:"sidebar-settings-account-title"},"Accounts",-1)),y("span",MD,ge(gn.value.length),1)]),y("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:Vt.value||Mt.value,onClick:Ws},ge(Vt.value?"Reloading…":"Reload"),9,PD)]),Fn.value?Se("",!0):(A(),L(Xe,{key:0},[an.value?(A(),L("p",$D,ge(an.value),1)):Se("",!0),gn.value.length===0?(A(),L("p",ND," Run `codex login`, then click reload. ")):(A(),L("div",OD,[(A(!0),L(Xe,null,Bt(gn.value,M=>(A(),L("article",{key:M.accountId,class:pt(["sidebar-settings-account-item",{"is-active":M.isActive,"is-unavailable":tr(M),"is-confirming-remove":qo(M),"is-remove-visible":Xa(M)}]),title:el(M),onMouseenter:de=>tu(M.accountId),onMouseleave:de=>Qa(M.accountId)},[y("div",DD,[y("p",jD,ge(M.email||"Account"),1),y("p",FD,ge(Ya(M)),1),y("p",BD,ge(Za(M)),1),y("p",qD," Workspace "+ge(Qc(M.accountId)),1)]),y("div",UD,[y("button",{class:"sidebar-settings-account-switch",type:"button",disabled:Ja(M)||M.isActive||tr(M),onClick:de=>tl(M.accountId)},ge(Zc(M)),9,HD),y("button",{class:pt(["sidebar-settings-account-remove",{"is-visible":Xa(M),"is-confirming":qo(M)}]),type:"button",disabled:Ja(M),onClick:de=>ou(M.accountId)},ge(eu(M)),11,WD)])],42,LD))),128))]))],64))]),y("button",{class:"sidebar-settings-row",type:"button",title:i.sendWithEnter,onClick:fb},[_[13]||(_[13]=y("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),y("span",{class:pt(["sidebar-settings-toggle",{"is-on":!Bn.value}])},null,2)],8,VD),y("button",{class:"sidebar-settings-row",type:"button",title:i.inProgressSendMode,onClick:pb},[_[14]||(_[14]=y("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),y("span",GD,ge(cr.value==="steer"?"Steer":"Queue"),1)],8,zD),y("button",{class:"sidebar-settings-row",type:"button",title:i.appearance,onClick:hb},[_[15]||(_[15]=y("span",{class:"sidebar-settings-label"},"Appearance",-1)),y("span",YD,ge(qn.value==="system"?"System":qn.value==="dark"?"Dark":"Light"),1)],8,KD),y("button",{class:"sidebar-settings-row",type:"button",title:i.chatWidth,onClick:mb},[_[16]||(_[16]=y("span",{class:"sidebar-settings-label"},"Chat width",-1)),y("span",XD,ge(Wc.value),1)],8,JD),y("button",{class:"sidebar-settings-row",type:"button",title:i.dictationClickToToggle,onClick:gb},[_[17]||(_[17]=y("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),y("span",{class:pt(["sidebar-settings-toggle",{"is-on":ln.value}])},null,2)],8,QD),y("button",{class:"sidebar-settings-row",type:"button",title:i.dictationAutoSend,onClick:vb},[_[18]||(_[18]=y("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),y("span",{class:pt(["sidebar-settings-toggle",{"is-on":Un.value}])},null,2)],8,ZD),y("button",{class:"sidebar-settings-row",type:"button",title:i.githubTrendingProjects,onClick:yb},[_[19]||(_[19]=y("span",{class:"sidebar-settings-label"},"GitHub trending projects",-1)),y("span",{class:pt(["sidebar-settings-toggle",{"is-on":Hn.value}])},null,2)],8,ej),y("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:i.dictationLanguage},[_[20]||(_[20]=y("span",{class:"sidebar-settings-label"},"Dictation language",-1)),ze(xs,{class:"sidebar-settings-language-dropdown","model-value":ur.value,options:Nr.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":_b},null,8,["model-value","options"])],8,tj),y("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:G},[_[21]||(_[21]=y("span",{class:"sidebar-settings-label"},"Telegram",-1)),y("span",nj,ge(Li.value),1)]),Ft.value?(A(),L("div",{key:0,class:"sidebar-settings-row sidebar-settings-context-row","data-state":Qr.value,title:Dc.value},[_[22]||(_[22]=y("span",{class:"sidebar-settings-label"},"Context",-1)),y("span",{class:"sidebar-settings-context-value","data-state":Qr.value},[$s(ge(ds.value)+" ",1),y("span",sj,ge(Lc.value),1)],8,oj)],8,rj)):Se("",!0),y("div",ij,[ze(fL,{snapshots:He(Ce)},null,8,["snapshots"])]),y("div",aj," WT "+ge(He(o))+" · v"+ge(He(s)),1)])):Se("",!0)]),_:1}),y("button",{class:"sidebar-settings-button",type:"button",onClick:_[3]||(_[3]=M=>ho.value=!ho.value)},[ze(OL,{class:"sidebar-settings-icon"}),_[23]||(_[23]=y("span",null,"Settings",-1)),y("span",lj,ge(He(o))+" · v"+ge(He(s)),1)])]))])]),content:kt(()=>[y("section",{class:"content-root",style:ko(Vc.value)},[ze(l$,{title:S.value},{leading:kt(()=>[Zt.value||He(x)?(A(),yt(Zm,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Zt.value,"show-new-thread-button":!0,onToggleSidebar:_[4]||(_[4]=M=>nr(!Zt.value)),onStartNewThread:rl},null,8,["is-sidebar-collapsed"])):Se("",!0)]),actions:kt(()=>[He(ye).name==="thread"&&He(P)?(A(),yt(xs,{key:0,class:pt(["content-header-branch-dropdown",{"is-review-open":en.value}]),"model-value":jc.value,options:Fc.value,disabled:Dt.value||lr.value,"enable-search":!0,"search-placeholder":"Search branches...","onUpdate:modelValue":zs},null,8,["class","model-value","options","disabled"])):Se("",!0)]),_:1},8,["title"]),y("section",cj,[br.value?(A(),yt(He(r),{key:0,onSkillsChanged:zc})):zt.value?(A(),L("div",uj,[y("div",dj,[_[30]||(_[30]=y("p",{class:"new-thread-hero"},"Let's build",-1)),ze(xs,{class:"new-thread-folder-dropdown","model-value":ct.value,options:fs.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-mode":"event","add-action-label":"+ Add new project",disabled:!1,"onUpdate:modelValue":ft,onAddAction:Gs},null,8,["model-value","options"]),ct.value?(A(),L("p",{key:0,class:"new-thread-folder-selected",title:ct.value}," Selected folder: "+ge(ct.value),9,fj)):Se("",!0),y("div",{class:"new-thread-folder-actions"},[y("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:al}," Select folder ")]),Rn.value?(A(),L("div",pj,[y("div",{class:"new-thread-open-folder-header"},[_[24]||(_[24]=y("p",{class:"new-thread-open-folder-title"},"Select folder",-1)),y("button",{class:"new-thread-open-folder-close",type:"button",onClick:Uo}," Cancel ")]),_[26]||(_[26]=y("p",{class:"new-thread-open-folder-label"},"Current folder",-1)),y("div",hj,[y("p",{class:"new-thread-open-folder-path",title:bn.value||"Unavailable"},ge(bn.value||"Unavailable"),9,mj),y("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!bn.value||!!Nt.value||on.value||Wn.value,onClick:_[5]||(_[5]=M=>mo())},ge(Wn.value?"Opening…":"Open"),9,gj)]),y("div",vj,[y("label",yj,[Br(y("input",{"onUpdate:modelValue":_[6]||(_[6]=M=>qe.value=M),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:ms},null,544),[[QS,qe.value]]),_[25]||(_[25]=y("span",null,"Show hidden folders",-1))]),y("button",{class:pt(["new-thread-folder-action",{"new-thread-folder-action-primary":En.value}]),type:"button","aria-pressed":En.value,disabled:!bn.value||on.value||Wn.value||_n.value||!!Nt.value&&!En.value,onClick:vs}," New folder ",10,_j)]),En.value?(A(),L("div",bj,[y("div",wj,[Br(y("input",{ref_key:"createFolderInputRef",ref:$r,"onUpdate:modelValue":_[7]||(_[7]=M=>Qn.value=M),class:"new-thread-open-folder-create-input",type:"text",placeholder:"Folder name",onKeydown:[Sn(_t(qi,["prevent"]),["enter"]),Sn(_t(Zr,["prevent"]),["esc"])]},null,40,Sj),[[fo,Qn.value]]),y("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!Bc.value||_n.value,onClick:qi},ge(qc.value),9,Tj)]),yn.value?(A(),L("p",Ej,ge(yn.value),1)):Se("",!0)])):Se("",!0),Br(y("input",{"onUpdate:modelValue":_[8]||(_[8]=M=>Te.value=M),class:"new-thread-open-folder-filter",type:"text",placeholder:"Filter folders..."},null,512),[[fo,Te.value]]),Nt.value?(A(),L("div",kj,[y("p",Ij,ge(Nt.value),1),y("button",{class:"new-thread-folder-action",type:"button",disabled:on.value||Wn.value,onClick:gs}," Retry ",8,Aj)])):Se("",!0),on.value?(A(),L("p",Cj,"Loading folders…")):!Nt.value&&Oi.value.length===0?(A(),L("p",xj,ge(Te.value.trim()?"No folders match this filter.":"No subfolders found here."),1)):Oi.value.length>0?(A(),L("ul",Rj,[(A(!0),L(Xe,null,Bt(Oi.value,M=>(A(),L("li",{key:M.key,class:"new-thread-open-folder-item"},[y("button",{class:"new-thread-open-folder-item-main",type:"button",title:M.path,disabled:on.value||Wn.value,onClick:de=>hs(M.path)},[y("span",Pj,ge(M.name),1)],8,Mj),M.kind==="directory"?(A(),L("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:on.value||Wn.value,onClick:de=>mo(M.path)}," Open ",8,$j)):Se("",!0)]))),128))])):Se("",!0)])):Se("",!0),ze(vL,{class:"new-thread-runtime-dropdown",modelValue:Qt.value,"onUpdate:modelValue":_[9]||(_[9]=M=>Qt.value=M)},null,8,["modelValue"]),Qt.value==="worktree"?(A(),L("div",Nj,[_[27]||(_[27]=y("p",{class:"new-thread-branch-select-label"},"Base branch",-1)),ze(xs,{class:"new-thread-branch-dropdown","model-value":mn.value,options:Ni.value,placeholder:"Select branch","enable-search":!0,"search-placeholder":"Search branches...",disabled:Xn.value||Ni.value.length===0,"onUpdate:modelValue":vt},null,8,["model-value","options","disabled"]),y("p",Oj,ge(Xn.value?"Loading branches…":Va.value?`New worktree branch will start from ${Va.value}.`:"No Git branches found for this folder."),1)])):Se("",!0),_[31]||(_[31]=y("p",{class:"new-thread-runtime-help"},[y("code",null,"Local project"),$s(" uses the selected folder directly. "),y("code",null,"New worktree"),$s(" creates an isolated Git worktree before the first prompt. ")],-1)),Ut.value.phase!=="idle"?(A(),L("div",{key:3,class:pt(["worktree-init-status",{"is-running":Ut.value.phase==="running","is-error":Ut.value.phase==="error"}])},[y("strong",Lj,ge(Ut.value.title),1),y("span",Dj,ge(Ut.value.message),1)],2)):Se("",!0),Hn.value?(A(),L("div",jj,[y("div",Fj,[_[28]||(_[28]=y("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),ze(xs,{class:"new-thread-trending-scope-dropdown","model-value":Ne.value,options:Hc.value,"onUpdate:modelValue":U},null,8,["model-value","options"])]),Le.value?(A(),L("p",Bj,"Loading trending projects...")):le.value.length===0?(A(),L("p",qj," Trending repos are unavailable right now. ")):(A(),L("div",Uj,[(A(!0),L(Xe,null,Bt(le.value,M=>(A(),L("button",{key:M.id,type:"button",class:"new-thread-trending-tip",onClick:de=>oe(M)},[y("span",{class:"new-thread-trending-tip-name",title:M.fullName},[M.owner&&M.repo?(A(),L(Xe,{key:0},[y("span",Vj,ge(M.owner),1),_[29]||(_[29]=y("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),y("span",zj,ge(M.repo),1)],64)):(A(),L("span",Gj,ge(M.fullName),1))],8,Wj),y("span",Kj,ge(B(M)),1),y("span",Yj,ge(M.description||"No description available."),1)],8,Hj))),128))]))])):Se("",!0)]),y("div",Jj,[ze(Qm,{ref_key:"homeThreadComposerRef",ref:$,"active-thread-id":R.value,cwd:Ee.value,"collaboration-modes":He(O),"selected-collaboration-mode":He(Y),models:He(W),"selected-model":He(ce),"selected-reasoning-effort":He(re),"selected-speed-mode":He(Z),"is-updating-speed-mode":He(Fe),skills:He(he),"thread-token-usage":He(m),"codex-quota":He(H),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Bn.value,"in-progress-submit-mode":cr.value,"dictation-click-to-toggle":ln.value,"dictation-auto-send":Un.value,"dictation-language":ur.value,onSubmit:F,"onUpdate:selectedCollaborationMode":fp,"onUpdate:selectedModel":cp,"onUpdate:selectedReasoningEffort":up,"onUpdate:selectedSpeedMode":dp},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"])])])):(A(),L("div",Xj,[en.value&&He(P)&&Ee.value?(A(),yt(He(n),{key:0,"thread-id":He(P),cwd:Ee.value,"is-thread-in-progress":it.value,onClose:_[10]||(_[10]=M=>en.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(A(),L(Xe,{key:1},[y("div",Qj,[ze(He(t),{ref_key:"threadConversationRef",ref:X,messages:z.value,"is-loading":He(V),"active-thread-id":R.value,cwd:Ee.value,"scroll-state":He(v),"live-overlay":w.value,"pending-requests":He(T),onUpdateScrollState:ol,onForkThread:du,onRollback:ob,onRespondServerRequest:Bi},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),y("div",Zj,[ze(rL,{messages:He(be),onEdit:je,onSteer:He(ve),onDelete:He(we)},null,8,["messages","onSteer","onDelete"]),K.value?(A(),yt(KO,{key:0,request:K.value,"request-count":He(T).length,"has-queue-above":He(be).length>0,onRespondServerRequest:Bi},null,8,["request","request-count","has-queue-above"])):(A(),yt(Qm,{key:1,ref_key:"threadComposerRef",ref:D,"active-thread-id":R.value,cwd:Ee.value,"collaboration-modes":He(O),"selected-collaboration-mode":He(Y),models:He(W),"selected-model":He(ce),"selected-reasoning-effort":He(re),"selected-speed-mode":He(Z),"is-updating-speed-mode":He(Fe),skills:He(he),"thread-token-usage":He(m),"codex-quota":He(H),"is-turn-in-progress":it.value,"is-interrupting-turn":He(xe),"has-queue-above":He(be).length>0,"send-with-enter":Bn.value,"in-progress-submit-mode":cr.value,"dictation-click-to-toggle":ln.value,"dictation-auto-send":Un.value,"dictation-language":ur.value,"onUpdate:selectedCollaborationMode":fp,onSubmit:F,"onUpdate:selectedModel":cp,"onUpdate:selectedReasoningEffort":up,"onUpdate:selectedSpeedMode":dp,onInterrupt:rb},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"]))])],64))]))])],4)]),_:1},8,["is-sidebar-collapsed"]))}}),n2=Et(t2,[["__scopeId","data-v-82e52728"]]),hd={render:()=>null},Q_=$1({history:d1(),routes:[{path:"/",name:"home",component:hd},{path:"/thread/:threadId",name:"thread",component:hd},{path:"/skills",name:"skills",component:hd},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. npm: https://www.npmjs.com/package/@nervmor/codexui");const Z_=oT(n2);async function r2(){{o2();return}}function o2(e){wx({app:Z_,dsn:"https://9b1c6357d134c512f8171518ec2cb18e@o4511194738982912.ingest.us.sentry.io/4511201728200704",release:"codexui@0.1.81",environment:"production",integrations:[Ex({router:Q_})],tracesSampleRate:.05,sendDefaultPii:!0,beforeSendTransaction(t){const n=t.transaction??"";return n.includes("/health")||n.includes("/favicon")||n.match(/\.(js|css|map|png|svg|ico|woff2?)$/)?null:t}})}r2();Z_.use(Q_).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});export{xR as A,Br as B,s2 as C,a2 as D,c2 as E,Xe as F,u2 as G,i2 as H,Ul as I,l2 as J,lp as K,xl as L,yM as M,eg as N,fo as O,Sn as P,Mv as T,Et as _,y as a,as as b,L as c,An as d,Fs as e,Se as f,Bt as g,pt as h,yt as i,kt as j,Ef as k,ko as l,ze as m,Jt as n,A as o,h$ as p,FL as q,j as r,_t as s,ge as t,rp as u,He as v,lt as w,$s as x,se as y,zu as z};
89
+ //# sourceMappingURL=index-BjPXEYO9.js.map