@_solaris/messenger-widget 0.5.48 โ†’ 0.5.50

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.
@@ -2,19 +2,19 @@
2
2
  * @vue/shared v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/function Rs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fe={},Ft=[],st=()=>{},Zr=()=>!1,Un=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Hn=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Ls=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xo=Object.prototype.hasOwnProperty,oe=(e,t)=>xo.call(e,t),z=Array.isArray,Dt=e=>bn(e)==="[object Map]",zt=e=>bn(e)==="[object Set]",nr=e=>bn(e)==="[object Date]",X=e=>typeof e=="function",be=e=>typeof e=="string",qe=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",ei=e=>(ae(e)||X(e))&&X(e.then)&&X(e.catch),ti=Object.prototype.toString,bn=e=>ti.call(e),To=e=>bn(e).slice(8,-1),ni=e=>bn(e)==="[object Object]",Ps=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,nn=Rs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$n=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Mo=/-\w/g,Fe=$n(e=>e.replace(Mo,t=>t.slice(1).toUpperCase())),Eo=/\B([A-Z])/g,St=$n(e=>e.replace(Eo,"-$1").toLowerCase()),Vn=$n(e=>e.charAt(0).toUpperCase()+e.slice(1)),ns=$n(e=>e?`on${Vn(e)}`:""),ct=(e,t)=>!Object.is(e,t),Tn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},si=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Kn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Oo=e=>{const t=be(e)?Number(e):NaN;return isNaN(t)?e:t};let sr;const zn=()=>sr||(sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Oe(e){if(z(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=be(r)?Po(r):Oe(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(be(e)||ae(e))return e}const Io=/;(?![^(]*\))/g,Ro=/:([^]+)/,Lo=/\/\*[^]*?\*\//g;function Po(e){const t={};return e.replace(Lo,"").split(Io).forEach(n=>{if(n){const r=n.split(Ro);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function re(e){let t="";if(be(e))t=e;else if(z(e))for(let n=0;n<e.length;n++){const r=re(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Bo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",No=Rs(Bo);function ri(e){return!!e||e===""}function Fo(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Wt(e[r],t[r]);return n}function Wt(e,t){if(e===t)return!0;let n=nr(e),r=nr(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=qe(e),r=qe(t),n||r)return e===t;if(n=z(e),r=z(t),n||r)return n&&r?Fo(e,t):!1;if(n=ae(e),r=ae(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,s=Object.keys(t).length;if(i!==s)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Wt(e[o],t[o]))return!1}}return String(e)===String(t)}function Bs(e,t){return e.findIndex(n=>Wt(n,t))}const ii=e=>!!(e&&e.__v_isRef===!0),L=e=>be(e)?e:e==null?"":z(e)||ae(e)&&(e.toString===ti||!X(e.toString))?ii(e)?L(e.value):JSON.stringify(e,oi,2):String(e),oi=(e,t)=>ii(t)?oi(e,t.value):Dt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[ss(r,s)+" =>"]=i,n),{})}:zt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ss(n))}:qe(t)?ss(t):ae(t)&&!z(t)&&!ni(t)?String(t):t,ss=(e,t="")=>{var n;return qe(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
5
+ **/function Rs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fe={},Nt=[],st=()=>{},Zr=()=>!1,Hn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Un=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Ls=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},xo=Object.prototype.hasOwnProperty,oe=(e,t)=>xo.call(e,t),z=Array.isArray,Dt=e=>bn(e)==="[object Map]",zt=e=>bn(e)==="[object Set]",nr=e=>bn(e)==="[object Date]",X=e=>typeof e=="function",be=e=>typeof e=="string",qe=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",ei=e=>(ae(e)||X(e))&&X(e.then)&&X(e.catch),ti=Object.prototype.toString,bn=e=>ti.call(e),To=e=>bn(e).slice(8,-1),ni=e=>bn(e)==="[object Object]",Ps=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,nn=Rs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),$n=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Mo=/-\w/g,Ne=$n(e=>e.replace(Mo,t=>t.slice(1).toUpperCase())),Eo=/\B([A-Z])/g,St=$n(e=>e.replace(Eo,"-$1").toLowerCase()),Vn=$n(e=>e.charAt(0).toUpperCase()+e.slice(1)),ns=$n(e=>e?`on${Vn(e)}`:""),ct=(e,t)=>!Object.is(e,t),Tn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},si=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Kn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Oo=e=>{const t=be(e)?Number(e):NaN;return isNaN(t)?e:t};let sr;const zn=()=>sr||(sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Oe(e){if(z(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=be(r)?Po(r):Oe(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(be(e)||ae(e))return e}const Io=/;(?![^(]*\))/g,Ro=/:([^]+)/,Lo=/\/\*[^]*?\*\//g;function Po(e){const t={};return e.replace(Lo,"").split(Io).forEach(n=>{if(n){const r=n.split(Ro);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ie(e){let t="";if(be(e))t=e;else if(z(e))for(let n=0;n<e.length;n++){const r=ie(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Bo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Fo=Rs(Bo);function ri(e){return!!e||e===""}function No(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Wt(e[r],t[r]);return n}function Wt(e,t){if(e===t)return!0;let n=nr(e),r=nr(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=qe(e),r=qe(t),n||r)return e===t;if(n=z(e),r=z(t),n||r)return n&&r?No(e,t):!1;if(n=ae(e),r=ae(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,s=Object.keys(t).length;if(i!==s)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Wt(e[o],t[o]))return!1}}return String(e)===String(t)}function Bs(e,t){return e.findIndex(n=>Wt(n,t))}const ii=e=>!!(e&&e.__v_isRef===!0),L=e=>be(e)?e:e==null?"":z(e)||ae(e)&&(e.toString===ti||!X(e.toString))?ii(e)?L(e.value):JSON.stringify(e,oi,2):String(e),oi=(e,t)=>ii(t)?oi(e,t.value):Dt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[ss(r,s)+" =>"]=i,n),{})}:zt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ss(n))}:qe(t)?ss(t):ae(t)&&!z(t)&&!ni(t)?String(t):t,ss=(e,t="")=>{var n;return qe(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
6
  * @vue/reactivity v3.5.34
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/let Me;class Do{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Me&&(Me.active?(this.parent=Me,this.index=(Me.scopes||(Me.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!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=Me;try{return Me=this,t()}finally{Me=n}}}on(){++this._on===1&&(this.prevScope=Me,Me=this)}off(){if(this._on>0&&--this._on===0){if(Me===this)Me=this.prevScope;else{let t=Me;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.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 i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function jo(){return Me}let pe;const rs=new WeakSet;class ai{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,Me&&(Me.active?Me.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,rs.has(this)&&(rs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ci(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rr(this),ui(this);const t=pe,n=ze;pe=this,ze=!0;try{return this.fn()}finally{di(this),pe=t,ze=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ds(t);this.deps=this.depsTail=void 0,rr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?rs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ys(this)&&this.run()}get dirty(){return ys(this)}}let li=0,sn,rn;function ci(e,t=!1){if(e.flags|=8,t){e.next=rn,rn=e;return}e.next=sn,sn=e}function Ns(){li++}function Fs(){if(--li>0)return;if(rn){let t=rn;for(rn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;sn;){let t=sn;for(sn=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 ui(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function di(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Ds(r),Uo(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(fi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function fi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===cn)||(e.globalVersion=cn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ys(e))))return;e.flags|=2;const t=e.dep,n=pe,r=ze;pe=e,ze=!0;try{ui(e);const i=e.fn(e._value);(t.version===0||ct(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{pe=n,ze=r,di(e),e.flags&=-3}}function Ds(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.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)Ds(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Uo(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ze=!0;const hi=[];function pt(){hi.push(ze),ze=!1}function gt(){const e=hi.pop();ze=e===void 0?!0:e}function rr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pe;pe=void 0;try{t()}finally{pe=n}}}let cn=0;class Ho{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 mi{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(!pe||!ze||pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pe)n=this.activeLink=new Ho(pe,this),pe.deps?(n.prevDep=pe.depsTail,pe.depsTail.nextDep=n,pe.depsTail=n):pe.deps=pe.depsTail=n,pi(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=pe.depsTail,n.nextDep=void 0,pe.depsTail.nextDep=n,pe.depsTail=n,pe.deps===n&&(pe.deps=r)}return n}trigger(t){this.version++,cn++,this.notify(t)}notify(t){Ns();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Fs()}}}function pi(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)pi(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vs=new WeakMap,Lt=Symbol(""),bs=Symbol(""),un=Symbol("");function Re(e,t,n){if(ze&&pe){let r=vs.get(e);r||vs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new mi),i.map=r,i.key=n),i.track()}}function ut(e,t,n,r,i,s){const o=vs.get(e);if(!o){cn++;return}const a=l=>{l&&l.trigger()};if(Ns(),t==="clear")o.forEach(a);else{const l=z(e),f=l&&Ps(n);if(l&&n==="length"){const c=Number(r);o.forEach((p,A)=>{(A==="length"||A===un||!qe(A)&&A>=c)&&a(p)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),f&&a(o.get(un)),t){case"add":l?f&&a(o.get("length")):(a(o.get(Lt)),Dt(e)&&a(o.get(bs)));break;case"delete":l||(a(o.get(Lt)),Dt(e)&&a(o.get(bs)));break;case"set":Dt(e)&&a(o.get(Lt));break}}Fs()}function Bt(e){const t=ce(e);return t===e?t:(Re(t,"iterate",un),We(e)?t:t.map(_t))}function Wn(e){return Re(e=ce(e),"iterate",un),e}function tt(e,t){return kt(e)?$t(Pt(e)?_t(t):t):_t(t)}const $o={__proto__:null,[Symbol.iterator](){return is(this,Symbol.iterator,e=>tt(this,e))},concat(...e){return Bt(this).concat(...e.map(t=>z(t)?Bt(t):t))},entries(){return is(this,"entries",e=>(e[1]=tt(this,e[1]),e))},every(e,t){return rt(this,"every",e,t,void 0,arguments)},filter(e,t){return rt(this,"filter",e,t,n=>n.map(r=>tt(this,r)),arguments)},find(e,t){return rt(this,"find",e,t,n=>tt(this,n),arguments)},findIndex(e,t){return rt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return rt(this,"findLast",e,t,n=>tt(this,n),arguments)},findLastIndex(e,t){return rt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return rt(this,"forEach",e,t,void 0,arguments)},includes(...e){return os(this,"includes",e)},indexOf(...e){return os(this,"indexOf",e)},join(e){return Bt(this).join(e)},lastIndexOf(...e){return os(this,"lastIndexOf",e)},map(e,t){return rt(this,"map",e,t,void 0,arguments)},pop(){return Jt(this,"pop")},push(...e){return Jt(this,"push",e)},reduce(e,...t){return ir(this,"reduce",e,t)},reduceRight(e,...t){return ir(this,"reduceRight",e,t)},shift(){return Jt(this,"shift")},some(e,t){return rt(this,"some",e,t,void 0,arguments)},splice(...e){return Jt(this,"splice",e)},toReversed(){return Bt(this).toReversed()},toSorted(e){return Bt(this).toSorted(e)},toSpliced(...e){return Bt(this).toSpliced(...e)},unshift(...e){return Jt(this,"unshift",e)},values(){return is(this,"values",e=>tt(this,e))}};function is(e,t,n){const r=Wn(e),i=r[t]();return r!==e&&!We(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const Vo=Array.prototype;function rt(e,t,n,r,i,s){const o=Wn(e),a=o!==e&&!We(e),l=o[t];if(l!==Vo[t]){const p=l.apply(e,s);return a?_t(p):p}let f=n;o!==e&&(a?f=function(p,A){return n.call(this,tt(e,p),A,e)}:n.length>2&&(f=function(p,A){return n.call(this,p,A,e)}));const c=l.call(o,f,r);return a&&i?i(c):c}function ir(e,t,n,r){const i=Wn(e),s=i!==e&&!We(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(f,c,p){return a&&(a=!1,f=tt(e,f)),n.call(this,f,tt(e,c),p,e)}):n.length>3&&(o=function(f,c,p){return n.call(this,f,c,p,e)}));const l=i[t](o,...r);return a?tt(e,l):l}function os(e,t,n){const r=ce(e);Re(r,"iterate",un);const i=r[t](...n);return(i===-1||i===!1)&&Hs(n[0])?(n[0]=ce(n[0]),r[t](...n)):i}function Jt(e,t,n=[]){pt(),Ns();const r=ce(e)[t].apply(e,n);return Fs(),gt(),r}const Ko=Rs("__proto__,__v_isRef,__isVue"),gi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qe));function zo(e){qe(e)||(e=String(e));const t=ce(this);return Re(t,"has",e),t.hasOwnProperty(e)}class _i{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(i?s?ta:wi:s?bi:vi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=z(t);if(!i){let l;if(o&&(l=$o[n]))return l;if(n==="hasOwnProperty")return zo}const a=Reflect.get(t,n,De(t)?t:r);if((qe(n)?gi.has(n):Ko(n))||(i||Re(t,"get",n),s))return a;if(De(a)){const l=o&&Ps(n)?a:a.value;return i&&ae(l)?ks(l):l}return ae(a)?i?ks(a):qn(a):a}}class yi extends _i{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=z(t)&&Ps(n);if(!this._isShallow){const f=kt(s);if(!We(r)&&!kt(r)&&(s=ce(s),r=ce(r)),!o&&De(s)&&!De(r))return f||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,De(t)?t:i);return t===ce(i)&&(a?ct(r,s)&&ut(t,"set",n,r):ut(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&ut(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!qe(n)||!gi.has(n))&&Re(t,"has",n),r}ownKeys(t){return Re(t,"iterate",z(t)?"length":Lt),Reflect.ownKeys(t)}}class Wo extends _i{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const qo=new yi,Go=new Wo,Yo=new yi(!0);const ws=e=>e,Sn=e=>Reflect.getPrototypeOf(e);function Jo(e,t,n){return function(...r){const i=this.__v_raw,s=ce(i),o=Dt(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,f=i[e](...r),c=n?ws:t?$t:_t;return!t&&Re(s,"iterate",l?bs:Lt),Ae(Object.create(f),{next(){const{value:p,done:A}=f.next();return A?{value:p,done:A}:{value:a?[c(p[0]),c(p[1])]:c(p),done:A}}})}}function An(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Xo(e,t){const n={get(i){const s=this.__v_raw,o=ce(s),a=ce(i);e||(ct(i,a)&&Re(o,"get",i),Re(o,"get",a));const{has:l}=Sn(o),f=t?ws:e?$t:_t;if(l.call(o,i))return f(s.get(i));if(l.call(o,a))return f(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Re(ce(i),"iterate",Lt),i.size},has(i){const s=this.__v_raw,o=ce(s),a=ce(i);return e||(ct(i,a)&&Re(o,"has",i),Re(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=ce(a),f=t?ws:e?$t:_t;return!e&&Re(l,"iterate",Lt),a.forEach((c,p)=>i.call(s,f(c),f(p),o))}};return Ae(n,e?{add:An("add"),set:An("set"),delete:An("delete"),clear:An("clear")}:{add(i){const s=ce(this),o=Sn(s),a=ce(i),l=!t&&!We(i)&&!kt(i)?a:i;return o.has.call(s,l)||ct(i,l)&&o.has.call(s,i)||ct(a,l)&&o.has.call(s,a)||(s.add(l),ut(s,"add",l,l)),this},set(i,s){!t&&!We(s)&&!kt(s)&&(s=ce(s));const o=ce(this),{has:a,get:l}=Sn(o);let f=a.call(o,i);f||(i=ce(i),f=a.call(o,i));const c=l.call(o,i);return o.set(i,s),f?ct(s,c)&&ut(o,"set",i,s):ut(o,"add",i,s),this},delete(i){const s=ce(this),{has:o,get:a}=Sn(s);let l=o.call(s,i);l||(i=ce(i),l=o.call(s,i)),a&&a.call(s,i);const f=s.delete(i);return l&&ut(s,"delete",i,void 0),f},clear(){const i=ce(this),s=i.size!==0,o=i.clear();return s&&ut(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Jo(i,e,t)}),n}function js(e,t){const n=Xo(e,t);return(r,i,s)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(oe(n,i)&&i in r?n:r,i,s)}const Qo={get:js(!1,!1)},Zo={get:js(!1,!0)},ea={get:js(!0,!1)};const vi=new WeakMap,bi=new WeakMap,wi=new WeakMap,ta=new WeakMap;function na(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function sa(e){return e.__v_skip||!Object.isExtensible(e)?0:na(To(e))}function qn(e){return kt(e)?e:Us(e,!1,qo,Qo,vi)}function ra(e){return Us(e,!1,Yo,Zo,bi)}function ks(e){return Us(e,!0,Go,ea,wi)}function Us(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=sa(e);if(s===0)return e;const o=i.get(e);if(o)return o;const a=new Proxy(e,s===2?r:n);return i.set(e,a),a}function Pt(e){return kt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function kt(e){return!!(e&&e.__v_isReadonly)}function We(e){return!!(e&&e.__v_isShallow)}function Hs(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Cs(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&si(e,"__v_skip",!0),e}const _t=e=>ae(e)?qn(e):e,$t=e=>ae(e)?ks(e):e;function De(e){return e?e.__v_isRef===!0:!1}function ia(e){return De(e)?e.value:e}const oa={get:(e,t,n)=>t==="__v_raw"?e:ia(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return De(i)&&!De(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function ki(e){return Pt(e)?e:new Proxy(e,oa)}class aa{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new mi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return ci(this,!0),!0}get value(){const t=this.dep.track();return fi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function la(e,t,n=!1){let r,i;return X(e)?r=e:(r=e.get,i=e.set),new aa(r,i,n)}const xn={},In=new WeakMap;let Ot;function ca(e,t=!1,n=Ot){if(n){let r=In.get(n);r||In.set(n,r=[]),r.push(e)}}function ua(e,t,n=fe){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,f=$=>i?$:We($)||i===!1||i===0?dt($,1):dt($);let c,p,A,w,V=!1,O=!1;if(De(e)?(p=()=>e.value,V=We(e)):Pt(e)?(p=()=>f(e),V=!0):z(e)?(O=!0,V=e.some($=>Pt($)||We($)),p=()=>e.map($=>{if(De($))return $.value;if(Pt($))return f($);if(X($))return l?l($,2):$()})):X(e)?t?p=l?()=>l(e,2):e:p=()=>{if(A){pt();try{A()}finally{gt()}}const $=Ot;Ot=c;try{return l?l(e,3,[w]):e(w)}finally{Ot=$}}:p=st,t&&i){const $=p,se=i===!0?1/0:i;p=()=>dt($(),se)}const J=jo(),W=()=>{c.stop(),J&&J.active&&Ls(J.effects,c)};if(s&&t){const $=t;t=(...se)=>{$(...se),W()}}let H=O?new Array(e.length).fill(xn):xn;const Q=$=>{if(!(!(c.flags&1)||!c.dirty&&!$))if(t){const se=c.run();if(i||V||(O?se.some((ge,he)=>ct(ge,H[he])):ct(se,H))){A&&A();const ge=Ot;Ot=c;try{const he=[se,H===xn?void 0:O&&H[0]===xn?[]:H,w];H=se,l?l(t,3,he):t(...he)}finally{Ot=ge}}}else c.run()};return a&&a(Q),c=new ai(p),c.scheduler=o?()=>o(Q,!1):Q,w=$=>ca($,!1,c),A=c.onStop=()=>{const $=In.get(c);if($){if(l)l($,4);else for(const se of $)se();In.delete(c)}},t?r?Q(!0):H=c.run():o?o(Q.bind(null,!0),!0):c.run(),W.pause=c.pause.bind(c),W.resume=c.resume.bind(c),W.stop=W,W}function dt(e,t=1/0,n){if(t<=0||!ae(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,De(e))dt(e.value,t,n);else if(z(e))for(let r=0;r<e.length;r++)dt(e[r],t,n);else if(zt(e)||Dt(e))e.forEach(r=>{dt(r,t,n)});else if(ni(e)){for(const r in e)dt(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&dt(e[r],t,n)}return e}/**
9
+ **/let Me;class Do{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Me&&(Me.active?(this.parent=Me,this.index=(Me.scopes||(Me.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!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=Me;try{return Me=this,t()}finally{Me=n}}}on(){++this._on===1&&(this.prevScope=Me,Me=this)}off(){if(this._on>0&&--this._on===0){if(Me===this)Me=this.prevScope;else{let t=Me;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.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 i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function jo(){return Me}let pe;const rs=new WeakSet;class ai{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,Me&&(Me.active?Me.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,rs.has(this)&&(rs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ci(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rr(this),ui(this);const t=pe,n=ze;pe=this,ze=!0;try{return this.fn()}finally{di(this),pe=t,ze=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ds(t);this.deps=this.depsTail=void 0,rr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?rs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ys(this)&&this.run()}get dirty(){return ys(this)}}let li=0,sn,rn;function ci(e,t=!1){if(e.flags|=8,t){e.next=rn,rn=e;return}e.next=sn,sn=e}function Fs(){li++}function Ns(){if(--li>0)return;if(rn){let t=rn;for(rn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;sn;){let t=sn;for(sn=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 ui(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function di(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Ds(r),Ho(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(fi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function fi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===cn)||(e.globalVersion=cn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ys(e))))return;e.flags|=2;const t=e.dep,n=pe,r=ze;pe=e,ze=!0;try{ui(e);const i=e.fn(e._value);(t.version===0||ct(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{pe=n,ze=r,di(e),e.flags&=-3}}function Ds(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.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)Ds(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ho(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ze=!0;const hi=[];function pt(){hi.push(ze),ze=!1}function gt(){const e=hi.pop();ze=e===void 0?!0:e}function rr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pe;pe=void 0;try{t()}finally{pe=n}}}let cn=0;class Uo{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 mi{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(!pe||!ze||pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pe)n=this.activeLink=new Uo(pe,this),pe.deps?(n.prevDep=pe.depsTail,pe.depsTail.nextDep=n,pe.depsTail=n):pe.deps=pe.depsTail=n,pi(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=pe.depsTail,n.nextDep=void 0,pe.depsTail.nextDep=n,pe.depsTail=n,pe.deps===n&&(pe.deps=r)}return n}trigger(t){this.version++,cn++,this.notify(t)}notify(t){Fs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ns()}}}function pi(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)pi(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vs=new WeakMap,Lt=Symbol(""),bs=Symbol(""),un=Symbol("");function Re(e,t,n){if(ze&&pe){let r=vs.get(e);r||vs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new mi),i.map=r,i.key=n),i.track()}}function ut(e,t,n,r,i,s){const o=vs.get(e);if(!o){cn++;return}const a=l=>{l&&l.trigger()};if(Fs(),t==="clear")o.forEach(a);else{const l=z(e),f=l&&Ps(n);if(l&&n==="length"){const c=Number(r);o.forEach((p,A)=>{(A==="length"||A===un||!qe(A)&&A>=c)&&a(p)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),f&&a(o.get(un)),t){case"add":l?f&&a(o.get("length")):(a(o.get(Lt)),Dt(e)&&a(o.get(bs)));break;case"delete":l||(a(o.get(Lt)),Dt(e)&&a(o.get(bs)));break;case"set":Dt(e)&&a(o.get(Lt));break}}Ns()}function Bt(e){const t=ce(e);return t===e?t:(Re(t,"iterate",un),We(e)?t:t.map(_t))}function Wn(e){return Re(e=ce(e),"iterate",un),e}function tt(e,t){return kt(e)?$t(Pt(e)?_t(t):t):_t(t)}const $o={__proto__:null,[Symbol.iterator](){return is(this,Symbol.iterator,e=>tt(this,e))},concat(...e){return Bt(this).concat(...e.map(t=>z(t)?Bt(t):t))},entries(){return is(this,"entries",e=>(e[1]=tt(this,e[1]),e))},every(e,t){return rt(this,"every",e,t,void 0,arguments)},filter(e,t){return rt(this,"filter",e,t,n=>n.map(r=>tt(this,r)),arguments)},find(e,t){return rt(this,"find",e,t,n=>tt(this,n),arguments)},findIndex(e,t){return rt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return rt(this,"findLast",e,t,n=>tt(this,n),arguments)},findLastIndex(e,t){return rt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return rt(this,"forEach",e,t,void 0,arguments)},includes(...e){return os(this,"includes",e)},indexOf(...e){return os(this,"indexOf",e)},join(e){return Bt(this).join(e)},lastIndexOf(...e){return os(this,"lastIndexOf",e)},map(e,t){return rt(this,"map",e,t,void 0,arguments)},pop(){return Jt(this,"pop")},push(...e){return Jt(this,"push",e)},reduce(e,...t){return ir(this,"reduce",e,t)},reduceRight(e,...t){return ir(this,"reduceRight",e,t)},shift(){return Jt(this,"shift")},some(e,t){return rt(this,"some",e,t,void 0,arguments)},splice(...e){return Jt(this,"splice",e)},toReversed(){return Bt(this).toReversed()},toSorted(e){return Bt(this).toSorted(e)},toSpliced(...e){return Bt(this).toSpliced(...e)},unshift(...e){return Jt(this,"unshift",e)},values(){return is(this,"values",e=>tt(this,e))}};function is(e,t,n){const r=Wn(e),i=r[t]();return r!==e&&!We(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const Vo=Array.prototype;function rt(e,t,n,r,i,s){const o=Wn(e),a=o!==e&&!We(e),l=o[t];if(l!==Vo[t]){const p=l.apply(e,s);return a?_t(p):p}let f=n;o!==e&&(a?f=function(p,A){return n.call(this,tt(e,p),A,e)}:n.length>2&&(f=function(p,A){return n.call(this,p,A,e)}));const c=l.call(o,f,r);return a&&i?i(c):c}function ir(e,t,n,r){const i=Wn(e),s=i!==e&&!We(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(f,c,p){return a&&(a=!1,f=tt(e,f)),n.call(this,f,tt(e,c),p,e)}):n.length>3&&(o=function(f,c,p){return n.call(this,f,c,p,e)}));const l=i[t](o,...r);return a?tt(e,l):l}function os(e,t,n){const r=ce(e);Re(r,"iterate",un);const i=r[t](...n);return(i===-1||i===!1)&&Us(n[0])?(n[0]=ce(n[0]),r[t](...n)):i}function Jt(e,t,n=[]){pt(),Fs();const r=ce(e)[t].apply(e,n);return Ns(),gt(),r}const Ko=Rs("__proto__,__v_isRef,__isVue"),gi=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qe));function zo(e){qe(e)||(e=String(e));const t=ce(this);return Re(t,"has",e),t.hasOwnProperty(e)}class _i{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(i?s?ta:wi:s?bi:vi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=z(t);if(!i){let l;if(o&&(l=$o[n]))return l;if(n==="hasOwnProperty")return zo}const a=Reflect.get(t,n,De(t)?t:r);if((qe(n)?gi.has(n):Ko(n))||(i||Re(t,"get",n),s))return a;if(De(a)){const l=o&&Ps(n)?a:a.value;return i&&ae(l)?ks(l):l}return ae(a)?i?ks(a):qn(a):a}}class yi extends _i{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=z(t)&&Ps(n);if(!this._isShallow){const f=kt(s);if(!We(r)&&!kt(r)&&(s=ce(s),r=ce(r)),!o&&De(s)&&!De(r))return f||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,De(t)?t:i);return t===ce(i)&&(a?ct(r,s)&&ut(t,"set",n,r):ut(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&ut(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!qe(n)||!gi.has(n))&&Re(t,"has",n),r}ownKeys(t){return Re(t,"iterate",z(t)?"length":Lt),Reflect.ownKeys(t)}}class Wo extends _i{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const qo=new yi,Go=new Wo,Yo=new yi(!0);const ws=e=>e,Sn=e=>Reflect.getPrototypeOf(e);function Jo(e,t,n){return function(...r){const i=this.__v_raw,s=ce(i),o=Dt(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,f=i[e](...r),c=n?ws:t?$t:_t;return!t&&Re(s,"iterate",l?bs:Lt),Ae(Object.create(f),{next(){const{value:p,done:A}=f.next();return A?{value:p,done:A}:{value:a?[c(p[0]),c(p[1])]:c(p),done:A}}})}}function An(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Xo(e,t){const n={get(i){const s=this.__v_raw,o=ce(s),a=ce(i);e||(ct(i,a)&&Re(o,"get",i),Re(o,"get",a));const{has:l}=Sn(o),f=t?ws:e?$t:_t;if(l.call(o,i))return f(s.get(i));if(l.call(o,a))return f(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Re(ce(i),"iterate",Lt),i.size},has(i){const s=this.__v_raw,o=ce(s),a=ce(i);return e||(ct(i,a)&&Re(o,"has",i),Re(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=ce(a),f=t?ws:e?$t:_t;return!e&&Re(l,"iterate",Lt),a.forEach((c,p)=>i.call(s,f(c),f(p),o))}};return Ae(n,e?{add:An("add"),set:An("set"),delete:An("delete"),clear:An("clear")}:{add(i){const s=ce(this),o=Sn(s),a=ce(i),l=!t&&!We(i)&&!kt(i)?a:i;return o.has.call(s,l)||ct(i,l)&&o.has.call(s,i)||ct(a,l)&&o.has.call(s,a)||(s.add(l),ut(s,"add",l,l)),this},set(i,s){!t&&!We(s)&&!kt(s)&&(s=ce(s));const o=ce(this),{has:a,get:l}=Sn(o);let f=a.call(o,i);f||(i=ce(i),f=a.call(o,i));const c=l.call(o,i);return o.set(i,s),f?ct(s,c)&&ut(o,"set",i,s):ut(o,"add",i,s),this},delete(i){const s=ce(this),{has:o,get:a}=Sn(s);let l=o.call(s,i);l||(i=ce(i),l=o.call(s,i)),a&&a.call(s,i);const f=s.delete(i);return l&&ut(s,"delete",i,void 0),f},clear(){const i=ce(this),s=i.size!==0,o=i.clear();return s&&ut(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Jo(i,e,t)}),n}function js(e,t){const n=Xo(e,t);return(r,i,s)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(oe(n,i)&&i in r?n:r,i,s)}const Qo={get:js(!1,!1)},Zo={get:js(!1,!0)},ea={get:js(!0,!1)};const vi=new WeakMap,bi=new WeakMap,wi=new WeakMap,ta=new WeakMap;function na(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function sa(e){return e.__v_skip||!Object.isExtensible(e)?0:na(To(e))}function qn(e){return kt(e)?e:Hs(e,!1,qo,Qo,vi)}function ra(e){return Hs(e,!1,Yo,Zo,bi)}function ks(e){return Hs(e,!0,Go,ea,wi)}function Hs(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=sa(e);if(s===0)return e;const o=i.get(e);if(o)return o;const a=new Proxy(e,s===2?r:n);return i.set(e,a),a}function Pt(e){return kt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function kt(e){return!!(e&&e.__v_isReadonly)}function We(e){return!!(e&&e.__v_isShallow)}function Us(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Cs(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&si(e,"__v_skip",!0),e}const _t=e=>ae(e)?qn(e):e,$t=e=>ae(e)?ks(e):e;function De(e){return e?e.__v_isRef===!0:!1}function ia(e){return De(e)?e.value:e}const oa={get:(e,t,n)=>t==="__v_raw"?e:ia(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return De(i)&&!De(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function ki(e){return Pt(e)?e:new Proxy(e,oa)}class aa{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new mi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=cn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return ci(this,!0),!0}get value(){const t=this.dep.track();return fi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function la(e,t,n=!1){let r,i;return X(e)?r=e:(r=e.get,i=e.set),new aa(r,i,n)}const xn={},In=new WeakMap;let Ot;function ca(e,t=!1,n=Ot){if(n){let r=In.get(n);r||In.set(n,r=[]),r.push(e)}}function ua(e,t,n=fe){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,f=$=>i?$:We($)||i===!1||i===0?dt($,1):dt($);let c,p,A,w,V=!1,O=!1;if(De(e)?(p=()=>e.value,V=We(e)):Pt(e)?(p=()=>f(e),V=!0):z(e)?(O=!0,V=e.some($=>Pt($)||We($)),p=()=>e.map($=>{if(De($))return $.value;if(Pt($))return f($);if(X($))return l?l($,2):$()})):X(e)?t?p=l?()=>l(e,2):e:p=()=>{if(A){pt();try{A()}finally{gt()}}const $=Ot;Ot=c;try{return l?l(e,3,[w]):e(w)}finally{Ot=$}}:p=st,t&&i){const $=p,se=i===!0?1/0:i;p=()=>dt($(),se)}const J=jo(),W=()=>{c.stop(),J&&J.active&&Ls(J.effects,c)};if(s&&t){const $=t;t=(...se)=>{$(...se),W()}}let U=O?new Array(e.length).fill(xn):xn;const Q=$=>{if(!(!(c.flags&1)||!c.dirty&&!$))if(t){const se=c.run();if(i||V||(O?se.some((ge,he)=>ct(ge,U[he])):ct(se,U))){A&&A();const ge=Ot;Ot=c;try{const he=[se,U===xn?void 0:O&&U[0]===xn?[]:U,w];U=se,l?l(t,3,he):t(...he)}finally{Ot=ge}}}else c.run()};return a&&a(Q),c=new ai(p),c.scheduler=o?()=>o(Q,!1):Q,w=$=>ca($,!1,c),A=c.onStop=()=>{const $=In.get(c);if($){if(l)l($,4);else for(const se of $)se();In.delete(c)}},t?r?Q(!0):U=c.run():o?o(Q.bind(null,!0),!0):c.run(),W.pause=c.pause.bind(c),W.resume=c.resume.bind(c),W.stop=W,W}function dt(e,t=1/0,n){if(t<=0||!ae(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,De(e))dt(e.value,t,n);else if(z(e))for(let r=0;r<e.length;r++)dt(e[r],t,n);else if(zt(e)||Dt(e))e.forEach(r=>{dt(r,t,n)});else if(ni(e)){for(const r in e)dt(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&dt(e[r],t,n)}return e}/**
10
10
  * @vue/runtime-core v3.5.34
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/function wn(e,t,n,r){try{return r?e(...r):e()}catch(i){Gn(i,t,n)}}function Ge(e,t,n,r){if(X(e)){const i=wn(e,t,n,r);return i&&ei(i)&&i.catch(s=>{Gn(s,t,n)}),i}if(z(e)){const i=[];for(let s=0;s<e.length;s++)i.push(Ge(e[s],t,n,r));return i}}function Gn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||fe;if(t){let a=t.parent;const l=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,l,f)===!1)return}a=a.parent}if(s){pt(),wn(s,null,10,[e,l,f]),gt();return}}da(e,n,i,r,o)}function da(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Ne=[];let Ze=-1;const jt=[];let bt=null,Nt=0;const Ci=Promise.resolve();let Rn=null;function Si(e){const t=Rn||Ci;return e?t.then(this?e.bind(this):e):t}function fa(e){let t=Ze+1,n=Ne.length;for(;t<n;){const r=t+n>>>1,i=Ne[r],s=dn(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function $s(e){if(!(e.flags&1)){const t=dn(e),n=Ne[Ne.length-1];!n||!(e.flags&2)&&t>=dn(n)?Ne.push(e):Ne.splice(fa(t),0,e),e.flags|=1,Ai()}}function Ai(){Rn||(Rn=Ci.then(Ti))}function ha(e){z(e)?jt.push(...e):bt&&e.id===-1?bt.splice(Nt+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Ai()}function or(e,t,n=Ze+1){for(;n<Ne.length;n++){const r=Ne[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ne.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function xi(e){if(jt.length){const t=[...new Set(jt)].sort((n,r)=>dn(n)-dn(r));if(jt.length=0,bt){bt.push(...t);return}for(bt=t,Nt=0;Nt<bt.length;Nt++){const n=bt[Nt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}bt=null,Nt=0}}const dn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ti(e){try{for(Ze=0;Ze<Ne.length;Ze++){const t=Ne[Ze];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),wn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ze<Ne.length;Ze++){const t=Ne[Ze];t&&(t.flags&=-2)}Ze=-1,Ne.length=0,xi(),Rn=null,(Ne.length||jt.length)&&Ti()}}let Ee=null,Mi=null;function Ln(e){const t=Ee;return Ee=e,Mi=e&&e.type.__scopeId||null,t}function Vs(e,t=Ee,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Nn(-1);const s=Ln(t);let o;try{o=e(...i)}finally{Ln(s),r._d&&Nn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function at(e,t){if(Ee===null)return e;const n=es(Ee),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=fe]=t[i];s&&(X(s)&&(s={mounted:s,updated:s}),s.deep&&dt(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function At(e,t,n,r){const i=e.dirs,s=t&&t.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(pt(),Ge(l,n,8,[e.el,a,e,t]),gt())}}function ma(e,t){if(Pe){let n=Pe.provides;const r=Pe.parent&&Pe.parent.provides;r===n&&(n=Pe.provides=Object.create(r)),n[e]=t}}function Mn(e,t,n=!1){const r=mo();if(r||Ht){let i=Ht?Ht._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&X(t)?t.call(r&&r.proxy):t}}const pa=Symbol.for("v-scx"),ga=()=>Mn(pa);function as(e,t,n){return Ei(e,t,n)}function Ei(e,t,n=fe){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let f;if(pn){if(s==="sync"){const w=ga();f=w.__watcherHandles||(w.__watcherHandles=[])}else if(!l){const w=()=>{};return w.stop=st,w.resume=st,w.pause=st,w}}const c=Pe;a.call=(w,V,O)=>Ge(w,c,V,O);let p=!1;s==="post"?a.scheduler=w=>{Ue(w,c&&c.suspense)}:s!=="sync"&&(p=!0,a.scheduler=(w,V)=>{V?w():$s(w)}),a.augmentJob=w=>{t&&(w.flags|=4),p&&(w.flags|=2,c&&(w.id=c.uid,w.i=c))};const A=ua(e,t,a);return pn&&(f?f.push(A):l&&A()),A}function _a(e,t,n){const r=this.proxy,i=be(e)?e.includes(".")?Oi(r,e):()=>r[e]:e.bind(r,r);let s;X(t)?s=t:(s=t.handler,n=t);const o=kn(this),a=Ei(i,s.bind(r),n);return o(),a}function Oi(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const ya=Symbol("_vte"),Ii=e=>e.__isTeleport,et=Symbol("_leaveCb"),Xt=Symbol("_enterCb");function va(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ji(()=>{e.isMounted=!0}),Ui(()=>{e.isUnmounting=!0}),e}const Ke=[Function,Array],Ri={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ke,onEnter:Ke,onAfterEnter:Ke,onEnterCancelled:Ke,onBeforeLeave:Ke,onLeave:Ke,onAfterLeave:Ke,onLeaveCancelled:Ke,onBeforeAppear:Ke,onAppear:Ke,onAfterAppear:Ke,onAppearCancelled:Ke},Li=e=>{const t=e.subTree;return t.component?Li(t.component):t},ba={name:"BaseTransition",props:Ri,setup(e,{slots:t}){const n=mo(),r=va();return()=>{const i=t.default&&Ni(t.default(),!0),s=i&&i.length?Pi(i):n.subTree?F():void 0;if(!s)return;const o=ce(e),{mode:a}=o;if(r.isLeaving)return ls(s);const l=ar(s);if(!l)return ls(s);let f=Ss(l,o,r,n,p=>f=p);l.type!==Le&&fn(l,f);let c=n.subTree&&ar(n.subTree);if(c&&c.type!==Le&&!It(c,l)&&Li(n).type!==Le){let p=Ss(c,o,r,n);if(fn(c,p),a==="out-in"&&l.type!==Le)return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,c=void 0},ls(s);a==="in-out"&&l.type!==Le?p.delayLeave=(A,w,V)=>{const O=Bi(r,c);O[String(c.key)]=c,A[et]=()=>{w(),A[et]=void 0,delete f.delayedLeave,c=void 0},f.delayedLeave=()=>{V(),delete f.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Pi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Le){t=n;break}}return t}const wa=ba;function Bi(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 Ss(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:c,onEnterCancelled:p,onBeforeLeave:A,onLeave:w,onAfterLeave:V,onLeaveCancelled:O,onBeforeAppear:J,onAppear:W,onAfterAppear:H,onAppearCancelled:Q}=t,$=String(e.key),se=Bi(n,e),ge=(G,ne)=>{G&&Ge(G,r,9,ne)},he=(G,ne)=>{const ue=ne[1];ge(G,ne),z(G)?G.every(U=>U.length<=1)&&ue():G.length<=1&&ue()},ke={mode:o,persisted:a,beforeEnter(G){let ne=l;if(!n.isMounted)if(s)ne=J||l;else return;G[et]&&G[et](!0);const ue=se[$];ue&&It(e,ue)&&ue.el[et]&&ue.el[et](),ge(ne,[G])},enter(G){if(se[$]===e)return;let ne=f,ue=c,U=p;if(!n.isMounted)if(s)ne=W||f,ue=H||c,U=Q||p;else return;let le=!1;G[Xt]=v=>{le||(le=!0,v?ge(U,[G]):ge(ue,[G]),ke.delayedLeave&&ke.delayedLeave(),G[Xt]=void 0)};const y=G[Xt].bind(null,!1);ne?he(ne,[G,y]):y()},leave(G,ne){const ue=String(e.key);if(G[Xt]&&G[Xt](!0),n.isUnmounting)return ne();ge(A,[G]);let U=!1;G[et]=y=>{U||(U=!0,ne(),y?ge(O,[G]):ge(V,[G]),G[et]=void 0,se[ue]===e&&delete se[ue])};const le=G[et].bind(null,!1);se[ue]=e,w?he(w,[G,le]):le()},clone(G){const ne=Ss(G,t,n,r,i);return i&&i(ne),ne}};return ke}function ls(e){if(Yn(e))return e=Ct(e),e.children=null,e}function ar(e){if(!Yn(e))return Ii(e.type)&&e.children?Pi(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&&X(n.default))return n.default()}}function fn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,fn(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 Ni(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===ee?(o.patchFlag&128&&i++,r=r.concat(Ni(o.children,t,a))):(t||o.type!==Le)&&r.push(a!=null?Ct(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Fi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function lr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Pn=new WeakMap;function on(e,t,n,r,i=!1){if(z(e)){e.forEach((O,J)=>on(O,t&&(z(t)?t[J]:t),n,r,i));return}if(Ut(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&on(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?es(r.component):r.el,o=i?null:s,{i:a,r:l}=e,f=t&&t.r,c=a.refs===fe?a.refs={}:a.refs,p=a.setupState,A=ce(p),w=p===fe?Zr:O=>lr(c,O)?!1:oe(A,O),V=(O,J)=>!(J&&lr(c,J));if(f!=null&&f!==l){if(cr(t),be(f))c[f]=null,w(f)&&(p[f]=null);else if(De(f)){const O=t;V(f,O.k)&&(f.value=null),O.k&&(c[O.k]=null)}}if(X(l))wn(l,a,12,[o,c]);else{const O=be(l),J=De(l);if(O||J){const W=()=>{if(e.f){const H=O?w(l)?p[l]:c[l]:V()||!e.k?l.value:c[e.k];if(i)z(H)&&Ls(H,s);else if(z(H))H.includes(s)||H.push(s);else if(O)c[l]=[s],w(l)&&(p[l]=c[l]);else{const Q=[s];V(l,e.k)&&(l.value=Q),e.k&&(c[e.k]=Q)}}else O?(c[l]=o,w(l)&&(p[l]=o)):J&&(V(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const H=()=>{W(),Pn.delete(e)};H.id=-1,Pn.set(e,H),Ue(H,n)}else cr(e),W()}}}function cr(e){const t=Pn.get(e);t&&(t.flags|=8,Pn.delete(e))}zn().requestIdleCallback;zn().cancelIdleCallback;const Ut=e=>!!e.type.__asyncLoader,Yn=e=>e.type.__isKeepAlive;function ka(e,t){Di(e,"a",t)}function Ca(e,t){Di(e,"da",t)}function Di(e,t,n=Pe){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Jn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)Yn(i.parent.vnode)&&Sa(r,t,n,i),i=i.parent}}function Sa(e,t,n,r){const i=Jn(t,e,r,!0);Hi(()=>{Ls(r[t],i)},n)}function Jn(e,t,n=Pe,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{pt();const a=kn(n),l=Ge(t,n,e,o);return a(),gt(),l});return r?i.unshift(s):i.push(s),s}}const yt=e=>(t,n=Pe)=>{(!pn||e==="sp")&&Jn(e,(...r)=>t(...r),n)},Aa=yt("bm"),ji=yt("m"),xa=yt("bu"),Ta=yt("u"),Ui=yt("bum"),Hi=yt("um"),Ma=yt("sp"),Ea=yt("rtg"),Oa=yt("rtc");function Ia(e,t=Pe){Jn("ec",e,t)}const $i="components";function _e(e,t){return zi($i,e,!0,t)||e}const Vi=Symbol.for("v-ndc");function Ki(e){return be(e)?zi($i,e,!1)||e:e||Vi}function zi(e,t,n=!0,r=!1){const i=Ee||Pe;if(i){const s=i.type;{const a=pl(s,!1);if(a&&(a===t||a===Fe(t)||a===Vn(Fe(t))))return s}const o=ur(i[e]||s[e],t)||ur(i.appContext[e],t);return!o&&r?s:o}}function ur(e,t){return e&&(e[t]||e[Fe(t)]||e[Vn(Fe(t))])}function Se(e,t,n,r){let i;const s=n,o=z(e);if(o||be(e)){const a=o&&Pt(e);let l=!1,f=!1;a&&(l=!We(e),f=kt(e),e=Wn(e)),i=new Array(e.length);for(let c=0,p=e.length;c<p;c++)i[c]=t(l?f?$t(_t(e[c])):_t(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,s)}else if(ae(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,f=a.length;l<f;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Ra(e,t,n={},r,i){if(Ee.ce||Ee.parent&&Ut(Ee.parent)&&Ee.parent.ce){const f=Object.keys(n).length>0;return h(),ye(ee,null,[ve("slot",n,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),h();const o=s&&Wi(s(n)),a=n.key||o&&o.key,l=ye(ee,{key:(a&&!qe(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function Wi(e){return e.some(t=>mn(t)?!(t.type===Le||t.type===ee&&!Wi(t.children)):!0)?e:null}const As=e=>e?po(e)?es(e):As(e.parent):null,an=Ae(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=>As(e.parent),$root:e=>As(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gi(e),$forceUpdate:e=>e.f||(e.f=()=>{$s(e.update)}),$nextTick:e=>e.n||(e.n=Si.bind(e.proxy)),$watch:e=>_a.bind(e)}),cs=(e,t)=>e!==fe&&!e.__isScriptSetup&&oe(e,t),La={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const A=o[t];if(A!==void 0)switch(A){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(cs(r,t))return o[t]=1,r[t];if(i!==fe&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==fe&&oe(n,t))return o[t]=4,n[t];xs&&(o[t]=0)}}const f=an[t];let c,p;if(f)return t==="$attrs"&&Re(e.attrs,"get",""),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==fe&&oe(n,t))return o[t]=4,n[t];if(p=l.config.globalProperties,oe(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return cs(i,t)?(i[t]=n,!0):r!==fe&&oe(r,t)?(r[t]=n,!0):oe(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:i,props:s,type:o}},a){let l;return!!(n[a]||e!==fe&&a[0]!=="$"&&oe(e,a)||cs(t,a)||oe(s,a)||oe(r,a)||oe(an,a)||oe(i.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function dr(e){return z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xs=!0;function Pa(e){const t=Gi(e),n=e.proxy,r=e.ctx;xs=!1,t.beforeCreate&&fr(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:f,created:c,beforeMount:p,mounted:A,beforeUpdate:w,updated:V,activated:O,deactivated:J,beforeDestroy:W,beforeUnmount:H,destroyed:Q,unmounted:$,render:se,renderTracked:ge,renderTriggered:he,errorCaptured:ke,serverPrefetch:G,expose:ne,inheritAttrs:ue,components:U,directives:le,filters:y}=t;if(f&&Ba(f,r,null),o)for(const S in o){const R=o[S];X(R)&&(r[S]=R.bind(n))}if(i){const S=i.call(n,n);ae(S)&&(e.data=qn(S))}if(xs=!0,s)for(const S in s){const R=s[S],g=X(R)?R.bind(n,n):X(R.get)?R.get.bind(n,n):st,C=!X(R)&&X(R.set)?R.set.bind(n):st,x=_l({get:g,set:C});Object.defineProperty(r,S,{enumerable:!0,configurable:!0,get:()=>x.value,set:j=>x.value=j})}if(a)for(const S in a)qi(a[S],r,n,S);if(l){const S=X(l)?l.call(n):l;Reflect.ownKeys(S).forEach(R=>{ma(R,S[R])})}c&&fr(c,e,"c");function b(S,R){z(R)?R.forEach(g=>S(g.bind(n))):R&&S(R.bind(n))}if(b(Aa,p),b(ji,A),b(xa,w),b(Ta,V),b(ka,O),b(Ca,J),b(Ia,ke),b(Oa,ge),b(Ea,he),b(Ui,H),b(Hi,$),b(Ma,G),z(ne))if(ne.length){const S=e.exposed||(e.exposed={});ne.forEach(R=>{Object.defineProperty(S,R,{get:()=>n[R],set:g=>n[R]=g,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===st&&(e.render=se),ue!=null&&(e.inheritAttrs=ue),U&&(e.components=U),le&&(e.directives=le),G&&Fi(e)}function Ba(e,t,n=st){z(e)&&(e=Ts(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=Mn(i.from||r,i.default,!0):s=Mn(i.from||r):s=Mn(i),De(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function fr(e,t,n){Ge(z(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function qi(e,t,n,r){let i=r.includes(".")?Oi(n,r):()=>n[r];if(be(e)){const s=t[e];X(s)&&as(i,s)}else if(X(e))as(i,e.bind(n));else if(ae(e))if(z(e))e.forEach(s=>qi(s,t,n,r));else{const s=X(e.handler)?e.handler.bind(n):t[e.handler];X(s)&&as(i,s,e)}}function Gi(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(f=>Bn(l,f,o,!0)),Bn(l,t,o)),ae(t)&&s.set(t,l),l}function Bn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Bn(e,s,n,!0),i&&i.forEach(o=>Bn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Na[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Na={data:hr,props:mr,emits:mr,methods:Zt,computed:Zt,beforeCreate:Be,created:Be,beforeMount:Be,mounted:Be,beforeUpdate:Be,updated:Be,beforeDestroy:Be,beforeUnmount:Be,destroyed:Be,unmounted:Be,activated:Be,deactivated:Be,errorCaptured:Be,serverPrefetch:Be,components:Zt,directives:Zt,watch:Da,provide:hr,inject:Fa};function hr(e,t){return t?e?function(){return Ae(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Fa(e,t){return Zt(Ts(e),Ts(t))}function Ts(e){if(z(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Be(e,t){return e?[...new Set([].concat(e,t))]:t}function Zt(e,t){return e?Ae(Object.create(null),e,t):t}function mr(e,t){return e?z(e)&&z(t)?[...new Set([...e,...t])]:Ae(Object.create(null),dr(e),dr(t??{})):t}function Da(e,t){if(!e)return t;if(!t)return e;const n=Ae(Object.create(null),e);for(const r in t)n[r]=Be(e[r],t[r]);return n}function Yi(){return{app:null,config:{isNativeTag:Zr,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 ja=0;function Ua(e,t){return function(r,i=null){X(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=Yi(),o=new WeakSet,a=[];let l=!1;const f=s.app={_uid:ja++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:yl,get config(){return s.config},set config(c){},use(c,...p){return o.has(c)||(c&&X(c.install)?(o.add(c),c.install(f,...p)):X(c)&&(o.add(c),c(f,...p))),f},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),f},component(c,p){return p?(s.components[c]=p,f):s.components[c]},directive(c,p){return p?(s.directives[c]=p,f):s.directives[c]},mount(c,p,A){if(!l){const w=f._ceVNode||ve(r,i);return w.appContext=s,A===!0?A="svg":A===!1&&(A=void 0),e(w,c,A),l=!0,f._container=c,c.__vue_app__=f,es(w.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Ge(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(c,p){return s.provides[c]=p,f},runWithContext(c){const p=Ht;Ht=f;try{return c()}finally{Ht=p}}};return f}}let Ht=null;const Ha=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fe(t)}Modifiers`]||e[`${St(t)}Modifiers`];function $a(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||fe;let i=n;const s=t.startsWith("update:"),o=s&&Ha(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>be(c)?c.trim():c)),o.number&&(i=n.map(Kn)));let a,l=r[a=ns(t)]||r[a=ns(Fe(t))];!l&&s&&(l=r[a=ns(St(t))]),l&&Ge(l,e,6,i);const f=r[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Ge(f,e,6,i)}}const Va=new WeakMap;function Ji(e,t,n=!1){const r=n?Va:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!X(e)){const l=f=>{const c=Ji(f,t,!0);c&&(a=!0,Ae(o,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(ae(e)&&r.set(e,null),null):(z(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function Xn(e,t){return!e||!Un(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,St(t))||oe(e,t))}function pr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:f,renderCache:c,props:p,data:A,setupState:w,ctx:V,inheritAttrs:O}=e,J=Ln(e);let W,H;try{if(n.shapeFlag&4){const $=i||r,se=$;W=nt(f.call(se,$,c,p,w,A,V)),H=a}else{const $=t;W=nt($.length>1?$(p,{attrs:a,slots:o,emit:l}):$(p,null)),H=t.props?a:Ka(a)}}catch($){ln.length=0,Gn($,e,1),W=ve(Le)}let Q=W;if(H&&O!==!1){const $=Object.keys(H),{shapeFlag:se}=Q;$.length&&se&7&&(s&&$.some(Hn)&&(H=za(H,s)),Q=Ct(Q,H,!1,!0))}return n.dirs&&(Q=Ct(Q,null,!1,!0),Q.dirs=Q.dirs?Q.dirs.concat(n.dirs):n.dirs),n.transition&&fn(Q,n.transition),W=Q,Ln(J),W}const Ka=e=>{let t;for(const n in e)(n==="class"||n==="style"||Un(n))&&((t||(t={}))[n]=e[n]);return t},za=(e,t)=>{const n={};for(const r in e)(!Hn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Wa(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?gr(r,o,f):!!o;if(l&8){const c=t.dynamicProps;for(let p=0;p<c.length;p++){const A=c[p];if(Xi(o,r,A)&&!Xn(f,A))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?gr(r,o,f):!0:!!o;return!1}function gr(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(Xi(t,e,s)&&!Xn(n,s))return!0}return!1}function Xi(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!Wt(r,i):r!==i}function qa({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Qi={},Zi=()=>Object.create(Qi),eo=e=>Object.getPrototypeOf(e)===Qi;function Ga(e,t,n,r=!1){const i={},s=Zi();e.propsDefaults=Object.create(null),to(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:ra(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Ya(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=ce(i),[l]=e.propsOptions;let f=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let p=0;p<c.length;p++){let A=c[p];if(Xn(e.emitsOptions,A))continue;const w=t[A];if(l)if(oe(s,A))w!==s[A]&&(s[A]=w,f=!0);else{const V=Fe(A);i[V]=Ms(l,a,V,w,e,!1)}else w!==s[A]&&(s[A]=w,f=!0)}}}else{to(e,t,i,s)&&(f=!0);let c;for(const p in a)(!t||!oe(t,p)&&((c=St(p))===p||!oe(t,c)))&&(l?n&&(n[p]!==void 0||n[c]!==void 0)&&(i[p]=Ms(l,a,p,void 0,e,!0)):delete i[p]);if(s!==a)for(const p in s)(!t||!oe(t,p))&&(delete s[p],f=!0)}f&&ut(e.attrs,"set","")}function to(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(nn(l))continue;const f=t[l];let c;i&&oe(i,c=Fe(l))?!s||!s.includes(c)?n[c]=f:(a||(a={}))[c]=f:Xn(e.emitsOptions,l)||(!(l in r)||f!==r[l])&&(r[l]=f,o=!0)}if(s){const l=ce(n),f=a||fe;for(let c=0;c<s.length;c++){const p=s[c];n[p]=Ms(i,l,p,f[p],e,!oe(f,p))}}return o}function Ms(e,t,n,r,i,s){const o=e[n];if(o!=null){const a=oe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&X(l)){const{propsDefaults:f}=i;if(n in f)r=f[n];else{const c=kn(i);r=f[n]=l.call(null,t),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===St(n))&&(r=!0))}return r}const Ja=new WeakMap;function no(e,t,n=!1){const r=n?Ja:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!X(e)){const c=p=>{l=!0;const[A,w]=no(p,t,!0);Ae(o,A),w&&a.push(...w)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!l)return ae(e)&&r.set(e,Ft),Ft;if(z(s))for(let c=0;c<s.length;c++){const p=Fe(s[c]);_r(p)&&(o[p]=fe)}else if(s)for(const c in s){const p=Fe(c);if(_r(p)){const A=s[c],w=o[p]=z(A)||X(A)?{type:A}:Ae({},A),V=w.type;let O=!1,J=!0;if(z(V))for(let W=0;W<V.length;++W){const H=V[W],Q=X(H)&&H.name;if(Q==="Boolean"){O=!0;break}else Q==="String"&&(J=!1)}else O=X(V)&&V.name==="Boolean";w[0]=O,w[1]=J,(O||oe(w,"default"))&&a.push(p)}}const f=[o,a];return ae(e)&&r.set(e,f),f}function _r(e){return e[0]!=="$"&&!nn(e)}const Ks=e=>e==="_"||e==="_ctx"||e==="$stable",zs=e=>z(e)?e.map(nt):[nt(e)],Xa=(e,t,n)=>{if(t._n)return t;const r=Vs((...i)=>zs(t(...i)),n);return r._c=!1,r},so=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Ks(i))continue;const s=e[i];if(X(s))t[i]=Xa(i,s,r);else if(s!=null){const o=zs(s);t[i]=()=>o}}},ro=(e,t)=>{const n=zs(t);e.slots.default=()=>n},io=(e,t,n)=>{for(const r in t)(n||!Ks(r))&&(e[r]=t[r])},Qa=(e,t,n)=>{const r=e.slots=Zi();if(e.vnode.shapeFlag&32){const i=t._;i?(io(r,t,n),n&&si(r,"_",i,!0)):so(t,r)}else t&&ro(e,t)},Za=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=fe;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:io(i,t,n):(s=!t.$stable,so(t,i)),o=t}else t&&(ro(e,t),o={default:1});if(s)for(const a in i)!Ks(a)&&o[a]==null&&delete i[a]},Ue=rl;function el(e){return tl(e)}function tl(e,t){const n=zn();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:f,setElementText:c,parentNode:p,nextSibling:A,setScopeId:w=st,insertStaticContent:V}=e,O=(d,m,k,I=null,T=null,M=null,N=void 0,B=null,P=!!m.dynamicChildren)=>{if(d===m)return;d&&!It(d,m)&&(I=Cn(d),j(d,T,M,!0),d=null),m.patchFlag===-2&&(P=!1,m.dynamicChildren=null);const{type:E,ref:q,shapeFlag:D}=m;switch(E){case Qn:J(d,m,k,I);break;case Le:W(d,m,k,I);break;case ds:d==null&&H(m,k,I,N);break;case ee:U(d,m,k,I,T,M,N,B,P);break;default:D&1?se(d,m,k,I,T,M,N,B,P):D&6?le(d,m,k,I,T,M,N,B,P):(D&64||D&128)&&E.process(d,m,k,I,T,M,N,B,P,Gt)}q!=null&&T?on(q,d&&d.ref,M,m||d,!m):q==null&&d&&d.ref!=null&&on(d.ref,null,M,d,!0)},J=(d,m,k,I)=>{if(d==null)r(m.el=a(m.children),k,I);else{const T=m.el=d.el;m.children!==d.children&&f(T,m.children)}},W=(d,m,k,I)=>{d==null?r(m.el=l(m.children||""),k,I):m.el=d.el},H=(d,m,k,I)=>{[d.el,d.anchor]=V(d.children,m,k,I,d.el,d.anchor)},Q=({el:d,anchor:m},k,I)=>{let T;for(;d&&d!==m;)T=A(d),r(d,k,I),d=T;r(m,k,I)},$=({el:d,anchor:m})=>{let k;for(;d&&d!==m;)k=A(d),i(d),d=k;i(m)},se=(d,m,k,I,T,M,N,B,P)=>{if(m.type==="svg"?N="svg":m.type==="math"&&(N="mathml"),d==null)ge(m,k,I,T,M,N,B,P);else{const E=d.el&&d.el._isVueCE?d.el:null;try{E&&E._beginPatch(),G(d,m,T,M,N,B,P)}finally{E&&E._endPatch()}}},ge=(d,m,k,I,T,M,N,B)=>{let P,E;const{props:q,shapeFlag:D,transition:K,dirs:Y}=d;if(P=d.el=o(d.type,M,q&&q.is,q),D&8?c(P,d.children):D&16&&ke(d.children,P,null,I,T,us(d,M),N,B),Y&&At(d,null,I,"created"),he(P,d,d.scopeId,N,I),q){for(const de in q)de!=="value"&&!nn(de)&&s(P,de,null,q[de],M,I);"value"in q&&s(P,"value",null,q.value,M),(E=q.onVnodeBeforeMount)&&Qe(E,I,d)}Y&&At(d,null,I,"beforeMount");const ie=nl(T,K);ie&&K.beforeEnter(P),r(P,m,k),((E=q&&q.onVnodeMounted)||ie||Y)&&Ue(()=>{try{E&&Qe(E,I,d),ie&&K.enter(P),Y&&At(d,null,I,"mounted")}finally{}},T)},he=(d,m,k,I,T)=>{if(k&&w(d,k),I)for(let M=0;M<I.length;M++)w(d,I[M]);if(T){let M=T.subTree;if(m===M||co(M.type)&&(M.ssContent===m||M.ssFallback===m)){const N=T.vnode;he(d,N,N.scopeId,N.slotScopeIds,T.parent)}}},ke=(d,m,k,I,T,M,N,B,P=0)=>{for(let E=P;E<d.length;E++){const q=d[E]=B?lt(d[E]):nt(d[E]);O(null,q,m,k,I,T,M,N,B)}},G=(d,m,k,I,T,M,N)=>{const B=m.el=d.el;let{patchFlag:P,dynamicChildren:E,dirs:q}=m;P|=d.patchFlag&16;const D=d.props||fe,K=m.props||fe;let Y;if(k&&xt(k,!1),(Y=K.onVnodeBeforeUpdate)&&Qe(Y,k,m,d),q&&At(m,d,k,"beforeUpdate"),k&&xt(k,!0),(D.innerHTML&&K.innerHTML==null||D.textContent&&K.textContent==null)&&c(B,""),E?ne(d.dynamicChildren,E,B,k,I,us(m,T),M):N||R(d,m,B,null,k,I,us(m,T),M,!1),P>0){if(P&16)ue(B,D,K,k,T);else if(P&2&&D.class!==K.class&&s(B,"class",null,K.class,T),P&4&&s(B,"style",D.style,K.style,T),P&8){const ie=m.dynamicProps;for(let de=0;de<ie.length;de++){const me=ie[de],Ce=D[me],Te=K[me];(Te!==Ce||me==="value")&&s(B,me,Ce,Te,T,k)}}P&1&&d.children!==m.children&&c(B,m.children)}else!N&&E==null&&ue(B,D,K,k,T);((Y=K.onVnodeUpdated)||q)&&Ue(()=>{Y&&Qe(Y,k,m,d),q&&At(m,d,k,"updated")},I)},ne=(d,m,k,I,T,M,N)=>{for(let B=0;B<m.length;B++){const P=d[B],E=m[B],q=P.el&&(P.type===ee||!It(P,E)||P.shapeFlag&198)?p(P.el):k;O(P,E,q,null,I,T,M,N,!0)}},ue=(d,m,k,I,T)=>{if(m!==k){if(m!==fe)for(const M in m)!nn(M)&&!(M in k)&&s(d,M,m[M],null,T,I);for(const M in k){if(nn(M))continue;const N=k[M],B=m[M];N!==B&&M!=="value"&&s(d,M,B,N,T,I)}"value"in k&&s(d,"value",m.value,k.value,T)}},U=(d,m,k,I,T,M,N,B,P)=>{const E=m.el=d?d.el:a(""),q=m.anchor=d?d.anchor:a("");let{patchFlag:D,dynamicChildren:K,slotScopeIds:Y}=m;Y&&(B=B?B.concat(Y):Y),d==null?(r(E,k,I),r(q,k,I),ke(m.children||[],k,q,T,M,N,B,P)):D>0&&D&64&&K&&d.dynamicChildren&&d.dynamicChildren.length===K.length?(ne(d.dynamicChildren,K,k,T,M,N,B),(m.key!=null||T&&m===T.subTree)&&oo(d,m,!0)):R(d,m,k,q,T,M,N,B,P)},le=(d,m,k,I,T,M,N,B,P)=>{m.slotScopeIds=B,d==null?m.shapeFlag&512?T.ctx.activate(m,k,I,N,P):y(m,k,I,T,M,N,P):v(d,m,P)},y=(d,m,k,I,T,M,N)=>{const B=d.component=ul(d,I,T);if(Yn(d)&&(B.ctx.renderer=Gt),dl(B,!1,N),B.asyncDep){if(T&&T.registerDep(B,b,N),!d.el){const P=B.subTree=ve(Le);W(null,P,m,k),d.placeholder=P.el}}else b(B,d,m,k,T,M,N)},v=(d,m,k)=>{const I=m.component=d.component;if(Wa(d,m,k))if(I.asyncDep&&!I.asyncResolved){S(I,m,k);return}else I.next=m,I.update();else m.el=d.el,I.vnode=m},b=(d,m,k,I,T,M,N)=>{const B=()=>{if(d.isMounted){let{next:D,bu:K,u:Y,parent:ie,vnode:de}=d;{const Je=ao(d);if(Je){D&&(D.el=de.el,S(d,D,N)),Je.asyncDep.then(()=>{Ue(()=>{d.isUnmounted||E()},T)});return}}let me=D,Ce;xt(d,!1),D?(D.el=de.el,S(d,D,N)):D=de,K&&Tn(K),(Ce=D.props&&D.props.onVnodeBeforeUpdate)&&Qe(Ce,ie,D,de),xt(d,!0);const Te=pr(d),Ye=d.subTree;d.subTree=Te,O(Ye,Te,p(Ye.el),Cn(Ye),d,T,M),D.el=Te.el,me===null&&qa(d,Te.el),Y&&Ue(Y,T),(Ce=D.props&&D.props.onVnodeUpdated)&&Ue(()=>Qe(Ce,ie,D,de),T)}else{let D;const{el:K,props:Y}=m,{bm:ie,m:de,parent:me,root:Ce,type:Te}=d,Ye=Ut(m);xt(d,!1),ie&&Tn(ie),!Ye&&(D=Y&&Y.onVnodeBeforeMount)&&Qe(D,me,m),xt(d,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Te,d.parent?d.parent.type:void 0);const Je=d.subTree=pr(d);O(null,Je,k,I,d,T,M),m.el=Je.el}if(de&&Ue(de,T),!Ye&&(D=Y&&Y.onVnodeMounted)){const Je=m;Ue(()=>Qe(D,me,Je),T)}(m.shapeFlag&256||me&&Ut(me.vnode)&&me.vnode.shapeFlag&256)&&d.a&&Ue(d.a,T),d.isMounted=!0,m=k=I=null}};d.scope.on();const P=d.effect=new ai(B);d.scope.off();const E=d.update=P.run.bind(P),q=d.job=P.runIfDirty.bind(P);q.i=d,q.id=d.uid,P.scheduler=()=>$s(q),xt(d,!0),E()},S=(d,m,k)=>{m.component=d;const I=d.vnode.props;d.vnode=m,d.next=null,Ya(d,m.props,I,k),Za(d,m.children,k),pt(),or(d),gt()},R=(d,m,k,I,T,M,N,B,P=!1)=>{const E=d&&d.children,q=d?d.shapeFlag:0,D=m.children,{patchFlag:K,shapeFlag:Y}=m;if(K>0){if(K&128){C(E,D,k,I,T,M,N,B,P);return}else if(K&256){g(E,D,k,I,T,M,N,B,P);return}}Y&8?(q&16&&He(E,T,M),D!==E&&c(k,D)):q&16?Y&16?C(E,D,k,I,T,M,N,B,P):He(E,T,M,!0):(q&8&&c(k,""),Y&16&&ke(D,k,I,T,M,N,B,P))},g=(d,m,k,I,T,M,N,B,P)=>{d=d||Ft,m=m||Ft;const E=d.length,q=m.length,D=Math.min(E,q);let K;for(K=0;K<D;K++){const Y=m[K]=P?lt(m[K]):nt(m[K]);O(d[K],Y,k,null,T,M,N,B,P)}E>q?He(d,T,M,!0,!1,D):ke(m,k,I,T,M,N,B,P,D)},C=(d,m,k,I,T,M,N,B,P)=>{let E=0;const q=m.length;let D=d.length-1,K=q-1;for(;E<=D&&E<=K;){const Y=d[E],ie=m[E]=P?lt(m[E]):nt(m[E]);if(It(Y,ie))O(Y,ie,k,null,T,M,N,B,P);else break;E++}for(;E<=D&&E<=K;){const Y=d[D],ie=m[K]=P?lt(m[K]):nt(m[K]);if(It(Y,ie))O(Y,ie,k,null,T,M,N,B,P);else break;D--,K--}if(E>D){if(E<=K){const Y=K+1,ie=Y<q?m[Y].el:I;for(;E<=K;)O(null,m[E]=P?lt(m[E]):nt(m[E]),k,ie,T,M,N,B,P),E++}}else if(E>K)for(;E<=D;)j(d[E],T,M,!0),E++;else{const Y=E,ie=E,de=new Map;for(E=ie;E<=K;E++){const $e=m[E]=P?lt(m[E]):nt(m[E]);$e.key!=null&&de.set($e.key,E)}let me,Ce=0;const Te=K-ie+1;let Ye=!1,Je=0;const Yt=new Array(Te);for(E=0;E<Te;E++)Yt[E]=0;for(E=Y;E<=D;E++){const $e=d[E];if(Ce>=Te){j($e,T,M,!0);continue}let Xe;if($e.key!=null)Xe=de.get($e.key);else for(me=ie;me<=K;me++)if(Yt[me-ie]===0&&It($e,m[me])){Xe=me;break}Xe===void 0?j($e,T,M,!0):(Yt[Xe-ie]=E+1,Xe>=Je?Je=Xe:Ye=!0,O($e,m[Xe],k,null,T,M,N,B,P),Ce++)}const Zs=Ye?sl(Yt):Ft;for(me=Zs.length-1,E=Te-1;E>=0;E--){const $e=ie+E,Xe=m[$e],er=m[$e+1],tr=$e+1<q?er.el||lo(er):I;Yt[E]===0?O(null,Xe,k,tr,T,M,N,B,P):Ye&&(me<0||E!==Zs[me]?x(Xe,k,tr,2):me--)}}},x=(d,m,k,I,T=null)=>{const{el:M,type:N,transition:B,children:P,shapeFlag:E}=d;if(E&6){x(d.component.subTree,m,k,I);return}if(E&128){d.suspense.move(m,k,I);return}if(E&64){N.move(d,m,k,Gt);return}if(N===ee){r(M,m,k);for(let D=0;D<P.length;D++)x(P[D],m,k,I);r(d.anchor,m,k);return}if(N===ds){Q(d,m,k);return}if(I!==2&&E&1&&B)if(I===0)B.beforeEnter(M),r(M,m,k),Ue(()=>B.enter(M),T);else{const{leave:D,delayLeave:K,afterLeave:Y}=B,ie=()=>{d.ctx.isUnmounted?i(M):r(M,m,k)},de=()=>{M._isLeaving&&M[et](!0),D(M,()=>{ie(),Y&&Y()})};K?K(M,ie,de):de()}else r(M,m,k)},j=(d,m,k,I=!1,T=!1)=>{const{type:M,props:N,ref:B,children:P,dynamicChildren:E,shapeFlag:q,patchFlag:D,dirs:K,cacheIndex:Y,memo:ie}=d;if(D===-2&&(T=!1),B!=null&&(pt(),on(B,null,k,d,!0),gt()),Y!=null&&(m.renderCache[Y]=void 0),q&256){m.ctx.deactivate(d);return}const de=q&1&&K,me=!Ut(d);let Ce;if(me&&(Ce=N&&N.onVnodeBeforeUnmount)&&Qe(Ce,m,d),q&6)je(d.component,k,I);else{if(q&128){d.suspense.unmount(k,I);return}de&&At(d,null,m,"beforeUnmount"),q&64?d.type.remove(d,m,k,Gt,I):E&&!E.hasOnce&&(M!==ee||D>0&&D&64)?He(E,m,k,!1,!0):(M===ee&&D&384||!T&&q&16)&&He(P,m,k),I&&te(d)}const Te=ie!=null&&Y==null;(me&&(Ce=N&&N.onVnodeUnmounted)||de||Te)&&Ue(()=>{Ce&&Qe(Ce,m,d),de&&At(d,null,m,"unmounted"),Te&&(d.el=null)},k)},te=d=>{const{type:m,el:k,anchor:I,transition:T}=d;if(m===ee){Z(k,I);return}if(m===ds){$(d);return}const M=()=>{i(k),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(d.shapeFlag&1&&T&&!T.persisted){const{leave:N,delayLeave:B}=T,P=()=>N(k,M);B?B(d.el,M,P):P()}else M()},Z=(d,m)=>{let k;for(;d!==m;)k=A(d),i(d),d=k;i(m)},je=(d,m,k)=>{const{bum:I,scope:T,job:M,subTree:N,um:B,m:P,a:E}=d;yr(P),yr(E),I&&Tn(I),T.stop(),M&&(M.flags|=8,j(N,d,m,k)),B&&Ue(B,m),Ue(()=>{d.isUnmounted=!0},m)},He=(d,m,k,I=!1,T=!1,M=0)=>{for(let N=M;N<d.length;N++)j(d[N],m,k,I,T)},Cn=d=>{if(d.shapeFlag&6)return Cn(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const m=A(d.anchor||d.el),k=m&&m[ya];return k?A(k):m};let ts=!1;const Qs=(d,m,k)=>{let I;d==null?m._vnode&&(j(m._vnode,null,null,!0),I=m._vnode.component):O(m._vnode||null,d,m,null,null,null,k),m._vnode=d,ts||(ts=!0,or(I),xi(),ts=!1)},Gt={p:O,um:j,m:x,r:te,mt:y,mc:ke,pc:R,pbc:ne,n:Cn,o:e};return{render:Qs,hydrate:void 0,createApp:Ua(Qs)}}function us({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 xt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function nl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oo(e,t,n=!1){const r=e.children,i=t.children;if(z(r)&&z(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=lt(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&oo(o,a)),a.type===Qn&&(a.patchFlag===-1&&(a=i[s]=lt(a)),a.el=o.el),a.type===Le&&!a.el&&(a.el=o.el)}}function sl(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const f=e[r];if(f!==0){if(i=n[n.length-1],e[i]<f){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<f?s=a+1:o=a;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function ao(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ao(t)}function yr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function lo(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?lo(t.subTree):null}const co=e=>e.__isSuspense;function rl(e,t){t&&t.pendingBranch?z(e)?t.effects.push(...e):t.effects.push(e):ha(e)}const ee=Symbol.for("v-fgt"),Qn=Symbol.for("v-txt"),Le=Symbol.for("v-cmt"),ds=Symbol.for("v-stc"),ln=[];let Ve=null;function h(e=!1){ln.push(Ve=e?null:[])}function il(){ln.pop(),Ve=ln[ln.length-1]||null}let hn=1;function Nn(e,t=!1){hn+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function uo(e){return e.dynamicChildren=hn>0?Ve||Ft:null,il(),hn>0&&Ve&&Ve.push(e),e}function _(e,t,n,r,i,s){return uo(u(e,t,n,r,i,s,!0))}function ye(e,t,n,r,i){return uo(ve(e,t,n,r,i,!0))}function mn(e){return e?e.__v_isVNode===!0:!1}function It(e,t){return e.type===t.type&&e.key===t.key}const fo=({key:e})=>e??null,En=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?be(e)||De(e)||X(e)?{i:Ee,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===ee?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fo(t),ref:t&&En(t),scopeId:Mi,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:i,dynamicChildren:null,appContext:null,ctx:Ee};return a?(Ws(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=be(n)?8:16),hn>0&&!o&&Ve&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Ve.push(l),l}const ve=ol;function ol(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Vi)&&(e=Le),mn(e)){const a=Ct(e,t,!0);return n&&Ws(a,n),hn>0&&!s&&Ve&&(a.shapeFlag&6?Ve[Ve.indexOf(e)]=a:Ve.push(a)),a.patchFlag=-2,a}if(gl(e)&&(e=e.__vccOpts),t){t=al(t);let{class:a,style:l}=t;a&&!be(a)&&(t.class=re(a)),ae(l)&&(Hs(l)&&!z(l)&&(l=Ae({},l)),t.style=Oe(l))}const o=be(e)?1:co(e)?128:Ii(e)?64:ae(e)?4:X(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function al(e){return e?Hs(e)||eo(e)?Ae({},e):e:null}function Ct(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,f=t?ho(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&fo(f),ref:t&&t.ref?n&&s?z(s)?s.concat(En(t)):[s,En(t)]:En(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!==ee?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ct(e.ssContent),ssFallback:e.ssFallback&&Ct(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&fn(c,l.clone(c)),c}function Zn(e=" ",t=0){return ve(Qn,null,e,t)}function F(e="",t=!1){return t?(h(),ye(Le,null,e)):ve(Le,null,e)}function nt(e){return e==null||typeof e=="boolean"?ve(Le):z(e)?ve(ee,null,e.slice()):mn(e)?lt(e):ve(Qn,null,String(e))}function lt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ct(e)}function Ws(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(z(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Ws(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!eo(t)?t._ctx=Ee:i===3&&Ee&&(Ee.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Ee},n=32):(t=String(t),r&64?(n=16,t=[Zn(t)]):n=8);e.children=t,e.shapeFlag|=n}function ho(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=re([t.class,r.class]));else if(i==="style")t.style=Oe([t.style,r.style]);else if(Un(i)){const s=t[i],o=r[i];o&&s!==o&&!(z(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!Hn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Qe(e,t,n,r=null){Ge(e,t,7,[n,r])}const ll=Yi();let cl=0;function ul(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||ll,s={uid:cl++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Do(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:no(r,i),emitsOptions:Ji(r,i),emit:null,emitted:null,propsDefaults:fe,inheritAttrs:r.inheritAttrs,ctx:fe,data:fe,props:fe,attrs:fe,slots:fe,refs:fe,setupState:fe,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=$a.bind(null,s),e.ce&&e.ce(s),s}let Pe=null;const mo=()=>Pe||Ee;let Fn,Es;{const e=zn(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};Fn=t("__VUE_INSTANCE_SETTERS__",n=>Pe=n),Es=t("__VUE_SSR_SETTERS__",n=>pn=n)}const kn=e=>{const t=Pe;return Fn(e),e.scope.on(),()=>{e.scope.off(),Fn(t)}},vr=()=>{Pe&&Pe.scope.off(),Fn(null)};function po(e){return e.vnode.shapeFlag&4}let pn=!1;function dl(e,t=!1,n=!1){t&&Es(t);const{props:r,children:i}=e.vnode,s=po(e);Ga(e,r,s,t),Qa(e,i,n||t);const o=s?fl(e,t):void 0;return t&&Es(!1),o}function fl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,La);const{setup:r}=n;if(r){pt();const i=e.setupContext=r.length>1?ml(e):null,s=kn(e),o=wn(r,e,0,[e.props,i]),a=ei(o);if(gt(),s(),(a||e.sp)&&!Ut(e)&&Fi(e),a){if(o.then(vr,vr),t)return o.then(l=>{br(e,l)}).catch(l=>{Gn(l,e,0)});e.asyncDep=o}else br(e,o)}else go(e)}function br(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=ki(t)),go(e)}function go(e,t,n){const r=e.type;e.render||(e.render=r.render||st);{const i=kn(e);pt();try{Pa(e)}finally{gt(),i()}}}const hl={get(e,t){return Re(e,"get",""),e[t]}};function ml(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,hl),slots:e.slots,emit:e.emit,expose:t}}function es(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ki(Cs(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in an)return an[n](e)},has(t,n){return n in t||n in an}})):e.proxy}function pl(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function gl(e){return X(e)&&"__vccOpts"in e}const _l=(e,t)=>la(e,t,pn);function _o(e,t,n){try{Nn(-1);const r=arguments.length;return r===2?ae(t)&&!z(t)?mn(t)?ve(e,null,[t]):ve(e,t):ve(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&mn(n)&&(n=[n]),ve(e,t,n))}finally{Nn(1)}}const yl="3.5.34";/**
13
+ **/function wn(e,t,n,r){try{return r?e(...r):e()}catch(i){Gn(i,t,n)}}function Ge(e,t,n,r){if(X(e)){const i=wn(e,t,n,r);return i&&ei(i)&&i.catch(s=>{Gn(s,t,n)}),i}if(z(e)){const i=[];for(let s=0;s<e.length;s++)i.push(Ge(e[s],t,n,r));return i}}function Gn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||fe;if(t){let a=t.parent;const l=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let p=0;p<c.length;p++)if(c[p](e,l,f)===!1)return}a=a.parent}if(s){pt(),wn(s,null,10,[e,l,f]),gt();return}}da(e,n,i,r,o)}function da(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Fe=[];let Ze=-1;const jt=[];let bt=null,Ft=0;const Ci=Promise.resolve();let Rn=null;function Si(e){const t=Rn||Ci;return e?t.then(this?e.bind(this):e):t}function fa(e){let t=Ze+1,n=Fe.length;for(;t<n;){const r=t+n>>>1,i=Fe[r],s=dn(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function $s(e){if(!(e.flags&1)){const t=dn(e),n=Fe[Fe.length-1];!n||!(e.flags&2)&&t>=dn(n)?Fe.push(e):Fe.splice(fa(t),0,e),e.flags|=1,Ai()}}function Ai(){Rn||(Rn=Ci.then(Ti))}function ha(e){z(e)?jt.push(...e):bt&&e.id===-1?bt.splice(Ft+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Ai()}function or(e,t,n=Ze+1){for(;n<Fe.length;n++){const r=Fe[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Fe.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function xi(e){if(jt.length){const t=[...new Set(jt)].sort((n,r)=>dn(n)-dn(r));if(jt.length=0,bt){bt.push(...t);return}for(bt=t,Ft=0;Ft<bt.length;Ft++){const n=bt[Ft];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}bt=null,Ft=0}}const dn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ti(e){try{for(Ze=0;Ze<Fe.length;Ze++){const t=Fe[Ze];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),wn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ze<Fe.length;Ze++){const t=Fe[Ze];t&&(t.flags&=-2)}Ze=-1,Fe.length=0,xi(),Rn=null,(Fe.length||jt.length)&&Ti()}}let Ee=null,Mi=null;function Ln(e){const t=Ee;return Ee=e,Mi=e&&e.type.__scopeId||null,t}function Vs(e,t=Ee,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Fn(-1);const s=Ln(t);let o;try{o=e(...i)}finally{Ln(s),r._d&&Fn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function at(e,t){if(Ee===null)return e;const n=es(Ee),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=fe]=t[i];s&&(X(s)&&(s={mounted:s,updated:s}),s.deep&&dt(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function At(e,t,n,r){const i=e.dirs,s=t&&t.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(pt(),Ge(l,n,8,[e.el,a,e,t]),gt())}}function ma(e,t){if(Pe){let n=Pe.provides;const r=Pe.parent&&Pe.parent.provides;r===n&&(n=Pe.provides=Object.create(r)),n[e]=t}}function Mn(e,t,n=!1){const r=mo();if(r||Ut){let i=Ut?Ut._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&X(t)?t.call(r&&r.proxy):t}}const pa=Symbol.for("v-scx"),ga=()=>Mn(pa);function as(e,t,n){return Ei(e,t,n)}function Ei(e,t,n=fe){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let f;if(pn){if(s==="sync"){const w=ga();f=w.__watcherHandles||(w.__watcherHandles=[])}else if(!l){const w=()=>{};return w.stop=st,w.resume=st,w.pause=st,w}}const c=Pe;a.call=(w,V,O)=>Ge(w,c,V,O);let p=!1;s==="post"?a.scheduler=w=>{He(w,c&&c.suspense)}:s!=="sync"&&(p=!0,a.scheduler=(w,V)=>{V?w():$s(w)}),a.augmentJob=w=>{t&&(w.flags|=4),p&&(w.flags|=2,c&&(w.id=c.uid,w.i=c))};const A=ua(e,t,a);return pn&&(f?f.push(A):l&&A()),A}function _a(e,t,n){const r=this.proxy,i=be(e)?e.includes(".")?Oi(r,e):()=>r[e]:e.bind(r,r);let s;X(t)?s=t:(s=t.handler,n=t);const o=kn(this),a=Ei(i,s.bind(r),n);return o(),a}function Oi(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}const ya=Symbol("_vte"),Ii=e=>e.__isTeleport,et=Symbol("_leaveCb"),Xt=Symbol("_enterCb");function va(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ji(()=>{e.isMounted=!0}),Hi(()=>{e.isUnmounting=!0}),e}const Ke=[Function,Array],Ri={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ke,onEnter:Ke,onAfterEnter:Ke,onEnterCancelled:Ke,onBeforeLeave:Ke,onLeave:Ke,onAfterLeave:Ke,onLeaveCancelled:Ke,onBeforeAppear:Ke,onAppear:Ke,onAfterAppear:Ke,onAppearCancelled:Ke},Li=e=>{const t=e.subTree;return t.component?Li(t.component):t},ba={name:"BaseTransition",props:Ri,setup(e,{slots:t}){const n=mo(),r=va();return()=>{const i=t.default&&Fi(t.default(),!0),s=i&&i.length?Pi(i):n.subTree?N():void 0;if(!s)return;const o=ce(e),{mode:a}=o;if(r.isLeaving)return ls(s);const l=ar(s);if(!l)return ls(s);let f=Ss(l,o,r,n,p=>f=p);l.type!==Le&&fn(l,f);let c=n.subTree&&ar(n.subTree);if(c&&c.type!==Le&&!It(c,l)&&Li(n).type!==Le){let p=Ss(c,o,r,n);if(fn(c,p),a==="out-in"&&l.type!==Le)return r.isLeaving=!0,p.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete p.afterLeave,c=void 0},ls(s);a==="in-out"&&l.type!==Le?p.delayLeave=(A,w,V)=>{const O=Bi(r,c);O[String(c.key)]=c,A[et]=()=>{w(),A[et]=void 0,delete f.delayedLeave,c=void 0},f.delayedLeave=()=>{V(),delete f.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Pi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Le){t=n;break}}return t}const wa=ba;function Bi(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 Ss(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:c,onEnterCancelled:p,onBeforeLeave:A,onLeave:w,onAfterLeave:V,onLeaveCancelled:O,onBeforeAppear:J,onAppear:W,onAfterAppear:U,onAppearCancelled:Q}=t,$=String(e.key),se=Bi(n,e),ge=(G,ne)=>{G&&Ge(G,r,9,ne)},he=(G,ne)=>{const ue=ne[1];ge(G,ne),z(G)?G.every(H=>H.length<=1)&&ue():G.length<=1&&ue()},ke={mode:o,persisted:a,beforeEnter(G){let ne=l;if(!n.isMounted)if(s)ne=J||l;else return;G[et]&&G[et](!0);const ue=se[$];ue&&It(e,ue)&&ue.el[et]&&ue.el[et](),ge(ne,[G])},enter(G){if(se[$]===e)return;let ne=f,ue=c,H=p;if(!n.isMounted)if(s)ne=W||f,ue=U||c,H=Q||p;else return;let le=!1;G[Xt]=v=>{le||(le=!0,v?ge(H,[G]):ge(ue,[G]),ke.delayedLeave&&ke.delayedLeave(),G[Xt]=void 0)};const y=G[Xt].bind(null,!1);ne?he(ne,[G,y]):y()},leave(G,ne){const ue=String(e.key);if(G[Xt]&&G[Xt](!0),n.isUnmounting)return ne();ge(A,[G]);let H=!1;G[et]=y=>{H||(H=!0,ne(),y?ge(O,[G]):ge(V,[G]),G[et]=void 0,se[ue]===e&&delete se[ue])};const le=G[et].bind(null,!1);se[ue]=e,w?he(w,[G,le]):le()},clone(G){const ne=Ss(G,t,n,r,i);return i&&i(ne),ne}};return ke}function ls(e){if(Yn(e))return e=Ct(e),e.children=null,e}function ar(e){if(!Yn(e))return Ii(e.type)&&e.children?Pi(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&&X(n.default))return n.default()}}function fn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,fn(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 Fi(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===ee?(o.patchFlag&128&&i++,r=r.concat(Fi(o.children,t,a))):(t||o.type!==Le)&&r.push(a!=null?Ct(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Ni(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function lr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Pn=new WeakMap;function on(e,t,n,r,i=!1){if(z(e)){e.forEach((O,J)=>on(O,t&&(z(t)?t[J]:t),n,r,i));return}if(Ht(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&on(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?es(r.component):r.el,o=i?null:s,{i:a,r:l}=e,f=t&&t.r,c=a.refs===fe?a.refs={}:a.refs,p=a.setupState,A=ce(p),w=p===fe?Zr:O=>lr(c,O)?!1:oe(A,O),V=(O,J)=>!(J&&lr(c,J));if(f!=null&&f!==l){if(cr(t),be(f))c[f]=null,w(f)&&(p[f]=null);else if(De(f)){const O=t;V(f,O.k)&&(f.value=null),O.k&&(c[O.k]=null)}}if(X(l))wn(l,a,12,[o,c]);else{const O=be(l),J=De(l);if(O||J){const W=()=>{if(e.f){const U=O?w(l)?p[l]:c[l]:V()||!e.k?l.value:c[e.k];if(i)z(U)&&Ls(U,s);else if(z(U))U.includes(s)||U.push(s);else if(O)c[l]=[s],w(l)&&(p[l]=c[l]);else{const Q=[s];V(l,e.k)&&(l.value=Q),e.k&&(c[e.k]=Q)}}else O?(c[l]=o,w(l)&&(p[l]=o)):J&&(V(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const U=()=>{W(),Pn.delete(e)};U.id=-1,Pn.set(e,U),He(U,n)}else cr(e),W()}}}function cr(e){const t=Pn.get(e);t&&(t.flags|=8,Pn.delete(e))}zn().requestIdleCallback;zn().cancelIdleCallback;const Ht=e=>!!e.type.__asyncLoader,Yn=e=>e.type.__isKeepAlive;function ka(e,t){Di(e,"a",t)}function Ca(e,t){Di(e,"da",t)}function Di(e,t,n=Pe){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Jn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)Yn(i.parent.vnode)&&Sa(r,t,n,i),i=i.parent}}function Sa(e,t,n,r){const i=Jn(t,e,r,!0);Ui(()=>{Ls(r[t],i)},n)}function Jn(e,t,n=Pe,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{pt();const a=kn(n),l=Ge(t,n,e,o);return a(),gt(),l});return r?i.unshift(s):i.push(s),s}}const yt=e=>(t,n=Pe)=>{(!pn||e==="sp")&&Jn(e,(...r)=>t(...r),n)},Aa=yt("bm"),ji=yt("m"),xa=yt("bu"),Ta=yt("u"),Hi=yt("bum"),Ui=yt("um"),Ma=yt("sp"),Ea=yt("rtg"),Oa=yt("rtc");function Ia(e,t=Pe){Jn("ec",e,t)}const $i="components";function _e(e,t){return zi($i,e,!0,t)||e}const Vi=Symbol.for("v-ndc");function Ki(e){return be(e)?zi($i,e,!1)||e:e||Vi}function zi(e,t,n=!0,r=!1){const i=Ee||Pe;if(i){const s=i.type;{const a=pl(s,!1);if(a&&(a===t||a===Ne(t)||a===Vn(Ne(t))))return s}const o=ur(i[e]||s[e],t)||ur(i.appContext[e],t);return!o&&r?s:o}}function ur(e,t){return e&&(e[t]||e[Ne(t)]||e[Vn(Ne(t))])}function Se(e,t,n,r){let i;const s=n,o=z(e);if(o||be(e)){const a=o&&Pt(e);let l=!1,f=!1;a&&(l=!We(e),f=kt(e),e=Wn(e)),i=new Array(e.length);for(let c=0,p=e.length;c<p;c++)i[c]=t(l?f?$t(_t(e[c])):_t(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,s)}else if(ae(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,f=a.length;l<f;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Ra(e,t,n={},r,i){if(Ee.ce||Ee.parent&&Ht(Ee.parent)&&Ee.parent.ce){const f=Object.keys(n).length>0;return h(),ye(ee,null,[ve("slot",n,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),h();const o=s&&Wi(s(n)),a=n.key||o&&o.key,l=ye(ee,{key:(a&&!qe(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function Wi(e){return e.some(t=>mn(t)?!(t.type===Le||t.type===ee&&!Wi(t.children)):!0)?e:null}const As=e=>e?po(e)?es(e):As(e.parent):null,an=Ae(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=>As(e.parent),$root:e=>As(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gi(e),$forceUpdate:e=>e.f||(e.f=()=>{$s(e.update)}),$nextTick:e=>e.n||(e.n=Si.bind(e.proxy)),$watch:e=>_a.bind(e)}),cs=(e,t)=>e!==fe&&!e.__isScriptSetup&&oe(e,t),La={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const A=o[t];if(A!==void 0)switch(A){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(cs(r,t))return o[t]=1,r[t];if(i!==fe&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==fe&&oe(n,t))return o[t]=4,n[t];xs&&(o[t]=0)}}const f=an[t];let c,p;if(f)return t==="$attrs"&&Re(e.attrs,"get",""),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==fe&&oe(n,t))return o[t]=4,n[t];if(p=l.config.globalProperties,oe(p,t))return p[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return cs(i,t)?(i[t]=n,!0):r!==fe&&oe(r,t)?(r[t]=n,!0):oe(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:i,props:s,type:o}},a){let l;return!!(n[a]||e!==fe&&a[0]!=="$"&&oe(e,a)||cs(t,a)||oe(s,a)||oe(r,a)||oe(an,a)||oe(i.config.globalProperties,a)||(l=o.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:oe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function dr(e){return z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xs=!0;function Pa(e){const t=Gi(e),n=e.proxy,r=e.ctx;xs=!1,t.beforeCreate&&fr(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:f,created:c,beforeMount:p,mounted:A,beforeUpdate:w,updated:V,activated:O,deactivated:J,beforeDestroy:W,beforeUnmount:U,destroyed:Q,unmounted:$,render:se,renderTracked:ge,renderTriggered:he,errorCaptured:ke,serverPrefetch:G,expose:ne,inheritAttrs:ue,components:H,directives:le,filters:y}=t;if(f&&Ba(f,r,null),o)for(const S in o){const R=o[S];X(R)&&(r[S]=R.bind(n))}if(i){const S=i.call(n,n);ae(S)&&(e.data=qn(S))}if(xs=!0,s)for(const S in s){const R=s[S],g=X(R)?R.bind(n,n):X(R.get)?R.get.bind(n,n):st,C=!X(R)&&X(R.set)?R.set.bind(n):st,x=_l({get:g,set:C});Object.defineProperty(r,S,{enumerable:!0,configurable:!0,get:()=>x.value,set:j=>x.value=j})}if(a)for(const S in a)qi(a[S],r,n,S);if(l){const S=X(l)?l.call(n):l;Reflect.ownKeys(S).forEach(R=>{ma(R,S[R])})}c&&fr(c,e,"c");function b(S,R){z(R)?R.forEach(g=>S(g.bind(n))):R&&S(R.bind(n))}if(b(Aa,p),b(ji,A),b(xa,w),b(Ta,V),b(ka,O),b(Ca,J),b(Ia,ke),b(Oa,ge),b(Ea,he),b(Hi,U),b(Ui,$),b(Ma,G),z(ne))if(ne.length){const S=e.exposed||(e.exposed={});ne.forEach(R=>{Object.defineProperty(S,R,{get:()=>n[R],set:g=>n[R]=g,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===st&&(e.render=se),ue!=null&&(e.inheritAttrs=ue),H&&(e.components=H),le&&(e.directives=le),G&&Ni(e)}function Ba(e,t,n=st){z(e)&&(e=Ts(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=Mn(i.from||r,i.default,!0):s=Mn(i.from||r):s=Mn(i),De(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function fr(e,t,n){Ge(z(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function qi(e,t,n,r){let i=r.includes(".")?Oi(n,r):()=>n[r];if(be(e)){const s=t[e];X(s)&&as(i,s)}else if(X(e))as(i,e.bind(n));else if(ae(e))if(z(e))e.forEach(s=>qi(s,t,n,r));else{const s=X(e.handler)?e.handler.bind(n):t[e.handler];X(s)&&as(i,s,e)}}function Gi(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(f=>Bn(l,f,o,!0)),Bn(l,t,o)),ae(t)&&s.set(t,l),l}function Bn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Bn(e,s,n,!0),i&&i.forEach(o=>Bn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Fa[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Fa={data:hr,props:mr,emits:mr,methods:Zt,computed:Zt,beforeCreate:Be,created:Be,beforeMount:Be,mounted:Be,beforeUpdate:Be,updated:Be,beforeDestroy:Be,beforeUnmount:Be,destroyed:Be,unmounted:Be,activated:Be,deactivated:Be,errorCaptured:Be,serverPrefetch:Be,components:Zt,directives:Zt,watch:Da,provide:hr,inject:Na};function hr(e,t){return t?e?function(){return Ae(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Na(e,t){return Zt(Ts(e),Ts(t))}function Ts(e){if(z(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Be(e,t){return e?[...new Set([].concat(e,t))]:t}function Zt(e,t){return e?Ae(Object.create(null),e,t):t}function mr(e,t){return e?z(e)&&z(t)?[...new Set([...e,...t])]:Ae(Object.create(null),dr(e),dr(t??{})):t}function Da(e,t){if(!e)return t;if(!t)return e;const n=Ae(Object.create(null),e);for(const r in t)n[r]=Be(e[r],t[r]);return n}function Yi(){return{app:null,config:{isNativeTag:Zr,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 ja=0;function Ha(e,t){return function(r,i=null){X(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=Yi(),o=new WeakSet,a=[];let l=!1;const f=s.app={_uid:ja++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:yl,get config(){return s.config},set config(c){},use(c,...p){return o.has(c)||(c&&X(c.install)?(o.add(c),c.install(f,...p)):X(c)&&(o.add(c),c(f,...p))),f},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),f},component(c,p){return p?(s.components[c]=p,f):s.components[c]},directive(c,p){return p?(s.directives[c]=p,f):s.directives[c]},mount(c,p,A){if(!l){const w=f._ceVNode||ve(r,i);return w.appContext=s,A===!0?A="svg":A===!1&&(A=void 0),e(w,c,A),l=!0,f._container=c,c.__vue_app__=f,es(w.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Ge(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(c,p){return s.provides[c]=p,f},runWithContext(c){const p=Ut;Ut=f;try{return c()}finally{Ut=p}}};return f}}let Ut=null;const Ua=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ne(t)}Modifiers`]||e[`${St(t)}Modifiers`];function $a(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||fe;let i=n;const s=t.startsWith("update:"),o=s&&Ua(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>be(c)?c.trim():c)),o.number&&(i=n.map(Kn)));let a,l=r[a=ns(t)]||r[a=ns(Ne(t))];!l&&s&&(l=r[a=ns(St(t))]),l&&Ge(l,e,6,i);const f=r[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Ge(f,e,6,i)}}const Va=new WeakMap;function Ji(e,t,n=!1){const r=n?Va:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!X(e)){const l=f=>{const c=Ji(f,t,!0);c&&(a=!0,Ae(o,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(ae(e)&&r.set(e,null),null):(z(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function Xn(e,t){return!e||!Hn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,St(t))||oe(e,t))}function pr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:f,renderCache:c,props:p,data:A,setupState:w,ctx:V,inheritAttrs:O}=e,J=Ln(e);let W,U;try{if(n.shapeFlag&4){const $=i||r,se=$;W=nt(f.call(se,$,c,p,w,A,V)),U=a}else{const $=t;W=nt($.length>1?$(p,{attrs:a,slots:o,emit:l}):$(p,null)),U=t.props?a:Ka(a)}}catch($){ln.length=0,Gn($,e,1),W=ve(Le)}let Q=W;if(U&&O!==!1){const $=Object.keys(U),{shapeFlag:se}=Q;$.length&&se&7&&(s&&$.some(Un)&&(U=za(U,s)),Q=Ct(Q,U,!1,!0))}return n.dirs&&(Q=Ct(Q,null,!1,!0),Q.dirs=Q.dirs?Q.dirs.concat(n.dirs):n.dirs),n.transition&&fn(Q,n.transition),W=Q,Ln(J),W}const Ka=e=>{let t;for(const n in e)(n==="class"||n==="style"||Hn(n))&&((t||(t={}))[n]=e[n]);return t},za=(e,t)=>{const n={};for(const r in e)(!Un(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Wa(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?gr(r,o,f):!!o;if(l&8){const c=t.dynamicProps;for(let p=0;p<c.length;p++){const A=c[p];if(Xi(o,r,A)&&!Xn(f,A))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?gr(r,o,f):!0:!!o;return!1}function gr(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(Xi(t,e,s)&&!Xn(n,s))return!0}return!1}function Xi(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!Wt(r,i):r!==i}function qa({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Qi={},Zi=()=>Object.create(Qi),eo=e=>Object.getPrototypeOf(e)===Qi;function Ga(e,t,n,r=!1){const i={},s=Zi();e.propsDefaults=Object.create(null),to(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:ra(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Ya(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=ce(i),[l]=e.propsOptions;let f=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let p=0;p<c.length;p++){let A=c[p];if(Xn(e.emitsOptions,A))continue;const w=t[A];if(l)if(oe(s,A))w!==s[A]&&(s[A]=w,f=!0);else{const V=Ne(A);i[V]=Ms(l,a,V,w,e,!1)}else w!==s[A]&&(s[A]=w,f=!0)}}}else{to(e,t,i,s)&&(f=!0);let c;for(const p in a)(!t||!oe(t,p)&&((c=St(p))===p||!oe(t,c)))&&(l?n&&(n[p]!==void 0||n[c]!==void 0)&&(i[p]=Ms(l,a,p,void 0,e,!0)):delete i[p]);if(s!==a)for(const p in s)(!t||!oe(t,p))&&(delete s[p],f=!0)}f&&ut(e.attrs,"set","")}function to(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(nn(l))continue;const f=t[l];let c;i&&oe(i,c=Ne(l))?!s||!s.includes(c)?n[c]=f:(a||(a={}))[c]=f:Xn(e.emitsOptions,l)||(!(l in r)||f!==r[l])&&(r[l]=f,o=!0)}if(s){const l=ce(n),f=a||fe;for(let c=0;c<s.length;c++){const p=s[c];n[p]=Ms(i,l,p,f[p],e,!oe(f,p))}}return o}function Ms(e,t,n,r,i,s){const o=e[n];if(o!=null){const a=oe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&X(l)){const{propsDefaults:f}=i;if(n in f)r=f[n];else{const c=kn(i);r=f[n]=l.call(null,t),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===St(n))&&(r=!0))}return r}const Ja=new WeakMap;function no(e,t,n=!1){const r=n?Ja:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!X(e)){const c=p=>{l=!0;const[A,w]=no(p,t,!0);Ae(o,A),w&&a.push(...w)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!l)return ae(e)&&r.set(e,Nt),Nt;if(z(s))for(let c=0;c<s.length;c++){const p=Ne(s[c]);_r(p)&&(o[p]=fe)}else if(s)for(const c in s){const p=Ne(c);if(_r(p)){const A=s[c],w=o[p]=z(A)||X(A)?{type:A}:Ae({},A),V=w.type;let O=!1,J=!0;if(z(V))for(let W=0;W<V.length;++W){const U=V[W],Q=X(U)&&U.name;if(Q==="Boolean"){O=!0;break}else Q==="String"&&(J=!1)}else O=X(V)&&V.name==="Boolean";w[0]=O,w[1]=J,(O||oe(w,"default"))&&a.push(p)}}const f=[o,a];return ae(e)&&r.set(e,f),f}function _r(e){return e[0]!=="$"&&!nn(e)}const Ks=e=>e==="_"||e==="_ctx"||e==="$stable",zs=e=>z(e)?e.map(nt):[nt(e)],Xa=(e,t,n)=>{if(t._n)return t;const r=Vs((...i)=>zs(t(...i)),n);return r._c=!1,r},so=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Ks(i))continue;const s=e[i];if(X(s))t[i]=Xa(i,s,r);else if(s!=null){const o=zs(s);t[i]=()=>o}}},ro=(e,t)=>{const n=zs(t);e.slots.default=()=>n},io=(e,t,n)=>{for(const r in t)(n||!Ks(r))&&(e[r]=t[r])},Qa=(e,t,n)=>{const r=e.slots=Zi();if(e.vnode.shapeFlag&32){const i=t._;i?(io(r,t,n),n&&si(r,"_",i,!0)):so(t,r)}else t&&ro(e,t)},Za=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=fe;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:io(i,t,n):(s=!t.$stable,so(t,i)),o=t}else t&&(ro(e,t),o={default:1});if(s)for(const a in i)!Ks(a)&&o[a]==null&&delete i[a]},He=rl;function el(e){return tl(e)}function tl(e,t){const n=zn();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:f,setElementText:c,parentNode:p,nextSibling:A,setScopeId:w=st,insertStaticContent:V}=e,O=(d,m,k,I=null,T=null,M=null,F=void 0,B=null,P=!!m.dynamicChildren)=>{if(d===m)return;d&&!It(d,m)&&(I=Cn(d),j(d,T,M,!0),d=null),m.patchFlag===-2&&(P=!1,m.dynamicChildren=null);const{type:E,ref:q,shapeFlag:D}=m;switch(E){case Qn:J(d,m,k,I);break;case Le:W(d,m,k,I);break;case ds:d==null&&U(m,k,I,F);break;case ee:H(d,m,k,I,T,M,F,B,P);break;default:D&1?se(d,m,k,I,T,M,F,B,P):D&6?le(d,m,k,I,T,M,F,B,P):(D&64||D&128)&&E.process(d,m,k,I,T,M,F,B,P,Gt)}q!=null&&T?on(q,d&&d.ref,M,m||d,!m):q==null&&d&&d.ref!=null&&on(d.ref,null,M,d,!0)},J=(d,m,k,I)=>{if(d==null)r(m.el=a(m.children),k,I);else{const T=m.el=d.el;m.children!==d.children&&f(T,m.children)}},W=(d,m,k,I)=>{d==null?r(m.el=l(m.children||""),k,I):m.el=d.el},U=(d,m,k,I)=>{[d.el,d.anchor]=V(d.children,m,k,I,d.el,d.anchor)},Q=({el:d,anchor:m},k,I)=>{let T;for(;d&&d!==m;)T=A(d),r(d,k,I),d=T;r(m,k,I)},$=({el:d,anchor:m})=>{let k;for(;d&&d!==m;)k=A(d),i(d),d=k;i(m)},se=(d,m,k,I,T,M,F,B,P)=>{if(m.type==="svg"?F="svg":m.type==="math"&&(F="mathml"),d==null)ge(m,k,I,T,M,F,B,P);else{const E=d.el&&d.el._isVueCE?d.el:null;try{E&&E._beginPatch(),G(d,m,T,M,F,B,P)}finally{E&&E._endPatch()}}},ge=(d,m,k,I,T,M,F,B)=>{let P,E;const{props:q,shapeFlag:D,transition:K,dirs:Y}=d;if(P=d.el=o(d.type,M,q&&q.is,q),D&8?c(P,d.children):D&16&&ke(d.children,P,null,I,T,us(d,M),F,B),Y&&At(d,null,I,"created"),he(P,d,d.scopeId,F,I),q){for(const de in q)de!=="value"&&!nn(de)&&s(P,de,null,q[de],M,I);"value"in q&&s(P,"value",null,q.value,M),(E=q.onVnodeBeforeMount)&&Qe(E,I,d)}Y&&At(d,null,I,"beforeMount");const re=nl(T,K);re&&K.beforeEnter(P),r(P,m,k),((E=q&&q.onVnodeMounted)||re||Y)&&He(()=>{try{E&&Qe(E,I,d),re&&K.enter(P),Y&&At(d,null,I,"mounted")}finally{}},T)},he=(d,m,k,I,T)=>{if(k&&w(d,k),I)for(let M=0;M<I.length;M++)w(d,I[M]);if(T){let M=T.subTree;if(m===M||co(M.type)&&(M.ssContent===m||M.ssFallback===m)){const F=T.vnode;he(d,F,F.scopeId,F.slotScopeIds,T.parent)}}},ke=(d,m,k,I,T,M,F,B,P=0)=>{for(let E=P;E<d.length;E++){const q=d[E]=B?lt(d[E]):nt(d[E]);O(null,q,m,k,I,T,M,F,B)}},G=(d,m,k,I,T,M,F)=>{const B=m.el=d.el;let{patchFlag:P,dynamicChildren:E,dirs:q}=m;P|=d.patchFlag&16;const D=d.props||fe,K=m.props||fe;let Y;if(k&&xt(k,!1),(Y=K.onVnodeBeforeUpdate)&&Qe(Y,k,m,d),q&&At(m,d,k,"beforeUpdate"),k&&xt(k,!0),(D.innerHTML&&K.innerHTML==null||D.textContent&&K.textContent==null)&&c(B,""),E?ne(d.dynamicChildren,E,B,k,I,us(m,T),M):F||R(d,m,B,null,k,I,us(m,T),M,!1),P>0){if(P&16)ue(B,D,K,k,T);else if(P&2&&D.class!==K.class&&s(B,"class",null,K.class,T),P&4&&s(B,"style",D.style,K.style,T),P&8){const re=m.dynamicProps;for(let de=0;de<re.length;de++){const me=re[de],Ce=D[me],Te=K[me];(Te!==Ce||me==="value")&&s(B,me,Ce,Te,T,k)}}P&1&&d.children!==m.children&&c(B,m.children)}else!F&&E==null&&ue(B,D,K,k,T);((Y=K.onVnodeUpdated)||q)&&He(()=>{Y&&Qe(Y,k,m,d),q&&At(m,d,k,"updated")},I)},ne=(d,m,k,I,T,M,F)=>{for(let B=0;B<m.length;B++){const P=d[B],E=m[B],q=P.el&&(P.type===ee||!It(P,E)||P.shapeFlag&198)?p(P.el):k;O(P,E,q,null,I,T,M,F,!0)}},ue=(d,m,k,I,T)=>{if(m!==k){if(m!==fe)for(const M in m)!nn(M)&&!(M in k)&&s(d,M,m[M],null,T,I);for(const M in k){if(nn(M))continue;const F=k[M],B=m[M];F!==B&&M!=="value"&&s(d,M,B,F,T,I)}"value"in k&&s(d,"value",m.value,k.value,T)}},H=(d,m,k,I,T,M,F,B,P)=>{const E=m.el=d?d.el:a(""),q=m.anchor=d?d.anchor:a("");let{patchFlag:D,dynamicChildren:K,slotScopeIds:Y}=m;Y&&(B=B?B.concat(Y):Y),d==null?(r(E,k,I),r(q,k,I),ke(m.children||[],k,q,T,M,F,B,P)):D>0&&D&64&&K&&d.dynamicChildren&&d.dynamicChildren.length===K.length?(ne(d.dynamicChildren,K,k,T,M,F,B),(m.key!=null||T&&m===T.subTree)&&oo(d,m,!0)):R(d,m,k,q,T,M,F,B,P)},le=(d,m,k,I,T,M,F,B,P)=>{m.slotScopeIds=B,d==null?m.shapeFlag&512?T.ctx.activate(m,k,I,F,P):y(m,k,I,T,M,F,P):v(d,m,P)},y=(d,m,k,I,T,M,F)=>{const B=d.component=ul(d,I,T);if(Yn(d)&&(B.ctx.renderer=Gt),dl(B,!1,F),B.asyncDep){if(T&&T.registerDep(B,b,F),!d.el){const P=B.subTree=ve(Le);W(null,P,m,k),d.placeholder=P.el}}else b(B,d,m,k,T,M,F)},v=(d,m,k)=>{const I=m.component=d.component;if(Wa(d,m,k))if(I.asyncDep&&!I.asyncResolved){S(I,m,k);return}else I.next=m,I.update();else m.el=d.el,I.vnode=m},b=(d,m,k,I,T,M,F)=>{const B=()=>{if(d.isMounted){let{next:D,bu:K,u:Y,parent:re,vnode:de}=d;{const Je=ao(d);if(Je){D&&(D.el=de.el,S(d,D,F)),Je.asyncDep.then(()=>{He(()=>{d.isUnmounted||E()},T)});return}}let me=D,Ce;xt(d,!1),D?(D.el=de.el,S(d,D,F)):D=de,K&&Tn(K),(Ce=D.props&&D.props.onVnodeBeforeUpdate)&&Qe(Ce,re,D,de),xt(d,!0);const Te=pr(d),Ye=d.subTree;d.subTree=Te,O(Ye,Te,p(Ye.el),Cn(Ye),d,T,M),D.el=Te.el,me===null&&qa(d,Te.el),Y&&He(Y,T),(Ce=D.props&&D.props.onVnodeUpdated)&&He(()=>Qe(Ce,re,D,de),T)}else{let D;const{el:K,props:Y}=m,{bm:re,m:de,parent:me,root:Ce,type:Te}=d,Ye=Ht(m);xt(d,!1),re&&Tn(re),!Ye&&(D=Y&&Y.onVnodeBeforeMount)&&Qe(D,me,m),xt(d,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Te,d.parent?d.parent.type:void 0);const Je=d.subTree=pr(d);O(null,Je,k,I,d,T,M),m.el=Je.el}if(de&&He(de,T),!Ye&&(D=Y&&Y.onVnodeMounted)){const Je=m;He(()=>Qe(D,me,Je),T)}(m.shapeFlag&256||me&&Ht(me.vnode)&&me.vnode.shapeFlag&256)&&d.a&&He(d.a,T),d.isMounted=!0,m=k=I=null}};d.scope.on();const P=d.effect=new ai(B);d.scope.off();const E=d.update=P.run.bind(P),q=d.job=P.runIfDirty.bind(P);q.i=d,q.id=d.uid,P.scheduler=()=>$s(q),xt(d,!0),E()},S=(d,m,k)=>{m.component=d;const I=d.vnode.props;d.vnode=m,d.next=null,Ya(d,m.props,I,k),Za(d,m.children,k),pt(),or(d),gt()},R=(d,m,k,I,T,M,F,B,P=!1)=>{const E=d&&d.children,q=d?d.shapeFlag:0,D=m.children,{patchFlag:K,shapeFlag:Y}=m;if(K>0){if(K&128){C(E,D,k,I,T,M,F,B,P);return}else if(K&256){g(E,D,k,I,T,M,F,B,P);return}}Y&8?(q&16&&Ue(E,T,M),D!==E&&c(k,D)):q&16?Y&16?C(E,D,k,I,T,M,F,B,P):Ue(E,T,M,!0):(q&8&&c(k,""),Y&16&&ke(D,k,I,T,M,F,B,P))},g=(d,m,k,I,T,M,F,B,P)=>{d=d||Nt,m=m||Nt;const E=d.length,q=m.length,D=Math.min(E,q);let K;for(K=0;K<D;K++){const Y=m[K]=P?lt(m[K]):nt(m[K]);O(d[K],Y,k,null,T,M,F,B,P)}E>q?Ue(d,T,M,!0,!1,D):ke(m,k,I,T,M,F,B,P,D)},C=(d,m,k,I,T,M,F,B,P)=>{let E=0;const q=m.length;let D=d.length-1,K=q-1;for(;E<=D&&E<=K;){const Y=d[E],re=m[E]=P?lt(m[E]):nt(m[E]);if(It(Y,re))O(Y,re,k,null,T,M,F,B,P);else break;E++}for(;E<=D&&E<=K;){const Y=d[D],re=m[K]=P?lt(m[K]):nt(m[K]);if(It(Y,re))O(Y,re,k,null,T,M,F,B,P);else break;D--,K--}if(E>D){if(E<=K){const Y=K+1,re=Y<q?m[Y].el:I;for(;E<=K;)O(null,m[E]=P?lt(m[E]):nt(m[E]),k,re,T,M,F,B,P),E++}}else if(E>K)for(;E<=D;)j(d[E],T,M,!0),E++;else{const Y=E,re=E,de=new Map;for(E=re;E<=K;E++){const $e=m[E]=P?lt(m[E]):nt(m[E]);$e.key!=null&&de.set($e.key,E)}let me,Ce=0;const Te=K-re+1;let Ye=!1,Je=0;const Yt=new Array(Te);for(E=0;E<Te;E++)Yt[E]=0;for(E=Y;E<=D;E++){const $e=d[E];if(Ce>=Te){j($e,T,M,!0);continue}let Xe;if($e.key!=null)Xe=de.get($e.key);else for(me=re;me<=K;me++)if(Yt[me-re]===0&&It($e,m[me])){Xe=me;break}Xe===void 0?j($e,T,M,!0):(Yt[Xe-re]=E+1,Xe>=Je?Je=Xe:Ye=!0,O($e,m[Xe],k,null,T,M,F,B,P),Ce++)}const Zs=Ye?sl(Yt):Nt;for(me=Zs.length-1,E=Te-1;E>=0;E--){const $e=re+E,Xe=m[$e],er=m[$e+1],tr=$e+1<q?er.el||lo(er):I;Yt[E]===0?O(null,Xe,k,tr,T,M,F,B,P):Ye&&(me<0||E!==Zs[me]?x(Xe,k,tr,2):me--)}}},x=(d,m,k,I,T=null)=>{const{el:M,type:F,transition:B,children:P,shapeFlag:E}=d;if(E&6){x(d.component.subTree,m,k,I);return}if(E&128){d.suspense.move(m,k,I);return}if(E&64){F.move(d,m,k,Gt);return}if(F===ee){r(M,m,k);for(let D=0;D<P.length;D++)x(P[D],m,k,I);r(d.anchor,m,k);return}if(F===ds){Q(d,m,k);return}if(I!==2&&E&1&&B)if(I===0)B.beforeEnter(M),r(M,m,k),He(()=>B.enter(M),T);else{const{leave:D,delayLeave:K,afterLeave:Y}=B,re=()=>{d.ctx.isUnmounted?i(M):r(M,m,k)},de=()=>{M._isLeaving&&M[et](!0),D(M,()=>{re(),Y&&Y()})};K?K(M,re,de):de()}else r(M,m,k)},j=(d,m,k,I=!1,T=!1)=>{const{type:M,props:F,ref:B,children:P,dynamicChildren:E,shapeFlag:q,patchFlag:D,dirs:K,cacheIndex:Y,memo:re}=d;if(D===-2&&(T=!1),B!=null&&(pt(),on(B,null,k,d,!0),gt()),Y!=null&&(m.renderCache[Y]=void 0),q&256){m.ctx.deactivate(d);return}const de=q&1&&K,me=!Ht(d);let Ce;if(me&&(Ce=F&&F.onVnodeBeforeUnmount)&&Qe(Ce,m,d),q&6)je(d.component,k,I);else{if(q&128){d.suspense.unmount(k,I);return}de&&At(d,null,m,"beforeUnmount"),q&64?d.type.remove(d,m,k,Gt,I):E&&!E.hasOnce&&(M!==ee||D>0&&D&64)?Ue(E,m,k,!1,!0):(M===ee&&D&384||!T&&q&16)&&Ue(P,m,k),I&&te(d)}const Te=re!=null&&Y==null;(me&&(Ce=F&&F.onVnodeUnmounted)||de||Te)&&He(()=>{Ce&&Qe(Ce,m,d),de&&At(d,null,m,"unmounted"),Te&&(d.el=null)},k)},te=d=>{const{type:m,el:k,anchor:I,transition:T}=d;if(m===ee){Z(k,I);return}if(m===ds){$(d);return}const M=()=>{i(k),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(d.shapeFlag&1&&T&&!T.persisted){const{leave:F,delayLeave:B}=T,P=()=>F(k,M);B?B(d.el,M,P):P()}else M()},Z=(d,m)=>{let k;for(;d!==m;)k=A(d),i(d),d=k;i(m)},je=(d,m,k)=>{const{bum:I,scope:T,job:M,subTree:F,um:B,m:P,a:E}=d;yr(P),yr(E),I&&Tn(I),T.stop(),M&&(M.flags|=8,j(F,d,m,k)),B&&He(B,m),He(()=>{d.isUnmounted=!0},m)},Ue=(d,m,k,I=!1,T=!1,M=0)=>{for(let F=M;F<d.length;F++)j(d[F],m,k,I,T)},Cn=d=>{if(d.shapeFlag&6)return Cn(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const m=A(d.anchor||d.el),k=m&&m[ya];return k?A(k):m};let ts=!1;const Qs=(d,m,k)=>{let I;d==null?m._vnode&&(j(m._vnode,null,null,!0),I=m._vnode.component):O(m._vnode||null,d,m,null,null,null,k),m._vnode=d,ts||(ts=!0,or(I),xi(),ts=!1)},Gt={p:O,um:j,m:x,r:te,mt:y,mc:ke,pc:R,pbc:ne,n:Cn,o:e};return{render:Qs,hydrate:void 0,createApp:Ha(Qs)}}function us({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 xt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function nl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oo(e,t,n=!1){const r=e.children,i=t.children;if(z(r)&&z(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=lt(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&oo(o,a)),a.type===Qn&&(a.patchFlag===-1&&(a=i[s]=lt(a)),a.el=o.el),a.type===Le&&!a.el&&(a.el=o.el)}}function sl(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const f=e[r];if(f!==0){if(i=n[n.length-1],e[i]<f){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<f?s=a+1:o=a;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function ao(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ao(t)}function yr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function lo(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?lo(t.subTree):null}const co=e=>e.__isSuspense;function rl(e,t){t&&t.pendingBranch?z(e)?t.effects.push(...e):t.effects.push(e):ha(e)}const ee=Symbol.for("v-fgt"),Qn=Symbol.for("v-txt"),Le=Symbol.for("v-cmt"),ds=Symbol.for("v-stc"),ln=[];let Ve=null;function h(e=!1){ln.push(Ve=e?null:[])}function il(){ln.pop(),Ve=ln[ln.length-1]||null}let hn=1;function Fn(e,t=!1){hn+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function uo(e){return e.dynamicChildren=hn>0?Ve||Nt:null,il(),hn>0&&Ve&&Ve.push(e),e}function _(e,t,n,r,i,s){return uo(u(e,t,n,r,i,s,!0))}function ye(e,t,n,r,i){return uo(ve(e,t,n,r,i,!0))}function mn(e){return e?e.__v_isVNode===!0:!1}function It(e,t){return e.type===t.type&&e.key===t.key}const fo=({key:e})=>e??null,En=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?be(e)||De(e)||X(e)?{i:Ee,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===ee?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fo(t),ref:t&&En(t),scopeId:Mi,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:i,dynamicChildren:null,appContext:null,ctx:Ee};return a?(Ws(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=be(n)?8:16),hn>0&&!o&&Ve&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Ve.push(l),l}const ve=ol;function ol(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Vi)&&(e=Le),mn(e)){const a=Ct(e,t,!0);return n&&Ws(a,n),hn>0&&!s&&Ve&&(a.shapeFlag&6?Ve[Ve.indexOf(e)]=a:Ve.push(a)),a.patchFlag=-2,a}if(gl(e)&&(e=e.__vccOpts),t){t=al(t);let{class:a,style:l}=t;a&&!be(a)&&(t.class=ie(a)),ae(l)&&(Us(l)&&!z(l)&&(l=Ae({},l)),t.style=Oe(l))}const o=be(e)?1:co(e)?128:Ii(e)?64:ae(e)?4:X(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function al(e){return e?Us(e)||eo(e)?Ae({},e):e:null}function Ct(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,f=t?ho(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&fo(f),ref:t&&t.ref?n&&s?z(s)?s.concat(En(t)):[s,En(t)]:En(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!==ee?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ct(e.ssContent),ssFallback:e.ssFallback&&Ct(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&fn(c,l.clone(c)),c}function Zn(e=" ",t=0){return ve(Qn,null,e,t)}function N(e="",t=!1){return t?(h(),ye(Le,null,e)):ve(Le,null,e)}function nt(e){return e==null||typeof e=="boolean"?ve(Le):z(e)?ve(ee,null,e.slice()):mn(e)?lt(e):ve(Qn,null,String(e))}function lt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ct(e)}function Ws(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(z(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Ws(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!eo(t)?t._ctx=Ee:i===3&&Ee&&(Ee.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Ee},n=32):(t=String(t),r&64?(n=16,t=[Zn(t)]):n=8);e.children=t,e.shapeFlag|=n}function ho(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const i in r)if(i==="class")t.class!==r.class&&(t.class=ie([t.class,r.class]));else if(i==="style")t.style=Oe([t.style,r.style]);else if(Hn(i)){const s=t[i],o=r[i];o&&s!==o&&!(z(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!Un(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Qe(e,t,n,r=null){Ge(e,t,7,[n,r])}const ll=Yi();let cl=0;function ul(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||ll,s={uid:cl++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Do(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:no(r,i),emitsOptions:Ji(r,i),emit:null,emitted:null,propsDefaults:fe,inheritAttrs:r.inheritAttrs,ctx:fe,data:fe,props:fe,attrs:fe,slots:fe,refs:fe,setupState:fe,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=$a.bind(null,s),e.ce&&e.ce(s),s}let Pe=null;const mo=()=>Pe||Ee;let Nn,Es;{const e=zn(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};Nn=t("__VUE_INSTANCE_SETTERS__",n=>Pe=n),Es=t("__VUE_SSR_SETTERS__",n=>pn=n)}const kn=e=>{const t=Pe;return Nn(e),e.scope.on(),()=>{e.scope.off(),Nn(t)}},vr=()=>{Pe&&Pe.scope.off(),Nn(null)};function po(e){return e.vnode.shapeFlag&4}let pn=!1;function dl(e,t=!1,n=!1){t&&Es(t);const{props:r,children:i}=e.vnode,s=po(e);Ga(e,r,s,t),Qa(e,i,n||t);const o=s?fl(e,t):void 0;return t&&Es(!1),o}function fl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,La);const{setup:r}=n;if(r){pt();const i=e.setupContext=r.length>1?ml(e):null,s=kn(e),o=wn(r,e,0,[e.props,i]),a=ei(o);if(gt(),s(),(a||e.sp)&&!Ht(e)&&Ni(e),a){if(o.then(vr,vr),t)return o.then(l=>{br(e,l)}).catch(l=>{Gn(l,e,0)});e.asyncDep=o}else br(e,o)}else go(e)}function br(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=ki(t)),go(e)}function go(e,t,n){const r=e.type;e.render||(e.render=r.render||st);{const i=kn(e);pt();try{Pa(e)}finally{gt(),i()}}}const hl={get(e,t){return Re(e,"get",""),e[t]}};function ml(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,hl),slots:e.slots,emit:e.emit,expose:t}}function es(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ki(Cs(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in an)return an[n](e)},has(t,n){return n in t||n in an}})):e.proxy}function pl(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function gl(e){return X(e)&&"__vccOpts"in e}const _l=(e,t)=>la(e,t,pn);function _o(e,t,n){try{Fn(-1);const r=arguments.length;return r===2?ae(t)&&!z(t)?mn(t)?ve(e,null,[t]):ve(e,t):ve(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&mn(n)&&(n=[n]),ve(e,t,n))}finally{Fn(1)}}const yl="3.5.34";/**
14
14
  * @vue/runtime-dom v3.5.34
15
15
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
16
  * @license MIT
17
- **/let Os;const wr=typeof window<"u"&&window.trustedTypes;if(wr)try{Os=wr.createPolicy("vue",{createHTML:e=>e})}catch{}const yo=Os?e=>Os.createHTML(e):e=>e,vl="http://www.w3.org/2000/svg",bl="http://www.w3.org/1998/Math/MathML",ot=typeof document<"u"?document:null,kr=ot&&ot.createElement("template"),wl={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 i=t==="svg"?ot.createElementNS(vl,e):t==="mathml"?ot.createElementNS(bl,e):n?ot.createElement(e,{is:n}):ot.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>ot.createTextNode(e),createComment:e=>ot.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ot.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{kr.innerHTML=yo(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=kr.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[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},vt="transition",Qt="animation",gn=Symbol("_vtc"),vo={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},kl=Ae({},Ri,vo),Cl=e=>(e.displayName="Transition",e.props=kl,e),bo=Cl((e,{slots:t})=>_o(wa,Sl(e),t)),Tt=(e,t=[])=>{z(e)?e.forEach(n=>n(...t)):e&&e(...t)},Cr=e=>e?z(e)?e.some(t=>t.length>1):e.length>1:!1;function Sl(e){const t={};for(const U in e)U in vo||(t[U]=e[U]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:f=o,appearToClass:c=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:A=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,V=Al(i),O=V&&V[0],J=V&&V[1],{onBeforeEnter:W,onEnter:H,onEnterCancelled:Q,onLeave:$,onLeaveCancelled:se,onBeforeAppear:ge=W,onAppear:he=H,onAppearCancelled:ke=Q}=t,G=(U,le,y,v)=>{U._enterCancelled=v,Mt(U,le?c:a),Mt(U,le?f:o),y&&y()},ne=(U,le)=>{U._isLeaving=!1,Mt(U,p),Mt(U,w),Mt(U,A),le&&le()},ue=U=>(le,y)=>{const v=U?he:H,b=()=>G(le,U,y);Tt(v,[le,b]),Sr(()=>{Mt(le,U?l:s),it(le,U?c:a),Cr(v)||Ar(le,r,O,b)})};return Ae(t,{onBeforeEnter(U){Tt(W,[U]),it(U,s),it(U,o)},onBeforeAppear(U){Tt(ge,[U]),it(U,l),it(U,f)},onEnter:ue(!1),onAppear:ue(!0),onLeave(U,le){U._isLeaving=!0;const y=()=>ne(U,le);it(U,p),U._enterCancelled?(it(U,A),Mr(U)):(Mr(U),it(U,A)),Sr(()=>{U._isLeaving&&(Mt(U,p),it(U,w),Cr($)||Ar(U,r,J,y))}),Tt($,[U,y])},onEnterCancelled(U){G(U,!1,void 0,!0),Tt(Q,[U])},onAppearCancelled(U){G(U,!0,void 0,!0),Tt(ke,[U])},onLeaveCancelled(U){ne(U),Tt(se,[U])}})}function Al(e){if(e==null)return null;if(ae(e))return[fs(e.enter),fs(e.leave)];{const t=fs(e);return[t,t]}}function fs(e){return Oo(e)}function it(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[gn]||(e[gn]=new Set)).add(t)}function Mt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[gn];n&&(n.delete(t),n.size||(e[gn]=void 0))}function Sr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let xl=0;function Ar(e,t,n,r){const i=e._endId=++xl,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Tl(e,t);if(!o)return r();const f=o+"end";let c=0;const p=()=>{e.removeEventListener(f,A),s()},A=w=>{w.target===e&&++c>=l&&p()};setTimeout(()=>{c<l&&p()},a+1),e.addEventListener(f,A)}function Tl(e,t){const n=window.getComputedStyle(e),r=V=>(n[V]||"").split(", "),i=r(`${vt}Delay`),s=r(`${vt}Duration`),o=xr(i,s),a=r(`${Qt}Delay`),l=r(`${Qt}Duration`),f=xr(a,l);let c=null,p=0,A=0;t===vt?o>0&&(c=vt,p=o,A=s.length):t===Qt?f>0&&(c=Qt,p=f,A=l.length):(p=Math.max(o,f),c=p>0?o>f?vt:Qt:null,A=c?c===vt?s.length:l.length:0);const w=c===vt&&/\b(?:transform|all)(?:,|$)/.test(r(`${vt}Property`).toString());return{type:c,timeout:p,propCount:A,hasTransform:w}}function xr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Tr(n)+Tr(e[r])))}function Tr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Mr(e){return(e?e.ownerDocument:document).body.offsetHeight}function Ml(e,t,n){const r=e[gn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Er=Symbol("_vod"),El=Symbol("_vsh"),Ol=Symbol(""),Il=/(?:^|;)\s*display\s*:/;function Rl(e,t,n){const r=e.style,i=be(n);let s=!1;if(n&&!i){if(t)if(be(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&en(r,a,"")}else for(const o in t)n[o]==null&&en(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Pl(e,o,!be(t)&&t?t[o]:void 0,a)||en(r,o,a):en(r,o,"")}}else if(i){if(t!==n){const o=r[Ol];o&&(n+=";"+o),r.cssText=n,s=Il.test(n)}}else t&&e.removeAttribute("style");Er in e&&(e[Er]=s?r.display:"",e[El]&&(r.display="none"))}const Or=/\s*!important$/;function en(e,t,n){if(z(n))n.forEach(r=>en(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ll(e,t);Or.test(n)?e.setProperty(St(r),n.replace(Or,""),"important"):e[r]=n}}const Ir=["Webkit","Moz","ms"],hs={};function Ll(e,t){const n=hs[t];if(n)return n;let r=Fe(t);if(r!=="filter"&&r in e)return hs[t]=r;r=Vn(r);for(let i=0;i<Ir.length;i++){const s=Ir[i]+r;if(s in e)return hs[t]=s}return t}function Pl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&be(r)&&n===r}const Rr="http://www.w3.org/1999/xlink";function Lr(e,t,n,r,i,s=No(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Rr,t.slice(6,t.length)):e.setAttributeNS(Rr,t,n):n==null||s&&!ri(n)?e.removeAttribute(t):e.setAttribute(t,s?"":qe(n)?String(n):n)}function Pr(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?yo(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 o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=ri(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function wt(e,t,n,r){e.addEventListener(t,n,r)}function Bl(e,t,n,r){e.removeEventListener(t,n,r)}const Br=Symbol("_vei");function Nl(e,t,n,r,i=null){const s=e[Br]||(e[Br]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=Fl(t);if(r){const f=s[t]=Ul(r,i);wt(e,a,f,l)}else o&&(Bl(e,a,o,l),s[t]=void 0)}}const Nr=/(?:Once|Passive|Capture)$/;function Fl(e){let t;if(Nr.test(e)){t={};let r;for(;r=e.match(Nr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let ms=0;const Dl=Promise.resolve(),jl=()=>ms||(Dl.then(()=>ms=0),ms=Date.now());function Ul(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Ge(Hl(r,n.value),t,5,[r])};return n.value=e,n.attached=jl(),n}function Hl(e,t){if(z(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const Fr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$l=(e,t,n,r,i,s)=>{const o=i==="svg";t==="class"?Ml(e,r,o):t==="style"?Rl(e,n,r):Un(t)?Hn(t)||Nl(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Vl(e,t,r,o))?(Pr(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Lr(e,t,r,o,s,t!=="value")):e._isVueCE&&(Kl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!be(r)))?Pr(e,Fe(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Lr(e,t,r,o))};function Vl(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Fr(t)&&X(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 i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Fr(t)&&be(n)?!1:t in e}function Kl(e,t){const n=e._def.props;if(!n)return!1;const r=Fe(t);return Array.isArray(n)?n.some(i=>Fe(i)===r):Object.keys(n).some(i=>Fe(i)===r)}const Vt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z(t)?n=>Tn(t,n):t};function zl(e){e.target.composing=!0}function Dr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function jr(e,t,n){return t&&(e=e.trim()),n&&(e=Kn(e)),e}const Rt={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[mt]=Vt(i);const s=r||i.props&&i.props.type==="number";wt(e,t?"change":"input",o=>{o.target.composing||e[mt](jr(e.value,n,s))}),(n||s)&&wt(e,"change",()=>{e.value=jr(e.value,n,s)}),t||(wt(e,"compositionstart",zl),wt(e,"compositionend",Dr),wt(e,"change",Dr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[mt]=Vt(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Kn(e.value):e.value,l=t??"";if(a===l)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},Wl={deep:!0,created(e,t,n){e[mt]=Vt(n),wt(e,"change",()=>{const r=e._modelValue,i=_n(e),s=e.checked,o=e[mt];if(z(r)){const a=Bs(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const f=[...r];f.splice(a,1),o(f)}}else if(zt(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(wo(e,s))})},mounted:Ur,beforeUpdate(e,t,n){e[mt]=Vt(n),Ur(e,t,n)}};function Ur(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(z(t))i=Bs(t,r.props.value)>-1;else if(zt(t))i=t.has(r.props.value);else{if(t===n)return;i=Wt(t,wo(e,!0))}e.checked!==i&&(e.checked=i)}const ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=zt(t);wt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Kn(_n(o)):_n(o));e[mt](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,Si(()=>{e._assigning=!1})}),e[mt]=Vt(r)},mounted(e,{value:t}){Hr(e,t)},beforeUpdate(e,t,n){e[mt]=Vt(n)},updated(e,{value:t}){e._assigning||Hr(e,t)}};function Hr(e,t){const n=e.multiple,r=z(t);if(!(n&&!r&&!zt(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=_n(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(f=>String(f)===String(a)):o.selected=Bs(t,a)>-1}else o.selected=t.has(a);else if(Wt(_n(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _n(e){return"_value"in e?e._value:e.value}function wo(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Gl=["ctrl","shift","alt","meta"],Yl={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)=>Gl.some(n=>e[`${n}Key`]&&!t.includes(n))},ht=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(i,...s)=>{for(let o=0;o<t.length;o++){const a=Yl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},Jl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Dn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=St(i.key);if(t.some(o=>o===s||Jl[o]===s))return e(i)})},Xl=Ae({patchProp:$l},wl);let $r;function Ql(){return $r||($r=el(Xl))}const Zl=(...e)=>{const t=Ql().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=tc(r);if(!i)return;const s=t._component;!X(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,ec(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function ec(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function tc(e){return be(e)?document.querySelector(e):e}const nc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],ps="/client",sc=5*60*1e3,rc=10*60*1e3,ic=5*60*1e3;function oc(e){const t={baseUrl:ac(e.baseUrl||""),widgetId:e.widgetId||"",userId:"",origin:"",token:"",currentContext:{},listeners:new Map,eventSource:null,connection:"idle",visibilityHandler:null,started:!1,panelOpen:!1,pollTimer:null,burstTimer:null,hiddenGraceTimer:null,lastActivityAt:null};if(!t.baseUrl||!t.widgetId)throw new Error("[transport] baseUrl and widgetId are required");function n(g,C){return t.listeners.has(g)||t.listeners.set(g,new Set),t.listeners.get(g).add(C),()=>t.listeners.get(g).delete(C)}function r(g,C){const x=t.listeners.get(g);x&&x.forEach(j=>{try{j(C)}catch(te){console.error("[transport] listener",g,te)}})}function i(g){t.connection!==g&&(t.connection=g,r("connection",g))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId,...t.origin?{"X-Parent-Origin":t.origin}:{}}}async function o(g,C,x){const j=await fetch(`${t.baseUrl}${ps}${C}`,{method:g,credentials:"include",headers:s(),body:x!==void 0?JSON.stringify(x):void 0});if(!j.ok){const te=await a(j),Z=new Error(`HTTP ${j.status} ${g} ${C} :: ${(te==null?void 0:te.error)||j.statusText}`);throw Z.status=j.status,Z.body=te,Z}return j.status===204?null:j.json()}async function a(g){try{return await g.json()}catch{return null}}async function l(g){if(t.started)return t.lastBootstrap;if(!(g!=null&&g.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=g.origin,t.token=g.token||"";const C=await fetch(`${t.baseUrl}${ps}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{},allowUnauthenticated:g.allowUnauthenticated===!0,...g.variables&&typeof g.variables=="object"?{variables:g.variables}:{}})});if(!C.ok){const je=await a(C),He=new Error(`Session bootstrap failed: HTTP ${C.status} :: ${(je==null?void 0:je.error)||C.statusText}`);throw He.status=C.status,He.body=je,He}const x=await C.json();t.userId=x.external_id;const[j,te]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async je=>{if(!je.ok){const He=await a(je);throw new Error(`HTTP ${je.status} GET /widgets/:id/config :: ${(He==null?void 0:He.error)||je.statusText}`)}return je.json()}),o("GET","/customers/me")]),Z={config:j,customer:(te==null?void 0:te.customer)??null};return t.lastBootstrap=Z,await f(),typeof document<"u"&&(t.visibilityHandler=v,document.addEventListener("visibilitychange",t.visibilityHandler)),le(),Z}async function f(){try{const g=await A();t.lastActivityAt=g.reduce((C,x)=>{const j=x==null?void 0:x.last_message_at;return j&&(!C||j>C)?j:C},null)}catch(g){console.error("[transport] initial /conversations failed",g)}}async function c(){const g=await o("GET","/customers/me");return(g==null?void 0:g.customer)??null}async function p(g){const C=await o("PATCH","/customers/me",g);return(C==null?void 0:C.customer)??null}async function A(){const g=await o("GET","/conversations");return(g==null?void 0:g.conversations)??[]}async function w(g={}){return(await o("POST","/conversations",g)).conversation}async function V(g){return(await o("GET",`/conversations/${encodeURIComponent(g)}`)).conversation}async function O(g,C){return(await o("PATCH",`/conversations/${encodeURIComponent(g)}`,C)).conversation}async function J(g,C){return o("PATCH",`/conversations/${encodeURIComponent(g)}/read`,{message_id:C})}async function W(g,C={}){const x=new URLSearchParams;C.before&&x.set("before",C.before),C.since&&x.set("since",C.since),C.limit&&x.set("limit",String(C.limit));const j=x.toString()?`?${x.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(g)}/messages${j}`)}async function H(g,C){ne();const x={client_msg_id:C.client_msg_id,type:"content",text_md:C.text_md,author:{id:t.userId,type:"user"},created_at:C.created_at||new Date().toISOString()};return Array.isArray(C.attachments)&&C.attachments.length&&(x.payload={type:"content",attachments:C.attachments}),C.metadata&&typeof C.metadata=="object"&&(x.metadata=C.metadata),t.currentContext&&Object.keys(t.currentContext).length>0&&(x.context=t.currentContext),o("POST",`/conversations/${encodeURIComponent(g)}/messages`,x)}async function Q(g,C,x){return ne(),o("POST",`/messages/${encodeURIComponent(g)}/callbacks/${encodeURIComponent(C)}`,x?{inputs:x}:{})}async function $(g){const C=g.name||"attachment",x=g.type||"application/octet-stream",j=g.size||0,te=await o("POST","/attachments",{mime_type:x,size_bytes:j,name:C}),Z=await fetch(te.upload_url,{method:"PUT",headers:{"Content-Type":x},body:g});if(!Z.ok)throw new Error(`HTTP ${Z.status} PUT signed upload`);return{type:lc(x),path:te.path,mime_type:x,size_bytes:j}}async function se(g){return o("GET",`/attachments/sign?path=${encodeURIComponent(g)}`)}function ge(){const g=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${ps}/stream?${g}`}function he(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const g=new EventSource(ge(),{withCredentials:!0});for(const C of nc)g.addEventListener(C,x=>ke(C,x.data));g.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=g,i("open")}catch(g){console.error("[transport] SSE open failed",g),r("error",g)}}function ke(g,C){try{const x=JSON.parse(C),j=x&&typeof x=="object"&&"data"in x?x.data:x;r(g,j)}catch(x){console.error("[transport] bad SSE payload",g,x)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function ne(){clearTimeout(t.burstTimer),he(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},rc))}function ue(g){t.panelOpen=!!g,t.panelOpen?(clearTimeout(t.burstTimer),he()):ne()}async function U(){try{const g=await A(),C=g.reduce((j,te)=>{const Z=te==null?void 0:te.last_message_at;return Z&&(!j||Z>j)?Z:j},null);C&&(!t.lastActivityAt||C>t.lastActivityAt)&&(t.lastActivityAt=C,r("activity",{conversations:g,latestAt:C}),ne())}catch(g){console.error("[transport] poll failed",g)}}function le(){y(),!(typeof document<"u"&&document.hidden)&&(t.pollTimer=setInterval(U,sc))}function y(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function v(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(y(),G(),i("paused"))},ic);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),le(),t.panelOpen&&he()}}function b(){y(),clearTimeout(t.burstTimer),clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null,G(),t.visibilityHandler&&(document.removeEventListener("visibilitychange",t.visibilityHandler),t.visibilityHandler=null),t.started=!1}async function S(g){return!g||typeof g!="object"?null:o("POST","/update",g)}function R(g){if(!(!g||typeof g!="object"))for(const[C,x]of Object.entries(g)){if(x===null){delete t.currentContext[C];continue}typeof x=="object"&&!Array.isArray(x)&&(t.currentContext[C]={...x})}}return{on:n,start:l,stop:b,setPanelOpen:ue,update:S,context:R,getCustomer:c,patchCustomer:p,listConversations:A,createConversation:w,getConversation:V,patchConversation:O,markConversationRead:J,listMessages:W,postMessage:H,postCallback:Q,uploadAttachment:$,signAttachment:se,get connection(){return t.connection}}}function ac(e){return e.endsWith("/")?e.slice(0,-1):e}function lc(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function cc(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0"));return t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10,16).join("")}function uc(e){const t=qn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",y=>{t.connection=y})),n.push(e.on("message",y=>{const v=y==null?void 0:y.conversation_id,b=y==null?void 0:y.message;!v||!(b!=null&&b.id)||(he(v,b),b.client_msg_id&&delete t.streamingByMsgId[b.client_msg_id],ne(v,b.created_at))})),n.push(e.on("message_stream",y=>{const v=y==null?void 0:y.message_id,b=y==null?void 0:y.token;!v||typeof b!="string"||(t.streamingByMsgId[v]=(t.streamingByMsgId[v]||"")+b)})),n.push(e.on("conversation_updated",y=>{const v=y==null?void 0:y.conversation_id,b=y==null?void 0:y.changes;if(!v||!b)return;const S=t.conversations.findIndex(R=>R.id===v);S!==-1&&(t.conversations[S]={...t.conversations[S],...b})})),n.push(e.on("config_updated",y=>{y!=null&&y.config&&(t.config=y.config)})),n.push(e.on("action_status",y=>{const v=y==null?void 0:y.conversation_id,b=y==null?void 0:y.action_id,S=y==null?void 0:y.action_name;if(!v||!b)return;const R=t.runningActionsByConv[v]||{};y.state==="running"?(R[b]=S||b,t.runningActionsByConv[v]={...R}):y.state==="done"&&(delete R[b],t.runningActionsByConv[v]={...R})})),n.push(e.on("activity",y=>{Array.isArray(y==null?void 0:y.conversations)&&(t.conversations=y.conversations)}));async function r(y){try{const v=new Promise((S,R)=>setTimeout(()=>R(new Error("bootstrap timeout (15s) โ€” check baseUrl, CORS, and network")),15e3)),b=await Promise.race([e.start(y),v]);t.config=b.config,t.customer=b.customer,t.conversations=await Promise.race([e.listConversations(),v]),t.ready=!0}catch(v){console.error("[store] start failed",v),t.error=(v==null?void 0:v.message)||String(v)}}function i(){for(const y of n)try{y()}catch{}e.stop()}async function s(y){const v=U(y);if(!v)return t.customer;try{const b=await e.patchCustomer(v);b&&(t.customer=b)}catch(b){console.error("[store] applyCustomer failed",b)}return t.customer}async function o(y={}){const v=await e.createConversation(y),b=t.conversations.findIndex(S=>S.id===v.id);return b===-1?t.conversations=[v,...t.conversations]:t.conversations[b]=v,v}const a=50;async function l(y){const v=t.paginationByConv[y];if(!(v!=null&&v.loaded||v!=null&&v.loading)){c(y,{nextCursor:null,loading:!0,loaded:!1});try{const b=await e.listMessages(y,{limit:a}),S=(b==null?void 0:b.messages)??[],R=t.messagesByConv[y]||[],g=new Set;for(const x of S)(x==null?void 0:x.id)!=null&&g.add(`id:${String(x.id)}`),x!=null&&x.client_msg_id&&g.add(`c:${x.client_msg_id}`);const C=R.filter(x=>!((x==null?void 0:x.id)!=null&&g.has(`id:${String(x.id)}`)||x!=null&&x.client_msg_id&&g.has(`c:${x.client_msg_id}`)));t.messagesByConv[y]=[...S,...C].sort(ue),c(y,{nextCursor:(b==null?void 0:b.next_cursor)??null,loading:!1,loaded:!0})}catch(b){console.error("[store] openConversation failed",b),c(y,{nextCursor:null,loading:!1,loaded:!1})}}}async function f(y){var R;const v=t.paginationByConv[y];if(!v||v.loading||!v.nextCursor)return;const S=(R=(t.messagesByConv[y]||[]).find(g=>g==null?void 0:g.created_at))==null?void 0:R.created_at;if(S){c(y,{...v,loading:!0});try{const g=await e.listMessages(y,{before:S,limit:a}),C=(g==null?void 0:g.messages)??[],x=t.messagesByConv[y]||[],j=new Set;for(const Z of x)(Z==null?void 0:Z.id)!=null&&j.add(`id:${String(Z.id)}`),Z!=null&&Z.client_msg_id&&j.add(`c:${Z.client_msg_id}`);const te=C.filter(Z=>!((Z==null?void 0:Z.id)!=null&&j.has(`id:${String(Z.id)}`)||Z!=null&&Z.client_msg_id&&j.has(`c:${Z.client_msg_id}`)));t.messagesByConv[y]=[...te,...x],c(y,{nextCursor:(g==null?void 0:g.next_cursor)??null,loading:!1,loaded:!0})}catch(g){console.error("[store] loadMore failed",g),c(y,{...v,loading:!1})}}}function c(y,v){t.paginationByConv={...t.paginationByConv,[y]:v}}async function p(y,v){const b=await e.patchConversation(y,v),S=t.conversations.findIndex(R=>R.id===y);S!==-1&&(t.conversations[S]=b)}async function A(y){if(!y)return[];const v=t.messagesByConv[y]||[];let b="";for(const S of v)S!=null&&S.created_at&&S.created_at>b&&(b=S.created_at);try{const S=await e.listMessages(y,b?{since:b}:{}),R=(S==null?void 0:S.messages)||[];if(!R.length)return[];const g=new Set,C=new Set;for(const j of v)(j==null?void 0:j.id)!=null&&g.add(String(j.id)),j!=null&&j.client_msg_id&&C.add(j.client_msg_id);const x=[];for(const j of R){const te=(j==null?void 0:j.id)!=null&&g.has(String(j.id))||(j==null?void 0:j.client_msg_id)&&C.has(j.client_msg_id);he(y,j),te||x.push(j)}return x}catch(S){return console.error("[store] fetchSinceLast failed",S),[]}}async function w(y,v){if(!(!y||v==null))try{const b=await e.markConversationRead(y,v),S=(b==null?void 0:b.last_read_message_id)??v,R=t.conversations.findIndex(g=>(g==null?void 0:g.id)===y);R!==-1&&(t.conversations[R]={...t.conversations[R],last_read_message_id:S})}catch(b){console.error("[store] markConversationRead failed",b)}}async function V(y,v,{attachments:b,metadata:S}={}){var te;const R=(v||"").trim(),g=Array.isArray(b)&&b.length>0;if(!y||!R&&!g)return;const C=cc(),x=le(y),j={id:C,client_msg_id:C,conversation_id:y,type:"content",text_md:R,author:{type:"user",id:((te=t.customer)==null?void 0:te.external_id)||null},created_at:x,_pending:!0,...g?{payload:{type:"content",attachments:b}}:{},...S&&typeof S=="object"?{metadata:S}:{}};he(y,j);try{await e.postMessage(y,{client_msg_id:C,text_md:R,created_at:x,...g?{attachments:b}:{},...S&&typeof S=="object"?{metadata:S}:{}})}catch(Z){console.error("[store] send failed",Z),G(y,C,{_failed:!0,_pending:!1})}}async function O(y,v,b){y!=null&&(t.awaitingCallback[y]=!0);try{await e.postCallback(y,v,b)}catch(S){console.error("[store] callback failed",S),y!=null&&delete t.awaitingCallback[y]}}const J=new Map;async function W(y){if(!y)return null;const v=J.get(y);if(v!=null&&v.url){const b=v.expires_at?Date.parse(v.expires_at):0;if(!b||b-Date.now()>6e4)return v.url}try{const b=await e.signAttachment(y);if(b!=null&&b.signed_url)return J.set(y,{url:b.signed_url,expires_at:b.expires_at}),b.signed_url}catch(b){console.error("[store] sign attachment failed",b)}return null}async function H(y,{rating:v,comment:b}={}){const S=t.conversations.find(C=>C.id===y),g={...(S==null?void 0:S.metadata)||{},feedback:{rating:v,comment:b||null,submitted_at:new Date().toISOString()}};await p(y,{metadata:g})}function Q(y){var b,S;const v=t.messagesByConv[y]||[];for(let R=v.length-1;R>=0;R--){const g=v[R];if((g==null?void 0:g.type)==="action"&&((b=g==null?void 0:g.payload)==null?void 0:b.type)==="action"&&((S=g==null?void 0:g.payload)==null?void 0:S.state)==="pending"&&Array.isArray(g==null?void 0:g.callbacks)&&g.callbacks.length>0&&!t.awaitingCallback[g.id])return g}return null}function $(y){var b,S,R;const v=t.messagesByConv[y]||[];for(let g=v.length-1;g>=0;g--){const C=v[g];if(((b=C==null?void 0:C.author)==null?void 0:b.type)==="user"||(C==null?void 0:C.type)==="action"&&((S=C==null?void 0:C.payload)==null?void 0:S.state)==="pending")return null;const x=(R=C==null?void 0:C.metadata)==null?void 0:R.form;if(x&&Array.isArray(x.fields)&&x.fields.length>0)return{message:C,form:x}}return null}function se(y){const v=t.runningActionsByConv[y];if(!v)return null;const b=Object.keys(v);if(b.length===0)return null;const S=b[0];return{id:S,payload:{name:v[S]}}}function ge(y){var b,S,R,g;const v=t.messagesByConv[y]||[];for(let C=v.length-1;C>=0;C--){const x=v[C];if(((b=x==null?void 0:x.author)==null?void 0:b.type)==="user")return[];if((x==null?void 0:x.type)==="action"&&((S=x==null?void 0:x.payload)==null?void 0:S.state)==="pending")return[];if(((R=x==null?void 0:x.author)==null?void 0:R.type)!=="agent_ia")continue;const j=(g=x==null?void 0:x.metadata)==null?void 0:g.suggested_replies;return Array.isArray(j)&&j.length?j.map(te=>{if(typeof te=="string"){const Z=te.trim();return Z?{label:Z,kind:null}:null}if(te&&typeof te=="object"&&typeof te.label=="string"){const Z=te.label.trim();if(!Z)return null;const je=te.kind==="cta"||te.kind==="choice"||te.kind==="followup"?te.kind:null;return{label:Z,kind:je}}return null}).filter(Boolean).slice(0,4):[]}return[]}function he(y,v){var g;const b=t.messagesByConv[y]||[];let S=-1;v!=null&&v.client_msg_id&&(S=b.findIndex(C=>(C==null?void 0:C.client_msg_id)&&C.client_msg_id===v.client_msg_id)),S===-1&&(v==null?void 0:v.id)!==void 0&&(v==null?void 0:v.id)!==null&&(S=b.findIndex(C=>ke(C==null?void 0:C.id,v.id)));let R;S===-1?R=[...b,v].sort(ue):(R=b.slice(),R[S]={...b[S],...v,_pending:!1,_failed:!1}),t.messagesByConv[y]=R,(v==null?void 0:v.type)==="action"&&((g=v==null?void 0:v.payload)!=null&&g.state)&&v.payload.state!=="pending"&&(v==null?void 0:v.id)!=null&&t.awaitingCallback[v.id]&&delete t.awaitingCallback[v.id]}function ke(y,v){return y===v?!0:y==null||v==null?!1:String(y)===String(v)}function G(y,v,b){const S=t.messagesByConv[y];if(!S)return;const R=S.findIndex(C=>C.id===v);if(R===-1)return;const g=S.slice();g[R]={...S[R],...b},t.messagesByConv[y]=g}function ne(y,v){const b=t.conversations.findIndex(R=>R.id===y);if(b===-1)return;const S=t.conversations[b];if(v&&(!S.last_message_at||v>S.last_message_at)){const R=t.conversations.slice();R[b]={...S,last_message_at:v},R.sort((g,C)=>(C.last_message_at||"").localeCompare(g.last_message_at||"")),t.conversations=R}}function ue(y,v){return(y.created_at||"").localeCompare(v.created_at||"")}function U(y){if(!y||typeof y!="object")return null;const v={},b={};for(const[S,R]of Object.entries(y))R!==void 0&&(S==="name"||S==="email"||S==="language"?R!=null&&String(R).trim()!==""&&(v[S]=R):(S==="values"||S==="metadata")&&R&&typeof R=="object"?Object.assign(b,R):b[S]=R);return Object.keys(b).length&&(v.values=b),Object.keys(v).length?v:null}function le(y){const v=t.messagesByConv[y]||[];let b="";for(const g of v)g!=null&&g.created_at&&g.created_at>b&&(b=g.created_at);const S=new Date().toISOString();return!b||S>b?S:new Date(Date.parse(b)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:f,fetchSinceLast:A,patchConversation:p,markConversationRead:w,send:V,clickCallback:O,signAttachment:W,submitFeedback:H,getPendingApproval:Q,getActionInFlight:se,getLatestSuggestions:ge,getLatestForm:$,setPanelOpen:e.setPanelOpen}}const Ie={w:"#ffffff",g50:"#F9F9F7",g100:"#F2F1EE",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},gs=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function qs(e=""){return e?gs[e.charCodeAt(0)%gs.length]:gs[0]}function Gs(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function Is(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const ko=`
17
+ **/let Os;const wr=typeof window<"u"&&window.trustedTypes;if(wr)try{Os=wr.createPolicy("vue",{createHTML:e=>e})}catch{}const yo=Os?e=>Os.createHTML(e):e=>e,vl="http://www.w3.org/2000/svg",bl="http://www.w3.org/1998/Math/MathML",ot=typeof document<"u"?document:null,kr=ot&&ot.createElement("template"),wl={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 i=t==="svg"?ot.createElementNS(vl,e):t==="mathml"?ot.createElementNS(bl,e):n?ot.createElement(e,{is:n}):ot.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>ot.createTextNode(e),createComment:e=>ot.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ot.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,s){const o=n?n.previousSibling:t.lastChild;if(i&&(i===s||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{kr.innerHTML=yo(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=kr.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[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},vt="transition",Qt="animation",gn=Symbol("_vtc"),vo={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},kl=Ae({},Ri,vo),Cl=e=>(e.displayName="Transition",e.props=kl,e),bo=Cl((e,{slots:t})=>_o(wa,Sl(e),t)),Tt=(e,t=[])=>{z(e)?e.forEach(n=>n(...t)):e&&e(...t)},Cr=e=>e?z(e)?e.some(t=>t.length>1):e.length>1:!1;function Sl(e){const t={};for(const H in e)H in vo||(t[H]=e[H]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:s=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:f=o,appearToClass:c=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:A=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,V=Al(i),O=V&&V[0],J=V&&V[1],{onBeforeEnter:W,onEnter:U,onEnterCancelled:Q,onLeave:$,onLeaveCancelled:se,onBeforeAppear:ge=W,onAppear:he=U,onAppearCancelled:ke=Q}=t,G=(H,le,y,v)=>{H._enterCancelled=v,Mt(H,le?c:a),Mt(H,le?f:o),y&&y()},ne=(H,le)=>{H._isLeaving=!1,Mt(H,p),Mt(H,w),Mt(H,A),le&&le()},ue=H=>(le,y)=>{const v=H?he:U,b=()=>G(le,H,y);Tt(v,[le,b]),Sr(()=>{Mt(le,H?l:s),it(le,H?c:a),Cr(v)||Ar(le,r,O,b)})};return Ae(t,{onBeforeEnter(H){Tt(W,[H]),it(H,s),it(H,o)},onBeforeAppear(H){Tt(ge,[H]),it(H,l),it(H,f)},onEnter:ue(!1),onAppear:ue(!0),onLeave(H,le){H._isLeaving=!0;const y=()=>ne(H,le);it(H,p),H._enterCancelled?(it(H,A),Mr(H)):(Mr(H),it(H,A)),Sr(()=>{H._isLeaving&&(Mt(H,p),it(H,w),Cr($)||Ar(H,r,J,y))}),Tt($,[H,y])},onEnterCancelled(H){G(H,!1,void 0,!0),Tt(Q,[H])},onAppearCancelled(H){G(H,!0,void 0,!0),Tt(ke,[H])},onLeaveCancelled(H){ne(H),Tt(se,[H])}})}function Al(e){if(e==null)return null;if(ae(e))return[fs(e.enter),fs(e.leave)];{const t=fs(e);return[t,t]}}function fs(e){return Oo(e)}function it(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[gn]||(e[gn]=new Set)).add(t)}function Mt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[gn];n&&(n.delete(t),n.size||(e[gn]=void 0))}function Sr(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let xl=0;function Ar(e,t,n,r){const i=e._endId=++xl,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Tl(e,t);if(!o)return r();const f=o+"end";let c=0;const p=()=>{e.removeEventListener(f,A),s()},A=w=>{w.target===e&&++c>=l&&p()};setTimeout(()=>{c<l&&p()},a+1),e.addEventListener(f,A)}function Tl(e,t){const n=window.getComputedStyle(e),r=V=>(n[V]||"").split(", "),i=r(`${vt}Delay`),s=r(`${vt}Duration`),o=xr(i,s),a=r(`${Qt}Delay`),l=r(`${Qt}Duration`),f=xr(a,l);let c=null,p=0,A=0;t===vt?o>0&&(c=vt,p=o,A=s.length):t===Qt?f>0&&(c=Qt,p=f,A=l.length):(p=Math.max(o,f),c=p>0?o>f?vt:Qt:null,A=c?c===vt?s.length:l.length:0);const w=c===vt&&/\b(?:transform|all)(?:,|$)/.test(r(`${vt}Property`).toString());return{type:c,timeout:p,propCount:A,hasTransform:w}}function xr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Tr(n)+Tr(e[r])))}function Tr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Mr(e){return(e?e.ownerDocument:document).body.offsetHeight}function Ml(e,t,n){const r=e[gn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Er=Symbol("_vod"),El=Symbol("_vsh"),Ol=Symbol(""),Il=/(?:^|;)\s*display\s*:/;function Rl(e,t,n){const r=e.style,i=be(n);let s=!1;if(n&&!i){if(t)if(be(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&en(r,a,"")}else for(const o in t)n[o]==null&&en(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Pl(e,o,!be(t)&&t?t[o]:void 0,a)||en(r,o,a):en(r,o,"")}}else if(i){if(t!==n){const o=r[Ol];o&&(n+=";"+o),r.cssText=n,s=Il.test(n)}}else t&&e.removeAttribute("style");Er in e&&(e[Er]=s?r.display:"",e[El]&&(r.display="none"))}const Or=/\s*!important$/;function en(e,t,n){if(z(n))n.forEach(r=>en(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ll(e,t);Or.test(n)?e.setProperty(St(r),n.replace(Or,""),"important"):e[r]=n}}const Ir=["Webkit","Moz","ms"],hs={};function Ll(e,t){const n=hs[t];if(n)return n;let r=Ne(t);if(r!=="filter"&&r in e)return hs[t]=r;r=Vn(r);for(let i=0;i<Ir.length;i++){const s=Ir[i]+r;if(s in e)return hs[t]=s}return t}function Pl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&be(r)&&n===r}const Rr="http://www.w3.org/1999/xlink";function Lr(e,t,n,r,i,s=Fo(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Rr,t.slice(6,t.length)):e.setAttributeNS(Rr,t,n):n==null||s&&!ri(n)?e.removeAttribute(t):e.setAttribute(t,s?"":qe(n)?String(n):n)}function Pr(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?yo(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 o=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=ri(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function wt(e,t,n,r){e.addEventListener(t,n,r)}function Bl(e,t,n,r){e.removeEventListener(t,n,r)}const Br=Symbol("_vei");function Fl(e,t,n,r,i=null){const s=e[Br]||(e[Br]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=Nl(t);if(r){const f=s[t]=Hl(r,i);wt(e,a,f,l)}else o&&(Bl(e,a,o,l),s[t]=void 0)}}const Fr=/(?:Once|Passive|Capture)$/;function Nl(e){let t;if(Fr.test(e)){t={};let r;for(;r=e.match(Fr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let ms=0;const Dl=Promise.resolve(),jl=()=>ms||(Dl.then(()=>ms=0),ms=Date.now());function Hl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Ge(Ul(r,n.value),t,5,[r])};return n.value=e,n.attached=jl(),n}function Ul(e,t){if(z(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const Nr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,$l=(e,t,n,r,i,s)=>{const o=i==="svg";t==="class"?Ml(e,r,o):t==="style"?Rl(e,n,r):Hn(t)?Un(t)||Fl(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Vl(e,t,r,o))?(Pr(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Lr(e,t,r,o,s,t!=="value")):e._isVueCE&&(Kl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!be(r)))?Pr(e,Ne(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Lr(e,t,r,o))};function Vl(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Nr(t)&&X(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 i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Nr(t)&&be(n)?!1:t in e}function Kl(e,t){const n=e._def.props;if(!n)return!1;const r=Ne(t);return Array.isArray(n)?n.some(i=>Ne(i)===r):Object.keys(n).some(i=>Ne(i)===r)}const Vt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z(t)?n=>Tn(t,n):t};function zl(e){e.target.composing=!0}function Dr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function jr(e,t,n){return t&&(e=e.trim()),n&&(e=Kn(e)),e}const Rt={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[mt]=Vt(i);const s=r||i.props&&i.props.type==="number";wt(e,t?"change":"input",o=>{o.target.composing||e[mt](jr(e.value,n,s))}),(n||s)&&wt(e,"change",()=>{e.value=jr(e.value,n,s)}),t||(wt(e,"compositionstart",zl),wt(e,"compositionend",Dr),wt(e,"change",Dr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[mt]=Vt(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Kn(e.value):e.value,l=t??"";if(a===l)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},Wl={deep:!0,created(e,t,n){e[mt]=Vt(n),wt(e,"change",()=>{const r=e._modelValue,i=_n(e),s=e.checked,o=e[mt];if(z(r)){const a=Bs(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const f=[...r];f.splice(a,1),o(f)}}else if(zt(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(wo(e,s))})},mounted:Hr,beforeUpdate(e,t,n){e[mt]=Vt(n),Hr(e,t,n)}};function Hr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(z(t))i=Bs(t,r.props.value)>-1;else if(zt(t))i=t.has(r.props.value);else{if(t===n)return;i=Wt(t,wo(e,!0))}e.checked!==i&&(e.checked=i)}const ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=zt(t);wt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Kn(_n(o)):_n(o));e[mt](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,Si(()=>{e._assigning=!1})}),e[mt]=Vt(r)},mounted(e,{value:t}){Ur(e,t)},beforeUpdate(e,t,n){e[mt]=Vt(n)},updated(e,{value:t}){e._assigning||Ur(e,t)}};function Ur(e,t){const n=e.multiple,r=z(t);if(!(n&&!r&&!zt(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=_n(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(f=>String(f)===String(a)):o.selected=Bs(t,a)>-1}else o.selected=t.has(a);else if(Wt(_n(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _n(e){return"_value"in e?e._value:e.value}function wo(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Gl=["ctrl","shift","alt","meta"],Yl={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)=>Gl.some(n=>e[`${n}Key`]&&!t.includes(n))},ht=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(i,...s)=>{for(let o=0;o<t.length;o++){const a=Yl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},Jl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Dn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=St(i.key);if(t.some(o=>o===s||Jl[o]===s))return e(i)})},Xl=Ae({patchProp:$l},wl);let $r;function Ql(){return $r||($r=el(Xl))}const Zl=(...e)=>{const t=Ql().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=tc(r);if(!i)return;const s=t._component;!X(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,ec(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function ec(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function tc(e){return be(e)?document.querySelector(e):e}const nc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],ps="/client",sc=5*60*1e3,rc=10*60*1e3,ic=5*60*1e3;function oc(e){const t={baseUrl:ac(e.baseUrl||""),widgetId:e.widgetId||"",userId:"",origin:"",token:"",currentContext:{},listeners:new Map,eventSource:null,connection:"idle",visibilityHandler:null,started:!1,panelOpen:!1,pollTimer:null,burstTimer:null,hiddenGraceTimer:null,lastActivityAt:null};if(!t.baseUrl||!t.widgetId)throw new Error("[transport] baseUrl and widgetId are required");function n(g,C){return t.listeners.has(g)||t.listeners.set(g,new Set),t.listeners.get(g).add(C),()=>t.listeners.get(g).delete(C)}function r(g,C){const x=t.listeners.get(g);x&&x.forEach(j=>{try{j(C)}catch(te){console.error("[transport] listener",g,te)}})}function i(g){t.connection!==g&&(t.connection=g,r("connection",g))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId,...t.origin?{"X-Parent-Origin":t.origin}:{}}}async function o(g,C,x){const j=await fetch(`${t.baseUrl}${ps}${C}`,{method:g,credentials:"include",headers:s(),body:x!==void 0?JSON.stringify(x):void 0});if(!j.ok){const te=await a(j),Z=new Error(`HTTP ${j.status} ${g} ${C} :: ${(te==null?void 0:te.error)||j.statusText}`);throw Z.status=j.status,Z.body=te,Z}return j.status===204?null:j.json()}async function a(g){try{return await g.json()}catch{return null}}async function l(g){if(t.started)return t.lastBootstrap;if(!(g!=null&&g.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=g.origin,t.token=g.token||"";const C=await fetch(`${t.baseUrl}${ps}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{},allowUnauthenticated:g.allowUnauthenticated===!0,...g.variables&&typeof g.variables=="object"?{variables:g.variables}:{}})});if(!C.ok){const je=await a(C),Ue=new Error(`Session bootstrap failed: HTTP ${C.status} :: ${(je==null?void 0:je.error)||C.statusText}`);throw Ue.status=C.status,Ue.body=je,Ue}const x=await C.json();t.userId=x.external_id;const[j,te]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async je=>{if(!je.ok){const Ue=await a(je);throw new Error(`HTTP ${je.status} GET /widgets/:id/config :: ${(Ue==null?void 0:Ue.error)||je.statusText}`)}return je.json()}),o("GET","/customers/me")]),Z={config:j,customer:(te==null?void 0:te.customer)??null};return t.lastBootstrap=Z,await f(),typeof document<"u"&&(t.visibilityHandler=v,document.addEventListener("visibilitychange",t.visibilityHandler)),le(),Z}async function f(){try{const g=await A();t.lastActivityAt=g.reduce((C,x)=>{const j=x==null?void 0:x.last_message_at;return j&&(!C||j>C)?j:C},null)}catch(g){console.error("[transport] initial /conversations failed",g)}}async function c(){const g=await o("GET","/customers/me");return(g==null?void 0:g.customer)??null}async function p(g){const C=await o("PATCH","/customers/me",g);return(C==null?void 0:C.customer)??null}async function A(){const g=await o("GET","/conversations");return(g==null?void 0:g.conversations)??[]}async function w(g={}){return(await o("POST","/conversations",g)).conversation}async function V(g){return(await o("GET",`/conversations/${encodeURIComponent(g)}`)).conversation}async function O(g,C){return(await o("PATCH",`/conversations/${encodeURIComponent(g)}`,C)).conversation}async function J(g,C){return o("PATCH",`/conversations/${encodeURIComponent(g)}/read`,{message_id:C})}async function W(g,C={}){const x=new URLSearchParams;C.before&&x.set("before",C.before),C.since&&x.set("since",C.since),C.limit&&x.set("limit",String(C.limit));const j=x.toString()?`?${x.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(g)}/messages${j}`)}async function U(g,C){ne();const x={client_msg_id:C.client_msg_id,type:"content",text_md:C.text_md,author:{id:t.userId,type:"user"},created_at:C.created_at||new Date().toISOString()};return Array.isArray(C.attachments)&&C.attachments.length&&(x.payload={type:"content",attachments:C.attachments}),C.metadata&&typeof C.metadata=="object"&&(x.metadata=C.metadata),t.currentContext&&Object.keys(t.currentContext).length>0&&(x.context=t.currentContext),o("POST",`/conversations/${encodeURIComponent(g)}/messages`,x)}async function Q(g,C,x){return ne(),o("POST",`/messages/${encodeURIComponent(g)}/callbacks/${encodeURIComponent(C)}`,x?{inputs:x}:{})}async function $(g){const C=g.name||"attachment",x=g.type||"application/octet-stream",j=g.size||0,te=await o("POST","/attachments",{mime_type:x,size_bytes:j,name:C}),Z=await fetch(te.upload_url,{method:"PUT",headers:{"Content-Type":x},body:g});if(!Z.ok)throw new Error(`HTTP ${Z.status} PUT signed upload`);return{type:lc(x),path:te.path,mime_type:x,size_bytes:j}}async function se(g){return o("GET",`/attachments/sign?path=${encodeURIComponent(g)}`)}function ge(){const g=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${ps}/stream?${g}`}function he(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const g=new EventSource(ge(),{withCredentials:!0});for(const C of nc)g.addEventListener(C,x=>ke(C,x.data));g.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=g,i("open")}catch(g){console.error("[transport] SSE open failed",g),r("error",g)}}function ke(g,C){try{const x=JSON.parse(C),j=x&&typeof x=="object"&&"data"in x?x.data:x;r(g,j)}catch(x){console.error("[transport] bad SSE payload",g,x)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function ne(){clearTimeout(t.burstTimer),he(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},rc))}function ue(g){t.panelOpen=!!g,t.panelOpen?(clearTimeout(t.burstTimer),he()):ne()}async function H(){try{const g=await A(),C=g.reduce((j,te)=>{const Z=te==null?void 0:te.last_message_at;return Z&&(!j||Z>j)?Z:j},null);C&&(!t.lastActivityAt||C>t.lastActivityAt)&&(t.lastActivityAt=C,r("activity",{conversations:g,latestAt:C}),ne())}catch(g){console.error("[transport] poll failed",g)}}function le(){y(),!(typeof document<"u"&&document.hidden)&&(t.pollTimer=setInterval(H,sc))}function y(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function v(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(y(),G(),i("paused"))},ic);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),le(),t.panelOpen&&he()}}function b(){y(),clearTimeout(t.burstTimer),clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null,G(),t.visibilityHandler&&(document.removeEventListener("visibilitychange",t.visibilityHandler),t.visibilityHandler=null),t.started=!1}async function S(g){return!g||typeof g!="object"?null:o("POST","/update",g)}function R(g){if(!(!g||typeof g!="object"))for(const[C,x]of Object.entries(g)){if(x===null){delete t.currentContext[C];continue}typeof x=="object"&&!Array.isArray(x)&&(t.currentContext[C]={...x})}}return{on:n,start:l,stop:b,setPanelOpen:ue,update:S,context:R,getCustomer:c,patchCustomer:p,listConversations:A,createConversation:w,getConversation:V,patchConversation:O,markConversationRead:J,listMessages:W,postMessage:U,postCallback:Q,uploadAttachment:$,signAttachment:se,get connection(){return t.connection}}}function ac(e){return e.endsWith("/")?e.slice(0,-1):e}function lc(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function cc(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let n=0;n<16;n++)e[n]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=[...e].map(n=>n.toString(16).padStart(2,"0"));return t.slice(0,4).join("")+"-"+t.slice(4,6).join("")+"-"+t.slice(6,8).join("")+"-"+t.slice(8,10).join("")+"-"+t.slice(10,16).join("")}function uc(e){const t=qn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",y=>{t.connection=y})),n.push(e.on("message",y=>{const v=y==null?void 0:y.conversation_id,b=y==null?void 0:y.message;!v||!(b!=null&&b.id)||(he(v,b),b.client_msg_id&&delete t.streamingByMsgId[b.client_msg_id],ne(v,b.created_at))})),n.push(e.on("message_stream",y=>{const v=y==null?void 0:y.message_id,b=y==null?void 0:y.token;!v||typeof b!="string"||(t.streamingByMsgId[v]=(t.streamingByMsgId[v]||"")+b)})),n.push(e.on("conversation_updated",y=>{const v=y==null?void 0:y.conversation_id,b=y==null?void 0:y.changes;if(!v||!b)return;const S=t.conversations.findIndex(R=>R.id===v);S!==-1&&(t.conversations[S]={...t.conversations[S],...b})})),n.push(e.on("config_updated",y=>{y!=null&&y.config&&(t.config=y.config)})),n.push(e.on("action_status",y=>{const v=y==null?void 0:y.conversation_id,b=y==null?void 0:y.action_id,S=y==null?void 0:y.action_name;if(!v||!b)return;const R=t.runningActionsByConv[v]||{};y.state==="running"?(R[b]=S||b,t.runningActionsByConv[v]={...R}):y.state==="done"&&(delete R[b],t.runningActionsByConv[v]={...R})})),n.push(e.on("activity",y=>{Array.isArray(y==null?void 0:y.conversations)&&(t.conversations=y.conversations)}));async function r(y){try{const v=new Promise((S,R)=>setTimeout(()=>R(new Error("bootstrap timeout (15s) โ€” check baseUrl, CORS, and network")),15e3)),b=await Promise.race([e.start(y),v]);t.config=b.config,t.customer=b.customer,t.conversations=await Promise.race([e.listConversations(),v]),t.ready=!0}catch(v){console.error("[store] start failed",v),t.error=(v==null?void 0:v.message)||String(v)}}function i(){for(const y of n)try{y()}catch{}e.stop()}async function s(y){const v=H(y);if(!v)return t.customer;try{const b=await e.patchCustomer(v);b&&(t.customer=b)}catch(b){console.error("[store] applyCustomer failed",b)}return t.customer}async function o(y={}){const v=await e.createConversation(y),b=t.conversations.findIndex(S=>S.id===v.id);return b===-1?t.conversations=[v,...t.conversations]:t.conversations[b]=v,v}const a=50;async function l(y){const v=t.paginationByConv[y];if(!(v!=null&&v.loaded||v!=null&&v.loading)){c(y,{nextCursor:null,loading:!0,loaded:!1});try{const b=await e.listMessages(y,{limit:a}),S=(b==null?void 0:b.messages)??[],R=t.messagesByConv[y]||[],g=new Set;for(const x of S)(x==null?void 0:x.id)!=null&&g.add(`id:${String(x.id)}`),x!=null&&x.client_msg_id&&g.add(`c:${x.client_msg_id}`);const C=R.filter(x=>!((x==null?void 0:x.id)!=null&&g.has(`id:${String(x.id)}`)||x!=null&&x.client_msg_id&&g.has(`c:${x.client_msg_id}`)));t.messagesByConv[y]=[...S,...C].sort(ue),c(y,{nextCursor:(b==null?void 0:b.next_cursor)??null,loading:!1,loaded:!0})}catch(b){console.error("[store] openConversation failed",b),c(y,{nextCursor:null,loading:!1,loaded:!1})}}}async function f(y){var R;const v=t.paginationByConv[y];if(!v||v.loading||!v.nextCursor)return;const S=(R=(t.messagesByConv[y]||[]).find(g=>g==null?void 0:g.created_at))==null?void 0:R.created_at;if(S){c(y,{...v,loading:!0});try{const g=await e.listMessages(y,{before:S,limit:a}),C=(g==null?void 0:g.messages)??[],x=t.messagesByConv[y]||[],j=new Set;for(const Z of x)(Z==null?void 0:Z.id)!=null&&j.add(`id:${String(Z.id)}`),Z!=null&&Z.client_msg_id&&j.add(`c:${Z.client_msg_id}`);const te=C.filter(Z=>!((Z==null?void 0:Z.id)!=null&&j.has(`id:${String(Z.id)}`)||Z!=null&&Z.client_msg_id&&j.has(`c:${Z.client_msg_id}`)));t.messagesByConv[y]=[...te,...x],c(y,{nextCursor:(g==null?void 0:g.next_cursor)??null,loading:!1,loaded:!0})}catch(g){console.error("[store] loadMore failed",g),c(y,{...v,loading:!1})}}}function c(y,v){t.paginationByConv={...t.paginationByConv,[y]:v}}async function p(y,v){const b=await e.patchConversation(y,v),S=t.conversations.findIndex(R=>R.id===y);S!==-1&&(t.conversations[S]=b)}async function A(y){if(!y)return[];const v=t.messagesByConv[y]||[];let b="";for(const S of v)S!=null&&S.created_at&&S.created_at>b&&(b=S.created_at);try{const S=await e.listMessages(y,b?{since:b}:{}),R=(S==null?void 0:S.messages)||[];if(!R.length)return[];const g=new Set,C=new Set;for(const j of v)(j==null?void 0:j.id)!=null&&g.add(String(j.id)),j!=null&&j.client_msg_id&&C.add(j.client_msg_id);const x=[];for(const j of R){const te=(j==null?void 0:j.id)!=null&&g.has(String(j.id))||(j==null?void 0:j.client_msg_id)&&C.has(j.client_msg_id);he(y,j),te||x.push(j)}return x}catch(S){return console.error("[store] fetchSinceLast failed",S),[]}}async function w(y,v){if(!(!y||v==null))try{const b=await e.markConversationRead(y,v),S=(b==null?void 0:b.last_read_message_id)??v,R=t.conversations.findIndex(g=>(g==null?void 0:g.id)===y);R!==-1&&(t.conversations[R]={...t.conversations[R],last_read_message_id:S})}catch(b){console.error("[store] markConversationRead failed",b)}}async function V(y,v,{attachments:b,metadata:S}={}){var te;const R=(v||"").trim(),g=Array.isArray(b)&&b.length>0;if(!y||!R&&!g)return;const C=cc(),x=le(y),j={id:C,client_msg_id:C,conversation_id:y,type:"content",text_md:R,author:{type:"user",id:((te=t.customer)==null?void 0:te.external_id)||null},created_at:x,_pending:!0,...g?{payload:{type:"content",attachments:b}}:{},...S&&typeof S=="object"?{metadata:S}:{}};he(y,j);try{await e.postMessage(y,{client_msg_id:C,text_md:R,created_at:x,...g?{attachments:b}:{},...S&&typeof S=="object"?{metadata:S}:{}})}catch(Z){console.error("[store] send failed",Z),G(y,C,{_failed:!0,_pending:!1})}}async function O(y,v,b){y!=null&&(t.awaitingCallback[y]=!0);try{await e.postCallback(y,v,b)}catch(S){console.error("[store] callback failed",S),y!=null&&delete t.awaitingCallback[y]}}const J=new Map;async function W(y){if(!y)return null;const v=J.get(y);if(v!=null&&v.url){const b=v.expires_at?Date.parse(v.expires_at):0;if(!b||b-Date.now()>6e4)return v.url}try{const b=await e.signAttachment(y);if(b!=null&&b.signed_url)return J.set(y,{url:b.signed_url,expires_at:b.expires_at}),b.signed_url}catch(b){console.error("[store] sign attachment failed",b)}return null}async function U(y,{rating:v,comment:b}={}){const S=t.conversations.find(C=>C.id===y),g={...(S==null?void 0:S.metadata)||{},feedback:{rating:v,comment:b||null,submitted_at:new Date().toISOString()}};await p(y,{metadata:g})}function Q(y){var b,S;const v=t.messagesByConv[y]||[];for(let R=v.length-1;R>=0;R--){const g=v[R];if((g==null?void 0:g.type)==="action"&&((b=g==null?void 0:g.payload)==null?void 0:b.type)==="action"&&((S=g==null?void 0:g.payload)==null?void 0:S.state)==="pending"&&Array.isArray(g==null?void 0:g.callbacks)&&g.callbacks.length>0&&!t.awaitingCallback[g.id])return g}return null}function $(y){var b,S,R;const v=t.messagesByConv[y]||[];for(let g=v.length-1;g>=0;g--){const C=v[g];if(((b=C==null?void 0:C.author)==null?void 0:b.type)==="user"||(C==null?void 0:C.type)==="action"&&((S=C==null?void 0:C.payload)==null?void 0:S.state)==="pending")return null;const x=(R=C==null?void 0:C.metadata)==null?void 0:R.form;if(x&&Array.isArray(x.fields)&&x.fields.length>0)return{message:C,form:x}}return null}function se(y){const v=t.runningActionsByConv[y];if(!v)return null;const b=Object.keys(v);if(b.length===0)return null;const S=b[0];return{id:S,payload:{name:v[S]}}}function ge(y){var b,S,R,g;const v=t.messagesByConv[y]||[];for(let C=v.length-1;C>=0;C--){const x=v[C];if(((b=x==null?void 0:x.author)==null?void 0:b.type)==="user")return[];if((x==null?void 0:x.type)==="action"&&((S=x==null?void 0:x.payload)==null?void 0:S.state)==="pending")return[];if(((R=x==null?void 0:x.author)==null?void 0:R.type)!=="agent_ia")continue;const j=(g=x==null?void 0:x.metadata)==null?void 0:g.suggested_replies;return Array.isArray(j)&&j.length?j.map(te=>{if(typeof te=="string"){const Z=te.trim();return Z?{label:Z,kind:null}:null}if(te&&typeof te=="object"&&typeof te.label=="string"){const Z=te.label.trim();if(!Z)return null;const je=te.kind==="cta"||te.kind==="choice"||te.kind==="followup"?te.kind:null;return{label:Z,kind:je}}return null}).filter(Boolean).slice(0,4):[]}return[]}function he(y,v){var g;const b=t.messagesByConv[y]||[];let S=-1;v!=null&&v.client_msg_id&&(S=b.findIndex(C=>(C==null?void 0:C.client_msg_id)&&C.client_msg_id===v.client_msg_id)),S===-1&&(v==null?void 0:v.id)!==void 0&&(v==null?void 0:v.id)!==null&&(S=b.findIndex(C=>ke(C==null?void 0:C.id,v.id)));let R;S===-1?R=[...b,v].sort(ue):(R=b.slice(),R[S]={...b[S],...v,_pending:!1,_failed:!1}),t.messagesByConv[y]=R,(v==null?void 0:v.type)==="action"&&((g=v==null?void 0:v.payload)!=null&&g.state)&&v.payload.state!=="pending"&&(v==null?void 0:v.id)!=null&&t.awaitingCallback[v.id]&&delete t.awaitingCallback[v.id]}function ke(y,v){return y===v?!0:y==null||v==null?!1:String(y)===String(v)}function G(y,v,b){const S=t.messagesByConv[y];if(!S)return;const R=S.findIndex(C=>C.id===v);if(R===-1)return;const g=S.slice();g[R]={...S[R],...b},t.messagesByConv[y]=g}function ne(y,v){const b=t.conversations.findIndex(R=>R.id===y);if(b===-1)return;const S=t.conversations[b];if(v&&(!S.last_message_at||v>S.last_message_at)){const R=t.conversations.slice();R[b]={...S,last_message_at:v},R.sort((g,C)=>(C.last_message_at||"").localeCompare(g.last_message_at||"")),t.conversations=R}}function ue(y,v){return(y.created_at||"").localeCompare(v.created_at||"")}function H(y){if(!y||typeof y!="object")return null;const v={},b={};for(const[S,R]of Object.entries(y))R!==void 0&&(S==="name"||S==="email"||S==="language"?R!=null&&String(R).trim()!==""&&(v[S]=R):(S==="values"||S==="metadata")&&R&&typeof R=="object"?Object.assign(b,R):b[S]=R);return Object.keys(b).length&&(v.values=b),Object.keys(v).length?v:null}function le(y){const v=t.messagesByConv[y]||[];let b="";for(const g of v)g!=null&&g.created_at&&g.created_at>b&&(b=g.created_at);const S=new Date().toISOString();return!b||S>b?S:new Date(Date.parse(b)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:f,fetchSinceLast:A,patchConversation:p,markConversationRead:w,send:V,clickCallback:O,signAttachment:W,submitFeedback:U,getPendingApproval:Q,getActionInFlight:se,getLatestSuggestions:ge,getLatestForm:$,setPanelOpen:e.setPanelOpen}}const Ie={w:"#ffffff",g50:"#F9F9F7",g100:"#F2F1EE",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},gs=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function qs(e=""){return e?gs[e.charCodeAt(0)%gs.length]:gs[0]}function Gs(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function Is(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const ko=`
18
18
  @import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
19
19
 
20
20
  .wm-root {
@@ -62,8 +62,8 @@
62
62
  100% { transform: translateX(0); opacity: 1; }
63
63
  }
64
64
  `,dc="https://api.messenger.victorc.fr",fc=/^[a-zA-Z]{3,32}$/,hc=/^#[0-9a-fA-F]{3,8}$/,mc=/^(rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/]{1,60}\)$/;function pc(e){return typeof e!="string"||!e||e.length>64?!1:hc.test(e)||mc.test(e)||fc.test(e)}function gc(e){if(typeof e!="string"||!e||e.length>2048||/["'()\\;\s<>]/.test(e))return null;let t;try{t=new URL(e)}catch{return null}return t.protocol==="https:"||t.protocol==="http:"||t.protocol==="data:"&&/^data:image\//i.test(e)?e:null}const yn="fr",_c=["fr","en"],Vr={fr:"fr-FR",en:"en-US"},_s={fr:{"common.newConversation":"Nouvelle conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"Assistant IA","common.system":"Systรจme","common.you":"Vous","common.action":"Action","common.yes":"Oui","common.no":"Non","common.send":"Envoyer","common.sending":"Envoiโ€ฆ","common.cancel":"Annuler","common.save":"Enregistrer","common.close":"Fermer","common.open":"Ouvrir","loading.minimize":"Rรฉduire","error.connectionFailed":"Connexion impossible","header.backToHome":"Retour ร  l'accueil","header.moreOptions":"Plus d'options","header.closeWidget":"Fermer le widget","launcher.open":"Ouvrir le messenger","launcher.openConversationWith":"Ouvrir la conversation avec {name}","launcher.theAgent":"l'agent","launcher.dismiss":"Ignorer","launcher.repliedToYou":" vous a rรฉpondu","launcher.unreadMessages":"{count} messages non lus","launcher.unreadConversationsOne":"{count} conversation non lue","launcher.unreadConversationsMany":"{count} conversations non lues","onboarding.start":"Commencer une conversation","onboarding.quickAccess":"Accรจs rapide","onboarding.recentConversations":"Conversations rรฉcentes","onboarding.search":"Rechercher dans vos messages","onboarding.unread":"Non lu","onboarding.noResults":"Aucun rรฉsultat pour ยซ {query} ยป.","onboarding.greetingNamed":"Bonjour, je suis {name}","onboarding.greeting":"Bonjour, je suis votre assistant","onboarding.heroSub":`Posez-moi n'importe quelle question.
65
- Je rรฉponds en quelques secondes.`,"onboarding.newMessage":"Nouveau message","onboarding.statusInProgress":"En cours","onboarding.resume":"Reprendre","onboarding.unreadConversations":"Conversations non lues","onboarding.allConversations":"Toutes les conversations","onboarding.noConversations":"Aucune conversation pour le moment.","composer.placeholder":"ร‰crivez votre messageโ€ฆ","composer.replyTo":"Rรฉpondre ร  {name}โ€ฆ","composer.agentTakingOver":"Un agent prend le relaisโ€ฆ","composer.send":"Envoyer","composer.attach":"Joindre","composer.attachFile":"Joindre un fichier","composer.screenshot":"Capture d'รฉcran","composer.recordScreen":"Enregistrer l'รฉcran","composer.recording":"Enregistrement ยท {time}","composer.stop":"Arrรชter","messageList.loadingHistory":"Chargement de l'historiqueโ€ฆ","messageList.conversationStart":"Dรฉbut de la conversation","messageList.unread":"Non lus","messageList.today":"Aujourd'hui ยท {time}","messageList.approvalRequestSent":"Demande d'approbation envoyรฉe","messageList.conversationUpdate":"Mise ร  jour de la conversation","messageList.anAgent":"Un agent","messageList.scrollToBottom":"Aller en bas","system.transferredToHuman":"Conversation transfรฉrรฉe ร  un humain","system.assigned":"{name} a rejoint la conversation","system.unassigned":"L'agent a quittรฉ la conversation","system.resolved":"Conversation rรฉsolue","system.reopened":"Conversation rouverte","system.idle":"Conversation en pause","action.title":"Confirmer l'action","action.inProgress":"{name} en cours, veuillez patienterโ€ฆ","action.rejectedByUser":"Action annulรฉe par l'utilisateur.","approval.approve":"Autoriser","approval.reject":"Refuser","moreMenu.editTitle":"Modifier le titre","moreMenu.exportTranscript":"Exporter la transcription","moreMenu.sound":"Son","moreMenu.browserNotifications":"Notifications navigateur","moreMenu.serviceStatus":"Statut des services","moreMenu.helpCenter":"Centre d'aide","feedback.question":"Comment s'est passรฉe cette conversation ?","feedback.subtitle":"Votre avis nous aide ร  amรฉliorer l'assistant.","feedback.rating1":"Pas bien","feedback.rating2":"Moyen","feedback.rating3":"Bien","feedback.rating4":"Super","feedback.rating5":"Excellent","feedback.submit":"Envoyer mon avis","feedback.doneTitle":"Merci pour votre retour !","feedback.doneSubtitle":"Votre avis a bien รฉtรฉ pris en compte.","rename.dialogTitle":"Modifier le titre de la conversation","rename.title":"Modifier le titre","rename.placeholder":"Titre de la conversation","form.title":"Formulaire","form.choose":"Choisirโ€ฆ","form.responseSent":"Rรฉponse envoyรฉe","form.sent":"Envoyรฉ","form.fieldRequired":"ยซ {label} ยป est requis.","ticket.dateAt":" ร  ","attachment.fallbackName":"Piรจce jointe","attachment.remove":"Retirer","attachment.fileFallbackName":"fichier","attachment.bytes":"{size} o","attachment.kilobytes":"{size} ko","attachment.megabytes":"{size} Mo","notification.newMessage":"Nouveau message","notification.youHaveNewMessage":"Vous avez un nouveau message","export.createdOn":"Crรฉรฉe le : {date}"},en:{"common.newConversation":"New conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"AI Assistant","common.system":"System","common.you":"You","common.action":"Action","common.yes":"Yes","common.no":"No","common.send":"Send","common.sending":"Sendingโ€ฆ","common.cancel":"Cancel","common.save":"Save","common.close":"Close","common.open":"Open","loading.minimize":"Minimize","error.connectionFailed":"Connection failed","header.backToHome":"Back to home","header.moreOptions":"More options","header.closeWidget":"Close widget","launcher.open":"Open the messenger","launcher.openConversationWith":"Open the conversation with {name}","launcher.theAgent":"the agent","launcher.dismiss":"Dismiss","launcher.repliedToYou":" replied to you","launcher.unreadMessages":"{count} unread messages","launcher.unreadConversationsOne":"{count} unread conversation","launcher.unreadConversationsMany":"{count} unread conversations","onboarding.start":"Start a conversation","onboarding.quickAccess":"Quick access","onboarding.recentConversations":"Recent conversations","onboarding.search":"Search your messages","onboarding.unread":"Unread","onboarding.noResults":"No results for โ€œ{query}โ€.","onboarding.greetingNamed":"Hi, I'm {name}","onboarding.greeting":"Hi, I'm your assistant","onboarding.heroSub":`Ask me anything.
66
- I reply within seconds.`,"onboarding.newMessage":"New message","onboarding.statusInProgress":"In progress","onboarding.resume":"Resume","onboarding.unreadConversations":"Unread conversations","onboarding.allConversations":"All conversations","onboarding.noConversations":"No conversations yet.","composer.placeholder":"Type your messageโ€ฆ","composer.replyTo":"Reply to {name}โ€ฆ","composer.agentTakingOver":"An agent is taking overโ€ฆ","composer.send":"Send","composer.attach":"Attach","composer.attachFile":"Attach a file","composer.screenshot":"Screenshot","composer.recordScreen":"Record screen","composer.recording":"Recording ยท {time}","composer.stop":"Stop","messageList.loadingHistory":"Loading historyโ€ฆ","messageList.conversationStart":"Start of the conversation","messageList.unread":"Unread","messageList.today":"Today ยท {time}","messageList.approvalRequestSent":"Approval request sent","messageList.conversationUpdate":"Conversation update","messageList.anAgent":"An agent","messageList.scrollToBottom":"Scroll to bottom","system.transferredToHuman":"Conversation transferred to a human","system.assigned":"{name} joined the conversation","system.unassigned":"The agent left the conversation","system.resolved":"Conversation resolved","system.reopened":"Conversation reopened","system.idle":"Conversation paused","action.title":"Confirm the action","action.inProgress":"{name} in progress, please waitโ€ฆ","action.rejectedByUser":"Action cancelled by the user.","approval.approve":"Approve","approval.reject":"Decline","moreMenu.editTitle":"Edit title","moreMenu.exportTranscript":"Export transcript","moreMenu.sound":"Sound","moreMenu.browserNotifications":"Browser notifications","moreMenu.serviceStatus":"Service status","moreMenu.helpCenter":"Help center","feedback.question":"How was this conversation?","feedback.subtitle":"Your feedback helps us improve the assistant.","feedback.rating1":"Poor","feedback.rating2":"Okay","feedback.rating3":"Good","feedback.rating4":"Great","feedback.rating5":"Excellent","feedback.submit":"Send my feedback","feedback.doneTitle":"Thanks for your feedback!","feedback.doneSubtitle":"Your feedback has been recorded.","rename.dialogTitle":"Edit conversation title","rename.title":"Edit title","rename.placeholder":"Conversation title","form.title":"Form","form.choose":"Chooseโ€ฆ","form.responseSent":"Response sent","form.sent":"Sent","form.fieldRequired":"โ€œ{label}โ€ is required.","ticket.dateAt":" at ","attachment.fallbackName":"Attachment","attachment.remove":"Remove","attachment.fileFallbackName":"file","attachment.bytes":"{size} B","attachment.kilobytes":"{size} KB","attachment.megabytes":"{size} MB","notification.newMessage":"New message","notification.youHaveNewMessage":"You have a new message","export.createdOn":"Created on: {date}"}};function Ys(e){if(typeof e!="string")return yn;const t=e.trim().toLowerCase().slice(0,2);return _c.includes(t)?t:yn}function Kt(e){return Vr[Ys(e)]||Vr[yn]}function xe(e){const t=Ys(e),n=_s[t]||_s[yn],r=_s[yn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,f)=>o[f]!=null?String(o[f]):l)),a)}}function Kr(e,t){if(!Array.isArray(e==null?void 0:e.options))return t;const n=e.options.find(r=>(r==null?void 0:r.value)===t);return(n==null?void 0:n.label)||t}function Co(e,t,n){return Array.isArray(t)?t.map(r=>Kr(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):Kr(e,String(t))}function yc(e,t,n=xe()){if(!e||!t)return"";const r=Array.isArray(e.fields)?e.fields:[],i=[];for(const s of r){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t[s.key];if(o==null||o==="")continue;const a=Co(s,o,n);a&&i.push(`${s.label} :
65
+ Je rรฉponds en quelques secondes.`,"onboarding.newMessage":"Nouveau message","onboarding.statusInProgress":"En cours","onboarding.resume":"Reprendre","onboarding.unreadConversations":"Conversations non lues","onboarding.allConversations":"Toutes les conversations","onboarding.noConversations":"Aucune conversation pour le moment.","composer.placeholder":"ร‰crivez votre messageโ€ฆ","composer.replyTo":"Rรฉpondre ร  {name}โ€ฆ","composer.agentTakingOver":"Un agent prend le relaisโ€ฆ","composer.send":"Envoyer","composer.attach":"Joindre","composer.attachFile":"Joindre un fichier","composer.screenshot":"Capture d'รฉcran","composer.recordScreen":"Enregistrer l'รฉcran","composer.recording":"Enregistrement ยท {time}","composer.stop":"Arrรชter","messageList.loadingHistory":"Chargement de l'historiqueโ€ฆ","messageList.conversationStart":"Dรฉbut de la conversation","messageList.unread":"Non lus","messageList.today":"Aujourd'hui ยท {time}","messageList.approvalRequestSent":"Demande d'approbation envoyรฉe","messageList.conversationUpdate":"Mise ร  jour de la conversation","messageList.anAgent":"Un agent","messageList.scrollToBottom":"Aller en bas","system.transferredToHuman":"Conversation transfรฉrรฉe ร  un humain","system.assigned":"{name} a rejoint la conversation","system.unassigned":"L'agent a quittรฉ la conversation","system.resolved":"Conversation rรฉsolue","system.reopened":"Conversation rouverte","system.idle":"Conversation en pause","action.title":"Confirmer l'action","action.inProgress":"{name} en cours, veuillez patienterโ€ฆ","action.rejectedByUser":"Action annulรฉe par l'utilisateur.","approval.approve":"Autoriser","approval.reject":"Refuser","moreMenu.editTitle":"Modifier le titre","moreMenu.exportTranscript":"Exporter la transcription","moreMenu.sound":"Son","moreMenu.serviceStatus":"Statut des services","moreMenu.helpCenter":"Centre d'aide","feedback.question":"Comment s'est passรฉe cette conversation ?","feedback.subtitle":"Votre avis nous aide ร  amรฉliorer l'assistant.","feedback.rating1":"Pas bien","feedback.rating2":"Moyen","feedback.rating3":"Bien","feedback.rating4":"Super","feedback.rating5":"Excellent","feedback.submit":"Envoyer mon avis","feedback.doneTitle":"Merci pour votre retour !","feedback.doneSubtitle":"Votre avis a bien รฉtรฉ pris en compte.","rename.dialogTitle":"Modifier le titre de la conversation","rename.title":"Modifier le titre","rename.placeholder":"Titre de la conversation","form.title":"Formulaire","form.choose":"Choisirโ€ฆ","form.responseSent":"Rรฉponse envoyรฉe","form.sent":"Envoyรฉ","form.fieldRequired":"ยซ {label} ยป est requis.","ticket.dateAt":" ร  ","attachment.fallbackName":"Piรจce jointe","attachment.remove":"Retirer","attachment.fileFallbackName":"fichier","attachment.bytes":"{size} o","attachment.kilobytes":"{size} ko","attachment.megabytes":"{size} Mo","notification.newMessage":"Nouveau message","notification.youHaveNewMessage":"Vous avez un nouveau message","export.createdOn":"Crรฉรฉe le : {date}"},en:{"common.newConversation":"New conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"AI Assistant","common.system":"System","common.you":"You","common.action":"Action","common.yes":"Yes","common.no":"No","common.send":"Send","common.sending":"Sendingโ€ฆ","common.cancel":"Cancel","common.save":"Save","common.close":"Close","common.open":"Open","loading.minimize":"Minimize","error.connectionFailed":"Connection failed","header.backToHome":"Back to home","header.moreOptions":"More options","header.closeWidget":"Close widget","launcher.open":"Open the messenger","launcher.openConversationWith":"Open the conversation with {name}","launcher.theAgent":"the agent","launcher.dismiss":"Dismiss","launcher.repliedToYou":" replied to you","launcher.unreadMessages":"{count} unread messages","launcher.unreadConversationsOne":"{count} unread conversation","launcher.unreadConversationsMany":"{count} unread conversations","onboarding.start":"Start a conversation","onboarding.quickAccess":"Quick access","onboarding.recentConversations":"Recent conversations","onboarding.search":"Search your messages","onboarding.unread":"Unread","onboarding.noResults":"No results for โ€œ{query}โ€.","onboarding.greetingNamed":"Hi, I'm {name}","onboarding.greeting":"Hi, I'm your assistant","onboarding.heroSub":`Ask me anything.
66
+ I reply within seconds.`,"onboarding.newMessage":"New message","onboarding.statusInProgress":"In progress","onboarding.resume":"Resume","onboarding.unreadConversations":"Unread conversations","onboarding.allConversations":"All conversations","onboarding.noConversations":"No conversations yet.","composer.placeholder":"Type your messageโ€ฆ","composer.replyTo":"Reply to {name}โ€ฆ","composer.agentTakingOver":"An agent is taking overโ€ฆ","composer.send":"Send","composer.attach":"Attach","composer.attachFile":"Attach a file","composer.screenshot":"Screenshot","composer.recordScreen":"Record screen","composer.recording":"Recording ยท {time}","composer.stop":"Stop","messageList.loadingHistory":"Loading historyโ€ฆ","messageList.conversationStart":"Start of the conversation","messageList.unread":"Unread","messageList.today":"Today ยท {time}","messageList.approvalRequestSent":"Approval request sent","messageList.conversationUpdate":"Conversation update","messageList.anAgent":"An agent","messageList.scrollToBottom":"Scroll to bottom","system.transferredToHuman":"Conversation transferred to a human","system.assigned":"{name} joined the conversation","system.unassigned":"The agent left the conversation","system.resolved":"Conversation resolved","system.reopened":"Conversation reopened","system.idle":"Conversation paused","action.title":"Confirm the action","action.inProgress":"{name} in progress, please waitโ€ฆ","action.rejectedByUser":"Action cancelled by the user.","approval.approve":"Approve","approval.reject":"Decline","moreMenu.editTitle":"Edit title","moreMenu.exportTranscript":"Export transcript","moreMenu.sound":"Sound","moreMenu.serviceStatus":"Service status","moreMenu.helpCenter":"Help center","feedback.question":"How was this conversation?","feedback.subtitle":"Your feedback helps us improve the assistant.","feedback.rating1":"Poor","feedback.rating2":"Okay","feedback.rating3":"Good","feedback.rating4":"Great","feedback.rating5":"Excellent","feedback.submit":"Send my feedback","feedback.doneTitle":"Thanks for your feedback!","feedback.doneSubtitle":"Your feedback has been recorded.","rename.dialogTitle":"Edit conversation title","rename.title":"Edit title","rename.placeholder":"Conversation title","form.title":"Form","form.choose":"Chooseโ€ฆ","form.responseSent":"Response sent","form.sent":"Sent","form.fieldRequired":"โ€œ{label}โ€ is required.","ticket.dateAt":" at ","attachment.fallbackName":"Attachment","attachment.remove":"Remove","attachment.fileFallbackName":"file","attachment.bytes":"{size} B","attachment.kilobytes":"{size} KB","attachment.megabytes":"{size} MB","notification.newMessage":"New message","notification.youHaveNewMessage":"You have a new message","export.createdOn":"Created on: {date}"}};function Ys(e){if(typeof e!="string")return yn;const t=e.trim().toLowerCase().slice(0,2);return _c.includes(t)?t:yn}function Kt(e){return Vr[Ys(e)]||Vr[yn]}function xe(e){const t=Ys(e),n=_s[t]||_s[yn],r=_s[yn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,f)=>o[f]!=null?String(o[f]):l)),a)}}function Kr(e,t){if(!Array.isArray(e==null?void 0:e.options))return t;const n=e.options.find(r=>(r==null?void 0:r.value)===t);return(n==null?void 0:n.label)||t}function Co(e,t,n){return Array.isArray(t)?t.map(r=>Kr(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):Kr(e,String(t))}function yc(e,t,n=xe()){if(!e||!t)return"";const r=Array.isArray(e.fields)?e.fields:[],i=[];for(const s of r){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t[s.key];if(o==null||o==="")continue;const a=Co(s,o,n);a&&i.push(`${s.label} :
67
67
  ${a}`)}return i.join(`
68
68
 
69
69
  `)}function vc(e,t,n=xe()){const r=[],i=Array.isArray(e==null?void 0:e.fields)?e.fields:[];for(const s of i){if(!(s!=null&&s.key)||!(s!=null&&s.label))continue;const o=t==null?void 0:t[s.key];if(o==null||o==="")continue;const a=Co(s,o,n);if(!a)continue;const l=s.type==="textarea"||typeof a=="string"&&(a.length>60||a.includes(`
@@ -71,4 +71,4 @@ ${a}`)}return i.join(`
71
71
  `),n=[];let r=0;for(;r<t.length;){const s=t[r];if(/^\s*```([\w-]*)\s*$/.exec(s)){r++;const f=[];for(;r<t.length&&!/^\s*```\s*$/.test(t[r]);)f.push(t[r]),r++;r<t.length&&r++,n.push({type:"block",html:`<pre class="wm-md-pre"><code>${f.join(`
72
72
  `)}</code></pre>`});continue}if(/^\s*[-*]\s+/.test(s)){const f=[];for(;r<t.length;){const p=/^\s*[-*]\s+(.*)$/.exec(t[r]);if(!p)break;f.push(p[1]),r++}const c=f.map(p=>`<li>${tn(p)}</li>`).join("");n.push({type:"block",html:`<ul class="wm-md-ul">${c}</ul>`});continue}const a=/^\s*(\d+)\.\s+(.*)$/.exec(s);if(a){const f=parseInt(a[1],10),c=[a[2]];for(r++;r<t.length;){const w=/^\s*\d+\.\s+(.*)$/.exec(t[r]);if(!w)break;c.push(w[1]),r++}const p=c.map(w=>`<li>${tn(w)}</li>`).join(""),A=f!==1?` start="${f}"`:"";n.push({type:"block",html:`<ol class="wm-md-ol"${A}>${p}</ol>`});continue}const l=/^(#{1,6})\s+(.*)$/.exec(s);if(l){const f=l[1].length;n.push({type:"block",html:`<h${f} class="wm-md-h wm-md-h${f}">${tn(l[2])}</h${f}>`}),r++;continue}n.push({type:"text",html:tn(s)}),r++}let i="";for(let s=0;s<n.length;s++){const o=n[s];i+=o.html;const a=n[s+1];a&&o.type!=="block"&&a.type!=="block"&&(i+=`
73
73
  `)}return i}function vn(e){var n;const t=(n=e==null?void 0:e.author)==null?void 0:n.type;return t==="agent_ia"||t==="agent_human"}function ft(e){if(e==null)return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Wr(e,t){let n=(e==null?void 0:e.last_message_at)||(e==null?void 0:e.updated_at)||(e==null?void 0:e.created_at)||"";for(const r of t)r!=null&&r.created_at&&r.created_at>n&&(n=r.created_at);return n}function kc(e,t){var n,r,i;for(let s=t.length-1;s>=0;s--){const o=t[s];if(!o)continue;const a=typeof o.text_md=="string"?o.text_md.trim():"";if(a)return(((n=o.author)==null?void 0:n.type)==="user"?"Vous : ":"")+a.replace(/\s+/g," ");const l=(r=o.payload)==null?void 0:r.attachments;if(Array.isArray(l)&&l.length)return"๐Ÿ“Ž Piรจce jointe"}return(e==null?void 0:e.last_message_preview)||(e==null?void 0:e.preview)||((i=e==null?void 0:e.metadata)==null?void 0:i.last_preview)||""}function Cc(e,t){return(e==null?void 0:e.name)||((e==null?void 0:e.type)==="user"?t("common.you"):(e==null?void 0:e.type)==="agent_human"?t("common.agent"):(e==null?void 0:e.type)==="agent_ia"?t("common.aiAssistant"):t("common.system"))}function Sc(e,t,n,r){const i=[`# ${e.name||n("common.conversation")}`,e.created_at?n("export.createdOn",{date:new Date(e.created_at).toLocaleString(r)}):"",""];for(const s of t){if(!s)continue;const o=(s.text_md||"").trim();if(!o)continue;const a=Cc(s.author,n),l=s.created_at?new Date(s.created_at).toLocaleString(r):"";i.push(`[${l}] ${a} :`),i.push(o),i.push("")}return i.join(`
74
- `)}function Ac(e,t,n=xe(),r){if(!e)return;const i=Sc(e,t||[],n,Kt(r)),s=new Blob([i],{type:"text/plain;charset=utf-8"});try{const o=URL.createObjectURL(s),a=document.createElement("a");a.href=o,a.download=`${(e.name||"conversation").replace(/[^a-z0-9-_]+/gi,"_")}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(o),1e3)}catch(o){console.error("[ww-messenger] export failed",o)}}const xc={data(){const e=typeof Notification<"u";return{notifPermission:e?Notification.permission:"denied",soundEnabled:!0,browserNotifEnabled:e&&Notification.permission==="granted",_audioCtx:null}},methods:{teardownNotifications(){var e,t;if(this._audioCtx){try{(t=(e=this._audioCtx).close)==null||t.call(e)}catch{}this._audioCtx=null}},soundStorageKey(){return`wm:notif:sound:${this.widgetId||""}`},browserNotifStorageKey(){return`wm:notif:browser:${this.widgetId||""}`},hydrateNotifPref(){try{if(typeof localStorage>"u")return;const e=localStorage.getItem(this.soundStorageKey());e==="0"?this.soundEnabled=!1:e==="1"&&(this.soundEnabled=!0);const t=localStorage.getItem(this.browserNotifStorageKey());t==="0"?this.browserNotifEnabled=!1:t==="1"&&(this.browserNotifEnabled=typeof Notification<"u"&&Notification.permission==="granted")}catch{}},persistSoundPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.soundStorageKey(),this.soundEnabled?"1":"0")}catch{}},persistBrowserNotifPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.browserNotifStorageKey(),this.browserNotifEnabled?"1":"0")}catch{}},onSoundToggle(e){this.soundEnabled=!!e,this.persistSoundPref()},async onBrowserNotifToggle(e){if(typeof Notification>"u"){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}if(!e){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}let t=Notification.permission;if(t==="default"){try{t=await Notification.requestPermission()}catch(n){console.warn("[ww-messenger] notif permission request failed",n),t="denied"}this.notifPermission=t}this.browserNotifEnabled=t==="granted",this.persistBrowserNotifPref()},onMessageRevealed(e,t){var i;if(!this.soundEnabled&&!this.browserNotifEnabled||!t||!e||!vn(e))return;const n=typeof document<"u"&&document.hidden;this.isOpen&&!n&&((i=this.currentConv)==null?void 0:i.id)===t||(this.soundEnabled&&this.playNotificationSound(),this.browserNotifEnabled&&this.showBrowserNotification(t,e))},playNotificationSound(){if(typeof window>"u")return;const e=window.AudioContext||window.webkitAudioContext;if(e)try{this._audioCtx||(this._audioCtx=new e);const t=this._audioCtx;if(t.state==="suspended")try{t.resume()}catch{}const n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.connect(i),i.connect(t.destination),r.type="sine",r.frequency.setValueAtTime(880,n),r.frequency.exponentialRampToValueAtTime(1320,n+.08),i.gain.setValueAtTime(0,n),i.gain.linearRampToValueAtTime(.12,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.28),r.start(n),r.stop(n+.32)}catch{}},showBrowserNotification(e,t){if(typeof Notification>"u"||Notification.permission!=="granted")return;const n=t==null?void 0:t.author,r=!n||n.type==="agent_ia",s=((n==null?void 0:n.name)||(r?this.agentName:"")||this.t("launcher.theAgent"))+this.t("launcher.repliedToYou"),o=typeof(t==null?void 0:t.text_md)=="string"?t.text_md.trim():"",a=o?o.slice(0,140):this.t("notification.youHaveNewMessage");try{const l=new Notification(s,{body:a,tag:`wm-${e}`,renotify:!1,silent:!0});l.onclick=()=>{try{window.focus()}catch{}this.draftConv=null,this.showOnboarding=!1,this.activeConvId=e,this.isOpen=!0,this.store&&this.store.setPanelOpen(!0);try{l.close()}catch{}}}catch(l){console.warn("[ww-messenger] notification failed",l)}}}},Tc=450,Mc=50,Ec=900,Oc=12e3,Ic=300,Rc={data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",r=>{const i=r==null?void 0:r.conversation_id,s=r==null?void 0:r.message;i&&s&&this.paceLiveMessage(s,i)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(r=>[r.id,(r==null?void 0:r.last_message_at)||""]));const t=this.transport.on("activity",r=>{this.handleLiveActivity(r)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null},async handleLiveActivity(e){var i,s;const t=e==null?void 0:e.conversations;if(!Array.isArray(t)||!this.store)return;const n=this._liveRevealConvSnapshot||new Map,r=[];for(const o of t){if(!(o!=null&&o.id))continue;const a=o.last_message_at||"";if(!a)continue;const l=n.get(o.id)||"";a>l&&r.push(o.id)}this._liveRevealConvSnapshot=new Map(t.map(o=>[o.id,(o==null?void 0:o.last_message_at)||""]));for(const o of r)try{const a=await((s=(i=this.store).fetchSinceLast)==null?void 0:s.call(i,o));if(!Array.isArray(a))continue;for(const l of a)this.paceLiveMessage(l,o)}catch(a){console.error("[ww-messenger] activity delta fetch failed",a)}},scheduleReveal(e,t){const n=Date.now(),r=((e==null?void 0:e.text_md)||"").length,i=Math.min(Oc,Math.max(Ec,r*Mc)),o=Math.max(n+Tc,this.nextRevealAt+Ic)+i;this.nextRevealAt=o;const a=Math.max(0,o-n),l=e.id,f=setTimeout(()=>{this.revealedAt={...this.revealedAt,[l]:Date.now()},this.revealTimers=this.revealTimers.filter(c=>c!==f),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},a);this.revealTimers.push(f)},paceMessages(e,t){var i;if(!Array.isArray(e)||!e.length)return;const n=Date.now(),r={...this.revealedAt};for(const s of e){if((s==null?void 0:s.id)==null||r[s.id]!==void 0)continue;if(!vn(s)){r[s.id]=n;continue}const o=s!=null&&s.created_at?Date.parse(s.created_at):NaN;if(!Number.isFinite(o)||o<this.convOpenedAt){r[s.id]=n;continue}const a=typeof(s==null?void 0:s.text_md)=="string"&&s.text_md.trim().length>0,l=Array.isArray((i=s==null?void 0:s.payload)==null?void 0:i.attachments)&&s.payload.attachments.length>0;if(!a&&!l){r[s.id]=n;continue}r[s.id]=0,this.scheduleReveal(s,t)}this.revealedAt=r},paceLiveMessage(e,t){var i;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!vn(e)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const n=typeof(e==null?void 0:e.text_md)=="string"&&e.text_md.trim().length>0,r=Array.isArray((i=e==null?void 0:e.payload)==null?void 0:i.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Lc={data(){return{approvalSettled:!0,approvalSettleTimer:null,approvalLatchId:null}},methods:{resetApprovalPacing(){this.approvalSettleTimer&&(clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=null),this.approvalSettled=!0,this.approvalLatchId=null},bumpApprovalSettle(e=800){this.approvalSettled=!1,this.approvalSettleTimer&&clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=setTimeout(()=>{this.approvalSettled=!0,this.approvalSettleTimer=null},e)}}},Pc=300,Bc={data(){return{unreadAnchorId:null,unreadBoundaryTs:""}},created(){this._readMarkerTimer=null,this._readMarkerPending=null},beforeUnmount(){this._readMarkerTimer&&(clearTimeout(this._readMarkerTimer),this._readMarkerTimer=null),this._readMarkerPending=null},methods:{markConvRead(e){var s,o;if(!(e!=null&&e.id)||e._draft||!this.store)return;const t=((o=(s=this.s)==null?void 0:s.messagesByConv)==null?void 0:o[e.id])||[],n=Nc(t);if(n==null)return;const r=ft(e.last_read_message_id),i=ft(n);i!=null&&(r!=null&&i<=r||(this._readMarkerPending={convId:e.id,messageId:n},!this._readMarkerTimer&&(this._readMarkerTimer=setTimeout(()=>{const a=this._readMarkerPending;this._readMarkerPending=null,this._readMarkerTimer=null,a&&this.store&&this.store.markConversationRead(a.convId,a.messageId)},Pc))))}}};function Nc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&ft(n.id)!=null)return n.id}return null}const we=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Fc={name:"WmHumanAvatar",props:{name:{type:String,default:""},avatarUrl:{type:String,default:null},size:{type:Number,default:26},tail:{type:Boolean,default:!1}},computed:{bg(){return this.avatarUrl?"transparent":qs(this.name)},initials(){return Gs(this.name)}}},Dc=["src","alt"];function jc(e,t,n,r,i,s){return h(),_("div",{class:re(["wm-huav",{"wm-huav--tail":n.tail}]),style:Oe({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(h(),_("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Dc)):(h(),_("span",{key:1,style:Oe({fontSize:n.size*.36+"px"})},L(s.initials),5))],6)}const Js=we(Fc,[["render",jc],["__scopeId","data-v-14e10c0d"]]),Uc=3,Hc={name:"WmLauncher",components:{HumanAvatar:Js},inject:{t:{default:()=>xe()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Uc).reverse()}}},$c=["aria-label","onClick","onKeydown"],Vc=["aria-label","onClick"],Kc={class:"wm-peek__avatar"},zc=["aria-label"],Wc={class:"wm-peek__body"},qc={class:"wm-peek__head"},Gc={class:"wm-peek__name"},Yc={class:"wm-peek__action"},Jc={class:"wm-peek__text"},Xc=["onClick"],Qc=["aria-label"],Zc=["aria-label"];function eu(e,t,n,r,i,s){const o=_e("HumanAvatar");return h(),_("div",{class:"wm-launcherWrap",onMouseenter:t[1]||(t[1]=a=>e.$emit("hover",!0)),onMouseleave:t[2]||(t[2]=a=>e.$emit("hover",!1)),onFocusin:t[3]||(t[3]=a=>e.$emit("hover",!0)),onFocusout:t[4]||(t[4]=a=>e.$emit("hover",!1))},[ve(bo,{name:"wm-peek"},{default:Vs(()=>[s.visiblePeeks.length?(h(),_("div",{key:0,class:re(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(h(!0),_(ee,null,Se(s.visiblePeeks,(a,l)=>(h(),_("div",{key:a.convId,class:"wm-peek",style:Oe({"--depth":s.visiblePeeks.length-1-l,zIndex:l+1}),role:"button",tabindex:"0","aria-label":s.t("launcher.openConversationWith",{name:a.senderName||s.t("launcher.theAgent")}),onClick:f=>e.$emit("open",a.convId),onKeydown:[Dn(ht(f=>e.$emit("open",a.convId),["prevent"]),["enter"]),Dn(ht(f=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:ht(f=>e.$emit("dismiss",a.convId),["stop"])},[...t[5]||(t[5]=[u("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Vc),u("div",Kc,[ve(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(h(),_("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},L(a.count>9?"9+":a.count),9,zc)):F("",!0)]),u("div",Wc,[u("div",qc,[u("span",Gc,L(a.senderName||s.t("common.agent")),1),u("span",Yc,L(s.t("launcher.repliedToYou")),1)]),u("p",Jc,L(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:ht(f=>e.$emit("open",a.convId),["stop"])},L(s.t("common.open")),9,Xc)],44,$c))),128))],2)):F("",!0)]),_:1}),u("button",{type:"button",class:"wm-launcher","aria-label":s.t("launcher.open"),onClick:t[0]||(t[0]=a=>e.$emit("open"))},[t[6]||(t[6]=u("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),n.unreadCount>0?(h(),_("span",{key:0,class:"wm-launcher__badge","aria-label":n.unreadCount>1?s.t("launcher.unreadConversationsMany",{count:n.unreadCount}):s.t("launcher.unreadConversationsOne",{count:n.unreadCount})},L(n.unreadCount>9?"9+":n.unreadCount),9,Zc)):F("",!0)],8,Qc)],32)}const tu=we(Hc,[["render",eu],["__scopeId","data-v-44ddf1a1"]]),nu={name:"WmAIAvatar",props:{size:{type:Number,default:26},pulse:{type:Boolean,default:!1},tail:{type:Boolean,default:!1},name:{type:String,default:""},imageUrl:{type:String,default:null}},computed:{initials(){return Gs(this.name)},bgColor(){return qs(this.name)}}},su={key:0,class:"wm-aiav__pulse"},ru=["src","alt"],iu=["width","height"];function ou(e,t,n,r,i,s){return h(),_("div",{class:re(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:Oe({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(h(),_("div",su)):F("",!0),u("div",{class:re(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:Oe(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(h(),_("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,ru)):s.initials?(h(),_("span",{key:1,style:Oe({fontSize:n.size*.36+"px"})},L(s.initials),5)):(h(),_("svg",{key:2,width:n.size*.5,height:n.size*.5,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[...t[0]||(t[0]=[u("path",{d:"M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",fill:"white",opacity:"0.92"},null,-1),u("circle",{cx:"19",cy:"5",r:"1.5",fill:"white",opacity:"0.55"},null,-1),u("circle",{cx:"5",cy:"18",r:"1",fill:"white",opacity:"0.38"},null,-1)])],8,iu))],6)],6)}const qt=we(nu,[["render",ou],["__scopeId","data-v-6f7f685d"]]),au={name:"WmTeamAvatars",props:{members:{type:Array,default:()=>[]},responseLabel:{type:String,default:""}},computed:{visible(){return Array.isArray(this.members)&&this.members.length>0},stackWidth(){return Math.min(this.members.length,3)===1?20:16+Math.min(this.members.length,3)*13}},methods:{colorFor(e){return e.avatar_url?"transparent":qs(e.name||"")},initialsFor(e){return Gs(e.name||"")}}},lu={key:0,class:"wm-team"},cu=["src","alt"],uu={key:1},du={key:0,class:"wm-team__label"};function fu(e,t,n,r,i,s){return s.visible?(h(),_("div",lu,[u("div",{class:"wm-team__stack",style:Oe({width:s.stackWidth+"px"})},[(h(!0),_(ee,null,Se(n.members.slice(0,3),(o,a)=>(h(),_("div",{key:a,class:"wm-team__pill",style:Oe({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(h(),_("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,cu)):(h(),_("span",uu,L(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(h(),_("span",du,L(n.responseLabel),1)):F("",!0)])):F("",!0)}const hu=we(au,[["render",fu],["__scopeId","data-v-e49a9063"]]),mu={name:"WmHeader",components:{AIAvatar:qt,TeamAvatars:hu},inject:{t:{default:()=>xe()}},props:{title:{type:String,default:"Nouvelle conversation"},showBack:{type:Boolean,default:!1},teamMembers:{type:Array,default:()=>[]},responseLabel:{type:String,default:""},showClose:{type:Boolean,default:!0},showMore:{type:Boolean,default:!0},moreActive:{type:Boolean,default:!1},showIdentity:{type:Boolean,default:!0},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["back","close","more"],computed:{hasTeam(){return Array.isArray(this.teamMembers)&&this.teamMembers.length>0},displayedTeamMembers(){const e=Array.isArray(this.teamMembers)?this.teamMembers:[];if(e.length<=3)return e;const t=new Date().getHours()%e.length,n=[];for(let r=0;r<3;r++)n.push(e[(t+r)%e.length]);return n}}},pu={class:"wm-header"},gu=["aria-label"],_u={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},yu={class:"wm-header__avatar"},vu={class:"wm-header__main"},bu={class:"wm-header__title"},wu={key:3,class:"wm-header__fill"},ku={class:"wm-header__actions"},Cu=["aria-label","title"],Su=["aria-label","title"];function Au(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("TeamAvatars");return h(),_("div",pu,[n.showBack?(h(),_("button",{key:0,type:"button",class:"wm-header__icon","aria-label":s.t("header.backToHome"),onClick:t[0]||(t[0]=l=>e.$emit("back"))},[...t[3]||(t[3]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M19 12H5M12 5l-7 7 7 7"})],-1)])],8,gu)):(h(),_("div",_u)),n.showIdentity?(h(),_(ee,{key:2},[u("div",yu,[ve(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",vu,[u("div",bu,L(n.title),1)]),s.hasTeam?(h(),ye(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):F("",!0)],64)):(h(),_("div",wu)),u("div",ku,[n.showMore?(h(),_("button",{key:0,type:"button",class:re(["wm-header__icon",{"wm-header__icon--active":n.moreActive}]),"aria-label":s.t("header.moreOptions"),title:s.t("header.moreOptions"),onClick:t[1]||(t[1]=l=>e.$emit("more"))},[...t[4]||(t[4]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[u("circle",{cx:"12",cy:"5",r:"1.6"}),u("circle",{cx:"12",cy:"12",r:"1.6"}),u("circle",{cx:"12",cy:"19",r:"1.6"})],-1)])],10,Cu)):F("",!0),n.showClose?(h(),_("button",{key:1,type:"button",class:"wm-header__icon","aria-label":s.t("header.closeWidget"),title:s.t("header.closeWidget"),onClick:t[2]||(t[2]=l=>e.$emit("close"))},[...t[5]||(t[5]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Su)):F("",!0)])])}const xu=we(mu,[["render",Au],["__scopeId","data-v-7af4c118"]]),qr={book:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",changelog:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",status:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",chat:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",link:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},Tu={name:"WmOnboarding",components:{AIAvatar:qt},inject:{t:{default:()=>xe()}},props:{welcomeMessage:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1}},emits:["start","select","resume","view-history"],computed:{heroTitle(){return this.welcomeMessage?this.welcomeMessage:this.agentName?this.t("onboarding.greetingNamed",{name:this.agentName}):this.t("onboarding.greeting")},heroSub(){return this.subtitle||this.t("onboarding.heroSub")},unreadThreads(){return this.openThreads.filter(e=>e.unread)}},methods:{iconPath(e){return qr[e]||qr.link},isExternalLink(e){const t=e==null?void 0:e.url;return!!t&&!t.startsWith("#")},safeIconUrl(e){return gc(e==null?void 0:e.icon_url)},iconUrlStyle(e){const t=this.safeIconUrl(e);return t?{"--icon-url":`url("${t}")`}:null}}},Mu={class:"wm-onb"},Eu={class:"wm-onb__hero"},Ou={class:"wm-onb__hero-text"},Iu={class:"wm-onb__title"},Ru={class:"wm-onb__sub"},Lu={class:"wm-onb__actions"},Pu=["disabled"],Bu={class:"wm-onb__btn-label"},Nu=["onClick"],Fu={class:"wm-onb__btn-icon"},Du=["aria-label"],ju={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.9","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Uu=["d"],Hu={class:"wm-onb__btn-label"},$u={key:0,class:"wm-onb__btn-trail",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Vu=["onClick"],Ku={class:"wm-onb__btn-label"},zu=["aria-label"],Wu={class:"wm-onb__btn-icon"},qu={width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Gu=["d"],Yu={class:"wm-onb__btn-label"},Ju={class:"wm-onb__btn-count"};function Xu(e,t,n,r,i,s){const o=_e("AIAvatar");return h(),_("div",Mu,[u("div",Eu,[t[2]||(t[2]=u("svg",{class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"}),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"}),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"})],-1)),ve(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",Ou,[u("div",Iu,L(s.heroTitle),1),u("div",Ru,L(s.heroSub),1)])]),u("div",Lu,[u("button",{type:"button",class:"wm-onb__btn wm-onb__btn--start",disabled:n.busy,onClick:t[0]||(t[0]=a=>e.$emit("start"))},[t[3]||(t[3]=u("span",{class:"wm-onb__btn-icon"},[u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 5v14M5 12h14"})])],-1)),u("span",Bu,L(n.busy?"โ€ฆ":s.t("onboarding.start")),1)],8,Pu),(h(!0),_(ee,null,Se(n.quickLinks,(a,l)=>(h(),_("button",{key:"ql-"+l,type:"button",class:"wm-onb__btn",onClick:f=>e.$emit("select",a)},[u("span",Fu,[s.safeIconUrl(a)?(h(),_("span",{key:0,class:"wm-onb__btn-iconImg",style:Oe(s.iconUrlStyle(a)),role:"img","aria-label":a.label||""},null,12,Du)):(h(),_("svg",ju,[u("path",{d:s.iconPath(a.icon)},null,8,Uu)]))]),u("span",Hu,L(a.label),1),s.isExternalLink(a)?(h(),_("svg",$u,[...t[4]||(t[4]=[u("path",{d:"M7 17L17 7M9 7h8v8"},null,-1)])])):F("",!0)],8,Nu))),128)),(h(!0),_(ee,null,Se(s.unreadThreads,a=>(h(),_("button",{key:"un-"+a.id,type:"button",class:"wm-onb__btn wm-onb__btn--unread",onClick:l=>e.$emit("resume",a)},[t[5]||(t[5]=u("span",{class:"wm-onb__btn-icon"},[u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])],-1)),u("span",Ku,L(a.title),1),u("span",{class:"wm-onb__btn-dot","aria-label":s.t("onboarding.unread")},null,8,zu)],8,Vu))),128)),n.openThreads.length?(h(),_("button",{key:0,type:"button",class:"wm-onb__btn",onClick:t[1]||(t[1]=a=>e.$emit("view-history"))},[u("span",Wu,[(h(),_("svg",qu,[u("path",{d:s.iconPath("chat")},null,8,Gu)]))]),u("span",Yu,L(s.t("onboarding.allConversations")),1),u("span",Ju,L(n.openThreads.length),1),t[6]||(t[6]=u("svg",{class:"wm-onb__btn-trail",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 18l6-6-6-6"})],-1))])):F("",!0)])])}const Qu=we(Tu,[["render",Xu],["__scopeId","data-v-8b4ef2e1"]]),Zu={name:"WmHistory",components:{AIAvatar:qt,HumanAvatar:Js},inject:{t:{default:()=>xe()},wmLocale:{default:()=>()=>"fr"}},props:{threads:{type:Array,default:()=>[]}},emits:["resume"],data(){return{query:""}},computed:{filteredThreads(){const e=this.query.trim().toLowerCase();return e?this.threads.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.preview||"").toLowerCase().includes(e)):this.threads}},methods:{renderPreview(e){return bc(e)},avatarComponent(e){var t;return((t=e==null?void 0:e.author)==null?void 0:t.type)==="agent_human"?"HumanAvatar":"AIAvatar"},avatarProps(e){const t=e==null?void 0:e.author;return(t==null?void 0:t.type)==="agent_human"?{size:40,name:t.name||"",avatarUrl:t.avatar_url||null}:{size:40,name:(t==null?void 0:t.name)||"",imageUrl:(t==null?void 0:t.avatar_url)||null}},isDefaultAvatar(e){const t=e==null?void 0:e.author;return!(t!=null&&t.avatar_url||t!=null&&t.name)},avatarWrapperClass(e){return this.isDefaultAvatar(e)&&!(e!=null&&e.unread)?"wm-hist__avatar--muted":null},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Kt(this.wmLocale()),r=new Date;if(t.toDateString()===r.toDateString())return t.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit"});if(r.getTime()-t.getTime()<7*864e5){const o=t.toLocaleDateString(n,{weekday:"short"});return o.charAt(0).toUpperCase()+o.slice(1)}return t.toLocaleDateString(n,{day:"2-digit",month:"2-digit"})}}},ed={class:"wm-hist"},td={class:"wm-hist__search"},nd=["placeholder","aria-label"],sd={class:"wm-hist__list"},rd=["onClick"],id={key:0,class:"wm-hist__defaultAvatar"},od=["aria-label"],ad={class:"wm-hist__thread-body"},ld={class:"wm-hist__thread-title"},cd=["innerHTML"],ud={class:"wm-hist__thread-meta"},dd={key:0,class:"wm-hist__thread-time"},fd={key:0,class:"wm-hist__empty"};function hd(e,t,n,r,i,s){return h(),_("div",ed,[u("div",td,[t[1]||(t[1]=u("span",{class:"wm-hist__searchIcon"},[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z"})])],-1)),at(u("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>i.query=o),type:"text",placeholder:s.t("onboarding.search"),"aria-label":s.t("onboarding.search")},null,8,nd),[[Rt,i.query]])]),u("div",sd,[(h(!0),_(ee,null,Se(s.filteredThreads,o=>(h(),_("button",{key:o.id,type:"button",class:re(["wm-hist__thread",{"wm-hist__thread--unread":o.unread}]),onClick:a=>e.$emit("resume",o)},[u("span",{class:re(["wm-hist__thread-avatar",s.avatarWrapperClass(o)])},[s.isDefaultAvatar(o)?(h(),_("span",id,[...t[2]||(t[2]=[u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"})],-1)])])):(h(),ye(Ki(s.avatarComponent(o)),ho({key:1,ref_for:!0},s.avatarProps(o)),null,16)),o.unread?(h(),_("span",{key:2,class:"wm-hist__thread-dot","aria-label":s.t("onboarding.unread")},null,8,od)):F("",!0)],2),u("span",ad,[u("span",ld,L(o.title),1),u("span",{class:"wm-hist__thread-preview",innerHTML:s.renderPreview(o.preview)},null,8,cd)]),u("span",ud,[s.formatTs(o._ts)?(h(),_("span",dd,L(s.formatTs(o._ts)),1)):F("",!0),t[3]||(t[3]=u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",class:"wm-hist__thread-chev","aria-hidden":"true"},[u("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))])],10,rd))),128)),s.filteredThreads.length?F("",!0):(h(),_("div",fd,L(i.query?s.t("onboarding.noResults",{query:i.query}):s.t("onboarding.noConversations")),1))])])}const md=we(Zu,[["render",hd],["__scopeId","data-v-0d31869d"]]);function pd(e){return typeof e!="string"?"":e.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)","g"),"$1").replace(/__([^_]+)__/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ").trim()}const gd={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return pd(this.detail)}}},_d={class:"wm-result__icon","aria-hidden":"true"},yd={key:0,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round"},vd={key:1,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},bd={key:2,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},wd={key:3,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},kd={class:"wm-result__body"},Cd={class:"wm-result__label"},Sd={class:"wm-result__detail"};function Ad(e,t,n,r,i,s){return h(),_("div",{class:re(["wm-result",`wm-result--${n.state}`])},[u("span",_d,[n.state==="success"?(h(),_("svg",yd,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(h(),_("svg",vd,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(h(),_("svg",bd,[...t[2]||(t[2]=[u("circle",{cx:"12",cy:"12",r:"10"},null,-1),u("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(h(),_("svg",wd,[...t[3]||(t[3]=[u("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"},null,-1),u("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),u("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])]))]),u("span",kd,[u("span",Cd,L(n.label),1),s.detailText?(h(),_(ee,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," ยท ",-1)),u("span",Sd,L(s.detailText),1)],64)):F("",!0)])],2)}const xd=we(gd,[["render",Ad],["__scopeId","data-v-7284acd0"]]),Td={name:"WmArtifactFormResponse",inject:{t:{default:()=>xe()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},Md={class:"wm-art wm-art--formResponse"},Ed={class:"wm-art__head"},Od={class:"wm-art__title"},Id={class:"wm-art__badge wm-art__badge--success"},Rd={class:"wm-art__body"},Ld={class:"wm-art__fieldLabel"};function Pd(e,t,n,r,i,s){return h(),_("div",Md,[u("div",Ed,[u("div",Od,L(n.data.title||s.t("form.title")),1),u("span",Id,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("polyline",{points:"20 6 9 17 4 12"})],-1)),Zn(" "+L(s.t("form.sent")),1)])]),u("div",Rd,[(h(!0),_(ee,null,Se(s.fields,(o,a)=>(h(),_("div",{key:a,class:"wm-art__field"},[u("div",Ld,L(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},L(o.value),3)]))),128))])])}const Bd=we(Td,[["render",Pd],["__scopeId","data-v-713aecf1"]]),Nd={name:"WmArtifactInfoCard",props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},hasBody(){var e;return!!((e=this.data)!=null&&e.body)||this.fields.length>0}}},Fd={class:"wm-art wm-art--infoCard"},Dd={key:0,class:"wm-art__image"},jd=["src","alt"],Ud={class:"wm-art__head"},Hd={class:"wm-art__headMain"},$d={class:"wm-art__title"},Vd={key:0,class:"wm-art__subtitle"},Kd={key:1,class:"wm-art__body"},zd={key:0,class:"wm-art__text"},Wd={class:"wm-art__fieldLabel"};function qd(e,t,n,r,i,s){return h(),_("div",Fd,[n.data.image_url?(h(),_("figure",Dd,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,jd)])):F("",!0),u("div",Ud,[u("div",Hd,[u("div",$d,L(n.data.title),1),n.data.subtitle?(h(),_("div",Vd,L(n.data.subtitle),1)):F("",!0)]),n.data.badge&&n.data.badge.label?(h(),_("span",{key:0,class:re(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},L(n.data.badge.label),3)):F("",!0)]),s.hasBody?(h(),_("div",Kd,[n.data.body?(h(),_("div",zd,L(n.data.body),1)):F("",!0),s.fields.length?(h(!0),_(ee,{key:1},Se(s.fields,(o,a)=>(h(),_("div",{key:a,class:"wm-art__field"},[u("div",Wd,L(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},L(o.value),3)]))),128)):F("",!0)])):F("",!0)])}const Gd=we(Nd,[["render",qd],["__scopeId","data-v-7eae0e4a"]]);function Yd(e,t,n){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const i=r.toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),s=r.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"});return`${i}${n}${s}`}const Jd={name:"WmArtifactTicket",inject:{t:{default:()=>xe()},wmLocale:{default:()=>()=>"fr"}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},formattedDate(){var e;return Yd((e=this.data)==null?void 0:e.created_at,Kt(this.wmLocale()),this.t("ticket.dateAt"))}},methods:{isPriority(e){return/priorit|^prio$/i.test(String(e||"").trim())},isDate(e){return/date|รฉchรฉanc|echeanc|deadline|due|crรฉรฉ|cree/i.test(String(e||"").trim())},priorityLevel(e){const t=String(e||"").toLowerCase();return/high|haute|รฉlev|elev|critic|critiq|urgent/.test(t)?3:/low|basse|faible|minor/.test(t)?1:2}}},Xd={class:"wm-art wm-art--ticket"},Qd={class:"wm-art__head wm-tk__head"},Zd={class:"wm-art__title wm-tk__title"},ef={class:"wm-tk__sub"},tf={class:"wm-tk__ref"},nf={key:0,class:"wm-tk__text"},sf={key:0,class:"wm-art__body"},rf={class:"wm-art__fieldLabel"},of=["data-level"],af={key:1,class:"wm-tk__date",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},lf={key:1,class:"wm-art__footer wm-tk__footer"};function cf(e,t,n,r,i,s){return h(),_("div",Xd,[u("div",Qd,[u("div",Zd,L(n.data.title),1),u("div",ef,[u("div",tf,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z"}),u("path",{d:"M13 5v2M13 17v2M13 11v2"})],-1)),u("span",null,L(n.data.reference),1)]),u("span",{class:re(["wm-art__badge","wm-tk__badge",`wm-art__badge--${n.data.status.tone||"neutral"}`])},[t[1]||(t[1]=u("span",{class:"wm-tk__dot","aria-hidden":"true"},null,-1)),Zn(" "+L(n.data.status.label),1)],2)]),n.data.body?(h(),_("div",nf,L(n.data.body),1)):F("",!0)]),s.fields.length?(h(),_("div",sf,[(h(!0),_(ee,null,Se(s.fields,(o,a)=>(h(),_("div",{key:a,class:"wm-art__field"},[u("div",rf,L(o.label),1),u("div",{class:re(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(h(),_("svg",{key:0,class:"wm-tk__prio","data-level":s.priorityLevel(o.value),width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},[...t[2]||(t[2]=[u("rect",{x:"1",y:"8",width:"2",height:"3",rx:"0.5"},null,-1),u("rect",{x:"5",y:"5",width:"2",height:"6",rx:"0.5"},null,-1),u("rect",{x:"9",y:"2",width:"2",height:"9",rx:"0.5"},null,-1)])],8,of)):s.isDate(o.label)?(h(),_("svg",af,[...t[3]||(t[3]=[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"},null,-1),u("path",{d:"M16 2v4M8 2v4M3 10h18"},null,-1)])])):F("",!0),u("span",null,L(o.value),1)],2)]))),128))])):F("",!0),n.data.created_at?(h(),_("div",lf,[t[4]||(t[4]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),u("path",{d:"M16 2v4M8 2v4M3 10h18"})],-1)),u("span",null,L(s.formattedDate),1)])):F("",!0)])}const uf=we(Jd,[["render",cf],["__scopeId","data-v-5f30c914"]]),df={form_response:Bd,info_card:Gd,ticket:uf},ff={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&df[e]||null}}};function hf(e,t,n,r,i,s){return s.component?(h(),ye(Ki(s.component),{key:0,data:n.artifact.data},null,8,["data"])):F("",!0)}const mf=we(ff,[["render",hf]]),pf={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>xe()}},props:{attachment:{type:Object,required:!0}},data(){return{url:null,loading:!1}},computed:{kind(){var n,r;const e=(n=this.attachment)==null?void 0:n.type;if(e)return e;const t=(((r=this.attachment)==null?void 0:r.mime_type)||"").toLowerCase();return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":"file"},displayName(){var e,t,n;return((t=(e=this.attachment)==null?void 0:e.metadata)==null?void 0:t.name)||((n=this.attachment)==null?void 0:n.name)||this.guessNameFromPath()||this.t("attachment.fallbackName")},safeHref(){const e=String(this.url||"").trim();return/^(https?:\/\/|blob:|data:image\/)/i.test(e)?e:"#"},sizeLabel(){var t;const e=(t=this.attachment)==null?void 0:t.size_bytes;return e?e<1024?this.t("attachment.bytes",{size:e}):e<1024*1024?this.t("attachment.kilobytes",{size:(e/1024).toFixed(0)}):this.t("attachment.megabytes",{size:(e/(1024*1024)).toFixed(1)}):""}},watch:{"attachment.path":{handler(){this.refresh()},immediate:!0}},methods:{guessNameFromPath(){var n;return((((n=this.attachment)==null?void 0:n.path)||"").split("/").pop()||"").replace(/^[0-9a-f-]{8,}-/,"")},async refresh(){var e;if(!(!((e=this.attachment)!=null&&e.path)||!this.signAttachmentFn)){this.loading=!0;try{this.url=await this.signAttachmentFn(this.attachment.path)}finally{this.loading=!1}}},onFileClick(e){this.safeHref==="#"&&e.preventDefault()}}},gf=["href"],_f=["src","alt"],yf=["src"],vf=["src"],bf=["href","download"],wf={class:"wm-att__main"},kf={class:"wm-att__name"},Cf={key:0,class:"wm-att__meta"},Sf={key:0,class:"wm-att__spin","aria-hidden":"true"};function Af(e,t,n,r,i,s){return h(),_("div",{class:re(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(h(),_("a",{key:0,href:s.safeHref,target:"_blank",rel:"noopener",class:"wm-att__imgWrap"},[u("img",{src:i.url,alt:s.displayName,loading:"lazy"},null,8,_f)],8,gf)):s.kind==="audio"&&i.url?(h(),_("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,yf)):s.kind==="video"&&i.url?(h(),_("video",{key:2,src:i.url,controls:"",preload:"metadata"},null,8,vf)):(h(),_("a",{key:3,class:"wm-att__file",href:s.safeHref,download:s.displayName,target:"_blank",rel:"noopener",onClick:t[0]||(t[0]=(...o)=>s.onFileClick&&s.onFileClick(...o))},[t[1]||(t[1]=u("span",{class:"wm-att__icon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),u("path",{d:"M14 2v6h6"})])],-1)),u("span",wf,[u("span",kf,L(s.displayName),1),s.sizeLabel?(h(),_("span",Cf,L(s.sizeLabel),1)):F("",!0)]),i.loading?(h(),_("span",Sf)):F("",!0)],8,bf))],2)}const xf=we(pf,[["render",Af],["__scopeId","data-v-0c877a62"]]),Tf={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return wc(this.text)}}},Mf=["innerHTML"];function Ef(e,t,n,r,i,s){return h(),_("div",{class:re(["wm-bubble","wm-bubble--"+n.role])},[Ra(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,Mf)])],2)}const Of=we(Tf,[["render",Ef],["__scopeId","data-v-7ab13147"]]),If={name:"WmTyping"},Rf={class:"wm-typing"};function Lf(e,t,n,r,i,s){return h(),_("div",Rf,[...t[0]||(t[0]=[u("span",{style:{"animation-delay":"0s"}},null,-1),u("span",{style:{"animation-delay":"0.2s"}},null,-1),u("span",{style:{"animation-delay":"0.4s"}},null,-1)])])}const Pf=we(If,[["render",Lf],["__scopeId","data-v-df2447fd"]]);function Et(e){return e?e.client_msg_id||e.id:""}const Bf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",reopened:"system.reopened",idle:"system.idle"},Nf=80,Ff=200,Df={name:"WmMessageList",components:{AIAvatar:qt,HumanAvatar:Js,Bubble:Of,Typing:Pf,ActionResult:xd,AttachmentPreview:xf,ArtifactRenderer:mf},inject:{t:{default:()=>xe()},wmLocale:{default:()=>()=>"fr"}},props:{messages:{type:Array,default:()=>[]},streamingActive:{type:Boolean,default:!1},dateLabel:{type:String,default:""},conversationId:{type:[String,Number],default:null},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},unreadAnchorId:{type:Number,default:null},unreadBoundaryTs:{type:String,default:""},aiAgentName:{type:String,default:""},aiAgentAvatarUrl:{type:String,default:null}},emits:["load-more"],data(){return{silentFades:!1,widthByKey:Object.freeze({}),showScrollDown:!1,pressedItemKey:null}},computed:{historyExhausted(){return!this.hasMore&&!this.loadingMore&&this.messages.length>=20},groups(){var n,r,i,s;const e=[];for(const o of this.messages){const a=this.roleOf(o);if(a==="system"){if(((n=o==null?void 0:o.payload)==null?void 0:n.event)==="action_admin_pending"){const c=e[e.length-1];c&&c.role==="ai"?c.messages.push(o):e.push({key:`g-${Et(o)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[o],items:[]});continue}e.push({key:`sys-${Et(o)}`,role:a,messages:[o],items:[],systemLabel:this.systemLabel(o)});continue}const l=e[e.length-1];l&&l.role===a&&(a==="ai"||l.agentName===(((r=o==null?void 0:o.author)==null?void 0:r.name)||""))?l.messages.push(o):e.push({key:`g-${Et(o)}`,role:a,agentName:((i=o==null?void 0:o.author)==null?void 0:i.name)||"",agentAvatarUrl:((s=o==null?void 0:o.author)==null?void 0:s.avatar_url)||null,messages:[o],items:[]})}for(const o of e){if(o.role==="system")continue;const a=[];for(const l of o.messages)for(const f of this.itemsOf(l))a.push(f);o.items=a}const t=[];for(const o of e){if(o.role!=="system"&&!o.items.length)continue;const a=t[t.length-1];if(a&&a.role!=="system"&&a.role===o.role&&(o.role==="ai"||a.agentName===o.agentName)){a.messages.push(...o.messages),a.items.push(...o.items);continue}t.push(o)}for(const o of t)o.role!=="system"&&(o.key=this.stableGroupKey(o.messages));return t},unreadGroupKey(){if(this.unreadAnchorId==null)return null;const e=this.unreadAnchorId,t=this.unreadBoundaryTs;for(const n of this.groups){if(n.role==="user"||n.role==="system"||!n.items.length)continue;const r=n.messages[0];if(!r)continue;const i=ft(r.id);if(i!=null&&!(i<=e)&&!(t&&r.created_at&&r.created_at>t))return n.key}return null}},watch:{messages:{handler:"snapshotAndRestore",deep:!0},conversationId(e,t){e!==t&&(this._groupIdByMsgKey=null,this.silentFades=!1)},loadingMore(e){e||(this._pendingLoadMore=!1),e&&(this.silentFades=!0),this.snapshotAndRestore()},streamingActive:"snapshotAndRestore"},mounted(){this._lastSeenConvId=this.conversationId,this.scrollToBottom(),this._measureFrame=null,this._ro=new ResizeObserver(()=>this.scheduleMeasure()),this.$refs.scrollEl&&this._ro.observe(this.$refs.scrollEl),this.$nextTick(()=>this.measureRows())},beforeUnmount(){var e;(e=this._ro)==null||e.disconnect(),this._measureFrame&&cancelAnimationFrame(this._measureFrame),this._pressTimer&&clearTimeout(this._pressTimer)},updated(){this.scheduleMeasure()},methods:{messageKey:Et,stableGroupKey(e){this._groupIdByMsgKey||(this._groupIdByMsgKey=new Map,this._groupIdCounter=0);const t=this._groupIdByMsgKey;let n=null;for(const r of e){const i=Et(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Et(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Nf},onScroll(){const e=this.$refs.scrollEl;e&&(this.showScrollDown=!this.isAtBottom(e),!(this.loadingMore||!this.hasMore)&&(this._pendingLoadMore||e.scrollTop<=Ff&&(this._pendingLoadMore=!0,this.$emit("load-more"))))},snapshotAndRestore(){const e=this.$refs.scrollEl;if(!e||this._scrollSnap)return;const t=this._lastSeenConvId!==this.conversationId;this._lastSeenConvId=this.conversationId;const n=this.isAtBottom(e);let r=null;if(!t&&!n){const s=this.pickAnchor(e);if(s!=null&&s.rowKey){const o=this.findRowByKey(e,s.rowKey);if(o){const a=e.getBoundingClientRect().top;r={rowKey:s.rowKey,relY:o.getBoundingClientRect().top-a}}}}const i={forceBottom:t,wasPinned:n,anchor:r};this._scrollSnap=i,this.$nextTick(()=>{if(this._scrollSnap=null,i.forceBottom||i.wasPinned){e.scrollTop=e.scrollHeight;return}if(!i.anchor)return;const s=()=>{const o=i.anchor,a=this.findRowByKey(e,o.rowKey);if(!a)return;const f=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(f)>.5&&(e.scrollTop+=f)};s(),requestAnimationFrame(()=>{s(),requestAnimationFrame(s)})})},pickAnchor(e){const t=e.getBoundingClientRect().top,n=e.querySelectorAll(".wm-list__row[data-row-key]");let r=null;for(const i of n)if(r||(r=i),i.getBoundingClientRect().bottom>=t)return{rowKey:i.dataset.rowKey};return r?{rowKey:r.dataset.rowKey}:null},findRowByKey(e,t){if(!t)return null;const n=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&");return e.querySelector(`.wm-list__row[data-row-key="${n}"]`)},roleOf(e){var n,r;if((e==null?void 0:e.type)==="system"||((n=e==null?void 0:e.payload)==null?void 0:n.type)==="system")return"system";const t=(r=e==null?void 0:e.author)==null?void 0:r.type;return t==="user"?"user":t==="agent_human"?"human":"ai"},roleLabel(e){if(e.role==="human")return e.agentName||this.t("common.agent");const t=this.t("common.aiAssistant");return this.aiAgentName?`${this.aiAgentName} โ€ข ${t}`:t},itemsOf(e){var t;if(!e)return[];if(e.type==="system"&&((t=e==null?void 0:e.payload)==null?void 0:t.event)==="action_admin_pending")return[{message:e,partKey:"main",renderAs:"admin-pending",kind:{top:"bubble",bottom:"bubble"}}];if(e.type==="action"&&e.payload&&e.payload.state!=="pending"){const n=[{message:e,partKey:"main",renderAs:"action",kind:{top:"bubble",bottom:"bubble"}}];return this.actionArtifact(e)&&n.push({message:e,partKey:"artifact",renderAs:"artifact-of-action",kind:{top:"card",bottom:"card"}}),n}return this.artifactOf(e)?[{message:e,partKey:"main",renderAs:"artifact",kind:{top:"card",bottom:"card"}}]:e.text_md||this.attachmentsOf(e).length?[{message:e,partKey:"main",renderAs:"bubble",kind:{top:"bubble",bottom:"bubble"}}]:[]},cornersFor(e,t){var $,se,ge;const n=e.items,r=($=n[t])==null?void 0:$.kind,i=(se=n[t-1])==null?void 0:se.kind,s=(ge=n[t+1])==null?void 0:ge.kind,o=e.role==="user",a=14,l=4,f=i==null?void 0:i.bottom,c=s==null?void 0:s.top,p=this.widthByKey[this.rowKeyOf(e,t)],A=this.widthByKey[this.rowKeyOf(e,t-1)],w=this.widthByKey[this.rowKeyOf(e,t+1)],V=.5,O=(he,ke,G)=>he!=null&&p!=null?he+V>=p:ke===G||ke==="card"&&G==="bubble";let J=a,W=a,H=a,Q=a;return o?(f&&(W=l),(c||!s)&&(H=l),f&&O(A,f,r==null?void 0:r.top)&&(J=l),c&&O(w,c,r==null?void 0:r.bottom)&&(Q=l)):(f&&(J=l),(c||!s)&&(Q=l),f&&O(A,f,r==null?void 0:r.top)&&(W=l),c&&O(w,c,r==null?void 0:r.bottom)&&(H=l)),{tl:J,tr:W,br:H,bl:Q}},cornersStyle(e,t){if(e.items.length<2)return null;const n=this.cornersFor(e,t);return{"--wm-r-tl":`${n.tl}px`,"--wm-r-tr":`${n.tr}px`,"--wm-r-br":`${n.br}px`,"--wm-r-bl":`${n.bl}px`}},rowKeyOf(e,t){var r;const n=(r=e==null?void 0:e.items)==null?void 0:r[t];return n?`${Et(n.message)}-${n.partKey}`:""},scheduleMeasure(){this._measureFrame||(this._measureFrame=requestAnimationFrame(()=>{this._measureFrame=null,this.measureRows()}))},measureRows(){const e=this.$refs.scrollEl;if(!e)return;const t={};for(const s of e.querySelectorAll(".wm-list__row[data-row-key]")){const o=s.dataset.rowKey;if(!o)continue;const a=s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");if(!a)continue;const l=a.getBoundingClientRect().width;l>0&&(t[o]=l)}const n=this.widthByKey,r=Object.keys(n),i=Object.keys(t);if(r.length===i.length){let s=!0;for(const o of i)if(Math.abs((n[o]??0)-t[o])>.5){s=!1;break}if(s)return}this.widthByKey=Object.freeze(t)},onPressStart(e){this.onPressEnd(),this._pressTimer=setTimeout(()=>{this._pressTimer=null,this.pressedItemKey=e},400)},onPressEnd(){this._pressTimer&&(clearTimeout(this._pressTimer),this._pressTimer=null),this.pressedItemKey!==null&&(this.pressedItemKey=null)},timeOf(e){if(!(e!=null&&e.created_at))return"";try{return Is(new Date(e.created_at),Kt(this.wmLocale()))}catch{return""}},lastTimeOf(e){const t=e.items[e.items.length-1],n=(t==null?void 0:t.message)||e.messages[e.messages.length-1];if(!(n!=null&&n.created_at))return"";try{return Is(new Date(n.created_at),Kt(this.wmLocale()))}catch{return""}},hasTrailingOverlay(e){if(!e.messages.length)return!1;const t=e.messages[e.messages.length-1],n=e.items[e.items.length-1];return!!t&&(n==null?void 0:n.message)!==t},attachmentsOf(e){var n;const t=(n=e==null?void 0:e.payload)==null?void 0:n.attachments;return Array.isArray(t)?t:[]},artifactOf(e){var n;const t=(n=e==null?void 0:e.metadata)==null?void 0:n.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},actionLabel(e){var t;return((t=e==null?void 0:e.payload)==null?void 0:t.name)||(e==null?void 0:e.text_md)||this.t("common.action")},actionDetail(e){var n,r,i,s,o,a;const t=e==null?void 0:e.payload;return t?t.state==="success"?((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"":t.state==="rejected"?((s=t.rejected)==null?void 0:s.reason)||this.t("action.rejectedByUser"):t.state==="failure"&&(((o=t.failure)==null?void 0:o.summary)||((a=t.failure)==null?void 0:a.error))||"":""},actionArtifact(e){var n,r;const t=(r=(n=e==null?void 0:e.payload)==null?void 0:n.success)==null?void 0:r.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},systemLabel(e){var i,s,o;const t=(i=e==null?void 0:e.payload)==null?void 0:i.event,n=Bf[t],r=((s=e==null?void 0:e.metadata)==null?void 0:s.agent_name)||((o=e==null?void 0:e.author)==null?void 0:o.name)||this.t("messageList.anAgent");return n?this.t(n,{name:r}):(e==null?void 0:e.text_md)||this.t("messageList.conversationUpdate")},scrollToBottom(){const e=this.$refs.scrollEl;e&&(e.scrollTop=e.scrollHeight),this.showScrollDown=!1},scrollToBottomSmooth(){const e=this.$refs.scrollEl;e&&(typeof e.scrollTo=="function"?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight,this.showScrollDown=!1)}}},jf={class:"wm-list__wrap"},Uf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Hf={class:"wm-list__loadMore-lbl"},$f={key:1,class:"wm-list__historyEnd"},Vf={key:2,class:"wm-list__sep"},Kf={class:"wm-list__sep-label"},zf={key:0,class:"wm-list__sep wm-list__sep--unread"},Wf={class:"wm-list__sep-label wm-list__sep-label--unread"},qf={key:0,class:"wm-list__sysep"},Gf={class:"wm-list__sysep-label"},Yf=["data-row-key","onPointerdown"],Jf={key:0,class:"wm-list__avatarSlot"},Xf={key:5,class:"wm-list__body"},Qf={key:0},Zf={key:1,"aria-hidden":"true"},eh={key:2},th={key:0},nh={key:1,"aria-hidden":"true"},sh={key:2},rh={key:3,class:"wm-list__row wm-list__row--ai fade-up"},ih={class:"wm-list__avatarSlot"},oh=["aria-label","title"];function ah(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("HumanAvatar"),l=_e("ActionResult"),f=_e("ArtifactRenderer"),c=_e("Bubble"),p=_e("AttachmentPreview"),A=_e("Typing");return h(),_("div",jf,[u("div",{ref:"scrollEl",class:re(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[4]||(t[4]=(...w)=>s.onScroll&&s.onScroll(...w))},[n.loadingMore?(h(),_("div",Uf,[t[6]||(t[6]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",Hf,L(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(h(),_("div",$f,L(s.t("messageList.conversationStart")),1)):F("",!0),n.dateLabel?(h(),_("div",Vf,[t[7]||(t[7]=u("div",{class:"wm-list__line"},null,-1)),u("span",Kf,L(n.dateLabel),1),t[8]||(t[8]=u("div",{class:"wm-list__line"},null,-1))])):F("",!0),(h(!0),_(ee,null,Se(s.groups,(w,V)=>(h(),_(ee,{key:w.key},[w.key===s.unreadGroupKey?(h(),_("div",zf,[t[9]||(t[9]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",Wf,L(s.t("messageList.unread")),1),t[10]||(t[10]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):F("",!0),w.role==="system"||w.items.length?(h(),_("div",{key:1,class:re(["wm-list__group","wm-list__group--"+w.role])},[w.role==="system"?(h(),_("div",qf,[t[11]||(t[11]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",Gf,L(w.systemLabel),1),t[12]||(t[12]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(h(),_(ee,{key:1},[(h(!0),_(ee,null,Se(w.items,(O,J)=>(h(),_(ee,{key:`${s.messageKey(O.message)}-${O.partKey}`},[u("div",{"data-row-key":`${s.messageKey(O.message)}-${O.partKey}`,class:re(["wm-list__row fade-up",["wm-list__row--"+w.role,{"is-pending":O.message._pending,"is-failed":O.message._failed}]]),style:Oe(s.cornersStyle(w,J)),onPointerdown:W=>s.onPressStart(`${s.messageKey(O.message)}-${O.partKey}`),onPointerup:t[0]||(t[0]=W=>s.onPressEnd()),onPointercancel:t[1]||(t[1]=W=>s.onPressEnd()),onPointerleave:t[2]||(t[2]=W=>s.onPressEnd()),onContextmenu:t[3]||(t[3]=ht(()=>{},["prevent"]))},[w.role!=="user"?(h(),_("div",Jf,[J===w.items.length-1?(h(),_(ee,{key:0},[w.role==="ai"?(h(),ye(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(h(),ye(a,{key:1,name:w.agentName,"avatar-url":w.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):F("",!0)])):F("",!0),O.renderAs==="action"?(h(),ye(l,{key:1,state:O.message.payload.state,label:s.actionLabel(O.message),detail:s.actionDetail(O.message)},null,8,["state","label","detail"])):O.renderAs==="admin-pending"?(h(),ye(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:O.message.text_md||""},null,8,["label","detail"])):O.renderAs==="artifact-of-action"?(h(),ye(f,{key:3,artifact:s.actionArtifact(O.message)},null,8,["artifact"])):O.renderAs==="artifact"?(h(),ye(f,{key:4,artifact:s.artifactOf(O.message)},null,8,["artifact"])):(h(),_("div",Xf,[O.message.text_md?(h(),ye(c,{key:0,role:w.role,text:O.message.text_md},null,8,["role","text"])):F("",!0),s.attachmentsOf(O.message).length?(h(),_("div",{key:1,class:re(["wm-list__atts",{"wm-list__atts--align-end":w.role==="user"}])},[(h(!0),_(ee,null,Se(s.attachmentsOf(O.message),(W,H)=>(h(),ye(p,{key:`${s.messageKey(O.message)}-att-${H}`,attachment:W},null,8,["attachment"]))),128))],2)):F("",!0)]))],46,Yf),J<w.items.length-1&&i.pressedItemKey===`${s.messageKey(O.message)}-${O.partKey}`&&(w.role!=="user"||s.timeOf(O.message))?(h(),_("div",{key:0,class:re(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":w.role==="user"}])},[w.role!=="user"?(h(),_("span",Qf,L(s.roleLabel(w)),1)):F("",!0),w.role!=="user"&&s.timeOf(O.message)?(h(),_("span",Zf,"โ€ข")):F("",!0),s.timeOf(O.message)?(h(),_("span",eh,L(s.timeOf(O.message)),1)):F("",!0)],2)):F("",!0)],64))),128)),(w.role!=="user"||s.lastTimeOf(w))&&!s.hasTrailingOverlay(w)?(h(),_("div",{key:0,class:re(["wm-list__meta",{"wm-list__meta--right":w.role==="user"}])},[w.role!=="user"?(h(),_("span",th,L(s.roleLabel(w)),1)):F("",!0),w.role!=="user"&&s.lastTimeOf(w)?(h(),_("span",nh,"โ€ข")):F("",!0),s.lastTimeOf(w)?(h(),_("span",sh,L(s.lastTimeOf(w)),1)):F("",!0)],2)):F("",!0)],64))],2)):F("",!0)],64))),128)),n.streamingActive?(h(),_("div",rh,[u("div",ih,[ve(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),ve(A)])):F("",!0)],34),ve(bo,{name:"wm-scrollDown"},{default:Vs(()=>[i.showScrollDown?(h(),_("button",{key:0,type:"button",class:"wm-list__scrollDown","aria-label":s.t("messageList.scrollToBottom"),title:s.t("messageList.scrollToBottom"),onClick:t[5]||(t[5]=(...w)=>s.scrollToBottomSmooth&&s.scrollToBottomSmooth(...w))},[...t[13]||(t[13]=[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M6 9l6 6 6-6"})],-1)])],8,oh)):F("",!0)]),_:1})])}const lh=we(Df,[["render",ah],["__scopeId","data-v-cf20685c"]]),jn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",Xs=typeof window<"u"&&typeof window.MediaRecorder<"u";function ch(){return Xs&&["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"].find(t=>{var n,r;return(r=(n=window.MediaRecorder).isTypeSupported)==null?void 0:r.call(n,t)})||""}function Ao({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function uh(){if(!jn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(Ao({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await dh(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function dh(e){const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.srcObject=e,await t.play(),await new Promise(a=>requestAnimationFrame(a));const n=t.videoWidth||1280,r=t.videoHeight||720,i=document.createElement("canvas");i.width=n,i.height=r,i.getContext("2d").drawImage(t,0,0,n,r);const s=await new Promise((a,l)=>{i.toBlob(f=>f?a(f):l(new Error("toBlob failed")),"image/png")}),o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);return new File([s],`capture-${o}.png`,{type:"image/png"})}async function fh(e={}){var f;if(!jn||!Xs)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(Ao({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=ch();let r;try{r=n?new window.MediaRecorder(t,{mimeType:n}):new window.MediaRecorder(t)}catch(c){return console.error("[media] recorder init",c),t.getTracks().forEach(p=>{p.stop()}),null}const i=[];let s=null,o=!1;r.addEventListener("dataavailable",c=>{c.data&&c.data.size>0&&i.push(c.data)}),r.addEventListener("stop",()=>{var c,p;if(s&&clearInterval(s),t.getTracks().forEach(A=>{A.stop()}),i.length){const A=r.mimeType||n||"video/webm",w=new Blob(i,{type:A}),V=/mp4/.test(A)?"mp4":"webm",O=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),J=new File([w],`ecran-${O}.${V}`,{type:A});(c=e.onfinalize)==null||c.call(e,J)}else(p=e.oncancel)==null||p.call(e)}),t.getVideoTracks().forEach(c=>{c.addEventListener("ended",()=>a(),{once:!0})});function a(){if(!o&&(o=!0,r.state!=="inactive"))try{r.stop()}catch(c){console.error("[media] recorder stop",c)}}try{r.start(1e3)}catch(c){return console.error("[media] recorder start",c),t.getTracks().forEach(p=>{p.stop()}),null}(f=e.onstart)==null||f.call(e);const l=Date.now();return s=setInterval(()=>{var c;(c=e.ontick)==null||c.call(e,Date.now()-l)},500),{stop:a,get state(){return r.state}}}const hh=[{action:"file",labelKey:"composer.attachFile",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"},{action:"screenshot",labelKey:"composer.screenshot",path:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z"},{action:"record",labelKey:"composer.recordScreen",path:"M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"}],mh={name:"WmComposer",inject:{t:{default:()=>xe()}},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"ร‰crivez votre messageโ€ฆ"},disabled:{type:Boolean,default:!1},attachLabel:{type:String,default:"Joindre"},displayMode:{type:String,default:"floating"}},emits:["update:modelValue","send","attach"],data(){return{local:this.modelValue,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null,kbOffset:0}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},attachItems(){return hh.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!jn||e.action==="record"&&(!jn||!Xs)}))},recordingElapsedLabel(){const e=Math.floor(this.recordingElapsed/1e3),t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}},watch:{modelValue(e){e!==this.local&&(this.local=e,this.$nextTick(()=>this.autosize()))},local(e){this.$emit("update:modelValue",e)}},mounted(){this.autosize(),this.displayMode==="sheet"&&this.setupKeyboardTracking()},beforeUnmount(){if(this.recorder)try{this.recorder.stop()}catch{}this.teardownKeyboardTracking()},methods:{focus(){const e=this.$refs.inputEl;if(!(!e||this.disabled))try{e.focus({preventScroll:!0})}catch{e.focus()}},onSubmit(){if(!this.canSend)return;const e=this.local.trim();this.local="",this.$emit("send",e),this.$nextTick(()=>this.autosize())},onKeydown(e){e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&(e.preventDefault(),this.onSubmit())},autosize(){const e=this.$refs.inputEl;e&&(e.clientWidth<80||(e.style.height="auto",e.style.height=`${e.scrollHeight}px`))},onFile(e){const t=Array.from(e.target.files||[]);for(const n of t)this.$emit("attach",n);e.target.value=""},onAttachAction(e){this.attachOpen=!1,e==="file"?this.pickFile():e==="screenshot"?this.captureScreenshot():e==="record"&&this.startRecording()},pickFile(){var e;(e=this.$refs.fileEl)==null||e.click()},async captureScreenshot(){if(this.disabled)return;const e=await uh();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await fh({onstart:()=>{this.recording=!0},ontick:t=>{this.recordingElapsed=t},onfinalize:t=>{this.$emit("attach",t),this.recording=!1,this.recordingElapsed=0,this.recorder=null},oncancel:()=>{this.recording=!1,this.recordingElapsed=0,this.recorder=null}});e&&(this.recorder=e)},stopRecording(){if(this.recorder)try{this.recorder.stop()}catch(e){console.error("[composer] stop recording",e)}},setupKeyboardTracking(){const e=window.visualViewport;e&&(this._vvHandler=()=>{const t=Math.max(0,window.innerHeight-e.height-e.offsetTop);this.kbOffset=t},e.addEventListener("resize",this._vvHandler),e.addEventListener("scroll",this._vvHandler))},teardownKeyboardTracking(){const e=window.visualViewport;!e||!this._vvHandler||(e.removeEventListener("resize",this._vvHandler),e.removeEventListener("scroll",this._vvHandler),this._vvHandler=null)}}},ph={key:0,class:"wm-rec"},gh={class:"wm-rec__lbl"},_h={key:1,class:"wm-compose__menu",role:"menu"},yh=["disabled","onClick"],vh={class:"wm-compose__menuIcon"},bh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},wh=["d"],kh=["placeholder","disabled"],Ch={class:"wm-compose__actions"},Sh=["title","aria-label","disabled"],Ah=["disabled","aria-label"];function xh(e,t,n,r,i,s){return h(),_("div",{class:re(["wm-compose-wrap",{"wm-compose-wrap--sheet":n.displayMode==="sheet"}]),style:Oe(i.kbOffset?{transform:`translateY(-${i.kbOffset}px)`}:null)},[i.recording?(h(),_("div",ph,[t[8]||(t[8]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",gh,L(s.t("composer.recording",{time:s.recordingElapsedLabel})),1),u("button",{type:"button",class:"wm-rec__stop",onClick:t[0]||(t[0]=(...o)=>s.stopRecording&&s.stopRecording(...o))},L(s.t("composer.stop")),1)])):F("",!0),u("form",{class:re(["wm-compose",{"has-attach":i.attachOpen}]),onSubmit:t[7]||(t[7]=ht((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]))},[u("input",{ref:"fileEl",type:"file",hidden:"",multiple:"",onChange:t[1]||(t[1]=(...o)=>s.onFile&&s.onFile(...o))},null,544),i.attachOpen?(h(),_("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):F("",!0),i.attachOpen?(h(),_("div",_h,[(h(!0),_(ee,null,Se(s.attachItems,o=>(h(),_("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",vh,[(h(),_("svg",bh,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,wh)]))]),u("span",null,L(o.label),1)],8,yh))),128))])):F("",!0),at(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"3",placeholder:n.placeholder,disabled:n.disabled,onKeydown:t[4]||(t[4]=(...o)=>s.onKeydown&&s.onKeydown(...o)),onInput:t[5]||(t[5]=(...o)=>s.autosize&&s.autosize(...o))},null,40,kh),[[Rt,i.local]]),u("div",Ch,[u("button",{type:"button",class:re(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onClick:t[6]||(t[6]=o=>i.attachOpen=!i.attachOpen)},[...t[9]||(t[9]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)])],10,Sh),u("button",{type:"submit",class:re(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[10]||(t[10]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],10,Ah)])],34)],6)}const Th=we(mh,[["render",xh],["__scopeId","data-v-01e81a27"]]),Mh={name:"WmSuggestionChips",props:{items:{type:Array,default:()=>[]},baseDelay:{type:Number,default:360},stepDelay:{type:Number,default:90}},emits:["select"],computed:{batchKey(){return this.items.map(e=>(e==null?void 0:e.label)||(e==null?void 0:e.text)||"").join("ยง")}}},Eh=["onClick"];function Oh(e,t,n,r,i,s){return n.items.length?(h(),_("div",{key:s.batchKey,class:"wm-chips"},[(h(!0),_(ee,null,Se(n.items,(o,a)=>(h(),_("button",{key:a,type:"button",class:"wm-chip",style:Oe({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},L(o.label),13,Eh))),128))])):F("",!0)}const Ih=we(Mh,[["render",Oh],["__scopeId","data-v-47ad8085"]]),Rh={name:"WmApprovalCard",components:{AIAvatar:qt},inject:{t:{default:()=>xe()}},props:{action:{type:String,required:!0},detail:{type:String,default:""},callbacks:{type:Array,default:()=>[]},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["callback"],computed:{approveCallback(){return this.callbacks.find(e=>e.id==="approve"||e.style==="primary")||this.callbacks[0]},rejectCallback(){return this.callbacks.find(e=>e.id==="reject"||e.style==="danger"||e.style==="neutral")||(this.callbacks.length>1?this.callbacks[1]:null)},approveId(){var e;return(e=this.approveCallback)==null?void 0:e.id},rejectId(){var e;return(e=this.rejectCallback)==null?void 0:e.id},approveLabel(){var e;return((e=this.approveCallback)==null?void 0:e.label)||this.t("approval.approve")},rejectLabel(){var e;return((e=this.rejectCallback)==null?void 0:e.label)||this.t("approval.reject")}}},Lh={class:"wm-approval"},Ph={class:"wm-approval__head"},Bh={class:"wm-approval__icon"},Nh={class:"wm-approval__main"},Fh={class:"wm-approval__title"},Dh={key:0,class:"wm-approval__detail"},jh={class:"wm-approval__actions"};function Uh(e,t,n,r,i,s){const o=_e("AIAvatar");return h(),_("div",Lh,[u("div",Ph,[u("div",Bh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Nh,[u("div",Fh,L(n.action),1),n.detail?(h(),_("div",Dh,L(n.detail),1)):F("",!0)])]),u("div",jh,[s.rejectId?(h(),_("button",{key:0,type:"button",class:"wm-approval__btn wm-approval__btn--neutral",onClick:t[0]||(t[0]=a=>e.$emit("callback",s.rejectId))},L(s.rejectLabel),1)):F("",!0),s.approveId?(h(),_("button",{key:1,type:"button",class:"wm-approval__btn wm-approval__btn--primary",onClick:t[1]||(t[1]=a=>e.$emit("callback",s.approveId))},L(s.approveLabel),1)):F("",!0)])])}const Hh=we(Rh,[["render",Uh],["__scopeId","data-v-a2bed37e"]]);let Gr=0;const $h=new Set(["text","textarea","number","boolean","select","multiselect","date"]),Vh={name:"WmFormCard",components:{AIAvatar:qt},inject:{t:{default:()=>xe()}},props:{form:{type:Object,required:!0},readOnly:{type:Boolean,default:!1},initialValues:{type:Object,default:null},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["submit"],data(){return Gr+=1,{_uid:Gr,values:{},busy:!1,error:""}},computed:{normalizedFields(){var t;return(Array.isArray((t=this.form)==null?void 0:t.fields)?this.form.fields:[]).filter(n=>!(!(n!=null&&n.key)||!(n!=null&&n.label)||!$h.has(n==null?void 0:n.type)||(n.type==="select"||n.type==="multiselect")&&(!Array.isArray(n.options)||n.options.length===0)))}},created(){this.resetValues()},methods:{resetValues(){const e=this.initialValues&&typeof this.initialValues=="object"?this.initialValues:{},t={};for(const n of this.normalizedFields){if(e[n.key]!==void 0){t[n.key]=e[n.key];continue}n.type==="boolean"?t[n.key]=!1:n.type==="multiselect"?t[n.key]=[]:t[n.key]=""}this.values=t,this.error=""},toggleMulti(e,t,n){const r=Array.isArray(this.values[e])?this.values[e].slice():[],i=r.indexOf(t);n&&i===-1?r.push(t):!n&&i!==-1&&r.splice(i,1),this.values={...this.values,[e]:r}},validate(){for(const e of this.normalizedFields){if(!e.required)continue;const t=this.values[e.key];if(e.type!=="boolean"){if(e.type==="multiselect"){if(!Array.isArray(t)||t.length===0)return this.t("form.fieldRequired",{label:e.label});continue}if(t==null||t==="")return this.t("form.fieldRequired",{label:e.label})}}return""},async onSubmit(){if(this.readOnly||this.busy)return;const e=this.validate();if(e){this.error=e;return}this.error="",this.busy=!0;try{await this.$emit("submit",{values:this.values})}finally{this.busy=!1}}}},Kh={class:"wm-form"},zh={class:"wm-form__head"},Wh={class:"wm-form__icon"},qh={class:"wm-form__main"},Gh={class:"wm-form__title"},Yh={key:0,class:"wm-form__detail"},Jh=["for"],Xh={key:0,class:"wm-form__req","aria-hidden":"true"},Qh=["id","onUpdate:modelValue","placeholder","required","disabled"],Zh=["id","onUpdate:modelValue","placeholder","required","disabled"],em=["id","onUpdate:modelValue","placeholder","required","disabled"],tm=["id","onUpdate:modelValue","required","disabled"],nm={key:4,class:"wm-form__bool"},sm=["id","onUpdate:modelValue","disabled"],rm=["id","onUpdate:modelValue","required","disabled"],im={value:"",disabled:""},om=["value"],am={key:6,class:"wm-form__multi"},lm=["value","checked","disabled","onChange"],cm={key:0,class:"wm-form__err"},um=["disabled"],dm={key:0,class:"wm-form__spinner","aria-hidden":"true"},fm={key:2,class:"wm-form__doneLbl"};function hm(e,t,n,r,i,s){const o=_e("AIAvatar");return h(),_("div",Kh,[u("div",zh,[u("div",Wh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",qh,[u("div",Gh,L(n.form.title||s.t("form.title")),1),n.form.description?(h(),_("div",Yh,L(n.form.description),1)):F("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=ht((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(h(!0),_(ee,null,Se(s.normalizedFields,a=>(h(),_("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[Zn(L(a.label),1),a.required?(h(),_("span",Xh,"*")):F("",!0)],8,Jh),a.type==="text"?at((h(),_("input",{key:0,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"text",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Qh)),[[Rt,i.values[a.key]]]):a.type==="textarea"?at((h(),_("textarea",{key:1,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__textarea",rows:"3",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Zh)),[[Rt,i.values[a.key]]]):a.type==="number"?at((h(),_("input",{key:2,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"number",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,em)),[[Rt,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?at((h(),_("input",{key:3,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"date",class:"wm-form__input",required:a.required,disabled:n.readOnly||i.busy},null,8,tm)),[[Rt,i.values[a.key]]]):a.type==="boolean"?(h(),_("label",nm,[at(u("input",{id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"checkbox",disabled:n.readOnly||i.busy},null,8,sm),[[Wl,i.values[a.key]]]),u("span",null,L(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?at((h(),_("select",{key:5,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__select",required:a.required,disabled:n.readOnly||i.busy},[u("option",im,L(a.placeholder||s.t("form.choose")),1),(h(!0),_(ee,null,Se(a.options,l=>(h(),_("option",{key:l.value,value:l.value},L(l.label),9,om))),128))],8,rm)),[[ql,i.values[a.key]]]):a.type==="multiselect"?(h(),_("div",am,[(h(!0),_(ee,null,Se(a.options,l=>(h(),_("label",{key:l.value,class:"wm-form__multiItem"},[u("input",{type:"checkbox",value:l.value,checked:Array.isArray(i.values[a.key])&&i.values[a.key].includes(l.value),disabled:n.readOnly||i.busy,onChange:f=>s.toggleMulti(a.key,l.value,f.target.checked)},null,40,lm),u("span",null,L(l.label),1)]))),128))])):F("",!0)]))),128)),i.error?(h(),_("div",cm,L(i.error),1)):F("",!0),n.readOnly?(h(),_("div",fm,L(s.t("form.responseSent")),1)):(h(),_("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(h(),_("span",dm)):F("",!0),u("span",null,L(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,um))],32)])}const mm=we(Vh,[["render",hm],["__scopeId","data-v-fe65cc56"]]),pm={name:"WmFeedback",inject:{t:{default:()=>xe()}},props:{busy:{type:Boolean,default:!1},done:{type:Boolean,default:!1}},emits:["submit"],data(){return{sel:null}},computed:{options(){return[{v:1,e:"๐Ÿ˜ž",l:this.t("feedback.rating1")},{v:2,e:"๐Ÿ˜",l:this.t("feedback.rating2")},{v:3,e:"๐Ÿ™‚",l:this.t("feedback.rating3")},{v:4,e:"๐Ÿ˜„",l:this.t("feedback.rating4")},{v:5,e:"๐Ÿคฉ",l:this.t("feedback.rating5")}]}},methods:{onSend(){!this.sel||this.busy||this.$emit("submit",{rating:this.sel})}}},gm={class:"wm-fb"},_m={class:"wm-fb__title"},ym={class:"wm-fb__sub"},vm={class:"wm-fb__row"},bm=["onClick"],wm={class:"wm-fb__emoji"},km={class:"wm-fb__label"},Cm=["disabled"],Sm={key:1,class:"wm-fb__done"},Am={class:"wm-fb__doneTitle"},xm={class:"wm-fb__doneSub"};function Tm(e,t,n,r,i,s){return h(),_("div",gm,[n.done?(h(),_("div",Sm,[t[1]||(t[1]=u("div",{class:"wm-fb__check"},[u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 6L9 17l-5-5"})])],-1)),u("div",Am,L(s.t("feedback.doneTitle")),1),u("div",xm,L(s.t("feedback.doneSubtitle")),1)])):(h(),_(ee,{key:0},[u("div",_m,L(s.t("feedback.question")),1),u("div",ym,L(s.t("feedback.subtitle")),1),u("div",vm,[(h(!0),_(ee,null,Se(s.options,o=>(h(),_("button",{key:o.v,type:"button",class:re(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",wm,L(o.e),1),u("span",km,L(o.l),1)],10,bm))),128))]),u("button",{type:"button",class:"wm-fb__send",disabled:!i.sel||n.busy,onClick:t[0]||(t[0]=(...o)=>s.onSend&&s.onSend(...o))},L(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,Cm)],64))])}const Mm=we(pm,[["render",Tm],["__scopeId","data-v-9b630564"]]),Em={name:"WmMoreMenu",inject:{t:{default:()=>xe()}},props:{canRename:{type:Boolean,default:!0},canExport:{type:Boolean,default:!0},soundEnabled:{type:Boolean,default:!0},browserNotifEnabled:{type:Boolean,default:!1},statusUrl:{type:String,default:""},helpUrl:{type:String,default:""}},emits:["close","action","sound-toggle","browser-notif-toggle"],data(){return{soundOn:this.soundEnabled,browserNotifOn:this.browserNotifEnabled}},watch:{soundEnabled(e){this.soundOn=!!e},browserNotifEnabled(e){this.browserNotifOn=!!e}},methods:{emit(e){this.$emit("action",e)},toggleSound(){this.soundOn=!this.soundOn,this.$emit("sound-toggle",this.soundOn)},toggleBrowserNotif(){this.browserNotifOn=!this.browserNotifOn,this.$emit("browser-notif-toggle",this.browserNotifOn)}}},Om={class:"wm-mm"},Im={class:"wm-mm__pop",role:"menu"},Rm={key:0,class:"wm-mm__section"},Lm={class:"wm-mm__label"},Pm={class:"wm-mm__label"},Bm={key:1,class:"wm-mm__sep"},Nm={class:"wm-mm__section"},Fm={class:"wm-mm__label"},Dm={class:"wm-mm__label"},jm={class:"wm-mm__section"},Um={class:"wm-mm__label"},Hm={class:"wm-mm__label"};function $m(e,t,n,r,i,s){return h(),_("div",Om,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Im,[n.canRename||n.canExport?(h(),_("div",Rm,[n.canRename?(h(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[1]||(t[1]=o=>s.emit("rename"))},[t[7]||(t[7]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 20h9"}),u("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})])],-1)),u("span",Lm,L(s.t("moreMenu.editTitle")),1)])):F("",!0),n.canExport?(h(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[2]||(t[2]=o=>s.emit("export"))},[t[8]||(t[8]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13"})])],-1)),u("span",Pm,L(s.t("moreMenu.exportTranscript")),1),t[9]||(t[9]=u("span",{class:"wm-mm__hint"},".txt",-1))])):F("",!0)])):F("",!0),n.canRename||n.canExport?(h(),_("div",Bm)):F("",!0),u("div",Nm,[u("button",{type:"button",class:"wm-mm__item",onClick:t[3]||(t[3]=(...o)=>s.toggleSound&&s.toggleSound(...o))},[t[11]||(t[11]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),u("path",{d:"M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14"})])],-1)),u("span",Fm,L(s.t("moreMenu.sound")),1),u("span",{class:re(["wm-mm__toggle",{"wm-mm__toggle--on":i.soundOn}])},[...t[10]||(t[10]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)]),u("button",{type:"button",class:"wm-mm__item",onClick:t[4]||(t[4]=(...o)=>s.toggleBrowserNotif&&s.toggleBrowserNotif(...o))},[t[13]||(t[13]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0"})])],-1)),u("span",Dm,L(s.t("moreMenu.browserNotifications")),1),u("span",{class:re(["wm-mm__toggle",{"wm-mm__toggle--on":i.browserNotifOn}])},[...t[12]||(t[12]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)])]),t[16]||(t[16]=u("div",{class:"wm-mm__sep"},null,-1)),u("div",jm,[n.statusUrl?(h(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[5]||(t[5]=o=>s.emit("status"))},[t[14]||(t[14]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2"})])],-1)),u("span",Um,L(s.t("moreMenu.serviceStatus")),1)])):F("",!0),n.helpUrl?(h(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[6]||(t[6]=o=>s.emit("help"))},[t[15]||(t[15]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z"})])],-1)),u("span",Hm,L(s.t("moreMenu.helpCenter")),1)])):F("",!0)])])])}const Vm=we(Em,[["render",$m],["__scopeId","data-v-76281e95"]]),Km={name:"WmRenameDialog",inject:{t:{default:()=>xe()}},props:{title:{type:String,default:""},initialValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["close","submit"],data(){return{value:this.initialValue||""}},computed:{canSubmit(){const e=(this.value||"").trim();return!!e&&e!==(this.initialValue||"").trim()}},mounted(){this.$nextTick(()=>{const e=this.$refs.input;if(e){e.focus();try{e.select()}catch{}}})},methods:{onSubmit(){this.canSubmit&&this.$emit("submit",this.value.trim())}}},zm={class:"wm-dialog"},Wm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},qm={class:"wm-dialog__head"},Gm={class:"wm-dialog__title"},Ym=["aria-label"],Jm={class:"wm-dialog__body"},Xm=["placeholder"],Qm={class:"wm-dialog__actions"},Zm=["disabled"];function ep(e,t,n,r,i,s){return h(),_("div",zm,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Wm,[u("div",qm,[u("div",Gm,L(n.title||s.t("rename.title")),1),u("button",{type:"button",class:"wm-dialog__close","aria-label":s.t("common.close"),onClick:t[1]||(t[1]=o=>e.$emit("close"))},[...t[7]||(t[7]=[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Ym)]),u("div",Jm,[at(u("input",{ref:"input","onUpdate:modelValue":t[2]||(t[2]=o=>i.value=o),type:"text",class:"wm-dialog__input",placeholder:n.placeholder||s.t("rename.placeholder"),maxlength:120,onKeydown:[t[3]||(t[3]=Dn(ht((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Dn(ht(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Xm),[[Rt,i.value]])]),u("div",Qm,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},L(s.t("common.cancel")),1),u("button",{type:"button",class:"wm-dialog__btn wm-dialog__btn--primary",disabled:!s.canSubmit,onClick:t[6]||(t[6]=(...o)=>s.onSubmit&&s.onSubmit(...o))},L(s.t("common.save")),9,Zm)])])])}const tp=we(Km,[["render",ep],["__scopeId","data-v-6d5f94a8"]]),Yr="ww-messenger-tokens",np={name:"Messenger",components:{Launcher:tu,Header:xu,Onboarding:Qu,History:md,MessageList:lh,Composer:Th,SuggestionChips:Ih,ApprovalCard:Hh,FormCard:mm,Feedback:Mm,MoreMenu:Vm,RenameDialog:tp},mixins:[xc,Rc,Lc,Bc],provide(){return{signAttachmentFn:e=>{var t,n;return((n=(t=this.store)==null?void 0:t.signAttachment)==null?void 0:n.call(t,e))||null},t:(e,t)=>this.t(e,t),wmLocale:()=>this.locale}},props:{baseUrl:{type:String,default:dc},widgetId:{type:String,default:""},context:{type:Object,default:null},displayMode:{type:String,default:"floating"},devtools:{type:Boolean,default:!1},language:{type:String,default:""}},data(){return{transport:null,store:null,isOpen:!1,launcherHovered:!1,draft:"",busy:!1,bootError:null,pendingAttachments:[],feedbackBusy:!1,feedbackDone:!1,convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,activeConvId:null,showOnboarding:!1,showHistory:!1,dismissedPeeks:{},floatHeight:0,floatRO:null,parentOrigin:"",parentToken:"",parentVariables:null,parentAllowUnauthenticated:!1,parentInitReceived:!1,parentInitDeferred:null}},computed:{isEditor(){return!!this.devtools},isEmbedded(){return this.displayMode==="embedded"},customerLanguage(){var n,r,i,s;const e=(n=this.s)==null?void 0:n.customer,t=e&&(e.language||((r=e.values)==null?void 0:r.language));return t||((s=(i=this.context)==null?void 0:i.customer)==null?void 0:s.language)||""},locale(){var e;return Ys(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return xe(this.locale)},error(){var e;return this.bootError||((e=this.s)==null?void 0:e.error)||null},canBoot(){return!!(this.baseUrl&&this.widgetId)},s(){var e;return((e=this.store)==null?void 0:e.state)||null},ready(){var e;return!!((e=this.s)!=null&&e.ready)},allConversations(){var t;const e=(t=this.s)==null?void 0:t.conversations;return Array.isArray(e)?e:[]},drawerConversations(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=this.revealedAt;return this.allConversations.map(r=>{var f;const i=e[r.id]||[],s=ft(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const p=i[c];if(!p)continue;if(((f=p.author)==null?void 0:f.type)==="user")break;const A=ft(p.id);if(A!=null){if(s!=null&&A<=s)break;t[p.id]!==0&&(!a&&p.author&&(a=p.author),o++)}}if(!i.length){const c=ft(r.last_message_id);c!=null&&(s==null||c>s)&&(o=1,a=r.last_message_author||null)}const l=i.filter(c=>!((c==null?void 0:c.id)!=null&&t[c.id]===0));return{...r,_preview:kc(r,l),_unread:o>0,_unreadCount:o,_lastAuthor:a}})},unreadCount(){return this.drawerConversations.filter(e=>e._unread).length},openThreads(){var t;const e=((t=this.s)==null?void 0:t.messagesByConv)||{};return this.drawerConversations.filter(n=>n.status!=="resolved").map(n=>({id:n.id,title:n.name||this.t("common.newConversation"),preview:n._preview||this.t("onboarding.newMessage"),unread:!!n._unread,author:n._lastAuthor||null,_ts:Wr(n,e[n.id]||[])})).sort((n,r)=>n._ts<r._ts?1:n._ts>r._ts?-1:0)},latestUnreads(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=[];for(const r of this.drawerConversations){if(!r._unread)continue;const i=Wr(r,e[r.id]||[]),s=r._lastAuthor,o=!s||s.type==="agent_ia",a=(s==null?void 0:s.name)||(o?this.agentName:"")||"",l=(s==null?void 0:s.avatar_url)||(o?this.agentAvatarUrl:null);t.push({convId:r.id,preview:r._preview||this.t("notification.youHaveNewMessage"),ts:i,count:r._unreadCount||1,senderName:a,senderAvatarUrl:l})}return t.sort((r,i)=>r.ts<i.ts?1:r.ts>i.ts?-1:0),t},launcherPeeks(){if(this.isOpen||this.isEmbedded)return[];const e=this.dismissedPeeks||{};return this.latestUnreads.filter(t=>e[t.convId]!==t.ts)},isViewingThread(){return(this.isOpen||this.isEmbedded)&&!!this.currentConv},currentConv(){if(this.draftConv)return this.draftConv;if(this.showOnboarding)return null;const e=this.allConversations;if(!e.length)return null;if(this.activeConvId!=null){const t=e.find(n=>n.id===this.activeConvId);if(t)return t}return e[0]||null},canBack(){return!!this.currentConv||this.showHistory},statusUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>r.icon==="status"&&r.url);return(t==null?void 0:t.url)||""},helpUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>(r.icon==="chat"||r.icon==="help")&&r.url);return(t==null?void 0:t.url)||""},widget(){var e,t;return((t=(e=this.s)==null?void 0:e.config)==null?void 0:t.widget)||null},rootStyle(){var t;const e=(t=this.widget)==null?void 0:t.primary_color;return e&&pc(e)?{"--wm-primary":e}:null},widgetWelcomeMessage(){var e;return((e=this.widget)==null?void 0:e.welcome_message)||""},widgetSubtitle(){var e;return((e=this.widget)==null?void 0:e.subtitle)||""},defaultIconUrl(){var e;return((e=this.widget)==null?void 0:e.default_icon_url)||null},agentName(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.name)||""},agentAvatarUrl(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.avatar_url)||null},quickLinks(){var t;const e=(t=this.widget)==null?void 0:t.quick_links;return Array.isArray(e)?e:[]},teamMembers(){var t;const e=(t=this.widget)==null?void 0:t.team_members;return Array.isArray(e)?e:[]},responseLabel(){var e;return((e=this.widget)==null?void 0:e.response_time_label)||""},humanMessageAuthor(){var t,n,r;if(!this.currentConv)return null;const e=((t=this.s.messagesByConv)==null?void 0:t[this.currentConv.id])||[];for(let i=e.length-1;i>=0;i--)if(((r=(n=e[i])==null?void 0:n.author)==null?void 0:r.type)==="agent_human")return e[i].author;return null},humanAgentName(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.name)||""},humanAgentAvatarUrl(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.avatar_url)||null},isEscalated(){return!!this.humanMessageAuthor},isWaitingHuman(){var t;const e=(t=this.currentConv)==null?void 0:t.status;return e==="waiting"||e==="handled"},headerTitle(){var e,t;return((e=this.currentConv)==null?void 0:e.name)||((t=this.widget)==null?void 0:t.name)||this.t("common.newConversation")},composerPlaceholder(){return this.isEscalated&&this.humanAgentName?this.t("composer.replyTo",{name:this.humanAgentName.split(" ")[0]}):this.isWaitingHuman?this.t("composer.agentTakingOver"):this.t("composer.placeholder")},displayedMessages(){var n,r;const e=this.currentConv;if(!e)return[];if(!e._draft){const i=(r=(n=this.s)==null?void 0:n.paginationByConv)==null?void 0:r[e.id];if(!(i!=null&&i.loaded))return[]}const t=this.revealedAt;return(this.s.messagesByConv[e.id]||[]).filter(i=>{var s,o,a,l,f;return(i==null?void 0:i.type)==="action"&&((s=i==null?void 0:i.payload)==null?void 0:s.state)==="pending"||vn(i)&&!(t[i.id]>0)?!1:(i==null?void 0:i.type)==="action"||(i==null?void 0:i.type)==="system"||((o=i==null?void 0:i.payload)==null?void 0:o.type)==="system"||Array.isArray((a=i==null?void 0:i.payload)==null?void 0:a.attachments)&&i.payload.attachments.length||(l=i==null?void 0:i.metadata)!=null&&l.artifact||(f=i==null?void 0:i.metadata)!=null&&f.form?!0:typeof(i==null?void 0:i.text_md)=="string"&&i.text_md.trim().length>0})},streamingActive(){var n,r,i;const e=this.currentConv;return e?Object.keys(((n=this.s)==null?void 0:n.streamingByMsgId)||{}).length>0?!0:this.actionInFlight?!1:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>vn(s)&&!(this.revealedAt[s.id]>0)):!1},currentConvMessages(){var t,n,r;const e=(t=this.currentConv)==null?void 0:t.id;return e?((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e])||[]:[]},pendingApproval(){return!this.currentConv||!this.store||this.actionInFlight?null:this.store.getPendingApproval(this.currentConv.id)},approvalReady(){return this.pendingApproval?this.pendingApproval.id===this.approvalLatchId?!0:!(this.streamingActive||!this.approvalSettled):!1},approvalTitle(){var e,t,n;return((t=(e=this.pendingApproval)==null?void 0:e.payload)==null?void 0:t.name)||((n=this.pendingApproval)==null?void 0:n.text_md)||this.t("action.title")},approvalDetail(){var r,i,s,o,a,l;const e=(s=(i=(r=this.pendingApproval)==null?void 0:r.payload)==null?void 0:i.pending)==null?void 0:s.user_explanation;if(typeof e=="string"&&e.trim())return e.trim();const t=(l=(a=(o=this.pendingApproval)==null?void 0:o.payload)==null?void 0:a.pending)==null?void 0:l.prepared_params;if(!t||typeof t!="object")return"";const n=Object.entries(t);return n.length?n.slice(0,2).map(([f,c])=>`${f}: ${c}`).join(" ยท "):""},actionInFlight(){var e,t;return!this.currentConv||!this.store?null:((t=(e=this.store).getActionInFlight)==null?void 0:t.call(e,this.currentConv.id))||null},actionInFlightName(){var t;const e=this.actionInFlight;return e?((t=e.payload)==null?void 0:t.name)||e.text_md||this.t("common.action"):""},suggestions(){return!this.currentConv||!this.store?[]:this.streamingActive?[]:this.pendingForm?[]:this.store.getLatestSuggestions(this.currentConv.id)},pendingForm(){var e,t;return!this.currentConv||!this.store||this.pendingApproval||this.actionInFlight||this.streamingActive||!this.approvalSettled?null:((t=(e=this.store).getLatestForm)==null?void 0:t.call(e,this.currentConv.id))||null},showFeedback(){var t;const e=this.currentConv;return e?this.feedbackDone?!0:e.status!=="resolved"?!1:!((t=e.metadata)!=null&&t.feedback):!1},floatVisible(){return this.approvalReady||!!this.pendingForm||this.showFeedback||this.suggestions.length>0},dateLabel(){var n,r,i;const e=this.currentConv;let t=new Date;if(e){const o=((i=(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).find(a=>a==null?void 0:a.created_at))==null?void 0:i.created_at)||e.created_at;if(o){const a=new Date(o);Number.isNaN(a.getTime())||(t=a)}}return this.t("messageList.today",{time:Is(t,Kt(this.locale))})},paginationState(){var n,r,i;const e=(n=this.currentConv)==null?void 0:n.id,t=e?(i=(r=this.s)==null?void 0:r.paginationByConv)==null?void 0:i[e]:null;return{loading:!!(t!=null&&t.loading),hasMore:!!(t!=null&&t.nextCursor)}}},watch:{latestUnreads:{handler(e){const t=new Set(e.map(o=>o.convId)),n=this.dismissedPeeks||{},r=Object.keys(n);if(!r.length)return;const i={};let s=!1;for(const o of r)t.has(o)?i[o]=n[o]:s=!0;s&&(this.dismissedPeeks=i)},deep:!0},"currentConv.id":{handler(e){var t;this.resetRevealQueue(),this.convOpenedAt=Date.now(),this.moreOpen=!1,this.renameDialogOpen=!1,this.resetApprovalPacing(),this.isViewingThread&&(this.unreadAnchorId=ft((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():"")},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=ft((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},pendingApproval:{handler(e,t){if(e&&!t){const n=e!=null&&e.created_at?Date.parse(e.created_at):NaN;if(!(Number.isFinite(n)&&n>=this.convOpenedAt)){this.resetApprovalPacing();return}this.bumpApprovalSettle(2600)}else!e&&t&&this.resetApprovalPacing()},immediate:!1},streamingActive(e,t){e!==t&&this.pendingApproval&&this.pendingApproval.id!==this.approvalLatchId&&this.bumpApprovalSettle()},approvalReady(e){e&&this.pendingApproval&&(this.approvalLatchId=this.pendingApproval.id)},floatVisible:{handler(e){this.$nextTick(()=>this.syncFloatObserver(e))},immediate:!0},currentConvMessages(e){var t;this.paceMessages(e,(t=this.currentConv)==null?void 0:t.id),(this.isOpen||this.isEmbedded)&&this.currentConv&&this.markConvRead(this.currentConv)}},async mounted(){if(typeof document<"u"&&!document.getElementById(Yr)){const e=document.createElement("style");e.id=Yr,e.textContent=ko,document.head.appendChild(e)}this._parentMessageHandler=this.onParentMessage.bind(this),window.addEventListener("message",this._parentMessageHandler),window.parent&&window.parent!==window&&window.parent.postMessage({type:"READY"},"*"),this.isEmbedded?(await this.boot(),this.store&&await this.open()):(await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize())},beforeUnmount(){this._parentMessageHandler&&(window.removeEventListener("message",this._parentMessageHandler),this._parentMessageHandler=null),this._launcherRo&&(this._launcherRo.disconnect(),this._launcherRo=null),this.cancelReveals(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.resetApprovalPacing(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{t(e,t){return this.translator(e,t)},waitForParentInit(){if(this.parentInitReceived)return Promise.resolve();if(!this.parentInitDeferred){let e;this.parentInitDeferred=new Promise(t=>{e=t}),this.parentInitDeferred._resolve=e}return this.parentInitDeferred},onParentMessage(e){var n;const t=e==null?void 0:e.data;if(!(!t||typeof t!="object")){if(t.type==="UPDATE"){this.transport&&t.payload&&this.transport.update(t.payload).catch(r=>{console.warn("[messenger] update failed",r)});return}if(t.type==="CONTEXT"){this.transport&&t.payload&&this.transport.context(t.payload);return}t.type==="INIT"&&(this.parentOrigin=e.origin,this.parentToken=typeof t.token=="string"?t.token:"",this.parentVariables=t.variables&&typeof t.variables=="object"?t.variables:t.context&&typeof t.context=="object"?t.context:null,this.parentAllowUnauthenticated=t.allowUnauthenticated===!0,this.parentInitReceived=!0,(n=this.parentInitDeferred)!=null&&n._resolve&&this.parentInitDeferred._resolve(),!this.isEmbedded&&!this.isOpen&&!this.parentAllowUnauthenticated&&this.parentToken&&this.hasValidSessionMarker()&&this.boot().catch(r=>{console.warn("[messenger] eager boot failed",r)}))}},hasValidSessionMarker(){if(typeof document>"u")return!1;const t=(document.cookie||"").match(/(?:^|; )messenger_session_marker=([^;]+)/);if(!t)return!1;const n=parseInt(t[1],10);return Number.isFinite(n)?n>Date.now():!1},async boot(){if(!this.canBoot){console.warn("[messenger] boot skipped โ€” missing creds");return}try{await this.waitForParentInit(),this.transport=Cs(oc({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=Cs(uc(this.transport)),this.hydrateNotifPref();const e=this.parentVariables||this.context||null;if(await this.store.start({origin:this.parentOrigin,token:this.parentToken||void 0,allowUnauthenticated:this.parentAllowUnauthenticated,variables:e&&typeof e=="object"?e:void 0}),e&&typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))n!=="customer"&&r&&typeof r=="object"&&!Array.isArray(r)&&(t[n]=r);Object.keys(t).length>0&&this.transport.context(t)}this.setupLiveReveal()}catch(e){console.error("[ww-messenger] bootstrap failed",e),this.bootError=(e==null?void 0:e.message)||String(e)}},async refresh(){this.store&&this.store.destroy(),this.cancelReveals(),this.teardownLiveReveal(),this.teardownNotifications(),this.convOpenedAt=0,this.transport=null,this.store=null,this.isOpen=!1,this.draft="",this.busy=!1,this.bootError=null,this.pendingAttachments=[],this.feedbackBusy=!1,this.feedbackDone=!1,this.moreOpen=!1,this.renameDialogOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!1,this.showHistory=!1,await this.boot(),this.isEmbedded&&this.store&&await this.open()},syncFloatObserver(e){if(this.disconnectFloatRO(),!e){this.floatHeight=0;return}const t=this.$refs.floatEl;if(t){if(typeof ResizeObserver>"u"){this.floatHeight=Math.ceil(t.getBoundingClientRect().height+8);return}this.floatRO=new ResizeObserver(n=>{const r=n[0];if(!r)return;const i=Math.ceil(r.contentRect.height+8);i!==this.floatHeight&&(this.floatHeight=i,this.$nextTick(()=>{var s,o;(o=(s=this.$refs.messageList)==null?void 0:s.scrollToBottom)==null||o.call(s)}))}),this.floatRO.observe(t)}},disconnectFloatRO(){if(this.floatRO){try{this.floatRO.disconnect()}catch{}this.floatRO=null}},async open(){this.isOpen=!0,this.notifyParentResize("open"),this._launcherRo&&this._launcherRo.disconnect(),this.store||await this.boot(),this.store&&this.store.setPanelOpen(!0);const e=this.currentConv;if(e&&!e._draft){this.activeConvId==null&&(this.activeConvId=e.id);try{await this.store.openConversation(e.id)}catch(t){console.error("[ww-messenger] load messages failed",t)}this.markConvRead(e)}},async close(){this.isOpen=!1,await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize(),this.store&&this.store.setPanelOpen(!1)},notifyParentResize(e,t){if(window.parent&&window.parent!==window)try{window.parent.postMessage({type:"RESIZE",state:e,displayMode:this.displayMode,...t||{}},"*")}catch(n){console.warn("[ww-messenger] notifyParentResize failed",n)}},onLauncherHover(e){this.launcherHovered=e,this.sendCurrentLauncherSize()},sendCurrentLauncherSize(){var c,p,A,w,V,O,J;if(this.isOpen)return;const e=(p=(c=this.$el)==null?void 0:c.querySelector)==null?void 0:p.call(c,".wm-launcherWrap");if(!e)return;const t=e.getBoundingClientRect();if(!t.width||!t.height)return;const n=(((A=this.launcherPeeks)==null?void 0:A.length)??0)>0,r=16,i=Math.ceil(t.width),s=Math.ceil(t.height),o=(V=(w=this.$el)==null?void 0:w.querySelector)==null?void 0:V.call(w,".wm-launcher"),a=(J=(O=this.$el)==null?void 0:O.querySelectorAll)==null?void 0:J.call(O,".wm-peek"),l=a&&a.length?a[a.length-1]:null;let f=null;if(l){const W=l.getBoundingClientRect();f={width:Math.ceil(W.width),height:Math.ceil(W.height),rightOffset:Math.max(0,Math.ceil(t.right-W.right)),bottomOffset:Math.max(0,Math.ceil(t.bottom-W.bottom))}}this.notifyParentResize("closed",{width:i+r,height:s+r,launcherWidth:(o==null?void 0:o.offsetWidth)||null,launcherHeight:(o==null?void 0:o.offsetHeight)||null,launcherHovered:this.launcherHovered,peek:f,peekHovered:this.launcherHovered&&n})},observeLauncherSize(){var n,r;if(typeof ResizeObserver>"u")return;const e=(r=(n=this.$el)==null?void 0:n.querySelector)==null?void 0:r.call(n,".wm-launcherWrap");if(!e)return;this._launcherRo&&this._launcherRo.disconnect();const t=new ResizeObserver(()=>{this.isOpen||this.sendCurrentLauncherSize()});t.observe(e),this._launcherRo=t},async openFromPeek(e){var n,r;const t=e||((n=this.latestUnreads[0])==null?void 0:n.convId);t&&t!==((r=this.currentConv)==null?void 0:r.id)&&(this.draftConv=null,this.activeConvId=t,this.showOnboarding=!1,this.showHistory=!1),await this.open()},dismissPeek(e){const t=this.latestUnreads.find(n=>n.convId===e);t&&(this.dismissedPeeks={...this.dismissedPeeks,[e]:t.ts})},startConv(){this.draftConv={id:"__draft__",_draft:!0,name:"",created_at:new Date().toISOString()},this.activeConvId=null,this.showOnboarding=!1,this.showHistory=!1,this.focusComposer()},async ensureRealConv(){const e=this.currentConv;if(!e)return null;if(!e._draft)return e;if(this.busy)return null;this.busy=!0;try{const t=await this.store.createConversation({});return this.draftConv=null,this.activeConvId=t.id,await this.store.openConversation(t.id),this.markConvRead(t),t}catch(t){return console.error("[ww-messenger] create conv failed",t),this.bootError=(t==null?void 0:t.message)||String(t),null}finally{this.busy=!1}},focusComposer(){this.$nextTick(()=>{var e;return(e=this.$refs.composer)==null?void 0:e.focus()})},toggleMore(){this.moreOpen=!this.moreOpen},goHome(){this.moreOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!0,this.showHistory=!1},async onDrawerPick(e){if(!(e!=null&&e.id)||!this.store)return;this.draftConv=null,this.activeConvId=e.id,this.showOnboarding=!1,this.showHistory=!1;try{await this.store.openConversation(e.id)}catch(n){console.error("[ww-messenger] open conv failed",n)}const t=this.allConversations.find(n=>n.id===e.id);t&&this.markConvRead(t)},async onMoreAction(e){var t,n;switch(this.moreOpen=!1,e){case"rename":this.openRenameDialog();break;case"export":Ac(this.currentConv,this.currentConv?(n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id]:[],this.translator,this.locale);break;case"status":if(On(this.statusUrl))try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(On(this.helpUrl))try{window.open(this.helpUrl,"_blank","noopener")}catch{}break}},openRenameDialog(){const e=this.currentConv;!e||e._draft||(this.renameDialogOpen=!0)},async onRenameSubmit(e){const t=this.currentConv;if(this.renameDialogOpen=!1,!t||t._draft||!this.store)return;const n=(e||"").trim();if(!(!n||n===t.name))try{await this.store.patchConversation(t.id,{name:n})}catch(r){console.error("[ww-messenger] rename failed",r)}},async onSend(e){let t=this.currentConv;if(!t&&(this.startConv(),t=this.currentConv,!t)||t._draft&&(t=await this.ensureRealConv(),!t))return;const n=t.id,r=this.pendingAttachments.slice();this.pendingAttachments=[],this.unreadAnchorId=null,this.unreadBoundaryTs="",await this.store.send(n,e,{attachments:r.length?r:void 0})},async onSuggestion(e){const t=e==null?void 0:e.label;t&&await this.onSend(t)},async onLoadMore(){var t;const e=(t=this.currentConv)==null?void 0:t.id;!e||!this.store||await this.store.loadMore(e)},async onApprovalCallback(e){const t=this.pendingApproval;t&&await this.store.clickCallback(t.id,e)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=yc(t.form,e,this.translator);if(!n)return;let r=this.currentConv;r&&(r._draft&&(r=await this.ensureRealConv(),!r)||await this.store.send(r.id,n,{metadata:{artifact:vc(t.form,e,this.translator)}}))},async onAttach(e){if(!(!e||!this.transport))try{const t=await this.transport.uploadAttachment(e);this.pendingAttachments.push({type:t.type||"file",path:t.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size})}catch(t){console.error("[ww-messenger] attachment upload failed",t)}},onPanelClick(e){const t=e.target&&e.target.closest?e.target.closest('a[href^="#"]'):null;t&&(e.preventDefault(),this.openInternalUrl(t.getAttribute("href")))},async openInternalUrl(e){if(typeof e!="string"||!e.startsWith("#"))return!1;const t=e.slice(1);if(t==="new"||t==="new-conversation")return this.isOpen||await this.open(),this.startConv(),!0;if(t.startsWith("conversation/")){const n=t.slice(13);return n&&await this.openFromPeek(n),!0}return console.warn("[messenger] unknown internal url",e),!0},async onQuickLink(e){if(e){if(e.url){if(await this.openInternalUrl(e.url))return;if(!On(e.url)){console.warn("[messenger] refusing unsafe quick-link url",e.url);return}try{window.open(e.url,"_blank","noopener")}catch{}return}this.currentConv||this.startConv(),await this.onSend(e.label)}},async onFeedback({rating:e,comment:t}){if(this.currentConv){this.feedbackBusy=!0;try{await this.store.submitFeedback(this.currentConv.id,{rating:e,comment:t}),this.feedbackDone=!0}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},sp={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},rp=["aria-label"],ip={key:0,class:"wm-state"},op={class:"wm-state__err"},ap={class:"wm-state__errTitle"},lp={class:"wm-state__errSub"},cp={class:"wm-bottom"},up={key:0,ref:"floatEl",class:"wm-float"},dp={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},fp={class:"wm-actionWait__lbl"},hp={key:2,class:"wm-attached"},mp=["aria-label","onClick"];function pp(e,t,n,r,i,s){const o=_e("Launcher"),a=_e("Header"),l=_e("History"),f=_e("Onboarding"),c=_e("MessageList"),p=_e("ApprovalCard"),A=_e("FormCard"),w=_e("Feedback"),V=_e("SuggestionChips"),O=_e("Composer"),J=_e("MoreMenu"),W=_e("RenameDialog");return h(),_("div",{class:re(["wm-root",`wm-root--${n.displayMode}`]),style:Oe(s.rootStyle)},[!i.isOpen&&!s.isEmbedded?(h(),ye(o,{key:0,"unread-count":s.unreadCount,peeks:s.launcherPeeks,onOpen:s.openFromPeek,onDismiss:s.dismissPeek,onHover:s.onLauncherHover},null,8,["unread-count","peeks","onOpen","onDismiss","onHover"])):F("",!0),i.isOpen||s.isEmbedded?(h(),_("section",{key:1,class:re(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv}]),style:Oe(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger",onClick:t[6]||(t[6]=(...H)=>s.onPanelClick&&s.onPanelClick(...H))},[!s.ready&&!s.error?(h(),_("div",sp,[s.isEmbedded?F("",!0):(h(),_("button",{key:0,type:"button",class:"wm-loading__close","aria-label":s.t("loading.minimize"),onClick:t[0]||(t[0]=(...H)=>s.close&&s.close(...H))},[...t[7]||(t[7]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,rp)),t[8]||(t[8]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(h(),_(ee,{key:1},[ve(a,{title:s.headerTitle,"team-members":s.teamMembers,"response-label":s.responseLabel,"show-identity":!!s.currentConv,"show-back":s.canBack,"show-close":!s.isEmbedded,"more-active":i.moreOpen,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onBack:s.goHome,onMore:s.toggleMore,onClose:s.close},null,8,["title","team-members","response-label","show-identity","show-back","show-close","more-active","agent-name","agent-avatar-url","onBack","onMore","onClose"]),s.error?(h(),_("div",ip,[u("div",op,[t[9]||(t[9]=u("div",{class:"wm-state__errIcon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})])],-1)),u("div",null,[u("div",ap,L(s.t("error.connectionFailed")),1),u("div",lp,L(s.error),1)])])])):!s.currentConv&&i.showHistory?(h(),ye(l,{key:1,threads:s.openThreads,onResume:s.onDrawerPick},null,8,["threads","onResume"])):s.currentConv?(h(),_(ee,{key:3},[ve(c,{ref:"messageList",messages:s.displayedMessages,"streaming-active":s.streamingActive,"date-label":s.dateLabel,"conversation-id":s.currentConv?s.currentConv.id:null,"loading-more":s.paginationState.loading,"has-more":s.paginationState.hasMore,"unread-anchor-id":e.unreadAnchorId,"unread-boundary-ts":e.unreadBoundaryTs,"ai-agent-name":s.agentName,"ai-agent-avatar-url":s.agentAvatarUrl,onLoadMore:s.onLoadMore},null,8,["messages","streaming-active","date-label","conversation-id","loading-more","has-more","unread-anchor-id","unread-boundary-ts","ai-agent-name","ai-agent-avatar-url","onLoadMore"]),u("div",cp,[s.floatVisible?(h(),_("div",up,[s.approvalReady?(h(),ye(p,{key:0,action:s.approvalTitle,detail:s.approvalDetail,callbacks:s.pendingApproval.callbacks,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onCallback:s.onApprovalCallback},null,8,["action","detail","callbacks","agent-name","agent-avatar-url","onCallback"])):s.pendingForm?(h(),ye(A,{key:s.pendingForm.message&&s.pendingForm.message.id,form:s.pendingForm.form,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onSubmit:s.onFormSubmit},null,8,["form","agent-name","agent-avatar-url","onSubmit"])):s.showFeedback?(h(),ye(w,{key:2,busy:i.feedbackBusy,done:i.feedbackDone,onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(h(),ye(V,{key:3,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):F("",!0),s.actionInFlight?(h(),_("div",dp,[t[10]||(t[10]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",fp,L(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):(h(),ye(O,{key:2,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[2]||(t[2]=H=>i.draft=H),placeholder:s.composerPlaceholder,disabled:!!s.pendingApproval,"attach-label":s.t("composer.attachFile"),"display-mode":n.displayMode,onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","disabled","attach-label","display-mode","onSend","onAttach"]))]),i.moreOpen?(h(),ye(J,{key:0,"can-rename":!!s.currentConv&&!s.currentConv._draft,"can-export":!!s.currentConv&&!s.currentConv._draft,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[3]||(t[3]=H=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):F("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(h(),ye(W,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[4]||(t[4]=H=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):F("",!0),i.pendingAttachments.length?(h(),_("div",hp,[(h(!0),_(ee,null,Se(i.pendingAttachments,(H,Q)=>(h(),_("div",{key:Q,class:"wm-attached__chip"},[t[12]||(t[12]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)),u("span",null,L(H.name),1),u("button",{type:"button","aria-label":s.t("attachment.remove"),onClick:$=>i.pendingAttachments.splice(Q,1)},[...t[11]||(t[11]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,mp)]))),128))])):F("",!0)],64)):(h(),ye(f,{key:2,"welcome-message":s.widgetWelcomeMessage,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,onStart:s.startConv,onSelect:s.onQuickLink,onResume:s.onDrawerPick,onViewHistory:t[1]||(t[1]=H=>i.showHistory=!0)},null,8,["welcome-message","subtitle","agent-name","default-icon-url","quick-links","open-threads","busy","onStart","onSelect","onResume"])),i.moreOpen&&!s.currentConv?(h(),ye(J,{key:4,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[5]||(t[5]=H=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):F("",!0)],64))],6)):F("",!0)],6)}const gp=we(np,[["render",pp],["__scopeId","data-v-543e7817"]]),Jr=window.__WIDGET_ID,Xr=window.__BASE_URL,_p=window.__DISPLAY_MODE||"floating",Qr=window.__LANGUAGE||"";window.__MESSENGER_IFRAME_VERSION="0.5.48";if(!Jr||!Xr)console.error("[messenger-iframe] missing __WIDGET_ID or __BASE_URL globals");else{if(!document.getElementById("wm-tokens")){const e=document.createElement("style");e.id="wm-tokens",e.textContent=ko,document.head.appendChild(e)}Zl({render:()=>_o(gp,{baseUrl:Xr,widgetId:Jr,displayMode:_p,...Qr?{language:Qr}:{}})}).mount("#app")}
74
+ `)}function Ac(e,t,n=xe(),r){if(!e)return;const i=Sc(e,t||[],n,Kt(r)),s=new Blob([i],{type:"text/plain;charset=utf-8"});try{const o=URL.createObjectURL(s),a=document.createElement("a");a.href=o,a.download=`${(e.name||"conversation").replace(/[^a-z0-9-_]+/gi,"_")}.txt`,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(o),1e3)}catch(o){console.error("[ww-messenger] export failed",o)}}const xc={data(){const e=typeof Notification<"u";return{notifPermission:e?Notification.permission:"denied",soundEnabled:!0,browserNotifEnabled:e&&Notification.permission==="granted",_audioCtx:null}},methods:{teardownNotifications(){var e,t;if(this._audioCtx){try{(t=(e=this._audioCtx).close)==null||t.call(e)}catch{}this._audioCtx=null}},soundStorageKey(){return`wm:notif:sound:${this.widgetId||""}`},browserNotifStorageKey(){return`wm:notif:browser:${this.widgetId||""}`},hydrateNotifPref(){try{if(typeof localStorage>"u")return;const e=localStorage.getItem(this.soundStorageKey());e==="0"?this.soundEnabled=!1:e==="1"&&(this.soundEnabled=!0);const t=localStorage.getItem(this.browserNotifStorageKey());t==="0"?this.browserNotifEnabled=!1:t==="1"&&(this.browserNotifEnabled=typeof Notification<"u"&&Notification.permission==="granted")}catch{}},persistSoundPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.soundStorageKey(),this.soundEnabled?"1":"0")}catch{}},persistBrowserNotifPref(){try{if(typeof localStorage>"u")return;localStorage.setItem(this.browserNotifStorageKey(),this.browserNotifEnabled?"1":"0")}catch{}},onSoundToggle(e){this.soundEnabled=!!e,this.persistSoundPref()},async onBrowserNotifToggle(e){if(typeof Notification>"u"){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}if(!e){this.browserNotifEnabled=!1,this.persistBrowserNotifPref();return}let t=Notification.permission;if(t==="default"){try{t=await Notification.requestPermission()}catch(n){console.warn("[ww-messenger] notif permission request failed",n),t="denied"}this.notifPermission=t}this.browserNotifEnabled=t==="granted",this.persistBrowserNotifPref()},onMessageRevealed(e,t){var i;if(!this.soundEnabled&&!this.browserNotifEnabled||!t||!e||!vn(e))return;const n=typeof document<"u"&&document.hidden;this.isOpen&&!n&&((i=this.currentConv)==null?void 0:i.id)===t||(this.soundEnabled&&this.playNotificationSound(),this.browserNotifEnabled&&this.showBrowserNotification(t,e))},playNotificationSound(){if(typeof window>"u")return;const e=window.AudioContext||window.webkitAudioContext;if(e)try{this._audioCtx||(this._audioCtx=new e);const t=this._audioCtx;if(t.state==="suspended")try{t.resume()}catch{}const n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.connect(i),i.connect(t.destination),r.type="sine",r.frequency.setValueAtTime(880,n),r.frequency.exponentialRampToValueAtTime(1320,n+.08),i.gain.setValueAtTime(0,n),i.gain.linearRampToValueAtTime(.12,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.28),r.start(n),r.stop(n+.32)}catch{}},showBrowserNotification(e,t){if(typeof Notification>"u"||Notification.permission!=="granted")return;const n=t==null?void 0:t.author,r=!n||n.type==="agent_ia",s=((n==null?void 0:n.name)||(r?this.agentName:"")||this.t("launcher.theAgent"))+this.t("launcher.repliedToYou"),o=typeof(t==null?void 0:t.text_md)=="string"?t.text_md.trim():"",a=o?o.slice(0,140):this.t("notification.youHaveNewMessage");try{const l=new Notification(s,{body:a,tag:`wm-${e}`,renotify:!1,silent:!0});l.onclick=()=>{try{window.focus()}catch{}this.draftConv=null,this.showOnboarding=!1,this.activeConvId=e,this.isOpen=!0,this.store&&this.store.setPanelOpen(!0);try{l.close()}catch{}}}catch(l){console.warn("[ww-messenger] notification failed",l)}}}},Tc=450,Mc=50,Ec=900,Oc=12e3,Ic=300,Rc={data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",r=>{const i=r==null?void 0:r.conversation_id,s=r==null?void 0:r.message;i&&s&&this.paceLiveMessage(s,i)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(r=>[r.id,(r==null?void 0:r.last_message_at)||""]));const t=this.transport.on("activity",r=>{this.handleLiveActivity(r)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null},async handleLiveActivity(e){var i,s;const t=e==null?void 0:e.conversations;if(!Array.isArray(t)||!this.store)return;const n=this._liveRevealConvSnapshot||new Map,r=[];for(const o of t){if(!(o!=null&&o.id))continue;const a=o.last_message_at||"";if(!a)continue;const l=n.get(o.id)||"";a>l&&r.push(o.id)}this._liveRevealConvSnapshot=new Map(t.map(o=>[o.id,(o==null?void 0:o.last_message_at)||""]));for(const o of r)try{const a=await((s=(i=this.store).fetchSinceLast)==null?void 0:s.call(i,o));if(!Array.isArray(a))continue;for(const l of a)this.paceLiveMessage(l,o)}catch(a){console.error("[ww-messenger] activity delta fetch failed",a)}},scheduleReveal(e,t){const n=Date.now(),r=((e==null?void 0:e.text_md)||"").length,i=Math.min(Oc,Math.max(Ec,r*Mc)),o=Math.max(n+Tc,this.nextRevealAt+Ic)+i;this.nextRevealAt=o;const a=Math.max(0,o-n),l=e.id,f=setTimeout(()=>{this.revealedAt={...this.revealedAt,[l]:Date.now()},this.revealTimers=this.revealTimers.filter(c=>c!==f),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},a);this.revealTimers.push(f)},paceMessages(e,t){var i;if(!Array.isArray(e)||!e.length)return;const n=Date.now(),r={...this.revealedAt};for(const s of e){if((s==null?void 0:s.id)==null||r[s.id]!==void 0)continue;if(!vn(s)){r[s.id]=n;continue}const o=s!=null&&s.created_at?Date.parse(s.created_at):NaN;if(!Number.isFinite(o)||o<this.convOpenedAt){r[s.id]=n;continue}const a=typeof(s==null?void 0:s.text_md)=="string"&&s.text_md.trim().length>0,l=Array.isArray((i=s==null?void 0:s.payload)==null?void 0:i.attachments)&&s.payload.attachments.length>0;if(!a&&!l){r[s.id]=n;continue}r[s.id]=0,this.scheduleReveal(s,t)}this.revealedAt=r},paceLiveMessage(e,t){var i;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!vn(e)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const n=typeof(e==null?void 0:e.text_md)=="string"&&e.text_md.trim().length>0,r=Array.isArray((i=e==null?void 0:e.payload)==null?void 0:i.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Lc={data(){return{approvalSettled:!0,approvalSettleTimer:null,approvalLatchId:null}},methods:{resetApprovalPacing(){this.approvalSettleTimer&&(clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=null),this.approvalSettled=!0,this.approvalLatchId=null},bumpApprovalSettle(e=800){this.approvalSettled=!1,this.approvalSettleTimer&&clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=setTimeout(()=>{this.approvalSettled=!0,this.approvalSettleTimer=null},e)}}},Pc=300,Bc={data(){return{unreadAnchorId:null,unreadBoundaryTs:""}},created(){this._readMarkerTimer=null,this._readMarkerPending=null},beforeUnmount(){this._readMarkerTimer&&(clearTimeout(this._readMarkerTimer),this._readMarkerTimer=null),this._readMarkerPending=null},methods:{markConvRead(e){var s,o;if(!(e!=null&&e.id)||e._draft||!this.store)return;const t=((o=(s=this.s)==null?void 0:s.messagesByConv)==null?void 0:o[e.id])||[],n=Fc(t);if(n==null)return;const r=ft(e.last_read_message_id),i=ft(n);i!=null&&(r!=null&&i<=r||(this._readMarkerPending={convId:e.id,messageId:n},!this._readMarkerTimer&&(this._readMarkerTimer=setTimeout(()=>{const a=this._readMarkerPending;this._readMarkerPending=null,this._readMarkerTimer=null,a&&this.store&&this.store.markConversationRead(a.convId,a.messageId)},Pc))))}}};function Fc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&ft(n.id)!=null)return n.id}return null}const we=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Nc={name:"WmHumanAvatar",props:{name:{type:String,default:""},avatarUrl:{type:String,default:null},size:{type:Number,default:26},tail:{type:Boolean,default:!1}},computed:{bg(){return this.avatarUrl?"transparent":qs(this.name)},initials(){return Gs(this.name)}}},Dc=["src","alt"];function jc(e,t,n,r,i,s){return h(),_("div",{class:ie(["wm-huav",{"wm-huav--tail":n.tail}]),style:Oe({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(h(),_("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Dc)):(h(),_("span",{key:1,style:Oe({fontSize:n.size*.36+"px"})},L(s.initials),5))],6)}const Js=we(Nc,[["render",jc],["__scopeId","data-v-14e10c0d"]]),Hc=3,Uc={name:"WmLauncher",components:{HumanAvatar:Js},inject:{t:{default:()=>xe()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Hc).reverse()}}},$c=["aria-label","onClick","onKeydown"],Vc=["aria-label","onClick"],Kc={class:"wm-peek__avatar"},zc=["aria-label"],Wc={class:"wm-peek__body"},qc={class:"wm-peek__head"},Gc={class:"wm-peek__name"},Yc={class:"wm-peek__action"},Jc={class:"wm-peek__text"},Xc=["onClick"],Qc=["aria-label"],Zc=["aria-label"];function eu(e,t,n,r,i,s){const o=_e("HumanAvatar");return h(),_("div",{class:"wm-launcherWrap",onMouseenter:t[1]||(t[1]=a=>e.$emit("hover",!0)),onMouseleave:t[2]||(t[2]=a=>e.$emit("hover",!1)),onFocusin:t[3]||(t[3]=a=>e.$emit("hover",!0)),onFocusout:t[4]||(t[4]=a=>e.$emit("hover",!1))},[ve(bo,{name:"wm-peek"},{default:Vs(()=>[s.visiblePeeks.length?(h(),_("div",{key:0,class:ie(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(h(!0),_(ee,null,Se(s.visiblePeeks,(a,l)=>(h(),_("div",{key:a.convId,class:"wm-peek",style:Oe({"--depth":s.visiblePeeks.length-1-l,zIndex:l+1}),role:"button",tabindex:"0","aria-label":s.t("launcher.openConversationWith",{name:a.senderName||s.t("launcher.theAgent")}),onClick:f=>e.$emit("open",a.convId),onKeydown:[Dn(ht(f=>e.$emit("open",a.convId),["prevent"]),["enter"]),Dn(ht(f=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:ht(f=>e.$emit("dismiss",a.convId),["stop"])},[...t[5]||(t[5]=[u("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Vc),u("div",Kc,[ve(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(h(),_("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},L(a.count>9?"9+":a.count),9,zc)):N("",!0)]),u("div",Wc,[u("div",qc,[u("span",Gc,L(a.senderName||s.t("common.agent")),1),u("span",Yc,L(s.t("launcher.repliedToYou")),1)]),u("p",Jc,L(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:ht(f=>e.$emit("open",a.convId),["stop"])},L(s.t("common.open")),9,Xc)],44,$c))),128))],2)):N("",!0)]),_:1}),u("button",{type:"button",class:"wm-launcher","aria-label":s.t("launcher.open"),onClick:t[0]||(t[0]=a=>e.$emit("open"))},[t[6]||(t[6]=u("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),n.unreadCount>0?(h(),_("span",{key:0,class:"wm-launcher__badge","aria-label":n.unreadCount>1?s.t("launcher.unreadConversationsMany",{count:n.unreadCount}):s.t("launcher.unreadConversationsOne",{count:n.unreadCount})},L(n.unreadCount>9?"9+":n.unreadCount),9,Zc)):N("",!0)],8,Qc)],32)}const tu=we(Uc,[["render",eu],["__scopeId","data-v-44ddf1a1"]]),nu={name:"WmAIAvatar",props:{size:{type:Number,default:26},pulse:{type:Boolean,default:!1},tail:{type:Boolean,default:!1},name:{type:String,default:""},imageUrl:{type:String,default:null}},computed:{initials(){return Gs(this.name)},bgColor(){return qs(this.name)}}},su={key:0,class:"wm-aiav__pulse"},ru=["src","alt"],iu=["width","height"];function ou(e,t,n,r,i,s){return h(),_("div",{class:ie(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:Oe({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(h(),_("div",su)):N("",!0),u("div",{class:ie(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:Oe(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(h(),_("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,ru)):s.initials?(h(),_("span",{key:1,style:Oe({fontSize:n.size*.36+"px"})},L(s.initials),5)):(h(),_("svg",{key:2,width:n.size*.5,height:n.size*.5,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[...t[0]||(t[0]=[u("path",{d:"M12 2 L13.5 9 L20 10.5 L13.5 12 L12 19 L10.5 12 L4 10.5 L10.5 9 Z",fill:"white",opacity:"0.92"},null,-1),u("circle",{cx:"19",cy:"5",r:"1.5",fill:"white",opacity:"0.55"},null,-1),u("circle",{cx:"5",cy:"18",r:"1",fill:"white",opacity:"0.38"},null,-1)])],8,iu))],6)],6)}const qt=we(nu,[["render",ou],["__scopeId","data-v-6f7f685d"]]),au={name:"WmTeamAvatars",props:{members:{type:Array,default:()=>[]},responseLabel:{type:String,default:""}},computed:{visible(){return Array.isArray(this.members)&&this.members.length>0},stackWidth(){return Math.min(this.members.length,3)===1?20:16+Math.min(this.members.length,3)*13}},methods:{colorFor(e){return e.avatar_url?"transparent":qs(e.name||"")},initialsFor(e){return Gs(e.name||"")}}},lu={key:0,class:"wm-team"},cu=["src","alt"],uu={key:1},du={key:0,class:"wm-team__label"};function fu(e,t,n,r,i,s){return s.visible?(h(),_("div",lu,[u("div",{class:"wm-team__stack",style:Oe({width:s.stackWidth+"px"})},[(h(!0),_(ee,null,Se(n.members.slice(0,3),(o,a)=>(h(),_("div",{key:a,class:"wm-team__pill",style:Oe({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(h(),_("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,cu)):(h(),_("span",uu,L(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(h(),_("span",du,L(n.responseLabel),1)):N("",!0)])):N("",!0)}const hu=we(au,[["render",fu],["__scopeId","data-v-e49a9063"]]),mu={name:"WmHeader",components:{AIAvatar:qt,TeamAvatars:hu},inject:{t:{default:()=>xe()}},props:{title:{type:String,default:"Nouvelle conversation"},showBack:{type:Boolean,default:!1},teamMembers:{type:Array,default:()=>[]},responseLabel:{type:String,default:""},showClose:{type:Boolean,default:!0},showMore:{type:Boolean,default:!0},moreActive:{type:Boolean,default:!1},showIdentity:{type:Boolean,default:!0},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["back","close","more"],computed:{hasTeam(){return Array.isArray(this.teamMembers)&&this.teamMembers.length>0},displayedTeamMembers(){const e=Array.isArray(this.teamMembers)?this.teamMembers:[];if(e.length<=3)return e;const t=new Date().getHours()%e.length,n=[];for(let r=0;r<3;r++)n.push(e[(t+r)%e.length]);return n}}},pu={class:"wm-header"},gu=["aria-label"],_u={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},yu={class:"wm-header__avatar"},vu={class:"wm-header__main"},bu={class:"wm-header__title"},wu={key:3,class:"wm-header__fill"},ku={class:"wm-header__actions"},Cu=["aria-label","title"],Su=["aria-label","title"];function Au(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("TeamAvatars");return h(),_("div",pu,[n.showBack?(h(),_("button",{key:0,type:"button",class:"wm-header__icon","aria-label":s.t("header.backToHome"),onClick:t[0]||(t[0]=l=>e.$emit("back"))},[...t[3]||(t[3]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M19 12H5M12 5l-7 7 7 7"})],-1)])],8,gu)):(h(),_("div",_u)),n.showIdentity?(h(),_(ee,{key:2},[u("div",yu,[ve(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",vu,[u("div",bu,L(n.title),1)]),s.hasTeam?(h(),ye(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):N("",!0)],64)):(h(),_("div",wu)),u("div",ku,[n.showMore?(h(),_("button",{key:0,type:"button",class:ie(["wm-header__icon",{"wm-header__icon--active":n.moreActive}]),"aria-label":s.t("header.moreOptions"),title:s.t("header.moreOptions"),onClick:t[1]||(t[1]=l=>e.$emit("more"))},[...t[4]||(t[4]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[u("circle",{cx:"12",cy:"5",r:"1.6"}),u("circle",{cx:"12",cy:"12",r:"1.6"}),u("circle",{cx:"12",cy:"19",r:"1.6"})],-1)])],10,Cu)):N("",!0),n.showClose?(h(),_("button",{key:1,type:"button",class:"wm-header__icon","aria-label":s.t("header.closeWidget"),title:s.t("header.closeWidget"),onClick:t[2]||(t[2]=l=>e.$emit("close"))},[...t[5]||(t[5]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Su)):N("",!0)])])}const xu=we(mu,[["render",Au],["__scopeId","data-v-7af4c118"]]),qr={book:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253",changelog:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",status:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",chat:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",link:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"},Tu={name:"WmOnboarding",components:{AIAvatar:qt},inject:{t:{default:()=>xe()}},props:{welcomeMessage:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1}},emits:["start","select","resume","view-history"],computed:{heroTitle(){return this.welcomeMessage?this.welcomeMessage:this.agentName?this.t("onboarding.greetingNamed",{name:this.agentName}):this.t("onboarding.greeting")},heroSub(){return this.subtitle||this.t("onboarding.heroSub")},unreadThreads(){return this.openThreads.filter(e=>e.unread)}},methods:{iconPath(e){return qr[e]||qr.link},isExternalLink(e){const t=e==null?void 0:e.url;return!!t&&!t.startsWith("#")},safeIconUrl(e){return gc(e==null?void 0:e.icon_url)},iconUrlStyle(e){const t=this.safeIconUrl(e);return t?{"--icon-url":`url("${t}")`}:null}}},Mu={class:"wm-onb"},Eu={class:"wm-onb__hero"},Ou={class:"wm-onb__hero-text"},Iu={class:"wm-onb__title"},Ru={class:"wm-onb__sub"},Lu={class:"wm-onb__actions"},Pu=["disabled"],Bu={class:"wm-onb__btn-label"},Fu=["onClick"],Nu={class:"wm-onb__btn-icon"},Du=["aria-label"],ju={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.9","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Hu=["d"],Uu={class:"wm-onb__btn-label"},$u={key:0,class:"wm-onb__btn-trail",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Vu=["onClick"],Ku={class:"wm-onb__btn-label"},zu=["aria-label"],Wu={class:"wm-onb__btn-icon"},qu={width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Gu=["d"],Yu={class:"wm-onb__btn-label"},Ju={class:"wm-onb__btn-count"};function Xu(e,t,n,r,i,s){const o=_e("AIAvatar");return h(),_("div",Mu,[u("div",Eu,[t[2]||(t[2]=u("svg",{class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"}),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"}),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"})],-1)),ve(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",Ou,[u("div",Iu,L(s.heroTitle),1),u("div",Ru,L(s.heroSub),1)])]),u("div",Lu,[u("button",{type:"button",class:"wm-onb__btn wm-onb__btn--start",disabled:n.busy,onClick:t[0]||(t[0]=a=>e.$emit("start"))},[t[3]||(t[3]=u("span",{class:"wm-onb__btn-icon"},[u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 5v14M5 12h14"})])],-1)),u("span",Bu,L(n.busy?"โ€ฆ":s.t("onboarding.start")),1)],8,Pu),(h(!0),_(ee,null,Se(n.quickLinks,(a,l)=>(h(),_("button",{key:"ql-"+l,type:"button",class:"wm-onb__btn",onClick:f=>e.$emit("select",a)},[u("span",Nu,[s.safeIconUrl(a)?(h(),_("span",{key:0,class:"wm-onb__btn-iconImg",style:Oe(s.iconUrlStyle(a)),role:"img","aria-label":a.label||""},null,12,Du)):(h(),_("svg",ju,[u("path",{d:s.iconPath(a.icon)},null,8,Hu)]))]),u("span",Uu,L(a.label),1),s.isExternalLink(a)?(h(),_("svg",$u,[...t[4]||(t[4]=[u("path",{d:"M7 17L17 7M9 7h8v8"},null,-1)])])):N("",!0)],8,Fu))),128)),(h(!0),_(ee,null,Se(s.unreadThreads,a=>(h(),_("button",{key:"un-"+a.id,type:"button",class:"wm-onb__btn wm-onb__btn--unread",onClick:l=>e.$emit("resume",a)},[t[5]||(t[5]=u("span",{class:"wm-onb__btn-icon"},[u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])],-1)),u("span",Ku,L(a.title),1),u("span",{class:"wm-onb__btn-dot","aria-label":s.t("onboarding.unread")},null,8,zu)],8,Vu))),128)),n.openThreads.length?(h(),_("button",{key:0,type:"button",class:"wm-onb__btn",onClick:t[1]||(t[1]=a=>e.$emit("view-history"))},[u("span",Wu,[(h(),_("svg",qu,[u("path",{d:s.iconPath("chat")},null,8,Gu)]))]),u("span",Yu,L(s.t("onboarding.allConversations")),1),u("span",Ju,L(n.openThreads.length),1),t[6]||(t[6]=u("svg",{class:"wm-onb__btn-trail",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 18l6-6-6-6"})],-1))])):N("",!0)])])}const Qu=we(Tu,[["render",Xu],["__scopeId","data-v-0a0574a9"]]),Zu={name:"WmHistory",components:{AIAvatar:qt,HumanAvatar:Js},inject:{t:{default:()=>xe()},wmLocale:{default:()=>()=>"fr"}},props:{threads:{type:Array,default:()=>[]}},emits:["resume"],data(){return{query:""}},computed:{filteredThreads(){const e=this.query.trim().toLowerCase();return e?this.threads.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.preview||"").toLowerCase().includes(e)):this.threads}},methods:{renderPreview(e){return bc(e)},avatarComponent(e){var t;return((t=e==null?void 0:e.author)==null?void 0:t.type)==="agent_human"?"HumanAvatar":"AIAvatar"},avatarProps(e){const t=e==null?void 0:e.author;return(t==null?void 0:t.type)==="agent_human"?{size:40,name:t.name||"",avatarUrl:t.avatar_url||null}:{size:40,name:(t==null?void 0:t.name)||"",imageUrl:(t==null?void 0:t.avatar_url)||null}},isDefaultAvatar(e){const t=e==null?void 0:e.author;return!(t!=null&&t.avatar_url||t!=null&&t.name)},avatarWrapperClass(e){return this.isDefaultAvatar(e)&&!(e!=null&&e.unread)?"wm-hist__avatar--muted":null},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Kt(this.wmLocale()),r=new Date;if(t.toDateString()===r.toDateString())return t.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit"});if(r.getTime()-t.getTime()<7*864e5){const o=t.toLocaleDateString(n,{weekday:"short"});return o.charAt(0).toUpperCase()+o.slice(1)}return t.toLocaleDateString(n,{day:"2-digit",month:"2-digit"})}}},ed={class:"wm-hist"},td={class:"wm-hist__search"},nd=["placeholder","aria-label"],sd={class:"wm-hist__list"},rd=["onClick"],id={key:0,class:"wm-hist__defaultAvatar"},od=["aria-label"],ad={class:"wm-hist__thread-body"},ld={class:"wm-hist__thread-title"},cd=["innerHTML"],ud={class:"wm-hist__thread-meta"},dd={key:0,class:"wm-hist__thread-time"},fd={key:0,class:"wm-hist__empty"};function hd(e,t,n,r,i,s){return h(),_("div",ed,[u("div",td,[t[1]||(t[1]=u("span",{class:"wm-hist__searchIcon"},[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z"})])],-1)),at(u("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>i.query=o),type:"text",placeholder:s.t("onboarding.search"),"aria-label":s.t("onboarding.search")},null,8,nd),[[Rt,i.query]])]),u("div",sd,[(h(!0),_(ee,null,Se(s.filteredThreads,o=>(h(),_("button",{key:o.id,type:"button",class:ie(["wm-hist__thread",{"wm-hist__thread--unread":o.unread}]),onClick:a=>e.$emit("resume",o)},[u("span",{class:ie(["wm-hist__thread-avatar",s.avatarWrapperClass(o)])},[s.isDefaultAvatar(o)?(h(),_("span",id,[...t[2]||(t[2]=[u("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"})],-1)])])):(h(),ye(Ki(s.avatarComponent(o)),ho({key:1,ref_for:!0},s.avatarProps(o)),null,16)),o.unread?(h(),_("span",{key:2,class:"wm-hist__thread-dot","aria-label":s.t("onboarding.unread")},null,8,od)):N("",!0)],2),u("span",ad,[u("span",ld,L(o.title),1),u("span",{class:"wm-hist__thread-preview",innerHTML:s.renderPreview(o.preview)},null,8,cd)]),u("span",ud,[s.formatTs(o._ts)?(h(),_("span",dd,L(s.formatTs(o._ts)),1)):N("",!0),t[3]||(t[3]=u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",class:"wm-hist__thread-chev","aria-hidden":"true"},[u("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))])],10,rd))),128)),s.filteredThreads.length?N("",!0):(h(),_("div",fd,L(i.query?s.t("onboarding.noResults",{query:i.query}):s.t("onboarding.noConversations")),1))])])}const md=we(Zu,[["render",hd],["__scopeId","data-v-0d31869d"]]);function pd(e){return typeof e!="string"?"":e.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)","g"),"$1").replace(/__([^_]+)__/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\s+/g," ").trim()}const gd={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return pd(this.detail)}}},_d={class:"wm-result__icon","aria-hidden":"true"},yd={key:0,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round"},vd={key:1,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"},bd={key:2,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},wd={key:3,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},kd={class:"wm-result__body"},Cd={class:"wm-result__label"},Sd={class:"wm-result__detail"};function Ad(e,t,n,r,i,s){return h(),_("div",{class:ie(["wm-result",`wm-result--${n.state}`])},[u("span",_d,[n.state==="success"?(h(),_("svg",yd,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(h(),_("svg",vd,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(h(),_("svg",bd,[...t[2]||(t[2]=[u("circle",{cx:"12",cy:"12",r:"10"},null,-1),u("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(h(),_("svg",wd,[...t[3]||(t[3]=[u("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"},null,-1),u("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),u("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])]))]),u("span",kd,[u("span",Cd,L(n.label),1),s.detailText?(h(),_(ee,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," ยท ",-1)),u("span",Sd,L(s.detailText),1)],64)):N("",!0)])],2)}const xd=we(gd,[["render",Ad],["__scopeId","data-v-7284acd0"]]),Td={name:"WmArtifactFormResponse",inject:{t:{default:()=>xe()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},Md={class:"wm-art wm-art--formResponse"},Ed={class:"wm-art__head"},Od={class:"wm-art__title"},Id={class:"wm-art__badge wm-art__badge--success"},Rd={class:"wm-art__body"},Ld={class:"wm-art__fieldLabel"};function Pd(e,t,n,r,i,s){return h(),_("div",Md,[u("div",Ed,[u("div",Od,L(n.data.title||s.t("form.title")),1),u("span",Id,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("polyline",{points:"20 6 9 17 4 12"})],-1)),Zn(" "+L(s.t("form.sent")),1)])]),u("div",Rd,[(h(!0),_(ee,null,Se(s.fields,(o,a)=>(h(),_("div",{key:a,class:"wm-art__field"},[u("div",Ld,L(o.label),1),u("div",{class:ie(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},L(o.value),3)]))),128))])])}const Bd=we(Td,[["render",Pd],["__scopeId","data-v-713aecf1"]]),Fd={name:"WmArtifactInfoCard",props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},hasBody(){var e;return!!((e=this.data)!=null&&e.body)||this.fields.length>0}}},Nd={class:"wm-art wm-art--infoCard"},Dd={key:0,class:"wm-art__image"},jd=["src","alt"],Hd={class:"wm-art__head"},Ud={class:"wm-art__headMain"},$d={class:"wm-art__title"},Vd={key:0,class:"wm-art__subtitle"},Kd={key:1,class:"wm-art__body"},zd={key:0,class:"wm-art__text"},Wd={class:"wm-art__fieldLabel"};function qd(e,t,n,r,i,s){return h(),_("div",Nd,[n.data.image_url?(h(),_("figure",Dd,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,jd)])):N("",!0),u("div",Hd,[u("div",Ud,[u("div",$d,L(n.data.title),1),n.data.subtitle?(h(),_("div",Vd,L(n.data.subtitle),1)):N("",!0)]),n.data.badge&&n.data.badge.label?(h(),_("span",{key:0,class:ie(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},L(n.data.badge.label),3)):N("",!0)]),s.hasBody?(h(),_("div",Kd,[n.data.body?(h(),_("div",zd,L(n.data.body),1)):N("",!0),s.fields.length?(h(!0),_(ee,{key:1},Se(s.fields,(o,a)=>(h(),_("div",{key:a,class:"wm-art__field"},[u("div",Wd,L(o.label),1),u("div",{class:ie(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},L(o.value),3)]))),128)):N("",!0)])):N("",!0)])}const Gd=we(Fd,[["render",qd],["__scopeId","data-v-7eae0e4a"]]);function Yd(e,t,n){if(!e)return"";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const i=r.toLocaleDateString(t,{day:"numeric",month:"long",year:"numeric"}),s=r.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"});return`${i}${n}${s}`}const Jd={name:"WmArtifactTicket",inject:{t:{default:()=>xe()},wmLocale:{default:()=>()=>"fr"}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},formattedDate(){var e;return Yd((e=this.data)==null?void 0:e.created_at,Kt(this.wmLocale()),this.t("ticket.dateAt"))}},methods:{isPriority(e){return/priorit|^prio$/i.test(String(e||"").trim())},isDate(e){return/date|รฉchรฉanc|echeanc|deadline|due|crรฉรฉ|cree/i.test(String(e||"").trim())},priorityLevel(e){const t=String(e||"").toLowerCase();return/high|haute|รฉlev|elev|critic|critiq|urgent/.test(t)?3:/low|basse|faible|minor/.test(t)?1:2}}},Xd={class:"wm-art wm-art--ticket"},Qd={class:"wm-art__head wm-tk__head"},Zd={class:"wm-art__title wm-tk__title"},ef={class:"wm-tk__sub"},tf={class:"wm-tk__ref"},nf={key:0,class:"wm-tk__text"},sf={key:0,class:"wm-art__body"},rf={class:"wm-art__fieldLabel"},of=["data-level"],af={key:1,class:"wm-tk__date",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},lf={key:1,class:"wm-art__footer wm-tk__footer"};function cf(e,t,n,r,i,s){return h(),_("div",Xd,[u("div",Qd,[u("div",Zd,L(n.data.title),1),u("div",ef,[u("div",tf,[t[0]||(t[0]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 12a2 2 0 0 1 2-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v4a2 2 0 0 1 0 4v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 1-2-2z"}),u("path",{d:"M13 5v2M13 17v2M13 11v2"})],-1)),u("span",null,L(n.data.reference),1)]),u("span",{class:ie(["wm-art__badge","wm-tk__badge",`wm-art__badge--${n.data.status.tone||"neutral"}`])},[t[1]||(t[1]=u("span",{class:"wm-tk__dot","aria-hidden":"true"},null,-1)),Zn(" "+L(n.data.status.label),1)],2)]),n.data.body?(h(),_("div",nf,L(n.data.body),1)):N("",!0)]),s.fields.length?(h(),_("div",sf,[(h(!0),_(ee,null,Se(s.fields,(o,a)=>(h(),_("div",{key:a,class:"wm-art__field"},[u("div",rf,L(o.label),1),u("div",{class:ie(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(h(),_("svg",{key:0,class:"wm-tk__prio","data-level":s.priorityLevel(o.value),width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true"},[...t[2]||(t[2]=[u("rect",{x:"1",y:"8",width:"2",height:"3",rx:"0.5"},null,-1),u("rect",{x:"5",y:"5",width:"2",height:"6",rx:"0.5"},null,-1),u("rect",{x:"9",y:"2",width:"2",height:"9",rx:"0.5"},null,-1)])],8,of)):s.isDate(o.label)?(h(),_("svg",af,[...t[3]||(t[3]=[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"},null,-1),u("path",{d:"M16 2v4M8 2v4M3 10h18"},null,-1)])])):N("",!0),u("span",null,L(o.value),1)],2)]))),128))])):N("",!0),n.data.created_at?(h(),_("div",lf,[t[4]||(t[4]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),u("path",{d:"M16 2v4M8 2v4M3 10h18"})],-1)),u("span",null,L(s.formattedDate),1)])):N("",!0)])}const uf=we(Jd,[["render",cf],["__scopeId","data-v-5f30c914"]]),df={form_response:Bd,info_card:Gd,ticket:uf},ff={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&df[e]||null}}};function hf(e,t,n,r,i,s){return s.component?(h(),ye(Ki(s.component),{key:0,data:n.artifact.data},null,8,["data"])):N("",!0)}const mf=we(ff,[["render",hf]]),pf={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>xe()}},props:{attachment:{type:Object,required:!0}},data(){return{url:null,loading:!1}},computed:{kind(){var n,r;const e=(n=this.attachment)==null?void 0:n.type;if(e)return e;const t=(((r=this.attachment)==null?void 0:r.mime_type)||"").toLowerCase();return t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":"file"},displayName(){var e,t,n;return((t=(e=this.attachment)==null?void 0:e.metadata)==null?void 0:t.name)||((n=this.attachment)==null?void 0:n.name)||this.guessNameFromPath()||this.t("attachment.fallbackName")},safeHref(){const e=String(this.url||"").trim();return/^(https?:\/\/|blob:|data:image\/)/i.test(e)?e:"#"},sizeLabel(){var t;const e=(t=this.attachment)==null?void 0:t.size_bytes;return e?e<1024?this.t("attachment.bytes",{size:e}):e<1024*1024?this.t("attachment.kilobytes",{size:(e/1024).toFixed(0)}):this.t("attachment.megabytes",{size:(e/(1024*1024)).toFixed(1)}):""}},watch:{"attachment.path":{handler(){this.refresh()},immediate:!0}},methods:{guessNameFromPath(){var n;return((((n=this.attachment)==null?void 0:n.path)||"").split("/").pop()||"").replace(/^[0-9a-f-]{8,}-/,"")},async refresh(){var e;if(!(!((e=this.attachment)!=null&&e.path)||!this.signAttachmentFn)){this.loading=!0;try{this.url=await this.signAttachmentFn(this.attachment.path)}finally{this.loading=!1}}},onFileClick(e){this.safeHref==="#"&&e.preventDefault()}}},gf=["href"],_f=["src","alt"],yf=["src"],vf=["src"],bf=["href","download"],wf={class:"wm-att__main"},kf={class:"wm-att__name"},Cf={key:0,class:"wm-att__meta"},Sf={key:0,class:"wm-att__spin","aria-hidden":"true"};function Af(e,t,n,r,i,s){return h(),_("div",{class:ie(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(h(),_("a",{key:0,href:s.safeHref,target:"_blank",rel:"noopener",class:"wm-att__imgWrap"},[u("img",{src:i.url,alt:s.displayName,loading:"lazy"},null,8,_f)],8,gf)):s.kind==="audio"&&i.url?(h(),_("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,yf)):s.kind==="video"&&i.url?(h(),_("video",{key:2,src:i.url,controls:"",preload:"metadata"},null,8,vf)):(h(),_("a",{key:3,class:"wm-att__file",href:s.safeHref,download:s.displayName,target:"_blank",rel:"noopener",onClick:t[0]||(t[0]=(...o)=>s.onFileClick&&s.onFileClick(...o))},[t[1]||(t[1]=u("span",{class:"wm-att__icon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),u("path",{d:"M14 2v6h6"})])],-1)),u("span",wf,[u("span",kf,L(s.displayName),1),s.sizeLabel?(h(),_("span",Cf,L(s.sizeLabel),1)):N("",!0)]),i.loading?(h(),_("span",Sf)):N("",!0)],8,bf))],2)}const xf=we(pf,[["render",Af],["__scopeId","data-v-0c877a62"]]),Tf={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return wc(this.text)}}},Mf=["innerHTML"];function Ef(e,t,n,r,i,s){return h(),_("div",{class:ie(["wm-bubble","wm-bubble--"+n.role])},[Ra(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,Mf)])],2)}const Of=we(Tf,[["render",Ef],["__scopeId","data-v-7ab13147"]]),If={name:"WmTyping"},Rf={class:"wm-typing"};function Lf(e,t,n,r,i,s){return h(),_("div",Rf,[...t[0]||(t[0]=[u("span",{style:{"animation-delay":"0s"}},null,-1),u("span",{style:{"animation-delay":"0.2s"}},null,-1),u("span",{style:{"animation-delay":"0.4s"}},null,-1)])])}const Pf=we(If,[["render",Lf],["__scopeId","data-v-df2447fd"]]);function Et(e){return e?e.client_msg_id||e.id:""}const Bf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",reopened:"system.reopened",idle:"system.idle"},Ff=80,Nf=200,Df={name:"WmMessageList",components:{AIAvatar:qt,HumanAvatar:Js,Bubble:Of,Typing:Pf,ActionResult:xd,AttachmentPreview:xf,ArtifactRenderer:mf},inject:{t:{default:()=>xe()},wmLocale:{default:()=>()=>"fr"}},props:{messages:{type:Array,default:()=>[]},streamingActive:{type:Boolean,default:!1},dateLabel:{type:String,default:""},conversationId:{type:[String,Number],default:null},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},unreadAnchorId:{type:Number,default:null},unreadBoundaryTs:{type:String,default:""},aiAgentName:{type:String,default:""},aiAgentAvatarUrl:{type:String,default:null}},emits:["load-more"],data(){return{silentFades:!1,widthByKey:Object.freeze({}),showScrollDown:!1,pressedItemKey:null}},computed:{historyExhausted(){return!this.hasMore&&!this.loadingMore&&this.messages.length>=20},groups(){var n,r,i,s;const e=[];for(const o of this.messages){const a=this.roleOf(o);if(a==="system"){if(((n=o==null?void 0:o.payload)==null?void 0:n.event)==="action_admin_pending"){const c=e[e.length-1];c&&c.role==="ai"?c.messages.push(o):e.push({key:`g-${Et(o)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[o],items:[]});continue}e.push({key:`sys-${Et(o)}`,role:a,messages:[o],items:[],systemLabel:this.systemLabel(o)});continue}const l=e[e.length-1];l&&l.role===a&&(a==="ai"||l.agentName===(((r=o==null?void 0:o.author)==null?void 0:r.name)||""))?l.messages.push(o):e.push({key:`g-${Et(o)}`,role:a,agentName:((i=o==null?void 0:o.author)==null?void 0:i.name)||"",agentAvatarUrl:((s=o==null?void 0:o.author)==null?void 0:s.avatar_url)||null,messages:[o],items:[]})}for(const o of e){if(o.role==="system")continue;const a=[];for(const l of o.messages)for(const f of this.itemsOf(l))a.push(f);o.items=a}const t=[];for(const o of e){if(o.role!=="system"&&!o.items.length)continue;const a=t[t.length-1];if(a&&a.role!=="system"&&a.role===o.role&&(o.role==="ai"||a.agentName===o.agentName)){a.messages.push(...o.messages),a.items.push(...o.items);continue}t.push(o)}for(const o of t)o.role!=="system"&&(o.key=this.stableGroupKey(o.messages));return t},unreadGroupKey(){if(this.unreadAnchorId==null)return null;const e=this.unreadAnchorId,t=this.unreadBoundaryTs;for(const n of this.groups){if(n.role==="user"||n.role==="system"||!n.items.length)continue;const r=n.messages[0];if(!r)continue;const i=ft(r.id);if(i!=null&&!(i<=e)&&!(t&&r.created_at&&r.created_at>t))return n.key}return null}},watch:{messages:{handler:"snapshotAndRestore",deep:!0},conversationId(e,t){e!==t&&(this._groupIdByMsgKey=null,this.silentFades=!1)},loadingMore(e){e||(this._pendingLoadMore=!1),e&&(this.silentFades=!0),this.snapshotAndRestore()},streamingActive:"snapshotAndRestore"},mounted(){this._lastSeenConvId=this.conversationId,this.scrollToBottom(),this._measureFrame=null,this._ro=new ResizeObserver(()=>this.scheduleMeasure()),this.$refs.scrollEl&&this._ro.observe(this.$refs.scrollEl),this.$nextTick(()=>this.measureRows())},beforeUnmount(){var e;(e=this._ro)==null||e.disconnect(),this._measureFrame&&cancelAnimationFrame(this._measureFrame),this._pressTimer&&clearTimeout(this._pressTimer)},updated(){this.scheduleMeasure()},methods:{messageKey:Et,stableGroupKey(e){this._groupIdByMsgKey||(this._groupIdByMsgKey=new Map,this._groupIdCounter=0);const t=this._groupIdByMsgKey;let n=null;for(const r of e){const i=Et(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Et(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Ff},onScroll(){const e=this.$refs.scrollEl;e&&(this.showScrollDown=!this.isAtBottom(e),!(this.loadingMore||!this.hasMore)&&(this._pendingLoadMore||e.scrollTop<=Nf&&(this._pendingLoadMore=!0,this.$emit("load-more"))))},snapshotAndRestore(){const e=this.$refs.scrollEl;if(!e||this._scrollSnap)return;const t=this._lastSeenConvId!==this.conversationId;this._lastSeenConvId=this.conversationId;const n=this.isAtBottom(e);let r=null;if(!t&&!n){const s=this.pickAnchor(e);if(s!=null&&s.rowKey){const o=this.findRowByKey(e,s.rowKey);if(o){const a=e.getBoundingClientRect().top;r={rowKey:s.rowKey,relY:o.getBoundingClientRect().top-a}}}}const i={forceBottom:t,wasPinned:n,anchor:r};this._scrollSnap=i,this.$nextTick(()=>{if(this._scrollSnap=null,i.forceBottom||i.wasPinned){e.scrollTop=e.scrollHeight;return}if(!i.anchor)return;const s=()=>{const o=i.anchor,a=this.findRowByKey(e,o.rowKey);if(!a)return;const f=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(f)>.5&&(e.scrollTop+=f)};s(),requestAnimationFrame(()=>{s(),requestAnimationFrame(s)})})},pickAnchor(e){const t=e.getBoundingClientRect().top,n=e.querySelectorAll(".wm-list__row[data-row-key]");let r=null;for(const i of n)if(r||(r=i),i.getBoundingClientRect().bottom>=t)return{rowKey:i.dataset.rowKey};return r?{rowKey:r.dataset.rowKey}:null},findRowByKey(e,t){if(!t)return null;const n=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&");return e.querySelector(`.wm-list__row[data-row-key="${n}"]`)},roleOf(e){var n,r;if((e==null?void 0:e.type)==="system"||((n=e==null?void 0:e.payload)==null?void 0:n.type)==="system")return"system";const t=(r=e==null?void 0:e.author)==null?void 0:r.type;return t==="user"?"user":t==="agent_human"?"human":"ai"},roleLabel(e){if(e.role==="human")return e.agentName||this.t("common.agent");const t=this.t("common.aiAssistant");return this.aiAgentName?`${this.aiAgentName} โ€ข ${t}`:t},itemsOf(e){var t;if(!e)return[];if(e.type==="system"&&((t=e==null?void 0:e.payload)==null?void 0:t.event)==="action_admin_pending")return[{message:e,partKey:"main",renderAs:"admin-pending",kind:{top:"bubble",bottom:"bubble"}}];if(e.type==="action"&&e.payload&&e.payload.state!=="pending"){const n=[{message:e,partKey:"main",renderAs:"action",kind:{top:"bubble",bottom:"bubble"}}];return this.actionArtifact(e)&&n.push({message:e,partKey:"artifact",renderAs:"artifact-of-action",kind:{top:"card",bottom:"card"}}),n}return this.artifactOf(e)?[{message:e,partKey:"main",renderAs:"artifact",kind:{top:"card",bottom:"card"}}]:e.text_md||this.attachmentsOf(e).length?[{message:e,partKey:"main",renderAs:"bubble",kind:{top:"bubble",bottom:"bubble"}}]:[]},cornersFor(e,t){var $,se,ge;const n=e.items,r=($=n[t])==null?void 0:$.kind,i=(se=n[t-1])==null?void 0:se.kind,s=(ge=n[t+1])==null?void 0:ge.kind,o=e.role==="user",a=14,l=4,f=i==null?void 0:i.bottom,c=s==null?void 0:s.top,p=this.widthByKey[this.rowKeyOf(e,t)],A=this.widthByKey[this.rowKeyOf(e,t-1)],w=this.widthByKey[this.rowKeyOf(e,t+1)],V=.5,O=(he,ke,G)=>he!=null&&p!=null?he+V>=p:ke===G||ke==="card"&&G==="bubble";let J=a,W=a,U=a,Q=a;return o?(f&&(W=l),(c||!s)&&(U=l),f&&O(A,f,r==null?void 0:r.top)&&(J=l),c&&O(w,c,r==null?void 0:r.bottom)&&(Q=l)):(f&&(J=l),(c||!s)&&(Q=l),f&&O(A,f,r==null?void 0:r.top)&&(W=l),c&&O(w,c,r==null?void 0:r.bottom)&&(U=l)),{tl:J,tr:W,br:U,bl:Q}},cornersStyle(e,t){if(e.items.length<2)return null;const n=this.cornersFor(e,t);return{"--wm-r-tl":`${n.tl}px`,"--wm-r-tr":`${n.tr}px`,"--wm-r-br":`${n.br}px`,"--wm-r-bl":`${n.bl}px`}},rowKeyOf(e,t){var r;const n=(r=e==null?void 0:e.items)==null?void 0:r[t];return n?`${Et(n.message)}-${n.partKey}`:""},scheduleMeasure(){this._measureFrame||(this._measureFrame=requestAnimationFrame(()=>{this._measureFrame=null,this.measureRows()}))},measureRows(){const e=this.$refs.scrollEl;if(!e)return;const t={};for(const s of e.querySelectorAll(".wm-list__row[data-row-key]")){const o=s.dataset.rowKey;if(!o)continue;const a=s.querySelector(".wm-bubble, .wm-result, .wm-art, .wm-list__body");if(!a)continue;const l=a.getBoundingClientRect().width;l>0&&(t[o]=l)}const n=this.widthByKey,r=Object.keys(n),i=Object.keys(t);if(r.length===i.length){let s=!0;for(const o of i)if(Math.abs((n[o]??0)-t[o])>.5){s=!1;break}if(s)return}this.widthByKey=Object.freeze(t)},onPressStart(e){this.onPressEnd(),this._pressTimer=setTimeout(()=>{this._pressTimer=null,this.pressedItemKey=e},400)},onPressEnd(){this._pressTimer&&(clearTimeout(this._pressTimer),this._pressTimer=null),this.pressedItemKey!==null&&(this.pressedItemKey=null)},timeOf(e){if(!(e!=null&&e.created_at))return"";try{return Is(new Date(e.created_at),Kt(this.wmLocale()))}catch{return""}},lastTimeOf(e){const t=e.items[e.items.length-1],n=(t==null?void 0:t.message)||e.messages[e.messages.length-1];if(!(n!=null&&n.created_at))return"";try{return Is(new Date(n.created_at),Kt(this.wmLocale()))}catch{return""}},hasTrailingOverlay(e){if(!e.messages.length)return!1;const t=e.messages[e.messages.length-1],n=e.items[e.items.length-1];return!!t&&(n==null?void 0:n.message)!==t},attachmentsOf(e){var n;const t=(n=e==null?void 0:e.payload)==null?void 0:n.attachments;return Array.isArray(t)?t:[]},artifactOf(e){var n;const t=(n=e==null?void 0:e.metadata)==null?void 0:n.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},actionLabel(e){var t;return((t=e==null?void 0:e.payload)==null?void 0:t.name)||(e==null?void 0:e.text_md)||this.t("common.action")},actionDetail(e){var n,r,i,s,o,a;const t=e==null?void 0:e.payload;return t?t.state==="success"?((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"":t.state==="rejected"?((s=t.rejected)==null?void 0:s.reason)||this.t("action.rejectedByUser"):t.state==="failure"&&(((o=t.failure)==null?void 0:o.summary)||((a=t.failure)==null?void 0:a.error))||"":""},actionArtifact(e){var n,r;const t=(r=(n=e==null?void 0:e.payload)==null?void 0:n.success)==null?void 0:r.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},systemLabel(e){var i,s,o;const t=(i=e==null?void 0:e.payload)==null?void 0:i.event,n=Bf[t],r=((s=e==null?void 0:e.metadata)==null?void 0:s.agent_name)||((o=e==null?void 0:e.author)==null?void 0:o.name)||this.t("messageList.anAgent");return n?this.t(n,{name:r}):(e==null?void 0:e.text_md)||this.t("messageList.conversationUpdate")},scrollToBottom(){const e=this.$refs.scrollEl;e&&(e.scrollTop=e.scrollHeight),this.showScrollDown=!1},scrollToBottomSmooth(){const e=this.$refs.scrollEl;e&&(typeof e.scrollTo=="function"?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight,this.showScrollDown=!1)}}},jf={class:"wm-list__wrap"},Hf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Uf={class:"wm-list__loadMore-lbl"},$f={key:1,class:"wm-list__historyEnd"},Vf={key:2,class:"wm-list__sep"},Kf={class:"wm-list__sep-label"},zf={key:0,class:"wm-list__sep wm-list__sep--unread"},Wf={class:"wm-list__sep-label wm-list__sep-label--unread"},qf={key:0,class:"wm-list__sysep"},Gf={class:"wm-list__sysep-label"},Yf=["data-row-key","onPointerdown"],Jf={key:0,class:"wm-list__avatarSlot"},Xf={key:5,class:"wm-list__body"},Qf={key:0},Zf={key:1,"aria-hidden":"true"},eh={key:2},th={key:0},nh={key:1,"aria-hidden":"true"},sh={key:2},rh={key:3,class:"wm-list__row wm-list__row--ai fade-up"},ih={class:"wm-list__avatarSlot"},oh=["aria-label","title"];function ah(e,t,n,r,i,s){const o=_e("AIAvatar"),a=_e("HumanAvatar"),l=_e("ActionResult"),f=_e("ArtifactRenderer"),c=_e("Bubble"),p=_e("AttachmentPreview"),A=_e("Typing");return h(),_("div",jf,[u("div",{ref:"scrollEl",class:ie(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[4]||(t[4]=(...w)=>s.onScroll&&s.onScroll(...w))},[n.loadingMore?(h(),_("div",Hf,[t[6]||(t[6]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",Uf,L(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(h(),_("div",$f,L(s.t("messageList.conversationStart")),1)):N("",!0),n.dateLabel?(h(),_("div",Vf,[t[7]||(t[7]=u("div",{class:"wm-list__line"},null,-1)),u("span",Kf,L(n.dateLabel),1),t[8]||(t[8]=u("div",{class:"wm-list__line"},null,-1))])):N("",!0),(h(!0),_(ee,null,Se(s.groups,(w,V)=>(h(),_(ee,{key:w.key},[w.key===s.unreadGroupKey?(h(),_("div",zf,[t[9]||(t[9]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",Wf,L(s.t("messageList.unread")),1),t[10]||(t[10]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):N("",!0),w.role==="system"||w.items.length?(h(),_("div",{key:1,class:ie(["wm-list__group","wm-list__group--"+w.role])},[w.role==="system"?(h(),_("div",qf,[t[11]||(t[11]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",Gf,L(w.systemLabel),1),t[12]||(t[12]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(h(),_(ee,{key:1},[(h(!0),_(ee,null,Se(w.items,(O,J)=>(h(),_(ee,{key:`${s.messageKey(O.message)}-${O.partKey}`},[u("div",{"data-row-key":`${s.messageKey(O.message)}-${O.partKey}`,class:ie(["wm-list__row fade-up",["wm-list__row--"+w.role,{"is-pending":O.message._pending,"is-failed":O.message._failed}]]),style:Oe(s.cornersStyle(w,J)),onPointerdown:W=>s.onPressStart(`${s.messageKey(O.message)}-${O.partKey}`),onPointerup:t[0]||(t[0]=W=>s.onPressEnd()),onPointercancel:t[1]||(t[1]=W=>s.onPressEnd()),onPointerleave:t[2]||(t[2]=W=>s.onPressEnd()),onContextmenu:t[3]||(t[3]=ht(()=>{},["prevent"]))},[w.role!=="user"?(h(),_("div",Jf,[J===w.items.length-1?(h(),_(ee,{key:0},[w.role==="ai"?(h(),ye(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(h(),ye(a,{key:1,name:w.agentName,"avatar-url":w.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):N("",!0)])):N("",!0),O.renderAs==="action"?(h(),ye(l,{key:1,state:O.message.payload.state,label:s.actionLabel(O.message),detail:s.actionDetail(O.message)},null,8,["state","label","detail"])):O.renderAs==="admin-pending"?(h(),ye(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:O.message.text_md||""},null,8,["label","detail"])):O.renderAs==="artifact-of-action"?(h(),ye(f,{key:3,artifact:s.actionArtifact(O.message)},null,8,["artifact"])):O.renderAs==="artifact"?(h(),ye(f,{key:4,artifact:s.artifactOf(O.message)},null,8,["artifact"])):(h(),_("div",Xf,[O.message.text_md?(h(),ye(c,{key:0,role:w.role,text:O.message.text_md},null,8,["role","text"])):N("",!0),s.attachmentsOf(O.message).length?(h(),_("div",{key:1,class:ie(["wm-list__atts",{"wm-list__atts--align-end":w.role==="user"}])},[(h(!0),_(ee,null,Se(s.attachmentsOf(O.message),(W,U)=>(h(),ye(p,{key:`${s.messageKey(O.message)}-att-${U}`,attachment:W},null,8,["attachment"]))),128))],2)):N("",!0)]))],46,Yf),J<w.items.length-1&&i.pressedItemKey===`${s.messageKey(O.message)}-${O.partKey}`&&(w.role!=="user"||s.timeOf(O.message))?(h(),_("div",{key:0,class:ie(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":w.role==="user"}])},[w.role!=="user"?(h(),_("span",Qf,L(s.roleLabel(w)),1)):N("",!0),w.role!=="user"&&s.timeOf(O.message)?(h(),_("span",Zf,"โ€ข")):N("",!0),s.timeOf(O.message)?(h(),_("span",eh,L(s.timeOf(O.message)),1)):N("",!0)],2)):N("",!0)],64))),128)),(w.role!=="user"||s.lastTimeOf(w))&&!s.hasTrailingOverlay(w)?(h(),_("div",{key:0,class:ie(["wm-list__meta",{"wm-list__meta--right":w.role==="user"}])},[w.role!=="user"?(h(),_("span",th,L(s.roleLabel(w)),1)):N("",!0),w.role!=="user"&&s.lastTimeOf(w)?(h(),_("span",nh,"โ€ข")):N("",!0),s.lastTimeOf(w)?(h(),_("span",sh,L(s.lastTimeOf(w)),1)):N("",!0)],2)):N("",!0)],64))],2)):N("",!0)],64))),128)),n.streamingActive?(h(),_("div",rh,[u("div",ih,[ve(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),ve(A)])):N("",!0)],34),ve(bo,{name:"wm-scrollDown"},{default:Vs(()=>[i.showScrollDown?(h(),_("button",{key:0,type:"button",class:"wm-list__scrollDown","aria-label":s.t("messageList.scrollToBottom"),title:s.t("messageList.scrollToBottom"),onClick:t[5]||(t[5]=(...w)=>s.scrollToBottomSmooth&&s.scrollToBottomSmooth(...w))},[...t[13]||(t[13]=[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M6 9l6 6 6-6"})],-1)])],8,oh)):N("",!0)]),_:1})])}const lh=we(Df,[["render",ah],["__scopeId","data-v-cf20685c"]]),jn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",Xs=typeof window<"u"&&typeof window.MediaRecorder<"u";function ch(){return Xs&&["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm","video/mp4"].find(t=>{var n,r;return(r=(n=window.MediaRecorder).isTypeSupported)==null?void 0:r.call(n,t)})||""}function Ao({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function uh(){if(!jn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(Ao({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await dh(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function dh(e){const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.srcObject=e,await t.play(),await new Promise(a=>requestAnimationFrame(a));const n=t.videoWidth||1280,r=t.videoHeight||720,i=document.createElement("canvas");i.width=n,i.height=r,i.getContext("2d").drawImage(t,0,0,n,r);const s=await new Promise((a,l)=>{i.toBlob(f=>f?a(f):l(new Error("toBlob failed")),"image/png")}),o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);return new File([s],`capture-${o}.png`,{type:"image/png"})}async function fh(e={}){var f;if(!jn||!Xs)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(Ao({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=ch();let r;try{r=n?new window.MediaRecorder(t,{mimeType:n}):new window.MediaRecorder(t)}catch(c){return console.error("[media] recorder init",c),t.getTracks().forEach(p=>{p.stop()}),null}const i=[];let s=null,o=!1;r.addEventListener("dataavailable",c=>{c.data&&c.data.size>0&&i.push(c.data)}),r.addEventListener("stop",()=>{var c,p;if(s&&clearInterval(s),t.getTracks().forEach(A=>{A.stop()}),i.length){const A=r.mimeType||n||"video/webm",w=new Blob(i,{type:A}),V=/mp4/.test(A)?"mp4":"webm",O=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),J=new File([w],`ecran-${O}.${V}`,{type:A});(c=e.onfinalize)==null||c.call(e,J)}else(p=e.oncancel)==null||p.call(e)}),t.getVideoTracks().forEach(c=>{c.addEventListener("ended",()=>a(),{once:!0})});function a(){if(!o&&(o=!0,r.state!=="inactive"))try{r.stop()}catch(c){console.error("[media] recorder stop",c)}}try{r.start(1e3)}catch(c){return console.error("[media] recorder start",c),t.getTracks().forEach(p=>{p.stop()}),null}(f=e.onstart)==null||f.call(e);const l=Date.now();return s=setInterval(()=>{var c;(c=e.ontick)==null||c.call(e,Date.now()-l)},500),{stop:a,get state(){return r.state}}}const hh=[{action:"file",labelKey:"composer.attachFile",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"},{action:"screenshot",labelKey:"composer.screenshot",path:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z M12 17a4 4 0 100-8 4 4 0 000 8z"},{action:"record",labelKey:"composer.recordScreen",path:"M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"}],mh={name:"WmComposer",inject:{t:{default:()=>xe()}},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"ร‰crivez votre messageโ€ฆ"},disabled:{type:Boolean,default:!1},attachLabel:{type:String,default:"Joindre"},displayMode:{type:String,default:"floating"}},emits:["update:modelValue","send","attach"],data(){return{local:this.modelValue,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null,kbOffset:0}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},attachItems(){return hh.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!jn||e.action==="record"&&(!jn||!Xs)}))},recordingElapsedLabel(){const e=Math.floor(this.recordingElapsed/1e3),t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}},watch:{modelValue(e){e!==this.local&&(this.local=e,this.$nextTick(()=>this.autosize()))},local(e){this.$emit("update:modelValue",e)}},mounted(){this.autosize(),this.displayMode==="sheet"&&this.setupKeyboardTracking()},beforeUnmount(){if(this.recorder)try{this.recorder.stop()}catch{}this.teardownKeyboardTracking()},methods:{focus(){const e=this.$refs.inputEl;if(!(!e||this.disabled))try{e.focus({preventScroll:!0})}catch{e.focus()}},onSubmit(){if(!this.canSend)return;const e=this.local.trim();this.local="",this.$emit("send",e),this.$nextTick(()=>this.autosize())},onKeydown(e){e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&(e.preventDefault(),this.onSubmit())},autosize(){const e=this.$refs.inputEl;e&&(e.clientWidth<80||(e.style.height="auto",e.style.height=`${e.scrollHeight}px`))},onFile(e){const t=Array.from(e.target.files||[]);for(const n of t)this.$emit("attach",n);e.target.value=""},onAttachAction(e){this.attachOpen=!1,e==="file"?this.pickFile():e==="screenshot"?this.captureScreenshot():e==="record"&&this.startRecording()},pickFile(){var e;(e=this.$refs.fileEl)==null||e.click()},async captureScreenshot(){if(this.disabled)return;const e=await uh();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await fh({onstart:()=>{this.recording=!0},ontick:t=>{this.recordingElapsed=t},onfinalize:t=>{this.$emit("attach",t),this.recording=!1,this.recordingElapsed=0,this.recorder=null},oncancel:()=>{this.recording=!1,this.recordingElapsed=0,this.recorder=null}});e&&(this.recorder=e)},stopRecording(){if(this.recorder)try{this.recorder.stop()}catch(e){console.error("[composer] stop recording",e)}},setupKeyboardTracking(){const e=window.visualViewport;e&&(this._vvHandler=()=>{const t=Math.max(0,window.innerHeight-e.height-e.offsetTop);this.kbOffset=t},e.addEventListener("resize",this._vvHandler),e.addEventListener("scroll",this._vvHandler))},teardownKeyboardTracking(){const e=window.visualViewport;!e||!this._vvHandler||(e.removeEventListener("resize",this._vvHandler),e.removeEventListener("scroll",this._vvHandler),this._vvHandler=null)}}},ph={key:0,class:"wm-rec"},gh={class:"wm-rec__lbl"},_h={key:1,class:"wm-compose__menu",role:"menu"},yh=["disabled","onClick"],vh={class:"wm-compose__menuIcon"},bh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},wh=["d"],kh=["placeholder","disabled"],Ch={class:"wm-compose__actions"},Sh=["title","aria-label","disabled"],Ah=["disabled","aria-label"];function xh(e,t,n,r,i,s){return h(),_("div",{class:ie(["wm-compose-wrap",{"wm-compose-wrap--sheet":n.displayMode==="sheet"}]),style:Oe(i.kbOffset?{transform:`translateY(-${i.kbOffset}px)`}:null)},[i.recording?(h(),_("div",ph,[t[8]||(t[8]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",gh,L(s.t("composer.recording",{time:s.recordingElapsedLabel})),1),u("button",{type:"button",class:"wm-rec__stop",onClick:t[0]||(t[0]=(...o)=>s.stopRecording&&s.stopRecording(...o))},L(s.t("composer.stop")),1)])):N("",!0),u("form",{class:ie(["wm-compose",{"has-attach":i.attachOpen}]),onSubmit:t[7]||(t[7]=ht((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]))},[u("input",{ref:"fileEl",type:"file",hidden:"",multiple:"",onChange:t[1]||(t[1]=(...o)=>s.onFile&&s.onFile(...o))},null,544),i.attachOpen?(h(),_("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):N("",!0),i.attachOpen?(h(),_("div",_h,[(h(!0),_(ee,null,Se(s.attachItems,o=>(h(),_("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",vh,[(h(),_("svg",bh,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,wh)]))]),u("span",null,L(o.label),1)],8,yh))),128))])):N("",!0),at(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"3",placeholder:n.placeholder,disabled:n.disabled,onKeydown:t[4]||(t[4]=(...o)=>s.onKeydown&&s.onKeydown(...o)),onInput:t[5]||(t[5]=(...o)=>s.autosize&&s.autosize(...o))},null,40,kh),[[Rt,i.local]]),u("div",Ch,[u("button",{type:"button",class:ie(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onClick:t[6]||(t[6]=o=>i.attachOpen=!i.attachOpen)},[...t[9]||(t[9]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)])],10,Sh),u("button",{type:"submit",class:ie(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[10]||(t[10]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],10,Ah)])],34)],6)}const Th=we(mh,[["render",xh],["__scopeId","data-v-01e81a27"]]),Mh={name:"WmSuggestionChips",props:{items:{type:Array,default:()=>[]},baseDelay:{type:Number,default:360},stepDelay:{type:Number,default:90}},emits:["select"],computed:{batchKey(){return this.items.map(e=>(e==null?void 0:e.label)||(e==null?void 0:e.text)||"").join("ยง")}}},Eh=["onClick"];function Oh(e,t,n,r,i,s){return n.items.length?(h(),_("div",{key:s.batchKey,class:"wm-chips"},[(h(!0),_(ee,null,Se(n.items,(o,a)=>(h(),_("button",{key:a,type:"button",class:"wm-chip",style:Oe({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},L(o.label),13,Eh))),128))])):N("",!0)}const Ih=we(Mh,[["render",Oh],["__scopeId","data-v-47ad8085"]]),Rh={name:"WmApprovalCard",components:{AIAvatar:qt},inject:{t:{default:()=>xe()}},props:{action:{type:String,required:!0},detail:{type:String,default:""},callbacks:{type:Array,default:()=>[]},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["callback"],computed:{approveCallback(){return this.callbacks.find(e=>e.id==="approve"||e.style==="primary")||this.callbacks[0]},rejectCallback(){return this.callbacks.find(e=>e.id==="reject"||e.style==="danger"||e.style==="neutral")||(this.callbacks.length>1?this.callbacks[1]:null)},approveId(){var e;return(e=this.approveCallback)==null?void 0:e.id},rejectId(){var e;return(e=this.rejectCallback)==null?void 0:e.id},approveLabel(){var e;return((e=this.approveCallback)==null?void 0:e.label)||this.t("approval.approve")},rejectLabel(){var e;return((e=this.rejectCallback)==null?void 0:e.label)||this.t("approval.reject")}}},Lh={class:"wm-approval"},Ph={class:"wm-approval__head"},Bh={class:"wm-approval__icon"},Fh={class:"wm-approval__main"},Nh={class:"wm-approval__title"},Dh={key:0,class:"wm-approval__detail"},jh={class:"wm-approval__actions"};function Hh(e,t,n,r,i,s){const o=_e("AIAvatar");return h(),_("div",Lh,[u("div",Ph,[u("div",Bh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Fh,[u("div",Nh,L(n.action),1),n.detail?(h(),_("div",Dh,L(n.detail),1)):N("",!0)])]),u("div",jh,[s.rejectId?(h(),_("button",{key:0,type:"button",class:"wm-approval__btn wm-approval__btn--neutral",onClick:t[0]||(t[0]=a=>e.$emit("callback",s.rejectId))},L(s.rejectLabel),1)):N("",!0),s.approveId?(h(),_("button",{key:1,type:"button",class:"wm-approval__btn wm-approval__btn--primary",onClick:t[1]||(t[1]=a=>e.$emit("callback",s.approveId))},L(s.approveLabel),1)):N("",!0)])])}const Uh=we(Rh,[["render",Hh],["__scopeId","data-v-a2bed37e"]]);let Gr=0;const $h=new Set(["text","textarea","number","boolean","select","multiselect","date"]),Vh={name:"WmFormCard",components:{AIAvatar:qt},inject:{t:{default:()=>xe()}},props:{form:{type:Object,required:!0},readOnly:{type:Boolean,default:!1},initialValues:{type:Object,default:null},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["submit"],data(){return Gr+=1,{_uid:Gr,values:{},busy:!1,error:""}},computed:{normalizedFields(){var t;return(Array.isArray((t=this.form)==null?void 0:t.fields)?this.form.fields:[]).filter(n=>!(!(n!=null&&n.key)||!(n!=null&&n.label)||!$h.has(n==null?void 0:n.type)||(n.type==="select"||n.type==="multiselect")&&(!Array.isArray(n.options)||n.options.length===0)))}},created(){this.resetValues()},methods:{resetValues(){const e=this.initialValues&&typeof this.initialValues=="object"?this.initialValues:{},t={};for(const n of this.normalizedFields){if(e[n.key]!==void 0){t[n.key]=e[n.key];continue}n.type==="boolean"?t[n.key]=!1:n.type==="multiselect"?t[n.key]=[]:t[n.key]=""}this.values=t,this.error=""},toggleMulti(e,t,n){const r=Array.isArray(this.values[e])?this.values[e].slice():[],i=r.indexOf(t);n&&i===-1?r.push(t):!n&&i!==-1&&r.splice(i,1),this.values={...this.values,[e]:r}},validate(){for(const e of this.normalizedFields){if(!e.required)continue;const t=this.values[e.key];if(e.type!=="boolean"){if(e.type==="multiselect"){if(!Array.isArray(t)||t.length===0)return this.t("form.fieldRequired",{label:e.label});continue}if(t==null||t==="")return this.t("form.fieldRequired",{label:e.label})}}return""},async onSubmit(){if(this.readOnly||this.busy)return;const e=this.validate();if(e){this.error=e;return}this.error="",this.busy=!0;try{await this.$emit("submit",{values:this.values})}finally{this.busy=!1}}}},Kh={class:"wm-form"},zh={class:"wm-form__head"},Wh={class:"wm-form__icon"},qh={class:"wm-form__main"},Gh={class:"wm-form__title"},Yh={key:0,class:"wm-form__detail"},Jh=["for"],Xh={key:0,class:"wm-form__req","aria-hidden":"true"},Qh=["id","onUpdate:modelValue","placeholder","required","disabled"],Zh=["id","onUpdate:modelValue","placeholder","required","disabled"],em=["id","onUpdate:modelValue","placeholder","required","disabled"],tm=["id","onUpdate:modelValue","required","disabled"],nm={key:4,class:"wm-form__bool"},sm=["id","onUpdate:modelValue","disabled"],rm=["id","onUpdate:modelValue","required","disabled"],im={value:"",disabled:""},om=["value"],am={key:6,class:"wm-form__multi"},lm=["value","checked","disabled","onChange"],cm={key:0,class:"wm-form__err"},um=["disabled"],dm={key:0,class:"wm-form__spinner","aria-hidden":"true"},fm={key:2,class:"wm-form__doneLbl"};function hm(e,t,n,r,i,s){const o=_e("AIAvatar");return h(),_("div",Kh,[u("div",zh,[u("div",Wh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",qh,[u("div",Gh,L(n.form.title||s.t("form.title")),1),n.form.description?(h(),_("div",Yh,L(n.form.description),1)):N("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=ht((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(h(!0),_(ee,null,Se(s.normalizedFields,a=>(h(),_("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[Zn(L(a.label),1),a.required?(h(),_("span",Xh,"*")):N("",!0)],8,Jh),a.type==="text"?at((h(),_("input",{key:0,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"text",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Qh)),[[Rt,i.values[a.key]]]):a.type==="textarea"?at((h(),_("textarea",{key:1,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__textarea",rows:"3",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,Zh)),[[Rt,i.values[a.key]]]):a.type==="number"?at((h(),_("input",{key:2,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"number",class:"wm-form__input",placeholder:a.placeholder||"",required:a.required,disabled:n.readOnly||i.busy},null,8,em)),[[Rt,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?at((h(),_("input",{key:3,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"date",class:"wm-form__input",required:a.required,disabled:n.readOnly||i.busy},null,8,tm)),[[Rt,i.values[a.key]]]):a.type==="boolean"?(h(),_("label",nm,[at(u("input",{id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,type:"checkbox",disabled:n.readOnly||i.busy},null,8,sm),[[Wl,i.values[a.key]]]),u("span",null,L(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?at((h(),_("select",{key:5,id:`wm-f-${i._uid}-${a.key}`,"onUpdate:modelValue":l=>i.values[a.key]=l,class:"wm-form__select",required:a.required,disabled:n.readOnly||i.busy},[u("option",im,L(a.placeholder||s.t("form.choose")),1),(h(!0),_(ee,null,Se(a.options,l=>(h(),_("option",{key:l.value,value:l.value},L(l.label),9,om))),128))],8,rm)),[[ql,i.values[a.key]]]):a.type==="multiselect"?(h(),_("div",am,[(h(!0),_(ee,null,Se(a.options,l=>(h(),_("label",{key:l.value,class:"wm-form__multiItem"},[u("input",{type:"checkbox",value:l.value,checked:Array.isArray(i.values[a.key])&&i.values[a.key].includes(l.value),disabled:n.readOnly||i.busy,onChange:f=>s.toggleMulti(a.key,l.value,f.target.checked)},null,40,lm),u("span",null,L(l.label),1)]))),128))])):N("",!0)]))),128)),i.error?(h(),_("div",cm,L(i.error),1)):N("",!0),n.readOnly?(h(),_("div",fm,L(s.t("form.responseSent")),1)):(h(),_("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(h(),_("span",dm)):N("",!0),u("span",null,L(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,um))],32)])}const mm=we(Vh,[["render",hm],["__scopeId","data-v-fe65cc56"]]),pm={name:"WmFeedback",inject:{t:{default:()=>xe()}},props:{busy:{type:Boolean,default:!1},done:{type:Boolean,default:!1}},emits:["submit"],data(){return{sel:null}},computed:{options(){return[{v:1,e:"๐Ÿ˜ž",l:this.t("feedback.rating1")},{v:2,e:"๐Ÿ˜",l:this.t("feedback.rating2")},{v:3,e:"๐Ÿ™‚",l:this.t("feedback.rating3")},{v:4,e:"๐Ÿ˜„",l:this.t("feedback.rating4")},{v:5,e:"๐Ÿคฉ",l:this.t("feedback.rating5")}]}},methods:{onSend(){!this.sel||this.busy||this.$emit("submit",{rating:this.sel})}}},gm={class:"wm-fb"},_m={class:"wm-fb__title"},ym={class:"wm-fb__sub"},vm={class:"wm-fb__row"},bm=["onClick"],wm={class:"wm-fb__emoji"},km={class:"wm-fb__label"},Cm=["disabled"],Sm={key:1,class:"wm-fb__done"},Am={class:"wm-fb__doneTitle"},xm={class:"wm-fb__doneSub"};function Tm(e,t,n,r,i,s){return h(),_("div",gm,[n.done?(h(),_("div",Sm,[t[1]||(t[1]=u("div",{class:"wm-fb__check"},[u("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M20 6L9 17l-5-5"})])],-1)),u("div",Am,L(s.t("feedback.doneTitle")),1),u("div",xm,L(s.t("feedback.doneSubtitle")),1)])):(h(),_(ee,{key:0},[u("div",_m,L(s.t("feedback.question")),1),u("div",ym,L(s.t("feedback.subtitle")),1),u("div",vm,[(h(!0),_(ee,null,Se(s.options,o=>(h(),_("button",{key:o.v,type:"button",class:ie(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",wm,L(o.e),1),u("span",km,L(o.l),1)],10,bm))),128))]),u("button",{type:"button",class:"wm-fb__send",disabled:!i.sel||n.busy,onClick:t[0]||(t[0]=(...o)=>s.onSend&&s.onSend(...o))},L(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,Cm)],64))])}const Mm=we(pm,[["render",Tm],["__scopeId","data-v-9b630564"]]),Em={name:"WmMoreMenu",inject:{t:{default:()=>xe()}},props:{canRename:{type:Boolean,default:!0},canExport:{type:Boolean,default:!0},soundEnabled:{type:Boolean,default:!0},statusUrl:{type:String,default:""},helpUrl:{type:String,default:""}},emits:["close","action","sound-toggle"],data(){return{soundOn:this.soundEnabled}},watch:{soundEnabled(e){this.soundOn=!!e}},methods:{emit(e){this.$emit("action",e)},toggleSound(){this.soundOn=!this.soundOn,this.$emit("sound-toggle",this.soundOn)}}},Om={class:"wm-mm"},Im={class:"wm-mm__pop",role:"menu"},Rm={key:0,class:"wm-mm__section"},Lm={class:"wm-mm__label"},Pm={class:"wm-mm__label"},Bm={key:1,class:"wm-mm__sep"},Fm={class:"wm-mm__section"},Nm={class:"wm-mm__label"},Dm={class:"wm-mm__section"},jm={class:"wm-mm__label"},Hm={class:"wm-mm__label"};function Um(e,t,n,r,i,s){return h(),_("div",Om,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Im,[n.canRename||n.canExport?(h(),_("div",Rm,[n.canRename?(h(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[1]||(t[1]=o=>s.emit("rename"))},[t[6]||(t[6]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 20h9"}),u("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})])],-1)),u("span",Lm,L(s.t("moreMenu.editTitle")),1)])):N("",!0),n.canExport?(h(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[2]||(t[2]=o=>s.emit("export"))},[t[7]||(t[7]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13"})])],-1)),u("span",Pm,L(s.t("moreMenu.exportTranscript")),1),t[8]||(t[8]=u("span",{class:"wm-mm__hint"},".txt",-1))])):N("",!0)])):N("",!0),n.canRename||n.canExport?(h(),_("div",Bm)):N("",!0),u("div",Fm,[u("button",{type:"button",class:"wm-mm__item",onClick:t[3]||(t[3]=(...o)=>s.toggleSound&&s.toggleSound(...o))},[t[10]||(t[10]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),u("path",{d:"M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14"})])],-1)),u("span",Nm,L(s.t("moreMenu.sound")),1),u("span",{class:ie(["wm-mm__toggle",{"wm-mm__toggle--on":i.soundOn}])},[...t[9]||(t[9]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)])]),t[13]||(t[13]=u("div",{class:"wm-mm__sep"},null,-1)),u("div",Dm,[n.statusUrl?(h(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[4]||(t[4]=o=>s.emit("status"))},[t[11]||(t[11]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2"})])],-1)),u("span",jm,L(s.t("moreMenu.serviceStatus")),1)])):N("",!0),n.helpUrl?(h(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[5]||(t[5]=o=>s.emit("help"))},[t[12]||(t[12]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z"})])],-1)),u("span",Hm,L(s.t("moreMenu.helpCenter")),1)])):N("",!0)])])])}const $m=we(Em,[["render",Um],["__scopeId","data-v-4cf6d578"]]),Vm={name:"WmRenameDialog",inject:{t:{default:()=>xe()}},props:{title:{type:String,default:""},initialValue:{type:String,default:""},placeholder:{type:String,default:""}},emits:["close","submit"],data(){return{value:this.initialValue||""}},computed:{canSubmit(){const e=(this.value||"").trim();return!!e&&e!==(this.initialValue||"").trim()}},mounted(){this.$nextTick(()=>{const e=this.$refs.input;if(e){e.focus();try{e.select()}catch{}}})},methods:{onSubmit(){this.canSubmit&&this.$emit("submit",this.value.trim())}}},Km={class:"wm-dialog"},zm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},Wm={class:"wm-dialog__head"},qm={class:"wm-dialog__title"},Gm=["aria-label"],Ym={class:"wm-dialog__body"},Jm=["placeholder"],Xm={class:"wm-dialog__actions"},Qm=["disabled"];function Zm(e,t,n,r,i,s){return h(),_("div",Km,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",zm,[u("div",Wm,[u("div",qm,L(n.title||s.t("rename.title")),1),u("button",{type:"button",class:"wm-dialog__close","aria-label":s.t("common.close"),onClick:t[1]||(t[1]=o=>e.$emit("close"))},[...t[7]||(t[7]=[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Gm)]),u("div",Ym,[at(u("input",{ref:"input","onUpdate:modelValue":t[2]||(t[2]=o=>i.value=o),type:"text",class:"wm-dialog__input",placeholder:n.placeholder||s.t("rename.placeholder"),maxlength:120,onKeydown:[t[3]||(t[3]=Dn(ht((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Dn(ht(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Jm),[[Rt,i.value]])]),u("div",Xm,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},L(s.t("common.cancel")),1),u("button",{type:"button",class:"wm-dialog__btn wm-dialog__btn--primary",disabled:!s.canSubmit,onClick:t[6]||(t[6]=(...o)=>s.onSubmit&&s.onSubmit(...o))},L(s.t("common.save")),9,Qm)])])])}const ep=we(Vm,[["render",Zm],["__scopeId","data-v-6d5f94a8"]]),Yr="ww-messenger-tokens",tp={name:"Messenger",components:{Launcher:tu,Header:xu,Onboarding:Qu,History:md,MessageList:lh,Composer:Th,SuggestionChips:Ih,ApprovalCard:Uh,FormCard:mm,Feedback:Mm,MoreMenu:$m,RenameDialog:ep},mixins:[xc,Rc,Lc,Bc],provide(){return{signAttachmentFn:e=>{var t,n;return((n=(t=this.store)==null?void 0:t.signAttachment)==null?void 0:n.call(t,e))||null},t:(e,t)=>this.t(e,t),wmLocale:()=>this.locale}},props:{baseUrl:{type:String,default:dc},widgetId:{type:String,default:""},context:{type:Object,default:null},displayMode:{type:String,default:"floating"},devtools:{type:Boolean,default:!1},language:{type:String,default:""}},data(){return{transport:null,store:null,isOpen:!1,launcherHovered:!1,draft:"",busy:!1,bootError:null,pendingAttachments:[],feedbackBusy:!1,feedbackDone:!1,convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,activeConvId:null,showOnboarding:!1,showHistory:!1,backToHistory:!1,dismissedPeeks:{},floatHeight:0,floatRO:null,parentOrigin:"",parentToken:"",parentVariables:null,parentAllowUnauthenticated:!1,parentInitReceived:!1,parentInitDeferred:null}},computed:{isEditor(){return!!this.devtools},isEmbedded(){return this.displayMode==="embedded"},customerLanguage(){var n,r,i,s;const e=(n=this.s)==null?void 0:n.customer,t=e&&(e.language||((r=e.values)==null?void 0:r.language));return t||((s=(i=this.context)==null?void 0:i.customer)==null?void 0:s.language)||""},locale(){var e;return Ys(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return xe(this.locale)},error(){var e;return this.bootError||((e=this.s)==null?void 0:e.error)||null},canBoot(){return!!(this.baseUrl&&this.widgetId)},s(){var e;return((e=this.store)==null?void 0:e.state)||null},ready(){var e;return!!((e=this.s)!=null&&e.ready)},allConversations(){var t;const e=(t=this.s)==null?void 0:t.conversations;return Array.isArray(e)?e:[]},drawerConversations(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=this.revealedAt;return this.allConversations.map(r=>{var f;const i=e[r.id]||[],s=ft(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const p=i[c];if(!p)continue;if(((f=p.author)==null?void 0:f.type)==="user")break;const A=ft(p.id);if(A!=null){if(s!=null&&A<=s)break;t[p.id]!==0&&(!a&&p.author&&(a=p.author),o++)}}if(!i.length){const c=ft(r.last_message_id);c!=null&&(s==null||c>s)&&(o=1,a=r.last_message_author||null)}const l=i.filter(c=>!((c==null?void 0:c.id)!=null&&t[c.id]===0));return{...r,_preview:kc(r,l),_unread:o>0,_unreadCount:o,_lastAuthor:a}})},unreadCount(){return this.drawerConversations.filter(e=>e._unread).length},openThreads(){var t;const e=((t=this.s)==null?void 0:t.messagesByConv)||{};return this.drawerConversations.filter(n=>n.status!=="resolved").map(n=>({id:n.id,title:n.name||this.t("common.newConversation"),preview:n._preview||this.t("onboarding.newMessage"),unread:!!n._unread,author:n._lastAuthor||null,_ts:Wr(n,e[n.id]||[])})).sort((n,r)=>n._ts<r._ts?1:n._ts>r._ts?-1:0)},latestUnreads(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=[];for(const r of this.drawerConversations){if(!r._unread)continue;const i=Wr(r,e[r.id]||[]),s=r._lastAuthor,o=!s||s.type==="agent_ia",a=(s==null?void 0:s.name)||(o?this.agentName:"")||"",l=(s==null?void 0:s.avatar_url)||(o?this.agentAvatarUrl:null);t.push({convId:r.id,preview:r._preview||this.t("notification.youHaveNewMessage"),ts:i,count:r._unreadCount||1,senderName:a,senderAvatarUrl:l})}return t.sort((r,i)=>r.ts<i.ts?1:r.ts>i.ts?-1:0),t},launcherPeeks(){if(this.isOpen||this.isEmbedded)return[];const e=this.dismissedPeeks||{};return this.latestUnreads.filter(t=>e[t.convId]!==t.ts)},isViewingThread(){return(this.isOpen||this.isEmbedded)&&!!this.currentConv},currentConv(){if(this.draftConv)return this.draftConv;if(this.showOnboarding)return null;const e=this.allConversations;if(!e.length)return null;if(this.activeConvId!=null){const t=e.find(n=>n.id===this.activeConvId);if(t)return t}return e[0]||null},canBack(){return!!this.currentConv||this.showHistory},statusUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>r.icon==="status"&&r.url);return(t==null?void 0:t.url)||""},helpUrl(){var n;const e=(n=this.widget)==null?void 0:n.quick_links;if(!Array.isArray(e))return"";const t=e.find(r=>(r.icon==="chat"||r.icon==="help")&&r.url);return(t==null?void 0:t.url)||""},widget(){var e,t;return((t=(e=this.s)==null?void 0:e.config)==null?void 0:t.widget)||null},rootStyle(){var t;const e=(t=this.widget)==null?void 0:t.primary_color;return e&&pc(e)?{"--wm-primary":e}:null},widgetWelcomeMessage(){var e;return((e=this.widget)==null?void 0:e.welcome_message)||""},widgetSubtitle(){var e;return((e=this.widget)==null?void 0:e.subtitle)||""},defaultIconUrl(){var e;return((e=this.widget)==null?void 0:e.default_icon_url)||null},agentName(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.name)||""},agentAvatarUrl(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.avatar_url)||null},quickLinks(){var t;const e=(t=this.widget)==null?void 0:t.quick_links;return Array.isArray(e)?e:[]},teamMembers(){var t;const e=(t=this.widget)==null?void 0:t.team_members;return Array.isArray(e)?e:[]},responseLabel(){var e;return((e=this.widget)==null?void 0:e.response_time_label)||""},humanMessageAuthor(){var t,n,r;if(!this.currentConv)return null;const e=((t=this.s.messagesByConv)==null?void 0:t[this.currentConv.id])||[];for(let i=e.length-1;i>=0;i--)if(((r=(n=e[i])==null?void 0:n.author)==null?void 0:r.type)==="agent_human")return e[i].author;return null},humanAgentName(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.name)||""},humanAgentAvatarUrl(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.avatar_url)||null},isEscalated(){return!!this.humanMessageAuthor},isWaitingHuman(){var t;const e=(t=this.currentConv)==null?void 0:t.status;return e==="waiting"||e==="handled"},headerTitle(){var e,t;return((e=this.currentConv)==null?void 0:e.name)||((t=this.widget)==null?void 0:t.name)||this.t("common.newConversation")},composerPlaceholder(){return this.isEscalated&&this.humanAgentName?this.t("composer.replyTo",{name:this.humanAgentName.split(" ")[0]}):this.isWaitingHuman?this.t("composer.agentTakingOver"):this.t("composer.placeholder")},displayedMessages(){var n,r;const e=this.currentConv;if(!e)return[];if(!e._draft){const i=(r=(n=this.s)==null?void 0:n.paginationByConv)==null?void 0:r[e.id];if(!(i!=null&&i.loaded))return[]}const t=this.revealedAt;return(this.s.messagesByConv[e.id]||[]).filter(i=>{var s,o,a,l,f;return(i==null?void 0:i.type)==="action"&&((s=i==null?void 0:i.payload)==null?void 0:s.state)==="pending"||vn(i)&&!(t[i.id]>0)?!1:(i==null?void 0:i.type)==="action"||(i==null?void 0:i.type)==="system"||((o=i==null?void 0:i.payload)==null?void 0:o.type)==="system"||Array.isArray((a=i==null?void 0:i.payload)==null?void 0:a.attachments)&&i.payload.attachments.length||(l=i==null?void 0:i.metadata)!=null&&l.artifact||(f=i==null?void 0:i.metadata)!=null&&f.form?!0:typeof(i==null?void 0:i.text_md)=="string"&&i.text_md.trim().length>0})},streamingActive(){var n,r,i;const e=this.currentConv;return e?Object.keys(((n=this.s)==null?void 0:n.streamingByMsgId)||{}).length>0?!0:this.actionInFlight?!1:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>vn(s)&&!(this.revealedAt[s.id]>0)):!1},currentConvMessages(){var t,n,r;const e=(t=this.currentConv)==null?void 0:t.id;return e?((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e])||[]:[]},pendingApproval(){return!this.currentConv||!this.store||this.actionInFlight?null:this.store.getPendingApproval(this.currentConv.id)},approvalReady(){return this.pendingApproval?this.pendingApproval.id===this.approvalLatchId?!0:!(this.streamingActive||!this.approvalSettled):!1},approvalTitle(){var e,t,n;return((t=(e=this.pendingApproval)==null?void 0:e.payload)==null?void 0:t.name)||((n=this.pendingApproval)==null?void 0:n.text_md)||this.t("action.title")},approvalDetail(){var r,i,s,o,a,l;const e=(s=(i=(r=this.pendingApproval)==null?void 0:r.payload)==null?void 0:i.pending)==null?void 0:s.user_explanation;if(typeof e=="string"&&e.trim())return e.trim();const t=(l=(a=(o=this.pendingApproval)==null?void 0:o.payload)==null?void 0:a.pending)==null?void 0:l.prepared_params;if(!t||typeof t!="object")return"";const n=Object.entries(t);return n.length?n.slice(0,2).map(([f,c])=>`${f}: ${c}`).join(" ยท "):""},actionInFlight(){var e,t;return!this.currentConv||!this.store?null:((t=(e=this.store).getActionInFlight)==null?void 0:t.call(e,this.currentConv.id))||null},actionInFlightName(){var t;const e=this.actionInFlight;return e?((t=e.payload)==null?void 0:t.name)||e.text_md||this.t("common.action"):""},suggestions(){return!this.currentConv||!this.store?[]:this.streamingActive?[]:this.pendingForm?[]:this.store.getLatestSuggestions(this.currentConv.id)},pendingForm(){var e,t;return!this.currentConv||!this.store||this.pendingApproval||this.actionInFlight||this.streamingActive||!this.approvalSettled?null:((t=(e=this.store).getLatestForm)==null?void 0:t.call(e,this.currentConv.id))||null},showFeedback(){var t;const e=this.currentConv;return e?this.feedbackDone?!0:e.status!=="resolved"?!1:!((t=e.metadata)!=null&&t.feedback):!1},floatVisible(){return this.approvalReady||!!this.pendingForm||this.showFeedback||this.suggestions.length>0},dateLabel(){var n,r,i;const e=this.currentConv;let t=new Date;if(e){const o=((i=(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).find(a=>a==null?void 0:a.created_at))==null?void 0:i.created_at)||e.created_at;if(o){const a=new Date(o);Number.isNaN(a.getTime())||(t=a)}}return this.t("messageList.today",{time:Is(t,Kt(this.locale))})},paginationState(){var n,r,i;const e=(n=this.currentConv)==null?void 0:n.id,t=e?(i=(r=this.s)==null?void 0:r.paginationByConv)==null?void 0:i[e]:null;return{loading:!!(t!=null&&t.loading),hasMore:!!(t!=null&&t.nextCursor)}}},watch:{latestUnreads:{handler(e){const t=new Set(e.map(o=>o.convId)),n=this.dismissedPeeks||{},r=Object.keys(n);if(!r.length)return;const i={};let s=!1;for(const o of r)t.has(o)?i[o]=n[o]:s=!0;s&&(this.dismissedPeeks=i)},deep:!0},"currentConv.id":{handler(e){var t;this.resetRevealQueue(),this.convOpenedAt=Date.now(),this.moreOpen=!1,this.renameDialogOpen=!1,this.resetApprovalPacing(),this.isViewingThread&&(this.unreadAnchorId=ft((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():"")},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=ft((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},pendingApproval:{handler(e,t){if(e&&!t){const n=e!=null&&e.created_at?Date.parse(e.created_at):NaN;if(!(Number.isFinite(n)&&n>=this.convOpenedAt)){this.resetApprovalPacing();return}this.bumpApprovalSettle(2600)}else!e&&t&&this.resetApprovalPacing()},immediate:!1},streamingActive(e,t){e!==t&&this.pendingApproval&&this.pendingApproval.id!==this.approvalLatchId&&this.bumpApprovalSettle()},approvalReady(e){e&&this.pendingApproval&&(this.approvalLatchId=this.pendingApproval.id)},floatVisible:{handler(e){this.$nextTick(()=>this.syncFloatObserver(e))},immediate:!0},currentConvMessages(e){var t;this.paceMessages(e,(t=this.currentConv)==null?void 0:t.id),(this.isOpen||this.isEmbedded)&&this.currentConv&&this.markConvRead(this.currentConv)}},async mounted(){if(typeof document<"u"&&!document.getElementById(Yr)){const e=document.createElement("style");e.id=Yr,e.textContent=ko,document.head.appendChild(e)}this._parentMessageHandler=this.onParentMessage.bind(this),window.addEventListener("message",this._parentMessageHandler),window.parent&&window.parent!==window&&window.parent.postMessage({type:"READY"},"*"),this.isEmbedded?(await this.boot(),this.store&&await this.open()):(await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize())},beforeUnmount(){this._parentMessageHandler&&(window.removeEventListener("message",this._parentMessageHandler),this._parentMessageHandler=null),this._launcherRo&&(this._launcherRo.disconnect(),this._launcherRo=null),this.cancelReveals(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.resetApprovalPacing(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{t(e,t){return this.translator(e,t)},waitForParentInit(){if(this.parentInitReceived)return Promise.resolve();if(!this.parentInitDeferred){let e;this.parentInitDeferred=new Promise(t=>{e=t}),this.parentInitDeferred._resolve=e}return this.parentInitDeferred},onParentMessage(e){var n;const t=e==null?void 0:e.data;if(!(!t||typeof t!="object")){if(t.type==="UPDATE"){this.transport&&t.payload&&this.transport.update(t.payload).catch(r=>{console.warn("[messenger] update failed",r)});return}if(t.type==="CONTEXT"){this.transport&&t.payload&&this.transport.context(t.payload);return}t.type==="INIT"&&(this.parentOrigin=e.origin,this.parentToken=typeof t.token=="string"?t.token:"",this.parentVariables=t.variables&&typeof t.variables=="object"?t.variables:t.context&&typeof t.context=="object"?t.context:null,this.parentAllowUnauthenticated=t.allowUnauthenticated===!0,this.parentInitReceived=!0,(n=this.parentInitDeferred)!=null&&n._resolve&&this.parentInitDeferred._resolve(),!this.isEmbedded&&!this.isOpen&&!this.parentAllowUnauthenticated&&this.parentToken&&this.hasValidSessionMarker()&&this.boot().catch(r=>{console.warn("[messenger] eager boot failed",r)}))}},hasValidSessionMarker(){if(typeof document>"u")return!1;const t=(document.cookie||"").match(/(?:^|; )messenger_session_marker=([^;]+)/);if(!t)return!1;const n=parseInt(t[1],10);return Number.isFinite(n)?n>Date.now():!1},async boot(){if(!this.canBoot){console.warn("[messenger] boot skipped โ€” missing creds");return}try{await this.waitForParentInit(),this.transport=Cs(oc({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=Cs(uc(this.transport)),this.hydrateNotifPref();const e=this.parentVariables||this.context||null;if(await this.store.start({origin:this.parentOrigin,token:this.parentToken||void 0,allowUnauthenticated:this.parentAllowUnauthenticated,variables:e&&typeof e=="object"?e:void 0}),e&&typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))n!=="customer"&&r&&typeof r=="object"&&!Array.isArray(r)&&(t[n]=r);Object.keys(t).length>0&&this.transport.context(t)}this.setupLiveReveal()}catch(e){console.error("[ww-messenger] bootstrap failed",e),this.bootError=(e==null?void 0:e.message)||String(e)}},async refresh(){this.store&&this.store.destroy(),this.cancelReveals(),this.teardownLiveReveal(),this.teardownNotifications(),this.convOpenedAt=0,this.transport=null,this.store=null,this.isOpen=!1,this.draft="",this.busy=!1,this.bootError=null,this.pendingAttachments=[],this.feedbackBusy=!1,this.feedbackDone=!1,this.moreOpen=!1,this.renameDialogOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!1,this.showHistory=!1,this.backToHistory=!1,await this.boot(),this.isEmbedded&&this.store&&await this.open()},syncFloatObserver(e){if(this.disconnectFloatRO(),!e){this.floatHeight=0;return}const t=this.$refs.floatEl;if(t){if(typeof ResizeObserver>"u"){this.floatHeight=Math.ceil(t.getBoundingClientRect().height+8);return}this.floatRO=new ResizeObserver(n=>{const r=n[0];if(!r)return;const i=Math.ceil(r.contentRect.height+8);i!==this.floatHeight&&(this.floatHeight=i,this.$nextTick(()=>{var s,o;(o=(s=this.$refs.messageList)==null?void 0:s.scrollToBottom)==null||o.call(s)}))}),this.floatRO.observe(t)}},disconnectFloatRO(){if(this.floatRO){try{this.floatRO.disconnect()}catch{}this.floatRO=null}},async open(){this.isOpen=!0,this.notifyParentResize("open"),this._launcherRo&&this._launcherRo.disconnect(),this.store||await this.boot(),this.store&&this.store.setPanelOpen(!0);const e=this.currentConv;if(e&&!e._draft){this.activeConvId==null&&(this.activeConvId=e.id);try{await this.store.openConversation(e.id)}catch(t){console.error("[ww-messenger] load messages failed",t)}this.markConvRead(e)}},async close(){this.isOpen=!1,await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize(),this.store&&this.store.setPanelOpen(!1)},notifyParentResize(e,t){if(window.parent&&window.parent!==window)try{window.parent.postMessage({type:"RESIZE",state:e,displayMode:this.displayMode,...t||{}},"*")}catch(n){console.warn("[ww-messenger] notifyParentResize failed",n)}},onLauncherHover(e){this.launcherHovered=e,this.sendCurrentLauncherSize()},sendCurrentLauncherSize(){var c,p,A,w,V,O,J;if(this.isOpen)return;const e=(p=(c=this.$el)==null?void 0:c.querySelector)==null?void 0:p.call(c,".wm-launcherWrap");if(!e)return;const t=e.getBoundingClientRect();if(!t.width||!t.height)return;const n=(((A=this.launcherPeeks)==null?void 0:A.length)??0)>0,r=16,i=Math.ceil(t.width),s=Math.ceil(t.height),o=(V=(w=this.$el)==null?void 0:w.querySelector)==null?void 0:V.call(w,".wm-launcher"),a=(J=(O=this.$el)==null?void 0:O.querySelectorAll)==null?void 0:J.call(O,".wm-peek"),l=a&&a.length?a[a.length-1]:null;let f=null;if(l){const W=l.getBoundingClientRect();f={width:Math.ceil(W.width),height:Math.ceil(W.height),rightOffset:Math.max(0,Math.ceil(t.right-W.right)),bottomOffset:Math.max(0,Math.ceil(t.bottom-W.bottom))}}this.notifyParentResize("closed",{width:i+r,height:s+r,launcherWidth:(o==null?void 0:o.offsetWidth)||null,launcherHeight:(o==null?void 0:o.offsetHeight)||null,launcherHovered:this.launcherHovered,peek:f,peekHovered:this.launcherHovered&&n})},observeLauncherSize(){var n,r;if(typeof ResizeObserver>"u")return;const e=(r=(n=this.$el)==null?void 0:n.querySelector)==null?void 0:r.call(n,".wm-launcherWrap");if(!e)return;this._launcherRo&&this._launcherRo.disconnect();const t=new ResizeObserver(()=>{this.isOpen||this.sendCurrentLauncherSize()});t.observe(e),this._launcherRo=t},async openFromPeek(e){var n,r;const t=e||((n=this.latestUnreads[0])==null?void 0:n.convId);t&&t!==((r=this.currentConv)==null?void 0:r.id)&&(this.draftConv=null,this.activeConvId=t,this.showOnboarding=!1,this.showHistory=!1,this.backToHistory=!1),await this.open()},dismissPeek(e){const t=this.latestUnreads.find(n=>n.convId===e);t&&(this.dismissedPeeks={...this.dismissedPeeks,[e]:t.ts})},startConv(){this.draftConv={id:"__draft__",_draft:!0,name:"",created_at:new Date().toISOString()},this.activeConvId=null,this.showOnboarding=!1,this.showHistory=!1,this.backToHistory=!1,this.focusComposer()},async ensureRealConv(){const e=this.currentConv;if(!e)return null;if(!e._draft)return e;if(this.busy)return null;this.busy=!0;try{const t=await this.store.createConversation({});return this.draftConv=null,this.activeConvId=t.id,await this.store.openConversation(t.id),this.markConvRead(t),t}catch(t){return console.error("[ww-messenger] create conv failed",t),this.bootError=(t==null?void 0:t.message)||String(t),null}finally{this.busy=!1}},focusComposer(){this.$nextTick(()=>{var e;return(e=this.$refs.composer)==null?void 0:e.focus()})},toggleMore(){this.moreOpen=!this.moreOpen},goHome(){this.moreOpen=!1,this.draftConv=null,this.activeConvId=null,this.backToHistory?(this.showOnboarding=!1,this.showHistory=!0,this.backToHistory=!1):(this.showOnboarding=!0,this.showHistory=!1)},async onDrawerPick(e){if(!(e!=null&&e.id)||!this.store)return;const t=this.showHistory;this.draftConv=null,this.activeConvId=e.id,this.showOnboarding=!1,this.showHistory=!1,this.backToHistory=t;try{await this.store.openConversation(e.id)}catch(r){console.error("[ww-messenger] open conv failed",r)}const n=this.allConversations.find(r=>r.id===e.id);n&&this.markConvRead(n)},async onMoreAction(e){var t,n;switch(this.moreOpen=!1,e){case"rename":this.openRenameDialog();break;case"export":Ac(this.currentConv,this.currentConv?(n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id]:[],this.translator,this.locale);break;case"status":if(On(this.statusUrl))try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(On(this.helpUrl))try{window.open(this.helpUrl,"_blank","noopener")}catch{}break}},openRenameDialog(){const e=this.currentConv;!e||e._draft||(this.renameDialogOpen=!0)},async onRenameSubmit(e){const t=this.currentConv;if(this.renameDialogOpen=!1,!t||t._draft||!this.store)return;const n=(e||"").trim();if(!(!n||n===t.name))try{await this.store.patchConversation(t.id,{name:n})}catch(r){console.error("[ww-messenger] rename failed",r)}},async onSend(e){let t=this.currentConv;if(!t&&(this.startConv(),t=this.currentConv,!t)||t._draft&&(t=await this.ensureRealConv(),!t))return;const n=t.id,r=this.pendingAttachments.slice();this.pendingAttachments=[],this.unreadAnchorId=null,this.unreadBoundaryTs="",await this.store.send(n,e,{attachments:r.length?r:void 0})},async onSuggestion(e){const t=e==null?void 0:e.label;t&&await this.onSend(t)},async onLoadMore(){var t;const e=(t=this.currentConv)==null?void 0:t.id;!e||!this.store||await this.store.loadMore(e)},async onApprovalCallback(e){const t=this.pendingApproval;t&&await this.store.clickCallback(t.id,e)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=yc(t.form,e,this.translator);if(!n)return;let r=this.currentConv;r&&(r._draft&&(r=await this.ensureRealConv(),!r)||await this.store.send(r.id,n,{metadata:{artifact:vc(t.form,e,this.translator)}}))},async onAttach(e){if(!(!e||!this.transport))try{const t=await this.transport.uploadAttachment(e);this.pendingAttachments.push({type:t.type||"file",path:t.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size})}catch(t){console.error("[ww-messenger] attachment upload failed",t)}},onPanelClick(e){const t=e.target&&e.target.closest?e.target.closest('a[href^="#"]'):null;t&&(e.preventDefault(),this.openInternalUrl(t.getAttribute("href")))},async openInternalUrl(e){if(typeof e!="string"||!e.startsWith("#"))return!1;const t=e.slice(1);if(t==="new"||t==="new-conversation")return this.isOpen||await this.open(),this.startConv(),!0;if(t.startsWith("conversation/")){const n=t.slice(13);return n&&await this.openFromPeek(n),!0}return console.warn("[messenger] unknown internal url",e),!0},async onQuickLink(e){if(e){if(e.url){if(await this.openInternalUrl(e.url))return;if(!On(e.url)){console.warn("[messenger] refusing unsafe quick-link url",e.url);return}try{window.open(e.url,"_blank","noopener")}catch{}return}this.currentConv||this.startConv(),await this.onSend(e.label)}},async onFeedback({rating:e,comment:t}){if(this.currentConv){this.feedbackBusy=!0;try{await this.store.submitFeedback(this.currentConv.id,{rating:e,comment:t}),this.feedbackDone=!0}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},np={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},sp=["aria-label"],rp={key:0,class:"wm-state"},ip={class:"wm-state__err"},op={class:"wm-state__errTitle"},ap={class:"wm-state__errSub"},lp={class:"wm-bottom"},cp={key:0,ref:"floatEl",class:"wm-float"},up={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},dp={class:"wm-actionWait__lbl"},fp={key:2,class:"wm-attached"},hp=["aria-label","onClick"];function mp(e,t,n,r,i,s){const o=_e("Launcher"),a=_e("Header"),l=_e("History"),f=_e("Onboarding"),c=_e("MessageList"),p=_e("ApprovalCard"),A=_e("FormCard"),w=_e("Feedback"),V=_e("SuggestionChips"),O=_e("Composer"),J=_e("MoreMenu"),W=_e("RenameDialog");return h(),_("div",{class:ie(["wm-root",`wm-root--${n.displayMode}`]),style:Oe(s.rootStyle)},[!i.isOpen&&!s.isEmbedded?(h(),ye(o,{key:0,"unread-count":s.unreadCount,peeks:s.launcherPeeks,onOpen:s.openFromPeek,onDismiss:s.dismissPeek,onHover:s.onLauncherHover},null,8,["unread-count","peeks","onOpen","onDismiss","onHover"])):N("",!0),i.isOpen||s.isEmbedded?(h(),_("section",{key:1,class:ie(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv}]),style:Oe(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger",onClick:t[6]||(t[6]=(...U)=>s.onPanelClick&&s.onPanelClick(...U))},[!s.ready&&!s.error?(h(),_("div",np,[s.isEmbedded?N("",!0):(h(),_("button",{key:0,type:"button",class:"wm-loading__close","aria-label":s.t("loading.minimize"),onClick:t[0]||(t[0]=(...U)=>s.close&&s.close(...U))},[...t[7]||(t[7]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,sp)),t[8]||(t[8]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(h(),_(ee,{key:1},[ve(a,{title:s.headerTitle,"team-members":s.teamMembers,"response-label":s.responseLabel,"show-identity":!!s.currentConv,"show-back":s.canBack,"show-close":!s.isEmbedded,"more-active":i.moreOpen,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onBack:s.goHome,onMore:s.toggleMore,onClose:s.close},null,8,["title","team-members","response-label","show-identity","show-back","show-close","more-active","agent-name","agent-avatar-url","onBack","onMore","onClose"]),s.error?(h(),_("div",rp,[u("div",ip,[t[9]||(t[9]=u("div",{class:"wm-state__errIcon"},[u("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})])],-1)),u("div",null,[u("div",op,L(s.t("error.connectionFailed")),1),u("div",ap,L(s.error),1)])])])):!s.currentConv&&i.showHistory?(h(),ye(l,{key:1,threads:s.openThreads,onResume:s.onDrawerPick},null,8,["threads","onResume"])):s.currentConv?(h(),_(ee,{key:3},[ve(c,{ref:"messageList",messages:s.displayedMessages,"streaming-active":s.streamingActive,"date-label":s.dateLabel,"conversation-id":s.currentConv?s.currentConv.id:null,"loading-more":s.paginationState.loading,"has-more":s.paginationState.hasMore,"unread-anchor-id":e.unreadAnchorId,"unread-boundary-ts":e.unreadBoundaryTs,"ai-agent-name":s.agentName,"ai-agent-avatar-url":s.agentAvatarUrl,onLoadMore:s.onLoadMore},null,8,["messages","streaming-active","date-label","conversation-id","loading-more","has-more","unread-anchor-id","unread-boundary-ts","ai-agent-name","ai-agent-avatar-url","onLoadMore"]),u("div",lp,[s.floatVisible?(h(),_("div",cp,[s.approvalReady?(h(),ye(p,{key:0,action:s.approvalTitle,detail:s.approvalDetail,callbacks:s.pendingApproval.callbacks,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onCallback:s.onApprovalCallback},null,8,["action","detail","callbacks","agent-name","agent-avatar-url","onCallback"])):s.pendingForm?(h(),ye(A,{key:s.pendingForm.message&&s.pendingForm.message.id,form:s.pendingForm.form,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onSubmit:s.onFormSubmit},null,8,["form","agent-name","agent-avatar-url","onSubmit"])):s.showFeedback?(h(),ye(w,{key:2,busy:i.feedbackBusy,done:i.feedbackDone,onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(h(),ye(V,{key:3,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):N("",!0),s.actionInFlight?(h(),_("div",up,[t[10]||(t[10]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",dp,L(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):(h(),ye(O,{key:2,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[2]||(t[2]=U=>i.draft=U),placeholder:s.composerPlaceholder,disabled:!!s.pendingApproval,"attach-label":s.t("composer.attachFile"),"display-mode":n.displayMode,onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","disabled","attach-label","display-mode","onSend","onAttach"]))]),i.moreOpen?(h(),ye(J,{key:0,"can-rename":!!s.currentConv&&!s.currentConv._draft,"can-export":!!s.currentConv&&!s.currentConv._draft,"sound-enabled":e.soundEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[3]||(t[3]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","status-url","help-url","onSoundToggle","onAction"])):N("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(h(),ye(W,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[4]||(t[4]=U=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):N("",!0),i.pendingAttachments.length?(h(),_("div",fp,[(h(!0),_(ee,null,Se(i.pendingAttachments,(U,Q)=>(h(),_("div",{key:Q,class:"wm-attached__chip"},[t[12]||(t[12]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)),u("span",null,L(U.name),1),u("button",{type:"button","aria-label":s.t("attachment.remove"),onClick:$=>i.pendingAttachments.splice(Q,1)},[...t[11]||(t[11]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,hp)]))),128))])):N("",!0)],64)):(h(),ye(f,{key:2,"welcome-message":s.widgetWelcomeMessage,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,onStart:s.startConv,onSelect:s.onQuickLink,onResume:s.onDrawerPick,onViewHistory:t[1]||(t[1]=U=>i.showHistory=!0)},null,8,["welcome-message","subtitle","agent-name","default-icon-url","quick-links","open-threads","busy","onStart","onSelect","onResume"])),i.moreOpen&&!s.currentConv?(h(),ye(J,{key:4,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[5]||(t[5]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onAction:s.onMoreAction},null,8,["sound-enabled","status-url","help-url","onSoundToggle","onAction"])):N("",!0)],64))],6)):N("",!0)],6)}const pp=we(tp,[["render",mp],["__scopeId","data-v-77e30aba"]]),Jr=window.__WIDGET_ID,Xr=window.__BASE_URL,gp=window.__DISPLAY_MODE||"floating",Qr=window.__LANGUAGE||"";window.__MESSENGER_IFRAME_VERSION="0.5.50";if(!Jr||!Xr)console.error("[messenger-iframe] missing __WIDGET_ID or __BASE_URL globals");else{if(!document.getElementById("wm-tokens")){const e=document.createElement("style");e.id="wm-tokens",e.textContent=ko,document.head.appendChild(e)}Zl({render:()=>_o(pp,{baseUrl:Xr,widgetId:Jr,displayMode:gp,...Qr?{language:Qr}:{}})}).mount("#app")}