@_solaris/messenger-widget 0.6.31 โ 0.6.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +9 -9
- package/dist/messenger.cjs +1 -1
- package/dist/messenger.js +161 -158
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/iframe/iframe.js
CHANGED
|
@@ -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 Fs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const he={},Nt=[],it=()=>{},ii=()=>!1,Vn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Kn=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Ds=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Oo=Object.prototype.hasOwnProperty,oe=(e,t)=>Oo.call(e,t),W=Array.isArray,Ht=e=>
|
|
5
|
+
**/function Fs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const he={},Nt=[],it=()=>{},ii=()=>!1,Vn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Kn=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Ds=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Oo=Object.prototype.hasOwnProperty,oe=(e,t)=>Oo.call(e,t),W=Array.isArray,Ht=e=>bn(e)==="[object Map]",Wt=e=>bn(e)==="[object Set]",ar=e=>bn(e)==="[object Date]",Q=e=>typeof e=="function",ye=e=>typeof e=="string",Ge=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",oi=e=>(ae(e)||Q(e))&&Q(e.then)&&Q(e.catch),ai=Object.prototype.toString,bn=e=>ai.call(e),Ro=e=>bn(e).slice(8,-1),li=e=>bn(e)==="[object Object]",Ns=e=>ye(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,sn=Fs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Io=/-\w/g,De=zn(e=>e.replace(Io,t=>t.slice(1).toUpperCase())),Lo=/\B([A-Z])/g,At=zn(e=>e.replace(Lo,"-$1").toLowerCase()),Wn=zn(e=>e.charAt(0).toUpperCase()+e.slice(1)),os=zn(e=>e?`on${Wn(e)}`:""),ut=(e,t)=>!Object.is(e,t),En=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ci=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},$n=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Po=e=>{const t=ye(e)?Number(e):NaN;return isNaN(t)?e:t};let lr;const qn=()=>lr||(lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ce(e){if(W(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=ye(r)?No(r):Ce(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(ye(e)||ae(e))return e}const Bo=/;(?![^(]*\))/g,Fo=/:([^]+)/,Do=/\/\*[^]*?\*\//g;function No(e){const t={};return e.replace(Do,"").split(Bo).forEach(n=>{if(n){const r=n.split(Fo);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function te(e){let t="";if(ye(e))t=e;else if(W(e))for(let n=0;n<e.length;n++){const r=te(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ho="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Uo=Fs(Ho);function ui(e){return!!e||e===""}function jo(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=$t(e[r],t[r]);return n}function $t(e,t){if(e===t)return!0;let n=ar(e),r=ar(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Ge(e),r=Ge(t),n||r)return e===t;if(n=W(e),r=W(t),n||r)return n&&r?jo(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||!$t(e[o],t[o]))return!1}}return String(e)===String(t)}function Hs(e,t){return e.findIndex(n=>$t(n,t))}const di=e=>!!(e&&e.__v_isRef===!0),R=e=>ye(e)?e:e==null?"":W(e)||ae(e)&&(e.toString===ai||!Q(e.toString))?di(e)?R(e.value):JSON.stringify(e,fi,2):String(e),fi=(e,t)=>di(t)?fi(e,t.value):Ht(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[as(r,s)+" =>"]=i,n),{})}:Wt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>as(n))}:Ge(t)?as(t):ae(t)&&!W(t)&&!li(t)?String(t):t,as=(e,t="")=>{var n;return Ge(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 Te;class Vo{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&&Te&&(Te.active?(this.parent=Te,this.index=(Te.scopes||(Te.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=Te;try{return Te=this,t()}finally{Te=n}}}on(){++this._on===1&&(this.prevScope=Te,Te=this)}off(){if(this._on>0&&--this._on===0){if(Te===this)Te=this.prevScope;else{let t=Te;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 Ko(){return Te}let ge;const ls=new WeakSet;class hi{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,Te&&(Te.active?Te.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ls.has(this)&&(ls.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||gi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,cr(this),pi(this);const t=ge,n=$e;ge=this,$e=!0;try{return this.fn()}finally{_i(this),ge=t,$e=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Vs(t);this.deps=this.depsTail=void 0,cr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ls.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ks(this)&&this.run()}get dirty(){return ks(this)}}let mi=0,rn,on;function gi(e,t=!1){if(e.flags|=8,t){e.next=on,on=e;return}e.next=rn,rn=e}function Us(){mi++}function js(){if(--mi>0)return;if(on){let t=on;for(on=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rn;){let t=rn;for(rn=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 pi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _i(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Vs(r),zo(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ks(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===un)||(e.globalVersion=un,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ks(e))))return;e.flags|=2;const t=e.dep,n=ge,r=$e;ge=e,$e=!0;try{pi(e);const i=e.fn(e._value);(t.version===0||ut(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ge=n,$e=r,_i(e),e.flags&=-3}}function Vs(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)Vs(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function zo(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let $e=!0;const vi=[];function gt(){vi.push($e),$e=!1}function pt(){const e=vi.pop();$e=e===void 0?!0:e}function cr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ge;ge=void 0;try{t()}finally{ge=n}}}let un=0;class Wo{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 bi{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(!ge||!$e||ge===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ge)n=this.activeLink=new Wo(ge,this),ge.deps?(n.prevDep=ge.depsTail,ge.depsTail.nextDep=n,ge.depsTail=n):ge.deps=ge.depsTail=n,wi(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=ge.depsTail,n.nextDep=void 0,ge.depsTail.nextDep=n,ge.depsTail=n,ge.deps===n&&(ge.deps=r)}return n}trigger(t){this.version++,un++,this.notify(t)}notify(t){Us();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{js()}}}function wi(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)wi(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Cs=new WeakMap,Lt=Symbol(""),Ss=Symbol(""),dn=Symbol("");function Re(e,t,n){if($e&&ge){let r=Cs.get(e);r||Cs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new bi),i.map=r,i.key=n),i.track()}}function dt(e,t,n,r,i,s){const o=Cs.get(e);if(!o){un++;return}const a=l=>{l&&l.trigger()};if(Us(),t==="clear")o.forEach(a);else{const l=W(e),d=l&&Ns(n);if(l&&n==="length"){const c=Number(r);o.forEach((m,C)=>{(C==="length"||C===dn||!Ge(C)&&C>=c)&&a(m)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),d&&a(o.get(dn)),t){case"add":l?d&&a(o.get("length")):(a(o.get(Lt)),Ht(e)&&a(o.get(Ss)));break;case"delete":l||(a(o.get(Lt)),Ht(e)&&a(o.get(Ss)));break;case"set":Ht(e)&&a(o.get(Lt));break}}js()}function Ft(e){const t=le(e);return t===e?t:(Re(t,"iterate",dn),qe(e)?t:t.map(_t))}function Gn(e){return Re(e=le(e),"iterate",dn),e}function nt(e,t){return Ct(e)?Kt(Pt(e)?_t(t):t):_t(t)}const $o={__proto__:null,[Symbol.iterator](){return cs(this,Symbol.iterator,e=>nt(this,e))},concat(...e){return Ft(this).concat(...e.map(t=>W(t)?Ft(t):t))},entries(){return cs(this,"entries",e=>(e[1]=nt(this,e[1]),e))},every(e,t){return ot(this,"every",e,t,void 0,arguments)},filter(e,t){return ot(this,"filter",e,t,n=>n.map(r=>nt(this,r)),arguments)},find(e,t){return ot(this,"find",e,t,n=>nt(this,n),arguments)},findIndex(e,t){return ot(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ot(this,"findLast",e,t,n=>nt(this,n),arguments)},findLastIndex(e,t){return ot(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ot(this,"forEach",e,t,void 0,arguments)},includes(...e){return us(this,"includes",e)},indexOf(...e){return us(this,"indexOf",e)},join(e){return Ft(this).join(e)},lastIndexOf(...e){return us(this,"lastIndexOf",e)},map(e,t){return ot(this,"map",e,t,void 0,arguments)},pop(){return Yt(this,"pop")},push(...e){return Yt(this,"push",e)},reduce(e,...t){return ur(this,"reduce",e,t)},reduceRight(e,...t){return ur(this,"reduceRight",e,t)},shift(){return Yt(this,"shift")},some(e,t){return ot(this,"some",e,t,void 0,arguments)},splice(...e){return Yt(this,"splice",e)},toReversed(){return Ft(this).toReversed()},toSorted(e){return Ft(this).toSorted(e)},toSpliced(...e){return Ft(this).toSpliced(...e)},unshift(...e){return Yt(this,"unshift",e)},values(){return cs(this,"values",e=>nt(this,e))}};function cs(e,t,n){const r=Gn(e),i=r[t]();return r!==e&&!qe(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const qo=Array.prototype;function ot(e,t,n,r,i,s){const o=Gn(e),a=o!==e&&!qe(e),l=o[t];if(l!==qo[t]){const m=l.apply(e,s);return a?_t(m):m}let d=n;o!==e&&(a?d=function(m,C){return n.call(this,nt(e,m),C,e)}:n.length>2&&(d=function(m,C){return n.call(this,m,C,e)}));const c=l.call(o,d,r);return a&&i?i(c):c}function ur(e,t,n,r){const i=Gn(e),s=i!==e&&!qe(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(d,c,m){return a&&(a=!1,d=nt(e,d)),n.call(this,d,nt(e,c),m,e)}):n.length>3&&(o=function(d,c,m){return n.call(this,d,c,m,e)}));const l=i[t](o,...r);return a?nt(e,l):l}function us(e,t,n){const r=le(e);Re(r,"iterate",dn);const i=r[t](...n);return(i===-1||i===!1)&&Ws(n[0])?(n[0]=le(n[0]),r[t](...n)):i}function Yt(e,t,n=[]){gt(),Us();const r=le(e)[t].apply(e,n);return js(),pt(),r}const Go=Fs("__proto__,__v_isRef,__isVue"),ki=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ge));function Yo(e){Ge(e)||(e=String(e));const t=le(this);return Re(t,"has",e),t.hasOwnProperty(e)}class Ci{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?ia:Ti:s?xi:Ai).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=W(t);if(!i){let l;if(o&&(l=$o[n]))return l;if(n==="hasOwnProperty")return Yo}const a=Reflect.get(t,n,Ne(t)?t:r);if((Ge(n)?ki.has(n):Go(n))||(i||Re(t,"get",n),s))return a;if(Ne(a)){const l=o&&Ns(n)?a:a.value;return i&&ae(l)?xs(l):l}return ae(a)?i?xs(a):Yn(a):a}}class Si extends Ci{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=W(t)&&Ns(n);if(!this._isShallow){const d=Ct(s);if(!qe(r)&&!Ct(r)&&(s=le(s),r=le(r)),!o&&Ne(s)&&!Ne(r))return d||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,Ne(t)?t:i);return t===le(i)&&(a?ut(r,s)&&dt(t,"set",n,r):dt(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&dt(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!Ge(n)||!ki.has(n))&&Re(t,"has",n),r}ownKeys(t){return Re(t,"iterate",W(t)?"length":Lt),Reflect.ownKeys(t)}}class Jo extends Ci{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Xo=new Si,Qo=new Jo,Zo=new Si(!0);const As=e=>e,xn=e=>Reflect.getPrototypeOf(e);function ea(e,t,n){return function(...r){const i=this.__v_raw,s=le(i),o=Ht(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,d=i[e](...r),c=n?As:t?Kt:_t;return!t&&Re(s,"iterate",l?Ss:Lt),Ae(Object.create(d),{next(){const{value:m,done:C}=d.next();return C?{value:m,done:C}:{value:a?[c(m[0]),c(m[1])]:c(m),done:C}}})}}function Tn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ta(e,t){const n={get(i){const s=this.__v_raw,o=le(s),a=le(i);e||(ut(i,a)&&Re(o,"get",i),Re(o,"get",a));const{has:l}=xn(o),d=t?As:e?Kt:_t;if(l.call(o,i))return d(s.get(i));if(l.call(o,a))return d(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Re(le(i),"iterate",Lt),i.size},has(i){const s=this.__v_raw,o=le(s),a=le(i);return e||(ut(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=le(a),d=t?As:e?Kt:_t;return!e&&Re(l,"iterate",Lt),a.forEach((c,m)=>i.call(s,d(c),d(m),o))}};return Ae(n,e?{add:Tn("add"),set:Tn("set"),delete:Tn("delete"),clear:Tn("clear")}:{add(i){const s=le(this),o=xn(s),a=le(i),l=!t&&!qe(i)&&!Ct(i)?a:i;return o.has.call(s,l)||ut(i,l)&&o.has.call(s,i)||ut(a,l)&&o.has.call(s,a)||(s.add(l),dt(s,"add",l,l)),this},set(i,s){!t&&!qe(s)&&!Ct(s)&&(s=le(s));const o=le(this),{has:a,get:l}=xn(o);let d=a.call(o,i);d||(i=le(i),d=a.call(o,i));const c=l.call(o,i);return o.set(i,s),d?ut(s,c)&&dt(o,"set",i,s):dt(o,"add",i,s),this},delete(i){const s=le(this),{has:o,get:a}=xn(s);let l=o.call(s,i);l||(i=le(i),l=o.call(s,i)),a&&a.call(s,i);const d=s.delete(i);return l&&dt(s,"delete",i,void 0),d},clear(){const i=le(this),s=i.size!==0,o=i.clear();return s&&dt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=ea(i,e,t)}),n}function Ks(e,t){const n=ta(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 na={get:Ks(!1,!1)},sa={get:Ks(!1,!0)},ra={get:Ks(!0,!1)};const Ai=new WeakMap,xi=new WeakMap,Ti=new WeakMap,ia=new WeakMap;function oa(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function aa(e){return e.__v_skip||!Object.isExtensible(e)?0:oa(Ro(e))}function Yn(e){return Ct(e)?e:zs(e,!1,Xo,na,Ai)}function la(e){return zs(e,!1,Zo,sa,xi)}function xs(e){return zs(e,!0,Qo,ra,Ti)}function zs(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=aa(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 Ct(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function Ct(e){return!!(e&&e.__v_isReadonly)}function qe(e){return!!(e&&e.__v_isShallow)}function Ws(e){return e?!!e.__v_raw:!1}function le(e){const t=e&&e.__v_raw;return t?le(t):e}function Ts(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&ci(e,"__v_skip",!0),e}const _t=e=>ae(e)?Yn(e):e,Kt=e=>ae(e)?xs(e):e;function Ne(e){return e?e.__v_isRef===!0:!1}function ca(e){return Ne(e)?e.value:e}const ua={get:(e,t,n)=>t==="__v_raw"?e:ca(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Ne(i)&&!Ne(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Mi(e){return Pt(e)?e:new Proxy(e,ua)}class da{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new bi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=un-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return gi(this,!0),!0}get value(){const t=this.dep.track();return yi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function fa(e,t,n=!1){let r,i;return Q(e)?r=e:(r=e.get,i=e.set),new da(r,i,n)}const Mn={},Ln=new WeakMap;let Rt;function ha(e,t=!1,n=Rt){if(n){let r=Ln.get(n);r||Ln.set(n,r=[]),r.push(e)}}function ma(e,t,n=he){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,d=V=>i?V:qe(V)||i===!1||i===0?ft(V,1):ft(V);let c,m,C,b,K=!1,S=!1;if(Ne(e)?(m=()=>e.value,K=qe(e)):Pt(e)?(m=()=>d(e),K=!0):W(e)?(S=!0,K=e.some(V=>Pt(V)||qe(V)),m=()=>e.map(V=>{if(Ne(V))return V.value;if(Pt(V))return d(V);if(Q(V))return l?l(V,2):V()})):Q(e)?t?m=l?()=>l(e,2):e:m=()=>{if(C){gt();try{C()}finally{pt()}}const V=Rt;Rt=c;try{return l?l(e,3,[b]):e(b)}finally{Rt=V}}:m=it,t&&i){const V=m,re=i===!0?1/0:i;m=()=>ft(V(),re)}const J=Ko(),U=()=>{c.stop(),J&&J.active&&Ds(J.effects,c)};if(s&&t){const V=t;t=(...re)=>{V(...re),U()}}let $=S?new Array(e.length).fill(Mn):Mn;const ne=V=>{if(!(!(c.flags&1)||!c.dirty&&!V))if(t){const re=c.run();if(i||K||(S?re.some((ce,_e)=>ut(ce,$[_e])):ut(re,$))){C&&C();const ce=Rt;Rt=c;try{const _e=[re,$===Mn?void 0:S&&$[0]===Mn?[]:$,b];$=re,l?l(t,3,_e):t(..._e)}finally{Rt=ce}}}else c.run()};return a&&a(ne),c=new hi(m),c.scheduler=o?()=>o(ne,!1):ne,b=V=>ha(V,!1,c),C=c.onStop=()=>{const V=Ln.get(c);if(V){if(l)l(V,4);else for(const re of V)re();Ln.delete(c)}},t?r?ne(!0):$=c.run():o?o(ne.bind(null,!0),!0):c.run(),U.pause=c.pause.bind(c),U.resume=c.resume.bind(c),U.stop=U,U}function ft(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--,Ne(e))ft(e.value,t,n);else if(W(e))for(let r=0;r<e.length;r++)ft(e[r],t,n);else if(Wt(e)||Ht(e))e.forEach(r=>{ft(r,t,n)});else if(li(e)){for(const r in e)ft(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ft(e[r],t,n)}return e}/**
|
|
9
|
+
**/let Te;class Vo{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&&Te&&(Te.active?(this.parent=Te,this.index=(Te.scopes||(Te.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=Te;try{return Te=this,t()}finally{Te=n}}}on(){++this._on===1&&(this.prevScope=Te,Te=this)}off(){if(this._on>0&&--this._on===0){if(Te===this)Te=this.prevScope;else{let t=Te;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 Ko(){return Te}let ge;const ls=new WeakSet;class hi{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,Te&&(Te.active?Te.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ls.has(this)&&(ls.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||gi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,cr(this),pi(this);const t=ge,n=$e;ge=this,$e=!0;try{return this.fn()}finally{_i(this),ge=t,$e=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Vs(t);this.deps=this.depsTail=void 0,cr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ls.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ks(this)&&this.run()}get dirty(){return ks(this)}}let mi=0,rn,on;function gi(e,t=!1){if(e.flags|=8,t){e.next=on,on=e;return}e.next=rn,rn=e}function Us(){mi++}function js(){if(--mi>0)return;if(on){let t=on;for(on=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rn;){let t=rn;for(rn=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 pi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _i(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Vs(r),zo(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ks(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===un)||(e.globalVersion=un,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ks(e))))return;e.flags|=2;const t=e.dep,n=ge,r=$e;ge=e,$e=!0;try{pi(e);const i=e.fn(e._value);(t.version===0||ut(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ge=n,$e=r,_i(e),e.flags&=-3}}function Vs(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)Vs(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function zo(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let $e=!0;const vi=[];function gt(){vi.push($e),$e=!1}function pt(){const e=vi.pop();$e=e===void 0?!0:e}function cr(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ge;ge=void 0;try{t()}finally{ge=n}}}let un=0;class Wo{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 wi{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(!ge||!$e||ge===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ge)n=this.activeLink=new Wo(ge,this),ge.deps?(n.prevDep=ge.depsTail,ge.depsTail.nextDep=n,ge.depsTail=n):ge.deps=ge.depsTail=n,bi(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=ge.depsTail,n.nextDep=void 0,ge.depsTail.nextDep=n,ge.depsTail=n,ge.deps===n&&(ge.deps=r)}return n}trigger(t){this.version++,un++,this.notify(t)}notify(t){Us();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{js()}}}function bi(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)bi(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Cs=new WeakMap,Lt=Symbol(""),Ss=Symbol(""),dn=Symbol("");function Re(e,t,n){if($e&&ge){let r=Cs.get(e);r||Cs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new wi),i.map=r,i.key=n),i.track()}}function dt(e,t,n,r,i,s){const o=Cs.get(e);if(!o){un++;return}const a=l=>{l&&l.trigger()};if(Us(),t==="clear")o.forEach(a);else{const l=W(e),d=l&&Ns(n);if(l&&n==="length"){const c=Number(r);o.forEach((m,C)=>{(C==="length"||C===dn||!Ge(C)&&C>=c)&&a(m)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),d&&a(o.get(dn)),t){case"add":l?d&&a(o.get("length")):(a(o.get(Lt)),Ht(e)&&a(o.get(Ss)));break;case"delete":l||(a(o.get(Lt)),Ht(e)&&a(o.get(Ss)));break;case"set":Ht(e)&&a(o.get(Lt));break}}js()}function Ft(e){const t=le(e);return t===e?t:(Re(t,"iterate",dn),qe(e)?t:t.map(_t))}function Gn(e){return Re(e=le(e),"iterate",dn),e}function nt(e,t){return Ct(e)?Kt(Pt(e)?_t(t):t):_t(t)}const $o={__proto__:null,[Symbol.iterator](){return cs(this,Symbol.iterator,e=>nt(this,e))},concat(...e){return Ft(this).concat(...e.map(t=>W(t)?Ft(t):t))},entries(){return cs(this,"entries",e=>(e[1]=nt(this,e[1]),e))},every(e,t){return ot(this,"every",e,t,void 0,arguments)},filter(e,t){return ot(this,"filter",e,t,n=>n.map(r=>nt(this,r)),arguments)},find(e,t){return ot(this,"find",e,t,n=>nt(this,n),arguments)},findIndex(e,t){return ot(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ot(this,"findLast",e,t,n=>nt(this,n),arguments)},findLastIndex(e,t){return ot(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ot(this,"forEach",e,t,void 0,arguments)},includes(...e){return us(this,"includes",e)},indexOf(...e){return us(this,"indexOf",e)},join(e){return Ft(this).join(e)},lastIndexOf(...e){return us(this,"lastIndexOf",e)},map(e,t){return ot(this,"map",e,t,void 0,arguments)},pop(){return Yt(this,"pop")},push(...e){return Yt(this,"push",e)},reduce(e,...t){return ur(this,"reduce",e,t)},reduceRight(e,...t){return ur(this,"reduceRight",e,t)},shift(){return Yt(this,"shift")},some(e,t){return ot(this,"some",e,t,void 0,arguments)},splice(...e){return Yt(this,"splice",e)},toReversed(){return Ft(this).toReversed()},toSorted(e){return Ft(this).toSorted(e)},toSpliced(...e){return Ft(this).toSpliced(...e)},unshift(...e){return Yt(this,"unshift",e)},values(){return cs(this,"values",e=>nt(this,e))}};function cs(e,t,n){const r=Gn(e),i=r[t]();return r!==e&&!qe(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const qo=Array.prototype;function ot(e,t,n,r,i,s){const o=Gn(e),a=o!==e&&!qe(e),l=o[t];if(l!==qo[t]){const m=l.apply(e,s);return a?_t(m):m}let d=n;o!==e&&(a?d=function(m,C){return n.call(this,nt(e,m),C,e)}:n.length>2&&(d=function(m,C){return n.call(this,m,C,e)}));const c=l.call(o,d,r);return a&&i?i(c):c}function ur(e,t,n,r){const i=Gn(e),s=i!==e&&!qe(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(d,c,m){return a&&(a=!1,d=nt(e,d)),n.call(this,d,nt(e,c),m,e)}):n.length>3&&(o=function(d,c,m){return n.call(this,d,c,m,e)}));const l=i[t](o,...r);return a?nt(e,l):l}function us(e,t,n){const r=le(e);Re(r,"iterate",dn);const i=r[t](...n);return(i===-1||i===!1)&&Ws(n[0])?(n[0]=le(n[0]),r[t](...n)):i}function Yt(e,t,n=[]){gt(),Us();const r=le(e)[t].apply(e,n);return js(),pt(),r}const Go=Fs("__proto__,__v_isRef,__isVue"),ki=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ge));function Yo(e){Ge(e)||(e=String(e));const t=le(this);return Re(t,"has",e),t.hasOwnProperty(e)}class Ci{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?ia:Ti:s?xi:Ai).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=W(t);if(!i){let l;if(o&&(l=$o[n]))return l;if(n==="hasOwnProperty")return Yo}const a=Reflect.get(t,n,Ne(t)?t:r);if((Ge(n)?ki.has(n):Go(n))||(i||Re(t,"get",n),s))return a;if(Ne(a)){const l=o&&Ns(n)?a:a.value;return i&&ae(l)?xs(l):l}return ae(a)?i?xs(a):Yn(a):a}}class Si extends Ci{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=W(t)&&Ns(n);if(!this._isShallow){const d=Ct(s);if(!qe(r)&&!Ct(r)&&(s=le(s),r=le(r)),!o&&Ne(s)&&!Ne(r))return d||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,Ne(t)?t:i);return t===le(i)&&(a?ut(r,s)&&dt(t,"set",n,r):dt(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&dt(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!Ge(n)||!ki.has(n))&&Re(t,"has",n),r}ownKeys(t){return Re(t,"iterate",W(t)?"length":Lt),Reflect.ownKeys(t)}}class Jo extends Ci{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Xo=new Si,Qo=new Jo,Zo=new Si(!0);const As=e=>e,xn=e=>Reflect.getPrototypeOf(e);function ea(e,t,n){return function(...r){const i=this.__v_raw,s=le(i),o=Ht(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,d=i[e](...r),c=n?As:t?Kt:_t;return!t&&Re(s,"iterate",l?Ss:Lt),Ae(Object.create(d),{next(){const{value:m,done:C}=d.next();return C?{value:m,done:C}:{value:a?[c(m[0]),c(m[1])]:c(m),done:C}}})}}function Tn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ta(e,t){const n={get(i){const s=this.__v_raw,o=le(s),a=le(i);e||(ut(i,a)&&Re(o,"get",i),Re(o,"get",a));const{has:l}=xn(o),d=t?As:e?Kt:_t;if(l.call(o,i))return d(s.get(i));if(l.call(o,a))return d(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Re(le(i),"iterate",Lt),i.size},has(i){const s=this.__v_raw,o=le(s),a=le(i);return e||(ut(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=le(a),d=t?As:e?Kt:_t;return!e&&Re(l,"iterate",Lt),a.forEach((c,m)=>i.call(s,d(c),d(m),o))}};return Ae(n,e?{add:Tn("add"),set:Tn("set"),delete:Tn("delete"),clear:Tn("clear")}:{add(i){const s=le(this),o=xn(s),a=le(i),l=!t&&!qe(i)&&!Ct(i)?a:i;return o.has.call(s,l)||ut(i,l)&&o.has.call(s,i)||ut(a,l)&&o.has.call(s,a)||(s.add(l),dt(s,"add",l,l)),this},set(i,s){!t&&!qe(s)&&!Ct(s)&&(s=le(s));const o=le(this),{has:a,get:l}=xn(o);let d=a.call(o,i);d||(i=le(i),d=a.call(o,i));const c=l.call(o,i);return o.set(i,s),d?ut(s,c)&&dt(o,"set",i,s):dt(o,"add",i,s),this},delete(i){const s=le(this),{has:o,get:a}=xn(s);let l=o.call(s,i);l||(i=le(i),l=o.call(s,i)),a&&a.call(s,i);const d=s.delete(i);return l&&dt(s,"delete",i,void 0),d},clear(){const i=le(this),s=i.size!==0,o=i.clear();return s&&dt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=ea(i,e,t)}),n}function Ks(e,t){const n=ta(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 na={get:Ks(!1,!1)},sa={get:Ks(!1,!0)},ra={get:Ks(!0,!1)};const Ai=new WeakMap,xi=new WeakMap,Ti=new WeakMap,ia=new WeakMap;function oa(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function aa(e){return e.__v_skip||!Object.isExtensible(e)?0:oa(Ro(e))}function Yn(e){return Ct(e)?e:zs(e,!1,Xo,na,Ai)}function la(e){return zs(e,!1,Zo,sa,xi)}function xs(e){return zs(e,!0,Qo,ra,Ti)}function zs(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=aa(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 Ct(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function Ct(e){return!!(e&&e.__v_isReadonly)}function qe(e){return!!(e&&e.__v_isShallow)}function Ws(e){return e?!!e.__v_raw:!1}function le(e){const t=e&&e.__v_raw;return t?le(t):e}function Ts(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&ci(e,"__v_skip",!0),e}const _t=e=>ae(e)?Yn(e):e,Kt=e=>ae(e)?xs(e):e;function Ne(e){return e?e.__v_isRef===!0:!1}function ca(e){return Ne(e)?e.value:e}const ua={get:(e,t,n)=>t==="__v_raw"?e:ca(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return Ne(i)&&!Ne(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Mi(e){return Pt(e)?e:new Proxy(e,ua)}class da{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new wi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=un-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return gi(this,!0),!0}get value(){const t=this.dep.track();return yi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function fa(e,t,n=!1){let r,i;return Q(e)?r=e:(r=e.get,i=e.set),new da(r,i,n)}const Mn={},Ln=new WeakMap;let Rt;function ha(e,t=!1,n=Rt){if(n){let r=Ln.get(n);r||Ln.set(n,r=[]),r.push(e)}}function ma(e,t,n=he){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,d=V=>i?V:qe(V)||i===!1||i===0?ft(V,1):ft(V);let c,m,C,w,K=!1,S=!1;if(Ne(e)?(m=()=>e.value,K=qe(e)):Pt(e)?(m=()=>d(e),K=!0):W(e)?(S=!0,K=e.some(V=>Pt(V)||qe(V)),m=()=>e.map(V=>{if(Ne(V))return V.value;if(Pt(V))return d(V);if(Q(V))return l?l(V,2):V()})):Q(e)?t?m=l?()=>l(e,2):e:m=()=>{if(C){gt();try{C()}finally{pt()}}const V=Rt;Rt=c;try{return l?l(e,3,[w]):e(w)}finally{Rt=V}}:m=it,t&&i){const V=m,re=i===!0?1/0:i;m=()=>ft(V(),re)}const J=Ko(),U=()=>{c.stop(),J&&J.active&&Ds(J.effects,c)};if(s&&t){const V=t;t=(...re)=>{V(...re),U()}}let $=S?new Array(e.length).fill(Mn):Mn;const ne=V=>{if(!(!(c.flags&1)||!c.dirty&&!V))if(t){const re=c.run();if(i||K||(S?re.some((ce,_e)=>ut(ce,$[_e])):ut(re,$))){C&&C();const ce=Rt;Rt=c;try{const _e=[re,$===Mn?void 0:S&&$[0]===Mn?[]:$,w];$=re,l?l(t,3,_e):t(..._e)}finally{Rt=ce}}}else c.run()};return a&&a(ne),c=new hi(m),c.scheduler=o?()=>o(ne,!1):ne,w=V=>ha(V,!1,c),C=c.onStop=()=>{const V=Ln.get(c);if(V){if(l)l(V,4);else for(const re of V)re();Ln.delete(c)}},t?r?ne(!0):$=c.run():o?o(ne.bind(null,!0),!0):c.run(),U.pause=c.pause.bind(c),U.resume=c.resume.bind(c),U.stop=U,U}function ft(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--,Ne(e))ft(e.value,t,n);else if(W(e))for(let r=0;r<e.length;r++)ft(e[r],t,n);else if(Wt(e)||Ht(e))e.forEach(r=>{ft(r,t,n)});else if(li(e)){for(const r in e)ft(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ft(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 kn(e,t,n,r){try{return r?e(...r):e()}catch(i){Jn(i,t,n)}}function Ye(e,t,n,r){if(Q(e)){const i=kn(e,t,n,r);return i&&oi(i)&&i.catch(s=>{Jn(s,t,n)}),i}if(W(e)){const i=[];for(let s=0;s<e.length;s++)i.push(Ye(e[s],t,n,r));return i}}function Jn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||he;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let m=0;m<c.length;m++)if(c[m](e,l,d)===!1)return}a=a.parent}if(s){gt(),kn(s,null,10,[e,l,d]),pt();return}}ga(e,n,i,r,o)}function ga(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Fe=[];let et=-1;const Ut=[];let bt=null,Dt=0;const Ei=Promise.resolve();let Pn=null;function Oi(e){const t=Pn||Ei;return e?t.then(this?e.bind(this):e):t}function pa(e){let t=et+1,n=Fe.length;for(;t<n;){const r=t+n>>>1,i=Fe[r],s=fn(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function $s(e){if(!(e.flags&1)){const t=fn(e),n=Fe[Fe.length-1];!n||!(e.flags&2)&&t>=fn(n)?Fe.push(e):Fe.splice(pa(t),0,e),e.flags|=1,Ri()}}function Ri(){Pn||(Pn=Ei.then(Li))}function _a(e){W(e)?Ut.push(...e):bt&&e.id===-1?bt.splice(Dt+1,0,e):e.flags&1||(Ut.push(e),e.flags|=1),Ri()}function dr(e,t,n=et+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 Ii(e){if(Ut.length){const t=[...new Set(Ut)].sort((n,r)=>fn(n)-fn(r));if(Ut.length=0,bt){bt.push(...t);return}for(bt=t,Dt=0;Dt<bt.length;Dt++){const n=bt[Dt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}bt=null,Dt=0}}const fn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Li(e){try{for(et=0;et<Fe.length;et++){const t=Fe[et];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),kn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;et<Fe.length;et++){const t=Fe[et];t&&(t.flags&=-2)}et=-1,Fe.length=0,Ii(),Pn=null,(Fe.length||Ut.length)&&Li()}}let Me=null,Pi=null;function Bn(e){const t=Me;return Me=e,Pi=e&&e.type.__scopeId||null,t}function Xn(e,t=Me,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Nn(-1);const s=Bn(t);let o;try{o=e(...i)}finally{Bn(s),r._d&&Nn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function st(e,t){if(Me===null)return e;const n=ss(Me),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=he]=t[i];s&&(Q(s)&&(s={mounted:s,updated:s}),s.deep&&ft(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function xt(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&&(gt(),Ye(l,n,8,[e.el,a,e,t]),pt())}}function ya(e,t){if(Le){let n=Le.provides;const r=Le.parent&&Le.parent.provides;r===n&&(n=Le.provides=Object.create(r)),n[e]=t}}function On(e,t,n=!1){const r=yo();if(r||Vt){let i=Vt?Vt._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&&Q(t)?t.call(r&&r.proxy):t}}const va=Symbol.for("v-scx"),ba=()=>On(va);function ds(e,t,n){return Bi(e,t,n)}function Bi(e,t,n=he){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let d;if(pn){if(s==="sync"){const b=ba();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=it,b.resume=it,b.pause=it,b}}const c=Le;a.call=(b,K,S)=>Ye(b,c,K,S);let m=!1;s==="post"?a.scheduler=b=>{He(b,c&&c.suspense)}:s!=="sync"&&(m=!0,a.scheduler=(b,K)=>{K?b():$s(b)}),a.augmentJob=b=>{t&&(b.flags|=4),m&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const C=ma(e,t,a);return pn&&(d?d.push(C):l&&C()),C}function wa(e,t,n){const r=this.proxy,i=ye(e)?e.includes(".")?Fi(r,e):()=>r[e]:e.bind(r,r);let s;Q(t)?s=t:(s=t.handler,n=t);const o=Cn(this),a=Bi(i,s.bind(r),n);return o(),a}function Fi(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 ka=Symbol("_vte"),Di=e=>e.__isTeleport,tt=Symbol("_leaveCb"),Jt=Symbol("_enterCb");function Ca(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Wi(()=>{e.isMounted=!0}),$i(()=>{e.isUnmounting=!0}),e}const ze=[Function,Array],Ni={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ze,onEnter:ze,onAfterEnter:ze,onEnterCancelled:ze,onBeforeLeave:ze,onLeave:ze,onAfterLeave:ze,onLeaveCancelled:ze,onBeforeAppear:ze,onAppear:ze,onAfterAppear:ze,onAppearCancelled:ze},Hi=e=>{const t=e.subTree;return t.component?Hi(t.component):t},Sa={name:"BaseTransition",props:Ni,setup(e,{slots:t}){const n=yo(),r=Ca();return()=>{const i=t.default&&Vi(t.default(),!0),s=i&&i.length?Ui(i):n.subTree?F():void 0;if(!s)return;const o=le(e),{mode:a}=o;if(r.isLeaving)return fs(s);const l=fr(s);if(!l)return fs(s);let d=Ms(l,o,r,n,m=>d=m);l.type!==Ie&&hn(l,d);let c=n.subTree&&fr(n.subTree);if(c&&c.type!==Ie&&!It(c,l)&&Hi(n).type!==Ie){let m=Ms(c,o,r,n);if(hn(c,m),a==="out-in"&&l.type!==Ie)return r.isLeaving=!0,m.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete m.afterLeave,c=void 0},fs(s);a==="in-out"&&l.type!==Ie?m.delayLeave=(C,b,K)=>{const S=ji(r,c);S[String(c.key)]=c,C[tt]=()=>{b(),C[tt]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{K(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Ui(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ie){t=n;break}}return t}const Aa=Sa;function ji(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 Ms(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:c,onEnterCancelled:m,onBeforeLeave:C,onLeave:b,onAfterLeave:K,onLeaveCancelled:S,onBeforeAppear:J,onAppear:U,onAfterAppear:$,onAppearCancelled:ne}=t,V=String(e.key),re=ji(n,e),ce=(G,se)=>{G&&Ye(G,r,9,se)},_e=(G,se)=>{const ue=se[1];ce(G,se),W(G)?G.every(j=>j.length<=1)&&ue():G.length<=1&&ue()},we={mode:o,persisted:a,beforeEnter(G){let se=l;if(!n.isMounted)if(s)se=J||l;else return;G[tt]&&G[tt](!0);const ue=re[V];ue&&It(e,ue)&&ue.el[tt]&&ue.el[tt](),ce(se,[G])},enter(G){if(re[V]===e)return;let se=d,ue=c,j=m;if(!n.isMounted)if(s)se=U||d,ue=$||c,j=ne||m;else return;let _=!1;G[Jt]=k=>{_||(_=!0,k?ce(j,[G]):ce(ue,[G]),we.delayedLeave&&we.delayedLeave(),G[Jt]=void 0)};const v=G[Jt].bind(null,!1);se?_e(se,[G,v]):v()},leave(G,se){const ue=String(e.key);if(G[Jt]&&G[Jt](!0),n.isUnmounting)return se();ce(C,[G]);let j=!1;G[tt]=v=>{j||(j=!0,se(),v?ce(S,[G]):ce(K,[G]),G[tt]=void 0,re[ue]===e&&delete re[ue])};const _=G[tt].bind(null,!1);re[ue]=e,b?_e(b,[G,_]):_()},clone(G){const se=Ms(G,t,n,r,i);return i&&i(se),se}};return we}function fs(e){if(Qn(e))return e=St(e),e.children=null,e}function fr(e){if(!Qn(e))return Di(e.type)&&e.children?Ui(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&&Q(n.default))return n.default()}}function hn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hn(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 Vi(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===Z?(o.patchFlag&128&&i++,r=r.concat(Vi(o.children,t,a))):(t||o.type!==Ie)&&r.push(a!=null?St(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Ki(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function hr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Fn=new WeakMap;function an(e,t,n,r,i=!1){if(W(e)){e.forEach((S,J)=>an(S,t&&(W(t)?t[J]:t),n,r,i));return}if(jt(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&an(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?ss(r.component):r.el,o=i?null:s,{i:a,r:l}=e,d=t&&t.r,c=a.refs===he?a.refs={}:a.refs,m=a.setupState,C=le(m),b=m===he?ii:S=>hr(c,S)?!1:oe(C,S),K=(S,J)=>!(J&&hr(c,J));if(d!=null&&d!==l){if(mr(t),ye(d))c[d]=null,b(d)&&(m[d]=null);else if(Ne(d)){const S=t;K(d,S.k)&&(d.value=null),S.k&&(c[S.k]=null)}}if(Q(l))kn(l,a,12,[o,c]);else{const S=ye(l),J=Ne(l);if(S||J){const U=()=>{if(e.f){const $=S?b(l)?m[l]:c[l]:K()||!e.k?l.value:c[e.k];if(i)W($)&&Ds($,s);else if(W($))$.includes(s)||$.push(s);else if(S)c[l]=[s],b(l)&&(m[l]=c[l]);else{const ne=[s];K(l,e.k)&&(l.value=ne),e.k&&(c[e.k]=ne)}}else S?(c[l]=o,b(l)&&(m[l]=o)):J&&(K(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const $=()=>{U(),Fn.delete(e)};$.id=-1,Fn.set(e,$),He($,n)}else mr(e),U()}}}function mr(e){const t=Fn.get(e);t&&(t.flags|=8,Fn.delete(e))}qn().requestIdleCallback;qn().cancelIdleCallback;const jt=e=>!!e.type.__asyncLoader,Qn=e=>e.type.__isKeepAlive;function xa(e,t){zi(e,"a",t)}function Ta(e,t){zi(e,"da",t)}function zi(e,t,n=Le){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Zn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)Qn(i.parent.vnode)&&Ma(r,t,n,i),i=i.parent}}function Ma(e,t,n,r){const i=Zn(t,e,r,!0);qi(()=>{Ds(r[t],i)},n)}function Zn(e,t,n=Le,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{gt();const a=Cn(n),l=Ye(t,n,e,o);return a(),pt(),l});return r?i.unshift(s):i.push(s),s}}const yt=e=>(t,n=Le)=>{(!pn||e==="sp")&&Zn(e,(...r)=>t(...r),n)},Ea=yt("bm"),Wi=yt("m"),Oa=yt("bu"),Ra=yt("u"),$i=yt("bum"),qi=yt("um"),Ia=yt("sp"),La=yt("rtg"),Pa=yt("rtc");function Ba(e,t=Le){Zn("ec",e,t)}const Gi="components";function ve(e,t){return Ji(Gi,e,!0,t)||e}const Yi=Symbol.for("v-ndc");function qs(e){return ye(e)?Ji(Gi,e,!1)||e:e||Yi}function Ji(e,t,n=!0,r=!1){const i=Me||Le;if(i){const s=i.type;{const a=vl(s,!1);if(a&&(a===t||a===De(t)||a===Wn(De(t))))return s}const o=gr(i[e]||s[e],t)||gr(i.appContext[e],t);return!o&&r?s:o}}function gr(e,t){return e&&(e[t]||e[De(t)]||e[Wn(De(t))])}function Se(e,t,n,r){let i;const s=n,o=W(e);if(o||ye(e)){const a=o&&Pt(e);let l=!1,d=!1;a&&(l=!qe(e),d=Ct(e),e=Gn(e)),i=new Array(e.length);for(let c=0,m=e.length;c<m;c++)i[c]=t(l?d?Kt(_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,d=a.length;l<d;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Fa(e,t,n={},r,i){if(Me.ce||Me.parent&&jt(Me.parent)&&Me.parent.ce){const d=Object.keys(n).length>0;return h(),fe(Z,null,[pe("slot",n,r&&r())],d?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),h();const o=s&&Xi(s(n)),a=n.key||o&&o.key,l=fe(Z,{key:(a&&!Ge(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function Xi(e){return e.some(t=>gn(t)?!(t.type===Ie||t.type===Z&&!Xi(t.children)):!0)?e:null}const Es=e=>e?vo(e)?ss(e):Es(e.parent):null,ln=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=>Es(e.parent),$root:e=>Es(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Zi(e),$forceUpdate:e=>e.f||(e.f=()=>{$s(e.update)}),$nextTick:e=>e.n||(e.n=Oi.bind(e.proxy)),$watch:e=>wa.bind(e)}),hs=(e,t)=>e!==he&&!e.__isScriptSetup&&oe(e,t),Da={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 C=o[t];if(C!==void 0)switch(C){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(hs(r,t))return o[t]=1,r[t];if(i!==he&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==he&&oe(n,t))return o[t]=4,n[t];Os&&(o[t]=0)}}const d=ln[t];let c,m;if(d)return t==="$attrs"&&Re(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==he&&oe(n,t))return o[t]=4,n[t];if(m=l.config.globalProperties,oe(m,t))return m[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return hs(i,t)?(i[t]=n,!0):r!==he&&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!==he&&a[0]!=="$"&&oe(e,a)||hs(t,a)||oe(s,a)||oe(r,a)||oe(ln,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 pr(e){return W(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Os=!0;function Na(e){const t=Zi(e),n=e.proxy,r=e.ctx;Os=!1,t.beforeCreate&&_r(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:d,created:c,beforeMount:m,mounted:C,beforeUpdate:b,updated:K,activated:S,deactivated:J,beforeDestroy:U,beforeUnmount:$,destroyed:ne,unmounted:V,render:re,renderTracked:ce,renderTriggered:_e,errorCaptured:we,serverPrefetch:G,expose:se,inheritAttrs:ue,components:j,directives:_,filters:v}=t;if(d&&Ha(d,r,null),o)for(const P in o){const I=o[P];Q(I)&&(r[P]=I.bind(n))}if(i){const P=i.call(n,n);ae(P)&&(e.data=Yn(P))}if(Os=!0,s)for(const P in s){const I=s[P],y=Q(I)?I.bind(n,n):Q(I.get)?I.get.bind(n,n):it,A=!Q(I)&&Q(I.set)?I.set.bind(n):it,L=wl({get:y,set:A});Object.defineProperty(r,P,{enumerable:!0,configurable:!0,get:()=>L.value,set:X=>L.value=X})}if(a)for(const P in a)Qi(a[P],r,n,P);if(l){const P=Q(l)?l.call(n):l;Reflect.ownKeys(P).forEach(I=>{ya(I,P[I])})}c&&_r(c,e,"c");function x(P,I){W(I)?I.forEach(y=>P(y.bind(n))):I&&P(I.bind(n))}if(x(Ea,m),x(Wi,C),x(Oa,b),x(Ra,K),x(xa,S),x(Ta,J),x(Ba,we),x(Pa,ce),x(La,_e),x($i,$),x(qi,V),x(Ia,G),W(se))if(se.length){const P=e.exposed||(e.exposed={});se.forEach(I=>{Object.defineProperty(P,I,{get:()=>n[I],set:y=>n[I]=y,enumerable:!0})})}else e.exposed||(e.exposed={});re&&e.render===it&&(e.render=re),ue!=null&&(e.inheritAttrs=ue),j&&(e.components=j),_&&(e.directives=_),G&&Ki(e)}function Ha(e,t,n=it){W(e)&&(e=Rs(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=On(i.from||r,i.default,!0):s=On(i.from||r):s=On(i),Ne(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function _r(e,t,n){Ye(W(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Qi(e,t,n,r){let i=r.includes(".")?Fi(n,r):()=>n[r];if(ye(e)){const s=t[e];Q(s)&&ds(i,s)}else if(Q(e))ds(i,e.bind(n));else if(ae(e))if(W(e))e.forEach(s=>Qi(s,t,n,r));else{const s=Q(e.handler)?e.handler.bind(n):t[e.handler];Q(s)&&ds(i,s,e)}}function Zi(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(d=>Dn(l,d,o,!0)),Dn(l,t,o)),ae(t)&&s.set(t,l),l}function Dn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Dn(e,s,n,!0),i&&i.forEach(o=>Dn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Ua[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Ua={data:yr,props:vr,emits:vr,methods:en,computed:en,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:en,directives:en,watch:Va,provide:yr,inject:ja};function yr(e,t){return t?e?function(){return Ae(Q(e)?e.call(this,this):e,Q(t)?t.call(this,this):t)}:t:e}function ja(e,t){return en(Rs(e),Rs(t))}function Rs(e){if(W(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 en(e,t){return e?Ae(Object.create(null),e,t):t}function vr(e,t){return e?W(e)&&W(t)?[...new Set([...e,...t])]:Ae(Object.create(null),pr(e),pr(t??{})):t}function Va(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 eo(){return{app:null,config:{isNativeTag:ii,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 Ka=0;function za(e,t){return function(r,i=null){Q(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=eo(),o=new WeakSet,a=[];let l=!1;const d=s.app={_uid:Ka++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:kl,get config(){return s.config},set config(c){},use(c,...m){return o.has(c)||(c&&Q(c.install)?(o.add(c),c.install(d,...m)):Q(c)&&(o.add(c),c(d,...m))),d},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),d},component(c,m){return m?(s.components[c]=m,d):s.components[c]},directive(c,m){return m?(s.directives[c]=m,d):s.directives[c]},mount(c,m,C){if(!l){const b=d._ceVNode||pe(r,i);return b.appContext=s,C===!0?C="svg":C===!1&&(C=void 0),e(b,c,C),l=!0,d._container=c,c.__vue_app__=d,ss(b.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Ye(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,m){return s.provides[c]=m,d},runWithContext(c){const m=Vt;Vt=d;try{return c()}finally{Vt=m}}};return d}}let Vt=null;const Wa=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${De(t)}Modifiers`]||e[`${At(t)}Modifiers`];function $a(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||he;let i=n;const s=t.startsWith("update:"),o=s&&Wa(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>ye(c)?c.trim():c)),o.number&&(i=n.map($n)));let a,l=r[a=os(t)]||r[a=os(De(t))];!l&&s&&(l=r[a=os(At(t))]),l&&Ye(l,e,6,i);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Ye(d,e,6,i)}}const qa=new WeakMap;function to(e,t,n=!1){const r=n?qa:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!Q(e)){const l=d=>{const c=to(d,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):(W(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function es(e,t){return!e||!Vn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,At(t))||oe(e,t))}function br(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:d,renderCache:c,props:m,data:C,setupState:b,ctx:K,inheritAttrs:S}=e,J=Bn(e);let U,$;try{if(n.shapeFlag&4){const V=i||r,re=V;U=rt(d.call(re,V,c,m,b,C,K)),$=a}else{const V=t;U=rt(V.length>1?V(m,{attrs:a,slots:o,emit:l}):V(m,null)),$=t.props?a:Ga(a)}}catch(V){cn.length=0,Jn(V,e,1),U=pe(Ie)}let ne=U;if($&&S!==!1){const V=Object.keys($),{shapeFlag:re}=ne;V.length&&re&7&&(s&&V.some(Kn)&&($=Ya($,s)),ne=St(ne,$,!1,!0))}return n.dirs&&(ne=St(ne,null,!1,!0),ne.dirs=ne.dirs?ne.dirs.concat(n.dirs):n.dirs),n.transition&&hn(ne,n.transition),U=ne,Bn(J),U}const Ga=e=>{let t;for(const n in e)(n==="class"||n==="style"||Vn(n))&&((t||(t={}))[n]=e[n]);return t},Ya=(e,t)=>{const n={};for(const r in e)(!Kn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ja(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,d=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?wr(r,o,d):!!o;if(l&8){const c=t.dynamicProps;for(let m=0;m<c.length;m++){const C=c[m];if(no(o,r,C)&&!es(d,C))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?wr(r,o,d):!0:!!o;return!1}function wr(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(no(t,e,s)&&!es(n,s))return!0}return!1}function no(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!$t(r,i):r!==i}function Xa({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 so={},ro=()=>Object.create(so),io=e=>Object.getPrototypeOf(e)===so;function Qa(e,t,n,r=!1){const i={},s=ro();e.propsDefaults=Object.create(null),oo(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:la(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Za(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=le(i),[l]=e.propsOptions;let d=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let m=0;m<c.length;m++){let C=c[m];if(es(e.emitsOptions,C))continue;const b=t[C];if(l)if(oe(s,C))b!==s[C]&&(s[C]=b,d=!0);else{const K=De(C);i[K]=Is(l,a,K,b,e,!1)}else b!==s[C]&&(s[C]=b,d=!0)}}}else{oo(e,t,i,s)&&(d=!0);let c;for(const m in a)(!t||!oe(t,m)&&((c=At(m))===m||!oe(t,c)))&&(l?n&&(n[m]!==void 0||n[c]!==void 0)&&(i[m]=Is(l,a,m,void 0,e,!0)):delete i[m]);if(s!==a)for(const m in s)(!t||!oe(t,m))&&(delete s[m],d=!0)}d&&dt(e.attrs,"set","")}function oo(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(sn(l))continue;const d=t[l];let c;i&&oe(i,c=De(l))?!s||!s.includes(c)?n[c]=d:(a||(a={}))[c]=d:es(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,o=!0)}if(s){const l=le(n),d=a||he;for(let c=0;c<s.length;c++){const m=s[c];n[m]=Is(i,l,m,d[m],e,!oe(d,m))}}return o}function Is(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&&Q(l)){const{propsDefaults:d}=i;if(n in d)r=d[n];else{const c=Cn(i);r=d[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===At(n))&&(r=!0))}return r}const el=new WeakMap;function ao(e,t,n=!1){const r=n?el:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!Q(e)){const c=m=>{l=!0;const[C,b]=ao(m,t,!0);Ae(o,C),b&&a.push(...b)};!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(W(s))for(let c=0;c<s.length;c++){const m=De(s[c]);kr(m)&&(o[m]=he)}else if(s)for(const c in s){const m=De(c);if(kr(m)){const C=s[c],b=o[m]=W(C)||Q(C)?{type:C}:Ae({},C),K=b.type;let S=!1,J=!0;if(W(K))for(let U=0;U<K.length;++U){const $=K[U],ne=Q($)&&$.name;if(ne==="Boolean"){S=!0;break}else ne==="String"&&(J=!1)}else S=Q(K)&&K.name==="Boolean";b[0]=S,b[1]=J,(S||oe(b,"default"))&&a.push(m)}}const d=[o,a];return ae(e)&&r.set(e,d),d}function kr(e){return e[0]!=="$"&&!sn(e)}const Gs=e=>e==="_"||e==="_ctx"||e==="$stable",Ys=e=>W(e)?e.map(rt):[rt(e)],tl=(e,t,n)=>{if(t._n)return t;const r=Xn((...i)=>Ys(t(...i)),n);return r._c=!1,r},lo=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Gs(i))continue;const s=e[i];if(Q(s))t[i]=tl(i,s,r);else if(s!=null){const o=Ys(s);t[i]=()=>o}}},co=(e,t)=>{const n=Ys(t);e.slots.default=()=>n},uo=(e,t,n)=>{for(const r in t)(n||!Gs(r))&&(e[r]=t[r])},nl=(e,t,n)=>{const r=e.slots=ro();if(e.vnode.shapeFlag&32){const i=t._;i?(uo(r,t,n),n&&ci(r,"_",i,!0)):lo(t,r)}else t&&co(e,t)},sl=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=he;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:uo(i,t,n):(s=!t.$stable,lo(t,i)),o=t}else t&&(co(e,t),o={default:1});if(s)for(const a in i)!Gs(a)&&o[a]==null&&delete i[a]},He=ll;function rl(e){return il(e)}function il(e,t){const n=qn();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:d,setElementText:c,parentNode:m,nextSibling:C,setScopeId:b=it,insertStaticContent:K}=e,S=(f,g,w,O=null,T=null,M=null,N=void 0,D=null,B=!!g.dynamicChildren)=>{if(f===g)return;f&&!It(f,g)&&(O=An(f),X(f,T,M,!0),f=null),g.patchFlag===-2&&(B=!1,g.dynamicChildren=null);const{type:E,ref:q,shapeFlag:H}=g;switch(E){case ts:J(f,g,w,O);break;case Ie:U(f,g,w,O);break;case gs:f==null&&$(g,w,O,N);break;case Z:j(f,g,w,O,T,M,N,D,B);break;default:H&1?re(f,g,w,O,T,M,N,D,B):H&6?_(f,g,w,O,T,M,N,D,B):(H&64||H&128)&&E.process(f,g,w,O,T,M,N,D,B,qt)}q!=null&&T?an(q,f&&f.ref,M,g||f,!g):q==null&&f&&f.ref!=null&&an(f.ref,null,M,f,!0)},J=(f,g,w,O)=>{if(f==null)r(g.el=a(g.children),w,O);else{const T=g.el=f.el;g.children!==f.children&&d(T,g.children)}},U=(f,g,w,O)=>{f==null?r(g.el=l(g.children||""),w,O):g.el=f.el},$=(f,g,w,O)=>{[f.el,f.anchor]=K(f.children,g,w,O,f.el,f.anchor)},ne=({el:f,anchor:g},w,O)=>{let T;for(;f&&f!==g;)T=C(f),r(f,w,O),f=T;r(g,w,O)},V=({el:f,anchor:g})=>{let w;for(;f&&f!==g;)w=C(f),i(f),f=w;i(g)},re=(f,g,w,O,T,M,N,D,B)=>{if(g.type==="svg"?N="svg":g.type==="math"&&(N="mathml"),f==null)ce(g,w,O,T,M,N,D,B);else{const E=f.el&&f.el._isVueCE?f.el:null;try{E&&E._beginPatch(),G(f,g,T,M,N,D,B)}finally{E&&E._endPatch()}}},ce=(f,g,w,O,T,M,N,D)=>{let B,E;const{props:q,shapeFlag:H,transition:z,dirs:Y}=f;if(B=f.el=o(f.type,M,q&&q.is,q),H&8?c(B,f.children):H&16&&we(f.children,B,null,O,T,ms(f,M),N,D),Y&&xt(f,null,O,"created"),_e(B,f,f.scopeId,N,O),q){for(const de in q)de!=="value"&&!sn(de)&&s(B,de,null,q[de],M,O);"value"in q&&s(B,"value",null,q.value,M),(E=q.onVnodeBeforeMount)&&Ze(E,O,f)}Y&&xt(f,null,O,"beforeMount");const ie=ol(T,z);ie&&z.beforeEnter(B),r(B,g,w),((E=q&&q.onVnodeMounted)||ie||Y)&&He(()=>{try{E&&Ze(E,O,f),ie&&z.enter(B),Y&&xt(f,null,O,"mounted")}finally{}},T)},_e=(f,g,w,O,T)=>{if(w&&b(f,w),O)for(let M=0;M<O.length;M++)b(f,O[M]);if(T){let M=T.subTree;if(g===M||go(M.type)&&(M.ssContent===g||M.ssFallback===g)){const N=T.vnode;_e(f,N,N.scopeId,N.slotScopeIds,T.parent)}}},we=(f,g,w,O,T,M,N,D,B=0)=>{for(let E=B;E<f.length;E++){const q=f[E]=D?ct(f[E]):rt(f[E]);S(null,q,g,w,O,T,M,N,D)}},G=(f,g,w,O,T,M,N)=>{const D=g.el=f.el;let{patchFlag:B,dynamicChildren:E,dirs:q}=g;B|=f.patchFlag&16;const H=f.props||he,z=g.props||he;let Y;if(w&&Tt(w,!1),(Y=z.onVnodeBeforeUpdate)&&Ze(Y,w,g,f),q&&xt(g,f,w,"beforeUpdate"),w&&Tt(w,!0),(H.innerHTML&&z.innerHTML==null||H.textContent&&z.textContent==null)&&c(D,""),E?se(f.dynamicChildren,E,D,w,O,ms(g,T),M):N||I(f,g,D,null,w,O,ms(g,T),M,!1),B>0){if(B&16)ue(D,H,z,w,T);else if(B&2&&H.class!==z.class&&s(D,"class",null,z.class,T),B&4&&s(D,"style",H.style,z.style,T),B&8){const ie=g.dynamicProps;for(let de=0;de<ie.length;de++){const me=ie[de],ke=H[me],xe=z[me];(xe!==ke||me==="value")&&s(D,me,ke,xe,T,w)}}B&1&&f.children!==g.children&&c(D,g.children)}else!N&&E==null&&ue(D,H,z,w,T);((Y=z.onVnodeUpdated)||q)&&He(()=>{Y&&Ze(Y,w,g,f),q&&xt(g,f,w,"updated")},O)},se=(f,g,w,O,T,M,N)=>{for(let D=0;D<g.length;D++){const B=f[D],E=g[D],q=B.el&&(B.type===Z||!It(B,E)||B.shapeFlag&198)?m(B.el):w;S(B,E,q,null,O,T,M,N,!0)}},ue=(f,g,w,O,T)=>{if(g!==w){if(g!==he)for(const M in g)!sn(M)&&!(M in w)&&s(f,M,g[M],null,T,O);for(const M in w){if(sn(M))continue;const N=w[M],D=g[M];N!==D&&M!=="value"&&s(f,M,D,N,T,O)}"value"in w&&s(f,"value",g.value,w.value,T)}},j=(f,g,w,O,T,M,N,D,B)=>{const E=g.el=f?f.el:a(""),q=g.anchor=f?f.anchor:a("");let{patchFlag:H,dynamicChildren:z,slotScopeIds:Y}=g;Y&&(D=D?D.concat(Y):Y),f==null?(r(E,w,O),r(q,w,O),we(g.children||[],w,q,T,M,N,D,B)):H>0&&H&64&&z&&f.dynamicChildren&&f.dynamicChildren.length===z.length?(se(f.dynamicChildren,z,w,T,M,N,D),(g.key!=null||T&&g===T.subTree)&&fo(f,g,!0)):I(f,g,w,q,T,M,N,D,B)},_=(f,g,w,O,T,M,N,D,B)=>{g.slotScopeIds=D,f==null?g.shapeFlag&512?T.ctx.activate(g,w,O,N,B):v(g,w,O,T,M,N,B):k(f,g,B)},v=(f,g,w,O,T,M,N)=>{const D=f.component=ml(f,O,T);if(Qn(f)&&(D.ctx.renderer=qt),gl(D,!1,N),D.asyncDep){if(T&&T.registerDep(D,x,N),!f.el){const B=D.subTree=pe(Ie);U(null,B,g,w),f.placeholder=B.el}}else x(D,f,g,w,T,M,N)},k=(f,g,w)=>{const O=g.component=f.component;if(Ja(f,g,w))if(O.asyncDep&&!O.asyncResolved){P(O,g,w);return}else O.next=g,O.update();else g.el=f.el,O.vnode=g},x=(f,g,w,O,T,M,N)=>{const D=()=>{if(f.isMounted){let{next:H,bu:z,u:Y,parent:ie,vnode:de}=f;{const Xe=ho(f);if(Xe){H&&(H.el=de.el,P(f,H,N)),Xe.asyncDep.then(()=>{He(()=>{f.isUnmounted||E()},T)});return}}let me=H,ke;Tt(f,!1),H?(H.el=de.el,P(f,H,N)):H=de,z&&En(z),(ke=H.props&&H.props.onVnodeBeforeUpdate)&&Ze(ke,ie,H,de),Tt(f,!0);const xe=br(f),Je=f.subTree;f.subTree=xe,S(Je,xe,m(Je.el),An(Je),f,T,M),H.el=xe.el,me===null&&Xa(f,xe.el),Y&&He(Y,T),(ke=H.props&&H.props.onVnodeUpdated)&&He(()=>Ze(ke,ie,H,de),T)}else{let H;const{el:z,props:Y}=g,{bm:ie,m:de,parent:me,root:ke,type:xe}=f,Je=jt(g);Tt(f,!1),ie&&En(ie),!Je&&(H=Y&&Y.onVnodeBeforeMount)&&Ze(H,me,g),Tt(f,!0);{ke.ce&&ke.ce._hasShadowRoot()&&ke.ce._injectChildStyle(xe,f.parent?f.parent.type:void 0);const Xe=f.subTree=br(f);S(null,Xe,w,O,f,T,M),g.el=Xe.el}if(de&&He(de,T),!Je&&(H=Y&&Y.onVnodeMounted)){const Xe=g;He(()=>Ze(H,me,Xe),T)}(g.shapeFlag&256||me&&jt(me.vnode)&&me.vnode.shapeFlag&256)&&f.a&&He(f.a,T),f.isMounted=!0,g=w=O=null}};f.scope.on();const B=f.effect=new hi(D);f.scope.off();const E=f.update=B.run.bind(B),q=f.job=B.runIfDirty.bind(B);q.i=f,q.id=f.uid,B.scheduler=()=>$s(q),Tt(f,!0),E()},P=(f,g,w)=>{g.component=f;const O=f.vnode.props;f.vnode=g,f.next=null,Za(f,g.props,O,w),sl(f,g.children,w),gt(),dr(f),pt()},I=(f,g,w,O,T,M,N,D,B=!1)=>{const E=f&&f.children,q=f?f.shapeFlag:0,H=g.children,{patchFlag:z,shapeFlag:Y}=g;if(z>0){if(z&128){A(E,H,w,O,T,M,N,D,B);return}else if(z&256){y(E,H,w,O,T,M,N,D,B);return}}Y&8?(q&16&&Ue(E,T,M),H!==E&&c(w,H)):q&16?Y&16?A(E,H,w,O,T,M,N,D,B):Ue(E,T,M,!0):(q&8&&c(w,""),Y&16&&we(H,w,O,T,M,N,D,B))},y=(f,g,w,O,T,M,N,D,B)=>{f=f||Nt,g=g||Nt;const E=f.length,q=g.length,H=Math.min(E,q);let z;for(z=0;z<H;z++){const Y=g[z]=B?ct(g[z]):rt(g[z]);S(f[z],Y,w,null,T,M,N,D,B)}E>q?Ue(f,T,M,!0,!1,H):we(g,w,O,T,M,N,D,B,H)},A=(f,g,w,O,T,M,N,D,B)=>{let E=0;const q=g.length;let H=f.length-1,z=q-1;for(;E<=H&&E<=z;){const Y=f[E],ie=g[E]=B?ct(g[E]):rt(g[E]);if(It(Y,ie))S(Y,ie,w,null,T,M,N,D,B);else break;E++}for(;E<=H&&E<=z;){const Y=f[H],ie=g[z]=B?ct(g[z]):rt(g[z]);if(It(Y,ie))S(Y,ie,w,null,T,M,N,D,B);else break;H--,z--}if(E>H){if(E<=z){const Y=z+1,ie=Y<q?g[Y].el:O;for(;E<=z;)S(null,g[E]=B?ct(g[E]):rt(g[E]),w,ie,T,M,N,D,B),E++}}else if(E>z)for(;E<=H;)X(f[E],T,M,!0),E++;else{const Y=E,ie=E,de=new Map;for(E=ie;E<=z;E++){const je=g[E]=B?ct(g[E]):rt(g[E]);je.key!=null&&de.set(je.key,E)}let me,ke=0;const xe=z-ie+1;let Je=!1,Xe=0;const Gt=new Array(xe);for(E=0;E<xe;E++)Gt[E]=0;for(E=Y;E<=H;E++){const je=f[E];if(ke>=xe){X(je,T,M,!0);continue}let Qe;if(je.key!=null)Qe=de.get(je.key);else for(me=ie;me<=z;me++)if(Gt[me-ie]===0&&It(je,g[me])){Qe=me;break}Qe===void 0?X(je,T,M,!0):(Gt[Qe-ie]=E+1,Qe>=Xe?Xe=Qe:Je=!0,S(je,g[Qe],w,null,T,M,N,D,B),ke++)}const rr=Je?al(Gt):Nt;for(me=rr.length-1,E=xe-1;E>=0;E--){const je=ie+E,Qe=g[je],ir=g[je+1],or=je+1<q?ir.el||mo(ir):O;Gt[E]===0?S(null,Qe,w,or,T,M,N,D,B):Je&&(me<0||E!==rr[me]?L(Qe,w,or,2):me--)}}},L=(f,g,w,O,T=null)=>{const{el:M,type:N,transition:D,children:B,shapeFlag:E}=f;if(E&6){L(f.component.subTree,g,w,O);return}if(E&128){f.suspense.move(g,w,O);return}if(E&64){N.move(f,g,w,qt);return}if(N===Z){r(M,g,w);for(let H=0;H<B.length;H++)L(B[H],g,w,O);r(f.anchor,g,w);return}if(N===gs){ne(f,g,w);return}if(O!==2&&E&1&&D)if(O===0)D.beforeEnter(M),r(M,g,w),He(()=>D.enter(M),T);else{const{leave:H,delayLeave:z,afterLeave:Y}=D,ie=()=>{f.ctx.isUnmounted?i(M):r(M,g,w)},de=()=>{M._isLeaving&&M[tt](!0),H(M,()=>{ie(),Y&&Y()})};z?z(M,ie,de):de()}else r(M,g,w)},X=(f,g,w,O=!1,T=!1)=>{const{type:M,props:N,ref:D,children:B,dynamicChildren:E,shapeFlag:q,patchFlag:H,dirs:z,cacheIndex:Y,memo:ie}=f;if(H===-2&&(T=!1),D!=null&&(gt(),an(D,null,w,f,!0),pt()),Y!=null&&(g.renderCache[Y]=void 0),q&256){g.ctx.deactivate(f);return}const de=q&1&&z,me=!jt(f);let ke;if(me&&(ke=N&&N.onVnodeBeforeUnmount)&&Ze(ke,g,f),q&6)Ke(f.component,w,O);else{if(q&128){f.suspense.unmount(w,O);return}de&&xt(f,null,g,"beforeUnmount"),q&64?f.type.remove(f,g,w,qt,O):E&&!E.hasOnce&&(M!==Z||H>0&&H&64)?Ue(E,g,w,!1,!0):(M===Z&&H&384||!T&&q&16)&&Ue(B,g,w),O&&ee(f)}const xe=ie!=null&&Y==null;(me&&(ke=N&&N.onVnodeUnmounted)||de||xe)&&He(()=>{ke&&Ze(ke,g,f),de&&xt(f,null,g,"unmounted"),xe&&(f.el=null)},w)},ee=f=>{const{type:g,el:w,anchor:O,transition:T}=f;if(g===Z){Pe(w,O);return}if(g===gs){V(f);return}const M=()=>{i(w),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(f.shapeFlag&1&&T&&!T.persisted){const{leave:N,delayLeave:D}=T,B=()=>N(w,M);D?D(f.el,M,B):B()}else M()},Pe=(f,g)=>{let w;for(;f!==g;)w=C(f),i(f),f=w;i(g)},Ke=(f,g,w)=>{const{bum:O,scope:T,job:M,subTree:N,um:D,m:B,a:E}=f;Cr(B),Cr(E),O&&En(O),T.stop(),M&&(M.flags|=8,X(N,f,g,w)),D&&He(D,g),He(()=>{f.isUnmounted=!0},g)},Ue=(f,g,w,O=!1,T=!1,M=0)=>{for(let N=M;N<f.length;N++)X(f[N],g,w,O,T)},An=f=>{if(f.shapeFlag&6)return An(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const g=C(f.anchor||f.el),w=g&&g[ka];return w?C(w):g};let is=!1;const sr=(f,g,w)=>{let O;f==null?g._vnode&&(X(g._vnode,null,null,!0),O=g._vnode.component):S(g._vnode||null,f,g,null,null,null,w),g._vnode=f,is||(is=!0,dr(O),Ii(),is=!1)},qt={p:S,um:X,m:L,r:ee,mt:v,mc:we,pc:I,pbc:se,n:An,o:e};return{render:sr,hydrate:void 0,createApp:za(sr)}}function ms({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 Tt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ol(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function fo(e,t,n=!1){const r=e.children,i=t.children;if(W(r)&&W(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]=ct(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&fo(o,a)),a.type===ts&&(a.patchFlag===-1&&(a=i[s]=ct(a)),a.el=o.el),a.type===Ie&&!a.el&&(a.el=o.el)}}function al(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(i=n[n.length-1],e[i]<d){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<d?s=a+1:o=a;d<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 ho(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ho(t)}function Cr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function mo(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?mo(t.subTree):null}const go=e=>e.__isSuspense;function ll(e,t){t&&t.pendingBranch?W(e)?t.effects.push(...e):t.effects.push(e):_a(e)}const Z=Symbol.for("v-fgt"),ts=Symbol.for("v-txt"),Ie=Symbol.for("v-cmt"),gs=Symbol.for("v-stc"),cn=[];let Ve=null;function h(e=!1){cn.push(Ve=e?null:[])}function cl(){cn.pop(),Ve=cn[cn.length-1]||null}let mn=1;function Nn(e,t=!1){mn+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function po(e){return e.dynamicChildren=mn>0?Ve||Nt:null,cl(),mn>0&&Ve&&Ve.push(e),e}function p(e,t,n,r,i,s){return po(u(e,t,n,r,i,s,!0))}function fe(e,t,n,r,i){return po(pe(e,t,n,r,i,!0))}function gn(e){return e?e.__v_isVNode===!0:!1}function It(e,t){return e.type===t.type&&e.key===t.key}const _o=({key:e})=>e??null,Rn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ye(e)||Ne(e)||Q(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===Z?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_o(t),ref:t&&Rn(t),scopeId:Pi,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:Me};return a?(Js(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=ye(n)?8:16),mn>0&&!o&&Ve&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Ve.push(l),l}const pe=ul;function ul(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Yi)&&(e=Ie),gn(e)){const a=St(e,t,!0);return n&&Js(a,n),mn>0&&!s&&Ve&&(a.shapeFlag&6?Ve[Ve.indexOf(e)]=a:Ve.push(a)),a.patchFlag=-2,a}if(bl(e)&&(e=e.__vccOpts),t){t=dl(t);let{class:a,style:l}=t;a&&!ye(a)&&(t.class=te(a)),ae(l)&&(Ws(l)&&!W(l)&&(l=Ae({},l)),t.style=Ce(l))}const o=ye(e)?1:go(e)?128:Di(e)?64:ae(e)?4:Q(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function dl(e){return e?Ws(e)||io(e)?Ae({},e):e:null}function St(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,d=t?Xs(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&_o(d),ref:t&&t.ref?n&&s?W(s)?s.concat(Rn(t)):[s,Rn(t)]:Rn(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!==Z?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&&St(e.ssContent),ssFallback:e.ssFallback&&St(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&hn(c,l.clone(c)),c}function ns(e=" ",t=0){return pe(ts,null,e,t)}function F(e="",t=!1){return t?(h(),fe(Ie,null,e)):pe(Ie,null,e)}function rt(e){return e==null||typeof e=="boolean"?pe(Ie):W(e)?pe(Z,null,e.slice()):gn(e)?ct(e):pe(ts,null,String(e))}function ct(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:St(e)}function Js(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(W(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Js(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!io(t)?t._ctx=Me:i===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Q(t)?(t={default:t,_ctx:Me},n=32):(t=String(t),r&64?(n=16,t=[ns(t)]):n=8);e.children=t,e.shapeFlag|=n}function Xs(...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=te([t.class,r.class]));else if(i==="style")t.style=Ce([t.style,r.style]);else if(Vn(i)){const s=t[i],o=r[i];o&&s!==o&&!(W(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!Kn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Ze(e,t,n,r=null){Ye(e,t,7,[n,r])}const fl=eo();let hl=0;function ml(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||fl,s={uid:hl++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Vo(!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:ao(r,i),emitsOptions:to(r,i),emit:null,emitted:null,propsDefaults:he,inheritAttrs:r.inheritAttrs,ctx:he,data:he,props:he,attrs:he,slots:he,refs:he,setupState:he,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 Le=null;const yo=()=>Le||Me;let Hn,Ls;{const e=qn(),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)}};Hn=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),Ls=t("__VUE_SSR_SETTERS__",n=>pn=n)}const Cn=e=>{const t=Le;return Hn(e),e.scope.on(),()=>{e.scope.off(),Hn(t)}},Sr=()=>{Le&&Le.scope.off(),Hn(null)};function vo(e){return e.vnode.shapeFlag&4}let pn=!1;function gl(e,t=!1,n=!1){t&&Ls(t);const{props:r,children:i}=e.vnode,s=vo(e);Qa(e,r,s,t),nl(e,i,n||t);const o=s?pl(e,t):void 0;return t&&Ls(!1),o}function pl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Da);const{setup:r}=n;if(r){gt();const i=e.setupContext=r.length>1?yl(e):null,s=Cn(e),o=kn(r,e,0,[e.props,i]),a=oi(o);if(pt(),s(),(a||e.sp)&&!jt(e)&&Ki(e),a){if(o.then(Sr,Sr),t)return o.then(l=>{Ar(e,l)}).catch(l=>{Jn(l,e,0)});e.asyncDep=o}else Ar(e,o)}else bo(e)}function Ar(e,t,n){Q(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=Mi(t)),bo(e)}function bo(e,t,n){const r=e.type;e.render||(e.render=r.render||it);{const i=Cn(e);gt();try{Na(e)}finally{pt(),i()}}}const _l={get(e,t){return Re(e,"get",""),e[t]}};function yl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,_l),slots:e.slots,emit:e.emit,expose:t}}function ss(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Mi(Ts(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ln)return ln[n](e)},has(t,n){return n in t||n in ln}})):e.proxy}function vl(e,t=!0){return Q(e)?e.displayName||e.name:e.name||t&&e.__name}function bl(e){return Q(e)&&"__vccOpts"in e}const wl=(e,t)=>fa(e,t,pn);function wo(e,t,n){try{Nn(-1);const r=arguments.length;return r===2?ae(t)&&!W(t)?gn(t)?pe(e,null,[t]):pe(e,t):pe(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&gn(n)&&(n=[n]),pe(e,t,n))}finally{Nn(1)}}const kl="3.5.34";/**
|
|
13
|
+
**/function kn(e,t,n,r){try{return r?e(...r):e()}catch(i){Jn(i,t,n)}}function Ye(e,t,n,r){if(Q(e)){const i=kn(e,t,n,r);return i&&oi(i)&&i.catch(s=>{Jn(s,t,n)}),i}if(W(e)){const i=[];for(let s=0;s<e.length;s++)i.push(Ye(e[s],t,n,r));return i}}function Jn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||he;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let m=0;m<c.length;m++)if(c[m](e,l,d)===!1)return}a=a.parent}if(s){gt(),kn(s,null,10,[e,l,d]),pt();return}}ga(e,n,i,r,o)}function ga(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Fe=[];let et=-1;const Ut=[];let wt=null,Dt=0;const Ei=Promise.resolve();let Pn=null;function Oi(e){const t=Pn||Ei;return e?t.then(this?e.bind(this):e):t}function pa(e){let t=et+1,n=Fe.length;for(;t<n;){const r=t+n>>>1,i=Fe[r],s=fn(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function $s(e){if(!(e.flags&1)){const t=fn(e),n=Fe[Fe.length-1];!n||!(e.flags&2)&&t>=fn(n)?Fe.push(e):Fe.splice(pa(t),0,e),e.flags|=1,Ri()}}function Ri(){Pn||(Pn=Ei.then(Li))}function _a(e){W(e)?Ut.push(...e):wt&&e.id===-1?wt.splice(Dt+1,0,e):e.flags&1||(Ut.push(e),e.flags|=1),Ri()}function dr(e,t,n=et+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 Ii(e){if(Ut.length){const t=[...new Set(Ut)].sort((n,r)=>fn(n)-fn(r));if(Ut.length=0,wt){wt.push(...t);return}for(wt=t,Dt=0;Dt<wt.length;Dt++){const n=wt[Dt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}wt=null,Dt=0}}const fn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Li(e){try{for(et=0;et<Fe.length;et++){const t=Fe[et];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),kn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;et<Fe.length;et++){const t=Fe[et];t&&(t.flags&=-2)}et=-1,Fe.length=0,Ii(),Pn=null,(Fe.length||Ut.length)&&Li()}}let Me=null,Pi=null;function Bn(e){const t=Me;return Me=e,Pi=e&&e.type.__scopeId||null,t}function Xn(e,t=Me,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Nn(-1);const s=Bn(t);let o;try{o=e(...i)}finally{Bn(s),r._d&&Nn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function st(e,t){if(Me===null)return e;const n=ss(Me),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=he]=t[i];s&&(Q(s)&&(s={mounted:s,updated:s}),s.deep&&ft(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function xt(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&&(gt(),Ye(l,n,8,[e.el,a,e,t]),pt())}}function ya(e,t){if(Le){let n=Le.provides;const r=Le.parent&&Le.parent.provides;r===n&&(n=Le.provides=Object.create(r)),n[e]=t}}function On(e,t,n=!1){const r=yo();if(r||Vt){let i=Vt?Vt._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&&Q(t)?t.call(r&&r.proxy):t}}const va=Symbol.for("v-scx"),wa=()=>On(va);function ds(e,t,n){return Bi(e,t,n)}function Bi(e,t,n=he){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let d;if(pn){if(s==="sync"){const w=wa();d=w.__watcherHandles||(w.__watcherHandles=[])}else if(!l){const w=()=>{};return w.stop=it,w.resume=it,w.pause=it,w}}const c=Le;a.call=(w,K,S)=>Ye(w,c,K,S);let m=!1;s==="post"?a.scheduler=w=>{He(w,c&&c.suspense)}:s!=="sync"&&(m=!0,a.scheduler=(w,K)=>{K?w():$s(w)}),a.augmentJob=w=>{t&&(w.flags|=4),m&&(w.flags|=2,c&&(w.id=c.uid,w.i=c))};const C=ma(e,t,a);return pn&&(d?d.push(C):l&&C()),C}function ba(e,t,n){const r=this.proxy,i=ye(e)?e.includes(".")?Fi(r,e):()=>r[e]:e.bind(r,r);let s;Q(t)?s=t:(s=t.handler,n=t);const o=Cn(this),a=Bi(i,s.bind(r),n);return o(),a}function Fi(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 ka=Symbol("_vte"),Di=e=>e.__isTeleport,tt=Symbol("_leaveCb"),Jt=Symbol("_enterCb");function Ca(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Wi(()=>{e.isMounted=!0}),$i(()=>{e.isUnmounting=!0}),e}const ze=[Function,Array],Ni={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ze,onEnter:ze,onAfterEnter:ze,onEnterCancelled:ze,onBeforeLeave:ze,onLeave:ze,onAfterLeave:ze,onLeaveCancelled:ze,onBeforeAppear:ze,onAppear:ze,onAfterAppear:ze,onAppearCancelled:ze},Hi=e=>{const t=e.subTree;return t.component?Hi(t.component):t},Sa={name:"BaseTransition",props:Ni,setup(e,{slots:t}){const n=yo(),r=Ca();return()=>{const i=t.default&&Vi(t.default(),!0),s=i&&i.length?Ui(i):n.subTree?F():void 0;if(!s)return;const o=le(e),{mode:a}=o;if(r.isLeaving)return fs(s);const l=fr(s);if(!l)return fs(s);let d=Ms(l,o,r,n,m=>d=m);l.type!==Ie&&hn(l,d);let c=n.subTree&&fr(n.subTree);if(c&&c.type!==Ie&&!It(c,l)&&Hi(n).type!==Ie){let m=Ms(c,o,r,n);if(hn(c,m),a==="out-in"&&l.type!==Ie)return r.isLeaving=!0,m.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete m.afterLeave,c=void 0},fs(s);a==="in-out"&&l.type!==Ie?m.delayLeave=(C,w,K)=>{const S=ji(r,c);S[String(c.key)]=c,C[tt]=()=>{w(),C[tt]=void 0,delete d.delayedLeave,c=void 0},d.delayedLeave=()=>{K(),delete d.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Ui(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ie){t=n;break}}return t}const Aa=Sa;function ji(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 Ms(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:c,onEnterCancelled:m,onBeforeLeave:C,onLeave:w,onAfterLeave:K,onLeaveCancelled:S,onBeforeAppear:J,onAppear:U,onAfterAppear:$,onAppearCancelled:ne}=t,V=String(e.key),re=ji(n,e),ce=(G,se)=>{G&&Ye(G,r,9,se)},_e=(G,se)=>{const ue=se[1];ce(G,se),W(G)?G.every(j=>j.length<=1)&&ue():G.length<=1&&ue()},be={mode:o,persisted:a,beforeEnter(G){let se=l;if(!n.isMounted)if(s)se=J||l;else return;G[tt]&&G[tt](!0);const ue=re[V];ue&&It(e,ue)&&ue.el[tt]&&ue.el[tt](),ce(se,[G])},enter(G){if(re[V]===e)return;let se=d,ue=c,j=m;if(!n.isMounted)if(s)se=U||d,ue=$||c,j=ne||m;else return;let _=!1;G[Jt]=k=>{_||(_=!0,k?ce(j,[G]):ce(ue,[G]),be.delayedLeave&&be.delayedLeave(),G[Jt]=void 0)};const v=G[Jt].bind(null,!1);se?_e(se,[G,v]):v()},leave(G,se){const ue=String(e.key);if(G[Jt]&&G[Jt](!0),n.isUnmounting)return se();ce(C,[G]);let j=!1;G[tt]=v=>{j||(j=!0,se(),v?ce(S,[G]):ce(K,[G]),G[tt]=void 0,re[ue]===e&&delete re[ue])};const _=G[tt].bind(null,!1);re[ue]=e,w?_e(w,[G,_]):_()},clone(G){const se=Ms(G,t,n,r,i);return i&&i(se),se}};return be}function fs(e){if(Qn(e))return e=St(e),e.children=null,e}function fr(e){if(!Qn(e))return Di(e.type)&&e.children?Ui(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&&Q(n.default))return n.default()}}function hn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hn(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 Vi(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===Z?(o.patchFlag&128&&i++,r=r.concat(Vi(o.children,t,a))):(t||o.type!==Ie)&&r.push(a!=null?St(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Ki(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function hr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Fn=new WeakMap;function an(e,t,n,r,i=!1){if(W(e)){e.forEach((S,J)=>an(S,t&&(W(t)?t[J]:t),n,r,i));return}if(jt(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&an(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?ss(r.component):r.el,o=i?null:s,{i:a,r:l}=e,d=t&&t.r,c=a.refs===he?a.refs={}:a.refs,m=a.setupState,C=le(m),w=m===he?ii:S=>hr(c,S)?!1:oe(C,S),K=(S,J)=>!(J&&hr(c,J));if(d!=null&&d!==l){if(mr(t),ye(d))c[d]=null,w(d)&&(m[d]=null);else if(Ne(d)){const S=t;K(d,S.k)&&(d.value=null),S.k&&(c[S.k]=null)}}if(Q(l))kn(l,a,12,[o,c]);else{const S=ye(l),J=Ne(l);if(S||J){const U=()=>{if(e.f){const $=S?w(l)?m[l]:c[l]:K()||!e.k?l.value:c[e.k];if(i)W($)&&Ds($,s);else if(W($))$.includes(s)||$.push(s);else if(S)c[l]=[s],w(l)&&(m[l]=c[l]);else{const ne=[s];K(l,e.k)&&(l.value=ne),e.k&&(c[e.k]=ne)}}else S?(c[l]=o,w(l)&&(m[l]=o)):J&&(K(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const $=()=>{U(),Fn.delete(e)};$.id=-1,Fn.set(e,$),He($,n)}else mr(e),U()}}}function mr(e){const t=Fn.get(e);t&&(t.flags|=8,Fn.delete(e))}qn().requestIdleCallback;qn().cancelIdleCallback;const jt=e=>!!e.type.__asyncLoader,Qn=e=>e.type.__isKeepAlive;function xa(e,t){zi(e,"a",t)}function Ta(e,t){zi(e,"da",t)}function zi(e,t,n=Le){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Zn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)Qn(i.parent.vnode)&&Ma(r,t,n,i),i=i.parent}}function Ma(e,t,n,r){const i=Zn(t,e,r,!0);qi(()=>{Ds(r[t],i)},n)}function Zn(e,t,n=Le,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{gt();const a=Cn(n),l=Ye(t,n,e,o);return a(),pt(),l});return r?i.unshift(s):i.push(s),s}}const yt=e=>(t,n=Le)=>{(!pn||e==="sp")&&Zn(e,(...r)=>t(...r),n)},Ea=yt("bm"),Wi=yt("m"),Oa=yt("bu"),Ra=yt("u"),$i=yt("bum"),qi=yt("um"),Ia=yt("sp"),La=yt("rtg"),Pa=yt("rtc");function Ba(e,t=Le){Zn("ec",e,t)}const Gi="components";function ve(e,t){return Ji(Gi,e,!0,t)||e}const Yi=Symbol.for("v-ndc");function qs(e){return ye(e)?Ji(Gi,e,!1)||e:e||Yi}function Ji(e,t,n=!0,r=!1){const i=Me||Le;if(i){const s=i.type;{const a=vl(s,!1);if(a&&(a===t||a===De(t)||a===Wn(De(t))))return s}const o=gr(i[e]||s[e],t)||gr(i.appContext[e],t);return!o&&r?s:o}}function gr(e,t){return e&&(e[t]||e[De(t)]||e[Wn(De(t))])}function Se(e,t,n,r){let i;const s=n,o=W(e);if(o||ye(e)){const a=o&&Pt(e);let l=!1,d=!1;a&&(l=!qe(e),d=Ct(e),e=Gn(e)),i=new Array(e.length);for(let c=0,m=e.length;c<m;c++)i[c]=t(l?d?Kt(_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,d=a.length;l<d;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Fa(e,t,n={},r,i){if(Me.ce||Me.parent&&jt(Me.parent)&&Me.parent.ce){const d=Object.keys(n).length>0;return h(),fe(Z,null,[pe("slot",n,r&&r())],d?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),h();const o=s&&Xi(s(n)),a=n.key||o&&o.key,l=fe(Z,{key:(a&&!Ge(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function Xi(e){return e.some(t=>gn(t)?!(t.type===Ie||t.type===Z&&!Xi(t.children)):!0)?e:null}const Es=e=>e?vo(e)?ss(e):Es(e.parent):null,ln=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=>Es(e.parent),$root:e=>Es(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Zi(e),$forceUpdate:e=>e.f||(e.f=()=>{$s(e.update)}),$nextTick:e=>e.n||(e.n=Oi.bind(e.proxy)),$watch:e=>ba.bind(e)}),hs=(e,t)=>e!==he&&!e.__isScriptSetup&&oe(e,t),Da={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 C=o[t];if(C!==void 0)switch(C){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(hs(r,t))return o[t]=1,r[t];if(i!==he&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==he&&oe(n,t))return o[t]=4,n[t];Os&&(o[t]=0)}}const d=ln[t];let c,m;if(d)return t==="$attrs"&&Re(e.attrs,"get",""),d(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==he&&oe(n,t))return o[t]=4,n[t];if(m=l.config.globalProperties,oe(m,t))return m[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return hs(i,t)?(i[t]=n,!0):r!==he&&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!==he&&a[0]!=="$"&&oe(e,a)||hs(t,a)||oe(s,a)||oe(r,a)||oe(ln,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 pr(e){return W(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Os=!0;function Na(e){const t=Zi(e),n=e.proxy,r=e.ctx;Os=!1,t.beforeCreate&&_r(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:d,created:c,beforeMount:m,mounted:C,beforeUpdate:w,updated:K,activated:S,deactivated:J,beforeDestroy:U,beforeUnmount:$,destroyed:ne,unmounted:V,render:re,renderTracked:ce,renderTriggered:_e,errorCaptured:be,serverPrefetch:G,expose:se,inheritAttrs:ue,components:j,directives:_,filters:v}=t;if(d&&Ha(d,r,null),o)for(const P in o){const I=o[P];Q(I)&&(r[P]=I.bind(n))}if(i){const P=i.call(n,n);ae(P)&&(e.data=Yn(P))}if(Os=!0,s)for(const P in s){const I=s[P],y=Q(I)?I.bind(n,n):Q(I.get)?I.get.bind(n,n):it,A=!Q(I)&&Q(I.set)?I.set.bind(n):it,L=bl({get:y,set:A});Object.defineProperty(r,P,{enumerable:!0,configurable:!0,get:()=>L.value,set:X=>L.value=X})}if(a)for(const P in a)Qi(a[P],r,n,P);if(l){const P=Q(l)?l.call(n):l;Reflect.ownKeys(P).forEach(I=>{ya(I,P[I])})}c&&_r(c,e,"c");function x(P,I){W(I)?I.forEach(y=>P(y.bind(n))):I&&P(I.bind(n))}if(x(Ea,m),x(Wi,C),x(Oa,w),x(Ra,K),x(xa,S),x(Ta,J),x(Ba,be),x(Pa,ce),x(La,_e),x($i,$),x(qi,V),x(Ia,G),W(se))if(se.length){const P=e.exposed||(e.exposed={});se.forEach(I=>{Object.defineProperty(P,I,{get:()=>n[I],set:y=>n[I]=y,enumerable:!0})})}else e.exposed||(e.exposed={});re&&e.render===it&&(e.render=re),ue!=null&&(e.inheritAttrs=ue),j&&(e.components=j),_&&(e.directives=_),G&&Ki(e)}function Ha(e,t,n=it){W(e)&&(e=Rs(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=On(i.from||r,i.default,!0):s=On(i.from||r):s=On(i),Ne(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function _r(e,t,n){Ye(W(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Qi(e,t,n,r){let i=r.includes(".")?Fi(n,r):()=>n[r];if(ye(e)){const s=t[e];Q(s)&&ds(i,s)}else if(Q(e))ds(i,e.bind(n));else if(ae(e))if(W(e))e.forEach(s=>Qi(s,t,n,r));else{const s=Q(e.handler)?e.handler.bind(n):t[e.handler];Q(s)&&ds(i,s,e)}}function Zi(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(d=>Dn(l,d,o,!0)),Dn(l,t,o)),ae(t)&&s.set(t,l),l}function Dn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Dn(e,s,n,!0),i&&i.forEach(o=>Dn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Ua[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Ua={data:yr,props:vr,emits:vr,methods:en,computed:en,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:en,directives:en,watch:Va,provide:yr,inject:ja};function yr(e,t){return t?e?function(){return Ae(Q(e)?e.call(this,this):e,Q(t)?t.call(this,this):t)}:t:e}function ja(e,t){return en(Rs(e),Rs(t))}function Rs(e){if(W(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 en(e,t){return e?Ae(Object.create(null),e,t):t}function vr(e,t){return e?W(e)&&W(t)?[...new Set([...e,...t])]:Ae(Object.create(null),pr(e),pr(t??{})):t}function Va(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 eo(){return{app:null,config:{isNativeTag:ii,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 Ka=0;function za(e,t){return function(r,i=null){Q(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=eo(),o=new WeakSet,a=[];let l=!1;const d=s.app={_uid:Ka++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:kl,get config(){return s.config},set config(c){},use(c,...m){return o.has(c)||(c&&Q(c.install)?(o.add(c),c.install(d,...m)):Q(c)&&(o.add(c),c(d,...m))),d},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),d},component(c,m){return m?(s.components[c]=m,d):s.components[c]},directive(c,m){return m?(s.directives[c]=m,d):s.directives[c]},mount(c,m,C){if(!l){const w=d._ceVNode||pe(r,i);return w.appContext=s,C===!0?C="svg":C===!1&&(C=void 0),e(w,c,C),l=!0,d._container=c,c.__vue_app__=d,ss(w.component)}},onUnmount(c){a.push(c)},unmount(){l&&(Ye(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,m){return s.provides[c]=m,d},runWithContext(c){const m=Vt;Vt=d;try{return c()}finally{Vt=m}}};return d}}let Vt=null;const Wa=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${De(t)}Modifiers`]||e[`${At(t)}Modifiers`];function $a(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||he;let i=n;const s=t.startsWith("update:"),o=s&&Wa(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>ye(c)?c.trim():c)),o.number&&(i=n.map($n)));let a,l=r[a=os(t)]||r[a=os(De(t))];!l&&s&&(l=r[a=os(At(t))]),l&&Ye(l,e,6,i);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Ye(d,e,6,i)}}const qa=new WeakMap;function to(e,t,n=!1){const r=n?qa:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!Q(e)){const l=d=>{const c=to(d,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):(W(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function es(e,t){return!e||!Vn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,At(t))||oe(e,t))}function wr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:d,renderCache:c,props:m,data:C,setupState:w,ctx:K,inheritAttrs:S}=e,J=Bn(e);let U,$;try{if(n.shapeFlag&4){const V=i||r,re=V;U=rt(d.call(re,V,c,m,w,C,K)),$=a}else{const V=t;U=rt(V.length>1?V(m,{attrs:a,slots:o,emit:l}):V(m,null)),$=t.props?a:Ga(a)}}catch(V){cn.length=0,Jn(V,e,1),U=pe(Ie)}let ne=U;if($&&S!==!1){const V=Object.keys($),{shapeFlag:re}=ne;V.length&&re&7&&(s&&V.some(Kn)&&($=Ya($,s)),ne=St(ne,$,!1,!0))}return n.dirs&&(ne=St(ne,null,!1,!0),ne.dirs=ne.dirs?ne.dirs.concat(n.dirs):n.dirs),n.transition&&hn(ne,n.transition),U=ne,Bn(J),U}const Ga=e=>{let t;for(const n in e)(n==="class"||n==="style"||Vn(n))&&((t||(t={}))[n]=e[n]);return t},Ya=(e,t)=>{const n={};for(const r in e)(!Kn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ja(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,d=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?br(r,o,d):!!o;if(l&8){const c=t.dynamicProps;for(let m=0;m<c.length;m++){const C=c[m];if(no(o,r,C)&&!es(d,C))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?br(r,o,d):!0:!!o;return!1}function br(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(no(t,e,s)&&!es(n,s))return!0}return!1}function no(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!$t(r,i):r!==i}function Xa({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 so={},ro=()=>Object.create(so),io=e=>Object.getPrototypeOf(e)===so;function Qa(e,t,n,r=!1){const i={},s=ro();e.propsDefaults=Object.create(null),oo(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:la(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Za(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=le(i),[l]=e.propsOptions;let d=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let m=0;m<c.length;m++){let C=c[m];if(es(e.emitsOptions,C))continue;const w=t[C];if(l)if(oe(s,C))w!==s[C]&&(s[C]=w,d=!0);else{const K=De(C);i[K]=Is(l,a,K,w,e,!1)}else w!==s[C]&&(s[C]=w,d=!0)}}}else{oo(e,t,i,s)&&(d=!0);let c;for(const m in a)(!t||!oe(t,m)&&((c=At(m))===m||!oe(t,c)))&&(l?n&&(n[m]!==void 0||n[c]!==void 0)&&(i[m]=Is(l,a,m,void 0,e,!0)):delete i[m]);if(s!==a)for(const m in s)(!t||!oe(t,m))&&(delete s[m],d=!0)}d&&dt(e.attrs,"set","")}function oo(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(sn(l))continue;const d=t[l];let c;i&&oe(i,c=De(l))?!s||!s.includes(c)?n[c]=d:(a||(a={}))[c]=d:es(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,o=!0)}if(s){const l=le(n),d=a||he;for(let c=0;c<s.length;c++){const m=s[c];n[m]=Is(i,l,m,d[m],e,!oe(d,m))}}return o}function Is(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&&Q(l)){const{propsDefaults:d}=i;if(n in d)r=d[n];else{const c=Cn(i);r=d[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===At(n))&&(r=!0))}return r}const el=new WeakMap;function ao(e,t,n=!1){const r=n?el:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!Q(e)){const c=m=>{l=!0;const[C,w]=ao(m,t,!0);Ae(o,C),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(W(s))for(let c=0;c<s.length;c++){const m=De(s[c]);kr(m)&&(o[m]=he)}else if(s)for(const c in s){const m=De(c);if(kr(m)){const C=s[c],w=o[m]=W(C)||Q(C)?{type:C}:Ae({},C),K=w.type;let S=!1,J=!0;if(W(K))for(let U=0;U<K.length;++U){const $=K[U],ne=Q($)&&$.name;if(ne==="Boolean"){S=!0;break}else ne==="String"&&(J=!1)}else S=Q(K)&&K.name==="Boolean";w[0]=S,w[1]=J,(S||oe(w,"default"))&&a.push(m)}}const d=[o,a];return ae(e)&&r.set(e,d),d}function kr(e){return e[0]!=="$"&&!sn(e)}const Gs=e=>e==="_"||e==="_ctx"||e==="$stable",Ys=e=>W(e)?e.map(rt):[rt(e)],tl=(e,t,n)=>{if(t._n)return t;const r=Xn((...i)=>Ys(t(...i)),n);return r._c=!1,r},lo=(e,t,n)=>{const r=e._ctx;for(const i in e){if(Gs(i))continue;const s=e[i];if(Q(s))t[i]=tl(i,s,r);else if(s!=null){const o=Ys(s);t[i]=()=>o}}},co=(e,t)=>{const n=Ys(t);e.slots.default=()=>n},uo=(e,t,n)=>{for(const r in t)(n||!Gs(r))&&(e[r]=t[r])},nl=(e,t,n)=>{const r=e.slots=ro();if(e.vnode.shapeFlag&32){const i=t._;i?(uo(r,t,n),n&&ci(r,"_",i,!0)):lo(t,r)}else t&&co(e,t)},sl=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=he;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:uo(i,t,n):(s=!t.$stable,lo(t,i)),o=t}else t&&(co(e,t),o={default:1});if(s)for(const a in i)!Gs(a)&&o[a]==null&&delete i[a]},He=ll;function rl(e){return il(e)}function il(e,t){const n=qn();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:d,setElementText:c,parentNode:m,nextSibling:C,setScopeId:w=it,insertStaticContent:K}=e,S=(f,g,b,O=null,T=null,M=null,N=void 0,D=null,B=!!g.dynamicChildren)=>{if(f===g)return;f&&!It(f,g)&&(O=An(f),X(f,T,M,!0),f=null),g.patchFlag===-2&&(B=!1,g.dynamicChildren=null);const{type:E,ref:q,shapeFlag:H}=g;switch(E){case ts:J(f,g,b,O);break;case Ie:U(f,g,b,O);break;case gs:f==null&&$(g,b,O,N);break;case Z:j(f,g,b,O,T,M,N,D,B);break;default:H&1?re(f,g,b,O,T,M,N,D,B):H&6?_(f,g,b,O,T,M,N,D,B):(H&64||H&128)&&E.process(f,g,b,O,T,M,N,D,B,qt)}q!=null&&T?an(q,f&&f.ref,M,g||f,!g):q==null&&f&&f.ref!=null&&an(f.ref,null,M,f,!0)},J=(f,g,b,O)=>{if(f==null)r(g.el=a(g.children),b,O);else{const T=g.el=f.el;g.children!==f.children&&d(T,g.children)}},U=(f,g,b,O)=>{f==null?r(g.el=l(g.children||""),b,O):g.el=f.el},$=(f,g,b,O)=>{[f.el,f.anchor]=K(f.children,g,b,O,f.el,f.anchor)},ne=({el:f,anchor:g},b,O)=>{let T;for(;f&&f!==g;)T=C(f),r(f,b,O),f=T;r(g,b,O)},V=({el:f,anchor:g})=>{let b;for(;f&&f!==g;)b=C(f),i(f),f=b;i(g)},re=(f,g,b,O,T,M,N,D,B)=>{if(g.type==="svg"?N="svg":g.type==="math"&&(N="mathml"),f==null)ce(g,b,O,T,M,N,D,B);else{const E=f.el&&f.el._isVueCE?f.el:null;try{E&&E._beginPatch(),G(f,g,T,M,N,D,B)}finally{E&&E._endPatch()}}},ce=(f,g,b,O,T,M,N,D)=>{let B,E;const{props:q,shapeFlag:H,transition:z,dirs:Y}=f;if(B=f.el=o(f.type,M,q&&q.is,q),H&8?c(B,f.children):H&16&&be(f.children,B,null,O,T,ms(f,M),N,D),Y&&xt(f,null,O,"created"),_e(B,f,f.scopeId,N,O),q){for(const de in q)de!=="value"&&!sn(de)&&s(B,de,null,q[de],M,O);"value"in q&&s(B,"value",null,q.value,M),(E=q.onVnodeBeforeMount)&&Ze(E,O,f)}Y&&xt(f,null,O,"beforeMount");const ie=ol(T,z);ie&&z.beforeEnter(B),r(B,g,b),((E=q&&q.onVnodeMounted)||ie||Y)&&He(()=>{try{E&&Ze(E,O,f),ie&&z.enter(B),Y&&xt(f,null,O,"mounted")}finally{}},T)},_e=(f,g,b,O,T)=>{if(b&&w(f,b),O)for(let M=0;M<O.length;M++)w(f,O[M]);if(T){let M=T.subTree;if(g===M||go(M.type)&&(M.ssContent===g||M.ssFallback===g)){const N=T.vnode;_e(f,N,N.scopeId,N.slotScopeIds,T.parent)}}},be=(f,g,b,O,T,M,N,D,B=0)=>{for(let E=B;E<f.length;E++){const q=f[E]=D?ct(f[E]):rt(f[E]);S(null,q,g,b,O,T,M,N,D)}},G=(f,g,b,O,T,M,N)=>{const D=g.el=f.el;let{patchFlag:B,dynamicChildren:E,dirs:q}=g;B|=f.patchFlag&16;const H=f.props||he,z=g.props||he;let Y;if(b&&Tt(b,!1),(Y=z.onVnodeBeforeUpdate)&&Ze(Y,b,g,f),q&&xt(g,f,b,"beforeUpdate"),b&&Tt(b,!0),(H.innerHTML&&z.innerHTML==null||H.textContent&&z.textContent==null)&&c(D,""),E?se(f.dynamicChildren,E,D,b,O,ms(g,T),M):N||I(f,g,D,null,b,O,ms(g,T),M,!1),B>0){if(B&16)ue(D,H,z,b,T);else if(B&2&&H.class!==z.class&&s(D,"class",null,z.class,T),B&4&&s(D,"style",H.style,z.style,T),B&8){const ie=g.dynamicProps;for(let de=0;de<ie.length;de++){const me=ie[de],ke=H[me],xe=z[me];(xe!==ke||me==="value")&&s(D,me,ke,xe,T,b)}}B&1&&f.children!==g.children&&c(D,g.children)}else!N&&E==null&&ue(D,H,z,b,T);((Y=z.onVnodeUpdated)||q)&&He(()=>{Y&&Ze(Y,b,g,f),q&&xt(g,f,b,"updated")},O)},se=(f,g,b,O,T,M,N)=>{for(let D=0;D<g.length;D++){const B=f[D],E=g[D],q=B.el&&(B.type===Z||!It(B,E)||B.shapeFlag&198)?m(B.el):b;S(B,E,q,null,O,T,M,N,!0)}},ue=(f,g,b,O,T)=>{if(g!==b){if(g!==he)for(const M in g)!sn(M)&&!(M in b)&&s(f,M,g[M],null,T,O);for(const M in b){if(sn(M))continue;const N=b[M],D=g[M];N!==D&&M!=="value"&&s(f,M,D,N,T,O)}"value"in b&&s(f,"value",g.value,b.value,T)}},j=(f,g,b,O,T,M,N,D,B)=>{const E=g.el=f?f.el:a(""),q=g.anchor=f?f.anchor:a("");let{patchFlag:H,dynamicChildren:z,slotScopeIds:Y}=g;Y&&(D=D?D.concat(Y):Y),f==null?(r(E,b,O),r(q,b,O),be(g.children||[],b,q,T,M,N,D,B)):H>0&&H&64&&z&&f.dynamicChildren&&f.dynamicChildren.length===z.length?(se(f.dynamicChildren,z,b,T,M,N,D),(g.key!=null||T&&g===T.subTree)&&fo(f,g,!0)):I(f,g,b,q,T,M,N,D,B)},_=(f,g,b,O,T,M,N,D,B)=>{g.slotScopeIds=D,f==null?g.shapeFlag&512?T.ctx.activate(g,b,O,N,B):v(g,b,O,T,M,N,B):k(f,g,B)},v=(f,g,b,O,T,M,N)=>{const D=f.component=ml(f,O,T);if(Qn(f)&&(D.ctx.renderer=qt),gl(D,!1,N),D.asyncDep){if(T&&T.registerDep(D,x,N),!f.el){const B=D.subTree=pe(Ie);U(null,B,g,b),f.placeholder=B.el}}else x(D,f,g,b,T,M,N)},k=(f,g,b)=>{const O=g.component=f.component;if(Ja(f,g,b))if(O.asyncDep&&!O.asyncResolved){P(O,g,b);return}else O.next=g,O.update();else g.el=f.el,O.vnode=g},x=(f,g,b,O,T,M,N)=>{const D=()=>{if(f.isMounted){let{next:H,bu:z,u:Y,parent:ie,vnode:de}=f;{const Xe=ho(f);if(Xe){H&&(H.el=de.el,P(f,H,N)),Xe.asyncDep.then(()=>{He(()=>{f.isUnmounted||E()},T)});return}}let me=H,ke;Tt(f,!1),H?(H.el=de.el,P(f,H,N)):H=de,z&&En(z),(ke=H.props&&H.props.onVnodeBeforeUpdate)&&Ze(ke,ie,H,de),Tt(f,!0);const xe=wr(f),Je=f.subTree;f.subTree=xe,S(Je,xe,m(Je.el),An(Je),f,T,M),H.el=xe.el,me===null&&Xa(f,xe.el),Y&&He(Y,T),(ke=H.props&&H.props.onVnodeUpdated)&&He(()=>Ze(ke,ie,H,de),T)}else{let H;const{el:z,props:Y}=g,{bm:ie,m:de,parent:me,root:ke,type:xe}=f,Je=jt(g);Tt(f,!1),ie&&En(ie),!Je&&(H=Y&&Y.onVnodeBeforeMount)&&Ze(H,me,g),Tt(f,!0);{ke.ce&&ke.ce._hasShadowRoot()&&ke.ce._injectChildStyle(xe,f.parent?f.parent.type:void 0);const Xe=f.subTree=wr(f);S(null,Xe,b,O,f,T,M),g.el=Xe.el}if(de&&He(de,T),!Je&&(H=Y&&Y.onVnodeMounted)){const Xe=g;He(()=>Ze(H,me,Xe),T)}(g.shapeFlag&256||me&&jt(me.vnode)&&me.vnode.shapeFlag&256)&&f.a&&He(f.a,T),f.isMounted=!0,g=b=O=null}};f.scope.on();const B=f.effect=new hi(D);f.scope.off();const E=f.update=B.run.bind(B),q=f.job=B.runIfDirty.bind(B);q.i=f,q.id=f.uid,B.scheduler=()=>$s(q),Tt(f,!0),E()},P=(f,g,b)=>{g.component=f;const O=f.vnode.props;f.vnode=g,f.next=null,Za(f,g.props,O,b),sl(f,g.children,b),gt(),dr(f),pt()},I=(f,g,b,O,T,M,N,D,B=!1)=>{const E=f&&f.children,q=f?f.shapeFlag:0,H=g.children,{patchFlag:z,shapeFlag:Y}=g;if(z>0){if(z&128){A(E,H,b,O,T,M,N,D,B);return}else if(z&256){y(E,H,b,O,T,M,N,D,B);return}}Y&8?(q&16&&Ue(E,T,M),H!==E&&c(b,H)):q&16?Y&16?A(E,H,b,O,T,M,N,D,B):Ue(E,T,M,!0):(q&8&&c(b,""),Y&16&&be(H,b,O,T,M,N,D,B))},y=(f,g,b,O,T,M,N,D,B)=>{f=f||Nt,g=g||Nt;const E=f.length,q=g.length,H=Math.min(E,q);let z;for(z=0;z<H;z++){const Y=g[z]=B?ct(g[z]):rt(g[z]);S(f[z],Y,b,null,T,M,N,D,B)}E>q?Ue(f,T,M,!0,!1,H):be(g,b,O,T,M,N,D,B,H)},A=(f,g,b,O,T,M,N,D,B)=>{let E=0;const q=g.length;let H=f.length-1,z=q-1;for(;E<=H&&E<=z;){const Y=f[E],ie=g[E]=B?ct(g[E]):rt(g[E]);if(It(Y,ie))S(Y,ie,b,null,T,M,N,D,B);else break;E++}for(;E<=H&&E<=z;){const Y=f[H],ie=g[z]=B?ct(g[z]):rt(g[z]);if(It(Y,ie))S(Y,ie,b,null,T,M,N,D,B);else break;H--,z--}if(E>H){if(E<=z){const Y=z+1,ie=Y<q?g[Y].el:O;for(;E<=z;)S(null,g[E]=B?ct(g[E]):rt(g[E]),b,ie,T,M,N,D,B),E++}}else if(E>z)for(;E<=H;)X(f[E],T,M,!0),E++;else{const Y=E,ie=E,de=new Map;for(E=ie;E<=z;E++){const je=g[E]=B?ct(g[E]):rt(g[E]);je.key!=null&&de.set(je.key,E)}let me,ke=0;const xe=z-ie+1;let Je=!1,Xe=0;const Gt=new Array(xe);for(E=0;E<xe;E++)Gt[E]=0;for(E=Y;E<=H;E++){const je=f[E];if(ke>=xe){X(je,T,M,!0);continue}let Qe;if(je.key!=null)Qe=de.get(je.key);else for(me=ie;me<=z;me++)if(Gt[me-ie]===0&&It(je,g[me])){Qe=me;break}Qe===void 0?X(je,T,M,!0):(Gt[Qe-ie]=E+1,Qe>=Xe?Xe=Qe:Je=!0,S(je,g[Qe],b,null,T,M,N,D,B),ke++)}const rr=Je?al(Gt):Nt;for(me=rr.length-1,E=xe-1;E>=0;E--){const je=ie+E,Qe=g[je],ir=g[je+1],or=je+1<q?ir.el||mo(ir):O;Gt[E]===0?S(null,Qe,b,or,T,M,N,D,B):Je&&(me<0||E!==rr[me]?L(Qe,b,or,2):me--)}}},L=(f,g,b,O,T=null)=>{const{el:M,type:N,transition:D,children:B,shapeFlag:E}=f;if(E&6){L(f.component.subTree,g,b,O);return}if(E&128){f.suspense.move(g,b,O);return}if(E&64){N.move(f,g,b,qt);return}if(N===Z){r(M,g,b);for(let H=0;H<B.length;H++)L(B[H],g,b,O);r(f.anchor,g,b);return}if(N===gs){ne(f,g,b);return}if(O!==2&&E&1&&D)if(O===0)D.beforeEnter(M),r(M,g,b),He(()=>D.enter(M),T);else{const{leave:H,delayLeave:z,afterLeave:Y}=D,ie=()=>{f.ctx.isUnmounted?i(M):r(M,g,b)},de=()=>{M._isLeaving&&M[tt](!0),H(M,()=>{ie(),Y&&Y()})};z?z(M,ie,de):de()}else r(M,g,b)},X=(f,g,b,O=!1,T=!1)=>{const{type:M,props:N,ref:D,children:B,dynamicChildren:E,shapeFlag:q,patchFlag:H,dirs:z,cacheIndex:Y,memo:ie}=f;if(H===-2&&(T=!1),D!=null&&(gt(),an(D,null,b,f,!0),pt()),Y!=null&&(g.renderCache[Y]=void 0),q&256){g.ctx.deactivate(f);return}const de=q&1&&z,me=!jt(f);let ke;if(me&&(ke=N&&N.onVnodeBeforeUnmount)&&Ze(ke,g,f),q&6)Ke(f.component,b,O);else{if(q&128){f.suspense.unmount(b,O);return}de&&xt(f,null,g,"beforeUnmount"),q&64?f.type.remove(f,g,b,qt,O):E&&!E.hasOnce&&(M!==Z||H>0&&H&64)?Ue(E,g,b,!1,!0):(M===Z&&H&384||!T&&q&16)&&Ue(B,g,b),O&&ee(f)}const xe=ie!=null&&Y==null;(me&&(ke=N&&N.onVnodeUnmounted)||de||xe)&&He(()=>{ke&&Ze(ke,g,f),de&&xt(f,null,g,"unmounted"),xe&&(f.el=null)},b)},ee=f=>{const{type:g,el:b,anchor:O,transition:T}=f;if(g===Z){Pe(b,O);return}if(g===gs){V(f);return}const M=()=>{i(b),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(f.shapeFlag&1&&T&&!T.persisted){const{leave:N,delayLeave:D}=T,B=()=>N(b,M);D?D(f.el,M,B):B()}else M()},Pe=(f,g)=>{let b;for(;f!==g;)b=C(f),i(f),f=b;i(g)},Ke=(f,g,b)=>{const{bum:O,scope:T,job:M,subTree:N,um:D,m:B,a:E}=f;Cr(B),Cr(E),O&&En(O),T.stop(),M&&(M.flags|=8,X(N,f,g,b)),D&&He(D,g),He(()=>{f.isUnmounted=!0},g)},Ue=(f,g,b,O=!1,T=!1,M=0)=>{for(let N=M;N<f.length;N++)X(f[N],g,b,O,T)},An=f=>{if(f.shapeFlag&6)return An(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const g=C(f.anchor||f.el),b=g&&g[ka];return b?C(b):g};let is=!1;const sr=(f,g,b)=>{let O;f==null?g._vnode&&(X(g._vnode,null,null,!0),O=g._vnode.component):S(g._vnode||null,f,g,null,null,null,b),g._vnode=f,is||(is=!0,dr(O),Ii(),is=!1)},qt={p:S,um:X,m:L,r:ee,mt:v,mc:be,pc:I,pbc:se,n:An,o:e};return{render:sr,hydrate:void 0,createApp:za(sr)}}function ms({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 Tt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ol(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function fo(e,t,n=!1){const r=e.children,i=t.children;if(W(r)&&W(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]=ct(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&fo(o,a)),a.type===ts&&(a.patchFlag===-1&&(a=i[s]=ct(a)),a.el=o.el),a.type===Ie&&!a.el&&(a.el=o.el)}}function al(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(i=n[n.length-1],e[i]<d){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<d?s=a+1:o=a;d<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 ho(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ho(t)}function Cr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function mo(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?mo(t.subTree):null}const go=e=>e.__isSuspense;function ll(e,t){t&&t.pendingBranch?W(e)?t.effects.push(...e):t.effects.push(e):_a(e)}const Z=Symbol.for("v-fgt"),ts=Symbol.for("v-txt"),Ie=Symbol.for("v-cmt"),gs=Symbol.for("v-stc"),cn=[];let Ve=null;function h(e=!1){cn.push(Ve=e?null:[])}function cl(){cn.pop(),Ve=cn[cn.length-1]||null}let mn=1;function Nn(e,t=!1){mn+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function po(e){return e.dynamicChildren=mn>0?Ve||Nt:null,cl(),mn>0&&Ve&&Ve.push(e),e}function p(e,t,n,r,i,s){return po(u(e,t,n,r,i,s,!0))}function fe(e,t,n,r,i){return po(pe(e,t,n,r,i,!0))}function gn(e){return e?e.__v_isVNode===!0:!1}function It(e,t){return e.type===t.type&&e.key===t.key}const _o=({key:e})=>e??null,Rn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ye(e)||Ne(e)||Q(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===Z?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_o(t),ref:t&&Rn(t),scopeId:Pi,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:Me};return a?(Js(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=ye(n)?8:16),mn>0&&!o&&Ve&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Ve.push(l),l}const pe=ul;function ul(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Yi)&&(e=Ie),gn(e)){const a=St(e,t,!0);return n&&Js(a,n),mn>0&&!s&&Ve&&(a.shapeFlag&6?Ve[Ve.indexOf(e)]=a:Ve.push(a)),a.patchFlag=-2,a}if(wl(e)&&(e=e.__vccOpts),t){t=dl(t);let{class:a,style:l}=t;a&&!ye(a)&&(t.class=te(a)),ae(l)&&(Ws(l)&&!W(l)&&(l=Ae({},l)),t.style=Ce(l))}const o=ye(e)?1:go(e)?128:Di(e)?64:ae(e)?4:Q(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function dl(e){return e?Ws(e)||io(e)?Ae({},e):e:null}function St(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,d=t?Xs(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&_o(d),ref:t&&t.ref?n&&s?W(s)?s.concat(Rn(t)):[s,Rn(t)]:Rn(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!==Z?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&&St(e.ssContent),ssFallback:e.ssFallback&&St(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&hn(c,l.clone(c)),c}function ns(e=" ",t=0){return pe(ts,null,e,t)}function F(e="",t=!1){return t?(h(),fe(Ie,null,e)):pe(Ie,null,e)}function rt(e){return e==null||typeof e=="boolean"?pe(Ie):W(e)?pe(Z,null,e.slice()):gn(e)?ct(e):pe(ts,null,String(e))}function ct(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:St(e)}function Js(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(W(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Js(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!io(t)?t._ctx=Me:i===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Q(t)?(t={default:t,_ctx:Me},n=32):(t=String(t),r&64?(n=16,t=[ns(t)]):n=8);e.children=t,e.shapeFlag|=n}function Xs(...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=te([t.class,r.class]));else if(i==="style")t.style=Ce([t.style,r.style]);else if(Vn(i)){const s=t[i],o=r[i];o&&s!==o&&!(W(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!Kn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Ze(e,t,n,r=null){Ye(e,t,7,[n,r])}const fl=eo();let hl=0;function ml(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||fl,s={uid:hl++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Vo(!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:ao(r,i),emitsOptions:to(r,i),emit:null,emitted:null,propsDefaults:he,inheritAttrs:r.inheritAttrs,ctx:he,data:he,props:he,attrs:he,slots:he,refs:he,setupState:he,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 Le=null;const yo=()=>Le||Me;let Hn,Ls;{const e=qn(),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)}};Hn=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),Ls=t("__VUE_SSR_SETTERS__",n=>pn=n)}const Cn=e=>{const t=Le;return Hn(e),e.scope.on(),()=>{e.scope.off(),Hn(t)}},Sr=()=>{Le&&Le.scope.off(),Hn(null)};function vo(e){return e.vnode.shapeFlag&4}let pn=!1;function gl(e,t=!1,n=!1){t&&Ls(t);const{props:r,children:i}=e.vnode,s=vo(e);Qa(e,r,s,t),nl(e,i,n||t);const o=s?pl(e,t):void 0;return t&&Ls(!1),o}function pl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Da);const{setup:r}=n;if(r){gt();const i=e.setupContext=r.length>1?yl(e):null,s=Cn(e),o=kn(r,e,0,[e.props,i]),a=oi(o);if(pt(),s(),(a||e.sp)&&!jt(e)&&Ki(e),a){if(o.then(Sr,Sr),t)return o.then(l=>{Ar(e,l)}).catch(l=>{Jn(l,e,0)});e.asyncDep=o}else Ar(e,o)}else wo(e)}function Ar(e,t,n){Q(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=Mi(t)),wo(e)}function wo(e,t,n){const r=e.type;e.render||(e.render=r.render||it);{const i=Cn(e);gt();try{Na(e)}finally{pt(),i()}}}const _l={get(e,t){return Re(e,"get",""),e[t]}};function yl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,_l),slots:e.slots,emit:e.emit,expose:t}}function ss(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Mi(Ts(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ln)return ln[n](e)},has(t,n){return n in t||n in ln}})):e.proxy}function vl(e,t=!0){return Q(e)?e.displayName||e.name:e.name||t&&e.__name}function wl(e){return Q(e)&&"__vccOpts"in e}const bl=(e,t)=>fa(e,t,pn);function bo(e,t,n){try{Nn(-1);const r=arguments.length;return r===2?ae(t)&&!W(t)?gn(t)?pe(e,null,[t]):pe(e,t):pe(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&gn(n)&&(n=[n]),pe(e,t,n))}finally{Nn(1)}}const kl="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 Ps;const xr=typeof window<"u"&&window.trustedTypes;if(xr)try{Ps=xr.createPolicy("vue",{createHTML:e=>e})}catch{}const ko=Ps?e=>Ps.createHTML(e):e=>e,Cl="http://www.w3.org/2000/svg",Sl="http://www.w3.org/1998/Math/MathML",lt=typeof document<"u"?document:null,Tr=lt&<.createElement("template"),Al={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"?lt.createElementNS(Cl,e):t==="mathml"?lt.createElementNS(Sl,e):n?lt.createElement(e,{is:n}):lt.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>lt.createTextNode(e),createComment:e=>lt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>lt.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{Tr.innerHTML=ko(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Tr.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",Xt="animation",_n=Symbol("_vtc"),Co={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},xl=Ae({},Ni,Co),Tl=e=>(e.displayName="Transition",e.props=xl,e),Qs=Tl((e,{slots:t})=>wo(Aa,Ml(e),t)),Mt=(e,t=[])=>{W(e)?e.forEach(n=>n(...t)):e&&e(...t)},Mr=e=>e?W(e)?e.some(t=>t.length>1):e.length>1:!1;function Ml(e){const t={};for(const j in e)j in Co||(t[j]=e[j]);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:d=o,appearToClass:c=a,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,K=El(i),S=K&&K[0],J=K&&K[1],{onBeforeEnter:U,onEnter:$,onEnterCancelled:ne,onLeave:V,onLeaveCancelled:re,onBeforeAppear:ce=U,onAppear:_e=$,onAppearCancelled:we=ne}=t,G=(j,_,v,k)=>{j._enterCancelled=k,Et(j,_?c:a),Et(j,_?d:o),v&&v()},se=(j,_)=>{j._isLeaving=!1,Et(j,m),Et(j,b),Et(j,C),_&&_()},ue=j=>(_,v)=>{const k=j?_e:$,x=()=>G(_,j,v);Mt(k,[_,x]),Er(()=>{Et(_,j?l:s),at(_,j?c:a),Mr(k)||Or(_,r,S,x)})};return Ae(t,{onBeforeEnter(j){Mt(U,[j]),at(j,s),at(j,o)},onBeforeAppear(j){Mt(ce,[j]),at(j,l),at(j,d)},onEnter:ue(!1),onAppear:ue(!0),onLeave(j,_){j._isLeaving=!0;const v=()=>se(j,_);at(j,m),j._enterCancelled?(at(j,C),Lr(j)):(Lr(j),at(j,C)),Er(()=>{j._isLeaving&&(Et(j,m),at(j,b),Mr(V)||Or(j,r,J,v))}),Mt(V,[j,v])},onEnterCancelled(j){G(j,!1,void 0,!0),Mt(ne,[j])},onAppearCancelled(j){G(j,!0,void 0,!0),Mt(we,[j])},onLeaveCancelled(j){se(j),Mt(re,[j])}})}function El(e){if(e==null)return null;if(ae(e))return[ps(e.enter),ps(e.leave)];{const t=ps(e);return[t,t]}}function ps(e){return Po(e)}function at(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[_n]||(e[_n]=new Set)).add(t)}function Et(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[_n];n&&(n.delete(t),n.size||(e[_n]=void 0))}function Er(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Ol=0;function Or(e,t,n,r){const i=e._endId=++Ol,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Rl(e,t);if(!o)return r();const d=o+"end";let c=0;const m=()=>{e.removeEventListener(d,C),s()},C=b=>{b.target===e&&++c>=l&&m()};setTimeout(()=>{c<l&&m()},a+1),e.addEventListener(d,C)}function Rl(e,t){const n=window.getComputedStyle(e),r=K=>(n[K]||"").split(", "),i=r(`${vt}Delay`),s=r(`${vt}Duration`),o=Rr(i,s),a=r(`${Xt}Delay`),l=r(`${Xt}Duration`),d=Rr(a,l);let c=null,m=0,C=0;t===vt?o>0&&(c=vt,m=o,C=s.length):t===Xt?d>0&&(c=Xt,m=d,C=l.length):(m=Math.max(o,d),c=m>0?o>d?vt:Xt:null,C=c?c===vt?s.length:l.length:0);const b=c===vt&&/\b(?:transform|all)(?:,|$)/.test(r(`${vt}Property`).toString());return{type:c,timeout:m,propCount:C,hasTransform:b}}function Rr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ir(n)+Ir(e[r])))}function Ir(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Lr(e){return(e?e.ownerDocument:document).body.offsetHeight}function Il(e,t,n){const r=e[_n];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Pr=Symbol("_vod"),Ll=Symbol("_vsh"),Pl=Symbol(""),Bl=/(?:^|;)\s*display\s*:/;function Fl(e,t,n){const r=e.style,i=ye(n);let s=!1;if(n&&!i){if(t)if(ye(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&tn(r,a,"")}else for(const o in t)n[o]==null&&tn(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Nl(e,o,!ye(t)&&t?t[o]:void 0,a)||tn(r,o,a):tn(r,o,"")}}else if(i){if(t!==n){const o=r[Pl];o&&(n+=";"+o),r.cssText=n,s=Bl.test(n)}}else t&&e.removeAttribute("style");Pr in e&&(e[Pr]=s?r.display:"",e[Ll]&&(r.display="none"))}const Br=/\s*!important$/;function tn(e,t,n){if(W(n))n.forEach(r=>tn(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Dl(e,t);Br.test(n)?e.setProperty(At(r),n.replace(Br,""),"important"):e[r]=n}}const Fr=["Webkit","Moz","ms"],_s={};function Dl(e,t){const n=_s[t];if(n)return n;let r=De(t);if(r!=="filter"&&r in e)return _s[t]=r;r=Wn(r);for(let i=0;i<Fr.length;i++){const s=Fr[i]+r;if(s in e)return _s[t]=s}return t}function Nl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&ye(r)&&n===r}const Dr="http://www.w3.org/1999/xlink";function Nr(e,t,n,r,i,s=Uo(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Dr,t.slice(6,t.length)):e.setAttributeNS(Dr,t,n):n==null||s&&!ui(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Ge(n)?String(n):n)}function Hr(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ko(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=ui(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 Hl(e,t,n,r){e.removeEventListener(t,n,r)}const Ur=Symbol("_vei");function Ul(e,t,n,r,i=null){const s=e[Ur]||(e[Ur]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=jl(t);if(r){const d=s[t]=zl(r,i);wt(e,a,d,l)}else o&&(Hl(e,a,o,l),s[t]=void 0)}}const jr=/(?:Once|Passive|Capture)$/;function jl(e){let t;if(jr.test(e)){t={};let r;for(;r=e.match(jr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):At(e.slice(2)),t]}let ys=0;const Vl=Promise.resolve(),Kl=()=>ys||(Vl.then(()=>ys=0),ys=Date.now());function zl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Ye(Wl(r,n.value),t,5,[r])};return n.value=e,n.attached=Kl(),n}function Wl(e,t){if(W(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 Vr=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"?Il(e,r,o):t==="style"?Fl(e,n,r):Vn(t)?Kn(t)||Ul(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ql(e,t,r,o))?(Hr(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Nr(e,t,r,o,s,t!=="value")):e._isVueCE&&(Gl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ye(r)))?Hr(e,De(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Nr(e,t,r,o))};function ql(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Vr(t)&&Q(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 Vr(t)&&ye(n)?!1:t in e}function Gl(e,t){const n=e._def.props;if(!n)return!1;const r=De(t);return Array.isArray(n)?n.some(i=>De(i)===r):Object.keys(n).some(i=>De(i)===r)}const zt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return W(t)?n=>En(t,n):t};function Yl(e){e.target.composing=!0}function Kr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function zr(e,t,n){return t&&(e=e.trim()),n&&(e=$n(e)),e}const kt={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[mt]=zt(i);const s=r||i.props&&i.props.type==="number";wt(e,t?"change":"input",o=>{o.target.composing||e[mt](zr(e.value,n,s))}),(n||s)&&wt(e,"change",()=>{e.value=zr(e.value,n,s)}),t||(wt(e,"compositionstart",Yl),wt(e,"compositionend",Kr),wt(e,"change",Kr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[mt]=zt(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?$n(e.value):e.value,l=t??"";if(a===l)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},Jl={deep:!0,created(e,t,n){e[mt]=zt(n),wt(e,"change",()=>{const r=e._modelValue,i=yn(e),s=e.checked,o=e[mt];if(W(r)){const a=Hs(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const d=[...r];d.splice(a,1),o(d)}}else if(Wt(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(So(e,s))})},mounted:Wr,beforeUpdate(e,t,n){e[mt]=zt(n),Wr(e,t,n)}};function Wr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(W(t))i=Hs(t,r.props.value)>-1;else if(Wt(t))i=t.has(r.props.value);else{if(t===n)return;i=$t(t,So(e,!0))}e.checked!==i&&(e.checked=i)}const Xl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=Wt(t);wt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?$n(yn(o)):yn(o));e[mt](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,Oi(()=>{e._assigning=!1})}),e[mt]=zt(r)},mounted(e,{value:t}){$r(e,t)},beforeUpdate(e,t,n){e[mt]=zt(n)},updated(e,{value:t}){e._assigning||$r(e,t)}};function $r(e,t){const n=e.multiple,r=W(t);if(!(n&&!r&&!Wt(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=yn(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(d=>String(d)===String(a)):o.selected=Hs(t,a)>-1}else o.selected=t.has(a);else if($t(yn(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function yn(e){return"_value"in e?e._value:e.value}function So(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ql=["ctrl","shift","alt","meta"],Zl={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)=>Ql.some(n=>e[`${n}Key`]&&!t.includes(n))},We=(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=Zl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},ec={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Un=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=At(i.key);if(t.some(o=>o===s||ec[o]===s))return e(i)})},tc=Ae({patchProp:$l},Al);let qr;function nc(){return qr||(qr=rl(tc))}const sc=(...e)=>{const t=nc().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=ic(r);if(!i)return;const s=t._component;!Q(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,rc(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function rc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ic(e){return ye(e)?document.querySelector(e):e}const oc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],vs="/client",ac=5*60*1e3,lc=15*1e3,cc=10*60*1e3,uc=5*60*1e3;function dc(e){const t={baseUrl:fc(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(y,A){return t.listeners.has(y)||t.listeners.set(y,new Set),t.listeners.get(y).add(A),()=>t.listeners.get(y).delete(A)}function r(y,A){const L=t.listeners.get(y);L&&L.forEach(X=>{try{X(A)}catch(ee){console.error("[transport] listener",y,ee)}})}function i(y){t.connection!==y&&(t.connection=y,r("connection",y))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId,...t.origin?{"X-Parent-Origin":t.origin}:{}}}async function o(y,A,L){const X=await fetch(`${t.baseUrl}${vs}${A}`,{method:y,credentials:"include",headers:s(),body:L!==void 0?JSON.stringify(L):void 0});if(!X.ok){const ee=await a(X),Pe=new Error(`HTTP ${X.status} ${y} ${A} :: ${(ee==null?void 0:ee.error)||X.statusText}`);throw Pe.status=X.status,Pe.body=ee,Pe}return X.status===204?null:X.json()}async function a(y){try{return await y.json()}catch{return null}}async function l(y){if(t.started)return t.lastBootstrap;if(!(y!=null&&y.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=y.origin,t.token=y.token||"";const A=await fetch(`${t.baseUrl}${vs}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{},allowUnauthenticated:y.allowUnauthenticated===!0,...y.variables&&typeof y.variables=="object"?{variables:y.variables}:{}})});if(!A.ok){const Ke=await a(A),Ue=new Error(`Session bootstrap failed: HTTP ${A.status} :: ${(Ke==null?void 0:Ke.error)||A.statusText}`);throw Ue.status=A.status,Ue.body=Ke,Ue}const L=await A.json();t.userId=L.external_id;const[X,ee]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async Ke=>{if(!Ke.ok){const Ue=await a(Ke);throw new Error(`HTTP ${Ke.status} GET /widgets/:id/config :: ${(Ue==null?void 0:Ue.error)||Ke.statusText}`)}return Ke.json()}),o("GET","/customers/me")]),Pe={config:X,customer:(ee==null?void 0:ee.customer)??null};return t.lastBootstrap=Pe,await d(),typeof document<"u"&&(t.visibilityHandler=k,document.addEventListener("visibilitychange",t.visibilityHandler)),_(),Pe}async function d(){try{const y=await C();t.lastActivityAt=y.reduce((A,L)=>{const X=L==null?void 0:L.last_message_at;return X&&(!A||X>A)?X:A},null)}catch(y){console.error("[transport] initial /conversations failed",y)}}async function c(){const y=await o("GET","/customers/me");return(y==null?void 0:y.customer)??null}async function m(y){const A=await o("PATCH","/customers/me",y);return(A==null?void 0:A.customer)??null}async function C(){const y=await o("GET","/conversations");return(y==null?void 0:y.conversations)??[]}async function b(y={}){return(await o("POST","/conversations",y)).conversation}async function K(y){return(await o("GET",`/conversations/${encodeURIComponent(y)}`)).conversation}async function S(y,A){return(await o("PATCH",`/conversations/${encodeURIComponent(y)}`,A)).conversation}async function J(y,A){return o("PATCH",`/conversations/${encodeURIComponent(y)}/read`,{message_id:A})}async function U(y,A={}){const L=new URLSearchParams;A.before&&L.set("before",A.before),A.since&&L.set("since",A.since),A.limit&&L.set("limit",String(A.limit));const X=L.toString()?`?${L.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(y)}/messages${X}`)}async function $(y,A){se();const L={client_msg_id:A.client_msg_id,type:"content",text_md:A.text_md,author:{id:t.userId,type:"user"},created_at:A.created_at||new Date().toISOString()};return Array.isArray(A.attachments)&&A.attachments.length&&(L.payload={type:"content",attachments:A.attachments}),A.metadata&&typeof A.metadata=="object"&&(L.metadata=A.metadata),t.currentContext&&Object.keys(t.currentContext).length>0&&(L.context=t.currentContext),o("POST",`/conversations/${encodeURIComponent(y)}/messages`,L)}async function ne(y,A,L){return se(),o("POST",`/messages/${encodeURIComponent(y)}/callbacks/${encodeURIComponent(A)}`,L?{inputs:L}:{})}async function V(y){const A=y.name||"attachment",L=y.type||"application/octet-stream",X=y.size||0,ee=await o("POST","/attachments",{mime_type:L,size_bytes:X,name:A}),Pe=await fetch(ee.upload_url,{method:"PUT",headers:{"Content-Type":L},body:y});if(!Pe.ok)throw new Error(`HTTP ${Pe.status} PUT signed upload`);return{type:hc(L),path:ee.path,mime_type:L,size_bytes:X}}async function re(y){return o("GET",`/attachments/sign?path=${encodeURIComponent(y)}`)}function ce(){const y=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${vs}/stream?${y}`}function _e(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const y=new EventSource(ce(),{withCredentials:!0});for(const A of oc)y.addEventListener(A,L=>we(A,L.data));y.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=y,i("open")}catch(y){console.error("[transport] SSE open failed",y),r("error",y)}}function we(y,A){try{const L=JSON.parse(A),X=L&&typeof L=="object"&&"data"in L?L.data:L;r(y,X)}catch(L){console.error("[transport] bad SSE payload",y,L)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function se(){clearTimeout(t.burstTimer),_e(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},cc))}function ue(y){const A=t.panelOpen;t.panelOpen=!!y,t.panelOpen?(clearTimeout(t.burstTimer),_e()):se(),A!==t.panelOpen&&_()}async function j(){try{const y=await C(),A=y.reduce((X,ee)=>{const Pe=ee==null?void 0:ee.last_message_at;return Pe&&(!X||Pe>X)?Pe:X},null);A&&(!t.lastActivityAt||A>t.lastActivityAt)&&(t.lastActivityAt=A,r("activity",{conversations:y,latestAt:A}),se())}catch(y){console.error("[transport] poll failed",y)}}function _(){if(v(),typeof document<"u"&&document.hidden)return;const y=t.panelOpen?lc:ac;t.pollTimer=setInterval(j,y)}function v(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function k(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(v(),G(),i("paused"))},uc);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),_(),t.panelOpen&&_e()}}function x(){v(),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 P(y){return!y||typeof y!="object"?null:o("POST","/update",y)}function I(y){if(!(!y||typeof y!="object"))for(const[A,L]of Object.entries(y)){if(L===null){delete t.currentContext[A];continue}typeof L=="object"&&!Array.isArray(L)&&(t.currentContext[A]={...L})}}return{on:n,start:l,stop:x,setPanelOpen:ue,update:P,context:I,getCustomer:c,patchCustomer:m,listConversations:C,createConversation:b,getConversation:K,patchConversation:S,markConversationRead:J,listMessages:U,postMessage:$,postCallback:ne,uploadAttachment:V,signAttachment:re,get connection(){return t.connection}}}function fc(e){return e.endsWith("/")?e.slice(0,-1):e}function hc(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function mc(){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 gc(e){const t=Yn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",_=>{t.connection=_})),n.push(e.on("message",_=>{const v=_==null?void 0:_.conversation_id,k=_==null?void 0:_.message;!v||!(k!=null&&k.id)||(ce(v,k),k.client_msg_id&&delete t.streamingByMsgId[k.client_msg_id],G(v,k.created_at))})),n.push(e.on("message_stream",_=>{const v=_==null?void 0:_.message_id,k=_==null?void 0:_.token;!v||typeof k!="string"||(t.streamingByMsgId[v]=(t.streamingByMsgId[v]||"")+k)})),n.push(e.on("conversation_updated",_=>{const v=_==null?void 0:_.conversation_id,k=_==null?void 0:_.changes;if(!v||!k)return;const x=t.conversations.findIndex(P=>P.id===v);x!==-1&&(t.conversations[x]={...t.conversations[x],...k})})),n.push(e.on("config_updated",_=>{_!=null&&_.config&&(t.config=_.config)})),n.push(e.on("action_status",_=>{const v=_==null?void 0:_.conversation_id,k=_==null?void 0:_.action_id,x=_==null?void 0:_.action_name;if(!v||!k)return;const P=t.runningActionsByConv[v]||{};_.state==="running"?(P[k]=x||k,t.runningActionsByConv[v]={...P}):_.state==="done"&&(delete P[k],t.runningActionsByConv[v]={...P})})),n.push(e.on("activity",_=>{Array.isArray(_==null?void 0:_.conversations)&&(t.conversations=_.conversations)}));async function r(_){try{const v=new Promise((x,P)=>setTimeout(()=>P(new Error("bootstrap timeout (15s) โ check baseUrl, CORS, and network")),15e3)),k=await Promise.race([e.start(_),v]);t.config=k.config,t.customer=k.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 _ of n)try{_()}catch{}e.stop()}async function s(_){const v=ue(_);if(!v)return t.customer;try{const k=await e.patchCustomer(v);k&&(t.customer=k)}catch(k){console.error("[store] applyCustomer failed",k)}return t.customer}async function o(_={}){const v=await e.createConversation(_),k=t.conversations.findIndex(x=>x.id===v.id);return k===-1?t.conversations=[v,...t.conversations]:t.conversations[k]=v,v}const a=50;async function l(_){const v=t.paginationByConv[_];if(!(v!=null&&v.loaded||v!=null&&v.loading)){c(_,{nextCursor:null,loading:!0,loaded:!1});try{const k=await e.listMessages(_,{limit:a}),x=(k==null?void 0:k.messages)??[],P=t.messagesByConv[_]||[],I=new Set;for(const A of x)(A==null?void 0:A.id)!=null&&I.add(`id:${String(A.id)}`),A!=null&&A.client_msg_id&&I.add(`c:${A.client_msg_id}`);const y=P.filter(A=>!((A==null?void 0:A.id)!=null&&I.has(`id:${String(A.id)}`)||A!=null&&A.client_msg_id&&I.has(`c:${A.client_msg_id}`)));t.messagesByConv[_]=[...x,...y].sort(se),c(_,{nextCursor:(k==null?void 0:k.next_cursor)??null,loading:!1,loaded:!0})}catch(k){console.error("[store] openConversation failed",k),c(_,{nextCursor:null,loading:!1,loaded:!1})}}}async function d(_){var P;const v=t.paginationByConv[_];if(!v||v.loading||!v.nextCursor)return;const x=(P=(t.messagesByConv[_]||[]).find(I=>I==null?void 0:I.created_at))==null?void 0:P.created_at;if(x){c(_,{...v,loading:!0});try{const I=await e.listMessages(_,{before:x,limit:a}),y=(I==null?void 0:I.messages)??[],A=t.messagesByConv[_]||[],L=new Set;for(const ee of A)(ee==null?void 0:ee.id)!=null&&L.add(`id:${String(ee.id)}`),ee!=null&&ee.client_msg_id&&L.add(`c:${ee.client_msg_id}`);const X=y.filter(ee=>!((ee==null?void 0:ee.id)!=null&&L.has(`id:${String(ee.id)}`)||ee!=null&&ee.client_msg_id&&L.has(`c:${ee.client_msg_id}`)));t.messagesByConv[_]=[...X,...A],c(_,{nextCursor:(I==null?void 0:I.next_cursor)??null,loading:!1,loaded:!0})}catch(I){console.error("[store] loadMore failed",I),c(_,{...v,loading:!1})}}}function c(_,v){t.paginationByConv={...t.paginationByConv,[_]:v}}async function m(_,v){const k=await e.patchConversation(_,v),x=t.conversations.findIndex(P=>P.id===_);x!==-1&&(t.conversations[x]=k)}async function C(_){if(!_)return[];const v=t.messagesByConv[_]||[];let k="";for(const x of v)x!=null&&x.created_at&&x.created_at>k&&(k=x.created_at);try{const x=await e.listMessages(_,k?{since:k}:{}),P=(x==null?void 0:x.messages)||[];if(!P.length)return[];const I=new Set,y=new Set;for(const L of v)(L==null?void 0:L.id)!=null&&I.add(String(L.id)),L!=null&&L.client_msg_id&&y.add(L.client_msg_id);const A=[];for(const L of P){const X=(L==null?void 0:L.id)!=null&&I.has(String(L.id))||(L==null?void 0:L.client_msg_id)&&y.has(L.client_msg_id);ce(_,L),X||A.push(L)}return A}catch(x){return console.error("[store] fetchSinceLast failed",x),[]}}async function b(_,v){if(!(!_||v==null))try{const k=await e.markConversationRead(_,v),x=(k==null?void 0:k.last_read_message_id)??v,P=t.conversations.findIndex(I=>(I==null?void 0:I.id)===_);P!==-1&&(t.conversations[P]={...t.conversations[P],last_read_message_id:x})}catch(k){console.error("[store] markConversationRead failed",k)}}async function K(_,v,{attachments:k,metadata:x}={}){var X;const P=(v||"").trim(),I=Array.isArray(k)&&k.length>0;if(!_||!P&&!I)return;const y=mc(),A=j(_),L={id:y,client_msg_id:y,conversation_id:_,type:"content",text_md:P,author:{type:"user",id:((X=t.customer)==null?void 0:X.external_id)||null},created_at:A,_pending:!0,...I?{payload:{type:"content",attachments:k}}:{},...x&&typeof x=="object"?{metadata:x}:{}};ce(_,L);try{await e.postMessage(_,{client_msg_id:y,text_md:P,created_at:A,...I?{attachments:k}:{},...x&&typeof x=="object"?{metadata:x}:{}})}catch(ee){console.error("[store] send failed",ee),we(_,y,{_failed:!0,_pending:!1})}}async function S(_,v,k){_!=null&&(t.awaitingCallback[_]=!0);try{await e.postCallback(_,v,k)}catch(x){console.error("[store] callback failed",x),_!=null&&delete t.awaitingCallback[_]}}const J=new Map;async function U(_){if(!_)return null;const v=J.get(_);if(v!=null&&v.url){const k=v.expires_at?Date.parse(v.expires_at):0;if(!k||k-Date.now()>6e4)return v.url}try{const k=await e.signAttachment(_);if(k!=null&&k.signed_url)return J.set(_,{url:k.signed_url,expires_at:k.expires_at}),k.signed_url}catch(k){console.error("[store] sign attachment failed",k)}return null}async function $(_,{rating:v,comment:k}={}){const x=t.conversations.find(y=>y.id===_),I={...(x==null?void 0:x.metadata)||{},feedback:{rating:v,comment:k||null,submitted_at:new Date().toISOString()}};await m(_,{metadata:I})}function ne(_){var k,x;const v=t.messagesByConv[_]||[];for(let P=v.length-1;P>=0;P--){const I=v[P];if(((k=I==null?void 0:I.author)==null?void 0:k.type)==="user"||(I==null?void 0:I.type)==="action"&&((x=I==null?void 0:I.payload)==null?void 0:x.state)==="pending")return null;const y=Array.isArray(I==null?void 0:I.callbacks)?I.callbacks.find(A=>(A==null?void 0:A.intent)==="submit_form"):null;if(y&&Array.isArray(y.inputs)&&y.inputs.length>0)return{message:I,form:{title:y.title||"",description:y.description||null,submit_label:y.label||null,fields:y.inputs}}}return null}function V(_){const v=t.runningActionsByConv[_];if(!v)return null;const k=Object.keys(v);if(k.length===0)return null;const x=k[0];return{id:x,payload:{name:v[x]}}}function re(_){var k,x,P;const v=t.messagesByConv[_]||[];for(let I=v.length-1;I>=0;I--){const y=v[I];if(((k=y==null?void 0:y.author)==null?void 0:k.type)==="user")return[];if((y==null?void 0:y.type)==="action"&&((x=y==null?void 0:y.payload)==null?void 0:x.state)==="pending")return[];if(((P=y==null?void 0:y.author)==null?void 0:P.type)!=="agent_ia")continue;const A=Array.isArray(y==null?void 0:y.callbacks)?y.callbacks.filter(L=>(L==null?void 0:L.intent)==="send_message"&&(L.render??"inline")==="inline"):[];return A.length?A.map(L=>typeof L.label=="string"&&L.label.trim()?{label:L.label.trim(),kind:null}:null).filter(Boolean).slice(0,4):[]}return[]}function ce(_,v){var I;const k=t.messagesByConv[_]||[];let x=-1;v!=null&&v.client_msg_id&&(x=k.findIndex(y=>(y==null?void 0:y.client_msg_id)&&y.client_msg_id===v.client_msg_id)),x===-1&&(v==null?void 0:v.id)!==void 0&&(v==null?void 0:v.id)!==null&&(x=k.findIndex(y=>_e(y==null?void 0:y.id,v.id)));let P;x===-1?P=[...k,v].sort(se):(P=k.slice(),P[x]={...k[x],...v,_pending:!1,_failed:!1}),t.messagesByConv[_]=P,(v==null?void 0:v.type)==="action"&&((I=v==null?void 0:v.payload)!=null&&I.state)&&v.payload.state!=="pending"&&(v==null?void 0:v.id)!=null&&t.awaitingCallback[v.id]&&delete t.awaitingCallback[v.id]}function _e(_,v){return _===v?!0:_==null||v==null?!1:String(_)===String(v)}function we(_,v,k){const x=t.messagesByConv[_];if(!x)return;const P=x.findIndex(y=>y.id===v);if(P===-1)return;const I=x.slice();I[P]={...x[P],...k},t.messagesByConv[_]=I}function G(_,v){const k=t.conversations.findIndex(P=>P.id===_);if(k===-1)return;const x=t.conversations[k];if(v&&(!x.last_message_at||v>x.last_message_at)){const P=t.conversations.slice();P[k]={...x,last_message_at:v},P.sort((I,y)=>(y.last_message_at||"").localeCompare(I.last_message_at||"")),t.conversations=P}}function se(_,v){return(_.created_at||"").localeCompare(v.created_at||"")}function ue(_){if(!_||typeof _!="object")return null;const v={},k={};for(const[x,P]of Object.entries(_))P!==void 0&&(x==="name"||x==="email"||x==="language"?P!=null&&String(P).trim()!==""&&(v[x]=P):(x==="values"||x==="metadata")&&P&&typeof P=="object"?Object.assign(k,P):k[x]=P);return Object.keys(k).length&&(v.values=k),Object.keys(v).length?v:null}function j(_){const v=t.messagesByConv[_]||[];let k="";for(const I of v)I!=null&&I.created_at&&I.created_at>k&&(k=I.created_at);const x=new Date().toISOString();return!k||x>k?x:new Date(Date.parse(k)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:d,fetchSinceLast:C,patchConversation:m,markConversationRead:b,send:K,clickCallback:S,signAttachment:U,submitFeedback:$,getActionInFlight:V,getLatestSuggestions:re,getLatestForm:ne,setPanelOpen:e.setPanelOpen}}const Oe={w:"#ffffff",g50:"#F9F9F7",g100:"#F5F5F5",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},bs=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function Zs(e=""){return e?bs[e.charCodeAt(0)%bs.length]:bs[0]}function er(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function Bs(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const Ao=`
|
|
17
|
+
**/let Ps;const xr=typeof window<"u"&&window.trustedTypes;if(xr)try{Ps=xr.createPolicy("vue",{createHTML:e=>e})}catch{}const ko=Ps?e=>Ps.createHTML(e):e=>e,Cl="http://www.w3.org/2000/svg",Sl="http://www.w3.org/1998/Math/MathML",lt=typeof document<"u"?document:null,Tr=lt&<.createElement("template"),Al={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"?lt.createElementNS(Cl,e):t==="mathml"?lt.createElementNS(Sl,e):n?lt.createElement(e,{is:n}):lt.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>lt.createTextNode(e),createComment:e=>lt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>lt.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{Tr.innerHTML=ko(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Tr.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",Xt="animation",_n=Symbol("_vtc"),Co={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},xl=Ae({},Ni,Co),Tl=e=>(e.displayName="Transition",e.props=xl,e),Qs=Tl((e,{slots:t})=>bo(Aa,Ml(e),t)),Mt=(e,t=[])=>{W(e)?e.forEach(n=>n(...t)):e&&e(...t)},Mr=e=>e?W(e)?e.some(t=>t.length>1):e.length>1:!1;function Ml(e){const t={};for(const j in e)j in Co||(t[j]=e[j]);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:d=o,appearToClass:c=a,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:C=`${n}-leave-active`,leaveToClass:w=`${n}-leave-to`}=e,K=El(i),S=K&&K[0],J=K&&K[1],{onBeforeEnter:U,onEnter:$,onEnterCancelled:ne,onLeave:V,onLeaveCancelled:re,onBeforeAppear:ce=U,onAppear:_e=$,onAppearCancelled:be=ne}=t,G=(j,_,v,k)=>{j._enterCancelled=k,Et(j,_?c:a),Et(j,_?d:o),v&&v()},se=(j,_)=>{j._isLeaving=!1,Et(j,m),Et(j,w),Et(j,C),_&&_()},ue=j=>(_,v)=>{const k=j?_e:$,x=()=>G(_,j,v);Mt(k,[_,x]),Er(()=>{Et(_,j?l:s),at(_,j?c:a),Mr(k)||Or(_,r,S,x)})};return Ae(t,{onBeforeEnter(j){Mt(U,[j]),at(j,s),at(j,o)},onBeforeAppear(j){Mt(ce,[j]),at(j,l),at(j,d)},onEnter:ue(!1),onAppear:ue(!0),onLeave(j,_){j._isLeaving=!0;const v=()=>se(j,_);at(j,m),j._enterCancelled?(at(j,C),Lr(j)):(Lr(j),at(j,C)),Er(()=>{j._isLeaving&&(Et(j,m),at(j,w),Mr(V)||Or(j,r,J,v))}),Mt(V,[j,v])},onEnterCancelled(j){G(j,!1,void 0,!0),Mt(ne,[j])},onAppearCancelled(j){G(j,!0,void 0,!0),Mt(be,[j])},onLeaveCancelled(j){se(j),Mt(re,[j])}})}function El(e){if(e==null)return null;if(ae(e))return[ps(e.enter),ps(e.leave)];{const t=ps(e);return[t,t]}}function ps(e){return Po(e)}function at(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[_n]||(e[_n]=new Set)).add(t)}function Et(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[_n];n&&(n.delete(t),n.size||(e[_n]=void 0))}function Er(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Ol=0;function Or(e,t,n,r){const i=e._endId=++Ol,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=Rl(e,t);if(!o)return r();const d=o+"end";let c=0;const m=()=>{e.removeEventListener(d,C),s()},C=w=>{w.target===e&&++c>=l&&m()};setTimeout(()=>{c<l&&m()},a+1),e.addEventListener(d,C)}function Rl(e,t){const n=window.getComputedStyle(e),r=K=>(n[K]||"").split(", "),i=r(`${vt}Delay`),s=r(`${vt}Duration`),o=Rr(i,s),a=r(`${Xt}Delay`),l=r(`${Xt}Duration`),d=Rr(a,l);let c=null,m=0,C=0;t===vt?o>0&&(c=vt,m=o,C=s.length):t===Xt?d>0&&(c=Xt,m=d,C=l.length):(m=Math.max(o,d),c=m>0?o>d?vt:Xt:null,C=c?c===vt?s.length:l.length:0);const w=c===vt&&/\b(?:transform|all)(?:,|$)/.test(r(`${vt}Property`).toString());return{type:c,timeout:m,propCount:C,hasTransform:w}}function Rr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Ir(n)+Ir(e[r])))}function Ir(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Lr(e){return(e?e.ownerDocument:document).body.offsetHeight}function Il(e,t,n){const r=e[_n];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Pr=Symbol("_vod"),Ll=Symbol("_vsh"),Pl=Symbol(""),Bl=/(?:^|;)\s*display\s*:/;function Fl(e,t,n){const r=e.style,i=ye(n);let s=!1;if(n&&!i){if(t)if(ye(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&tn(r,a,"")}else for(const o in t)n[o]==null&&tn(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Nl(e,o,!ye(t)&&t?t[o]:void 0,a)||tn(r,o,a):tn(r,o,"")}}else if(i){if(t!==n){const o=r[Pl];o&&(n+=";"+o),r.cssText=n,s=Bl.test(n)}}else t&&e.removeAttribute("style");Pr in e&&(e[Pr]=s?r.display:"",e[Ll]&&(r.display="none"))}const Br=/\s*!important$/;function tn(e,t,n){if(W(n))n.forEach(r=>tn(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Dl(e,t);Br.test(n)?e.setProperty(At(r),n.replace(Br,""),"important"):e[r]=n}}const Fr=["Webkit","Moz","ms"],_s={};function Dl(e,t){const n=_s[t];if(n)return n;let r=De(t);if(r!=="filter"&&r in e)return _s[t]=r;r=Wn(r);for(let i=0;i<Fr.length;i++){const s=Fr[i]+r;if(s in e)return _s[t]=s}return t}function Nl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&ye(r)&&n===r}const Dr="http://www.w3.org/1999/xlink";function Nr(e,t,n,r,i,s=Uo(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Dr,t.slice(6,t.length)):e.setAttributeNS(Dr,t,n):n==null||s&&!ui(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Ge(n)?String(n):n)}function Hr(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ko(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=ui(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 bt(e,t,n,r){e.addEventListener(t,n,r)}function Hl(e,t,n,r){e.removeEventListener(t,n,r)}const Ur=Symbol("_vei");function Ul(e,t,n,r,i=null){const s=e[Ur]||(e[Ur]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=jl(t);if(r){const d=s[t]=zl(r,i);bt(e,a,d,l)}else o&&(Hl(e,a,o,l),s[t]=void 0)}}const jr=/(?:Once|Passive|Capture)$/;function jl(e){let t;if(jr.test(e)){t={};let r;for(;r=e.match(jr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):At(e.slice(2)),t]}let ys=0;const Vl=Promise.resolve(),Kl=()=>ys||(Vl.then(()=>ys=0),ys=Date.now());function zl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Ye(Wl(r,n.value),t,5,[r])};return n.value=e,n.attached=Kl(),n}function Wl(e,t){if(W(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 Vr=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"?Il(e,r,o):t==="style"?Fl(e,n,r):Vn(t)?Kn(t)||Ul(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ql(e,t,r,o))?(Hr(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Nr(e,t,r,o,s,t!=="value")):e._isVueCE&&(Gl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ye(r)))?Hr(e,De(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Nr(e,t,r,o))};function ql(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Vr(t)&&Q(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 Vr(t)&&ye(n)?!1:t in e}function Gl(e,t){const n=e._def.props;if(!n)return!1;const r=De(t);return Array.isArray(n)?n.some(i=>De(i)===r):Object.keys(n).some(i=>De(i)===r)}const zt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return W(t)?n=>En(t,n):t};function Yl(e){e.target.composing=!0}function Kr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function zr(e,t,n){return t&&(e=e.trim()),n&&(e=$n(e)),e}const kt={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[mt]=zt(i);const s=r||i.props&&i.props.type==="number";bt(e,t?"change":"input",o=>{o.target.composing||e[mt](zr(e.value,n,s))}),(n||s)&&bt(e,"change",()=>{e.value=zr(e.value,n,s)}),t||(bt(e,"compositionstart",Yl),bt(e,"compositionend",Kr),bt(e,"change",Kr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[mt]=zt(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?$n(e.value):e.value,l=t??"";if(a===l)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},Jl={deep:!0,created(e,t,n){e[mt]=zt(n),bt(e,"change",()=>{const r=e._modelValue,i=yn(e),s=e.checked,o=e[mt];if(W(r)){const a=Hs(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const d=[...r];d.splice(a,1),o(d)}}else if(Wt(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(So(e,s))})},mounted:Wr,beforeUpdate(e,t,n){e[mt]=zt(n),Wr(e,t,n)}};function Wr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(W(t))i=Hs(t,r.props.value)>-1;else if(Wt(t))i=t.has(r.props.value);else{if(t===n)return;i=$t(t,So(e,!0))}e.checked!==i&&(e.checked=i)}const Xl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=Wt(t);bt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?$n(yn(o)):yn(o));e[mt](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,Oi(()=>{e._assigning=!1})}),e[mt]=zt(r)},mounted(e,{value:t}){$r(e,t)},beforeUpdate(e,t,n){e[mt]=zt(n)},updated(e,{value:t}){e._assigning||$r(e,t)}};function $r(e,t){const n=e.multiple,r=W(t);if(!(n&&!r&&!Wt(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=yn(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(d=>String(d)===String(a)):o.selected=Hs(t,a)>-1}else o.selected=t.has(a);else if($t(yn(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function yn(e){return"_value"in e?e._value:e.value}function So(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ql=["ctrl","shift","alt","meta"],Zl={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)=>Ql.some(n=>e[`${n}Key`]&&!t.includes(n))},We=(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=Zl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},ec={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Un=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=At(i.key);if(t.some(o=>o===s||ec[o]===s))return e(i)})},tc=Ae({patchProp:$l},Al);let qr;function nc(){return qr||(qr=rl(tc))}const sc=(...e)=>{const t=nc().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=ic(r);if(!i)return;const s=t._component;!Q(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,rc(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function rc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ic(e){return ye(e)?document.querySelector(e):e}const oc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],vs="/client",ac=5*60*1e3,lc=15*1e3,cc=10*60*1e3,uc=5*60*1e3;function dc(e){const t={baseUrl:fc(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(y,A){return t.listeners.has(y)||t.listeners.set(y,new Set),t.listeners.get(y).add(A),()=>t.listeners.get(y).delete(A)}function r(y,A){const L=t.listeners.get(y);L&&L.forEach(X=>{try{X(A)}catch(ee){console.error("[transport] listener",y,ee)}})}function i(y){t.connection!==y&&(t.connection=y,r("connection",y))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId,...t.origin?{"X-Parent-Origin":t.origin}:{}}}async function o(y,A,L){const X=await fetch(`${t.baseUrl}${vs}${A}`,{method:y,credentials:"include",headers:s(),body:L!==void 0?JSON.stringify(L):void 0});if(!X.ok){const ee=await a(X),Pe=new Error(`HTTP ${X.status} ${y} ${A} :: ${(ee==null?void 0:ee.error)||X.statusText}`);throw Pe.status=X.status,Pe.body=ee,Pe}return X.status===204?null:X.json()}async function a(y){try{return await y.json()}catch{return null}}async function l(y){if(t.started)return t.lastBootstrap;if(!(y!=null&&y.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=y.origin,t.token=y.token||"";const A=await fetch(`${t.baseUrl}${vs}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{},allowUnauthenticated:y.allowUnauthenticated===!0,...y.variables&&typeof y.variables=="object"?{variables:y.variables}:{}})});if(!A.ok){const Ke=await a(A),Ue=new Error(`Session bootstrap failed: HTTP ${A.status} :: ${(Ke==null?void 0:Ke.error)||A.statusText}`);throw Ue.status=A.status,Ue.body=Ke,Ue}const L=await A.json();t.userId=L.external_id;const[X,ee]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async Ke=>{if(!Ke.ok){const Ue=await a(Ke);throw new Error(`HTTP ${Ke.status} GET /widgets/:id/config :: ${(Ue==null?void 0:Ue.error)||Ke.statusText}`)}return Ke.json()}),o("GET","/customers/me")]),Pe={config:X,customer:(ee==null?void 0:ee.customer)??null};return t.lastBootstrap=Pe,await d(),typeof document<"u"&&(t.visibilityHandler=k,document.addEventListener("visibilitychange",t.visibilityHandler)),_(),Pe}async function d(){try{const y=await C();t.lastActivityAt=y.reduce((A,L)=>{const X=L==null?void 0:L.last_message_at;return X&&(!A||X>A)?X:A},null)}catch(y){console.error("[transport] initial /conversations failed",y)}}async function c(){const y=await o("GET","/customers/me");return(y==null?void 0:y.customer)??null}async function m(y){const A=await o("PATCH","/customers/me",y);return(A==null?void 0:A.customer)??null}async function C(){const y=await o("GET","/conversations");return(y==null?void 0:y.conversations)??[]}async function w(y={}){return(await o("POST","/conversations",y)).conversation}async function K(y){return(await o("GET",`/conversations/${encodeURIComponent(y)}`)).conversation}async function S(y,A){return(await o("PATCH",`/conversations/${encodeURIComponent(y)}`,A)).conversation}async function J(y,A){return o("PATCH",`/conversations/${encodeURIComponent(y)}/read`,{message_id:A})}async function U(y,A={}){const L=new URLSearchParams;A.before&&L.set("before",A.before),A.since&&L.set("since",A.since),A.limit&&L.set("limit",String(A.limit));const X=L.toString()?`?${L.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(y)}/messages${X}`)}async function $(y,A){se();const L={client_msg_id:A.client_msg_id,type:"content",text_md:A.text_md,author:{id:t.userId,type:"user"},created_at:A.created_at||new Date().toISOString()};return Array.isArray(A.attachments)&&A.attachments.length&&(L.payload={type:"content",attachments:A.attachments}),A.metadata&&typeof A.metadata=="object"&&(L.metadata=A.metadata),t.currentContext&&Object.keys(t.currentContext).length>0&&(L.context=t.currentContext),o("POST",`/conversations/${encodeURIComponent(y)}/messages`,L)}async function ne(y,A,L){return se(),o("POST",`/messages/${encodeURIComponent(y)}/callbacks/${encodeURIComponent(A)}`,L?{inputs:L}:{})}async function V(y){const A=y.name||"attachment",L=y.type||"application/octet-stream",X=y.size||0,ee=await o("POST","/attachments",{mime_type:L,size_bytes:X,name:A}),Pe=await fetch(ee.upload_url,{method:"PUT",headers:{"Content-Type":L},body:y});if(!Pe.ok)throw new Error(`HTTP ${Pe.status} PUT signed upload`);return{type:hc(L),path:ee.path,mime_type:L,size_bytes:X}}async function re(y){return o("GET",`/attachments/sign?path=${encodeURIComponent(y)}`)}function ce(){const y=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${vs}/stream?${y}`}function _e(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const y=new EventSource(ce(),{withCredentials:!0});for(const A of oc)y.addEventListener(A,L=>be(A,L.data));y.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=y,i("open")}catch(y){console.error("[transport] SSE open failed",y),r("error",y)}}function be(y,A){try{const L=JSON.parse(A),X=L&&typeof L=="object"&&"data"in L?L.data:L;r(y,X)}catch(L){console.error("[transport] bad SSE payload",y,L)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function se(){clearTimeout(t.burstTimer),_e(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},cc))}function ue(y){const A=t.panelOpen;t.panelOpen=!!y,t.panelOpen?(clearTimeout(t.burstTimer),_e()):se(),A!==t.panelOpen&&_()}async function j(){try{const y=await C(),A=y.reduce((X,ee)=>{const Pe=ee==null?void 0:ee.last_message_at;return Pe&&(!X||Pe>X)?Pe:X},null);A&&(!t.lastActivityAt||A>t.lastActivityAt)&&(t.lastActivityAt=A,r("activity",{conversations:y,latestAt:A}),se())}catch(y){console.error("[transport] poll failed",y)}}function _(){if(v(),typeof document<"u"&&document.hidden)return;const y=t.panelOpen?lc:ac;t.pollTimer=setInterval(j,y)}function v(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function k(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(v(),G(),i("paused"))},uc);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),_(),t.panelOpen&&_e()}}function x(){v(),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 P(y){return!y||typeof y!="object"?null:o("POST","/update",y)}function I(y){if(!(!y||typeof y!="object"))for(const[A,L]of Object.entries(y)){if(L===null){delete t.currentContext[A];continue}typeof L=="object"&&!Array.isArray(L)&&(t.currentContext[A]={...L})}}return{on:n,start:l,stop:x,setPanelOpen:ue,update:P,context:I,getCustomer:c,patchCustomer:m,listConversations:C,createConversation:w,getConversation:K,patchConversation:S,markConversationRead:J,listMessages:U,postMessage:$,postCallback:ne,uploadAttachment:V,signAttachment:re,get connection(){return t.connection}}}function fc(e){return e.endsWith("/")?e.slice(0,-1):e}function hc(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function mc(){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 gc(e){const t=Yn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",_=>{t.connection=_})),n.push(e.on("message",_=>{const v=_==null?void 0:_.conversation_id,k=_==null?void 0:_.message;!v||!(k!=null&&k.id)||(ce(v,k),k.client_msg_id&&delete t.streamingByMsgId[k.client_msg_id],G(v,k.created_at))})),n.push(e.on("message_stream",_=>{const v=_==null?void 0:_.message_id,k=_==null?void 0:_.token;!v||typeof k!="string"||(t.streamingByMsgId[v]=(t.streamingByMsgId[v]||"")+k)})),n.push(e.on("conversation_updated",_=>{const v=_==null?void 0:_.conversation_id,k=_==null?void 0:_.changes;if(!v||!k)return;const x=t.conversations.findIndex(P=>P.id===v);x!==-1&&(t.conversations[x]={...t.conversations[x],...k})})),n.push(e.on("config_updated",_=>{_!=null&&_.config&&(t.config=_.config)})),n.push(e.on("action_status",_=>{const v=_==null?void 0:_.conversation_id,k=_==null?void 0:_.action_id,x=_==null?void 0:_.action_name;if(!v||!k)return;const P=t.runningActionsByConv[v]||{};_.state==="running"?(P[k]=x||k,t.runningActionsByConv[v]={...P}):_.state==="done"&&(delete P[k],t.runningActionsByConv[v]={...P})})),n.push(e.on("activity",_=>{Array.isArray(_==null?void 0:_.conversations)&&(t.conversations=_.conversations)}));async function r(_){try{const v=new Promise((x,P)=>setTimeout(()=>P(new Error("bootstrap timeout (15s) โ check baseUrl, CORS, and network")),15e3)),k=await Promise.race([e.start(_),v]);t.config=k.config,t.customer=k.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 _ of n)try{_()}catch{}e.stop()}async function s(_){const v=ue(_);if(!v)return t.customer;try{const k=await e.patchCustomer(v);k&&(t.customer=k)}catch(k){console.error("[store] applyCustomer failed",k)}return t.customer}async function o(_={}){const v=await e.createConversation(_),k=t.conversations.findIndex(x=>x.id===v.id);return k===-1?t.conversations=[v,...t.conversations]:t.conversations[k]=v,v}const a=50;async function l(_){const v=t.paginationByConv[_];if(!(v!=null&&v.loaded||v!=null&&v.loading)){c(_,{nextCursor:null,loading:!0,loaded:!1});try{const k=await e.listMessages(_,{limit:a}),x=(k==null?void 0:k.messages)??[],P=t.messagesByConv[_]||[],I=new Set;for(const A of x)(A==null?void 0:A.id)!=null&&I.add(`id:${String(A.id)}`),A!=null&&A.client_msg_id&&I.add(`c:${A.client_msg_id}`);const y=P.filter(A=>!((A==null?void 0:A.id)!=null&&I.has(`id:${String(A.id)}`)||A!=null&&A.client_msg_id&&I.has(`c:${A.client_msg_id}`)));t.messagesByConv[_]=[...x,...y].sort(se),c(_,{nextCursor:(k==null?void 0:k.next_cursor)??null,loading:!1,loaded:!0})}catch(k){console.error("[store] openConversation failed",k),c(_,{nextCursor:null,loading:!1,loaded:!1})}}}async function d(_){var P;const v=t.paginationByConv[_];if(!v||v.loading||!v.nextCursor)return;const x=(P=(t.messagesByConv[_]||[]).find(I=>I==null?void 0:I.created_at))==null?void 0:P.created_at;if(x){c(_,{...v,loading:!0});try{const I=await e.listMessages(_,{before:x,limit:a}),y=(I==null?void 0:I.messages)??[],A=t.messagesByConv[_]||[],L=new Set;for(const ee of A)(ee==null?void 0:ee.id)!=null&&L.add(`id:${String(ee.id)}`),ee!=null&&ee.client_msg_id&&L.add(`c:${ee.client_msg_id}`);const X=y.filter(ee=>!((ee==null?void 0:ee.id)!=null&&L.has(`id:${String(ee.id)}`)||ee!=null&&ee.client_msg_id&&L.has(`c:${ee.client_msg_id}`)));t.messagesByConv[_]=[...X,...A],c(_,{nextCursor:(I==null?void 0:I.next_cursor)??null,loading:!1,loaded:!0})}catch(I){console.error("[store] loadMore failed",I),c(_,{...v,loading:!1})}}}function c(_,v){t.paginationByConv={...t.paginationByConv,[_]:v}}async function m(_,v){const k=await e.patchConversation(_,v),x=t.conversations.findIndex(P=>P.id===_);x!==-1&&(t.conversations[x]=k)}async function C(_){if(!_)return[];const v=t.messagesByConv[_]||[];let k="";for(const x of v)x!=null&&x.created_at&&x.created_at>k&&(k=x.created_at);try{const x=await e.listMessages(_,k?{since:k}:{}),P=(x==null?void 0:x.messages)||[];if(!P.length)return[];const I=new Set,y=new Set;for(const L of v)(L==null?void 0:L.id)!=null&&I.add(String(L.id)),L!=null&&L.client_msg_id&&y.add(L.client_msg_id);const A=[];for(const L of P){const X=(L==null?void 0:L.id)!=null&&I.has(String(L.id))||(L==null?void 0:L.client_msg_id)&&y.has(L.client_msg_id);ce(_,L),X||A.push(L)}return A}catch(x){return console.error("[store] fetchSinceLast failed",x),[]}}async function w(_,v){if(!(!_||v==null))try{const k=await e.markConversationRead(_,v),x=(k==null?void 0:k.last_read_message_id)??v,P=t.conversations.findIndex(I=>(I==null?void 0:I.id)===_);P!==-1&&(t.conversations[P]={...t.conversations[P],last_read_message_id:x})}catch(k){console.error("[store] markConversationRead failed",k)}}async function K(_,v,{attachments:k,metadata:x}={}){var X;const P=(v||"").trim(),I=Array.isArray(k)&&k.length>0;if(!_||!P&&!I)return;const y=mc(),A=j(_),L={id:y,client_msg_id:y,conversation_id:_,type:"content",text_md:P,author:{type:"user",id:((X=t.customer)==null?void 0:X.external_id)||null},created_at:A,_pending:!0,...I?{payload:{type:"content",attachments:k}}:{},...x&&typeof x=="object"?{metadata:x}:{}};ce(_,L);try{await e.postMessage(_,{client_msg_id:y,text_md:P,created_at:A,...I?{attachments:k}:{},...x&&typeof x=="object"?{metadata:x}:{}})}catch(ee){console.error("[store] send failed",ee),be(_,y,{_failed:!0,_pending:!1})}}async function S(_,v,k){_!=null&&(t.awaitingCallback[_]=!0);try{await e.postCallback(_,v,k)}catch(x){console.error("[store] callback failed",x),_!=null&&delete t.awaitingCallback[_]}}const J=new Map;async function U(_){if(!_)return null;const v=J.get(_);if(v!=null&&v.url){const k=v.expires_at?Date.parse(v.expires_at):0;if(!k||k-Date.now()>6e4)return v.url}try{const k=await e.signAttachment(_);if(k!=null&&k.signed_url)return J.set(_,{url:k.signed_url,expires_at:k.expires_at}),k.signed_url}catch(k){console.error("[store] sign attachment failed",k)}return null}async function $(_,{rating:v,comment:k}={}){const x=t.conversations.find(y=>y.id===_),I={...(x==null?void 0:x.metadata)||{},feedback:{rating:v,comment:k||null,submitted_at:new Date().toISOString()}};await m(_,{metadata:I})}function ne(_){var k,x;const v=t.messagesByConv[_]||[];for(let P=v.length-1;P>=0;P--){const I=v[P];if(((k=I==null?void 0:I.author)==null?void 0:k.type)==="user"||(I==null?void 0:I.type)==="action"&&((x=I==null?void 0:I.payload)==null?void 0:x.state)==="pending")return null;const y=Array.isArray(I==null?void 0:I.callbacks)?I.callbacks.find(A=>(A==null?void 0:A.intent)==="submit_form"):null;if(y&&Array.isArray(y.inputs)&&y.inputs.length>0)return{message:I,form:{title:y.title||"",description:y.description||null,submit_label:y.label||null,fields:y.inputs}}}return null}function V(_){const v=t.runningActionsByConv[_];if(!v)return null;const k=Object.keys(v);if(k.length===0)return null;const x=k[0];return{id:x,payload:{name:v[x]}}}function re(_){var k,x,P;const v=t.messagesByConv[_]||[];for(let I=v.length-1;I>=0;I--){const y=v[I];if(((k=y==null?void 0:y.author)==null?void 0:k.type)==="user")return[];if((y==null?void 0:y.type)==="action"&&((x=y==null?void 0:y.payload)==null?void 0:x.state)==="pending")return[];if(((P=y==null?void 0:y.author)==null?void 0:P.type)!=="agent_ia")continue;const A=Array.isArray(y==null?void 0:y.callbacks)?y.callbacks.filter(L=>(L==null?void 0:L.intent)==="send_message"&&(L.render??"inline")==="inline"):[];return A.length?A.map(L=>typeof L.label=="string"&&L.label.trim()?{label:L.label.trim(),kind:null}:null).filter(Boolean).slice(0,4):[]}return[]}function ce(_,v){var I;const k=t.messagesByConv[_]||[];let x=-1;v!=null&&v.client_msg_id&&(x=k.findIndex(y=>(y==null?void 0:y.client_msg_id)&&y.client_msg_id===v.client_msg_id)),x===-1&&(v==null?void 0:v.id)!==void 0&&(v==null?void 0:v.id)!==null&&(x=k.findIndex(y=>_e(y==null?void 0:y.id,v.id)));let P;x===-1?P=[...k,v].sort(se):(P=k.slice(),P[x]={...k[x],...v,_pending:!1,_failed:!1}),t.messagesByConv[_]=P,(v==null?void 0:v.type)==="action"&&((I=v==null?void 0:v.payload)!=null&&I.state)&&v.payload.state!=="pending"&&(v==null?void 0:v.id)!=null&&t.awaitingCallback[v.id]&&delete t.awaitingCallback[v.id]}function _e(_,v){return _===v?!0:_==null||v==null?!1:String(_)===String(v)}function be(_,v,k){const x=t.messagesByConv[_];if(!x)return;const P=x.findIndex(y=>y.id===v);if(P===-1)return;const I=x.slice();I[P]={...x[P],...k},t.messagesByConv[_]=I}function G(_,v){const k=t.conversations.findIndex(P=>P.id===_);if(k===-1)return;const x=t.conversations[k];if(v&&(!x.last_message_at||v>x.last_message_at)){const P=t.conversations.slice();P[k]={...x,last_message_at:v},P.sort((I,y)=>(y.last_message_at||"").localeCompare(I.last_message_at||"")),t.conversations=P}}function se(_,v){return(_.created_at||"").localeCompare(v.created_at||"")}function ue(_){if(!_||typeof _!="object")return null;const v={},k={};for(const[x,P]of Object.entries(_))P!==void 0&&(x==="name"||x==="email"||x==="language"?P!=null&&String(P).trim()!==""&&(v[x]=P):(x==="values"||x==="metadata")&&P&&typeof P=="object"?Object.assign(k,P):k[x]=P);return Object.keys(k).length&&(v.values=k),Object.keys(v).length?v:null}function j(_){const v=t.messagesByConv[_]||[];let k="";for(const I of v)I!=null&&I.created_at&&I.created_at>k&&(k=I.created_at);const x=new Date().toISOString();return!k||x>k?x:new Date(Date.parse(k)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:d,fetchSinceLast:C,patchConversation:m,markConversationRead:w,send:K,clickCallback:S,signAttachment:U,submitFeedback:$,getActionInFlight:V,getLatestSuggestions:re,getLatestForm:ne,setPanelOpen:e.setPanelOpen}}const Oe={w:"#ffffff",g50:"#F9F9F7",g100:"#F5F5F5",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},ws=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function Zs(e=""){return e?ws[e.charCodeAt(0)%ws.length]:ws[0]}function er(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function Bs(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const Ao=`
|
|
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 {
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
0% { transform: translateX(110%); opacity: 0; }
|
|
62
62
|
100% { transform: translateX(0); opacity: 1; }
|
|
63
63
|
}
|
|
64
|
-
`,pc="https://api.messenger.victorc.fr",_c=/^[a-zA-Z]{3,32}$/,yc=/^#[0-9a-fA-F]{3,8}$/,vc=/^(rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/]{1,60}\)$/;function
|
|
64
|
+
`,pc="https://api.messenger.victorc.fr",_c=/^[a-zA-Z]{3,32}$/,yc=/^#[0-9a-fA-F]{3,8}$/,vc=/^(rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/]{1,60}\)$/;function wc(e){return typeof e!="string"||!e||e.length>64?!1:yc.test(e)||vc.test(e)||_c.test(e)}function Gr(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 vn="fr",bc=["fr","en"],Yr={fr:"fr-FR",en:"en-US"},bs={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.starterPlaceholder":"รcrivez votre messageโฆ","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
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","composer.conversationEnded":"Cette conversation est terminรฉe.","composer.conversationClosed":"Cette conversation a รฉtรฉ fermรฉe.","composer.reopen":"Rouvrir la conversation","composer.newConversation":"Nouvelle conversation","resolution.title":"Souhaites-tu clรดturer cette conversation ?","resolution.confirm":"Oui, clรดturer","resolution.decline":"Pas encore","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.closed":"Conversation fermรฉe","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.","action.rejectedByAdmin":"Action refusรฉe par un agent.","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.starterPlaceholder":"Type your messageโฆ","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","composer.conversationEnded":"This conversation has ended.","composer.conversationClosed":"This conversation has been closed.","composer.reopen":"Reopen conversation","composer.newConversation":"New conversation","resolution.title":"Shall we close this conversation?","resolution.confirm":"Yes, close","resolution.decline":"Not yet","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.closed":"Conversation closed","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.","action.rejectedByAdmin":"Action declined by an agent.","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 tr(e){if(typeof e!="string")return vn;const t=e.trim().toLowerCase().slice(0,2);return
|
|
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","composer.conversationEnded":"This conversation has ended.","composer.conversationClosed":"This conversation has been closed.","composer.reopen":"Reopen conversation","composer.newConversation":"New conversation","resolution.title":"Shall we close this conversation?","resolution.confirm":"Yes, close","resolution.decline":"Not yet","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.closed":"Conversation closed","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.","action.rejectedByAdmin":"Action declined by an agent.","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 tr(e){if(typeof e!="string")return vn;const t=e.trim().toLowerCase().slice(0,2);return bc.includes(t)?t:vn}function Bt(e){return Yr[tr(e)]||Yr[vn]}function Ee(e){const t=tr(e),n=bs[t]||bs[vn],r=bs[vn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,d)=>o[d]!=null?String(o[d]):l)),a)}}function Jr(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 xo(e,t,n){return Array.isArray(t)?t.map(r=>Jr(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):Jr(e,String(t))}function kc(e,t,n=Ee()){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=xo(s,o,n);a&&i.push(`${s.label} :
|
|
67
67
|
${a}`)}return i.join(`
|
|
68
68
|
|
|
69
69
|
`)}function Cc(e,t,n=Ee()){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=xo(s,o,n);if(!a)continue;const l=s.type==="textarea"||typeof a=="string"&&(a.length>60||a.includes(`
|
|
70
70
|
`));r.push({label:s.label,value:a,multiline:l})}return{kind:"form_response",data:{title:(e==null?void 0:e.title)||n("form.title"),fields:r}}}function To(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function In(e){return/^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim())}const Xr="๎";function nn(e){let t=e;const n=[];return t=t.replace(/`([^`\n]+)`/g,(r,i)=>{const s=n.length;return n.push(i),`${Xr}CODE${s}${Xr}`}),t=t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g,(r,i,s)=>In(s)?`<a href="${s}" target="_blank" rel="noopener noreferrer">${i}</a>`:i),t=t.replace(/\*\*([^\n*][^\n]*?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/__([^\n_][^\n]*?)__/g,"<u>$1</u>"),t=t.replace(/~~([^\n~][^\n]*?)~~/g,"<s>$1</s>"),t=t.replace(/(^|[^\w*])\*([^\n*]+?)\*(?!\w)/g,"$1<em>$2</em>"),t=t.replace(/(^|[^\w_])_([^\n_]+?)_(?!\w)/g,"$1<em>$2</em>"),t=t.replace(/๎CODE(\d+)๎/g,(r,i)=>`<code class="wm-md-code">${n[+i]}</code>`),t}function Mo(e){if(!e)return"";const t=String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g,"$1");return nn(To(t))}function Sc(e){if(!e)return"";const t=To(e).split(`
|
|
71
71
|
`),n=[];let r=0;for(;r<t.length;){const s=t[r];if(/^\s*```([\w-]*)\s*$/.exec(s)){r++;const d=[];for(;r<t.length&&!/^\s*```\s*$/.test(t[r]);)d.push(t[r]),r++;r<t.length&&r++,n.push({type:"block",html:`<pre class="wm-md-pre"><code>${d.join(`
|
|
72
|
-
`)}</code></pre>`});continue}if(/^\s*[-*]\s+/.test(s)){const d=[];for(;r<t.length;){const m=/^\s*[-*]\s+(.*)$/.exec(t[r]);if(!m)break;d.push(m[1]),r++}const c=d.map(m=>`<li>${nn(m)}</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 d=parseInt(a[1],10),c=[a[2]];for(r++;r<t.length;){const
|
|
73
|
-
`)}return i}function
|
|
74
|
-
`)}function Mc(e,t,n=Ee(),r){if(!e)return;const i=Tc(e,t||[],n,Bt(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 Ec={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||!bn(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)}}}},Qt=Object.freeze({firstRevealDelayMs:450,msPerChar:50,minTypingMs:900,maxTypingMs:12e3,pauseBetweenMs:300}),Zt=(e,t)=>Number.isFinite(e)?e:t,Oc={computed:{revealPacing(){var t;const e=((t=this.widget)==null?void 0:t.reveal_pacing)||{};return{firstRevealDelayMs:Zt(e.first_reveal_delay_ms,Qt.firstRevealDelayMs),msPerChar:Zt(e.ms_per_char,Qt.msPerChar),minTypingMs:Zt(e.min_typing_ms,Qt.minTypingMs),maxTypingMs:Zt(e.max_typing_ms,Qt.maxTypingMs),pauseBetweenMs:Zt(e.pause_between_ms,Qt.pauseBetweenMs)}}},data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null,_liveHwm:{}}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n,r;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",i=>{const s=i==null?void 0:i.conversation_id,o=i==null?void 0:i.message;s&&o&&this.paceLiveMessage(o,s)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(i=>[i.id,(i==null?void 0:i.last_message_at)||""])),this._liveHwm=Object.fromEntries((((r=this.s)==null?void 0:r.conversations)||[]).map(i=>[i.id,(i==null?void 0:i.last_message_at)||""]));const t=this.transport.on("activity",i=>{this.handleLiveActivity(i)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null,this._liveHwm={}},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=this.revealPacing,r=Date.now(),i=((e==null?void 0:e.text_md)||"").length,s=Math.min(n.maxTypingMs,Math.max(n.minTypingMs,i*n.msPerChar)),a=Math.max(r+n.firstRevealDelayMs,this.nextRevealAt+n.pauseBetweenMs)+s;this.nextRevealAt=a;const l=Math.max(0,a-r),d=e.id,c=setTimeout(()=>{this.revealedAt={...this.revealedAt,[d]:Date.now()},this.revealTimers=this.revealTimers.filter(m=>m!==c),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},l);this.revealTimers.push(c)},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(!bn(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 a;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!bn(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((a=e==null?void 0:e.payload)==null?void 0:a.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const i=this._liveHwm[t],s=(e==null?void 0:e.created_at)||"";if(s&&(i===void 0||s>i)&&(this._liveHwm={...this._liveHwm,[t]:s}),!(i!==void 0&&s&&s>i)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Rc=300,Ic={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=Lc(t);if(n==null)return;const r=ht(e.last_read_message_id),i=ht(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)},Rc))))}}};function Lc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&ht(n.id)!=null)return n.id}return null}const be=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Pc={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":Zs(this.name)},initials(){return er(this.name)}}},Bc=["src","alt"];function Fc(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-huav",{"wm-huav--tail":n.tail}]),style:Ce({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(h(),p("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Bc)):(h(),p("span",{key:1,style:Ce({fontSize:n.size*.36+"px"})},R(s.initials),5))],6)}const rs=be(Pc,[["render",Fc],["__scopeId","data-v-14e10c0d"]]),Dc=3,Nc={name:"WmLauncher",components:{HumanAvatar:rs},inject:{t:{default:()=>Ee()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Dc).reverse()}}},Hc=["aria-label","onClick","onKeydown"],Uc=["aria-label","onClick"],jc={class:"wm-peek__avatar"},Vc=["aria-label"],Kc={class:"wm-peek__body"},zc={class:"wm-peek__head"},Wc={class:"wm-peek__name"},$c={class:"wm-peek__action"},qc={class:"wm-peek__text"},Gc=["onClick"],Yc=["aria-label"],Jc=["aria-label"];function Xc(e,t,n,r,i,s){const o=ve("HumanAvatar");return h(),p("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))},[pe(Qs,{name:"wm-peek"},{default:Xn(()=>[s.visiblePeeks.length?(h(),p("div",{key:0,class:te(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(h(!0),p(Z,null,Se(s.visiblePeeks,(a,l)=>(h(),p("div",{key:a.convId,class:"wm-peek",style:Ce({"--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:d=>e.$emit("open",a.convId),onKeydown:[Un(We(d=>e.$emit("open",a.convId),["prevent"]),["enter"]),Un(We(d=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:We(d=>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,Uc),u("div",jc,[pe(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(h(),p("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},R(a.count>9?"9+":a.count),9,Vc)):F("",!0)]),u("div",Kc,[u("div",zc,[u("span",Wc,R(a.senderName||s.t("common.agent")),1),u("span",$c,R(s.t("launcher.repliedToYou")),1)]),u("p",qc,R(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:We(d=>e.$emit("open",a.convId),["stop"])},R(s.t("common.open")),9,Gc)],44,Hc))),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(),p("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})},R(n.unreadCount>9?"9+":n.unreadCount),9,Jc)):F("",!0)],8,Yc)],32)}const Qc=be(Nc,[["render",Xc],["__scopeId","data-v-d81459bc"]]),Zc={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 er(this.name)},bgColor(){return Zs(this.name)}}},eu={key:0,class:"wm-aiav__pulse"},tu=["src","alt"],nu=["width","height"];function su(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:Ce({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(h(),p("div",eu)):F("",!0),u("div",{class:te(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:Ce(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(h(),p("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,tu)):s.initials?(h(),p("span",{key:1,style:Ce({fontSize:n.size*.36+"px"})},R(s.initials),5)):(h(),p("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,nu))],6)],6)}const Sn=be(Zc,[["render",su],["__scopeId","data-v-6f7f685d"]]),ru={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":Zs(e.name||"")},initialsFor(e){return er(e.name||"")}}},iu={key:0,class:"wm-team"},ou=["src","alt"],au={key:1},lu={key:0,class:"wm-team__label"};function cu(e,t,n,r,i,s){return s.visible?(h(),p("div",iu,[u("div",{class:"wm-team__stack",style:Ce({width:s.stackWidth+"px"})},[(h(!0),p(Z,null,Se(n.members.slice(0,3),(o,a)=>(h(),p("div",{key:a,class:"wm-team__pill",style:Ce({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(h(),p("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,ou)):(h(),p("span",au,R(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(h(),p("span",lu,R(n.responseLabel),1)):F("",!0)])):F("",!0)}const uu=be(ru,[["render",cu],["__scopeId","data-v-e49a9063"]]),du={name:"WmHeader",components:{AIAvatar:Sn,TeamAvatars:uu},inject:{t:{default:()=>Ee()}},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}}},fu={class:"wm-header"},hu=["aria-label"],mu={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},gu={class:"wm-header__avatar"},pu={class:"wm-header__main"},_u={class:"wm-header__title"},yu={key:3,class:"wm-header__fill"},vu={class:"wm-header__actions"},bu=["aria-label","title"],wu=["aria-label","title"];function ku(e,t,n,r,i,s){const o=ve("AIAvatar"),a=ve("TeamAvatars");return h(),p("div",fu,[n.showBack?(h(),p("button",{key:0,type:"button",class:"wm-header__icon wm-header__back","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,hu)):(h(),p("div",mu)),n.showIdentity?(h(),p(Z,{key:2},[u("div",gu,[pe(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",pu,[u("div",_u,R(n.title),1)]),s.hasTeam?(h(),fe(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):F("",!0)],64)):(h(),p("div",yu)),u("div",vu,[n.showMore?(h(),p("button",{key:0,type:"button",class:te(["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,bu)):F("",!0),n.showClose?(h(),p("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,wu)):F("",!0)])])}const Cu=be(du,[["render",ku],["__scopeId","data-v-27232009"]]),Zr={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"},Su={name:"WmOnboarding",components:{AIAvatar:Sn,HumanAvatar:rs},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{title:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},coverImageUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1},launching:{type:Boolean,default:!1},welcomeMessage:{type:String,default:""}},emits:["start","launched","select","resume","view-history"],data(){return{launchPhase:"idle",inputFocused:!1,launchDone:!1,starterText:""}},watch:{launching(e){e&&this.runLaunch()}},computed:{canStart(){return!this.busy&&!!this.starterText.trim()},typing(){return this.inputFocused&&!!this.starterText.trim()},heroTitle(){return this.title?this.title: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)},safeCoverUrl(){return Gr(this.coverImageUrl)},hasCover(){return!!this.safeCoverUrl},coverStyle(){return this.safeCoverUrl?{backgroundImage:`url("${this.safeCoverUrl}")`}:null}},methods:{submitStarter(){this.canStart&&this.$emit("start",this.starterText.trim())},onStarterKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.submitStarter())},onInputFocus(){this.launchPhase==="idle"&&(this.inputFocused=!0,this.$nextTick(()=>this.autosize()))},onInputBlur(){this.launchPhase==="idle"&&(this.inputFocused=!1,this.$nextTick(()=>this.autosize()))},autosize(){const e=this.$refs.starterInput;if(!e||e.clientWidth<40)return;e.style.height="auto",e.style.minHeight="0px";const t=e.scrollHeight;e.style.minHeight="",e.style.height=t>62?`${Math.min(t,120)}px`:""},async runLaunch(){const e=this.$refs.starterForm,t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!e||t){this.launchPhase="fade",await this.wait(t?120:0),this.finishLaunch();return}this.launchPhase="fade",await this.wait(320);const n=e.getBoundingClientRect();this.launchPhase="slide",await this.$nextTick();const r=e.getBoundingClientRect(),i=n.left-r.left,s=n.top-r.top;e.style.transition="none",e.style.transform=`translate(${i}px, ${s}px)`,e.offsetWidth,e.style.transition="transform 0.44s cubic-bezier(0.32, 0.72, 0, 1)",e.style.transform="translate(0, 0)";const o=()=>{e.removeEventListener("transitionend",o),this.finishLaunch()};e.addEventListener("transitionend",o),this.wait(520).then(()=>this.finishLaunch())},finishLaunch(){this.launchDone||(this.launchDone=!0,this.$emit("launched"))},wait(e){return new Promise(t=>window.setTimeout(t,e))},iconPath(e){return Zr[e]||Zr.link},isExternalLink(e){const t=e==null?void 0:e.url;return!!t&&!t.startsWith("#")},safeIconUrl(e){return Gr(e==null?void 0:e.icon_url)},iconUrlStyle(e){const t=this.safeIconUrl(e);return t?{"--icon-url":`url("${t}")`}:null},renderPreview(e){return Mo(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-onb__avatar--muted":null},senderLabel(e){var t;return((t=e==null?void 0:e.author)==null?void 0:t.name)||""},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Bt(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"})}}},Au=["aria-label"],xu={key:1,class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},Tu={class:"wm-onb__hero-text"},Mu={class:"wm-onb__hero-default"},Eu={class:"wm-onb__title"},Ou={class:"wm-onb__sub"},Ru={key:0,class:"wm-onb__welcome"},Iu={key:0,class:"wm-onb__alertList"},Lu=["onClick"],Pu={key:0,class:"wm-onb__defaultAvatar"},Bu=["aria-label"],Fu={class:"wm-onb__alert-body"},Du={class:"wm-onb__alert-title"},Nu={class:"wm-onb__alert-preview"},Hu={key:0,class:"wm-onb__alert-sender"},Uu=["innerHTML"],ju={class:"wm-onb__alert-meta"},Vu={key:0,class:"wm-onb__alert-time"},Ku={class:"wm-onb__alert-resume"},zu={class:"wm-onb__actions"},Wu=["onClick"],$u={class:"wm-onb__btn-icon"},qu=["aria-label"],Gu={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"},Yu=["d"],Ju={class:"wm-onb__btn-label"},Xu={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"},Qu={class:"wm-onb__btn-icon"},Zu={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"},ed=["d"],td={class:"wm-onb__btn-label"},nd={class:"wm-onb__btn-count"},sd=["placeholder","disabled","aria-label"],rd=["disabled","aria-label"],id={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},od={key:1,class:"wm-onb__starter-spinner","aria-hidden":"true"};function ad(e,t,n,r,i,s){const o=ve("AIAvatar");return h(),p("div",{class:te(["wm-onb",{"wm-onb--launching":i.launchPhase!=="idle","wm-onb--sliding":i.launchPhase==="slide","wm-onb--focused":i.inputFocused,"wm-onb--typing":s.typing}])},[u("div",{class:te(["wm-onb__hero",{"wm-onb__hero--cover":s.hasCover}])},[s.hasCover?(h(),p("div",{key:0,class:"wm-onb__cover",style:Ce(s.coverStyle),role:"img","aria-label":s.heroTitle},null,12,Au)):F("",!0),s.hasCover?F("",!0):(h(),p("svg",xu,[...t[7]||(t[7]=[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"},null,-1),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"},null,-1),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"},null,-1)])])),pe(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",Tu,[u("div",Mu,[u("div",Eu,R(s.heroTitle),1),u("div",Ou,R(s.heroSub),1)]),n.welcomeMessage?(h(),p("div",Ru,R(n.welcomeMessage),1)):F("",!0)])],2),s.unreadThreads.length?(h(),p("div",Iu,[(h(!0),p(Z,null,Se(s.unreadThreads,a=>(h(),p("button",{key:a.id,type:"button",class:"wm-onb__alert",onClick:l=>e.$emit("resume",a)},[u("span",{class:te(["wm-onb__alert-avatar",s.avatarWrapperClass(a)])},[s.isDefaultAvatar(a)?(h(),p("span",Pu,[...t[8]||(t[8]=[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)])])):(h(),fe(qs(s.avatarComponent(a)),Xs({key:1,ref_for:!0},s.avatarProps(a)),null,16)),u("span",{class:"wm-onb__alert-dot","aria-label":s.t("onboarding.unread")},null,8,Bu)],2),u("span",Fu,[u("span",Du,R(a.title),1),u("span",Nu,[s.senderLabel(a)?(h(),p("span",Hu,R(s.senderLabel(a))+" ยท ",1)):F("",!0),u("span",{innerHTML:s.renderPreview(a.preview)},null,8,Uu)])]),u("span",ju,[s.formatTs(a._ts)?(h(),p("span",Vu,R(s.formatTs(a._ts)),1)):F("",!0),u("span",Ku,R(s.t("onboarding.resume")),1)])],8,Lu))),128))])):F("",!0),u("div",zu,[(h(!0),p(Z,null,Se(n.quickLinks,(a,l)=>(h(),p("button",{key:"ql-"+l,type:"button",class:"wm-onb__btn",onClick:d=>e.$emit("select",a)},[u("span",$u,[s.safeIconUrl(a)?(h(),p("span",{key:0,class:"wm-onb__btn-iconImg",style:Ce(s.iconUrlStyle(a)),role:"img","aria-label":a.label||""},null,12,qu)):(h(),p("svg",Gu,[u("path",{d:s.iconPath(a.icon)},null,8,Yu)]))]),u("span",Ju,R(a.label),1),s.isExternalLink(a)?(h(),p("svg",Xu,[...t[9]||(t[9]=[u("path",{d:"M7 17L17 7M9 7h8v8"},null,-1)])])):F("",!0)],8,Wu))),128)),n.openThreads.length?(h(),p("button",{key:0,type:"button",class:"wm-onb__btn",onClick:t[0]||(t[0]=a=>e.$emit("view-history"))},[u("span",Qu,[(h(),p("svg",Zu,[u("path",{d:s.iconPath("chat")},null,8,ed)]))]),u("span",td,R(s.t("onboarding.allConversations")),1),u("span",nd,R(n.openThreads.length),1),t[10]||(t[10]=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),u("form",{ref:"starterForm",class:te(["wm-onb__starter",{"is-active":!!i.starterText.trim(),"is-expanded":i.inputFocused,"wm-onb__starter--toBottom":i.launchPhase==="slide"}]),onSubmit:t[6]||(t[6]=We((...a)=>s.submitStarter&&s.submitStarter(...a),["prevent"]))},[st(u("textarea",{ref:"starterInput","onUpdate:modelValue":t[1]||(t[1]=a=>i.starterText=a),class:"wm-onb__starter-input",rows:"1",placeholder:s.t("onboarding.starterPlaceholder"),disabled:n.busy,"aria-label":s.t("onboarding.start"),enterkeyhint:"send",onKeydown:t[2]||(t[2]=(...a)=>s.onStarterKeydown&&s.onStarterKeydown(...a)),onInput:t[3]||(t[3]=(...a)=>s.autosize&&s.autosize(...a)),onFocus:t[4]||(t[4]=(...a)=>s.onInputFocus&&s.onInputFocus(...a)),onBlur:t[5]||(t[5]=(...a)=>s.onInputBlur&&s.onInputBlur(...a))},null,40,sd),[[kt,i.starterText]]),u("button",{type:"submit",class:te(["wm-onb__starter-send",{"is-empty":!s.canStart}]),disabled:n.busy||!s.canStart,"aria-label":s.t("composer.send")},[n.busy?(h(),p("span",od)):(h(),p("svg",id,[...t[11]||(t[11]=[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"},null,-1)])]))],10,rd)],34)])],2)}const ld=be(Su,[["render",ad],["__scopeId","data-v-cfaffcfa"]]),cd={name:"WmHistory",components:{AIAvatar:Sn,HumanAvatar:rs},inject:{t:{default:()=>Ee()},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 Mo(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=Bt(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"})}}},ud={class:"wm-hist"},dd={class:"wm-hist__search"},fd=["placeholder","aria-label"],hd={class:"wm-hist__list"},md=["onClick"],gd={key:0,class:"wm-hist__defaultAvatar"},pd=["aria-label"],_d={class:"wm-hist__thread-body"},yd={class:"wm-hist__thread-title"},vd=["innerHTML"],bd={class:"wm-hist__thread-meta"},wd={key:0,class:"wm-hist__thread-time"},kd={key:0,class:"wm-hist__empty"};function Cd(e,t,n,r,i,s){return h(),p("div",ud,[u("div",dd,[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)),st(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,fd),[[kt,i.query]])]),u("div",hd,[(h(!0),p(Z,null,Se(s.filteredThreads,o=>(h(),p("button",{key:o.id,type:"button",class:te(["wm-hist__thread",{"wm-hist__thread--unread":o.unread}]),onClick:a=>e.$emit("resume",o)},[u("span",{class:te(["wm-hist__thread-avatar",s.avatarWrapperClass(o)])},[s.isDefaultAvatar(o)?(h(),p("span",gd,[...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(),fe(qs(s.avatarComponent(o)),Xs({key:1,ref_for:!0},s.avatarProps(o)),null,16)),o.unread?(h(),p("span",{key:2,class:"wm-hist__thread-dot","aria-label":s.t("onboarding.unread")},null,8,pd)):F("",!0)],2),u("span",_d,[u("span",yd,R(o.title),1),u("span",{class:"wm-hist__thread-preview",innerHTML:s.renderPreview(o.preview)},null,8,vd)]),u("span",bd,[s.formatTs(o._ts)?(h(),p("span",wd,R(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,md))),128)),s.filteredThreads.length?F("",!0):(h(),p("div",kd,R(i.query?s.t("onboarding.noResults",{query:i.query}):s.t("onboarding.noConversations")),1))])])}const Sd=be(cd,[["render",Cd],["__scopeId","data-v-6bf35ef1"]]);function Ad(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 xd={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return Ad(this.detail)}}},Td={class:"wm-result__icon","aria-hidden":"true"},Md={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"},Ed={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"},Od={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"},Rd={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"},Id={class:"wm-result__body"},Ld={class:"wm-result__label"},Pd={class:"wm-result__detail"};function Bd(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-result",`wm-result--${n.state}`])},[u("span",Td,[n.state==="success"?(h(),p("svg",Md,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(h(),p("svg",Ed,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(h(),p("svg",Od,[...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(),p("svg",Rd,[...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",Id,[u("span",Ld,R(n.label),1),s.detailText?(h(),p(Z,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," ยท ",-1)),u("span",Pd,R(s.detailText),1)],64)):F("",!0)])],2)}const Fd=be(xd,[["render",Bd],["__scopeId","data-v-7284acd0"]]),Dd={name:"WmArtifactFormResponse",inject:{t:{default:()=>Ee()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},Nd={class:"wm-art wm-art--formResponse"},Hd={class:"wm-art__head"},Ud={class:"wm-art__title"},jd={class:"wm-art__badge wm-art__badge--success"},Vd={class:"wm-art__body"},Kd={class:"wm-art__fieldLabel"};function zd(e,t,n,r,i,s){return h(),p("div",Nd,[u("div",Hd,[u("div",Ud,R(n.data.title||s.t("form.title")),1),u("span",jd,[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)),ns(" "+R(s.t("form.sent")),1)])]),u("div",Vd,[(h(!0),p(Z,null,Se(s.fields,(o,a)=>(h(),p("div",{key:a,class:"wm-art__field"},[u("div",Kd,R(o.label),1),u("div",{class:te(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},R(o.value),3)]))),128))])])}const Wd=be(Dd,[["render",zd],["__scopeId","data-v-713aecf1"]]),$d={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}}},qd={class:"wm-art wm-art--infoCard"},Gd={key:0,class:"wm-art__image"},Yd=["src","alt"],Jd={class:"wm-art__head"},Xd={class:"wm-art__headMain"},Qd={class:"wm-art__title"},Zd={key:0,class:"wm-art__subtitle"},ef={key:1,class:"wm-art__body"},tf={key:0,class:"wm-art__text"},nf={class:"wm-art__fieldLabel"};function sf(e,t,n,r,i,s){return h(),p("div",qd,[n.data.image_url?(h(),p("figure",Gd,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,Yd)])):F("",!0),u("div",Jd,[u("div",Xd,[u("div",Qd,R(n.data.title),1),n.data.subtitle?(h(),p("div",Zd,R(n.data.subtitle),1)):F("",!0)]),n.data.badge&&n.data.badge.label?(h(),p("span",{key:0,class:te(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},R(n.data.badge.label),3)):F("",!0)]),s.hasBody?(h(),p("div",ef,[n.data.body?(h(),p("div",tf,R(n.data.body),1)):F("",!0),s.fields.length?(h(!0),p(Z,{key:1},Se(s.fields,(o,a)=>(h(),p("div",{key:a,class:"wm-art__field"},[u("div",nf,R(o.label),1),u("div",{class:te(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},R(o.value),3)]))),128)):F("",!0)])):F("",!0)])}const rf=be($d,[["render",sf],["__scopeId","data-v-7eae0e4a"]]);function of(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 af={name:"WmArtifactTicket",inject:{t:{default:()=>Ee()},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 of((e=this.data)==null?void 0:e.created_at,Bt(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}}},lf={class:"wm-art wm-art--ticket"},cf={class:"wm-art__head wm-tk__head"},uf={class:"wm-art__title wm-tk__title"},df={class:"wm-tk__sub"},ff={class:"wm-tk__ref"},hf={key:0,class:"wm-tk__text"},mf={key:0,class:"wm-art__body"},gf={class:"wm-art__fieldLabel"},pf=["data-level"],_f={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"},yf={key:1,class:"wm-art__footer wm-tk__footer"};function vf(e,t,n,r,i,s){return h(),p("div",lf,[u("div",cf,[u("div",uf,R(n.data.title),1),u("div",df,[u("div",ff,[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,R(n.data.reference),1)]),u("span",{class:te(["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)),ns(" "+R(n.data.status.label),1)],2)]),n.data.body?(h(),p("div",hf,R(n.data.body),1)):F("",!0)]),s.fields.length?(h(),p("div",mf,[(h(!0),p(Z,null,Se(s.fields,(o,a)=>(h(),p("div",{key:a,class:"wm-art__field"},[u("div",gf,R(o.label),1),u("div",{class:te(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(h(),p("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,pf)):s.isDate(o.label)?(h(),p("svg",_f,[...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,R(o.value),1)],2)]))),128))])):F("",!0),n.data.created_at?(h(),p("div",yf,[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,R(s.formattedDate),1)])):F("",!0)])}const bf=be(af,[["render",vf],["__scopeId","data-v-5f30c914"]]),wf={form_response:Wd,info_card:rf,ticket:bf},kf={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&wf[e]||null}}};function Cf(e,t,n,r,i,s){return s.component?(h(),fe(qs(s.component),{key:0,data:n.artifact.data},null,8,["data"])):F("",!0)}const Sf=be(kf,[["render",Cf]]),Af={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>Ee()}},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()}}},xf=["href"],Tf=["src","alt"],Mf=["src"],Ef=["src"],Of=["href","download"],Rf={class:"wm-att__main"},If={class:"wm-att__name"},Lf={key:0,class:"wm-att__meta"},Pf={key:0,class:"wm-att__spin","aria-hidden":"true"};function Bf(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(h(),p("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,Tf)],8,xf)):s.kind==="audio"&&i.url?(h(),p("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,Mf)):s.kind==="video"&&i.url?(h(),p("video",{key:2,src:i.url,controls:"",playsinline:"",preload:"auto"},null,8,Ef)):(h(),p("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",Rf,[u("span",If,R(s.displayName),1),s.sizeLabel?(h(),p("span",Lf,R(s.sizeLabel),1)):F("",!0)]),i.loading?(h(),p("span",Pf)):F("",!0)],8,Of))],2)}const Ff=be(Af,[["render",Bf],["__scopeId","data-v-b207a8bd"]]),Df={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return Sc(this.text)}}},Nf=["innerHTML"];function Hf(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-bubble","wm-bubble--"+n.role])},[Fa(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,Nf)])],2)}const Uf=be(Df,[["render",Hf],["__scopeId","data-v-7ab13147"]]),jf={name:"WmTyping"},Vf={class:"wm-typing"};function Kf(e,t,n,r,i,s){return h(),p("div",Vf,[...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 zf=be(jf,[["render",Kf],["__scopeId","data-v-df2447fd"]]);function Ot(e){return e?e.client_msg_id||e.id:""}const Wf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",closed:"system.closed",reopened:"system.reopened",idle:"system.idle"},$f=80,qf=200,Gf={name:"WmMessageList",components:{AIAvatar:Sn,HumanAvatar:rs,Bubble:Uf,Typing:zf,ActionResult:Fd,AttachmentPreview:Ff,ArtifactRenderer:Sf},inject:{t:{default:()=>Ee()},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,o;const e=[];for(const a of this.messages){if((n=a==null?void 0:a.metadata)!=null&&n.resolution_request)continue;const l=this.roleOf(a);if(l==="system"){if(((r=a==null?void 0:a.payload)==null?void 0:r.event)==="action_admin_pending"){const m=e[e.length-1];m&&m.role==="ai"?m.messages.push(a):e.push({key:`g-${Ot(a)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[a],items:[]});continue}e.push({key:`sys-${Ot(a)}`,role:l,messages:[a],items:[],systemLabel:this.systemLabel(a)});continue}const d=e[e.length-1];d&&d.role===l&&(l==="ai"||d.agentName===(((i=a==null?void 0:a.author)==null?void 0:i.name)||""))?d.messages.push(a):e.push({key:`g-${Ot(a)}`,role:l,agentName:((s=a==null?void 0:a.author)==null?void 0:s.name)||"",agentAvatarUrl:((o=a==null?void 0:a.author)==null?void 0:o.avatar_url)||null,messages:[a],items:[]})}for(const a of e){if(a.role==="system")continue;const l=[];for(const d of a.messages)for(const c of this.itemsOf(d))l.push(c);a.items=l}const t=[];for(const a of e){if(a.role!=="system"&&!a.items.length)continue;const l=t[t.length-1];if(l&&l.role!=="system"&&l.role===a.role&&(a.role==="ai"||l.agentName===a.agentName)){l.messages.push(...a.messages),l.items.push(...a.items);continue}t.push(a)}for(const a of t)a.role!=="system"&&(a.key=this.stableGroupKey(a.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=ht(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._pinFrame&&cancelAnimationFrame(this._pinFrame),this._pressTimer&&clearTimeout(this._pressTimer)},updated(){this.scheduleMeasure()},methods:{messageKey:Ot,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=Ot(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Ot(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=$f},onScroll(){const e=this.$refs.scrollEl;e&&(this.showScrollDown=!this.isAtBottom(e),!(this.loadingMore||!this.hasMore)&&(this._pendingLoadMore||e.scrollTop<=qf&&(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 d=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(d)>.5&&(e.scrollTop+=d)};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 V,re,ce;const n=e.items,r=(V=n[t])==null?void 0:V.kind,i=(re=n[t-1])==null?void 0:re.kind,s=(ce=n[t+1])==null?void 0:ce.kind,o=e.role==="user",a=14,l=4,d=i==null?void 0:i.bottom,c=s==null?void 0:s.top,m=this.widthByKey[this.rowKeyOf(e,t)],C=this.widthByKey[this.rowKeyOf(e,t-1)],b=this.widthByKey[this.rowKeyOf(e,t+1)],K=.5,S=(_e,we,G)=>_e!=null&&m!=null?_e+K>=m:we===G||we==="card"&&G==="bubble";let J=a,U=a,$=a,ne=a;return o?(d&&(U=l),(c||!s)&&($=l),d&&S(C,d,r==null?void 0:r.top)&&(J=l),c&&S(b,c,r==null?void 0:r.bottom)&&(ne=l)):(d&&(J=l),(c||!s)&&(ne=l),d&&S(C,d,r==null?void 0:r.top)&&(U=l),c&&S(b,c,r==null?void 0:r.bottom)&&($=l)),{tl:J,tr:U,br:$,bl:ne}},mosaicGridStyle(e){return!e||e<2?null:{"grid-template-columns":`repeat(${Math.min(e,4)}, 1fr)`}},mosaicCornerStyle(e,t,n){if(!t||t<2)return null;const r=Math.min(t,4),i=Math.floor(e/r),s=e%r,o=s>0,a=s<r-1&&e+1<t,l=i>0,d=e+r<t,c="4px",m={};return(o||l)&&(m["--wm-r-tl"]=c),(a||l)&&(m["--wm-r-tr"]=c),(o||d)&&(m["--wm-r-bl"]=c),(a||d)&&(m["--wm-r-br"]=c),n&&(m["--wm-r-tl"]=c,m["--wm-r-tr"]=c),Object.keys(m).length?m:null},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?`${Ot(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 Bs(new Date(e.created_at),Bt(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 Bs(new Date(n.created_at),Bt(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,l,d;const t=e==null?void 0:e.payload;if(!t)return"";if(t.state==="success")return((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"";if(t.state==="rejected"){if((s=t.rejected)!=null&&s.reason)return t.rejected.reason;const c=(a=(o=t.rejected)==null?void 0:o.metadata)==null?void 0:a.resolution,m=typeof c=="string"&&c.startsWith("admin")?"action.rejectedByAdmin":"action.rejectedByUser";return this.t(m)}return t.state==="failure"&&(((l=t.failure)==null?void 0:l.summary)||((d=t.failure)==null?void 0:d.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=Wf[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},keepPinnedToBottom(e=320){const t=this.$refs.scrollEl;if(!t)return;this._pinFrame&&cancelAnimationFrame(this._pinFrame);let n=null;const r=i=>{n===null&&(n=i),t.scrollTop=t.scrollHeight,i-n<e?this._pinFrame=requestAnimationFrame(r):this._pinFrame=null};this._pinFrame=requestAnimationFrame(r),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)}}},Yf={class:"wm-list__wrap"},Jf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Xf={class:"wm-list__loadMore-lbl"},Qf={key:1,class:"wm-list__historyEnd"},Zf={key:2,class:"wm-list__sep"},eh={class:"wm-list__sep-label"},th={key:0,class:"wm-list__sep wm-list__sep--unread"},nh={class:"wm-list__sep-label wm-list__sep-label--unread"},sh={key:0,class:"wm-list__sysep"},rh={class:"wm-list__sysep-label"},ih=["data-row-key","onPointerdown"],oh={key:0,class:"wm-list__avatarSlot"},ah={key:0},lh={key:1,"aria-hidden":"true"},ch={key:2},uh={key:0},dh={key:1,"aria-hidden":"true"},fh={key:2},hh={key:3,class:"wm-list__row wm-list__row--ai fade-up"},mh={class:"wm-list__avatarSlot"},gh=["aria-label","title"];function ph(e,t,n,r,i,s){const o=ve("AIAvatar"),a=ve("HumanAvatar"),l=ve("ActionResult"),d=ve("ArtifactRenderer"),c=ve("Bubble"),m=ve("AttachmentPreview"),C=ve("Typing");return h(),p("div",Yf,[u("div",{ref:"scrollEl",class:te(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[4]||(t[4]=(...b)=>s.onScroll&&s.onScroll(...b))},[n.loadingMore?(h(),p("div",Jf,[t[6]||(t[6]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",Xf,R(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(h(),p("div",Qf,R(s.t("messageList.conversationStart")),1)):F("",!0),n.dateLabel?(h(),p("div",Zf,[t[7]||(t[7]=u("div",{class:"wm-list__line"},null,-1)),u("span",eh,R(n.dateLabel),1),t[8]||(t[8]=u("div",{class:"wm-list__line"},null,-1))])):F("",!0),(h(!0),p(Z,null,Se(s.groups,(b,K)=>(h(),p(Z,{key:b.key},[b.key===s.unreadGroupKey?(h(),p("div",th,[t[9]||(t[9]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",nh,R(s.t("messageList.unread")),1),t[10]||(t[10]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):F("",!0),b.role==="system"||b.items.length?(h(),p("div",{key:1,class:te(["wm-list__group","wm-list__group--"+b.role])},[b.role==="system"?(h(),p("div",sh,[t[11]||(t[11]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",rh,R(b.systemLabel),1),t[12]||(t[12]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(h(),p(Z,{key:1},[(h(!0),p(Z,null,Se(b.items,(S,J)=>(h(),p(Z,{key:`${s.messageKey(S.message)}-${S.partKey}`},[u("div",{"data-row-key":`${s.messageKey(S.message)}-${S.partKey}`,class:te(["wm-list__row fade-up",["wm-list__row--"+b.role,{"is-pending":S.message._pending,"is-failed":S.message._failed}]]),style:Ce(s.cornersStyle(b,J)),onPointerdown:U=>s.onPressStart(`${s.messageKey(S.message)}-${S.partKey}`),onPointerup:t[0]||(t[0]=U=>s.onPressEnd()),onPointercancel:t[1]||(t[1]=U=>s.onPressEnd()),onPointerleave:t[2]||(t[2]=U=>s.onPressEnd()),onContextmenu:t[3]||(t[3]=We(()=>{},["prevent"]))},[b.role!=="user"?(h(),p("div",oh,[J===b.items.length-1?(h(),p(Z,{key:0},[b.role==="ai"?(h(),fe(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(h(),fe(a,{key:1,name:b.agentName,"avatar-url":b.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):F("",!0)])):F("",!0),S.renderAs==="action"?(h(),fe(l,{key:1,state:S.message.payload.state,label:s.actionLabel(S.message),detail:s.actionDetail(S.message)},null,8,["state","label","detail"])):S.renderAs==="admin-pending"?(h(),fe(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:S.message.text_md||""},null,8,["label","detail"])):S.renderAs==="artifact-of-action"?(h(),fe(d,{key:3,artifact:s.actionArtifact(S.message)},null,8,["artifact"])):S.renderAs==="artifact"?(h(),fe(d,{key:4,artifact:s.artifactOf(S.message)},null,8,["artifact"])):(h(),p("div",{key:5,class:te(["wm-list__body",{"wm-list__body--mixed":!!S.message.text_md&&s.attachmentsOf(S.message).length>0}])},[S.message.text_md?(h(),fe(c,{key:0,role:b.role,text:S.message.text_md},null,8,["role","text"])):F("",!0),s.attachmentsOf(S.message).length?(h(),p("div",{key:1,class:te(["wm-list__atts",{"wm-list__atts--align-end":b.role==="user","wm-list__atts--mosaic":s.attachmentsOf(S.message).length>=2}]),style:Ce(s.mosaicGridStyle(s.attachmentsOf(S.message).length))},[(h(!0),p(Z,null,Se(s.attachmentsOf(S.message),(U,$)=>(h(),fe(m,{key:`${s.messageKey(S.message)}-att-${$}`,attachment:U,style:Ce(s.mosaicCornerStyle($,s.attachmentsOf(S.message).length,!!S.message.text_md))},null,8,["attachment","style"]))),128))],6)):F("",!0)],2))],46,ih),J<b.items.length-1&&i.pressedItemKey===`${s.messageKey(S.message)}-${S.partKey}`&&(b.role!=="user"||s.timeOf(S.message))?(h(),p("div",{key:0,class:te(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":b.role==="user"}])},[b.role!=="user"?(h(),p("span",ah,R(s.roleLabel(b)),1)):F("",!0),b.role!=="user"&&s.timeOf(S.message)?(h(),p("span",lh,"โข")):F("",!0),s.timeOf(S.message)?(h(),p("span",ch,R(s.timeOf(S.message)),1)):F("",!0)],2)):F("",!0)],64))),128)),i.pressedItemKey===s.rowKeyOf(b,b.items.length-1)&&(b.role!=="user"||s.lastTimeOf(b))&&!s.hasTrailingOverlay(b)?(h(),p("div",{key:0,class:te(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":b.role==="user"}])},[b.role!=="user"?(h(),p("span",uh,R(s.roleLabel(b)),1)):F("",!0),b.role!=="user"&&s.lastTimeOf(b)?(h(),p("span",dh,"โข")):F("",!0),s.lastTimeOf(b)?(h(),p("span",fh,R(s.lastTimeOf(b)),1)):F("",!0)],2)):F("",!0)],64))],2)):F("",!0)],64))),128)),n.streamingActive?(h(),p("div",hh,[u("div",mh,[pe(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),pe(C)])):F("",!0)],34),pe(Qs,{name:"wm-scrollDown"},{default:Xn(()=>[i.showScrollDown?(h(),p("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]=(...b)=>s.scrollToBottomSmooth&&s.scrollToBottomSmooth(...b))},[...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,gh)):F("",!0)]),_:1})])}const _h=be(Gf,[["render",ph],["__scopeId","data-v-5a563f2b"]]),jn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",nr=typeof window<"u"&&typeof window.MediaRecorder<"u";function yh(){return nr&&["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 Eo({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function vh(){if(!jn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(Eo({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await bh(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function bh(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(d=>d?a(d):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 wh(e={}){var d;if(!jn||!nr)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(Eo({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=yh();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(m=>{m.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,m;if(s&&clearInterval(s),t.getTracks().forEach(C=>{C.stop()}),i.length){const C=r.mimeType||n||"video/webm",b=new Blob(i,{type:C}),K=/mp4/.test(C)?"mp4":"webm",S=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),J=new File([b],`ecran-${S}.${K}`,{type:C});(c=e.onfinalize)==null||c.call(e,J)}else(m=e.oncancel)==null||m.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(m=>{m.stop()}),null}(d=e.onstart)==null||d.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 kh=[{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"}],Ch={name:"WmComposer",inject:{t:{default:()=>Ee()}},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","focus","blur"],data(){return{local:this.modelValue,focused:!1,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null,kbOffset:0}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},expanded(){return this.focused||!!this.local.trim()||this.attachOpen||this.recording},attachItems(){return kh.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!jn||e.action==="record"&&(!jn||!nr)}))},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()}},onFocus(){this.focused=!0,this.$emit("focus"),this.$nextTick(()=>this.autosize())},onBlur(){this.focused=!1,this.$emit("blur"),this.$nextTick(()=>this.autosize())},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;if(!e||e.clientWidth<80)return;e.style.height="auto",e.style.minHeight="0px";const t=e.scrollHeight;e.style.minHeight="",e.style.height=t>62?`${Math.min(t,120)}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 vh();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await wh({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)}}},Sh={key:0,class:"wm-rec"},Ah={class:"wm-rec__lbl"},xh={key:1,class:"wm-compose__menu",role:"menu"},Th=["disabled","onClick"],Mh={class:"wm-compose__menuIcon"},Eh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},Oh=["d"],Rh=["placeholder","disabled"],Ih={class:"wm-compose__actions"},Lh=["title","aria-label","disabled"],Ph=["disabled","aria-label"];function Bh(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-compose-wrap",{"wm-compose-wrap--sheet":n.displayMode==="sheet"}]),style:Ce(i.kbOffset?{transform:`translateY(-${i.kbOffset}px)`}:null)},[i.recording?(h(),p("div",Sh,[t[11]||(t[11]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",Ah,R(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))},R(s.t("composer.stop")),1)])):F("",!0),u("form",{class:te(["wm-compose",{"has-attach":i.attachOpen,"is-expanded":s.expanded}]),onSubmit:t[10]||(t[10]=We((...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(),p("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):F("",!0),i.attachOpen?(h(),p("div",xh,[(h(!0),p(Z,null,Se(s.attachItems,o=>(h(),p("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",Mh,[(h(),p("svg",Eh,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Oh)]))]),u("span",null,R(o.label),1)],8,Th))),128))])):F("",!0),st(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"1",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)),onFocus:t[6]||(t[6]=(...o)=>s.onFocus&&s.onFocus(...o)),onBlur:t[7]||(t[7]=(...o)=>s.onBlur&&s.onBlur(...o))},null,40,Rh),[[kt,i.local]]),u("div",Ih,[u("button",{type:"button",class:te(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onMousedown:t[8]||(t[8]=We(()=>{},["prevent"])),onClick:t[9]||(t[9]=o=>i.attachOpen=!i.attachOpen)},[...t[12]||(t[12]=[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)])],42,Lh),u("button",{type:"submit",class:te(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[13]||(t[13]=[u("svg",{width:"16",height:"16",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,Ph)])],34)],6)}const Fh=be(Ch,[["render",Bh],["__scopeId","data-v-a9738520"]]),Dh={name:"WmInlineCallbacks",props:{items:{type:Array,default:()=>[]},variant:{type:String,default:"chips",validator:e=>e==="chips"||e==="buttons"},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("ยง")},headerTitle(){if(this.variant!=="buttons")return"";const e=this.items.find(t=>typeof(t==null?void 0:t.title)=="string"&&t.title.trim());return e?e.title.trim():""}},methods:{btnClass(e){return this.variant==="chips"?"wm-icb__btn--chip":["wm-icb__btn--action",`wm-icb__btn--${(e==null?void 0:e.style)||"neutral"}`]}}},Nh=["onClick"],Hh={key:0,class:"wm-icb__title"},Uh={class:"wm-icb__row"},jh=["onClick"];function Vh(e,t,n,r,i,s){return n.items.length?(h(),p("div",{key:s.batchKey,class:te(["wm-icb",`wm-icb--${n.variant}`])},[n.variant==="chips"?(h(!0),p(Z,{key:0},Se(n.items,(o,a)=>(h(),p("button",{key:o.id!=null?o.id:a,type:"button",class:"wm-icb__btn wm-icb__btn--chip",style:Ce({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},R(o.label),13,Nh))),128)):(h(),p(Z,{key:1},[s.headerTitle?(h(),p("div",Hh,R(s.headerTitle),1)):F("",!0),u("div",Uh,[(h(!0),p(Z,null,Se(n.items,(o,a)=>(h(),p("button",{key:o.id!=null?o.id:a,type:"button",class:te(["wm-icb__btn",s.btnClass(o)]),onClick:l=>e.$emit("select",o)},R(o.label),11,jh))),128))])],64))],2)):F("",!0)}const Kh=be(Dh,[["render",Vh],["__scopeId","data-v-c8cc8cbf"]]);let ei=0;const zh=new Set(["text","textarea","number","boolean","select","multiselect","date"]),Wh={name:"WmFormCard",components:{AIAvatar:Sn},inject:{t:{default:()=>Ee()}},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 ei+=1,{_uid:ei,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)||!zh.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}}}},$h={class:"wm-form"},qh={class:"wm-form__head"},Gh={class:"wm-form__icon"},Yh={class:"wm-form__main"},Jh={class:"wm-form__title"},Xh={key:0,class:"wm-form__detail"},Qh=["for"],Zh={key:0,class:"wm-form__req","aria-hidden":"true"},em=["id","onUpdate:modelValue","placeholder","required","disabled"],tm=["id","onUpdate:modelValue","placeholder","required","disabled"],nm=["id","onUpdate:modelValue","placeholder","required","disabled"],sm=["id","onUpdate:modelValue","required","disabled"],rm={key:4,class:"wm-form__bool"},im=["id","onUpdate:modelValue","disabled"],om=["id","onUpdate:modelValue","required","disabled"],am={value:"",disabled:""},lm=["value"],cm={key:6,class:"wm-form__multi"},um=["value","checked","disabled","onChange"],dm={key:0,class:"wm-form__err"},fm=["disabled"],hm={key:0,class:"wm-form__spinner","aria-hidden":"true"},mm={key:2,class:"wm-form__doneLbl"};function gm(e,t,n,r,i,s){const o=ve("AIAvatar");return h(),p("div",$h,[u("div",qh,[u("div",Gh,[pe(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Yh,[u("div",Jh,R(n.form.title||s.t("form.title")),1),n.form.description?(h(),p("div",Xh,R(n.form.description),1)):F("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=We((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(h(!0),p(Z,null,Se(s.normalizedFields,a=>(h(),p("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[ns(R(a.label),1),a.required?(h(),p("span",Zh,"*")):F("",!0)],8,Qh),a.type==="text"?st((h(),p("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,em)),[[kt,i.values[a.key]]]):a.type==="textarea"?st((h(),p("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,tm)),[[kt,i.values[a.key]]]):a.type==="number"?st((h(),p("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,nm)),[[kt,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?st((h(),p("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,sm)),[[kt,i.values[a.key]]]):a.type==="boolean"?(h(),p("label",rm,[st(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,im),[[Jl,i.values[a.key]]]),u("span",null,R(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?st((h(),p("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",am,R(a.placeholder||s.t("form.choose")),1),(h(!0),p(Z,null,Se(a.options,l=>(h(),p("option",{key:l.value,value:l.value},R(l.label),9,lm))),128))],8,om)),[[Xl,i.values[a.key]]]):a.type==="multiselect"?(h(),p("div",cm,[(h(!0),p(Z,null,Se(a.options,l=>(h(),p("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:d=>s.toggleMulti(a.key,l.value,d.target.checked)},null,40,um),u("span",null,R(l.label),1)]))),128))])):F("",!0)]))),128)),i.error?(h(),p("div",dm,R(i.error),1)):F("",!0),n.readOnly?(h(),p("div",mm,R(s.t("form.responseSent")),1)):(h(),p("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(h(),p("span",hm)):F("",!0),u("span",null,R(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,fm))],32)])}const pm=be(Wh,[["render",gm],["__scopeId","data-v-fe65cc56"]]),_m={name:"WmFeedback",inject:{t:{default:()=>Ee()}},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})}}},ym={class:"wm-fb"},vm={class:"wm-fb__title"},bm={class:"wm-fb__sub"},wm={class:"wm-fb__row"},km=["onClick"],Cm={class:"wm-fb__emoji"},Sm={class:"wm-fb__label"},Am=["disabled"],xm={key:1,class:"wm-fb__done"},Tm={class:"wm-fb__doneTitle"},Mm={class:"wm-fb__doneSub"};function Em(e,t,n,r,i,s){return h(),p("div",ym,[n.done?(h(),p("div",xm,[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",Tm,R(s.t("feedback.doneTitle")),1),u("div",Mm,R(s.t("feedback.doneSubtitle")),1)])):(h(),p(Z,{key:0},[u("div",vm,R(s.t("feedback.question")),1),u("div",bm,R(s.t("feedback.subtitle")),1),u("div",wm,[(h(!0),p(Z,null,Se(s.options,o=>(h(),p("button",{key:o.v,type:"button",class:te(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",Cm,R(o.e),1),u("span",Sm,R(o.l),1)],10,km))),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))},R(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,Am)],64))])}const Om=be(_m,[["render",Em],["__scopeId","data-v-9b630564"]]),Rm={name:"WmMoreMenu",inject:{t:{default:()=>Ee()}},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)}}},Im={class:"wm-mm"},Lm={class:"wm-mm__pop",role:"menu"},Pm={key:0,class:"wm-mm__section"},Bm={class:"wm-mm__label"},Fm={class:"wm-mm__label"},Dm={key:1,class:"wm-mm__sep"},Nm={class:"wm-mm__section"},Hm={class:"wm-mm__label"},Um={class:"wm-mm__section"},jm={class:"wm-mm__label"},Vm={class:"wm-mm__label"};function Km(e,t,n,r,i,s){return h(),p("div",Im,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Lm,[n.canRename||n.canExport?(h(),p("div",Pm,[n.canRename?(h(),p("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",Bm,R(s.t("moreMenu.editTitle")),1)])):F("",!0),n.canExport?(h(),p("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",Fm,R(s.t("moreMenu.exportTranscript")),1),t[8]||(t[8]=u("span",{class:"wm-mm__hint"},".txt",-1))])):F("",!0)])):F("",!0),n.canRename||n.canExport?(h(),p("div",Dm)):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[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",Hm,R(s.t("moreMenu.sound")),1),u("span",{class:te(["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",Um,[n.statusUrl?(h(),p("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,R(s.t("moreMenu.serviceStatus")),1)])):F("",!0),n.helpUrl?(h(),p("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",Vm,R(s.t("moreMenu.helpCenter")),1)])):F("",!0)])])])}const zm=be(Rm,[["render",Km],["__scopeId","data-v-4cf6d578"]]),Wm={name:"WmRenameDialog",inject:{t:{default:()=>Ee()}},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())}}},$m={class:"wm-dialog"},qm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},Gm={class:"wm-dialog__head"},Ym={class:"wm-dialog__title"},Jm=["aria-label"],Xm={class:"wm-dialog__body"},Qm=["placeholder"],Zm={class:"wm-dialog__actions"},eg=["disabled"];function tg(e,t,n,r,i,s){return h(),p("div",$m,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",qm,[u("div",Gm,[u("div",Ym,R(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,Jm)]),u("div",Xm,[st(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]=Un(We((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Un(We(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Qm),[[kt,i.value]])]),u("div",Zm,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},R(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))},R(s.t("common.save")),9,eg)])])])}const ng=be(Wm,[["render",tg],["__scopeId","data-v-6d5f94a8"]]),ti="ww-messenger-tokens",sg={name:"Messenger",components:{Launcher:Qc,Header:Cu,Onboarding:ld,History:Sd,MessageList:_h,Composer:Fh,InlineCallbacks:Kh,FormCard:pm,Feedback:Om,MoreMenu:zm,RenameDialog:ng},mixins:[Ec,Oc,Ic],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:pc},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:{},convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,launching:!1,launchStage:"idle",pendingLaunchText:"",reopenedLocally:{},activeConvId:null,showOnboarding:!1,showHistory:!1,backToHistory:!1,welcomeRevealedAt:{},welcomeRevealTimers:{},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 tr(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return Ee(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 d;const i=e[r.id]||[],s=ht(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const m=i[c];if(!m)continue;if(((d=m.author)==null?void 0:d.type)==="user")break;const C=ht(m.id);if(C!=null){if(s!=null&&C<=s)break;t[m.id]!==0&&(!a&&m.author&&(a=m.author),o++)}}if(!i.length){const c=ht(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:Ac(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=>{const r=this.convStatus(n);return r!=="resolved"&&r!=="closed"}).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:Qr(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=Qr(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||this.showHistory)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&&bc(e)?{"--wm-primary":e}:null},widgetTitle(){var e;return((e=this.widget)==null?void 0:e.title)||""},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},coverImageUrl(){var e;return((e=this.widget)==null?void 0:e.cover_image_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(){return this.currentStatus==="waiting_human_response"},isTerminal(){return this.currentStatus==="resolved"||this.currentStatus==="closed"},isClosed(){return this.currentStatus==="closed"},endedBlockVisible(){var e;return!(!this.isTerminal||this.isClosed&&this.reopenedLocally[(e=this.currentConv)==null?void 0:e.id])},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 i,s;const e=this.currentConv;if(!e)return[];const t=this.welcomeRevealedAt[e.id]>0?this.buildWelcomePrefix(e):[];if(!e._draft){const o=(s=(i=this.s)==null?void 0:i.paginationByConv)==null?void 0:s[e.id];if(!(o!=null&&o.loaded))return t}const n=this.revealedAt,r=(this.s.messagesByConv[e.id]||[]).filter(o=>{var a,l,d,c,m;return(o==null?void 0:o.type)==="action"&&((a=o==null?void 0:o.payload)==null?void 0:a.state)==="pending"||bn(o)&&!(n[o.id]>0)?!1:(o==null?void 0:o.type)==="action"||(o==null?void 0:o.type)==="system"||((l=o==null?void 0:o.payload)==null?void 0:l.type)==="system"||Array.isArray((d=o==null?void 0:o.payload)==null?void 0:d.attachments)&&o.payload.attachments.length||(c=o==null?void 0:o.metadata)!=null&&c.artifact||(m=o==null?void 0:o.metadata)!=null&&m.form||Array.isArray(o==null?void 0:o.callbacks)&&o.callbacks.some(C=>(C==null?void 0:C.intent)==="submit_form")?!0:typeof(o==null?void 0:o.text_md)=="string"&&o.text_md.trim().length>0});return t.length?[...t,...r]:r},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:this.widgetWelcomeMessage&&this.welcomeRevealedAt[e.id]===0?!0:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>bn(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])||[]:[]},pendingResolution(){var t,n,r,i,s;if(!this.currentConv)return null;const e=((n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id])||[];for(let o=e.length-1;o>=0;o--){const a=e[o];if((r=a==null?void 0:a.metadata)!=null&&r.resolution_request)return!Array.isArray(a.callbacks)||!a.callbacks.length||(s=(i=this.s)==null?void 0:i.awaitingCallback)!=null&&s[a.id]?null:a}return null},resolutionCallbacks(){const e=this.pendingResolution;if(!e||!Array.isArray(e.callbacks))return[];const t={resolve_confirm:this.t("resolution.confirm"),resolve_decline:this.t("resolution.decline")};return e.callbacks.map(n=>({...n,label:t[n.id]||n.label}))},pendingApproval(){var t,n,r,i;if(!this.currentConv)return null;const e=((n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id])||[];for(let s=e.length-1;s>=0;s--){const o=e[s];if(!(!Array.isArray(o==null?void 0:o.callbacks)||!o.callbacks.length||!o.callbacks.some(l=>(l==null?void 0:l.intent)==="approve"&&(l.audience??"customer")==="customer")))return(i=(r=this.s)==null?void 0:r.awaitingCallback)!=null&&i[o.id]?null:o}return null},approvalCallbacks(){const e=this.pendingApproval;return!e||!Array.isArray(e.callbacks)?[]:e.callbacks.filter(t=>(t==null?void 0:t.intent)==="approve"||(t==null?void 0:t.intent)==="reject")},currentStatus(){return this.convStatus(this.currentConv)},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.isTerminal?[]:this.streamingActive?[]:this.pendingForm?[]:this.conversationIsEmpty?this.starterPrompts:this.store?this.store.getLatestSuggestions(this.currentConv.id):[]:[]},conversationIsEmpty(){var n,r;const e=this.currentConv;return e?e._draft?!0:(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).length===0:!1},starterPrompts(){var n;const e=(n=this.widget)==null?void 0:n.starter_prompts;if(!Array.isArray(e))return[];const t=[];for(const r of e){if(!r||typeof r!="object")continue;const i=typeof r.title=="string"?r.title.trim():"";if(!i)continue;const s=typeof r.message=="string"?r.message.trim():"";t.push({label:i,text:s||i,kind:"starter"})}return t},pendingForm(){var e,t;return!this.currentConv||!this.store||this.actionInFlight||this.streamingActive?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.currentStatus!=="resolved"?!1:this.feedbackDone[e.id]?!0:!((t=e.metadata)!=null&&t.feedback)},floatVisible(){return!!this.pendingApproval||!!this.pendingResolution||!!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:Bs(t,Bt(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.isViewingThread&&(this.unreadAnchorId=ht((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():""),e&&this.scheduleWelcomeReveal(e)},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=ht((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},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(ti)){const e=document.createElement("style");e.id=ti,e.textContent=Ao,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.cancelWelcomeTimers(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{convStatus(e){var n,r,i,s;if(!e)return"open";const t=((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[];for(let o=t.length-1;o>=0;o--){const a=(s=(i=t[o])==null?void 0:i.metadata)==null?void 0:s.conversation_status;if(a)return a}return e.status||"open"},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=Ts(dc({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=Ts(gc(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.cancelWelcomeTimers(),this.welcomeRevealedAt={},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={},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.keepPinnedToBottom)==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,m,C,b,K,S,J;if(this.isOpen)return;const e=(m=(c=this.$el)==null?void 0:c.querySelector)==null?void 0:m.call(c,".wm-launcherWrap");if(!e)return;const t=e.getBoundingClientRect();if(!t.width||!t.height)return;const n=(((C=this.launcherPeeks)==null?void 0:C.length)??0)>0,r=16,i=Math.ceil(t.width),s=Math.ceil(t.height),o=(K=(b=this.$el)==null?void 0:b.querySelector)==null?void 0:K.call(b,".wm-launcher"),a=(J=(S=this.$el)==null?void 0:S.querySelectorAll)==null?void 0:J.call(S,".wm-peek"),l=a&&a.length?a[a.length-1]:null;let d=null;if(l){const U=l.getBoundingClientRect();d={width:Math.ceil(U.width),height:Math.ceil(U.height),rightOffset:Math.max(0,Math.ceil(t.right-U.right)),bottomOffset:Math.max(0,Math.ceil(t.bottom-U.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:d,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})},onOnboardingStart(e){this.pendingLaunchText=(e||"").trim(),this.launching=!0,this.launchStage="whiteslide"},onHomeLaunched(){const e=this.pendingLaunchText;this.pendingLaunchText="",this.startConv(),e&&this.$nextTick(()=>this.onSend(e)),this.launchStage="header",window.setTimeout(()=>{this.launching&&(this.launchStage="messages")},520),window.setTimeout(()=>{this.launching=!1,this.launchStage="idle"},1160)},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()},onReopen(){var t;const e=(t=this.currentConv)==null?void 0:t.id;e&&(this.reopenedLocally={...this.reopenedLocally,[e]:!0},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({}),n=this.welcomeRevealedAt.__draft__;return n!==void 0&&(this.welcomeRevealedAt={...this.welcomeRevealedAt,[t.id]:n>0?n:Date.now()}),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()})},buildWelcomePrefix(e){const t=this.widgetWelcomeMessage;return!t||typeof t!="string"||!t.trim()?[]:[{id:"__welcome__",text_md:t.trim(),author:{type:"agent_ia",name:this.agentName,avatar_url:this.agentAvatarUrl},created_at:(e==null?void 0:e.created_at)||new Date(0).toISOString()}]},scheduleWelcomeReveal(e){if(!e)return;const t=this.widgetWelcomeMessage;if(!t||typeof t!="string"||!t.trim()||this.welcomeRevealedAt[e]!==void 0)return;const n=this.currentConv;if(!((n==null?void 0:n._draft)||!(n!=null&&n.last_message_id))){this.welcomeRevealedAt={...this.welcomeRevealedAt,[e]:Date.now()};return}this.welcomeRevealedAt={...this.welcomeRevealedAt,[e]:0};const i=this.revealPacing,s=t.trim().length,o=Math.min(i.maxTypingMs,Math.max(i.minTypingMs,s*i.msPerChar)),a=i.firstRevealDelayMs+o,l=setTimeout(()=>{this.welcomeRevealedAt={...this.welcomeRevealedAt,[e]:Date.now()};const d={...this.welcomeRevealTimers};delete d[e],this.welcomeRevealTimers=d},a);this.welcomeRevealTimers={...this.welcomeRevealTimers,[e]:l}},cancelWelcomeTimers(){for(const e of Object.values(this.welcomeRevealTimers))try{clearTimeout(e)}catch{}this.welcomeRevealTimers={}},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":Mc(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(In(this.statusUrl))try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(In(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="";const i=r.map(s=>{const{previewUrl:o,...a}=s;return a});await this.store.send(n,e,{attachments:i.length?i:void 0})},async onSuggestion(e){const t=(e==null?void 0:e.text)||(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 onResolutionSelect(e){const t=this.pendingResolution;!t||!(e!=null&&e.id)||await this.store.clickCallback(t.id,e.id)},async onApprovalSelect(e){const t=this.pendingApproval;!t||!(e!=null&&e.id)||await this.store.clickCallback(t.id,e.id)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=kc(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:Cc(t.form,e,this.translator)}}))},formatAttachmentSize(e){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)}):""},removePendingAttachment(e){this.pendingAttachments.splice(e,1)},async onAttach(e){var t,n;if(!(!e||!this.transport))try{const r=await this.transport.uploadAttachment(e),i=(r==null?void 0:r.type)==="image"||(e.type||"").toLowerCase().startsWith("image/")||((r==null?void 0:r.mime_type)||"").toLowerCase().startsWith("image/");let s=null;if(i)try{s=await((n=(t=this.store)==null?void 0:t.signAttachment)==null?void 0:n.call(t,r.path))||null}catch{}this.pendingAttachments.push({type:r.type||"file",path:r.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size,previewUrl:s})}catch(r){console.error("[ww-messenger] attachment upload failed",r)}},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(!In(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={...this.feedbackDone,[this.currentConv.id]:!0}}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},rg={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},ig=["aria-label"],og={class:"wm-screens"},ag={key:"error",class:"wm-screen wm-state"},lg={class:"wm-state__err"},cg={class:"wm-state__errTitle"},ug={class:"wm-state__errSub"},dg={key:"chat",class:"wm-screen wm-screen--chat"},fg={class:"wm-bottom"},hg={key:0,ref:"floatEl",class:"wm-float"},mg={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},gg={class:"wm-actionWait__lbl"},pg={key:2,class:"wm-attached"},_g=["src","alt"],yg={key:1,class:"wm-attached__file"},vg={class:"wm-attached__fileMeta"},bg={class:"wm-attached__fileName"},wg={key:0,class:"wm-attached__fileSize"},kg=["aria-label","onClick"],Cg={key:3,class:"wm-ended",role:"status","aria-live":"polite"},Sg={class:"wm-ended__lbl"};function Ag(e,t,n,r,i,s){const o=ve("Launcher"),a=ve("Header"),l=ve("History"),d=ve("Onboarding"),c=ve("MessageList"),m=ve("InlineCallbacks"),C=ve("FormCard"),b=ve("Feedback"),K=ve("Composer"),S=ve("MoreMenu"),J=ve("RenameDialog");return h(),p("div",{class:te(["wm-root",`wm-root--${n.displayMode}`]),style:Ce(s.rootStyle)},[!i.isOpen&&!s.isEmbedded?(h(),fe(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(),p("section",{key:1,class:te(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv},i.launching?`wm-launch-${i.launchStage}`:""]),style:Ce(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger",onClick:t[7]||(t[7]=(...U)=>s.onPanelClick&&s.onPanelClick(...U))},[!s.ready&&!s.error?(h(),p("div",rg,[s.isEmbedded?F("",!0):(h(),p("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[8]||(t[8]=[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,ig)),t[9]||(t[9]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(h(),p(Z,{key:1},[pe(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"]),u("div",og,[pe(Qs,{name:"wm-none"},{default:Xn(()=>[s.error?(h(),p("div",ag,[u("div",lg,[t[10]||(t[10]=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",cg,R(s.t("error.connectionFailed")),1),u("div",ug,R(s.error),1)])])])):!s.currentConv&&i.showHistory?(h(),fe(l,{key:"history",class:"wm-screen",threads:s.openThreads,onResume:s.onDrawerPick},null,8,["threads","onResume"])):s.currentConv?(h(),p("div",dg,[pe(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",fg,[s.floatVisible?(h(),p("div",hg,[s.pendingApproval?(h(),fe(m,{key:`appr-${s.pendingApproval.id}`,variant:"buttons",items:s.approvalCallbacks,onSelect:s.onApprovalSelect},null,8,["items","onSelect"])):s.pendingResolution?(h(),fe(m,{key:`res-${s.pendingResolution.id}`,variant:"buttons",items:s.resolutionCallbacks,onSelect:s.onResolutionSelect},null,8,["items","onSelect"])):s.pendingForm?(h(),fe(C,{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(),fe(b,{key:3,busy:i.feedbackBusy,done:!!(s.currentConv&&i.feedbackDone[s.currentConv.id]),onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(h(),fe(m,{key:4,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):F("",!0),s.actionInFlight?(h(),p("div",mg,[t[11]||(t[11]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",gg,R(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):F("",!0),i.pendingAttachments.length?(h(),p("div",pg,[(h(!0),p(Z,null,Se(i.pendingAttachments,(U,$)=>(h(),p("div",{key:U.path||$,class:"wm-attached__item"},[U.previewUrl?(h(),p("img",{key:0,class:"wm-attached__thumb",src:U.previewUrl,alt:U.name},null,8,_g)):(h(),p("div",yg,[t[12]||(t[12]=u("span",{class:"wm-attached__fileIcon"},[u("svg",{width:"16",height:"16",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",vg,[u("span",bg,R(U.name),1),s.formatAttachmentSize(U.size_bytes)?(h(),p("span",wg,R(s.formatAttachmentSize(U.size_bytes)),1)):F("",!0)])])),u("button",{type:"button",class:"wm-attached__remove","aria-label":s.t("attachment.remove"),onClick:ne=>s.removePendingAttachment($)},[...t[13]||(t[13]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,kg)]))),128))])):F("",!0),s.endedBlockVisible?(h(),p("div",Cg,[u("span",Sg,R(s.isClosed?s.t("composer.conversationClosed"):s.t("composer.conversationEnded")),1),u("button",{type:"button",class:"wm-ended__btn",onClick:t[2]||(t[2]=U=>s.isClosed?s.onReopen():s.startConv())},R(s.isClosed?s.t("composer.reopen"):s.t("composer.newConversation")),1)])):s.actionInFlight?F("",!0):(h(),fe(K,{key:4,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[3]||(t[3]=U=>i.draft=U),placeholder:s.composerPlaceholder,"attach-label":s.t("composer.attachFile"),"display-mode":n.displayMode,onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","attach-label","display-mode","onSend","onAttach"]))]),i.moreOpen?(h(),fe(S,{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[4]||(t[4]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","status-url","help-url","onSoundToggle","onAction"])):F("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(h(),fe(J,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[5]||(t[5]=U=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):F("",!0)])):(h(),fe(d,{key:"home",class:"wm-screen",title:s.widgetTitle,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"cover-image-url":s.coverImageUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,launching:i.launching,"welcome-message":s.widgetWelcomeMessage,onStart:s.onOnboardingStart,onLaunched:s.onHomeLaunched,onSelect:s.onQuickLink,onResume:s.onDrawerPick,onViewHistory:t[1]||(t[1]=U=>i.showHistory=!0)},null,8,["title","subtitle","agent-name","default-icon-url","cover-image-url","quick-links","open-threads","busy","launching","welcome-message","onStart","onLaunched","onSelect","onResume"]))]),_:1})]),i.moreOpen&&!s.currentConv?(h(),fe(S,{key:0,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[6]||(t[6]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onAction:s.onMoreAction},null,8,["sound-enabled","status-url","help-url","onSoundToggle","onAction"])):F("",!0)],64))],6)):F("",!0)],6)}const xg=be(sg,[["render",Ag],["__scopeId","data-v-801581ca"]]),ni=window.__WIDGET_ID,si=window.__BASE_URL,Tg=window.__DISPLAY_MODE||"floating",ri=window.__LANGUAGE||"";window.__MESSENGER_IFRAME_VERSION="0.6.31";if(!ni||!si)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=Ao,document.head.appendChild(e)}sc({render:()=>wo(xg,{baseUrl:si,widgetId:ni,displayMode:Tg,...ri?{language:ri}:{}})}).mount("#app")}
|
|
72
|
+
`)}</code></pre>`});continue}if(/^\s*[-*]\s+/.test(s)){const d=[];for(;r<t.length;){const m=/^\s*[-*]\s+(.*)$/.exec(t[r]);if(!m)break;d.push(m[1]),r++}const c=d.map(m=>`<li>${nn(m)}</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 d=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 m=c.map(w=>`<li>${nn(w)}</li>`).join(""),C=d!==1?` start="${d}"`:"";n.push({type:"block",html:`<ol class="wm-md-ol"${C}>${m}</ol>`});continue}const l=/^(#{1,6})\s+(.*)$/.exec(s);if(l){const d=l[1].length;n.push({type:"block",html:`<h${d} class="wm-md-h wm-md-h${d}">${nn(l[2])}</h${d}>`}),r++;continue}n.push({type:"text",html:nn(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
|
+
`)}return i}function wn(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 ht(e){if(e==null)return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Qr(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 Ac(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 xc(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 Tc(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=xc(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 Mc(e,t,n=Ee(),r){if(!e)return;const i=Tc(e,t||[],n,Bt(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 Ec={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||!wn(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)}}}},Qt=Object.freeze({firstRevealDelayMs:450,msPerChar:50,minTypingMs:900,maxTypingMs:12e3,pauseBetweenMs:300}),Zt=(e,t)=>Number.isFinite(e)?e:t,Oc={computed:{revealPacing(){var t;const e=((t=this.widget)==null?void 0:t.reveal_pacing)||{};return{firstRevealDelayMs:Zt(e.first_reveal_delay_ms,Qt.firstRevealDelayMs),msPerChar:Zt(e.ms_per_char,Qt.msPerChar),minTypingMs:Zt(e.min_typing_ms,Qt.minTypingMs),maxTypingMs:Zt(e.max_typing_ms,Qt.maxTypingMs),pauseBetweenMs:Zt(e.pause_between_ms,Qt.pauseBetweenMs)}}},data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null,_liveHwm:{}}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n,r;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",i=>{const s=i==null?void 0:i.conversation_id,o=i==null?void 0:i.message;s&&o&&this.paceLiveMessage(o,s)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(i=>[i.id,(i==null?void 0:i.last_message_at)||""])),this._liveHwm=Object.fromEntries((((r=this.s)==null?void 0:r.conversations)||[]).map(i=>[i.id,(i==null?void 0:i.last_message_at)||""]));const t=this.transport.on("activity",i=>{this.handleLiveActivity(i)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null,this._liveHwm={}},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=this.revealPacing,r=Date.now(),i=((e==null?void 0:e.text_md)||"").length,s=Math.min(n.maxTypingMs,Math.max(n.minTypingMs,i*n.msPerChar)),a=Math.max(r+n.firstRevealDelayMs,this.nextRevealAt+n.pauseBetweenMs)+s;this.nextRevealAt=a;const l=Math.max(0,a-r),d=e.id,c=setTimeout(()=>{this.revealedAt={...this.revealedAt,[d]:Date.now()},this.revealTimers=this.revealTimers.filter(m=>m!==c),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},l);this.revealTimers.push(c)},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(!wn(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 a;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!wn(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((a=e==null?void 0:e.payload)==null?void 0:a.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const i=this._liveHwm[t],s=(e==null?void 0:e.created_at)||"";if(s&&(i===void 0||s>i)&&(this._liveHwm={...this._liveHwm,[t]:s}),!(i!==void 0&&s&&s>i)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Rc=300,Ic={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=Lc(t);if(n==null)return;const r=ht(e.last_read_message_id),i=ht(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)},Rc))))}}};function Lc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&ht(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},Pc={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":Zs(this.name)},initials(){return er(this.name)}}},Bc=["src","alt"];function Fc(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-huav",{"wm-huav--tail":n.tail}]),style:Ce({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(h(),p("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Bc)):(h(),p("span",{key:1,style:Ce({fontSize:n.size*.36+"px"})},R(s.initials),5))],6)}const rs=we(Pc,[["render",Fc],["__scopeId","data-v-14e10c0d"]]),Dc=3,Nc={name:"WmLauncher",components:{HumanAvatar:rs},inject:{t:{default:()=>Ee()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Dc).reverse()}}},Hc=["aria-label","onClick","onKeydown"],Uc=["aria-label","onClick"],jc={class:"wm-peek__avatar"},Vc=["aria-label"],Kc={class:"wm-peek__body"},zc={class:"wm-peek__head"},Wc={class:"wm-peek__name"},$c={class:"wm-peek__action"},qc={class:"wm-peek__text"},Gc=["onClick"],Yc=["aria-label"],Jc=["aria-label"];function Xc(e,t,n,r,i,s){const o=ve("HumanAvatar");return h(),p("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))},[pe(Qs,{name:"wm-peek"},{default:Xn(()=>[s.visiblePeeks.length?(h(),p("div",{key:0,class:te(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(h(!0),p(Z,null,Se(s.visiblePeeks,(a,l)=>(h(),p("div",{key:a.convId,class:"wm-peek",style:Ce({"--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:d=>e.$emit("open",a.convId),onKeydown:[Un(We(d=>e.$emit("open",a.convId),["prevent"]),["enter"]),Un(We(d=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:We(d=>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,Uc),u("div",jc,[pe(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(h(),p("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},R(a.count>9?"9+":a.count),9,Vc)):F("",!0)]),u("div",Kc,[u("div",zc,[u("span",Wc,R(a.senderName||s.t("common.agent")),1),u("span",$c,R(s.t("launcher.repliedToYou")),1)]),u("p",qc,R(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:We(d=>e.$emit("open",a.convId),["stop"])},R(s.t("common.open")),9,Gc)],44,Hc))),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(),p("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})},R(n.unreadCount>9?"9+":n.unreadCount),9,Jc)):F("",!0)],8,Yc)],32)}const Qc=we(Nc,[["render",Xc],["__scopeId","data-v-d81459bc"]]),Zc={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 er(this.name)},bgColor(){return Zs(this.name)}}},eu={key:0,class:"wm-aiav__pulse"},tu=["src","alt"],nu=["width","height"];function su(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:Ce({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(h(),p("div",eu)):F("",!0),u("div",{class:te(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:Ce(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(h(),p("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,tu)):s.initials?(h(),p("span",{key:1,style:Ce({fontSize:n.size*.36+"px"})},R(s.initials),5)):(h(),p("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,nu))],6)],6)}const Sn=we(Zc,[["render",su],["__scopeId","data-v-6f7f685d"]]),ru={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":Zs(e.name||"")},initialsFor(e){return er(e.name||"")}}},iu={key:0,class:"wm-team"},ou=["src","alt"],au={key:1},lu={key:0,class:"wm-team__label"};function cu(e,t,n,r,i,s){return s.visible?(h(),p("div",iu,[u("div",{class:"wm-team__stack",style:Ce({width:s.stackWidth+"px"})},[(h(!0),p(Z,null,Se(n.members.slice(0,3),(o,a)=>(h(),p("div",{key:a,class:"wm-team__pill",style:Ce({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(h(),p("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,ou)):(h(),p("span",au,R(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(h(),p("span",lu,R(n.responseLabel),1)):F("",!0)])):F("",!0)}const uu=we(ru,[["render",cu],["__scopeId","data-v-e49a9063"]]),du={name:"WmHeader",components:{AIAvatar:Sn,TeamAvatars:uu},inject:{t:{default:()=>Ee()}},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}}},fu={class:"wm-header"},hu=["aria-label"],mu={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},gu={class:"wm-header__avatar"},pu={class:"wm-header__main"},_u={class:"wm-header__title"},yu={key:3,class:"wm-header__fill"},vu={class:"wm-header__actions"},wu=["aria-label","title"],bu=["aria-label","title"];function ku(e,t,n,r,i,s){const o=ve("AIAvatar"),a=ve("TeamAvatars");return h(),p("div",fu,[n.showBack?(h(),p("button",{key:0,type:"button",class:"wm-header__icon wm-header__back","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,hu)):(h(),p("div",mu)),n.showIdentity?(h(),p(Z,{key:2},[u("div",gu,[pe(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",pu,[u("div",_u,R(n.title),1)]),s.hasTeam?(h(),fe(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):F("",!0)],64)):(h(),p("div",yu)),u("div",vu,[n.showMore?(h(),p("button",{key:0,type:"button",class:te(["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,wu)):F("",!0),n.showClose?(h(),p("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,bu)):F("",!0)])])}const Cu=we(du,[["render",ku],["__scopeId","data-v-27232009"]]),Zr={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"},Su={name:"WmOnboarding",components:{AIAvatar:Sn,HumanAvatar:rs},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{title:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},coverImageUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1},launching:{type:Boolean,default:!1},welcomeMessage:{type:String,default:""}},emits:["start","launched","select","resume","view-history"],data(){return{launchPhase:"idle",inputFocused:!1,launchDone:!1,starterText:""}},watch:{launching(e){e&&this.runLaunch()}},computed:{canStart(){return!this.busy&&!!this.starterText.trim()},typing(){return this.inputFocused&&!!this.starterText.trim()},heroTitle(){return this.title?this.title: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)},safeCoverUrl(){return Gr(this.coverImageUrl)},hasCover(){return!!this.safeCoverUrl},coverStyle(){return this.safeCoverUrl?{backgroundImage:`url("${this.safeCoverUrl}")`}:null}},methods:{submitStarter(){this.canStart&&this.$emit("start",this.starterText.trim())},onStarterKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.submitStarter())},onInputFocus(){this.launchPhase==="idle"&&(this.inputFocused=!0,this.$nextTick(()=>this.autosize()))},onInputBlur(){this.launchPhase==="idle"&&(this.inputFocused=!1,this.$nextTick(()=>this.autosize()))},autosize(){const e=this.$refs.starterInput;if(!e||e.clientWidth<40)return;e.style.height="auto",e.style.minHeight="0px";const t=e.scrollHeight;e.style.minHeight="",e.style.height=t>62?`${Math.min(t,120)}px`:""},async runLaunch(){const e=this.$refs.starterForm,t=typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!e||t){this.launchPhase="fade",await this.wait(t?120:0),this.finishLaunch();return}this.launchPhase="fade",await this.wait(320);const n=e.getBoundingClientRect();this.launchPhase="slide",await this.$nextTick();const r=e.getBoundingClientRect(),i=n.left-r.left,s=n.top-r.top;e.style.transition="none",e.style.transform=`translate(${i}px, ${s}px)`,e.offsetWidth,e.style.transition="transform 0.44s cubic-bezier(0.32, 0.72, 0, 1)",e.style.transform="translate(0, 0)";const o=()=>{e.removeEventListener("transitionend",o),this.finishLaunch()};e.addEventListener("transitionend",o),this.wait(520).then(()=>this.finishLaunch())},finishLaunch(){this.launchDone||(this.launchDone=!0,this.$emit("launched"))},wait(e){return new Promise(t=>window.setTimeout(t,e))},iconPath(e){return Zr[e]||Zr.link},isExternalLink(e){const t=e==null?void 0:e.url;return!!t&&!t.startsWith("#")},safeIconUrl(e){return Gr(e==null?void 0:e.icon_url)},iconUrlStyle(e){const t=this.safeIconUrl(e);return t?{"--icon-url":`url("${t}")`}:null},renderPreview(e){return Mo(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-onb__avatar--muted":null},senderLabel(e){var t;return((t=e==null?void 0:e.author)==null?void 0:t.name)||""},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Bt(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"})}}},Au=["aria-label"],xu={key:1,class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},Tu={class:"wm-onb__hero-text"},Mu={class:"wm-onb__hero-default"},Eu={class:"wm-onb__title"},Ou={class:"wm-onb__sub"},Ru={key:0,class:"wm-onb__welcome"},Iu={key:0,class:"wm-onb__alertList"},Lu=["onClick"],Pu={key:0,class:"wm-onb__defaultAvatar"},Bu=["aria-label"],Fu={class:"wm-onb__alert-body"},Du={class:"wm-onb__alert-title"},Nu={class:"wm-onb__alert-preview"},Hu={key:0,class:"wm-onb__alert-sender"},Uu=["innerHTML"],ju={class:"wm-onb__alert-meta"},Vu={key:0,class:"wm-onb__alert-time"},Ku={class:"wm-onb__alert-resume"},zu={class:"wm-onb__actions"},Wu=["onClick"],$u={class:"wm-onb__btn-icon"},qu=["aria-label"],Gu={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"},Yu=["d"],Ju={class:"wm-onb__btn-label"},Xu={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"},Qu={class:"wm-onb__btn-icon"},Zu={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"},ed=["d"],td={class:"wm-onb__btn-label"},nd={class:"wm-onb__btn-count"},sd=["placeholder","disabled","aria-label"],rd=["disabled","aria-label"],id={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},od={key:1,class:"wm-onb__starter-spinner","aria-hidden":"true"};function ad(e,t,n,r,i,s){const o=ve("AIAvatar");return h(),p("div",{class:te(["wm-onb",{"wm-onb--launching":i.launchPhase!=="idle","wm-onb--sliding":i.launchPhase==="slide","wm-onb--focused":i.inputFocused,"wm-onb--typing":s.typing}])},[u("div",{class:te(["wm-onb__hero",{"wm-onb__hero--cover":s.hasCover}])},[s.hasCover?(h(),p("div",{key:0,class:"wm-onb__cover",style:Ce(s.coverStyle),role:"img","aria-label":s.heroTitle},null,12,Au)):F("",!0),s.hasCover?F("",!0):(h(),p("svg",xu,[...t[7]||(t[7]=[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"},null,-1),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"},null,-1),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"},null,-1)])])),pe(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",Tu,[u("div",Mu,[u("div",Eu,R(s.heroTitle),1),u("div",Ou,R(s.heroSub),1)]),n.welcomeMessage?(h(),p("div",Ru,R(n.welcomeMessage),1)):F("",!0)])],2),s.unreadThreads.length?(h(),p("div",Iu,[(h(!0),p(Z,null,Se(s.unreadThreads,a=>(h(),p("button",{key:a.id,type:"button",class:"wm-onb__alert",onClick:l=>e.$emit("resume",a)},[u("span",{class:te(["wm-onb__alert-avatar",s.avatarWrapperClass(a)])},[s.isDefaultAvatar(a)?(h(),p("span",Pu,[...t[8]||(t[8]=[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)])])):(h(),fe(qs(s.avatarComponent(a)),Xs({key:1,ref_for:!0},s.avatarProps(a)),null,16)),u("span",{class:"wm-onb__alert-dot","aria-label":s.t("onboarding.unread")},null,8,Bu)],2),u("span",Fu,[u("span",Du,R(a.title),1),u("span",Nu,[s.senderLabel(a)?(h(),p("span",Hu,R(s.senderLabel(a))+" ยท ",1)):F("",!0),u("span",{innerHTML:s.renderPreview(a.preview)},null,8,Uu)])]),u("span",ju,[s.formatTs(a._ts)?(h(),p("span",Vu,R(s.formatTs(a._ts)),1)):F("",!0),u("span",Ku,R(s.t("onboarding.resume")),1)])],8,Lu))),128))])):F("",!0),u("div",zu,[(h(!0),p(Z,null,Se(n.quickLinks,(a,l)=>(h(),p("button",{key:"ql-"+l,type:"button",class:"wm-onb__btn",onClick:d=>e.$emit("select",a)},[u("span",$u,[s.safeIconUrl(a)?(h(),p("span",{key:0,class:"wm-onb__btn-iconImg",style:Ce(s.iconUrlStyle(a)),role:"img","aria-label":a.label||""},null,12,qu)):(h(),p("svg",Gu,[u("path",{d:s.iconPath(a.icon)},null,8,Yu)]))]),u("span",Ju,R(a.label),1),s.isExternalLink(a)?(h(),p("svg",Xu,[...t[9]||(t[9]=[u("path",{d:"M7 17L17 7M9 7h8v8"},null,-1)])])):F("",!0)],8,Wu))),128)),n.openThreads.length?(h(),p("button",{key:0,type:"button",class:"wm-onb__btn",onClick:t[0]||(t[0]=a=>e.$emit("view-history"))},[u("span",Qu,[(h(),p("svg",Zu,[u("path",{d:s.iconPath("chat")},null,8,ed)]))]),u("span",td,R(s.t("onboarding.allConversations")),1),u("span",nd,R(n.openThreads.length),1),t[10]||(t[10]=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),u("form",{ref:"starterForm",class:te(["wm-onb__starter",{"is-active":!!i.starterText.trim(),"is-expanded":i.inputFocused,"wm-onb__starter--toBottom":i.launchPhase==="slide"}]),onSubmit:t[6]||(t[6]=We((...a)=>s.submitStarter&&s.submitStarter(...a),["prevent"]))},[st(u("textarea",{ref:"starterInput","onUpdate:modelValue":t[1]||(t[1]=a=>i.starterText=a),class:"wm-onb__starter-input",rows:"1",placeholder:s.t("onboarding.starterPlaceholder"),disabled:n.busy,"aria-label":s.t("onboarding.start"),enterkeyhint:"send",onKeydown:t[2]||(t[2]=(...a)=>s.onStarterKeydown&&s.onStarterKeydown(...a)),onInput:t[3]||(t[3]=(...a)=>s.autosize&&s.autosize(...a)),onFocus:t[4]||(t[4]=(...a)=>s.onInputFocus&&s.onInputFocus(...a)),onBlur:t[5]||(t[5]=(...a)=>s.onInputBlur&&s.onInputBlur(...a))},null,40,sd),[[kt,i.starterText]]),u("button",{type:"submit",class:te(["wm-onb__starter-send",{"is-empty":!s.canStart}]),disabled:n.busy||!s.canStart,"aria-label":s.t("composer.send")},[n.busy?(h(),p("span",od)):(h(),p("svg",id,[...t[11]||(t[11]=[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"},null,-1)])]))],10,rd)],34)])],2)}const ld=we(Su,[["render",ad],["__scopeId","data-v-cfaffcfa"]]),cd={name:"WmHistory",components:{AIAvatar:Sn,HumanAvatar:rs},inject:{t:{default:()=>Ee()},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 Mo(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=Bt(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"})}}},ud={class:"wm-hist"},dd={class:"wm-hist__search"},fd=["placeholder","aria-label"],hd={class:"wm-hist__list"},md=["onClick"],gd={key:0,class:"wm-hist__defaultAvatar"},pd=["aria-label"],_d={class:"wm-hist__thread-body"},yd={class:"wm-hist__thread-title"},vd=["innerHTML"],wd={class:"wm-hist__thread-meta"},bd={key:0,class:"wm-hist__thread-time"},kd={key:0,class:"wm-hist__empty"};function Cd(e,t,n,r,i,s){return h(),p("div",ud,[u("div",dd,[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)),st(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,fd),[[kt,i.query]])]),u("div",hd,[(h(!0),p(Z,null,Se(s.filteredThreads,o=>(h(),p("button",{key:o.id,type:"button",class:te(["wm-hist__thread",{"wm-hist__thread--unread":o.unread}]),onClick:a=>e.$emit("resume",o)},[u("span",{class:te(["wm-hist__thread-avatar",s.avatarWrapperClass(o)])},[s.isDefaultAvatar(o)?(h(),p("span",gd,[...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(),fe(qs(s.avatarComponent(o)),Xs({key:1,ref_for:!0},s.avatarProps(o)),null,16)),o.unread?(h(),p("span",{key:2,class:"wm-hist__thread-dot","aria-label":s.t("onboarding.unread")},null,8,pd)):F("",!0)],2),u("span",_d,[u("span",yd,R(o.title),1),u("span",{class:"wm-hist__thread-preview",innerHTML:s.renderPreview(o.preview)},null,8,vd)]),u("span",wd,[s.formatTs(o._ts)?(h(),p("span",bd,R(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,md))),128)),s.filteredThreads.length?F("",!0):(h(),p("div",kd,R(i.query?s.t("onboarding.noResults",{query:i.query}):s.t("onboarding.noConversations")),1))])])}const Sd=we(cd,[["render",Cd],["__scopeId","data-v-6bf35ef1"]]);function Ad(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 xd={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return Ad(this.detail)}}},Td={class:"wm-result__icon","aria-hidden":"true"},Md={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"},Ed={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"},Od={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"},Rd={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"},Id={class:"wm-result__body"},Ld={class:"wm-result__label"},Pd={class:"wm-result__detail"};function Bd(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-result",`wm-result--${n.state}`])},[u("span",Td,[n.state==="success"?(h(),p("svg",Md,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(h(),p("svg",Ed,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(h(),p("svg",Od,[...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(),p("svg",Rd,[...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",Id,[u("span",Ld,R(n.label),1),s.detailText?(h(),p(Z,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," ยท ",-1)),u("span",Pd,R(s.detailText),1)],64)):F("",!0)])],2)}const Fd=we(xd,[["render",Bd],["__scopeId","data-v-7284acd0"]]),Dd={name:"WmArtifactFormResponse",inject:{t:{default:()=>Ee()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},Nd={class:"wm-art wm-art--formResponse"},Hd={class:"wm-art__head"},Ud={class:"wm-art__title"},jd={class:"wm-art__badge wm-art__badge--success"},Vd={class:"wm-art__body"},Kd={class:"wm-art__fieldLabel"};function zd(e,t,n,r,i,s){return h(),p("div",Nd,[u("div",Hd,[u("div",Ud,R(n.data.title||s.t("form.title")),1),u("span",jd,[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)),ns(" "+R(s.t("form.sent")),1)])]),u("div",Vd,[(h(!0),p(Z,null,Se(s.fields,(o,a)=>(h(),p("div",{key:a,class:"wm-art__field"},[u("div",Kd,R(o.label),1),u("div",{class:te(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},R(o.value),3)]))),128))])])}const Wd=we(Dd,[["render",zd],["__scopeId","data-v-713aecf1"]]),$d={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}}},qd={class:"wm-art wm-art--infoCard"},Gd={key:0,class:"wm-art__image"},Yd=["src","alt"],Jd={class:"wm-art__head"},Xd={class:"wm-art__headMain"},Qd={class:"wm-art__title"},Zd={key:0,class:"wm-art__subtitle"},ef={key:1,class:"wm-art__body"},tf={key:0,class:"wm-art__text"},nf={class:"wm-art__fieldLabel"};function sf(e,t,n,r,i,s){return h(),p("div",qd,[n.data.image_url?(h(),p("figure",Gd,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,Yd)])):F("",!0),u("div",Jd,[u("div",Xd,[u("div",Qd,R(n.data.title),1),n.data.subtitle?(h(),p("div",Zd,R(n.data.subtitle),1)):F("",!0)]),n.data.badge&&n.data.badge.label?(h(),p("span",{key:0,class:te(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},R(n.data.badge.label),3)):F("",!0)]),s.hasBody?(h(),p("div",ef,[n.data.body?(h(),p("div",tf,R(n.data.body),1)):F("",!0),s.fields.length?(h(!0),p(Z,{key:1},Se(s.fields,(o,a)=>(h(),p("div",{key:a,class:"wm-art__field"},[u("div",nf,R(o.label),1),u("div",{class:te(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},R(o.value),3)]))),128)):F("",!0)])):F("",!0)])}const rf=we($d,[["render",sf],["__scopeId","data-v-7eae0e4a"]]);function of(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 af={name:"WmArtifactTicket",inject:{t:{default:()=>Ee()},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 of((e=this.data)==null?void 0:e.created_at,Bt(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}}},lf={class:"wm-art wm-art--ticket"},cf={class:"wm-art__head wm-tk__head"},uf={class:"wm-art__title wm-tk__title"},df={class:"wm-tk__sub"},ff={class:"wm-tk__ref"},hf={key:0,class:"wm-tk__text"},mf={key:0,class:"wm-art__body"},gf={class:"wm-art__fieldLabel"},pf=["data-level"],_f={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"},yf={key:1,class:"wm-art__footer wm-tk__footer"};function vf(e,t,n,r,i,s){return h(),p("div",lf,[u("div",cf,[u("div",uf,R(n.data.title),1),u("div",df,[u("div",ff,[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,R(n.data.reference),1)]),u("span",{class:te(["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)),ns(" "+R(n.data.status.label),1)],2)]),n.data.body?(h(),p("div",hf,R(n.data.body),1)):F("",!0)]),s.fields.length?(h(),p("div",mf,[(h(!0),p(Z,null,Se(s.fields,(o,a)=>(h(),p("div",{key:a,class:"wm-art__field"},[u("div",gf,R(o.label),1),u("div",{class:te(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(h(),p("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,pf)):s.isDate(o.label)?(h(),p("svg",_f,[...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,R(o.value),1)],2)]))),128))])):F("",!0),n.data.created_at?(h(),p("div",yf,[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,R(s.formattedDate),1)])):F("",!0)])}const wf=we(af,[["render",vf],["__scopeId","data-v-5f30c914"]]),bf={form_response:Wd,info_card:rf,ticket:wf},kf={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&bf[e]||null}}};function Cf(e,t,n,r,i,s){return s.component?(h(),fe(qs(s.component),{key:0,data:n.artifact.data},null,8,["data"])):F("",!0)}const Sf=we(kf,[["render",Cf]]),Af={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>Ee()}},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()}}},xf=["href"],Tf=["src","alt"],Mf=["src"],Ef=["src"],Of=["href","download"],Rf={class:"wm-att__main"},If={class:"wm-att__name"},Lf={key:0,class:"wm-att__meta"},Pf={key:0,class:"wm-att__spin","aria-hidden":"true"};function Bf(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(h(),p("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,Tf)],8,xf)):s.kind==="audio"&&i.url?(h(),p("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,Mf)):s.kind==="video"&&i.url?(h(),p("video",{key:2,src:i.url,controls:"",playsinline:"",preload:"auto"},null,8,Ef)):(h(),p("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",Rf,[u("span",If,R(s.displayName),1),s.sizeLabel?(h(),p("span",Lf,R(s.sizeLabel),1)):F("",!0)]),i.loading?(h(),p("span",Pf)):F("",!0)],8,Of))],2)}const Ff=we(Af,[["render",Bf],["__scopeId","data-v-b207a8bd"]]),Df={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return Sc(this.text)}}},Nf=["innerHTML"];function Hf(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-bubble","wm-bubble--"+n.role])},[Fa(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,Nf)])],2)}const Uf=we(Df,[["render",Hf],["__scopeId","data-v-7ab13147"]]),jf={name:"WmTyping"},Vf={class:"wm-typing"};function Kf(e,t,n,r,i,s){return h(),p("div",Vf,[...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 zf=we(jf,[["render",Kf],["__scopeId","data-v-df2447fd"]]);function Ot(e){return e?e.client_msg_id||e.id:""}const Wf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",closed:"system.closed",reopened:"system.reopened",idle:"system.idle"},$f=80,qf=200,Gf={name:"WmMessageList",components:{AIAvatar:Sn,HumanAvatar:rs,Bubble:Uf,Typing:zf,ActionResult:Fd,AttachmentPreview:Ff,ArtifactRenderer:Sf},inject:{t:{default:()=>Ee()},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,o;const e=[];for(const a of this.messages){if((n=a==null?void 0:a.metadata)!=null&&n.resolution_request)continue;const l=this.roleOf(a);if(l==="system"){if(((r=a==null?void 0:a.payload)==null?void 0:r.event)==="action_admin_pending"){const m=e[e.length-1];m&&m.role==="ai"?m.messages.push(a):e.push({key:`g-${Ot(a)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[a],items:[]});continue}e.push({key:`sys-${Ot(a)}`,role:l,messages:[a],items:[],systemLabel:this.systemLabel(a)});continue}const d=e[e.length-1];d&&d.role===l&&(l==="ai"||d.agentName===(((i=a==null?void 0:a.author)==null?void 0:i.name)||""))?d.messages.push(a):e.push({key:`g-${Ot(a)}`,role:l,agentName:((s=a==null?void 0:a.author)==null?void 0:s.name)||"",agentAvatarUrl:((o=a==null?void 0:a.author)==null?void 0:o.avatar_url)||null,messages:[a],items:[]})}for(const a of e){if(a.role==="system")continue;const l=[];for(const d of a.messages)for(const c of this.itemsOf(d))l.push(c);a.items=l}const t=[];for(const a of e){if(a.role!=="system"&&!a.items.length)continue;const l=t[t.length-1];if(l&&l.role!=="system"&&l.role===a.role&&(a.role==="ai"||l.agentName===a.agentName)){l.messages.push(...a.messages),l.items.push(...a.items);continue}t.push(a)}for(const a of t)a.role!=="system"&&(a.key=this.stableGroupKey(a.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=ht(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._pinFrame&&cancelAnimationFrame(this._pinFrame),this._pressTimer&&clearTimeout(this._pressTimer)},updated(){this.scheduleMeasure()},methods:{messageKey:Ot,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=Ot(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Ot(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=$f},onScroll(){const e=this.$refs.scrollEl;e&&(this.showScrollDown=!this.isAtBottom(e),!(this.loadingMore||!this.hasMore)&&(this._pendingLoadMore||e.scrollTop<=qf&&(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 d=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(d)>.5&&(e.scrollTop+=d)};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 V,re,ce;const n=e.items,r=(V=n[t])==null?void 0:V.kind,i=(re=n[t-1])==null?void 0:re.kind,s=(ce=n[t+1])==null?void 0:ce.kind,o=e.role==="user",a=14,l=4,d=i==null?void 0:i.bottom,c=s==null?void 0:s.top,m=this.widthByKey[this.rowKeyOf(e,t)],C=this.widthByKey[this.rowKeyOf(e,t-1)],w=this.widthByKey[this.rowKeyOf(e,t+1)],K=.5,S=(_e,be,G)=>_e!=null&&m!=null?_e+K>=m:be===G||be==="card"&&G==="bubble";let J=a,U=a,$=a,ne=a;return o?(d&&(U=l),(c||!s)&&($=l),d&&S(C,d,r==null?void 0:r.top)&&(J=l),c&&S(w,c,r==null?void 0:r.bottom)&&(ne=l)):(d&&(J=l),(c||!s)&&(ne=l),d&&S(C,d,r==null?void 0:r.top)&&(U=l),c&&S(w,c,r==null?void 0:r.bottom)&&($=l)),{tl:J,tr:U,br:$,bl:ne}},mosaicGridStyle(e){return!e||e<2?null:{"grid-template-columns":`repeat(${Math.min(e,4)}, 1fr)`}},mosaicCornerStyle(e,t,n){if(!t||t<2)return null;const r=Math.min(t,4),i=Math.floor(e/r),s=e%r,o=s>0,a=s<r-1&&e+1<t,l=i>0,d=e+r<t,c="4px",m={};return(o||l)&&(m["--wm-r-tl"]=c),(a||l)&&(m["--wm-r-tr"]=c),(o||d)&&(m["--wm-r-bl"]=c),(a||d)&&(m["--wm-r-br"]=c),n&&(m["--wm-r-tl"]=c,m["--wm-r-tr"]=c),Object.keys(m).length?m:null},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?`${Ot(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 Bs(new Date(e.created_at),Bt(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 Bs(new Date(n.created_at),Bt(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,l,d;const t=e==null?void 0:e.payload;if(!t)return"";if(t.state==="success")return((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"";if(t.state==="rejected"){if((s=t.rejected)!=null&&s.reason)return t.rejected.reason;const c=(a=(o=t.rejected)==null?void 0:o.metadata)==null?void 0:a.resolution,m=typeof c=="string"&&c.startsWith("admin")?"action.rejectedByAdmin":"action.rejectedByUser";return this.t(m)}return t.state==="failure"&&(((l=t.failure)==null?void 0:l.summary)||((d=t.failure)==null?void 0:d.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=Wf[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},keepPinnedToBottom(e=320){const t=this.$refs.scrollEl;if(!t)return;this._pinFrame&&cancelAnimationFrame(this._pinFrame);let n=null;const r=i=>{n===null&&(n=i),t.scrollTop=t.scrollHeight,i-n<e?this._pinFrame=requestAnimationFrame(r):this._pinFrame=null};this._pinFrame=requestAnimationFrame(r),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)}}},Yf={class:"wm-list__wrap"},Jf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Xf={class:"wm-list__loadMore-lbl"},Qf={key:1,class:"wm-list__historyEnd"},Zf={key:2,class:"wm-list__sep"},eh={class:"wm-list__sep-label"},th={key:0,class:"wm-list__sep wm-list__sep--unread"},nh={class:"wm-list__sep-label wm-list__sep-label--unread"},sh={key:0,class:"wm-list__sysep"},rh={class:"wm-list__sysep-label"},ih=["data-row-key","onPointerdown"],oh={key:0,class:"wm-list__avatarSlot"},ah={key:0},lh={key:1,"aria-hidden":"true"},ch={key:2},uh={key:0},dh={key:1,"aria-hidden":"true"},fh={key:2},hh={key:3,class:"wm-list__row wm-list__row--ai fade-up"},mh={class:"wm-list__avatarSlot"},gh=["aria-label","title"];function ph(e,t,n,r,i,s){const o=ve("AIAvatar"),a=ve("HumanAvatar"),l=ve("ActionResult"),d=ve("ArtifactRenderer"),c=ve("Bubble"),m=ve("AttachmentPreview"),C=ve("Typing");return h(),p("div",Yf,[u("div",{ref:"scrollEl",class:te(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[4]||(t[4]=(...w)=>s.onScroll&&s.onScroll(...w))},[n.loadingMore?(h(),p("div",Jf,[t[6]||(t[6]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",Xf,R(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(h(),p("div",Qf,R(s.t("messageList.conversationStart")),1)):F("",!0),n.dateLabel?(h(),p("div",Zf,[t[7]||(t[7]=u("div",{class:"wm-list__line"},null,-1)),u("span",eh,R(n.dateLabel),1),t[8]||(t[8]=u("div",{class:"wm-list__line"},null,-1))])):F("",!0),(h(!0),p(Z,null,Se(s.groups,(w,K)=>(h(),p(Z,{key:w.key},[w.key===s.unreadGroupKey?(h(),p("div",th,[t[9]||(t[9]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",nh,R(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(),p("div",{key:1,class:te(["wm-list__group","wm-list__group--"+w.role])},[w.role==="system"?(h(),p("div",sh,[t[11]||(t[11]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",rh,R(w.systemLabel),1),t[12]||(t[12]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(h(),p(Z,{key:1},[(h(!0),p(Z,null,Se(w.items,(S,J)=>(h(),p(Z,{key:`${s.messageKey(S.message)}-${S.partKey}`},[u("div",{"data-row-key":`${s.messageKey(S.message)}-${S.partKey}`,class:te(["wm-list__row fade-up",["wm-list__row--"+w.role,{"is-pending":S.message._pending,"is-failed":S.message._failed}]]),style:Ce(s.cornersStyle(w,J)),onPointerdown:U=>s.onPressStart(`${s.messageKey(S.message)}-${S.partKey}`),onPointerup:t[0]||(t[0]=U=>s.onPressEnd()),onPointercancel:t[1]||(t[1]=U=>s.onPressEnd()),onPointerleave:t[2]||(t[2]=U=>s.onPressEnd()),onContextmenu:t[3]||(t[3]=We(()=>{},["prevent"]))},[w.role!=="user"?(h(),p("div",oh,[J===w.items.length-1?(h(),p(Z,{key:0},[w.role==="ai"?(h(),fe(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(h(),fe(a,{key:1,name:w.agentName,"avatar-url":w.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):F("",!0)])):F("",!0),S.renderAs==="action"?(h(),fe(l,{key:1,state:S.message.payload.state,label:s.actionLabel(S.message),detail:s.actionDetail(S.message)},null,8,["state","label","detail"])):S.renderAs==="admin-pending"?(h(),fe(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:S.message.text_md||""},null,8,["label","detail"])):S.renderAs==="artifact-of-action"?(h(),fe(d,{key:3,artifact:s.actionArtifact(S.message)},null,8,["artifact"])):S.renderAs==="artifact"?(h(),fe(d,{key:4,artifact:s.artifactOf(S.message)},null,8,["artifact"])):(h(),p("div",{key:5,class:te(["wm-list__body",{"wm-list__body--mixed":!!S.message.text_md&&s.attachmentsOf(S.message).length>0}])},[S.message.text_md?(h(),fe(c,{key:0,role:w.role,text:S.message.text_md},null,8,["role","text"])):F("",!0),s.attachmentsOf(S.message).length?(h(),p("div",{key:1,class:te(["wm-list__atts",{"wm-list__atts--align-end":w.role==="user","wm-list__atts--mosaic":s.attachmentsOf(S.message).length>=2}]),style:Ce(s.mosaicGridStyle(s.attachmentsOf(S.message).length))},[(h(!0),p(Z,null,Se(s.attachmentsOf(S.message),(U,$)=>(h(),fe(m,{key:`${s.messageKey(S.message)}-att-${$}`,attachment:U,style:Ce(s.mosaicCornerStyle($,s.attachmentsOf(S.message).length,!!S.message.text_md))},null,8,["attachment","style"]))),128))],6)):F("",!0)],2))],46,ih),J<w.items.length-1&&i.pressedItemKey===`${s.messageKey(S.message)}-${S.partKey}`&&(w.role!=="user"||s.timeOf(S.message))?(h(),p("div",{key:0,class:te(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":w.role==="user"}])},[w.role!=="user"?(h(),p("span",ah,R(s.roleLabel(w)),1)):F("",!0),w.role!=="user"&&s.timeOf(S.message)?(h(),p("span",lh,"โข")):F("",!0),s.timeOf(S.message)?(h(),p("span",ch,R(s.timeOf(S.message)),1)):F("",!0)],2)):F("",!0)],64))),128)),i.pressedItemKey===s.rowKeyOf(w,w.items.length-1)&&(w.role!=="user"||s.lastTimeOf(w))&&!s.hasTrailingOverlay(w)?(h(),p("div",{key:0,class:te(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":w.role==="user"}])},[w.role!=="user"?(h(),p("span",uh,R(s.roleLabel(w)),1)):F("",!0),w.role!=="user"&&s.lastTimeOf(w)?(h(),p("span",dh,"โข")):F("",!0),s.lastTimeOf(w)?(h(),p("span",fh,R(s.lastTimeOf(w)),1)):F("",!0)],2)):F("",!0)],64))],2)):F("",!0)],64))),128)),n.streamingActive?(h(),p("div",hh,[u("div",mh,[pe(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),pe(C)])):F("",!0)],34),pe(Qs,{name:"wm-scrollDown"},{default:Xn(()=>[i.showScrollDown?(h(),p("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,gh)):F("",!0)]),_:1})])}const _h=we(Gf,[["render",ph],["__scopeId","data-v-5a563f2b"]]),jn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",nr=typeof window<"u"&&typeof window.MediaRecorder<"u";function yh(){return nr&&["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 Eo({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function vh(){if(!jn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(Eo({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await wh(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function wh(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(d=>d?a(d):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 bh(e={}){var d;if(!jn||!nr)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(Eo({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=yh();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(m=>{m.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,m;if(s&&clearInterval(s),t.getTracks().forEach(C=>{C.stop()}),i.length){const C=r.mimeType||n||"video/webm",w=new Blob(i,{type:C}),K=/mp4/.test(C)?"mp4":"webm",S=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),J=new File([w],`ecran-${S}.${K}`,{type:C});(c=e.onfinalize)==null||c.call(e,J)}else(m=e.oncancel)==null||m.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(m=>{m.stop()}),null}(d=e.onstart)==null||d.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}}}function kh(){return typeof window.matchMedia=="function"&&window.matchMedia("(hover: none) and (pointer: coarse)").matches}const Ch=[{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"}],Sh={name:"WmComposer",inject:{t:{default:()=>Ee()}},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","focus","blur"],data(){return{local:this.modelValue,focused:!1,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null,kbOffset:0}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},expanded(){return this.focused||!!this.local.trim()||this.attachOpen||this.recording},attachItems(){return Ch.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!jn||e.action==="record"&&(!jn||!nr)}))},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"||kh())&&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()}},onFocus(){this.focused=!0,this.$emit("focus"),this.$nextTick(()=>this.autosize())},onBlur(){this.focused=!1,this.$emit("blur"),this.$nextTick(()=>this.autosize())},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;if(!e||e.clientWidth<80)return;e.style.height="auto",e.style.minHeight="0px";const t=e.scrollHeight;e.style.minHeight="",e.style.height=t>62?`${Math.min(t,120)}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 vh();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await bh({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)}}},Ah={key:0,class:"wm-rec"},xh={class:"wm-rec__lbl"},Th={key:1,class:"wm-compose__menu",role:"menu"},Mh=["disabled","onClick"],Eh={class:"wm-compose__menuIcon"},Oh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},Rh=["d"],Ih=["placeholder","disabled"],Lh={class:"wm-compose__actions"},Ph=["title","aria-label","disabled"],Bh=["disabled","aria-label"];function Fh(e,t,n,r,i,s){return h(),p("div",{class:te(["wm-compose-wrap",{"wm-compose-wrap--sheet":n.displayMode==="sheet"}]),style:Ce(i.kbOffset?{transform:`translateY(-${i.kbOffset}px)`}:null)},[i.recording?(h(),p("div",Ah,[t[11]||(t[11]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",xh,R(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))},R(s.t("composer.stop")),1)])):F("",!0),u("form",{class:te(["wm-compose",{"has-attach":i.attachOpen,"is-expanded":s.expanded}]),onSubmit:t[10]||(t[10]=We((...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(),p("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):F("",!0),i.attachOpen?(h(),p("div",Th,[(h(!0),p(Z,null,Se(s.attachItems,o=>(h(),p("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",Eh,[(h(),p("svg",Oh,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Rh)]))]),u("span",null,R(o.label),1)],8,Mh))),128))])):F("",!0),st(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"1",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)),onFocus:t[6]||(t[6]=(...o)=>s.onFocus&&s.onFocus(...o)),onBlur:t[7]||(t[7]=(...o)=>s.onBlur&&s.onBlur(...o))},null,40,Ih),[[kt,i.local]]),u("div",Lh,[u("button",{type:"button",class:te(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onMousedown:t[8]||(t[8]=We(()=>{},["prevent"])),onClick:t[9]||(t[9]=o=>i.attachOpen=!i.attachOpen)},[...t[12]||(t[12]=[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)])],42,Ph),u("button",{type:"submit",class:te(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[13]||(t[13]=[u("svg",{width:"16",height:"16",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,Bh)])],34)],6)}const Dh=we(Sh,[["render",Fh],["__scopeId","data-v-f641d642"]]),Nh={name:"WmInlineCallbacks",props:{items:{type:Array,default:()=>[]},variant:{type:String,default:"chips",validator:e=>e==="chips"||e==="buttons"},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("ยง")},headerTitle(){if(this.variant!=="buttons")return"";const e=this.items.find(t=>typeof(t==null?void 0:t.title)=="string"&&t.title.trim());return e?e.title.trim():""}},methods:{btnClass(e){return this.variant==="chips"?"wm-icb__btn--chip":["wm-icb__btn--action",`wm-icb__btn--${(e==null?void 0:e.style)||"neutral"}`]}}},Hh=["onClick"],Uh={key:0,class:"wm-icb__title"},jh={class:"wm-icb__row"},Vh=["onClick"];function Kh(e,t,n,r,i,s){return n.items.length?(h(),p("div",{key:s.batchKey,class:te(["wm-icb",`wm-icb--${n.variant}`])},[n.variant==="chips"?(h(!0),p(Z,{key:0},Se(n.items,(o,a)=>(h(),p("button",{key:o.id!=null?o.id:a,type:"button",class:"wm-icb__btn wm-icb__btn--chip",style:Ce({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},R(o.label),13,Hh))),128)):(h(),p(Z,{key:1},[s.headerTitle?(h(),p("div",Uh,R(s.headerTitle),1)):F("",!0),u("div",jh,[(h(!0),p(Z,null,Se(n.items,(o,a)=>(h(),p("button",{key:o.id!=null?o.id:a,type:"button",class:te(["wm-icb__btn",s.btnClass(o)]),onClick:l=>e.$emit("select",o)},R(o.label),11,Vh))),128))])],64))],2)):F("",!0)}const zh=we(Nh,[["render",Kh],["__scopeId","data-v-c8cc8cbf"]]);let ei=0;const Wh=new Set(["text","textarea","number","boolean","select","multiselect","date"]),$h={name:"WmFormCard",components:{AIAvatar:Sn},inject:{t:{default:()=>Ee()}},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 ei+=1,{_uid:ei,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)||!Wh.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}}}},qh={class:"wm-form"},Gh={class:"wm-form__head"},Yh={class:"wm-form__icon"},Jh={class:"wm-form__main"},Xh={class:"wm-form__title"},Qh={key:0,class:"wm-form__detail"},Zh=["for"],em={key:0,class:"wm-form__req","aria-hidden":"true"},tm=["id","onUpdate:modelValue","placeholder","required","disabled"],nm=["id","onUpdate:modelValue","placeholder","required","disabled"],sm=["id","onUpdate:modelValue","placeholder","required","disabled"],rm=["id","onUpdate:modelValue","required","disabled"],im={key:4,class:"wm-form__bool"},om=["id","onUpdate:modelValue","disabled"],am=["id","onUpdate:modelValue","required","disabled"],lm={value:"",disabled:""},cm=["value"],um={key:6,class:"wm-form__multi"},dm=["value","checked","disabled","onChange"],fm={key:0,class:"wm-form__err"},hm=["disabled"],mm={key:0,class:"wm-form__spinner","aria-hidden":"true"},gm={key:2,class:"wm-form__doneLbl"};function pm(e,t,n,r,i,s){const o=ve("AIAvatar");return h(),p("div",qh,[u("div",Gh,[u("div",Yh,[pe(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Jh,[u("div",Xh,R(n.form.title||s.t("form.title")),1),n.form.description?(h(),p("div",Qh,R(n.form.description),1)):F("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=We((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(h(!0),p(Z,null,Se(s.normalizedFields,a=>(h(),p("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[ns(R(a.label),1),a.required?(h(),p("span",em,"*")):F("",!0)],8,Zh),a.type==="text"?st((h(),p("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,tm)),[[kt,i.values[a.key]]]):a.type==="textarea"?st((h(),p("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,nm)),[[kt,i.values[a.key]]]):a.type==="number"?st((h(),p("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,sm)),[[kt,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?st((h(),p("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,rm)),[[kt,i.values[a.key]]]):a.type==="boolean"?(h(),p("label",im,[st(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,om),[[Jl,i.values[a.key]]]),u("span",null,R(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?st((h(),p("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",lm,R(a.placeholder||s.t("form.choose")),1),(h(!0),p(Z,null,Se(a.options,l=>(h(),p("option",{key:l.value,value:l.value},R(l.label),9,cm))),128))],8,am)),[[Xl,i.values[a.key]]]):a.type==="multiselect"?(h(),p("div",um,[(h(!0),p(Z,null,Se(a.options,l=>(h(),p("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:d=>s.toggleMulti(a.key,l.value,d.target.checked)},null,40,dm),u("span",null,R(l.label),1)]))),128))])):F("",!0)]))),128)),i.error?(h(),p("div",fm,R(i.error),1)):F("",!0),n.readOnly?(h(),p("div",gm,R(s.t("form.responseSent")),1)):(h(),p("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(h(),p("span",mm)):F("",!0),u("span",null,R(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,hm))],32)])}const _m=we($h,[["render",pm],["__scopeId","data-v-fe65cc56"]]),ym={name:"WmFeedback",inject:{t:{default:()=>Ee()}},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})}}},vm={class:"wm-fb"},wm={class:"wm-fb__title"},bm={class:"wm-fb__sub"},km={class:"wm-fb__row"},Cm=["onClick"],Sm={class:"wm-fb__emoji"},Am={class:"wm-fb__label"},xm=["disabled"],Tm={key:1,class:"wm-fb__done"},Mm={class:"wm-fb__doneTitle"},Em={class:"wm-fb__doneSub"};function Om(e,t,n,r,i,s){return h(),p("div",vm,[n.done?(h(),p("div",Tm,[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",Mm,R(s.t("feedback.doneTitle")),1),u("div",Em,R(s.t("feedback.doneSubtitle")),1)])):(h(),p(Z,{key:0},[u("div",wm,R(s.t("feedback.question")),1),u("div",bm,R(s.t("feedback.subtitle")),1),u("div",km,[(h(!0),p(Z,null,Se(s.options,o=>(h(),p("button",{key:o.v,type:"button",class:te(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",Sm,R(o.e),1),u("span",Am,R(o.l),1)],10,Cm))),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))},R(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,xm)],64))])}const Rm=we(ym,[["render",Om],["__scopeId","data-v-9b630564"]]),Im={name:"WmMoreMenu",inject:{t:{default:()=>Ee()}},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)}}},Lm={class:"wm-mm"},Pm={class:"wm-mm__pop",role:"menu"},Bm={key:0,class:"wm-mm__section"},Fm={class:"wm-mm__label"},Dm={class:"wm-mm__label"},Nm={key:1,class:"wm-mm__sep"},Hm={class:"wm-mm__section"},Um={class:"wm-mm__label"},jm={class:"wm-mm__section"},Vm={class:"wm-mm__label"},Km={class:"wm-mm__label"};function zm(e,t,n,r,i,s){return h(),p("div",Lm,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Pm,[n.canRename||n.canExport?(h(),p("div",Bm,[n.canRename?(h(),p("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",Fm,R(s.t("moreMenu.editTitle")),1)])):F("",!0),n.canExport?(h(),p("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",Dm,R(s.t("moreMenu.exportTranscript")),1),t[8]||(t[8]=u("span",{class:"wm-mm__hint"},".txt",-1))])):F("",!0)])):F("",!0),n.canRename||n.canExport?(h(),p("div",Nm)):F("",!0),u("div",Hm,[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",Um,R(s.t("moreMenu.sound")),1),u("span",{class:te(["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",jm,[n.statusUrl?(h(),p("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",Vm,R(s.t("moreMenu.serviceStatus")),1)])):F("",!0),n.helpUrl?(h(),p("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",Km,R(s.t("moreMenu.helpCenter")),1)])):F("",!0)])])])}const Wm=we(Im,[["render",zm],["__scopeId","data-v-4cf6d578"]]),$m={name:"WmRenameDialog",inject:{t:{default:()=>Ee()}},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())}}},qm={class:"wm-dialog"},Gm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},Ym={class:"wm-dialog__head"},Jm={class:"wm-dialog__title"},Xm=["aria-label"],Qm={class:"wm-dialog__body"},Zm=["placeholder"],eg={class:"wm-dialog__actions"},tg=["disabled"];function ng(e,t,n,r,i,s){return h(),p("div",qm,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Gm,[u("div",Ym,[u("div",Jm,R(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,Xm)]),u("div",Qm,[st(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]=Un(We((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Un(We(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Zm),[[kt,i.value]])]),u("div",eg,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},R(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))},R(s.t("common.save")),9,tg)])])])}const sg=we($m,[["render",ng],["__scopeId","data-v-6d5f94a8"]]),ti="ww-messenger-tokens",rg={name:"Messenger",components:{Launcher:Qc,Header:Cu,Onboarding:ld,History:Sd,MessageList:_h,Composer:Dh,InlineCallbacks:zh,FormCard:_m,Feedback:Rm,MoreMenu:Wm,RenameDialog:sg},mixins:[Ec,Oc,Ic],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:pc},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:{},convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,launching:!1,launchStage:"idle",pendingLaunchText:"",reopenedLocally:{},activeConvId:null,showOnboarding:!1,showHistory:!1,backToHistory:!1,welcomeRevealedAt:{},welcomeRevealTimers:{},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 tr(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return Ee(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 d;const i=e[r.id]||[],s=ht(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const m=i[c];if(!m)continue;if(((d=m.author)==null?void 0:d.type)==="user")break;const C=ht(m.id);if(C!=null){if(s!=null&&C<=s)break;t[m.id]!==0&&(!a&&m.author&&(a=m.author),o++)}}if(!i.length){const c=ht(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:Ac(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=>{const r=this.convStatus(n);return r!=="resolved"&&r!=="closed"}).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:Qr(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=Qr(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||this.showHistory)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&&wc(e)?{"--wm-primary":e}:null},widgetTitle(){var e;return((e=this.widget)==null?void 0:e.title)||""},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},coverImageUrl(){var e;return((e=this.widget)==null?void 0:e.cover_image_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(){return this.currentStatus==="waiting_human_response"},isTerminal(){return this.currentStatus==="resolved"||this.currentStatus==="closed"},isClosed(){return this.currentStatus==="closed"},endedBlockVisible(){var e;return!(!this.isTerminal||this.isClosed&&this.reopenedLocally[(e=this.currentConv)==null?void 0:e.id])},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 i,s;const e=this.currentConv;if(!e)return[];const t=this.welcomeRevealedAt[e.id]>0?this.buildWelcomePrefix(e):[];if(!e._draft){const o=(s=(i=this.s)==null?void 0:i.paginationByConv)==null?void 0:s[e.id];if(!(o!=null&&o.loaded))return t}const n=this.revealedAt,r=(this.s.messagesByConv[e.id]||[]).filter(o=>{var a,l,d,c,m;return(o==null?void 0:o.type)==="action"&&((a=o==null?void 0:o.payload)==null?void 0:a.state)==="pending"||wn(o)&&!(n[o.id]>0)?!1:(o==null?void 0:o.type)==="action"||(o==null?void 0:o.type)==="system"||((l=o==null?void 0:o.payload)==null?void 0:l.type)==="system"||Array.isArray((d=o==null?void 0:o.payload)==null?void 0:d.attachments)&&o.payload.attachments.length||(c=o==null?void 0:o.metadata)!=null&&c.artifact||(m=o==null?void 0:o.metadata)!=null&&m.form||Array.isArray(o==null?void 0:o.callbacks)&&o.callbacks.some(C=>(C==null?void 0:C.intent)==="submit_form")?!0:typeof(o==null?void 0:o.text_md)=="string"&&o.text_md.trim().length>0});return t.length?[...t,...r]:r},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:this.widgetWelcomeMessage&&this.welcomeRevealedAt[e.id]===0?!0:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>wn(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])||[]:[]},pendingResolution(){var t,n,r,i,s;if(!this.currentConv)return null;const e=((n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id])||[];for(let o=e.length-1;o>=0;o--){const a=e[o];if((r=a==null?void 0:a.metadata)!=null&&r.resolution_request)return!Array.isArray(a.callbacks)||!a.callbacks.length||(s=(i=this.s)==null?void 0:i.awaitingCallback)!=null&&s[a.id]?null:a}return null},resolutionCallbacks(){const e=this.pendingResolution;if(!e||!Array.isArray(e.callbacks))return[];const t={resolve_confirm:this.t("resolution.confirm"),resolve_decline:this.t("resolution.decline")};return e.callbacks.map(n=>({...n,label:t[n.id]||n.label}))},pendingApproval(){var t,n,r,i;if(!this.currentConv)return null;const e=((n=(t=this.s)==null?void 0:t.messagesByConv)==null?void 0:n[this.currentConv.id])||[];for(let s=e.length-1;s>=0;s--){const o=e[s];if(!(!Array.isArray(o==null?void 0:o.callbacks)||!o.callbacks.length||!o.callbacks.some(l=>(l==null?void 0:l.intent)==="approve"&&(l.audience??"customer")==="customer")))return(i=(r=this.s)==null?void 0:r.awaitingCallback)!=null&&i[o.id]?null:o}return null},approvalCallbacks(){const e=this.pendingApproval;return!e||!Array.isArray(e.callbacks)?[]:e.callbacks.filter(t=>(t==null?void 0:t.intent)==="approve"||(t==null?void 0:t.intent)==="reject")},currentStatus(){return this.convStatus(this.currentConv)},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.isTerminal?[]:this.streamingActive?[]:this.pendingForm?[]:this.conversationIsEmpty?this.starterPrompts:this.store?this.store.getLatestSuggestions(this.currentConv.id):[]:[]},conversationIsEmpty(){var n,r;const e=this.currentConv;return e?e._draft?!0:(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).length===0:!1},starterPrompts(){var n;const e=(n=this.widget)==null?void 0:n.starter_prompts;if(!Array.isArray(e))return[];const t=[];for(const r of e){if(!r||typeof r!="object")continue;const i=typeof r.title=="string"?r.title.trim():"";if(!i)continue;const s=typeof r.message=="string"?r.message.trim():"";t.push({label:i,text:s||i,kind:"starter"})}return t},pendingForm(){var e,t;return!this.currentConv||!this.store||this.actionInFlight||this.streamingActive?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.currentStatus!=="resolved"?!1:this.feedbackDone[e.id]?!0:!((t=e.metadata)!=null&&t.feedback)},floatVisible(){return!!this.pendingApproval||!!this.pendingResolution||!!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:Bs(t,Bt(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.isViewingThread&&(this.unreadAnchorId=ht((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():""),e&&this.scheduleWelcomeReveal(e)},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=ht((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},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(ti)){const e=document.createElement("style");e.id=ti,e.textContent=Ao,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.cancelWelcomeTimers(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{convStatus(e){var n,r,i,s;if(!e)return"open";const t=((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[];for(let o=t.length-1;o>=0;o--){const a=(s=(i=t[o])==null?void 0:i.metadata)==null?void 0:s.conversation_status;if(a)return a}return e.status||"open"},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=Ts(dc({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=Ts(gc(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.cancelWelcomeTimers(),this.welcomeRevealedAt={},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={},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.keepPinnedToBottom)==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,m,C,w,K,S,J;if(this.isOpen)return;const e=(m=(c=this.$el)==null?void 0:c.querySelector)==null?void 0:m.call(c,".wm-launcherWrap");if(!e)return;const t=e.getBoundingClientRect();if(!t.width||!t.height)return;const n=(((C=this.launcherPeeks)==null?void 0:C.length)??0)>0,r=16,i=Math.ceil(t.width),s=Math.ceil(t.height),o=(K=(w=this.$el)==null?void 0:w.querySelector)==null?void 0:K.call(w,".wm-launcher"),a=(J=(S=this.$el)==null?void 0:S.querySelectorAll)==null?void 0:J.call(S,".wm-peek"),l=a&&a.length?a[a.length-1]:null;let d=null;if(l){const U=l.getBoundingClientRect();d={width:Math.ceil(U.width),height:Math.ceil(U.height),rightOffset:Math.max(0,Math.ceil(t.right-U.right)),bottomOffset:Math.max(0,Math.ceil(t.bottom-U.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:d,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})},onOnboardingStart(e){this.pendingLaunchText=(e||"").trim(),this.launching=!0,this.launchStage="whiteslide"},onHomeLaunched(){const e=this.pendingLaunchText;this.pendingLaunchText="",this.startConv(),e&&this.$nextTick(()=>this.onSend(e)),this.launchStage="header",window.setTimeout(()=>{this.launching&&(this.launchStage="messages")},520),window.setTimeout(()=>{this.launching=!1,this.launchStage="idle"},1160)},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()},onReopen(){var t;const e=(t=this.currentConv)==null?void 0:t.id;e&&(this.reopenedLocally={...this.reopenedLocally,[e]:!0},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({}),n=this.welcomeRevealedAt.__draft__;return n!==void 0&&(this.welcomeRevealedAt={...this.welcomeRevealedAt,[t.id]:n>0?n:Date.now()}),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()})},buildWelcomePrefix(e){const t=this.widgetWelcomeMessage;return!t||typeof t!="string"||!t.trim()?[]:[{id:"__welcome__",text_md:t.trim(),author:{type:"agent_ia",name:this.agentName,avatar_url:this.agentAvatarUrl},created_at:(e==null?void 0:e.created_at)||new Date(0).toISOString()}]},scheduleWelcomeReveal(e){if(!e)return;const t=this.widgetWelcomeMessage;if(!t||typeof t!="string"||!t.trim()||this.welcomeRevealedAt[e]!==void 0)return;const n=this.currentConv;if(!((n==null?void 0:n._draft)||!(n!=null&&n.last_message_id))){this.welcomeRevealedAt={...this.welcomeRevealedAt,[e]:Date.now()};return}this.welcomeRevealedAt={...this.welcomeRevealedAt,[e]:0};const i=this.revealPacing,s=t.trim().length,o=Math.min(i.maxTypingMs,Math.max(i.minTypingMs,s*i.msPerChar)),a=i.firstRevealDelayMs+o,l=setTimeout(()=>{this.welcomeRevealedAt={...this.welcomeRevealedAt,[e]:Date.now()};const d={...this.welcomeRevealTimers};delete d[e],this.welcomeRevealTimers=d},a);this.welcomeRevealTimers={...this.welcomeRevealTimers,[e]:l}},cancelWelcomeTimers(){for(const e of Object.values(this.welcomeRevealTimers))try{clearTimeout(e)}catch{}this.welcomeRevealTimers={}},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":Mc(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(In(this.statusUrl))try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(In(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="";const i=r.map(s=>{const{previewUrl:o,...a}=s;return a});await this.store.send(n,e,{attachments:i.length?i:void 0})},async onSuggestion(e){const t=(e==null?void 0:e.text)||(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 onResolutionSelect(e){const t=this.pendingResolution;!t||!(e!=null&&e.id)||await this.store.clickCallback(t.id,e.id)},async onApprovalSelect(e){const t=this.pendingApproval;!t||!(e!=null&&e.id)||await this.store.clickCallback(t.id,e.id)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=kc(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:Cc(t.form,e,this.translator)}}))},formatAttachmentSize(e){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)}):""},removePendingAttachment(e){this.pendingAttachments.splice(e,1)},async onAttach(e){var t,n;if(!(!e||!this.transport))try{const r=await this.transport.uploadAttachment(e),i=(r==null?void 0:r.type)==="image"||(e.type||"").toLowerCase().startsWith("image/")||((r==null?void 0:r.mime_type)||"").toLowerCase().startsWith("image/");let s=null;if(i)try{s=await((n=(t=this.store)==null?void 0:t.signAttachment)==null?void 0:n.call(t,r.path))||null}catch{}this.pendingAttachments.push({type:r.type||"file",path:r.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size,previewUrl:s})}catch(r){console.error("[ww-messenger] attachment upload failed",r)}},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(!In(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={...this.feedbackDone,[this.currentConv.id]:!0}}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},ig={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},og=["aria-label"],ag={class:"wm-screens"},lg={key:"error",class:"wm-screen wm-state"},cg={class:"wm-state__err"},ug={class:"wm-state__errTitle"},dg={class:"wm-state__errSub"},fg={key:"chat",class:"wm-screen wm-screen--chat"},hg={class:"wm-bottom"},mg={key:0,ref:"floatEl",class:"wm-float"},gg={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},pg={class:"wm-actionWait__lbl"},_g={key:2,class:"wm-attached"},yg=["src","alt"],vg={key:1,class:"wm-attached__file"},wg={class:"wm-attached__fileMeta"},bg={class:"wm-attached__fileName"},kg={key:0,class:"wm-attached__fileSize"},Cg=["aria-label","onClick"],Sg={key:3,class:"wm-ended",role:"status","aria-live":"polite"},Ag={class:"wm-ended__lbl"};function xg(e,t,n,r,i,s){const o=ve("Launcher"),a=ve("Header"),l=ve("History"),d=ve("Onboarding"),c=ve("MessageList"),m=ve("InlineCallbacks"),C=ve("FormCard"),w=ve("Feedback"),K=ve("Composer"),S=ve("MoreMenu"),J=ve("RenameDialog");return h(),p("div",{class:te(["wm-root",`wm-root--${n.displayMode}`]),style:Ce(s.rootStyle)},[!i.isOpen&&!s.isEmbedded?(h(),fe(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(),p("section",{key:1,class:te(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv},i.launching?`wm-launch-${i.launchStage}`:""]),style:Ce(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger",onClick:t[7]||(t[7]=(...U)=>s.onPanelClick&&s.onPanelClick(...U))},[!s.ready&&!s.error?(h(),p("div",ig,[s.isEmbedded?F("",!0):(h(),p("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[8]||(t[8]=[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,og)),t[9]||(t[9]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(h(),p(Z,{key:1},[pe(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"]),u("div",ag,[pe(Qs,{name:"wm-none"},{default:Xn(()=>[s.error?(h(),p("div",lg,[u("div",cg,[t[10]||(t[10]=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",ug,R(s.t("error.connectionFailed")),1),u("div",dg,R(s.error),1)])])])):!s.currentConv&&i.showHistory?(h(),fe(l,{key:"history",class:"wm-screen",threads:s.openThreads,onResume:s.onDrawerPick},null,8,["threads","onResume"])):s.currentConv?(h(),p("div",fg,[pe(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",hg,[s.floatVisible?(h(),p("div",mg,[s.pendingApproval?(h(),fe(m,{key:`appr-${s.pendingApproval.id}`,variant:"buttons",items:s.approvalCallbacks,onSelect:s.onApprovalSelect},null,8,["items","onSelect"])):s.pendingResolution?(h(),fe(m,{key:`res-${s.pendingResolution.id}`,variant:"buttons",items:s.resolutionCallbacks,onSelect:s.onResolutionSelect},null,8,["items","onSelect"])):s.pendingForm?(h(),fe(C,{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(),fe(w,{key:3,busy:i.feedbackBusy,done:!!(s.currentConv&&i.feedbackDone[s.currentConv.id]),onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(h(),fe(m,{key:4,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):F("",!0),s.actionInFlight?(h(),p("div",gg,[t[11]||(t[11]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",pg,R(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):F("",!0),i.pendingAttachments.length?(h(),p("div",_g,[(h(!0),p(Z,null,Se(i.pendingAttachments,(U,$)=>(h(),p("div",{key:U.path||$,class:"wm-attached__item"},[U.previewUrl?(h(),p("img",{key:0,class:"wm-attached__thumb",src:U.previewUrl,alt:U.name},null,8,yg)):(h(),p("div",vg,[t[12]||(t[12]=u("span",{class:"wm-attached__fileIcon"},[u("svg",{width:"16",height:"16",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",wg,[u("span",bg,R(U.name),1),s.formatAttachmentSize(U.size_bytes)?(h(),p("span",kg,R(s.formatAttachmentSize(U.size_bytes)),1)):F("",!0)])])),u("button",{type:"button",class:"wm-attached__remove","aria-label":s.t("attachment.remove"),onClick:ne=>s.removePendingAttachment($)},[...t[13]||(t[13]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Cg)]))),128))])):F("",!0),s.endedBlockVisible?(h(),p("div",Sg,[u("span",Ag,R(s.isClosed?s.t("composer.conversationClosed"):s.t("composer.conversationEnded")),1),u("button",{type:"button",class:"wm-ended__btn",onClick:t[2]||(t[2]=U=>s.isClosed?s.onReopen():s.startConv())},R(s.isClosed?s.t("composer.reopen"):s.t("composer.newConversation")),1)])):s.actionInFlight?F("",!0):(h(),fe(K,{key:4,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[3]||(t[3]=U=>i.draft=U),placeholder:s.composerPlaceholder,"attach-label":s.t("composer.attachFile"),"display-mode":n.displayMode,onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","attach-label","display-mode","onSend","onAttach"]))]),i.moreOpen?(h(),fe(S,{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[4]||(t[4]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","status-url","help-url","onSoundToggle","onAction"])):F("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(h(),fe(J,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[5]||(t[5]=U=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):F("",!0)])):(h(),fe(d,{key:"home",class:"wm-screen",title:s.widgetTitle,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"cover-image-url":s.coverImageUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,launching:i.launching,"welcome-message":s.widgetWelcomeMessage,onStart:s.onOnboardingStart,onLaunched:s.onHomeLaunched,onSelect:s.onQuickLink,onResume:s.onDrawerPick,onViewHistory:t[1]||(t[1]=U=>i.showHistory=!0)},null,8,["title","subtitle","agent-name","default-icon-url","cover-image-url","quick-links","open-threads","busy","launching","welcome-message","onStart","onLaunched","onSelect","onResume"]))]),_:1})]),i.moreOpen&&!s.currentConv?(h(),fe(S,{key:0,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[6]||(t[6]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onAction:s.onMoreAction},null,8,["sound-enabled","status-url","help-url","onSoundToggle","onAction"])):F("",!0)],64))],6)):F("",!0)],6)}const Tg=we(rg,[["render",xg],["__scopeId","data-v-801581ca"]]),ni=window.__WIDGET_ID,si=window.__BASE_URL,Mg=window.__DISPLAY_MODE||"floating",ri=window.__LANGUAGE||"";window.__MESSENGER_IFRAME_VERSION="0.6.32";if(!ni||!si)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=Ao,document.head.appendChild(e)}sc({render:()=>bo(Tg,{baseUrl:si,widgetId:ni,displayMode:Mg,...ri?{language:ri}:{}})}).mount("#app")}
|