codexui-android 0.1.89 → 0.1.91

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,92 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-Dr0u8WbA.js","assets/ThreadConversation-BsN7bN3q.css","assets/ReviewPane-gbhCGpfh.js","assets/ReviewPane-CyugWwTM.css","assets/SkillsHub-xXcF9J80.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 Rf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ot={},mi=[],io=()=>{},zg=()=>!1,bc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),wc=e=>e.startsWith("onUpdate:"),fn=Object.assign,Mf=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},iw=Object.prototype.hasOwnProperty,It=(e,t)=>iw.call(e,t),ze=Array.isArray,gi=e=>ja(e)==="[object Map]",Pi=e=>ja(e)==="[object Set]",Fp=e=>ja(e)==="[object Date]",Ze=e=>typeof e=="function",Wt=e=>typeof e=="string",jr=e=>typeof e=="symbol",Ct=e=>e!==null&&typeof e=="object",Gg=e=>(Ct(e)||Ze(e))&&Ze(e.then)&&Ze(e.catch),Kg=Object.prototype.toString,ja=e=>Kg.call(e),aw=e=>ja(e).slice(8,-1),Yg=e=>ja(e)==="[object Object]",Pf=e=>Wt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ua=Rf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Sc=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},lw=/-\w/g,Yn=Sc(e=>e.replace(lw,t=>t.slice(1).toUpperCase())),cw=/\B([A-Z])/g,ls=Sc(e=>e.replace(cw,"-$1").toLowerCase()),Tc=Sc(e=>e.charAt(0).toUpperCase()+e.slice(1)),Nu=Sc(e=>e?`on${Tc(e)}`:""),oo=(e,t)=>!Object.is(e,t),jl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Jg=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ec=e=>{const t=parseFloat(e);return isNaN(t)?e:t},uw=e=>{const t=Wt(e)?Number(e):NaN;return isNaN(t)?e:t};let Bp;const kc=()=>Bp||(Bp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function To(e){if(ze(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=Wt(r)?hw(r):To(r);if(o)for(const s in o)t[s]=o[s]}return t}else if(Wt(e)||Ct(e))return e}const dw=/;(?![^(]*\))/g,fw=/:([^]+)/,pw=/\/\*[^]*?\*\//g;function hw(e){const t={};return e.replace(pw,"").split(dw).forEach(n=>{if(n){const r=n.split(fw);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function pt(e){let t="";if(Wt(e))t=e;else if(ze(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 mw="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",gw=Rf(mw);function Xg(e){return!!e||e===""}function vw(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=$i(e[r],t[r]);return n}function $i(e,t){if(e===t)return!0;let n=Fp(e),r=Fp(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=jr(e),r=jr(t),n||r)return e===t;if(n=ze(e),r=ze(t),n||r)return n&&r?vw(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||!$i(e[i],t[i]))return!1}}return String(e)===String(t)}function $f(e,t){return e.findIndex(n=>$i(n,t))}const Qg=e=>!!(e&&e.__v_isRef===!0),ce=e=>Wt(e)?e:e==null?"":ze(e)||Ct(e)&&(e.toString===Kg||!Ze(e.toString))?Qg(e)?ce(e.value):JSON.stringify(e,Zg,2):String(e),Zg=(e,t)=>Qg(t)?Zg(e,t.value):gi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,o],s)=>(n[Ou(r,s)+" =>"]=o,n),{})}:Pi(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ou(n))}:jr(t)?Ou(t):Ct(t)&&!ze(t)&&!Yg(t)?String(t):t,Ou=(e,t="")=>{var n;return jr(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 rr;class yw{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=rr,!t&&rr&&(this.index=(rr.scopes||(rr.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=rr;try{return rr=this,t()}finally{rr=n}}}on(){++this._on===1&&(this.prevScope=rr,rr=this)}off(){this._on>0&&--this._on===0&&(rr=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 _w(){return rr}let Dt;const Lu=new WeakSet;class ev{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,rr&&rr.active&&rr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Lu.has(this)&&(Lu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||nv(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Up(this),rv(this);const t=Dt,n=Lr;Dt=this,Lr=!0;try{return this.fn()}finally{ov(this),Dt=t,Lr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Lf(t);this.deps=this.depsTail=void 0,Up(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Lu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Nd(this)&&this.run()}get dirty(){return Nd(this)}}let tv=0,da,fa;function nv(e,t=!1){if(e.flags|=8,t){e.next=fa,fa=e;return}e.next=da,da=e}function Nf(){tv++}function Of(){if(--tv>0)return;if(fa){let t=fa;for(fa=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;da;){let t=da;for(da=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 rv(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ov(e){let t,n=e.depsTail,r=n;for(;r;){const o=r.prevDep;r.version===-1?(r===n&&(n=o),Lf(r),bw(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=o}e.deps=t,e.depsTail=n}function Nd(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sv(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sv(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===wa)||(e.globalVersion=wa,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Nd(e))))return;e.flags|=2;const t=e.dep,n=Dt,r=Lr;Dt=e,Lr=!0;try{rv(e);const o=e.fn(e._value);(t.version===0||oo(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{Dt=n,Lr=r,ov(e),e.flags&=-3}}function Lf(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)Lf(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function bw(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Lr=!0;const iv=[];function Ao(){iv.push(Lr),Lr=!1}function xo(){const e=iv.pop();Lr=e===void 0?!0:e}function Up(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Dt;Dt=void 0;try{t()}finally{Dt=n}}}let wa=0;class ww{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 Df{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(!Dt||!Lr||Dt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Dt)n=this.activeLink=new ww(Dt,this),Dt.deps?(n.prevDep=Dt.depsTail,Dt.depsTail.nextDep=n,Dt.depsTail=n):Dt.deps=Dt.depsTail=n,av(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=Dt.depsTail,n.nextDep=void 0,Dt.depsTail.nextDep=n,Dt.depsTail=n,Dt.deps===n&&(Dt.deps=r)}return n}trigger(t){this.version++,wa++,this.notify(t)}notify(t){Nf();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Of()}}}function av(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)av(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Od=new WeakMap,Ls=Symbol(""),Ld=Symbol(""),Sa=Symbol("");function xn(e,t,n){if(Lr&&Dt){let r=Od.get(e);r||Od.set(e,r=new Map);let o=r.get(n);o||(r.set(n,o=new Df),o.map=r,o.key=n),o.track()}}function wo(e,t,n,r,o,s){const i=Od.get(e);if(!i){wa++;return}const a=l=>{l&&l.trigger()};if(Nf(),t==="clear")i.forEach(a);else{const l=ze(e),u=l&&Pf(n);if(l&&n==="length"){const d=Number(r);i.forEach((p,g)=>{(g==="length"||g===Sa||!jr(g)&&g>=d)&&a(p)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Sa)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Ls)),gi(e)&&a(i.get(Ld)));break;case"delete":l||(a(i.get(Ls)),gi(e)&&a(i.get(Ld)));break;case"set":gi(e)&&a(i.get(Ls));break}}Of()}function oi(e){const t=wt(e);return t===e?t:(xn(t,"iterate",Sa),_r(e)?t:t.map(Fr))}function Ic(e){return xn(e=wt(e),"iterate",Sa),e}function no(e,t){return Ro(e)?wi(Ds(e)?Fr(t):t):Fr(t)}const Sw={__proto__:null,[Symbol.iterator](){return Du(this,Symbol.iterator,e=>no(this,e))},concat(...e){return oi(this).concat(...e.map(t=>ze(t)?oi(t):t))},entries(){return Du(this,"entries",e=>(e[1]=no(this,e[1]),e))},every(e,t){return ho(this,"every",e,t,void 0,arguments)},filter(e,t){return ho(this,"filter",e,t,n=>n.map(r=>no(this,r)),arguments)},find(e,t){return ho(this,"find",e,t,n=>no(this,n),arguments)},findIndex(e,t){return ho(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ho(this,"findLast",e,t,n=>no(this,n),arguments)},findLastIndex(e,t){return ho(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ho(this,"forEach",e,t,void 0,arguments)},includes(...e){return ju(this,"includes",e)},indexOf(...e){return ju(this,"indexOf",e)},join(e){return oi(this).join(e)},lastIndexOf(...e){return ju(this,"lastIndexOf",e)},map(e,t){return ho(this,"map",e,t,void 0,arguments)},pop(){return na(this,"pop")},push(...e){return na(this,"push",e)},reduce(e,...t){return qp(this,"reduce",e,t)},reduceRight(e,...t){return qp(this,"reduceRight",e,t)},shift(){return na(this,"shift")},some(e,t){return ho(this,"some",e,t,void 0,arguments)},splice(...e){return na(this,"splice",e)},toReversed(){return oi(this).toReversed()},toSorted(e){return oi(this).toSorted(e)},toSpliced(...e){return oi(this).toSpliced(...e)},unshift(...e){return na(this,"unshift",e)},values(){return Du(this,"values",e=>no(this,e))}};function Du(e,t,n){const r=Ic(e),o=r[t]();return r!==e&&!_r(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const Tw=Array.prototype;function ho(e,t,n,r,o,s){const i=Ic(e),a=i!==e&&!_r(e),l=i[t];if(l!==Tw[t]){const p=l.apply(e,s);return a?Fr(p):p}let u=n;i!==e&&(a?u=function(p,g){return n.call(this,no(e,p),g,e)}:n.length>2&&(u=function(p,g){return n.call(this,p,g,e)}));const d=l.call(i,u,r);return a&&o?o(d):d}function qp(e,t,n,r){const o=Ic(e),s=o!==e&&!_r(e);let i=n,a=!1;o!==e&&(s?(a=r.length===0,i=function(u,d,p){return a&&(a=!1,u=no(e,u)),n.call(this,u,no(e,d),p,e)}):n.length>3&&(i=function(u,d,p){return n.call(this,u,d,p,e)}));const l=o[t](i,...r);return a?no(e,l):l}function ju(e,t,n){const r=wt(e);xn(r,"iterate",Sa);const o=r[t](...n);return(o===-1||o===!1)&&Bf(n[0])?(n[0]=wt(n[0]),r[t](...n)):o}function na(e,t,n=[]){Ao(),Nf();const r=wt(e)[t].apply(e,n);return Of(),xo(),r}const Ew=Rf("__proto__,__v_isRef,__isVue"),lv=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(jr));function kw(e){jr(e)||(e=String(e));const t=wt(this);return xn(t,"has",e),t.hasOwnProperty(e)}class cv{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:pv:s?fv:dv).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=ze(t);if(!o){let l;if(i&&(l=Sw[n]))return l;if(n==="hasOwnProperty")return kw}const a=Reflect.get(t,n,$n(t)?t:r);if((jr(n)?lv.has(n):Ew(n))||(o||xn(t,"get",n),s))return a;if($n(a)){const l=i&&Pf(n)?a:a.value;return o&&Ct(l)?jd(l):l}return Ct(a)?o?jd(a):Cc(a):a}}class uv extends cv{constructor(t=!1){super(!1,t)}set(t,n,r,o){let s=t[n];const i=ze(t)&&Pf(n);if(!this._isShallow){const u=Ro(s);if(!_r(r)&&!Ro(r)&&(s=wt(s),r=wt(r)),!i&&$n(s)&&!$n(r))return u||(s.value=r),!0}const a=i?Number(n)<t.length:It(t,n),l=Reflect.set(t,n,r,$n(t)?t:o);return t===wt(o)&&(a?oo(r,s)&&wo(t,"set",n,r):wo(t,"add",n,r)),l}deleteProperty(t,n){const r=It(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&r&&wo(t,"delete",n,void 0),o}has(t,n){const r=Reflect.has(t,n);return(!jr(n)||!lv.has(n))&&xn(t,"has",n),r}ownKeys(t){return xn(t,"iterate",ze(t)?"length":Ls),Reflect.ownKeys(t)}}class Iw extends cv{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Cw=new uv,Aw=new Iw,xw=new uv(!0);const Dd=e=>e,Sl=e=>Reflect.getPrototypeOf(e);function Rw(e,t,n){return function(...r){const o=this.__v_raw,s=wt(o),i=gi(s),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=o[e](...r),d=n?Dd:t?wi:Fr;return!t&&xn(s,"iterate",l?Ld:Ls),fn(Object.create(u),{next(){const{value:p,done:g}=u.next();return g?{value:p,done:g}:{value:a?[d(p[0]),d(p[1])]:d(p),done:g}}})}}function Tl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Mw(e,t){const n={get(o){const s=this.__v_raw,i=wt(s),a=wt(o);e||(oo(o,a)&&xn(i,"get",o),xn(i,"get",a));const{has:l}=Sl(i),u=t?Dd:e?wi:Fr;if(l.call(i,o))return u(s.get(o));if(l.call(i,a))return u(s.get(a));s!==i&&s.get(o)},get size(){const o=this.__v_raw;return!e&&xn(wt(o),"iterate",Ls),o.size},has(o){const s=this.__v_raw,i=wt(s),a=wt(o);return e||(oo(o,a)&&xn(i,"has",o),xn(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=wt(a),u=t?Dd:e?wi:Fr;return!e&&xn(l,"iterate",Ls),a.forEach((d,p)=>o.call(s,u(d),u(p),i))}};return fn(n,e?{add:Tl("add"),set:Tl("set"),delete:Tl("delete"),clear:Tl("clear")}:{add(o){const s=wt(this),i=Sl(s),a=wt(o),l=!t&&!_r(o)&&!Ro(o)?a:o;return i.has.call(s,l)||oo(o,l)&&i.has.call(s,o)||oo(a,l)&&i.has.call(s,a)||(s.add(l),wo(s,"add",l,l)),this},set(o,s){!t&&!_r(s)&&!Ro(s)&&(s=wt(s));const i=wt(this),{has:a,get:l}=Sl(i);let u=a.call(i,o);u||(o=wt(o),u=a.call(i,o));const d=l.call(i,o);return i.set(o,s),u?oo(s,d)&&wo(i,"set",o,s):wo(i,"add",o,s),this},delete(o){const s=wt(this),{has:i,get:a}=Sl(s);let l=i.call(s,o);l||(o=wt(o),l=i.call(s,o)),a&&a.call(s,o);const u=s.delete(o);return l&&wo(s,"delete",o,void 0),u},clear(){const o=wt(this),s=o.size!==0,i=o.clear();return s&&wo(o,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Rw(o,e,t)}),n}function jf(e,t){const n=Mw(e,t);return(r,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?r:Reflect.get(It(n,o)&&o in r?n:r,o,s)}const Pw={get:jf(!1,!1)},$w={get:jf(!1,!0)},Nw={get:jf(!0,!1)};const dv=new WeakMap,fv=new WeakMap,pv=new WeakMap,Ow=new WeakMap;function Lw(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dw(e){return e.__v_skip||!Object.isExtensible(e)?0:Lw(aw(e))}function Cc(e){return Ro(e)?e:Ff(e,!1,Cw,Pw,dv)}function hv(e){return Ff(e,!1,xw,$w,fv)}function jd(e){return Ff(e,!0,Aw,Nw,pv)}function Ff(e,t,n,r,o){if(!Ct(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=Dw(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 Ds(e){return Ro(e)?Ds(e.__v_raw):!!(e&&e.__v_isReactive)}function Ro(e){return!!(e&&e.__v_isReadonly)}function _r(e){return!!(e&&e.__v_isShallow)}function Bf(e){return e?!!e.__v_raw:!1}function wt(e){const t=e&&e.__v_raw;return t?wt(t):e}function jw(e){return!It(e,"__v_skip")&&Object.isExtensible(e)&&Jg(e,"__v_skip",!0),e}const Fr=e=>Ct(e)?Cc(e):e,wi=e=>Ct(e)?jd(e):e;function $n(e){return e?e.__v_isRef===!0:!1}function O(e){return mv(e,!1)}function Fw(e){return mv(e,!0)}function mv(e,t){return $n(e)?e:new Bw(e,t)}class Bw{constructor(t,n){this.dep=new Df,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:wt(t),this._value=n?t:Fr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||_r(t)||Ro(t);t=r?t:wt(t),oo(t,n)&&(this._rawValue=t,this._value=r?t:Fr(t),this.dep.trigger())}}function je(e){return $n(e)?e.value:e}const Uw={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return $n(o)&&!$n(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function gv(e){return Ds(e)?e:new Proxy(e,Uw)}class qw{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Df(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=wa-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Dt!==this)return nv(this,!0),!0}get value(){const t=this.dep.track();return sv(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Hw(e,t,n=!1){let r,o;return Ze(e)?r=e:(r=e.get,o=e.set),new qw(r,o,n)}const El={},Zl=new WeakMap;let As;function Ww(e,t=!1,n=As){if(n){let r=Zl.get(n);r||Zl.set(n,r=[]),r.push(e)}}function Vw(e,t,n=Ot){const{immediate:r,deep:o,once:s,scheduler:i,augmentJob:a,call:l}=n,u=z=>o?z:_r(z)||o===!1||o===0?So(z,1):So(z);let d,p,g,_,I=!1,R=!1;if($n(e)?(p=()=>e.value,I=_r(e)):Ds(e)?(p=()=>u(e),I=!0):ze(e)?(R=!0,I=e.some(z=>Ds(z)||_r(z)),p=()=>e.map(z=>{if($n(z))return z.value;if(Ds(z))return u(z);if(Ze(z))return l?l(z,2):z()})):Ze(e)?t?p=l?()=>l(e,2):e:p=()=>{if(g){Ao();try{g()}finally{xo()}}const z=As;As=d;try{return l?l(e,3,[_]):e(_)}finally{As=z}}:p=io,t&&o){const z=p,ue=o===!0?1/0:o;p=()=>So(z(),ue)}const W=_w(),M=()=>{d.stop(),W&&W.active&&Mf(W.effects,d)};if(s&&t){const z=t;t=(...ue)=>{z(...ue),M()}}let $=R?new Array(e.length).fill(El):El;const q=z=>{if(!(!(d.flags&1)||!d.dirty&&!z))if(t){const ue=d.run();if(o||I||(R?ue.some((ne,J)=>oo(ne,$[J])):oo(ue,$))){g&&g();const ne=As;As=d;try{const J=[ue,$===El?void 0:R&&$[0]===El?[]:$,_];$=ue,l?l(t,3,J):t(...J)}finally{As=ne}}}else d.run()};return a&&a(q),d=new ev(p),d.scheduler=i?()=>i(q,!1):q,_=z=>Ww(z,!1,d),g=d.onStop=()=>{const z=Zl.get(d);if(z){if(l)l(z,4);else for(const ue of z)ue();Zl.delete(d)}},t?r?q(!0):$=d.run():i?i(q.bind(null,!0),!0):d.run(),M.pause=d.pause.bind(d),M.resume=d.resume.bind(d),M.stop=M,M}function So(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--,$n(e))So(e.value,t,n);else if(ze(e))for(let r=0;r<e.length;r++)So(e[r],t,n);else if(Pi(e)||gi(e))e.forEach(r=>{So(r,t,n)});else if(Yg(e)){for(const r in e)So(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&So(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 Fa(e,t,n,r){try{return r?e(...r):e()}catch(o){Ba(o,t,n)}}function Br(e,t,n,r){if(Ze(e)){const o=Fa(e,t,n,r);return o&&Gg(o)&&o.catch(s=>{Ba(s,t,n)}),o}if(ze(e)){const o=[];for(let s=0;s<e.length;s++)o.push(Br(e[s],t,n,r));return o}}function Ba(e,t,n,r=!0){const o=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ot;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const d=a.ec;if(d){for(let p=0;p<d.length;p++)if(d[p](e,l,u)===!1)return}a=a.parent}if(s){Ao(),Fa(s,null,10,[e,l,u]),xo();return}}zw(e,n,o,r,i)}function zw(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}const Kn=[];let eo=-1;const vi=[];let Jo=null,ci=0;const vv=Promise.resolve();let ec=null;function Yt(e){const t=ec||vv;return e?t.then(this?e.bind(this):e):t}function Gw(e){let t=eo+1,n=Kn.length;for(;t<n;){const r=t+n>>>1,o=Kn[r],s=Ta(o);s<e||s===e&&o.flags&2?t=r+1:n=r}return t}function Uf(e){if(!(e.flags&1)){const t=Ta(e),n=Kn[Kn.length-1];!n||!(e.flags&2)&&t>=Ta(n)?Kn.push(e):Kn.splice(Gw(t),0,e),e.flags|=1,yv()}}function yv(){ec||(ec=vv.then(bv))}function Kw(e){ze(e)?vi.push(...e):Jo&&e.id===-1?Jo.splice(ci+1,0,e):e.flags&1||(vi.push(e),e.flags|=1),yv()}function Hp(e,t,n=eo+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 _v(e){if(vi.length){const t=[...new Set(vi)].sort((n,r)=>Ta(n)-Ta(r));if(vi.length=0,Jo){Jo.push(...t);return}for(Jo=t,ci=0;ci<Jo.length;ci++){const n=Jo[ci];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Jo=null,ci=0}}const Ta=e=>e.id==null?e.flags&2?-1:1/0:e.id;function bv(e){try{for(eo=0;eo<Kn.length;eo++){const t=Kn[eo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Fa(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;eo<Kn.length;eo++){const t=Kn[eo];t&&(t.flags&=-2)}eo=-1,Kn.length=0,_v(),ec=null,(Kn.length||vi.length)&&bv()}}let Sn=null,wv=null;function tc(e){const t=Sn;return Sn=e,wv=e&&e.type.__scopeId||null,t}function Et(e,t=Sn,n){if(!t||e._n)return e;const r=(...o)=>{r._d&&oc(-1);const s=tc(t);let i;try{i=e(...o)}finally{tc(s),r._d&&oc(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Gn(e,t){if(Sn===null)return e;const n=Pc(Sn),r=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[s,i,a,l=Ot]=t[o];s&&(Ze(s)&&(s={mounted:s,updated:s}),s.deep&&So(i),r.push({dir:s,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ss(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&&(Ao(),Br(l,n,8,[e.el,a,e,t]),xo())}}function Fl(e,t){if(wn){let n=wn.provides;const r=wn.parent&&wn.parent.provides;r===n&&(n=wn.provides=Object.create(r)),n[e]=t}}function Dr(e,t,n=!1){const r=Kf();if(r||_i){let o=_i?_i._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&&Ze(t)?t.call(r&&r.proxy):t}}const Yw=Symbol.for("v-scx"),Jw=()=>Dr(Yw);function it(e,t,n){return Sv(e,t,n)}function Sv(e,t,n=Ot){const{immediate:r,deep:o,flush:s,once:i}=n,a=fn({},n),l=t&&r||!t&&s!=="post";let u;if(Si){if(s==="sync"){const _=Jw();u=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=io,_.resume=io,_.pause=io,_}}const d=wn;a.call=(_,I,R)=>Br(_,d,I,R);let p=!1;s==="post"?a.scheduler=_=>{Vn(_,d&&d.suspense)}:s!=="sync"&&(p=!0,a.scheduler=(_,I)=>{I?_():Uf(_)}),a.augmentJob=_=>{t&&(_.flags|=4),p&&(_.flags|=2,d&&(_.id=d.uid,_.i=d))};const g=Vw(e,t,a);return Si&&(u?u.push(g):l&&g()),g}function Xw(e,t,n){const r=this.proxy,o=Wt(e)?e.includes(".")?Tv(r,e):()=>r[e]:e.bind(r,r);let s;Ze(t)?s=t:(s=t.handler,n=t);const i=qa(this),a=Sv(o,s.bind(r),n);return i(),a}function Tv(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 Ts=new WeakMap,Ev=Symbol("_vte"),kv=e=>e.__isTeleport,Ms=e=>e&&(e.disabled||e.disabled===""),Qw=e=>e&&(e.defer||e.defer===""),Wp=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Vp=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Fd=(e,t)=>{const n=e&&e.to;return Wt(n)?t?t(n):null:n},Zw={name:"Teleport",__isTeleport:!0,process(e,t,n,r,o,s,i,a,l,u){const{mc:d,pc:p,pbc:g,o:{insert:_,querySelector:I,createText:R,createComment:W}}=u,M=Ms(t.props);let{dynamicChildren:$}=t;const q=(ne,J,he)=>{ne.shapeFlag&16&&d(ne.children,J,he,o,s,i,a,l)},z=(ne=t)=>{const J=Ms(ne.props),he=ne.target=Fd(ne.props,I),xe=Bd(he,ne,R,_);he&&(i!=="svg"&&Wp(he)?i="svg":i!=="mathml"&&Vp(he)&&(i="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(he),J||(q(ne,he,xe),la(ne,!1)))},ue=ne=>{const J=()=>{Ts.get(ne)===J&&(Ts.delete(ne),Ms(ne.props)&&(q(ne,n,ne.anchor),la(ne,!0)),z(ne))};Ts.set(ne,J),Vn(J,s)};if(e==null){const ne=t.el=R(""),J=t.anchor=R("");if(_(ne,n,r),_(J,n,r),Qw(t.props)||s&&s.pendingBranch){ue(t);return}M&&(q(t,n,J),la(t,!0)),z()}else{t.el=e.el;const ne=t.anchor=e.anchor,J=Ts.get(e);if(J){J.flags|=8,Ts.delete(e),ue(t);return}t.targetStart=e.targetStart;const he=t.target=e.target,xe=t.targetAnchor=e.targetAnchor,Ce=Ms(e.props),Pe=Ce?n:he,Y=Ce?ne:xe;if(i==="svg"||Wp(he)?i="svg":(i==="mathml"||Vp(he))&&(i="mathml"),$?(g(e.dynamicChildren,$,Pe,o,s,i,a),zf(e,t,!0)):l||p(e,t,Pe,Y,o,s,i,a,!1),M)Ce?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kl(t,n,ne,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const de=t.target=Fd(t.props,I);de&&kl(t,de,null,u,0)}else Ce&&kl(t,he,xe,u,1);la(t,M)}},remove(e,t,n,{um:r,o:{remove:o}},s){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:d,target:p,props:g}=e;let _=s||!Ms(g);const I=Ts.get(e);if(I&&(I.flags|=8,Ts.delete(e),_=!1),p&&(o(u),o(d)),s&&o(l),i&16)for(let R=0;R<a.length;R++){const W=a[R];r(W,t,n,_,!!W.dynamicChildren)}},move:kl,hydrate:eS};function kl(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:u,props:d}=e,p=s===2;if(p&&r(i,t,n),(!p||Ms(d))&&l&16)for(let g=0;g<u.length;g++)o(u[g],t,n,2);p&&r(a,t,n)}function eS(e,t,n,r,o,s,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:d}},p){function g(W,M){let $=M;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,W._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function _(W,M){M.anchor=p(i(W),M,a(W),n,r,o,s)}const I=t.target=Fd(t.props,l),R=Ms(t.props);if(I){const W=I._lpa||I.firstChild;t.shapeFlag&16&&(R?(_(e,t),g(I,W),t.targetAnchor||Bd(I,t,d,u,a(e)===I?e:null)):(t.anchor=i(e),g(I,W),t.targetAnchor||Bd(I,t,d,u),p(W&&i(W),t,I,n,r,o,s))),la(t,R)}else R&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const pa=Zw;function la(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 Bd(e,t,n,r,o=null){const s=t.targetStart=n(""),i=t.targetAnchor=n("");return s[Ev]=i,e&&(r(s,e,o),r(i,e,o)),i}const to=Symbol("_leaveCb"),ra=Symbol("_enterCb");function tS(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return cs(()=>{e.isMounted=!0}),Ws(()=>{e.isUnmounting=!0}),e}const gr=[Function,Array],Iv={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:gr,onEnter:gr,onAfterEnter:gr,onEnterCancelled:gr,onBeforeLeave:gr,onLeave:gr,onAfterLeave:gr,onLeaveCancelled:gr,onBeforeAppear:gr,onAppear:gr,onAfterAppear:gr,onAppearCancelled:gr},Cv=e=>{const t=e.subTree;return t.component?Cv(t.component):t},nS={name:"BaseTransition",props:Iv,setup(e,{slots:t}){const n=Kf(),r=tS();return()=>{const o=t.default&&Rv(t.default(),!0);if(!o||!o.length)return;const s=Av(o),i=wt(e),{mode:a}=i;if(r.isLeaving)return Fu(s);const l=zp(s);if(!l)return Fu(s);let u=Ud(l,i,r,n,p=>u=p);l.type!==Mn&&Ea(l,u);let d=n.subTree&&zp(n.subTree);if(d&&d.type!==Mn&&!Ps(d,l)&&Cv(n).type!==Mn){let p=Ud(d,i,r,n);if(Ea(d,p),a==="out-in"&&l.type!==Mn)return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,d=void 0},Fu(s);a==="in-out"&&l.type!==Mn?p.delayLeave=(g,_,I)=>{const R=xv(r,d);R[String(d.key)]=d,g[to]=()=>{_(),g[to]=void 0,delete u.delayedLeave,d=void 0},u.delayedLeave=()=>{I(),delete u.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return s}}};function Av(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Mn){t=n;break}}return t}const rS=nS;function xv(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 Ud(e,t,n,r,o){const{appear:s,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:d,onEnterCancelled:p,onBeforeLeave:g,onLeave:_,onAfterLeave:I,onLeaveCancelled:R,onBeforeAppear:W,onAppear:M,onAfterAppear:$,onAppearCancelled:q}=t,z=String(e.key),ue=xv(n,e),ne=(xe,Ce)=>{xe&&Br(xe,r,9,Ce)},J=(xe,Ce)=>{const Pe=Ce[1];ne(xe,Ce),ze(xe)?xe.every(Y=>Y.length<=1)&&Pe():xe.length<=1&&Pe()},he={mode:i,persisted:a,beforeEnter(xe){let Ce=l;if(!n.isMounted)if(s)Ce=W||l;else return;xe[to]&&xe[to](!0);const Pe=ue[z];Pe&&Ps(e,Pe)&&Pe.el[to]&&Pe.el[to](),ne(Ce,[xe])},enter(xe){if(ue[z]===e)return;let Ce=u,Pe=d,Y=p;if(!n.isMounted)if(s)Ce=M||u,Pe=$||d,Y=q||p;else return;let de=!1;xe[ra]=De=>{de||(de=!0,De?ne(Y,[xe]):ne(Pe,[xe]),he.delayedLeave&&he.delayedLeave(),xe[ra]=void 0)};const Ae=xe[ra].bind(null,!1);Ce?J(Ce,[xe,Ae]):Ae()},leave(xe,Ce){const Pe=String(e.key);if(xe[ra]&&xe[ra](!0),n.isUnmounting)return Ce();ne(g,[xe]);let Y=!1;xe[to]=Ae=>{Y||(Y=!0,Ce(),Ae?ne(R,[xe]):ne(I,[xe]),xe[to]=void 0,ue[Pe]===e&&delete ue[Pe])};const de=xe[to].bind(null,!1);ue[Pe]=e,_?J(_,[xe,de]):de()},clone(xe){const Ce=Ud(xe,t,n,r,o);return o&&o(Ce),Ce}};return he}function Fu(e){if(Ua(e))return e=os(e),e.children=null,e}function zp(e){if(!Ua(e))return kv(e.type)&&e.children?Av(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&&Ze(n.default))return n.default()}}function Ea(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ea(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===Ke?(i.patchFlag&128&&o++,r=r.concat(Rv(i.children,t,a))):(t||i.type!==Mn)&&r.push(a!=null?os(i,{key:a}):i)}if(o>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Tn(e,t){return Ze(e)?fn({name:e.name},t,{setup:e}):e}function qf(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Gp(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const nc=new WeakMap;function ha(e,t,n,r,o=!1){if(ze(e)){e.forEach((R,W)=>ha(R,t&&(ze(t)?t[W]:t),n,r,o));return}if(yi(r)&&!o){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ha(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Pc(r.component):r.el,i=o?null:s,{i:a,r:l}=e,u=t&&t.r,d=a.refs===Ot?a.refs={}:a.refs,p=a.setupState,g=wt(p),_=p===Ot?zg:R=>Gp(d,R)?!1:It(g,R),I=(R,W)=>!(W&&Gp(d,W));if(u!=null&&u!==l){if(Kp(t),Wt(u))d[u]=null,_(u)&&(p[u]=null);else if($n(u)){const R=t;I(u,R.k)&&(u.value=null),R.k&&(d[R.k]=null)}}if(Ze(l))Fa(l,a,12,[i,d]);else{const R=Wt(l),W=$n(l);if(R||W){const M=()=>{if(e.f){const $=R?_(l)?p[l]:d[l]:I()||!e.k?l.value:d[e.k];if(o)ze($)&&Mf($,s);else if(ze($))$.includes(s)||$.push(s);else if(R)d[l]=[s],_(l)&&(p[l]=d[l]);else{const q=[s];I(l,e.k)&&(l.value=q),e.k&&(d[e.k]=q)}}else R?(d[l]=i,_(l)&&(p[l]=i)):W&&(I(l,e.k)&&(l.value=i),e.k&&(d[e.k]=i))};if(i){const $=()=>{M(),nc.delete(e)};$.id=-1,nc.set(e,$),Vn($,n)}else Kp(e),M()}}}function Kp(e){const t=nc.get(e);t&&(t.flags|=8,nc.delete(e))}const Yp=e=>e.nodeType===8;kc().requestIdleCallback;kc().cancelIdleCallback;function oS(e,t){if(Yp(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Yp(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const yi=e=>!!e.type.__asyncLoader;function Bu(e){Ze(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 u=null,d,p=0;const g=()=>(p++,u=null,_()),_=()=>{let I;return u||(I=u=t().catch(R=>{if(R=R instanceof Error?R:new Error(String(R)),l)return new Promise((W,M)=>{l(R,()=>W(g()),()=>M(R),p+1)});throw R}).then(R=>I!==u&&u?u:(R&&(R.__esModule||R[Symbol.toStringTag]==="Module")&&(R=R.default),d=R,R)))};return Tn({name:"AsyncComponentWrapper",__asyncLoader:_,__asyncHydrate(I,R,W){let M=!1;(R.bu||(R.bu=[])).push(()=>M=!0);const $=()=>{M||W()},q=s?()=>{const z=s($,ue=>oS(I,ue));z&&(R.bum||(R.bum=[])).push(z)}:$;d?q():_().then(()=>!R.isUnmounted&&q())},get __asyncResolved(){return d},setup(){const I=wn;if(qf(I),d)return()=>Il(d,I);const R=q=>{u=null,Ba(q,I,13,!r)};if(a&&I.suspense||Si)return _().then(q=>()=>Il(q,I)).catch(q=>(R(q),()=>r?Ue(r,{error:q}):null));const W=O(!1),M=O(),$=O(!!o);return o&&setTimeout(()=>{$.value=!1},o),i!=null&&setTimeout(()=>{if(!W.value&&!M.value){const q=new Error(`Async component timed out after ${i}ms.`);R(q),M.value=q}},i),_().then(()=>{W.value=!0,I.parent&&Ua(I.parent.vnode)&&I.parent.update()}).catch(q=>{R(q),M.value=q}),()=>{if(W.value&&d)return Il(d,I);if(M.value&&r)return Ue(r,{error:M.value});if(n&&!$.value)return Il(n,I)}}})}function Il(e,t){const{ref:n,props:r,children:o,ce:s}=t.vnode,i=Ue(e,r,o);return i.ref=n,i.ce=s,delete t.vnode.ce,i}const Ua=e=>e.type.__isKeepAlive;function sS(e,t){Mv(e,"a",t)}function iS(e,t){Mv(e,"da",t)}function Mv(e,t,n=wn){const r=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Ac(t,r,n),n){let o=n.parent;for(;o&&o.parent;)Ua(o.parent.vnode)&&aS(r,t,n,o),o=o.parent}}function aS(e,t,n,r){const o=Ac(t,e,r,!0);xc(()=>{Mf(r[t],o)},n)}function Ac(e,t,n=wn,r=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...i)=>{Ao();const a=qa(n),l=Br(t,n,e,i);return a(),xo(),l});return r?o.unshift(s):o.push(s),s}}const Lo=e=>(t,n=wn)=>{(!Si||e==="sp")&&Ac(e,(...r)=>t(...r),n)},lS=Lo("bm"),cs=Lo("m"),cS=Lo("bu"),uS=Lo("u"),Ws=Lo("bum"),xc=Lo("um"),dS=Lo("sp"),fS=Lo("rtg"),pS=Lo("rtc");function hS(e,t=wn){Ac("ec",e,t)}const mS="components",Pv=Symbol.for("v-ndc");function Hf(e){return Wt(e)?gS(mS,e,!1)||e:e||Pv}function gS(e,t,n=!0,r=!1){const o=Sn||wn;if(o){const s=o.type;{const a=eT(s,!1);if(a&&(a===t||a===Yn(t)||a===Tc(Yn(t))))return s}const i=Jp(o[e]||s[e],t)||Jp(o.appContext[e],t);return!i&&r?s:i}}function Jp(e,t){return e&&(e[t]||e[Yn(t)]||e[Tc(Yn(t))])}function jt(e,t,n,r){let o;const s=n,i=ze(e);if(i||Wt(e)){const a=i&&Ds(e);let l=!1,u=!1;a&&(l=!_r(e),u=Ro(e),e=Ic(e)),o=new Array(e.length);for(let d=0,p=e.length;d<p;d++)o[d]=t(l?u?wi(Fr(e[d])):Fr(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,u=a.length;l<u;l++){const d=a[l];o[l]=t(e[d],d,l,s)}}else o=[];return o}function so(e,t,n={},r,o){if(Sn.ce||Sn.parent&&yi(Sn.parent)&&Sn.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),x(),ht(Ke,null,[Ue("slot",n,r)],u?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),x();const i=s&&$v(s(n)),a=n.key||i&&i.key,l=ht(Ke,{key:(a&&!jr(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function $v(e){return e.some(t=>Ia(t)?!(t.type===Mn||t.type===Ke&&!$v(t.children)):!0)?e:null}const qd=e=>e?Zv(e)?Pc(e):qd(e.parent):null,ma=fn(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=>qd(e.parent),$root:e=>qd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ov(e),$forceUpdate:e=>e.f||(e.f=()=>{Uf(e.update)}),$nextTick:e=>e.n||(e.n=Yt.bind(e.proxy)),$watch:e=>Xw.bind(e)}),Uu=(e,t)=>e!==Ot&&!e.__isScriptSetup&&It(e,t),vS={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 g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(Uu(r,t))return i[t]=1,r[t];if(o!==Ot&&It(o,t))return i[t]=2,o[t];if(It(s,t))return i[t]=3,s[t];if(n!==Ot&&It(n,t))return i[t]=4,n[t];Hd&&(i[t]=0)}}const u=ma[t];let d,p;if(u)return t==="$attrs"&&xn(e.attrs,"get",""),u(e);if((d=a.__cssModules)&&(d=d[t]))return d;if(n!==Ot&&It(n,t))return i[t]=4,n[t];if(p=l.config.globalProperties,It(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:o,ctx:s}=e;return Uu(o,t)?(o[t]=n,!0):r!==Ot&&It(r,t)?(r[t]=n,!0):It(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!==Ot&&a[0]!=="$"&&It(e,a)||Uu(t,a)||It(s,a)||It(r,a)||It(ma,a)||It(o.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:It(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function yS(){return _S().slots}function _S(e){const t=Kf();return t.setupContext||(t.setupContext=ty(t))}function Xp(e){return ze(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Hd=!0;function bS(e){const t=Ov(e),n=e.proxy,r=e.ctx;Hd=!1,t.beforeCreate&&Qp(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:i,watch:a,provide:l,inject:u,created:d,beforeMount:p,mounted:g,beforeUpdate:_,updated:I,activated:R,deactivated:W,beforeDestroy:M,beforeUnmount:$,destroyed:q,unmounted:z,render:ue,renderTracked:ne,renderTriggered:J,errorCaptured:he,serverPrefetch:xe,expose:Ce,inheritAttrs:Pe,components:Y,directives:de,filters:Ae}=t;if(u&&wS(u,r,null),i)for(const Se in i){const ae=i[Se];Ze(ae)&&(r[Se]=ae.bind(n))}if(o){const Se=o.call(n,n);Ct(Se)&&(e.data=Cc(Se))}if(Hd=!0,s)for(const Se in s){const ae=s[Se],ke=Ze(ae)?ae.bind(n,n):Ze(ae.get)?ae.get.bind(n,n):io,Ne=!Ze(ae)&&Ze(ae.set)?ae.set.bind(n):io,Me=oe({get:ke,set:Ne});Object.defineProperty(r,Se,{enumerable:!0,configurable:!0,get:()=>Me.value,set:qe=>Me.value=qe})}if(a)for(const Se in a)Nv(a[Se],r,n,Se);if(l){const Se=Ze(l)?l.call(n):l;Reflect.ownKeys(Se).forEach(ae=>{Fl(ae,Se[ae])})}d&&Qp(d,e,"c");function ve(Se,ae){ze(ae)?ae.forEach(ke=>Se(ke.bind(n))):ae&&Se(ae.bind(n))}if(ve(lS,p),ve(cs,g),ve(cS,_),ve(uS,I),ve(sS,R),ve(iS,W),ve(hS,he),ve(pS,ne),ve(fS,J),ve(Ws,$),ve(xc,z),ve(dS,xe),ze(Ce))if(Ce.length){const Se=e.exposed||(e.exposed={});Ce.forEach(ae=>{Object.defineProperty(Se,ae,{get:()=>n[ae],set:ke=>n[ae]=ke,enumerable:!0})})}else e.exposed||(e.exposed={});ue&&e.render===io&&(e.render=ue),Pe!=null&&(e.inheritAttrs=Pe),Y&&(e.components=Y),de&&(e.directives=de),xe&&qf(e)}function wS(e,t,n=io){ze(e)&&(e=Wd(e));for(const r in e){const o=e[r];let s;Ct(o)?"default"in o?s=Dr(o.from||r,o.default,!0):s=Dr(o.from||r):s=Dr(o),$n(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:i=>s.value=i}):t[r]=s}}function Qp(e,t,n){Br(ze(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Nv(e,t,n,r){let o=r.includes(".")?Tv(n,r):()=>n[r];if(Wt(e)){const s=t[e];Ze(s)&&it(o,s)}else if(Ze(e))it(o,e.bind(n));else if(Ct(e))if(ze(e))e.forEach(s=>Nv(s,t,n,r));else{const s=Ze(e.handler)?e.handler.bind(n):t[e.handler];Ze(s)&&it(o,s,e)}}function Ov(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(u=>rc(l,u,i,!0)),rc(l,t,i)),Ct(t)&&s.set(t,l),l}function rc(e,t,n,r=!1){const{mixins:o,extends:s}=t;s&&rc(e,s,n,!0),o&&o.forEach(i=>rc(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=SS[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const SS={data:Zp,props:eh,emits:eh,methods:ca,computed:ca,beforeCreate:Wn,created:Wn,beforeMount:Wn,mounted:Wn,beforeUpdate:Wn,updated:Wn,beforeDestroy:Wn,beforeUnmount:Wn,destroyed:Wn,unmounted:Wn,activated:Wn,deactivated:Wn,errorCaptured:Wn,serverPrefetch:Wn,components:ca,directives:ca,watch:ES,provide:Zp,inject:TS};function Zp(e,t){return t?e?function(){return fn(Ze(e)?e.call(this,this):e,Ze(t)?t.call(this,this):t)}:t:e}function TS(e,t){return ca(Wd(e),Wd(t))}function Wd(e){if(ze(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Wn(e,t){return e?[...new Set([].concat(e,t))]:t}function ca(e,t){return e?fn(Object.create(null),e,t):t}function eh(e,t){return e?ze(e)&&ze(t)?[...new Set([...e,...t])]:fn(Object.create(null),Xp(e),Xp(t??{})):t}function ES(e,t){if(!e)return t;if(!t)return e;const n=fn(Object.create(null),e);for(const r in t)n[r]=Wn(e[r],t[r]);return n}function Lv(){return{app:null,config:{isNativeTag:zg,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 kS=0;function IS(e,t){return function(r,o=null){Ze(r)||(r=fn({},r)),o!=null&&!Ct(o)&&(o=null);const s=Lv(),i=new WeakSet,a=[];let l=!1;const u=s.app={_uid:kS++,_component:r,_props:o,_container:null,_context:s,_instance:null,version:nT,get config(){return s.config},set config(d){},use(d,...p){return i.has(d)||(d&&Ze(d.install)?(i.add(d),d.install(u,...p)):Ze(d)&&(i.add(d),d(u,...p))),u},mixin(d){return s.mixins.includes(d)||s.mixins.push(d),u},component(d,p){return p?(s.components[d]=p,u):s.components[d]},directive(d,p){return p?(s.directives[d]=p,u):s.directives[d]},mount(d,p,g){if(!l){const _=u._ceVNode||Ue(r,o);return _.appContext=s,g===!0?g="svg":g===!1&&(g=void 0),e(_,d,g),l=!0,u._container=d,d.__vue_app__=u,Pc(_.component)}},onUnmount(d){a.push(d)},unmount(){l&&(Br(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(d,p){return s.provides[d]=p,u},runWithContext(d){const p=_i;_i=u;try{return d()}finally{_i=p}}};return u}}let _i=null;const CS=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Yn(t)}Modifiers`]||e[`${ls(t)}Modifiers`];function AS(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ot;let o=n;const s=t.startsWith("update:"),i=s&&CS(r,t.slice(7));i&&(i.trim&&(o=n.map(d=>Wt(d)?d.trim():d)),i.number&&(o=n.map(Ec)));let a,l=r[a=Nu(t)]||r[a=Nu(Yn(t))];!l&&s&&(l=r[a=Nu(ls(t))]),l&&Br(l,e,6,o);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Br(u,e,6,o)}}const xS=new WeakMap;function Dv(e,t,n=!1){const r=n?xS:t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!Ze(e)){const l=u=>{const d=Dv(u,t,!0);d&&(a=!0,fn(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):(ze(s)?s.forEach(l=>i[l]=null):fn(i,s),Ct(e)&&r.set(e,i),i)}function Rc(e,t){return!e||!bc(t)?!1:(t=t.slice(2).replace(/Once$/,""),It(e,t[0].toLowerCase()+t.slice(1))||It(e,ls(t))||It(e,t))}function th(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:u,renderCache:d,props:p,data:g,setupState:_,ctx:I,inheritAttrs:R}=e,W=tc(e);let M,$;try{if(n.shapeFlag&4){const z=o||r,ue=z;M=ro(u.call(ue,z,d,p,_,g,I)),$=a}else{const z=t;M=ro(z.length>1?z(p,{attrs:a,slots:i,emit:l}):z(p,null)),$=t.props?a:RS(a)}}catch(z){ga.length=0,Ba(z,e,1),M=Ue(Mn)}let q=M;if($&&R!==!1){const z=Object.keys($),{shapeFlag:ue}=q;z.length&&ue&7&&(s&&z.some(wc)&&($=MS($,s)),q=os(q,$,!1,!0))}return n.dirs&&(q=os(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&Ea(q,n.transition),M=q,tc(W),M}const RS=e=>{let t;for(const n in e)(n==="class"||n==="style"||bc(n))&&((t||(t={}))[n]=e[n]);return t},MS=(e,t)=>{const n={};for(const r in e)(!wc(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function PS(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?nh(r,i,u):!!i;if(l&8){const d=t.dynamicProps;for(let p=0;p<d.length;p++){const g=d[p];if(jv(i,r,g)&&!Rc(u,g))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?nh(r,i,u):!0:!!i;return!1}function nh(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(jv(t,e,s)&&!Rc(n,s))return!0}return!1}function jv(e,t,n){const r=e[n],o=t[n];return n==="style"&&Ct(r)&&Ct(o)?!$i(r,o):r!==o}function $S({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={},Bv=()=>Object.create(Fv),Uv=e=>Object.getPrototypeOf(e)===Fv;function NS(e,t,n,r=!1){const o={},s=Bv();e.propsDefaults=Object.create(null),qv(e,t,o,s);for(const i in e.propsOptions[0])i in o||(o[i]=void 0);n?e.props=r?o:hv(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=wt(o),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const d=e.vnode.dynamicProps;for(let p=0;p<d.length;p++){let g=d[p];if(Rc(e.emitsOptions,g))continue;const _=t[g];if(l)if(It(s,g))_!==s[g]&&(s[g]=_,u=!0);else{const I=Yn(g);o[I]=Vd(l,a,I,_,e,!1)}else _!==s[g]&&(s[g]=_,u=!0)}}}else{qv(e,t,o,s)&&(u=!0);let d;for(const p in a)(!t||!It(t,p)&&((d=ls(p))===p||!It(t,d)))&&(l?n&&(n[p]!==void 0||n[d]!==void 0)&&(o[p]=Vd(l,a,p,void 0,e,!0)):delete o[p]);if(s!==a)for(const p in s)(!t||!It(t,p))&&(delete s[p],u=!0)}u&&wo(e.attrs,"set","")}function qv(e,t,n,r){const[o,s]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(ua(l))continue;const u=t[l];let d;o&&It(o,d=Yn(l))?!s||!s.includes(d)?n[d]=u:(a||(a={}))[d]=u:Rc(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(s){const l=wt(n),u=a||Ot;for(let d=0;d<s.length;d++){const p=s[d];n[p]=Vd(o,l,p,u[p],e,!It(u,p))}}return i}function Vd(e,t,n,r,o,s){const i=e[n];if(i!=null){const a=It(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ze(l)){const{propsDefaults:u}=o;if(n in u)r=u[n];else{const d=qa(o);r=u[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===ls(n))&&(r=!0))}return r}const LS=new WeakMap;function Hv(e,t,n=!1){const r=n?LS:t.propsCache,o=r.get(e);if(o)return o;const s=e.props,i={},a=[];let l=!1;if(!Ze(e)){const d=p=>{l=!0;const[g,_]=Hv(p,t,!0);fn(i,g),_&&a.push(..._)};!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,mi),mi;if(ze(s))for(let d=0;d<s.length;d++){const p=Yn(s[d]);rh(p)&&(i[p]=Ot)}else if(s)for(const d in s){const p=Yn(d);if(rh(p)){const g=s[d],_=i[p]=ze(g)||Ze(g)?{type:g}:fn({},g),I=_.type;let R=!1,W=!0;if(ze(I))for(let M=0;M<I.length;++M){const $=I[M],q=Ze($)&&$.name;if(q==="Boolean"){R=!0;break}else q==="String"&&(W=!1)}else R=Ze(I)&&I.name==="Boolean";_[0]=R,_[1]=W,(R||It(_,"default"))&&a.push(p)}}const u=[i,a];return Ct(e)&&r.set(e,u),u}function rh(e){return e[0]!=="$"&&!ua(e)}const Wf=e=>e==="_"||e==="_ctx"||e==="$stable",Vf=e=>ze(e)?e.map(ro):[ro(e)],DS=(e,t,n)=>{if(t._n)return t;const r=Et((...o)=>Vf(t(...o)),n);return r._c=!1,r},Wv=(e,t,n)=>{const r=e._ctx;for(const o in e){if(Wf(o))continue;const s=e[o];if(Ze(s))t[o]=DS(o,s,r);else if(s!=null){const i=Vf(s);t[o]=()=>i}}},Vv=(e,t)=>{const n=Vf(t);e.slots.default=()=>n},zv=(e,t,n)=>{for(const r in t)(n||!Wf(r))&&(e[r]=t[r])},jS=(e,t,n)=>{const r=e.slots=Bv();if(e.vnode.shapeFlag&32){const o=t._;o?(zv(r,t,n),n&&Jg(r,"_",o,!0)):Wv(t,r)}else t&&Vv(e,t)},FS=(e,t,n)=>{const{vnode:r,slots:o}=e;let s=!0,i=Ot;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:zv(o,t,n):(s=!t.$stable,Wv(t,o)),i=t}else t&&(Vv(e,t),i={default:1});if(s)for(const a in o)!Wf(a)&&i[a]==null&&delete o[a]},Vn=WS;function BS(e){return US(e)}function US(e,t){const n=kc();n.__VUE__=!0;const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:u,setElementText:d,parentNode:p,nextSibling:g,setScopeId:_=io,insertStaticContent:I}=e,R=(k,C,H,X=null,Z=null,Q=null,ie=void 0,me=null,se=!!C.dynamicChildren)=>{if(k===C)return;k&&!Ps(k,C)&&(X=K(k),qe(k,Z,Q,!0),k=null),C.patchFlag===-2&&(se=!1,C.dynamicChildren=null);const{type:te,ref:Le,shapeFlag:ye}=C;switch(te){case Mc:W(k,C,H,X);break;case Mn:M(k,C,H,X);break;case Hu:k==null&&$(C,H,X,ie);break;case Ke:Y(k,C,H,X,Z,Q,ie,me,se);break;default:ye&1?ue(k,C,H,X,Z,Q,ie,me,se):ye&6?de(k,C,H,X,Z,Q,ie,me,se):(ye&64||ye&128)&&te.process(k,C,H,X,Z,Q,ie,me,se,Oe)}Le!=null&&Z?ha(Le,k&&k.ref,Q,C||k,!C):Le==null&&k&&k.ref!=null&&ha(k.ref,null,Q,k,!0)},W=(k,C,H,X)=>{if(k==null)r(C.el=a(C.children),H,X);else{const Z=C.el=k.el;C.children!==k.children&&u(Z,C.children)}},M=(k,C,H,X)=>{k==null?r(C.el=l(C.children||""),H,X):C.el=k.el},$=(k,C,H,X)=>{[k.el,k.anchor]=I(k.children,C,H,X,k.el,k.anchor)},q=({el:k,anchor:C},H,X)=>{let Z;for(;k&&k!==C;)Z=g(k),r(k,H,X),k=Z;r(C,H,X)},z=({el:k,anchor:C})=>{let H;for(;k&&k!==C;)H=g(k),o(k),k=H;o(C)},ue=(k,C,H,X,Z,Q,ie,me,se)=>{if(C.type==="svg"?ie="svg":C.type==="math"&&(ie="mathml"),k==null)ne(C,H,X,Z,Q,ie,me,se);else{const te=k.el&&k.el._isVueCE?k.el:null;try{te&&te._beginPatch(),xe(k,C,Z,Q,ie,me,se)}finally{te&&te._endPatch()}}},ne=(k,C,H,X,Z,Q,ie,me)=>{let se,te;const{props:Le,shapeFlag:ye,transition:be,dirs:we}=k;if(se=k.el=i(k.type,Q,Le&&Le.is,Le),ye&8?d(se,k.children):ye&16&&he(k.children,se,null,X,Z,qu(k,Q),ie,me),we&&Ss(k,null,X,"created"),J(se,k,k.scopeId,ie,X),Le){for(const P in Le)P!=="value"&&!ua(P)&&s(se,P,null,Le[P],Q,X);"value"in Le&&s(se,"value",null,Le.value,Q),(te=Le.onVnodeBeforeMount)&&Zr(te,X,k)}we&&Ss(k,null,X,"beforeMount");const N=qS(Z,be);N&&be.beforeEnter(se),r(se,C,H),((te=Le&&Le.onVnodeMounted)||N||we)&&Vn(()=>{try{te&&Zr(te,X,k),N&&be.enter(se),we&&Ss(k,null,X,"mounted")}finally{}},Z)},J=(k,C,H,X,Z)=>{if(H&&_(k,H),X)for(let Q=0;Q<X.length;Q++)_(k,X[Q]);if(Z){let Q=Z.subTree;if(C===Q||Yv(Q.type)&&(Q.ssContent===C||Q.ssFallback===C)){const ie=Z.vnode;J(k,ie,ie.scopeId,ie.slotScopeIds,Z.parent)}}},he=(k,C,H,X,Z,Q,ie,me,se=0)=>{for(let te=se;te<k.length;te++){const Le=k[te]=me?bo(k[te]):ro(k[te]);R(null,Le,C,H,X,Z,Q,ie,me)}},xe=(k,C,H,X,Z,Q,ie)=>{const me=C.el=k.el;let{patchFlag:se,dynamicChildren:te,dirs:Le}=C;se|=k.patchFlag&16;const ye=k.props||Ot,be=C.props||Ot;let we;if(H&&Es(H,!1),(we=be.onVnodeBeforeUpdate)&&Zr(we,H,C,k),Le&&Ss(C,k,H,"beforeUpdate"),H&&Es(H,!0),(ye.innerHTML&&be.innerHTML==null||ye.textContent&&be.textContent==null)&&d(me,""),te?Ce(k.dynamicChildren,te,me,H,X,qu(C,Z),Q):ie||ae(k,C,me,null,H,X,qu(C,Z),Q,!1),se>0){if(se&16)Pe(me,ye,be,H,Z);else if(se&2&&ye.class!==be.class&&s(me,"class",null,be.class,Z),se&4&&s(me,"style",ye.style,be.style,Z),se&8){const N=C.dynamicProps;for(let P=0;P<N.length;P++){const B=N[P],G=ye[B],le=be[B];(le!==G||B==="value")&&s(me,B,G,le,Z,H)}}se&1&&k.children!==C.children&&d(me,C.children)}else!ie&&te==null&&Pe(me,ye,be,H,Z);((we=be.onVnodeUpdated)||Le)&&Vn(()=>{we&&Zr(we,H,C,k),Le&&Ss(C,k,H,"updated")},X)},Ce=(k,C,H,X,Z,Q,ie)=>{for(let me=0;me<C.length;me++){const se=k[me],te=C[me],Le=se.el&&(se.type===Ke||!Ps(se,te)||se.shapeFlag&198)?p(se.el):H;R(se,te,Le,null,X,Z,Q,ie,!0)}},Pe=(k,C,H,X,Z)=>{if(C!==H){if(C!==Ot)for(const Q in C)!ua(Q)&&!(Q in H)&&s(k,Q,C[Q],null,Z,X);for(const Q in H){if(ua(Q))continue;const ie=H[Q],me=C[Q];ie!==me&&Q!=="value"&&s(k,Q,me,ie,Z,X)}"value"in H&&s(k,"value",C.value,H.value,Z)}},Y=(k,C,H,X,Z,Q,ie,me,se)=>{const te=C.el=k?k.el:a(""),Le=C.anchor=k?k.anchor:a("");let{patchFlag:ye,dynamicChildren:be,slotScopeIds:we}=C;we&&(me=me?me.concat(we):we),k==null?(r(te,H,X),r(Le,H,X),he(C.children||[],H,Le,Z,Q,ie,me,se)):ye>0&&ye&64&&be&&k.dynamicChildren&&k.dynamicChildren.length===be.length?(Ce(k.dynamicChildren,be,H,Z,Q,ie,me),(C.key!=null||Z&&C===Z.subTree)&&zf(k,C,!0)):ae(k,C,H,Le,Z,Q,ie,me,se)},de=(k,C,H,X,Z,Q,ie,me,se)=>{C.slotScopeIds=me,k==null?C.shapeFlag&512?Z.ctx.activate(C,H,X,ie,se):Ae(C,H,X,Z,Q,ie,se):De(k,C,se)},Ae=(k,C,H,X,Z,Q,ie)=>{const me=k.component=JS(k,X,Z);if(Ua(k)&&(me.ctx.renderer=Oe),XS(me,!1,ie),me.asyncDep){if(Z&&Z.registerDep(me,ve,ie),!k.el){const se=me.subTree=Ue(Mn);M(null,se,C,H),k.placeholder=se.el}}else ve(me,k,C,H,Z,Q,ie)},De=(k,C,H)=>{const X=C.component=k.component;if(PS(k,C,H))if(X.asyncDep&&!X.asyncResolved){Se(X,C,H);return}else X.next=C,X.update();else C.el=k.el,X.vnode=C},ve=(k,C,H,X,Z,Q,ie)=>{const me=()=>{if(k.isMounted){let{next:ye,bu:be,u:we,parent:N,vnode:P}=k;{const Fe=Gv(k);if(Fe){ye&&(ye.el=P.el,Se(k,ye,ie)),Fe.asyncDep.then(()=>{Vn(()=>{k.isUnmounted||te()},Z)});return}}let B=ye,G;Es(k,!1),ye?(ye.el=P.el,Se(k,ye,ie)):ye=P,be&&jl(be),(G=ye.props&&ye.props.onVnodeBeforeUpdate)&&Zr(G,N,ye,P),Es(k,!0);const le=th(k),Re=k.subTree;k.subTree=le,R(Re,le,p(Re.el),K(Re),k,Z,Q),ye.el=le.el,B===null&&$S(k,le.el),we&&Vn(we,Z),(G=ye.props&&ye.props.onVnodeUpdated)&&Vn(()=>Zr(G,N,ye,P),Z)}else{let ye;const{el:be,props:we}=C,{bm:N,m:P,parent:B,root:G,type:le}=k,Re=yi(C);Es(k,!1),N&&jl(N),!Re&&(ye=we&&we.onVnodeBeforeMount)&&Zr(ye,B,C),Es(k,!0);{G.ce&&G.ce._hasShadowRoot()&&G.ce._injectChildStyle(le,k.parent?k.parent.type:void 0);const Fe=k.subTree=th(k);R(null,Fe,H,X,k,Z,Q),C.el=Fe.el}if(P&&Vn(P,Z),!Re&&(ye=we&&we.onVnodeMounted)){const Fe=C;Vn(()=>Zr(ye,B,Fe),Z)}(C.shapeFlag&256||B&&yi(B.vnode)&&B.vnode.shapeFlag&256)&&k.a&&Vn(k.a,Z),k.isMounted=!0,C=H=X=null}};k.scope.on();const se=k.effect=new ev(me);k.scope.off();const te=k.update=se.run.bind(se),Le=k.job=se.runIfDirty.bind(se);Le.i=k,Le.id=k.uid,se.scheduler=()=>Uf(Le),Es(k,!0),te()},Se=(k,C,H)=>{C.component=k;const X=k.vnode.props;k.vnode=C,k.next=null,OS(k,C.props,X,H),FS(k,C.children,H),Ao(),Hp(k),xo()},ae=(k,C,H,X,Z,Q,ie,me,se=!1)=>{const te=k&&k.children,Le=k?k.shapeFlag:0,ye=C.children,{patchFlag:be,shapeFlag:we}=C;if(be>0){if(be&128){Ne(te,ye,H,X,Z,Q,ie,me,se);return}else if(be&256){ke(te,ye,H,X,Z,Q,ie,me,se);return}}we&8?(Le&16&&Ge(te,Z,Q),ye!==te&&d(H,ye)):Le&16?we&16?Ne(te,ye,H,X,Z,Q,ie,me,se):Ge(te,Z,Q,!0):(Le&8&&d(H,""),we&16&&he(ye,H,X,Z,Q,ie,me,se))},ke=(k,C,H,X,Z,Q,ie,me,se)=>{k=k||mi,C=C||mi;const te=k.length,Le=C.length,ye=Math.min(te,Le);let be;for(be=0;be<ye;be++){const we=C[be]=se?bo(C[be]):ro(C[be]);R(k[be],we,H,null,Z,Q,ie,me,se)}te>Le?Ge(k,Z,Q,!0,!1,ye):he(C,H,X,Z,Q,ie,me,se,ye)},Ne=(k,C,H,X,Z,Q,ie,me,se)=>{let te=0;const Le=C.length;let ye=k.length-1,be=Le-1;for(;te<=ye&&te<=be;){const we=k[te],N=C[te]=se?bo(C[te]):ro(C[te]);if(Ps(we,N))R(we,N,H,null,Z,Q,ie,me,se);else break;te++}for(;te<=ye&&te<=be;){const we=k[ye],N=C[be]=se?bo(C[be]):ro(C[be]);if(Ps(we,N))R(we,N,H,null,Z,Q,ie,me,se);else break;ye--,be--}if(te>ye){if(te<=be){const we=be+1,N=we<Le?C[we].el:X;for(;te<=be;)R(null,C[te]=se?bo(C[te]):ro(C[te]),H,N,Z,Q,ie,me,se),te++}}else if(te>be)for(;te<=ye;)qe(k[te],Z,Q,!0),te++;else{const we=te,N=te,P=new Map;for(te=N;te<=be;te++){const Pt=C[te]=se?bo(C[te]):ro(C[te]);Pt.key!=null&&P.set(Pt.key,te)}let B,G=0;const le=be-N+1;let Re=!1,Fe=0;const et=new Array(le);for(te=0;te<le;te++)et[te]=0;for(te=we;te<=ye;te++){const Pt=k[te];if(G>=le){qe(Pt,Z,Q,!0);continue}let Vt;if(Pt.key!=null)Vt=P.get(Pt.key);else for(B=N;B<=be;B++)if(et[B-N]===0&&Ps(Pt,C[B])){Vt=B;break}Vt===void 0?qe(Pt,Z,Q,!0):(et[Vt-N]=te+1,Vt>=Fe?Fe=Vt:Re=!0,R(Pt,C[Vt],H,null,Z,Q,ie,me,se),G++)}const tt=Re?HS(et):mi;for(B=tt.length-1,te=le-1;te>=0;te--){const Pt=N+te,Vt=C[Pt],On=C[Pt+1],st=Pt+1<Le?On.el||Kv(On):X;et[te]===0?R(null,Vt,H,st,Z,Q,ie,me,se):Re&&(B<0||te!==tt[B]?Me(Vt,H,st,2):B--)}}},Me=(k,C,H,X,Z=null)=>{const{el:Q,type:ie,transition:me,children:se,shapeFlag:te}=k;if(te&6){Me(k.component.subTree,C,H,X);return}if(te&128){k.suspense.move(C,H,X);return}if(te&64){ie.move(k,C,H,Oe);return}if(ie===Ke){r(Q,C,H);for(let ye=0;ye<se.length;ye++)Me(se[ye],C,H,X);r(k.anchor,C,H);return}if(ie===Hu){q(k,C,H);return}if(X!==2&&te&1&&me)if(X===0)me.beforeEnter(Q),r(Q,C,H),Vn(()=>me.enter(Q),Z);else{const{leave:ye,delayLeave:be,afterLeave:we}=me,N=()=>{k.ctx.isUnmounted?o(Q):r(Q,C,H)},P=()=>{Q._isLeaving&&Q[to](!0),ye(Q,()=>{N(),we&&we()})};be?be(Q,N,P):P()}else r(Q,C,H)},qe=(k,C,H,X=!1,Z=!1)=>{const{type:Q,props:ie,ref:me,children:se,dynamicChildren:te,shapeFlag:Le,patchFlag:ye,dirs:be,cacheIndex:we,memo:N}=k;if(ye===-2&&(Z=!1),me!=null&&(Ao(),ha(me,null,H,k,!0),xo()),we!=null&&(C.renderCache[we]=void 0),Le&256){C.ctx.deactivate(k);return}const P=Le&1&&be,B=!yi(k);let G;if(B&&(G=ie&&ie.onVnodeBeforeUnmount)&&Zr(G,C,k),Le&6)ot(k.component,H,X);else{if(Le&128){k.suspense.unmount(H,X);return}P&&Ss(k,null,C,"beforeUnmount"),Le&64?k.type.remove(k,C,H,Oe,X):te&&!te.hasOnce&&(Q!==Ke||ye>0&&ye&64)?Ge(te,C,H,!1,!0):(Q===Ke&&ye&384||!Z&&Le&16)&&Ge(se,C,H),X&&He(k)}const le=N!=null&&we==null;(B&&(G=ie&&ie.onVnodeUnmounted)||P||le)&&Vn(()=>{G&&Zr(G,C,k),P&&Ss(k,null,C,"unmounted"),le&&(k.el=null)},H)},He=k=>{const{type:C,el:H,anchor:X,transition:Z}=k;if(C===Ke){Ve(H,X);return}if(C===Hu){z(k);return}const Q=()=>{o(H),Z&&!Z.persisted&&Z.afterLeave&&Z.afterLeave()};if(k.shapeFlag&1&&Z&&!Z.persisted){const{leave:ie,delayLeave:me}=Z,se=()=>ie(H,Q);me?me(k.el,Q,se):se()}else Q()},Ve=(k,C)=>{let H;for(;k!==C;)H=g(k),o(k),k=H;o(C)},ot=(k,C,H)=>{const{bum:X,scope:Z,job:Q,subTree:ie,um:me,m:se,a:te}=k;oh(se),oh(te),X&&jl(X),Z.stop(),Q&&(Q.flags|=8,qe(ie,k,C,H)),me&&Vn(me,C),Vn(()=>{k.isUnmounted=!0},C)},Ge=(k,C,H,X=!1,Z=!1,Q=0)=>{for(let ie=Q;ie<k.length;ie++)qe(k[ie],C,H,X,Z)},K=k=>{if(k.shapeFlag&6)return K(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const C=g(k.anchor||k.el),H=C&&C[Ev];return H?g(H):C};let _e=!1;const fe=(k,C,H)=>{let X;k==null?C._vnode&&(qe(C._vnode,null,null,!0),X=C._vnode.component):R(C._vnode||null,k,C,null,null,null,H),C._vnode=k,_e||(_e=!0,Hp(X),_v(),_e=!1)},Oe={p:R,um:qe,m:Me,r:He,mt:Ae,mc:he,pc:ae,pbc:Ce,n:K,o:e};return{render:fe,hydrate:void 0,createApp:IS(fe)}}function qu({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 Es({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function qS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function zf(e,t,n=!1){const r=e.children,o=t.children;if(ze(r)&&ze(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]=bo(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&zf(i,a)),a.type===Mc&&(a.patchFlag===-1&&(a=o[s]=bo(a)),a.el=i.el),a.type===Mn&&!a.el&&(a.el=i.el)}}function HS(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(o=n[n.length-1],e[o]<u){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<u?s=a+1:i=a;u<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 Gv(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Gv(t)}function oh(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Kv(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Kv(t.subTree):null}const Yv=e=>e.__isSuspense;function WS(e,t){t&&t.pendingBranch?ze(e)?t.effects.push(...e):t.effects.push(e):Kw(e)}const Ke=Symbol.for("v-fgt"),Mc=Symbol.for("v-txt"),Mn=Symbol.for("v-cmt"),Hu=Symbol.for("v-stc"),ga=[];let fr=null;function x(e=!1){ga.push(fr=e?null:[])}function VS(){ga.pop(),fr=ga[ga.length-1]||null}let ka=1;function oc(e,t=!1){ka+=e,e<0&&fr&&t&&(fr.hasOnce=!0)}function Jv(e){return e.dynamicChildren=ka>0?fr||mi:null,VS(),ka>0&&fr&&fr.push(e),e}function D(e,t,n,r,o,s){return Jv(b(e,t,n,r,o,s,!0))}function ht(e,t,n,r,o){return Jv(Ue(e,t,n,r,o,!0))}function Ia(e){return e?e.__v_isVNode===!0:!1}function Ps(e,t){return e.type===t.type&&e.key===t.key}const Xv=({key:e})=>e??null,Bl=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Wt(e)||$n(e)||Ze(e)?{i:Sn,r:e,k:t,f:!!n}:e:null);function b(e,t=null,n=null,r=0,o=null,s=e===Ke?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Xv(t),ref:t&&Bl(t),scopeId:wv,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:Sn};return a?(Gf(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Wt(n)?8:16),ka>0&&!i&&fr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&fr.push(l),l}const Ue=zS;function zS(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Pv)&&(e=Mn),Ia(e)){const a=os(e,t,!0);return n&&Gf(a,n),ka>0&&!s&&fr&&(a.shapeFlag&6?fr[fr.indexOf(e)]=a:fr.push(a)),a.patchFlag=-2,a}if(tT(e)&&(e=e.__vccOpts),t){t=GS(t);let{class:a,style:l}=t;a&&!Wt(a)&&(t.class=pt(a)),Ct(l)&&(Bf(l)&&!ze(l)&&(l=fn({},l)),t.style=To(l))}const i=Wt(e)?1:Yv(e)?128:kv(e)?64:Ct(e)?4:Ze(e)?2:0;return b(e,t,n,r,o,i,s,!0)}function GS(e){return e?Bf(e)||Uv(e)?fn({},e):e:null}function os(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,u=t?Qv(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Xv(u),ref:t&&t.ref?n&&s?ze(s)?s.concat(Bl(t)):[s,Bl(t)]:Bl(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!==Ke?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&&os(e.ssContent),ssFallback:e.ssFallback&&os(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Ea(d,l.clone(d)),d}function js(e=" ",t=0){return Ue(Mc,null,e,t)}function pe(e="",t=!1){return t?(x(),ht(Mn,null,e)):Ue(Mn,null,e)}function ro(e){return e==null||typeof e=="boolean"?Ue(Mn):ze(e)?Ue(Ke,null,e.slice()):Ia(e)?bo(e):Ue(Mc,null,String(e))}function bo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:os(e)}function Gf(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ze(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Gf(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Uv(t)?t._ctx=Sn:o===3&&Sn&&(Sn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ze(t)?(t={default:t,_ctx:Sn},n=32):(t=String(t),r&64?(n=16,t=[js(t)]):n=8);e.children=t,e.shapeFlag|=n}function Qv(...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=To([t.style,r.style]);else if(bc(o)){const s=t[o],i=r[o];i&&s!==i&&!(ze(s)&&s.includes(i))?t[o]=s?[].concat(s,i):i:i==null&&s==null&&!wc(o)&&(t[o]=i)}else o!==""&&(t[o]=r[o])}return t}function Zr(e,t,n,r=null){Br(e,t,7,[n,r])}const KS=Lv();let YS=0;function JS(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||KS,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 yw(!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:Hv(r,o),emitsOptions:Dv(r,o),emit:null,emitted:null,propsDefaults:Ot,inheritAttrs:r.inheritAttrs,ctx:Ot,data:Ot,props:Ot,attrs:Ot,slots:Ot,refs:Ot,setupState:Ot,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=AS.bind(null,s),e.ce&&e.ce(s),s}let wn=null;const Kf=()=>wn||Sn;let sc,zd;{const e=kc(),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)}};sc=t("__VUE_INSTANCE_SETTERS__",n=>wn=n),zd=t("__VUE_SSR_SETTERS__",n=>Si=n)}const qa=e=>{const t=wn;return sc(e),e.scope.on(),()=>{e.scope.off(),sc(t)}},sh=()=>{wn&&wn.scope.off(),sc(null)};function Zv(e){return e.vnode.shapeFlag&4}let Si=!1;function XS(e,t=!1,n=!1){t&&zd(t);const{props:r,children:o}=e.vnode,s=Zv(e);NS(e,r,s,t),jS(e,o,n||t);const i=s?QS(e,t):void 0;return t&&zd(!1),i}function QS(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,vS);const{setup:r}=n;if(r){Ao();const o=e.setupContext=r.length>1?ty(e):null,s=qa(e),i=Fa(r,e,0,[e.props,o]),a=Gg(i);if(xo(),s(),(a||e.sp)&&!yi(e)&&qf(e),a){if(i.then(sh,sh),t)return i.then(l=>{ih(e,l)}).catch(l=>{Ba(l,e,0)});e.asyncDep=i}else ih(e,i)}else ey(e)}function ih(e,t,n){Ze(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ct(t)&&(e.setupState=gv(t)),ey(e)}function ey(e,t,n){const r=e.type;e.render||(e.render=r.render||io);{const o=qa(e);Ao();try{bS(e)}finally{xo(),o()}}}const ZS={get(e,t){return xn(e,"get",""),e[t]}};function ty(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,ZS),slots:e.slots,emit:e.emit,expose:t}}function Pc(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(gv(jw(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ma)return ma[n](e)},has(t,n){return n in t||n in ma}})):e.proxy}function eT(e,t=!0){return Ze(e)?e.displayName||e.name:e.name||t&&e.__name}function tT(e){return Ze(e)&&"__vccOpts"in e}const oe=(e,t)=>Hw(e,t,Si);function Yf(e,t,n){try{oc(-1);const r=arguments.length;return r===2?Ct(t)&&!ze(t)?Ia(t)?Ue(e,null,[t]):Ue(e,t):Ue(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ia(n)&&(n=[n]),Ue(e,t,n))}finally{oc(1)}}const nT="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 Gd;const ah=typeof window<"u"&&window.trustedTypes;if(ah)try{Gd=ah.createPolicy("vue",{createHTML:e=>e})}catch{}const ny=Gd?e=>Gd.createHTML(e):e=>e,rT="http://www.w3.org/2000/svg",oT="http://www.w3.org/1998/Math/MathML",yo=typeof document<"u"?document:null,lh=yo&&yo.createElement("template"),sT={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"?yo.createElementNS(rT,e):t==="mathml"?yo.createElementNS(oT,e):n?yo.createElement(e,{is:n}):yo.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>yo.createTextNode(e),createComment:e=>yo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yo.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{lh.innerHTML=ny(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=lh.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]}},Vo="transition",oa="animation",Ca=Symbol("_vtc"),ry={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},iT=fn({},Iv,ry),aT=e=>(e.displayName="Transition",e.props=iT,e),oy=aT((e,{slots:t})=>Yf(rS,lT(e),t)),ks=(e,t=[])=>{ze(e)?e.forEach(n=>n(...t)):e&&e(...t)},ch=e=>e?ze(e)?e.some(t=>t.length>1):e.length>1:!1;function lT(e){const t={};for(const Y in e)Y in ry||(t[Y]=e[Y]);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:u=i,appearToClass:d=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:g=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,I=cT(o),R=I&&I[0],W=I&&I[1],{onBeforeEnter:M,onEnter:$,onEnterCancelled:q,onLeave:z,onLeaveCancelled:ue,onBeforeAppear:ne=M,onAppear:J=$,onAppearCancelled:he=q}=t,xe=(Y,de,Ae,De)=>{Y._enterCancelled=De,Is(Y,de?d:a),Is(Y,de?u:i),Ae&&Ae()},Ce=(Y,de)=>{Y._isLeaving=!1,Is(Y,p),Is(Y,_),Is(Y,g),de&&de()},Pe=Y=>(de,Ae)=>{const De=Y?J:$,ve=()=>xe(de,Y,Ae);ks(De,[de,ve]),uh(()=>{Is(de,Y?l:s),mo(de,Y?d:a),ch(De)||dh(de,r,R,ve)})};return fn(t,{onBeforeEnter(Y){ks(M,[Y]),mo(Y,s),mo(Y,i)},onBeforeAppear(Y){ks(ne,[Y]),mo(Y,l),mo(Y,u)},onEnter:Pe(!1),onAppear:Pe(!0),onLeave(Y,de){Y._isLeaving=!0;const Ae=()=>Ce(Y,de);mo(Y,p),Y._enterCancelled?(mo(Y,g),hh(Y)):(hh(Y),mo(Y,g)),uh(()=>{Y._isLeaving&&(Is(Y,p),mo(Y,_),ch(z)||dh(Y,r,W,Ae))}),ks(z,[Y,Ae])},onEnterCancelled(Y){xe(Y,!1,void 0,!0),ks(q,[Y])},onAppearCancelled(Y){xe(Y,!0,void 0,!0),ks(he,[Y])},onLeaveCancelled(Y){Ce(Y),ks(ue,[Y])}})}function cT(e){if(e==null)return null;if(Ct(e))return[Wu(e.enter),Wu(e.leave)];{const t=Wu(e);return[t,t]}}function Wu(e){return uw(e)}function mo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Ca]||(e[Ca]=new Set)).add(t)}function Is(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Ca];n&&(n.delete(t),n.size||(e[Ca]=void 0))}function uh(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let uT=0;function dh(e,t,n,r){const o=e._endId=++uT,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=dT(e,t);if(!i)return r();const u=i+"end";let d=0;const p=()=>{e.removeEventListener(u,g),s()},g=_=>{_.target===e&&++d>=l&&p()};setTimeout(()=>{d<l&&p()},a+1),e.addEventListener(u,g)}function dT(e,t){const n=window.getComputedStyle(e),r=I=>(n[I]||"").split(", "),o=r(`${Vo}Delay`),s=r(`${Vo}Duration`),i=fh(o,s),a=r(`${oa}Delay`),l=r(`${oa}Duration`),u=fh(a,l);let d=null,p=0,g=0;t===Vo?i>0&&(d=Vo,p=i,g=s.length):t===oa?u>0&&(d=oa,p=u,g=l.length):(p=Math.max(i,u),d=p>0?i>u?Vo:oa:null,g=d?d===Vo?s.length:l.length:0);const _=d===Vo&&/\b(?:transform|all)(?:,|$)/.test(r(`${Vo}Property`).toString());return{type:d,timeout:p,propCount:g,hasTransform:_}}function fh(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ph(n)+ph(e[r])))}function ph(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function hh(e){return(e?e.ownerDocument:document).body.offsetHeight}function fT(e,t,n){const r=e[Ca];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const mh=Symbol("_vod"),pT=Symbol("_vsh"),hT=Symbol(""),mT=/(?:^|;)\s*display\s*:/;function gT(e,t,n){const r=e.style,o=Wt(n);let s=!1;if(n&&!o){if(t)if(Wt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ul(r,a,"")}else for(const i in t)n[i]==null&&Ul(r,i,"");for(const i in n)i==="display"&&(s=!0),Ul(r,i,n[i])}else if(o){if(t!==n){const i=r[hT];i&&(n+=";"+i),r.cssText=n,s=mT.test(n)}}else t&&e.removeAttribute("style");mh in e&&(e[mh]=s?r.display:"",e[pT]&&(r.display="none"))}const gh=/\s*!important$/;function Ul(e,t,n){if(ze(n))n.forEach(r=>Ul(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=vT(e,t);gh.test(n)?e.setProperty(ls(r),n.replace(gh,""),"important"):e[r]=n}}const vh=["Webkit","Moz","ms"],Vu={};function vT(e,t){const n=Vu[t];if(n)return n;let r=Yn(t);if(r!=="filter"&&r in e)return Vu[t]=r;r=Tc(r);for(let o=0;o<vh.length;o++){const s=vh[o]+r;if(s in e)return Vu[t]=s}return t}const yh="http://www.w3.org/1999/xlink";function _h(e,t,n,r,o,s=gw(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(yh,t.slice(6,t.length)):e.setAttributeNS(yh,t,n):n==null||s&&!Xg(n)?e.removeAttribute(t):e.setAttribute(t,s?"":jr(n)?String(n):n)}function bh(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ny(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=Xg(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 Zo(e,t,n,r){e.addEventListener(t,n,r)}function yT(e,t,n,r){e.removeEventListener(t,n,r)}const wh=Symbol("_vei");function _T(e,t,n,r,o=null){const s=e[wh]||(e[wh]={}),i=s[t];if(r&&i)i.value=r;else{const[a,l]=bT(t);if(r){const u=s[t]=TT(r,o);Zo(e,a,u,l)}else i&&(yT(e,a,i,l),s[t]=void 0)}}const Sh=/(?:Once|Passive|Capture)$/;function bT(e){let t;if(Sh.test(e)){t={};let r;for(;r=e.match(Sh);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ls(e.slice(2)),t]}let zu=0;const wT=Promise.resolve(),ST=()=>zu||(wT.then(()=>zu=0),zu=Date.now());function TT(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Br(ET(r,n.value),t,5,[r])};return n.value=e,n.attached=ST(),n}function ET(e,t){if(ze(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 Th=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,kT=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?fT(e,r,i):t==="style"?gT(e,n,r):bc(t)?wc(t)||_T(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):IT(e,t,r,i))?(bh(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_h(e,t,r,i,s,t!=="value")):e._isVueCE&&(CT(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Wt(r)))?bh(e,Yn(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_h(e,t,r,i))};function IT(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Th(t)&&Ze(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 Th(t)&&Wt(n)?!1:t in e}function CT(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 Ti=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ze(t)?n=>jl(t,n):t};function AT(e){e.target.composing=!0}function Eh(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Eo=Symbol("_assign");function kh(e,t,n){return t&&(e=e.trim()),n&&(e=Ec(e)),e}const or={created(e,{modifiers:{lazy:t,trim:n,number:r}},o){e[Eo]=Ti(o);const s=r||o.props&&o.props.type==="number";Zo(e,t?"change":"input",i=>{i.target.composing||e[Eo](kh(e.value,n,s))}),(n||s)&&Zo(e,"change",()=>{e.value=kh(e.value,n,s)}),t||(Zo(e,"compositionstart",AT),Zo(e,"compositionend",Eh),Zo(e,"change",Eh))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:o,number:s}},i){if(e[Eo]=Ti(i),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Ec(e.value):e.value,l=t??"";if(a===l)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(r&&t===n||o&&e.value.trim()===l)||(e.value=l)}},xT={deep:!0,created(e,t,n){e[Eo]=Ti(n),Zo(e,"change",()=>{const r=e._modelValue,o=Aa(e),s=e.checked,i=e[Eo];if(ze(r)){const a=$f(r,o),l=a!==-1;if(s&&!l)i(r.concat(o));else if(!s&&l){const u=[...r];u.splice(a,1),i(u)}}else if(Pi(r)){const a=new Set(r);s?a.add(o):a.delete(o),i(a)}else i(sy(e,s))})},mounted:Ih,beforeUpdate(e,t,n){e[Eo]=Ti(n),Ih(e,t,n)}};function Ih(e,{value:t,oldValue:n},r){e._modelValue=t;let o;if(ze(t))o=$f(t,r.props.value)>-1;else if(Pi(t))o=t.has(r.props.value);else{if(t===n)return;o=$i(t,sy(e,!0))}e.checked!==o&&(e.checked=o)}const r2={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const o=Pi(t);Zo(e,"change",()=>{const s=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?Ec(Aa(i)):Aa(i));e[Eo](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,Yt(()=>{e._assigning=!1})}),e[Eo]=Ti(r)},mounted(e,{value:t}){Ch(e,t)},beforeUpdate(e,t,n){e[Eo]=Ti(n)},updated(e,{value:t}){e._assigning||Ch(e,t)}};function Ch(e,t){const n=e.multiple,r=ze(t);if(!(n&&!r&&!Pi(t))){for(let o=0,s=e.options.length;o<s;o++){const i=e.options[o],a=Aa(i);if(n)if(r){const l=typeof a;l==="string"||l==="number"?i.selected=t.some(u=>String(u)===String(a)):i.selected=$f(t,a)>-1}else i.selected=t.has(a);else if($i(Aa(i),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Aa(e){return"_value"in e?e._value:e.value}function sy(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const RT=["ctrl","shift","alt","meta"],MT={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)=>RT.some(n=>e[`${n}Key`]&&!t.includes(n))},ft=(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=MT[t[i]];if(a&&a(o,t))return}return e(o,...s)}))},PT={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Zt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(o=>{if(!("key"in o))return;const s=ls(o.key);if(t.some(i=>i===s||PT[i]===s))return e(o)}))},$T=fn({patchProp:kT},sT);let Ah;function NT(){return Ah||(Ah=BS($T))}const OT=((...e)=>{const t=NT().createApp(...e),{mount:n}=t;return t.mount=r=>{const o=DT(r);if(!o)return;const s=t._component;!Ze(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,LT(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t});function LT(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function DT(e){return Wt(e)?document.querySelector(e):e}const Be=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,gt=globalThis,Fs="10.48.0";function Vs(){return $c(gt),gt}function $c(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Fs,t[Fs]=t[Fs]||{}}function Ni(e,t,n=gt){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Fs]=r[Fs]||{};return o[e]||(o[e]=t())}const jT=["debug","info","warn","error","log","assert","trace"],FT="Sentry Logger ",ic={};function Do(e){if(!("console"in gt))return e();const t=gt.console,n={},r=Object.keys(ic);r.forEach(o=>{const s=ic[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function BT(){Xf().enabled=!0}function UT(){Xf().enabled=!1}function iy(){return Xf().enabled}function qT(...e){Jf("log",...e)}function HT(...e){Jf("warn",...e)}function WT(...e){Jf("error",...e)}function Jf(e,...t){Be&&iy()&&Do(()=>{gt.console[e](`${FT}[${e}]:`,...t)})}function Xf(){return Be?Ni("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ee={enable:BT,disable:UT,isEnabled:iy,log:qT,warn:HT,error:WT},ay=50,Hs="?",xh=/\(error: (.*)\)/,Rh=/captureMessage|captureException/;function ly(...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 u=xh.test(l)?l.replace(xh,"$1"):l;if(!u.includes("Error: ")){for(const d of t){const p=d(u);if(p){s.push(p);break}}if(s.length>=ay+o)break}}return zT(s.slice(o))}}function VT(e){return Array.isArray(e)?ly(...e):e}function zT(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Cl(t).function||"")&&t.pop(),t.reverse(),Rh.test(Cl(t).function||"")&&(t.pop(),Rh.test(Cl(t).function||"")&&t.pop()),t.slice(0,ay).map(n=>({...n,filename:n.filename||Cl(t).filename,function:n.function||Hs}))}function Cl(e){return e[e.length-1]||{}}const Gu="<anonymous>";function Mo(e){try{return!e||typeof e!="function"?Gu:e.name||Gu}catch{return Gu}}function Mh(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 cy(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const ql={},Ph={};function us(e,t){ql[e]=ql[e]||[],ql[e].push(t)}function ds(e,t){if(!Ph[e]){Ph[e]=!0;try{t()}catch(n){Be&&Ee.error(`Error while instrumenting ${e}`,n)}}}function br(e,t){const n=e&&ql[e];if(n)for(const r of n)try{r(t)}catch(o){Be&&Ee.error(`Error while triggering instrumentation handler.
20
+ Type: ${e}
21
+ Name: ${Mo(r)}
22
+ Error:`,o)}}let Ku=null;function uy(e){const t="error";us(t,e),ds(t,GT)}function GT(){Ku=gt.onerror,gt.onerror=function(e,t,n,r,o){return br("error",{column:r,error:o,line:n,msg:e,url:t}),Ku?Ku.apply(this,arguments):!1},gt.onerror.__SENTRY_INSTRUMENTED__=!0}let Yu=null;function dy(e){const t="unhandledrejection";us(t,e),ds(t,KT)}function KT(){Yu=gt.onunhandledrejection,gt.onunhandledrejection=function(e){return br("unhandledrejection",e),Yu?Yu.apply(this,arguments):!0},gt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const fy=Object.prototype.toString;function Nc(e){switch(fy.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Po(e,Error)}}function Oi(e,t){return fy.call(e)===`[object ${t}]`}function py(e){return Oi(e,"ErrorEvent")}function $h(e){return Oi(e,"DOMError")}function YT(e){return Oi(e,"DOMException")}function ko(e){return Oi(e,"String")}function Qf(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ei(e){return e===null||Qf(e)||typeof e!="object"&&typeof e!="function"}function xa(e){return Oi(e,"Object")}function Oc(e){return typeof Event<"u"&&Po(e,Event)}function JT(e){return typeof Element<"u"&&Po(e,Element)}function XT(e){return Oi(e,"RegExp")}function Li(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function QT(e){return xa(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Po(e,t){try{return e instanceof t}catch{return!1}}function hy(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Zf(e){return typeof Request<"u"&&Po(e,Request)}const ep=gt,ZT=80;function Er(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 u;const d=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||ZT;for(;n&&s++<r&&(u=e0(n,d),!(u==="html"||s>1&&i+o.length*l+u.length>=p));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function e0(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if(ep.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&&ko(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 Ha(){try{return ep.document.location.href}catch{return""}}function my(e){if(!ep.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 pr(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const o=n(r);typeof o=="function"&&gy(o,r);try{e[t]=o}catch{Be&&Ee.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{Be&&Ee.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function gy(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,sr(e,"__sentry_original__",t)}catch{}}function tp(e){return e.__sentry_original__}function vy(e){if(Nc(e))return{message:e.message,name:e.name,stack:e.stack,...Oh(e)};if(Oc(e)){const t={type:e.type,target:Nh(e.target),currentTarget:Nh(e.currentTarget),...Oh(e)};return typeof CustomEvent<"u"&&Po(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Nh(e){try{return JT(e)?Er(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Oh(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function t0(e){const t=Object.keys(vy(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let si;function Wa(e){if(si!==void 0)return si?si(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=gt;return t in n&&typeof n[t]=="function"?(si=n[t],si(e)):(si=null,e())}function es(){return Wa(()=>Math.random())}function Va(){return Wa(()=>Date.now())}function Kd(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Lh(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const o=e[r];try{hy(o)?n.push(cy(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Hl(e,t,n=!1){return ko(e)?XT(t)?t.test(e):ko(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function ts(e,t=[],n=!1){return t.some(r=>Hl(e,r,n))}function n0(){const e=gt;return e.crypto||e.msCrypto}let Ju;function r0(){return es()*16}function wr(e=n0()){try{if(e!=null&&e.randomUUID)return Wa(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Ju||(Ju="10000000100040008000"+1e11),Ju.replace(/[018]/g,t=>(t^(r0()&15)>>t/4).toString(16))}function yy(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function $s(e){const{message:t,event_id:n}=e;if(t)return t;const r=yy(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Yd(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 ki(e,t){const n=yy(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 Dh(e){if(o0(e))return!0;try{sr(e,"__sentry_captured__",!0)}catch{}return!1}function o0(e){try{return e.__sentry_captured__}catch{}}const _y=1e3;function zs(){return Va()/_y}function s0(){const{performance:e}=gt;if(!(e!=null&&e.now)||!e.timeOrigin)return zs;const t=e.timeOrigin;return()=>(t+Wa(()=>e.now()))/_y}let jh;function tn(){return(jh??(jh=s0()))()}let Xu=null;function i0(){var i;const{performance:e}=gt;if(!(e!=null&&e.now))return;const t=3e5,n=Wa(()=>e.now()),r=Va(),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 kr(){return Xu===null&&(Xu=i0()),Xu}function a0(e){const t=tn(),n={sid:wr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>c0(n)};return e&&Ii(n,e),n}function Ii(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||tn(),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:wr()),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 l0(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Ii(e,n)}function c0(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 za(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]=za(r[o],t[o],n-1));return r}function $o(){return wr()}function Io(){return wr().substring(16)}const Jd="_sentrySpan";function Ci(e,t){t?sr(e,Jd,t):delete e[Jd]}function ac(e){return e[Jd]}const u0=100;class ao{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:$o(),sampleRand:es()}}clone(){const t=new ao;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,Ci(t,ac(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&&Ii(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 ao?n.getScopeData():xa(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:l,level:u,fingerprint:d=[],propagationContext:p,conversationId:g}=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),u&&(this._level=u),d.length&&(this._fingerprint=d),p&&(this._propagationContext=p),g&&(this._conversationId=g),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,Ci(this,void 0),this._attachments=[],this.setPropagationContext({traceId:$o(),sampleRand:es()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var s;const r=typeof n=="number"?n:u0;if(r<=0)return this;const o={timestamp:zs(),...t,message:t.message?Kd(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:ac(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=za(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)||wr();if(!this._client)return Be&&Ee.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)||wr();if(!this._client)return Be&&Ee.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)||wr();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Be&&Ee.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 d0(){return Ni("defaultCurrentScope",()=>new ao)}function f0(){return Ni("defaultIsolationScope",()=>new ao)}const Fh=e=>e instanceof Promise&&!e[by],by=Symbol("chained PromiseLike"),wy=(e,t,n)=>{const r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Fh(r)&&Fh(e)?r:p0(e,r)},p0=(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,{[by]:!0}),t};class h0{constructor(t,n){let r;t?r=t:r=new ao;let o;n?o=n:o=new ao,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 Li(r)?wy(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 Ai(){const e=Vs(),t=$c(e);return t.stack=t.stack||new h0(d0(),f0())}function m0(e){return Ai().withScope(e)}function g0(e,t){const n=Ai();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Bh(e){return Ai().withScope(()=>e(Ai().getIsolationScope()))}function v0(){return{withIsolationScope:Bh,withScope:m0,withSetScope:g0,withSetIsolationScope:(e,t)=>Bh(t),getCurrentScope:()=>Ai().getScope(),getIsolationScope:()=>Ai().getIsolationScope()}}function Di(e){const t=$c(e);return t.acs?t.acs:v0()}function $t(){const e=Vs();return Di(e).getCurrentScope()}function qr(){const e=Vs();return Di(e).getIsolationScope()}function y0(){return Ni("globalScope",()=>new ao)}function Lc(...e){const t=Vs(),n=Di(t);if(e.length===2){const[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function At(){return $t().getClient()}function _0(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Io()};return r&&(s.parent_span_id=r),s}const yr="sentry.source",np="sentry.sample_rate",Sy="sentry.previous_trace_sample_rate",No="sentry.op",Jt="sentry.origin",Ra="sentry.idle_span_finish_reason",Ga="sentry.measurement_unit",Ka="sentry.measurement_value",Uh="sentry.custom_span_name",rp="sentry.profile_id",ji="sentry.exclusive_time",b0="sentry.link.type",w0="gen_ai.conversation.id",Ty=0,Dc=1,un=2;function S0(e){if(e<400&&e>=100)return{code:Dc};if(e>=400&&e<500)switch(e){case 401:return{code:un,message:"unauthenticated"};case 403:return{code:un,message:"permission_denied"};case 404:return{code:un,message:"not_found"};case 409:return{code:un,message:"already_exists"};case 413:return{code:un,message:"failed_precondition"};case 429:return{code:un,message:"resource_exhausted"};case 499:return{code:un,message:"cancelled"};default:return{code:un,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:un,message:"unimplemented"};case 503:return{code:un,message:"unavailable"};case 504:return{code:un,message:"deadline_exceeded"};default:return{code:un,message:"internal_error"}}return{code:un,message:"internal_error"}}function Ey(e,t){e.setAttribute("http.response.status_code",t);const n=S0(t);n.message!=="unknown_error"&&e.setStatus(n)}const ky="_sentryScope",Iy="_sentryIsolationScope";function T0(e){try{const t=gt.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function E0(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function k0(e,t,n){e&&(sr(e,Iy,T0(n)),sr(e,ky,t))}function lc(e){const t=e;return{scope:t[ky],isolationScope:E0(t[Iy])}}const cc="sentry-",I0=8192;function Cy(e){const t=A0(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(cc)){const i=o.slice(cc.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function C0(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,o])=>(o&&(n[`${cc}${r}`]=o),n),{});return x0(t)}function A0(e){if(!(!e||!ko(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=qh(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):qh(e)}function qh(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 x0(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>I0?(Be&&Ee.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}const R0=/^o(\d+)\./,M0=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function P0(e){return e==="http"||e==="https"}function Fi(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 $0(e){const t=M0.exec(e);if(!t){Do(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",s="",i="",a=""]=t.slice(1);let l="",u=a;const d=u.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),u=d.pop()),u){const p=u.match(/^\d+/);p&&(u=p[0])}return Ay({host:s,pass:o,path:l,projectId:u,port:i,protocol:n,publicKey:r})}function Ay(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function N0(e){if(!Be)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(Ee.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?P0(r)?t&&isNaN(parseInt(t,10))?(Ee.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Ee.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ee.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function O0(e){const t=e.match(R0);return t==null?void 0:t[1]}function L0(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=O0(n)),r}function D0(e){const t=typeof e=="string"?$0(e):Ay(e);if(!(!t||!N0(t)))return t}function Ma(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 xy=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function j0(e){if(!e)return;const t=e.match(xy);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 F0(e,t){const n=j0(e),r=Cy(t);if(!(n!=null&&n.traceId))return{traceId:$o(),sampleRand:es()};const o=B0(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=$o(),t=Io(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function My(e=$o(),t=Io(),n){return`00-${e}-${t}-${n?"01":"00"}`}function B0(e,t){const n=Ma(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Ma(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?es()*r:r+es()*(1-r):es()}const Py=0,jc=1;let Hh=!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}=yt(e);return{parent_span_id:s,span_id:t,trace_id:n,data:r,op:o,status:i,origin:a,links:l}}function q0(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:yt(e).parent_span_id,s=lc(e).scope,i=r?(s==null?void 0:s.getPropagationContext().propagationSpanId)||Io():t;return{parent_span_id:o,span_id:i,trace_id:n}}function H0(e){const{traceId:t,spanId:n}=e.spanContext(),r=fs(e);return Ry(t,n,r)}function W0(e){const{traceId:t,spanId:n}=e.spanContext(),r=fs(e);return My(t,n,r)}function $y(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===jc,attributes:s,...o}))}function V0(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===jc,attributes:o}))}function Bs(e){return typeof e=="number"?Wh(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Wh(e.getTime()):tn()}function Wh(e){return e>9999999999?e/1e3:e}function yt(e){if(K0(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:z0(e),start_timestamp:Bs(o),timestamp:Bs(i)||void 0,status:Ny(a),op:r[No],origin:r[Jt],links:$y(l)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function z0(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 K0(e){return typeof e.getSpanJSON=="function"}function fs(e){const{traceFlags:t}=e.spanContext();return t===jc}function Ny(e){if(!(!e||e.code===Ty))return e.code===Dc?"ok":e.message||"internal_error"}function Y0(e){return!e||e.code===Dc||e.code===Ty||e.message==="cancelled"?"ok":"error"}const Us="_sentryChildSpans",Xd="_sentryRootSpan";function Oy(e,t){const n=e[Xd]||e;sr(t,Xd,n),e[Us]?e[Us].add(t):sr(e,Us,new Set([t]))}function J0(e,t){e[Us]&&e[Us].delete(t)}function Wl(e){const t=new Set;function n(r){if(!t.has(r)&&fs(r)){t.add(r);const o=r[Us]?Array.from(r[Us]):[];for(const s of o)n(s)}}return n(e),Array.from(t)}const Pn=X0;function X0(e){return e[Xd]||e}function ir(){const e=Vs(),t=Di(e);return t.getActiveSpan?t.getActiveSpan():ac($t())}function Qd(){Hh||(Do(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Hh=!0)}let Vh=!1;function Q0(){if(Vh)return;function e(){const t=ir(),n=t&&Pn(t);if(n){const r="internal_error";Be&&Ee.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:un,message:r})}}e.tag="sentry_tracingErrorCallback",Vh=!0,uy(e),dy(e)}function Sr(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=At())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function zh(e){Ee.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Pa(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(eE(n)){if(Hl(e.description,n))return Be&&zh(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Hl(e.description,n.name):!0,o=n.op?e.op&&Hl(e.op,n.op):!0;if(r&&o)return Be&&zh(e),!0}return!1}function Z0(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 eE(e){return typeof e=="string"||e instanceof RegExp}const op="production",Ly="_frozenDsc";function Vl(e,t){sr(e,Ly,t)}function Dy(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||op,release:n.release,public_key:r,trace_id:e,org_id:L0(t)};return t.emit("createDsc",o),o}function jy(e,t){const n=t.getPropagationContext();return n.dsc||Dy(n.traceId,e)}function ss(e){var I;const t=At();if(!t)return{};const n=Pn(e),r=yt(n),o=r.data,s=n.spanContext().traceState,i=(s==null?void 0:s.get("sentry.sample_rate"))??o[np]??o[Sy];function a(R){return(typeof i=="number"||typeof i=="string")&&(R.sample_rate=`${i}`),R}const l=n[Ly];if(l)return a(l);const u=s==null?void 0:s.get("sentry.dsc"),d=u&&Cy(u);if(d)return a(d);const p=Dy(e.spanContext().traceId,t),g=o[yr]??o["sentry.span.source"],_=r.description;return g!=="url"&&_&&(p.transaction=_),Sr()&&(p.sampled=String(fs(n)),p.sample_rand=(s==null?void 0:s.get("sentry.sample_rand"))??((I=lc(n).scope)==null?void 0:I.getPropagationContext().sampleRand.toString())),a(p),t.emit("createDsc",p,n),p}class Tr{constructor(t={}){this._traceId=t.traceId||$o(),this._spanId=t.spanId||Io(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Py}}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 _o(e,t=100,n=1/0){try{return Zd("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function By(e,t=3,n=100*1024){const r=_o(e,t);return oE(r)>n?By(e,t-1,n):r}function Zd(e,t,n=1/0,r=1/0,o=sE()){const[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=tE(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 u=t;if(u&&typeof u.toJSON=="function")try{const _=u.toJSON();return Zd("",_,l-1,r,o)}catch{}const d=Array.isArray(t)?[]:{};let p=0;const g=vy(t);for(const _ in g){if(!Object.prototype.hasOwnProperty.call(g,_))continue;if(p>=r){d[_]="[MaxProperties ~]";break}const I=g[_];d[_]=Zd(_,I,l-1,r,o),p++}return i(t),d}function tE(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(hy(t))return cy(t);if(QT(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Mo(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=nE(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function nE(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function rE(e){return~-encodeURI(e).split(/%..|./).length}function oE(e){return rE(JSON.stringify(e))}function sE(){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 Gs(e,t=[]){return[e,t]}function iE(e,t){const[n,r]=e;return[n,[...r,t]]}function ef(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 aE(e,t){return ef(e,(n,r)=>t.includes(r))}function tf(e){const t=$c(gt);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function lE(e){const[t,n]=e;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[tf(r),s]:r.push(typeof s=="string"?tf(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(_o(a))}o(l)}}return typeof r=="string"?r:cE(r)}function cE(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 uE(e){return[{type:"span"},e]}function dE(e){const t=typeof e.data=="string"?tf(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Uy={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 fE(e){return e in Uy}function Gh(e){return fE(e)?Uy[e]:e}function qy(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function pE(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:Fi(r)},...o&&{trace:o}}}function hE(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 mE(e,t,n,r){const o=qy(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:Fi(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Gs(s,[i])}function gE(e,t,n,r){const o=qy(n),s=e.type&&e.type!=="replay_event"?e.type:"event";hE(e,n==null?void 0:n.sdk);const i=pE(e,o,r,t);return delete e.sdkProcessingMetadata,Gs(i,[[{type:s},e]])}function vE(e,t){function n(_){return!!_.trace_id&&!!_.public_key}const r=ss(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:Fi(o)}},{beforeSendSpan:a,ignoreSpans:l}=(t==null?void 0:t.getOptions())||{},u=l!=null&&l.length?e.filter(_=>!Pa(yt(_),l)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const p=a?_=>{const I=yt(_),R=Fy(a)?I:a(I);return R||(Qd(),I)}:yt,g=[];for(const _ of u){const I=p(_);I&&g.push(uE(I))}return Gs(i,g)}function yE(e){if(!Be)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=yt(e),{spanId:o}=e.spanContext(),s=fs(e),i=Pn(e),a=i===e,l=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){const{op:d,description:p}=yt(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),p&&u.push(`root description: ${p}`)}Ee.log(`${l}
25
+ ${u.join(`
26
+ `)}`)}function _E(e){if(!Be)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:r}=e.spanContext(),s=Pn(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;Ee.log(i)}function bE(e,t,n,r=ir()){const o=r&&Pn(r);o&&(Be&&Ee.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[Ka]:t,[Ga]:n}))}function Kh(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},o=r[Ga],s=r[Ka];typeof o=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:o})}),t}function Ya(e){return e.getOptions().traceLifecycle==="stream"}const Yh=1e3;class Fc{constructor(t={}){this._traceId=t.traceId||$o(),this._spanId=t.spanId||Io(),this._startTime=t.startTimestamp||tn(),this._links=t.links,this._attributes={},this.setAttributes({[Jt]:"manual",[No]: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?jc:Py}}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=Bs(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(yr,"custom"),this}end(t){this._endTime||(this._endTime=Bs(t),_E(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[No],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Ny(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Jt],profile_id:this._attributes[rp],exclusive_time:this._attributes[ji],measurements:Kh(this._events),is_segment:this._isStandaloneSpan&&Pn(this)===this||void 0,segment_id:this._isStandaloneSpan?Pn(this).spanContext().spanId:void 0,links:$y(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===Pn(this),status:Y0(this._status),attributes:this._attributes,links:V0(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){Be&&Ee.log("[Tracing] Adding an event to span:",t);const o=Jh(n)?n:r||tn(),s=Jh(n)?{}:n||{},i={name:t,time:Bs(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=At();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Pn(this)))return;if(this._isStandaloneSpan){this._sampled?SE(vE([this],t)):(Be&&Ee.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Ya(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(lc(this).scope||$t()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Xh(yt(this)))return;this._name||(Be&&Ee.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=lc(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const s=Wl(this).filter(p=>p!==this&&!wE(p)).map(p=>yt(p)).filter(Xh),i=this._attributes[yr];delete this._attributes[Uh],s.forEach(p=>{delete p.data[Uh]});const a={contexts:{trace:U0(this)},spans:s.length>Yh?s.sort((p,g)=>p.start_timestamp-g.start_timestamp).slice(0,Yh):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ss(this)},request:r,...i&&{transaction_info:{source:i}}},l=Kh(this._events);return l&&Object.keys(l).length&&(Be&&Ee.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}}function Jh(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Xh(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function wE(e){return e instanceof Fc&&e.isStandaloneSpan()}function SE(e){const t=At();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function TE(e,t,n=()=>{},r=()=>{}){let o;try{o=e()}catch(s){throw t(s),n(),s}return EE(o,t,n,r)}function EE(e,t,n,r){return Li(e)?wy(e,o=>{n(),r(o)},o=>{t(o),n()}):(n(),r(e),e)}function kE(e,t,n){if(!Sr(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=Ma(o);if(s===void 0)return Be&&Ee.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 Be&&Ee.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||Be&&Ee.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}const IE="__SENTRY_SUPPRESS_TRACING__";function nf(e,t){const n=ip();if(n.startSpan)return n.startSpan(e,t);const r=Wy(e),{forceTransaction:o,parentSpan:s,scope:i}=e,a=i==null?void 0:i.clone();return Lc(a,()=>AE(s)(()=>{const u=$t(),d=Vy(u,s),g=e.onlyIfParent&&!d?new Tr:Hy({parentSpan:d,spanArguments:r,forceTransaction:o,scope:u});return(!RE(g)||!d)&&Ci(u,g),TE(()=>t(g),()=>{const{status:_}=yt(g);g.isRecording()&&(!_||_==="ok")&&g.setStatus({code:un,message:"internal_error"})},()=>{g.end()})}))}function is(e){const t=ip();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Wy(e),{forceTransaction:r,parentSpan:o}=e;return(e.scope?i=>Lc(e.scope,i):o!==void 0?i=>sp(o,i):i=>i())(()=>{const i=$t(),a=Vy(i,o);return e.onlyIfParent&&!a?new Tr:Hy({parentSpan:a,spanArguments:n,forceTransaction:r,scope:i})})}function sp(e,t){const n=ip();return n.withActiveSpan?n.withActiveSpan(e,t):Lc(r=>(Ci(r,e||void 0),t(r)))}function Hy({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Sr()){const a=new Tr;if(n||!e){const l={sampled:"false",sample_rate:"0",transaction:t.name,...ss(a)};Vl(a,l)}return a}const o=At();if(xE(o,t))return ap(r)||o==null||o.recordDroppedEvent("ignored","span"),new Tr({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const s=qr();let i;if(e&&!n)i=CE(e,r,t),Oy(e,i);else if(e){const a=ss(e),{traceId:l,spanId:u}=e.spanContext(),d=fs(e);i=Qh({traceId:l,parentSpanId:u,...t},r,d),Vl(i,a)}else{const{traceId:a,dsc:l,parentSpanId:u,sampled:d}={...s.getPropagationContext(),...r.getPropagationContext()};i=Qh({traceId:a,parentSpanId:u,...t},r,d),l&&Vl(i,l)}return yE(i),k0(i,r,s),i}function Wy(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=Bs(e.startTime),delete r.startTime,r}return n}function ip(){const e=Vs();return Di(e)}function Qh(e,t,n){var R;const r=At(),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,u=t.getPropagationContext(),d=ap(t),[p,g,_]=d?[!1]:kE(o,{name:s,parentSampled:a,attributes:l,parentSampleRate:Ma((R=u.dsc)==null?void 0:R.sample_rate)},u.sampleRand),I=new Fc({...e,attributes:{[yr]:"custom",[np]:g!==void 0&&_?g:void 0,...l},sampled:p});return!p&&r&&!d&&(Be&&Ee.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Ya(r)?"span":"transaction")),r&&r.emit("spanStart",I),I}function CE(e,t,n){const{spanId:r,traceId:o}=e.spanContext(),s=ap(t),i=s?!1:fs(e),a=i?new Fc({...n,parentSpanId:r,traceId:o,sampled:i}):new Tr({traceId:o});Oy(e,a);const l=At();return l&&(Ya(l)&&a instanceof Tr&&(e instanceof Tr&&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 Vy(e,t){if(t)return t;if(t===null)return;const n=ac(e);if(!n)return;const r=At();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Pn(n):n}function AE(e){return e!==void 0?t=>sp(e,t):t=>t()}function xE(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!Ya(e)||!(n!=null&&n.length)?!1:Pa({description:t.name||"",op:((r=t.attributes)==null?void 0:r[No])||t.op},n)}function RE(e){return e instanceof Tr&&e.dropReason==="ignored"}function ap(e){return e.getScopeData().sdkProcessingMetadata[IE]===!0}const zl={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},ME="heartbeatFailed",PE="idleTimeout",$E="finalTimeout",NE="externalFinish";function zy(e,t={}){const n=new Map;let r=!1,o,s=NE,i=!t.disableAutoFinish;const a=[],{idleTimeout:l=zl.idleTimeout,finalTimeout:u=zl.finalTimeout,childSpanTimeout:d=zl.childSpanTimeout,beforeSpanEnd:p,trimIdleSpanEndTimestamp:g=!0}=t,_=At();if(!_||!Sr()){const J=new Tr,he={sample_rate:"0",sampled:"false",...ss(J)};return Vl(J,he),J}const I=$t(),R=ir(),W=OE(e);W.end=new Proxy(W.end,{apply(J,he,xe){if(p&&p(W),he instanceof Tr)return;const[Ce,...Pe]=xe,Y=Ce||tn(),de=Bs(Y),Ae=Wl(W).filter(Ne=>Ne!==W),De=yt(W);if(!Ae.length||!g)return ne(de),Reflect.apply(J,he,[de,...Pe]);const ve=_.getOptions().ignoreSpans,Se=Ae==null?void 0:Ae.reduce((Ne,Me)=>{const qe=yt(Me);return!qe.timestamp||ve&&Pa(qe,ve)?Ne:Ne?Math.max(Ne,qe.timestamp):qe.timestamp},void 0),ae=De.start_timestamp,ke=Math.min(ae?ae+u/1e3:1/0,Math.max(ae||-1/0,Math.min(de,Se||1/0)));return ne(ke),Reflect.apply(J,he,[ke,...Pe])}});function M(){o&&(clearTimeout(o),o=void 0)}function $(J){M(),o=setTimeout(()=>{!r&&n.size===0&&i&&(s=PE,W.end(J))},l)}function q(J){o=setTimeout(()=>{!r&&i&&(s=ME,W.end(J))},d)}function z(J){M(),n.set(J,!0);const he=tn();q(he+d/1e3)}function ue(J){if(n.has(J)&&n.delete(J),n.size===0){const he=tn();$(he+l/1e3)}}function ne(J){r=!0,n.clear(),a.forEach(Ae=>Ae()),Ci(I,R);const he=yt(W),{start_timestamp:xe}=he;if(!xe)return;he.data[Ra]||W.setAttribute(Ra,s);const Pe=he.status;(!Pe||Pe==="unknown")&&W.setStatus({code:Dc}),Ee.log(`[Tracing] Idle span "${he.op}" finished`);const Y=Wl(W).filter(Ae=>Ae!==W);let de=0;Y.forEach(Ae=>{Ae.isRecording()&&(Ae.setStatus({code:un,message:"cancelled"}),Ae.end(J),Be&&Ee.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Ae,void 0,2)));const De=yt(Ae),{timestamp:ve=0,start_timestamp:Se=0}=De,ae=Se<=J,ke=(u+l)/1e3,Ne=ve-Se<=ke;if(Be){const Me=JSON.stringify(Ae,void 0,2);ae?Ne||Ee.log("[Tracing] Discarding span since it finished after idle span final timeout",Me):Ee.log("[Tracing] Discarding span since it happened after idle span was finished",Me)}(!Ne||!ae)&&(J0(W,Ae),de++)}),de>0&&W.setAttribute("sentry.idle_span_discarded_spans",de)}return a.push(_.on("spanStart",J=>{if(r||J===W||yt(J).timestamp||J instanceof Fc&&J.isStandaloneSpan())return;Wl(W).includes(J)&&z(J.spanContext().spanId)})),a.push(_.on("spanEnd",J=>{r||ue(J.spanContext().spanId)})),a.push(_.on("idleSpanEnableAutoFinish",J=>{J===W&&(i=!0,$(),n.size&&q())})),t.disableAutoFinish||$(),setTimeout(()=>{r||(W.setStatus({code:un,message:"deadline_exceeded"}),s=$E,W.end())},u),W}function OE(e){const t=is(e);return Ci($t(),t),Be&&Ee.log("[Tracing] Started span is an idle span"),t}function LE(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;DE(e,t),r&&BE(e,r),UE(e,n),jE(e,o),FE(e,s)}function Zh(e,t){const{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:l,breadcrumbs:u,fingerprint:d,eventProcessors:p,attachments:g,propagationContext:_,transactionName:I,span:R}=t;sa(e,"extra",n),sa(e,"tags",r),sa(e,"attributes",o),sa(e,"user",s),sa(e,"contexts",i),e.sdkProcessingMetadata=za(e.sdkProcessingMetadata,l,2),a&&(e.level=a),I&&(e.transactionName=I),R&&(e.span=R),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),p.length&&(e.eventProcessors=[...e.eventProcessors,...p]),g.length&&(e.attachments=[...e.attachments,...g]),e.propagationContext={...e.propagationContext,..._}}function sa(e,t,n){e[t]=za(e[t],n,1)}function Gy(e,t){const n=y0().getScopeData();return e&&Zh(n,e.getScopeData()),t&&Zh(n,t.getScopeData()),n}function DE(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 jE(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function FE(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function BE(e,t){e.contexts={trace:q0(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ss(t),...e.sdkProcessingMetadata};const n=Pn(t),r=yt(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 Qu=0,em=1,tm=2;function Ja(e){return new $a(t=>{t(e)})}function lp(e){return new $a((t,n)=>{n(e)})}class $a{constructor(t){this._state=Qu,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===Qu)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===em&&n[1](this._value),this._state===tm&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(s,i)=>{if(this._state===Qu){if(Li(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(em,s)},o=s=>{n(tm,s)};try{t(r,o)}catch(s){o(s)}}}function qE(e,t,n,r=0){try{const o=rf(t,n,e,r);return Li(o)?o:Ja(o)}catch(o){return lp(o)}}function rf(e,t,n,r){const o=n[r];if(!e||!o)return e;const s=o({...e},t);return Be&&s===null&&Ee.log(`Event processor "${o.id||"?"}" dropped event`),Li(s)?s.then(i=>rf(i,t,n,r+1)):rf(s,t,n,r+1)}let go,nm,rm,zo;function HE(e){const t=gt._sentryDebugIds,n=gt._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(zo&&r.length===nm&&o.length===rm)return zo;nm=r.length,rm=o.length,zo={},go||(go={});const s=(i,a)=>{for(const l of i){const u=a[l],d=go==null?void 0:go[l];if(d&&zo&&u)zo[d[0]]=u,go&&(go[l]=[d[0],u]);else if(u){const p=e(l);for(let g=p.length-1;g>=0;g--){const _=p[g],I=_==null?void 0:_.filename;if(I&&zo&&go){zo[I]=u,go[l]=[I,u];break}}}}};return t&&s(r,t),n&&s(o,n),zo}function WE(e,t,n,r,o,s){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,l={...t,event_id:t.event_id||n.event_id||wr(),timestamp:t.timestamp||zs()},u=n.integrations||e.integrations.map(M=>M.name);VE(l,e),KE(l,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&zE(l,e.stackParser);const d=JE(r,n.captureContext);n.mechanism&&ki(l,n.mechanism);const p=o?o.getEventProcessors():[],g=Gy(s,d),_=[...n.attachments||[],...g.attachments];_.length&&(n.attachments=_),LE(l,g);const I=[...p,...g.eventProcessors];return(n.data&&n.data.__sentry__===!0?Ja(l):qE(I,l,n)).then(M=>(M&&GE(M),typeof i=="number"&&i>0?YE(M,i,a):M))}function VE(e,t){var a,l;const{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||op,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);const i=e.request;i!=null&&i.url&&s&&(i.url=Kd(i.url,s)),s&&((l=(a=e.exception)==null?void 0:a.values)==null||l.forEach(u=>{u.value&&(u.value=Kd(u.value,s))}))}function zE(e,t){var r,o;const n=HE(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 KE(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:_o(i.data,t,n)}}))},...e.user&&{user:_o(e.user,t,n)},...e.contexts&&{contexts:_o(e.contexts,t,n)},...e.extra&&{extra:_o(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=_o(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:_o(i.data,t,n)}}))),(s=e.contexts)!=null&&s.flags&&r.contexts&&(r.contexts.flags=_o(e.contexts.flags,3,n)),r}function JE(e,t){if(!t)return e;const n=e?e.clone():new ao;return n.update(t),n}function XE(e){if(e)return QE(e)?{captureContext:e}:ek(e)?{captureContext:e}:e}function QE(e){return e instanceof ao||typeof e=="function"}const ZE=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function ek(e){return Object.keys(e).some(t=>ZE.includes(t))}function cp(e,t){return $t().captureException(e,XE(t))}function Ky(e,t){return $t().captureEvent(e,t)}function tk(e,t){qr().setContext(e,t)}function nk(e,t){qr().setTag(e,t)}function rk(){const e=At();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function om(e){const t=qr(),{user:n}=Gy(t,$t()),{userAgent:r}=gt.navigator||{},o=a0({user:n,...r&&{userAgent:r},...e}),s=t.getSession();return(s==null?void 0:s.status)==="ok"&&Ii(s,{status:"exited"}),Yy(),t.setSession(o),o}function Yy(){const e=qr(),n=$t().getSession()||e.getSession();n&&l0(n),Jy(),e.setSession()}function Jy(){const e=qr(),t=At(),n=e.getSession();n&&t&&t.captureSession(n)}function Zu(e=!1){if(e){Yy();return}Jy()}const ok="7";function sk(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function ik(e){return`${sk(e)}${e.projectId}/envelope/`}function ak(e,t){const n={sentry_version:ok};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function lk(e,t,n){return t||`${ik(e)}?${ak(e,n)}`}const sm=[];function ck(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 uk(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 ck(r)}function dk(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Xy(e,r,n)}),n}function im(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function Xy(e,t,n){if(n[t.name]){Be&&Ee.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!sm.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),sm.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)}Be&&Ee.log(`Integration installed: ${t.name}`)}function fk(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function pk(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=Fi(r)),Gs(o,[fk(e)])}function of(e,t){const n=t??hk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=pk(n,r._metadata,r.tunnel,e.getDsn());Qy().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function hk(e){return Qy().get(e)}function Qy(){return Ni("clientToLogBufferMap",()=>new WeakMap)}function mk(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function gk(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=Fi(r)),Gs(o,[mk(e)])}function Zy(e,t){const n=t??vk(e)??[];if(n.length===0)return;const r=e.getOptions(),o=gk(n,r._metadata,r.tunnel,e.getDsn());e_().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function vk(e){return e_().get(e)}function e_(){return Ni("clientToMetricBufferMap",()=>new WeakMap)}function t_(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const up=Symbol.for("SentryBufferFullError");function dp(e=100){const t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return lp(up);const a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Ja(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;const l=[a,new Promise(u=>t_(setTimeout(()=>u(!1),i)))];return Promise.race(l)}return{get $(){return Array.from(t)},add:o,drain:s}}const yk=60*1e3;function _k(e,t=Va()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?yk:r-t}function bk(e,t){return e[t]||e.all||0}function wk(e,t,n=Va()){return bk(e,t)>n}function Sk(e,{statusCode:t,headers:n},r=Va()){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,u,,,d]=a.split(":",5),p=parseInt(l,10),g=(isNaN(p)?60:p)*1e3;if(!u)o.all=r+g;else for(const _ of u.split(";"))_==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(o[_]=r+g):o[_]=r+g}else i?o.all=r+_k(i,r):t===429&&(o.all=r+60*1e3);return o}const n_=64;function Tk(e,t,n=dp(e.bufferSize||n_)){let r={};const o=i=>n.drain(i);function s(i){const a=[];if(ef(i,(p,g)=>{const _=Gh(g);wk(r,_)?e.recordDroppedEvent("ratelimit_backoff",_):a.push(p)}),a.length===0)return Promise.resolve({});const l=Gs(i[0],a),u=p=>{if(aE(l,["client_report"])){Be&&Ee.warn(`Dropping client report. Will not send outcomes (reason: ${p}).`);return}ef(l,(g,_)=>{e.recordDroppedEvent(p,Gh(_))})},d=()=>t({body:lE(l)}).then(p=>p.statusCode===413?(Be&&Ee.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),p):(Be&&p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&Ee.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),r=Sk(r,p),p),p=>{throw u("network_error"),Be&&Ee.error("Encountered error running transport request:",p),p});return n.add(d).then(p=>p,p=>{if(p===up)return Be&&Ee.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw p})}return{send:s,flush:o}}function Ek(e,t,n){const r=[{type:"client_report"},{timestamp:zs(),discarded_events:e}];return Gs(t?{dsn:t}:{},[r])}function r_(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 kk(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[rp],exclusive_time:i==null?void 0:i[ji],measurements:e.measurements,is_segment:!0}}function Ik(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&&{[rp]:e.profile_id},...e.exclusive_time&&{[ji]:e.exclusive_time}}}},measurements:e.measurements}}const am="Not capturing exception because it's already been captured.",lm="Discarded session because of missing or non-string release",o_=Symbol.for("SentryInternalError"),s_=Symbol.for("SentryDoNotSendEventError"),Ck=5e3;function Gl(e){return{message:e,[o_]:!0}}function ed(e){return{message:e,[s_]:!0}}function cm(e){return!!e&&typeof e=="object"&&o_ in e}function um(e){return!!e&&typeof e=="object"&&s_ in e}function dm(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=t_(setTimeout(()=>{o(e)},Ck)))}),e.on("flush",()=>{o(e)})}class Ak{constructor(t){var r,o,s;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=dp(((r=t.transportOptions)==null?void 0:r.bufferSize)??n_),t.dsn?this._dsn=D0(t.dsn):Be&&Ee.warn("No DSN provided, client will not send events."),this._dsn){const i=lk(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&&dm(this,"afterCaptureLog","flushLogs",Pk,of),(this._options.enableMetrics??((s=this._options._experiments)==null?void 0:s.enableMetrics)??!0)&&dm(this,"afterCaptureMetric","flushMetrics",Mk,Zy)}captureException(t,n,r){const o=wr();if(Dh(t))return Be&&Ee.log(am),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:wr(),...r},i=Qf(t)?t:String(t),a=Ei(t),l=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>l.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){const o=wr();if(n!=null&&n.originalException&&Dh(n.originalException))return Be&&Ee.log(am),o;const s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,l=i.capturedSpanIsolationScope,u=fm(t.type);return this._process(()=>this._captureEvent(t,s,a||r,l),u),s.event_id}captureSession(t){this.sendSession(t),Ii(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){of(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),Xy(this,t,this._integrations),n||im(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=gE(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=iE(r,dE(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:r=op}=this._options;if("aggregates"in t){const s=t.attrs||{};if(!s.release&&!n){Be&&Ee.warn(lm);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){Be&&Ee.warn(lm);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const o=mE(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}`;Be&&Ee.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 Be&&Ee.error("Error while sending envelope:",n),{}}return Be&&Ee.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=dk(this,t),im(this,t)}_updateSessionFromEvent(t,n){var l,u;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(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Ii(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),WE(s,t,n,r,this,o).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(u=a.contexts)==null?void 0:u.trace,..._0(r)},...a.contexts};const l=jy(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=$t(),o=qr()){return Be&&sf(t)&&Ee.log(`Captured error event \`${r_(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{Be&&(um(s)?Ee.log(s.message):cm(s)?Ee.warn(s.message):Ee.warn(s))})}_processEvent(t,n,r,o){const s=this.getOptions(),{sampleRate:i}=s,a=i_(t),l=sf(t),d=`before send for type \`${t.type||"error"}\``,p=typeof i>"u"?void 0:Ma(i);if(l&&typeof p=="number"&&es()>p)return this.recordDroppedEvent("sample_rate","error"),lp(ed(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const g=fm(t.type);return this._prepareEvent(t,n,r,o).then(_=>{var W;if(_===null)throw this.recordDroppedEvent("event_processor",g),ed("An event processor returned `null`, will not send event.");if(((W=n.data)==null?void 0:W.__sentry__)===!0)return _;const R=Rk(this,s,_,n);return xk(R,d)}).then(_=>{var W;if(_===null){if(this.recordDroppedEvent("before_send",g),a){const $=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",$)}throw ed(`${d} returned \`null\`, will not send event.`)}const I=r.getSession()||o.getSession();if(l&&I&&this._updateSessionFromEvent(I,_),a){const M=((W=_.sdkProcessingMetadata)==null?void 0:W.spanCountBeforeProcessing)||0,$=_.spans?_.spans.length:0,q=M-$;q>0&&this.recordDroppedEvent("before_send","span",q)}const R=_.transaction_info;if(a&&R&&_.transaction!==t.transaction){const M="custom";_.transaction_info={...R,source:M}}return this.sendEvent(_,n),_}).then(null,_=>{throw um(_)||cm(_)?_:(this.captureException(_,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:_}),Gl(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
27
+ Reason: ${_}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===up&&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(){Be&&Ee.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Be&&Ee.log("No outcomes to send");return}if(!this._dsn){Be&&Ee.log("No dsn provided, will not send outcomes");return}Be&&Ee.log("Sending outcomes:",t);const n=Ek(t,this._options.tunnel&&Fi(this._dsn));this.sendEnvelope(n)}}function fm(e){return e==="replay_event"?"replay":e||"error"}function xk(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Li(e))return e.then(r=>{if(!xa(r)&&r!==null)throw Gl(n);return r},r=>{throw Gl(`${t} rejected with ${r}`)});if(!xa(e)&&e!==null)throw Gl(n);return e}function Rk(e,t,n,r){const{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Fy(t.beforeSendSpan)&&t.beforeSendSpan;let l=n;if(sf(l)&&o)return o(l,r);if(i_(l)){if(a||i){const u=kk(l);if(i!=null&&i.length&&Pa(u,i))return null;if(a){const d=a(u);d?l=za(n,Ik(d)):Qd()}if(l.spans){const d=[],p=l.spans;for(const _ of p){if(i!=null&&i.length&&Pa(_,i)){Z0(p,_);continue}if(a){const I=a(_);I?d.push(I):(Qd(),d.push(_))}else d.push(_)}const g=l.spans.length-d.length;g&&e.recordDroppedEvent("before_send","span",g),l.spans=d}}if(s){if(l.spans){const u=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(l,r)}}return l}function sf(e){return e.type===void 0}function i_(e){return e.type==="transaction"}function Mk(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+a_(e.attributes)}function Pk(e){let t=0;return e.message&&(t+=e.message.length*2),t+a_(e.attributes)}function a_(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*pm(n[0]):Ei(n)?t+=pm(n):t+=100}),t}function pm(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function $k(e){return Nc(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function hm(e){return $k(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Nk(e,t){t.debug===!0&&(Be?Ee.enable():Do(()=>{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 Lk="thismessage:/";function l_(e){return"isRelative"in e}function c_(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Lk: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 Dk(e){if(l_(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 qs(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 jk(e){return e.split(/[?#]/,1)[0]}function ns(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 Fk(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 u_(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:Fs})),o.version=Fs)}function d_(e={}){const t=e.client||At();if(!rk()||!t)return{};const n=Vs(),r=Di(n);if(r.getTraceData)return r.getTraceData(e);const o=e.scope||$t(),s=e.span||ir(),i=s?H0(s):Bk(o),a=s?ss(s):jy(t,o),l=C0(a);if(!xy.test(i))return Ee.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:l};return e.propagateTraceparent&&(d.traceparent=s?W0(s):Uk(o)),d}function Bk(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 My(t,r,n)}const qk=100;function hr(e,t){const n=At(),r=qr();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=qk}=n.getOptions();if(s<=0)return;const a={timestamp:zs(),...e},l=o?Do(()=>o(a,t)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,t),r.addBreadcrumb(l,s))}let mm;const Hk="FunctionToString",gm=new WeakMap,Wk=(()=>({name:Hk,setupOnce(){mm=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=tp(this),n=gm.has(At())&&t!==void 0?t:this;return mm.apply(n,e)}}catch{}},setup(e){gm.set(e,!0)}})),Vk=Wk,zk=[/^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",Kk=(e={})=>{let t;return{name:Gk,setup(n){const r=n.getOptions();t=vm(e,r)},processEvent(n,r,o){if(!t){const s=o.getOptions();t=vm(e,s)}return Jk(n,t)?null:n}}},Yk=((e={})=>({...Kk(e),name:"InboundFilters"}));function vm(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:zk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Jk(e,t){if(e.type){if(e.type==="transaction"&&Qk(e,t.ignoreTransactions))return Be&&Ee.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
28
+ Event: ${$s(e)}`),!0}else{if(Xk(e,t.ignoreErrors))return Be&&Ee.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
29
+ Event: ${$s(e)}`),!0;if(nI(e))return Be&&Ee.warn(`Event dropped due to not having an error message, error type or stacktrace.
30
+ Event: ${$s(e)}`),!0;if(Zk(e,t.denyUrls))return Be&&Ee.warn(`Event dropped due to being matched by \`denyUrls\` option.
31
+ Event: ${$s(e)}.
32
+ Url: ${uc(e)}`),!0;if(!eI(e,t.allowUrls))return Be&&Ee.warn(`Event dropped due to not being matched by \`allowUrls\` option.
33
+ Event: ${$s(e)}.
34
+ Url: ${uc(e)}`),!0}return!1}function Xk(e,t){return t!=null&&t.length?r_(e).some(n=>ts(n,t)):!1}function Qk(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?ts(n,t):!1}function Zk(e,t){if(!(t!=null&&t.length))return!1;const n=uc(e);return n?ts(n,t):!1}function eI(e,t){if(!(t!=null&&t.length))return!0;const n=uc(e);return n?ts(n,t):!0}function tI(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 uc(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?tI(o):null}catch{return Be&&Ee.error(`Cannot extract url for event ${$s(e)}`),null}}function nI(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 rI(e,t,n,r,o,s){var a;if(!((a=o.exception)!=null&&a.values)||!s||!Po(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=af(e,t,r,s.originalException,n,o.exception.values,i,0))}function af(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let l=[...s];if(Po(r[o],Error)){ym(i,a,r);const u=e(t,r[o]),d=l.length;_m(u,o,d,a),l=af(e,t,n,r[o],o,[u,...l],u,d)}return f_(r)&&r.errors.forEach((u,d)=>{if(Po(u,Error)){ym(i,a,r);const p=e(t,u),g=l.length;_m(p,`errors[${d}]`,g,a),l=af(e,t,n,u,o,[p,...l],p,g)}}),l}function f_(e){return Array.isArray(e.errors)}function ym(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...f_(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function _m(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function oI(e){const t="console";us(t,e),ds(t,sI)}function sI(){"console"in gt&&jT.forEach(function(e){e in gt.console&&pr(gt.console,e,function(t){return ic[e]=t,function(...n){br("console",{args:n,level:e});const o=ic[e];o==null||o.apply(gt.console,n)}})})}function iI(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const aI="Dedupe",lI=(()=>{let e;return{name:aI,processEvent(t){if(t.type)return t;try{if(uI(t,e))return Be&&Ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),cI=lI;function uI(e,t){return t?!!(dI(e,t)||fI(e,t)):!1}function dI(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!h_(e,t)||!p_(e,t))}function fI(e,t){const n=bm(t),r=bm(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!h_(e,t)||!p_(e,t))}function p_(e,t){let n=Mh(e),r=Mh(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 h_(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 bm(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const pI="ConversationId",hI=(()=>({name:pI,setup(e){e.on("spanStart",t=>{const n=$t().getScopeData(),r=qr().getScopeData(),o=n.conversationId||r.conversationId;o&&t.setAttribute(w0,o)})}})),mI=hI;function gI(e,t,n,r,o){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,a=Sr()&&t(i);if(e.endTimestamp){const _=e.fetchData.__span;if(!_)return;const I=r[_];I&&(a&&(_I(I,e),vI(I,e,o)),delete r[_]);return}const{spanOrigin:l="auto.http.browser",propagateTraceparent:u=!1}=typeof o=="object"?o:{spanOrigin:o},d=!!ir(),p=a&&d?is(wI(i,s,l)):new Tr;if(e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){const _=e.args[0],I={...e.args[1]||{}},R=yI(_,I,Sr()&&d?p:void 0,u);R&&(e.args[1]=I,I.headers=R)}const g=At();if(g){const _={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};g.emit("beforeOutgoingRequestSpan",p,_)}return p}function vI(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 yI(e,t,n,r){const o=d_({span:n,propagateTraceparent:r}),s=o["sentry-trace"],i=o.baggage,a=o.traceparent;if(!s)return;const l=t.headers||(Zf(e)?e.headers:void 0);if(l)if(bI(l)){const u=new Headers(l);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&a&&!u.get("traceparent")&&u.set("traceparent",a),i){const d=u.get("baggage");d?Al(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(Array.isArray(l)){const u=[...l];l.find(p=>p[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&a&&!l.find(p=>p[0]==="traceparent")&&u.push(["traceparent",a]);const d=l.find(p=>p[0]==="baggage"&&Al(p[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in l?l["sentry-trace"]:void 0,d="traceparent"in l?l.traceparent:void 0,p="baggage"in l?l.baggage:void 0,g=p?Array.isArray(p)?[...p]:[p]:[],_=p&&(Array.isArray(p)?p.find(R=>Al(R)):Al(p));i&&!_&&g.push(i);const I={...l,"sentry-trace":u??s,baggage:g.length>0?g.join(","):void 0};return r&&a&&!d&&(I.traceparent=a),I}else return{...o}}function _I(e,t){var n,r;if(t.response){Ey(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:un,message:"internal_error"});e.end()}function Al(e){return e.split(",").some(t=>t.trim().startsWith(cc))}function bI(e){return typeof Headers<"u"&&Po(e,Headers)}function wI(e,t,n){if(e.startsWith("data:")){const s=ns(e);return{name:`${t} ${s}`,attributes:wm(e,void 0,t,n)}}const r=c_(e),o=r?Dk(r):e;return{name:`${t} ${o}`,attributes:wm(e,r,t,n)}}function wm(e,t,n,r){const o={url:ns(e),type:"fetch","http.method":n,[Jt]:r,[No]:"http.client"};return t&&(l_(t)||(o["http.url"]=ns(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function m_(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Na=gt;function SI(){return"history"in Na&&!!Na.history}function TI(){if(!("fetch"in Na))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function lf(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function EI(){var n;if(typeof EdgeRuntime=="string")return!0;if(!TI())return!1;if(lf(Na.fetch))return!0;let e=!1;const t=Na.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=lf(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){Be&&Ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function g_(e,t){const n="fetch";us(n,e),ds(n,()=>v_(void 0,t))}function kI(e){const t="fetch-body-resolved";us(t,e),ds(t,()=>v_(CI))}function v_(e,t=!1){t&&!EI()||pr(gt,"fetch",function(n){return function(...r){const o=new Error,{method:s,url:i}=AI(r),a={args:r,fetchData:{method:s,url:i},startTimestamp:tn()*1e3,virtualError:o,headers:xI(r)};return e||br("fetch",{...a}),n.apply(gt,r).then(async l=>(e?e(l):br("fetch",{...a,endTimestamp:tn()*1e3,response:l}),l),l=>{br("fetch",{...a,endTimestamp:tn()*1e3,error:l}),Nc(l)&&l.stack===void 0&&(l.stack=o.stack,sr(l,"framesToPop",1));const u=At(),d=(u==null?void 0:u.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 _=new URL(a.fetchData.url).host;d==="always"?l.message=`${l.message} (${_})`:sr(l,"__sentry_fetch_url_host__",_)}catch{}throw l})}})}async function II(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 CI(e){let t;try{t=e.clone()}catch{return}II(t,()=>{br("fetch-body-resolved",{endTimestamp:tn()*1e3,response:e})})}function Kl(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Sm(e){return typeof e=="string"?e:e?Kl(e,"url")?e.url:e.toString?e.toString():"":""}function AI(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Sm(n),method:Kl(r,"method")?String(r.method).toUpperCase():Zf(n)&&Kl(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Sm(t),method:Kl(t,"method")?String(t.method).toUpperCase():"GET"}}function xI(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Zf(t))return new Headers(t.headers)}catch{}}function RI(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function MI(){return"npm"}function PI(){return!RI()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function $I(){return typeof window<"u"&&(!PI()||NI())}function NI(){const e=gt.process;return(e==null?void 0:e.type)==="renderer"}const at=gt;let cf=0;function y_(){return cf>0}function OI(){cf++,setTimeout(()=>{cf--})}function xi(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(tp(e))return e}catch{return e}const r=function(...o){try{const s=o.map(i=>xi(i,t));return e.apply(this,s)}catch(s){throw OI(),Lc(i=>{i.addEventProcessor(a=>(t.mechanism&&(Yd(a,void 0),ki(a,t.mechanism)),a.extra={...a.extra,arguments:o},a)),cp(s)}),s}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}gy(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 fp(){const e=Ha(),{referrer:t}=at.document||{},{userAgent:n}=at.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}function pp(e,t){const n=hp(e,t),r={type:BI(t),value:UI(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function LI(e,t,n,r){const o=At(),s=o==null?void 0:o.getOptions().normalizeDepth,i=zI(t),a={__serialized__:By(t,s)};if(i)return{exception:{values:[pp(e,i)]},extra:a};const l={exception:{values:[{type:Oc(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:WI(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=hp(e,n);u.length&&(l.exception.values[0].stacktrace={frames:u})}return l}function td(e,t){return{exception:{values:[pp(e,t)]}}}function hp(e,t){const n=t.stacktrace||t.stack||"",r=jI(t),o=FI(t);try{return e(n,r,o)}catch{}return[]}const DI=/Minified React error #\d+;/i;function jI(e){return e&&DI.test(e.message)?1:0}function FI(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function __(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function BI(e){const t=e==null?void 0:e.name;return!t&&__(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 __(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?hm(t.error):hm(e):"No error message"}function qI(e,t,n,r){const o=(n==null?void 0:n.syntheticException)||void 0,s=mp(e,t,o,r);return ki(s),s.level="error",n!=null&&n.event_id&&(s.event_id=n.event_id),Ja(s)}function HI(e,t,n="info",r,o){const s=(r==null?void 0:r.syntheticException)||void 0,i=uf(e,t,s,o);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),Ja(i)}function mp(e,t,n,r,o){let s;if(py(t)&&t.error)return td(e,t.error);if($h(t)||YT(t)){const i=t;if("stack"in t)s=td(e,t);else{const a=i.name||($h(i)?"DOMError":"DOMException"),l=i.message?`${a}: ${i.message}`:a;s=uf(e,l,n,r),Yd(s,l)}return"code"in i&&(s.tags={...s.tags,"DOMException.code":`${i.code}`}),s}return Nc(t)?td(e,t):xa(t)||Oc(t)?(s=LI(e,t,n,o),ki(s,{synthetic:!0}),s):(s=uf(e,t,n,r),Yd(s,`${t}`),ki(s,{synthetic:!0}),s)}function uf(e,t,n,r){const o={};if(r&&n){const s=hp(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),ki(o,{synthetic:!0})}if(Qf(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 WI(e,{isUnhandledRejection:t}){const n=t0(e),r=t?"promise rejection":"exception";return py(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Oc(e)?`Event \`${VI(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function VI(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function zI(e){return Object.values(e).find(t=>t instanceof Error)}class GI extends Ak{constructor(t){var d;const n=KI(t),r=at.SENTRY_SDK_SOURCE||MI();u_(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,u=l??(a==null?void 0:a.enableMetrics)??!0;at.document&&(s||i||u)&&at.document.addEventListener("visibilitychange",()=>{at.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),i&&of(this),u&&Zy(this))}),o&&this.on("beforeSendSession",Fk)}eventFromException(t,n){return qI(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return HI(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 KI(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=at.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const Xa=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xe=gt,YI=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Qa=(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)))}},Za=(e=!0)=>{var n,r;const t=(r=(n=Xe.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},Bi=()=>{const e=Za();return(e==null?void 0:e.activationStart)??0};function rs(e,t,n){Xe.document&&Xe.addEventListener(e,t,n)}function dc(e,t,n){Xe.document&&Xe.removeEventListener(e,t,n)}let bi=-1;const b_=new Set,JI=()=>{var e,t;return((e=Xe.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=Xe.document)!=null&&t.prerendering)?0:1/0},Yl=e=>{if(XI(e)&&bi>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of b_)t();isFinite(bi)||(bi=e.type==="visibilitychange"?e.timeStamp:0,dc("prerenderingchange",Yl,!0))}},el=()=>{var e;if(Xe.document&&bi<0){const t=Bi();bi=(Xe.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??JI(),rs("visibilitychange",Yl,!0),rs("pagehide",Yl,!0),rs("prerenderingchange",Yl,!0)}return{get firstHiddenTime(){return bi},onHidden(t){b_.add(t)}}};function XI(e){var t;return e.type==="pagehide"||((t=Xe.document)==null?void 0:t.visibilityState)==="hidden"}const QI=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,tl=(e,t=-1)=>{var s,i;const n=Za();let r="navigate";return n&&((s=Xe.document)!=null&&s.prerendering||Bi()>0?r="prerender":(i=Xe.document)!=null&&i.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:QI(),navigationType:r}},nd=new WeakMap;function gp(e,t){try{return nd.get(e)||nd.set(e,new t),nd.get(e)}catch{return new t}}class fc{constructor(){fc.prototype.__init.call(this),fc.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 Ui=(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{}},vp=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Bc=e=>{var t;(t=Xe.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},ZI=[1800,3e3],eC=(e,t={})=>{Bc(()=>{const n=el(),r=tl("FCP");let o;const i=Ui("paint",a=>{for(const l of a)l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Bi(),0),r.entries.push(l),o(!0)))});i&&(o=Qa(e,r,ZI,t.reportAllChanges))})},tC=[.1,.25],nC=(e,t={})=>{eC(vp(()=>{var l;const n=tl("CLS",0);let r;const o=el(),s=gp(t,fc),i=u=>{for(const d of u)s._processEntry(d);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},a=Ui("layout-shift",i);a&&(r=Qa(e,n,tC,t.reportAllChanges),o.onHidden(()=>{i(a.takeRecords()),r(!0)}),(l=Xe==null?void 0:Xe.setTimeout)==null||l.call(Xe,r))}))};let w_=0,rd=1/0,xl=0;const rC=e=>{e.forEach(t=>{t.interactionId&&(rd=Math.min(rd,t.interactionId),xl=Math.max(xl,t.interactionId),w_=xl?(xl-rd)/7+1:0)})};let df;const S_=()=>df?w_:performance.interactionCount||0,oC=()=>{"interactionCount"in performance||df||(df=Ui("event",rC,{type:"event",buffered:!0,durationThreshold:0}))},od=10;let T_=0;const sC=()=>S_()-T_;class pc{constructor(){pc.prototype.__init.call(this),pc.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){T_=S_(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(sC()/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<od||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>od){const i=this._longestInteractionList.splice(od);for(const a of i)this._longestInteractionMap.delete(a.id)}(s=this._onAfterProcessingINPCandidate)==null||s.call(this,r)}}}const E_=e=>{var n;const t=Xe.requestIdleCallback||Xe.setTimeout;((n=Xe.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=vp(e),rs("visibilitychange",e,{once:!0,capture:!0}),rs("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),dc("visibilitychange",e,{capture:!0}),dc("pagehide",e,{capture:!0})}))},iC=[200,500],aC=40,lC=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=el();Bc(()=>{oC();const r=tl("INP");let o;const s=gp(t,pc),i=l=>{E_(()=>{for(const d of l)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,o())})},a=Ui("event",i,{durationThreshold:t.durationThreshold??aC});o=Qa(e,r,iC,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(a.takeRecords()),o(!0)}))})};class cC{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const uC=[2500,4e3],dC=(e,t={})=>{Bc(()=>{const n=el(),r=tl("LCP");let o;const s=gp(t,cC),i=l=>{t.reportAllChanges||(l=l.slice(-1));for(const u of l)s._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-Bi(),0),r.entries=[u],o())},a=Ui("largest-contentful-paint",i);if(a){o=Qa(e,r,uC,t.reportAllChanges);const l=vp(()=>{i(a.takeRecords()),a.disconnect(),o(!0)}),u=d=>{d.isTrusted&&(E_(l),dc(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])rs(d,u,{capture:!0})}})},fC=[800,1800],ff=e=>{var t,n;(t=Xe.document)!=null&&t.prerendering?Bc(()=>ff(e)):((n=Xe.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>ff(e),!0):setTimeout(e)},pC=(e,t={})=>{const n=tl("TTFB"),r=Qa(e,n,fC,t.reportAllChanges);ff(()=>{const o=Za();o&&(n.value=Math.max(o.responseStart-Bi(),0),n.entries=[o],r(!0))})},va={},hc={};let k_,I_,C_,A_;function x_(e,t=!1){return Uc("cls",e,gC,k_,t)}function R_(e,t=!1){return Uc("lcp",e,vC,I_,t)}function hC(e){return Uc("ttfb",e,yC,C_)}function mC(e){return Uc("inp",e,_C,A_)}function Oa(e,t){return M_(e,t),hc[e]||(bC(e),hc[e]=!0),P_(e,t)}function nl(e,t){const n=va[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(o){Xa&&Ee.error(`Error while triggering instrumentation handler.
35
+ Type: ${e}
36
+ Name: ${Mo(r)}
37
+ Error:`,o)}}function gC(){return nC(e=>{nl("cls",{metric:e}),k_=e},{reportAllChanges:!0})}function vC(){return dC(e=>{nl("lcp",{metric:e}),I_=e},{reportAllChanges:!0})}function yC(){return pC(e=>{nl("ttfb",{metric:e}),C_=e})}function _C(){return lC(e=>{nl("inp",{metric:e}),A_=e})}function Uc(e,t,n,r,o=!1){M_(e,t);let s;return hc[e]||(s=n(),hc[e]=!0),r&&t({metric:r}),P_(e,t,o?s:void 0)}function bC(e){const t={};e==="event"&&(t.durationThreshold=0),Ui(e,n=>{nl(e,{entries:n})},t)}function M_(e,t){va[e]=va[e]||[],va[e].push(t)}function P_(e,t,n){return()=>{n&&n();const r=va[e];if(!r)return;const o=r.indexOf(t);o!==-1&&r.splice(o,1)}}function wC(e){return"duration"in e}const SC=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=Xe.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};rs("visibilitychange",t,{capture:!0,once:!0}),rs("pagehide",t,{capture:!0,once:!0})};function sd(e){return typeof e=="number"&&isFinite(e)}function as(e,t,n,{...r}){const o=yt(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),sp(e,()=>{const s=is({startTime:t,...r});return s&&s.end(n),s})}function yp(e){var W;const t=At();if(!t)return;const{name:n,transaction:r,attributes:o,startTime:s}=e,{release:i,environment:a,sendDefaultPii:l}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),p=$t(),g=p.getUser(),_=g!==void 0?g.email||g.id||g.ip_address:void 0;let I;try{I=p.getScopeData().contexts.profile.profile_id}catch{}const R={release:i,environment:a,user:_||void 0,profile_id:I||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(W=Xe.navigator)==null?void 0:W.userAgent,"client.address":l?"{{auto}}":void 0,...o};return is({name:n,attributes:R,startTime:s,experimental:{standalone:!0}})}function qc(){return Xe.addEventListener&&Xe.performance}function dn(e){return e/1e3}function TC(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 $_(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function N_(e,t){let n,r=!1;function o(a){!r&&n&&t(a,n),r=!0}SC(()=>{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 EC(e){let t=0,n;if(!$_("layout-shift"))return;const r=x_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);N_(e,(o,s)=>{kC(t,n,s,o),r()})}function kC(e,t,n,r){var u;Xa&&Ee.log(`Sending CLS span (${e})`);const o=t?dn((kr()||0)+t.startTime):tn(),s=$t().getScopeData().transactionName,i=t?Er((u=t.sources[0])==null?void 0:u.node):"Layout shift",a={[Jt]:"auto.http.browser.cls",[No]:"ui.webvital.cls",[ji]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,p)=>{a[`cls.source.${p+1}`]=Er(d.node)});const l=yp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("cls",{[Ga]:"",[Ka]:e}),l.end(o))}function IC(e){let t=0,n;if(!$_("largest-contentful-paint"))return;const r=R_(({metric:o})=>{const s=o.entries[o.entries.length-1];s&&(t=o.value,n=s)},!0);N_(e,(o,s)=>{CC(t,n,s,o),r()})}function CC(e,t,n,r){Xa&&Ee.log(`Sending LCP span (${e})`);const o=dn((kr()||0)+((t==null?void 0:t.startTime)||0)),s=$t().getScopeData().transactionName,i=t?Er(t.element):"Largest contentful paint",a={[Jt]:"auto.http.browser.lcp",[No]:"ui.webvital.lcp",[ji]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=Er(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=yp({name:i,transaction:s,attributes:a,startTime:o});l&&(l.addEvent("lcp",{[Ga]:"millisecond",[Ka]:e}),l.end(o))}function vr(e){return e&&((kr()||performance.timeOrigin)+e)/1e3}function O_(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:o}=TC(e.nextHopProtocol);t["network.protocol.version"]=o,t["network.protocol.name"]=r}return kr()||(n=qc())!=null&&n.timeOrigin?AC({...t,"http.request.redirect_start":vr(e.redirectStart),"http.request.redirect_end":vr(e.redirectEnd),"http.request.worker_start":vr(e.workerStart),"http.request.fetch_start":vr(e.fetchStart),"http.request.domain_lookup_start":vr(e.domainLookupStart),"http.request.domain_lookup_end":vr(e.domainLookupEnd),"http.request.connect_start":vr(e.connectStart),"http.request.secure_connection_start":vr(e.secureConnectionStart),"http.request.connection_end":vr(e.connectEnd),"http.request.request_start":vr(e.requestStart),"http.request.response_start":vr(e.responseStart),"http.request.response_end":vr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function AC(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const xC=2147483647;let Tm=0,Nr={},nr,fi;function RC({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=qc();if(r&&kr()){r.mark&&Xe.performance.mark("sentry-tracing-init");const o=t?IC(n):OC(),s=LC(),i=e?EC(n):NC();return()=>{o==null||o(),s(),i==null||i()}}return()=>{}}function MC(){Oa("longtask",({entries:e})=>{const t=ir();if(!t)return;const{op:n,start_timestamp:r}=yt(t);for(const o of e){const s=dn(kr()+o.startTime),i=dn(o.duration);n==="navigation"&&r&&s<r||as(t,s,s+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[Jt]:"auto.ui.browser.metrics"}})}})}function PC(){new PerformanceObserver(t=>{const n=ir();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const o=dn(kr()+r.startTime),{start_timestamp:s,op:i}=yt(n);if(i==="navigation"&&s&&o<s)continue;const a=dn(r.duration),l={[Jt]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:p,sourceURL:g,sourceFunctionName:_,sourceCharPosition:I}=u;l["browser.script.invoker"]=d,l["browser.script.invoker_type"]=p,g&&(l["code.filepath"]=g),_&&(l["code.function"]=_),I!==-1&&(l["browser.script.source_char_position"]=I),as(n,o,o+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:l})}}).observe({type:"long-animation-frame",buffered:!0})}function $C(){Oa("event",({entries:e})=>{const t=ir();if(t){for(const n of e)if(n.name==="click"){const r=dn(kr()+n.startTime),o=dn(n.duration),s={name:Er(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[Jt]:"auto.ui.browser.metrics"}},i=my(n.target);i&&(s.attributes["ui.component_name"]=i),as(t,r,r+o,s)}}})}function NC(){return x_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Nr.cls={value:e.value,unit:""},fi=t)},!0)}function OC(){return R_(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Nr.lcp={value:e.value,unit:"millisecond"},nr=t)},!0)}function LC(){return hC(({metric:e})=>{e.entries[e.entries.length-1]&&(Nr.ttfb={value:e.value,unit:"millisecond"})})}function DC(e,t){const n=qc(),r=kr();if(!(n!=null&&n.getEntries)||!r)return;const o=dn(r),s=n.getEntries(),{op:i,start_timestamp:a}=yt(e);s.slice(Tm).forEach(l=>{const u=dn(l.startTime),d=dn(Math.max(0,l.duration));if(!(i==="navigation"&&a&&o+u<a))switch(l.entryType){case"navigation":{UC(e,l,o);break}case"mark":case"paint":case"measure":{FC(e,l,u,d,o,t.ignorePerformanceApiSpans);const p=el(),g=l.startTime<p.firstHiddenTime;l.name==="first-paint"&&g&&(Nr.fp={value:l.startTime,unit:"millisecond"}),l.name==="first-contentful-paint"&&g&&(Nr.fcp={value:l.startTime,unit:"millisecond"});break}case"resource":{WC(e,l,l.name,u,d,o,t.ignoreResourceSpans);break}}}),Tm=Math.max(s.length-1,0),VC(e),i==="pageload"&&(KC(Nr),t.recordClsOnPageloadSpan||delete Nr.cls,t.recordLcpOnPageloadSpan||delete Nr.lcp,Object.entries(Nr).forEach(([l,u])=>{bE(l,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",Bi()),zC(e,t)),nr=void 0,fi=void 0,Nr={}}function jC(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function FC(e,t,n,r,o,s){if(jC(t)||["mark","measure"].includes(t.entryType)&&ts(t.name,s))return;const i=Za(!1),a=dn(i?i.requestStart:0),l=o+Math.max(n,a),u=o+n,d=u+r,p={[Jt]:"auto.resource.browser.metrics"};l!==u&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=l),BC(p,t),l<=d&&as(e,l,d,{name:t.name,op:t.entryType,attributes:p})}function BC(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,o]of Object.entries(n))if(o&&Ei(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(Ei(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function UC(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Rl(e,t,r,n)}),Rl(e,t,"secureConnection",n,"TLS/SSL"),Rl(e,t,"fetch",n,"cache"),Rl(e,t,"domainLookup",n,"DNS"),HC(e,t,n)}function Rl(e,t,n,r,o=n){const s=qC(n),i=t[s],a=t[`${n}Start`];!a||!i||as(e,r+dn(a),r+dn(i),{op:`browser.${o}`,name:t.name,attributes:{[Jt]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function qC(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function HC(e,t,n){const r=n+dn(t.requestStart),o=n+dn(t.responseEnd),s=n+dn(t.responseStart);t.responseEnd&&(as(e,r,o,{op:"browser.request",name:t.name,attributes:{[Jt]:"auto.ui.browser.metrics"}}),as(e,s,o,{op:"browser.response",name:t.name,attributes:{[Jt]:"auto.ui.browser.metrics"}}))}function WC(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={[Jt]:"auto.resource.browser.metrics"},u=qs(n);u.protocol&&(l["url.scheme"]=u.protocol.split(":").pop()),u.host&&(l["server.address"]=u.host),l["url.same_origin"]=n.includes(Xe.location.origin),GC(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,...O_(t)},p=s+r,g=p+o;as(e,p,g,{name:n.replace(Xe.location.origin,""),op:a,attributes:d})}function VC(e){const t=Xe.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),sd(n.rtt)&&(Nr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),sd(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),sd(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function zC(e,t){nr&&t.recordLcpOnPageloadSpan&&(nr.element&&e.setAttribute("lcp.element",Er(nr.element)),nr.id&&e.setAttribute("lcp.id",nr.id),nr.url&&e.setAttribute("lcp.url",nr.url.trim().slice(0,200)),nr.loadTime!=null&&e.setAttribute("lcp.loadTime",nr.loadTime),nr.renderTime!=null&&e.setAttribute("lcp.renderTime",nr.renderTime),e.setAttribute("lcp.size",nr.size)),fi!=null&&fi.sources&&t.recordClsOnPageloadSpan&&fi.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Er(n.node)))}function GC(e,t,n){n.forEach(([r,o])=>{const s=e[r];s!=null&&(typeof s=="number"&&s<xC||typeof s=="string")&&(t[o]=s)})}function KC(e){const t=Za(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const YC=1e3;let Em,pf,hf;function JC(e){us("dom",e),ds("dom",XC)}function XC(){if(!Xe.document)return;const e=br.bind(null,"dom"),t=km(e,!0);Xe.document.addEventListener("click",t,!1),Xe.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var s,i;const o=(s=Xe[n])==null?void 0:s.prototype;(i=o==null?void 0:o.hasOwnProperty)!=null&&i.call(o,"addEventListener")&&(pr(o,"addEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=p[l]=p[l]||{refCount:0};if(!g.handler){const _=km(e);g.handler=_,a.call(this,l,_,d)}g.refCount++}catch{}return a.call(this,l,u,d)}}),pr(o,"removeEventListener",function(a){return function(l,u,d){if(l==="click"||l=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},g=p[l];g&&(g.refCount--,g.refCount<=0&&(a.call(this,l,g.handler,d),g.handler=void 0,delete p[l]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,l,u,d)}}))})}function QC(e){if(e.type!==pf)return!1;try{if(!e.target||e.target._sentryId!==hf)return!1}catch{}return!0}function ZC(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function km(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=eA(n);if(ZC(n.type,r))return;sr(n,"_sentryCaptured",!0),r&&!r._sentryId&&sr(r,"_sentryId",wr());const o=n.type==="keypress"?"input":n.type;QC(n)||(e({event:n,name:o,global:t}),pf=n.type,hf=r?r._sentryId:void 0),clearTimeout(Em),Em=Xe.setTimeout(()=>{hf=void 0,pf=void 0},YC)}}function eA(e){try{return e.target}catch{return null}}let Ml;function _p(e){const t="history";us(t,e),ds(t,tA)}function tA(){if(Xe.addEventListener("popstate",()=>{const t=Xe.location.href,n=Ml;if(Ml=t,n===t)return;br("history",{from:n,to:t})}),!SI())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const o=Ml,s=nA(String(r));if(Ml=s,o===s)return t.apply(this,n);br("history",{from:o,to:s})}return t.apply(this,n)}}pr(Xe.history,"pushState",e),pr(Xe.history,"replaceState",e)}function nA(e){try{return new URL(e,Xe.location.origin).toString()}catch{return e}}const Jl={};function rA(e){const t=Jl[e];if(t)return t;let n=Xe[e];if(lf(n))return Jl[e]=n.bind(Xe);const r=Xe.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){Xa&&Ee.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(Jl[e]=n.bind(Xe))}function oA(e){Jl[e]=void 0}const pi="__sentry_xhr_v3__";function L_(e){us("xhr",e),ds("xhr",sA)}function sA(){if(!Xe.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const o=new Error,s=tn()*1e3,i=ko(r[0])?r[0].toUpperCase():void 0,a=iA(r[1]);if(!i||!a)return t.apply(n,r);n[pi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const u=n[pi];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:tn()*1e3,startTimestamp:s,xhr:n,virtualError:o};br("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,p){return l(),u.apply(d,p)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,p){const[g,_]=p,I=d[pi];return I&&ko(g)&&ko(_)&&(I.request_headers[g.toLowerCase()]=_),u.apply(d,p)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const o=n[pi];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const s={startTimestamp:tn()*1e3,xhr:n};return br("xhr",s),t.apply(n,r)}})}function iA(e){if(ko(e))return e;try{return e.toString()}catch{}}function aA(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return Xa&&Ee.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 id=[],Xl=new Map,ii=new Map,lA=60;function cA(){if(qc()&&kr()){const t=uA();return()=>{t()}}return()=>{}}const mf={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 uA(){return mC(dA)}const dA=({metric:e})=>{if(e.value==null)return;const t=dn(e.value);if(t>lA)return;const n=e.entries.find(I=>I.duration===e.value&&mf[I.name]);if(!n)return;const{interactionId:r}=n,o=mf[n.name],s=dn(kr()+n.startTime),i=ir(),a=i?Pn(i):void 0,l=r!=null?Xl.get(r):void 0,u=(l==null?void 0:l.span)||a,d=u?yt(u).description:$t().getScopeData().transactionName,p=(l==null?void 0:l.elementName)||Er(n.target),g={[Jt]:"auto.http.browser.inp",[No]:`ui.interaction.${o}`,[ji]:n.duration},_=yp({name:p,transaction:d,attributes:g,startTime:s});_&&(_.addEvent("inp",{[Ga]:"millisecond",[Ka]:e.value}),_.end(s+t))};function fA(){const e=Object.keys(mf);$I()&&e.forEach(o=>{Xe.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const s=o.target;if(!s)return;const i=Er(s),a=Math.round(o.timeStamp);if(ii.set(a,i),ii.size>50){const l=ii.keys().next().value;l!==void 0&&ii.delete(l)}}function n(o){const s=Math.round(o.startTime);let i=ii.get(s);if(!i)for(let a=-5;a<=5;a++){const l=ii.get(s+a);if(l){i=l;break}}return i||"<unknown>"}const r=({entries:o})=>{const s=ir(),i=s&&Pn(s);o.forEach(a=>{if(!wC(a))return;const l=a.interactionId;if(l==null||Xl.has(l))return;const u=a.target?Er(a.target):n(a);if(id.length>10){const d=id.shift();Xl.delete(d)}id.push(l),Xl.set(l,{span:i,elementName:u})})};Oa("event",r),Oa("first-input",r)}const pA=40;function hA(e,t=rA("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 oA("fetch"),l}finally{n-=i,r--}}return Tk(e,o,dp(e.bufferSize||pA))}const mr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,mA=30,gA=50;function gf(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?Hs:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const vA=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,yA=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,_A=/\((\S*)(?::(\d+))(?::(\d+))\)/,bA=/at (.+?) ?\(data:(.+?),/,wA=e=>{var o;const t=e.match(bA);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=vA.exec(e);if(n){const[,s,i,a]=n;return gf(s,Hs,+i,+a)}const r=yA.exec(e);if(r){if(((o=r[2])==null?void 0:o.indexOf("eval"))===0){const l=_A.exec(r[2]);l&&(r[2]=l[1],r[3]=l[2],r[4]=l[3])}const[i,a]=D_(r[1]||Hs,r[2]);return gf(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},SA=[mA,wA],TA=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,EA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,kA=e=>{const t=TA.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const s=EA.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]||Hs;return[o,r]=D_(o,r),gf(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},IA=[gA,kA],CA=[SA,IA],AA=ly(...CA),D_=(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]:Hs,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Pl=1024,xA="Breadcrumbs",RA=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:xA,setup(n){t.console&&oI(NA(n)),t.dom&&JC($A(n,t.dom)),t.xhr&&L_(OA(n)),t.fetch&&g_(LA(n)),t.history&&_p(DA(n)),t.sentry&&n.on("beforeSendEvent",PA(n))}}}),MA=RA;function PA(e){return function(n){At()===e&&hr({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:$s(n)},{event:n})}}function $A(e,t){return function(r){if(At()!==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>Pl&&(mr&&Ee.warn(`\`dom.maxStringLength\` cannot exceed ${Pl}, but a value of ${a} was configured. Sentry will use ${Pl} instead.`),a=Pl),typeof i=="string"&&(i=[i]);try{const u=r.event,d=jA(u)?u.target:u;o=Er(d,{keyAttrs:i,maxStringLength:a}),s=my(d)}catch{o="<unknown>"}if(o.length===0)return;const l={category:`ui.${r.name}`,message:o};s&&(l.data={"ui.component_name":s}),hr(l,{event:r.event,name:r.name,global:r.global})}}function NA(e){return function(n){if(At()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:iI(n.level),message:Lh(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Lh(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;hr(r,{input:n.args,level:n.level})}}function OA(e){return function(n){if(At()!==e)return;const{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[pi];if(!r||!o||!s)return;const{method:i,url:a,status_code:l,body:u}=s,d={method:i,url:a,status_code:l},p={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},g={category:"xhr",data:d,type:"http",level:m_(l)};e.emit("beforeOutgoingRequestBreadcrumb",g,p),hr(g,p)}}function LA(e){return function(n){if(At()!==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),hr(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:m_(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",l,a),hr(l,a)}}}function DA(e){return function(n){if(At()!==e)return;let r=n.from,o=n.to;const s=qs(at.location.href);let i=r?qs(r):void 0;const a=qs(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),hr({category:"navigation",data:{from:r,to:o}})}}function jA(e){return!!e&&!!e.target}const FA="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(","),BA="BrowserApiErrors",UA=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:BA,setupOnce(){t.setTimeout&&pr(at,"setTimeout",Im),t.setInterval&&pr(at,"setInterval",Im),t.requestAnimationFrame&&pr(at,"requestAnimationFrame",HA),t.XMLHttpRequest&&"XMLHttpRequest"in at&&pr(XMLHttpRequest.prototype,"send",WA);const n=t.eventTarget;n&&(Array.isArray(n)?n:FA).forEach(o=>VA(o,t))}}}),qA=UA;function Im(e){return function(...t){const n=t[0];return t[0]=xi(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Mo(e)}`}}),e.apply(this,t)}}function HA(e){return function(t){return e.apply(this,[xi(t,{mechanism:{data:{handler:Mo(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function WA(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&pr(n,o,function(s){const i={mechanism:{data:{handler:Mo(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},a=tp(s);return a&&(i.mechanism.data.handler=Mo(a)),xi(s,i)})}),e.apply(this,t)}}function VA(e,t){var o,s;const r=(o=at[e])==null?void 0:o.prototype;(s=r==null?void 0:r.hasOwnProperty)!=null&&s.call(r,"addEventListener")&&(pr(r,"addEventListener",function(i){return function(a,l,u){try{zA(l)&&(l.handleEvent=xi(l.handleEvent,{mechanism:{data:{handler:Mo(l),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&GA(this,a,l),i.apply(this,[a,xi(l,{mechanism:{data:{handler:Mo(l),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),pr(r,"removeEventListener",function(i){return function(a,l,u){try{const d=l.__sentry_wrapped__;d&&i.call(this,a,d,u)}catch{}return i.call(this,a,l,u)}}))}function zA(e){return typeof e.handleEvent=="function"}function GA(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const KA=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof at.document>"u"){mr&&Ee.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}om({ignoreDuration:!0}),Zu();const n=qr();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))&&(Zu(),r=s)}),t==="route"&&_p(({from:o,to:s})=>{o!==s&&(om({ignoreDuration:!0}),Zu())})}}},YA="CultureContext",JA=(()=>({name:YA,preprocessEvent(e){var n;const t=QA();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}})),XA=JA;function QA(){try{const e=at.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const ZA="GlobalHandlers",ex=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:ZA,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(nx(n),Cm("onerror")),t.onunhandledrejection&&(rx(n),Cm("onunhandledrejection"))}}}),tx=ex;function nx(e){uy(t=>{const{stackParser:n,attachStacktrace:r}=j_();if(At()!==e||y_())return;const{msg:o,url:s,line:i,column:a,error:l}=t,u=ix(mp(n,l||o,void 0,r,!1),s,i,a);u.level="error",Ky(u,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function rx(e){dy(t=>{const{stackParser:n,attachStacktrace:r}=j_();if(At()!==e||y_())return;const o=ox(t),s=Ei(o)?sx(o):mp(n,o,void 0,r,!0);s.level="error",Ky(s,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function ox(e){if(Ei(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 sx(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function ix(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:ax(t)??Ha(),function:Hs,in_app:!0}),e}function Cm(e){mr&&Ee.log(`Global Handler attached: ${e}`)}function j_(){const e=At();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function ax(e){if(!(!ko(e)||e.length===0))return e.startsWith("data:")?`<${ns(e,!1)}>`:e}const lx=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!at.navigator&&!at.location&&!at.document)return;const t=fp(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),cx="cause",ux=5,dx="LinkedErrors",fx=((e={})=>{const t=e.limit||ux,n=e.key||cx;return{name:dx,preprocessEvent(r,o,s){const i=s.getOptions();rI(pp,i.stackParser,n,t,r,o)}}}),px=fx;function hx(){return mx()?(mr&&Do(()=>{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 mx(){var o;if(typeof at.window>"u")return!1;const e=at;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=Ha();return!(at===at.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function F_(e){return[Yk(),Vk(),mI(),qA(),MA(),tx(),px(),cI(),lx(),XA(),KA()]}function gx(e={}){const t=!e.skipBrowserExtensionCheck&&hx();let n=e.defaultIntegrations==null?F_():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:VT(e.stackParser||AA),integrations:uk({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||hA};return Nk(GI,r)}function vx(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function B_(e){try{return new URL(e,at.location.origin).href}catch{return}}function yx(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function U_(e){try{return new Headers(e)}catch{return}}const Am=new WeakMap,ad=new Map,q_={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function _x(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:a,onRequestSpanStart:l,onRequestSpanEnd:u}={...q_,...t},d=typeof s=="function"?s:I=>!0,p=I=>wx(I,a),g={},_=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(I=>(I.type==="transaction"&&I.spans&&I.spans.forEach(R=>{if(R.op==="http.client"){const W=ad.get(R.span_id);W&&(R.timestamp=W/1e3,ad.delete(R.span_id))}}),I)),o&&kI(I=>{if(I.response){const R=Am.get(I.response);R&&I.endTimestamp&&ad.set(R,I.endTimestamp)}}),g_(I=>{const R=gI(I,d,p,g,{propagateTraceparent:_,onRequestSpanEnd:u});if(I.response&&I.fetchData.__span&&Am.set(I.response,I.fetchData.__span),R){const W=B_(I.fetchData.url),M=W?qs(W).host:void 0;R.setAttributes({"http.url":W?ns(W):void 0,"server.address":M}),i&&xm(R,e),l==null||l(R,{headers:I.headers})}})),r&&L_(I=>{var W;const R=Sx(I,d,p,g,_,u);R&&(i&&xm(R,e),l==null||l(R,{headers:U_((W=I.xhr.__sentry_xhr_v3__)==null?void 0:W.request_headers)}))})}const bx=300;function xm(e,t){const{url:n}=yt(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(o);if(Ya(t)){const s=e.end.bind(e);e.end=i=>{const a=i??tn();let l=!1;const u=()=>{l||(l=!0,setTimeout(o),s(a),clearTimeout(d))};r=u;const d=setTimeout(u,bx)}}const o=Oa("resource",({entries:s})=>{s.forEach(i=>{yx(i)&&i.name.endsWith(n)&&(e.setAttributes(O_(i)),r())})})}function wx(e,t){const n=Ha();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?ts(r.toString(),t)||s&&ts(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?ts(e,t):r}}function Sx(e,t,n,r,o,s){const i=e.xhr,a=i==null?void 0:i[pi];if(!i||i.__sentry_own_request__||!a)return;const{url:l,method:u}=a,d=Sr()&&t(l);if(e.endTimestamp){const M=i.__sentry_xhr_span_id__;if(!M)return;const $=r[M];$&&(d&&a.status_code!==void 0&&(Ey($,a.status_code),$.end(),s==null||s($,{headers:U_(aA(i)),error:e.error})),delete r[M]);return}const p=B_(l),g=qs(p||l),_=ns(jk(l)),I=!!ir(),R=d&&I?is({name:`${u} ${_}`,attributes:{url:ns(l),type:"xhr","http.method":u,"http.url":p?ns(p):void 0,"server.address":g==null?void 0:g.host,[Jt]:"auto.http.browser",[No]:"http.client",...(g==null?void 0:g.search)&&{"http.query":g==null?void 0:g.search},...(g==null?void 0:g.hash)&&{"http.fragment":g==null?void 0:g.hash}}}):new Tr;i.__sentry_xhr_span_id__=R.spanContext().spanId,r[i.__sentry_xhr_span_id__]=R,n(l)&&Tx(i,Sr()&&I?R:void 0,o);const W=At();return W&&W.emit("beforeOutgoingRequestSpan",R,e),R}function Tx(e,t,n){const{"sentry-trace":r,baggage:o,traceparent:s}=d_({span:t,propagateTraceparent:n});r&&Ex(e,r,o,s)}function Ex(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||!vx(i))&&e.setRequestHeader("baggage",n)}}catch{}}function kx(){at.document?at.document.addEventListener("visibilitychange",()=>{const e=ir();if(!e)return;const t=Pn(e);if(at.document.hidden&&t){const n="cancelled",{op:r,status:o}=yt(t);mr&&Ee.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||t.setStatus({code:un,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):mr&&Ee.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const Ix=3600,H_="sentry_previous_trace",Cx="sentry.previous_trace";function Ax(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let o=r?Mx():void 0;e.on("spanStart",i=>{if(Pn(i)!==i)return;const a=$t().getPropagationContext();o=xx(o,i,a),r&&Rx(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(vf(o.spanContext))},sampleRand:o.sampleRand}),i.parentSampled=vf(o.spanContext),i.parentSampleRate=o.sampleRate,i.spanAttributes={...i.spanAttributes,[Sy]:o.sampleRate}})}function xx(e,t,n){const r=yt(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[np])}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<=Ix&&(mr&&Ee.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[b0]:"previous_trace"}}),t.setAttribute(Cx,`${i.traceId}-${i.spanId}-${vf(i)?1:0}`)),s)}function Rx(e){try{at.sessionStorage.setItem(H_,JSON.stringify(e))}catch(t){mr&&Ee.warn("Could not store previous trace in sessionStorage",t)}}function Mx(){var e;try{const t=(e=at.sessionStorage)==null?void 0:e.getItem(H_);return JSON.parse(t)}catch{return}}function vf(e){return e.traceFlags===1}const Px="BrowserTracing",$x=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Nx(){const e=at.navigator;return e!=null&&e.userAgent?$x.test(e.userAgent):!1}const Ox={...zl,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...q_},Rm=((e={})=>{"enableElementTiming"in e&&Do(()=>{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=at.document,{enableInp:r,enableLongTask:o,enableLongAnimationFrame:s,_experiments:{enableInteractions:i,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:u,idleTimeout:d,finalTimeout:p,childSpanTimeout:g,markBackgroundSpan:_,traceFetch:I,traceXHR:R,trackFetchStreamPerformance:W,shouldCreateSpanForRequest:M,enableHTTPTimings:$,ignoreResourceSpans:q,ignorePerformanceApiSpans:z,instrumentPageLoad:ue,instrumentNavigation:ne,detectRedirects:J,linkPreviousTrace:he,consistentTraceSampling:xe,enableReportPageLoaded:Ce,onRequestSpanStart:Pe,onRequestSpanEnd:Y}={...Ox,...e},de=Nx();let Ae,De,ve;function Se(ae,ke,Ne=!0){const Me=ke.op==="pageload",qe=ke.name,He=u?u(ke):ke,Ve=He.attributes||{};if(qe!==He.name&&(Ve[yr]="custom",He.attributes=Ve),!Ne){const K=zs();is({...He,startTime:K}).end(K);return}t.name=He.name,t.source=Ve[yr];const ot=zy(He,{idleTimeout:d,finalTimeout:p,childSpanTimeout:g,disableAutoFinish:Me,beforeSpanEnd:K=>{Ae==null||Ae(),DC(K,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:q,ignorePerformanceApiSpans:z}),$m(ae,void 0);const _e=$t(),fe=_e.getPropagationContext();_e.setPropagationContext({...fe,traceId:ot.spanContext().traceId,sampled:fs(ot),dsc:ss(K)}),Me&&(ve=void 0)},trimIdleSpanEndTimestamp:!Ce});Me&&Ce&&(ve=ot),$m(ae,ot);function Ge(){n&&["interactive","complete"].includes(n.readyState)&&ae.emit("idleSpanEnableAutoFinish",ot)}Me&&!Ce&&n&&(n.addEventListener("readystatechange",()=>{Ge()}),Ge())}return{name:Px,setup(ae){var Ne;if(de){mr&&Ee.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(Q0(),Ae=RC({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:l||!1,client:ae}),r&&cA(),s&&gt.PerformanceObserver&&((Ne=PerformanceObserver.supportedEntryTypes)!=null&&Ne.includes("long-animation-frame"))?PC():o&&MC(),i&&$C(),J&&n){const Me=()=>{De=tn()};addEventListener("click",Me,{capture:!0}),addEventListener("keydown",Me,{capture:!0,passive:!0})}function ke(){const Me=La(ae);Me&&!yt(Me).timestamp&&(mr&&Ee.log(`[Tracing] Finishing current active span with op: ${yt(Me).op}`),Me.setAttribute(Ra,"cancelled"),Me.end())}ae.on("startNavigationSpan",(Me,qe)=>{if(At()!==ae)return;if(qe!=null&&qe.isRedirect){mr&&Ee.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Se(ae,{op:"navigation.redirect",...Me},!1);return}De=void 0,ke(),qr().setPropagationContext({traceId:$o(),sampleRand:Math.random(),propagationSpanId:Sr()?void 0:Io()});const He=$t();He.setPropagationContext({traceId:$o(),sampleRand:Math.random(),propagationSpanId:Sr()?void 0:Io()}),He.setSDKProcessingMetadata({normalizedRequest:void 0}),Se(ae,{op:"navigation",...Me,parentSpan:null,forceTransaction:!0})}),ae.on("startPageLoadSpan",(Me,qe={})=>{if(At()!==ae)return;ke();const He=qe.sentryTrace||Mm("sentry-trace")||Pm("sentry-trace"),Ve=qe.baggage||Mm("baggage")||Pm("baggage"),ot=F0(He,Ve),Ge=$t();Ge.setPropagationContext(ot),Sr()||(Ge.getPropagationContext().propagationSpanId=Io()),Ge.setSDKProcessingMetadata({normalizedRequest:fp()}),Se(ae,{op:"pageload",...Me})}),ae.on("endPageloadSpan",()=>{Ce&&ve&&(ve.setAttribute(Ra,"reportPageLoaded"),ve.end())})},afterAllSetup(ae){if(de)return;let ke=Ha();if(he!=="off"&&Ax(ae,{linkPreviousTrace:he,consistentTraceSampling:xe}),at.location){if(ue){const Ne=kr();Lx(ae,{name:at.location.pathname,startTime:Ne?Ne/1e3:void 0,attributes:{[yr]:"url",[Jt]:"auto.pageload.browser"}})}ne&&_p(({to:Ne,from:Me})=>{if(Me===void 0&&(ke==null?void 0:ke.indexOf(Ne))!==-1){ke=void 0;return}ke=void 0;const qe=c_(Ne),He=La(ae),Ve=He&&J&&jx(He,De);W_(ae,{name:(qe==null?void 0:qe.pathname)||at.location.pathname,attributes:{[yr]:"url",[Jt]:"auto.navigation.browser"}},{url:Ne,isRedirect:Ve})})}_&&kx(),i&&Dx(ae,d,p,g,t),r&&fA(),_x(ae,{traceFetch:I,traceXHR:R,trackFetchStreamPerformance:W,tracePropagationTargets:ae.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:M,enableHTTPTimings:$,onRequestSpanStart:Pe,onRequestSpanEnd:Y})}}});function Lx(e,t,n){e.emit("startPageLoadSpan",t,n),$t().setTransactionName(t.name);const r=La(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function W_(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:{...fp(),url:r}}),La(e)}function Mm(e){const t=at.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Pm(e){var r,o,s;const t=(o=(r=at.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 Dx(e,t,n,r,o){const s=at.document;let i;const a=()=>{const l="ui.action.click",u=La(e);if(u){const d=yt(u).op;if(["navigation","pageload"].includes(d)){mr&&Ee.warn(`[Tracing] Did not create ${l} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(Ra,"interactionInterrupted"),i.end(),i=void 0),!o.name){mr&&Ee.warn(`[Tracing] Did not create ${l} transaction because _latestRouteName is missing.`);return}i=zy({name:o.name,op:l,attributes:{[yr]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",a,{capture:!0})}const V_="_sentry_idleSpan";function La(e){return e[V_]}function $m(e,t){sr(e,V_,t)}const Nm=1.5;function jx(e,t){const n=yt(e),r=zs(),o=n.start_timestamp;return!(r-o>Nm||t&&r-t<=Nm)}const z_=["activate","mount"],G_=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Fx=/(?:^|[-_])(\w)/g,Bx=e=>e.replace(Fx,t=>t.toUpperCase()).replace(/[-_]/g,""),Ux="<Root>",ld="<Anonymous>",qx=(e,t)=>e.repeat(t),ya=(e,t)=>{if(!e)return ld;if(e.$root===e)return Ux;if(!e.$options)return ld;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?`<${Bx(r)}>`:ld)+(o&&t!==!1?` at ${o}`:"")},Hx=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?"---> ":qx(" ",5+s*2))+(Array.isArray(o)?`${ya(o[0])}... (${o[1]} recursive calls)`:ya(o))}`).join(`
43
+ `)}`}return`
44
+
45
+ (found in ${ya(e)})`},Wx=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,o,s)=>{var u;const i=ya(o,!1),a=o?Hx(o):"",l={componentName:i,lifecycleHook:s,trace:a};if((t==null?void 0:t.attachProps)!==!1&&o&&((u=o.$options)!=null&&u.propsData?l.propsData=o.$options.propsData:o.$props&&(l.propsData=o.$props)),setTimeout(()=>{cp(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}},Om="ui.vue",Vx={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function cd(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 zx(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(z_).filter((o,s,i)=>i.indexOf(o)===s),n={},r=e.timeout||2e3;for(const o of t){const s=Vx[o];if(!s){G_&&Ee.warn(`Unknown hook: ${o}`);continue}for(const i of s)n[i]=function(){var g;const a=this.$root===this;a&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||is({name:"Application Render",op:`${Om}.render`,attributes:{[Jt]:"auto.ui.vue"},onlyIfParent:!0}),cd(this,tn(),r));const l=ya(this,!1);if(!(a||(Array.isArray(e.trackComponents)?zx(e.trackComponents,l):e.trackComponents))){cd(this,tn(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=i===s[0],p=((g=this.$root)==null?void 0:g.$_sentryRootComponentSpan)||ir();if(d){if(p){const _=this.$_sentryComponentSpans[o];_&&_.end(),this.$_sentryComponentSpans[o]=is({name:`Vue ${l}`,op:`${Om}.${o}`,attributes:{[Jt]:"auto.ui.vue"},onlyIfParent:!0})}}else{const _=this.$_sentryComponentSpans[o];if(!_)return;_.end(),cd(this,tn(),r)}}}return n},Kx=gt,Yx={Vue:Kx.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:z_,timeout:2e3,trackComponents:!1}},Jx="Vue",Xx=(e={})=>({name:Jx,setup(t){const n={...Yx,...t.getOptions(),...e};if(!n.Vue&&!n.app){Do(()=>{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=>Lm(o,n)):n.Vue&&Lm(n.Vue,n)}}),Lm=(e,t)=>{var n;G_&&((n=e._instance)==null?void 0:n.isMounted)===!0&&Do(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&Wx(e,t),Sr(t)&&e.mixin(Gx(t.tracingOptions))};function Qx(e={}){const t={defaultIntegrations:[...F_(),Xx()],...e};return u_(t,"vue"),gx(t)}function Zx(e,t,n){let r=!1;const o="mode"in e;e.onError(s=>cp(s,{mechanism:{handled:!1}})),e.beforeEach((s,i,...a)=>{const l=r?void 0:e1(),u={};for(const g of Object.keys(s.params))u[`url.path.parameter.${g}`]=s.params[g],u[`params.${g}`]=s.params[g];for(const g of Object.keys(s.query)){const _=s.query[g];_&&(u[`query.${g}`]=_)}let d=s.path,p="url";if(s.name&&t.routeLabel!=="path")d=s.name.toString(),p="custom";else if(s.matched.length>0){const g=s.matched.length-1;d=s.matched[g].path,p="route"}if($t().setTransactionName(d),t.instrumentPageLoad&&l&&(yt(l).data[yr]!=="custom"&&(l.updateName(d),l.setAttribute(yr,p)),l.setAttributes({...u,[Jt]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!l&&n({name:d,op:"navigation",attributes:{...u,[Jt]:"auto.navigation.vue",[yr]:p}}),o){const g=a[0];typeof g=="function"&&g()}})}function e1(){const e=ir(),t=e&&Pn(e);return t&&yt(t).op==="pageload"?t:void 0}function t1(e={}){if(!e.router)return Rm(e);const t=Rm({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:o=!0,routeLabel:s="name"}=e;return{...t,afterAllSetup(i){t.afterAllSetup(i),Zx(n,{routeLabel:s,instrumentNavigation:r,instrumentPageLoad:o},l=>{W_(i,l)})}}}const n1="modulepreload",r1=function(e){return"/"+e},Dm={},ud=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};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(u=>{if(u=r1(u),u in Dm)return;Dm[u]=!0;const d=u.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":n1,d||(g.as="script"),g.crossOrigin="",g.href=u,l&&g.setAttribute("nonce",l),document.head.appendChild(g),d)return new Promise((_,I)=>{g.addEventListener("load",_),g.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${u}`)))})}))}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 ui=typeof document<"u";function K_(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function o1(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&K_(e.default)}const kt=Object.assign;function dd(e,t){const n={};for(const r in t){const o=t[r];n[r]=Ur(o)?o.map(e):e(o)}return n}const _a=()=>{},Ur=Array.isArray;function jm(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Y_=/#/g,s1=/&/g,i1=/\//g,a1=/=/g,l1=/\?/g,J_=/\+/g,c1=/%5B/g,u1=/%5D/g,X_=/%5E/g,d1=/%60/g,Q_=/%7B/g,f1=/%7C/g,Z_=/%7D/g,p1=/%20/g;function bp(e){return e==null?"":encodeURI(""+e).replace(f1,"|").replace(c1,"[").replace(u1,"]")}function h1(e){return bp(e).replace(Q_,"{").replace(Z_,"}").replace(X_,"^")}function yf(e){return bp(e).replace(J_,"%2B").replace(p1,"+").replace(Y_,"%23").replace(s1,"%26").replace(d1,"`").replace(Q_,"{").replace(Z_,"}").replace(X_,"^")}function m1(e){return yf(e).replace(a1,"%3D")}function g1(e){return bp(e).replace(Y_,"%23").replace(l1,"%3F")}function v1(e){return g1(e).replace(i1,"%2F")}function Da(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const y1=/\/$/,_1=e=>e.replace(y1,"");function fd(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=T1(r??t,n),{fullPath:r+s+i,path:r,query:o,hash:Da(i)}}function b1(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Fm(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function w1(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Ri(t.matched[r],n.matched[o])&&eb(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Ri(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function eb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!S1(e[n],t[n]))return!1;return!0}function S1(e,t){return Ur(e)?Bm(e,t):Ur(t)?Bm(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Bm(e,t){return Ur(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function T1(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 Go={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let _f=(function(e){return e.pop="pop",e.push="push",e})({}),pd=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function E1(e){if(!e)if(ui){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),_1(e)}const k1=/^[^#]+#/;function I1(e,t){return e.replace(k1,"#")+t}function C1(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 Hc=()=>({left:window.scrollX,top:window.scrollY});function A1(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=C1(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 Um(e,t){return(history.state?history.state.position-t:-1)+e}const bf=new Map;function x1(e,t){bf.set(e,t)}function R1(e){const t=bf.get(e);return bf.delete(e),t}function M1(e){return typeof e=="string"||e&&typeof e=="object"}function tb(e){return typeof e=="string"||typeof e=="symbol"}let Kt=(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 nb=Symbol("");Kt.MATCHER_NOT_FOUND+"",Kt.NAVIGATION_GUARD_REDIRECT+"",Kt.NAVIGATION_ABORTED+"",Kt.NAVIGATION_CANCELLED+"",Kt.NAVIGATION_DUPLICATED+"";function Mi(e,t){return kt(new Error,{type:e,[nb]:!0},t)}function vo(e,t){return e instanceof Error&&nb in e&&(t==null||!!(e.type&t))}const P1=["params","query","hash"];function $1(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of P1)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function N1(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(J_," "),s=o.indexOf("="),i=Da(s<0?o:o.slice(0,s)),a=s<0?null:Da(o.slice(s+1));if(i in t){let l=t[i];Ur(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function qm(e){let t="";for(let n in e){const r=e[n];if(n=m1(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Ur(r)?r.map(o=>o&&yf(o)):[r&&yf(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]=Ur(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const L1=Symbol(""),Hm=Symbol(""),Wc=Symbol(""),wp=Symbol(""),wf=Symbol("");function ia(){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 Xo(e,t,n,r,o,s=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((a,l)=>{const u=g=>{g===!1?l(Mi(Kt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):M1(g)?l(Mi(Kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[o]===i&&typeof g=="function"&&i.push(g),a())},d=s(()=>e.call(r&&r.instances[o],t,n,u));let p=Promise.resolve(d);e.length<3&&(p=p.then(u)),p.catch(g=>l(g))})}function hd(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(K_(l)){const u=(l.__vccOpts||l)[t];u&&s.push(Xo(u,n,r,i,a,o))}else{let u=l();s.push(()=>u.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const p=o1(d)?d.default:d;i.mods[a]=d,i.components[a]=p;const g=(p.__vccOpts||p)[t];return g&&Xo(g,n,r,i,a,o)()}))}}return s}function D1(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(u=>Ri(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>Ri(u,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 j1=()=>location.protocol+"//"+location.host;function rb(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),Fm(a,"")}return Fm(n,e)+r+o}function F1(e,t,n,r){let o=[],s=[],i=null;const a=({state:g})=>{const _=rb(e,location),I=n.value,R=t.value;let W=0;if(g){if(n.value=_,t.value=g,i&&i===I){i=null;return}W=R?g.position-R.position:0}else r(_);o.forEach(M=>{M(n.value,I,{delta:W,type:_f.pop,direction:W?W>0?pd.forward:pd.back:pd.unknown})})};function l(){i=n.value}function u(g){o.push(g);const _=()=>{const I=o.indexOf(g);I>-1&&o.splice(I,1)};return s.push(_),_}function d(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(kt({},g.state,{scroll:Hc()}),"")}}function p(){for(const g of s)g();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:u,destroy:p}}function Wm(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Hc():null}}function B1(e){const{history:t,location:n}=window,r={value:rb(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,u,d){const p=e.indexOf("#"),g=p>-1?(n.host&&document.querySelector("base")?e:e.slice(p))+l:j1()+e+l;try{t[d?"replaceState":"pushState"](u,"",g),o.value=u}catch(_){console.error(_),n[d?"replace":"assign"](g)}}function i(l,u){s(l,kt({},t.state,Wm(o.value.back,l,o.value.forward,!0),u,{position:o.value.position}),!0),r.value=l}function a(l,u){const d=kt({},o.value,t.state,{forward:l,scroll:Hc()});s(d.current,d,!0),s(l,kt({},Wm(r.value,l,null),{position:d.position+1},u),!1),r.value=l}return{location:r,state:o,push:a,replace:i}}function U1(e){e=E1(e);const t=B1(e),n=F1(e,t.state,t.location,t.replace);function r(s,i=!0){i||n.pauseListeners(),history.go(s)}const o=kt({location:"",base:e,go:r,createHref:I1.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 q1(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),U1(e)}let Os=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var cn=(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})(cn||{});const H1={type:Os.Static,value:""},W1=/[a-zA-Z0-9_]/;function V1(e){if(!e)return[[]];if(e==="/")return[[H1]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${u}": ${_}`)}let n=cn.Static,r=n;const o=[];let s;function i(){s&&o.push(s),s=[]}let a=0,l,u="",d="";function p(){u&&(n===cn.Static?s.push({type:Os.Static,value:u}):n===cn.Param||n===cn.ParamRegExp||n===cn.ParamRegExpEnd?(s.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),s.push({type:Os.Param,value:u,regexp:d,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function g(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==cn.ParamRegExp){r=n,n=cn.EscapeNext;continue}switch(n){case cn.Static:l==="/"?(u&&p(),i()):l===":"?(p(),n=cn.Param):g();break;case cn.EscapeNext:g(),n=r;break;case cn.Param:l==="("?n=cn.ParamRegExp:W1.test(l)?g():(p(),n=cn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case cn.ParamRegExp:l===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+l:n=cn.ParamRegExpEnd:d+=l;break;case cn.ParamRegExpEnd:p(),n=cn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,d="";break;default:t("Unknown state");break}}return n===cn.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),p(),i(),o}const Vm="[^/]+?",z1={sensitive:!1,strict:!1,start:!0,end:!0};var zn=(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})(zn||{});const G1=/[.+*?^${}()[\]/\\]/g;function K1(e,t){const n=kt({},z1,t),r=[];let o=n.start?"^":"";const s=[];for(const u of e){const d=u.length?[]:[zn.Root];n.strict&&!u.length&&(o+="/");for(let p=0;p<u.length;p++){const g=u[p];let _=zn.Segment+(n.sensitive?zn.BonusCaseSensitive:0);if(g.type===Os.Static)p||(o+="/"),o+=g.value.replace(G1,"\\$&"),_+=zn.Static;else if(g.type===Os.Param){const{value:I,repeatable:R,optional:W,regexp:M}=g;s.push({name:I,repeatable:R,optional:W});const $=M||Vm;if($!==Vm){_+=zn.BonusCustomRegExp;try{`${$}`}catch(z){throw new Error(`Invalid custom RegExp for param "${I}" (${$}): `+z.message)}}let q=R?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;p||(q=W&&u.length<2?`(?:/${q})`:"/"+q),W&&(q+="?"),o+=q,_+=zn.Dynamic,W&&(_+=zn.BonusOptional),R&&(_+=zn.BonusRepeatable),$===".*"&&(_+=zn.BonusWildcard)}d.push(_)}r.push(d)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=zn.BonusStrict}n.strict||(o+="/?"),n.end?o+="$":n.strict&&!o.endsWith("/")&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function a(u){const d=u.match(i),p={};if(!d)return null;for(let g=1;g<d.length;g++){const _=d[g]||"",I=s[g-1];p[I.name]=_&&I.repeatable?_.split("/"):_}return p}function l(u){let d="",p=!1;for(const g of e){(!p||!d.endsWith("/"))&&(d+="/"),p=!1;for(const _ of g)if(_.type===Os.Static)d+=_.value;else if(_.type===Os.Param){const{value:I,repeatable:R,optional:W}=_,M=I in u?u[I]:"";if(Ur(M)&&!R)throw new Error(`Provided param "${I}" is an array but it is not repeatable (* or + modifiers)`);const $=Ur(M)?M.join("/"):M;if(!$)if(W)g.length<2&&(d.endsWith("/")?d=d.slice(0,-1):p=!0);else throw new Error(`Missing required param "${I}"`);d+=$}}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]===zn.Static+zn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===zn.Static+zn.Segment?1:-1:0}function ob(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(zm(r))return 1;if(zm(o))return-1}return o.length-r.length}function zm(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const J1={strict:!1,end:!0,sensitive:!1};function X1(e,t,n){const r=K1(V1(e.path),n),o=kt(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function Q1(e,t){const n=[],r=new Map;t=jm(J1,t);function o(p){return r.get(p)}function s(p,g,_){const I=!_,R=Km(p);R.aliasOf=_&&_.record;const W=jm(t,p),M=[R];if("alias"in p){const z=typeof p.alias=="string"?[p.alias]:p.alias;for(const ue of z)M.push(Km(kt({},R,{components:_?_.record.components:R.components,path:ue,aliasOf:_?_.record:R})))}let $,q;for(const z of M){const{path:ue}=z;if(g&&ue[0]!=="/"){const ne=g.record.path,J=ne[ne.length-1]==="/"?"":"/";z.path=g.record.path+(ue&&J+ue)}if($=X1(z,g,W),_?_.alias.push($):(q=q||$,q!==$&&q.alias.push($),I&&p.name&&!Ym($)&&i(p.name)),sb($)&&l($),R.children){const ne=R.children;for(let J=0;J<ne.length;J++)s(ne[J],$,_&&_.children[J])}_=_||$}return q?()=>{i(q)}:_a}function i(p){if(tb(p)){const g=r.get(p);g&&(r.delete(p),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(p);g>-1&&(n.splice(g,1),p.record.name&&r.delete(p.record.name),p.children.forEach(i),p.alias.forEach(i))}}function a(){return n}function l(p){const g=tR(p,n);n.splice(g,0,p),p.record.name&&!Ym(p)&&r.set(p.record.name,p)}function u(p,g){let _,I={},R,W;if("name"in p&&p.name){if(_=r.get(p.name),!_)throw Mi(Kt.MATCHER_NOT_FOUND,{location:p});W=_.record.name,I=kt(Gm(g.params,_.keys.filter(q=>!q.optional).concat(_.parent?_.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),p.params&&Gm(p.params,_.keys.map(q=>q.name))),R=_.stringify(I)}else if(p.path!=null)R=p.path,_=n.find(q=>q.re.test(R)),_&&(I=_.parse(R),W=_.record.name);else{if(_=g.name?r.get(g.name):n.find(q=>q.re.test(g.path)),!_)throw Mi(Kt.MATCHER_NOT_FOUND,{location:p,currentLocation:g});W=_.record.name,I=kt({},g.params,p.params),R=_.stringify(I)}const M=[];let $=_;for(;$;)M.unshift($.record),$=$.parent;return{name:W,path:R,params:I,matched:M,meta:eR(M)}}e.forEach(p=>s(p));function d(){n.length=0,r.clear()}return{addRoute:s,resolve:u,removeRoute:i,clearRoutes:d,getRoutes:a,getRecordMatcher:o}}function Gm(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Km(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Z1(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 Z1(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 Ym(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function eR(e){return e.reduce((t,n)=>kt(t,n.meta),{})}function tR(e,t){let n=0,r=t.length;for(;n!==r;){const s=n+r>>1;ob(e,t[s])<0?r=s:n=s+1}const o=nR(e);return o&&(r=t.lastIndexOf(o,r-1)),r}function nR(e){let t=e;for(;t=t.parent;)if(sb(t)&&ob(e,t)===0)return t}function sb({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Jm(e){const t=Dr(Wc),n=Dr(wp),r=oe(()=>{const l=je(e.to);return t.resolve(l)}),o=oe(()=>{const{matched:l}=r.value,{length:u}=l,d=l[u-1],p=n.matched;if(!d||!p.length)return-1;const g=p.findIndex(Ri.bind(null,d));if(g>-1)return g;const _=Xm(l[u-2]);return u>1&&Xm(d)===_&&p[p.length-1].path!==_?p.findIndex(Ri.bind(null,l[u-2])):g}),s=oe(()=>o.value>-1&&aR(n.params,r.value.params)),i=oe(()=>o.value>-1&&o.value===n.matched.length-1&&eb(n.params,r.value.params));function a(l={}){if(iR(l)){const u=t[je(e.replace)?"replace":"push"](je(e.to)).catch(_a);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:oe(()=>r.value.href),isActive:s,isExactActive:i,navigate:a}}function rR(e){return e.length===1?e[0]:e}const oR=Tn({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:Jm,setup(e,{slots:t}){const n=Cc(Jm(e)),{options:r}=Dr(Wc),o=oe(()=>({[Qm(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Qm(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const s=t.default&&rR(t.default(n));return e.custom?s:Yf("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},s)}}}),sR=oR;function iR(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 aR(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(!Ur(o)||o.length!==r.length||r.some((s,i)=>s.valueOf()!==o[i].valueOf()))return!1}return!0}function Xm(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qm=(e,t,n)=>e??t??n,lR=Tn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Dr(wf),o=oe(()=>e.route||r.value),s=Dr(Hm,0),i=oe(()=>{let u=je(s);const{matched:d}=o.value;let p;for(;(p=d[u])&&!p.components;)u++;return u}),a=oe(()=>o.value.matched[i.value]);Fl(Hm,oe(()=>i.value+1)),Fl(L1,a),Fl(wf,o);const l=O();return it(()=>[l.value,a.value,e.name],([u,d,p],[g,_,I])=>{d&&(d.instances[p]=u,_&&_!==d&&u&&u===g&&(d.leaveGuards.size||(d.leaveGuards=_.leaveGuards),d.updateGuards.size||(d.updateGuards=_.updateGuards))),u&&d&&(!_||!Ri(d,_)||!g)&&(d.enterCallbacks[p]||[]).forEach(R=>R(u))},{flush:"post"}),()=>{const u=o.value,d=e.name,p=a.value,g=p&&p.components[d];if(!g)return Zm(n.default,{Component:g,route:u});const _=p.props[d],I=_?_===!0?u.params:typeof _=="function"?_(u):_:null,W=Yf(g,kt({},I,t,{onVnodeUnmounted:M=>{M.component.isUnmounted&&(p.instances[d]=null)},ref:l}));return Zm(n.default,{Component:W,route:u})||W}}});function Zm(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const cR=lR;function uR(e){const t=Q1(e.routes,e),n=e.parseQuery||N1,r=e.stringifyQuery||qm,o=e.history,s=ia(),i=ia(),a=ia(),l=Fw(Go);let u=Go;ui&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=dd.bind(null,K=>""+K),p=dd.bind(null,v1),g=dd.bind(null,Da);function _(K,_e){let fe,Oe;return tb(K)?(fe=t.getRecordMatcher(K),Oe=_e):Oe=K,t.addRoute(Oe,fe)}function I(K){const _e=t.getRecordMatcher(K);_e&&t.removeRoute(_e)}function R(){return t.getRoutes().map(K=>K.record)}function W(K){return!!t.getRecordMatcher(K)}function M(K,_e){if(_e=kt({},_e||l.value),typeof K=="string"){const H=fd(n,K,_e.path),X=t.resolve({path:H.path},_e),Z=o.createHref(H.fullPath);return kt(H,X,{params:g(X.params),hash:Da(H.hash),redirectedFrom:void 0,href:Z})}let fe;if(K.path!=null)fe=kt({},K,{path:fd(n,K.path,_e.path).path});else{const H=kt({},K.params);for(const X in H)H[X]==null&&delete H[X];fe=kt({},K,{params:p(H)}),_e.params=p(_e.params)}const Oe=t.resolve(fe,_e),Ye=K.hash||"";Oe.params=d(g(Oe.params));const k=b1(r,kt({},K,{hash:h1(Ye),path:Oe.path})),C=o.createHref(k);return kt({fullPath:k,hash:Ye,query:r===qm?O1(K.query):K.query||{}},Oe,{redirectedFrom:void 0,href:C})}function $(K){return typeof K=="string"?fd(n,K,l.value.path):kt({},K)}function q(K,_e){if(u!==K)return Mi(Kt.NAVIGATION_CANCELLED,{from:_e,to:K})}function z(K){return J(K)}function ue(K){return z(kt($(K),{replace:!0}))}function ne(K,_e){const fe=K.matched[K.matched.length-1];if(fe&&fe.redirect){const{redirect:Oe}=fe;let Ye=typeof Oe=="function"?Oe(K,_e):Oe;return typeof Ye=="string"&&(Ye=Ye.includes("?")||Ye.includes("#")?Ye=$(Ye):{path:Ye},Ye.params={}),kt({query:K.query,hash:K.hash,params:Ye.path!=null?{}:K.params},Ye)}}function J(K,_e){const fe=u=M(K),Oe=l.value,Ye=K.state,k=K.force,C=K.replace===!0,H=ne(fe,Oe);if(H)return J(kt($(H),{state:typeof H=="object"?kt({},Ye,H.state):Ye,force:k,replace:C}),_e||fe);const X=fe;X.redirectedFrom=_e;let Z;return!k&&w1(r,Oe,fe)&&(Z=Mi(Kt.NAVIGATION_DUPLICATED,{to:X,from:Oe}),Me(Oe,Oe,!0,!1)),(Z?Promise.resolve(Z):Ce(X,Oe)).catch(Q=>vo(Q)?vo(Q,Kt.NAVIGATION_GUARD_REDIRECT)?Q:Ne(Q):ae(Q,X,Oe)).then(Q=>{if(Q){if(vo(Q,Kt.NAVIGATION_GUARD_REDIRECT))return J(kt({replace:C},$(Q.to),{state:typeof Q.to=="object"?kt({},Ye,Q.to.state):Ye,force:k}),_e||X)}else Q=Y(X,Oe,!0,C,Ye);return Pe(X,Oe,Q),Q})}function he(K,_e){const fe=q(K,_e);return fe?Promise.reject(fe):Promise.resolve()}function xe(K){const _e=Ve.values().next().value;return _e&&typeof _e.runWithContext=="function"?_e.runWithContext(K):K()}function Ce(K,_e){let fe;const[Oe,Ye,k]=D1(K,_e);fe=hd(Oe.reverse(),"beforeRouteLeave",K,_e);for(const H of Oe)H.leaveGuards.forEach(X=>{fe.push(Xo(X,K,_e))});const C=he.bind(null,K,_e);return fe.push(C),Ge(fe).then(()=>{fe=[];for(const H of s.list())fe.push(Xo(H,K,_e));return fe.push(C),Ge(fe)}).then(()=>{fe=hd(Ye,"beforeRouteUpdate",K,_e);for(const H of Ye)H.updateGuards.forEach(X=>{fe.push(Xo(X,K,_e))});return fe.push(C),Ge(fe)}).then(()=>{fe=[];for(const H of k)if(H.beforeEnter)if(Ur(H.beforeEnter))for(const X of H.beforeEnter)fe.push(Xo(X,K,_e));else fe.push(Xo(H.beforeEnter,K,_e));return fe.push(C),Ge(fe)}).then(()=>(K.matched.forEach(H=>H.enterCallbacks={}),fe=hd(k,"beforeRouteEnter",K,_e,xe),fe.push(C),Ge(fe))).then(()=>{fe=[];for(const H of i.list())fe.push(Xo(H,K,_e));return fe.push(C),Ge(fe)}).catch(H=>vo(H,Kt.NAVIGATION_CANCELLED)?H:Promise.reject(H))}function Pe(K,_e,fe){a.list().forEach(Oe=>xe(()=>Oe(K,_e,fe)))}function Y(K,_e,fe,Oe,Ye){const k=q(K,_e);if(k)return k;const C=_e===Go,H=ui?history.state:{};fe&&(Oe||C?o.replace(K.fullPath,kt({scroll:C&&H&&H.scroll},Ye)):o.push(K.fullPath,Ye)),l.value=K,Me(K,_e,fe,C),Ne()}let de;function Ae(){de||(de=o.listen((K,_e,fe)=>{if(!ot.listening)return;const Oe=M(K),Ye=ne(Oe,ot.currentRoute.value);if(Ye){J(kt(Ye,{replace:!0,force:!0}),Oe).catch(_a);return}u=Oe;const k=l.value;ui&&x1(Um(k.fullPath,fe.delta),Hc()),Ce(Oe,k).catch(C=>vo(C,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_CANCELLED)?C:vo(C,Kt.NAVIGATION_GUARD_REDIRECT)?(J(kt($(C.to),{force:!0}),Oe).then(H=>{vo(H,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&!fe.delta&&fe.type===_f.pop&&o.go(-1,!1)}).catch(_a),Promise.reject()):(fe.delta&&o.go(-fe.delta,!1),ae(C,Oe,k))).then(C=>{C=C||Y(Oe,k,!1),C&&(fe.delta&&!vo(C,Kt.NAVIGATION_CANCELLED)?o.go(-fe.delta,!1):fe.type===_f.pop&&vo(C,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),Pe(Oe,k,C)}).catch(_a)}))}let De=ia(),ve=ia(),Se;function ae(K,_e,fe){Ne(K);const Oe=ve.list();return Oe.length?Oe.forEach(Ye=>Ye(K,_e,fe)):console.error(K),Promise.reject(K)}function ke(){return Se&&l.value!==Go?Promise.resolve():new Promise((K,_e)=>{De.add([K,_e])})}function Ne(K){return Se||(Se=!K,Ae(),De.list().forEach(([_e,fe])=>K?fe(K):_e()),De.reset()),K}function Me(K,_e,fe,Oe){const{scrollBehavior:Ye}=e;if(!ui||!Ye)return Promise.resolve();const k=!fe&&R1(Um(K.fullPath,0))||(Oe||!fe)&&history.state&&history.state.scroll||null;return Yt().then(()=>Ye(K,_e,k)).then(C=>C&&A1(C)).catch(C=>ae(C,K,_e))}const qe=K=>o.go(K);let He;const Ve=new Set,ot={currentRoute:l,listening:!0,addRoute:_,removeRoute:I,clearRoutes:t.clearRoutes,hasRoute:W,getRoutes:R,resolve:M,options:e,push:z,replace:ue,go:qe,back:()=>qe(-1),forward:()=>qe(1),beforeEach:s.add,beforeResolve:i.add,afterEach:a.add,onError:ve.add,isReady:ke,install(K){K.component("RouterLink",sR),K.component("RouterView",cR),K.config.globalProperties.$router=ot,Object.defineProperty(K.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),ui&&!He&&l.value===Go&&(He=!0,z(o.location).catch(Oe=>{}));const _e={};for(const Oe in Go)Object.defineProperty(_e,Oe,{get:()=>l.value[Oe],enumerable:!0});K.provide(Wc,ot),K.provide(wp,hv(_e)),K.provide(wf,l);const fe=K.unmount;Ve.add(K),K.unmount=function(){Ve.delete(K),Ve.size<1&&(u=Go,de&&de(),de=null,l.value=Go,He=!1,Se=!1),fe()}}};function Ge(K){return K.reduce((_e,fe)=>_e.then(()=>xe(fe)),Promise.resolve())}return ot}function dR(){return Dr(Wc)}function fR(e){return Dr(wp)}const eg=768;function Sp(){const e=O(typeof window<"u"?window.innerWidth<eg:!1);let t=null;function n(r){e.value=r.matches}return cs(()=>{t=window.matchMedia(`(max-width: ${eg-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),xc(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const pR={key:0,class:"desktop-sidebar"},hR={class:"desktop-main"},tg="codex-web-local.sidebar-width.v1",mR=260,gR=620,ng=320,vR=Tn({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Sp();function r(u){return Math.min(gR,Math.max(mR,u))}function o(){if(typeof window>"u")return ng;const u=window.localStorage.getItem(tg),d=Number(u);return Number.isFinite(d)?r(d):ng}const s=O(o()),i=oe(()=>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(u){typeof window>"u"||window.localStorage.setItem(tg,String(u))}function l(u){u.preventDefault();const d=u.clientX,p=s.value,g=I=>{const R=I.clientX-d;s.value=r(p+R)},_=()=>{a(s.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",_)}return(u,d)=>(x(),D("div",{class:pt(["desktop-layout",{"is-mobile":je(n)}]),style:To(i.value)},[je(n)?(x(),ht(pa,{key:0,to:"body"},[Ue(oy,{name:"drawer"},{default:Et(()=>[e.isSidebarCollapsed?pe("",!0):(x(),D("div",{key:0,class:"mobile-drawer-backdrop",onClick:d[1]||(d[1]=p=>u.$emit("close-sidebar"))},[b("aside",{class:"mobile-drawer",onClick:d[0]||(d[0]=ft(()=>{},["stop"]))},[so(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):pe("",!0),je(n)?pe("",!0):(x(),D(Ke,{key:1},[e.isSidebarCollapsed?pe("",!0):(x(),D("aside",pR,[so(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?pe("",!0):(x(),D("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),b("section",hR,[so(u.$slots,"content",{},void 0)])],6))}}),St=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},yR=St(vR,[["__scopeId","data-v-4c6dbcd7"]]);function rg(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Co extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Tp(e,t){const n=rg(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const o=rg(r);return o&&typeof o.message=="string"&&o.message.length>0?o.message:t}function Oo(e,t,n){return e instanceof Co?e:e instanceof Error?new Co(e.message||t,{code:"unknown_error",method:n}):new Co(t,{code:"unknown_error",method:n})}function ib(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function _R(e,t){const n={method:e,params:t??null};return nf({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 Co(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 Co(Tp(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 Co(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result})}function bR(e){const t=ib(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 og(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function wR(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,p)=>{if(n||r!==null)return;const g=Math.min(1e3*2**p,1e4);r=window.setTimeout(()=>{r=null,!n&&d()},g)},a=d=>{const p=bR(d);p&&e(p)},l=(d=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const p=new EventSource("/codex-api/events");let g=!1;p.onmessage=_=>{try{a(JSON.parse(_.data))}catch{}},p.addEventListener("ready",_=>{try{const I=_.data?JSON.parse(_.data):{ok:!0};og(e,I)}catch{og(e)}}),p.onerror=()=>{n||g||p.readyState===EventSource.CLOSED&&(g=!0,p.close(),i(()=>l(d+1),d))},t=()=>{g=!0,p.close()}},u=(d=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const p=window.location.protocol==="https:"?"wss:":"ws:",g=new WebSocket(`${p}//${window.location.host}/codex-api/ws`);let _=!1,I=!1,R=window.setTimeout(()=>{_||n||I||(I=!0,g.close(),l())},2500);g.onopen=()=>{_=!0,s(),R!==null&&(window.clearTimeout(R),R=null),hr({category:"ws",message:"WebSocket connected",level:"info"})},g.onmessage=W=>{try{a(JSON.parse(String(W.data)))}catch{}},g.onerror=()=>{},g.onclose=()=>{if(R!==null&&(window.clearTimeout(R),R=null),!(n||I)){if(o++,hr({category:"ws",message:`WebSocket closed (attempt ${d})`,data:{totalReconnects:o},level:"warning"}),nk("ws_reconnects",o),!_){l();return}i(()=>u(d+1),d)}},t=()=>{I=!0,R!==null&&(window.clearTimeout(R),R=null),g.close()}};return typeof WebSocket<"u"?u():l(),()=>{n=!0,s(),t==null||t()}}async function SR(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 Co(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 Co(Tp(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function TR(){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 Co(Tp(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=ib(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function ER(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function en(e){return ER(e)}function kR(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function IR(e){const t=en(e).replace(/[\\/]+/gu,"/");return kR(t)?t.toLowerCase():t}function xs(e){const t=en(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function md(e){const t=en(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function rl(e){return xs(e)||en(e)||"unknown-project"}function sg(e){return new Date(e*1e3).toISOString()}function CR(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const AR=/^##\s+(.+?):\s+(.+?)\s*$/,xR=/^#\s*files mentioned by the user\s*:?\s*$/i;function RR(e){var o,s;const t=e.split(`
54
+ `).findIndex(i=>xR.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(AR);if(!l)break;const u=(o=l[1])==null?void 0:o.trim(),d=(s=l[2])==null?void 0:s.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&d&&r.push({label:u,path:d})}return r}function MR(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 PR(e){return`/codex-local-image?path=${encodeURIComponent(e)}`}function $R(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==="localImage"&&typeof l.path=="string"&&l.path.trim().length>0&&r.push(PR(l.path.trim())),l.type!=="text"&&l.type!=="image"&&l.type!=="localImage"&&o.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:CR(l),isUnhandled:!0});const s=n.join(`
56
+ `),i=RR(s);return{text:MR(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 u=(l[1]??" ").toLowerCase(),d=(s=l[2])==null?void 0:s.trim();if(!d)continue;let p="pending";u==="x"&&(p="completed"),(u==="~"||u===">"||u==="-")&&(p="inProgress"),r.push({step:d,status:p});continue}o.push(a)}return r.length===0?null:{explanation:o.join(`
59
+ `).trim()||void 0,steps:r}}function ig(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 OR(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 ab(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function lb(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 u=l==="update"&&typeof(a==null?void 0:a.move_path)=="string"?a.move_path:null,d=l==="update"?OR(i):l==="add"?{addedLineCount:ig(i),removedLineCount:0}:{addedLineCount:0,removedLineCount:ig(i)};n.push({path:s,operation:l,movedToPath:u,diff:i,...d})}return n}function LR(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=$R(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=DR(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=lb(e.changes),n=ab(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function DR(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function jR(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 FR(e){const t=jR(e);return t.length>0?t:"Untitled thread"}function Ep(e){return(e==null?void 0:e.status)==="inProgress"}function BR(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 Ep(r)}function UR(e){const t=e,n=en(typeof t.cwd=="string"?t.cwd:e.cwd),r=IR(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:FR(e),projectName:rl(n),cwd:n,hasWorktree:o,createdAtIso:sg(e.createdAt),updatedAtIso:sg(e.updatedAt),preview:e.preview,unread:!1,inProgress:BR(e)}}function qR(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 HR(e){const t=e.data.map(UR);return qR(t)}function Vc(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 LR(a))n.push({...l,turnId:s,turnIndex:r})}return n}function WR(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Ep(t.at(-1))}function cb(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(Ep(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const VR=5e3;function gd(e){return e&&e.length>0?e:null}function vd(e){return e&&e.length>0?e:null}const ag=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function lg(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 yn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function mt(e){return typeof e=="string"&&e.length>0?e:null}function Rn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function mc(e){return typeof e=="boolean"?e:null}function zR(e){return e==="payment_required"?e:null}function GR(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function cg(e){const t=yn(e);if(!t)return null;const n=Rn(t.usedPercent??t.used_percent);if(n===null)return null;const r=Rn(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:Rn(t.resetsAt??t.resets_at)}}function KR(e){const t=yn(e);if(!t)return null;const n=mc(t.hasCredits??t.has_credits),r=mc(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:mt(t.balance)}}function Sf(e){const t=yn(e);if(!t)return null;const n=cg(t.primary),r=cg(t.secondary),o=KR(t.credits);return!n&&!r&&!o?null:{limitId:mt(t.limitId??t.limit_id),limitName:mt(t.limitName??t.limit_name),primary:n,secondary:r,credits:o,planType:mt(t.planType??t.plan_type)}}function ub(e,t=null){const n=yn(e);if(!n)return null;const r=mt(n.accountId),o=mt(n.quotaStatus),s=o==="loading"||o==="ready"||o==="error"?o:"idle";return r?{accountId:r,authMode:mt(n.authMode),email:mt(n.email),planType:mt(n.planType),lastRefreshedAtIso:mt(n.lastRefreshedAtIso)??"",lastActivatedAtIso:mt(n.lastActivatedAtIso),quotaSnapshot:Sf(n.quotaSnapshot),quotaUpdatedAtIso:mt(n.quotaUpdatedAtIso),quotaStatus:s,quotaError:mt(n.quotaError),unavailableReason:zR(n.unavailableReason)??(GR(mt(n.quotaError))?"payment_required":null),isActive:mc(n.isActive)??r===t}:null}function db(e){const t=yn(e);if(!t)return null;const n=yn(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=Sf(n==null?void 0:n.codex);return r||Sf(t.rateLimits??t.rate_limits)}async function rn(e,t){try{return await _R(e,t)}catch(n){throw Oo(n,`RPC ${e} failed`,e)}}function fb(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 YR(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function JR(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function XR(){const e=await rn("thread/list",{archived:!1,limit:100,sortKey:"updated_at",modelProviders:[]});return HR(e)}async function QR(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 ZR(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:Vc(n),inProgress:e.isInProgress,activeTurnId:cb(n),turnIndexByTurnId:fb(n)}}async function eM(e){const t=await QR(e);if(t&&!t.liveStateError){const o=ZR(t);if(o&&o.messages.length>0)return o}const n=await rn("thread/read",{threadId:e,includeTurns:!0});return{messages:Vc(n),inProgress:WR(n),activeTurnId:cb(n),turnIndexByTurnId:fb(n)}}async function tM(){try{return await XR()}catch(e){throw Oo(e,"Failed to load thread groups","thread/list")}}async function ug(e){try{return await eM(e)}catch(t){throw Oo(t,`Failed to load thread ${e}`,"thread/read")}}function nM(e){const t=yn(e);if(!t)return null;const n=mt(t.key),r=typeof t.text=="string"?t.text:"",o=mt(t.kind);return!n||!o||o!=="meta"&&o!=="hunk"&&o!=="add"&&o!=="remove"&&o!=="context"?null:{key:n,kind:o,text:r,oldLine:Rn(t.oldLine),newLine:Rn(t.newLine)}}function rM(e){const t=yn(e);if(!t)return null;const n=mt(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:Rn(t.addedLineCount)??0,removedLineCount:Rn(t.removedLineCount)??0,oldStart:Rn(t.oldStart),oldLineCount:Rn(t.oldLineCount)??0,newStart:Rn(t.newStart),newLineCount:Rn(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(s=>nM(s)).filter(s=>s!==null):[]}:null}function oM(e){const t=yn(e);if(!t)return null;const n=mt(t.id),r=mt(t.path),o=mt(t.absolutePath),s=mt(t.operation);return!n||!r||!o||!s||s!=="add"&&s!=="delete"&&s!=="update"&&s!=="rename"?null:{id:n,path:r,absolutePath:o,previousPath:mt(t.previousPath),previousAbsolutePath:mt(t.previousAbsolutePath),operation:s,addedLineCount:Rn(t.addedLineCount)??0,removedLineCount:Rn(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(i=>rM(i)).filter(i=>i!==null):[]}}function pb(e){const t=yn(e),n=yn(t==null?void 0:t.data),r=yn(n==null?void 0:n.summary),o=mt(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",s=mt(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:mt(n==null?void 0:n.cwd)??"",gitRoot:mt(n==null?void 0:n.gitRoot),isGitRepo:mc(n==null?void 0:n.isGitRepo)??!1,scope:o,workspaceView:s,baseBranch:mt(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(i=>mt(i)).filter(i=>typeof i=="string"&&i.length>0):[],headBranch:mt(n==null?void 0:n.headBranch),mergeBaseSha:mt(n==null?void 0:n.mergeBaseSha),generatedAtIso:mt(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:Rn(r==null?void 0:r.fileCount)??0,addedLineCount:Rn(r==null?void 0:r.addedLineCount)??0,removedLineCount:Rn(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(i=>oM(i)).filter(i=>i!==null):[]}}function sM(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 iM(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 u=0;for(const d of l){const p=((i=d[1])==null?void 0:i.trim())??"",g=sM(d[2]??""),_=(d[0]??"").trim(),I=(d[3]??"").split(`
66
+ `).map(R=>R.replace(/^ /u,"")).join(`
67
+ `).trim();s.push({id:`finding:${u}`,title:p||`Finding ${u+1}`,body:I,path:g.absolutePath?g.absolutePath.split("/").filter(Boolean).slice(-1)[0]??g.absolutePath:null,absolutePath:g.absolutePath,startLine:g.startLine,endLine:g.endLine,rawText:_}),u+=1}}return{reviewText:t,summary:r,findings:s}}function dg(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 o2(e){const t=await rn("thread/read",{threadId:e,includeTurns:!0}),n=dg(t,"exitedReviewMode");return{enteredReviewLabel:dg(t,"enteredReviewMode"),result:n?iM(n):null}}function aM(e){return wR(e)}async function lM(e,t){await SR({id:e,...t})}async function cM(){return TR()}async function fg(){try{const e=await rn("account/rateLimits/read");return db(e)}catch(e){throw Oo(e,"Failed to load account rate limits","account/rateLimits/read")}}function kp(e){const t=yn(e),n=mt(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:mt(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(o=>ub(o,n)).filter(o=>o!==null)}}async function uM(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(Nn(t,"Failed to load accounts"));const n=yn(t);return kp(n==null?void 0:n.data)}async function dM(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(Nn(t,"Failed to refresh accounts"));const n=yn(t);return kp(n==null?void 0:n.data)}async function fM(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(Nn(n,"Failed to switch account"));const r=yn(n),o=yn(r==null?void 0:r.data),s=ub(o==null?void 0:o.account,mt(o==null?void 0:o.activeAccountId));if(!s)throw new Error("Failed to switch account");return s}async function pM(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(Nn(n,"Failed to remove account"));const r=yn(n);return kp(r==null?void 0:r.data)}async function yd(e){const t=await rn("thread/resume",{threadId:e});return{model:gc(t)}}async function hM(e){await rn("thread/archive",{threadId:e})}async function mM(e,t){await rn("thread/name/set",{threadId:e,name:t})}async function _d(e,t){const n=await rn("thread/rollback",{threadId:e,numTurns:t});return Vc(n)}async function gM(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 Tf(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 vM(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 gc(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function pg(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 rn("thread/start",n),o=Tf(r);if(!o)throw new Error("thread/start did not return a thread id");return{threadId:o,model:gc(r)}}catch(n){throw Oo(n,"Failed to start a new thread","thread/start")}}async function hg(e,t,n){if(arguments.length<=1)try{const r=await rn("thread/fork",{threadId:e,persistExtendedHistory:!0}),o=Tf(r);if(!o)throw new Error("thread/fork did not return a thread id");return{threadId:o,cwd:vM(r),model:gc(r),messages:Vc(r)}}catch(r){throw Oo(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 rn("thread/fork",o),i=Tf(s);if(!i)throw new Error("thread/fork did not return a thread id");return{threadId:i,model:gc(s)}}catch(r){throw Oo(r,`Failed to fork thread ${e}`,"thread/fork")}}function mg(e){var t;if(!e)return null;try{const n=new URL(e,"http://localhost");if(n.pathname!=="/codex-local-image")return null;const r=((t=n.searchParams.get("path"))==null?void 0:t.trim())??"";return r.length>0?r:null}catch{return null}}function yM(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
+ `}function _M(e){const t=e.replace(/\\/g,"/");return t.split("/").filter(Boolean).at(-1)??t}async function bM(e,t,n){var l;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?gd(n):vd(n)};let o=null;try{o=await mb()}catch{o=null}const s=(o==null?void 0:o.model.trim())??"";if(s)return{model:s,reasoningEffort:e==="plan"?gd(n??(o==null?void 0:o.reasoningEffort)):vd(n??(o==null?void 0:o.reasoningEffort))};let i=[];try{i=await hb()}catch{i=[]}const a=((l=i.find(u=>u.trim().length>0))==null?void 0:l.trim())??"";if(a)return{model:a,reasoningEffort:e==="plan"?gd(n??(o==null?void 0:o.reasoningEffort)):vd(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 bd(e,t,n=[],r,o,s,i=[],a){var l;try{const u=(r==null?void 0:r.trim())??"",d=[];for(const $ of n){const q=mg($.trim());q&&d.push({label:_M(q),path:q,fsPath:q})}const p=[...i,...d],g=p.filter(($,q)=>p.findIndex(z=>z.fsPath===$.fsPath)===q),I=[{type:"text",text:yM(t,g)}];for(const $ of n){const q=$.trim();if(!q)continue;const z=mg(q);if(z){I.push({type:"localImage",path:z});continue}I.push({type:"image",url:q,image_url:q})}if(s)for(const $ of s)I.push({type:"skill",name:$.name,path:$.path});const R=g.map($=>({label:$.label,path:$.path,fsPath:$.fsPath})),W={threadId:e,input:I};if(R.length>0&&(W.attachments=R),u&&(W.model=u),typeof o=="string"&&o.length>0&&(W.effort=o),a){const $=await bM(a,u,o);W.collaborationMode={mode:a,settings:{model:$.model,reasoning_effort:$.reasoningEffort,developer_instructions:null}}}const M=await rn("turn/start",W);return typeof((l=M==null?void 0:M.turn)==null?void 0:l.id)=="string"?M.turn.id.trim():""}catch(u){throw Oo(u,`Failed to start turn for thread ${e}`,"turn/start")}}async function wM(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 rn("turn/interrupt",{threadId:n,turnId:r})}catch(o){throw Oo(o,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function SM(e){const t=e==="fast"?"fast":"standard";await rn("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 TM(){return await(await fetch("/codex-api/free-mode/status")).json()}async function gg(e){return await(await fetch("/codex-api/free-mode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enable:e})})).json()}async function vg(e){return await(await fetch("/codex-api/free-mode/custom-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e})})).json()}async function EM(e,t){return await(await fetch("/codex-api/free-mode/custom-provider",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t})})).json()}async function hb(){const e=await rn("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(VR)});let r=null;try{r=await n.json()}catch{r=null}if(n.ok&&Array.isArray(r==null?void 0:r.data)){if(r.exclusive)return r.data.filter(o=>typeof o=="string"&&o.trim().length>0);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 mb(){const e=await rn("config/read",{}),t=e.config.model??"",n=YR(e.config.model_reasoning_effort),r=JR(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}function kM(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function IM(){try{const e=await rn("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:kM(r.name||o)||(o==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of ag)t.has(r.value)||n.push(r);return n.sort((r,o)=>r.value===o.value?0:r.value==="default"?-1:1)}}catch{}return ag}function CM(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"?en(s):"";a.length>0&&typeof i=="string"&&(o[a]=i)}return{order:n(t.order).map(s=>en(s)),labels:o,active:n(t.active).map(s=>en(s))}}async function Rs(){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 CM(n.data)}async function AM(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:en(o.data.cwd),gitRoot:en(o.data.gitRoot)}}async function xM(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 u=l,d=typeof u.value=="string"?u.value.trim():"",p=typeof u.label=="string"?u.label.trim():"";!d||a.has(d)||(a.add(d),i.push({value:d,label:p||d}))}return i}async function RM(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:[],u=[],d=new Set;for(const p of l){if(!p||typeof p!="object"||Array.isArray(p))continue;const g=p,_=typeof g.value=="string"?g.value.trim():"",I=typeof g.label=="string"?g.label.trim():"";!_||d.has(_)||(d.add(_),u.push({value:_,label:I||_}))}return a&&!d.has(a)&&u.unshift({value:a,label:a}),{currentBranch:a,options:u}}async function MM(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 s2(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(Nn(i,"Failed to load review snapshot"));return pb(i)}async function i2(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(Nn(n,"Failed to apply review action"));return pb(n)}async function a2(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(Nn(n,"Failed to initialize Git"))}async function l2(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 rn("review/start",{threadId:e,target:o,delivery:"inline"})}async function yg(){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 PM(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 gb(r);if(!r.ok){const l=Nn(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"?en(i.path):"",parentPath:typeof i.parentPath=="string"?en(i.parentPath):"",entries:a.flatMap(l=>{if(!l||typeof l!="object"||Array.isArray(l))return[];const u=l,d=typeof u.name=="string"?u.name.trim():"",p=typeof u.path=="string"?en(u.path):"";return d&&p?[{name:d,path:p}]:[]})}}async function gb(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 wd(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 Sd(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=Nn(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"?en(s.path):""}async function $M(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await gb(t);if(!t.ok){const s=Nn(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"?en(o.path):""}async function NM(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=Nn(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"?en(s.path):""}}async function OM(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 u=Nn(s,"Failed to search files");throw new Error(u)}const i=s&&typeof s=="object"&&!Array.isArray(s)?s:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const p=u.path,g=typeof p=="string"?p.trim():"";g&&l.push({path:g})}return l}async function LM(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 DM(e,t){const n=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e,allowedUserIds:t})}),r=await n.json();if(!n.ok){const o=Nn(r,"Failed to connect Telegram bot");throw new Error(o)}}async function jM(){const e=await fetch("/codex-api/telegram/config"),t=await e.json();if(!e.ok){const i=Nn(t,"Failed to load Telegram configuration");throw new Error(i)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{},o=Array.isArray(r.allowedUserIds)?r.allowedUserIds:[],s=[];for(const i of o){if(i==="*"){s.push("*");continue}typeof i=="number"&&Number.isFinite(i)&&s.push(Math.trunc(i))}return{botToken:typeof r.botToken=="string"?r.botToken:"",allowedUserIds:s}}async function FM(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const o=Nn(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,allowedUsers:typeof r.allowedUsers=="number"?r.allowedUsers:0,allowAllUsers:r.allowAllUsers===!0,lastError:typeof r.lastError=="string"?r.lastError:""}}function BM(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 UM(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 p=new URLSearchParams({q:`created:>=${BM(d)}`,sort:"stars",order:"desc",per_page:String(n)}),g=await fetch(`https://api.github.com/search/repositories?${p.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!g.ok)throw new Error(`Failed to fetch GitHub search projects (${g.status})`);const _=await g.json(),I=_&&typeof _=="object"&&!Array.isArray(_)?_:{},R=Array.isArray(I.items)?I.items:[],W=[];for(const M of R){if(!M||typeof M!="object"||Array.isArray(M))continue;const $=M,q=typeof $.id=="number"?$.id:0,z=typeof $.full_name=="string"?$.full_name.trim():"",ue=typeof $.html_url=="string"?$.html_url.trim():"";if(!q||!z||!ue)continue;const[ne="",J=""]=z.split("/",2);W.push({id:q,fullName:z,owner:ne,repo:J,url:ue,description:lg(z,typeof $.description=="string"?$.description:""),language:typeof $.language=="string"?$.language.trim():"",stars:typeof $.stargazers_count=="number"?$.stargazers_count:0})}return W}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=Nn(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:[],u=[];for(const d of l){if(!d||typeof d!="object"||Array.isArray(d))continue;const p=d,g=typeof p.id=="number"?p.id:0,_=typeof p.fullName=="string"?p.fullName.trim():"",I=typeof p.url=="string"?p.url.trim():"";if(!g||!_||!I)continue;const[R="",W=""]=_.split("/",2);u.push({id:g,fullName:_,owner:R,repo:W,url:I,description:lg(_,typeof p.description=="string"?p.description:""),language:typeof p.language=="string"?p.language.trim():"",stars:typeof p.stars=="number"?p.stars:0})}return u}function Nn(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 qM(){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 Td(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 HM(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function WM(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function VM(e,t){var n;try{return((n=(await rn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function zM(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await rn("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 GM=6e4;async function Ed(e){const t=new AbortController,n=setTimeout(()=>t.abort(),GM);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 KM={},YM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function JM(e,t){return x(),D("svg",YM,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Ip=St(KM,[["render",JM]]),XM={},QM={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ZM(e,t){return x(),D("svg",QM,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const eP=St(XM,[["render",ZM]]),tP={},nP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rP(e,t){return x(),D("svg",nP,[...t[0]||(t[0]=[b("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 aa=St(tP,[["render",rP]]),oP={},sP={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function iP(e,t){return x(),D("svg",sP,[...t[0]||(t[0]=[b("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 vc=St(oP,[["render",iP]]),aP={},lP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cP(e,t){return x(),D("svg",lP,[...t[0]||(t[0]=[b("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 Cp=St(aP,[["render",cP]]),uP={},dP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fP(e,t){return x(),D("svg",dP,[...t[0]||(t[0]=[b("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 pP=St(uP,[["render",fP]]),hP={},mP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gP(e,t){return x(),D("svg",mP,[...t[0]||(t[0]=[b("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 Ql=St(hP,[["render",gP]]),vP={},yP={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _P(e,t){return x(),D("svg",yP,[...t[0]||(t[0]=[b("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 kd=St(vP,[["render",_P]]),bP={key:0,class:"sidebar-menu-row-left"},wP={class:"sidebar-menu-row-main"},SP={key:1,class:"sidebar-menu-row-right"},TP={key:0,class:"sidebar-menu-row-right-default"},EP={key:1,class:"sidebar-menu-row-right-hover"},kP=Tn({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=yS(),r=oe(()=>!!n.left),o=oe(()=>!!n.right),s=oe(()=>!!n["right-hover"]),i=oe(()=>o.value||s.value);return(a,l)=>(x(),ht(Hf(t.as),Qv({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:Et(()=>[r.value?(x(),D("span",bP,[so(a.$slots,"left",{},void 0,!0)])):pe("",!0),b("span",wP,[so(a.$slots,"default",{},void 0,!0)]),i.value?(x(),D("span",SP,[o.value?(x(),D("span",TP,[so(a.$slots,"right",{},void 0,!0)])):pe("",!0),s.value?(x(),D("span",EP,[so(a.$slots,"right-hover",{},void 0,!0)])):pe("",!0)])):pe("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Cs=St(kP,[["__scopeId","data-v-36239f39"]]),IP={class:"thread-tree-root"},CP={key:0,class:"pinned-section"},AP={class:"thread-list"},xP=["data-menu-open"],RP={class:"thread-left-stack"},MP=["data-state"],PP=["onClick"],$P=["onClick"],NP={class:"thread-row-title-wrap"},OP={class:"thread-row-title-line"},LP={class:"thread-row-title"},DP=["data-state"],jP={class:"thread-row-time"},FP=["onClick"],BP=["aria-expanded"],UP=["data-active"],qP={key:0},HP=["data-active"],WP={key:0},VP={key:1,class:"thread-tree-no-results"},zP={key:2,class:"thread-tree-loading"},GP={key:3,class:"thread-list thread-list-global"},KP=["data-menu-open"],YP={class:"thread-left-stack"},JP=["data-state"],XP=["onClick"],QP=["onClick"],ZP={class:"thread-row-title-wrap"},e$={class:"thread-row-title-line"},t$={class:"thread-row-title"},n$=["data-state"],r$={class:"thread-row-time"},o$=["onClick"],s$=["data-project-name","data-expanded","data-dragging"],i$={class:"project-icon-stack"},a$={class:"project-icon-folder"},l$={class:"project-icon-chevron"},c$=["data-dragging-handle","onMousedown"],u$={class:"project-title"},d$={class:"project-hover-controls"},f$=["onClick"],p$=["data-open-direction"],h$=["onClick"],m$=["onClick"],g$=["onInput"],v$=["aria-label","title","onClick"],y$={key:0,class:"thread-list"},_$=["data-menu-open"],b$={class:"thread-left-stack"},w$=["data-state"],S$=["onClick"],T$=["onClick"],E$={class:"thread-row-title-wrap"},k$={class:"thread-row-title-line"},I$={class:"thread-row-title"},C$=["data-state"],A$={class:"thread-row-time"},x$=["onClick"],R$=["onClick"],M$=["data-open-direction"],P$={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},$$=["onKeydown"],N$={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},O$={class:"rename-thread-subtitle"},L$=4,_g=6,bg="codex-web-local.thread-view-mode.v1",wg="codex-web-local.collapsed-projects.v1",D$=Tn({__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=O({}),s=O({});let i=!1;const a=O([]),l=O(""),u=O(""),d=O({}),p=O({}),g=O({}),_=O("actions"),I=O(""),R=O(!1),W=O(""),M=O(""),$=O(null),q=O(!1),z=O(""),ue=O(""),ne=O(null),J=O(null),he=O(null);let xe=null,Ce=null;const Pe=O(""),Y=O({}),de=new Map,Ae=new Map,De=new Map,ve=new WeakMap,Se=O(null),ae=O(null),ke=O(!1),Ne=O(He()),Me=typeof window<"u"?new ResizeObserver(w=>{for(const E of w){const m=E.target,S=ve.get(m);S&&Rt(S,m)}}):null;function qe(){if(typeof window>"u")return{};try{const w=window.localStorage.getItem(wg);if(!w)return{};const E=JSON.parse(w);return!E||typeof E!="object"||Array.isArray(E)?{}:E}catch{return{}}}function He(){return typeof window>"u"?"project":window.localStorage.getItem(bg)==="chronological"?"chronological":"project"}s.value=qe(),it(s,w=>{typeof window>"u"||window.localStorage.setItem(wg,JSON.stringify(w))},{deep:!0}),it(Ne,w=>{typeof window>"u"||window.localStorage.setItem(bg,w)});const Ve=oe(()=>n.searchQuery.trim().toLowerCase()),ot=oe(()=>Ve.value.length>0),Ge=oe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),K=oe(()=>new Set(a.value));function _e(w){if(!ot.value)return!0;if(Ge.value)return Ge.value.has(w.id);const E=Ve.value;return w.title.toLowerCase().includes(E)||w.preview.toLowerCase().includes(E)}const fe=oe(()=>ot.value?n.groups.map(w=>({...w,threads:w.threads.filter(_e)})).filter(w=>w.threads.length>0):n.groups),Oe=oe(()=>Ne.value==="chronological"),Ye=oe(()=>{const w=fe.value,E=[];for(const m of w)for(const S of m.threads)K.value.has(S.id)||E.push(S);return E.sort((m,S)=>{const U=new Date(m.updatedAtIso||m.createdAtIso).getTime();return new Date(S.updatedAtIso||S.createdAtIso).getTime()-U})}),k=oe(()=>{const w=new Map;for(const E of n.groups)for(const m of E.threads)w.set(m.id,m);return w});it(a,w=>{i&&WM(w)}),it(k,w=>{const E=a.value.filter(m=>w.has(m));E.length!==a.value.length&&(a.value=E)}),cs(async()=>{const{threadIds:w}=await HM(),E=Array.isArray(w)?w.filter(m=>typeof m=="string").map(m=>m.trim()).filter((m,S,U)=>m.length>0&&U.indexOf(m)===S):[];E.length>0&&(a.value=E),i=!0});const C=oe(()=>{const w=new Map;for(const E of n.groups)for(const m of E.threads)w.set(m.id,E.projectName);return w}),H=oe(()=>{const w=new Map;for(const E of n.groups){const m=E.threads.filter(S=>!K.value.has(S.id));w.set(E.projectName,m)}return w}),X=oe(()=>{const w=new Map;for(const E of n.groups)for(const m of E.threads){const S=new Date(m.updatedAtIso||m.createdAtIso).getTime();w.set(m.id,S)}return w}),Z=oe(()=>{const w=u.value;return w?k.value.get(w)??null:null}),Q=oe(()=>a.value.map(w=>k.value.get(w)??null).filter(w=>w!==null).filter(_e)),ie=oe(()=>{const w=he.value;if(!w||w.dropTargetIndexFull===null||n.groups.length===0)return null;const E=Math.max(0,Math.min(w.dropTargetIndexFull,n.groups.length)),m=E>w.fromIndex?E-1:E,S=Math.max(0,Math.min(m,n.groups.length-1));return S===w.fromIndex?null:S}),me=oe(()=>{const E=(ot.value?fe.value:n.groups).map(nt=>nt.projectName),m=he.value,S=ie.value;if(!m||S===null)return E;const U=[...E],[ge]=U.splice(m.fromIndex,1);return ge?(U.splice(S,0,ge),U):E}),se=oe(()=>{const w={};let E=0;for(const m of me.value)w[m]=E,E+=hn(m);return w}),te=oe(()=>{let w=0;for(const E of me.value)w+=hn(E);return{height:`${Math.max(0,w)}px`}});function Le(w){if(Number.isNaN(w))return"n/a";const E=Math.abs(Date.now()-w);if(E<6e4)return"now";const m=Math.floor(E/6e4);if(m<60)return`${m}m`;const S=Math.floor(m/60);return S<24?`${S}h`:`${Math.floor(S/24)}d`}function ye(w){const E=X.value.get(w.id);return Le(typeof E=="number"?E:new Date(w.updatedAtIso||w.createdAtIso).getTime())}function be(w){return K.value.has(w)}function we(w){if(be(w)){a.value=a.value.filter(E=>E!==w);return}a.value=[w,...a.value]}function N(w){r("select",w)}function P(w){r("export-thread",w),tt()}function B(w){r("fork-thread",w),tt()}function G(w){return`start new thread ${sn(w)}`}function le(w){r("start-new-thread",w)}function Re(w){r("browse-thread-files",w),tt()}function Fe(w,E){if(u.value===w){if(E){const m=E.relatedTarget,S=ae.value;if(m instanceof Node&&S&&S.contains(m))return}tt()}}function et(w){return u.value===w}function tt(){u.value="",g.value={}}function Pt(w){if(u.value===w){tt();return}_t(),ke.value=!1,u.value=w,Yt(()=>{bn(w)})}function Vt(w,E){w.preventDefault(),u.value=E}function On(w,E){W.value=w,M.value=E,R.value=!0,tt(),Yt(()=>{var m,S;(m=$.value)==null||m.focus(),(S=$.value)==null||S.select()})}function st(){R.value=!1,W.value="",M.value=""}function Ft(){const w=W.value,E=M.value.trim();!w||!E||(r("rename-thread",{threadId:w,title:E}),st())}function on(w,E){z.value=w,ue.value=E,q.value=!0,tt()}function pn(){q.value=!1,z.value="",ue.value=""}function Jn(){const w=z.value;w&&(a.value=a.value.filter(E=>E!==w),r("archive",w),pn())}function sn(w){return n.projectDisplayNameById[w]??w}function an(w){return l.value===w}function _t(){l.value="",_.value="actions",I.value=""}function _n(){const w=!ke.value;w&&(_t(),tt()),ke.value=w}function Lt(w){Ne.value=w,ke.value=!1}function Ir(w){if(l.value===w){_t();return}tt(),ke.value=!1,l.value=w,_.value="actions",I.value=sn(w),Yt(()=>{Tt(w)})}function lo(w){tt(),l.value=w,_.value="rename",I.value=sn(w),Yt(()=>{Tt(w)})}function Hr(w){r("rename-project",{projectName:w,displayName:I.value})}function co(w){r("remove-project",w),_t()}function Wr(w,E){if(!w.altKey||w.key!=="ArrowUp"&&w.key!=="ArrowDown")return;const m=n.groups.findIndex(ge=>ge.projectName===E);if(m<0)return;const S=w.key==="ArrowUp"?-1:1,U=Math.max(0,Math.min(m+S,n.groups.length-1));U!==m&&(w.preventDefault(),r("reorder-project",{projectName:E,toIndex:U}))}function Ln(w){return o.value[w]===!0}function Xt(w){return s.value[w]===!0}function Vr(w){o.value={...o.value,[w]:!Ln(w)}}function ln(w){if(Pe.value===w){Pe.value="";return}s.value={...s.value,[w]:!Xt(w)}}function hn(w){const E=Y.value[w]??0,m=he.value,U=((m==null?void 0:m.projectName)===w?m.groupHeight:null)??E,ge=Xt(w)?0:_g;return Math.max(0,U+ge)}function Xn(w,E){const m=E instanceof HTMLElement?E:E&&"$el"in E&&E.$el instanceof HTMLElement?E.$el:null;if(m){Ae.set(w,m);return}Ae.delete(w)}function ar(w,E){const m=E instanceof HTMLElement?E:E&&"$el"in E&&E.$el instanceof HTMLElement?E.$el:null;if(m){De.set(w,m);return}De.delete(w)}function Dn(w){let E=w.parentElement;for(;E;){const m=window.getComputedStyle(E),S=m.overflowY||m.overflow;if(S==="auto"||S==="scroll"||S==="hidden"||S==="clip")return E.getBoundingClientRect();E=E.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Cr(w,E){const m=w.getBoundingClientRect(),S=Dn(w),U=6,ge=S.bottom-m.bottom,nt=m.top-S.top;return ge>=E+U?"down":nt>ge?"up":"down"}function zr(w,E){const m=De.get(w);if(!m)return"down";const S=Cr(m,E);return p.value={...p.value,[w]:S},S}function lr(w){return p.value[w]??"down"}function Tt(w){const E=Ae.get(w);E&&(d.value={...d.value,[w]:Cr(E,112)})}function mn(w,E,m){return Math.min(Math.max(w,E),m)}function bn(w){const E=De.get(w);if(!E)return;const m=ae.value,S=m==null?void 0:m.getBoundingClientRect(),U=(S==null?void 0:S.height)||(m==null?void 0:m.offsetHeight)||112,ge=(S==null?void 0:S.width)||(m==null?void 0:m.offsetWidth)||160,nt=zr(w,U),Mt=E.getBoundingClientRect(),lt=8,ct=4,ut=Math.max(lt,window.innerWidth-ge-lt),Hn=mn(Mt.right-ge,lt,ut),gn=mn(nt==="up"?Mt.top-U-ct:Mt.bottom+ct,lt,Math.max(lt,window.innerHeight-U-lt));g.value={left:`${Math.round(Hn)}px`,top:`${Math.round(gn)}px`}}function En(){const w=u.value;w&&bn(w)}function Bt(){window.addEventListener("resize",En),document.addEventListener("scroll",En,!0)}function xt(){window.removeEventListener("resize",En),document.removeEventListener("scroll",En,!0)}function Ut(w){const E=l.value;if(!E)return!1;const m=Ae.get(E);if(!m)return!1;if((typeof w.composedPath=="function"?w.composedPath():[]).includes(m))return!0;const U=w.target;return U instanceof Node?m.contains(U):!1}function jn(w){const E=u.value;if(!E)return!1;const m=De.get(E);if(!m)return!1;const S=typeof w.composedPath=="function"?w.composedPath():[];if(S.includes(m))return!0;const U=ae.value;if(U&&S.includes(U))return!0;const ge=w.target;return ge instanceof Node?!!(m.contains(ge)||U&&U.contains(ge)):!1}function kn(w){if(ke.value){const E=Se.value,m=typeof w.composedPath=="function"?w.composedPath():[];!!E&&(m.includes(E)||w.target instanceof Node&&E.contains(w.target))||(ke.value=!1)}l.value&&(Ut(w)||_t(),u.value&&(jn(w)||tt()))}function Qn(w){l.value&&!Ut(w)&&_t(),u.value&&!jn(w)&&tt()}function Zn(){ke.value&&(ke.value=!1),l.value&&_t(),u.value&&tt()}function cr(){window.addEventListener("pointerdown",kn,{capture:!0}),window.addEventListener("focusin",Qn,{capture:!0}),window.addEventListener("blur",Zn)}function bt(){window.removeEventListener("pointerdown",kn,{capture:!0}),window.removeEventListener("focusin",Qn,{capture:!0}),window.removeEventListener("blur",Zn)}function Rt(w,E){const m=E.getBoundingClientRect().height;if(!Number.isFinite(m)||m<=0)return;const S=Y.value[w];S!==void 0&&Math.abs(S-m)<.5||(Y.value={...Y.value,[w]:m})}function ps(w,E){const m=de.get(w);m&&m!==E&&Me&&Me.unobserve(m);const S=E instanceof HTMLElement?E:E&&"$el"in E&&E.$el instanceof HTMLElement?E.$el:null;if(S){de.set(w,S),ve.set(S,w),Rt(w,S),Me==null||Me.observe(S);return}m&&(Me==null||Me.unobserve(m)),de.delete(w)}function er(w,E){if(w.button!==0||J.value||he.value)return;const m=n.groups.findIndex(nt=>nt.projectName===E),S=de.get(E);if(m<0||!S)return;const U=S.getBoundingClientRect(),ge=Xt(E)?0:_g;J.value={projectName:E,fromIndex:m,startClientX:w.clientX,startClientY:w.clientY,pointerOffsetY:w.clientY-U.top,groupLeft:U.left,groupWidth:U.width,groupHeight:U.height,groupOuterHeight:U.height+ge},w.preventDefault(),Ar()}function Ar(){window.addEventListener("mousemove",qt),window.addEventListener("mouseup",ur),window.addEventListener("keydown",Gr)}function xr(){window.removeEventListener("mousemove",qt),window.removeEventListener("mouseup",ur),window.removeEventListener("keydown",Gr)}function qt(w){xe={clientX:w.clientX,clientY:w.clientY},In()}function ur(w){nn({clientX:w.clientX,clientY:w.clientY});const E=he.value;if(E&&ie.value!==null){const m=n.groups.findIndex(S=>S.projectName===E.projectName);if(m>=0){const S=ie.value;S!==m&&r("reorder-project",{projectName:E.projectName,toIndex:S})}}Ht()}function Gr(w){w.key==="Escape"&&(!J.value&&!he.value||(w.preventDefault(),Ht()))}function Ht(){Ce!==null&&(window.cancelAnimationFrame(Ce),Ce=null),xe=null,J.value=null,he.value=null,Pe.value="",xr()}function In(){Ce===null&&(Ce=window.requestAnimationFrame(()=>{if(Ce=null,!xe)return;const w=xe;xe=null,nn(w)}))}function nn(w){const E=J.value;if(!he.value&&E){const m=w.clientX-E.startClientX,S=w.clientY-E.startClientY;if(Math.hypot(m,S)<L$)return;_t(),Pe.value=E.projectName,he.value={projectName:E.projectName,fromIndex:E.fromIndex,pointerOffsetY:E.pointerOffsetY,groupLeft:E.groupLeft,groupWidth:E.groupWidth,groupHeight:E.groupHeight,groupOuterHeight:E.groupOuterHeight,ghostTop:w.clientY-E.pointerOffsetY,dropTargetIndexFull:null}}he.value&&Kr(w)}function Kr(w){const E=he.value;if(!E)return;if(E.ghostTop=w.clientY-E.pointerOffsetY,!Yr(w)){E.dropTargetIndexFull=null;return}const m=w.clientY,S=ne.value;if(!S){E.dropTargetIndexFull=null;return}const U=S.getBoundingClientRect(),ge=new Map(n.groups.map((ct,ut)=>[ct.projectName,ut])),nt=n.groups.map(ct=>ct.projectName).filter(ct=>ct!==E.projectName);let Mt=0,lt=n.groups.length;for(const ct of nt){const ut=ge.get(ct);if(ut===void 0)continue;const Hn=hn(ct),gn=U.top+Mt+Hn/2;if(m<gn){lt=ut;break}Mt+=Hn}E.dropTargetIndexFull=lt}function Yr(w){const E=ne.value;if(!E)return!1;const m=E.getBoundingClientRect(),S=w.clientX>=m.left&&w.clientX<=m.right,U=w.clientY>=m.top-32&&w.clientY<=m.bottom+32;return S&&U}function dr(w){var E;return((E=he.value)==null?void 0:E.projectName)===w}function Rr(w){const E=he.value,m=se.value[w]??0,S=u.value?C.value.get(u.value)??"":"",U=l.value===w||S===w;return!E||E.projectName!==w?{position:"absolute",top:"0",left:"0",right:"0",zIndex:U?"40":"1",transform:`translate3d(0, ${m}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${E.groupLeft}px`,width:`${E.groupWidth}px`,height:`${E.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${E.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function zt(w){return H.value.get(w.projectName)??[]}function tr(w){if(ot.value)return zt(w);if(Xt(w.projectName))return[];const E=zt(w);return Ln(w.projectName)?E:E.slice(0,10)}function Fn(w){return ot.value?!1:!Xt(w.projectName)&&zt(w).length>10}function Bn(w){return zt(w).length>0}function Qt(w){return!!w.pendingRequestState||w.inProgress||w.unread}function Un(w){return w.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function qn(w){return w.pendingRequestState==="approval"?"awaiting-approval":w.pendingRequestState==="response"?"awaiting-response":w.inProgress?"working":w.unread?"unread":"idle"}it(()=>n.groups.map(w=>w.projectName),w=>{var U,ge;const E=((U=he.value)==null?void 0:U.projectName)??((ge=J.value)==null?void 0:ge.projectName)??"";E&&!n.groups.some(nt=>nt.projectName===E)&&Ht();const m=new Set(w),S=Object.fromEntries(Object.entries(Y.value).filter(([nt])=>m.has(nt)));Object.keys(S).length!==Object.keys(Y.value).length&&(Y.value=S)});const jo=oe(()=>ke.value||l.value!==""||u.value!=="");return it(jo,w=>{if(w){cr();return}bt()}),it(u,w=>{if(!w){xt();return}Bt(),Yt(()=>{bn(w)})}),Ws(()=>{for(const w of de.values())Me==null||Me.unobserve(w);de.clear(),Ae.clear(),xt(),bt(),Ht()}),(w,E)=>(x(),D("section",IP,[Q.value.length>0?(x(),D("section",CP,[b("ul",AP,[(x(!0),D(Ke,null,jt(Q.value,m=>(x(),D("li",{key:m.id,class:"thread-row-item","data-menu-open":et(m.id)?"true":"false"},[Ue(Cs,{class:"thread-row","data-active":m.id===e.selectedThreadId,"data-pinned":be(m.id),"data-menu-open":et(m.id)?"true":"false","force-right-hover":et(m.id),onMouseleave:S=>Fe(m.id,S),onContextmenu:S=>Vt(S,m.id)},{left:Et(()=>[b("span",RP,[Qt(m)?(x(),D("span",{key:0,class:"thread-status-indicator","data-state":qn(m)},null,8,MP)):pe("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:S=>we(m.id)},[Ue(kd,{class:"thread-icon"})],8,PP)])]),right:Et(()=>[b("span",jP,ce(ye(m)),1)]),"right-hover":Et(()=>[b("div",{ref_for:!0,ref:S=>ar(m.id,S),class:"thread-menu-wrap"},[b("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ft(S=>Pt(m.id),["stop"])},[Ue(aa,{class:"thread-icon"})],8,FP)],512)]),default:Et(()=>[b("button",{class:"thread-main-button",type:"button",onClick:S=>N(m.id)},[b("span",NP,[b("span",OP,[b("span",LP,ce(m.title),1),m.hasWorktree?(x(),ht(Ql,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0),m.pendingRequestState?(x(),D("span",{key:1,class:"thread-row-request-chip","data-state":m.pendingRequestState},ce(Un(m)),9,DP)):pe("",!0)])])],8,$P)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,xP))),128))])])):pe("",!0),Ue(Cs,{as:"header",class:"thread-tree-header-row"},{right:Et(()=>[b("div",{ref_key:"organizeMenuWrapRef",ref:Se,class:"organize-menu-wrap"},[b("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ke.value,"aria-label":"Organize threads",title:"Organize threads",onClick:_n},[Ue(aa,{class:"thread-icon"})],8,BP),ke.value?(x(),D("div",{key:0,class:"organize-menu-panel",onClick:E[2]||(E[2]=ft(()=>{},["stop"]))},[E[14]||(E[14]=b("p",{class:"organize-menu-title"},"Organize",-1)),b("button",{class:"organize-menu-item","data-active":Ne.value==="project",type:"button",onClick:E[0]||(E[0]=m=>Lt("project"))},[E[12]||(E[12]=b("span",null,"By project",-1)),Ne.value==="project"?(x(),D("span",qP,"✓")):pe("",!0)],8,UP),b("button",{class:"organize-menu-item","data-active":Ne.value==="chronological",type:"button",onClick:E[1]||(E[1]=m=>Lt("chronological"))},[E[13]||(E[13]=b("span",null,"Chronological list",-1)),Ne.value==="chronological"?(x(),D("span",WP,"✓")):pe("",!0)],8,HP)])):pe("",!0)],512)]),default:Et(()=>[E[15]||(E[15]=b("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),ot.value&&fe.value.length===0?(x(),D("p",VP,"No matching threads")):e.isLoading&&e.groups.length===0?(x(),D("p",zP,"Loading threads...")):Oe.value?(x(),D("ul",GP,[(x(!0),D(Ke,null,jt(Ye.value,m=>(x(),D("li",{key:m.id,class:"thread-row-item","data-menu-open":et(m.id)?"true":"false"},[Ue(Cs,{class:"thread-row","data-active":m.id===e.selectedThreadId,"data-pinned":be(m.id),"data-menu-open":et(m.id)?"true":"false","force-right-hover":et(m.id),onMouseleave:S=>Fe(m.id,S),onContextmenu:S=>Vt(S,m.id)},{left:Et(()=>[b("span",YP,[Qt(m)?(x(),D("span",{key:0,class:"thread-status-indicator","data-state":qn(m)},null,8,JP)):pe("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:S=>we(m.id)},[Ue(kd,{class:"thread-icon"})],8,XP)])]),right:Et(()=>[b("span",r$,ce(ye(m)),1)]),"right-hover":Et(()=>[b("div",{ref_for:!0,ref:S=>ar(m.id,S),class:"thread-menu-wrap"},[b("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ft(S=>Pt(m.id),["stop"])},[Ue(aa,{class:"thread-icon"})],8,o$)],512)]),default:Et(()=>[b("button",{class:"thread-main-button",type:"button",onClick:S=>N(m.id)},[b("span",ZP,[b("span",e$,[b("span",t$,ce(m.title),1),m.hasWorktree?(x(),ht(Ql,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0),m.pendingRequestState?(x(),D("span",{key:1,class:"thread-row-request-chip","data-state":m.pendingRequestState},ce(Un(m)),9,n$)):pe("",!0)])])],8,QP)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,KP))),128))])):(x(),D("div",{key:4,ref_key:"groupsContainerRef",ref:ne,class:"thread-tree-groups",style:To(te.value)},[(x(!0),D(Ke,null,jt(fe.value,m=>(x(),D("article",{key:m.projectName,ref_for:!0,ref:S=>ps(m.projectName,S),class:"project-group","data-project-name":m.projectName,"data-expanded":!Xt(m.projectName),"data-dragging":dr(m.projectName),style:To(Rr(m.projectName))},[Ue(Cs,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:S=>ln(m.projectName),onKeydown:[S=>Wr(S,m.projectName),Zt(ft(S=>ln(m.projectName),["prevent"]),["enter"]),Zt(ft(S=>ln(m.projectName),["prevent"]),["space"])]},{left:Et(()=>[b("span",i$,[b("span",a$,[Xt(m.projectName)?(x(),ht(Cp,{key:0,class:"thread-icon"})):(x(),ht(pP,{key:1,class:"thread-icon"}))]),b("span",l$,[Xt(m.projectName)?(x(),ht(eP,{key:0,class:"thread-icon"})):(x(),ht(Ip,{key:1,class:"thread-icon"}))])])]),right:Et(()=>[b("div",d$,[b("div",{ref_for:!0,ref:S=>Xn(m.projectName,S),class:"project-menu-wrap"},[b("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ft(S=>Ir(m.projectName),["stop"])},[Ue(aa,{class:"thread-icon"})],8,f$),an(m.projectName)?(x(),D("div",{key:0,class:"project-menu-panel","data-open-direction":d.value[m.projectName]??"down",onClick:E[4]||(E[4]=ft(()=>{},["stop"]))},[_.value==="actions"?(x(),D(Ke,{key:0},[b("button",{class:"project-menu-item",type:"button",onClick:S=>lo(m.projectName)}," Edit name ",8,h$),b("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:S=>co(m.projectName)}," Remove ",8,m$)],64)):(x(),D(Ke,{key:1},[E[16]||(E[16]=b("label",{class:"project-menu-label"},"Project name",-1)),Gn(b("input",{"onUpdate:modelValue":E[3]||(E[3]=S=>I.value=S),class:"project-menu-input",type:"text",onInput:S=>Hr(m.projectName)},null,40,g$),[[or,I.value]])],64))],8,p$)):pe("",!0)],512),b("button",{class:"thread-start-button",type:"button","aria-label":G(m.projectName),title:G(m.projectName),onClick:ft(S=>le(m.projectName),["stop"])},[Ue(vc,{class:"thread-icon"})],8,v$)])]),default:Et(()=>[b("span",{class:"project-main-button","data-dragging-handle":dr(m.projectName),onMousedown:ft(S=>er(S,m.projectName),["left"])},[b("span",u$,ce(sn(m.projectName)),1)],40,c$)]),_:2},1032,["onClick","onKeydown"]),Bn(m)?(x(),D("ul",y$,[(x(!0),D(Ke,null,jt(tr(m),S=>(x(),D("li",{key:S.id,class:"thread-row-item","data-menu-open":et(S.id)?"true":"false"},[Ue(Cs,{class:"thread-row","data-active":S.id===e.selectedThreadId,"data-pinned":be(S.id),"data-menu-open":et(S.id)?"true":"false","force-right-hover":et(S.id),onMouseleave:U=>Fe(S.id,U),onContextmenu:U=>Vt(U,S.id)},{left:Et(()=>[b("span",b$,[Qt(S)?(x(),D("span",{key:0,class:"thread-status-indicator","data-state":qn(S)},null,8,w$)):pe("",!0),b("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:U=>we(S.id)},[Ue(kd,{class:"thread-icon"})],8,S$)])]),right:Et(()=>[b("span",A$,ce(ye(S)),1)]),"right-hover":Et(()=>[b("div",{ref_for:!0,ref:U=>ar(S.id,U),class:"thread-menu-wrap"},[b("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ft(U=>Pt(S.id),["stop"])},[Ue(aa,{class:"thread-icon"})],8,x$)],512)]),default:Et(()=>[b("button",{class:"thread-main-button",type:"button",onClick:U=>N(S.id)},[b("span",E$,[b("span",k$,[b("span",I$,ce(S.title),1),S.hasWorktree?(x(),ht(Ql,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0),S.pendingRequestState?(x(),D("span",{key:1,class:"thread-row-request-chip","data-state":S.pendingRequestState},ce(Un(S)),9,C$)):pe("",!0)])])],8,T$)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onMouseleave","onContextmenu"])],8,_$))),128))])):(x(),ht(Cs,{key:1,as:"p",class:"project-empty-row"},{left:Et(()=>[...E[17]||(E[17]=[b("span",{class:"project-empty-spacer"},null,-1)])]),default:Et(()=>[E[18]||(E[18]=b("span",{class:"project-empty"},"No threads",-1))]),_:1})),Fn(m)?(x(),ht(Cs,{key:2,class:"thread-show-more-row"},{left:Et(()=>[...E[19]||(E[19]=[b("span",{class:"thread-show-more-spacer"},null,-1)])]),default:Et(()=>[b("button",{class:"thread-show-more-button",type:"button",onClick:S=>Vr(m.projectName)},ce(Ln(m.projectName)?"Show less":"Show more"),9,R$)]),_:2},1024)):pe("",!0)],12,s$))),128))],4)),(x(),ht(pa,{to:"body"},[Z.value?(x(),D("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:ae,class:"thread-menu-panel thread-menu-panel-fixed",style:To(g.value),"data-open-direction":lr(Z.value.id),onClick:E[10]||(E[10]=ft(()=>{},["stop"]))},[b("button",{class:"thread-menu-item",type:"button",onClick:E[5]||(E[5]=m=>Re(Z.value.id))}," Browse files "),b("button",{class:"thread-menu-item",type:"button",onClick:E[6]||(E[6]=m=>P(Z.value.id))}," Export chat "),b("button",{class:"thread-menu-item",type:"button",onClick:E[7]||(E[7]=m=>B(Z.value.id))}," Create chat fork "),b("button",{class:"thread-menu-item",type:"button",onClick:E[8]||(E[8]=m=>On(Z.value.id,Z.value.title))}," Rename thread "),b("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:E[9]||(E[9]=m=>on(Z.value.id,Z.value.title))}," Delete thread ")],12,M$)):pe("",!0)])),(x(),ht(pa,{to:"body"},[R.value?(x(),D("div",{key:0,class:"rename-thread-overlay",onClick:ft(st,["self"])},[b("div",P$,[E[20]||(E[20]=b("h3",{class:"rename-thread-title"},"Rename thread",-1)),E[21]||(E[21]=b("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Gn(b("input",{ref_key:"renameThreadInputRef",ref:$,"onUpdate:modelValue":E[11]||(E[11]=m=>M.value=m),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Zt(ft(Ft,["prevent"]),["enter"]),Zt(ft(st,["prevent"]),["esc"])]},null,40,$$),[[or,M.value]]),b("div",{class:"rename-thread-actions"},[b("button",{class:"rename-thread-button",type:"button",onClick:st},"Cancel"),b("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Ft},"Save")])])])):pe("",!0)])),(x(),ht(pa,{to:"body"},[q.value?(x(),D("div",{key:0,class:"rename-thread-overlay",onClick:ft(pn,["self"])},[b("div",N$,[E[22]||(E[22]=b("h3",{class:"rename-thread-title"},"Delete thread?",-1)),b("p",O$,' This will archive the thread "'+ce(ue.value)+'". You can find it later in archived threads. ',1),b("div",{class:"rename-thread-actions"},[b("button",{class:"rename-thread-button",type:"button",onClick:pn},"Cancel"),b("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Jn},"Delete")])])])):pe("",!0)]))]))}}),j$=St(D$,[["__scopeId","data-v-24f893c5"]]),F$={class:"content-header"},B$={class:"content-leading"},U$={class:"content-title"},q$={class:"content-actions"},H$=Tn({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(x(),D("header",F$,[b("div",B$,[so(t.$slots,"leading",{},void 0)]),b("h1",U$,ce(e.title),1),b("div",q$,[so(t.$slots,"actions",{},void 0)])]))}}),W$=St(H$,[["__scopeId","data-v-66ee223c"]]),Sg=.0025,Id=3,Tg=2,V$=256;function z$(e){var Pe;const t=O("idle"),n=O(typeof navigator<"u"&&!!((Pe=navigator.mediaDevices)!=null&&Pe.getUserMedia)),r=O(0),o=O(null);let s=null,i=null,a=[],l=null,u=null,d=null,p=null,g=[],_=!1,I=!1,R=null;function W(){R&&(R.abort(),R=null),t.value==="transcribing"&&(t.value="idle")}function M(){const Y=o.value;if(!Y||typeof window>"u")return;const de=Y.getContext("2d");if(!de)return;const Ae=Math.max(1,Math.floor(Y.clientWidth)),De=Math.max(1,Math.floor(Y.clientHeight||36)),ve=window.devicePixelRatio||1,Se=Math.max(1,Math.floor(Ae*ve)),ae=Math.max(1,Math.floor(De*ve));(Y.width!==Se||Y.height!==ae)&&(Y.width=Se,Y.height=ae),de.setTransform(ve,0,0,ve,0,0),de.clearRect(0,0,Ae,De);const ke=Math.max(12,Math.floor(Ae/(Id+Tg))),Ne=g.slice(-ke),Me=Math.max(0,ke-Ne.length),qe=De/2,He=getComputedStyle(Y).color||"#000000";for(let Ve=0;Ve<ke;Ve+=1){const ot=Ne[Ve-Me]??0,K=Math.max(.08,Math.min(1,ot*18))*qe,_e=Ve*(Id+Tg);de.globalAlpha=ot<=Sg?.35:1,de.fillStyle=He,de.fillRect(_e,qe-K,Id,K*2)}de.globalAlpha=1}function $(){g=[],r.value=0,M()}function q(){d&&(d.disconnect(),d.onaudioprocess=null,d=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),p=null}function z(Y){if(typeof window>"u")return;const de=window.webkitAudioContext,Ae=window.AudioContext??de;Ae&&(q(),$(),l=new Ae,u=l.createMediaStreamSource(Y),d=l.createScriptProcessor(2048,1,1),p=performance.now(),d.onaudioprocess=De=>{const ve=De.inputBuffer.getChannelData(0);let Se=0;for(let ae=0;ae<ve.length;ae+=1){const ke=Math.abs(ve[ae]??0);Se+=ke<Sg?0:ke}g.push(Se/ve.length),g.length>V$&&g.shift(),p!==null&&(r.value=Math.max(0,performance.now()-p)),M()},u.connect(d),d.connect(l.destination),M())}async function ue(){var Y;if(t.value==="transcribing"&&W(),!(t.value!=="idle"||!n.value||_)){_=!0,I=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],s=new MediaRecorder(i),s.ondataavailable=de=>{de.data.size>0&&a.push(de.data)},s.onstop=()=>{var De;const de=a,Ae=(s==null?void 0:s.mimeType)||((De=de[0])==null?void 0:De.type)||"audio/webm";xe(),he(de,Ae)},z(i),s.start(250),t.value="recording",I&&ne()}catch(de){xe(),t.value="idle",(Y=e.onError)==null||Y.call(e,de)}finally{_=!1}}}function ne(){if(_&&t.value==="idle"){I=!0;return}if(!(t.value!=="recording"||!s)&&s.state!=="inactive"){t.value="transcribing";try{s.requestData()}catch{}s.stop()}}function J(){I=!1,W(),xe(),t.value="idle"}async function he(Y,de){var ve,Se,ae,ke,Ne;if(Y.length===0){(ve=e.onEmpty)==null||ve.call(e),t.value="idle";return}const Ae=new Blob(Y,{type:de});t.value="transcribing";let De=null;try{const Me=de.split(/[/;]/)[1]??"webm",qe=new FormData;qe.append("file",Ae,`codex.${Me}`);const He=((Se=e.getLanguage)==null?void 0:Se.call(e).trim())??"";He&&He.toLowerCase()!=="auto"&&qe.append("language",He),De=new AbortController,R=De;const Ve=await fetch("/codex-api/transcribe",{method:"POST",body:qe,signal:De.signal}),ot=await Ve.text();let Ge=null;try{Ge=ot.trim()?JSON.parse(ot):null}catch{Ge=null}if(!Ve.ok){const _e=(ae=Ge==null?void 0:Ge.error)==null?void 0:ae.trim(),fe=ot.trim();throw new Error(_e||fe||`Transcription failed: ${Ve.status}`)}const K=((Ge==null?void 0:Ge.text)??"").trim();K.length>0?e.onTranscript(K):(ke=e.onEmpty)==null||ke.call(e)}catch(Me){if(Me instanceof DOMException&&Me.name==="AbortError")return;(Ne=e.onError)==null||Ne.call(e,Me)}finally{De&&R===De&&(R=null),t.value==="transcribing"&&(t.value="idle")}}function xe(){q(),$(),s&&(s.ondataavailable=null,s.onstop=null,s=null),i&&(i.getTracks().forEach(Y=>Y.stop()),i=null),a=[]}Ws(()=>{J()});function Ce(){if(t.value==="recording"){ne();return}(t.value==="idle"||t.value==="transcribing")&&ue()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:o,startRecording:ue,stopRecording:ne,toggleRecording:Ce,cancel:J}}const G$={},K$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Y$(e,t){return x(),D("svg",K$,[...t[0]||(t[0]=[b("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 J$=St(G$,[["render",Y$]]),X$={},Q$={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Z$(e,t){return x(),D("svg",Q$,[...t[0]||(t[0]=[b("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 eN=St(X$,[["render",Z$]]),tN={},nN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rN(e,t){return x(),D("svg",nN,[...t[0]||(t[0]=[b("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 oN=St(tN,[["render",rN]]),sN={},iN={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function aN(e,t){return x(),D("svg",iN,[...t[0]||(t[0]=[b("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),b("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 Eg=St(sN,[["render",aN]]),lN=["disabled"],cN={class:"composer-dropdown-value"},uN={class:"composer-dropdown-menu"},dN={key:0,class:"composer-dropdown-search-wrap"},fN=["placeholder","onKeydown"],pN={class:"composer-dropdown-options",role:"listbox"},hN=["onClick"],mN={key:0,class:"composer-dropdown-empty"},gN=Tn({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=O(null),s=O(null),i=O(!1),a=O(""),l=oe(()=>{var $;const M=n.options.find(q=>q.value===n.modelValue);return M?M.label:(($=n.placeholder)==null?void 0:$.trim())||""}),u=oe(()=>n.openDirection??"down"),d=oe(()=>n.enableSearch===!0),p=oe(()=>{var M;return((M=n.searchPlaceholder)==null?void 0:M.trim())||"Quick search projects"}),g=oe(()=>{const M=a.value.trim().toLowerCase();return M?n.options.filter($=>$.label.toLowerCase().includes(M)||$.value.toLowerCase().includes(M)):n.options});function _(){n.disabled||(i.value=!i.value)}function I(M){r("update:modelValue",M),i.value=!1,a.value=""}function R(){if(a.value.length>0){a.value="";return}i.value=!1}function W(M){if(!i.value)return;const $=o.value;if(!$)return;const q=M.target;q instanceof Node&&($.contains(q)||(i.value=!1,a.value=""))}return it(i,M=>{M&&d.value&&Yt(()=>{var $;return($=s.value)==null?void 0:$.focus()})}),cs(()=>{window.addEventListener("pointerdown",W)}),Ws(()=>{window.removeEventListener("pointerdown",W)}),(M,$)=>(x(),D("div",{ref_key:"rootRef",ref:o,class:"composer-dropdown"},[b("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[e.selectedPrefixIcon?(x(),ht(Hf(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):pe("",!0),b("span",cN,ce(l.value),1),Ue(Ip,{class:"composer-dropdown-chevron"})],8,lN),i.value?(x(),D("div",{key:0,class:pt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":u.value==="up","composer-dropdown-menu-wrap-down":u.value==="down"}])},[b("div",uN,[d.value?(x(),D("div",dN,[Gn(b("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":$[0]||($[0]=q=>a.value=q),class:"composer-dropdown-search-input",type:"text",placeholder:p.value,onKeydown:Zt(ft(R,["prevent"]),["esc"])},null,40,fN),[[or,a.value]])])):pe("",!0),b("ul",pN,[(x(!0),D(Ke,null,jt(g.value,q=>(x(),D("li",{key:q.value},[b("button",{class:pt(["composer-dropdown-option",{"is-selected":q.value===e.modelValue}]),type:"button",onClick:z=>I(q.value)},ce(q.label),11,hN)]))),128)),g.value.length===0?(x(),D("li",mN," No matching projects ")):pe("",!0)])])],2)):pe("",!0)],512))}}),Ns=St(gN,[["__scopeId","data-v-fce3cdfb"]]),vN=["disabled"],yN={class:"search-dropdown-value"},_N={class:"search-dropdown-search-wrap"},bN=["placeholder","onKeydown"],wN={key:0,class:"search-dropdown-list",role:"listbox"},SN=["onClick","onPointerenter"],TN={class:"search-dropdown-option-check"},EN={class:"search-dropdown-option-label"},kN={key:0,class:"search-dropdown-option-desc"},IN={key:1,class:"search-dropdown-empty"},CN=Tn({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,o=O(null),s=O(null),i=O(null),a=O(!1),l=O(""),u=O(0),d=oe(()=>n.openDirection??"down"),p=oe(()=>new Set(n.selectedValues)),g=oe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const z=n.options.find(ue=>ue.value===n.selectedValues[0]);return(z==null?void 0:z.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),_=oe(()=>{const z=l.value.toLowerCase().trim();return z?n.options.filter(ue=>{var ne;return ue.label.toLowerCase().includes(z)||(((ne=ue.description)==null?void 0:ne.toLowerCase().includes(z))??!1)}):n.options});function I(){const z=s.value,ue=o.value;if(!z||!ue||window.innerWidth>=640)return;const ne=ue.getBoundingClientRect();d.value==="up"?(z.style.setProperty("bottom",`${window.innerHeight-ne.top+8}px`,"important"),z.style.setProperty("top","auto","important")):(z.style.setProperty("top",`${ne.bottom+8}px`,"important"),z.style.setProperty("bottom","auto","important"))}function R(){n.disabled||(a.value=!a.value,a.value&&(l.value="",u.value=0,Yt(()=>{var z;Yt(()=>{I()}),(z=i.value)==null||z.focus()})))}function W(z){r("toggle",z.value,!p.value.has(z.value)),a.value=!1}function M(z){_.value.length!==0&&(u.value=(u.value+z+_.value.length)%_.value.length)}function $(){const z=_.value[u.value];z&&W(z)}function q(z){if(!a.value)return;const ue=o.value;if(!ue)return;const ne=z.target;ne instanceof Node&&(ue.contains(ne)||(a.value=!1))}return it(l,()=>{u.value=0}),cs(()=>window.addEventListener("pointerdown",q)),Ws(()=>window.removeEventListener("pointerdown",q)),(z,ue)=>(x(),D("div",{ref_key:"rootRef",ref:o,class:"search-dropdown"},[b("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:R},[b("span",yN,ce(g.value),1),Ue(Ip,{class:"search-dropdown-chevron"})],8,vN),a.value?(x(),D("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"}])},[b("div",_N,[Gn(b("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":ue[0]||(ue[0]=ne=>l.value=ne),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[ue[1]||(ue[1]=Zt(ft(ne=>a.value=!1,["prevent"]),["escape"])),Zt(ft($,["prevent"]),["enter"]),ue[2]||(ue[2]=Zt(ft(ne=>M(1),["prevent"]),["arrow-down"])),ue[3]||(ue[3]=Zt(ft(ne=>M(-1),["prevent"]),["arrow-up"]))]},null,40,bN),[[or,l.value]])]),_.value.length>0?(x(),D("ul",wN,[(x(!0),D(Ke,null,jt(_.value,(ne,J)=>(x(),D("li",{key:ne.value},[b("button",{class:pt(["search-dropdown-option",{"is-selected":p.value.has(ne.value),"is-highlighted":J===u.value}]),type:"button",onClick:he=>W(ne),onPointerenter:he=>u.value=J},[b("span",TN,ce(p.value.has(ne.value)?"✓":""),1),b("span",EN,ce(ne.label),1),ne.description?(x(),D("span",kN,ce(ne.description),1)):pe("",!0)],42,SN)]))),128))])):(x(),D("div",IN,"No results"))],2)):pe("",!0)],512))}}),AN=St(CN,[["__scopeId","data-v-3147b20f"]]),xN={class:"skill-picker-header"},RN=["onKeydown"],MN={key:0,class:"skill-picker-list",role:"listbox"},PN=["onClick","onPointerenter"],$N={class:"skill-picker-name"},NN={key:0,class:"skill-picker-desc"},ON={key:1,class:"skill-picker-empty"},LN=Tn({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,o=O(null),s=O(null),i=O(""),a=O(0),l=oe(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(_=>_.name.toLowerCase().includes(g)||_.description.toLowerCase().includes(g)):n.skills}),u=oe(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function d(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function p(){const g=l.value[a.value];g&&r("select",g)}return it(()=>n.visible,g=>{g&&(i.value="",a.value=0,Yt(()=>{var _;return(_=s.value)==null?void 0:_.focus()}))}),it(i,()=>{a.value=0}),(g,_)=>e.visible?(x(),D("div",{key:0,ref_key:"rootRef",ref:o,class:"skill-picker",style:To(u.value)},[b("div",xN,[Gn(b("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":_[0]||(_[0]=I=>i.value=I),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Zt(ft(I=>g.$emit("close"),["prevent"]),["escape"])),Zt(ft(p,["prevent"]),["enter"]),_[2]||(_[2]=Zt(ft(I=>d(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Zt(ft(I=>d(-1),["prevent"]),["arrow-up"]))]},null,40,RN),[[or,i.value]])]),l.value.length>0?(x(),D("ul",MN,[(x(!0),D(Ke,null,jt(l.value,(I,R)=>(x(),D("li",{key:I.path},[b("button",{class:pt(["skill-picker-item",{"is-highlighted":R===a.value}]),type:"button",onClick:W=>g.$emit("select",I),onPointerenter:W=>a.value=R},[b("span",$N,ce(I.name),1),I.description?(x(),D("span",NN,ce(I.description),1)):pe("",!0)],42,PN)]))),128))])):(x(),D("div",ON,"No skills found"))],4)):pe("",!0)}}),DN=St(LN,[["__scopeId","data-v-ff3fb7dc"]]),jN={key:0,class:"thread-composer-dictation-error"},FN={key:0,class:"thread-composer-attachments"},BN=["src","alt"],UN=["aria-label","disabled","onClick"],qN={key:1,class:"thread-composer-folder-chips"},HN=["title"],WN={class:"thread-composer-folder-chip-meta"},VN=["aria-label","disabled","onClick"],zN={key:2,class:"thread-composer-file-chips"},GN=["title"],KN=["aria-label","disabled","onClick"],YN={key:3,class:"thread-composer-skill-chips"},JN={class:"thread-composer-skill-chip-name"},XN=["aria-label","onClick"],QN={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},ZN={key:1,class:"thread-composer-file-mentions"},eO=["onMousedown"],tO={key:1,class:"thread-composer-file-mention-icon-markdown"},nO={class:"thread-composer-file-mention-text"},rO={class:"thread-composer-file-mention-name"},oO={key:0,class:"thread-composer-file-mention-dir"},sO={key:1,class:"thread-composer-file-mention-empty"},iO=["placeholder","disabled"],aO=["disabled"],lO={key:0,class:"thread-composer-attach-menu"},cO=["disabled"],uO=["disabled"],dO=["disabled"],fO={class:"thread-composer-attach-mode"},pO={class:"thread-composer-attach-mode-buttons"},hO=["disabled"],mO=["disabled"],gO=["aria-checked","aria-label","disabled"],vO={class:"thread-composer-attach-setting-copy"},yO={class:"thread-composer-attach-setting-description"},_O=["aria-checked","aria-label","disabled"],bO={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},wO={key:1,class:"thread-composer-dictation-timer"},SO=["aria-label","title","disabled"],TO=["aria-label","title","disabled"],EO={key:0,class:"thread-composer-stop-spinner","aria-hidden":"true"},kO=["aria-label","title","disabled"],IO=["disabled"],CO=["disabled"],AO=["disabled"],xO=2e3,RO="codex-web-local.thread-draft.v1.",MO=Tn({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{type:Boolean},isStopPending:{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=O(""),i=O([]),a=O([]),l=O([]),u=O([]),d=O(""),p=O(0),g=O(null),_=O(!1),{state:I,isSupported:R,recordingDurationMs:W,waveformCanvasRef:M,startRecording:$,stopRecording:q,toggleRecording:z,cancel:ue}=z$({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:m=>{if(s.value=s.value?`${s.value}
75
+ ${m}`:m,d.value="",r.dictationAutoSend!==!1){const S=r.isTurnInProgress?be.value:"steer";Re(S);return}Yt(()=>{var S;return(S=Ce.value)==null?void 0:S.focus()})},onEmpty:()=>{d.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:m=>{if(m instanceof DOMException&&m.name==="NotAllowedError"){d.value="Microphone access was denied.";return}d.value=m instanceof Error?m.message:"Dictation failed."}}),ne=O(null),J=O(null),he=O(null),xe=O(null),Ce=O(null),{isMobile:Pe}=Sp(),Y=O(!1),de=O(!1),Ae=O(null),De=O(""),ve=O([]),Se=O(!1),ae=O(0),ke=O(0);let Ne=0,Me=null,qe=!1,He=0,Ve=0;const ot=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let Ge="";const K=[{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 _e(m){return m.trim().replace(/^gpt/i,"GPT")}const fe=oe(()=>r.models.map(m=>({value:m,label:_e(m)}))),Oe=oe(()=>r.selectedCollaborationMode==="plan"),Ye=oe(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),k=oe(()=>r.skills??[]),C=oe(()=>a.value.map(m=>m.path)),H=oe(()=>(r.skills??[]).map(m=>({value:m.path,label:m.name,description:m.description}))),X=oe(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||Ye.value||p.value>0?!1:s.value.trim().length>0||i.value.length>0||l.value.length>0),Z=oe(()=>s.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||u.value.length>0),Q=oe(()=>{const m=new Set;for(const S of u.value)for(const U of S.filePaths)m.add(U);return l.value.filter(S=>!m.has(S.fsPath))}),ie=oe(()=>r.disabled||!r.activeThreadId),me=oe(()=>r.selectedModel.trim()==="gpt-5.4"),se=oe(()=>r.selectedSpeedMode==="fast"&&me.value),te=oe(()=>ie.value||r.isUpdatingSpeedMode===!0),Le=oe(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),ye=oe(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),be=O(ye.value),we=oe(()=>I.value==="recording"),N=oe(()=>I.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),P=oe(()=>I.value==="idle"?d.value.trim():""),B=oe(()=>{const m=Math.max(0,Math.floor(W.value/1e3)),S=Math.floor(m/60),U=m%60;return`${S}:${String(U).padStart(2,"0")}`}),G=oe(()=>r.activeThreadId?Ye.value?"Loading models for plan mode...":"Type a message... (@ for files, / for skills)":"Select a thread to send a message"),le=oe(()=>s.value.trim().length>0||i.value.length>0||l.value.length>0);function Re(m="steer"){var U;const S=s.value.trim();if(X.value){if(o("submit",{text:S,imageUrls:i.value.map(ge=>ge.url),fileAttachments:[...l.value],skills:a.value.map(ge=>({name:ge.name,path:ge.path})),mode:m}),st(r.activeThreadId),tt(),u.value=[],Y.value=!1,de.value=!1,nn(),ot||Pe.value){(U=Ce.value)==null||U.blur();return}Yt(()=>{var ge;return(ge=Ce.value)==null?void 0:ge.focus()})}}function Fe(m){be.value=m}function et(m){ke.value+=1,s.value=m.text,i.value=m.imageUrls.map((S,U)=>({id:`queued-${Date.now()}-${U}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${U+1}`,url:S})),a.value=m.skills.map(S=>(r.skills??[]).find(U=>U.path===S.path)??{name:S.name,description:"",path:S.path}),l.value=m.fileAttachments.map(S=>({...S})),u.value=[],d.value="",g.value=null,p.value=0,Y.value=!1,de.value=!1,nn(),Ve+=1}function tt(){et({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Pt(m){return`${RO}${m}`}function Vt(m){if(typeof window>"u")return null;const S=m.trim();if(!S)return null;try{const U=window.localStorage.getItem(Pt(S));if(!U)return null;const ge=JSON.parse(U);return typeof ge=="string"?{text:ge,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof ge.text=="string"?ge.text:"",imageUrls:Array.isArray(ge.imageUrls)?ge.imageUrls.filter(nt=>typeof nt=="string"):[],fileAttachments:Array.isArray(ge.fileAttachments)?ge.fileAttachments.filter(nt=>!!nt&&typeof nt.label=="string"&&typeof nt.path=="string"&&typeof nt.fsPath=="string"):[],skills:Array.isArray(ge.skills)?ge.skills.filter(nt=>!!nt&&typeof nt.name=="string"&&typeof nt.path=="string"):[]}}catch{return null}}function On(m,S){if(typeof window>"u")return;const U=m.trim();if(U)try{if(S.text.trim().length>0||S.imageUrls.length>0||S.fileAttachments.length>0||S.skills.length>0){window.localStorage.setItem(Pt(U),JSON.stringify(S));return}window.localStorage.removeItem(Pt(U))}catch{}}function st(m){On(m,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Ft(){return{text:s.value,imageUrls:i.value.map(m=>m.url),fileAttachments:l.value.map(m=>({...m})),skills:a.value.map(m=>({name:m.name,path:m.path}))}}function on(){o("interrupt")}function pn(m){o("update:selected-model",m)}function Jn(){o("update:selected-collaboration-mode",Oe.value?"default":"plan")}function sn(m){o("update:selected-reasoning-effort",m)}function an(){te.value||o("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function _t(){r.dictationClickToToggle&&(d.value&&(d.value=""),z())}function _n(m){if(r.dictationClickToToggle||(m.preventDefault(),qe))return;qe=!0;const S=m.currentTarget;if(S)try{S.setPointerCapture(m.pointerId)}catch{}d.value&&(d.value=""),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt),window.addEventListener("blur",Lt),$()}function Lt(){r.dictationClickToToggle||qe&&(qe=!1,window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),window.removeEventListener("blur",Lt),q())}function Ir(){ie.value||(Y.value=!Y.value)}function lo(){var m;(m=J.value)==null||m.click()}function Hr(){var m;(m=he.value)==null||m.click()}function co(){var m;(m=xe.value)==null||m.click()}function Wr(m){i.value=i.value.filter(S=>S.id!==m)}function Ln(m){a.value=a.value.filter(S=>S.path!==m)}function Xt(m){l.value=l.value.filter(S=>S.fsPath!==m)}function Vr(m){const S=u.value.find(ge=>ge.id===m);if(!S)return;const U=new Set(S.filePaths);l.value=l.value.filter(ge=>!U.has(ge.fsPath)),u.value=u.value.filter(ge=>ge.id!==m)}function ln(m){return m.total<=0?0:Math.round(m.processed/m.total*100)}function hn(m,S){const U=m.replace(/\\/g,"/");if(l.value.some(Mt=>Mt.fsPath===U))return;const ge=U.split("/").filter(Boolean),nt=(S==null?void 0:S.trim())||ge[ge.length-1]||U;l.value=[...l.value,{label:nt,path:U,fsPath:U}]}function Xn(m){return m.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(m.name)}function ar(m){return m?Array.from(m):[]}function Dn(m){return m!==Ve?!1:(p.value+=1,!0)}function Cr(m){m===Ve&&(p.value=Math.max(0,p.value-1))}function zr(m){if(m<=0)return;const S=g.value,U=S?S.succeeded+S.failed:0;if(!S||U>=S.total){g.value={total:m,succeeded:0,failed:0};return}g.value={...S,total:S.total+m}}function lr(m){const S=g.value;S&&(g.value={...S,succeeded:S.succeeded+(m==="success"?1:0),failed:S.failed+(m==="failure"?1:0)})}function Tt(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function mn(m){const S=new Date,U=[S.getFullYear(),String(S.getMonth()+1).padStart(2,"0"),String(S.getDate()).padStart(2,"0"),String(S.getHours()).padStart(2,"0"),String(S.getMinutes()).padStart(2,"0"),String(S.getSeconds()).padStart(2,"0")].join("-"),ge=m.type.startsWith("image/")&&m.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${U}.${ge}`}function bn(){const m=new Date;return`pasted-text-${[m.getFullYear(),String(m.getMonth()+1).padStart(2,"0"),String(m.getDate()).padStart(2,"0"),String(m.getHours()).padStart(2,"0"),String(m.getMinutes()).padStart(2,"0"),String(m.getSeconds()).padStart(2,"0")].join("-")}.txt`}function En(m){return m.name.trim()?m:new File([m],mn(m),{type:m.type||"image/png",lastModified:Date.now()})}async function Bt(m,S){if(Dn(S))try{const U=En(m),ge=await Ed(U);if(S!==Ve)return;if(!ge){lr("failure");return}i.value=[...i.value,{id:Tt(),name:U.name,url:`/codex-local-image?path=${encodeURIComponent(ge)}`}],lr("success")}catch{S===Ve&&lr("failure")}finally{Cr(S)}}async function xt(m,S){if(Dn(S))try{const U=await Ed(m);if(S!==Ve)return;if(!U){lr("failure");return}hn(U),lr("success")}catch{S===Ve&&lr("failure")}finally{Cr(S)}}function Ut(m){const S=ar(m);if(S.length===0)return;zr(S.length),Y.value=!1,de.value=!1,nn();const U=Ve;for(const ge of S)Xn(ge)?Bt(ge,U):xt(ge,U)}function jn(){He=0,_.value=!1}function kn(m){return m?Array.from(m.types??[]).includes("Files"):!1}async function Qn(m){if(!m||m.length===0)return;const S=ke.value,U=Array.from(m),nt=(U[0].webkitRelativePath||U[0].name).split("/").filter(Boolean)[0]||"Folder",Mt=`${Date.now()}-${Math.random().toString(36).slice(2)}`;u.value=[...u.value,{id:Mt,name:nt,total:U.length,processed:0,filePaths:[],isUploading:!0}];const lt=ct=>{S===ke.value&&(u.value=u.value.map(ut=>ut.id===Mt?ct(ut):ut))};for(const ct of U)try{const ut=await Ed(ct);if(S!==ke.value)return;if(ut){const Hn=ct.webkitRelativePath||ct.name;hn(ut,Hn),lt(gn=>({...gn,processed:gn.processed+1,filePaths:[...gn.filePaths,ut]}));continue}lt(Hn=>({...Hn,processed:Hn.processed+1}))}catch{lt(ut=>({...ut,processed:ut.processed+1}))}lt(ct=>({...ct,isUploading:!1}))}function Zn(m){m&&(m.value="")}function cr(m){const S=m.target;Ut((S==null?void 0:S.files)??null),Zn(S),Y.value=!1}function bt(m){const S=m.target;Ut((S==null?void 0:S.files)??null),Zn(S),Y.value=!1}function Rt(m){const S=m.target;Qn((S==null?void 0:S.files)??null),Zn(S),Y.value=!1}function ps(m){ie.value||!kn(m.dataTransfer)||(m.preventDefault(),He+=1,_.value=!0)}function er(m){ie.value||!kn(m.dataTransfer)||(m.preventDefault(),m.dataTransfer&&(m.dataTransfer.dropEffect="copy"),_.value=!0)}function Ar(m){_.value&&(m.preventDefault(),He=Math.max(0,He-1),He===0&&jn())}function xr(m){var S;ie.value||!kn(m.dataTransfer)||(m.preventDefault(),jn(),Ut(((S=m.dataTransfer)==null?void 0:S.files)??null))}function qt(){!_.value&&He===0||jn()}function ur(m){var Mt,lt;if(ie.value)return;const S=((Mt=m.clipboardData)==null?void 0:Mt.getData("text/plain"))??"";if(S.length>=xO){m.preventDefault();const ct=new File([S],bn(),{type:"text/plain",lastModified:Date.now()});Ut([ct]);return}const U=Array.from(((lt=m.clipboardData)==null?void 0:lt.items)??[]);if(U.length===0)return;const ge=S.length>0,nt=U.filter(ct=>ct.kind==="file"&&ct.type.startsWith("image/")).map(ct=>ct.getAsFile()).filter(ct=>ct instanceof File);nt.length!==0&&(ge||m.preventDefault(),Ut(nt))}function Gr(){d.value&&(d.value="");const S=s.value.startsWith("/");S!==de.value&&(de.value=S),Kr()}function Ht(m){if(Se.value){if(m.key==="Escape"){m.preventDefault(),nn();return}if(m.key==="ArrowDown"){m.preventDefault(),ve.value.length>0&&(ae.value=(ae.value+1)%ve.value.length);return}if(m.key==="ArrowUp"){if(m.preventDefault(),ve.value.length>0){const U=ve.value.length;ae.value=(ae.value+U-1)%U}return}if(m.key==="Enter"||m.key==="Tab"){m.preventDefault();const U=ve.value[ae.value];U?dr(U):nn();return}}if(r.sendWithEnter!==!1?m.key==="Enter"&&!m.shiftKey:m.key==="Enter"&&(m.metaKey||m.ctrlKey)){m.preventDefault(),Re(r.isTurnInProgress?be.value:"steer");return}if(de.value){if(m.key==="Escape"){m.preventDefault(),In();return}if(m.key==="ArrowDown"||m.key==="ArrowUp"){m.preventDefault();return}}}function In(){var m;de.value=!1,(m=Ce.value)==null||m.focus()}function nn(){Se.value=!1,Ae.value=null,De.value="",ve.value=[],ae.value=0}function Kr(){const m=Ce.value;if(!m){nn();return}const S=m.selectionStart??s.value.length,ge=s.value.slice(0,S).match(/(^|\s)(@[^\s@]*)$/);if(!ge){nn();return}const nt=ge[2]??"",Mt=nt.length,lt=S-Mt;Ae.value=lt,De.value=nt.slice(1),Se.value=!0,Yr()}async function Yr(){if(!Se.value)return;const m=(r.cwd??"").trim();if(!m){ve.value=[];return}Me&&clearTimeout(Me);const S=++Ne;Me=setTimeout(async()=>{try{const U=await OM(m,De.value,20);if(!Se.value||S!==Ne)return;ve.value=U,ae.value=0}catch{if(!Se.value||S!==Ne)return;ve.value=[]}},120)}function dr(m){const S=Ce.value,U=Ae.value;if(U!==null&&S){const ge=S.selectionStart??s.value.length;s.value=`${s.value.slice(0,U)}${s.value.slice(ge)}`.trimEnd()}hn(m.path),nn(),Yt(()=>S==null?void 0:S.focus())}function Rr(m){ue(),et(m),Yt(()=>{var S;return(S=Ce.value)==null?void 0:S.focus()})}function zt(m){const S=m.trim();S&&(ue(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
76
+ ${S}`:s.value=S,Yt(()=>{var U;return(U=Ce.value)==null?void 0:U.focus()}))}function tr(m){const S=m.lastIndexOf("/");return S<0?m:m.slice(S+1)}function Fn(m){const S=m.lastIndexOf("/");return S<=0?"":m.slice(0,S)}function Bn(m){const S=tr(m),U=S.lastIndexOf(".");return U<=0?"":S.slice(U+1).toLowerCase()}function Qt(m){const S=Bn(m);return S==="ts"?"TS":S==="tsx"?"TSX":S==="js"?"JS":S==="jsx"?"JSX":S==="json"?"{}":""}function Un(m){const S=Bn(m);return S.startsWith("ts")?"ts":S.startsWith("js")?"js":S==="json"?"json":"default"}function qn(m){const S=Bn(m);return S==="md"||S==="mdx"}function jo(m){var S;a.value.some(U=>U.path===m.path)||(a.value=[...a.value,m]),s.value=s.value.startsWith("/")?"":s.value,de.value=!1,(S=Ce.value)==null||S.focus()}function w(m,S){if(S){const U=(r.skills??[]).find(ge=>ge.path===m);U&&!a.value.some(ge=>ge.path===m)&&(a.value=[...a.value,U])}else a.value=a.value.filter(U=>U.path!==m)}function E(m){if(!Y.value)return;const S=ne.value;if(!S)return;const U=m.target;!U||S.contains(U)||(Y.value=!1)}return cs(()=>{document.addEventListener("click",E),window.addEventListener("drop",qt),window.addEventListener("dragend",qt),window.addEventListener("blur",qt)}),t({hydrateDraft:Rr,appendTextToDraft:zt,hasUnsavedDraft:()=>Z.value}),Ws(()=>{document.removeEventListener("click",E),window.removeEventListener("drop",qt),window.removeEventListener("dragend",qt),window.removeEventListener("blur",qt),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),window.removeEventListener("blur",Lt),Me&&clearTimeout(Me)}),it(()=>r.activeThreadId,m=>{ue(),Ge&&On(Ge,Ft()),tt();const S=Vt(m);S&&(et(S),Gr()),Ge=m.trim()},{immediate:!0}),it([s,i,l,a],()=>{Ge&&On(Ge,Ft())},{deep:!0}),it(()=>r.cwd,()=>{Se.value&&Yr()}),it(ye,m=>{be.value=m}),(m,S)=>(x(),D("form",{class:"thread-composer",onSubmit:S[4]||(S[4]=ft(U=>Re(e.isTurnInProgress?be.value:"steer"),["prevent"]))},[P.value?(x(),D("p",jN,ce(P.value),1)):pe("",!0),b("div",{class:pt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":_.value}])},[i.value.length>0?(x(),D("div",FN,[(x(!0),D(Ke,null,jt(i.value,U=>(x(),D("div",{key:U.id,class:"thread-composer-attachment"},[b("img",{class:"thread-composer-attachment-image",src:U.url,alt:U.name||"Selected image"},null,8,BN),b("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${U.name||"image"}`,disabled:ie.value,onClick:ge=>Wr(U.id)}," x ",8,UN)]))),128))])):pe("",!0),u.value.length>0?(x(),D("div",qN,[(x(!0),D(Ke,null,jt(u.value,U=>(x(),D("span",{key:U.id,class:"thread-composer-folder-chip"},[Ue(Cp,{class:"thread-composer-folder-chip-icon"}),b("span",{class:"thread-composer-folder-chip-name",title:U.name},ce(U.name),9,HN),b("span",WN,[U.isUploading?(x(),D(Ke,{key:0},[js(ce(ln(U))+"% uploading ("+ce(U.processed)+"/"+ce(U.total)+") ",1)],64)):(x(),D(Ke,{key:1},[js(ce(U.filePaths.length)+" file"+ce(U.filePaths.length===1?"":"s"),1)],64))]),b("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${U.name}`,disabled:ie.value,onClick:ge=>Vr(U.id)},"×",8,VN)]))),128))])):pe("",!0),Q.value.length>0?(x(),D("div",zN,[(x(!0),D(Ke,null,jt(Q.value,U=>(x(),D("span",{key:U.fsPath,class:"thread-composer-file-chip"},[Ue(vc,{class:"thread-composer-file-chip-icon"}),b("span",{class:"thread-composer-file-chip-name",title:U.fsPath},ce(U.label),9,GN),b("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${U.label}`,disabled:ie.value,onClick:ge=>Xt(U.fsPath)},"×",8,KN)]))),128))])):pe("",!0),a.value.length>0?(x(),D("div",YN,[(x(!0),D(Ke,null,jt(a.value,U=>(x(),D("span",{key:U.path,class:"thread-composer-skill-chip"},[b("span",JN,ce(U.name),1),b("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${U.name}`,onClick:ge=>Ln(U.path)},"×",8,XN)]))),128))])):pe("",!0),b("div",{class:pt(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":_.value}]),onDragenter:ps,onDragover:er,onDragleave:Ar,onDrop:xr},[_.value?(x(),D("div",QN,[...S[5]||(S[5]=[b("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):pe("",!0),Se.value?(x(),D("div",ZN,[ve.value.length>0?(x(!0),D(Ke,{key:0},jt(ve.value,(U,ge)=>(x(),D("button",{key:U.path,class:pt(["thread-composer-file-mention-row",{"is-active":ge===ae.value}]),type:"button",onMousedown:ft(nt=>dr(U),["prevent"])},[Qt(U.path)?(x(),D("span",{key:0,class:pt(["thread-composer-file-mention-icon-badge",`is-${Un(U.path)}`])},ce(Qt(U.path)),3)):qn(U.path)?(x(),D("span",tO,"↓")):(x(),ht(vc,{key:2,class:"thread-composer-file-mention-icon-file"})),b("span",nO,[b("span",rO,ce(tr(U.path)),1),Fn(U.path)?(x(),D("span",oO,ce(Fn(U.path)),1)):pe("",!0)])],42,eO))),128)):(x(),D("div",sO,"No matching files"))])):pe("",!0),Gn(b("textarea",{ref_key:"inputRef",ref:Ce,"onUpdate:modelValue":S[0]||(S[0]=U=>s.value=U),class:"thread-composer-input",placeholder:G.value,disabled:ie.value,onInput:Gr,onKeydown:Ht,onPaste:ur},null,40,iO),[[or,s.value]]),Ue(DN,{skills:k.value,visible:de.value,"anchor-bottom":44,"anchor-left":0,onSelect:jo,onClose:In},null,8,["skills","visible"])],34),b("div",{class:pt(["thread-composer-controls",{"thread-composer-controls--recording":we.value}])},[b("div",{ref_key:"attachMenuRootRef",ref:ne,class:"thread-composer-attach"},[b("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:ie.value,onClick:Ir}," + ",8,aO),Y.value?(x(),D("div",lO,[b("button",{class:"thread-composer-attach-item",type:"button",disabled:ie.value,onClick:lo}," Add photos & files ",8,cO),b("button",{class:"thread-composer-attach-item",type:"button",disabled:ie.value,onClick:co}," Add folder ",8,uO),b("button",{class:"thread-composer-attach-item",type:"button",disabled:ie.value,onClick:Hr}," Take photo ",8,dO),S[9]||(S[9]=b("div",{class:"thread-composer-attach-separator"},null,-1)),b("div",fO,[S[6]||(S[6]=b("span",{class:"thread-composer-attach-mode-label"},"In-progress send",-1)),b("div",pO,[b("button",{class:pt(["thread-composer-attach-mode-button",{"is-active":be.value==="steer"}]),type:"button",disabled:ie.value,onClick:S[1]||(S[1]=U=>Fe("steer"))}," Steer ",10,hO),b("button",{class:pt(["thread-composer-attach-mode-button",{"is-active":be.value==="queue"}]),type:"button",disabled:ie.value,onClick:S[2]||(S[2]=U=>Fe("queue"))}," Queue ",10,mO)])]),S[10]||(S[10]=b("div",{class:"thread-composer-attach-separator"},null,-1)),me.value?(x(),D("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:te.value,onClick:an},[b("span",vO,[S[7]||(S[7]=b("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),b("span",yO,ce(Le.value),1)]),b("span",{class:pt(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":te.value}])},null,2)],8,gO)):pe("",!0),b("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":Oe.value,"aria-label":Oe.value?"Disable plan mode":"Enable plan mode",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:Jn},[S[8]||(S[8]=b("span",{class:"thread-composer-attach-setting-copy"},[b("span",{class:"thread-composer-attach-setting-label"},"Plan mode"),b("span",{class:"thread-composer-attach-setting-description"},"Agent proposes a plan before acting")],-1)),b("span",{class:pt(["thread-composer-attach-switch",{"is-on":Oe.value}])},null,2)],8,_O)])):pe("",!0)],512),we.value?pe("",!0):(x(),D(Ke,{key:0},[Ue(Ns,{class:"thread-composer-control","model-value":e.selectedModel,options:fe.value,"selected-prefix-icon":se.value?eN:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":pn},null,8,["model-value","options","selected-prefix-icon","disabled"]),Ue(AN,{class:"thread-composer-control",options:H.value,"selected-values":C.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:w},null,8,["options","selected-values","disabled"]),Ue(Ns,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:K,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":sn},null,8,["model-value","disabled"])],64)),b("div",{class:pt(["thread-composer-actions",{"thread-composer-actions--recording":we.value}])},[je(I)==="recording"?(x(),D("div",bO,[b("canvas",{ref_key:"dictationWaveformCanvasRef",ref:M,class:"thread-composer-dictation-waveform"},null,512)])):pe("",!0),je(I)==="recording"?(x(),D("span",wO,ce(B.value),1)):pe("",!0),je(R)?(x(),D("button",{key:2,class:pt(["thread-composer-mic",{"thread-composer-mic--active":je(I)==="recording"}]),type:"button","aria-label":N.value,title:N.value,disabled:ie.value,onClick:_t,onPointerdown:_n,onPointerup:Lt,onPointercancel:Lt},[je(I)==="recording"?(x(),ht(Eg,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(x(),ht(oN,{key:1,class:"thread-composer-mic-icon"}))],42,SO)):pe("",!0),e.isTurnInProgress&&!le.value?(x(),D("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":e.isStopPending?"Saving thread before stop is available":"Stop",title:e.isStopPending?"Saving thread before stop is available":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn||e.isStopPending,onClick:on},[e.isStopPending?(x(),D("span",EO)):(x(),ht(Eg,{key:1,class:"thread-composer-stop-icon"}))],8,TO)):(x(),D("button",{key:4,class:pt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&be.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&be.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${be.value}`:"Send",disabled:!X.value,onClick:S[3]||(S[3]=U=>Re(e.isTurnInProgress?be.value:"steer"))},[Ue(J$,{class:"thread-composer-submit-icon"})],10,kO))],2)],2)],2),b("input",{ref_key:"photoLibraryInputRef",ref:J,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:ie.value,onChange:cr},null,40,IO),b("input",{ref_key:"cameraCaptureInputRef",ref:he,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:ie.value,onChange:bt},null,40,CO),b("input",{ref_key:"folderPickerInputRef",ref:xe,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:ie.value,onChange:Rt},null,40,AO)],32))}}),kg=St(MO,[["__scopeId","data-v-4dfd8383"]]),PO={key:0,class:"thread-pending-request"},$O={class:"thread-pending-request-title"},NO=["title"],OO={class:"thread-pending-request-approval"},LO={class:"thread-pending-request-options",role:"radiogroup","aria-label":"Approval choices"},DO=["aria-pressed","onClick"],jO={class:"thread-pending-request-option-index"},FO={class:"thread-pending-request-option-label"},BO={class:"thread-pending-request-footer thread-pending-request-footer--approval"},UO=["value"],qO={class:"thread-pending-request-header"},HO={class:"thread-pending-request-heading"},WO={class:"thread-pending-request-eyebrow"},VO={class:"thread-pending-request-title"},zO={key:0,class:"thread-pending-request-counter"},GO={key:0,class:"thread-pending-request-preview"},KO={class:"thread-pending-request-preview-code"},YO={key:1,class:"thread-pending-request-user-input"},JO={key:0,class:"thread-pending-request-question-description"},XO=["href"],QO={class:"thread-pending-request-question-title"},ZO={key:0},eL={key:0,class:"thread-pending-request-question-text"},tL={key:1,class:"thread-pending-request-input-wrap"},nL=["type","value","onInput"],rL={key:2,class:"thread-pending-request-select-wrap"},oL=["value","onChange"],sL={key:0,value:""},iL={key:3,class:"thread-pending-request-select-wrap"},aL=["value","onChange"],lL={key:0,value:""},cL=["value"],uL={key:4,class:"thread-pending-request-question-options"},dL=["checked","onChange"],fL={class:"thread-pending-request-checkbox-label"},pL={key:2,class:"thread-pending-request-validation-error"},hL={class:"thread-pending-request-footer"},mL={key:2,class:"thread-pending-request-user-input"},gL={class:"thread-pending-request-question-title"},vL={key:0,class:"thread-pending-request-question-text"},yL={key:1,class:"thread-pending-request-question-options"},_L={class:"thread-pending-request-select-wrap"},bL=["value","onChange"],wL=["value"],SL={key:0,class:"thread-pending-request-question-description"},TL={key:2,class:"thread-pending-request-input-wrap"},EL=["value","onInput"],kL={class:"thread-pending-request-footer"},IL={key:3,class:"thread-pending-request-actions"},CL={key:4,class:"thread-pending-request-actions"},AL=Tn({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,o=O("accept"),s=O(""),i=O({}),a=O({}),l=O({}),u=O("");function d(N){return N!==null&&typeof N=="object"&&!Array.isArray(N)?N:null}function p(N){return typeof N=="string"?N.trim():""}function g(N){return typeof N=="string"?N:null}function _(N){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(N)?N:JSON.stringify(N)}function I(N){const B=(Array.isArray(N.commandActions)?N.commandActions:[]).map(G=>d(G)).map(G=>p(G==null?void 0:G.command)).find(G=>G.length>0);if(B)return B.replace(/\s+/g," ").trim();if(Array.isArray(N.command)){const G=N.command.filter(le=>typeof le=="string").map(le=>le.trim()).filter(le=>le.length>0);if(G.length>0)return G.map(le=>_(le)).join(" ")}return J(p(N.command))}function R(N){return N.method==="item/commandExecution/requestApproval"||N.method==="execCommandApproval"}function W(N){return N.method==="item/fileChange/requestApproval"||N.method==="applyPatchApproval"}function M(N){return N.method==="item/permissions/requestApproval"}function $(N){return R(N)||W(N)||M(N)}function q(N){return N.method==="mcpServer/elicitation/request"}function z(N){const P=d(N.params);return p(P==null?void 0:P.reason)||p(P==null?void 0:P.prompt)||p(P==null?void 0:P.message)}function ue(N){return $(N)?"Awaiting approval":q(N)?"MCP server input required":N.method==="item/tool/requestUserInput"?"Awaiting response":N.method==="item/tool/call"?"Tool call waiting for response":N.method}function ne(N){const P=z(N);return P||(R(N)?"Do you want to run this command?":W(N)?"Do you want to make these changes?":M(N)?"Do you want to grant these permissions?":q(N)?"An MCP server needs your input before Codex can continue.":N.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function J(N){var Re;const P=N.trim();if(!P)return"";const B=P.match(/-Command\s+(.+)$/i),G=((Re=B==null?void 0:B[1])==null?void 0:Re.trim())??P;return(G.startsWith('"')&&G.endsWith('"')?G.slice(1,-1):G).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function he(N){const P=d(N.params);if(!P)return"";if(R(N))return I(P);if(W(N)){const B=p(P.grantRoot)||p(P.grant_root);if(B)return B.replace(/\s+/g," ").trim();const G=d(P.fileChanges)??d(P.changes);if(!G)return"";const le=Object.keys(G).map(Re=>Re.trim()).filter(Re=>Re.length>0);return le.length===0?"":le.slice(0,3).join(", ")}return M(N)?xe(P.permissions):q(N)?p(P.serverName)||p(P.url):""}function xe(N){const P=d(N);if(!P)return"";const B=[],G=d(P.fileSystem),le=d(P.network),Re=Array.isArray(G==null?void 0:G.read)?G.read.filter(et=>typeof et=="string"):[],Fe=Array.isArray(G==null?void 0:G.write)?G.write.filter(et=>typeof et=="string"):[];return Re.length>0&&B.push(`Read: ${Re.join(", ")}`),Fe.length>0&&B.push(`Write: ${Fe.join(", ")}`),(le==null?void 0:le.enabled)===!0&&B.push("Network access"),B.join(" • ")}function Ce(N){return!N||!$(N)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const Pe=oe(()=>Ce(n.request));it(()=>{var N;return((N=n.request)==null?void 0:N.id)??0},()=>{var N;s.value="",i.value={},a.value={},l.value={},u.value="",o.value=((N=Pe.value[0])==null?void 0:N.id)??"accept"},{immediate:!0}),it(Pe,N=>{var P;o.value!=="decline"&&(N.some(B=>B.id===o.value)||(o.value=((P=N[0])==null?void 0:P.id)??"accept"))},{immediate:!0});function Y(N,P){return`${String(N)}:${P}`}function de(N){const P=d(N.params),B=Array.isArray(P==null?void 0:P.questions)?P.questions:[],G=[];for(const le of B){const Re=d(le);if(!Re)continue;const Fe=p(Re.id);if(!Fe)continue;const et=Array.isArray(Re.options)?Re.options.map(tt=>d(tt)).map(tt=>({label:p(tt==null?void 0:tt.label),description:p(tt==null?void 0:tt.description)})).filter(tt=>tt.label.length>0):[];G.push({id:Fe,header:p(Re.header),question:p(Re.question),isOther:Re.isOther===!0,options:et})}return G}function Ae(N,P,B){const G=Y(N,P),le=i.value[G];return typeof le=="string"&&le.length>0?le:B}function De(N,P){return a.value[Y(N,P)]??""}function ve(N,P,B){const G=B.target;if(!(G instanceof HTMLSelectElement))return;const le=Y(N,P);i.value={...i.value,[le]:G.value}}function Se(N,P,B){const G=B.target;if(!(G instanceof HTMLInputElement))return;const le=Y(N,P);a.value={...a.value,[le]:G.value}}function ae(N,P,B){var le,Re;const G=Ae(N,P,((le=B[0])==null?void 0:le.label)||"");return((Re=B.find(Fe=>Fe.label===G))==null?void 0:Re.description)??""}function ke(N,P){return`${String(N)}:${P}`}function Ne(N){var P;return p((P=d(N.params))==null?void 0:P.serverName)}function Me(N){var B;const P=p((B=d(N.params))==null?void 0:B.url);if(!P)return"";try{const G=new URL(P),le=G.protocol.toLowerCase();return le==="https:"||le==="http:"?G.toString():""}catch{return""}}function qe(N){const P=d(N.params),B=d(P==null?void 0:P.requestedSchema),G=d(B==null?void 0:B.properties);if(!G)return[];const le=new Set(Array.isArray(B==null?void 0:B.required)?B.required.filter(Re=>typeof Re=="string"):[]);return Object.entries(G).map(([Re,Fe])=>He(Re,d(Fe),le.has(Re))).filter(Re=>Re!==null)}function He(N,P,B){if(!P)return null;const G=p(P.title)||N,le=p(P.description),Re=p(P.type);if(Re==="boolean")return{key:N,label:G,description:le,required:B,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof P.default=="boolean"?P.default:null,hasExplicitDefault:typeof P.default=="boolean"};if(Re==="number"||Re==="integer")return{key:N,label:G,description:le,required:B,kind:"number",inputType:"number",options:[],defaultValue:typeof P.default=="number"?P.default:null,hasExplicitDefault:typeof P.default=="number"};const Fe=Ve(P);if(Re==="array")return{key:N,label:G,description:le,required:B,kind:"multiEnum",inputType:"checkbox",options:Fe,defaultValue:Array.isArray(P.default)?P.default.filter(tt=>typeof tt=="string"):[],hasExplicitDefault:Array.isArray(P.default)};const et=g(P.default);return Fe.length>0?{key:N,label:G,description:le,required:B,kind:"singleEnum",inputType:"select",options:Fe,defaultValue:et,hasExplicitDefault:et!==null}:{key:N,label:G,description:le,required:B,kind:"string",inputType:ot(P),options:[],defaultValue:et,hasExplicitDefault:et!==null}}function Ve(N){const B=(Array.isArray(N.oneOf)?N.oneOf:Array.isArray(N.anyOf)?N.anyOf:[]).map(Fe=>d(Fe)).map(Fe=>({value:p(Fe==null?void 0:Fe.const),label:p(Fe==null?void 0:Fe.title)||p(Fe==null?void 0:Fe.const)})).filter(Fe=>Fe.value.length>0);if(B.length>0)return B;const G=d(N.items);if(G){const Fe=Ve(G);if(Fe.length>0)return Fe}const le=Array.isArray(N.enum)?N.enum.filter(Fe=>typeof Fe=="string"):[],Re=Array.isArray(N.enumNames)?N.enumNames.filter(Fe=>typeof Fe=="string"):[];return le.map((Fe,et)=>({value:Fe,label:Re[et]||Fe}))}function ot(N){const P=p(N.format);return P==="email"?"email":P==="uri"?"url":P==="date"?"date":P==="date-time"?"datetime-local":"text"}function Ge(N,P){const B=l.value[ke(N,P.key)];return B!==void 0?B:P.defaultValue}function K(N,P){const B=Ge(N,P);return Array.isArray(B)?B.filter(G=>typeof G=="string"):[]}function _e(N,P,B){const G=B.target;if(!(G instanceof HTMLInputElement)&&!(G instanceof HTMLSelectElement))return;const le=G.value,Re=(P.kind==="number",le);l.value={...l.value,[ke(N,P.key)]:le.length>0?Re:null},u.value=""}function fe(N,P,B){const G=B.target;if(!(G instanceof HTMLSelectElement))return;let le=null;G.value==="true"?le=!0:G.value==="false"&&(le=!1),l.value={...l.value,[ke(N,P.key)]:le},u.value=""}function Oe(N,P,B,G){const le=G.target;if(!(le instanceof HTMLInputElement))return;const Re=new Set(K(N,P));le.checked?Re.add(B):Re.delete(B),l.value={...l.value,[ke(N,P.key)]:Array.from(Re)},u.value=""}function Ye(N){return N===!0?"true":N===!1?"false":""}function k(N,P){const B=Ge(N,P);return P.kind==="multiEnum"?Array.isArray(B)&&B.length>0:P.kind==="boolean"?typeof B=="boolean":P.kind==="number"&&typeof B=="number"?!0:typeof B=="string"&&B.trim().length>0}function C(N){const P=qe(N).filter(B=>B.required&&!k(N.id,B)).map(B=>B.label);return P.length===0?"":P.length===1?`Answer the required field: ${P[0]}.`:`Answer the required fields: ${P.join(", ")}.`}function H(N){const P={};for(const B of qe(N)){const G=Ge(N.id,B);if(B.kind==="multiEnum"){const Re=Array.isArray(G)?G:[];(Re.length>0||B.required)&&(P[B.key]=Re);continue}if(B.kind==="boolean"){typeof G=="boolean"&&(P[B.key]=G);continue}if(B.kind==="number"){const Re=typeof G=="number"?G:Number(String(G).trim());Number.isNaN(Re)||(P[B.key]=Re);continue}const le=String(G??"").trim();(le.length>0||B.required)&&(P[B.key]=le)}return P}function X(N){o.value=N}function Z(){o.value="decline"}function Q(N){const P=N.target;P instanceof HTMLInputElement&&(s.value=P.value,o.value="decline")}function ie(N,P){var B;if(M(N)){if(P==="decline"||P==="cancel"){r("respondServerRequest",{id:N.id,error:{code:-32e3,message:P==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const G=d((B=d(N.params))==null?void 0:B.permissions)??{};r("respondServerRequest",{id:N.id,result:{permissions:G,scope:P==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:N.id,result:{decision:P}})}function me(N){const P=s.value.trim(),B=P.length>0?"decline":o.value;if(M(N)){ie(N,B);return}r("respondServerRequest",{id:N.id,result:{decision:B},followUpMessageText:P||void 0})}function se(N,P){const B=d(N.params),G={action:P};if(P==="accept"&&p(B==null?void 0:B.mode)==="form"){const le=C(N);if(le){u.value=le;return}G.content=H(N)}r("respondServerRequest",{id:N.id,result:G})}function te(N){var G;const P=de(N),B={};for(const le of P){const Re=Ae(N.id,le.id,((G=le.options[0])==null?void 0:G.label)||""),Fe=De(N.id,le.id).trim(),et=[Re,Fe].map(tt=>tt.trim()).filter(tt=>tt.length>0);B[le.id]={answers:et}}r("respondServerRequest",{id:N.id,result:{answers:B}})}function Le(N){r("respondServerRequest",{id:N.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function ye(N){r("respondServerRequest",{id:N.id,result:{success:!0,contentItems:[]}})}function be(N){r("respondServerRequest",{id:N.id,result:{}})}function we(N){r("respondServerRequest",{id:N.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(N,P)=>e.request?(x(),D("section",PO,[b("article",{class:pt(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[$(e.request)?(x(),D(Ke,{key:0},[b("p",$O,ce(ne(e.request)),1),he(e.request)?(x(),D("p",{key:0,class:"thread-pending-request-command-line",title:he(e.request)},ce(he(e.request)),9,NO)):pe("",!0),b("section",OO,[b("div",LO,[(x(!0),D(Ke,null,jt(Pe.value,(B,G)=>(x(),D("button",{key:B.id,type:"button",class:pt(["thread-pending-request-option",{"is-selected":o.value===B.id}]),"aria-pressed":o.value===B.id,onClick:le=>X(B.id)},[b("span",jO,ce(G+1)+".",1),b("span",FO,ce(B.label),1)],10,DO))),128))]),b("footer",BO,[b("label",{class:pt(["thread-pending-request-inline-input",{"is-active":o.value==="decline"||s.value.length>0}])},[P[11]||(P[11]=b("span",{class:"thread-pending-request-option-index"},"3.",-1)),b("input",{class:"thread-pending-request-inline-control",type:"text",value:s.value,placeholder:"No, and tell Codex what to do differently",onFocus:Z,onInput:Q,onKeydown:P[0]||(P[0]=Zt(ft(B=>me(e.request),["prevent"]),["enter"]))},null,40,UO)],2),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:P[1]||(P[1]=B=>ie(e.request,"cancel"))}," Skip "),b("button",{type:"button",class:"thread-pending-request-primary",onClick:P[2]||(P[2]=B=>me(e.request))}," Send ")])])],64)):(x(),D(Ke,{key:1},[b("header",qO,[b("div",HO,[b("p",WO,ce(ue(e.request)),1),b("p",VO,ce(ne(e.request)),1)]),(e.requestCount??0)>1?(x(),D("span",zO,ce(e.requestCount??0)+" pending",1)):pe("",!0)]),he(e.request)?(x(),D("div",GO,[b("code",KO,ce(he(e.request)),1)])):pe("",!0),e.request.method==="mcpServer/elicitation/request"?(x(),D("section",YO,[Ne(e.request)?(x(),D("p",JO," Server: "+ce(Ne(e.request)),1)):pe("",!0),Me(e.request)?(x(),D("a",{key:1,class:"thread-pending-request-link",href:Me(e.request),target:"_blank",rel:"noopener noreferrer"}," Open authorization link ",8,XO)):pe("",!0),(x(!0),D(Ke,null,jt(qe(e.request),B=>(x(),D("div",{key:`${e.request.id}:${B.key}`,class:"thread-pending-request-question"},[b("p",QO,[js(ce(B.label),1),B.required?(x(),D("span",ZO," *")):pe("",!0)]),B.description?(x(),D("p",eL,ce(B.description),1)):pe("",!0),B.kind==="string"||B.kind==="number"?(x(),D("label",tL,[P[12]||(P[12]=b("span",{class:"thread-pending-request-select-label"},"Value",-1)),b("input",{class:"thread-pending-request-input",type:B.inputType,value:String(Ge(e.request.id,B)??""),onInput:G=>_e(e.request.id,B,G)},null,40,nL)])):B.kind==="boolean"?(x(),D("label",rL,[P[15]||(P[15]=b("span",{class:"thread-pending-request-select-label"},"Choice",-1)),b("select",{class:"thread-pending-request-select",value:Ye(Ge(e.request.id,B)),onChange:G=>fe(e.request.id,B,G)},[B.hasExplicitDefault?pe("",!0):(x(),D("option",sL,"Select true or false")),P[13]||(P[13]=b("option",{value:"true"},"True",-1)),P[14]||(P[14]=b("option",{value:"false"},"False",-1))],40,oL)])):B.kind==="singleEnum"?(x(),D("label",iL,[P[16]||(P[16]=b("span",{class:"thread-pending-request-select-label"},"Choice",-1)),b("select",{class:"thread-pending-request-select",value:String(Ge(e.request.id,B)??""),onChange:G=>_e(e.request.id,B,G)},[B.hasExplicitDefault?pe("",!0):(x(),D("option",lL,"Select an option")),(x(!0),D(Ke,null,jt(B.options,G=>(x(),D("option",{key:`${e.request.id}:${B.key}:${G.value}`,value:G.value},ce(G.label),9,cL))),128))],40,aL)])):(x(),D("div",uL,[(x(!0),D(Ke,null,jt(B.options,G=>(x(),D("label",{key:`${e.request.id}:${B.key}:${G.value}`,class:"thread-pending-request-checkbox-row"},[b("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:K(e.request.id,B).includes(G.value),onChange:le=>Oe(e.request.id,B,G.value,le)},null,40,dL),b("span",fL,ce(G.label),1)]))),128))]))]))),128)),u.value?(x(),D("p",pL,ce(u.value),1)):pe("",!0),b("footer",hL,[b("button",{type:"button",class:"thread-pending-request-secondary",onClick:P[3]||(P[3]=B=>se(e.request,"cancel"))}," Cancel "),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:P[4]||(P[4]=B=>se(e.request,"decline"))}," Decline "),b("button",{type:"button",class:"thread-pending-request-primary",onClick:P[5]||(P[5]=B=>se(e.request,"accept"))}," Continue ")])])):e.request.method==="item/tool/requestUserInput"?(x(),D("section",mL,[(x(!0),D(Ke,null,jt(de(e.request),B=>{var G;return x(),D("div",{key:`${e.request.id}:${B.id}`,class:"thread-pending-request-question"},[b("p",gL,ce(B.header||B.question),1),B.question?(x(),D("p",vL,ce(B.question),1)):pe("",!0),B.options.length>0?(x(),D("div",yL,[b("label",_L,[P[17]||(P[17]=b("span",{class:"thread-pending-request-select-label"},"Choice",-1)),b("select",{class:"thread-pending-request-select",value:Ae(e.request.id,B.id,((G=B.options[0])==null?void 0:G.label)||""),onChange:le=>ve(e.request.id,B.id,le)},[(x(!0),D(Ke,null,jt(B.options,le=>(x(),D("option",{key:`${e.request.id}:${B.id}:${le.label}`,value:le.label},ce(le.label),9,wL))),128))],40,bL)]),ae(e.request.id,B.id,B.options)?(x(),D("p",SL,ce(ae(e.request.id,B.id,B.options)),1)):pe("",!0)])):pe("",!0),B.isOther?(x(),D("label",TL,[P[18]||(P[18]=b("span",{class:"thread-pending-request-select-label"},"Other answer",-1)),b("input",{class:"thread-pending-request-input",type:"text",value:De(e.request.id,B.id),placeholder:"Other answer",onInput:le=>Se(e.request.id,B.id,le)},null,40,EL)])):pe("",!0)])}),128)),b("footer",kL,[b("button",{type:"button",class:"thread-pending-request-primary",onClick:P[6]||(P[6]=B=>te(e.request))}," Send ")])])):e.request.method==="item/tool/call"?(x(),D("section",IL,[b("button",{type:"button",class:"thread-pending-request-primary",onClick:P[7]||(P[7]=B=>Le(e.request))}," Fail Tool Call "),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:P[8]||(P[8]=B=>ye(e.request))}," Success (Empty) ")])):(x(),D("section",CL,[b("button",{type:"button",class:"thread-pending-request-primary",onClick:P[9]||(P[9]=B=>be(e.request))}," Return Empty Result "),b("button",{type:"button",class:"thread-pending-request-secondary",onClick:P[10]||(P[10]=B=>we(e.request))}," Reject Request ")]))],64))],2)])):pe("",!0)}}),xL=St(AL,[["__scopeId","data-v-a033894d"]]),RL={key:0,class:"queued-messages"},ML={class:"queued-messages-inner"},PL={class:"queued-row-text"},$L={class:"queued-row-actions"},NL=["onClick"],OL=["onClick"],LL=["onClick"],DL=Tn({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,u,d;const r=n.text.trim();if(r)return r;const o=[],s=((l=n.imageUrls)==null?void 0:l.length)??0,i=((u=n.fileAttachments)==null?void 0:u.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?(x(),D("div",RL,[b("div",ML,[(x(!0),D(Ke,null,jt(e.messages,o=>(x(),D("div",{key:o.id,class:"queued-row"},[r[1]||(r[1]=b("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[b("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)),b("span",PL,ce(t(o)),1),b("div",$L,[b("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:s=>n.$emit("edit",o.id)},"Edit",8,NL),b("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>n.$emit("steer",o.id)},"Steer",8,OL),b("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]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[b("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,LL)])]))),128))])])):pe("",!0)}}),jL=St(DL,[["__scopeId","data-v-835c6739"]]),FL={key:0,class:"rate-limit-status","aria-live":"polite"},BL=["title"],UL={class:"rate-limit-card-header"},qL={class:"rate-limit-card-title"},HL={key:0,class:"rate-limit-card-plan"},WL={class:"rate-limit-card-metrics"},VL={key:0,class:"rate-limit-card-footer"},zL=Tn({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(M){var $,q;return(($=M.limitId)==null?void 0:$.trim())||((q=M.limitName)==null?void 0:q.trim())||"__default__"}function n(M){var $,q;return(($=M.limitName)==null?void 0:$.trim())||((q=M.limitId)==null?void 0:q.trim())||"Rate limits"}function r(M){const $=M.trim();return $?$.replace(/[_-]+/g," ").replace(/\b\w/g,q=>q.toUpperCase()):""}function o(M){return!M||M<=0?"Window":M%1440===0?`${M/1440}d`:M%60===0?`${M/60}h`:M<60?`${M}m`:`${Math.round(M/60*10)/10}h`}function s(M){const $=Math.max(0,Math.min(100,100-M));return`${Math.round($)}% left`}function i(M){return`${Math.round(M)}%`}function a(M,$){return{key:$,label:`${o(M.windowDurationMins)} ${s(M.usedPercent)}`}}function l(M){const $=[];return M.primary&&$.push(a(M.primary,"primary")),M.secondary&&$.push(a(M.secondary,"secondary")),$}function u(M){if(!M)return"";const $=new Date(M*1e3),q=$.getMonth()+1,z=String($.getDate()).padStart(2,"0"),ue=String($.getHours()).padStart(2,"0"),ne=String($.getMinutes()).padStart(2,"0");return`${q}.${z} ${ue}:${ne}`}function d(M){if(!(M!=null&&M.resetsAt))return"";const $=M.resetsAt*1e3-Date.now();if($<=0)return"Resetting now";const q=Math.round($/6e4);if(q<60)return`Resets in ${q}m`;const z=Math.round(q/60);return z<24?`Resets in ${z}h`:`Resets in ${Math.round(z/24)}d`}function p(M){return[M.primary,M.secondary].filter($=>$!==null)}function g(M){const $=p(M);return $.length===0?null:[...$].sort((q,z)=>{const ue=q.windowDurationMins??Number.MAX_SAFE_INTEGER,ne=z.windowDurationMins??Number.MAX_SAFE_INTEGER;return ue!==ne?ue-ne:(q.resetsAt??Number.MAX_SAFE_INTEGER)-(z.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function _(M){const $=p(M);if($.length===0)return"";const q=[...$].sort((ue,ne)=>{const J=ue.windowDurationMins??-1,he=ne.windowDurationMins??-1;return J!==he?he-J:(ne.resetsAt??-1)-(ue.resetsAt??-1)})[0],z=u(q.resetsAt);return z||""}function I(M){const $=M.credits;return $?$.unlimited?"Unlimited credits":$.balance?`Credits ${$.balance}`:$.hasCredits?"Credits available":"":""}function R(M){return[d(g(M)),_(M),I(M)].filter($=>$.length>0)}function W(M){const $=[n(M)];for(const q of l(M))$.push(q.label);for(const q of p(M))$.push(`${o(q.windowDurationMins)} used ${i(q.usedPercent)}`);for(const q of R(M))$.push(q);return $.join(`
77
+ `)}return(M,$)=>e.snapshots.length>0?(x(),D("aside",FL,[(x(!0),D(Ke,null,jt(e.snapshots,q=>(x(),D("div",{key:t(q),class:"rate-limit-card",title:W(q)},[b("div",UL,[b("span",qL,ce(n(q)),1),q.planType?(x(),D("span",HL,ce(r(q.planType)),1)):pe("",!0)]),b("div",WL,[(x(!0),D(Ke,null,jt(l(q),z=>(x(),D("span",{key:z.key,class:"rate-limit-card-metric"},ce(z.label),1))),128))]),R(q).length>0?(x(),D("div",VL,ce(R(q).join(" | ")),1)):pe("",!0)],8,BL))),128))])):pe("",!0)}}),GL=St(zL,[["__scopeId","data-v-df88906b"]]),KL={class:"runtime-toggle",role:"radiogroup","aria-label":"Continue in"},YL=["aria-checked","onClick"],JL={class:"runtime-toggle-option-label"},XL=Tn({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,r=[{value:"local",label:"Local project",icon:Cp},{value:"worktree",label:"New worktree",icon:Ql}];function o(s){n("update:modelValue",s)}return(s,i)=>(x(),D("div",KL,[(x(),D(Ke,null,jt(r,a=>b("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)},[(x(),ht(Hf(a.icon),{class:"runtime-toggle-option-icon"})),b("span",JL,ce(a.label),1)],10,YL)),64))]))}}),QL=St(XL,[["__scopeId","data-v-e8b0d0ac"]]),ZL={},eD={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 tD(e,t){return x(),D("svg",eD,[...t[0]||(t[0]=[b("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),b("path",{d:"M9 4l0 16"},null,-1)])])}const nD=St(ZL,[["render",tD]]),rD={},oD={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function sD(e,t){return x(),D("svg",oD,[...t[0]||(t[0]=[b("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 iD=St(rD,[["render",sD]]),aD={class:"sidebar-thread-controls"},lD=["aria-label","title"],cD=Tn({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(x(),D("div",aD,[b("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?(x(),ht(iD,{key:0,class:"sidebar-thread-controls-icon"})):(x(),ht(nD,{key:1,class:"sidebar-thread-controls-icon"}))],8,lD),so(t.$slots,"default",{},void 0),e.showNewThreadButton?(x(),D("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"))},[Ue(vc,{class:"sidebar-thread-controls-icon"})])):pe("",!0)]))}}),Ig=St(cD,[["__scopeId","data-v-46a10052"]]),uD={},dD={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function fD(e,t){return x(),D("svg",dD,[...t[0]||(t[0]=[b("circle",{cx:"11",cy:"11",r:"8"},null,-1),b("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Cg=St(uD,[["render",fD]]),pD={},hD={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function mD(e,t){return x(),D("svg",hD,[...t[0]||(t[0]=[b("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[b("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"}),b("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const gD=St(pD,[["render",mD]]),vD={},yD={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _D(e,t){return x(),D("svg",yD,[...t[0]||(t[0]=[b("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const bD=St(vD,[["render",_D]]);function $r(e){return e.flatMap(t=>t.threads)}const vb="codex-web-local.thread-read-state.v1",yb="codex-web-local.thread-scroll-state.v1",_b="codex-web-local.thread-token-usage.v1",Ef="codex-web-local.selected-thread-id.v1",kf="codex-web-local.selected-model-by-context.v1",bb="codex-web-local.selected-model-id.v1",wb="codex-web-local.project-order.v1",Sb="codex-web-local.project-display-name.v1",If="codex-web-local.collaboration-mode-by-context.v1",Tb="codex-web-local.collaboration-mode.v1",ol="__new-thread__",Cd=220,wD=500,SD=3e3,Ag=["none","minimal","low","medium","high","xhigh"],ai="__global__",TD="gpt-5.4-mini",Pr="gpt-5.2-codex";function ED(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(vb);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function xg(e){typeof window>"u"||window.localStorage.setItem(vb,JSON.stringify(e))}function Cf(e){return e==="plan"?"plan":"default"}function yc(e){return typeof e=="string"?e.trim():""}function Or(){return Object.create(null)}function Ad(e){const t=Or();for(const[n,r]of Object.entries(e))t[n]=r;return t}function xd(e,t){if(!(t in e))return e;const n=Or();for(const[r,o]of Object.entries(e))r!==t&&(n[r]=o);return n}function Rg(e,t){let n=!1;const r=Or();for(const[o,s]of Object.entries(e)){if(o===ol||t.has(o)){r[o]=s;continue}n=!0}return n?r:e}function _c(e){return e.trim()||ol}function kD(){if(typeof window>"u")return Or();try{const n=window.localStorage.getItem(kf);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Or();const o=Or();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=yc(i);a&&(o[s]=a)}return o}}catch{}const e=yc(window.localStorage.getItem(bb)),t=Or();return e&&(t[ol]=e),t}function Mg(e,t){const n=_c(t),r=yc(e[n]);return r||yc(e[ol])||TD}function Rd(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(kf):window.localStorage.setItem(kf,JSON.stringify(e)),window.localStorage.removeItem(bb)}catch{}}function ID(){if(typeof window>"u")return Or();try{const n=window.localStorage.getItem(If);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Or();const o=Or();for(const[s,i]of Object.entries(r)){if(typeof s!="string"||s.length===0)continue;const a=Cf(i);a==="plan"&&(o[s]=a)}return o}}catch{}const e=Cf(window.localStorage.getItem(Tb)),t=Or();return e==="plan"&&(t[ol]="plan"),t}function $l(e,t){const n=_c(t);return Cf(e[n])}function Pg(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(If):window.localStorage.setItem(If,JSON.stringify(e)),window.localStorage.removeItem(Tb)}catch{}}function ba(e,t,n){return Math.min(Math.max(e,t),n)}function CD(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=ba(t.scrollRatio,0,1)),n}function AD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(yb);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=CD(o);s&&(n[r]=s)}return n}catch{return{}}}function $g(e){typeof window>"u"||window.localStorage.setItem(yb,JSON.stringify(e))}function di(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 Ng(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:di(t.totalTokens)??0,inputTokens:di(t.inputTokens)??0,cachedInputTokens:di(t.cachedInputTokens)??0,outputTokens:di(t.outputTokens)??0,reasoningOutputTokens:di(t.reasoningOutputTokens)??0}}function xD(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Ng(t.total),r=Ng(t.last);if(!n||!r)return null;const o=di(t.modelContextWindow),s=r.totalTokens,i=typeof o=="number"?Math.max(o-s,0):null,a=typeof o=="number"&&o>0?ba(Math.round((i??0)/o*100),0,100):null;return{total:n,last:r,modelContextWindow:o,currentContextTokens:s,remainingContextTokens:i,remainingContextPercent:a}}function RD(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(_b);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=xD(o);s&&(n[r]=s)}return n}catch{return{}}}function Og(e){typeof window>"u"||window.localStorage.setItem(_b,JSON.stringify(e))}function MD(){return typeof window>"u"?"":window.localStorage.getItem(Ef)??""}function PD(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ef);return}window.localStorage.setItem(Ef,e)}}function $D(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(wb);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=rl(r);o.length>0&&!n.includes(o)&&n.push(o)}return n}catch{return[]}}function li(e){typeof window>"u"||window.localStorage.setItem(wb,JSON.stringify(e))}function ND(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Sb);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"?rl(r):"";s.length>0&&typeof o=="string"&&(n[s]=o)}return n}catch{return{}}}function Md(e){typeof window>"u"||window.localStorage.setItem(Sb,JSON.stringify(e))}function Nl(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 Qo(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 Qo(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 OD(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 LD(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function DD(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 jD(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&DD(e.steps,t.steps)}function Ol(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 Af(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Qo(e.images,t.images)&&BD(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&LD(e.commandExecution,t.commandExecution)&&jD(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex}function hi(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 FD(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 p=r.get(d.id);return p&&Af(p,d)?p:d});if(n.preserveMissing!==!0)return hi(e,s)?e:s;const i=e.map(d=>{const p=o.get(d.id);return!p||Af(d,p)?d:p}),a=new Set(e.map(d=>d.id)),l=s.filter(d=>!a.has(d.id)),u=[...i,...l];return hi(e,u)?e:u}function BD(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 xf(e){return e.replace(/\s+/gu," ").trim()}function UD(e,t){const n=new Set(t.map(s=>s.id)),r=new Set(t.filter(s=>s.role==="assistant").map(s=>xf(s.text)).filter(s=>s.length>0));if(r.size===0)return e;const o=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;if(n.has(s.id))return!1;const i=xf(s.text);return i.length===0?!1:!r.has(i)});return o.length===e.length?e:o}function Ll(e,t){const n=e.findIndex(s=>s.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Af(r,t))return e;const o=[...e];return o.splice(n,1,t),o}const Eb="worked";function Ko(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function qD(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 HD(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function WD(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 VD(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${qD(e.durationMs)}`,messageType:Eb,turnId:e.turnId}}function zD(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function GD(e,t){const n=VD(t),r=e.filter(i=>i.messageType!==Eb),o=zD(r);if(o<0)return[...r,n];const s=[...r];return s.splice(o,0,n),s}function vt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function KD(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 YD(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 JD(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 XD(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 Gt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Dl(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 u=i.get(l.id);return u&&YD(u,l)?u:l});return s&&s.projectName===o.projectName&&JD(s.threads,a)?s:{projectName:o.projectName,threads:a}});return XD(e,r)?e:r}function QD(e,t,n){const r=new Set($r(t).map(a=>a.id)),o=$r(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 u=i.findIndex(d=>d.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function Yo(e){return rl(e)}function ZD(e){const t=e.split(`
78
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function ej(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function tj(){const e=O([]),t=O([]),n=O(MD()),r=O({}),o=O({}),s=O({}),i=O({}),a=O({}),l=O({}),u=O({}),d=O({}),p=O({}),g=O({}),_=O([]),I=O([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),R=O(ID()),W=O(kD()),M=O($l(R.value,n.value)),$=O(Mg(W.value,n.value)),q=O("medium"),z=O("standard"),ue=O(ED()),ne=O(AD()),J=O($D()),he=O(ND()),xe=O({}),Ce=O({}),Pe=O({}),Y=O({}),de=O({}),Ae=O({}),De=O({}),ve=O({}),Se=O({}),ae=O({}),ke=O({}),Ne=O({}),Me=O({}),qe=O(null),He=O(RD()),Ve=O({}),ot=O([]),Ge=O([]),K=O(!1),_e=O(!1),fe=O(!1),Oe=O(!1),Ye=O(!1),k=O(!1),C=O(""),H=O(!1),X=O(!1);function Z(c){var f;try{const v=new URL(c,"http://localhost");return v.pathname!=="/codex-local-image"?"":((f=v.searchParams.get("path"))==null?void 0:f.trim())??""}catch{return""}}function Q(c){const f=c.trim().toLowerCase();return f?/\b(attached image|attached screenshot|save the attached|copy (the )?screenshot|save screenshot)\b/i.test(f):!1}function ie(c){var v;const f=r.value[c]??[];for(let T=f.length-1;T>=0;T-=1){const L=f[T];if(!(L.role!=="user"||!Array.isArray(L.images)||L.images.length===0))for(let j=L.images.length-1;j>=0;j-=1){const F=((v=L.images[j])==null?void 0:v.trim())??"";if(F&&Z(F))return F}}return""}let me=null,se=null,te=null;const Le=new Map;let ye=null,be=!1;const we=new Set;let N=!1,P=!1;const B=new Map,G=new Set,le=oe(()=>$r(e.value)),Re=oe(()=>le.value.find(c=>c.id===n.value)??null),Fe=oe(()=>ne.value[n.value]??null),et=oe(()=>{const c=n.value;return c?Se.value[c]===!0:!1}),tt=oe(()=>{const c=[],f=n.value;return f&&Array.isArray(Ne.value[f])&&c.push(...Ne.value[f]),Array.isArray(Ne.value[ai])&&c.push(...Ne.value[ai]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),Pt=oe(()=>{var j;const c=n.value;if(!c)return null;const f=u.value[c]===!0,v=f?Ae.value[c]:void 0,T=f?(i.value[c]??"").trim():"",L=(((j=De.value[c])==null?void 0:j.message)??"").trim();return!v&&!T&&!L?null:{activityLabel:(v==null?void 0:v.label)||"Thinking",activityDetails:(v==null?void 0:v.details)??[],reasoningText:T,errorText:L}}),Vt=oe(()=>qe.value),On=oe(()=>{const c=n.value;return c?He.value[c]??null:null}),st=oe(()=>{const c=n.value;if(!c)return[];const f=r.value[c]??[],v=o.value[c]??[],T=s.value[c]??[],L=a.value[c]??[],j=l.value[c]??[],F=[...f,...v,...L,...j,...T],V=de.value[c];return V?GD(F,V):F});function Ft(c){return Mg(W.value,c).trim()}function on(...c){const f=[..._.value];for(const v of c){const T=v.trim();T&&!f.includes(T)&&f.push(T)}Qo(_.value,f)||(_.value=f)}function pn(c){n.value!==c&&(n.value=c,PD(c),$.value=Ft(c),on($.value),M.value=$l(R.value,c),P=!1)}function Jn(c){const f=c.trim(),v=_c(n.value);if(f){const T=Ad(W.value);T[v]=f,W.value=T}else W.value=xd(W.value,v);$.value=Ft(n.value),on($.value),Rd(W.value),hr({category:"ui.model",message:`model → ${$.value}`,level:"info"})}function sn(c,f){const v=c.trim();if(!v)return;const T=f.trim();if(T){const L=Ad(W.value);L[v]=T,W.value=L}else W.value=xd(W.value,v);on(T),n.value===v&&($.value=Ft(n.value)),Rd(W.value)}function an(c,f){const v=c.trim();if(!v)return;if(!f){if(!(v in He.value))return;He.value=vt(He.value,v),Og(He.value);return}const T=He.value[v];T&&JSON.stringify(T)===JSON.stringify(f)||(He.value={...He.value,[v]:f},Og(He.value))}function _t(c){const f=c==="plan"?"plan":"default",v=_c(n.value);if(!($l(R.value,n.value)===f&&M.value===f)){if(M.value=f,f==="plan"){const L=Ad(R.value);L[v]=f,R.value=L}else R.value=xd(R.value,v);Pg(R.value)}}function _n(c){qe.value=c}async function Lt(c=n.value){c.trim()?sn(c,Pr):Jn(Pr),on(Pr)}function Ir(c,f){Me.value={...Me.value,[c]:f}}function lo(c){Me.value[c]&&(Me.value=vt(Me.value,c))}async function Hr(c){if(G.has(c))return;const f=Me.value[c];if(!(!f||f.fallbackRetried)){G.add(c),Ir(c,{...f,fallbackRetried:!0});try{await Lt(c);try{const v=await _d(c,1);qt(c,v),tr(c),ur(c,[]),zt(c),a.value[c]&&(a.value=vt(a.value,c))}catch{}Rt(c,null),C.value="",Bt(c,null),bt(c,{label:"Thinking",details:Xt(Pr,f.effort,f.collaborationMode)}),xt(c,!0),Pe.value[c]!==!0&&await yd(c),await bd(c,f.text,f.imageUrls,Pr,f.effort||void 0,f.skills.length>0?f.skills:void 0,f.fileAttachments,f.collaborationMode),Pe.value={...Pe.value,[c]:!0},hn(),we.add(c),be=!0,await Mr()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";Rt(c,T),C.value=T,xt(c,!1),bt(c,null)}finally{G.delete(c)}}}function co(c){c&&!Ag.includes(c)||(q.value=c)}async function Wr(c){const f=c==="fast"?"fast":"standard";if(Ye.value||z.value===f)return;const v=z.value;z.value=f,Ye.value=!0,C.value="";try{await SM(f)}catch(T){z.value=v,C.value=T instanceof Error?T.message:"Failed to update Fast mode"}finally{Ye.value=!1}}async function Ln(){try{const c=await IM();I.value=c,c.some(f=>f.value===M.value)||_t("default")}catch{}}function Xt(c,f,v=M.value){const T=c.trim()||"default",L=f||"default",j=v==="plan"?"Plan":"Default",F=z.value==="fast"?"Fast":"Standard";return[`Mode: ${j}`,`Model: ${T}`,`Thinking: ${L}`,`Speed: ${F}`]}async function Vr(){try{const[c,f]=await Promise.all([hb(),mb()]),v=Ft(n.value),T=f.model.trim(),L=[...c];for(const j of[v,T])j&&!L.includes(j)&&L.push(j);_.value=L,v||(T&&L.includes(T)?Jn(f.model):L.length>0?Jn(L[0]):Jn("")),f.reasoningEffort&&Ag.includes(f.reasoningEffort)&&(q.value=f.reasoningEffort),z.value=f.speedMode}catch{}}async function ln(){if(ye){await ye;return}ye=(async()=>{try{Ge.value=nt(await fg())}catch{}finally{ye=null}})(),await ye}function hn(){if(typeof window>"u"){ln();return}te!==null&&window.clearTimeout(te),te=window.setTimeout(()=>{te=null,ln()},wD)}function Xn(c){if(!c||typeof window>"u")return;const f=Le.get(c);f!==void 0&&(window.clearTimeout(f),Le.delete(c))}function ar(c){if(!c||typeof window>"u")return;Xn(c);const f=window.setTimeout(()=>{Le.delete(c),we.add(c),Mr()},SD);Le.set(c,f)}function Dn(c){const f=Ve.value;return Object.keys(f).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const L=f[T.id];return L?{...T,title:L}:T})}))}function Cr(c){return c?Array.isArray(Ne.value[c])?Ne.value[c]:[]:[]}function zr(c){return c==="item/commandExecution/requestApproval"||c==="item/fileChange/requestApproval"||c==="item/permissions/requestApproval"||c==="execCommandApproval"||c==="applyPatchApproval"}function lr(c){return c.some(f=>zr(f.method))?"approval":c.length>0?"response":null}function Tt(){const f=Dn(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const L=u.value[T.id]===!0,j=lr(Cr(T.id)),F=n.value===T.id,V=ue.value[T.id],ee=g.value[T.id]===!0,$e=!F&&!L&&(ee||V!==T.updatedAtIso);return{...T,inProgress:L,unread:$e,pendingRequestState:j}})}));e.value=Dl(e.value,f)}function mn(c,f,v){const T=new Date().toISOString(),L=en(f),j=rl(L),F={id:c,title:ZD(v),projectName:j,cwd:L,hasWorktree:L.includes("/.codex/worktrees/")||L.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},V=t.value.findIndex($e=>$e.projectName===j);if(V>=0){const We=t.value[V].threads.filter(Nt=>Nt.id!==c),Qe={projectName:j,threads:[F,...We]},dt=[...t.value];dt.splice(V,1,Qe),t.value=dt}else t.value=[{projectName:j,threads:[F]},...t.value];const ee=Nl(J.value,t.value);Qo(J.value,ee)||(J.value=ee,li(J.value)),Tt()}function bn(c){const f=new Set(c.map(V=>V.id)),v=Rg(W.value,f);v!==W.value&&(W.value=v,$.value=Ft(n.value),on($.value),Rd(v));const T=Rg(R.value,f);T!==R.value&&(R.value=T,M.value=$l(T,n.value),Pg(T));const L=Gt(ue.value,f);L!==ue.value&&(ue.value=L,xg(L));const j=Gt(ne.value,f);j!==ne.value&&(ne.value=j,$g(j)),Ce.value=Gt(Ce.value,f),xe.value=Gt(xe.value,f),Pe.value=Gt(Pe.value,f),Y.value=Gt(Y.value,f),r.value=Gt(r.value,f),s.value=Gt(s.value,f),i.value=Gt(i.value,f),a.value=Gt(a.value,f),l.value=Gt(l.value,f),de.value=Gt(de.value,f),Ae.value=Gt(Ae.value,f),De.value=Gt(De.value,f),ve.value=Gt(ve.value,f),Se.value=Gt(Se.value,f),ae.value=Gt(ae.value,f),ke.value=Gt(ke.value,f),He.value=Gt(He.value,f),g.value=Gt(g.value,f),u.value=Gt(u.value,f);const F={};for(const[V,ee]of Object.entries(Ne.value))(V===ai||f.has(V))&&(F[V]=ee);Ne.value=F}function En(c){const f=$r(t.value).find(v=>v.id===c);f&&(ue.value={...ue.value,[c]:f.updatedAtIso},xg(ue.value),g.value[c]&&(g.value=vt(g.value,c)),Tt())}function Bt(c,f){if(!c)return;const v=de.value[c];if(f){if(HD(v,f))return;de.value={...de.value,[c]:f}}else v&&(de.value=vt(de.value,c))}function xt(c,f){!c||u.value[c]===!0===f||(f?u.value={...u.value,[c]:!0}:(u.value=vt(u.value,c),Bn(c),Ut(c)),Tt())}function Ut(c){c&&(Se.value[c]&&(Se.value=vt(Se.value,c)),ae.value[c]&&(ae.value=vt(ae.value,c)),ke.value[c]&&(ke.value=vt(ke.value,c)))}function jn(c){c&&(Se.value={...Se.value,[c]:!0},ae.value[c]&&(ae.value=vt(ae.value,c)),ke.value[c]&&(ke.value=vt(ke.value,c)))}function kn(c){c&&Se.value[c]===!0&&ae.value[c]===!0&&ke.value[c]===!0&&Ut(c)}function Qn(c){const f=Object.keys(Se.value);if(f.length===0)return;let v=ae.value,T=!1;for(const L of f)!c.has(L)||v[L]===!0||(v={...v,[L]:!0},T=!0);if(T){ae.value=v;for(const L of f)kn(L)}}function Zn(c,f){c&&Se.value[c]===!0&&f.some(v=>v.role==="user")&&(ke.value[c]!==!0&&(ke.value={...ke.value,[c]:!0}),kn(c))}function cr(c){c&&c!==n.value&&g.value[c]!==!0&&(g.value={...g.value,[c]:!0},Tt())}function bt(c,f){if(!c)return;const v=Ae.value[c];if(!f){v&&(Ae.value=vt(Ae.value,c));return}const T=Jr(f.label)||"Thinking",L=f.details.map(V=>Jr(V)).filter(V=>V.length>0&&V!==T),j=Array.from(new Set([...(v==null?void 0:v.details)??[],...L])).slice(-3),F={label:T,details:j};WD(v,F)||(Ae.value={...Ae.value,[c]:F})}function Rt(c,f,v={}){if(!c)return;const T=De.value[c],L=f?xf(f):"";if(!L){T&&(De.value=vt(De.value,c));return}const j=v.transient===!0;(T==null?void 0:T.message)===L&&T.transient===j||(De.value={...De.value,[c]:{message:L,transient:j}})}function ps(c){var f;c&&(f=De.value[c])!=null&&f.transient&&Rt(c,null)}function er(){const c=Object.entries(De.value).filter(([,v])=>v==null?void 0:v.transient).map(([v])=>v);if(c.length===0)return;let f=De.value;for(const v of c)f=vt(f,v);De.value=f}function Ar(c){const f=$r(t.value).find(v=>v.id===c);return(f==null?void 0:f.updatedAtIso)??""}function xr(c,f){if(!c)return;const v={scrollTop:Math.max(0,f.scrollTop),isAtBottom:f.isAtBottom===!0};typeof f.scrollRatio=="number"&&Number.isFinite(f.scrollRatio)&&(v.scrollRatio=ba(f.scrollRatio,0,1));const T=ne.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(ne.value={...ne.value,[c]:v},$g(ne.value))}function qt(c,f){const v=r.value[c]??[];hi(v,f)||(r.value={...r.value,[c]:f})}function ur(c,f){const v=s.value[c]??[];hi(v,f)||(s.value={...s.value,[c]:f})}function Gr(c){c&&c in s.value&&(s.value=vt(s.value,c))}function Ht(c,f){const v=l.value[c]??[];hi(v,f)||(l.value={...l.value,[c]:f})}function In(c,f){const v=o.value[c]??[];hi(v,f)||(o.value={...o.value,[c]:f})}function nn(c,f){const v=o.value[c]??[],T=Ll(v,f);In(c,T)}function Kr(c,f){const v=s.value[c]??[],T=Ll(v,f);ur(c,T)}function Yr(c,f){const v=l.value[c]??[],T=Ll(v,f);Ht(c,T)}function dr(c,f){if(!c)return;const v=f.trim(),T=i.value[c]??"";if(v.length===0){if(!T)return;i.value=vt(i.value,c);return}T!==v&&(i.value={...i.value,[c]:v})}function Rr(c,f){if(!c)return;const v=i.value[c]??"";dr(c,`${v}${f}`)}function zt(c){c&&c in i.value&&(i.value=vt(i.value,c))}function tr(c){c&&c in o.value&&(o.value=vt(o.value,c))}function Fn(c){c&&c in l.value&&(l.value=vt(l.value,c))}function Bn(c){c&&(tr(c),zt(c),bt(c,null),n.value,a.value[c]&&(a.value=vt(a.value,c)),ve.value[c]&&(ve.value=vt(ve.value,c)),lo(c))}function Qt(c){return c==="completed"?"completed":c==="inProgress"||c==="in_progress"?"inProgress":"pending"}function Un(c){var v;const f=[];(v=c.explanation)!=null&&v.trim()&&f.push(c.explanation.trim());for(const T of c.steps){const L=T.status==="completed"?"x":T.status==="inProgress"?"~":" ";f.push(`- [${L}] ${T.step}`)}return f.join(`
79
+ `).trim()}function qn(c){if(c.method!=="turn/plan/updated")return null;const f=w(c.params),v=ut(c),T=E(f==null?void 0:f.turnId)||E(f==null?void 0:f.turn_id),j=(Array.isArray(f==null?void 0:f.plan)?f==null?void 0:f.plan:[]).map(ee=>w(ee)).map(ee=>({step:E(ee==null?void 0:ee.step),status:Qt(ee==null?void 0:ee.status)})).filter(ee=>ee.step.length>0);if(!v||!T)return null;const V={explanation:E(f==null?void 0:f.explanation).trim()||void 0,steps:j,isStreaming:!0};return{threadId:v,message:{id:`${T}:plan`,role:"assistant",text:Un(V),messageType:"plan.live",plan:V}}}function jo(c){if(c.method!=="item/plan/delta")return null;const f=w(c.params),v=ut(c),T=E(f==null?void 0:f.turnId)||E(f==null?void 0:f.turn_id),L=E(f==null?void 0:f.delta);if(!v||!T||!L)return null;const j=`${T}:plan`,F=(o.value[v]??[]).find($e=>$e.id===j),V=`${(F==null?void 0:F.text)??""}${L}`,ee=F!=null&&F.plan?{...F.plan,isStreaming:!0}:void 0;return{threadId:v,message:{id:j,role:"assistant",text:V,messageType:"plan.live",plan:ee}}}function w(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function E(c){return typeof c=="string"?c:""}function m(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function S(c){var f,v;return((f=c.limitId)==null?void 0:f.trim())||((v=c.limitName)==null?void 0:v.trim())||"__default__"}function U(c){const f=w(c);if(!f)return null;const v=m(f.windowDurationMins);return{usedPercent:ba(m(f.usedPercent)??0,0,100),windowDurationMins:v,windowMinutes:v,resetsAt:m(f.resetsAt)}}function ge(c){const f=w(c);if(!f)return null;const v=w(f.credits);return{limitId:E(f.limitId)||null,limitName:E(f.limitName)||null,primary:U(f.primary),secondary:U(f.secondary),credits:v?{hasCredits:v.hasCredits===!0,unlimited:v.unlimited===!0,balance:E(v.balance)||null}:null,planType:E(f.planType)||null}}function nt(c){const f=w(c);if(!f)return[];const v=[],T=new Set,L=F=>{if(!F)return;const V=S(F);T.has(V)||(T.add(V),v.push(F))};L(ge(f.rateLimits));const j=w(f.rateLimitsByLimitId);if(j)for(const F of Object.values(j))L(ge(F));return v}function Mt(c){const f=w(c);if(!f)return null;const v=m(f.totalTokens??f.total_tokens),T=m(f.inputTokens??f.input_tokens),L=m(f.cachedInputTokens??f.cached_input_tokens),j=m(f.outputTokens??f.output_tokens),F=m(f.reasoningOutputTokens??f.reasoning_output_tokens);return v===null||T===null||L===null||j===null||F===null?null:{totalTokens:v,inputTokens:T,cachedInputTokens:L,outputTokens:j,reasoningOutputTokens:F}}function lt(c){const f=w(c);if(!f)return null;const v=Mt(f.total),T=Mt(f.last);if(!v||!T)return null;const L=m(f.modelContextWindow??f.model_context_window),j=T.totalTokens,F=typeof L=="number"?Math.max(L-j,0):null,V=typeof L=="number"&&L>0?ba(Math.round((F??0)/L*100),0,100):null;return{total:v,last:T,modelContextWindow:L,currentContextTokens:j,remainingContextTokens:F,remainingContextPercent:V}}function ct(c){if(c.method!=="thread/tokenUsage/updated")return null;const f=w(c.params),v=ut(c),T=lt((f==null?void 0:f.tokenUsage)??(f==null?void 0:f.token_usage));return!v||!T?null:{threadId:v,usage:T}}function ut(c){const f=w(c.params);if(!f)return"";const v=E(f.threadId);if(v)return v;const T=E(f.thread_id);if(T)return T;const L=E(f.conversationId);if(L)return L;const j=E(f.conversation_id);if(j)return j;const F=w(f.thread),V=E(F==null?void 0:F.id);if(V)return V;const ee=w(f.turn),$e=E(ee==null?void 0:ee.threadId);if($e)return $e;const We=E(ee==null?void 0:ee.thread_id);return We||""}function Hn(c){if(c.method!=="turn/completed")return"";const f=w(c.params),v=w(f==null?void 0:f.turn);if(!v||v.status!=="failed")return"";const T=w(v.error);return E(T==null?void 0:T.message)}function gn(c){var T;if(c.method!=="error")return null;const f=w(c.params),v=E(f==null?void 0:f.message)||E((T=w(f==null?void 0:f.error))==null?void 0:T.message);return v?{message:v,transient:(f==null?void 0:f.willRetry)===!0}:null}function Ks(c){const f=w(c);if(!f)return null;const v=f.id,T=E(f.method),L=f.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const j=w(L),F=hs(T,j),V=E(j==null?void 0:j.threadId)||E(j==null?void 0:j.thread_id)||E(j==null?void 0:j.conversationId)||E(j==null?void 0:j.conversation_id)||ai,ee=E(j==null?void 0:j.turnId)||E(j==null?void 0:j.turn_id),$e=E(j==null?void 0:j.itemId)||E(j==null?void 0:j.item_id)||E(j==null?void 0:j.callId)||E(j==null?void 0:j.call_id),We=E(f.receivedAtIso)||new Date().toISOString();return{id:v,method:F,threadId:V,turnId:ee,itemId:$e,receivedAtIso:We,params:L??null}}function hs(c,f){const v=c.trim();return v&&(v==="item/commandExecution/requestApproval"||v==="execCommandApproval"||v==="exec_approval_request"||uo(f)?"item/commandExecution/requestApproval":v==="item/fileChange/requestApproval"||v==="applyPatchApproval"||v==="apply_patch_approval_request"||sl(f)?"item/fileChange/requestApproval":v==="item/tool/requestUserInput"||v==="request_user_input"||Cn(f)?"item/tool/requestUserInput":v==="mcpServer/elicitation/request"||v==="elicitation_request"||zc(f)?"mcpServer/elicitation/request":v==="item/permissions/requestApproval"||Gc(f)?"item/permissions/requestApproval":v==="item/tool/call"||v==="dynamic_tool_call_request"||Fo(f)?"item/tool/call":v)}function uo(c){if(!c)return!1;const f=c.command;return Array.isArray(f)&&f.some(v=>typeof v=="string"&&v.trim().length>0)||typeof f=="string"&&f.trim().length>0?!0:Array.isArray(c.commandActions)}function sl(c){return c?typeof c.grantRoot=="string"&&c.grantRoot.trim().length>0||typeof c.grant_root=="string"&&c.grant_root.trim().length>0||w(c.fileChanges)?!0:w(c.changes)!==null:!1}function Cn(c){return!!(c&&Array.isArray(c.questions))}function Fo(c){return c?typeof c.toolName=="string"||typeof c.tool_name=="string"||typeof c.name=="string"||Array.isArray(c.arguments):!1}function zc(c){if(!c)return!1;const f=E(c.mode);return typeof c.serverName=="string"&&typeof c.threadId=="string"&&typeof c.message=="string"&&(f==="form"||f==="url")}function Gc(c){return c?typeof c.threadId=="string"&&typeof c.turnId=="string"&&typeof c.itemId=="string"&&w(c.permissions)!==null:!1}function Kc(c){if(c.method!=="item/tool/requestUserInput")return[];const f=w(c.params),v=Array.isArray(f==null?void 0:f.questions)?f.questions:[],T=[];for(const L of v){const j=w(L),F=E(j==null?void 0:j.id).trim();F&&T.push(F)}return T}function Ys(c){const f=c.threadId||ai,v=Ne.value[f]??[],T=v.findIndex(j=>j.id===c.id),L=[...v];T>=0?L.splice(T,1,c):L.push(c),Ne.value={...Ne.value,[f]:L.sort((j,F)=>j.receivedAtIso.localeCompare(F.receivedAtIso))},Tt()}function il(c){const f={};for(const[v,T]of Object.entries(Ne.value)){const L=T.filter(j=>j.id!==c);L.length>0&&(f[v]=L)}Ne.value=f,Tt()}function qi(c){const f={};for(const v of c){const T=v.threadId||ai,L=f[T]??[];L.push(v),f[T]=L}for(const v of Object.values(f))v.sort((T,L)=>T.receivedAtIso.localeCompare(L.receivedAtIso));Ne.value=f}function al(c){if(c.method==="server/request"){const f=Ks(c.params);return f&&Ys(f),!0}if(c.method==="server/request/resolved"){const f=w(c.params),v=f==null?void 0:f.id;return typeof v=="number"&&Number.isInteger(v)&&il(v),!0}return!1}function Jr(c){return c.replace(/\s+/gu," ").trim()}function Hi(c){const f=ut(c);if(!f)return null;if(c.method==="turn/started")return{threadId:f,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=w(c.params),T=w(v==null?void 0:v.item),L=E(T==null?void 0:T.type).toLowerCase();if(L==="reasoning")return{threadId:f,activity:{label:"Thinking",details:[]}};if(L==="agentmessage")return{threadId:f,activity:{label:"Writing response",details:[]}};if(L==="commandexecution"){const j=E(T==null?void 0:T.command);return{threadId:f,activity:{label:"Running command",details:j?[j]:[]}}}if(L==="filechange"){const F=(Array.isArray(T==null?void 0:T.changes)?T.changes:[])[0],V=E(F==null?void 0:F.path);return{threadId:f,activity:{label:"Applying changes",details:V?[V]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:f,activity:{label:"Running command",details:[]}}:c.method==="item/fileChange/outputDelta"?{threadId:f,activity:{label:"Applying changes",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:f,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:f,activity:{label:"Writing response",details:[]}}:null}function Yc(c){if(c.method!=="turn/started")return null;const f=w(c.params);if(!f)return null;const v=ut(c);if(!v)return null;const T=w(f.turn),L=E(T==null?void 0:T.id)||E(f.turnId)||`${v}:unknown`;if(!L)return null;const j=Ko(E(T==null?void 0:T.startedAt))??Ko(E(f.startedAt))??Ko(c.atIso)??Date.now();return{threadId:v,turnId:L,startedAtMs:j}}function Wi(c){if(c.method!=="turn/completed")return null;const f=w(c.params);if(!f)return null;const v=ut(c);if(!v)return null;const T=w(f.turn),L=E(T==null?void 0:T.id)||E(f.turnId)||`${v}:unknown`;if(!L)return null;const j=Ko(E(T==null?void 0:T.completedAt))??Ko(E(f.completedAt))??Ko(c.atIso)??Date.now(),F=Ko(E(T==null?void 0:T.startedAt))??Ko(E(f.startedAt))??void 0;return{threadId:v,turnId:L,completedAtMs:j,startedAtMs:F}}function Bo(c){return`${c}:live-reasoning`}function Jc(c){const f=r.value[c]??[];let v=-1;for(const T of f)typeof T.turnIndex=="number"&&Number.isFinite(T.turnIndex)&&(v=Math.max(v,T.turnIndex));return v+1}function ll(c,f,v){if(!c||!f||!Number.isInteger(v)||v<0)return;const T=Y.value[c]??{};T[f]!==v&&(Y.value={...Y.value,[c]:{...T,[f]:v}})}function Xc(c,f){const v=Y.value[c]??{},T=Object.entries(v),L=Object.entries(f);T.length===L.length&&T.every(([j,F])=>f[j]===F)||(Y.value={...Y.value,[c]:{...f}})}function Qc(c){const f=l.value[c];if(!f||f.length===0)return;const v=Y.value[c]??{};let T=!1;const L=f.map(j=>{if(typeof j.turnIndex=="number"||!j.turnId)return j;const F=v[j.turnId];return typeof F!="number"?j:(T=!0,{...j,turnIndex:F})});T&&(l.value={...l.value,[c]:L})}function Zc(c){const f=w(c.params);if(!f)return"";if(c.method==="item/started"){const v=w(f.item);return!v||v.type!=="reasoning"?"":E(v.id)}return""}function Vi(c){const f=w(c.params);if(!f)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=E(f.itemId),T=E(f.delta);return!v||!T?null:{messageId:Bo(v),delta:T}}return null}function zi(c){const f=w(c.params);if(!f)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=E(f.itemId);return v?Bo(v):""}return""}function cl(c){const f=w(c.params);if(!f)return"";if(c.method==="item/completed"){const v=w(f.item);return!v||v.type!=="reasoning"?"":Bo(E(v.id))}return""}function eu(c){const f=w(c.params);if(!f)return"";if(c.method==="item/started"){const v=w(f.item);return!v||v.type!=="agentMessage"?"":E(v.id)}return""}function tu(c){const f=w(c.params);if(!f)return null;if(c.method==="item/agentMessage/delta"){const v=E(f.itemId),T=E(f.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function ul(c){const f=w(c.params);if(!f)return null;if(c.method==="item/completed"){const v=w(f.item);if(!v||v.type!=="agentMessage")return null;const T=E(v.id),L=E(v.text);return!T||!L?null:{id:T,role:"assistant",text:L,messageType:"agentMessage.live"}}return null}function dl(c){var $e;if(c.method!=="item/started")return null;const f=w(c.params),v=w(f==null?void 0:f.item);if(!v||v.type!=="commandExecution")return null;const T=E(v.id),L=E(v.command);if(!T)return null;const j=typeof v.cwd=="string"?v.cwd:null,F=ut(c),V=E(f==null?void 0:f.turnId)||E(f==null?void 0:f.turn_id),ee=F&&V?($e=Y.value[F])==null?void 0:$e[V]:void 0;return{id:T,role:"system",text:L,messageType:"commandExecution",commandExecution:{command:L,cwd:j,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:V||void 0,turnIndex:typeof ee=="number"?ee:void 0}}function nu(c){if(c.method!=="item/commandExecution/outputDelta")return null;const f=w(c.params);if(!f)return null;const v=E(f.itemId),T=E(f.delta);return!v||!T?null:{itemId:v,delta:T}}function ru(c){var Nt;if(c.method!=="item/completed")return null;const f=w(c.params),v=w(f==null?void 0:f.item);if(!v||v.type!=="commandExecution")return null;const T=E(v.id),L=E(v.command);if(!T)return null;const j=typeof v.cwd=="string"?v.cwd:null,F=E(v.status),V=F==="failed"?"failed":F==="declined"?"declined":F==="interrupted"?"interrupted":"completed",ee=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",$e=typeof v.exitCode=="number"?v.exitCode:null,We=ut(c),Qe=E(f==null?void 0:f.turnId)||E(f==null?void 0:f.turn_id),dt=We&&Qe?(Nt=Y.value[We])==null?void 0:Nt[Qe]:void 0;return{id:T,role:"system",text:L,messageType:"commandExecution",commandExecution:{command:L,cwd:j,status:V,aggregatedOutput:ee,exitCode:$e},turnId:Qe||void 0,turnIndex:typeof dt=="number"?dt:void 0}}function ou(c){var $e;if(c.method!=="item/completed")return null;const f=w(c.params),v=w(f==null?void 0:f.item);if(!v||v.type!=="fileChange")return null;const T=E(v.id);if(!T)return null;const L=E(f==null?void 0:f.threadId),j=E(f==null?void 0:f.turnId),F=L&&j?($e=Y.value[L])==null?void 0:$e[j]:void 0,V=lb(v.changes),ee=ab(v.status);return V.length===0||ee!=="completed"?null:{id:T,role:"system",text:"",messageType:"fileChange",fileChangeStatus:ee,fileChanges:V,turnId:j||void 0,turnIndex:typeof F=="number"?F:void 0}}function Js(c,f){const v=a.value[c]??[],T=Ll(v,f);T!==v&&(a.value={...a.value,[c]:T})}function Gi(c,f){const v=a.value[c];if(!v||v.length===0)return;const T=new Set(f.map(j=>j.id)),L=v.filter(j=>!T.has(j.id));L.length!==v.length&&(L.length===0?a.value=vt(a.value,c):a.value={...a.value,[c]:L})}function Uo(c,f){const v=l.value[c];if(!v||v.length===0)return;const T=new Set(f.map(V=>V.id)),L=new Set(f.filter(V=>V.messageType==="fileChange"&&typeof V.turnId=="string"&&V.turnId.length>0).map(V=>V.turnId)),j=new Set(f.filter(V=>V.messageType==="fileChange"&&typeof V.turnIndex=="number").map(V=>V.turnIndex)),F=v.filter(V=>!T.has(V.id)&&!(V.turnId&&L.has(V.turnId))&&!(typeof V.turnIndex=="number"&&j.has(V.turnIndex)));F.length!==v.length&&(F.length===0?l.value=vt(l.value,c):l.value={...l.value,[c]:F})}function su(c){if(c.method==="item/agentMessage/delta")return!0;const f=w(c.params);if(!f)return!1;if(c.method==="item/completed"){const v=w(f.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function iu(c){var ws,Ho,ea,yl,_l;if(al(c))return;if(c.method==="account/rateLimits/updated"&&hn(),c.method==="thread/name/updated"){const Je=w(c.params),vn=E(Je==null?void 0:Je.threadId),po=E(Je==null?void 0:Je.threadName);vn&&po&&(Ve.value={...Ve.value,[vn]:po},Tt(),Td(vn,po))}if(c.method==="account/rateLimits/updated"){_n(db(c.params));return}const f=ct(c);if(f){an(f.threadId,f.usage);return}const v=Hi(c);v&&bt(v.threadId,v.activity);const T=ut(c),L=gn(c);!L&&T&&ps(T);const j=Yc(c);j&&(B.set(j.turnId,j),ll(j.threadId,j.turnId,Jc(j.threadId)),ve.value={...ve.value,[j.threadId]:j.turnId},tr(j.threadId),Fn(j.threadId),Bt(j.threadId,null),Rt(j.threadId,null),xt(j.threadId,!0),g.value[j.threadId]&&(g.value=vt(g.value,j.threadId)));const F=Wi(c),V=Hn(c),ee=(F==null?void 0:F.threadId)??ut(c),$e=ee?Ft(ee):"",We=!!ee&&!!V&&$e!==Pr&&Ol(new Error(V));if(F){Me.value[F.threadId];const Je=B.get(F.turnId);Je&&B.delete(F.turnId);const vn=m((ws=w(c.params))==null?void 0:ws.durationMs)??m((ea=w((Ho=w(c.params))==null?void 0:Ho.turn))==null?void 0:ea.durationMs)??(typeof F.startedAtMs=="number"?F.completedAtMs-F.startedAtMs:null)??(Je?F.completedAtMs-Je.startedAtMs:null),po=typeof vn=="number"?Math.max(0,vn):0;Bt(F.threadId,{turnId:F.turnId,durationMs:po}),ve.value[F.threadId]&&(ve.value=vt(ve.value,F.threadId)),xt(F.threadId,!1),bt(F.threadId,null),cr(F.threadId),We||(lo(F.threadId),ml(F.threadId))}if(V){const Je=(F==null?void 0:F.threadId)||ut(c);Je&&Rt(Je,V),C.value=V,Je&&We&&Hr(Je)}else F&&Rt(F.threadId,null);if(L){const Je=T,vn=Je?Ft(Je):$.value.trim();Je&&Rt(Je,L.message,{transient:L.transient}),C.value=L.message,vn!==Pr&&Ol(new Error(L.message))&&(Je?Hr(Je):Lt())}const Qe=qn(c);Qe&&(nn(Qe.threadId,Qe.message),bt(Qe.threadId,{label:"Planning",details:((yl=Qe.message.plan)==null?void 0:yl.steps.map(Je=>Je.step).slice(0,2))??[]}));const dt=jo(c);if(dt&&(nn(dt.threadId,dt.message),bt(dt.threadId,{label:"Planning",details:[]})),!T||T!==n.value)return;eu(c);const Nt=tu(c);if(Nt){const Je=(s.value[T]??[]).find(po=>po.id===Nt.messageId),vn=`${(Je==null?void 0:Je.text)??""}${Nt.delta}`;Kr(T,{id:Nt.messageId,role:"assistant",text:vn,messageType:"agentMessage.live"})}const ti=ul(c);ti&&Kr(T,ti),Zc(c);const ys=Vi(c);if(ys&&Rr(T,ys.delta),zi(c)){const Je=i.value[T]??"";Je.trim().length>0&&!Je.endsWith(`
80
+
81
+ `)&&dr(T,`${Je}
82
+
83
+ `)}cl(c);const _s=dl(c);_s&&(Js(T,_s),bt(T,{label:"Running command",details:[((_l=_s.commandExecution)==null?void 0:_l.command)??""]}));const qo=nu(c);if(qo){const Je=(a.value[T]??[]).find(vn=>vn.id===qo.itemId);Je!=null&&Je.commandExecution&&Js(T,{...Je,commandExecution:{...Je.commandExecution,aggregatedOutput:`${Je.commandExecution.aggregatedOutput}${qo.delta}`}})}const bs=ru(c);bs&&Js(T,bs);const fo=ou(c);if(fo&&Yr(T,fo),su(c)&&(P&&n.value&&xr(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),zt(T)),c.method==="turn/completed"){P=!1,zt(T),a.value[T]&&(a.value=vt(a.value,T));const Je=ut(c);Je&&(xt(Je,!1),bt(Je,null),cr(Je),We||(lo(Je),ml(Je)))}}function au(c){if(c.method==="thread/tokenUsage/updated")return;const f=ut(c);f&&we.add(f);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(be=!0),!(se!==null||typeof window>"u")&&(se=window.setTimeout(()=>{se=null,Mr()},Cd))}async function lu(c){if(!N){N=!0;try{const f=await Rs(),v=[];for(const T of f.order){const L=Yo(T);v.includes(L)||v.push(L)}if(v.length>0){const T=Nl(v,c);Qo(J.value,T)||(J.value=T,li(J.value))}if(Object.keys(f.labels).length>0){const T={...he.value};let L=!1;for(const[j,F]of Object.entries(f.labels)){const V=Yo(j);T[V]!==F&&(T[V]=F,L=!0)}L&&(he.value=T,Md(T))}}catch{}}}async function cu(){if(!(Object.keys(Ve.value).length>0))try{const c=await qM();Object.keys(c.titles).length>0&&(Ve.value=c.titles)}catch{}}async function Ki(c,f,v){if(Ve.value[c])return;const T=f.trim();if(!T)return;const L=T.length>300?T.slice(0,300):T;try{const j=await VM(L,v);if(!j||Ve.value[c])return;Ve.value={...Ve.value,[c]:j},Tt(),Td(c,j)}catch{}}async function fl(c){try{const f=await Rs();if(f.order.length===0)return c;const v=new Set(f.order.map(T=>Yo(T)));return c.filter(T=>v.has(T.projectName))}catch{return c}}async function ms(){var f;X.value||(K.value=!0);const c=performance.now();try{const[v]=await nf({name:"loadThreads",op:"ui.load.threads"},()=>Promise.all([tM(),cu()]));await lu(v);const T=await fl(v),L=Nl(J.value,T);Qo(J.value,L)||(J.value=L,li(J.value));const j=Pd(T,J.value);Qn(new Set($r(j).map(We=>We.id)));const F=QD(t.value,j,u.value);t.value=Dl(t.value,F),u.value=Gt(u.value,new Set($r(t.value).map(We=>We.id))),Tt(),X.value=!0;const V=$r(e.value);bn(V),V.some(We=>We.id===n.value)||pn(((f=V[0])==null?void 0:f.id)??"");const $e=Math.round(performance.now()-c);hr({category:"threads",message:`loaded ${V.length} threads in ${$e}ms`,data:{projectCount:T.length},level:"info"})}finally{K.value=!1}}async function Xr(c,f={}){var j;if(!c)return;const v=Ce.value[c]===!0,T=f.silent!==!0&&!v;T&&(_e.value=!0);const L=performance.now();try{const V=Pe.value[c]!==!0?yd(c):null,ee=ug(c),[$e,We]=await nf({name:"thread.loadMessages",op:"ui.load",attributes:{threadId:c,silent:f.silent??!1}},()=>Promise.all([V,ee]));$e&&(sn(c,$e.model),Pe.value={...Pe.value,[c]:!0});const{messages:Qe,inProgress:dt,activeTurnId:Nt,turnIndexByTurnId:ti}=We;Zn(c,Qe),Xc(c,ti),Qc(c);const ys=r.value[c]??[],vl=FD(ys,Qe,{preserveMissing:f.silent===!0});qt(c,vl);const _s=s.value[c]??[];if(dt){const Ho=UD(_s,Qe);ur(c,Ho)}else Gr(c);Gi(c,Qe),Uo(c,Qe),Ce.value={...Ce.value,[c]:!0};const qo=Ar(c);qo&&(xe.value={...xe.value,[c]:qo}),xt(c,dt),Nt?ve.value={...ve.value,[c]:Nt}:ve.value[c]&&(ve.value=vt(ve.value,c)),dt||Bn(c),En(c);const bs=Math.round(performance.now()-L),fo=le.value.find(Ho=>Ho.id===c),ws=((j=fo==null?void 0:fo.cwd)==null?void 0:j.split("/").pop())??"unknown";tk("thread",{id:c,messageCount:Qe.length,loadMs:bs,projectFolder:ws}),hr({category:"thread",message:`loaded ${Qe.length} msgs in ${bs}ms`,data:{threadId:c,projectFolder:ws},level:"info"})}finally{T&&(_e.value=!1)}}async function uu(c,f={}){c&&Ce.value[c]!==!0&&await Xr(c,f)}async function Yi(){var c,f;try{const v=((f=(c=Re.value)==null?void 0:c.cwd)==null?void 0:f.trim())??"";ot.value=await zM(v?[v]:void 0)}catch{}}async function du(){try{_n(await fg())}catch{}}async function fu(c={}){C.value="";const f=c.includeSelectedThreadMessages!==!1,v=c.awaitAncillaryRefreshes===!0;try{await ms();const T=Promise.allSettled([Vr(),ln(),Ln(),Yi(),du()]).then(()=>{});f&&await Xr(n.value),v&&await T}catch(T){C.value=T instanceof Error?T.message:"Unknown application error"}}async function pu(c){pn(c);try{await Promise.all([Xr(c),Yi()])}catch(f){C.value=f instanceof Error?f.message:"Unknown application error"}}async function hu(c){try{await hM(c),await ms(),n.value===c&&await Xr(n.value)}catch(f){C.value=f instanceof Error?f.message:"Unknown application error"}}async function Ji(c,f){const v=f.trim();if(!(!c||!v))try{await mM(c,v),Ve.value={...Ve.value,[c]:v},Tt(),Td(c,v)}catch(T){C.value=T instanceof Error?T.message:"Unknown application error"}}async function mu(c){var F,V;const f=c.trim();if(!f)return"";const v=$r(t.value).find(ee=>ee.id===f),T=((F=v==null?void 0:v.cwd)==null?void 0:F.trim())??"",L=((V=v==null?void 0:v.title)==null?void 0:V.trim())??"Forked chat",j=Ft(f);C.value="";try{const ee=await hg(f,T||void 0,j||void 0),$e=ee.threadId.trim();return $e?(mn($e,T,L),sn($e,ee.model),Pe.value={...Pe.value,[$e]:!0},pn($e),await ms(),await Xr($e),$e):""}catch(ee){return C.value=ee instanceof Error?ee.message:"Unknown application error",""}}async function gs(c,f){var F;const v=c.trim();if(!v||!Number.isInteger(f)||f<0)return"";if(u.value[v]===!0)return C.value="Finish the current turn before forking from a response.","";if(Ce.value[v]!==!0)try{await Xr(v)}catch(V){return C.value=V instanceof Error?V.message:"Unknown application error",""}const T=r.value[v]??[];let L=-1;for(const V of T)typeof V.turnIndex=="number"&&Number.isFinite(V.turnIndex)&&(L=Math.max(L,V.turnIndex));if(L>=0&&f>L)return"";const j=$r(t.value).find(V=>V.id===v)??null;try{C.value="";const V=await hg(v),ee=V.threadId.trim();if(!ee)return"";const $e=V.cwd.trim()||((F=j==null?void 0:j.cwd)==null?void 0:F.trim())||"",We=ej((j==null?void 0:j.title)||(j==null?void 0:j.preview)||"Untitled thread");mn(ee,$e,We),sn(ee,V.model),qt(ee,V.messages),Ce.value={...Ce.value,[ee]:!0},Pe.value={...Pe.value,[ee]:!0},tr(ee),ur(ee,[]),zt(ee),a.value[ee]&&(a.value=vt(a.value,ee)),Bt(ee,null),bt(ee,null),Rt(ee,null),xt(ee,!1);const Qe=L-f;if(Qe>0){const dt=await _d(ee,Qe);qt(ee,dt)}return await Ji(ee,We),pn(ee),ms().catch(()=>{}),ee}catch(V){return C.value=V instanceof Error?V.message:"Unknown application error",""}}async function pl(c,f,v=[],T=[],L=[]){if(!c||!f.trim()||v.length>0||T.length>0||L.length>0)return!1;const F=(Ne.value[c]??[]).filter($e=>$e.method==="item/tool/requestUserInput");if(F.length!==1)return!1;const[V]=F,ee=Kc(V);return ee.length!==1?!1:ei({id:V.id,result:{answers:{[ee[0]]:{answers:[f.trim()]}}}})}async function vs(c,f=[],v=[],T="steer",L=[],j){if(Ye.value)return;const F=n.value,V=c.trim();if(!F||!V&&f.length===0&&L.length===0||await pl(F,V,f,v,L))return;hr({category:"ui.action",message:"send message",data:{threadId:F,hasImages:f.length>0,skillCount:v.length},level:"info"});const ee=u.value[F]===!0;if(ee&&T==="queue"){const $e=d.value[F]??[],We=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,Qe=[...$e],dt=typeof j=="number"?Math.max(0,Math.min(j,Qe.length)):Qe.length;Qe.splice(dt,0,{id:We,text:V,imageUrls:f,skills:v,fileAttachments:L,collaborationMode:M.value}),d.value={...d.value,[F]:Qe};return}if(ee){P=!0,Xs(F,V,f,v,L).catch($e=>{const We=$e instanceof Error?$e.message:"Unknown application error";Rt(F,We),C.value=We});return}C.value="",P=!0,Bt(F,null),bt(F,{label:"Thinking",details:Xt(Ft(F),q.value,M.value)}),Rt(F,null),xt(F,!0);try{await Xs(F,V,f,v,L)}catch($e){P=!1,xt(F,!1),bt(F,null);const We=$e instanceof Error?$e.message:"Unknown application error";throw Rt(F,We),C.value=We,$e}}async function hl(c,f,v=[],T=[],L=[]){if(Ye.value)return"";const j=c.trim(),F=f.trim(),V=$.value.trim();if(!j&&v.length===0&&L.length===0)return"";fe.value=!0,C.value="";let ee="";try{try{const dt=await pg(F||void 0,V||void 0);ee=dt.threadId,sn(ee,dt.model)}catch(dt){if(V&&V!==Pr&&Ol(dt)){await Lt();const Nt=await pg(F||void 0,Pr);ee=Nt.threadId,sn(ee,Nt.model)}else throw dt}if(!ee)return"";mn(ee,F,j||"[Image]"),jn(ee),Pe.value={...Pe.value,[ee]:!0},pn(ee),P=!0,Bt(ee,null),bt(ee,{label:"Thinking",details:Xt($.value,q.value,M.value)}),Rt(ee,null),xt(ee,!0);const $e=ee,We=F||null,Qe=j;return Xs(ee,j,v,T,L).catch(dt=>{P=!1,xt(ee,!1),bt(ee,null);const Nt=dt instanceof Error?dt.message:"Unknown application error";Rt(ee,Nt),C.value=Nt}).finally(()=>{fe.value=!1}),Ki($e,Qe,We),ee}catch($e){P=!1,ee&&(xt(ee,!1),bt(ee,null));const We=$e instanceof Error?$e.message:"Unknown application error";throw ee&&Rt(ee,We),C.value=We,fe.value=!1,$e}}async function Xs(c,f,v=[],T=[],L=[]){const j=q.value,F=M.value,V=f.trim(),ee=[...v];if(ee.length===0&&Q(V)){const Qe=ie(c);Qe&&ee.push(Qe)}const $e=T.map(Qe=>({name:Qe.name,path:Qe.path})),We=L.map(Qe=>({...Qe}));Ir(c,{text:V,imageUrls:[...ee],skills:$e,fileAttachments:We,effort:j,collaborationMode:F,fallbackRetried:!1});try{if(Pe.value[c]!==!0){const Nt=await yd(c);sn(c,Nt.model)}const Qe=Ft(c);let dt="";try{dt=await bd(c,f,ee,Qe||void 0,j||void 0,T.length>0?T:void 0,L,F)}catch(Nt){if(Qe&&Qe!==Pr&&Ol(Nt))await Lt(c),Ir(c,{text:V,imageUrls:[...ee],skills:$e,fileAttachments:We,effort:j,collaborationMode:F,fallbackRetried:!0}),dt=await bd(c,f,ee,Pr,j||void 0,T.length>0?T:void 0,L,F);else throw Nt}dt&&(ve.value={...ve.value,[c]:dt}),Pe.value={...Pe.value,[c]:!0},we.add(c),be=!0,await Mr(),ar(c)}catch(Qe){throw Qe}}async function ml(c){if(p.value[c]===!0)return;const f=d.value[c];if(!f||f.length===0)return;p.value={...p.value,[c]:!0};const[v,...T]=f;d.value=T.length>0?{...d.value,[c]:T}:vt(d.value,c),fe.value=!0,C.value="",P=!0,Bt(c,null),bt(c,{label:"Thinking",details:Xt(Ft(c),q.value,v.collaborationMode)}),Rt(c,null),xt(c,!0);try{_t(v.collaborationMode),await Xs(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{xt(c,!1),bt(c,null)}finally{p.value=vt(p.value,c),fe.value=!1}}async function gu(){const c=n.value;if(!c||u.value[c]!==!0||Se.value[c]===!0)return;let f=ve.value[c];if(!f){const{activeTurnId:v}=await ug(c);f=v,f&&(ve.value={...ve.value,[c]:f})}if(!f)throw new Error("Could not determine active turn id for interrupt");Oe.value=!0,C.value="";try{await wM(c,f),xt(c,!1),bt(c,null),Rt(c,null),ve.value[c]&&(ve.value=vt(ve.value,c)),we.add(c),be=!0,await Mr()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";Rt(c,T),C.value=T}finally{Oe.value=!1}}async function vu(c){var V,ee;const f=n.value;if(!f||k.value||!c.trim())return;const v=r.value[f]??[],T=v.find($e=>$e.turnId===c),L=typeof(T==null?void 0:T.turnIndex)=="number"?T.turnIndex:-1;if(L<0)return;const j=v.reduce(($e,We)=>typeof We.turnIndex=="number"&&We.turnIndex>$e?We.turnIndex:$e,-1);if(j<0||L>j)return;const F=j-L+1;if(!(F<1)){k.value=!0,C.value="";try{const $e=((ee=(V=Re.value)==null?void 0:V.cwd)==null?void 0:ee.trim())??"";$e&&await gM(f,c,$e);const We=await _d(f,F);qt(f,We),ur(f,[]),zt(f),a.value[f]&&(a.value=vt(a.value,f)),Bt(f,null),bt(f,null),Rt(f,null),be=!0,await Mr()}catch($e){C.value=$e instanceof Error?$e.message:"Failed to rollback thread"}finally{k.value=!1}}}let Qs=null;async function yu(c,f){try{const v=await Rs(),T={...v.labels};let L=!1;for(const j of v.order){if(Yo(j)!==c)continue;const F=f.trim();F.length===0?T[j]!==void 0&&(delete T[j],L=!0):T[j]!==F&&(T[j]=F,L=!0)}L&&await wd({order:v.order,labels:T,active:v.active})}catch{}}function gl(c,f){c.length===0||(he.value[c]??"")===f||(he.value={...he.value,[c]:f},Md(he.value),Qs!==null&&clearTimeout(Qs),Qs=setTimeout(()=>{Qs=null,yu(c,f)},500))}async function _u(c){var j;if(c.length===0)return;const f=J.value.filter(F=>F!==c);if(Qo(J.value,f)||(J.value=f,li(J.value)),t.value=t.value.filter(F=>F.projectName!==c),he.value[c]!==void 0){const F={...he.value};delete F[c],he.value=F,Md(F)}Tt();const v=$r(e.value);bn(v),v.some(F=>F.id===n.value)||pn(((j=v[0])==null?void 0:j.id)??"");const L=new Set;try{const F=await Rs();for(const V of F.order)Yo(V)===c&&L.add(V);for(const V of F.active)Yo(V)===c&&L.add(V);for(const V of Object.keys(F.labels))Yo(V)===c&&L.add(V)}catch{}if(L.size>0)try{const F=await Rs(),V=F.order.filter(We=>!L.has(We)),ee=F.active.filter(We=>!L.has(We)),$e=ee.length===0&&V.length>0?[V[0]]:ee;await wd({order:V,labels:KD(F.labels,L),active:$e});return}catch{}await Xi()}function Zs(c,f){if(c.length===0||t.value.length===0)return;const v=t.value.map(ee=>ee.projectName),T=v.indexOf(c);if(T===-1)return;const L=Math.max(0,Math.min(f,v.length-1)),j=OD(v,T,L);if(j===v)return;const F=Nl(j,t.value);J.value=F,li(J.value);const V=Pd(t.value,J.value);t.value=Dl(t.value,V),Tt(),Xi()}function bu(c){const f=c.trim();if(!f)return;const v=[f,...J.value.filter(L=>L!==f)];if(Qo(J.value,v))return;J.value=v,li(J.value);const T=Pd(t.value,J.value);t.value=Dl(t.value,T),Tt(),Xi()}async function Xi(){var c,f;try{const v=await Rs(),T=new Map;for(const F of v.order){const V=Yo(F);T.has(V)||T.set(V,F)}for(const F of t.value){const V=((f=(c=F.threads[0])==null?void 0:c.cwd)==null?void 0:f.trim())??"";V&&T.set(F.projectName,V)}const L=[];for(const F of J.value){const V=T.get(F);V&&!L.includes(V)&&L.push(V)}for(const F of v.order)L.includes(F)||L.push(F);const j=v.active.filter(F=>L.includes(F));j.length===0&&L.length>0&&j.push(L[0]),await wd({order:L,labels:v.labels,active:j})}catch{}}async function Mr(){if(H.value){typeof window<"u"&&se===null&&(se=window.setTimeout(()=>{se=null,Mr()},Cd));return}H.value=!0;const c=be,f=new Set(we);be=!1,we.clear();try{c&&await ms();const v=n.value;if(!v)return;const T=f.has(v),L=u.value[v]===!0,j=Ar(v),F=xe.value[v]??"",V=j.length>0&&j!==F;(T||L||V||c)&&await Xr(v,{silent:!0})}catch{}finally{H.value=!1,(be||we.size>0)&&typeof window<"u"&&se===null&&(se=window.setTimeout(()=>{se=null,Mr()},Cd))}}async function wu(){await Qi(),be=!0,n.value&&we.add(n.value),await Mr()}function Su(){typeof window>"u"||me||(Qi(),me=aM(c=>{if(c.method==="ready"){er(),wu();return}iu(c),au(c)}))}async function Qi(){try{const f=(await cM()).map(v=>Ks(v)).filter(v=>v!==null);qi(f)}catch{}}async function ei(c){try{return await lM(c.id,{result:c.result,error:c.error}),il(c.id),!0}catch(f){return C.value=f instanceof Error?f.message:"Failed to reply to server request",!1}}function Tu(){if(me&&(me(),me=null),be=!1,we.clear(),B.clear(),se!==null&&typeof window<"u"&&(window.clearTimeout(se),se=null),te!==null&&typeof window<"u"&&(window.clearTimeout(te),te=null),typeof window<"u")for(const c of Le.values())window.clearTimeout(c);Le.clear(),P=!1,r.value={},o.value={},s.value={},i.value={},a.value={},l.value={},Y.value={},Ae.value={},de.value={},De.value={},ve.value={},Se.value={},ae.value={},ke.value={},d.value={},p.value={},qe.value=null,He.value={}}const Eu=oe(()=>{const c=n.value;return c?d.value[c]??[]:[]});function Zi(c){const f=n.value;if(!f)return;const v=d.value[f];if(!v)return;const T=v.filter(L=>L.id!==c);d.value=T.length>0?{...d.value,[f]:T}:vt(d.value,f)}function ku(c){const f=n.value;if(!f)return;const v=d.value[f];if(!v)return;const T=v.find(L=>L.id===c);T&&(Zi(c),_t(T.collaborationMode),vs(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}function Iu(c){pn(c)}return{projectGroups:e,projectDisplayNameById:he,selectedThread:Re,selectedThreadTokenUsage:On,selectedThreadScrollState:Fe,isSelectedThreadInterruptPending:et,selectedThreadServerRequests:tt,selectedLiveOverlay:Pt,codexQuota:Vt,selectedThreadId:n,availableCollaborationModes:I,availableModelIds:_,selectedCollaborationMode:M,selectedModelId:$,selectedReasoningEffort:q,selectedSpeedMode:z,installedSkills:ot,accountRateLimitSnapshots:Ge,messages:st,isLoadingThreads:K,isLoadingMessages:_e,isSendingMessage:fe,isInterruptingTurn:Oe,isUpdatingSpeedMode:Ye,isRollingBack:k,error:C,refreshAll:fu,refreshSkills:Yi,selectThread:pu,loadMessages:Xr,ensureThreadMessagesLoaded:uu,setThreadScrollState:xr,archiveThreadById:hu,renameThreadById:Ji,forkThreadById:mu,forkThreadFromTurn:gs,rollbackSelectedThread:vu,sendMessageToSelectedThread:vs,sendMessageToNewThread:hl,interruptSelectedThreadTurn:gu,selectedThreadQueuedMessages:Eu,removeQueuedMessage:Zi,steerQueuedMessage:ku,setSelectedCollaborationMode:_t,setSelectedModelId:Jn,setSelectedReasoningEffort:co,updateSelectedSpeedMode:Wr,respondToPendingServerRequest:ei,renameProject:gl,removeProject:_u,reorderProject:Zs,pinProjectToTop:bu,startPolling:Su,stopPolling:Tu,primeSelectedThread:Iu}}const nj={class:"sidebar-root"},rj={class:"sidebar-scrollable"},oj=["aria-pressed"],sj={key:1,class:"sidebar-search-bar"},ij={class:"sidebar-settings-account-section"},aj={class:"sidebar-settings-account-header"},lj={class:"sidebar-settings-account-header-main"},cj=["aria-expanded","title"],uj={class:"sidebar-settings-account-collapse-icon"},dj={class:"sidebar-settings-account-count"},fj=["disabled"],pj={key:0,class:"sidebar-settings-account-error"},hj={key:1,class:"sidebar-settings-account-empty"},mj={key:2,class:"sidebar-settings-account-list"},gj=["title","onMouseenter","onMouseleave"],vj={class:"sidebar-settings-account-main"},yj={class:"sidebar-settings-account-email"},_j={class:"sidebar-settings-account-meta"},bj={class:"sidebar-settings-account-quota"},wj={class:"sidebar-settings-account-id"},Sj={class:"sidebar-settings-account-actions"},Tj=["disabled","onClick"],Ej=["disabled","onClick"],kj=["title"],Ij=["title"],Cj={class:"sidebar-settings-value"},Aj=["title"],xj={class:"sidebar-settings-value"},Rj=["title"],Mj={class:"sidebar-settings-value"},Pj=["title"],$j=["title"],Nj=["title"],Oj={class:"sidebar-settings-row sidebar-settings-row--select",title:"Choose the API provider for the Codex backend"},Lj=["value","disabled"],Dj={key:0,class:"sidebar-settings-row sidebar-settings-row--input"},jj={class:"sidebar-settings-key-group"},Fj={class:"sidebar-settings-key-masked"},Bj=["disabled"],Uj=["disabled"],qj={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},Hj={class:"sidebar-settings-key-group"},Wj={class:"sidebar-settings-key-group"},Vj=["disabled"],zj=["title"],Gj={class:"sidebar-settings-value"},Kj={key:2,class:"sidebar-settings-telegram-panel"},Yj={class:"sidebar-settings-field"},Jj={class:"sidebar-settings-field"},Xj={key:0,class:"sidebar-settings-telegram-error"},Qj={class:"sidebar-settings-telegram-actions"},Zj=["disabled"],eF=["data-state","title"],tF=["data-state"],nF={class:"sidebar-settings-context-meta"},rF={class:"sidebar-settings-rate-limits"},oF={class:"sidebar-settings-build-label","aria-label":"Worktree name and version"},sF={class:"sidebar-settings-button-version"},iF={class:"content-body"},aF={key:1,class:"content-grid content-grid-home"},lF={class:"new-thread-empty"},cF=["title"],uF=["onKeydown"],dF={class:"new-thread-open-folder-current"},fF=["title"],pF=["disabled"],hF={class:"new-thread-open-folder-actions"},mF={class:"new-thread-open-folder-toggle"},gF=["aria-pressed","disabled"],vF={key:0,class:"new-thread-open-folder-create"},yF={class:"new-thread-open-folder-create-composer"},_F=["onKeydown"],bF=["disabled"],wF={key:0,class:"new-thread-open-folder-error"},SF=["onKeydown"],TF={key:1,class:"new-thread-open-folder-error-actions"},EF={class:"new-thread-open-folder-error"},kF=["disabled"],IF={key:2,class:"new-thread-open-folder-status"},CF={key:3,class:"new-thread-open-folder-status"},AF={key:4,class:"new-thread-open-folder-list"},xF=["title","disabled","onClick"],RF={class:"new-thread-open-folder-item-name"},MF=["disabled","onClick"],PF={key:1,class:"new-thread-branch-select"},$F={class:"new-thread-branch-select-help"},NF={class:"worktree-init-status-title"},OF={class:"worktree-init-status-message"},LF={key:3,class:"new-thread-trending"},DF={class:"new-thread-trending-header"},jF={key:0,class:"new-thread-trending-empty"},FF={key:1,class:"new-thread-trending-empty"},BF={key:2,class:"new-thread-trending-list"},UF=["onClick"],qF=["title"],HF={class:"new-thread-trending-tip-name-owner"},WF={class:"new-thread-trending-tip-name-repo"},VF={key:1,class:"new-thread-trending-tip-name-repo"},zF={class:"new-thread-trending-tip-meta"},GF={class:"new-thread-trending-tip-description"},KF={class:"composer-with-queue"},YF={key:2,class:"content-grid"},JF={class:"content-thread"},XF={class:"composer-with-queue"},Lg="codex-web-local.sidebar-collapsed.v1",Dg="codex-web-local.accounts-section-collapsed.v1",jg="codex-web-local.send-with-enter.v1",Fg="codex-web-local.in-progress-send-mode.v1",Bg="codex-web-local.dark-mode.v1",Ug="codex-web-local.dictation-click-to-toggle.v1",qg="codex-web-local.dictation-auto-send.v1",Hg="codex-web-local.dictation-language.v1",Wg="codex-web-local.github-trending-projects.v1",Vg="codex-web-local.chat-width.v1",QF=400,ZF=Tn({__name:"App",setup(e){const t=Bu(()=>ud(()=>import("./ThreadConversation-Dr0u8WbA.js"),__vite__mapDeps([0,1]))),n=Bu(()=>ud(()=>import("./ReviewPane-gbhCGpfh.js"),__vite__mapDeps([2,3]))),r=Bu(()=>ud(()=>import("./SkillsHub-xXcF9J80.js"),__vite__mapDeps([4,5]))),o="a77f",s="0.1.91",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:u,projectDisplayNameById:d,selectedThread:p,selectedThreadTokenUsage:g,selectedThreadScrollState:_,selectedThreadServerRequests:I,selectedLiveOverlay:R,codexQuota:W,selectedThreadId:M,availableCollaborationModes:$,availableModelIds:q,selectedCollaborationMode:z,selectedModelId:ue,selectedReasoningEffort:ne,selectedSpeedMode:J,installedSkills:he,accountRateLimitSnapshots:xe,messages:Ce,isLoadingThreads:Pe,isLoadingMessages:Y,isSendingMessage:de,isInterruptingTurn:Ae,isSelectedThreadInterruptPending:De,isUpdatingSpeedMode:ve,refreshAll:Se,refreshSkills:ae,selectThread:ke,ensureThreadMessagesLoaded:Ne,setThreadScrollState:Me,archiveThreadById:qe,forkThreadById:He,renameThreadById:Ve,forkThreadFromTurn:ot,sendMessageToSelectedThread:Ge,sendMessageToNewThread:K,interruptSelectedThreadTurn:_e,selectedThreadQueuedMessages:fe,removeQueuedMessage:Oe,steerQueuedMessage:Ye,setSelectedCollaborationMode:k,setSelectedModelId:C,setSelectedReasoningEffort:H,updateSelectedSpeedMode:X,respondToPendingServerRequest:Z,renameProject:Q,removeProject:ie,reorderProject:me,pinProjectToTop:se,startPolling:te,stopPolling:Le,primeSelectedThread:ye,rollbackSelectedThread:be}=tj(),we=fR(),N=dR(),{isMobile:P}=Sp(),B=O(null),G=O(null),le=O(null),Re=O([]),Fe=O(!1),et=O("trending-daily"),tt=O(null),Pt=O(!1);let Vt=!1;const On=O(!1),st=O(""),Ft=O("local"),on=O(""),pn=O([]),Jn=O(!1),sn=O({order:[],labels:{}}),an=O({phase:"idle",title:"",message:""}),_t=O(Zb()),_n=O(""),Lt=O(!1),Ir=O(null),lo=O(null),Hr=O(null),co=O(null),Wr=O(null);let Ln=null;const Xt=O("New Project (1)"),Vr=O(""),ln=O(!1),hn=O(tw()),Xn=O(!1),ar=O([]),Dn=O(null),Cr=O(!1),zr=O(!1),lr=O(null),Tt=O([]),mn=O(!1),bn=O(!1),En=O(""),Bt=O(""),xt=O(""),Ut=O(""),jn=O(bl(jg,!0)),kn=O(Fb()),Qn=O(jb()),Zn=O(Bb()),cr=O(bl(Ug,!1)),bt=O(bl(qg,!0)),Rt=O(Xb()),ps=oe(()=>Qb()),er=O(bl(Wg,!1)),Ar=O(!1),xr=O(!1),qt=O(""),ur=O(!1),Gr=O(null),Ht=O(!1),In=O("codex"),nn=O(""),Kr=O(""),Yr=O(!1),dr=O(""),Rr=O(""),zt=O(""),tr=O(!1),Fn=O(!1),Bn=O(""),Qt=O(""),Un=O(!1),qn=O(!1),jo=O(null),w=O(""),E=O(""),m=O([]),S=O(""),U=O(!1),ge=O(!1),nt=O(!1),Mt=O(""),lt=O({configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:""}),ct=O(null),ut=O(!1),Hn=O(!1);let gn=null,Ks=!1,hs=0;const uo=oe(()=>{const h=we.params.threadId;return typeof h=="string"?h:""}),sl=oe(()=>{const h=new Set;for(const y of u.value)for(const A of y.threads)h.add(A.id);return h}),Cn=oe(()=>we.name==="home"),Fo=oe(()=>we.name==="skills"),zc=oe(()=>{var h;return Fo.value?"Skills":Cn.value?"New thread":((h=p.value)==null?void 0:h.title)??"Choose a thread"}),Gc=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",Kc=oe(()=>{var y,A;return(((A=(y=p.value)==null?void 0:y.title)==null?void 0:A.trim())??"")||Gc}),Ys=oe(()=>Ce.value.filter(h=>{const y=rw(h.messageType,h.role);return y==="worked"?!0:!(y==="turnActivity.live"||y==="turnError.live"||y==="agentReasoning.live")})),il=oe(()=>R.value),qi=oe(()=>Cn.value?"__new-thread__":M.value),al=oe(()=>{const h=I.value;return h.length>0?h[h.length-1]:null}),Jr=oe(()=>{var h,y;return Cn.value?st.value.trim():((y=(h=p.value)==null?void 0:h.cwd)==null?void 0:y.trim())??""}),Hi=oe(()=>{var h;return!Cn.value&&((h=p.value)==null?void 0:h.inProgress)===!0}),Yc=oe(()=>!Cn.value&&!Fo.value&&M.value.trim().length>0),Wi=oe(()=>de.value||Ae.value||Hi.value||I.value.length>0);function Bo(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 Jc(h){if(!h)return"Waiting for Codex thread/tokenUsage/updated events for this thread.";const y=[`Current context usage: ${h.currentContextTokens.toLocaleString()} tokens`,`Cumulative thread usage: ${h.total.totalTokens.toLocaleString()} tokens`];return typeof h.modelContextWindow=="number"?(y.unshift(`Model context window: ${h.modelContextWindow.toLocaleString()} tokens`),y.push(`Remaining context: ${(h.remainingContextTokens??0).toLocaleString()} tokens`)):y.push("Model context window is unavailable in the latest usage event."),y.join(`
84
+ `)}const ll=oe(()=>{var y;const h=(y=g.value)==null?void 0:y.remainingContextPercent;return h===null||typeof h!="number"?"pending":h<=10?"danger":h<=25?"warning":"ok"}),Xc=oe(()=>{const h=g.value;return h?typeof h.remainingContextTokens=="number"?`${Bo(h.remainingContextTokens)} left`:`${Bo(h.currentContextTokens)} used`:"Awaiting data"}),Qc=oe(()=>{const h=g.value;return h?typeof h.modelContextWindow=="number"?`${Bo(h.currentContextTokens)} used / ${Bo(h.modelContextWindow)}`:"Window size unavailable":"Updates after the next token usage event"}),Zc=oe(()=>Jc(g.value)),Vi=oe(()=>{var re,Te;const h=[],y=new Set;for(const Ie of sn.value.order){const rt=Ie.trim();!rt||y.has(rt)||(y.add(rt),h.push({value:rt,label:sn.value.labels[rt]||xs(rt)}))}for(const Ie of u.value){const rt=((Te=(re=Ie.threads[0])==null?void 0:re.cwd)==null?void 0:Te.trim())??"";!rt||y.has(rt)||(y.add(rt),h.push({value:rt,label:d.value[Ie.projectName]??Ie.projectName}))}const A=st.value.trim();return A&&!y.has(A)&&h.unshift({value:A,label:xs(A)}),h}),zi=oe(()=>{const h=on.value.trim(),y=[...pn.value];return h&&!y.some(A=>A.value===h)&&y.unshift({value:h,label:h}),y}),cl=oe(()=>{const h=on.value.trim();if(!h)return"";const y=zi.value.find(A=>A.value===h);return(y==null?void 0:y.label)??h}),eu=oe(()=>Dn.value??"__detached_head__"),tu=oe(()=>{var re;const h=[{value:"__review__",label:Xn.value?"Review (Open)":"Review"}],y=new Set,A=((re=Dn.value)==null?void 0:re.trim())??"";A?(h.push({value:A,label:A}),y.add(A)):(h.push({value:"__detached_head__",label:"Detached HEAD"}),y.add("__detached_head__"));for(const Te of ar.value)!Te.value||y.has(Te.value)||(y.add(Te.value),h.push(Te));return h}),ul=oe(()=>w.value.trim()),dl=oe(()=>{const h=Bn.value.trim();return!h||h==="."||h===".."?!1:!/[\\/]/u.test(h)}),nu=oe(()=>dl.value&&ul.value.trim().length>0&&!S.value),ru=oe(()=>Un.value?"Creating…":"Create"),ou=oe(()=>{const h=w.value.trim(),y=E.value.trim();return!!(h&&y&&h!==y)}),Js=oe(()=>{const h=[];ou.value&&h.push({key:`parent:${E.value}`,name:"..",path:E.value,kind:"parent"});for(const y of m.value)h.push({key:`directory:${y.path}`,name:y.name,path:y.path,kind:"directory"});return h}),Gi=oe(()=>{const h=Mt.value.trim().toLowerCase();return h?Js.value.filter(y=>y.kind==="parent"||y.name.toLowerCase().includes(h)):Js.value}),Uo=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,su=oe(()=>[{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"}]),iu=oe(()=>a[Zn.value].label),au=oe(()=>{const h=a[Zn.value];return{"--chat-column-max":h.columnMax,"--chat-card-max":h.cardMax}}),lu=oe(()=>{if(!lt.value.configured)return"Not configured";const h=lt.value.active?"Online":"Configured (offline)",y=lt.value.allowAllUsers?"allow all users":`${lt.value.allowedUsers} allowed user(s)`,A=`${lt.value.mappedChats} chat(s), ${lt.value.mappedThreads} thread(s), ${y}`,re=lt.value.lastError?`, error: ${lt.value.lastError}`:"";return`${h}, ${A}${re}`});cs(()=>{document.addEventListener("pointerdown",ee),window.addEventListener("keydown",V),document.addEventListener("visibilitychange",We),window.addEventListener("pageshow",Qe),window.addEventListener("focus",dt),wl(),Uo==null||Uo.addEventListener("change",wl),ow(),Mb(),ni(),Wo(),fl(),Ki(),Mu(),er.value&&Au()}),xc(()=>{document.removeEventListener("pointerdown",ee),window.removeEventListener("keydown",V),document.removeEventListener("visibilitychange",We),window.removeEventListener("pageshow",Qe),window.removeEventListener("focus",dt),Uo==null||Uo.removeEventListener("change",wl),gn!==null&&(window.clearInterval(gn),gn=null),Ln&&(clearTimeout(Ln),Ln=null),Le()}),it(_n,h=>{const y=h.trim();if(Ln&&(clearTimeout(Ln),Ln=null),!y){Wr.value=null;return}Ln=setTimeout(()=>{LM(y,1e3).then(A=>{_n.value.trim()===y&&(Wr.value=A.threadIds)}).catch(()=>{_n.value.trim()===y&&(Wr.value=null)})},220)}),it(Tt,()=>{if(typeof window>"u")return;if(!Tt.value.some(y=>y.quotaStatus==="loading")){gn!==null&&(window.clearInterval(gn),gn=null);return}gn===null&&(gn=window.setInterval(()=>{Ks||(Ks=!0,Zs({silent:!0}).finally(()=>{Ks=!1}))},1500))},{deep:!0});function cu(){ae()}async function Ki(){try{lt.value=await FM()}catch(h){const y=h instanceof Error?h.message:"Failed to load Telegram status";lt.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:y}}}async function fl(){try{const h=await jM();dr.value=h.botToken,Rr.value=h.allowedUserIds.map(y=>String(y)).join(`
85
+ `),zt.value=""}catch(h){zt.value=h instanceof Error?h.message:"Failed to load Telegram configuration"}}function ms(h){const y=h.split(/[\n,]/).map(Te=>Te.trim().replace(/^(telegram|tg):/i,"").trim()).filter(Boolean),A=y.includes("*"),re=Array.from(new Set(y.filter(Te=>/^-?\d+$/.test(Te)).map(Te=>Number.parseInt(Te,10))));return A?["*",...re]:re}async function Xr(){const h=dr.value.trim(),y=ms(Rr.value);if(!h){zt.value="Telegram bot token is required.";return}if(y.length===0){zt.value="At least one allowed Telegram user ID or * is required.";return}tr.value=!0,zt.value="";try{await DM(h,y),Rr.value=y.map(A=>String(A)).join(`
86
+ `),await Promise.all([fl(),Ki()]),window.alert("Telegram bot configured. Only allowlisted Telegram users can use the bridge.")}catch(A){zt.value=A instanceof Error?A.message:"Failed to connect Telegram bot",Ki()}finally{tr.value=!1}}function uu(){Lt.value=!Lt.value,Lt.value?Yt(()=>{var h;return(h=Ir.value)==null?void 0:h.focus()}):_n.value=""}function Yi(){var h;_n.value="",(h=Ir.value)==null||h.focus()}function du(h){h.key==="Escape"&&(Lt.value=!1,_n.value="")}function fu(h){h&&(we.name==="thread"&&uo.value===h||(N.push({name:"thread",params:{threadId:h}}),P.value&&F(!0)))}async function pu(h){h&&(M.value!==h&&(await ke(h),await N.push({name:"thread",params:{threadId:h}})),await Yt(),Nb())}function hu(h){return h.length>8?h.slice(-8):h}function Ji(h){const y=[h.planType||"unknown"];return h.authMode&&y.unshift(h.authMode),y.join(" · ")}function mu(h){if(!h)return!1;const y=h.toLowerCase();return y.includes("payment required")||/\b402\b/.test(y)}function gs(h){return h.unavailableReason==="payment_required"||mu(h.quotaError)}function pl(h){return mn.value||bn.value||En.value.length>0||h.isActive&&En.value!==h.accountId&&Wi.value}function vs(h){return Bt.value===h.accountId}function hl(h){return xt.value===h.accountId||vs(h)}function Xs(h){return gs(h)?"Unavailable":h.isActive?"Active":bn.value?"Switching…":"Switch"}function ml(h){return En.value===h.accountId?"Removing…":vs(h)?"Click again to remove":"Remove"}function gu(h){xt.value=h}function vu(h){xt.value===h&&(xt.value=""),En.value!==h&&Bt.value===h&&(Bt.value="")}function Qs(h){const y=h.quotaSnapshot;if(!y)return null;const A=[y==null?void 0:y.primary,y==null?void 0:y.secondary].filter(Ie=>Ie!==null),re=A.find(Ie=>Ie.windowMinutes===10080);if(re)return re;const Te=A.filter(Ie=>typeof Ie.windowMinutes=="number"&&Ie.windowMinutes>=10080).sort((Ie,rt)=>(Ie.windowMinutes??0)-(rt.windowMinutes??0))[0]??null;return Te||(y.secondary??null)}function yu(h){if(typeof h!="number"||!Number.isFinite(h))return"";const y=new Date(h*1e3);return`${y.getMonth()+1}月${y.getDate()}日`}function gl(h){var Ie,rt;if(gs(h))return h.quotaError||"402 Payment Required";const y=h.quotaSnapshot,A=Qs(h),re=(y==null?void 0:y.primary)??(y==null?void 0:y.secondary)??null,Te=A??re;if(Te){const An=Math.max(0,Math.min(100,100-Math.round(Te.usedPercent))),Qr=yu(Te.resetsAt);return Qr?`${An}% weekly remaining · ${Qr}`:`${An}% weekly remaining`}return(Ie=y==null?void 0:y.credits)!=null&&Ie.unlimited?"Unlimited credits":(rt=y==null?void 0:y.credits)!=null&&rt.hasCredits&&y.credits.balance?`${y.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 _u(h){return[h.email||"Account",Ji(h),gs(h)?"Unavailable account":null,gl(h),`Workspace ${h.accountId}`].filter(Boolean).join(`
87
+ `)}async function Zs(h={}){try{const y=await uM();Tt.value=y.accounts,y.accounts.some(A=>A.accountId===xt.value)||(xt.value=""),y.accounts.some(A=>A.accountId===Bt.value)||(Bt.value="")}catch(y){if(h.silent===!0)return;Ut.value=y instanceof Error?y.message:"Failed to load accounts"}}async function bu(){if(!(mn.value||bn.value)){Ut.value="",xt.value="",Bt.value="",mn.value=!0;try{const h=await dM();Tt.value=h.accounts,Le(),te(),Se({includeSelectedThreadMessages:!0})}catch(h){Ut.value=h instanceof Error?h.message:"Failed to refresh accounts"}finally{mn.value=!1}}}async function Xi(h){if(!(bn.value||mn.value)){if(Wi.value){Ut.value="Finish the current turn and pending requests before switching accounts.";return}Ut.value="",xt.value="",Bt.value="",bn.value=!0;try{const y=await fM(h);Tt.value=Tt.value.map(A=>A.accountId===h?y:{...A,isActive:!1}),Le(),te(),Se({includeSelectedThreadMessages:!0}),Zs({silent:!0})}catch(y){Ut.value=y instanceof Error?y.message:"Failed to switch account"}finally{bn.value=!1}}}async function Mr(h){if(mn.value||bn.value||En.value.length>0)return;const y=Tt.value.find(re=>re.accountId===h)??null;if(!y)return;if(Bt.value!==h){Bt.value=h;return}if(y.isActive&&Wi.value){Ut.value="Finish the current turn and pending requests before removing the active account.";return}const A=y.isActive;Ut.value="",Bt.value="",En.value=h;try{const re=await pM(h);Tt.value=re.accounts,Le(),te(),A&&Se({includeSelectedThreadMessages:!0}),Zs({silent:!0})}catch(re){Ut.value=re instanceof Error?re.message:"Failed to remove account"}finally{En.value=""}}function wu(h){qe(h)}async function Su(h){const y=await He(h);y&&(Cn.value?await N.replace({name:"thread",params:{threadId:y}}):await N.push({name:"thread",params:{threadId:y}}),P.value&&F(!0))}function Qi(h){const y=h.trim().replace(/\\/gu,"/");return y?y.includes("/.codex/worktrees/")||y.includes("/.git/worktrees/"):!1}function ei(h,y=""){var Ie,rt,An;const A=u.value.find(Qr=>Qr.projectName===h);if(!A)return y.trim();const re=A.threads.find(Qr=>!Qi(Qr.cwd));return(((Ie=re==null?void 0:re.cwd)==null?void 0:Ie.trim())??((An=(rt=A.threads[0])==null?void 0:rt.cwd)==null?void 0:An.trim())??"")||y.trim()}function Tu(h){var re,Te;const y=u.value.find(Ie=>Ie.projectName===h),A=ei(h,((Te=(re=y==null?void 0:y.threads[0])==null?void 0:re.cwd)==null?void 0:Te.trim())??"");A&&(st.value=A),P.value&&F(!0),!Cn.value&&N.push({name:"home"})}function Eu(h){var A;let y="";for(const re of u.value){const Te=re.threads.find(Ie=>Ie.id===h);if((A=Te==null?void 0:Te.cwd)!=null&&A.trim()){y=Te.cwd.trim();break}}!y||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(y)}`,"_blank","noopener,noreferrer")}function Zi(){var A;const h=p.value,y=h?ei(h.projectName,((A=h.cwd)==null?void 0:A.trim())??""):"";y&&(st.value=y),P.value&&F(!0),!Cn.value&&N.push({name:"home"})}function ku(h){Q(h.projectName,h.displayName)}function Iu(h){Ve(h.threadId,h.title)}async function c(h){await ie(h),await ni(),Wo()}function f(h){me(h.projectName,h.toIndex)}function v(h){Me(h.threadId,h.state)}function T(h){L(h)}async function L(h){var re;const y=await Z(h),A=((re=h.followUpMessageText)==null?void 0:re.trim())??"";if(!(!y||!A||Cn.value))try{await Ge(A,[],[],"steer",[])}catch{}}async function j(h){const y=await ot(h.threadId,h.turnIndex);y&&(await N.push({name:"thread",params:{threadId:y}}),M.value!==y&&await ke(y),P.value&&F(!0))}function F(h){_t.value!==h&&(_t.value=h,ew(h))}function V(h){if(!h.defaultPrevented){if(h.key==="Escape"&&ln.value){ln.value=!1;return}!h.ctrlKey&&!h.metaKey||h.shiftKey||h.altKey||h.key.toLowerCase()==="b"&&(h.preventDefault(),F(!_t.value))}}function ee(h){var A,re;if(!ln.value)return;const y=h.target;y instanceof Node&&((A=Hr.value)!=null&&A.contains(y)||(re=co.value)!=null&&re.contains(y)||(ln.value=!1))}function $e(h){var A,re;if(!ln.value)return;const y=h.target;y instanceof Node&&((A=Hr.value)!=null&&A.contains(y)||(re=co.value)!=null&&re.contains(y)||(ln.value=!1))}function We(){if(!(typeof document>"u")&&P.value){if(document.visibilityState==="hidden"){ct.value=Date.now(),ut.value=!1;return}Nt()}}function Qe(h){h.persisted&&Nt()}function dt(){we.name==="home"&&(ni(),Wo()),Nt()}function Nt(){typeof window>"u"||typeof document>"u"||!P.value||document.visibilityState!=="visible"||ut.value||ct.value===null||Date.now()-ct.value<QF||(ut.value=!0,ct.value=null,ti())}async function ti(){if(!Hn.value){Hn.value=!0;try{await Se({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await $u()}finally{Hn.value=!1}}}function ys(h){const y=h.text;fo();const A=tt.value,re=h.mode==="queue"&&A&&A.threadId===M.value?A.queueIndex:void 0;if(tt.value=null,Cn.value){sw(y,h.imageUrls,h.skills,h.fileAttachments);return}Ge(y,h.imageUrls,h.skills,h.mode,h.fileAttachments,re)}function vl(h){const y=new Intl.NumberFormat().format(h.stars);return h.language?`${h.language} · ★ ${y}`:`★ ${y}`}function _s(h){const A=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(h)?h:"trending-daily";et.value!==A&&(et.value=A)}function qo(h){const y=B.value;y&&y.hydrateDraft({text:`Clone this GitHub project and run it: ${h.url}
88
+ Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function bs(h){const y=fe.value.findIndex(Ie=>Ie.id===h),A=y>=0?fe.value[y]:void 0,re=G.value;if(!A||!re||re.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;tt.value=M.value?{threadId:M.value,queueIndex:y}:null;const Te={text:A.text,imageUrls:[...A.imageUrls],fileAttachments:A.fileAttachments.map(Ie=>({...Ie})),skills:A.skills.map(Ie=>({...Ie}))};re.hydrateDraft(Te),Oe(h)}function fo(){if(!P.value||Cn.value)return;const h=()=>{var y;(y=le.value)==null||y.jumpToLatest()};h(),Yt(()=>{h(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{h(),window.requestAnimationFrame(h)})})}function ws(h){st.value=h.trim(),Qt.value=""}function Ho(h){on.value=h.trim()}async function ea(h){const y=h.trim();if(!y||we.name!=="thread"){ar.value=[],Dn.value=null;return}Cr.value=!0;try{const A=await RM(y);ar.value=A.options,Dn.value=A.currentBranch}catch{ar.value=[],Dn.value=null}finally{Cr.value=!1}}function yl(h){if(h==="__review__"){Xn.value=!Xn.value;return}if(h==="__detached_head__"||zr.value)return;const y=h.trim();if(!y||y===(Dn.value??""))return;const A=Jr.value.trim();A&&(zr.value=!0,MM(A,y).then(re=>(Dn.value=re||y,Xn.value=!1,ea(A))).catch(re=>{const Te=re instanceof Error?re.message:"Failed to switch branch";window.alert(Te)}).finally(()=>{zr.value=!1}))}async function _l(){const h=await Cu();if(!h)return;await Wo();const y=Xt.value.trim()||"New Project (1)",A=window.prompt(`Create project in ${h}`,y);if(A===null)return;const re=A.trim();if(!re)return;const Te=Pp(Mp(h,re));if(Te)try{const Ie=await Sd(Te,{createIfMissing:!0,label:""});if(!Ie)return;st.value=Ie,se(xs(Ie)),await ni(),await Wo()}catch(Ie){const rt=Ie instanceof Error?Ie.message:"Failed to create the project.";window.alert(rt)}}async function Je(){const h=st.value.trim()||await Cu();h&&(Fn.value=!1,qn.value=!0,Mt.value="",await ri(h),S.value||Yt(()=>{var y;return(y=jo.value)==null?void 0:y.focus()}))}function vn(){hs+=1,qn.value=!1,U.value=!1,S.value="",Mt.value="",ta()}async function po(h){!h||U.value||(Mt.value="",await ri(h))}function Cb(){const h=w.value.trim();!qn.value||!h||ri(h)}function Ab(){const h=w.value.trim();!qn.value||!h||U.value||ri(h)}async function Ap(h=w.value){const y=h.trim();if(y){S.value="",ge.value=!0;try{const A=await Sd(y,{createIfMissing:!1,label:""});if(!A){S.value="Failed to open the selected folder.";return}st.value=A,se(xs(A)),await ni(),await Wo(),vn()}catch(A){S.value=A instanceof Error?A.message:"Failed to open the selected folder."}finally{ge.value=!1}}}async function xb(){if(Qt.value="",Fn.value){ta();return}if(!qn.value){const h=st.value.trim()||await Cu();if(!h||(qn.value=!0,Mt.value="",await ri(h),S.value))return}S.value||(Bn.value=Xt.value,Fn.value=!0,Yt(()=>{var h;return(h=lr.value)==null?void 0:h.focus()}))}function ta(){Qt.value="",Bn.value="",Fn.value=!1}async function xp(){const h=Bn.value.trim();if(!h)return;if(Qt.value="",S.value){Qt.value="Reload the current folder before creating a new one.";return}Un.value=!0;const y=ul.value.trim(),A=Pp(Mp(y,h));if(!A){Qt.value="Unable to determine where the new folder should be created.",Un.value=!1;return}if(!dl.value){Qt.value="Enter a single folder name.",Un.value=!1;return}try{const re=await $M(A);if(!re){Qt.value="Failed to create the folder.";return}Qt.value="",Mt.value="",await ri(re),ta()}catch(re){Qt.value=re instanceof Error?re.message:"Failed to create folder."}finally{Un.value=!1}}async function Rb(){var y;if(typeof window>"u")return!1;const h=((y=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:y.trim())??"";if(!h)return!1;try{const A=await Sd(h,{createIfMissing:!1,label:""});if(!A)return!1;st.value=A,se(xs(A)),await N.replace({name:"home"}),await ni();const re=new URL(window.location.href);return re.searchParams.delete("openProjectPath"),window.history.replaceState({},"",re.toString()),!0}catch{return!1}}async function Cu(){const h=Rp();if(h)return h;try{const y=await yg();if(y)return Vr.value=y,y}catch{}return""}async function Wo(){const h=Rp();if(!h){Xt.value="New Project (1)";return}try{const y=await NM(h);Xt.value=y.name||"New Project (1)"}catch{Xt.value="New Project (1)"}}function Rp(){var A,re;const h=st.value.trim();if(h)return md(h);const y=((re=(A=Vi.value[0])==null?void 0:A.value)==null?void 0:re.trim())??"";return y?md(y):Vr.value.trim()}async function Mb(){try{Vr.value=await yg()}catch{Vr.value=""}}async function ni(){try{const h=await Rs();sn.value={order:[...h.order],labels:{...h.labels}}}catch{sn.value={order:[],labels:{}}}}async function ri(h){const y=++hs;w.value=en(h).trim(),S.value="",U.value=!0;try{const A=await PM(h,{showHidden:nt.value});if(y!==hs)return;w.value=A.path,E.value=A.parentPath,m.value=A.entries}catch(A){if(y!==hs)return;S.value=A instanceof Error?A.message:"Failed to load local folders.",E.value=md(w.value),m.value=[],ta()}finally{y===hs&&(U.value=!1)}}async function Au(){Fe.value=!0;try{Re.value=await UM(et.value,6)}catch{Re.value=[]}finally{Fe.value=!1}}function Mp(h,y){const A=en(h).trim(),re=en(y).trim().replace(/^[\\/]+/u,"");if(!A||!re)return"";const Te=A.includes("\\")&&!A.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(A))return`${A.slice(0,2)}${Te}${re}`;if(/^\/+$/u.test(A))return`/${re}`;const Ie=A.replace(/[\\/]+$/u,"");return Ie?`${Ie}${Te}${re}`:""}function Pp(h){const y=en(h).trim();if(!y)return"";const A=y.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(A){const[,Te,Ie,rt=""]=A,An=xu(rt.split(/[\\/]+/u));return An.length>0?`\\\\${Te}\\${Ie}\\${An.join("\\")}`:`\\\\${Te}\\${Ie}`}const re=y.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(re){const[,Te,Ie=""]=re,rt=y.includes("\\")&&!y.includes("/")?"\\":"/",An=xu(Ie.split(/[\\/]+/u));return An.length>0?`${Te}${rt}${An.join(rt)}`:`${Te}${rt}`}if(y.startsWith("/")){const Te=xu(y.split("/"));return Te.length>0?`/${Te.join("/")}`:"/"}return y}function xu(h){const y=[];for(const A of h){const re=A.trim();if(!(!re||re===".")){if(re===".."){y.length>0&&y.pop();continue}y.push(re)}}return y}function $p(h){C(h)}function Np(h){H(h)}function Op(h){X(h)}function Pb(){_e()}function $b(h){const y=h.turnId.trim();if(y.length>0){const A=[...Ys.value].reverse().find(re=>{var Te;return re.role==="user"&&(((Te=re.turnId)==null?void 0:Te.trim())??"")===y&&re.text.trim().length>0});A!=null&&A.text&&G.value&&G.value.appendTextToDraft(A.text)}be(h.turnId)}function Nb(){if(Cn.value||Fo.value||typeof document>"u"||!p.value||Ys.value.length===0)return;const h=Ob(),y=Lb(),A=new Blob([h],{type:"text/markdown;charset=utf-8"}),re=URL.createObjectURL(A),Te=document.createElement("a");Te.href=re,Te.download=y,document.body.appendChild(Te),Te.click(),document.body.removeChild(Te),window.setTimeout(()=>URL.revokeObjectURL(re),0)}function Ob(){var A,re,Te;const h=[],y=((re=(A=p.value)==null?void 0:A.title)==null?void 0:re.trim())||"Untitled thread";h.push(`# ${Db(y)}`),h.push(""),h.push(`- Exported: ${new Date().toISOString()}`),h.push(`- Thread ID: ${((Te=p.value)==null?void 0:Te.id)??""}`),h.push(""),h.push("---"),h.push("");for(const Ie of Ys.value){const rt=Ie.role?Ie.role.toUpperCase():"MESSAGE";h.push(`## ${rt}`),h.push("");const An=Ie.text.trim();if(An&&(h.push(An),h.push("")),Ie.commandExecution&&(h.push("```text"),h.push(`command: ${Ie.commandExecution.command}`),h.push(`status: ${Ie.commandExecution.status}`),Ie.commandExecution.cwd&&h.push(`cwd: ${Ie.commandExecution.cwd}`),Ie.commandExecution.exitCode!==null&&h.push(`exitCode: ${Ie.commandExecution.exitCode}`),h.push(Ie.commandExecution.aggregatedOutput||"(no output)"),h.push("```"),h.push("")),Ie.fileAttachments&&Ie.fileAttachments.length>0){h.push("Attachments:");for(const Qr of Ie.fileAttachments)h.push(`- ${Qr.path}`);h.push("")}if(Ie.images&&Ie.images.length>0){h.push("Images:");for(const Qr of Ie.images)h.push(`- ${Qr}`);h.push("")}}return`${h.join(`
89
+ `).trimEnd()}
90
+ `}function Lb(){var Te,Ie;const A=(((Ie=(Te=p.value)==null?void 0:Te.title)==null?void 0:Ie.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",re=new Date().toISOString().replace(/[:.]/g,"-");return`${A}-${re}.md`}function Db(h){return h.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function bl(h,y){if(typeof window>"u")return y;const A=window.localStorage.getItem(h);return A===null?y:A==="1"}function jb(){if(typeof window>"u")return"system";const h=window.localStorage.getItem(Bg);return h==="light"||h==="dark"?h:"system"}function Fb(){return typeof window>"u"?"steer":window.localStorage.getItem(Fg)==="queue"?"queue":"steer"}function Bb(){if(typeof window>"u")return"standard";const h=window.localStorage.getItem(Vg);return h==="standard"||h==="wide"||h==="extra-wide"?h:"standard"}function Ub(){jn.value=!jn.value,window.localStorage.setItem(jg,jn.value?"1":"0")}function qb(){kn.value=kn.value==="steer"?"queue":"steer",window.localStorage.setItem(Fg,kn.value)}function Hb(){const h=["system","light","dark"],y=h.indexOf(Qn.value);Qn.value=h[(y+1)%h.length],window.localStorage.setItem(Bg,Qn.value),wl()}function Wb(){const h=["standard","wide","extra-wide"],y=h.indexOf(Zn.value);Zn.value=h[(y+1)%h.length],window.localStorage.setItem(Vg,Zn.value)}function Vb(){cr.value=!cr.value,window.localStorage.setItem(Ug,cr.value?"1":"0")}function zb(){bt.value=!bt.value,window.localStorage.setItem(qg,bt.value?"1":"0")}function Gb(){er.value=!er.value,window.localStorage.setItem(Wg,er.value?"1":"0")}async function Kb(h){if(!xr.value){xr.value=!0;try{if(h==="codex"){In.value="codex";const y=await gg(!1);Ar.value=y.enabled}else if(h==="openrouter"){In.value="openrouter";const y=await gg(!0);Ar.value=y.enabled}else h==="custom"&&(In.value="custom");await Se({includeSelectedThreadMessages:!1})}catch{}finally{xr.value=!1}}}async function Ru(){if(Ht.value)return;const h=nn.value.trim();if(h){Ht.value=!0;try{await EM(h,Kr.value.trim()),Ar.value=!0,await Se({includeSelectedThreadMessages:!1})}catch{}finally{Ht.value=!1}}}async function Lp(){if(!Ht.value){Ht.value=!0;try{const h=qt.value.trim();await vg(h),qt.value="",await Mu(),await Se({includeSelectedThreadMessages:!1})}catch{}finally{Ht.value=!1}}}async function Yb(){if(!Ht.value){Ht.value=!0;try{await vg(""),qt.value="",await Mu(),await Se({includeSelectedThreadMessages:!1})}catch{}finally{Ht.value=!1}}}async function Mu(){try{const h=await TM();Ar.value=h.enabled,ur.value=h.customKey??!1,Gr.value=h.maskedKey??null,h.enabled?h.provider==="custom"?(In.value="custom",nn.value=h.customBaseUrl??""):In.value="openrouter":In.value="codex"}catch{}}function Jb(h){const A=Pu(h.trim())||"auto";Rt.value=A,window.localStorage.setItem(Hg,A)}function Xb(){var A;if(typeof window>"u")return"auto";const h=((A=window.localStorage.getItem(Hg))==null?void 0:A.trim())||"auto";return Pu(h)||"auto"}function Qb(){const h=[{value:"auto",label:"Auto-detect"}],y=new Set(["auto"]);function A(Te){const Ie=l[Te]||Te;return`${Ie.charAt(0).toUpperCase()+Ie.slice(1)} (${Te})`}for(const Te of typeof navigator<"u"?navigator.languages??[]:[]){const Ie=Pu(Te);!Ie||y.has(Ie)||(y.add(Ie),h.push({value:Ie,label:`Preferred: ${A(Ie)}`}))}for(const Te of Object.keys(l))y.has(Te)||(y.add(Te),h.push({value:Te,label:A(Te)}));const re=Rt.value.trim();return re&&!y.has(re)&&h.push({value:re,label:A(re)}),h}function Pu(h){const y=h.trim().toLowerCase();if(!y||y==="auto")return"";if(y in l)return y;const A=y.split("-")[0]??y;return A in l?A:""}function wl(){const h=document.documentElement;if(Qn.value==="dark")h.classList.add("dark");else if(Qn.value==="light")h.classList.remove("dark");else{const y=window.matchMedia("(prefers-color-scheme: dark)").matches;h.classList.toggle("dark",y)}}function Zb(){return typeof window>"u"?!1:window.localStorage.getItem(Lg)==="1"}function ew(h){typeof window>"u"||window.localStorage.setItem(Lg,h?"1":"0")}function tw(){if(typeof window>"u")return!0;const h=window.localStorage.getItem(Dg);return h===null?!0:h==="1"}function nw(){hn.value=!hn.value,!(typeof window>"u")&&window.localStorage.setItem(Dg,hn.value?"1":"0")}function rw(h,y){const A=(h??"").trim();return A.length>0?A:y.trim()||"message"}function Dp(h){k(h)}async function ow(){await N.isReady(),we.name==="thread"&&uo.value&&ye(uo.value),te(),await Se({includeSelectedThreadMessages:!0}),Zs({silent:!0}),await Rb(),On.value=!0,await $u()}async function $u(){if(Pt.value){Vt=!0;return}Pt.value=!0;try{do{if(Vt=!1,we.name==="home"||we.name==="skills"){M.value!==""&&await ke("");continue}if(we.name==="thread"){const h=uo.value;if(!h)continue;if(!sl.value.has(h)){await N.replace({name:"home"});continue}M.value!==h?await ke(h):Ne(h,{silent:!0})}}while(Vt)}finally{Pt.value=!1}}it(()=>[we.name,uo.value,Pe.value,sl.value.has(uo.value),M.value],async()=>{On.value&&await $u()}),it(()=>M.value,async h=>{if(On.value&&!Pt.value&&!(Cn.value||Fo.value)){if(!h){we.name!=="home"&&await N.replace({name:"home"});return}we.name==="thread"&&uo.value===h||await N.replace({name:"thread",params:{threadId:h}})}}),it(()=>et.value,()=>{er.value&&Au()}),it(()=>er.value,h=>{if(!h){Re.value=[];return}Au()}),it(()=>[On.value,we.name,M.value],([h,y,A])=>{h&&y==="thread"&&A&&Ne(A,{silent:!0})}),it(()=>Vi.value,h=>{if(h.length===0){st.value="";return}h.some(A=>A.value===st.value)||(st.value=h[0].value),Wo()},{immediate:!0}),it(()=>st.value,()=>{an.value={phase:"idle",title:"",message:""},Wo()}),it(()=>[Ft.value,st.value],([h,y])=>{h==="worktree"&&jp(y)},{immediate:!0}),it(()=>Ft.value,h=>{var y;if(h==="local"){an.value={phase:"idle",title:"",message:""};const A=st.value.trim();if(A&&Qi(A)){const re=((y=p.value)==null?void 0:y.projectName)??xs(A),Te=ei(re,"");Te&&(st.value=Te)}return}jp(st.value)}),it(()=>we.name,h=>{h!=="home"&&(an.value={phase:"idle",title:"",message:""}),h!=="thread"&&(Xn.value=!1)}),it(()=>M.value,()=>{an.value={phase:"idle",title:"",message:""}}),it(()=>[we.name,Jr.value],([h,y])=>{if(h!=="thread"){ar.value=[],Dn.value=null;return}ea(y)},{immediate:!0}),it(Kc,h=>{typeof document>"u"||(document.title=h)},{immediate:!0}),it(P,h=>{h&&!_t.value&&F(!0)});async function sw(h,y=[],A=[],re=[]){try{an.value={phase:"idle",title:"",message:""};let Te=st.value;if(Ft.value==="worktree"){an.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const rt=await AM(st.value,on.value);Te=rt.cwd,st.value=rt.cwd,an.value={phase:"idle",title:"",message:""}}catch{an.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ie=await K(h,Te,y,A,re);if(!Ie)return;await N.replace({name:"thread",params:{threadId:Ie}}),fo()}catch{}}async function jp(h){var A;const y=h.trim();if(!y){pn.value=[],on.value="";return}Jn.value=!0;try{const re=await xM(y);pn.value=re;const Te=on.value.trim();if(!(Te.length>0&&re.some(rt=>rt.value===Te))){const rt=re.find(An=>An.value.trim()==="main");on.value=(rt==null?void 0:rt.value)??((A=re[0])==null?void 0:A.value)??""}}catch{pn.value=[],on.value=""}finally{Jn.value=!1}}return(h,y)=>(x(),ht(yR,{"is-sidebar-collapsed":_t.value,onCloseSidebar:y[19]||(y[19]=A=>F(!0))},{sidebar:Et(()=>[b("section",nj,[b("div",rj,[_t.value?pe("",!0):(x(),ht(Ig,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":_t.value,"show-new-thread-button":!0,onToggleSidebar:y[0]||(y[0]=A=>F(!_t.value)),onStartNewThread:Zi},{default:Et(()=>[b("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":Lt.value,"aria-label":"Search threads",title:"Search threads",onClick:uu},[Ue(Cg,{class:"sidebar-search-toggle-icon"})],8,oj)]),_:1},8,["is-sidebar-collapsed"])),!_t.value&&Lt.value?(x(),D("div",sj,[Ue(Cg,{class:"sidebar-search-bar-icon"}),Gn(b("input",{ref_key:"sidebarSearchInputRef",ref:Ir,"onUpdate:modelValue":y[1]||(y[1]=A=>_n.value=A),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:du},null,544),[[or,_n.value]]),_n.value.length>0?(x(),D("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Yi},[Ue(bD,{class:"sidebar-search-clear-icon"})])):pe("",!0)])):pe("",!0),_t.value?pe("",!0):(x(),D("button",{key:2,class:pt(["sidebar-skills-link",{"is-active":Fo.value}]),type:"button",onClick:y[2]||(y[2]=A=>{je(N).push({name:"skills"}),je(P)&&F(!0)})}," Skills Hub ",2)),_t.value?pe("",!0):(x(),ht(j$,{key:3,groups:je(u),"project-display-name-by-id":je(d),"selected-thread-id":je(M),"is-loading":je(Pe),"search-query":_n.value,"search-matched-thread-ids":Wr.value,onSelect:fu,onArchive:wu,onStartNewThread:Tu,onRenameProject:ku,onBrowseThreadFiles:Eu,onRenameThread:Iu,onForkThread:Su,onRemoveProject:c,onReorderProject:f,onExportThread:pu},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),_t.value?pe("",!0):(x(),D("div",{key:0,ref_key:"settingsAreaRef",ref:lo,class:"sidebar-settings-area",onClick:$e},[Ue(oy,{name:"settings-panel"},{default:Et(()=>[ln.value?(x(),D("div",{key:0,ref_key:"settingsPanelRef",ref:Hr,class:"sidebar-settings-panel",onClick:y[10]||(y[10]=ft(()=>{},["stop"]))},[b("div",ij,[b("div",aj,[b("div",lj,[b("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!hn.value,title:hn.value?"Expand accounts":"Collapse accounts",onClick:nw},[b("span",uj,ce(hn.value?"▸":"▾"),1)],8,cj),y[20]||(y[20]=b("span",{class:"sidebar-settings-account-title"},"Accounts",-1)),b("span",dj,ce(Tt.value.length),1)]),b("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:mn.value||bn.value,onClick:bu},ce(mn.value?"Reloading…":"Reload"),9,fj)]),hn.value?pe("",!0):(x(),D(Ke,{key:0},[Ut.value?(x(),D("p",pj,ce(Ut.value),1)):pe("",!0),Tt.value.length===0?(x(),D("p",hj," Run `codex login`, then click reload. ")):(x(),D("div",mj,[(x(!0),D(Ke,null,jt(Tt.value,A=>(x(),D("article",{key:A.accountId,class:pt(["sidebar-settings-account-item",{"is-active":A.isActive,"is-unavailable":gs(A),"is-confirming-remove":vs(A),"is-remove-visible":hl(A)}]),title:_u(A),onMouseenter:re=>gu(A.accountId),onMouseleave:re=>vu(A.accountId)},[b("div",vj,[b("p",yj,ce(A.email||"Account"),1),b("p",_j,ce(Ji(A)),1),b("p",bj,ce(gl(A)),1),b("p",wj," Workspace "+ce(hu(A.accountId)),1)]),b("div",Sj,[b("button",{class:"sidebar-settings-account-switch",type:"button",disabled:pl(A)||A.isActive||gs(A),onClick:re=>Xi(A.accountId)},ce(Xs(A)),9,Tj),b("button",{class:pt(["sidebar-settings-account-remove",{"is-visible":hl(A),"is-confirming":vs(A)}]),type:"button",disabled:pl(A),onClick:re=>Mr(A.accountId)},ce(ml(A)),11,Ej)])],42,gj))),128))]))],64))]),b("button",{class:"sidebar-settings-row",type:"button",title:i.sendWithEnter,onClick:Ub},[y[21]||(y[21]=b("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),b("span",{class:pt(["sidebar-settings-toggle",{"is-on":!jn.value}])},null,2)],8,kj),b("button",{class:"sidebar-settings-row",type:"button",title:i.inProgressSendMode,onClick:qb},[y[22]||(y[22]=b("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),b("span",Cj,ce(kn.value==="steer"?"Steer":"Queue"),1)],8,Ij),b("button",{class:"sidebar-settings-row",type:"button",title:i.appearance,onClick:Hb},[y[23]||(y[23]=b("span",{class:"sidebar-settings-label"},"Appearance",-1)),b("span",xj,ce(Qn.value==="system"?"System":Qn.value==="dark"?"Dark":"Light"),1)],8,Aj),b("button",{class:"sidebar-settings-row",type:"button",title:i.chatWidth,onClick:Wb},[y[24]||(y[24]=b("span",{class:"sidebar-settings-label"},"Chat width",-1)),b("span",Mj,ce(iu.value),1)],8,Rj),b("button",{class:"sidebar-settings-row",type:"button",title:i.dictationClickToToggle,onClick:Vb},[y[25]||(y[25]=b("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),b("span",{class:pt(["sidebar-settings-toggle",{"is-on":cr.value}])},null,2)],8,Pj),b("button",{class:"sidebar-settings-row",type:"button",title:i.dictationAutoSend,onClick:zb},[y[26]||(y[26]=b("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),b("span",{class:pt(["sidebar-settings-toggle",{"is-on":bt.value}])},null,2)],8,$j),b("button",{class:"sidebar-settings-row",type:"button",title:i.githubTrendingProjects,onClick:Gb},[y[27]||(y[27]=b("span",{class:"sidebar-settings-label"},"GitHub trending projects",-1)),b("span",{class:pt(["sidebar-settings-toggle",{"is-on":er.value}])},null,2)],8,Nj),b("div",Oj,[y[29]||(y[29]=b("span",{class:"sidebar-settings-label"},"Provider",-1)),b("select",{class:"sidebar-settings-provider-select",value:In.value,disabled:xr.value,onChange:y[3]||(y[3]=A=>Kb(A.target.value))},[...y[28]||(y[28]=[b("option",{value:"codex"},"Codex",-1),b("option",{value:"openrouter"},"OpenRouter",-1),b("option",{value:"custom"},"Custom endpoint",-1)])],40,Lj)]),In.value==="openrouter"?(x(),D("div",Dj,[y[30]||(y[30]=b("div",{class:"sidebar-settings-provider-info"},[b("span",{class:"sidebar-settings-label"},"OpenRouter API key"),b("a",{class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},"Get API key")],-1)),b("div",jj,[ur.value&&!qt.value?(x(),D(Ke,{key:0},[b("span",Fj,ce(Gr.value),1),b("button",{class:"sidebar-settings-key-clear",type:"button",disabled:Ht.value,title:"Remove custom key, use community keys",onClick:Yb},"✕",8,Bj)],64)):(x(),D(Ke,{key:1},[Gn(b("input",{"onUpdate:modelValue":y[4]||(y[4]=A=>qt.value=A),class:"sidebar-settings-key-input",type:"password",placeholder:"sk-or-v1-... (optional, uses free keys if empty)",onKeydown:Zt(Lp,["enter"])},null,544),[[or,qt.value]]),b("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ht.value||!qt.value.trim(),onClick:Lp},ce(Ht.value?"...":"Set"),9,Uj)],64))])])):pe("",!0),In.value==="custom"?(x(),D("div",qj,[y[31]||(y[31]=b("span",{class:"sidebar-settings-label"},"Custom endpoint URL",-1)),b("div",Hj,[Gn(b("input",{"onUpdate:modelValue":y[5]||(y[5]=A=>nn.value=A),class:"sidebar-settings-key-input",type:"url",placeholder:"https://api.example.com/v1",onKeydown:Zt(Ru,["enter"])},null,544),[[or,nn.value]])]),y[32]||(y[32]=b("span",{class:"sidebar-settings-label",style:{"margin-top":"4px"}},"API key",-1)),b("div",Wj,[Gn(b("input",{"onUpdate:modelValue":y[6]||(y[6]=A=>Kr.value=A),class:"sidebar-settings-key-input",type:"password",placeholder:"Bearer token (optional)",onKeydown:Zt(Ru,["enter"])},null,544),[[or,Kr.value]]),b("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ht.value||!nn.value.trim(),onClick:Ru},ce(Ht.value?"...":"Save"),9,Vj)])])):pe("",!0),b("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:i.dictationLanguage},[y[33]||(y[33]=b("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Ue(Ns,{class:"sidebar-settings-language-dropdown","model-value":Rt.value,options:ps.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Jb},null,8,["model-value","options"])],8,zj),b("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:y[7]||(y[7]=A=>Yr.value=!Yr.value)},[y[34]||(y[34]=b("span",{class:"sidebar-settings-label"},"Telegram",-1)),b("span",Gj,ce(lu.value),1)]),Yr.value?(x(),D("div",Kj,[b("label",Yj,[y[35]||(y[35]=b("span",{class:"sidebar-settings-field-label"},"Bot token",-1)),Gn(b("input",{"onUpdate:modelValue":y[8]||(y[8]=A=>dr.value=A),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,512),[[or,dr.value]])]),b("label",Jj,[y[36]||(y[36]=b("span",{class:"sidebar-settings-field-label"},"Allowed Telegram user IDs",-1)),Gn(b("textarea",{"onUpdate:modelValue":y[9]||(y[9]=A=>Rr.value=A),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
91
+ 987654321`,spellcheck:"false"},null,512),[[or,Rr.value]])]),y[37]||(y[37]=b("div",{class:"sidebar-settings-field-help"}," Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here. ",-1)),zt.value?(x(),D("div",Xj,ce(zt.value),1)):pe("",!0),b("div",Qj,[b("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:tr.value,onClick:Xr},ce(tr.value?"Saving…":"Save Telegram config"),9,Zj)])])):pe("",!0),Yc.value?(x(),D("div",{key:3,class:"sidebar-settings-row sidebar-settings-context-row","data-state":ll.value,title:Zc.value},[y[38]||(y[38]=b("span",{class:"sidebar-settings-label"},"Context",-1)),b("span",{class:"sidebar-settings-context-value","data-state":ll.value},[js(ce(Xc.value)+" ",1),b("span",nF,ce(Qc.value),1)],8,tF)],8,eF)):pe("",!0),b("div",rF,[Ue(GL,{snapshots:je(xe)},null,8,["snapshots"])]),b("div",oF," WT "+ce(je(o))+" · v"+ce(je(s)),1)],512)):pe("",!0)]),_:1}),b("button",{ref_key:"settingsButtonRef",ref:co,class:"sidebar-settings-button",type:"button",onClick:y[11]||(y[11]=ft(A=>ln.value=!ln.value,["stop"]))},[Ue(gD,{class:"sidebar-settings-icon"}),y[39]||(y[39]=b("span",null,"Settings",-1)),b("span",sF,ce(je(o))+" · v"+ce(je(s)),1)],512)],512))])]),content:Et(()=>[b("section",{class:"content-root",style:To(au.value)},[Ue(W$,{title:zc.value},{leading:Et(()=>[_t.value||je(P)?(x(),ht(Ig,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":_t.value,"show-new-thread-button":!0,onToggleSidebar:y[12]||(y[12]=A=>F(!_t.value)),onStartNewThread:Zi},null,8,["is-sidebar-collapsed"])):pe("",!0)]),actions:Et(()=>[je(we).name==="thread"&&je(M)?(x(),ht(Ns,{key:0,class:pt(["content-header-branch-dropdown",{"is-review-open":Xn.value}]),"model-value":eu.value,options:tu.value,disabled:Cr.value||zr.value,"enable-search":!0,"search-placeholder":"Search branches...","onUpdate:modelValue":yl},null,8,["class","model-value","options","disabled"])):pe("",!0)]),_:1},8,["title"]),b("section",iF,[Fo.value?(x(),ht(je(r),{key:0,onSkillsChanged:cu})):Cn.value?(x(),D("div",aF,[b("div",lF,[y[46]||(y[46]=b("p",{class:"new-thread-hero"},"Let's build",-1)),Ue(Ns,{class:"new-thread-folder-dropdown","model-value":st.value,options:Vi.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project",disabled:!1,"onUpdate:modelValue":ws},null,8,["model-value","options"]),st.value?(x(),D("p",{key:0,class:"new-thread-folder-selected",title:st.value}," Selected folder: "+ce(st.value),9,cF)):pe("",!0),b("div",{class:"new-thread-folder-actions"},[b("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:Je}," Select folder "),b("button",{class:"new-thread-folder-action",type:"button",onClick:_l}," Create Project ")]),(x(),ht(pa,{to:"body"},[qn.value?(x(),D("div",{key:0,class:"new-thread-open-folder-overlay",onClick:ft(vn,["self"])},[b("div",{class:"new-thread-open-folder",role:"dialog","aria-modal":"true","aria-label":"Select folder",onKeydown:Zt(ft(vn,["prevent"]),["esc"])},[b("div",{class:"new-thread-open-folder-header"},[y[40]||(y[40]=b("p",{class:"new-thread-open-folder-title"},"Select folder",-1)),b("button",{class:"new-thread-open-folder-close",type:"button",onClick:vn}," Cancel ")]),y[42]||(y[42]=b("p",{class:"new-thread-open-folder-label"},"Current folder",-1)),b("div",dF,[b("p",{class:"new-thread-open-folder-path",title:w.value||"Unavailable"},ce(w.value||"Unavailable"),9,fF),b("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!w.value||!!S.value||U.value||ge.value,onClick:y[13]||(y[13]=A=>Ap())},ce(ge.value?"Opening…":"Open"),9,pF)]),b("div",hF,[b("label",mF,[Gn(b("input",{"onUpdate:modelValue":y[14]||(y[14]=A=>nt.value=A),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:Cb},null,544),[[xT,nt.value]]),y[41]||(y[41]=b("span",null,"Show hidden folders",-1))]),b("button",{class:pt(["new-thread-folder-action",{"new-thread-folder-action-primary":Fn.value}]),type:"button","aria-pressed":Fn.value,disabled:!w.value||U.value||ge.value||Un.value||!!S.value&&!Fn.value,onClick:xb}," New folder ",10,gF)]),Fn.value?(x(),D("div",vF,[b("div",yF,[Gn(b("input",{ref_key:"createFolderInputRef",ref:lr,"onUpdate:modelValue":y[15]||(y[15]=A=>Bn.value=A),class:"new-thread-open-folder-create-input",type:"text",placeholder:"Folder name",onKeydown:[Zt(ft(xp,["prevent"]),["enter"]),Zt(ft(ta,["prevent"]),["esc"])]},null,40,_F),[[or,Bn.value]]),b("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!nu.value||Un.value,onClick:xp},ce(ru.value),9,bF)]),Qt.value?(x(),D("p",wF,ce(Qt.value),1)):pe("",!0)])):pe("",!0),Gn(b("input",{ref_key:"existingFolderFilterInputRef",ref:jo,"onUpdate:modelValue":y[16]||(y[16]=A=>Mt.value=A),class:"new-thread-open-folder-filter",type:"text",placeholder:"Filter folders...",onKeydown:Zt(ft(vn,["prevent"]),["esc"])},null,40,SF),[[or,Mt.value]]),S.value?(x(),D("div",TF,[b("p",EF,ce(S.value),1),b("button",{class:"new-thread-folder-action",type:"button",disabled:U.value||ge.value,onClick:Ab}," Retry ",8,kF)])):pe("",!0),U.value?(x(),D("p",IF,"Loading folders…")):!S.value&&Gi.value.length===0?(x(),D("p",CF,ce(Mt.value.trim()?"No folders match this filter.":"No subfolders found here."),1)):Gi.value.length>0?(x(),D("ul",AF,[(x(!0),D(Ke,null,jt(Gi.value,A=>(x(),D("li",{key:A.key,class:"new-thread-open-folder-item"},[b("button",{class:"new-thread-open-folder-item-main",type:"button",title:A.path,disabled:U.value||ge.value,onClick:re=>po(A.path)},[b("span",RF,ce(A.name),1)],8,xF),A.kind==="directory"?(x(),D("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:U.value||ge.value,onClick:re=>Ap(A.path)}," Open ",8,MF)):pe("",!0)]))),128))])):pe("",!0)],40,uF)])):pe("",!0)])),Ue(QL,{class:"new-thread-runtime-dropdown",modelValue:Ft.value,"onUpdate:modelValue":y[17]||(y[17]=A=>Ft.value=A)},null,8,["modelValue"]),Ft.value==="worktree"?(x(),D("div",PF,[y[43]||(y[43]=b("p",{class:"new-thread-branch-select-label"},"Base branch",-1)),Ue(Ns,{class:"new-thread-branch-dropdown","model-value":on.value,options:zi.value,placeholder:"Select branch","enable-search":!0,"search-placeholder":"Search branches...",disabled:Jn.value||zi.value.length===0,"onUpdate:modelValue":Ho},null,8,["model-value","options","disabled"]),b("p",$F,ce(Jn.value?"Loading branches…":cl.value?`New worktree branch will start from ${cl.value}.`:"No Git branches found for this folder."),1)])):pe("",!0),y[47]||(y[47]=b("p",{class:"new-thread-runtime-help"},[b("code",null,"Local project"),js(" uses the selected folder directly. "),b("code",null,"New worktree"),js(" creates an isolated Git worktree before the first prompt. ")],-1)),an.value.phase!=="idle"?(x(),D("div",{key:2,class:pt(["worktree-init-status",{"is-running":an.value.phase==="running","is-error":an.value.phase==="error"}])},[b("strong",NF,ce(an.value.title),1),b("span",OF,ce(an.value.message),1)],2)):pe("",!0),er.value?(x(),D("div",LF,[b("div",DF,[y[44]||(y[44]=b("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),Ue(Ns,{class:"new-thread-trending-scope-dropdown","model-value":et.value,options:su.value,"onUpdate:modelValue":_s},null,8,["model-value","options"])]),Fe.value?(x(),D("p",jF,"Loading trending projects...")):Re.value.length===0?(x(),D("p",FF," Trending repos are unavailable right now. ")):(x(),D("div",BF,[(x(!0),D(Ke,null,jt(Re.value,A=>(x(),D("button",{key:A.id,type:"button",class:"new-thread-trending-tip",onClick:re=>qo(A)},[b("span",{class:"new-thread-trending-tip-name",title:A.fullName},[A.owner&&A.repo?(x(),D(Ke,{key:0},[b("span",HF,ce(A.owner),1),y[45]||(y[45]=b("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),b("span",WF,ce(A.repo),1)],64)):(x(),D("span",VF,ce(A.fullName),1))],8,qF),b("span",zF,ce(vl(A)),1),b("span",GF,ce(A.description||"No description available."),1)],8,UF))),128))]))])):pe("",!0)]),b("div",KF,[Ue(kg,{ref_key:"homeThreadComposerRef",ref:B,"active-thread-id":qi.value,cwd:Jr.value,"collaboration-modes":je($),"selected-collaboration-mode":je(z),models:je(q),"selected-model":je(ue),"selected-reasoning-effort":je(ne),"selected-speed-mode":je(J),"is-updating-speed-mode":je(ve),skills:je(he),"thread-token-usage":je(g),"codex-quota":je(W),"is-turn-in-progress":!1,"is-stop-pending":!1,"is-interrupting-turn":!1,"send-with-enter":jn.value,"in-progress-submit-mode":kn.value,"dictation-click-to-toggle":cr.value,"dictation-auto-send":bt.value,"dictation-language":Rt.value,onSubmit:ys,"onUpdate:selectedCollaborationMode":Dp,"onUpdate:selectedModel":$p,"onUpdate:selectedReasoningEffort":Np,"onUpdate:selectedSpeedMode":Op},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"])])])):(x(),D("div",YF,[Xn.value&&je(M)&&Jr.value?(x(),ht(je(n),{key:0,"thread-id":je(M),cwd:Jr.value,"is-thread-in-progress":Hi.value,onClose:y[18]||(y[18]=A=>Xn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(x(),D(Ke,{key:1},[b("div",JF,[Ue(je(t),{ref_key:"threadConversationRef",ref:le,messages:Ys.value,"is-loading":je(Y),"active-thread-id":qi.value,cwd:Jr.value,"scroll-state":je(_),"live-overlay":il.value,"pending-requests":je(I),onUpdateScrollState:v,onForkThread:j,onRollback:$b,onRespondServerRequest:T},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),b("div",XF,[Ue(jL,{messages:je(fe),onEdit:bs,onSteer:je(Ye),onDelete:je(Oe)},null,8,["messages","onSteer","onDelete"]),al.value?(x(),ht(xL,{key:0,request:al.value,"request-count":je(I).length,"has-queue-above":je(fe).length>0,onRespondServerRequest:T},null,8,["request","request-count","has-queue-above"])):(x(),ht(kg,{key:1,ref_key:"threadComposerRef",ref:G,"active-thread-id":qi.value,cwd:Jr.value,"collaboration-modes":je($),"selected-collaboration-mode":je(z),models:je(q),"selected-model":je(ue),"selected-reasoning-effort":je(ne),"selected-speed-mode":je(J),"is-updating-speed-mode":je(ve),skills:je(he),"thread-token-usage":je(g),"codex-quota":je(W),"is-turn-in-progress":Hi.value,"is-stop-pending":je(De),"is-interrupting-turn":je(Ae),"has-queue-above":je(fe).length>0,"send-with-enter":jn.value,"in-progress-submit-mode":kn.value,"dictation-click-to-toggle":cr.value,"dictation-auto-send":bt.value,"dictation-language":Rt.value,"onUpdate:selectedCollaborationMode":Dp,onSubmit:ys,"onUpdate:selectedModel":$p,"onUpdate:selectedReasoningEffort":Np,"onUpdate:selectedSpeedMode":Op,onInterrupt:Pb},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-stop-pending","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"]))}}),e2=St(ZF,[["__scopeId","data-v-8f736898"]]),$d={render:()=>null},kb=uR({history:q1(),routes:[{path:"/",name:"home",component:$d},{path:"/thread/:threadId",name:"thread",component:$d},{path:"/skills",name:"skills",component:$d},{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 Ib=OT(e2);async function t2(){{n2();return}}function n2(e){Qx({app:Ib,dsn:"https://9b1c6357d134c512f8171518ec2cb18e@o4511194738982912.ingest.us.sentry.io/4511201728200704",release:"codexui@0.1.91",environment:"production",integrations:[t1({router:kb})],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}})}t2();Ib.use(kb).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error("Service worker registration failed.",e)})});export{aM as A,Gn as B,r2 as C,s2 as D,a2 as E,Ke as F,l2 as G,o2 as H,Ql as I,i2 as J,Cp as K,pa as L,eP as M,Cg as N,or as O,Zt as P,oy as T,St as _,b as a,cs as b,D as c,Tn as d,Ws as e,pe as f,jt as g,pt as h,ht as i,Et as j,Hf as k,To as l,Ue as m,Yt as n,x as o,J$ as p,bD as q,O as r,ft as s,ce as t,Sp as u,je as v,it as w,js as x,oe as y,ud as z};
92
+ //# sourceMappingURL=index-B81KnkV8.js.map