@_solaris/messenger-widget 0.5.39 โ†’ 0.5.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,39 +2,40 @@
2
2
  * @vue/shared v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/function Rs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fe={},Bt=[],tt=()=>{},ei=()=>!1,Dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jn=e=>e.startsWith("onUpdate:"),Ae=Object.assign,Ps=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ao=Object.prototype.hasOwnProperty,oe=(e,t)=>Ao.call(e,t),z=Array.isArray,Nt=e=>vn(e)==="[object Map]",$t=e=>vn(e)==="[object Set]",sr=e=>vn(e)==="[object Date]",X=e=>typeof e=="function",be=e=>typeof e=="string",ze=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",ti=e=>(ae(e)||X(e))&&X(e.then)&&X(e.catch),ni=Object.prototype.toString,vn=e=>ni.call(e),xo=e=>vn(e).slice(8,-1),si=e=>vn(e)==="[object Object]",Bs=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,en=Rs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},To=/-\w/g,Ne=Un(e=>e.replace(To,t=>t.slice(1).toUpperCase())),Mo=/\B([A-Z])/g,kt=Un(e=>e.replace(Mo,"-$1").toLowerCase()),Hn=Un(e=>e.charAt(0).toUpperCase()+e.slice(1)),ts=Un(e=>e?`on${Hn(e)}`:""),at=(e,t)=>!Object.is(e,t),xn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ri=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Vn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Eo=e=>{const t=be(e)?Number(e):NaN;return isNaN(t)?e:t};let rr;const $n=()=>rr||(rr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Fe(e){if(z(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=be(r)?Ro(r):Fe(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(be(e)||ae(e))return e}const Oo=/;(?![^(]*\))/g,Io=/:([^]+)/,Lo=/\/\*[^]*?\*\//g;function Ro(e){const t={};return e.replace(Lo,"").split(Oo).forEach(n=>{if(n){const r=n.split(Io);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ee(e){let t="";if(be(e))t=e;else if(z(e))for(let n=0;n<e.length;n++){const r=ee(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Po="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Bo=Rs(Po);function ii(e){return!!e||e===""}function No(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Kt(e[r],t[r]);return n}function Kt(e,t){if(e===t)return!0;let n=sr(e),r=sr(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=ze(e),r=ze(t),n||r)return e===t;if(n=z(e),r=z(t),n||r)return n&&r?No(e,t):!1;if(n=ae(e),r=ae(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,s=Object.keys(t).length;if(i!==s)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Kt(e[o],t[o]))return!1}}return String(e)===String(t)}function Ns(e,t){return e.findIndex(n=>Kt(n,t))}const oi=e=>!!(e&&e.__v_isRef===!0),I=e=>be(e)?e:e==null?"":z(e)||ae(e)&&(e.toString===ni||!X(e.toString))?oi(e)?I(e.value):JSON.stringify(e,ai,2):String(e),ai=(e,t)=>oi(t)?ai(e,t.value):Nt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[ns(r,s)+" =>"]=i,n),{})}:$t(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ns(n))}:ze(t)?ns(t):ae(t)&&!z(t)&&!si(t)?String(t):t,ns=(e,t="")=>{var n;return ze(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
5
+ **/function Rs(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fe={},Pt=[],tt=()=>{},ei=()=>!1,Dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jn=e=>e.startsWith("onUpdate:"),xe=Object.assign,Bs=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ao=Object.prototype.hasOwnProperty,oe=(e,t)=>Ao.call(e,t),z=Array.isArray,Nt=e=>vn(e)==="[object Map]",$t=e=>vn(e)==="[object Set]",sr=e=>vn(e)==="[object Date]",X=e=>typeof e=="function",be=e=>typeof e=="string",ze=e=>typeof e=="symbol",ae=e=>e!==null&&typeof e=="object",ti=e=>(ae(e)||X(e))&&X(e.then)&&X(e.catch),ni=Object.prototype.toString,vn=e=>ni.call(e),xo=e=>vn(e).slice(8,-1),si=e=>vn(e)==="[object Object]",Ps=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,en=Rs(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},To=/-\w/g,Fe=Un(e=>e.replace(To,t=>t.slice(1).toUpperCase())),Mo=/\B([A-Z])/g,kt=Un(e=>e.replace(Mo,"-$1").toLowerCase()),Hn=Un(e=>e.charAt(0).toUpperCase()+e.slice(1)),ts=Un(e=>e?`on${Hn(e)}`:""),at=(e,t)=>!Object.is(e,t),xn=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ri=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Vn=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Eo=e=>{const t=be(e)?Number(e):NaN;return isNaN(t)?e:t};let rr;const $n=()=>rr||(rr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Se(e){if(z(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=be(r)?Ro(r):Se(r);if(i)for(const s in i)t[s]=i[s]}return t}else if(be(e)||ae(e))return e}const Oo=/;(?![^(]*\))/g,Io=/:([^]+)/,Lo=/\/\*[^]*?\*\//g;function Ro(e){const t={};return e.replace(Lo,"").split(Oo).forEach(n=>{if(n){const r=n.split(Io);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ee(e){let t="";if(be(e))t=e;else if(z(e))for(let n=0;n<e.length;n++){const r=ee(e[n]);r&&(t+=r+" ")}else if(ae(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Bo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Po=Rs(Bo);function ii(e){return!!e||e===""}function No(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Kt(e[r],t[r]);return n}function Kt(e,t){if(e===t)return!0;let n=sr(e),r=sr(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=ze(e),r=ze(t),n||r)return e===t;if(n=z(e),r=z(t),n||r)return n&&r?No(e,t):!1;if(n=ae(e),r=ae(t),n||r){if(!n||!r)return!1;const i=Object.keys(e).length,s=Object.keys(t).length;if(i!==s)return!1;for(const o in e){const a=e.hasOwnProperty(o),l=t.hasOwnProperty(o);if(a&&!l||!a&&l||!Kt(e[o],t[o]))return!1}}return String(e)===String(t)}function Ns(e,t){return e.findIndex(n=>Kt(n,t))}const oi=e=>!!(e&&e.__v_isRef===!0),I=e=>be(e)?e:e==null?"":z(e)||ae(e)&&(e.toString===ni||!X(e.toString))?oi(e)?I(e.value):JSON.stringify(e,ai,2):String(e),ai=(e,t)=>oi(t)?ai(e,t.value):Nt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],s)=>(n[ns(r,s)+" =>"]=i,n),{})}:$t(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ns(n))}:ze(t)?ns(t):ae(t)&&!z(t)&&!si(t)?String(t):t,ns=(e,t="")=>{var n;return ze(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 Fo{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 Do(){return Te}let pe;const ss=new WeakSet;class li{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,ss.has(this)&&(ss.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ui(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ir(this),di(this);const t=pe,n=$e;pe=this,$e=!0;try{return this.fn()}finally{fi(this),pe=t,$e=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)js(t);this.deps=this.depsTail=void 0,ir(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ss.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_s(this)&&this.run()}get dirty(){return _s(this)}}let ci=0,tn,nn;function ui(e,t=!1){if(e.flags|=8,t){e.next=nn,nn=e;return}e.next=tn,tn=e}function Fs(){ci++}function Ds(){if(--ci>0)return;if(nn){let t=nn;for(nn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;tn;){let t=tn;for(tn=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 di(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fi(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),js(r),jo(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function _s(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(hi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function hi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===an)||(e.globalVersion=an,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_s(e))))return;e.flags|=2;const t=e.dep,n=pe,r=$e;pe=e,$e=!0;try{di(e);const i=e.fn(e._value);(t.version===0||at(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{pe=n,$e=r,fi(e),e.flags&=-3}}function js(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)js(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jo(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 mi=[];function ht(){mi.push($e),$e=!1}function mt(){const e=mi.pop();$e=e===void 0?!0:e}function ir(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pe;pe=void 0;try{t()}finally{pe=n}}}let an=0;class Uo{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class pi{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!pe||!$e||pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pe)n=this.activeLink=new Uo(pe,this),pe.deps?(n.prevDep=pe.depsTail,pe.depsTail.nextDep=n,pe.depsTail=n):pe.deps=pe.depsTail=n,gi(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=pe.depsTail,n.nextDep=void 0,pe.depsTail.nextDep=n,pe.depsTail=n,pe.deps===n&&(pe.deps=r)}return n}trigger(t){this.version++,an++,this.notify(t)}notify(t){Fs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ds()}}}function gi(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)gi(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vs=new WeakMap,It=Symbol(""),ys=Symbol(""),ln=Symbol("");function Oe(e,t,n){if($e&&pe){let r=vs.get(e);r||vs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new pi),i.map=r,i.key=n),i.track()}}function lt(e,t,n,r,i,s){const o=vs.get(e);if(!o){an++;return}const a=l=>{l&&l.trigger()};if(Fs(),t==="clear")o.forEach(a);else{const l=z(e),f=l&&Bs(n);if(l&&n==="length"){const c=Number(r);o.forEach((g,A)=>{(A==="length"||A===ln||!ze(A)&&A>=c)&&a(g)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),f&&a(o.get(ln)),t){case"add":l?f&&a(o.get("length")):(a(o.get(It)),Nt(e)&&a(o.get(ys)));break;case"delete":l||(a(o.get(It)),Nt(e)&&a(o.get(ys)));break;case"set":Nt(e)&&a(o.get(It));break}}Ds()}function Rt(e){const t=ce(e);return t===e?t:(Oe(t,"iterate",ln),Ke(e)?t:t.map(pt))}function Kn(e){return Oe(e=ce(e),"iterate",ln),e}function Ze(e,t){return bt(e)?Ut(Lt(e)?pt(t):t):pt(t)}const Ho={__proto__:null,[Symbol.iterator](){return rs(this,Symbol.iterator,e=>Ze(this,e))},concat(...e){return Rt(this).concat(...e.map(t=>z(t)?Rt(t):t))},entries(){return rs(this,"entries",e=>(e[1]=Ze(this,e[1]),e))},every(e,t){return nt(this,"every",e,t,void 0,arguments)},filter(e,t){return nt(this,"filter",e,t,n=>n.map(r=>Ze(this,r)),arguments)},find(e,t){return nt(this,"find",e,t,n=>Ze(this,n),arguments)},findIndex(e,t){return nt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return nt(this,"findLast",e,t,n=>Ze(this,n),arguments)},findLastIndex(e,t){return nt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return nt(this,"forEach",e,t,void 0,arguments)},includes(...e){return is(this,"includes",e)},indexOf(...e){return is(this,"indexOf",e)},join(e){return Rt(this).join(e)},lastIndexOf(...e){return is(this,"lastIndexOf",e)},map(e,t){return nt(this,"map",e,t,void 0,arguments)},pop(){return Gt(this,"pop")},push(...e){return Gt(this,"push",e)},reduce(e,...t){return or(this,"reduce",e,t)},reduceRight(e,...t){return or(this,"reduceRight",e,t)},shift(){return Gt(this,"shift")},some(e,t){return nt(this,"some",e,t,void 0,arguments)},splice(...e){return Gt(this,"splice",e)},toReversed(){return Rt(this).toReversed()},toSorted(e){return Rt(this).toSorted(e)},toSpliced(...e){return Rt(this).toSpliced(...e)},unshift(...e){return Gt(this,"unshift",e)},values(){return rs(this,"values",e=>Ze(this,e))}};function rs(e,t,n){const r=Kn(e),i=r[t]();return r!==e&&!Ke(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const Vo=Array.prototype;function nt(e,t,n,r,i,s){const o=Kn(e),a=o!==e&&!Ke(e),l=o[t];if(l!==Vo[t]){const g=l.apply(e,s);return a?pt(g):g}let f=n;o!==e&&(a?f=function(g,A){return n.call(this,Ze(e,g),A,e)}:n.length>2&&(f=function(g,A){return n.call(this,g,A,e)}));const c=l.call(o,f,r);return a&&i?i(c):c}function or(e,t,n,r){const i=Kn(e),s=i!==e&&!Ke(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(f,c,g){return a&&(a=!1,f=Ze(e,f)),n.call(this,f,Ze(e,c),g,e)}):n.length>3&&(o=function(f,c,g){return n.call(this,f,c,g,e)}));const l=i[t](o,...r);return a?Ze(e,l):l}function is(e,t,n){const r=ce(e);Oe(r,"iterate",ln);const i=r[t](...n);return(i===-1||i===!1)&&Vs(n[0])?(n[0]=ce(n[0]),r[t](...n)):i}function Gt(e,t,n=[]){ht(),Fs();const r=ce(e)[t].apply(e,n);return Ds(),mt(),r}const $o=Rs("__proto__,__v_isRef,__isVue"),_i=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ze));function Ko(e){ze(e)||(e=String(e));const t=ce(this);return Oe(t,"has",e),t.hasOwnProperty(e)}class vi{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?ea:ki:s?wi:bi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=z(t);if(!i){let l;if(o&&(l=Ho[n]))return l;if(n==="hasOwnProperty")return Ko}const a=Reflect.get(t,n,De(t)?t:r);if((ze(n)?_i.has(n):$o(n))||(i||Oe(t,"get",n),s))return a;if(De(a)){const l=o&&Bs(n)?a:a.value;return i&&ae(l)?ws(l):l}return ae(a)?i?ws(a):zn(a):a}}class yi extends vi{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=z(t)&&Bs(n);if(!this._isShallow){const f=bt(s);if(!Ke(r)&&!bt(r)&&(s=ce(s),r=ce(r)),!o&&De(s)&&!De(r))return f||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,De(t)?t:i);return t===ce(i)&&(a?at(r,s)&&lt(t,"set",n,r):lt(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&lt(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!ze(n)||!_i.has(n))&&Oe(t,"has",n),r}ownKeys(t){return Oe(t,"iterate",z(t)?"length":It),Reflect.ownKeys(t)}}class zo extends vi{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const qo=new yi,Wo=new zo,Go=new yi(!0);const bs=e=>e,Cn=e=>Reflect.getPrototypeOf(e);function Yo(e,t,n){return function(...r){const i=this.__v_raw,s=ce(i),o=Nt(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,f=i[e](...r),c=n?bs:t?Ut:pt;return!t&&Oe(s,"iterate",l?ys:It),Ae(Object.create(f),{next(){const{value:g,done:A}=f.next();return A?{value:g,done:A}:{value:a?[c(g[0]),c(g[1])]:c(g),done:A}}})}}function Sn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Jo(e,t){const n={get(i){const s=this.__v_raw,o=ce(s),a=ce(i);e||(at(i,a)&&Oe(o,"get",i),Oe(o,"get",a));const{has:l}=Cn(o),f=t?bs:e?Ut:pt;if(l.call(o,i))return f(s.get(i));if(l.call(o,a))return f(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Oe(ce(i),"iterate",It),i.size},has(i){const s=this.__v_raw,o=ce(s),a=ce(i);return e||(at(i,a)&&Oe(o,"has",i),Oe(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=ce(a),f=t?bs:e?Ut:pt;return!e&&Oe(l,"iterate",It),a.forEach((c,g)=>i.call(s,f(c),f(g),o))}};return Ae(n,e?{add:Sn("add"),set:Sn("set"),delete:Sn("delete"),clear:Sn("clear")}:{add(i){const s=ce(this),o=Cn(s),a=ce(i),l=!t&&!Ke(i)&&!bt(i)?a:i;return o.has.call(s,l)||at(i,l)&&o.has.call(s,i)||at(a,l)&&o.has.call(s,a)||(s.add(l),lt(s,"add",l,l)),this},set(i,s){!t&&!Ke(s)&&!bt(s)&&(s=ce(s));const o=ce(this),{has:a,get:l}=Cn(o);let f=a.call(o,i);f||(i=ce(i),f=a.call(o,i));const c=l.call(o,i);return o.set(i,s),f?at(s,c)&&lt(o,"set",i,s):lt(o,"add",i,s),this},delete(i){const s=ce(this),{has:o,get:a}=Cn(s);let l=o.call(s,i);l||(i=ce(i),l=o.call(s,i)),a&&a.call(s,i);const f=s.delete(i);return l&&lt(s,"delete",i,void 0),f},clear(){const i=ce(this),s=i.size!==0,o=i.clear();return s&&lt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Yo(i,e,t)}),n}function Us(e,t){const n=Jo(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 Xo={get:Us(!1,!1)},Qo={get:Us(!1,!0)},Zo={get:Us(!0,!1)};const bi=new WeakMap,wi=new WeakMap,ki=new WeakMap,ea=new WeakMap;function ta(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function na(e){return e.__v_skip||!Object.isExtensible(e)?0:ta(xo(e))}function zn(e){return bt(e)?e:Hs(e,!1,qo,Xo,bi)}function sa(e){return Hs(e,!1,Go,Qo,wi)}function ws(e){return Hs(e,!0,Wo,Zo,ki)}function Hs(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=na(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 Lt(e){return bt(e)?Lt(e.__v_raw):!!(e&&e.__v_isReactive)}function bt(e){return!!(e&&e.__v_isReadonly)}function Ke(e){return!!(e&&e.__v_isShallow)}function Vs(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function ks(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&ri(e,"__v_skip",!0),e}const pt=e=>ae(e)?zn(e):e,Ut=e=>ae(e)?ws(e):e;function De(e){return e?e.__v_isRef===!0:!1}function ra(e){return De(e)?e.value:e}const ia={get:(e,t,n)=>t==="__v_raw"?e:ra(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return De(i)&&!De(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ci(e){return Lt(e)?e:new Proxy(e,ia)}class oa{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new pi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=an-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return ui(this,!0),!0}get value(){const t=this.dep.track();return hi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function aa(e,t,n=!1){let r,i;return X(e)?r=e:(r=e.get,i=e.set),new oa(r,i,n)}const An={},En=new WeakMap;let Mt;function la(e,t=!1,n=Mt){if(n){let r=En.get(n);r||En.set(n,r=[]),r.push(e)}}function ca(e,t,n=fe){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,f=H=>i?H:Ke(H)||i===!1||i===0?ct(H,1):ct(H);let c,g,A,k,$=!1,T=!1;if(De(e)?(g=()=>e.value,$=Ke(e)):Lt(e)?(g=()=>f(e),$=!0):z(e)?(T=!0,$=e.some(H=>Lt(H)||Ke(H)),g=()=>e.map(H=>{if(De(H))return H.value;if(Lt(H))return f(H);if(X(H))return l?l(H,2):H()})):X(e)?t?g=l?()=>l(e,2):e:g=()=>{if(A){ht();try{A()}finally{mt()}}const H=Mt;Mt=c;try{return l?l(e,3,[k]):e(k)}finally{Mt=H}}:g=tt,t&&i){const H=g,se=i===!0?1/0:i;g=()=>ct(H(),se)}const J=Do(),U=()=>{c.stop(),J&&J.active&&Ps(J.effects,c)};if(s&&t){const H=t;t=(...se)=>{H(...se),U()}}let q=T?new Array(e.length).fill(An):An;const Z=H=>{if(!(!(c.flags&1)||!c.dirty&&!H))if(t){const se=c.run();if(i||$||(T?se.some((ge,he)=>at(ge,q[he])):at(se,q))){A&&A();const ge=Mt;Mt=c;try{const he=[se,q===An?void 0:T&&q[0]===An?[]:q,k];q=se,l?l(t,3,he):t(...he)}finally{Mt=ge}}}else c.run()};return a&&a(Z),c=new li(g),c.scheduler=o?()=>o(Z,!1):Z,k=H=>la(H,!1,c),A=c.onStop=()=>{const H=En.get(c);if(H){if(l)l(H,4);else for(const se of H)se();En.delete(c)}},t?r?Z(!0):q=c.run():o?o(Z.bind(null,!0),!0):c.run(),U.pause=c.pause.bind(c),U.resume=c.resume.bind(c),U.stop=U,U}function ct(e,t=1/0,n){if(t<=0||!ae(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,De(e))ct(e.value,t,n);else if(z(e))for(let r=0;r<e.length;r++)ct(e[r],t,n);else if($t(e)||Nt(e))e.forEach(r=>{ct(r,t,n)});else if(si(e)){for(const r in e)ct(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ct(e[r],t,n)}return e}/**
9
+ **/let Me;class Fo{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Me&&(Me.active?(this.parent=Me,this.index=(Me.scopes||(Me.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Me;try{return Me=this,t()}finally{Me=n}}}on(){++this._on===1&&(this.prevScope=Me,Me=this)}off(){if(this._on>0&&--this._on===0){if(Me===this)Me=this.prevScope;else{let t=Me;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Do(){return Me}let pe;const ss=new WeakSet;class li{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Me&&(Me.active?Me.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ss.has(this)&&(ss.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ui(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ir(this),di(this);const t=pe,n=$e;pe=this,$e=!0;try{return this.fn()}finally{fi(this),pe=t,$e=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)js(t);this.deps=this.depsTail=void 0,ir(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ss.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){_s(this)&&this.run()}get dirty(){return _s(this)}}let ci=0,tn,nn;function ui(e,t=!1){if(e.flags|=8,t){e.next=nn,nn=e;return}e.next=tn,tn=e}function Fs(){ci++}function Ds(){if(--ci>0)return;if(nn){let t=nn;for(nn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;tn;){let t=tn;for(tn=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 di(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fi(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),js(r),jo(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function _s(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(hi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function hi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===an)||(e.globalVersion=an,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_s(e))))return;e.flags|=2;const t=e.dep,n=pe,r=$e;pe=e,$e=!0;try{di(e);const i=e.fn(e._value);(t.version===0||at(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{pe=n,$e=r,fi(e),e.flags&=-3}}function js(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)js(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jo(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 mi=[];function ht(){mi.push($e),$e=!1}function mt(){const e=mi.pop();$e=e===void 0?!0:e}function ir(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=pe;pe=void 0;try{t()}finally{pe=n}}}let an=0;class Uo{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class pi{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!pe||!$e||pe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==pe)n=this.activeLink=new Uo(pe,this),pe.deps?(n.prevDep=pe.depsTail,pe.depsTail.nextDep=n,pe.depsTail=n):pe.deps=pe.depsTail=n,gi(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=pe.depsTail,n.nextDep=void 0,pe.depsTail.nextDep=n,pe.depsTail=n,pe.deps===n&&(pe.deps=r)}return n}trigger(t){this.version++,an++,this.notify(t)}notify(t){Fs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ds()}}}function gi(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)gi(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const vs=new WeakMap,It=Symbol(""),ys=Symbol(""),ln=Symbol("");function Le(e,t,n){if($e&&pe){let r=vs.get(e);r||vs.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new pi),i.map=r,i.key=n),i.track()}}function lt(e,t,n,r,i,s){const o=vs.get(e);if(!o){an++;return}const a=l=>{l&&l.trigger()};if(Fs(),t==="clear")o.forEach(a);else{const l=z(e),f=l&&Ps(n);if(l&&n==="length"){const u=Number(r);o.forEach((_,A)=>{(A==="length"||A===ln||!ze(A)&&A>=u)&&a(_)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),f&&a(o.get(ln)),t){case"add":l?f&&a(o.get("length")):(a(o.get(It)),Nt(e)&&a(o.get(ys)));break;case"delete":l||(a(o.get(It)),Nt(e)&&a(o.get(ys)));break;case"set":Nt(e)&&a(o.get(It));break}}Ds()}function Rt(e){const t=ce(e);return t===e?t:(Le(t,"iterate",ln),Ke(e)?t:t.map(pt))}function Kn(e){return Le(e=ce(e),"iterate",ln),e}function Ze(e,t){return bt(e)?Ut(Lt(e)?pt(t):t):pt(t)}const Ho={__proto__:null,[Symbol.iterator](){return rs(this,Symbol.iterator,e=>Ze(this,e))},concat(...e){return Rt(this).concat(...e.map(t=>z(t)?Rt(t):t))},entries(){return rs(this,"entries",e=>(e[1]=Ze(this,e[1]),e))},every(e,t){return nt(this,"every",e,t,void 0,arguments)},filter(e,t){return nt(this,"filter",e,t,n=>n.map(r=>Ze(this,r)),arguments)},find(e,t){return nt(this,"find",e,t,n=>Ze(this,n),arguments)},findIndex(e,t){return nt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return nt(this,"findLast",e,t,n=>Ze(this,n),arguments)},findLastIndex(e,t){return nt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return nt(this,"forEach",e,t,void 0,arguments)},includes(...e){return is(this,"includes",e)},indexOf(...e){return is(this,"indexOf",e)},join(e){return Rt(this).join(e)},lastIndexOf(...e){return is(this,"lastIndexOf",e)},map(e,t){return nt(this,"map",e,t,void 0,arguments)},pop(){return Gt(this,"pop")},push(...e){return Gt(this,"push",e)},reduce(e,...t){return or(this,"reduce",e,t)},reduceRight(e,...t){return or(this,"reduceRight",e,t)},shift(){return Gt(this,"shift")},some(e,t){return nt(this,"some",e,t,void 0,arguments)},splice(...e){return Gt(this,"splice",e)},toReversed(){return Rt(this).toReversed()},toSorted(e){return Rt(this).toSorted(e)},toSpliced(...e){return Rt(this).toSpliced(...e)},unshift(...e){return Gt(this,"unshift",e)},values(){return rs(this,"values",e=>Ze(this,e))}};function rs(e,t,n){const r=Kn(e),i=r[t]();return r!==e&&!Ke(e)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.done||(s.value=n(s.value)),s}),i}const Vo=Array.prototype;function nt(e,t,n,r,i,s){const o=Kn(e),a=o!==e&&!Ke(e),l=o[t];if(l!==Vo[t]){const _=l.apply(e,s);return a?pt(_):_}let f=n;o!==e&&(a?f=function(_,A){return n.call(this,Ze(e,_),A,e)}:n.length>2&&(f=function(_,A){return n.call(this,_,A,e)}));const u=l.call(o,f,r);return a&&i?i(u):u}function or(e,t,n,r){const i=Kn(e),s=i!==e&&!Ke(e);let o=n,a=!1;i!==e&&(s?(a=r.length===0,o=function(f,u,_){return a&&(a=!1,f=Ze(e,f)),n.call(this,f,Ze(e,u),_,e)}):n.length>3&&(o=function(f,u,_){return n.call(this,f,u,_,e)}));const l=i[t](o,...r);return a?Ze(e,l):l}function is(e,t,n){const r=ce(e);Le(r,"iterate",ln);const i=r[t](...n);return(i===-1||i===!1)&&Vs(n[0])?(n[0]=ce(n[0]),r[t](...n)):i}function Gt(e,t,n=[]){ht(),Fs();const r=ce(e)[t].apply(e,n);return Ds(),mt(),r}const $o=Rs("__proto__,__v_isRef,__isVue"),_i=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ze));function Ko(e){ze(e)||(e=String(e));const t=ce(this);return Le(t,"has",e),t.hasOwnProperty(e)}class vi{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?ea:ki:s?wi:bi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=z(t);if(!i){let l;if(o&&(l=Ho[n]))return l;if(n==="hasOwnProperty")return Ko}const a=Reflect.get(t,n,De(t)?t:r);if((ze(n)?_i.has(n):$o(n))||(i||Le(t,"get",n),s))return a;if(De(a)){const l=o&&Ps(n)?a:a.value;return i&&ae(l)?ws(l):l}return ae(a)?i?ws(a):zn(a):a}}class yi extends vi{constructor(t=!1){super(!1,t)}set(t,n,r,i){let s=t[n];const o=z(t)&&Ps(n);if(!this._isShallow){const f=bt(s);if(!Ke(r)&&!bt(r)&&(s=ce(s),r=ce(r)),!o&&De(s)&&!De(r))return f||(s.value=r),!0}const a=o?Number(n)<t.length:oe(t,n),l=Reflect.set(t,n,r,De(t)?t:i);return t===ce(i)&&(a?at(r,s)&&lt(t,"set",n,r):lt(t,"add",n,r)),l}deleteProperty(t,n){const r=oe(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&r&&lt(t,"delete",n,void 0),i}has(t,n){const r=Reflect.has(t,n);return(!ze(n)||!_i.has(n))&&Le(t,"has",n),r}ownKeys(t){return Le(t,"iterate",z(t)?"length":It),Reflect.ownKeys(t)}}class zo extends vi{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const qo=new yi,Wo=new zo,Go=new yi(!0);const bs=e=>e,Cn=e=>Reflect.getPrototypeOf(e);function Yo(e,t,n){return function(...r){const i=this.__v_raw,s=ce(i),o=Nt(s),a=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,f=i[e](...r),u=n?bs:t?Ut:pt;return!t&&Le(s,"iterate",l?ys:It),xe(Object.create(f),{next(){const{value:_,done:A}=f.next();return A?{value:_,done:A}:{value:a?[u(_[0]),u(_[1])]:u(_),done:A}}})}}function Sn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Jo(e,t){const n={get(i){const s=this.__v_raw,o=ce(s),a=ce(i);e||(at(i,a)&&Le(o,"get",i),Le(o,"get",a));const{has:l}=Cn(o),f=t?bs:e?Ut:pt;if(l.call(o,i))return f(s.get(i));if(l.call(o,a))return f(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!e&&Le(ce(i),"iterate",It),i.size},has(i){const s=this.__v_raw,o=ce(s),a=ce(i);return e||(at(i,a)&&Le(o,"has",i),Le(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=ce(a),f=t?bs:e?Ut:pt;return!e&&Le(l,"iterate",It),a.forEach((u,_)=>i.call(s,f(u),f(_),o))}};return xe(n,e?{add:Sn("add"),set:Sn("set"),delete:Sn("delete"),clear:Sn("clear")}:{add(i){const s=ce(this),o=Cn(s),a=ce(i),l=!t&&!Ke(i)&&!bt(i)?a:i;return o.has.call(s,l)||at(i,l)&&o.has.call(s,i)||at(a,l)&&o.has.call(s,a)||(s.add(l),lt(s,"add",l,l)),this},set(i,s){!t&&!Ke(s)&&!bt(s)&&(s=ce(s));const o=ce(this),{has:a,get:l}=Cn(o);let f=a.call(o,i);f||(i=ce(i),f=a.call(o,i));const u=l.call(o,i);return o.set(i,s),f?at(s,u)&&lt(o,"set",i,s):lt(o,"add",i,s),this},delete(i){const s=ce(this),{has:o,get:a}=Cn(s);let l=o.call(s,i);l||(i=ce(i),l=o.call(s,i)),a&&a.call(s,i);const f=s.delete(i);return l&&lt(s,"delete",i,void 0),f},clear(){const i=ce(this),s=i.size!==0,o=i.clear();return s&&lt(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Yo(i,e,t)}),n}function Us(e,t){const n=Jo(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 Xo={get:Us(!1,!1)},Qo={get:Us(!1,!0)},Zo={get:Us(!0,!1)};const bi=new WeakMap,wi=new WeakMap,ki=new WeakMap,ea=new WeakMap;function ta(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function na(e){return e.__v_skip||!Object.isExtensible(e)?0:ta(xo(e))}function zn(e){return bt(e)?e:Hs(e,!1,qo,Xo,bi)}function sa(e){return Hs(e,!1,Go,Qo,wi)}function ws(e){return Hs(e,!0,Wo,Zo,ki)}function Hs(e,t,n,r,i){if(!ae(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=na(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 Lt(e){return bt(e)?Lt(e.__v_raw):!!(e&&e.__v_isReactive)}function bt(e){return!!(e&&e.__v_isReadonly)}function Ke(e){return!!(e&&e.__v_isShallow)}function Vs(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function ks(e){return!oe(e,"__v_skip")&&Object.isExtensible(e)&&ri(e,"__v_skip",!0),e}const pt=e=>ae(e)?zn(e):e,Ut=e=>ae(e)?ws(e):e;function De(e){return e?e.__v_isRef===!0:!1}function ra(e){return De(e)?e.value:e}const ia={get:(e,t,n)=>t==="__v_raw"?e:ra(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return De(i)&&!De(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ci(e){return Lt(e)?e:new Proxy(e,ia)}class oa{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new pi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=an-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&pe!==this)return ui(this,!0),!0}get value(){const t=this.dep.track();return hi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function aa(e,t,n=!1){let r,i;return X(e)?r=e:(r=e.get,i=e.set),new oa(r,i,n)}const An={},En=new WeakMap;let Mt;function la(e,t=!1,n=Mt){if(n){let r=En.get(n);r||En.set(n,r=[]),r.push(e)}}function ca(e,t,n=fe){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,f=H=>i?H:Ke(H)||i===!1||i===0?ct(H,1):ct(H);let u,_,A,k,$=!1,T=!1;if(De(e)?(_=()=>e.value,$=Ke(e)):Lt(e)?(_=()=>f(e),$=!0):z(e)?(T=!0,$=e.some(H=>Lt(H)||Ke(H)),_=()=>e.map(H=>{if(De(H))return H.value;if(Lt(H))return f(H);if(X(H))return l?l(H,2):H()})):X(e)?t?_=l?()=>l(e,2):e:_=()=>{if(A){ht();try{A()}finally{mt()}}const H=Mt;Mt=u;try{return l?l(e,3,[k]):e(k)}finally{Mt=H}}:_=tt,t&&i){const H=_,se=i===!0?1/0:i;_=()=>ct(H(),se)}const J=Do(),U=()=>{u.stop(),J&&J.active&&Bs(J.effects,u)};if(s&&t){const H=t;t=(...se)=>{H(...se),U()}}let q=T?new Array(e.length).fill(An):An;const Z=H=>{if(!(!(u.flags&1)||!u.dirty&&!H))if(t){const se=u.run();if(i||$||(T?se.some((ge,he)=>at(ge,q[he])):at(se,q))){A&&A();const ge=Mt;Mt=u;try{const he=[se,q===An?void 0:T&&q[0]===An?[]:q,k];q=se,l?l(t,3,he):t(...he)}finally{Mt=ge}}}else u.run()};return a&&a(Z),u=new li(_),u.scheduler=o?()=>o(Z,!1):Z,k=H=>la(H,!1,u),A=u.onStop=()=>{const H=En.get(u);if(H){if(l)l(H,4);else for(const se of H)se();En.delete(u)}},t?r?Z(!0):q=u.run():o?o(Z.bind(null,!0),!0):u.run(),U.pause=u.pause.bind(u),U.resume=u.resume.bind(u),U.stop=U,U}function ct(e,t=1/0,n){if(t<=0||!ae(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,De(e))ct(e.value,t,n);else if(z(e))for(let r=0;r<e.length;r++)ct(e[r],t,n);else if($t(e)||Nt(e))e.forEach(r=>{ct(r,t,n)});else if(si(e)){for(const r in e)ct(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ct(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 yn(e,t,n,r){try{return r?e(...r):e()}catch(i){qn(i,t,n)}}function qe(e,t,n,r){if(X(e)){const i=yn(e,t,n,r);return i&&ti(i)&&i.catch(s=>{qn(s,t,n)}),i}if(z(e)){const i=[];for(let s=0;s<e.length;s++)i.push(qe(e[s],t,n,r));return i}}function qn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||fe;if(t){let a=t.parent;const l=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let g=0;g<c.length;g++)if(c[g](e,l,f)===!1)return}a=a.parent}if(s){ht(),yn(s,null,10,[e,l,f]),mt();return}}ua(e,n,i,r,o)}function ua(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Be=[];let Xe=-1;const Ft=[];let vt=null,Pt=0;const Si=Promise.resolve();let On=null;function Ai(e){const t=On||Si;return e?t.then(this?e.bind(this):e):t}function da(e){let t=Xe+1,n=Be.length;for(;t<n;){const r=t+n>>>1,i=Be[r],s=cn(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function $s(e){if(!(e.flags&1)){const t=cn(e),n=Be[Be.length-1];!n||!(e.flags&2)&&t>=cn(n)?Be.push(e):Be.splice(da(t),0,e),e.flags|=1,xi()}}function xi(){On||(On=Si.then(Mi))}function fa(e){z(e)?Ft.push(...e):vt&&e.id===-1?vt.splice(Pt+1,0,e):e.flags&1||(Ft.push(e),e.flags|=1),xi()}function ar(e,t,n=Xe+1){for(;n<Be.length;n++){const r=Be[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Be.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ti(e){if(Ft.length){const t=[...new Set(Ft)].sort((n,r)=>cn(n)-cn(r));if(Ft.length=0,vt){vt.push(...t);return}for(vt=t,Pt=0;Pt<vt.length;Pt++){const n=vt[Pt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}vt=null,Pt=0}}const cn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Mi(e){try{for(Xe=0;Xe<Be.length;Xe++){const t=Be[Xe];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),yn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Xe<Be.length;Xe++){const t=Be[Xe];t&&(t.flags&=-2)}Xe=-1,Be.length=0,Ti(),On=null,(Be.length||Ft.length)&&Mi()}}let Me=null,Ei=null;function In(e){const t=Me;return Me=e,Ei=e&&e.type.__scopeId||null,t}function Ks(e,t=Me,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Pn(-1);const s=In(t);let o;try{o=e(...i)}finally{In(s),r._d&&Pn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function it(e,t){if(Me===null)return e;const n=Qn(Me),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=fe]=t[i];s&&(X(s)&&(s={mounted:s,updated:s}),s.deep&&ct(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ct(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&&(ht(),qe(l,n,8,[e.el,a,e,t]),mt())}}function ha(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 Tn(e,t,n=!1){const r=ho();if(r||jt){let i=jt?jt._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&X(t)?t.call(r&&r.proxy):t}}const ma=Symbol.for("v-scx"),pa=()=>Tn(ma);function os(e,t,n){return Oi(e,t,n)}function Oi(e,t,n=fe){const{immediate:r,deep:i,flush:s,once:o}=n,a=Ae({},n),l=t&&r||!t&&s!=="post";let f;if(hn){if(s==="sync"){const k=pa();f=k.__watcherHandles||(k.__watcherHandles=[])}else if(!l){const k=()=>{};return k.stop=tt,k.resume=tt,k.pause=tt,k}}const c=Le;a.call=(k,$,T)=>qe(k,c,$,T);let g=!1;s==="post"?a.scheduler=k=>{je(k,c&&c.suspense)}:s!=="sync"&&(g=!0,a.scheduler=(k,$)=>{$?k():$s(k)}),a.augmentJob=k=>{t&&(k.flags|=4),g&&(k.flags|=2,c&&(k.id=c.uid,k.i=c))};const A=ca(e,t,a);return hn&&(f?f.push(A):l&&A()),A}function ga(e,t,n){const r=this.proxy,i=be(e)?e.includes(".")?Ii(r,e):()=>r[e]:e.bind(r,r);let s;X(t)?s=t:(s=t.handler,n=t);const o=bn(this),a=Oi(i,s.bind(r),n);return o(),a}function Ii(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 _a=Symbol("_vte"),Li=e=>e.__isTeleport,Qe=Symbol("_leaveCb"),Yt=Symbol("_enterCb");function va(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ui(()=>{e.isMounted=!0}),Hi(()=>{e.isUnmounting=!0}),e}const Ve=[Function,Array],Ri={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ve,onEnter:Ve,onAfterEnter:Ve,onEnterCancelled:Ve,onBeforeLeave:Ve,onLeave:Ve,onAfterLeave:Ve,onLeaveCancelled:Ve,onBeforeAppear:Ve,onAppear:Ve,onAfterAppear:Ve,onAppearCancelled:Ve},Pi=e=>{const t=e.subTree;return t.component?Pi(t.component):t},ya={name:"BaseTransition",props:Ri,setup(e,{slots:t}){const n=ho(),r=va();return()=>{const i=t.default&&Fi(t.default(),!0),s=i&&i.length?Bi(i):n.subTree?B():void 0;if(!s)return;const o=ce(e),{mode:a}=o;if(r.isLeaving)return as(s);const l=lr(s);if(!l)return as(s);let f=Cs(l,o,r,n,g=>f=g);l.type!==Ie&&un(l,f);let c=n.subTree&&lr(n.subTree);if(c&&c.type!==Ie&&!Et(c,l)&&Pi(n).type!==Ie){let g=Cs(c,o,r,n);if(un(c,g),a==="out-in"&&l.type!==Ie)return r.isLeaving=!0,g.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete g.afterLeave,c=void 0},as(s);a==="in-out"&&l.type!==Ie?g.delayLeave=(A,k,$)=>{const T=Ni(r,c);T[String(c.key)]=c,A[Qe]=()=>{k(),A[Qe]=void 0,delete f.delayedLeave,c=void 0},f.delayedLeave=()=>{$(),delete f.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function Bi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Ie){t=n;break}}return t}const ba=ya;function Ni(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 Cs(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:c,onEnterCancelled:g,onBeforeLeave:A,onLeave:k,onAfterLeave:$,onLeaveCancelled:T,onBeforeAppear:J,onAppear:U,onAfterAppear:q,onAppearCancelled:Z}=t,H=String(e.key),se=Ni(n,e),ge=(G,te)=>{G&&qe(G,r,9,te)},he=(G,te)=>{const ue=te[1];ge(G,te),z(G)?G.every(j=>j.length<=1)&&ue():G.length<=1&&ue()},ke={mode:o,persisted:a,beforeEnter(G){let te=l;if(!n.isMounted)if(s)te=J||l;else return;G[Qe]&&G[Qe](!0);const ue=se[H];ue&&Et(e,ue)&&ue.el[Qe]&&ue.el[Qe](),ge(te,[G])},enter(G){if(se[H]===e)return;let te=f,ue=c,j=g;if(!n.isMounted)if(s)te=U||f,ue=q||c,j=Z||g;else return;let le=!1;G[Yt]=b=>{le||(le=!0,b?ge(j,[G]):ge(ue,[G]),ke.delayedLeave&&ke.delayedLeave(),G[Yt]=void 0)};const v=G[Yt].bind(null,!1);te?he(te,[G,v]):v()},leave(G,te){const ue=String(e.key);if(G[Yt]&&G[Yt](!0),n.isUnmounting)return te();ge(A,[G]);let j=!1;G[Qe]=v=>{j||(j=!0,te(),v?ge(T,[G]):ge($,[G]),G[Qe]=void 0,se[ue]===e&&delete se[ue])};const le=G[Qe].bind(null,!1);se[ue]=e,k?he(k,[G,le]):le()},clone(G){const te=Cs(G,t,n,r,i);return i&&i(te),te}};return ke}function as(e){if(Wn(e))return e=wt(e),e.children=null,e}function lr(e){if(!Wn(e))return Li(e.type)&&e.children?Bi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&X(n.default))return n.default()}}function un(e,t){e.shapeFlag&6&&e.component?(e.transition=t,un(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Fi(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===Q?(o.patchFlag&128&&i++,r=r.concat(Fi(o.children,t,a))):(t||o.type!==Ie)&&r.push(a!=null?wt(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Di(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function cr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ln=new WeakMap;function sn(e,t,n,r,i=!1){if(z(e)){e.forEach((T,J)=>sn(T,t&&(z(t)?t[J]:t),n,r,i));return}if(Dt(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&sn(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Qn(r.component):r.el,o=i?null:s,{i:a,r:l}=e,f=t&&t.r,c=a.refs===fe?a.refs={}:a.refs,g=a.setupState,A=ce(g),k=g===fe?ei:T=>cr(c,T)?!1:oe(A,T),$=(T,J)=>!(J&&cr(c,J));if(f!=null&&f!==l){if(ur(t),be(f))c[f]=null,k(f)&&(g[f]=null);else if(De(f)){const T=t;$(f,T.k)&&(f.value=null),T.k&&(c[T.k]=null)}}if(X(l))yn(l,a,12,[o,c]);else{const T=be(l),J=De(l);if(T||J){const U=()=>{if(e.f){const q=T?k(l)?g[l]:c[l]:$()||!e.k?l.value:c[e.k];if(i)z(q)&&Ps(q,s);else if(z(q))q.includes(s)||q.push(s);else if(T)c[l]=[s],k(l)&&(g[l]=c[l]);else{const Z=[s];$(l,e.k)&&(l.value=Z),e.k&&(c[e.k]=Z)}}else T?(c[l]=o,k(l)&&(g[l]=o)):J&&($(l,e.k)&&(l.value=o),e.k&&(c[e.k]=o))};if(o){const q=()=>{U(),Ln.delete(e)};q.id=-1,Ln.set(e,q),je(q,n)}else ur(e),U()}}}function ur(e){const t=Ln.get(e);t&&(t.flags|=8,Ln.delete(e))}$n().requestIdleCallback;$n().cancelIdleCallback;const Dt=e=>!!e.type.__asyncLoader,Wn=e=>e.type.__isKeepAlive;function wa(e,t){ji(e,"a",t)}function ka(e,t){ji(e,"da",t)}function ji(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(Gn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)Wn(i.parent.vnode)&&Ca(r,t,n,i),i=i.parent}}function Ca(e,t,n,r){const i=Gn(t,e,r,!0);Vi(()=>{Ps(r[t],i)},n)}function Gn(e,t,n=Le,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{ht();const a=bn(n),l=qe(t,n,e,o);return a(),mt(),l});return r?i.unshift(s):i.push(s),s}}const gt=e=>(t,n=Le)=>{(!hn||e==="sp")&&Gn(e,(...r)=>t(...r),n)},Sa=gt("bm"),Ui=gt("m"),Aa=gt("bu"),xa=gt("u"),Hi=gt("bum"),Vi=gt("um"),Ta=gt("sp"),Ma=gt("rtg"),Ea=gt("rtc");function Oa(e,t=Le){Gn("ec",e,t)}const $i="components";function ye(e,t){return zi($i,e,!0,t)||e}const Ki=Symbol.for("v-ndc");function Ss(e){return be(e)?zi($i,e,!1)||e:e||Ki}function zi(e,t,n=!0,r=!1){const i=Me||Le;if(i){const s=i.type;{const a=ml(s,!1);if(a&&(a===t||a===Ne(t)||a===Hn(Ne(t))))return s}const o=dr(i[e]||s[e],t)||dr(i.appContext[e],t);return!o&&r?s:o}}function dr(e,t){return e&&(e[t]||e[Ne(t)]||e[Hn(Ne(t))])}function Se(e,t,n,r){let i;const s=n,o=z(e);if(o||be(e)){const a=o&&Lt(e);let l=!1,f=!1;a&&(l=!Ke(e),f=bt(e),e=Kn(e)),i=new Array(e.length);for(let c=0,g=e.length;c<g;c++)i[c]=t(l?f?Ut(pt(e[c])):pt(e[c]):e[c],c,void 0,s)}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,s)}else if(ae(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,f=a.length;l<f;l++){const c=a[l];i[l]=t(e[c],c,l,s)}}else i=[];return i}function Ia(e,t,n={},r,i){if(Me.ce||Me.parent&&Dt(Me.parent)&&Me.parent.ce){const f=Object.keys(n).length>0;return m(),_e(Q,null,[ve("slot",n,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),m();const o=s&&qi(s(n)),a=n.key||o&&o.key,l=_e(Q,{key:(a&&!ze(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function qi(e){return e.some(t=>fn(t)?!(t.type===Ie||t.type===Q&&!qi(t.children)):!0)?e:null}const As=e=>e?mo(e)?Qn(e):As(e.parent):null,rn=Ae(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>As(e.parent),$root:e=>As(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gi(e),$forceUpdate:e=>e.f||(e.f=()=>{$s(e.update)}),$nextTick:e=>e.n||(e.n=Ai.bind(e.proxy)),$watch:e=>ga.bind(e)}),ls=(e,t)=>e!==fe&&!e.__isScriptSetup&&oe(e,t),La={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const A=o[t];if(A!==void 0)switch(A){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(ls(r,t))return o[t]=1,r[t];if(i!==fe&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==fe&&oe(n,t))return o[t]=4,n[t];xs&&(o[t]=0)}}const f=rn[t];let c,g;if(f)return t==="$attrs"&&Oe(e.attrs,"get",""),f(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==fe&&oe(n,t))return o[t]=4,n[t];if(g=l.config.globalProperties,oe(g,t))return g[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return ls(i,t)?(i[t]=n,!0):r!==fe&&oe(r,t)?(r[t]=n,!0):oe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:s,type:o}},a){let l;return!!(n[a]||e!==fe&&a[0]!=="$"&&oe(e,a)||ls(t,a)||oe(s,a)||oe(r,a)||oe(rn,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 fr(e){return z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xs=!0;function Ra(e){const t=Gi(e),n=e.proxy,r=e.ctx;xs=!1,t.beforeCreate&&hr(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:f,created:c,beforeMount:g,mounted:A,beforeUpdate:k,updated:$,activated:T,deactivated:J,beforeDestroy:U,beforeUnmount:q,destroyed:Z,unmounted:H,render:se,renderTracked:ge,renderTriggered:he,errorCaptured:ke,serverPrefetch:G,expose:te,inheritAttrs:ue,components:j,directives:le,filters:v}=t;if(f&&Pa(f,r,null),o)for(const h in o){const y=o[h];X(y)&&(r[h]=y.bind(n))}if(i){const h=i.call(n,n);ae(h)&&(e.data=zn(h))}if(xs=!0,s)for(const h in s){const y=s[h],S=X(y)?y.bind(n,n):X(y.get)?y.get.bind(n,n):tt,P=!X(y)&&X(y.set)?y.set.bind(n):tt,N=gl({get:S,set:P});Object.defineProperty(r,h,{enumerable:!0,configurable:!0,get:()=>N.value,set:V=>N.value=V})}if(a)for(const h in a)Wi(a[h],r,n,h);if(l){const h=X(l)?l.call(n):l;Reflect.ownKeys(h).forEach(y=>{ha(y,h[y])})}c&&hr(c,e,"c");function w(h,y){z(y)?y.forEach(S=>h(S.bind(n))):y&&h(y.bind(n))}if(w(Sa,g),w(Ui,A),w(Aa,k),w(xa,$),w(wa,T),w(ka,J),w(Oa,ke),w(Ea,ge),w(Ma,he),w(Hi,q),w(Vi,H),w(Ta,G),z(te))if(te.length){const h=e.exposed||(e.exposed={});te.forEach(y=>{Object.defineProperty(h,y,{get:()=>n[y],set:S=>n[y]=S,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===tt&&(e.render=se),ue!=null&&(e.inheritAttrs=ue),j&&(e.components=j),le&&(e.directives=le),G&&Di(e)}function Pa(e,t,n=tt){z(e)&&(e=Ts(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=Tn(i.from||r,i.default,!0):s=Tn(i.from||r):s=Tn(i),De(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function hr(e,t,n){qe(z(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Wi(e,t,n,r){let i=r.includes(".")?Ii(n,r):()=>n[r];if(be(e)){const s=t[e];X(s)&&os(i,s)}else if(X(e))os(i,e.bind(n));else if(ae(e))if(z(e))e.forEach(s=>Wi(s,t,n,r));else{const s=X(e.handler)?e.handler.bind(n):t[e.handler];X(s)&&os(i,s,e)}}function Gi(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(f=>Rn(l,f,o,!0)),Rn(l,t,o)),ae(t)&&s.set(t,l),l}function Rn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Rn(e,s,n,!0),i&&i.forEach(o=>Rn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Ba[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Ba={data:mr,props:pr,emits:pr,methods:Xt,computed:Xt,beforeCreate:Pe,created:Pe,beforeMount:Pe,mounted:Pe,beforeUpdate:Pe,updated:Pe,beforeDestroy:Pe,beforeUnmount:Pe,destroyed:Pe,unmounted:Pe,activated:Pe,deactivated:Pe,errorCaptured:Pe,serverPrefetch:Pe,components:Xt,directives:Xt,watch:Fa,provide:mr,inject:Na};function mr(e,t){return t?e?function(){return Ae(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Na(e,t){return Xt(Ts(e),Ts(t))}function Ts(e){if(z(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Pe(e,t){return e?[...new Set([].concat(e,t))]:t}function Xt(e,t){return e?Ae(Object.create(null),e,t):t}function pr(e,t){return e?z(e)&&z(t)?[...new Set([...e,...t])]:Ae(Object.create(null),fr(e),fr(t??{})):t}function Fa(e,t){if(!e)return t;if(!t)return e;const n=Ae(Object.create(null),e);for(const r in t)n[r]=Pe(e[r],t[r]);return n}function Yi(){return{app:null,config:{isNativeTag:ei,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 Da=0;function ja(e,t){return function(r,i=null){X(r)||(r=Ae({},r)),i!=null&&!ae(i)&&(i=null);const s=Yi(),o=new WeakSet,a=[];let l=!1;const f=s.app={_uid:Da++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:_l,get config(){return s.config},set config(c){},use(c,...g){return o.has(c)||(c&&X(c.install)?(o.add(c),c.install(f,...g)):X(c)&&(o.add(c),c(f,...g))),f},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),f},component(c,g){return g?(s.components[c]=g,f):s.components[c]},directive(c,g){return g?(s.directives[c]=g,f):s.directives[c]},mount(c,g,A){if(!l){const k=f._ceVNode||ve(r,i);return k.appContext=s,A===!0?A="svg":A===!1&&(A=void 0),e(k,c,A),l=!0,f._container=c,c.__vue_app__=f,Qn(k.component)}},onUnmount(c){a.push(c)},unmount(){l&&(qe(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(c,g){return s.provides[c]=g,f},runWithContext(c){const g=jt;jt=f;try{return c()}finally{jt=g}}};return f}}let jt=null;const Ua=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ne(t)}Modifiers`]||e[`${kt(t)}Modifiers`];function Ha(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||fe;let i=n;const s=t.startsWith("update:"),o=s&&Ua(r,t.slice(7));o&&(o.trim&&(i=n.map(c=>be(c)?c.trim():c)),o.number&&(i=n.map(Vn)));let a,l=r[a=ts(t)]||r[a=ts(Ne(t))];!l&&s&&(l=r[a=ts(kt(t))]),l&&qe(l,e,6,i);const f=r[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,qe(f,e,6,i)}}const Va=new WeakMap;function Ji(e,t,n=!1){const r=n?Va:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!X(e)){const l=f=>{const c=Ji(f,t,!0);c&&(a=!0,Ae(o,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(ae(e)&&r.set(e,null),null):(z(s)?s.forEach(l=>o[l]=null):Ae(o,s),ae(e)&&r.set(e,o),o)}function Yn(e,t){return!e||!Dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,kt(t))||oe(e,t))}function gr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:f,renderCache:c,props:g,data:A,setupState:k,ctx:$,inheritAttrs:T}=e,J=In(e);let U,q;try{if(n.shapeFlag&4){const H=i||r,se=H;U=et(f.call(se,H,c,g,k,A,$)),q=a}else{const H=t;U=et(H.length>1?H(g,{attrs:a,slots:o,emit:l}):H(g,null)),q=t.props?a:$a(a)}}catch(H){on.length=0,qn(H,e,1),U=ve(Ie)}let Z=U;if(q&&T!==!1){const H=Object.keys(q),{shapeFlag:se}=Z;H.length&&se&7&&(s&&H.some(jn)&&(q=Ka(q,s)),Z=wt(Z,q,!1,!0))}return n.dirs&&(Z=wt(Z,null,!1,!0),Z.dirs=Z.dirs?Z.dirs.concat(n.dirs):n.dirs),n.transition&&un(Z,n.transition),U=Z,In(J),U}const $a=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dn(n))&&((t||(t={}))[n]=e[n]);return t},Ka=(e,t)=>{const n={};for(const r in e)(!jn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function za(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?_r(r,o,f):!!o;if(l&8){const c=t.dynamicProps;for(let g=0;g<c.length;g++){const A=c[g];if(Xi(o,r,A)&&!Yn(f,A))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?_r(r,o,f):!0:!!o;return!1}function _r(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(Xi(t,e,s)&&!Yn(n,s))return!0}return!1}function Xi(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!Kt(r,i):r!==i}function qa({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Qi={},Zi=()=>Object.create(Qi),eo=e=>Object.getPrototypeOf(e)===Qi;function Wa(e,t,n,r=!1){const i={},s=Zi();e.propsDefaults=Object.create(null),to(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:sa(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Ga(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=ce(i),[l]=e.propsOptions;let f=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let g=0;g<c.length;g++){let A=c[g];if(Yn(e.emitsOptions,A))continue;const k=t[A];if(l)if(oe(s,A))k!==s[A]&&(s[A]=k,f=!0);else{const $=Ne(A);i[$]=Ms(l,a,$,k,e,!1)}else k!==s[A]&&(s[A]=k,f=!0)}}}else{to(e,t,i,s)&&(f=!0);let c;for(const g in a)(!t||!oe(t,g)&&((c=kt(g))===g||!oe(t,c)))&&(l?n&&(n[g]!==void 0||n[c]!==void 0)&&(i[g]=Ms(l,a,g,void 0,e,!0)):delete i[g]);if(s!==a)for(const g in s)(!t||!oe(t,g))&&(delete s[g],f=!0)}f&&lt(e.attrs,"set","")}function to(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(en(l))continue;const f=t[l];let c;i&&oe(i,c=Ne(l))?!s||!s.includes(c)?n[c]=f:(a||(a={}))[c]=f:Yn(e.emitsOptions,l)||(!(l in r)||f!==r[l])&&(r[l]=f,o=!0)}if(s){const l=ce(n),f=a||fe;for(let c=0;c<s.length;c++){const g=s[c];n[g]=Ms(i,l,g,f[g],e,!oe(f,g))}}return o}function Ms(e,t,n,r,i,s){const o=e[n];if(o!=null){const a=oe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&X(l)){const{propsDefaults:f}=i;if(n in f)r=f[n];else{const c=bn(i);r=f[n]=l.call(null,t),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===kt(n))&&(r=!0))}return r}const Ya=new WeakMap;function no(e,t,n=!1){const r=n?Ya:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!X(e)){const c=g=>{l=!0;const[A,k]=no(g,t,!0);Ae(o,A),k&&a.push(...k)};!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,Bt),Bt;if(z(s))for(let c=0;c<s.length;c++){const g=Ne(s[c]);vr(g)&&(o[g]=fe)}else if(s)for(const c in s){const g=Ne(c);if(vr(g)){const A=s[c],k=o[g]=z(A)||X(A)?{type:A}:Ae({},A),$=k.type;let T=!1,J=!0;if(z($))for(let U=0;U<$.length;++U){const q=$[U],Z=X(q)&&q.name;if(Z==="Boolean"){T=!0;break}else Z==="String"&&(J=!1)}else T=X($)&&$.name==="Boolean";k[0]=T,k[1]=J,(T||oe(k,"default"))&&a.push(g)}}const f=[o,a];return ae(e)&&r.set(e,f),f}function vr(e){return e[0]!=="$"&&!en(e)}const zs=e=>e==="_"||e==="_ctx"||e==="$stable",qs=e=>z(e)?e.map(et):[et(e)],Ja=(e,t,n)=>{if(t._n)return t;const r=Ks((...i)=>qs(t(...i)),n);return r._c=!1,r},so=(e,t,n)=>{const r=e._ctx;for(const i in e){if(zs(i))continue;const s=e[i];if(X(s))t[i]=Ja(i,s,r);else if(s!=null){const o=qs(s);t[i]=()=>o}}},ro=(e,t)=>{const n=qs(t);e.slots.default=()=>n},io=(e,t,n)=>{for(const r in t)(n||!zs(r))&&(e[r]=t[r])},Xa=(e,t,n)=>{const r=e.slots=Zi();if(e.vnode.shapeFlag&32){const i=t._;i?(io(r,t,n),n&&ri(r,"_",i,!0)):so(t,r)}else t&&ro(e,t)},Qa=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=fe;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:io(i,t,n):(s=!t.$stable,so(t,i)),o=t}else t&&(ro(e,t),o={default:1});if(s)for(const a in i)!zs(a)&&o[a]==null&&delete i[a]},je=sl;function Za(e){return el(e)}function el(e,t){const n=$n();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:f,setElementText:c,parentNode:g,nextSibling:A,setScopeId:k=tt,insertStaticContent:$}=e,T=(d,p,C,O=null,x=null,M=null,F=void 0,R=null,L=!!p.dynamicChildren)=>{if(d===p)return;d&&!Et(d,p)&&(O=kn(d),V(d,x,M,!0),d=null),p.patchFlag===-2&&(L=!1,p.dynamicChildren=null);const{type:E,ref:W,shapeFlag:D}=p;switch(E){case Jn:J(d,p,C,O);break;case Ie:U(d,p,C,O);break;case us:d==null&&q(p,C,O,F);break;case Q:j(d,p,C,O,x,M,F,R,L);break;default:D&1?se(d,p,C,O,x,M,F,R,L):D&6?le(d,p,C,O,x,M,F,R,L):(D&64||D&128)&&E.process(d,p,C,O,x,M,F,R,L,qt)}W!=null&&x?sn(W,d&&d.ref,M,p||d,!p):W==null&&d&&d.ref!=null&&sn(d.ref,null,M,d,!0)},J=(d,p,C,O)=>{if(d==null)r(p.el=a(p.children),C,O);else{const x=p.el=d.el;p.children!==d.children&&f(x,p.children)}},U=(d,p,C,O)=>{d==null?r(p.el=l(p.children||""),C,O):p.el=d.el},q=(d,p,C,O)=>{[d.el,d.anchor]=$(d.children,p,C,O,d.el,d.anchor)},Z=({el:d,anchor:p},C,O)=>{let x;for(;d&&d!==p;)x=A(d),r(d,C,O),d=x;r(p,C,O)},H=({el:d,anchor:p})=>{let C;for(;d&&d!==p;)C=A(d),i(d),d=C;i(p)},se=(d,p,C,O,x,M,F,R,L)=>{if(p.type==="svg"?F="svg":p.type==="math"&&(F="mathml"),d==null)ge(p,C,O,x,M,F,R,L);else{const E=d.el&&d.el._isVueCE?d.el:null;try{E&&E._beginPatch(),G(d,p,x,M,F,R,L)}finally{E&&E._endPatch()}}},ge=(d,p,C,O,x,M,F,R)=>{let L,E;const{props:W,shapeFlag:D,transition:K,dirs:Y}=d;if(L=d.el=o(d.type,M,W&&W.is,W),D&8?c(L,d.children):D&16&&ke(d.children,L,null,O,x,cs(d,M),F,R),Y&&Ct(d,null,O,"created"),he(L,d,d.scopeId,F,O),W){for(const de in W)de!=="value"&&!en(de)&&s(L,de,null,W[de],M,O);"value"in W&&s(L,"value",null,W.value,M),(E=W.onVnodeBeforeMount)&&Je(E,O,d)}Y&&Ct(d,null,O,"beforeMount");const re=tl(x,K);re&&K.beforeEnter(L),r(L,p,C),((E=W&&W.onVnodeMounted)||re||Y)&&je(()=>{try{E&&Je(E,O,d),re&&K.enter(L),Y&&Ct(d,null,O,"mounted")}finally{}},x)},he=(d,p,C,O,x)=>{if(C&&k(d,C),O)for(let M=0;M<O.length;M++)k(d,O[M]);if(x){let M=x.subTree;if(p===M||co(M.type)&&(M.ssContent===p||M.ssFallback===p)){const F=x.vnode;he(d,F,F.scopeId,F.slotScopeIds,x.parent)}}},ke=(d,p,C,O,x,M,F,R,L=0)=>{for(let E=L;E<d.length;E++){const W=d[E]=R?ot(d[E]):et(d[E]);T(null,W,p,C,O,x,M,F,R)}},G=(d,p,C,O,x,M,F)=>{const R=p.el=d.el;let{patchFlag:L,dynamicChildren:E,dirs:W}=p;L|=d.patchFlag&16;const D=d.props||fe,K=p.props||fe;let Y;if(C&&St(C,!1),(Y=K.onVnodeBeforeUpdate)&&Je(Y,C,p,d),W&&Ct(p,d,C,"beforeUpdate"),C&&St(C,!0),(D.innerHTML&&K.innerHTML==null||D.textContent&&K.textContent==null)&&c(R,""),E?te(d.dynamicChildren,E,R,C,O,cs(p,x),M):F||y(d,p,R,null,C,O,cs(p,x),M,!1),L>0){if(L&16)ue(R,D,K,C,x);else if(L&2&&D.class!==K.class&&s(R,"class",null,K.class,x),L&4&&s(R,"style",D.style,K.style,x),L&8){const re=p.dynamicProps;for(let de=0;de<re.length;de++){const me=re[de],Ce=D[me],xe=K[me];(xe!==Ce||me==="value")&&s(R,me,Ce,xe,x,C)}}L&1&&d.children!==p.children&&c(R,p.children)}else!F&&E==null&&ue(R,D,K,C,x);((Y=K.onVnodeUpdated)||W)&&je(()=>{Y&&Je(Y,C,p,d),W&&Ct(p,d,C,"updated")},O)},te=(d,p,C,O,x,M,F)=>{for(let R=0;R<p.length;R++){const L=d[R],E=p[R],W=L.el&&(L.type===Q||!Et(L,E)||L.shapeFlag&198)?g(L.el):C;T(L,E,W,null,O,x,M,F,!0)}},ue=(d,p,C,O,x)=>{if(p!==C){if(p!==fe)for(const M in p)!en(M)&&!(M in C)&&s(d,M,p[M],null,x,O);for(const M in C){if(en(M))continue;const F=C[M],R=p[M];F!==R&&M!=="value"&&s(d,M,R,F,x,O)}"value"in C&&s(d,"value",p.value,C.value,x)}},j=(d,p,C,O,x,M,F,R,L)=>{const E=p.el=d?d.el:a(""),W=p.anchor=d?d.anchor:a("");let{patchFlag:D,dynamicChildren:K,slotScopeIds:Y}=p;Y&&(R=R?R.concat(Y):Y),d==null?(r(E,C,O),r(W,C,O),ke(p.children||[],C,W,x,M,F,R,L)):D>0&&D&64&&K&&d.dynamicChildren&&d.dynamicChildren.length===K.length?(te(d.dynamicChildren,K,C,x,M,F,R),(p.key!=null||x&&p===x.subTree)&&oo(d,p,!0)):y(d,p,C,W,x,M,F,R,L)},le=(d,p,C,O,x,M,F,R,L)=>{p.slotScopeIds=R,d==null?p.shapeFlag&512?x.ctx.activate(p,C,O,F,L):v(p,C,O,x,M,F,L):b(d,p,L)},v=(d,p,C,O,x,M,F)=>{const R=d.component=cl(d,O,x);if(Wn(d)&&(R.ctx.renderer=qt),ul(R,!1,F),R.asyncDep){if(x&&x.registerDep(R,w,F),!d.el){const L=R.subTree=ve(Ie);U(null,L,p,C),d.placeholder=L.el}}else w(R,d,p,C,x,M,F)},b=(d,p,C)=>{const O=p.component=d.component;if(za(d,p,C))if(O.asyncDep&&!O.asyncResolved){h(O,p,C);return}else O.next=p,O.update();else p.el=d.el,O.vnode=p},w=(d,p,C,O,x,M,F)=>{const R=()=>{if(d.isMounted){let{next:D,bu:K,u:Y,parent:re,vnode:de}=d;{const Ge=ao(d);if(Ge){D&&(D.el=de.el,h(d,D,F)),Ge.asyncDep.then(()=>{je(()=>{d.isUnmounted||E()},x)});return}}let me=D,Ce;St(d,!1),D?(D.el=de.el,h(d,D,F)):D=de,K&&xn(K),(Ce=D.props&&D.props.onVnodeBeforeUpdate)&&Je(Ce,re,D,de),St(d,!0);const xe=gr(d),We=d.subTree;d.subTree=xe,T(We,xe,g(We.el),kn(We),d,x,M),D.el=xe.el,me===null&&qa(d,xe.el),Y&&je(Y,x),(Ce=D.props&&D.props.onVnodeUpdated)&&je(()=>Je(Ce,re,D,de),x)}else{let D;const{el:K,props:Y}=p,{bm:re,m:de,parent:me,root:Ce,type:xe}=d,We=Dt(p);St(d,!1),re&&xn(re),!We&&(D=Y&&Y.onVnodeBeforeMount)&&Je(D,me,p),St(d,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(xe,d.parent?d.parent.type:void 0);const Ge=d.subTree=gr(d);T(null,Ge,C,O,d,x,M),p.el=Ge.el}if(de&&je(de,x),!We&&(D=Y&&Y.onVnodeMounted)){const Ge=p;je(()=>Je(D,me,Ge),x)}(p.shapeFlag&256||me&&Dt(me.vnode)&&me.vnode.shapeFlag&256)&&d.a&&je(d.a,x),d.isMounted=!0,p=C=O=null}};d.scope.on();const L=d.effect=new li(R);d.scope.off();const E=d.update=L.run.bind(L),W=d.job=L.runIfDirty.bind(L);W.i=d,W.id=d.uid,L.scheduler=()=>$s(W),St(d,!0),E()},h=(d,p,C)=>{p.component=d;const O=d.vnode.props;d.vnode=p,d.next=null,Ga(d,p.props,O,C),Qa(d,p.children,C),ht(),ar(d),mt()},y=(d,p,C,O,x,M,F,R,L=!1)=>{const E=d&&d.children,W=d?d.shapeFlag:0,D=p.children,{patchFlag:K,shapeFlag:Y}=p;if(K>0){if(K&128){P(E,D,C,O,x,M,F,R,L);return}else if(K&256){S(E,D,C,O,x,M,F,R,L);return}}Y&8?(W&16&&zt(E,x,M),D!==E&&c(C,D)):W&16?Y&16?P(E,D,C,O,x,M,F,R,L):zt(E,x,M,!0):(W&8&&c(C,""),Y&16&&ke(D,C,O,x,M,F,R,L))},S=(d,p,C,O,x,M,F,R,L)=>{d=d||Bt,p=p||Bt;const E=d.length,W=p.length,D=Math.min(E,W);let K;for(K=0;K<D;K++){const Y=p[K]=L?ot(p[K]):et(p[K]);T(d[K],Y,C,null,x,M,F,R,L)}E>W?zt(d,x,M,!0,!1,D):ke(p,C,O,x,M,F,R,L,D)},P=(d,p,C,O,x,M,F,R,L)=>{let E=0;const W=p.length;let D=d.length-1,K=W-1;for(;E<=D&&E<=K;){const Y=d[E],re=p[E]=L?ot(p[E]):et(p[E]);if(Et(Y,re))T(Y,re,C,null,x,M,F,R,L);else break;E++}for(;E<=D&&E<=K;){const Y=d[D],re=p[K]=L?ot(p[K]):et(p[K]);if(Et(Y,re))T(Y,re,C,null,x,M,F,R,L);else break;D--,K--}if(E>D){if(E<=K){const Y=K+1,re=Y<W?p[Y].el:O;for(;E<=K;)T(null,p[E]=L?ot(p[E]):et(p[E]),C,re,x,M,F,R,L),E++}}else if(E>K)for(;E<=D;)V(d[E],x,M,!0),E++;else{const Y=E,re=E,de=new Map;for(E=re;E<=K;E++){const Ue=p[E]=L?ot(p[E]):et(p[E]);Ue.key!=null&&de.set(Ue.key,E)}let me,Ce=0;const xe=K-re+1;let We=!1,Ge=0;const Wt=new Array(xe);for(E=0;E<xe;E++)Wt[E]=0;for(E=Y;E<=D;E++){const Ue=d[E];if(Ce>=xe){V(Ue,x,M,!0);continue}let Ye;if(Ue.key!=null)Ye=de.get(Ue.key);else for(me=re;me<=K;me++)if(Wt[me-re]===0&&Et(Ue,p[me])){Ye=me;break}Ye===void 0?V(Ue,x,M,!0):(Wt[Ye-re]=E+1,Ye>=Ge?Ge=Ye:We=!0,T(Ue,p[Ye],C,null,x,M,F,R,L),Ce++)}const er=We?nl(Wt):Bt;for(me=er.length-1,E=xe-1;E>=0;E--){const Ue=re+E,Ye=p[Ue],tr=p[Ue+1],nr=Ue+1<W?tr.el||lo(tr):O;Wt[E]===0?T(null,Ye,C,nr,x,M,F,R,L):We&&(me<0||E!==er[me]?N(Ye,C,nr,2):me--)}}},N=(d,p,C,O,x=null)=>{const{el:M,type:F,transition:R,children:L,shapeFlag:E}=d;if(E&6){N(d.component.subTree,p,C,O);return}if(E&128){d.suspense.move(p,C,O);return}if(E&64){F.move(d,p,C,qt);return}if(F===Q){r(M,p,C);for(let D=0;D<L.length;D++)N(L[D],p,C,O);r(d.anchor,p,C);return}if(F===us){Z(d,p,C);return}if(O!==2&&E&1&&R)if(O===0)R.beforeEnter(M),r(M,p,C),je(()=>R.enter(M),x);else{const{leave:D,delayLeave:K,afterLeave:Y}=R,re=()=>{d.ctx.isUnmounted?i(M):r(M,p,C)},de=()=>{M._isLeaving&&M[Qe](!0),D(M,()=>{re(),Y&&Y()})};K?K(M,re,de):de()}else r(M,p,C)},V=(d,p,C,O=!1,x=!1)=>{const{type:M,props:F,ref:R,children:L,dynamicChildren:E,shapeFlag:W,patchFlag:D,dirs:K,cacheIndex:Y,memo:re}=d;if(D===-2&&(x=!1),R!=null&&(ht(),sn(R,null,C,d,!0),mt()),Y!=null&&(p.renderCache[Y]=void 0),W&256){p.ctx.deactivate(d);return}const de=W&1&&K,me=!Dt(d);let Ce;if(me&&(Ce=F&&F.onVnodeBeforeUnmount)&&Je(Ce,p,d),W&6)Zn(d.component,C,O);else{if(W&128){d.suspense.unmount(C,O);return}de&&Ct(d,null,p,"beforeUnmount"),W&64?d.type.remove(d,p,C,qt,O):E&&!E.hasOnce&&(M!==Q||D>0&&D&64)?zt(E,p,C,!1,!0):(M===Q&&D&384||!x&&W&16)&&zt(L,p,C),O&&ie(d)}const xe=re!=null&&Y==null;(me&&(Ce=F&&F.onVnodeUnmounted)||de||xe)&&je(()=>{Ce&&Je(Ce,p,d),de&&Ct(d,null,p,"unmounted"),xe&&(d.el=null)},C)},ie=d=>{const{type:p,el:C,anchor:O,transition:x}=d;if(p===Q){ne(C,O);return}if(p===us){H(d);return}const M=()=>{i(C),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(d.shapeFlag&1&&x&&!x.persisted){const{leave:F,delayLeave:R}=x,L=()=>F(C,M);R?R(d.el,M,L):L()}else M()},ne=(d,p)=>{let C;for(;d!==p;)C=A(d),i(d),d=C;i(p)},Zn=(d,p,C)=>{const{bum:O,scope:x,job:M,subTree:F,um:R,m:L,a:E}=d;yr(L),yr(E),O&&xn(O),x.stop(),M&&(M.flags|=8,V(F,d,p,C)),R&&je(R,p),je(()=>{d.isUnmounted=!0},p)},zt=(d,p,C,O=!1,x=!1,M=0)=>{for(let F=M;F<d.length;F++)V(d[F],p,C,O,x)},kn=d=>{if(d.shapeFlag&6)return kn(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const p=A(d.anchor||d.el),C=p&&p[_a];return C?A(C):p};let es=!1;const Zs=(d,p,C)=>{let O;d==null?p._vnode&&(V(p._vnode,null,null,!0),O=p._vnode.component):T(p._vnode||null,d,p,null,null,null,C),p._vnode=d,es||(es=!0,ar(O),Ti(),es=!1)},qt={p:T,um:V,m:N,r:ie,mt:v,mc:ke,pc:y,pbc:te,n:kn,o:e};return{render:Zs,hydrate:void 0,createApp:ja(Zs)}}function cs({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 St({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function tl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oo(e,t,n=!1){const r=e.children,i=t.children;if(z(r)&&z(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=ot(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&oo(o,a)),a.type===Jn&&(a.patchFlag===-1&&(a=i[s]=ot(a)),a.el=o.el),a.type===Ie&&!a.el&&(a.el=o.el)}}function nl(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const f=e[r];if(f!==0){if(i=n[n.length-1],e[i]<f){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<f?s=a+1:o=a;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function ao(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ao(t)}function yr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function lo(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?lo(t.subTree):null}const co=e=>e.__isSuspense;function sl(e,t){t&&t.pendingBranch?z(e)?t.effects.push(...e):t.effects.push(e):fa(e)}const Q=Symbol.for("v-fgt"),Jn=Symbol.for("v-txt"),Ie=Symbol.for("v-cmt"),us=Symbol.for("v-stc"),on=[];let He=null;function m(e=!1){on.push(He=e?null:[])}function rl(){on.pop(),He=on[on.length-1]||null}let dn=1;function Pn(e,t=!1){dn+=e,e<0&&He&&t&&(He.hasOnce=!0)}function uo(e){return e.dynamicChildren=dn>0?He||Bt:null,rl(),dn>0&&He&&He.push(e),e}function _(e,t,n,r,i,s){return uo(u(e,t,n,r,i,s,!0))}function _e(e,t,n,r,i){return uo(ve(e,t,n,r,i,!0))}function fn(e){return e?e.__v_isVNode===!0:!1}function Et(e,t){return e.type===t.type&&e.key===t.key}const fo=({key:e})=>e??null,Mn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?be(e)||De(e)||X(e)?{i:Me,r:e,k:t,f:!!n}:e:null);function u(e,t=null,n=null,r=0,i=null,s=e===Q?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fo(t),ref:t&&Mn(t),scopeId:Ei,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?(Ws(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=be(n)?8:16),dn>0&&!o&&He&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&He.push(l),l}const ve=il;function il(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Ki)&&(e=Ie),fn(e)){const a=wt(e,t,!0);return n&&Ws(a,n),dn>0&&!s&&He&&(a.shapeFlag&6?He[He.indexOf(e)]=a:He.push(a)),a.patchFlag=-2,a}if(pl(e)&&(e=e.__vccOpts),t){t=ol(t);let{class:a,style:l}=t;a&&!be(a)&&(t.class=ee(a)),ae(l)&&(Vs(l)&&!z(l)&&(l=Ae({},l)),t.style=Fe(l))}const o=be(e)?1:co(e)?128:Li(e)?64:ae(e)?4:X(e)?2:0;return u(e,t,n,r,i,o,s,!0)}function ol(e){return e?Vs(e)||eo(e)?Ae({},e):e:null}function wt(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,f=t?Es(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&fo(f),ref:t&&t.ref?n&&s?z(s)?s.concat(Mn(t)):[s,Mn(t)]:Mn(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!==Q?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&&wt(e.ssContent),ssFallback:e.ssFallback&&wt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&un(c,l.clone(c)),c}function Xn(e=" ",t=0){return ve(Jn,null,e,t)}function B(e="",t=!1){return t?(m(),_e(Ie,null,e)):ve(Ie,null,e)}function et(e){return e==null||typeof e=="boolean"?ve(Ie):z(e)?ve(Q,null,e.slice()):fn(e)?ot(e):ve(Jn,null,String(e))}function ot(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wt(e)}function Ws(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(z(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Ws(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!eo(t)?t._ctx=Me:i===3&&Me&&(Me.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Me},n=32):(t=String(t),r&64?(n=16,t=[Xn(t)]):n=8);e.children=t,e.shapeFlag|=n}function Es(...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=ee([t.class,r.class]));else if(i==="style")t.style=Fe([t.style,r.style]);else if(Dn(i)){const s=t[i],o=r[i];o&&s!==o&&!(z(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!jn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Je(e,t,n,r=null){qe(e,t,7,[n,r])}const al=Yi();let ll=0;function cl(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||al,s={uid:ll++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Fo(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:no(r,i),emitsOptions:Ji(r,i),emit:null,emitted:null,propsDefaults:fe,inheritAttrs:r.inheritAttrs,ctx:fe,data:fe,props:fe,attrs:fe,slots:fe,refs:fe,setupState:fe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=Ha.bind(null,s),e.ce&&e.ce(s),s}let Le=null;const ho=()=>Le||Me;let Bn,Os;{const e=$n(),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)}};Bn=t("__VUE_INSTANCE_SETTERS__",n=>Le=n),Os=t("__VUE_SSR_SETTERS__",n=>hn=n)}const bn=e=>{const t=Le;return Bn(e),e.scope.on(),()=>{e.scope.off(),Bn(t)}},br=()=>{Le&&Le.scope.off(),Bn(null)};function mo(e){return e.vnode.shapeFlag&4}let hn=!1;function ul(e,t=!1,n=!1){t&&Os(t);const{props:r,children:i}=e.vnode,s=mo(e);Wa(e,r,s,t),Xa(e,i,n||t);const o=s?dl(e,t):void 0;return t&&Os(!1),o}function dl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,La);const{setup:r}=n;if(r){ht();const i=e.setupContext=r.length>1?hl(e):null,s=bn(e),o=yn(r,e,0,[e.props,i]),a=ti(o);if(mt(),s(),(a||e.sp)&&!Dt(e)&&Di(e),a){if(o.then(br,br),t)return o.then(l=>{wr(e,l)}).catch(l=>{qn(l,e,0)});e.asyncDep=o}else wr(e,o)}else po(e)}function wr(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=Ci(t)),po(e)}function po(e,t,n){const r=e.type;e.render||(e.render=r.render||tt);{const i=bn(e);ht();try{Ra(e)}finally{mt(),i()}}}const fl={get(e,t){return Oe(e,"get",""),e[t]}};function hl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,fl),slots:e.slots,emit:e.emit,expose:t}}function Qn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ci(ks(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in rn)return rn[n](e)},has(t,n){return n in t||n in rn}})):e.proxy}function ml(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function pl(e){return X(e)&&"__vccOpts"in e}const gl=(e,t)=>aa(e,t,hn);function go(e,t,n){try{Pn(-1);const r=arguments.length;return r===2?ae(t)&&!z(t)?fn(t)?ve(e,null,[t]):ve(e,t):ve(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&fn(n)&&(n=[n]),ve(e,t,n))}finally{Pn(1)}}const _l="3.5.34";/**
13
+ **/function yn(e,t,n,r){try{return r?e(...r):e()}catch(i){qn(i,t,n)}}function qe(e,t,n,r){if(X(e)){const i=yn(e,t,n,r);return i&&ti(i)&&i.catch(s=>{qn(s,t,n)}),i}if(z(e)){const i=[];for(let s=0;s<e.length;s++)i.push(qe(e[s],t,n,r));return i}}function qn(e,t,n,r=!0){const i=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||fe;if(t){let a=t.parent;const l=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let _=0;_<u.length;_++)if(u[_](e,l,f)===!1)return}a=a.parent}if(s){ht(),yn(s,null,10,[e,l,f]),mt();return}}ua(e,n,i,r,o)}function ua(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}const Ne=[];let Xe=-1;const Ft=[];let vt=null,Bt=0;const Si=Promise.resolve();let On=null;function Ai(e){const t=On||Si;return e?t.then(this?e.bind(this):e):t}function da(e){let t=Xe+1,n=Ne.length;for(;t<n;){const r=t+n>>>1,i=Ne[r],s=cn(i);s<e||s===e&&i.flags&2?t=r+1:n=r}return t}function $s(e){if(!(e.flags&1)){const t=cn(e),n=Ne[Ne.length-1];!n||!(e.flags&2)&&t>=cn(n)?Ne.push(e):Ne.splice(da(t),0,e),e.flags|=1,xi()}}function xi(){On||(On=Si.then(Mi))}function fa(e){z(e)?Ft.push(...e):vt&&e.id===-1?vt.splice(Bt+1,0,e):e.flags&1||(Ft.push(e),e.flags|=1),xi()}function ar(e,t,n=Xe+1){for(;n<Ne.length;n++){const r=Ne[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ne.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ti(e){if(Ft.length){const t=[...new Set(Ft)].sort((n,r)=>cn(n)-cn(r));if(Ft.length=0,vt){vt.push(...t);return}for(vt=t,Bt=0;Bt<vt.length;Bt++){const n=vt[Bt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}vt=null,Bt=0}}const cn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Mi(e){try{for(Xe=0;Xe<Ne.length;Xe++){const t=Ne[Xe];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),yn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Xe<Ne.length;Xe++){const t=Ne[Xe];t&&(t.flags&=-2)}Xe=-1,Ne.length=0,Ti(),On=null,(Ne.length||Ft.length)&&Mi()}}let Ee=null,Ei=null;function In(e){const t=Ee;return Ee=e,Ei=e&&e.type.__scopeId||null,t}function Ks(e,t=Ee,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&Bn(-1);const s=In(t);let o;try{o=e(...i)}finally{In(s),r._d&&Bn(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function it(e,t){if(Ee===null)return e;const n=Qn(Ee),r=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[s,o,a,l=fe]=t[i];s&&(X(s)&&(s={mounted:s,updated:s}),s.deep&&ct(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return e}function Ct(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&&(ht(),qe(l,n,8,[e.el,a,e,t]),mt())}}function ha(e,t){if(Be){let n=Be.provides;const r=Be.parent&&Be.parent.provides;r===n&&(n=Be.provides=Object.create(r)),n[e]=t}}function Tn(e,t,n=!1){const r=ho();if(r||jt){let i=jt?jt._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&X(t)?t.call(r&&r.proxy):t}}const ma=Symbol.for("v-scx"),pa=()=>Tn(ma);function os(e,t,n){return Oi(e,t,n)}function Oi(e,t,n=fe){const{immediate:r,deep:i,flush:s,once:o}=n,a=xe({},n),l=t&&r||!t&&s!=="post";let f;if(hn){if(s==="sync"){const k=pa();f=k.__watcherHandles||(k.__watcherHandles=[])}else if(!l){const k=()=>{};return k.stop=tt,k.resume=tt,k.pause=tt,k}}const u=Be;a.call=(k,$,T)=>qe(k,u,$,T);let _=!1;s==="post"?a.scheduler=k=>{je(k,u&&u.suspense)}:s!=="sync"&&(_=!0,a.scheduler=(k,$)=>{$?k():$s(k)}),a.augmentJob=k=>{t&&(k.flags|=4),_&&(k.flags|=2,u&&(k.id=u.uid,k.i=u))};const A=ca(e,t,a);return hn&&(f?f.push(A):l&&A()),A}function ga(e,t,n){const r=this.proxy,i=be(e)?e.includes(".")?Ii(r,e):()=>r[e]:e.bind(r,r);let s;X(t)?s=t:(s=t.handler,n=t);const o=bn(this),a=Oi(i,s.bind(r),n);return o(),a}function Ii(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 _a=Symbol("_vte"),Li=e=>e.__isTeleport,Qe=Symbol("_leaveCb"),Yt=Symbol("_enterCb");function va(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ui(()=>{e.isMounted=!0}),Hi(()=>{e.isUnmounting=!0}),e}const Ve=[Function,Array],Ri={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ve,onEnter:Ve,onAfterEnter:Ve,onEnterCancelled:Ve,onBeforeLeave:Ve,onLeave:Ve,onAfterLeave:Ve,onLeaveCancelled:Ve,onBeforeAppear:Ve,onAppear:Ve,onAfterAppear:Ve,onAppearCancelled:Ve},Bi=e=>{const t=e.subTree;return t.component?Bi(t.component):t},ya={name:"BaseTransition",props:Ri,setup(e,{slots:t}){const n=ho(),r=va();return()=>{const i=t.default&&Fi(t.default(),!0),s=i&&i.length?Pi(i):n.subTree?B():void 0;if(!s)return;const o=ce(e),{mode:a}=o;if(r.isLeaving)return as(s);const l=lr(s);if(!l)return as(s);let f=Cs(l,o,r,n,_=>f=_);l.type!==Re&&un(l,f);let u=n.subTree&&lr(n.subTree);if(u&&u.type!==Re&&!Et(u,l)&&Bi(n).type!==Re){let _=Cs(u,o,r,n);if(un(u,_),a==="out-in"&&l.type!==Re)return r.isLeaving=!0,_.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete _.afterLeave,u=void 0},as(s);a==="in-out"&&l.type!==Re?_.delayLeave=(A,k,$)=>{const T=Ni(r,u);T[String(u.key)]=u,A[Qe]=()=>{k(),A[Qe]=void 0,delete f.delayedLeave,u=void 0},f.delayedLeave=()=>{$(),delete f.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return s}}};function Pi(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Re){t=n;break}}return t}const ba=ya;function Ni(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 Cs(e,t,n,r,i){const{appear:s,mode:o,persisted:a=!1,onBeforeEnter:l,onEnter:f,onAfterEnter:u,onEnterCancelled:_,onBeforeLeave:A,onLeave:k,onAfterLeave:$,onLeaveCancelled:T,onBeforeAppear:J,onAppear:U,onAfterAppear:q,onAppearCancelled:Z}=t,H=String(e.key),se=Ni(n,e),ge=(G,te)=>{G&&qe(G,r,9,te)},he=(G,te)=>{const ue=te[1];ge(G,te),z(G)?G.every(j=>j.length<=1)&&ue():G.length<=1&&ue()},ke={mode:o,persisted:a,beforeEnter(G){let te=l;if(!n.isMounted)if(s)te=J||l;else return;G[Qe]&&G[Qe](!0);const ue=se[H];ue&&Et(e,ue)&&ue.el[Qe]&&ue.el[Qe](),ge(te,[G])},enter(G){if(se[H]===e)return;let te=f,ue=u,j=_;if(!n.isMounted)if(s)te=U||f,ue=q||u,j=Z||_;else return;let le=!1;G[Yt]=b=>{le||(le=!0,b?ge(j,[G]):ge(ue,[G]),ke.delayedLeave&&ke.delayedLeave(),G[Yt]=void 0)};const v=G[Yt].bind(null,!1);te?he(te,[G,v]):v()},leave(G,te){const ue=String(e.key);if(G[Yt]&&G[Yt](!0),n.isUnmounting)return te();ge(A,[G]);let j=!1;G[Qe]=v=>{j||(j=!0,te(),v?ge(T,[G]):ge($,[G]),G[Qe]=void 0,se[ue]===e&&delete se[ue])};const le=G[Qe].bind(null,!1);se[ue]=e,k?he(k,[G,le]):le()},clone(G){const te=Cs(G,t,n,r,i);return i&&i(te),te}};return ke}function as(e){if(Wn(e))return e=wt(e),e.children=null,e}function lr(e){if(!Wn(e))return Li(e.type)&&e.children?Pi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&X(n.default))return n.default()}}function un(e,t){e.shapeFlag&6&&e.component?(e.transition=t,un(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Fi(e,t=!1,n){let r=[],i=0;for(let s=0;s<e.length;s++){let o=e[s];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:s);o.type===Q?(o.patchFlag&128&&i++,r=r.concat(Fi(o.children,t,a))):(t||o.type!==Re)&&r.push(a!=null?wt(o,{key:a}):o)}if(i>1)for(let s=0;s<r.length;s++)r[s].patchFlag=-2;return r}function Di(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function cr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Ln=new WeakMap;function sn(e,t,n,r,i=!1){if(z(e)){e.forEach((T,J)=>sn(T,t&&(z(t)?t[J]:t),n,r,i));return}if(Dt(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&sn(e,t,n,r.component.subTree);return}const s=r.shapeFlag&4?Qn(r.component):r.el,o=i?null:s,{i:a,r:l}=e,f=t&&t.r,u=a.refs===fe?a.refs={}:a.refs,_=a.setupState,A=ce(_),k=_===fe?ei:T=>cr(u,T)?!1:oe(A,T),$=(T,J)=>!(J&&cr(u,J));if(f!=null&&f!==l){if(ur(t),be(f))u[f]=null,k(f)&&(_[f]=null);else if(De(f)){const T=t;$(f,T.k)&&(f.value=null),T.k&&(u[T.k]=null)}}if(X(l))yn(l,a,12,[o,u]);else{const T=be(l),J=De(l);if(T||J){const U=()=>{if(e.f){const q=T?k(l)?_[l]:u[l]:$()||!e.k?l.value:u[e.k];if(i)z(q)&&Bs(q,s);else if(z(q))q.includes(s)||q.push(s);else if(T)u[l]=[s],k(l)&&(_[l]=u[l]);else{const Z=[s];$(l,e.k)&&(l.value=Z),e.k&&(u[e.k]=Z)}}else T?(u[l]=o,k(l)&&(_[l]=o)):J&&($(l,e.k)&&(l.value=o),e.k&&(u[e.k]=o))};if(o){const q=()=>{U(),Ln.delete(e)};q.id=-1,Ln.set(e,q),je(q,n)}else ur(e),U()}}}function ur(e){const t=Ln.get(e);t&&(t.flags|=8,Ln.delete(e))}$n().requestIdleCallback;$n().cancelIdleCallback;const Dt=e=>!!e.type.__asyncLoader,Wn=e=>e.type.__isKeepAlive;function wa(e,t){ji(e,"a",t)}function ka(e,t){ji(e,"da",t)}function ji(e,t,n=Be){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Gn(t,r,n),n){let i=n.parent;for(;i&&i.parent;)Wn(i.parent.vnode)&&Ca(r,t,n,i),i=i.parent}}function Ca(e,t,n,r){const i=Gn(t,e,r,!0);Vi(()=>{Bs(r[t],i)},n)}function Gn(e,t,n=Be,r=!1){if(n){const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{ht();const a=bn(n),l=qe(t,n,e,o);return a(),mt(),l});return r?i.unshift(s):i.push(s),s}}const gt=e=>(t,n=Be)=>{(!hn||e==="sp")&&Gn(e,(...r)=>t(...r),n)},Sa=gt("bm"),Ui=gt("m"),Aa=gt("bu"),xa=gt("u"),Hi=gt("bum"),Vi=gt("um"),Ta=gt("sp"),Ma=gt("rtg"),Ea=gt("rtc");function Oa(e,t=Be){Gn("ec",e,t)}const $i="components";function ye(e,t){return zi($i,e,!0,t)||e}const Ki=Symbol.for("v-ndc");function Ss(e){return be(e)?zi($i,e,!1)||e:e||Ki}function zi(e,t,n=!0,r=!1){const i=Ee||Be;if(i){const s=i.type;{const a=ml(s,!1);if(a&&(a===t||a===Fe(t)||a===Hn(Fe(t))))return s}const o=dr(i[e]||s[e],t)||dr(i.appContext[e],t);return!o&&r?s:o}}function dr(e,t){return e&&(e[t]||e[Fe(t)]||e[Hn(Fe(t))])}function Ae(e,t,n,r){let i;const s=n,o=z(e);if(o||be(e)){const a=o&&Lt(e);let l=!1,f=!1;a&&(l=!Ke(e),f=bt(e),e=Kn(e)),i=new Array(e.length);for(let u=0,_=e.length;u<_;u++)i[u]=t(l?f?Ut(pt(e[u])):pt(e[u]):e[u],u,void 0,s)}else if(typeof e=="number"){i=new Array(e);for(let a=0;a<e;a++)i[a]=t(a+1,a,void 0,s)}else if(ae(e))if(e[Symbol.iterator])i=Array.from(e,(a,l)=>t(a,l,void 0,s));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,f=a.length;l<f;l++){const u=a[l];i[l]=t(e[u],u,l,s)}}else i=[];return i}function Ia(e,t,n={},r,i){if(Ee.ce||Ee.parent&&Dt(Ee.parent)&&Ee.parent.ce){const f=Object.keys(n).length>0;return h(),_e(Q,null,[ve("slot",n,r&&r())],f?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),h();const o=s&&qi(s(n)),a=n.key||o&&o.key,l=_e(Q,{key:(a&&!ze(a)?a:`_${t}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&e._===1?64:-2);return s&&s._c&&(s._d=!0),l}function qi(e){return e.some(t=>fn(t)?!(t.type===Re||t.type===Q&&!qi(t.children)):!0)?e:null}const As=e=>e?mo(e)?Qn(e):As(e.parent):null,rn=xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>As(e.parent),$root:e=>As(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gi(e),$forceUpdate:e=>e.f||(e.f=()=>{$s(e.update)}),$nextTick:e=>e.n||(e.n=Ai.bind(e.proxy)),$watch:e=>ga.bind(e)}),ls=(e,t)=>e!==fe&&!e.__isScriptSetup&&oe(e,t),La={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=e;if(t[0]!=="$"){const A=o[t];if(A!==void 0)switch(A){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return s[t]}else{if(ls(r,t))return o[t]=1,r[t];if(i!==fe&&oe(i,t))return o[t]=2,i[t];if(oe(s,t))return o[t]=3,s[t];if(n!==fe&&oe(n,t))return o[t]=4,n[t];xs&&(o[t]=0)}}const f=rn[t];let u,_;if(f)return t==="$attrs"&&Le(e.attrs,"get",""),f(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==fe&&oe(n,t))return o[t]=4,n[t];if(_=l.config.globalProperties,oe(_,t))return _[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:s}=e;return ls(i,t)?(i[t]=n,!0):r!==fe&&oe(r,t)?(r[t]=n,!0):oe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:s,type:o}},a){let l;return!!(n[a]||e!==fe&&a[0]!=="$"&&oe(e,a)||ls(t,a)||oe(s,a)||oe(r,a)||oe(rn,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 fr(e){return z(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xs=!0;function Ra(e){const t=Gi(e),n=e.proxy,r=e.ctx;xs=!1,t.beforeCreate&&hr(t.beforeCreate,e,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:f,created:u,beforeMount:_,mounted:A,beforeUpdate:k,updated:$,activated:T,deactivated:J,beforeDestroy:U,beforeUnmount:q,destroyed:Z,unmounted:H,render:se,renderTracked:ge,renderTriggered:he,errorCaptured:ke,serverPrefetch:G,expose:te,inheritAttrs:ue,components:j,directives:le,filters:v}=t;if(f&&Ba(f,r,null),o)for(const m in o){const y=o[m];X(y)&&(r[m]=y.bind(n))}if(i){const m=i.call(n,n);ae(m)&&(e.data=zn(m))}if(xs=!0,s)for(const m in s){const y=s[m],S=X(y)?y.bind(n,n):X(y.get)?y.get.bind(n,n):tt,P=!X(y)&&X(y.set)?y.set.bind(n):tt,N=gl({get:S,set:P});Object.defineProperty(r,m,{enumerable:!0,configurable:!0,get:()=>N.value,set:V=>N.value=V})}if(a)for(const m in a)Wi(a[m],r,n,m);if(l){const m=X(l)?l.call(n):l;Reflect.ownKeys(m).forEach(y=>{ha(y,m[y])})}u&&hr(u,e,"c");function w(m,y){z(y)?y.forEach(S=>m(S.bind(n))):y&&m(y.bind(n))}if(w(Sa,_),w(Ui,A),w(Aa,k),w(xa,$),w(wa,T),w(ka,J),w(Oa,ke),w(Ea,ge),w(Ma,he),w(Hi,q),w(Vi,H),w(Ta,G),z(te))if(te.length){const m=e.exposed||(e.exposed={});te.forEach(y=>{Object.defineProperty(m,y,{get:()=>n[y],set:S=>n[y]=S,enumerable:!0})})}else e.exposed||(e.exposed={});se&&e.render===tt&&(e.render=se),ue!=null&&(e.inheritAttrs=ue),j&&(e.components=j),le&&(e.directives=le),G&&Di(e)}function Ba(e,t,n=tt){z(e)&&(e=Ts(e));for(const r in e){const i=e[r];let s;ae(i)?"default"in i?s=Tn(i.from||r,i.default,!0):s=Tn(i.from||r):s=Tn(i),De(s)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):t[r]=s}}function hr(e,t,n){qe(z(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Wi(e,t,n,r){let i=r.includes(".")?Ii(n,r):()=>n[r];if(be(e)){const s=t[e];X(s)&&os(i,s)}else if(X(e))os(i,e.bind(n));else if(ae(e))if(z(e))e.forEach(s=>Wi(s,t,n,r));else{const s=X(e.handler)?e.handler.bind(n):t[e.handler];X(s)&&os(i,s,e)}}function Gi(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(t);let l;return a?l=a:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(f=>Rn(l,f,o,!0)),Rn(l,t,o)),ae(t)&&s.set(t,l),l}function Rn(e,t,n,r=!1){const{mixins:i,extends:s}=t;s&&Rn(e,s,n,!0),i&&i.forEach(o=>Rn(e,o,n,!0));for(const o in t)if(!(r&&o==="expose")){const a=Pa[o]||n&&n[o];e[o]=a?a(e[o],t[o]):t[o]}return e}const Pa={data:mr,props:pr,emits:pr,methods:Xt,computed:Xt,beforeCreate:Pe,created:Pe,beforeMount:Pe,mounted:Pe,beforeUpdate:Pe,updated:Pe,beforeDestroy:Pe,beforeUnmount:Pe,destroyed:Pe,unmounted:Pe,activated:Pe,deactivated:Pe,errorCaptured:Pe,serverPrefetch:Pe,components:Xt,directives:Xt,watch:Fa,provide:mr,inject:Na};function mr(e,t){return t?e?function(){return xe(X(e)?e.call(this,this):e,X(t)?t.call(this,this):t)}:t:e}function Na(e,t){return Xt(Ts(e),Ts(t))}function Ts(e){if(z(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Pe(e,t){return e?[...new Set([].concat(e,t))]:t}function Xt(e,t){return e?xe(Object.create(null),e,t):t}function pr(e,t){return e?z(e)&&z(t)?[...new Set([...e,...t])]:xe(Object.create(null),fr(e),fr(t??{})):t}function Fa(e,t){if(!e)return t;if(!t)return e;const n=xe(Object.create(null),e);for(const r in t)n[r]=Pe(e[r],t[r]);return n}function Yi(){return{app:null,config:{isNativeTag:ei,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 Da=0;function ja(e,t){return function(r,i=null){X(r)||(r=xe({},r)),i!=null&&!ae(i)&&(i=null);const s=Yi(),o=new WeakSet,a=[];let l=!1;const f=s.app={_uid:Da++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:_l,get config(){return s.config},set config(u){},use(u,..._){return o.has(u)||(u&&X(u.install)?(o.add(u),u.install(f,..._)):X(u)&&(o.add(u),u(f,..._))),f},mixin(u){return s.mixins.includes(u)||s.mixins.push(u),f},component(u,_){return _?(s.components[u]=_,f):s.components[u]},directive(u,_){return _?(s.directives[u]=_,f):s.directives[u]},mount(u,_,A){if(!l){const k=f._ceVNode||ve(r,i);return k.appContext=s,A===!0?A="svg":A===!1&&(A=void 0),e(k,u,A),l=!0,f._container=u,u.__vue_app__=f,Qn(k.component)}},onUnmount(u){a.push(u)},unmount(){l&&(qe(a,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(u,_){return s.provides[u]=_,f},runWithContext(u){const _=jt;jt=f;try{return u()}finally{jt=_}}};return f}}let jt=null;const Ua=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Fe(t)}Modifiers`]||e[`${kt(t)}Modifiers`];function Ha(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||fe;let i=n;const s=t.startsWith("update:"),o=s&&Ua(r,t.slice(7));o&&(o.trim&&(i=n.map(u=>be(u)?u.trim():u)),o.number&&(i=n.map(Vn)));let a,l=r[a=ts(t)]||r[a=ts(Fe(t))];!l&&s&&(l=r[a=ts(kt(t))]),l&&qe(l,e,6,i);const f=r[a+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,qe(f,e,6,i)}}const Va=new WeakMap;function Ji(e,t,n=!1){const r=n?Va:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const s=e.emits;let o={},a=!1;if(!X(e)){const l=f=>{const u=Ji(f,t,!0);u&&(a=!0,xe(o,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(ae(e)&&r.set(e,null),null):(z(s)?s.forEach(l=>o[l]=null):xe(o,s),ae(e)&&r.set(e,o),o)}function Yn(e,t){return!e||!Dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),oe(e,t[0].toLowerCase()+t.slice(1))||oe(e,kt(t))||oe(e,t))}function gr(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:f,renderCache:u,props:_,data:A,setupState:k,ctx:$,inheritAttrs:T}=e,J=In(e);let U,q;try{if(n.shapeFlag&4){const H=i||r,se=H;U=et(f.call(se,H,u,_,k,A,$)),q=a}else{const H=t;U=et(H.length>1?H(_,{attrs:a,slots:o,emit:l}):H(_,null)),q=t.props?a:$a(a)}}catch(H){on.length=0,qn(H,e,1),U=ve(Re)}let Z=U;if(q&&T!==!1){const H=Object.keys(q),{shapeFlag:se}=Z;H.length&&se&7&&(s&&H.some(jn)&&(q=Ka(q,s)),Z=wt(Z,q,!1,!0))}return n.dirs&&(Z=wt(Z,null,!1,!0),Z.dirs=Z.dirs?Z.dirs.concat(n.dirs):n.dirs),n.transition&&un(Z,n.transition),U=Z,In(J),U}const $a=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dn(n))&&((t||(t={}))[n]=e[n]);return t},Ka=(e,t)=>{const n={};for(const r in e)(!jn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function za(e,t,n){const{props:r,children:i,component:s}=e,{props:o,children:a,patchFlag:l}=t,f=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?_r(r,o,f):!!o;if(l&8){const u=t.dynamicProps;for(let _=0;_<u.length;_++){const A=u[_];if(Xi(o,r,A)&&!Yn(f,A))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?_r(r,o,f):!0:!!o;return!1}function _r(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(Xi(t,e,s)&&!Yn(n,s))return!0}return!1}function Xi(e,t,n){const r=e[n],i=t[n];return n==="style"&&ae(r)&&ae(i)?!Kt(r,i):r!==i}function qa({vnode:e,parent:t,suspense:n},r){for(;t;){const i=t.subTree;if(i.suspense&&i.suspense.activeBranch===e&&(i.suspense.vnode.el=i.el=r,e=i),i===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Qi={},Zi=()=>Object.create(Qi),eo=e=>Object.getPrototypeOf(e)===Qi;function Wa(e,t,n,r=!1){const i={},s=Zi();e.propsDefaults=Object.create(null),to(e,t,i,s);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=r?i:sa(i):e.type.props?e.props=i:e.props=s,e.attrs=s}function Ga(e,t,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=e,a=ce(i),[l]=e.propsOptions;let f=!1;if((r||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let _=0;_<u.length;_++){let A=u[_];if(Yn(e.emitsOptions,A))continue;const k=t[A];if(l)if(oe(s,A))k!==s[A]&&(s[A]=k,f=!0);else{const $=Fe(A);i[$]=Ms(l,a,$,k,e,!1)}else k!==s[A]&&(s[A]=k,f=!0)}}}else{to(e,t,i,s)&&(f=!0);let u;for(const _ in a)(!t||!oe(t,_)&&((u=kt(_))===_||!oe(t,u)))&&(l?n&&(n[_]!==void 0||n[u]!==void 0)&&(i[_]=Ms(l,a,_,void 0,e,!0)):delete i[_]);if(s!==a)for(const _ in s)(!t||!oe(t,_))&&(delete s[_],f=!0)}f&&lt(e.attrs,"set","")}function to(e,t,n,r){const[i,s]=e.propsOptions;let o=!1,a;if(t)for(let l in t){if(en(l))continue;const f=t[l];let u;i&&oe(i,u=Fe(l))?!s||!s.includes(u)?n[u]=f:(a||(a={}))[u]=f:Yn(e.emitsOptions,l)||(!(l in r)||f!==r[l])&&(r[l]=f,o=!0)}if(s){const l=ce(n),f=a||fe;for(let u=0;u<s.length;u++){const _=s[u];n[_]=Ms(i,l,_,f[_],e,!oe(f,_))}}return o}function Ms(e,t,n,r,i,s){const o=e[n];if(o!=null){const a=oe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&X(l)){const{propsDefaults:f}=i;if(n in f)r=f[n];else{const u=bn(i);r=f[n]=l.call(null,t),u()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===kt(n))&&(r=!0))}return r}const Ya=new WeakMap;function no(e,t,n=!1){const r=n?Ya:t.propsCache,i=r.get(e);if(i)return i;const s=e.props,o={},a=[];let l=!1;if(!X(e)){const u=_=>{l=!0;const[A,k]=no(_,t,!0);xe(o,A),k&&a.push(...k)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!s&&!l)return ae(e)&&r.set(e,Pt),Pt;if(z(s))for(let u=0;u<s.length;u++){const _=Fe(s[u]);vr(_)&&(o[_]=fe)}else if(s)for(const u in s){const _=Fe(u);if(vr(_)){const A=s[u],k=o[_]=z(A)||X(A)?{type:A}:xe({},A),$=k.type;let T=!1,J=!0;if(z($))for(let U=0;U<$.length;++U){const q=$[U],Z=X(q)&&q.name;if(Z==="Boolean"){T=!0;break}else Z==="String"&&(J=!1)}else T=X($)&&$.name==="Boolean";k[0]=T,k[1]=J,(T||oe(k,"default"))&&a.push(_)}}const f=[o,a];return ae(e)&&r.set(e,f),f}function vr(e){return e[0]!=="$"&&!en(e)}const zs=e=>e==="_"||e==="_ctx"||e==="$stable",qs=e=>z(e)?e.map(et):[et(e)],Ja=(e,t,n)=>{if(t._n)return t;const r=Ks((...i)=>qs(t(...i)),n);return r._c=!1,r},so=(e,t,n)=>{const r=e._ctx;for(const i in e){if(zs(i))continue;const s=e[i];if(X(s))t[i]=Ja(i,s,r);else if(s!=null){const o=qs(s);t[i]=()=>o}}},ro=(e,t)=>{const n=qs(t);e.slots.default=()=>n},io=(e,t,n)=>{for(const r in t)(n||!zs(r))&&(e[r]=t[r])},Xa=(e,t,n)=>{const r=e.slots=Zi();if(e.vnode.shapeFlag&32){const i=t._;i?(io(r,t,n),n&&ri(r,"_",i,!0)):so(t,r)}else t&&ro(e,t)},Qa=(e,t,n)=>{const{vnode:r,slots:i}=e;let s=!0,o=fe;if(r.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:io(i,t,n):(s=!t.$stable,so(t,i)),o=t}else t&&(ro(e,t),o={default:1});if(s)for(const a in i)!zs(a)&&o[a]==null&&delete i[a]},je=sl;function Za(e){return el(e)}function el(e,t){const n=$n();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:f,setElementText:u,parentNode:_,nextSibling:A,setScopeId:k=tt,insertStaticContent:$}=e,T=(d,p,C,O=null,x=null,M=null,F=void 0,R=null,L=!!p.dynamicChildren)=>{if(d===p)return;d&&!Et(d,p)&&(O=kn(d),V(d,x,M,!0),d=null),p.patchFlag===-2&&(L=!1,p.dynamicChildren=null);const{type:E,ref:W,shapeFlag:D}=p;switch(E){case Jn:J(d,p,C,O);break;case Re:U(d,p,C,O);break;case us:d==null&&q(p,C,O,F);break;case Q:j(d,p,C,O,x,M,F,R,L);break;default:D&1?se(d,p,C,O,x,M,F,R,L):D&6?le(d,p,C,O,x,M,F,R,L):(D&64||D&128)&&E.process(d,p,C,O,x,M,F,R,L,qt)}W!=null&&x?sn(W,d&&d.ref,M,p||d,!p):W==null&&d&&d.ref!=null&&sn(d.ref,null,M,d,!0)},J=(d,p,C,O)=>{if(d==null)r(p.el=a(p.children),C,O);else{const x=p.el=d.el;p.children!==d.children&&f(x,p.children)}},U=(d,p,C,O)=>{d==null?r(p.el=l(p.children||""),C,O):p.el=d.el},q=(d,p,C,O)=>{[d.el,d.anchor]=$(d.children,p,C,O,d.el,d.anchor)},Z=({el:d,anchor:p},C,O)=>{let x;for(;d&&d!==p;)x=A(d),r(d,C,O),d=x;r(p,C,O)},H=({el:d,anchor:p})=>{let C;for(;d&&d!==p;)C=A(d),i(d),d=C;i(p)},se=(d,p,C,O,x,M,F,R,L)=>{if(p.type==="svg"?F="svg":p.type==="math"&&(F="mathml"),d==null)ge(p,C,O,x,M,F,R,L);else{const E=d.el&&d.el._isVueCE?d.el:null;try{E&&E._beginPatch(),G(d,p,x,M,F,R,L)}finally{E&&E._endPatch()}}},ge=(d,p,C,O,x,M,F,R)=>{let L,E;const{props:W,shapeFlag:D,transition:K,dirs:Y}=d;if(L=d.el=o(d.type,M,W&&W.is,W),D&8?u(L,d.children):D&16&&ke(d.children,L,null,O,x,cs(d,M),F,R),Y&&Ct(d,null,O,"created"),he(L,d,d.scopeId,F,O),W){for(const de in W)de!=="value"&&!en(de)&&s(L,de,null,W[de],M,O);"value"in W&&s(L,"value",null,W.value,M),(E=W.onVnodeBeforeMount)&&Je(E,O,d)}Y&&Ct(d,null,O,"beforeMount");const re=tl(x,K);re&&K.beforeEnter(L),r(L,p,C),((E=W&&W.onVnodeMounted)||re||Y)&&je(()=>{try{E&&Je(E,O,d),re&&K.enter(L),Y&&Ct(d,null,O,"mounted")}finally{}},x)},he=(d,p,C,O,x)=>{if(C&&k(d,C),O)for(let M=0;M<O.length;M++)k(d,O[M]);if(x){let M=x.subTree;if(p===M||co(M.type)&&(M.ssContent===p||M.ssFallback===p)){const F=x.vnode;he(d,F,F.scopeId,F.slotScopeIds,x.parent)}}},ke=(d,p,C,O,x,M,F,R,L=0)=>{for(let E=L;E<d.length;E++){const W=d[E]=R?ot(d[E]):et(d[E]);T(null,W,p,C,O,x,M,F,R)}},G=(d,p,C,O,x,M,F)=>{const R=p.el=d.el;let{patchFlag:L,dynamicChildren:E,dirs:W}=p;L|=d.patchFlag&16;const D=d.props||fe,K=p.props||fe;let Y;if(C&&St(C,!1),(Y=K.onVnodeBeforeUpdate)&&Je(Y,C,p,d),W&&Ct(p,d,C,"beforeUpdate"),C&&St(C,!0),(D.innerHTML&&K.innerHTML==null||D.textContent&&K.textContent==null)&&u(R,""),E?te(d.dynamicChildren,E,R,C,O,cs(p,x),M):F||y(d,p,R,null,C,O,cs(p,x),M,!1),L>0){if(L&16)ue(R,D,K,C,x);else if(L&2&&D.class!==K.class&&s(R,"class",null,K.class,x),L&4&&s(R,"style",D.style,K.style,x),L&8){const re=p.dynamicProps;for(let de=0;de<re.length;de++){const me=re[de],Ce=D[me],Te=K[me];(Te!==Ce||me==="value")&&s(R,me,Ce,Te,x,C)}}L&1&&d.children!==p.children&&u(R,p.children)}else!F&&E==null&&ue(R,D,K,C,x);((Y=K.onVnodeUpdated)||W)&&je(()=>{Y&&Je(Y,C,p,d),W&&Ct(p,d,C,"updated")},O)},te=(d,p,C,O,x,M,F)=>{for(let R=0;R<p.length;R++){const L=d[R],E=p[R],W=L.el&&(L.type===Q||!Et(L,E)||L.shapeFlag&198)?_(L.el):C;T(L,E,W,null,O,x,M,F,!0)}},ue=(d,p,C,O,x)=>{if(p!==C){if(p!==fe)for(const M in p)!en(M)&&!(M in C)&&s(d,M,p[M],null,x,O);for(const M in C){if(en(M))continue;const F=C[M],R=p[M];F!==R&&M!=="value"&&s(d,M,R,F,x,O)}"value"in C&&s(d,"value",p.value,C.value,x)}},j=(d,p,C,O,x,M,F,R,L)=>{const E=p.el=d?d.el:a(""),W=p.anchor=d?d.anchor:a("");let{patchFlag:D,dynamicChildren:K,slotScopeIds:Y}=p;Y&&(R=R?R.concat(Y):Y),d==null?(r(E,C,O),r(W,C,O),ke(p.children||[],C,W,x,M,F,R,L)):D>0&&D&64&&K&&d.dynamicChildren&&d.dynamicChildren.length===K.length?(te(d.dynamicChildren,K,C,x,M,F,R),(p.key!=null||x&&p===x.subTree)&&oo(d,p,!0)):y(d,p,C,W,x,M,F,R,L)},le=(d,p,C,O,x,M,F,R,L)=>{p.slotScopeIds=R,d==null?p.shapeFlag&512?x.ctx.activate(p,C,O,F,L):v(p,C,O,x,M,F,L):b(d,p,L)},v=(d,p,C,O,x,M,F)=>{const R=d.component=cl(d,O,x);if(Wn(d)&&(R.ctx.renderer=qt),ul(R,!1,F),R.asyncDep){if(x&&x.registerDep(R,w,F),!d.el){const L=R.subTree=ve(Re);U(null,L,p,C),d.placeholder=L.el}}else w(R,d,p,C,x,M,F)},b=(d,p,C)=>{const O=p.component=d.component;if(za(d,p,C))if(O.asyncDep&&!O.asyncResolved){m(O,p,C);return}else O.next=p,O.update();else p.el=d.el,O.vnode=p},w=(d,p,C,O,x,M,F)=>{const R=()=>{if(d.isMounted){let{next:D,bu:K,u:Y,parent:re,vnode:de}=d;{const Ge=ao(d);if(Ge){D&&(D.el=de.el,m(d,D,F)),Ge.asyncDep.then(()=>{je(()=>{d.isUnmounted||E()},x)});return}}let me=D,Ce;St(d,!1),D?(D.el=de.el,m(d,D,F)):D=de,K&&xn(K),(Ce=D.props&&D.props.onVnodeBeforeUpdate)&&Je(Ce,re,D,de),St(d,!0);const Te=gr(d),We=d.subTree;d.subTree=Te,T(We,Te,_(We.el),kn(We),d,x,M),D.el=Te.el,me===null&&qa(d,Te.el),Y&&je(Y,x),(Ce=D.props&&D.props.onVnodeUpdated)&&je(()=>Je(Ce,re,D,de),x)}else{let D;const{el:K,props:Y}=p,{bm:re,m:de,parent:me,root:Ce,type:Te}=d,We=Dt(p);St(d,!1),re&&xn(re),!We&&(D=Y&&Y.onVnodeBeforeMount)&&Je(D,me,p),St(d,!0);{Ce.ce&&Ce.ce._hasShadowRoot()&&Ce.ce._injectChildStyle(Te,d.parent?d.parent.type:void 0);const Ge=d.subTree=gr(d);T(null,Ge,C,O,d,x,M),p.el=Ge.el}if(de&&je(de,x),!We&&(D=Y&&Y.onVnodeMounted)){const Ge=p;je(()=>Je(D,me,Ge),x)}(p.shapeFlag&256||me&&Dt(me.vnode)&&me.vnode.shapeFlag&256)&&d.a&&je(d.a,x),d.isMounted=!0,p=C=O=null}};d.scope.on();const L=d.effect=new li(R);d.scope.off();const E=d.update=L.run.bind(L),W=d.job=L.runIfDirty.bind(L);W.i=d,W.id=d.uid,L.scheduler=()=>$s(W),St(d,!0),E()},m=(d,p,C)=>{p.component=d;const O=d.vnode.props;d.vnode=p,d.next=null,Ga(d,p.props,O,C),Qa(d,p.children,C),ht(),ar(d),mt()},y=(d,p,C,O,x,M,F,R,L=!1)=>{const E=d&&d.children,W=d?d.shapeFlag:0,D=p.children,{patchFlag:K,shapeFlag:Y}=p;if(K>0){if(K&128){P(E,D,C,O,x,M,F,R,L);return}else if(K&256){S(E,D,C,O,x,M,F,R,L);return}}Y&8?(W&16&&zt(E,x,M),D!==E&&u(C,D)):W&16?Y&16?P(E,D,C,O,x,M,F,R,L):zt(E,x,M,!0):(W&8&&u(C,""),Y&16&&ke(D,C,O,x,M,F,R,L))},S=(d,p,C,O,x,M,F,R,L)=>{d=d||Pt,p=p||Pt;const E=d.length,W=p.length,D=Math.min(E,W);let K;for(K=0;K<D;K++){const Y=p[K]=L?ot(p[K]):et(p[K]);T(d[K],Y,C,null,x,M,F,R,L)}E>W?zt(d,x,M,!0,!1,D):ke(p,C,O,x,M,F,R,L,D)},P=(d,p,C,O,x,M,F,R,L)=>{let E=0;const W=p.length;let D=d.length-1,K=W-1;for(;E<=D&&E<=K;){const Y=d[E],re=p[E]=L?ot(p[E]):et(p[E]);if(Et(Y,re))T(Y,re,C,null,x,M,F,R,L);else break;E++}for(;E<=D&&E<=K;){const Y=d[D],re=p[K]=L?ot(p[K]):et(p[K]);if(Et(Y,re))T(Y,re,C,null,x,M,F,R,L);else break;D--,K--}if(E>D){if(E<=K){const Y=K+1,re=Y<W?p[Y].el:O;for(;E<=K;)T(null,p[E]=L?ot(p[E]):et(p[E]),C,re,x,M,F,R,L),E++}}else if(E>K)for(;E<=D;)V(d[E],x,M,!0),E++;else{const Y=E,re=E,de=new Map;for(E=re;E<=K;E++){const Ue=p[E]=L?ot(p[E]):et(p[E]);Ue.key!=null&&de.set(Ue.key,E)}let me,Ce=0;const Te=K-re+1;let We=!1,Ge=0;const Wt=new Array(Te);for(E=0;E<Te;E++)Wt[E]=0;for(E=Y;E<=D;E++){const Ue=d[E];if(Ce>=Te){V(Ue,x,M,!0);continue}let Ye;if(Ue.key!=null)Ye=de.get(Ue.key);else for(me=re;me<=K;me++)if(Wt[me-re]===0&&Et(Ue,p[me])){Ye=me;break}Ye===void 0?V(Ue,x,M,!0):(Wt[Ye-re]=E+1,Ye>=Ge?Ge=Ye:We=!0,T(Ue,p[Ye],C,null,x,M,F,R,L),Ce++)}const er=We?nl(Wt):Pt;for(me=er.length-1,E=Te-1;E>=0;E--){const Ue=re+E,Ye=p[Ue],tr=p[Ue+1],nr=Ue+1<W?tr.el||lo(tr):O;Wt[E]===0?T(null,Ye,C,nr,x,M,F,R,L):We&&(me<0||E!==er[me]?N(Ye,C,nr,2):me--)}}},N=(d,p,C,O,x=null)=>{const{el:M,type:F,transition:R,children:L,shapeFlag:E}=d;if(E&6){N(d.component.subTree,p,C,O);return}if(E&128){d.suspense.move(p,C,O);return}if(E&64){F.move(d,p,C,qt);return}if(F===Q){r(M,p,C);for(let D=0;D<L.length;D++)N(L[D],p,C,O);r(d.anchor,p,C);return}if(F===us){Z(d,p,C);return}if(O!==2&&E&1&&R)if(O===0)R.beforeEnter(M),r(M,p,C),je(()=>R.enter(M),x);else{const{leave:D,delayLeave:K,afterLeave:Y}=R,re=()=>{d.ctx.isUnmounted?i(M):r(M,p,C)},de=()=>{M._isLeaving&&M[Qe](!0),D(M,()=>{re(),Y&&Y()})};K?K(M,re,de):de()}else r(M,p,C)},V=(d,p,C,O=!1,x=!1)=>{const{type:M,props:F,ref:R,children:L,dynamicChildren:E,shapeFlag:W,patchFlag:D,dirs:K,cacheIndex:Y,memo:re}=d;if(D===-2&&(x=!1),R!=null&&(ht(),sn(R,null,C,d,!0),mt()),Y!=null&&(p.renderCache[Y]=void 0),W&256){p.ctx.deactivate(d);return}const de=W&1&&K,me=!Dt(d);let Ce;if(me&&(Ce=F&&F.onVnodeBeforeUnmount)&&Je(Ce,p,d),W&6)Zn(d.component,C,O);else{if(W&128){d.suspense.unmount(C,O);return}de&&Ct(d,null,p,"beforeUnmount"),W&64?d.type.remove(d,p,C,qt,O):E&&!E.hasOnce&&(M!==Q||D>0&&D&64)?zt(E,p,C,!1,!0):(M===Q&&D&384||!x&&W&16)&&zt(L,p,C),O&&ie(d)}const Te=re!=null&&Y==null;(me&&(Ce=F&&F.onVnodeUnmounted)||de||Te)&&je(()=>{Ce&&Je(Ce,p,d),de&&Ct(d,null,p,"unmounted"),Te&&(d.el=null)},C)},ie=d=>{const{type:p,el:C,anchor:O,transition:x}=d;if(p===Q){ne(C,O);return}if(p===us){H(d);return}const M=()=>{i(C),x&&!x.persisted&&x.afterLeave&&x.afterLeave()};if(d.shapeFlag&1&&x&&!x.persisted){const{leave:F,delayLeave:R}=x,L=()=>F(C,M);R?R(d.el,M,L):L()}else M()},ne=(d,p)=>{let C;for(;d!==p;)C=A(d),i(d),d=C;i(p)},Zn=(d,p,C)=>{const{bum:O,scope:x,job:M,subTree:F,um:R,m:L,a:E}=d;yr(L),yr(E),O&&xn(O),x.stop(),M&&(M.flags|=8,V(F,d,p,C)),R&&je(R,p),je(()=>{d.isUnmounted=!0},p)},zt=(d,p,C,O=!1,x=!1,M=0)=>{for(let F=M;F<d.length;F++)V(d[F],p,C,O,x)},kn=d=>{if(d.shapeFlag&6)return kn(d.component.subTree);if(d.shapeFlag&128)return d.suspense.next();const p=A(d.anchor||d.el),C=p&&p[_a];return C?A(C):p};let es=!1;const Zs=(d,p,C)=>{let O;d==null?p._vnode&&(V(p._vnode,null,null,!0),O=p._vnode.component):T(p._vnode||null,d,p,null,null,null,C),p._vnode=d,es||(es=!0,ar(O),Ti(),es=!1)},qt={p:T,um:V,m:N,r:ie,mt:v,mc:ke,pc:y,pbc:te,n:kn,o:e};return{render:Zs,hydrate:void 0,createApp:ja(Zs)}}function cs({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 St({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function tl(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oo(e,t,n=!1){const r=e.children,i=t.children;if(z(r)&&z(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=ot(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&oo(o,a)),a.type===Jn&&(a.patchFlag===-1&&(a=i[s]=ot(a)),a.el=o.el),a.type===Re&&!a.el&&(a.el=o.el)}}function nl(e){const t=e.slice(),n=[0];let r,i,s,o,a;const l=e.length;for(r=0;r<l;r++){const f=e[r];if(f!==0){if(i=n[n.length-1],e[i]<f){t[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,e[n[a]]<f?s=a+1:o=a;f<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=t[o];return n}function ao(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ao(t)}function yr(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function lo(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?lo(t.subTree):null}const co=e=>e.__isSuspense;function sl(e,t){t&&t.pendingBranch?z(e)?t.effects.push(...e):t.effects.push(e):fa(e)}const Q=Symbol.for("v-fgt"),Jn=Symbol.for("v-txt"),Re=Symbol.for("v-cmt"),us=Symbol.for("v-stc"),on=[];let He=null;function h(e=!1){on.push(He=e?null:[])}function rl(){on.pop(),He=on[on.length-1]||null}let dn=1;function Bn(e,t=!1){dn+=e,e<0&&He&&t&&(He.hasOnce=!0)}function uo(e){return e.dynamicChildren=dn>0?He||Pt:null,rl(),dn>0&&He&&He.push(e),e}function g(e,t,n,r,i,s){return uo(c(e,t,n,r,i,s,!0))}function _e(e,t,n,r,i){return uo(ve(e,t,n,r,i,!0))}function fn(e){return e?e.__v_isVNode===!0:!1}function Et(e,t){return e.type===t.type&&e.key===t.key}const fo=({key:e})=>e??null,Mn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?be(e)||De(e)||X(e)?{i:Ee,r:e,k:t,f:!!n}:e:null);function c(e,t=null,n=null,r=0,i=null,s=e===Q?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fo(t),ref:t&&Mn(t),scopeId:Ei,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Ee};return a?(Ws(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=be(n)?8:16),dn>0&&!o&&He&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&He.push(l),l}const ve=il;function il(e,t=null,n=null,r=0,i=null,s=!1){if((!e||e===Ki)&&(e=Re),fn(e)){const a=wt(e,t,!0);return n&&Ws(a,n),dn>0&&!s&&He&&(a.shapeFlag&6?He[He.indexOf(e)]=a:He.push(a)),a.patchFlag=-2,a}if(pl(e)&&(e=e.__vccOpts),t){t=ol(t);let{class:a,style:l}=t;a&&!be(a)&&(t.class=ee(a)),ae(l)&&(Vs(l)&&!z(l)&&(l=xe({},l)),t.style=Se(l))}const o=be(e)?1:co(e)?128:Li(e)?64:ae(e)?4:X(e)?2:0;return c(e,t,n,r,i,o,s,!0)}function ol(e){return e?Vs(e)||eo(e)?xe({},e):e:null}function wt(e,t,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=e,f=t?Es(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&fo(f),ref:t&&t.ref?n&&s?z(s)?s.concat(Mn(t)):[s,Mn(t)]:Mn(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!==Q?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&&wt(e.ssContent),ssFallback:e.ssFallback&&wt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&un(u,l.clone(u)),u}function Xn(e=" ",t=0){return ve(Jn,null,e,t)}function B(e="",t=!1){return t?(h(),_e(Re,null,e)):ve(Re,null,e)}function et(e){return e==null||typeof e=="boolean"?ve(Re):z(e)?ve(Q,null,e.slice()):fn(e)?ot(e):ve(Jn,null,String(e))}function ot(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:wt(e)}function Ws(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(z(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),Ws(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!eo(t)?t._ctx=Ee:i===3&&Ee&&(Ee.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else X(t)?(t={default:t,_ctx:Ee},n=32):(t=String(t),r&64?(n=16,t=[Xn(t)]):n=8);e.children=t,e.shapeFlag|=n}function Es(...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=ee([t.class,r.class]));else if(i==="style")t.style=Se([t.style,r.style]);else if(Dn(i)){const s=t[i],o=r[i];o&&s!==o&&!(z(s)&&s.includes(o))?t[i]=s?[].concat(s,o):o:o==null&&s==null&&!jn(i)&&(t[i]=o)}else i!==""&&(t[i]=r[i])}return t}function Je(e,t,n,r=null){qe(e,t,7,[n,r])}const al=Yi();let ll=0;function cl(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||al,s={uid:ll++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Fo(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:no(r,i),emitsOptions:Ji(r,i),emit:null,emitted:null,propsDefaults:fe,inheritAttrs:r.inheritAttrs,ctx:fe,data:fe,props:fe,attrs:fe,slots:fe,refs:fe,setupState:fe,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return s.ctx={_:s},s.root=t?t.root:s,s.emit=Ha.bind(null,s),e.ce&&e.ce(s),s}let Be=null;const ho=()=>Be||Ee;let Pn,Os;{const e=$n(),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)}};Pn=t("__VUE_INSTANCE_SETTERS__",n=>Be=n),Os=t("__VUE_SSR_SETTERS__",n=>hn=n)}const bn=e=>{const t=Be;return Pn(e),e.scope.on(),()=>{e.scope.off(),Pn(t)}},br=()=>{Be&&Be.scope.off(),Pn(null)};function mo(e){return e.vnode.shapeFlag&4}let hn=!1;function ul(e,t=!1,n=!1){t&&Os(t);const{props:r,children:i}=e.vnode,s=mo(e);Wa(e,r,s,t),Xa(e,i,n||t);const o=s?dl(e,t):void 0;return t&&Os(!1),o}function dl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,La);const{setup:r}=n;if(r){ht();const i=e.setupContext=r.length>1?hl(e):null,s=bn(e),o=yn(r,e,0,[e.props,i]),a=ti(o);if(mt(),s(),(a||e.sp)&&!Dt(e)&&Di(e),a){if(o.then(br,br),t)return o.then(l=>{wr(e,l)}).catch(l=>{qn(l,e,0)});e.asyncDep=o}else wr(e,o)}else po(e)}function wr(e,t,n){X(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ae(t)&&(e.setupState=Ci(t)),po(e)}function po(e,t,n){const r=e.type;e.render||(e.render=r.render||tt);{const i=bn(e);ht();try{Ra(e)}finally{mt(),i()}}}const fl={get(e,t){return Le(e,"get",""),e[t]}};function hl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,fl),slots:e.slots,emit:e.emit,expose:t}}function Qn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ci(ks(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in rn)return rn[n](e)},has(t,n){return n in t||n in rn}})):e.proxy}function ml(e,t=!0){return X(e)?e.displayName||e.name:e.name||t&&e.__name}function pl(e){return X(e)&&"__vccOpts"in e}const gl=(e,t)=>aa(e,t,hn);function go(e,t,n){try{Bn(-1);const r=arguments.length;return r===2?ae(t)&&!z(t)?fn(t)?ve(e,null,[t]):ve(e,t):ve(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&fn(n)&&(n=[n]),ve(e,t,n))}finally{Bn(1)}}const _l="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 Is;const kr=typeof window<"u"&&window.trustedTypes;if(kr)try{Is=kr.createPolicy("vue",{createHTML:e=>e})}catch{}const _o=Is?e=>Is.createHTML(e):e=>e,vl="http://www.w3.org/2000/svg",yl="http://www.w3.org/1998/Math/MathML",rt=typeof document<"u"?document:null,Cr=rt&&rt.createElement("template"),bl={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"?rt.createElementNS(vl,e):t==="mathml"?rt.createElementNS(yl,e):n?rt.createElement(e,{is:n}):rt.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>rt.createTextNode(e),createComment:e=>rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rt.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{Cr.innerHTML=_o(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Cr.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]}},_t="transition",Jt="animation",mn=Symbol("_vtc"),vo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},wl=Ae({},Ri,vo),kl=e=>(e.displayName="Transition",e.props=wl,e),yo=kl((e,{slots:t})=>go(ba,Cl(e),t)),At=(e,t=[])=>{z(e)?e.forEach(n=>n(...t)):e&&e(...t)},Sr=e=>e?z(e)?e.some(t=>t.length>1):e.length>1:!1;function Cl(e){const t={};for(const j in e)j in vo||(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:f=o,appearToClass:c=a,leaveFromClass:g=`${n}-leave-from`,leaveActiveClass:A=`${n}-leave-active`,leaveToClass:k=`${n}-leave-to`}=e,$=Sl(i),T=$&&$[0],J=$&&$[1],{onBeforeEnter:U,onEnter:q,onEnterCancelled:Z,onLeave:H,onLeaveCancelled:se,onBeforeAppear:ge=U,onAppear:he=q,onAppearCancelled:ke=Z}=t,G=(j,le,v,b)=>{j._enterCancelled=b,xt(j,le?c:a),xt(j,le?f:o),v&&v()},te=(j,le)=>{j._isLeaving=!1,xt(j,g),xt(j,k),xt(j,A),le&&le()},ue=j=>(le,v)=>{const b=j?he:q,w=()=>G(le,j,v);At(b,[le,w]),Ar(()=>{xt(le,j?l:s),st(le,j?c:a),Sr(b)||xr(le,r,T,w)})};return Ae(t,{onBeforeEnter(j){At(U,[j]),st(j,s),st(j,o)},onBeforeAppear(j){At(ge,[j]),st(j,l),st(j,f)},onEnter:ue(!1),onAppear:ue(!0),onLeave(j,le){j._isLeaving=!0;const v=()=>te(j,le);st(j,g),j._enterCancelled?(st(j,A),Er(j)):(Er(j),st(j,A)),Ar(()=>{j._isLeaving&&(xt(j,g),st(j,k),Sr(H)||xr(j,r,J,v))}),At(H,[j,v])},onEnterCancelled(j){G(j,!1,void 0,!0),At(Z,[j])},onAppearCancelled(j){G(j,!0,void 0,!0),At(ke,[j])},onLeaveCancelled(j){te(j),At(se,[j])}})}function Sl(e){if(e==null)return null;if(ae(e))return[ds(e.enter),ds(e.leave)];{const t=ds(e);return[t,t]}}function ds(e){return Eo(e)}function st(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[mn]||(e[mn]=new Set)).add(t)}function xt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[mn];n&&(n.delete(t),n.size||(e[mn]=void 0))}function Ar(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Al=0;function xr(e,t,n,r){const i=e._endId=++Al,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=xl(e,t);if(!o)return r();const f=o+"end";let c=0;const g=()=>{e.removeEventListener(f,A),s()},A=k=>{k.target===e&&++c>=l&&g()};setTimeout(()=>{c<l&&g()},a+1),e.addEventListener(f,A)}function xl(e,t){const n=window.getComputedStyle(e),r=$=>(n[$]||"").split(", "),i=r(`${_t}Delay`),s=r(`${_t}Duration`),o=Tr(i,s),a=r(`${Jt}Delay`),l=r(`${Jt}Duration`),f=Tr(a,l);let c=null,g=0,A=0;t===_t?o>0&&(c=_t,g=o,A=s.length):t===Jt?f>0&&(c=Jt,g=f,A=l.length):(g=Math.max(o,f),c=g>0?o>f?_t:Jt:null,A=c?c===_t?s.length:l.length:0);const k=c===_t&&/\b(?:transform|all)(?:,|$)/.test(r(`${_t}Property`).toString());return{type:c,timeout:g,propCount:A,hasTransform:k}}function Tr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Mr(n)+Mr(e[r])))}function Mr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Er(e){return(e?e.ownerDocument:document).body.offsetHeight}function Tl(e,t,n){const r=e[mn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Or=Symbol("_vod"),Ml=Symbol("_vsh"),El=Symbol(""),Ol=/(?:^|;)\s*display\s*:/;function Il(e,t,n){const r=e.style,i=be(n);let s=!1;if(n&&!i){if(t)if(be(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Qt(r,a,"")}else for(const o in t)n[o]==null&&Qt(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Rl(e,o,!be(t)&&t?t[o]:void 0,a)||Qt(r,o,a):Qt(r,o,"")}}else if(i){if(t!==n){const o=r[El];o&&(n+=";"+o),r.cssText=n,s=Ol.test(n)}}else t&&e.removeAttribute("style");Or in e&&(e[Or]=s?r.display:"",e[Ml]&&(r.display="none"))}const Ir=/\s*!important$/;function Qt(e,t,n){if(z(n))n.forEach(r=>Qt(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ll(e,t);Ir.test(n)?e.setProperty(kt(r),n.replace(Ir,""),"important"):e[r]=n}}const Lr=["Webkit","Moz","ms"],fs={};function Ll(e,t){const n=fs[t];if(n)return n;let r=Ne(t);if(r!=="filter"&&r in e)return fs[t]=r;r=Hn(r);for(let i=0;i<Lr.length;i++){const s=Lr[i]+r;if(s in e)return fs[t]=s}return t}function Rl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&be(r)&&n===r}const Rr="http://www.w3.org/1999/xlink";function Pr(e,t,n,r,i,s=Bo(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Rr,t.slice(6,t.length)):e.setAttributeNS(Rr,t,n):n==null||s&&!ii(n)?e.removeAttribute(t):e.setAttribute(t,s?"":ze(n)?String(n):n)}function Br(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?_o(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=ii(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 yt(e,t,n,r){e.addEventListener(t,n,r)}function Pl(e,t,n,r){e.removeEventListener(t,n,r)}const Nr=Symbol("_vei");function Bl(e,t,n,r,i=null){const s=e[Nr]||(e[Nr]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=Nl(t);if(r){const f=s[t]=jl(r,i);yt(e,a,f,l)}else o&&(Pl(e,a,o,l),s[t]=void 0)}}const Fr=/(?:Once|Passive|Capture)$/;function Nl(e){let t;if(Fr.test(e)){t={};let r;for(;r=e.match(Fr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kt(e.slice(2)),t]}let hs=0;const Fl=Promise.resolve(),Dl=()=>hs||(Fl.then(()=>hs=0),hs=Date.now());function jl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;qe(Ul(r,n.value),t,5,[r])};return n.value=e,n.attached=Dl(),n}function Ul(e,t){if(z(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const Dr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Hl=(e,t,n,r,i,s)=>{const o=i==="svg";t==="class"?Tl(e,r,o):t==="style"?Il(e,n,r):Dn(t)?jn(t)||Bl(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Vl(e,t,r,o))?(Br(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Pr(e,t,r,o,s,t!=="value")):e._isVueCE&&($l(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!be(r)))?Br(e,Ne(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Pr(e,t,r,o))};function Vl(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Dr(t)&&X(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Dr(t)&&be(n)?!1:t in e}function $l(e,t){const n=e._def.props;if(!n)return!1;const r=Ne(t);return Array.isArray(n)?n.some(i=>Ne(i)===r):Object.keys(n).some(i=>Ne(i)===r)}const Ht=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z(t)?n=>xn(t,n):t};function Kl(e){e.target.composing=!0}function jr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ft=Symbol("_assign");function Ur(e,t,n){return t&&(e=e.trim()),n&&(e=Vn(e)),e}const Ot={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[ft]=Ht(i);const s=r||i.props&&i.props.type==="number";yt(e,t?"change":"input",o=>{o.target.composing||e[ft](Ur(e.value,n,s))}),(n||s)&&yt(e,"change",()=>{e.value=Ur(e.value,n,s)}),t||(yt(e,"compositionstart",Kl),yt(e,"compositionend",jr),yt(e,"change",jr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[ft]=Ht(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Vn(e.value):e.value,l=t??"";if(a===l)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},zl={deep:!0,created(e,t,n){e[ft]=Ht(n),yt(e,"change",()=>{const r=e._modelValue,i=pn(e),s=e.checked,o=e[ft];if(z(r)){const a=Ns(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const f=[...r];f.splice(a,1),o(f)}}else if($t(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(bo(e,s))})},mounted:Hr,beforeUpdate(e,t,n){e[ft]=Ht(n),Hr(e,t,n)}};function Hr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(z(t))i=Ns(t,r.props.value)>-1;else if($t(t))i=t.has(r.props.value);else{if(t===n)return;i=Kt(t,bo(e,!0))}e.checked!==i&&(e.checked=i)}const ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=$t(t);yt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Vn(pn(o)):pn(o));e[ft](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,Ai(()=>{e._assigning=!1})}),e[ft]=Ht(r)},mounted(e,{value:t}){Vr(e,t)},beforeUpdate(e,t,n){e[ft]=Ht(n)},updated(e,{value:t}){e._assigning||Vr(e,t)}};function Vr(e,t){const n=e.multiple,r=z(t);if(!(n&&!r&&!$t(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=pn(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(f=>String(f)===String(a)):o.selected=Ns(t,a)>-1}else o.selected=t.has(a);else if(Kt(pn(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function pn(e){return"_value"in e?e._value:e.value}function bo(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Wl=["ctrl","shift","alt","meta"],Gl={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)=>Wl.some(n=>e[`${n}Key`]&&!t.includes(n))},dt=(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=Gl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},Yl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Nn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=kt(i.key);if(t.some(o=>o===s||Yl[o]===s))return e(i)})},Jl=Ae({patchProp:Hl},bl);let $r;function Xl(){return $r||($r=Za(Jl))}const Ql=(...e)=>{const t=Xl().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=ec(r);if(!i)return;const s=t._component;!X(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,Zl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ec(e){return be(e)?document.querySelector(e):e}const tc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],ms="/client",nc=5*60*1e3,sc=10*60*1e3,rc=5*60*1e3;function ic(e){const t={baseUrl:oc(e.baseUrl||""),widgetId:e.widgetId||"",userId:"",origin:"",token:"",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(h,y){return t.listeners.has(h)||t.listeners.set(h,new Set),t.listeners.get(h).add(y),()=>t.listeners.get(h).delete(y)}function r(h,y){const S=t.listeners.get(h);S&&S.forEach(P=>{try{P(y)}catch(N){console.error("[transport] listener",h,N)}})}function i(h){t.connection!==h&&(t.connection=h,r("connection",h))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId,...t.origin?{"X-Parent-Origin":t.origin}:{}}}async function o(h,y,S){const P=await fetch(`${t.baseUrl}${ms}${y}`,{method:h,credentials:"include",headers:s(),body:S!==void 0?JSON.stringify(S):void 0});if(!P.ok){const N=await a(P),V=new Error(`HTTP ${P.status} ${h} ${y} :: ${(N==null?void 0:N.error)||P.statusText}`);throw V.status=P.status,V.body=N,V}return P.status===204?null:P.json()}async function a(h){try{return await h.json()}catch{return null}}async function l(h){if(t.started)return t.lastBootstrap;if(!(h!=null&&h.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=h.origin,t.token=h.token||"";const y=await fetch(`${t.baseUrl}${ms}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{},allowUnauthenticated:h.allowUnauthenticated===!0,...h.customer&&typeof h.customer=="object"?{customer:h.customer}:{}})});if(!y.ok){const ie=await a(y),ne=new Error(`Session bootstrap failed: HTTP ${y.status} :: ${(ie==null?void 0:ie.error)||y.statusText}`);throw ne.status=y.status,ne.body=ie,ne}const S=await y.json();t.userId=S.external_id;const[P,N]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async ie=>{if(!ie.ok){const ne=await a(ie);throw new Error(`HTTP ${ie.status} GET /widgets/:id/config :: ${(ne==null?void 0:ne.error)||ie.statusText}`)}return ie.json()}),o("GET","/customers/me")]),V={config:P,customer:(N==null?void 0:N.customer)??null};return t.lastBootstrap=V,await f(),typeof document<"u"&&(t.visibilityHandler=b,document.addEventListener("visibilitychange",t.visibilityHandler)),le(),V}async function f(){try{const h=await A();t.lastActivityAt=h.reduce((y,S)=>{const P=S==null?void 0:S.last_message_at;return P&&(!y||P>y)?P:y},null)}catch(h){console.error("[transport] initial /conversations failed",h)}}async function c(){const h=await o("GET","/customers/me");return(h==null?void 0:h.customer)??null}async function g(h){const y=await o("PATCH","/customers/me",h);return(y==null?void 0:y.customer)??null}async function A(){const h=await o("GET","/conversations");return(h==null?void 0:h.conversations)??[]}async function k(h={}){return(await o("POST","/conversations",h)).conversation}async function $(h){return(await o("GET",`/conversations/${encodeURIComponent(h)}`)).conversation}async function T(h,y){return(await o("PATCH",`/conversations/${encodeURIComponent(h)}`,y)).conversation}async function J(h,y){return o("PATCH",`/conversations/${encodeURIComponent(h)}/read`,{message_id:y})}async function U(h,y={}){const S=new URLSearchParams;y.before&&S.set("before",y.before),y.since&&S.set("since",y.since),y.limit&&S.set("limit",String(y.limit));const P=S.toString()?`?${S.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(h)}/messages${P}`)}async function q(h,y){te();const S={client_msg_id:y.client_msg_id,type:"content",text_md:y.text_md,author:{id:t.userId,type:"user"},created_at:y.created_at||new Date().toISOString()};return Array.isArray(y.attachments)&&y.attachments.length&&(S.payload={type:"content",attachments:y.attachments}),y.metadata&&typeof y.metadata=="object"&&(S.metadata=y.metadata),o("POST",`/conversations/${encodeURIComponent(h)}/messages`,S)}async function Z(h,y,S){return te(),o("POST",`/messages/${encodeURIComponent(h)}/callbacks/${encodeURIComponent(y)}`,S?{inputs:S}:{})}async function H(h){const y=h.name||"attachment",S=h.type||"application/octet-stream",P=h.size||0,N=await o("POST","/attachments",{mime_type:S,size_bytes:P,name:y}),V=await fetch(N.upload_url,{method:"PUT",headers:{"Content-Type":S},body:h});if(!V.ok)throw new Error(`HTTP ${V.status} PUT signed upload`);return{type:ac(S),path:N.path,mime_type:S,size_bytes:P}}async function se(h){return o("GET",`/attachments/sign?path=${encodeURIComponent(h)}`)}function ge(){const h=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${ms}/stream?${h}`}function he(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const h=new EventSource(ge(),{withCredentials:!0});for(const y of tc)h.addEventListener(y,S=>ke(y,S.data));h.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=h,i("open")}catch(h){console.error("[transport] SSE open failed",h),r("error",h)}}function ke(h,y){try{const S=JSON.parse(y),P=S&&typeof S=="object"&&"data"in S?S.data:S;r(h,P)}catch(S){console.error("[transport] bad SSE payload",h,S)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function te(){clearTimeout(t.burstTimer),he(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},sc))}function ue(h){t.panelOpen=!!h,t.panelOpen?(clearTimeout(t.burstTimer),he()):te()}async function j(){try{const h=await A(),y=h.reduce((P,N)=>{const V=N==null?void 0:N.last_message_at;return V&&(!P||V>P)?V:P},null);y&&(!t.lastActivityAt||y>t.lastActivityAt)&&(t.lastActivityAt=y,r("activity",{conversations:h,latestAt:y}),te())}catch(h){console.error("[transport] poll failed",h)}}function le(){v(),!(typeof document<"u"&&document.hidden)&&(t.pollTimer=setInterval(j,nc))}function v(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function b(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(v(),G(),i("paused"))},rc);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),le(),t.panelOpen&&he()}}function w(){v(),clearTimeout(t.burstTimer),clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null,G(),t.visibilityHandler&&(document.removeEventListener("visibilitychange",t.visibilityHandler),t.visibilityHandler=null),t.started=!1}return{on:n,start:l,stop:w,setPanelOpen:ue,getCustomer:c,patchCustomer:g,listConversations:A,createConversation:k,getConversation:$,patchConversation:T,markConversationRead:J,listMessages:U,postMessage:q,postCallback:Z,uploadAttachment:H,signAttachment:se,get connection(){return t.connection}}}function oc(e){return e.endsWith("/")?e.slice(0,-1):e}function ac(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function lc(){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 cc(e){const t=zn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",v=>{t.connection=v})),n.push(e.on("message",v=>{const b=v==null?void 0:v.conversation_id,w=v==null?void 0:v.message;!b||!(w!=null&&w.id)||(he(b,w),w.client_msg_id&&delete t.streamingByMsgId[w.client_msg_id],te(b,w.created_at))})),n.push(e.on("message_stream",v=>{const b=v==null?void 0:v.message_id,w=v==null?void 0:v.token;!b||typeof w!="string"||(t.streamingByMsgId[b]=(t.streamingByMsgId[b]||"")+w)})),n.push(e.on("conversation_updated",v=>{const b=v==null?void 0:v.conversation_id,w=v==null?void 0:v.changes;if(!b||!w)return;const h=t.conversations.findIndex(y=>y.id===b);h!==-1&&(t.conversations[h]={...t.conversations[h],...w})})),n.push(e.on("config_updated",v=>{v!=null&&v.config&&(t.config=v.config)})),n.push(e.on("action_status",v=>{const b=v==null?void 0:v.conversation_id,w=v==null?void 0:v.action_id,h=v==null?void 0:v.action_name;if(!b||!w)return;const y=t.runningActionsByConv[b]||{};v.state==="running"?(y[w]=h||w,t.runningActionsByConv[b]={...y}):v.state==="done"&&(delete y[w],t.runningActionsByConv[b]={...y})})),n.push(e.on("activity",v=>{Array.isArray(v==null?void 0:v.conversations)&&(t.conversations=v.conversations)}));async function r(v){try{const b=new Promise((h,y)=>setTimeout(()=>y(new Error("bootstrap timeout (15s) โ€” check baseUrl, CORS, and network")),15e3)),w=await Promise.race([e.start(v),b]);t.config=w.config,t.customer=w.customer,t.conversations=await Promise.race([e.listConversations(),b]),t.ready=!0}catch(b){console.error("[store] start failed",b),t.error=(b==null?void 0:b.message)||String(b)}}function i(){for(const v of n)try{v()}catch{}e.stop()}async function s(v){const b=j(v);if(!b)return t.customer;try{const w=await e.patchCustomer(b);w&&(t.customer=w)}catch(w){console.error("[store] applyCustomer failed",w)}return t.customer}async function o(v={}){const b=await e.createConversation(v),w=t.conversations.findIndex(h=>h.id===b.id);return w===-1?t.conversations=[b,...t.conversations]:t.conversations[w]=b,b}const a=50;async function l(v){const b=t.paginationByConv[v];if(!(b!=null&&b.loaded||b!=null&&b.loading)){c(v,{nextCursor:null,loading:!0,loaded:!1});try{const w=await e.listMessages(v,{limit:a}),h=(w==null?void 0:w.messages)??[],y=t.messagesByConv[v]||[],S=new Set;for(const N of h)(N==null?void 0:N.id)!=null&&S.add(`id:${String(N.id)}`),N!=null&&N.client_msg_id&&S.add(`c:${N.client_msg_id}`);const P=y.filter(N=>!((N==null?void 0:N.id)!=null&&S.has(`id:${String(N.id)}`)||N!=null&&N.client_msg_id&&S.has(`c:${N.client_msg_id}`)));t.messagesByConv[v]=[...h,...P].sort(ue),c(v,{nextCursor:(w==null?void 0:w.next_cursor)??null,loading:!1,loaded:!0})}catch(w){console.error("[store] openConversation failed",w),c(v,{nextCursor:null,loading:!1,loaded:!1})}}}async function f(v){var y;const b=t.paginationByConv[v];if(!b||b.loading||!b.nextCursor)return;const h=(y=(t.messagesByConv[v]||[]).find(S=>S==null?void 0:S.created_at))==null?void 0:y.created_at;if(h){c(v,{...b,loading:!0});try{const S=await e.listMessages(v,{before:h,limit:a}),P=(S==null?void 0:S.messages)??[],N=t.messagesByConv[v]||[],V=new Set;for(const ne of N)(ne==null?void 0:ne.id)!=null&&V.add(`id:${String(ne.id)}`),ne!=null&&ne.client_msg_id&&V.add(`c:${ne.client_msg_id}`);const ie=P.filter(ne=>!((ne==null?void 0:ne.id)!=null&&V.has(`id:${String(ne.id)}`)||ne!=null&&ne.client_msg_id&&V.has(`c:${ne.client_msg_id}`)));t.messagesByConv[v]=[...ie,...N],c(v,{nextCursor:(S==null?void 0:S.next_cursor)??null,loading:!1,loaded:!0})}catch(S){console.error("[store] loadMore failed",S),c(v,{...b,loading:!1})}}}function c(v,b){t.paginationByConv={...t.paginationByConv,[v]:b}}async function g(v,b){const w=await e.patchConversation(v,b),h=t.conversations.findIndex(y=>y.id===v);h!==-1&&(t.conversations[h]=w)}async function A(v){if(!v)return[];const b=t.messagesByConv[v]||[];let w="";for(const h of b)h!=null&&h.created_at&&h.created_at>w&&(w=h.created_at);try{const h=await e.listMessages(v,w?{since:w}:{}),y=(h==null?void 0:h.messages)||[];if(!y.length)return[];const S=new Set,P=new Set;for(const V of b)(V==null?void 0:V.id)!=null&&S.add(String(V.id)),V!=null&&V.client_msg_id&&P.add(V.client_msg_id);const N=[];for(const V of y){const ie=(V==null?void 0:V.id)!=null&&S.has(String(V.id))||(V==null?void 0:V.client_msg_id)&&P.has(V.client_msg_id);he(v,V),ie||N.push(V)}return N}catch(h){return console.error("[store] fetchSinceLast failed",h),[]}}async function k(v,b){if(!(!v||b==null))try{const w=await e.markConversationRead(v,b),h=(w==null?void 0:w.last_read_message_id)??b,y=t.conversations.findIndex(S=>(S==null?void 0:S.id)===v);y!==-1&&(t.conversations[y]={...t.conversations[y],last_read_message_id:h})}catch(w){console.error("[store] markConversationRead failed",w)}}async function $(v,b,{attachments:w,metadata:h}={}){var ie;const y=(b||"").trim(),S=Array.isArray(w)&&w.length>0;if(!v||!y&&!S)return;const P=lc(),N=le(v),V={id:P,client_msg_id:P,conversation_id:v,type:"content",text_md:y,author:{type:"user",id:((ie=t.customer)==null?void 0:ie.external_id)||null},created_at:N,_pending:!0,...S?{payload:{type:"content",attachments:w}}:{},...h&&typeof h=="object"?{metadata:h}:{}};he(v,V);try{await e.postMessage(v,{client_msg_id:P,text_md:y,created_at:N,...S?{attachments:w}:{},...h&&typeof h=="object"?{metadata:h}:{}})}catch(ne){console.error("[store] send failed",ne),G(v,P,{_failed:!0,_pending:!1})}}async function T(v,b,w){v!=null&&(t.awaitingCallback[v]=!0);try{await e.postCallback(v,b,w)}catch(h){console.error("[store] callback failed",h),v!=null&&delete t.awaitingCallback[v]}}const J=new Map;async function U(v){if(!v)return null;const b=J.get(v);if(b!=null&&b.url){const w=b.expires_at?Date.parse(b.expires_at):0;if(!w||w-Date.now()>6e4)return b.url}try{const w=await e.signAttachment(v);if(w!=null&&w.signed_url)return J.set(v,{url:w.signed_url,expires_at:w.expires_at}),w.signed_url}catch(w){console.error("[store] sign attachment failed",w)}return null}async function q(v,{rating:b,comment:w}={}){const h=t.conversations.find(P=>P.id===v),S={...(h==null?void 0:h.metadata)||{},feedback:{rating:b,comment:w||null,submitted_at:new Date().toISOString()}};await g(v,{metadata:S})}function Z(v){var w,h;const b=t.messagesByConv[v]||[];for(let y=b.length-1;y>=0;y--){const S=b[y];if((S==null?void 0:S.type)==="action"&&((w=S==null?void 0:S.payload)==null?void 0:w.type)==="action"&&((h=S==null?void 0:S.payload)==null?void 0:h.state)==="pending"&&Array.isArray(S==null?void 0:S.callbacks)&&S.callbacks.length>0&&!t.awaitingCallback[S.id])return S}return null}function H(v){var w,h,y;const b=t.messagesByConv[v]||[];for(let S=b.length-1;S>=0;S--){const P=b[S];if(((w=P==null?void 0:P.author)==null?void 0:w.type)==="user"||(P==null?void 0:P.type)==="action"&&((h=P==null?void 0:P.payload)==null?void 0:h.state)==="pending")return null;const N=(y=P==null?void 0:P.metadata)==null?void 0:y.form;if(N&&Array.isArray(N.fields)&&N.fields.length>0)return{message:P,form:N}}return null}function se(v){const b=t.runningActionsByConv[v];if(!b)return null;const w=Object.keys(b);if(w.length===0)return null;const h=w[0];return{id:h,payload:{name:b[h]}}}function ge(v){var w,h,y,S;const b=t.messagesByConv[v]||[];for(let P=b.length-1;P>=0;P--){const N=b[P];if(((w=N==null?void 0:N.author)==null?void 0:w.type)==="user")return[];if((N==null?void 0:N.type)==="action"&&((h=N==null?void 0:N.payload)==null?void 0:h.state)==="pending")return[];if(((y=N==null?void 0:N.author)==null?void 0:y.type)!=="agent_ia")continue;const V=(S=N==null?void 0:N.metadata)==null?void 0:S.suggested_replies;return Array.isArray(V)&&V.length?V.map(ie=>{if(typeof ie=="string"){const ne=ie.trim();return ne?{label:ne,kind:null}:null}if(ie&&typeof ie=="object"&&typeof ie.label=="string"){const ne=ie.label.trim();if(!ne)return null;const Zn=ie.kind==="cta"||ie.kind==="choice"||ie.kind==="followup"?ie.kind:null;return{label:ne,kind:Zn}}return null}).filter(Boolean).slice(0,4):[]}return[]}function he(v,b){var S;const w=t.messagesByConv[v]||[];let h=-1;b!=null&&b.client_msg_id&&(h=w.findIndex(P=>(P==null?void 0:P.client_msg_id)&&P.client_msg_id===b.client_msg_id)),h===-1&&(b==null?void 0:b.id)!==void 0&&(b==null?void 0:b.id)!==null&&(h=w.findIndex(P=>ke(P==null?void 0:P.id,b.id)));let y;h===-1?y=[...w,b].sort(ue):(y=w.slice(),y[h]={...w[h],...b,_pending:!1,_failed:!1}),t.messagesByConv[v]=y,(b==null?void 0:b.type)==="action"&&((S=b==null?void 0:b.payload)!=null&&S.state)&&b.payload.state!=="pending"&&(b==null?void 0:b.id)!=null&&t.awaitingCallback[b.id]&&delete t.awaitingCallback[b.id]}function ke(v,b){return v===b?!0:v==null||b==null?!1:String(v)===String(b)}function G(v,b,w){const h=t.messagesByConv[v];if(!h)return;const y=h.findIndex(P=>P.id===b);if(y===-1)return;const S=h.slice();S[y]={...h[y],...w},t.messagesByConv[v]=S}function te(v,b){const w=t.conversations.findIndex(y=>y.id===v);if(w===-1)return;const h=t.conversations[w];if(b&&(!h.last_message_at||b>h.last_message_at)){const y=t.conversations.slice();y[w]={...h,last_message_at:b},y.sort((S,P)=>(P.last_message_at||"").localeCompare(S.last_message_at||"")),t.conversations=y}}function ue(v,b){return(v.created_at||"").localeCompare(b.created_at||"")}function j(v){if(!v||typeof v!="object")return null;const b={},w={};for(const[h,y]of Object.entries(v))y!==void 0&&(h==="name"||h==="email"||h==="language"?y!=null&&String(y).trim()!==""&&(b[h]=y):(h==="values"||h==="metadata")&&y&&typeof y=="object"?Object.assign(w,y):w[h]=y);return Object.keys(w).length&&(b.values=w),Object.keys(b).length?b:null}function le(v){const b=t.messagesByConv[v]||[];let w="";for(const S of b)S!=null&&S.created_at&&S.created_at>w&&(w=S.created_at);const h=new Date().toISOString();return!w||h>w?h:new Date(Date.parse(w)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:f,fetchSinceLast:A,patchConversation:g,markConversationRead:k,send:$,clickCallback:T,signAttachment:U,submitFeedback:q,getPendingApproval:Z,getActionInFlight:se,getLatestSuggestions:ge,getLatestForm:H,setPanelOpen:e.setPanelOpen}}const Re={w:"#ffffff",g50:"#F9F9F7",g100:"#F2F1EE",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},ps=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function Gs(e=""){return e?ps[e.charCodeAt(0)%ps.length]:ps[0]}function Ys(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function Ls(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const wo=`
17
+ **/let Is;const kr=typeof window<"u"&&window.trustedTypes;if(kr)try{Is=kr.createPolicy("vue",{createHTML:e=>e})}catch{}const _o=Is?e=>Is.createHTML(e):e=>e,vl="http://www.w3.org/2000/svg",yl="http://www.w3.org/1998/Math/MathML",rt=typeof document<"u"?document:null,Cr=rt&&rt.createElement("template"),bl={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"?rt.createElementNS(vl,e):t==="mathml"?rt.createElementNS(yl,e):n?rt.createElement(e,{is:n}):rt.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>rt.createTextNode(e),createComment:e=>rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>rt.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{Cr.innerHTML=_o(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Cr.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]}},_t="transition",Jt="animation",mn=Symbol("_vtc"),vo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},wl=xe({},Ri,vo),kl=e=>(e.displayName="Transition",e.props=wl,e),yo=kl((e,{slots:t})=>go(ba,Cl(e),t)),At=(e,t=[])=>{z(e)?e.forEach(n=>n(...t)):e&&e(...t)},Sr=e=>e?z(e)?e.some(t=>t.length>1):e.length>1:!1;function Cl(e){const t={};for(const j in e)j in vo||(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:f=o,appearToClass:u=a,leaveFromClass:_=`${n}-leave-from`,leaveActiveClass:A=`${n}-leave-active`,leaveToClass:k=`${n}-leave-to`}=e,$=Sl(i),T=$&&$[0],J=$&&$[1],{onBeforeEnter:U,onEnter:q,onEnterCancelled:Z,onLeave:H,onLeaveCancelled:se,onBeforeAppear:ge=U,onAppear:he=q,onAppearCancelled:ke=Z}=t,G=(j,le,v,b)=>{j._enterCancelled=b,xt(j,le?u:a),xt(j,le?f:o),v&&v()},te=(j,le)=>{j._isLeaving=!1,xt(j,_),xt(j,k),xt(j,A),le&&le()},ue=j=>(le,v)=>{const b=j?he:q,w=()=>G(le,j,v);At(b,[le,w]),Ar(()=>{xt(le,j?l:s),st(le,j?u:a),Sr(b)||xr(le,r,T,w)})};return xe(t,{onBeforeEnter(j){At(U,[j]),st(j,s),st(j,o)},onBeforeAppear(j){At(ge,[j]),st(j,l),st(j,f)},onEnter:ue(!1),onAppear:ue(!0),onLeave(j,le){j._isLeaving=!0;const v=()=>te(j,le);st(j,_),j._enterCancelled?(st(j,A),Er(j)):(Er(j),st(j,A)),Ar(()=>{j._isLeaving&&(xt(j,_),st(j,k),Sr(H)||xr(j,r,J,v))}),At(H,[j,v])},onEnterCancelled(j){G(j,!1,void 0,!0),At(Z,[j])},onAppearCancelled(j){G(j,!0,void 0,!0),At(ke,[j])},onLeaveCancelled(j){te(j),At(se,[j])}})}function Sl(e){if(e==null)return null;if(ae(e))return[ds(e.enter),ds(e.leave)];{const t=ds(e);return[t,t]}}function ds(e){return Eo(e)}function st(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[mn]||(e[mn]=new Set)).add(t)}function xt(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[mn];n&&(n.delete(t),n.size||(e[mn]=void 0))}function Ar(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Al=0;function xr(e,t,n,r){const i=e._endId=++Al,s=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:o,timeout:a,propCount:l}=xl(e,t);if(!o)return r();const f=o+"end";let u=0;const _=()=>{e.removeEventListener(f,A),s()},A=k=>{k.target===e&&++u>=l&&_()};setTimeout(()=>{u<l&&_()},a+1),e.addEventListener(f,A)}function xl(e,t){const n=window.getComputedStyle(e),r=$=>(n[$]||"").split(", "),i=r(`${_t}Delay`),s=r(`${_t}Duration`),o=Tr(i,s),a=r(`${Jt}Delay`),l=r(`${Jt}Duration`),f=Tr(a,l);let u=null,_=0,A=0;t===_t?o>0&&(u=_t,_=o,A=s.length):t===Jt?f>0&&(u=Jt,_=f,A=l.length):(_=Math.max(o,f),u=_>0?o>f?_t:Jt:null,A=u?u===_t?s.length:l.length:0);const k=u===_t&&/\b(?:transform|all)(?:,|$)/.test(r(`${_t}Property`).toString());return{type:u,timeout:_,propCount:A,hasTransform:k}}function Tr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Mr(n)+Mr(e[r])))}function Mr(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Er(e){return(e?e.ownerDocument:document).body.offsetHeight}function Tl(e,t,n){const r=e[mn];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Or=Symbol("_vod"),Ml=Symbol("_vsh"),El=Symbol(""),Ol=/(?:^|;)\s*display\s*:/;function Il(e,t,n){const r=e.style,i=be(n);let s=!1;if(n&&!i){if(t)if(be(t))for(const o of t.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Qt(r,a,"")}else for(const o in t)n[o]==null&&Qt(r,o,"");for(const o in n){o==="display"&&(s=!0);const a=n[o];a!=null?Rl(e,o,!be(t)&&t?t[o]:void 0,a)||Qt(r,o,a):Qt(r,o,"")}}else if(i){if(t!==n){const o=r[El];o&&(n+=";"+o),r.cssText=n,s=Ol.test(n)}}else t&&e.removeAttribute("style");Or in e&&(e[Or]=s?r.display:"",e[Ml]&&(r.display="none"))}const Ir=/\s*!important$/;function Qt(e,t,n){if(z(n))n.forEach(r=>Qt(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Ll(e,t);Ir.test(n)?e.setProperty(kt(r),n.replace(Ir,""),"important"):e[r]=n}}const Lr=["Webkit","Moz","ms"],fs={};function Ll(e,t){const n=fs[t];if(n)return n;let r=Fe(t);if(r!=="filter"&&r in e)return fs[t]=r;r=Hn(r);for(let i=0;i<Lr.length;i++){const s=Lr[i]+r;if(s in e)return fs[t]=s}return t}function Rl(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&be(r)&&n===r}const Rr="http://www.w3.org/1999/xlink";function Br(e,t,n,r,i,s=Po(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Rr,t.slice(6,t.length)):e.setAttributeNS(Rr,t,n):n==null||s&&!ii(n)?e.removeAttribute(t):e.setAttribute(t,s?"":ze(n)?String(n):n)}function Pr(e,t,n,r,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?_o(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=ii(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 yt(e,t,n,r){e.addEventListener(t,n,r)}function Bl(e,t,n,r){e.removeEventListener(t,n,r)}const Nr=Symbol("_vei");function Pl(e,t,n,r,i=null){const s=e[Nr]||(e[Nr]={}),o=s[t];if(r&&o)o.value=r;else{const[a,l]=Nl(t);if(r){const f=s[t]=jl(r,i);yt(e,a,f,l)}else o&&(Bl(e,a,o,l),s[t]=void 0)}}const Fr=/(?:Once|Passive|Capture)$/;function Nl(e){let t;if(Fr.test(e)){t={};let r;for(;r=e.match(Fr);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):kt(e.slice(2)),t]}let hs=0;const Fl=Promise.resolve(),Dl=()=>hs||(Fl.then(()=>hs=0),hs=Date.now());function jl(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;qe(Ul(r,n.value),t,5,[r])};return n.value=e,n.attached=Dl(),n}function Ul(e,t){if(z(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>i=>!i._stopped&&r&&r(i))}else return t}const Dr=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Hl=(e,t,n,r,i,s)=>{const o=i==="svg";t==="class"?Tl(e,r,o):t==="style"?Il(e,n,r):Dn(t)?jn(t)||Pl(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Vl(e,t,r,o))?(Pr(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Br(e,t,r,o,s,t!=="value")):e._isVueCE&&($l(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!be(r)))?Pr(e,Fe(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Br(e,t,r,o))};function Vl(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Dr(t)&&X(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Dr(t)&&be(n)?!1:t in e}function $l(e,t){const n=e._def.props;if(!n)return!1;const r=Fe(t);return Array.isArray(n)?n.some(i=>Fe(i)===r):Object.keys(n).some(i=>Fe(i)===r)}const Ht=e=>{const t=e.props["onUpdate:modelValue"]||!1;return z(t)?n=>xn(t,n):t};function Kl(e){e.target.composing=!0}function jr(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ft=Symbol("_assign");function Ur(e,t,n){return t&&(e=e.trim()),n&&(e=Vn(e)),e}const Ot={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[ft]=Ht(i);const s=r||i.props&&i.props.type==="number";yt(e,t?"change":"input",o=>{o.target.composing||e[ft](Ur(e.value,n,s))}),(n||s)&&yt(e,"change",()=>{e.value=Ur(e.value,n,s)}),t||(yt(e,"compositionstart",Kl),yt(e,"compositionend",jr),yt(e,"change",jr))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:s}},o){if(e[ft]=Ht(o),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?Vn(e.value):e.value,l=t??"";if(a===l)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},zl={deep:!0,created(e,t,n){e[ft]=Ht(n),yt(e,"change",()=>{const r=e._modelValue,i=pn(e),s=e.checked,o=e[ft];if(z(r)){const a=Ns(r,i),l=a!==-1;if(s&&!l)o(r.concat(i));else if(!s&&l){const f=[...r];f.splice(a,1),o(f)}}else if($t(r)){const a=new Set(r);s?a.add(i):a.delete(i),o(a)}else o(bo(e,s))})},mounted:Hr,beforeUpdate(e,t,n){e[ft]=Ht(n),Hr(e,t,n)}};function Hr(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(z(t))i=Ns(t,r.props.value)>-1;else if($t(t))i=t.has(r.props.value);else{if(t===n)return;i=Kt(t,bo(e,!0))}e.checked!==i&&(e.checked=i)}const ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=$t(t);yt(e,"change",()=>{const s=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Vn(pn(o)):pn(o));e[ft](e.multiple?i?new Set(s):s:s[0]),e._assigning=!0,Ai(()=>{e._assigning=!1})}),e[ft]=Ht(r)},mounted(e,{value:t}){Vr(e,t)},beforeUpdate(e,t,n){e[ft]=Ht(n)},updated(e,{value:t}){e._assigning||Vr(e,t)}};function Vr(e,t){const n=e.multiple,r=z(t);if(!(n&&!r&&!$t(t))){for(let i=0,s=e.options.length;i<s;i++){const o=e.options[i],a=pn(o);if(n)if(r){const l=typeof a;l==="string"||l==="number"?o.selected=t.some(f=>String(f)===String(a)):o.selected=Ns(t,a)>-1}else o.selected=t.has(a);else if(Kt(pn(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function pn(e){return"_value"in e?e._value:e.value}function bo(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Wl=["ctrl","shift","alt","meta"],Gl={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)=>Wl.some(n=>e[`${n}Key`]&&!t.includes(n))},dt=(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=Gl[t[o]];if(a&&a(i,t))return}return e(i,...s)})},Yl={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Nn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const s=kt(i.key);if(t.some(o=>o===s||Yl[o]===s))return e(i)})},Jl=xe({patchProp:Hl},bl);let $r;function Xl(){return $r||($r=Za(Jl))}const Ql=(...e)=>{const t=Xl().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=ec(r);if(!i)return;const s=t._component;!X(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,Zl(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t};function Zl(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ec(e){return be(e)?document.querySelector(e):e}const tc=["connected","message","message_stream","conversation_updated","config_updated","action_status"],ms="/client",nc=5*60*1e3,sc=10*60*1e3,rc=5*60*1e3;function ic(e){const t={baseUrl:oc(e.baseUrl||""),widgetId:e.widgetId||"",userId:"",origin:"",token:"",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(m,y){return t.listeners.has(m)||t.listeners.set(m,new Set),t.listeners.get(m).add(y),()=>t.listeners.get(m).delete(y)}function r(m,y){const S=t.listeners.get(m);S&&S.forEach(P=>{try{P(y)}catch(N){console.error("[transport] listener",m,N)}})}function i(m){t.connection!==m&&(t.connection=m,r("connection",m))}function s(){return{"Content-Type":"application/json","X-Widget-Id":t.widgetId,...t.origin?{"X-Parent-Origin":t.origin}:{}}}async function o(m,y,S){const P=await fetch(`${t.baseUrl}${ms}${y}`,{method:m,credentials:"include",headers:s(),body:S!==void 0?JSON.stringify(S):void 0});if(!P.ok){const N=await a(P),V=new Error(`HTTP ${P.status} ${m} ${y} :: ${(N==null?void 0:N.error)||P.statusText}`);throw V.status=P.status,V.body=N,V}return P.status===204?null:P.json()}async function a(m){try{return await m.json()}catch{return null}}async function l(m){if(t.started)return t.lastBootstrap;if(!(m!=null&&m.origin))throw new Error("[transport] start requires origin");t.started=!0,t.origin=m.origin,t.token=m.token||"";const y=await fetch(`${t.baseUrl}${ms}/session`,{method:"POST",credentials:"include",headers:s(),body:JSON.stringify({origin:t.origin,...t.token?{token:t.token}:{},allowUnauthenticated:m.allowUnauthenticated===!0,...m.customer&&typeof m.customer=="object"?{customer:m.customer}:{}})});if(!y.ok){const ie=await a(y),ne=new Error(`Session bootstrap failed: HTTP ${y.status} :: ${(ie==null?void 0:ie.error)||y.statusText}`);throw ne.status=y.status,ne.body=ie,ne}const S=await y.json();t.userId=S.external_id;const[P,N]=await Promise.all([fetch(`${t.baseUrl}/widgets/${encodeURIComponent(t.widgetId)}/config`,{credentials:"include"}).then(async ie=>{if(!ie.ok){const ne=await a(ie);throw new Error(`HTTP ${ie.status} GET /widgets/:id/config :: ${(ne==null?void 0:ne.error)||ie.statusText}`)}return ie.json()}),o("GET","/customers/me")]),V={config:P,customer:(N==null?void 0:N.customer)??null};return t.lastBootstrap=V,await f(),typeof document<"u"&&(t.visibilityHandler=b,document.addEventListener("visibilitychange",t.visibilityHandler)),le(),V}async function f(){try{const m=await A();t.lastActivityAt=m.reduce((y,S)=>{const P=S==null?void 0:S.last_message_at;return P&&(!y||P>y)?P:y},null)}catch(m){console.error("[transport] initial /conversations failed",m)}}async function u(){const m=await o("GET","/customers/me");return(m==null?void 0:m.customer)??null}async function _(m){const y=await o("PATCH","/customers/me",m);return(y==null?void 0:y.customer)??null}async function A(){const m=await o("GET","/conversations");return(m==null?void 0:m.conversations)??[]}async function k(m={}){return(await o("POST","/conversations",m)).conversation}async function $(m){return(await o("GET",`/conversations/${encodeURIComponent(m)}`)).conversation}async function T(m,y){return(await o("PATCH",`/conversations/${encodeURIComponent(m)}`,y)).conversation}async function J(m,y){return o("PATCH",`/conversations/${encodeURIComponent(m)}/read`,{message_id:y})}async function U(m,y={}){const S=new URLSearchParams;y.before&&S.set("before",y.before),y.since&&S.set("since",y.since),y.limit&&S.set("limit",String(y.limit));const P=S.toString()?`?${S.toString()}`:"";return o("GET",`/conversations/${encodeURIComponent(m)}/messages${P}`)}async function q(m,y){te();const S={client_msg_id:y.client_msg_id,type:"content",text_md:y.text_md,author:{id:t.userId,type:"user"},created_at:y.created_at||new Date().toISOString()};return Array.isArray(y.attachments)&&y.attachments.length&&(S.payload={type:"content",attachments:y.attachments}),y.metadata&&typeof y.metadata=="object"&&(S.metadata=y.metadata),o("POST",`/conversations/${encodeURIComponent(m)}/messages`,S)}async function Z(m,y,S){return te(),o("POST",`/messages/${encodeURIComponent(m)}/callbacks/${encodeURIComponent(y)}`,S?{inputs:S}:{})}async function H(m){const y=m.name||"attachment",S=m.type||"application/octet-stream",P=m.size||0,N=await o("POST","/attachments",{mime_type:S,size_bytes:P,name:y}),V=await fetch(N.upload_url,{method:"PUT",headers:{"Content-Type":S},body:m});if(!V.ok)throw new Error(`HTTP ${V.status} PUT signed upload`);return{type:ac(S),path:N.path,mime_type:S,size_bytes:P}}async function se(m){return o("GET",`/attachments/sign?path=${encodeURIComponent(m)}`)}function ge(){const m=new URLSearchParams({widgetId:t.widgetId}).toString();return`${t.baseUrl}${ms}/stream?${m}`}function he(){if(!t.eventSource&&!(typeof document<"u"&&document.hidden)&&t.started)try{const m=new EventSource(ge(),{withCredentials:!0});for(const y of tc)m.addEventListener(y,S=>ke(y,S.data));m.addEventListener("error",()=>r("error",new Error("SSE error"))),t.eventSource=m,i("open")}catch(m){console.error("[transport] SSE open failed",m),r("error",m)}}function ke(m,y){try{const S=JSON.parse(y),P=S&&typeof S=="object"&&"data"in S?S.data:S;r(m,P)}catch(S){console.error("[transport] bad SSE payload",m,S)}}function G(){t.eventSource&&(t.eventSource.close(),t.eventSource=null),t.connection!=="paused"&&i("idle")}function te(){clearTimeout(t.burstTimer),he(),t.panelOpen||(t.burstTimer=setTimeout(()=>{t.panelOpen||G()},sc))}function ue(m){t.panelOpen=!!m,t.panelOpen?(clearTimeout(t.burstTimer),he()):te()}async function j(){try{const m=await A(),y=m.reduce((P,N)=>{const V=N==null?void 0:N.last_message_at;return V&&(!P||V>P)?V:P},null);y&&(!t.lastActivityAt||y>t.lastActivityAt)&&(t.lastActivityAt=y,r("activity",{conversations:m,latestAt:y}),te())}catch(m){console.error("[transport] poll failed",m)}}function le(){v(),!(typeof document<"u"&&document.hidden)&&(t.pollTimer=setInterval(j,nc))}function v(){t.pollTimer&&(clearInterval(t.pollTimer),t.pollTimer=null)}function b(){if(document.hidden)clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=setTimeout(()=>{t.hiddenGraceTimer=null,document.hidden&&(v(),G(),i("paused"))},rc);else{if(t.hiddenGraceTimer){clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null;return}i("idle"),le(),t.panelOpen&&he()}}function w(){v(),clearTimeout(t.burstTimer),clearTimeout(t.hiddenGraceTimer),t.hiddenGraceTimer=null,G(),t.visibilityHandler&&(document.removeEventListener("visibilitychange",t.visibilityHandler),t.visibilityHandler=null),t.started=!1}return{on:n,start:l,stop:w,setPanelOpen:ue,getCustomer:u,patchCustomer:_,listConversations:A,createConversation:k,getConversation:$,patchConversation:T,markConversationRead:J,listMessages:U,postMessage:q,postCallback:Z,uploadAttachment:H,signAttachment:se,get connection(){return t.connection}}}function oc(e){return e.endsWith("/")?e.slice(0,-1):e}function ac(e){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":"file"}function lc(){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 cc(e){const t=zn({ready:!1,error:null,config:null,customer:null,conversations:[],messagesByConv:{},paginationByConv:{},streamingByMsgId:{},awaitingCallback:{},runningActionsByConv:{},connection:"idle"}),n=[];n.push(e.on("connection",v=>{t.connection=v})),n.push(e.on("message",v=>{const b=v==null?void 0:v.conversation_id,w=v==null?void 0:v.message;!b||!(w!=null&&w.id)||(he(b,w),w.client_msg_id&&delete t.streamingByMsgId[w.client_msg_id],te(b,w.created_at))})),n.push(e.on("message_stream",v=>{const b=v==null?void 0:v.message_id,w=v==null?void 0:v.token;!b||typeof w!="string"||(t.streamingByMsgId[b]=(t.streamingByMsgId[b]||"")+w)})),n.push(e.on("conversation_updated",v=>{const b=v==null?void 0:v.conversation_id,w=v==null?void 0:v.changes;if(!b||!w)return;const m=t.conversations.findIndex(y=>y.id===b);m!==-1&&(t.conversations[m]={...t.conversations[m],...w})})),n.push(e.on("config_updated",v=>{v!=null&&v.config&&(t.config=v.config)})),n.push(e.on("action_status",v=>{const b=v==null?void 0:v.conversation_id,w=v==null?void 0:v.action_id,m=v==null?void 0:v.action_name;if(!b||!w)return;const y=t.runningActionsByConv[b]||{};v.state==="running"?(y[w]=m||w,t.runningActionsByConv[b]={...y}):v.state==="done"&&(delete y[w],t.runningActionsByConv[b]={...y})})),n.push(e.on("activity",v=>{Array.isArray(v==null?void 0:v.conversations)&&(t.conversations=v.conversations)}));async function r(v){try{const b=new Promise((m,y)=>setTimeout(()=>y(new Error("bootstrap timeout (15s) โ€” check baseUrl, CORS, and network")),15e3)),w=await Promise.race([e.start(v),b]);t.config=w.config,t.customer=w.customer,t.conversations=await Promise.race([e.listConversations(),b]),t.ready=!0}catch(b){console.error("[store] start failed",b),t.error=(b==null?void 0:b.message)||String(b)}}function i(){for(const v of n)try{v()}catch{}e.stop()}async function s(v){const b=j(v);if(!b)return t.customer;try{const w=await e.patchCustomer(b);w&&(t.customer=w)}catch(w){console.error("[store] applyCustomer failed",w)}return t.customer}async function o(v={}){const b=await e.createConversation(v),w=t.conversations.findIndex(m=>m.id===b.id);return w===-1?t.conversations=[b,...t.conversations]:t.conversations[w]=b,b}const a=50;async function l(v){const b=t.paginationByConv[v];if(!(b!=null&&b.loaded||b!=null&&b.loading)){u(v,{nextCursor:null,loading:!0,loaded:!1});try{const w=await e.listMessages(v,{limit:a}),m=(w==null?void 0:w.messages)??[],y=t.messagesByConv[v]||[],S=new Set;for(const N of m)(N==null?void 0:N.id)!=null&&S.add(`id:${String(N.id)}`),N!=null&&N.client_msg_id&&S.add(`c:${N.client_msg_id}`);const P=y.filter(N=>!((N==null?void 0:N.id)!=null&&S.has(`id:${String(N.id)}`)||N!=null&&N.client_msg_id&&S.has(`c:${N.client_msg_id}`)));t.messagesByConv[v]=[...m,...P].sort(ue),u(v,{nextCursor:(w==null?void 0:w.next_cursor)??null,loading:!1,loaded:!0})}catch(w){console.error("[store] openConversation failed",w),u(v,{nextCursor:null,loading:!1,loaded:!1})}}}async function f(v){var y;const b=t.paginationByConv[v];if(!b||b.loading||!b.nextCursor)return;const m=(y=(t.messagesByConv[v]||[]).find(S=>S==null?void 0:S.created_at))==null?void 0:y.created_at;if(m){u(v,{...b,loading:!0});try{const S=await e.listMessages(v,{before:m,limit:a}),P=(S==null?void 0:S.messages)??[],N=t.messagesByConv[v]||[],V=new Set;for(const ne of N)(ne==null?void 0:ne.id)!=null&&V.add(`id:${String(ne.id)}`),ne!=null&&ne.client_msg_id&&V.add(`c:${ne.client_msg_id}`);const ie=P.filter(ne=>!((ne==null?void 0:ne.id)!=null&&V.has(`id:${String(ne.id)}`)||ne!=null&&ne.client_msg_id&&V.has(`c:${ne.client_msg_id}`)));t.messagesByConv[v]=[...ie,...N],u(v,{nextCursor:(S==null?void 0:S.next_cursor)??null,loading:!1,loaded:!0})}catch(S){console.error("[store] loadMore failed",S),u(v,{...b,loading:!1})}}}function u(v,b){t.paginationByConv={...t.paginationByConv,[v]:b}}async function _(v,b){const w=await e.patchConversation(v,b),m=t.conversations.findIndex(y=>y.id===v);m!==-1&&(t.conversations[m]=w)}async function A(v){if(!v)return[];const b=t.messagesByConv[v]||[];let w="";for(const m of b)m!=null&&m.created_at&&m.created_at>w&&(w=m.created_at);try{const m=await e.listMessages(v,w?{since:w}:{}),y=(m==null?void 0:m.messages)||[];if(!y.length)return[];const S=new Set,P=new Set;for(const V of b)(V==null?void 0:V.id)!=null&&S.add(String(V.id)),V!=null&&V.client_msg_id&&P.add(V.client_msg_id);const N=[];for(const V of y){const ie=(V==null?void 0:V.id)!=null&&S.has(String(V.id))||(V==null?void 0:V.client_msg_id)&&P.has(V.client_msg_id);he(v,V),ie||N.push(V)}return N}catch(m){return console.error("[store] fetchSinceLast failed",m),[]}}async function k(v,b){if(!(!v||b==null))try{const w=await e.markConversationRead(v,b),m=(w==null?void 0:w.last_read_message_id)??b,y=t.conversations.findIndex(S=>(S==null?void 0:S.id)===v);y!==-1&&(t.conversations[y]={...t.conversations[y],last_read_message_id:m})}catch(w){console.error("[store] markConversationRead failed",w)}}async function $(v,b,{attachments:w,metadata:m}={}){var ie;const y=(b||"").trim(),S=Array.isArray(w)&&w.length>0;if(!v||!y&&!S)return;const P=lc(),N=le(v),V={id:P,client_msg_id:P,conversation_id:v,type:"content",text_md:y,author:{type:"user",id:((ie=t.customer)==null?void 0:ie.external_id)||null},created_at:N,_pending:!0,...S?{payload:{type:"content",attachments:w}}:{},...m&&typeof m=="object"?{metadata:m}:{}};he(v,V);try{await e.postMessage(v,{client_msg_id:P,text_md:y,created_at:N,...S?{attachments:w}:{},...m&&typeof m=="object"?{metadata:m}:{}})}catch(ne){console.error("[store] send failed",ne),G(v,P,{_failed:!0,_pending:!1})}}async function T(v,b,w){v!=null&&(t.awaitingCallback[v]=!0);try{await e.postCallback(v,b,w)}catch(m){console.error("[store] callback failed",m),v!=null&&delete t.awaitingCallback[v]}}const J=new Map;async function U(v){if(!v)return null;const b=J.get(v);if(b!=null&&b.url){const w=b.expires_at?Date.parse(b.expires_at):0;if(!w||w-Date.now()>6e4)return b.url}try{const w=await e.signAttachment(v);if(w!=null&&w.signed_url)return J.set(v,{url:w.signed_url,expires_at:w.expires_at}),w.signed_url}catch(w){console.error("[store] sign attachment failed",w)}return null}async function q(v,{rating:b,comment:w}={}){const m=t.conversations.find(P=>P.id===v),S={...(m==null?void 0:m.metadata)||{},feedback:{rating:b,comment:w||null,submitted_at:new Date().toISOString()}};await _(v,{metadata:S})}function Z(v){var w,m;const b=t.messagesByConv[v]||[];for(let y=b.length-1;y>=0;y--){const S=b[y];if((S==null?void 0:S.type)==="action"&&((w=S==null?void 0:S.payload)==null?void 0:w.type)==="action"&&((m=S==null?void 0:S.payload)==null?void 0:m.state)==="pending"&&Array.isArray(S==null?void 0:S.callbacks)&&S.callbacks.length>0&&!t.awaitingCallback[S.id])return S}return null}function H(v){var w,m,y;const b=t.messagesByConv[v]||[];for(let S=b.length-1;S>=0;S--){const P=b[S];if(((w=P==null?void 0:P.author)==null?void 0:w.type)==="user"||(P==null?void 0:P.type)==="action"&&((m=P==null?void 0:P.payload)==null?void 0:m.state)==="pending")return null;const N=(y=P==null?void 0:P.metadata)==null?void 0:y.form;if(N&&Array.isArray(N.fields)&&N.fields.length>0)return{message:P,form:N}}return null}function se(v){const b=t.runningActionsByConv[v];if(!b)return null;const w=Object.keys(b);if(w.length===0)return null;const m=w[0];return{id:m,payload:{name:b[m]}}}function ge(v){var w,m,y,S;const b=t.messagesByConv[v]||[];for(let P=b.length-1;P>=0;P--){const N=b[P];if(((w=N==null?void 0:N.author)==null?void 0:w.type)==="user")return[];if((N==null?void 0:N.type)==="action"&&((m=N==null?void 0:N.payload)==null?void 0:m.state)==="pending")return[];if(((y=N==null?void 0:N.author)==null?void 0:y.type)!=="agent_ia")continue;const V=(S=N==null?void 0:N.metadata)==null?void 0:S.suggested_replies;return Array.isArray(V)&&V.length?V.map(ie=>{if(typeof ie=="string"){const ne=ie.trim();return ne?{label:ne,kind:null}:null}if(ie&&typeof ie=="object"&&typeof ie.label=="string"){const ne=ie.label.trim();if(!ne)return null;const Zn=ie.kind==="cta"||ie.kind==="choice"||ie.kind==="followup"?ie.kind:null;return{label:ne,kind:Zn}}return null}).filter(Boolean).slice(0,4):[]}return[]}function he(v,b){var S;const w=t.messagesByConv[v]||[];let m=-1;b!=null&&b.client_msg_id&&(m=w.findIndex(P=>(P==null?void 0:P.client_msg_id)&&P.client_msg_id===b.client_msg_id)),m===-1&&(b==null?void 0:b.id)!==void 0&&(b==null?void 0:b.id)!==null&&(m=w.findIndex(P=>ke(P==null?void 0:P.id,b.id)));let y;m===-1?y=[...w,b].sort(ue):(y=w.slice(),y[m]={...w[m],...b,_pending:!1,_failed:!1}),t.messagesByConv[v]=y,(b==null?void 0:b.type)==="action"&&((S=b==null?void 0:b.payload)!=null&&S.state)&&b.payload.state!=="pending"&&(b==null?void 0:b.id)!=null&&t.awaitingCallback[b.id]&&delete t.awaitingCallback[b.id]}function ke(v,b){return v===b?!0:v==null||b==null?!1:String(v)===String(b)}function G(v,b,w){const m=t.messagesByConv[v];if(!m)return;const y=m.findIndex(P=>P.id===b);if(y===-1)return;const S=m.slice();S[y]={...m[y],...w},t.messagesByConv[v]=S}function te(v,b){const w=t.conversations.findIndex(y=>y.id===v);if(w===-1)return;const m=t.conversations[w];if(b&&(!m.last_message_at||b>m.last_message_at)){const y=t.conversations.slice();y[w]={...m,last_message_at:b},y.sort((S,P)=>(P.last_message_at||"").localeCompare(S.last_message_at||"")),t.conversations=y}}function ue(v,b){return(v.created_at||"").localeCompare(b.created_at||"")}function j(v){if(!v||typeof v!="object")return null;const b={},w={};for(const[m,y]of Object.entries(v))y!==void 0&&(m==="name"||m==="email"||m==="language"?y!=null&&String(y).trim()!==""&&(b[m]=y):(m==="values"||m==="metadata")&&y&&typeof y=="object"?Object.assign(w,y):w[m]=y);return Object.keys(w).length&&(b.values=w),Object.keys(b).length?b:null}function le(v){const b=t.messagesByConv[v]||[];let w="";for(const S of b)S!=null&&S.created_at&&S.created_at>w&&(w=S.created_at);const m=new Date().toISOString();return!w||m>w?m:new Date(Date.parse(w)+1).toISOString()}return{state:t,start:r,destroy:i,applyCustomer:s,createConversation:o,openConversation:l,loadMore:f,fetchSinceLast:A,patchConversation:_,markConversationRead:k,send:$,clickCallback:T,signAttachment:U,submitFeedback:q,getPendingApproval:Z,getActionInFlight:se,getLatestSuggestions:ge,getLatestForm:H,setPanelOpen:e.setPanelOpen}}const Ie={w:"#ffffff",g50:"#F9F9F7",g100:"#F2F1EE",g150:"#E8E6E2",g200:"#D9D6CF",g300:"#B4B0A8",g400:"#888480",g500:"#5A5753",g700:"#2B2926",g900:"#17161A",accent:"#5B5FEF",accentLight:"#EEEFFE",green:"#22C55E",red:"#B91C1C",redBg:"#FDECEC"},ps=["#5B5FEF","#7C3AED","#DB2777","#0891B2","#D97706","#059669"];function Gs(e=""){return e?ps[e.charCodeAt(0)%ps.length]:ps[0]}function Ys(e=""){return e.split(" ").map(t=>t[0]||"").join("").toUpperCase().slice(0,2)}function Ls(e=new Date,t="fr-FR"){return e.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}const wo=`
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 {
21
21
  --wm-f: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
22
22
  --wm-fm: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
23
- --wm-w: ${Re.w};
24
- --wm-g50: ${Re.g50};
25
- --wm-g100: ${Re.g100};
26
- --wm-g150: ${Re.g150};
27
- --wm-g200: ${Re.g200};
28
- --wm-g300: ${Re.g300};
29
- --wm-g400: ${Re.g400};
30
- --wm-g500: ${Re.g500};
31
- --wm-g700: ${Re.g700};
32
- --wm-g900: ${Re.g900};
33
- --wm-a: ${Re.accent};
34
- --wm-al: ${Re.accentLight};
35
- --wm-green: ${Re.green};
36
- --wm-red: ${Re.red};
37
- --wm-redBg: ${Re.redBg};
23
+ --wm-w: ${Ie.w};
24
+ --wm-g50: ${Ie.g50};
25
+ --wm-g100: ${Ie.g100};
26
+ --wm-g150: ${Ie.g150};
27
+ --wm-g200: ${Ie.g200};
28
+ --wm-g300: ${Ie.g300};
29
+ --wm-g400: ${Ie.g400};
30
+ --wm-g500: ${Ie.g500};
31
+ --wm-g700: ${Ie.g700};
32
+ --wm-g900: ${Ie.g900};
33
+ --wm-a: ${Ie.accent};
34
+ --wm-al: ${Ie.accentLight};
35
+ --wm-primary: ${Ie.accent};
36
+ --wm-green: ${Ie.green};
37
+ --wm-red: ${Ie.red};
38
+ --wm-redBg: ${Ie.redBg};
38
39
  --wm-sh1: 0 1px 3px rgba(0,0,0,.06);
39
40
  --wm-sh2: 0 4px 24px rgba(0,0,0,.09), 0 1px 4px rgba(0,0,0,.05);
40
41
  --wm-shPanel: 0 12px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
@@ -62,12 +63,12 @@
62
63
  }
63
64
  `,uc="https://api.messenger.victorc.fr",gn="fr",dc=["fr","en"],Kr={fr:"fr-FR",en:"en-US"},gs={fr:{"common.newConversation":"Nouvelle conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"Assistant IA","common.system":"Systรจme","common.you":"Vous","common.action":"Action","common.yes":"Oui","common.no":"Non","common.send":"Envoyer","common.sending":"Envoiโ€ฆ","common.cancel":"Annuler","common.save":"Enregistrer","common.close":"Fermer","common.open":"Ouvrir","loading.minimize":"Rรฉduire","error.connectionFailed":"Connexion impossible","header.backToHome":"Retour ร  l'accueil","header.moreOptions":"Plus d'options","header.closeWidget":"Fermer le widget","launcher.open":"Ouvrir le messenger","launcher.openConversationWith":"Ouvrir la conversation avec {name}","launcher.theAgent":"l'agent","launcher.dismiss":"Ignorer","launcher.repliedToYou":" vous a rรฉpondu","launcher.unreadMessages":"{count} messages non lus","launcher.unreadConversationsOne":"{count} conversation non lue","launcher.unreadConversationsMany":"{count} conversations non lues","onboarding.start":"Commencer une conversation","onboarding.quickAccess":"Accรจs rapide","onboarding.recentConversations":"Conversations rรฉcentes","onboarding.search":"Rechercher dans vos messages","onboarding.unread":"Non lu","onboarding.noResults":"Aucun rรฉsultat pour ยซ {query} ยป.","onboarding.greetingNamed":"Bonjour, je suis {name}","onboarding.greeting":"Bonjour, je suis votre assistant","onboarding.heroSub":`Posez-moi n'importe quelle question.
64
65
  Je rรฉponds en quelques secondes.`,"onboarding.newMessage":"Nouveau message","onboarding.statusInProgress":"En cours","onboarding.resume":"Reprendre","onboarding.unreadConversations":"Conversations non lues","composer.placeholder":"ร‰crivez votre messageโ€ฆ","composer.replyTo":"Rรฉpondre ร  {name}โ€ฆ","composer.agentTakingOver":"Un agent prend le relaisโ€ฆ","composer.send":"Envoyer","composer.attach":"Joindre","composer.attachFile":"Joindre un fichier","composer.screenshot":"Capture d'รฉcran","composer.recordScreen":"Enregistrer l'รฉcran","composer.recording":"Enregistrement ยท {time}","composer.stop":"Arrรชter","messageList.loadingHistory":"Chargement de l'historiqueโ€ฆ","messageList.conversationStart":"Dรฉbut de la conversation","messageList.unread":"Non lus","messageList.today":"Aujourd'hui ยท {time}","messageList.approvalRequestSent":"Demande d'approbation envoyรฉe","messageList.conversationUpdate":"Mise ร  jour de la conversation","messageList.anAgent":"Un agent","messageList.scrollToBottom":"Aller en bas","system.transferredToHuman":"Conversation transfรฉrรฉe ร  un humain","system.assigned":"{name} a rejoint la conversation","system.unassigned":"L'agent a quittรฉ la conversation","system.resolved":"Conversation rรฉsolue","system.reopened":"Conversation rouverte","system.idle":"Conversation en pause","action.title":"Confirmer l'action","action.inProgress":"{name} en cours, veuillez patienterโ€ฆ","action.rejectedByUser":"Action annulรฉe par l'utilisateur.","approval.approve":"Autoriser","approval.reject":"Refuser","moreMenu.editTitle":"Modifier le titre","moreMenu.exportTranscript":"Exporter la transcription","moreMenu.sound":"Son","moreMenu.browserNotifications":"Notifications navigateur","moreMenu.serviceStatus":"Statut des services","moreMenu.helpCenter":"Centre d'aide","feedback.question":"Comment s'est passรฉe cette conversation ?","feedback.subtitle":"Votre avis nous aide ร  amรฉliorer l'assistant.","feedback.rating1":"Pas bien","feedback.rating2":"Moyen","feedback.rating3":"Bien","feedback.rating4":"Super","feedback.rating5":"Excellent","feedback.submit":"Envoyer mon avis","feedback.doneTitle":"Merci pour votre retour !","feedback.doneSubtitle":"Votre avis a bien รฉtรฉ pris en compte.","rename.dialogTitle":"Modifier le titre de la conversation","rename.title":"Modifier le titre","rename.placeholder":"Titre de la conversation","form.title":"Formulaire","form.choose":"Choisirโ€ฆ","form.responseSent":"Rรฉponse envoyรฉe","form.sent":"Envoyรฉ","form.fieldRequired":"ยซ {label} ยป est requis.","ticket.dateAt":" ร  ","attachment.fallbackName":"Piรจce jointe","attachment.remove":"Retirer","attachment.fileFallbackName":"fichier","attachment.bytes":"{size} o","attachment.kilobytes":"{size} ko","attachment.megabytes":"{size} Mo","notification.newMessage":"Nouveau message","notification.youHaveNewMessage":"Vous avez un nouveau message","export.createdOn":"Crรฉรฉe le : {date}"},en:{"common.newConversation":"New conversation","common.conversation":"Conversation","common.agent":"Agent","common.aiAssistant":"AI Assistant","common.system":"System","common.you":"You","common.action":"Action","common.yes":"Yes","common.no":"No","common.send":"Send","common.sending":"Sendingโ€ฆ","common.cancel":"Cancel","common.save":"Save","common.close":"Close","common.open":"Open","loading.minimize":"Minimize","error.connectionFailed":"Connection failed","header.backToHome":"Back to home","header.moreOptions":"More options","header.closeWidget":"Close widget","launcher.open":"Open the messenger","launcher.openConversationWith":"Open the conversation with {name}","launcher.theAgent":"the agent","launcher.dismiss":"Dismiss","launcher.repliedToYou":" replied to you","launcher.unreadMessages":"{count} unread messages","launcher.unreadConversationsOne":"{count} unread conversation","launcher.unreadConversationsMany":"{count} unread conversations","onboarding.start":"Start a conversation","onboarding.quickAccess":"Quick access","onboarding.recentConversations":"Recent conversations","onboarding.search":"Search your messages","onboarding.unread":"Unread","onboarding.noResults":"No results for โ€œ{query}โ€.","onboarding.greetingNamed":"Hi, I'm {name}","onboarding.greeting":"Hi, I'm your assistant","onboarding.heroSub":`Ask me anything.
65
- I reply within seconds.`,"onboarding.newMessage":"New message","onboarding.statusInProgress":"In progress","onboarding.resume":"Resume","onboarding.unreadConversations":"Unread conversations","composer.placeholder":"Type your messageโ€ฆ","composer.replyTo":"Reply to {name}โ€ฆ","composer.agentTakingOver":"An agent is taking overโ€ฆ","composer.send":"Send","composer.attach":"Attach","composer.attachFile":"Attach a file","composer.screenshot":"Screenshot","composer.recordScreen":"Record screen","composer.recording":"Recording ยท {time}","composer.stop":"Stop","messageList.loadingHistory":"Loading historyโ€ฆ","messageList.conversationStart":"Start of the conversation","messageList.unread":"Unread","messageList.today":"Today ยท {time}","messageList.approvalRequestSent":"Approval request sent","messageList.conversationUpdate":"Conversation update","messageList.anAgent":"An agent","messageList.scrollToBottom":"Scroll to bottom","system.transferredToHuman":"Conversation transferred to a human","system.assigned":"{name} joined the conversation","system.unassigned":"The agent left the conversation","system.resolved":"Conversation resolved","system.reopened":"Conversation reopened","system.idle":"Conversation paused","action.title":"Confirm the action","action.inProgress":"{name} in progress, please waitโ€ฆ","action.rejectedByUser":"Action cancelled by the user.","approval.approve":"Approve","approval.reject":"Decline","moreMenu.editTitle":"Edit title","moreMenu.exportTranscript":"Export transcript","moreMenu.sound":"Sound","moreMenu.browserNotifications":"Browser notifications","moreMenu.serviceStatus":"Service status","moreMenu.helpCenter":"Help center","feedback.question":"How was this conversation?","feedback.subtitle":"Your feedback helps us improve the assistant.","feedback.rating1":"Poor","feedback.rating2":"Okay","feedback.rating3":"Good","feedback.rating4":"Great","feedback.rating5":"Excellent","feedback.submit":"Send my feedback","feedback.doneTitle":"Thanks for your feedback!","feedback.doneSubtitle":"Your feedback has been recorded.","rename.dialogTitle":"Edit conversation title","rename.title":"Edit title","rename.placeholder":"Conversation title","form.title":"Form","form.choose":"Chooseโ€ฆ","form.responseSent":"Response sent","form.sent":"Sent","form.fieldRequired":"โ€œ{label}โ€ is required.","ticket.dateAt":" at ","attachment.fallbackName":"Attachment","attachment.remove":"Remove","attachment.fileFallbackName":"file","attachment.bytes":"{size} B","attachment.kilobytes":"{size} KB","attachment.megabytes":"{size} MB","notification.newMessage":"New message","notification.youHaveNewMessage":"You have a new message","export.createdOn":"Created on: {date}"}};function Js(e){if(typeof e!="string")return gn;const t=e.trim().toLowerCase().slice(0,2);return dc.includes(t)?t:gn}function Vt(e){return Kr[Js(e)]||Kr[gn]}function Ee(e){const t=Js(e),n=gs[t]||gs[gn],r=gs[gn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,f)=>o[f]!=null?String(o[f]):l)),a)}}function zr(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 ko(e,t,n){return Array.isArray(t)?t.map(r=>zr(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):zr(e,String(t))}function fc(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=ko(s,o,n);a&&i.push(`${s.label} :
66
+ I reply within seconds.`,"onboarding.newMessage":"New message","onboarding.statusInProgress":"In progress","onboarding.resume":"Resume","onboarding.unreadConversations":"Unread conversations","composer.placeholder":"Type your messageโ€ฆ","composer.replyTo":"Reply to {name}โ€ฆ","composer.agentTakingOver":"An agent is taking overโ€ฆ","composer.send":"Send","composer.attach":"Attach","composer.attachFile":"Attach a file","composer.screenshot":"Screenshot","composer.recordScreen":"Record screen","composer.recording":"Recording ยท {time}","composer.stop":"Stop","messageList.loadingHistory":"Loading historyโ€ฆ","messageList.conversationStart":"Start of the conversation","messageList.unread":"Unread","messageList.today":"Today ยท {time}","messageList.approvalRequestSent":"Approval request sent","messageList.conversationUpdate":"Conversation update","messageList.anAgent":"An agent","messageList.scrollToBottom":"Scroll to bottom","system.transferredToHuman":"Conversation transferred to a human","system.assigned":"{name} joined the conversation","system.unassigned":"The agent left the conversation","system.resolved":"Conversation resolved","system.reopened":"Conversation reopened","system.idle":"Conversation paused","action.title":"Confirm the action","action.inProgress":"{name} in progress, please waitโ€ฆ","action.rejectedByUser":"Action cancelled by the user.","approval.approve":"Approve","approval.reject":"Decline","moreMenu.editTitle":"Edit title","moreMenu.exportTranscript":"Export transcript","moreMenu.sound":"Sound","moreMenu.browserNotifications":"Browser notifications","moreMenu.serviceStatus":"Service status","moreMenu.helpCenter":"Help center","feedback.question":"How was this conversation?","feedback.subtitle":"Your feedback helps us improve the assistant.","feedback.rating1":"Poor","feedback.rating2":"Okay","feedback.rating3":"Good","feedback.rating4":"Great","feedback.rating5":"Excellent","feedback.submit":"Send my feedback","feedback.doneTitle":"Thanks for your feedback!","feedback.doneSubtitle":"Your feedback has been recorded.","rename.dialogTitle":"Edit conversation title","rename.title":"Edit title","rename.placeholder":"Conversation title","form.title":"Form","form.choose":"Chooseโ€ฆ","form.responseSent":"Response sent","form.sent":"Sent","form.fieldRequired":"โ€œ{label}โ€ is required.","ticket.dateAt":" at ","attachment.fallbackName":"Attachment","attachment.remove":"Remove","attachment.fileFallbackName":"file","attachment.bytes":"{size} B","attachment.kilobytes":"{size} KB","attachment.megabytes":"{size} MB","notification.newMessage":"New message","notification.youHaveNewMessage":"You have a new message","export.createdOn":"Created on: {date}"}};function Js(e){if(typeof e!="string")return gn;const t=e.trim().toLowerCase().slice(0,2);return dc.includes(t)?t:gn}function Vt(e){return Kr[Js(e)]||Kr[gn]}function Oe(e){const t=Js(e),n=gs[t]||gs[gn],r=gs[gn];return function(s,o){let a=n[s];return a==null&&(a=r[s]),a==null?s:(o&&(a=a.replace(/\{(\w+)\}/g,(l,f)=>o[f]!=null?String(o[f]):l)),a)}}function zr(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 ko(e,t,n){return Array.isArray(t)?t.map(r=>zr(e,String(r))).join(", "):typeof t=="boolean"?n(t?"common.yes":"common.no"):zr(e,String(t))}function fc(e,t,n=Oe()){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=ko(s,o,n);a&&i.push(`${s.label} :
66
67
  ${a}`)}return i.join(`
67
68
 
68
- `)}function hc(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=ko(s,o,n);if(!a)continue;const l=s.type==="textarea"||typeof a=="string"&&(a.length>60||a.includes(`
69
+ `)}function hc(e,t,n=Oe()){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=ko(s,o,n);if(!a)continue;const l=s.type==="textarea"||typeof a=="string"&&(a.length>60||a.includes(`
69
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 _n(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 ut(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 mc(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 pc(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 gc(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=pc(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(`
70
- `)}function _c(e,t,n=Ee(),r){if(!e)return;const i=gc(e,t||[],n,Vt(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 vc={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||!_n(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)}}}},yc=450,bc=50,wc=900,kc=12e3,Cc=300,Sc={data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",r=>{const i=r==null?void 0:r.conversation_id,s=r==null?void 0:r.message;i&&s&&this.paceLiveMessage(s,i)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(r=>[r.id,(r==null?void 0:r.last_message_at)||""]));const t=this.transport.on("activity",r=>{this.handleLiveActivity(r)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null},async handleLiveActivity(e){var i,s;const t=e==null?void 0:e.conversations;if(!Array.isArray(t)||!this.store)return;const n=this._liveRevealConvSnapshot||new Map,r=[];for(const o of t){if(!(o!=null&&o.id))continue;const a=o.last_message_at||"";if(!a)continue;const l=n.get(o.id)||"";a>l&&r.push(o.id)}this._liveRevealConvSnapshot=new Map(t.map(o=>[o.id,(o==null?void 0:o.last_message_at)||""]));for(const o of r)try{const a=await((s=(i=this.store).fetchSinceLast)==null?void 0:s.call(i,o));if(!Array.isArray(a))continue;for(const l of a)this.paceLiveMessage(l,o)}catch(a){console.error("[ww-messenger] activity delta fetch failed",a)}},scheduleReveal(e,t){const n=Date.now(),r=((e==null?void 0:e.text_md)||"").length,i=Math.min(kc,Math.max(wc,r*bc)),o=Math.max(n+yc,this.nextRevealAt+Cc)+i;this.nextRevealAt=o;const a=Math.max(0,o-n),l=e.id,f=setTimeout(()=>{this.revealedAt={...this.revealedAt,[l]:Date.now()},this.revealTimers=this.revealTimers.filter(c=>c!==f),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},a);this.revealTimers.push(f)},paceMessages(e,t){var i;if(!Array.isArray(e)||!e.length)return;const n=Date.now(),r={...this.revealedAt};for(const s of e){if((s==null?void 0:s.id)==null||r[s.id]!==void 0)continue;if(!_n(s)){r[s.id]=n;continue}const o=s!=null&&s.created_at?Date.parse(s.created_at):NaN;if(!Number.isFinite(o)||o<this.convOpenedAt){r[s.id]=n;continue}const a=typeof(s==null?void 0:s.text_md)=="string"&&s.text_md.trim().length>0,l=Array.isArray((i=s==null?void 0:s.payload)==null?void 0:i.attachments)&&s.payload.attachments.length>0;if(!a&&!l){r[s.id]=n;continue}r[s.id]=0,this.scheduleReveal(s,t)}this.revealedAt=r},paceLiveMessage(e,t){var i;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!_n(e)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const n=typeof(e==null?void 0:e.text_md)=="string"&&e.text_md.trim().length>0,r=Array.isArray((i=e==null?void 0:e.payload)==null?void 0:i.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Ac={data(){return{approvalSettled:!0,approvalSettleTimer:null,approvalLatchId:null}},methods:{resetApprovalPacing(){this.approvalSettleTimer&&(clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=null),this.approvalSettled=!0,this.approvalLatchId=null},bumpApprovalSettle(e=800){this.approvalSettled=!1,this.approvalSettleTimer&&clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=setTimeout(()=>{this.approvalSettled=!0,this.approvalSettleTimer=null},e)}}},xc=300,Tc={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=Mc(t);if(n==null)return;const r=ut(e.last_read_message_id),i=ut(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)},xc))))}}};function Mc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&ut(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},Ec={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":Gs(this.name)},initials(){return Ys(this.name)}}},Oc=["src","alt"];function Ic(e,t,n,r,i,s){return m(),_("div",{class:ee(["wm-huav",{"wm-huav--tail":n.tail}]),style:Fe({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(m(),_("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Oc)):(m(),_("span",{key:1,style:Fe({fontSize:n.size*.36+"px"})},I(s.initials),5))],6)}const Xs=we(Ec,[["render",Ic],["__scopeId","data-v-14e10c0d"]]),Lc=3,Rc={name:"WmLauncher",components:{HumanAvatar:Xs},inject:{t:{default:()=>Ee()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Lc).reverse()}}},Pc=["aria-label","onClick","onKeydown"],Bc=["aria-label","onClick"],Nc={class:"wm-peek__avatar"},Fc=["aria-label"],Dc={class:"wm-peek__body"},jc={class:"wm-peek__head"},Uc={class:"wm-peek__name"},Hc={class:"wm-peek__action"},Vc={class:"wm-peek__text"},$c=["onClick"],Kc=["aria-label"],zc=["aria-label"];function qc(e,t,n,r,i,s){const o=ye("HumanAvatar");return m(),_("div",{class:"wm-launcherWrap",onMouseenter:t[1]||(t[1]=a=>e.$emit("hover",!0)),onMouseleave:t[2]||(t[2]=a=>e.$emit("hover",!1)),onFocusin:t[3]||(t[3]=a=>e.$emit("hover",!0)),onFocusout:t[4]||(t[4]=a=>e.$emit("hover",!1))},[ve(yo,{name:"wm-peek"},{default:Ks(()=>[s.visiblePeeks.length?(m(),_("div",{key:0,class:ee(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(m(!0),_(Q,null,Se(s.visiblePeeks,(a,l)=>(m(),_("div",{key:a.convId,class:"wm-peek",style:Fe({"--depth":s.visiblePeeks.length-1-l,zIndex:l+1}),role:"button",tabindex:"0","aria-label":s.t("launcher.openConversationWith",{name:a.senderName||s.t("launcher.theAgent")}),onClick:f=>e.$emit("open",a.convId),onKeydown:[Nn(dt(f=>e.$emit("open",a.convId),["prevent"]),["enter"]),Nn(dt(f=>e.$emit("open",a.convId),["prevent"]),["space"])]},[u("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:dt(f=>e.$emit("dismiss",a.convId),["stop"])},[...t[5]||(t[5]=[u("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Bc),u("div",Nc,[ve(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(m(),_("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},I(a.count>9?"9+":a.count),9,Fc)):B("",!0)]),u("div",Dc,[u("div",jc,[u("span",Uc,I(a.senderName||s.t("common.agent")),1),u("span",Hc,I(s.t("launcher.repliedToYou")),1)]),u("p",Vc,I(a.preview),1)]),u("button",{type:"button",class:"wm-peek__open",onClick:dt(f=>e.$emit("open",a.convId),["stop"])},I(s.t("common.open")),9,$c)],44,Pc))),128))],2)):B("",!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?(m(),_("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})},I(n.unreadCount>9?"9+":n.unreadCount),9,zc)):B("",!0)],8,Kc)],32)}const Wc=we(Rc,[["render",qc],["__scopeId","data-v-44ddf1a1"]]),Gc={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 Ys(this.name)},bgColor(){return Gs(this.name)}}},Yc={key:0,class:"wm-aiav__pulse"},Jc=["src","alt"],Xc=["width","height"];function Qc(e,t,n,r,i,s){return m(),_("div",{class:ee(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:Fe({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(m(),_("div",Yc)):B("",!0),u("div",{class:ee(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:Fe(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(m(),_("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,Jc)):s.initials?(m(),_("span",{key:1,style:Fe({fontSize:n.size*.36+"px"})},I(s.initials),5)):(m(),_("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,Xc))],6)],6)}const wn=we(Gc,[["render",Qc],["__scopeId","data-v-6f7f685d"]]),Zc={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":Gs(e.name||"")},initialsFor(e){return Ys(e.name||"")}}},eu={key:0,class:"wm-team"},tu=["src","alt"],nu={key:1},su={key:0,class:"wm-team__label"};function ru(e,t,n,r,i,s){return s.visible?(m(),_("div",eu,[u("div",{class:"wm-team__stack",style:Fe({width:s.stackWidth+"px"})},[(m(!0),_(Q,null,Se(n.members.slice(0,3),(o,a)=>(m(),_("div",{key:a,class:"wm-team__pill",style:Fe({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(m(),_("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,tu)):(m(),_("span",nu,I(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(m(),_("span",su,I(n.responseLabel),1)):B("",!0)])):B("",!0)}const iu=we(Zc,[["render",ru],["__scopeId","data-v-e49a9063"]]),ou={name:"WmHeader",components:{AIAvatar:wn,TeamAvatars:iu},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}}},au={class:"wm-header"},lu=["aria-label"],cu={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},uu={class:"wm-header__avatar"},du={class:"wm-header__main"},fu={class:"wm-header__title"},hu={key:3,class:"wm-header__fill"},mu={class:"wm-header__actions"},pu=["aria-label","title"],gu=["aria-label","title"];function _u(e,t,n,r,i,s){const o=ye("AIAvatar"),a=ye("TeamAvatars");return m(),_("div",au,[n.showBack?(m(),_("button",{key:0,type:"button",class:"wm-header__icon","aria-label":s.t("header.backToHome"),onClick:t[0]||(t[0]=l=>e.$emit("back"))},[...t[3]||(t[3]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M19 12H5M12 5l-7 7 7 7"})],-1)])],8,lu)):(m(),_("div",cu)),n.showIdentity?(m(),_(Q,{key:2},[u("div",uu,[ve(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",du,[u("div",fu,I(n.title),1)]),s.hasTeam?(m(),_e(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):B("",!0)],64)):(m(),_("div",hu)),u("div",mu,[n.showMore?(m(),_("button",{key:0,type:"button",class:ee(["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,pu)):B("",!0),n.showClose?(m(),_("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,gu)):B("",!0)])])}const vu=we(ou,[["render",_u],["__scopeId","data-v-0da6fbcd"]]);function Co(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yu(e){return/^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim())}const Wr="๎€€";function Zt(e){let t=e;const n=[];return t=t.replace(/`([^`\n]+)`/g,(r,i)=>{const s=n.length;return n.push(i),`${Wr}CODE${s}${Wr}`}),t=t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g,(r,i,s)=>yu(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 bu(e){if(!e)return"";const t=String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g,"$1");return Zt(Co(t))}function wu(e){if(!e)return"";const t=Co(e).split(`
71
+ `)}function _c(e,t,n=Oe(),r){if(!e)return;const i=gc(e,t||[],n,Vt(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 vc={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||!_n(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)}}}},yc=450,bc=50,wc=900,kc=12e3,Cc=300,Sc={data(){return{revealedAt:{},nextRevealAt:0,revealTimers:[],_liveRevealOff:null,_liveRevealConvSnapshot:null}},methods:{cancelReveals(){for(const e of this.revealTimers)clearTimeout(e);this.revealTimers=[]},resetRevealQueue(){this.cancelReveals(),this.revealedAt={},this.nextRevealAt=0},setupLiveReveal(){var n;if(!this.transport)return;this.teardownLiveReveal();const e=this.transport.on("message",r=>{const i=r==null?void 0:r.conversation_id,s=r==null?void 0:r.message;i&&s&&this.paceLiveMessage(s,i)});this._liveRevealConvSnapshot=new Map((((n=this.s)==null?void 0:n.conversations)||[]).map(r=>[r.id,(r==null?void 0:r.last_message_at)||""]));const t=this.transport.on("activity",r=>{this.handleLiveActivity(r)});this._liveRevealOff=()=>{try{e()}catch{}try{t()}catch{}}},teardownLiveReveal(){if(this._liveRevealOff){try{this._liveRevealOff()}catch{}this._liveRevealOff=null}this._liveRevealConvSnapshot=null},async handleLiveActivity(e){var i,s;const t=e==null?void 0:e.conversations;if(!Array.isArray(t)||!this.store)return;const n=this._liveRevealConvSnapshot||new Map,r=[];for(const o of t){if(!(o!=null&&o.id))continue;const a=o.last_message_at||"";if(!a)continue;const l=n.get(o.id)||"";a>l&&r.push(o.id)}this._liveRevealConvSnapshot=new Map(t.map(o=>[o.id,(o==null?void 0:o.last_message_at)||""]));for(const o of r)try{const a=await((s=(i=this.store).fetchSinceLast)==null?void 0:s.call(i,o));if(!Array.isArray(a))continue;for(const l of a)this.paceLiveMessage(l,o)}catch(a){console.error("[ww-messenger] activity delta fetch failed",a)}},scheduleReveal(e,t){const n=Date.now(),r=((e==null?void 0:e.text_md)||"").length,i=Math.min(kc,Math.max(wc,r*bc)),o=Math.max(n+yc,this.nextRevealAt+Cc)+i;this.nextRevealAt=o;const a=Math.max(0,o-n),l=e.id,f=setTimeout(()=>{this.revealedAt={...this.revealedAt,[l]:Date.now()},this.revealTimers=this.revealTimers.filter(u=>u!==f),typeof this.onMessageRevealed=="function"&&this.onMessageRevealed(e,t)},a);this.revealTimers.push(f)},paceMessages(e,t){var i;if(!Array.isArray(e)||!e.length)return;const n=Date.now(),r={...this.revealedAt};for(const s of e){if((s==null?void 0:s.id)==null||r[s.id]!==void 0)continue;if(!_n(s)){r[s.id]=n;continue}const o=s!=null&&s.created_at?Date.parse(s.created_at):NaN;if(!Number.isFinite(o)||o<this.convOpenedAt){r[s.id]=n;continue}const a=typeof(s==null?void 0:s.text_md)=="string"&&s.text_md.trim().length>0,l=Array.isArray((i=s==null?void 0:s.payload)==null?void 0:i.attachments)&&s.payload.attachments.length>0;if(!a&&!l){r[s.id]=n;continue}r[s.id]=0,this.scheduleReveal(s,t)}this.revealedAt=r},paceLiveMessage(e,t){var i;if(!(e!=null&&e.id)||this.revealedAt[e.id]!==void 0)return;if(!_n(e)){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}const n=typeof(e==null?void 0:e.text_md)=="string"&&e.text_md.trim().length>0,r=Array.isArray((i=e==null?void 0:e.payload)==null?void 0:i.attachments)&&e.payload.attachments.length>0;if(!n&&!r){this.revealedAt={...this.revealedAt,[e.id]:Date.now()};return}this.revealedAt={...this.revealedAt,[e.id]:0},this.scheduleReveal(e,t)}}},Ac={data(){return{approvalSettled:!0,approvalSettleTimer:null,approvalLatchId:null}},methods:{resetApprovalPacing(){this.approvalSettleTimer&&(clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=null),this.approvalSettled=!0,this.approvalLatchId=null},bumpApprovalSettle(e=800){this.approvalSettled=!1,this.approvalSettleTimer&&clearTimeout(this.approvalSettleTimer),this.approvalSettleTimer=setTimeout(()=>{this.approvalSettled=!0,this.approvalSettleTimer=null},e)}}},xc=300,Tc={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=Mc(t);if(n==null)return;const r=ut(e.last_read_message_id),i=ut(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)},xc))))}}};function Mc(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!(!n||n._pending)&&ut(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},Ec={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":Gs(this.name)},initials(){return Ys(this.name)}}},Oc=["src","alt"];function Ic(e,t,n,r,i,s){return h(),g("div",{class:ee(["wm-huav",{"wm-huav--tail":n.tail}]),style:Se({width:n.size+"px",height:n.size+"px","--wm-avr":Math.round(n.size*.32)+"px",background:s.bg})},[n.avatarUrl?(h(),g("img",{key:0,src:n.avatarUrl,alt:n.name||""},null,8,Oc)):(h(),g("span",{key:1,style:Se({fontSize:n.size*.36+"px"})},I(s.initials),5))],6)}const Xs=we(Ec,[["render",Ic],["__scopeId","data-v-14e10c0d"]]),Lc=3,Rc={name:"WmLauncher",components:{HumanAvatar:Xs},inject:{t:{default:()=>Oe()}},props:{unreadCount:{type:Number,default:0},peeks:{type:Array,default:()=>[]}},emits:["open","dismiss"],computed:{visiblePeeks(){return this.peeks.slice(0,Lc).reverse()}}},Bc=["aria-label","onClick","onKeydown"],Pc=["aria-label","onClick"],Nc={class:"wm-peek__avatar"},Fc=["aria-label"],Dc={class:"wm-peek__body"},jc={class:"wm-peek__head"},Uc={class:"wm-peek__name"},Hc={class:"wm-peek__action"},Vc={class:"wm-peek__text"},$c=["onClick"],Kc=["aria-label"],zc=["aria-label"];function qc(e,t,n,r,i,s){const o=ye("HumanAvatar");return h(),g("div",{class:"wm-launcherWrap",onMouseenter:t[1]||(t[1]=a=>e.$emit("hover",!0)),onMouseleave:t[2]||(t[2]=a=>e.$emit("hover",!1)),onFocusin:t[3]||(t[3]=a=>e.$emit("hover",!0)),onFocusout:t[4]||(t[4]=a=>e.$emit("hover",!1))},[ve(yo,{name:"wm-peek"},{default:Ks(()=>[s.visiblePeeks.length?(h(),g("div",{key:0,class:ee(["wm-peekStack",{"wm-peekStack--multi":s.visiblePeeks.length>1}])},[(h(!0),g(Q,null,Ae(s.visiblePeeks,(a,l)=>(h(),g("div",{key:a.convId,class:"wm-peek",style:Se({"--depth":s.visiblePeeks.length-1-l,zIndex:l+1}),role:"button",tabindex:"0","aria-label":s.t("launcher.openConversationWith",{name:a.senderName||s.t("launcher.theAgent")}),onClick:f=>e.$emit("open",a.convId),onKeydown:[Nn(dt(f=>e.$emit("open",a.convId),["prevent"]),["enter"]),Nn(dt(f=>e.$emit("open",a.convId),["prevent"]),["space"])]},[c("button",{type:"button",class:"wm-peek__close","aria-label":s.t("launcher.dismiss"),onClick:dt(f=>e.$emit("dismiss",a.convId),["stop"])},[...t[5]||(t[5]=[c("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"},[c("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Pc),c("div",Nc,[ve(o,{name:a.senderName,"avatar-url":a.senderAvatarUrl,size:34},null,8,["name","avatar-url"]),a.count>1?(h(),g("span",{key:0,class:"wm-peek__avatarBadge","aria-label":s.t("launcher.unreadMessages",{count:a.count})},I(a.count>9?"9+":a.count),9,Fc)):B("",!0)]),c("div",Dc,[c("div",jc,[c("span",Uc,I(a.senderName||s.t("common.agent")),1),c("span",Hc,I(s.t("launcher.repliedToYou")),1)]),c("p",Vc,I(a.preview),1)]),c("button",{type:"button",class:"wm-peek__open",onClick:dt(f=>e.$emit("open",a.convId),["stop"])},I(s.t("common.open")),9,$c)],44,Bc))),128))],2)):B("",!0)]),_:1}),c("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]=c("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"},[c("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(),g("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})},I(n.unreadCount>9?"9+":n.unreadCount),9,zc)):B("",!0)],8,Kc)],32)}const Wc=we(Rc,[["render",qc],["__scopeId","data-v-44ddf1a1"]]),Gc={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 Ys(this.name)},bgColor(){return Gs(this.name)}}},Yc={key:0,class:"wm-aiav__pulse"},Jc=["src","alt"],Xc=["width","height"];function Qc(e,t,n,r,i,s){return h(),g("div",{class:ee(["wm-aiav",{"wm-aiav--tail":n.tail}]),style:Se({width:n.size+"px",height:n.size+"px","--wm-avr":n.size*.32+"px"})},[n.pulse?(h(),g("div",Yc)):B("",!0),c("div",{class:ee(["wm-aiav__inner",{"wm-aiav__inner--glow":n.pulse,"wm-aiav__inner--img":!!n.imageUrl,"wm-aiav__inner--initials":!n.imageUrl&&!!s.initials}]),style:Se(!n.imageUrl&&s.initials?{background:s.bgColor}:null)},[n.imageUrl?(h(),g("img",{key:0,src:n.imageUrl,alt:n.name||""},null,8,Jc)):s.initials?(h(),g("span",{key:1,style:Se({fontSize:n.size*.36+"px"})},I(s.initials),5)):(h(),g("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]=[c("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),c("circle",{cx:"19",cy:"5",r:"1.5",fill:"white",opacity:"0.55"},null,-1),c("circle",{cx:"5",cy:"18",r:"1",fill:"white",opacity:"0.38"},null,-1)])],8,Xc))],6)],6)}const wn=we(Gc,[["render",Qc],["__scopeId","data-v-6f7f685d"]]),Zc={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":Gs(e.name||"")},initialsFor(e){return Ys(e.name||"")}}},eu={key:0,class:"wm-team"},tu=["src","alt"],nu={key:1},su={key:0,class:"wm-team__label"};function ru(e,t,n,r,i,s){return s.visible?(h(),g("div",eu,[c("div",{class:"wm-team__stack",style:Se({width:s.stackWidth+"px"})},[(h(!0),g(Q,null,Ae(n.members.slice(0,3),(o,a)=>(h(),g("div",{key:a,class:"wm-team__pill",style:Se({left:a*13+"px",zIndex:3-a,background:s.colorFor(o)})},[o.avatar_url?(h(),g("img",{key:0,src:o.avatar_url,alt:o.name||""},null,8,tu)):(h(),g("span",nu,I(s.initialsFor(o)),1))],4))),128))],4),n.responseLabel?(h(),g("span",su,I(n.responseLabel),1)):B("",!0)])):B("",!0)}const iu=we(Zc,[["render",ru],["__scopeId","data-v-e49a9063"]]),ou={name:"WmHeader",components:{AIAvatar:wn,TeamAvatars:iu},inject:{t:{default:()=>Oe()}},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}}},au={class:"wm-header"},lu=["aria-label"],cu={key:1,style:{width:"30px",height:"30px","flex-shrink":"0"}},uu={class:"wm-header__avatar"},du={class:"wm-header__main"},fu={class:"wm-header__title"},hu={key:3,class:"wm-header__fill"},mu={class:"wm-header__actions"},pu=["aria-label","title"],gu=["aria-label","title"];function _u(e,t,n,r,i,s){const o=ye("AIAvatar"),a=ye("TeamAvatars");return h(),g("div",au,[n.showBack?(h(),g("button",{key:0,type:"button",class:"wm-header__icon","aria-label":s.t("header.backToHome"),onClick:t[0]||(t[0]=l=>e.$emit("back"))},[...t[3]||(t[3]=[c("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"},[c("path",{d:"M19 12H5M12 5l-7 7 7 7"})],-1)])],8,lu)):(h(),g("div",cu)),n.showIdentity?(h(),g(Q,{key:2},[c("div",uu,[ve(o,{size:30,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),c("div",du,[c("div",fu,I(n.title),1)]),s.hasTeam?(h(),_e(a,{key:0,members:s.displayedTeamMembers,"response-label":""},null,8,["members"])):B("",!0)],64)):(h(),g("div",hu)),c("div",mu,[n.showMore?(h(),g("button",{key:0,type:"button",class:ee(["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]=[c("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[c("circle",{cx:"12",cy:"5",r:"1.6"}),c("circle",{cx:"12",cy:"12",r:"1.6"}),c("circle",{cx:"12",cy:"19",r:"1.6"})],-1)])],10,pu)):B("",!0),n.showClose?(h(),g("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]=[c("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"},[c("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,gu)):B("",!0)])])}const vu=we(ou,[["render",_u],["__scopeId","data-v-7af4c118"]]);function Co(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yu(e){return/^(https?:\/\/|mailto:|tel:)/i.test(String(e).trim())}const Wr="๎€€";function Zt(e){let t=e;const n=[];return t=t.replace(/`([^`\n]+)`/g,(r,i)=>{const s=n.length;return n.push(i),`${Wr}CODE${s}${Wr}`}),t=t.replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g,(r,i,s)=>yu(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 bu(e){if(!e)return"";const t=String(e).replace(/\[([^\]\n]+)\]\([^)\s]+\)/g,"$1");return Zt(Co(t))}function wu(e){if(!e)return"";const t=Co(e).split(`
71
72
  `),n=[];let r=0;for(;r<t.length;){const s=t[r];if(/^\s*```([\w-]*)\s*$/.exec(s)){r++;const f=[];for(;r<t.length&&!/^\s*```\s*$/.test(t[r]);)f.push(t[r]),r++;r<t.length&&r++,n.push({type:"block",html:`<pre class="wm-md-pre"><code>${f.join(`
72
- `)}</code></pre>`});continue}if(/^\s*[-*]\s+/.test(s)){const f=[];for(;r<t.length;){const g=/^\s*[-*]\s+(.*)$/.exec(t[r]);if(!g)break;f.push(g[1]),r++}const c=f.map(g=>`<li>${Zt(g)}</li>`).join("");n.push({type:"block",html:`<ul class="wm-md-ul">${c}</ul>`});continue}const a=/^\s*(\d+)\.\s+(.*)$/.exec(s);if(a){const f=parseInt(a[1],10),c=[a[2]];for(r++;r<t.length;){const k=/^\s*\d+\.\s+(.*)$/.exec(t[r]);if(!k)break;c.push(k[1]),r++}const g=c.map(k=>`<li>${Zt(k)}</li>`).join(""),A=f!==1?` start="${f}"`:"";n.push({type:"block",html:`<ol class="wm-md-ol"${A}>${g}</ol>`});continue}const l=/^(#{1,6})\s+(.*)$/.exec(s);if(l){const f=l[1].length;n.push({type:"block",html:`<h${f} class="wm-md-h wm-md-h${f}">${Zt(l[2])}</h${f}>`}),r++;continue}n.push({type:"text",html:Zt(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}const Gr={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"},ku={name:"WmOnboarding",components:{AIAvatar:wn,HumanAvatar:Xs},inject:{t:{default:()=>Ee()},wmLocale:{default:()=>()=>"fr"}},props:{welcomeMessage:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1}},emits:["start","select","resume"],data(){return{query:""}},computed:{heroTitle(){return this.welcomeMessage?this.welcomeMessage:this.agentName?this.t("onboarding.greetingNamed",{name:this.agentName}):this.t("onboarding.greeting")},heroSub(){return this.subtitle||this.t("onboarding.heroSub")},isOddQuickLinks(){return this.quickLinks.length%2===1},quickLinksLayout(){return this.isOddQuickLinks?"wm-onb__qlist":"wm-onb__grid"},filteredThreads(){const e=this.query.trim().toLowerCase();return e?this.openThreads.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.preview||"").toLowerCase().includes(e)):this.openThreads},unreadThreads(){return this.openThreads.filter(e=>e.unread)}},methods:{iconPath(e){return Gr[e]||Gr.link},renderPreview(e){return bu(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}:t!=null&&t.avatar_url||t!=null&&t.name?{size:40,name:t.name||"",imageUrl:t.avatar_url||null}:{size:40,name:"",imageUrl:this.defaultIconUrl}},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},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Vt(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"})}}},Cu={class:"wm-onb"},Su={class:"wm-onb__hero"},Au={class:"wm-onb__hero-text"},xu={class:"wm-onb__title"},Tu={class:"wm-onb__sub"},Mu={class:"wm-onb__cta"},Eu=["disabled"],Ou={key:0,class:"wm-onb__section wm-onb__section--card"},Iu={class:"wm-onb__section-title"},Lu=["onClick"],Ru={class:"wm-onb__card-icon"},Pu={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"},Bu=["d"],Nu={class:"wm-onb__card-body"},Fu={class:"wm-onb__card-title"},Du={key:0,class:"wm-onb__card-sub"},ju={key:1,class:"wm-onb__section wm-onb__section--card"},Uu={class:"wm-onb__section-title"},Hu={class:"wm-onb__alertList"},Vu=["onClick"],$u=["aria-label"],Ku={class:"wm-onb__alert-body"},zu={class:"wm-onb__alert-title"},qu=["innerHTML"],Wu={class:"wm-onb__alert-meta"},Gu={key:0,class:"wm-onb__alert-time"},Yu={class:"wm-onb__alert-resume"},Ju={key:2,class:"wm-onb__section wm-onb__section--card"},Xu={class:"wm-onb__section-title"},Qu={class:"wm-onb__search"},Zu=["placeholder","aria-label"],ed={class:"wm-onb__list"},td=["onClick"],nd=["aria-label"],sd={class:"wm-onb__thread-body"},rd={class:"wm-onb__thread-title"},id=["innerHTML"],od={class:"wm-onb__thread-meta"},ad={key:0,class:"wm-onb__thread-time"},ld={key:0,class:"wm-onb__empty"};function cd(e,t,n,r,i,s){const o=ye("AIAvatar");return m(),_("div",Cu,[u("div",Su,[t[2]||(t[2]=u("svg",{class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},[u("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"}),u("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"}),u("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"})],-1)),ve(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),u("div",Au,[u("div",xu,I(s.heroTitle),1),u("div",Tu,I(s.heroSub),1)])]),u("div",Mu,[u("button",{type:"button",class:"wm-onb__startBtn",disabled:n.busy,onClick:t[0]||(t[0]=a=>e.$emit("start"))},[t[3]||(t[3]=u("span",{class:"wm-onb__startIcon"},[u("svg",{width:"12",height:"12",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:"M12 5v14M5 12h14"})])],-1)),u("span",null,I(n.busy?"โ€ฆ":s.t("onboarding.start")),1)],8,Eu)]),n.quickLinks.length?(m(),_("div",Ou,[u("div",Iu,I(s.t("onboarding.quickAccess")),1),u("div",{class:ee(s.quickLinksLayout)},[(m(!0),_(Q,null,Se(n.quickLinks,(a,l)=>(m(),_("button",{key:l,type:"button",class:ee(["wm-onb__card",{"wm-onb__card--row":s.isOddQuickLinks}]),onClick:f=>e.$emit("select",a)},[u("span",Ru,[(m(),_("svg",Pu,[u("path",{d:s.iconPath(a.icon)},null,8,Bu)]))]),u("span",Nu,[u("span",Fu,I(a.label),1),a.description?(m(),_("span",Du,I(a.description),1)):B("",!0)])],10,Lu))),128))],2)])):B("",!0),s.unreadThreads.length?(m(),_("div",ju,[u("div",Uu,I(s.t("onboarding.unreadConversations")),1),u("div",Hu,[(m(!0),_(Q,null,Se(s.unreadThreads,a=>(m(),_("button",{key:a.id,type:"button",class:"wm-onb__alert",onClick:l=>e.$emit("resume",a)},[u("span",{class:ee(["wm-onb__alert-avatar",s.avatarWrapperClass(a)])},[(m(),_e(Ss(s.avatarComponent(a)),Es({ref_for:!0},s.avatarProps(a)),null,16)),u("span",{class:"wm-onb__alert-dot","aria-label":s.t("onboarding.unread")},null,8,$u)],2),u("span",Ku,[u("span",zu,I(a.title),1),u("span",{class:"wm-onb__alert-preview",innerHTML:s.renderPreview(a.preview)},null,8,qu)]),u("span",Wu,[s.formatTs(a._ts)?(m(),_("span",Gu,I(s.formatTs(a._ts)),1)):B("",!0),u("span",Yu,I(s.t("onboarding.resume")),1)])],8,Vu))),128))])])):B("",!0),n.openThreads.length?(m(),_("div",Ju,[u("div",Xu,I(s.t("onboarding.recentConversations")),1),u("div",Qu,[t[4]||(t[4]=u("span",{class:"wm-onb__searchIcon"},[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:"M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z"})])],-1)),it(u("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>i.query=a),type:"text",placeholder:s.t("onboarding.search"),"aria-label":s.t("onboarding.search")},null,8,Zu),[[Ot,i.query]])]),u("div",ed,[(m(!0),_(Q,null,Se(s.filteredThreads,a=>(m(),_("button",{key:a.id,type:"button",class:ee(["wm-onb__thread",{"wm-onb__thread--unread":a.unread}]),onClick:l=>e.$emit("resume",a)},[u("span",{class:ee(["wm-onb__thread-avatar",s.avatarWrapperClass(a)])},[(m(),_e(Ss(s.avatarComponent(a)),Es({ref_for:!0},s.avatarProps(a)),null,16)),a.unread?(m(),_("span",{key:0,class:"wm-onb__thread-dot","aria-label":s.t("onboarding.unread")},null,8,nd)):B("",!0)],2),u("span",sd,[u("span",rd,I(a.title),1),u("span",{class:"wm-onb__thread-preview",innerHTML:s.renderPreview(a.preview)},null,8,id)]),u("span",od,[s.formatTs(a._ts)?(m(),_("span",ad,I(s.formatTs(a._ts)),1)):B("",!0),t[5]||(t[5]=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-onb__thread-chev","aria-hidden":"true"},[u("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))])],10,td))),128)),s.filteredThreads.length?B("",!0):(m(),_("div",ld,I(s.t("onboarding.noResults",{query:i.query})),1))])])):B("",!0)])}const ud=we(ku,[["render",cd],["__scopeId","data-v-ee89cb1d"]]);function dd(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 fd={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return dd(this.detail)}}},hd={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"},pd={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"},gd={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"},_d={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"},vd={class:"wm-result__body"},yd={class:"wm-result__label"},bd={class:"wm-result__detail"};function wd(e,t,n,r,i,s){return m(),_("div",{class:ee(["wm-result",`wm-result--${n.state}`])},[u("span",hd,[n.state==="success"?(m(),_("svg",md,[...t[0]||(t[0]=[u("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(m(),_("svg",pd,[...t[1]||(t[1]=[u("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(m(),_("svg",gd,[...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)])])):(m(),_("svg",_d,[...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",vd,[u("span",yd,I(n.label),1),s.detailText?(m(),_(Q,{key:0},[t[4]||(t[4]=u("span",{class:"wm-result__sep","aria-hidden":"true"}," ยท ",-1)),u("span",bd,I(s.detailText),1)],64)):B("",!0)])],2)}const kd=we(fd,[["render",wd],["__scopeId","data-v-7284acd0"]]),Cd={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:[]}}},Sd={class:"wm-art wm-art--formResponse"},Ad={class:"wm-art__head"},xd={class:"wm-art__title"},Td={class:"wm-art__badge wm-art__badge--success"},Md={class:"wm-art__body"},Ed={class:"wm-art__fieldLabel"};function Od(e,t,n,r,i,s){return m(),_("div",Sd,[u("div",Ad,[u("div",xd,I(n.data.title||s.t("form.title")),1),u("span",Td,[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)),Xn(" "+I(s.t("form.sent")),1)])]),u("div",Md,[(m(!0),_(Q,null,Se(s.fields,(o,a)=>(m(),_("div",{key:a,class:"wm-art__field"},[u("div",Ed,I(o.label),1),u("div",{class:ee(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},I(o.value),3)]))),128))])])}const Id=we(Cd,[["render",Od],["__scopeId","data-v-713aecf1"]]),Ld={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}}},Rd={class:"wm-art wm-art--infoCard"},Pd={key:0,class:"wm-art__image"},Bd=["src","alt"],Nd={class:"wm-art__head"},Fd={class:"wm-art__headMain"},Dd={class:"wm-art__title"},jd={key:0,class:"wm-art__subtitle"},Ud={key:1,class:"wm-art__body"},Hd={key:0,class:"wm-art__text"},Vd={class:"wm-art__fieldLabel"};function $d(e,t,n,r,i,s){return m(),_("div",Rd,[n.data.image_url?(m(),_("figure",Pd,[u("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,Bd)])):B("",!0),u("div",Nd,[u("div",Fd,[u("div",Dd,I(n.data.title),1),n.data.subtitle?(m(),_("div",jd,I(n.data.subtitle),1)):B("",!0)]),n.data.badge&&n.data.badge.label?(m(),_("span",{key:0,class:ee(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},I(n.data.badge.label),3)):B("",!0)]),s.hasBody?(m(),_("div",Ud,[n.data.body?(m(),_("div",Hd,I(n.data.body),1)):B("",!0),s.fields.length?(m(!0),_(Q,{key:1},Se(s.fields,(o,a)=>(m(),_("div",{key:a,class:"wm-art__field"},[u("div",Vd,I(o.label),1),u("div",{class:ee(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},I(o.value),3)]))),128)):B("",!0)])):B("",!0)])}const Kd=we(Ld,[["render",$d],["__scopeId","data-v-7eae0e4a"]]);function zd(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 qd={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 zd((e=this.data)==null?void 0:e.created_at,Vt(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}}},Wd={class:"wm-art wm-art--ticket"},Gd={class:"wm-art__head wm-tk__head"},Yd={class:"wm-art__title wm-tk__title"},Jd={class:"wm-tk__sub"},Xd={class:"wm-tk__ref"},Qd={key:0,class:"wm-tk__text"},Zd={key:0,class:"wm-art__body"},ef={class:"wm-art__fieldLabel"},tf=["data-level"],nf={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"},sf={key:1,class:"wm-art__footer wm-tk__footer"};function rf(e,t,n,r,i,s){return m(),_("div",Wd,[u("div",Gd,[u("div",Yd,I(n.data.title),1),u("div",Jd,[u("div",Xd,[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,I(n.data.reference),1)]),u("span",{class:ee(["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)),Xn(" "+I(n.data.status.label),1)],2)]),n.data.body?(m(),_("div",Qd,I(n.data.body),1)):B("",!0)]),s.fields.length?(m(),_("div",Zd,[(m(!0),_(Q,null,Se(s.fields,(o,a)=>(m(),_("div",{key:a,class:"wm-art__field"},[u("div",ef,I(o.label),1),u("div",{class:ee(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(m(),_("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,tf)):s.isDate(o.label)?(m(),_("svg",nf,[...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)])])):B("",!0),u("span",null,I(o.value),1)],2)]))),128))])):B("",!0),n.data.created_at?(m(),_("div",sf,[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,I(s.formattedDate),1)])):B("",!0)])}const of=we(qd,[["render",rf],["__scopeId","data-v-5f30c914"]]),af={form_response:Id,info_card:Kd,ticket:of},lf={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&af[e]||null}}};function cf(e,t,n,r,i,s){return s.component?(m(),_e(Ss(s.component),{key:0,data:n.artifact.data},null,8,["data"])):B("",!0)}const uf=we(lf,[["render",cf]]),df={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()}}},ff=["href"],hf=["src","alt"],mf=["src"],pf=["src"],gf=["href","download"],_f={class:"wm-att__main"},vf={class:"wm-att__name"},yf={key:0,class:"wm-att__meta"},bf={key:0,class:"wm-att__spin","aria-hidden":"true"};function wf(e,t,n,r,i,s){return m(),_("div",{class:ee(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(m(),_("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,hf)],8,ff)):s.kind==="audio"&&i.url?(m(),_("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,mf)):s.kind==="video"&&i.url?(m(),_("video",{key:2,src:i.url,controls:"",preload:"metadata"},null,8,pf)):(m(),_("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",_f,[u("span",vf,I(s.displayName),1),s.sizeLabel?(m(),_("span",yf,I(s.sizeLabel),1)):B("",!0)]),i.loading?(m(),_("span",bf)):B("",!0)],8,gf))],2)}const kf=we(df,[["render",wf],["__scopeId","data-v-0c877a62"]]),Cf={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return wu(this.text)}}},Sf=["innerHTML"];function Af(e,t,n,r,i,s){return m(),_("div",{class:ee(["wm-bubble","wm-bubble--"+n.role])},[Ia(e.$slots,"default",{},()=>[u("span",{innerHTML:s.rendered},null,8,Sf)])],2)}const xf=we(Cf,[["render",Af],["__scopeId","data-v-7ab13147"]]),Tf={name:"WmTyping"},Mf={class:"wm-typing"};function Ef(e,t,n,r,i,s){return m(),_("div",Mf,[...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 Of=we(Tf,[["render",Ef],["__scopeId","data-v-df2447fd"]]);function Tt(e){return e?e.client_msg_id||e.id:""}const If={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",reopened:"system.reopened",idle:"system.idle"},Lf=80,Rf=200,Pf={name:"WmMessageList",components:{AIAvatar:wn,HumanAvatar:Xs,Bubble:xf,Typing:Of,ActionResult:kd,AttachmentPreview:kf,ArtifactRenderer:uf},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;const e=[];for(const o of this.messages){const a=this.roleOf(o);if(a==="system"){if(((n=o==null?void 0:o.payload)==null?void 0:n.event)==="action_admin_pending"){const c=e[e.length-1];c&&c.role==="ai"?c.messages.push(o):e.push({key:`g-${Tt(o)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[o],items:[]});continue}e.push({key:`sys-${Tt(o)}`,role:a,messages:[o],items:[],systemLabel:this.systemLabel(o)});continue}const l=e[e.length-1];l&&l.role===a&&(a==="ai"||l.agentName===(((r=o==null?void 0:o.author)==null?void 0:r.name)||""))?l.messages.push(o):e.push({key:`g-${Tt(o)}`,role:a,agentName:((i=o==null?void 0:o.author)==null?void 0:i.name)||"",agentAvatarUrl:((s=o==null?void 0:o.author)==null?void 0:s.avatar_url)||null,messages:[o],items:[]})}for(const o of e){if(o.role==="system")continue;const a=[];for(const l of o.messages)for(const f of this.itemsOf(l))a.push(f);o.items=a}const t=[];for(const o of e){if(o.role!=="system"&&!o.items.length)continue;const a=t[t.length-1];if(a&&a.role!=="system"&&a.role===o.role&&(o.role==="ai"||a.agentName===o.agentName)){a.messages.push(...o.messages),a.items.push(...o.items);continue}t.push(o)}for(const o of t)o.role!=="system"&&(o.key=this.stableGroupKey(o.messages));return t},unreadGroupKey(){if(this.unreadAnchorId==null)return null;const e=this.unreadAnchorId,t=this.unreadBoundaryTs;for(const n of this.groups){if(n.role==="user"||n.role==="system"||!n.items.length)continue;const r=n.messages[0];if(!r)continue;const i=ut(r.id);if(i!=null&&!(i<=e)&&!(t&&r.created_at&&r.created_at>t))return n.key}return null}},watch:{messages:{handler:"snapshotAndRestore",deep:!0},conversationId(e,t){e!==t&&(this._groupIdByMsgKey=null,this.silentFades=!1)},loadingMore(e){e||(this._pendingLoadMore=!1),e&&(this.silentFades=!0),this.snapshotAndRestore()},streamingActive:"snapshotAndRestore"},mounted(){this._lastSeenConvId=this.conversationId,this.scrollToBottom(),this._measureFrame=null,this._ro=new ResizeObserver(()=>this.scheduleMeasure()),this.$refs.scrollEl&&this._ro.observe(this.$refs.scrollEl),this.$nextTick(()=>this.measureRows())},beforeUnmount(){var e;(e=this._ro)==null||e.disconnect(),this._measureFrame&&cancelAnimationFrame(this._measureFrame),this._pressTimer&&clearTimeout(this._pressTimer)},updated(){this.scheduleMeasure()},methods:{messageKey:Tt,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=Tt(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Tt(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Lf},onScroll(){const e=this.$refs.scrollEl;e&&(this.showScrollDown=!this.isAtBottom(e),!(this.loadingMore||!this.hasMore)&&(this._pendingLoadMore||e.scrollTop<=Rf&&(this._pendingLoadMore=!0,this.$emit("load-more"))))},snapshotAndRestore(){const e=this.$refs.scrollEl;if(!e||this._scrollSnap)return;const t=this._lastSeenConvId!==this.conversationId;this._lastSeenConvId=this.conversationId;const n=this.isAtBottom(e);let r=null;if(!t&&!n){const s=this.pickAnchor(e);if(s!=null&&s.rowKey){const o=this.findRowByKey(e,s.rowKey);if(o){const a=e.getBoundingClientRect().top;r={rowKey:s.rowKey,relY:o.getBoundingClientRect().top-a}}}}const i={forceBottom:t,wasPinned:n,anchor:r};this._scrollSnap=i,this.$nextTick(()=>{if(this._scrollSnap=null,i.forceBottom||i.wasPinned){e.scrollTop=e.scrollHeight;return}if(!i.anchor)return;const s=()=>{const o=i.anchor,a=this.findRowByKey(e,o.rowKey);if(!a)return;const f=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(f)>.5&&(e.scrollTop+=f)};s(),requestAnimationFrame(()=>{s(),requestAnimationFrame(s)})})},pickAnchor(e){const t=e.getBoundingClientRect().top,n=e.querySelectorAll(".wm-list__row[data-row-key]");let r=null;for(const i of n)if(r||(r=i),i.getBoundingClientRect().bottom>=t)return{rowKey:i.dataset.rowKey};return r?{rowKey:r.dataset.rowKey}:null},findRowByKey(e,t){if(!t)return null;const n=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&");return e.querySelector(`.wm-list__row[data-row-key="${n}"]`)},roleOf(e){var n,r;if((e==null?void 0:e.type)==="system"||((n=e==null?void 0:e.payload)==null?void 0:n.type)==="system")return"system";const t=(r=e==null?void 0:e.author)==null?void 0:r.type;return t==="user"?"user":t==="agent_human"?"human":"ai"},roleLabel(e){if(e.role==="human")return e.agentName||this.t("common.agent");const t=this.t("common.aiAssistant");return this.aiAgentName?`${this.aiAgentName} โ€ข ${t}`:t},itemsOf(e){var t;if(!e)return[];if(e.type==="system"&&((t=e==null?void 0:e.payload)==null?void 0:t.event)==="action_admin_pending")return[{message:e,partKey:"main",renderAs:"admin-pending",kind:{top:"bubble",bottom:"bubble"}}];if(e.type==="action"&&e.payload&&e.payload.state!=="pending"){const n=[{message:e,partKey:"main",renderAs:"action",kind:{top:"bubble",bottom:"bubble"}}];return this.actionArtifact(e)&&n.push({message:e,partKey:"artifact",renderAs:"artifact-of-action",kind:{top:"card",bottom:"card"}}),n}return this.artifactOf(e)?[{message:e,partKey:"main",renderAs:"artifact",kind:{top:"card",bottom:"card"}}]:e.text_md||this.attachmentsOf(e).length?[{message:e,partKey:"main",renderAs:"bubble",kind:{top:"bubble",bottom:"bubble"}}]:[]},cornersFor(e,t){var H,se,ge;const n=e.items,r=(H=n[t])==null?void 0:H.kind,i=(se=n[t-1])==null?void 0:se.kind,s=(ge=n[t+1])==null?void 0:ge.kind,o=e.role==="user",a=14,l=4,f=i==null?void 0:i.bottom,c=s==null?void 0:s.top,g=this.widthByKey[this.rowKeyOf(e,t)],A=this.widthByKey[this.rowKeyOf(e,t-1)],k=this.widthByKey[this.rowKeyOf(e,t+1)],$=.5,T=(he,ke,G)=>he!=null&&g!=null?he+$>=g:ke===G||ke==="card"&&G==="bubble";let J=a,U=a,q=a,Z=a;return o?(f&&(U=l),(c||!s)&&(q=l),f&&T(A,f,r==null?void 0:r.top)&&(J=l),c&&T(k,c,r==null?void 0:r.bottom)&&(Z=l)):(f&&(J=l),(c||!s)&&(Z=l),f&&T(A,f,r==null?void 0:r.top)&&(U=l),c&&T(k,c,r==null?void 0:r.bottom)&&(q=l)),{tl:J,tr:U,br:q,bl:Z}},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?`${Tt(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 Ls(new Date(e.created_at),Vt(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 Ls(new Date(n.created_at),Vt(this.wmLocale()))}catch{return""}},hasTrailingOverlay(e){if(!e.messages.length)return!1;const t=e.messages[e.messages.length-1],n=e.items[e.items.length-1];return!!t&&(n==null?void 0:n.message)!==t},attachmentsOf(e){var n;const t=(n=e==null?void 0:e.payload)==null?void 0:n.attachments;return Array.isArray(t)?t:[]},artifactOf(e){var n;const t=(n=e==null?void 0:e.metadata)==null?void 0:n.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},actionLabel(e){var t;return((t=e==null?void 0:e.payload)==null?void 0:t.name)||(e==null?void 0:e.text_md)||this.t("common.action")},actionDetail(e){var n,r,i,s,o,a;const t=e==null?void 0:e.payload;return t?t.state==="success"?((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"":t.state==="rejected"?((s=t.rejected)==null?void 0:s.reason)||this.t("action.rejectedByUser"):t.state==="failure"&&(((o=t.failure)==null?void 0:o.summary)||((a=t.failure)==null?void 0:a.error))||"":""},actionArtifact(e){var n,r;const t=(r=(n=e==null?void 0:e.payload)==null?void 0:n.success)==null?void 0:r.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},systemLabel(e){var i,s,o;const t=(i=e==null?void 0:e.payload)==null?void 0:i.event,n=If[t],r=((s=e==null?void 0:e.metadata)==null?void 0:s.agent_name)||((o=e==null?void 0:e.author)==null?void 0:o.name)||this.t("messageList.anAgent");return n?this.t(n,{name:r}):(e==null?void 0:e.text_md)||this.t("messageList.conversationUpdate")},scrollToBottom(){const e=this.$refs.scrollEl;e&&(e.scrollTop=e.scrollHeight),this.showScrollDown=!1},scrollToBottomSmooth(){const e=this.$refs.scrollEl;e&&(typeof e.scrollTo=="function"?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight,this.showScrollDown=!1)}}},Bf={class:"wm-list__wrap"},Nf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Ff={class:"wm-list__loadMore-lbl"},Df={key:1,class:"wm-list__historyEnd"},jf={key:2,class:"wm-list__sep"},Uf={class:"wm-list__sep-label"},Hf={key:0,class:"wm-list__sep wm-list__sep--unread"},Vf={class:"wm-list__sep-label wm-list__sep-label--unread"},$f={key:0,class:"wm-list__sysep"},Kf={class:"wm-list__sysep-label"},zf=["data-row-key","onPointerdown"],qf={key:0,class:"wm-list__avatarSlot"},Wf={key:5,class:"wm-list__body"},Gf={key:0},Yf={key:1,"aria-hidden":"true"},Jf={key:2},Xf={key:0},Qf={key:1,"aria-hidden":"true"},Zf={key:2},eh={key:3,class:"wm-list__row wm-list__row--ai fade-up"},th={class:"wm-list__avatarSlot"},nh=["aria-label","title"];function sh(e,t,n,r,i,s){const o=ye("AIAvatar"),a=ye("HumanAvatar"),l=ye("ActionResult"),f=ye("ArtifactRenderer"),c=ye("Bubble"),g=ye("AttachmentPreview"),A=ye("Typing");return m(),_("div",Bf,[u("div",{ref:"scrollEl",class:ee(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[4]||(t[4]=(...k)=>s.onScroll&&s.onScroll(...k))},[n.loadingMore?(m(),_("div",Nf,[t[6]||(t[6]=u("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),u("span",Ff,I(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(m(),_("div",Df,I(s.t("messageList.conversationStart")),1)):B("",!0),n.dateLabel?(m(),_("div",jf,[t[7]||(t[7]=u("div",{class:"wm-list__line"},null,-1)),u("span",Uf,I(n.dateLabel),1),t[8]||(t[8]=u("div",{class:"wm-list__line"},null,-1))])):B("",!0),(m(!0),_(Q,null,Se(s.groups,(k,$)=>(m(),_(Q,{key:k.key},[k.key===s.unreadGroupKey?(m(),_("div",Hf,[t[9]||(t[9]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),u("span",Vf,I(s.t("messageList.unread")),1),t[10]||(t[10]=u("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):B("",!0),k.role==="system"||k.items.length?(m(),_("div",{key:1,class:ee(["wm-list__group","wm-list__group--"+k.role])},[k.role==="system"?(m(),_("div",$f,[t[11]||(t[11]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),u("span",Kf,I(k.systemLabel),1),t[12]||(t[12]=u("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(m(),_(Q,{key:1},[(m(!0),_(Q,null,Se(k.items,(T,J)=>(m(),_(Q,{key:`${s.messageKey(T.message)}-${T.partKey}`},[u("div",{"data-row-key":`${s.messageKey(T.message)}-${T.partKey}`,class:ee(["wm-list__row fade-up",["wm-list__row--"+k.role,{"is-pending":T.message._pending,"is-failed":T.message._failed}]]),style:Fe(s.cornersStyle(k,J)),onPointerdown:U=>s.onPressStart(`${s.messageKey(T.message)}-${T.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]=dt(()=>{},["prevent"]))},[k.role!=="user"?(m(),_("div",qf,[J===k.items.length-1?(m(),_(Q,{key:0},[k.role==="ai"?(m(),_e(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(m(),_e(a,{key:1,name:k.agentName,"avatar-url":k.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):B("",!0)])):B("",!0),T.renderAs==="action"?(m(),_e(l,{key:1,state:T.message.payload.state,label:s.actionLabel(T.message),detail:s.actionDetail(T.message)},null,8,["state","label","detail"])):T.renderAs==="admin-pending"?(m(),_e(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:T.message.text_md||""},null,8,["label","detail"])):T.renderAs==="artifact-of-action"?(m(),_e(f,{key:3,artifact:s.actionArtifact(T.message)},null,8,["artifact"])):T.renderAs==="artifact"?(m(),_e(f,{key:4,artifact:s.artifactOf(T.message)},null,8,["artifact"])):(m(),_("div",Wf,[T.message.text_md?(m(),_e(c,{key:0,role:k.role,text:T.message.text_md},null,8,["role","text"])):B("",!0),s.attachmentsOf(T.message).length?(m(),_("div",{key:1,class:ee(["wm-list__atts",{"wm-list__atts--align-end":k.role==="user"}])},[(m(!0),_(Q,null,Se(s.attachmentsOf(T.message),(U,q)=>(m(),_e(g,{key:`${s.messageKey(T.message)}-att-${q}`,attachment:U},null,8,["attachment"]))),128))],2)):B("",!0)]))],46,zf),J<k.items.length-1&&i.pressedItemKey===`${s.messageKey(T.message)}-${T.partKey}`&&(k.role!=="user"||s.timeOf(T.message))?(m(),_("div",{key:0,class:ee(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":k.role==="user"}])},[k.role!=="user"?(m(),_("span",Gf,I(s.roleLabel(k)),1)):B("",!0),k.role!=="user"&&s.timeOf(T.message)?(m(),_("span",Yf,"ยท")):B("",!0),s.timeOf(T.message)?(m(),_("span",Jf,I(s.timeOf(T.message)),1)):B("",!0)],2)):B("",!0)],64))),128)),(k.role!=="user"||s.lastTimeOf(k))&&!s.hasTrailingOverlay(k)?(m(),_("div",{key:0,class:ee(["wm-list__meta",{"wm-list__meta--right":k.role==="user"}])},[k.role!=="user"?(m(),_("span",Xf,I(s.roleLabel(k)),1)):B("",!0),k.role!=="user"&&s.lastTimeOf(k)?(m(),_("span",Qf,"ยท")):B("",!0),s.lastTimeOf(k)?(m(),_("span",Zf,I(s.lastTimeOf(k)),1)):B("",!0)],2)):B("",!0)],64))],2)):B("",!0)],64))),128)),n.streamingActive?(m(),_("div",eh,[u("div",th,[ve(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),ve(A)])):B("",!0)],34),ve(yo,{name:"wm-scrollDown"},{default:Ks(()=>[i.showScrollDown?(m(),_("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]=(...k)=>s.scrollToBottomSmooth&&s.scrollToBottomSmooth(...k))},[...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,nh)):B("",!0)]),_:1})])}const rh=we(Pf,[["render",sh],["__scopeId","data-v-9ddbd0e3"]]),Fn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",Qs=typeof window<"u"&&typeof window.MediaRecorder<"u";function ih(){return Qs&&["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 So({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function oh(){if(!Fn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(So({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await ah(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function ah(e){const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.srcObject=e,await t.play(),await new Promise(a=>requestAnimationFrame(a));const n=t.videoWidth||1280,r=t.videoHeight||720,i=document.createElement("canvas");i.width=n,i.height=r,i.getContext("2d").drawImage(t,0,0,n,r);const s=await new Promise((a,l)=>{i.toBlob(f=>f?a(f):l(new Error("toBlob failed")),"image/png")}),o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);return new File([s],`capture-${o}.png`,{type:"image/png"})}async function lh(e={}){var f;if(!Fn||!Qs)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(So({audio:!0}))}catch(c){return(c==null?void 0:c.name)!=="NotAllowedError"&&console.error("[media] record picker",c),null}const n=ih();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(g=>{g.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,g;if(s&&clearInterval(s),t.getTracks().forEach(A=>{A.stop()}),i.length){const A=r.mimeType||n||"video/webm",k=new Blob(i,{type:A}),$=/mp4/.test(A)?"mp4":"webm",T=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),J=new File([k],`ecran-${T}.${$}`,{type:A});(c=e.onfinalize)==null||c.call(e,J)}else(g=e.oncancel)==null||g.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(g=>{g.stop()}),null}(f=e.onstart)==null||f.call(e);const l=Date.now();return s=setInterval(()=>{var c;(c=e.ontick)==null||c.call(e,Date.now()-l)},500),{stop:a,get state(){return r.state}}}const 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"}],uh={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"],data(){return{local:this.modelValue,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null,kbOffset:0}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},attachItems(){return ch.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!Fn||e.action==="record"&&(!Fn||!Qs)}))},recordingElapsedLabel(){const e=Math.floor(this.recordingElapsed/1e3),t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}},watch:{modelValue(e){e!==this.local&&(this.local=e,this.$nextTick(()=>this.autosize()))},local(e){this.$emit("update:modelValue",e)}},mounted(){this.autosize(),this.displayMode==="sheet"&&this.setupKeyboardTracking()},beforeUnmount(){if(this.recorder)try{this.recorder.stop()}catch{}this.teardownKeyboardTracking()},methods:{focus(){const e=this.$refs.inputEl;if(!(!e||this.disabled))try{e.focus({preventScroll:!0})}catch{e.focus()}},onSubmit(){if(!this.canSend)return;const e=this.local.trim();this.local="",this.$emit("send",e),this.$nextTick(()=>this.autosize())},onKeydown(e){e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&(e.preventDefault(),this.onSubmit())},autosize(){const e=this.$refs.inputEl;e&&(e.clientWidth<80||(e.style.height="auto",e.style.height=`${e.scrollHeight}px`))},onFile(e){const t=Array.from(e.target.files||[]);for(const n of t)this.$emit("attach",n);e.target.value=""},onAttachAction(e){this.attachOpen=!1,e==="file"?this.pickFile():e==="screenshot"?this.captureScreenshot():e==="record"&&this.startRecording()},pickFile(){var e;(e=this.$refs.fileEl)==null||e.click()},async captureScreenshot(){if(this.disabled)return;const e=await oh();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await lh({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)}}},dh={key:0,class:"wm-rec"},fh={class:"wm-rec__lbl"},hh={key:1,class:"wm-compose__menu",role:"menu"},mh=["disabled","onClick"],ph={class:"wm-compose__menuIcon"},gh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},_h=["d"],vh=["placeholder","disabled"],yh={class:"wm-compose__actions"},bh=["title","aria-label","disabled"],wh=["disabled","aria-label"];function kh(e,t,n,r,i,s){return m(),_("div",{class:ee(["wm-compose-wrap",{"wm-compose-wrap--sheet":n.displayMode==="sheet"}]),style:Fe(i.kbOffset?{transform:`translateY(-${i.kbOffset}px)`}:null)},[i.recording?(m(),_("div",dh,[t[8]||(t[8]=u("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),u("span",fh,I(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))},I(s.t("composer.stop")),1)])):B("",!0),u("form",{class:ee(["wm-compose",{"has-attach":i.attachOpen}]),onSubmit:t[7]||(t[7]=dt((...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?(m(),_("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):B("",!0),i.attachOpen?(m(),_("div",hh,[(m(!0),_(Q,null,Se(s.attachItems,o=>(m(),_("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[u("span",ph,[(m(),_("svg",gh,[u("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,_h)]))]),u("span",null,I(o.label),1)],8,mh))),128))])):B("",!0),it(u("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"3",placeholder:n.placeholder,disabled:n.disabled,onKeydown:t[4]||(t[4]=(...o)=>s.onKeydown&&s.onKeydown(...o)),onInput:t[5]||(t[5]=(...o)=>s.autosize&&s.autosize(...o))},null,40,vh),[[Ot,i.local]]),u("div",yh,[u("button",{type:"button",class:ee(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onClick:t[6]||(t[6]=o=>i.attachOpen=!i.attachOpen)},[...t[9]||(t[9]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)])],10,bh),u("button",{type:"submit",class:ee(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[10]||(t[10]=[u("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],10,wh)])],34)],6)}const Ch=we(uh,[["render",kh],["__scopeId","data-v-01e81a27"]]),Sh={name:"WmSuggestionChips",props:{items:{type:Array,default:()=>[]},baseDelay:{type:Number,default:360},stepDelay:{type:Number,default:90}},emits:["select"],computed:{batchKey(){return this.items.map(e=>(e==null?void 0:e.label)||(e==null?void 0:e.text)||"").join("ยง")}}},Ah=["onClick"];function xh(e,t,n,r,i,s){return n.items.length?(m(),_("div",{key:s.batchKey,class:"wm-chips"},[(m(!0),_(Q,null,Se(n.items,(o,a)=>(m(),_("button",{key:a,type:"button",class:"wm-chip",style:Fe({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},I(o.label),13,Ah))),128))])):B("",!0)}const Th=we(Sh,[["render",xh],["__scopeId","data-v-47ad8085"]]),Mh={name:"WmApprovalCard",components:{AIAvatar:wn},inject:{t:{default:()=>Ee()}},props:{action:{type:String,required:!0},detail:{type:String,default:""},callbacks:{type:Array,default:()=>[]},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["callback"],computed:{approveCallback(){return this.callbacks.find(e=>e.id==="approve"||e.style==="primary")||this.callbacks[0]},rejectCallback(){return this.callbacks.find(e=>e.id==="reject"||e.style==="danger"||e.style==="neutral")||(this.callbacks.length>1?this.callbacks[1]:null)},approveId(){var e;return(e=this.approveCallback)==null?void 0:e.id},rejectId(){var e;return(e=this.rejectCallback)==null?void 0:e.id},approveLabel(){var e;return((e=this.approveCallback)==null?void 0:e.label)||this.t("approval.approve")},rejectLabel(){var e;return((e=this.rejectCallback)==null?void 0:e.label)||this.t("approval.reject")}}},Eh={class:"wm-approval"},Oh={class:"wm-approval__head"},Ih={class:"wm-approval__icon"},Lh={class:"wm-approval__main"},Rh={class:"wm-approval__title"},Ph={key:0,class:"wm-approval__detail"},Bh={class:"wm-approval__actions"};function Nh(e,t,n,r,i,s){const o=ye("AIAvatar");return m(),_("div",Eh,[u("div",Oh,[u("div",Ih,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",Lh,[u("div",Rh,I(n.action),1),n.detail?(m(),_("div",Ph,I(n.detail),1)):B("",!0)])]),u("div",Bh,[s.rejectId?(m(),_("button",{key:0,type:"button",class:"wm-approval__btn wm-approval__btn--neutral",onClick:t[0]||(t[0]=a=>e.$emit("callback",s.rejectId))},I(s.rejectLabel),1)):B("",!0),s.approveId?(m(),_("button",{key:1,type:"button",class:"wm-approval__btn wm-approval__btn--primary",onClick:t[1]||(t[1]=a=>e.$emit("callback",s.approveId))},I(s.approveLabel),1)):B("",!0)])])}const Fh=we(Mh,[["render",Nh],["__scopeId","data-v-a2bed37e"]]);let Yr=0;const Dh=new Set(["text","textarea","number","boolean","select","multiselect","date"]),jh={name:"WmFormCard",components:{AIAvatar:wn},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 Yr+=1,{_uid:Yr,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)||!Dh.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}}}},Uh={class:"wm-form"},Hh={class:"wm-form__head"},Vh={class:"wm-form__icon"},$h={class:"wm-form__main"},Kh={class:"wm-form__title"},zh={key:0,class:"wm-form__detail"},qh=["for"],Wh={key:0,class:"wm-form__req","aria-hidden":"true"},Gh=["id","onUpdate:modelValue","placeholder","required","disabled"],Yh=["id","onUpdate:modelValue","placeholder","required","disabled"],Jh=["id","onUpdate:modelValue","placeholder","required","disabled"],Xh=["id","onUpdate:modelValue","required","disabled"],Qh={key:4,class:"wm-form__bool"},Zh=["id","onUpdate:modelValue","disabled"],em=["id","onUpdate:modelValue","required","disabled"],tm={value:"",disabled:""},nm=["value"],sm={key:6,class:"wm-form__multi"},rm=["value","checked","disabled","onChange"],im={key:0,class:"wm-form__err"},om=["disabled"],am={key:0,class:"wm-form__spinner","aria-hidden":"true"},lm={key:2,class:"wm-form__doneLbl"};function cm(e,t,n,r,i,s){const o=ye("AIAvatar");return m(),_("div",Uh,[u("div",Hh,[u("div",Vh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),u("div",$h,[u("div",Kh,I(n.form.title||s.t("form.title")),1),n.form.description?(m(),_("div",zh,I(n.form.description),1)):B("",!0)])]),u("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=dt((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(m(!0),_(Q,null,Se(s.normalizedFields,a=>(m(),_("div",{key:a.key,class:"wm-form__field"},[u("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[Xn(I(a.label),1),a.required?(m(),_("span",Wh,"*")):B("",!0)],8,qh),a.type==="text"?it((m(),_("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,Gh)),[[Ot,i.values[a.key]]]):a.type==="textarea"?it((m(),_("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,Yh)),[[Ot,i.values[a.key]]]):a.type==="number"?it((m(),_("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,Jh)),[[Ot,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?it((m(),_("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,Xh)),[[Ot,i.values[a.key]]]):a.type==="boolean"?(m(),_("label",Qh,[it(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,Zh),[[zl,i.values[a.key]]]),u("span",null,I(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?it((m(),_("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",tm,I(a.placeholder||s.t("form.choose")),1),(m(!0),_(Q,null,Se(a.options,l=>(m(),_("option",{key:l.value,value:l.value},I(l.label),9,nm))),128))],8,em)),[[ql,i.values[a.key]]]):a.type==="multiselect"?(m(),_("div",sm,[(m(!0),_(Q,null,Se(a.options,l=>(m(),_("label",{key:l.value,class:"wm-form__multiItem"},[u("input",{type:"checkbox",value:l.value,checked:Array.isArray(i.values[a.key])&&i.values[a.key].includes(l.value),disabled:n.readOnly||i.busy,onChange:f=>s.toggleMulti(a.key,l.value,f.target.checked)},null,40,rm),u("span",null,I(l.label),1)]))),128))])):B("",!0)]))),128)),i.error?(m(),_("div",im,I(i.error),1)):B("",!0),n.readOnly?(m(),_("div",lm,I(s.t("form.responseSent")),1)):(m(),_("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(m(),_("span",am)):B("",!0),u("span",null,I(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,om))],32)])}const um=we(jh,[["render",cm],["__scopeId","data-v-fe65cc56"]]),dm={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})}}},fm={class:"wm-fb"},hm={class:"wm-fb__title"},mm={class:"wm-fb__sub"},pm={class:"wm-fb__row"},gm=["onClick"],_m={class:"wm-fb__emoji"},vm={class:"wm-fb__label"},ym=["disabled"],bm={key:1,class:"wm-fb__done"},wm={class:"wm-fb__doneTitle"},km={class:"wm-fb__doneSub"};function Cm(e,t,n,r,i,s){return m(),_("div",fm,[n.done?(m(),_("div",bm,[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",wm,I(s.t("feedback.doneTitle")),1),u("div",km,I(s.t("feedback.doneSubtitle")),1)])):(m(),_(Q,{key:0},[u("div",hm,I(s.t("feedback.question")),1),u("div",mm,I(s.t("feedback.subtitle")),1),u("div",pm,[(m(!0),_(Q,null,Se(s.options,o=>(m(),_("button",{key:o.v,type:"button",class:ee(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[u("span",_m,I(o.e),1),u("span",vm,I(o.l),1)],10,gm))),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))},I(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,ym)],64))])}const Sm=we(dm,[["render",Cm],["__scopeId","data-v-9b630564"]]),Am={name:"WmMoreMenu",inject:{t:{default:()=>Ee()}},props:{canRename:{type:Boolean,default:!0},canExport:{type:Boolean,default:!0},soundEnabled:{type:Boolean,default:!0},browserNotifEnabled:{type:Boolean,default:!1},statusUrl:{type:String,default:""},helpUrl:{type:String,default:""}},emits:["close","action","sound-toggle","browser-notif-toggle"],data(){return{soundOn:this.soundEnabled,browserNotifOn:this.browserNotifEnabled}},watch:{soundEnabled(e){this.soundOn=!!e},browserNotifEnabled(e){this.browserNotifOn=!!e}},methods:{emit(e){this.$emit("action",e)},toggleSound(){this.soundOn=!this.soundOn,this.$emit("sound-toggle",this.soundOn)},toggleBrowserNotif(){this.browserNotifOn=!this.browserNotifOn,this.$emit("browser-notif-toggle",this.browserNotifOn)}}},xm={class:"wm-mm"},Tm={class:"wm-mm__pop",role:"menu"},Mm={key:0,class:"wm-mm__section"},Em={class:"wm-mm__label"},Om={class:"wm-mm__label"},Im={key:1,class:"wm-mm__sep"},Lm={class:"wm-mm__section"},Rm={class:"wm-mm__label"},Pm={class:"wm-mm__label"},Bm={class:"wm-mm__section"},Nm={class:"wm-mm__label"},Fm={class:"wm-mm__label"};function Dm(e,t,n,r,i,s){return m(),_("div",xm,[u("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Tm,[n.canRename||n.canExport?(m(),_("div",Mm,[n.canRename?(m(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[1]||(t[1]=o=>s.emit("rename"))},[t[7]||(t[7]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M12 20h9"}),u("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})])],-1)),u("span",Em,I(s.t("moreMenu.editTitle")),1)])):B("",!0),n.canExport?(m(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[2]||(t[2]=o=>s.emit("export"))},[t[8]||(t[8]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13"})])],-1)),u("span",Om,I(s.t("moreMenu.exportTranscript")),1),t[9]||(t[9]=u("span",{class:"wm-mm__hint"},".txt",-1))])):B("",!0)])):B("",!0),n.canRename||n.canExport?(m(),_("div",Im)):B("",!0),u("div",Lm,[u("button",{type:"button",class:"wm-mm__item",onClick:t[3]||(t[3]=(...o)=>s.toggleSound&&s.toggleSound(...o))},[t[11]||(t[11]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),u("path",{d:"M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14"})])],-1)),u("span",Rm,I(s.t("moreMenu.sound")),1),u("span",{class:ee(["wm-mm__toggle",{"wm-mm__toggle--on":i.soundOn}])},[...t[10]||(t[10]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)]),u("button",{type:"button",class:"wm-mm__item",onClick:t[4]||(t[4]=(...o)=>s.toggleBrowserNotif&&s.toggleBrowserNotif(...o))},[t[13]||(t[13]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0"})])],-1)),u("span",Pm,I(s.t("moreMenu.browserNotifications")),1),u("span",{class:ee(["wm-mm__toggle",{"wm-mm__toggle--on":i.browserNotifOn}])},[...t[12]||(t[12]=[u("span",{class:"wm-mm__knob"},null,-1)])],2)])]),t[16]||(t[16]=u("div",{class:"wm-mm__sep"},null,-1)),u("div",Bm,[n.statusUrl?(m(),_("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[5]||(t[5]=o=>s.emit("status"))},[t[14]||(t[14]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2"})])],-1)),u("span",Nm,I(s.t("moreMenu.serviceStatus")),1)])):B("",!0),n.helpUrl?(m(),_("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[6]||(t[6]=o=>s.emit("help"))},[t[15]||(t[15]=u("span",{class:"wm-mm__icon"},[u("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M9 11a3 3 0 116 0c0 2-3 2-3 5M12 19h.01M12 22a10 10 0 110-20 10 10 0 010 20z"})])],-1)),u("span",Fm,I(s.t("moreMenu.helpCenter")),1)])):B("",!0)])])])}const jm=we(Am,[["render",Dm],["__scopeId","data-v-76281e95"]]),Um={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())}}},Hm={class:"wm-dialog"},Vm={class:"wm-dialog__card",role:"dialog","aria-modal":"true"},$m={class:"wm-dialog__head"},Km={class:"wm-dialog__title"},zm=["aria-label"],qm={class:"wm-dialog__body"},Wm=["placeholder"],Gm={class:"wm-dialog__actions"},Ym=["disabled"];function Jm(e,t,n,r,i,s){return m(),_("div",Hm,[u("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),u("div",Vm,[u("div",$m,[u("div",Km,I(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,zm)]),u("div",qm,[it(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]=Nn(dt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Nn(dt(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Wm),[[Ot,i.value]])]),u("div",Gm,[u("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},I(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))},I(s.t("common.save")),9,Ym)])])])}const Xm=we(Um,[["render",Jm],["__scopeId","data-v-6d5f94a8"]]),Jr="ww-messenger-tokens",Qm={name:"Messenger",components:{Launcher:Wc,Header:vu,Onboarding:ud,MessageList:rh,Composer:Ch,SuggestionChips:Th,ApprovalCard:Fh,FormCard:um,Feedback:Sm,MoreMenu:jm,RenameDialog:Xm},mixins:[vc,Sc,Ac,Tc],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:uc},widgetId:{type:String,default:""},context:{type:Object,default:null},displayMode:{type:String,default:"floating"},devtools:{type:Boolean,default:!1},language:{type:String,default:""}},data(){return{transport:null,store:null,isOpen:!1,launcherHovered:!1,draft:"",busy:!1,bootError:null,pendingAttachments:[],feedbackBusy:!1,feedbackDone:!1,convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,activeConvId:null,showOnboarding:!1,dismissedPeeks:{},floatHeight:0,floatRO:null,parentOrigin:"",parentToken:"",parentContext: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 Js(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 f;const i=e[r.id]||[],s=ut(r.last_read_message_id);let o=0,a=null;for(let c=i.length-1;c>=0;c--){const g=i[c];if(!g)continue;if(((f=g.author)==null?void 0:f.type)==="user")break;const A=ut(g.id);if(A!=null){if(s!=null&&A<=s)break;t[g.id]!==0&&(!a&&g.author&&(a=g.author),o++)}}if(!i.length){const c=ut(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:mc(r,l),_unread:o>0,_unreadCount:o,_lastAuthor:a}})},unreadCount(){return this.drawerConversations.filter(e=>e._unread).length},openThreads(){var t;const e=((t=this.s)==null?void 0:t.messagesByConv)||{};return this.drawerConversations.filter(n=>n.status!=="resolved").map(n=>({id:n.id,title:n.name||this.t("common.newConversation"),preview:n._preview||this.t("onboarding.newMessage"),unread:!!n._unread,author:n._lastAuthor||null,_ts: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)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},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},widgetWelcomeMessage(){var e;return((e=this.widget)==null?void 0:e.welcome_message)||""},widgetSubtitle(){var e;return((e=this.widget)==null?void 0:e.subtitle)||""},defaultIconUrl(){var e;return((e=this.widget)==null?void 0:e.default_icon_url)||null},agentName(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.name)||""},agentAvatarUrl(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.avatar_url)||null},quickLinks(){var t;const e=(t=this.widget)==null?void 0:t.quick_links;return Array.isArray(e)?e:[]},teamMembers(){var t;const e=(t=this.widget)==null?void 0:t.team_members;return Array.isArray(e)?e:[]},responseLabel(){var e;return((e=this.widget)==null?void 0:e.response_time_label)||""},humanMessageAuthor(){var t,n,r;if(!this.currentConv)return null;const e=((t=this.s.messagesByConv)==null?void 0:t[this.currentConv.id])||[];for(let i=e.length-1;i>=0;i--)if(((r=(n=e[i])==null?void 0:n.author)==null?void 0:r.type)==="agent_human")return e[i].author;return null},humanAgentName(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.name)||""},humanAgentAvatarUrl(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.avatar_url)||null},isEscalated(){return!!this.humanMessageAuthor},isWaitingHuman(){var t;const e=(t=this.currentConv)==null?void 0:t.status;return e==="waiting"||e==="handled"},headerTitle(){var e,t;return((e=this.currentConv)==null?void 0:e.name)||((t=this.widget)==null?void 0:t.name)||this.t("common.newConversation")},composerPlaceholder(){return this.isEscalated&&this.humanAgentName?this.t("composer.replyTo",{name:this.humanAgentName.split(" ")[0]}):this.isWaitingHuman?this.t("composer.agentTakingOver"):this.t("composer.placeholder")},displayedMessages(){var n,r;const e=this.currentConv;if(!e)return[];if(!e._draft){const i=(r=(n=this.s)==null?void 0:n.paginationByConv)==null?void 0:r[e.id];if(!(i!=null&&i.loaded))return[]}const t=this.revealedAt;return(this.s.messagesByConv[e.id]||[]).filter(i=>{var s,o,a,l,f;return(i==null?void 0:i.type)==="action"&&((s=i==null?void 0:i.payload)==null?void 0:s.state)==="pending"||_n(i)&&!(t[i.id]>0)?!1:(i==null?void 0:i.type)==="action"||(i==null?void 0:i.type)==="system"||((o=i==null?void 0:i.payload)==null?void 0:o.type)==="system"||Array.isArray((a=i==null?void 0:i.payload)==null?void 0:a.attachments)&&i.payload.attachments.length||(l=i==null?void 0:i.metadata)!=null&&l.artifact||(f=i==null?void 0:i.metadata)!=null&&f.form?!0:typeof(i==null?void 0:i.text_md)=="string"&&i.text_md.trim().length>0})},streamingActive(){var n,r,i;const e=this.currentConv;return e?Object.keys(((n=this.s)==null?void 0:n.streamingByMsgId)||{}).length>0?!0:this.actionInFlight?!1:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>_n(s)&&!(this.revealedAt[s.id]>0)):!1},currentConvMessages(){var t,n,r;const e=(t=this.currentConv)==null?void 0:t.id;return e?((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e])||[]:[]},pendingApproval(){return!this.currentConv||!this.store||this.actionInFlight?null:this.store.getPendingApproval(this.currentConv.id)},approvalReady(){return this.pendingApproval?this.pendingApproval.id===this.approvalLatchId?!0:!(this.streamingActive||!this.approvalSettled):!1},approvalTitle(){var e,t,n;return((t=(e=this.pendingApproval)==null?void 0:e.payload)==null?void 0:t.name)||((n=this.pendingApproval)==null?void 0:n.text_md)||this.t("action.title")},approvalDetail(){var r,i,s,o,a,l;const e=(s=(i=(r=this.pendingApproval)==null?void 0:r.payload)==null?void 0:i.pending)==null?void 0:s.user_explanation;if(typeof e=="string"&&e.trim())return e.trim();const t=(l=(a=(o=this.pendingApproval)==null?void 0:o.payload)==null?void 0:a.pending)==null?void 0:l.prepared_params;if(!t||typeof t!="object")return"";const n=Object.entries(t);return n.length?n.slice(0,2).map(([f,c])=>`${f}: ${c}`).join(" ยท "):""},actionInFlight(){var e,t;return!this.currentConv||!this.store?null:((t=(e=this.store).getActionInFlight)==null?void 0:t.call(e,this.currentConv.id))||null},actionInFlightName(){var t;const e=this.actionInFlight;return e?((t=e.payload)==null?void 0:t.name)||e.text_md||this.t("common.action"):""},suggestions(){return!this.currentConv||!this.store?[]:this.streamingActive?[]:this.pendingForm?[]:this.store.getLatestSuggestions(this.currentConv.id)},pendingForm(){var e,t;return!this.currentConv||!this.store||this.pendingApproval||this.actionInFlight||this.streamingActive||!this.approvalSettled?null:((t=(e=this.store).getLatestForm)==null?void 0:t.call(e,this.currentConv.id))||null},showFeedback(){var t;const e=this.currentConv;return e?this.feedbackDone?!0:e.status!=="resolved"?!1:!((t=e.metadata)!=null&&t.feedback):!1},floatVisible(){return this.approvalReady||!!this.pendingForm||this.showFeedback||this.suggestions.length>0},dateLabel(){var n,r,i;const e=this.currentConv;let t=new Date;if(e){const o=((i=(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).find(a=>a==null?void 0:a.created_at))==null?void 0:i.created_at)||e.created_at;if(o){const a=new Date(o);Number.isNaN(a.getTime())||(t=a)}}return this.t("messageList.today",{time:Ls(t,Vt(this.locale))})},paginationState(){var n,r,i;const e=(n=this.currentConv)==null?void 0:n.id,t=e?(i=(r=this.s)==null?void 0:r.paginationByConv)==null?void 0:i[e]:null;return{loading:!!(t!=null&&t.loading),hasMore:!!(t!=null&&t.nextCursor)}}},watch:{latestUnreads:{handler(e){const t=new Set(e.map(o=>o.convId)),n=this.dismissedPeeks||{},r=Object.keys(n);if(!r.length)return;const i={};let s=!1;for(const o of r)t.has(o)?i[o]=n[o]:s=!0;s&&(this.dismissedPeeks=i)},deep:!0},"currentConv.id":{handler(e){var t;this.resetRevealQueue(),this.convOpenedAt=Date.now(),this.moreOpen=!1,this.renameDialogOpen=!1,this.resetApprovalPacing(),this.isViewingThread&&(this.unreadAnchorId=ut((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():"")},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=ut((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},pendingApproval:{handler(e,t){if(e&&!t){const n=e!=null&&e.created_at?Date.parse(e.created_at):NaN;if(!(Number.isFinite(n)&&n>=this.convOpenedAt)){this.resetApprovalPacing();return}this.bumpApprovalSettle(2600)}else!e&&t&&this.resetApprovalPacing()},immediate:!1},streamingActive(e,t){e!==t&&this.pendingApproval&&this.pendingApproval.id!==this.approvalLatchId&&this.bumpApprovalSettle()},approvalReady(e){e&&this.pendingApproval&&(this.approvalLatchId=this.pendingApproval.id)},floatVisible:{handler(e){this.$nextTick(()=>this.syncFloatObserver(e))},immediate:!0},currentConvMessages(e){var t;this.paceMessages(e,(t=this.currentConv)==null?void 0:t.id),(this.isOpen||this.isEmbedded)&&this.currentConv&&this.markConvRead(this.currentConv)}},async mounted(){if(typeof document<"u"&&!document.getElementById(Jr)){const e=document.createElement("style");e.id=Jr,e.textContent=wo,document.head.appendChild(e)}this._parentMessageHandler=this.onParentMessage.bind(this),window.addEventListener("message",this._parentMessageHandler),window.parent&&window.parent!==window&&window.parent.postMessage({type:"READY"},"*"),this.isEmbedded?(await this.boot(),this.store&&await this.open()):(await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize())},beforeUnmount(){this._parentMessageHandler&&(window.removeEventListener("message",this._parentMessageHandler),this._parentMessageHandler=null),this._launcherRo&&(this._launcherRo.disconnect(),this._launcherRo=null),this.cancelReveals(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.resetApprovalPacing(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{t(e,t){return this.translator(e,t)},waitForParentInit(){if(this.parentInitReceived)return Promise.resolve();if(!this.parentInitDeferred){let e;this.parentInitDeferred=new Promise(t=>{e=t}),this.parentInitDeferred._resolve=e}return this.parentInitDeferred},onParentMessage(e){var n;const t=e==null?void 0:e.data;!t||typeof t!="object"||t.type!=="INIT"||(this.parentOrigin=e.origin,this.parentToken=typeof t.token=="string"?t.token:"",this.parentContext=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(){var e,t;if(!this.canBoot){console.warn("[messenger] boot skipped โ€” missing creds");return}try{await this.waitForParentInit(),this.transport=ks(ic({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=ks(cc(this.transport)),this.hydrateNotifPref();const n=((e=this.parentContext)==null?void 0:e.customer)||((t=this.context)==null?void 0:t.customer);await this.store.start({origin:this.parentOrigin,token:this.parentToken||void 0,allowUnauthenticated:this.parentAllowUnauthenticated,customer:n&&typeof n=="object"?n:void 0}),this.setupLiveReveal()}catch(n){console.error("[ww-messenger] bootstrap failed",n),this.bootError=(n==null?void 0:n.message)||String(n)}},async refresh(){this.store&&this.store.destroy(),this.cancelReveals(),this.teardownLiveReveal(),this.teardownNotifications(),this.convOpenedAt=0,this.transport=null,this.store=null,this.isOpen=!1,this.draft="",this.busy=!1,this.bootError=null,this.pendingAttachments=[],this.feedbackBusy=!1,this.feedbackDone=!1,this.moreOpen=!1,this.renameDialogOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!1,await this.boot(),this.isEmbedded&&this.store&&await this.open()},syncFloatObserver(e){if(this.disconnectFloatRO(),!e){this.floatHeight=0;return}const t=this.$refs.floatEl;if(t){if(typeof ResizeObserver>"u"){this.floatHeight=Math.ceil(t.getBoundingClientRect().height+8);return}this.floatRO=new ResizeObserver(n=>{const r=n[0];if(!r)return;const i=Math.ceil(r.contentRect.height+8);i!==this.floatHeight&&(this.floatHeight=i,this.$nextTick(()=>{var s,o;(o=(s=this.$refs.messageList)==null?void 0:s.scrollToBottom)==null||o.call(s)}))}),this.floatRO.observe(t)}},disconnectFloatRO(){if(this.floatRO){try{this.floatRO.disconnect()}catch{}this.floatRO=null}},async open(){this.isOpen=!0,this.notifyParentResize("open"),this._launcherRo&&this._launcherRo.disconnect(),this.store||await this.boot(),this.store&&this.store.setPanelOpen(!0);const e=this.currentConv;if(e&&!e._draft){this.activeConvId==null&&(this.activeConvId=e.id);try{await this.store.openConversation(e.id)}catch(t){console.error("[ww-messenger] load messages failed",t)}this.markConvRead(e)}},async close(){this.isOpen=!1,await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize(),this.store&&this.store.setPanelOpen(!1)},notifyParentResize(e,t){if(window.parent&&window.parent!==window)try{window.parent.postMessage({type:"RESIZE",state:e,displayMode:this.displayMode,...t||{}},"*")}catch(n){console.warn("[ww-messenger] notifyParentResize failed",n)}},onLauncherHover(e){this.launcherHovered=e,this.sendCurrentLauncherSize()},sendCurrentLauncherSize(){var c,g,A,k,$,T,J;if(this.isOpen)return;const e=(g=(c=this.$el)==null?void 0:c.querySelector)==null?void 0:g.call(c,".wm-launcherWrap");if(!e)return;const t=e.getBoundingClientRect();if(!t.width||!t.height)return;const n=(((A=this.launcherPeeks)==null?void 0:A.length)??0)>0,r=16,i=Math.ceil(t.width),s=Math.ceil(t.height),o=($=(k=this.$el)==null?void 0:k.querySelector)==null?void 0:$.call(k,".wm-launcher"),a=(J=(T=this.$el)==null?void 0:T.querySelectorAll)==null?void 0:J.call(T,".wm-peek"),l=a&&a.length?a[a.length-1]:null;let f=null;if(l){const U=l.getBoundingClientRect();f={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:f,peekHovered:this.launcherHovered&&n})},observeLauncherSize(){var n,r;if(typeof ResizeObserver>"u")return;const e=(r=(n=this.$el)==null?void 0:n.querySelector)==null?void 0:r.call(n,".wm-launcherWrap");if(!e)return;this._launcherRo&&this._launcherRo.disconnect();const t=new ResizeObserver(()=>{this.isOpen||this.sendCurrentLauncherSize()});t.observe(e),this._launcherRo=t},async openFromPeek(e){var n,r;const t=e||((n=this.latestUnreads[0])==null?void 0:n.convId);t&&t!==((r=this.currentConv)==null?void 0:r.id)&&(this.draftConv=null,this.activeConvId=t,this.showOnboarding=!1),await this.open()},dismissPeek(e){const t=this.latestUnreads.find(n=>n.convId===e);t&&(this.dismissedPeeks={...this.dismissedPeeks,[e]:t.ts})},startConv(){this.draftConv={id:"__draft__",_draft:!0,name:"",created_at:new Date().toISOString()},this.activeConvId=null,this.showOnboarding=!1,this.focusComposer()},async ensureRealConv(){const e=this.currentConv;if(!e)return null;if(!e._draft)return e;if(this.busy)return null;this.busy=!0;try{const t=await this.store.createConversation({});return this.draftConv=null,this.activeConvId=t.id,await this.store.openConversation(t.id),this.markConvRead(t),t}catch(t){return console.error("[ww-messenger] create conv failed",t),this.bootError=(t==null?void 0:t.message)||String(t),null}finally{this.busy=!1}},focusComposer(){this.$nextTick(()=>{var e;return(e=this.$refs.composer)==null?void 0:e.focus()})},toggleMore(){this.moreOpen=!this.moreOpen},goHome(){this.moreOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!0},async onDrawerPick(e){if(!(e!=null&&e.id)||!this.store)return;this.draftConv=null,this.activeConvId=e.id,this.showOnboarding=!1;try{await this.store.openConversation(e.id)}catch(n){console.error("[ww-messenger] open conv failed",n)}const t=this.allConversations.find(n=>n.id===e.id);t&&this.markConvRead(t)},async onMoreAction(e){var t,n;switch(this.moreOpen=!1,e){case"rename":this.openRenameDialog();break;case"export":_c(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(this.statusUrl)try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(this.helpUrl)try{window.open(this.helpUrl,"_blank","noopener")}catch{}break}},openRenameDialog(){const e=this.currentConv;!e||e._draft||(this.renameDialogOpen=!0)},async onRenameSubmit(e){const t=this.currentConv;if(this.renameDialogOpen=!1,!t||t._draft||!this.store)return;const n=(e||"").trim();if(!(!n||n===t.name))try{await this.store.patchConversation(t.id,{name:n})}catch(r){console.error("[ww-messenger] rename failed",r)}},async onSend(e){let t=this.currentConv;if(!t&&(this.startConv(),t=this.currentConv,!t)||t._draft&&(t=await this.ensureRealConv(),!t))return;const n=t.id,r=this.pendingAttachments.slice();this.pendingAttachments=[],this.unreadAnchorId=null,this.unreadBoundaryTs="",await this.store.send(n,e,{attachments:r.length?r:void 0})},async onSuggestion(e){const t=e==null?void 0:e.label;t&&await this.onSend(t)},async onLoadMore(){var t;const e=(t=this.currentConv)==null?void 0:t.id;!e||!this.store||await this.store.loadMore(e)},async onApprovalCallback(e){const t=this.pendingApproval;t&&await this.store.clickCallback(t.id,e)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=fc(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:hc(t.form,e,this.translator)}}))},async onAttach(e){if(!(!e||!this.transport))try{const t=await this.transport.uploadAttachment(e);this.pendingAttachments.push({type:t.type||"file",path:t.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size})}catch(t){console.error("[ww-messenger] attachment upload failed",t)}},onPanelClick(e){const t=e.target&&e.target.closest?e.target.closest('a[href^="#"]'):null;t&&(e.preventDefault(),this.openInternalUrl(t.getAttribute("href")))},async openInternalUrl(e){if(typeof e!="string"||!e.startsWith("#"))return!1;const t=e.slice(1);if(t==="new"||t==="new-conversation")return this.isOpen||await this.open(),this.startConv(),!0;if(t.startsWith("conversation/")){const n=t.slice(13);return n&&await this.openFromPeek(n),!0}return console.warn("[messenger] unknown internal url",e),!0},async onQuickLink(e){if(e){if(e.url){if(await this.openInternalUrl(e.url))return;try{window.open(e.url,"_blank","noopener")}catch{}return}this.currentConv||this.startConv(),await this.onSend(e.label)}},async onFeedback({rating:e,comment:t}){if(this.currentConv){this.feedbackBusy=!0;try{await this.store.submitFeedback(this.currentConv.id,{rating:e,comment:t}),this.feedbackDone=!0}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},Zm={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},ep=["aria-label"],tp={key:0,class:"wm-state"},np={class:"wm-state__err"},sp={class:"wm-state__errTitle"},rp={class:"wm-state__errSub"},ip={class:"wm-bottom"},op={key:0,ref:"floatEl",class:"wm-float"},ap={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},lp={class:"wm-actionWait__lbl"},cp={key:2,class:"wm-attached"},up=["aria-label","onClick"];function dp(e,t,n,r,i,s){const o=ye("Launcher"),a=ye("Header"),l=ye("Onboarding"),f=ye("MessageList"),c=ye("ApprovalCard"),g=ye("FormCard"),A=ye("Feedback"),k=ye("SuggestionChips"),$=ye("Composer"),T=ye("MoreMenu"),J=ye("RenameDialog");return m(),_("div",{class:ee(["wm-root",`wm-root--${n.displayMode}`])},[!i.isOpen&&!s.isEmbedded?(m(),_e(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"])):B("",!0),i.isOpen||s.isEmbedded?(m(),_("section",{key:1,class:ee(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv}]),style:Fe(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger",onClick:t[5]||(t[5]=(...U)=>s.onPanelClick&&s.onPanelClick(...U))},[!s.ready&&!s.error?(m(),_("div",Zm,[s.isEmbedded?B("",!0):(m(),_("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[6]||(t[6]=[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,ep)),t[7]||(t[7]=u("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(m(),_(Q,{key:1},[ve(a,{title:s.headerTitle,"team-members":s.teamMembers,"response-label":s.responseLabel,"show-identity":!!s.currentConv,"show-back":s.canBack,"show-close":!s.isEmbedded,"more-active":i.moreOpen,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onBack:s.goHome,onMore:s.toggleMore,onClose:s.close},null,8,["title","team-members","response-label","show-identity","show-back","show-close","more-active","agent-name","agent-avatar-url","onBack","onMore","onClose"]),s.error?(m(),_("div",tp,[u("div",np,[t[8]||(t[8]=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",sp,I(s.t("error.connectionFailed")),1),u("div",rp,I(s.error),1)])])])):s.currentConv?(m(),_(Q,{key:2},[ve(f,{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",ip,[s.floatVisible?(m(),_("div",op,[s.approvalReady?(m(),_e(c,{key:0,action:s.approvalTitle,detail:s.approvalDetail,callbacks:s.pendingApproval.callbacks,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onCallback:s.onApprovalCallback},null,8,["action","detail","callbacks","agent-name","agent-avatar-url","onCallback"])):s.pendingForm?(m(),_e(g,{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?(m(),_e(A,{key:2,busy:i.feedbackBusy,done:i.feedbackDone,onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(m(),_e(k,{key:3,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):B("",!0),s.actionInFlight?(m(),_("div",ap,[t[9]||(t[9]=u("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),u("span",lp,I(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):(m(),_e($,{key:2,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[1]||(t[1]=U=>i.draft=U),placeholder:s.composerPlaceholder,disabled:!!s.pendingApproval,"attach-label":s.t("composer.attachFile"),"display-mode":n.displayMode,onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","disabled","attach-label","display-mode","onSend","onAttach"]))]),i.moreOpen?(m(),_e(T,{key:0,"can-rename":!!s.currentConv&&!s.currentConv._draft,"can-export":!!s.currentConv&&!s.currentConv._draft,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[2]||(t[2]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):B("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(m(),_e(J,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[3]||(t[3]=U=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):B("",!0),i.pendingAttachments.length?(m(),_("div",cp,[(m(!0),_(Q,null,Se(i.pendingAttachments,(U,q)=>(m(),_("div",{key:q,class:"wm-attached__chip"},[t[11]||(t[11]=u("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)),u("span",null,I(U.name),1),u("button",{type:"button","aria-label":s.t("attachment.remove"),onClick:Z=>i.pendingAttachments.splice(q,1)},[...t[10]||(t[10]=[u("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[u("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,up)]))),128))])):B("",!0)],64)):(m(),_e(l,{key:1,"welcome-message":s.widgetWelcomeMessage,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,onStart:s.startConv,onSelect:s.onQuickLink,onResume:s.onDrawerPick},null,8,["welcome-message","subtitle","agent-name","default-icon-url","quick-links","open-threads","busy","onStart","onSelect","onResume"])),i.moreOpen&&!s.currentConv?(m(),_e(T,{key:3,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[4]||(t[4]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):B("",!0)],64))],6)):B("",!0)],2)}const fp=we(Qm,[["render",dp],["__scopeId","data-v-9e47cfb4"]]),Xr=window.__WIDGET_ID,Qr=window.__BASE_URL,hp=window.__DISPLAY_MODE||"floating",Zr=window.__LANGUAGE||"";window.__MESSENGER_IFRAME_VERSION="0.5.39";if(!Xr||!Qr)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=wo,document.head.appendChild(e)}Ql({render:()=>go(fp,{baseUrl:Qr,widgetId:Xr,displayMode:hp,...Zr?{language:Zr}:{}})}).mount("#app")}
73
+ `)}</code></pre>`});continue}if(/^\s*[-*]\s+/.test(s)){const f=[];for(;r<t.length;){const _=/^\s*[-*]\s+(.*)$/.exec(t[r]);if(!_)break;f.push(_[1]),r++}const u=f.map(_=>`<li>${Zt(_)}</li>`).join("");n.push({type:"block",html:`<ul class="wm-md-ul">${u}</ul>`});continue}const a=/^\s*(\d+)\.\s+(.*)$/.exec(s);if(a){const f=parseInt(a[1],10),u=[a[2]];for(r++;r<t.length;){const k=/^\s*\d+\.\s+(.*)$/.exec(t[r]);if(!k)break;u.push(k[1]),r++}const _=u.map(k=>`<li>${Zt(k)}</li>`).join(""),A=f!==1?` start="${f}"`:"";n.push({type:"block",html:`<ol class="wm-md-ol"${A}>${_}</ol>`});continue}const l=/^(#{1,6})\s+(.*)$/.exec(s);if(l){const f=l[1].length;n.push({type:"block",html:`<h${f} class="wm-md-h wm-md-h${f}">${Zt(l[2])}</h${f}>`}),r++;continue}n.push({type:"text",html:Zt(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+=`
74
+ `)}return i}const Gr={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"},ku={name:"WmOnboarding",components:{AIAvatar:wn,HumanAvatar:Xs},inject:{t:{default:()=>Oe()},wmLocale:{default:()=>()=>"fr"}},props:{welcomeMessage:{type:String,default:""},subtitle:{type:String,default:""},agentName:{type:String,default:""},defaultIconUrl:{type:String,default:null},quickLinks:{type:Array,default:()=>[]},openThreads:{type:Array,default:()=>[]},busy:{type:Boolean,default:!1}},emits:["start","select","resume"],data(){return{query:""}},computed:{heroTitle(){return this.welcomeMessage?this.welcomeMessage:this.agentName?this.t("onboarding.greetingNamed",{name:this.agentName}):this.t("onboarding.greeting")},heroSub(){return this.subtitle||this.t("onboarding.heroSub")},isOddQuickLinks(){return this.quickLinks.length%2===1},quickLinksLayout(){return this.isOddQuickLinks?"wm-onb__qlist":"wm-onb__grid"},filteredThreads(){const e=this.query.trim().toLowerCase();return e?this.openThreads.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.preview||"").toLowerCase().includes(e)):this.openThreads},unreadThreads(){return this.openThreads.filter(e=>e.unread)}},methods:{iconPath(e){return Gr[e]||Gr.link},isExternalLink(e){const t=e==null?void 0:e.url;return!!t&&!t.startsWith("#")},renderPreview(e){return bu(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},formatTs(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const n=Vt(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"})}}},Cu={class:"wm-onb"},Su={class:"wm-onb__hero"},Au={class:"wm-onb__hero-text"},xu={class:"wm-onb__title"},Tu={class:"wm-onb__sub"},Mu={class:"wm-onb__cta"},Eu=["disabled"],Ou={class:"wm-onb__startLabel"},Iu={key:0,class:"wm-onb__section wm-onb__section--card"},Lu={class:"wm-onb__section-title"},Ru=["onClick"],Bu={class:"wm-onb__card-icon"},Pu=["aria-label"],Nu={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"},Fu=["d"],Du={class:"wm-onb__card-body"},ju={class:"wm-onb__card-title"},Uu={key:0,class:"wm-onb__card-sub"},Hu={key:0,class:"wm-onb__card-ext",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"},Vu={key:1,class:"wm-onb__section wm-onb__section--card"},$u={class:"wm-onb__section-title"},Ku={class:"wm-onb__alertList"},zu=["onClick"],qu={key:0,class:"wm-onb__defaultAvatar"},Wu=["aria-label"],Gu={class:"wm-onb__alert-body"},Yu={class:"wm-onb__alert-title"},Ju=["innerHTML"],Xu={class:"wm-onb__alert-meta"},Qu={key:0,class:"wm-onb__alert-time"},Zu={class:"wm-onb__alert-resume"},ed={key:2,class:"wm-onb__section wm-onb__section--card"},td={class:"wm-onb__section-title"},nd={class:"wm-onb__search"},sd=["placeholder","aria-label"],rd={class:"wm-onb__list"},id=["onClick"],od={key:0,class:"wm-onb__defaultAvatar"},ad=["aria-label"],ld={class:"wm-onb__thread-body"},cd={class:"wm-onb__thread-title"},ud=["innerHTML"],dd={class:"wm-onb__thread-meta"},fd={key:0,class:"wm-onb__thread-time"},hd={key:0,class:"wm-onb__empty"};function md(e,t,n,r,i,s){const o=ye("AIAvatar");return h(),g("div",Cu,[c("div",Su,[t[2]||(t[2]=c("svg",{class:"wm-onb__hero-deco",width:"180",height:"180",viewBox:"0 0 180 180",fill:"none","aria-hidden":"true"},[c("circle",{cx:"170",cy:"10",r:"105",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.35"}),c("circle",{cx:"170",cy:"10",r:"72",stroke:"#5B5FEF","stroke-width":"1","stroke-dasharray":"1 5",opacity:"0.5"}),c("circle",{cx:"152",cy:"34",r:"2.5",fill:"#5B5FEF",opacity:"0.65"})],-1)),ve(o,{size:52,"image-url":n.defaultIconUrl},null,8,["image-url"]),c("div",Au,[c("div",xu,I(s.heroTitle),1),c("div",Tu,I(s.heroSub),1)])]),c("div",Mu,[c("button",{type:"button",class:"wm-onb__startBtn",disabled:n.busy,onClick:t[0]||(t[0]=a=>e.$emit("start"))},[t[3]||(t[3]=c("span",{class:"wm-onb__startIcon"},[c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[c("path",{d:"M12 5v14M5 12h14"})])],-1)),c("span",Ou,I(n.busy?"โ€ฆ":s.t("onboarding.start")),1),t[4]||(t[4]=c("svg",{class:"wm-onb__startArrow",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"},[c("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))],8,Eu)]),n.quickLinks.length?(h(),g("div",Iu,[c("div",Lu,I(s.t("onboarding.quickAccess")),1),c("div",{class:ee(s.quickLinksLayout)},[(h(!0),g(Q,null,Ae(n.quickLinks,(a,l)=>(h(),g("button",{key:l,type:"button",class:ee(["wm-onb__card",{"wm-onb__card--row":s.isOddQuickLinks}]),style:Se(a.color?{"--card-color":a.color}:null),onClick:f=>e.$emit("select",a)},[c("span",Bu,[a.icon_url?(h(),g("span",{key:0,class:"wm-onb__card-iconImg",style:Se({"--icon-url":`url('${a.icon_url}')`}),role:"img","aria-label":a.label||""},null,12,Pu)):(h(),g("svg",Nu,[c("path",{d:s.iconPath(a.icon)},null,8,Fu)]))]),c("span",Du,[c("span",ju,I(a.label),1),a.subtitle?(h(),g("span",Uu,I(a.subtitle),1)):B("",!0)]),s.isExternalLink(a)?(h(),g("svg",Hu,[...t[5]||(t[5]=[c("path",{d:"M7 17L17 7M9 7h8v8"},null,-1)])])):B("",!0)],14,Ru))),128))],2)])):B("",!0),s.unreadThreads.length?(h(),g("div",Vu,[c("div",$u,I(s.t("onboarding.unreadConversations")),1),c("div",Ku,[(h(!0),g(Q,null,Ae(s.unreadThreads,a=>(h(),g("button",{key:a.id,type:"button",class:"wm-onb__alert",onClick:l=>e.$emit("resume",a)},[c("span",{class:ee(["wm-onb__alert-avatar",s.avatarWrapperClass(a)])},[s.isDefaultAvatar(a)?(h(),g("span",qu,[...t[6]||(t[6]=[c("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"},[c("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(),_e(Ss(s.avatarComponent(a)),Es({key:1,ref_for:!0},s.avatarProps(a)),null,16)),c("span",{class:"wm-onb__alert-dot","aria-label":s.t("onboarding.unread")},null,8,Wu)],2),c("span",Gu,[c("span",Yu,I(a.title),1),c("span",{class:"wm-onb__alert-preview",innerHTML:s.renderPreview(a.preview)},null,8,Ju)]),c("span",Xu,[s.formatTs(a._ts)?(h(),g("span",Qu,I(s.formatTs(a._ts)),1)):B("",!0),c("span",Zu,I(s.t("onboarding.resume")),1)])],8,zu))),128))])])):B("",!0),n.openThreads.length?(h(),g("div",ed,[c("div",td,I(s.t("onboarding.recentConversations")),1),c("div",nd,[t[7]||(t[7]=c("span",{class:"wm-onb__searchIcon"},[c("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"},[c("path",{d:"M21 21l-4.35-4.35M11 17a6 6 0 100-12 6 6 0 000 12z"})])],-1)),it(c("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>i.query=a),type:"text",placeholder:s.t("onboarding.search"),"aria-label":s.t("onboarding.search")},null,8,sd),[[Ot,i.query]])]),c("div",rd,[(h(!0),g(Q,null,Ae(s.filteredThreads,a=>(h(),g("button",{key:a.id,type:"button",class:ee(["wm-onb__thread",{"wm-onb__thread--unread":a.unread}]),onClick:l=>e.$emit("resume",a)},[c("span",{class:ee(["wm-onb__thread-avatar",s.avatarWrapperClass(a)])},[s.isDefaultAvatar(a)?(h(),g("span",od,[...t[8]||(t[8]=[c("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"},[c("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(),_e(Ss(s.avatarComponent(a)),Es({key:1,ref_for:!0},s.avatarProps(a)),null,16)),a.unread?(h(),g("span",{key:2,class:"wm-onb__thread-dot","aria-label":s.t("onboarding.unread")},null,8,ad)):B("",!0)],2),c("span",ld,[c("span",cd,I(a.title),1),c("span",{class:"wm-onb__thread-preview",innerHTML:s.renderPreview(a.preview)},null,8,ud)]),c("span",dd,[s.formatTs(a._ts)?(h(),g("span",fd,I(s.formatTs(a._ts)),1)):B("",!0),t[9]||(t[9]=c("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-onb__thread-chev","aria-hidden":"true"},[c("path",{d:"M5 12h14M13 5l7 7-7 7"})],-1))])],10,id))),128)),s.filteredThreads.length?B("",!0):(h(),g("div",hd,I(s.t("onboarding.noResults",{query:i.query})),1))])])):B("",!0)])}const pd=we(ku,[["render",md],["__scopeId","data-v-369d70df"]]);function gd(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 _d={name:"WmActionResult",props:{state:{type:String,default:"success"},label:{type:String,required:!0},detail:{type:String,default:""}},computed:{detailText(){return gd(this.detail)}}},vd={class:"wm-result__icon","aria-hidden":"true"},yd={key:0,width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.8","stroke-linecap":"round","stroke-linejoin":"round"},bd={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"},wd={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"},kd={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"},Cd={class:"wm-result__body"},Sd={class:"wm-result__label"},Ad={class:"wm-result__detail"};function xd(e,t,n,r,i,s){return h(),g("div",{class:ee(["wm-result",`wm-result--${n.state}`])},[c("span",vd,[n.state==="success"?(h(),g("svg",yd,[...t[0]||(t[0]=[c("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):n.state==="rejected"?(h(),g("svg",bd,[...t[1]||(t[1]=[c("path",{d:"M18 6L6 18M6 6l12 12"},null,-1)])])):n.state==="awaiting"?(h(),g("svg",wd,[...t[2]||(t[2]=[c("circle",{cx:"12",cy:"12",r:"10"},null,-1),c("polyline",{points:"12 7 12 12 15 14"},null,-1)])])):(h(),g("svg",kd,[...t[3]||(t[3]=[c("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),c("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),c("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"},null,-1)])]))]),c("span",Cd,[c("span",Sd,I(n.label),1),s.detailText?(h(),g(Q,{key:0},[t[4]||(t[4]=c("span",{class:"wm-result__sep","aria-hidden":"true"}," ยท ",-1)),c("span",Ad,I(s.detailText),1)],64)):B("",!0)])],2)}const Td=we(_d,[["render",xd],["__scopeId","data-v-7284acd0"]]),Md={name:"WmArtifactFormResponse",inject:{t:{default:()=>Oe()}},props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]}}},Ed={class:"wm-art wm-art--formResponse"},Od={class:"wm-art__head"},Id={class:"wm-art__title"},Ld={class:"wm-art__badge wm-art__badge--success"},Rd={class:"wm-art__body"},Bd={class:"wm-art__fieldLabel"};function Pd(e,t,n,r,i,s){return h(),g("div",Ed,[c("div",Od,[c("div",Id,I(n.data.title||s.t("form.title")),1),c("span",Ld,[t[0]||(t[0]=c("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"},[c("polyline",{points:"20 6 9 17 4 12"})],-1)),Xn(" "+I(s.t("form.sent")),1)])]),c("div",Rd,[(h(!0),g(Q,null,Ae(s.fields,(o,a)=>(h(),g("div",{key:a,class:"wm-art__field"},[c("div",Bd,I(o.label),1),c("div",{class:ee(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},I(o.value),3)]))),128))])])}const Nd=we(Md,[["render",Pd],["__scopeId","data-v-713aecf1"]]),Fd={name:"WmArtifactInfoCard",props:{data:{type:Object,required:!0}},computed:{fields(){var e;return Array.isArray((e=this.data)==null?void 0:e.fields)?this.data.fields:[]},hasBody(){var e;return!!((e=this.data)!=null&&e.body)||this.fields.length>0}}},Dd={class:"wm-art wm-art--infoCard"},jd={key:0,class:"wm-art__image"},Ud=["src","alt"],Hd={class:"wm-art__head"},Vd={class:"wm-art__headMain"},$d={class:"wm-art__title"},Kd={key:0,class:"wm-art__subtitle"},zd={key:1,class:"wm-art__body"},qd={key:0,class:"wm-art__text"},Wd={class:"wm-art__fieldLabel"};function Gd(e,t,n,r,i,s){return h(),g("div",Dd,[n.data.image_url?(h(),g("figure",jd,[c("img",{src:n.data.image_url,alt:n.data.title||"",loading:"lazy"},null,8,Ud)])):B("",!0),c("div",Hd,[c("div",Vd,[c("div",$d,I(n.data.title),1),n.data.subtitle?(h(),g("div",Kd,I(n.data.subtitle),1)):B("",!0)]),n.data.badge&&n.data.badge.label?(h(),g("span",{key:0,class:ee(["wm-art__badge",`wm-art__badge--${n.data.badge.tone||"neutral"}`])},I(n.data.badge.label),3)):B("",!0)]),s.hasBody?(h(),g("div",zd,[n.data.body?(h(),g("div",qd,I(n.data.body),1)):B("",!0),s.fields.length?(h(!0),g(Q,{key:1},Ae(s.fields,(o,a)=>(h(),g("div",{key:a,class:"wm-art__field"},[c("div",Wd,I(o.label),1),c("div",{class:ee(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},I(o.value),3)]))),128)):B("",!0)])):B("",!0)])}const Yd=we(Fd,[["render",Gd],["__scopeId","data-v-7eae0e4a"]]);function Jd(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 Xd={name:"WmArtifactTicket",inject:{t:{default:()=>Oe()},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 Jd((e=this.data)==null?void 0:e.created_at,Vt(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}}},Qd={class:"wm-art wm-art--ticket"},Zd={class:"wm-art__head wm-tk__head"},ef={class:"wm-art__title wm-tk__title"},tf={class:"wm-tk__sub"},nf={class:"wm-tk__ref"},sf={key:0,class:"wm-tk__text"},rf={key:0,class:"wm-art__body"},of={class:"wm-art__fieldLabel"},af=["data-level"],lf={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"},cf={key:1,class:"wm-art__footer wm-tk__footer"};function uf(e,t,n,r,i,s){return h(),g("div",Qd,[c("div",Zd,[c("div",ef,I(n.data.title),1),c("div",tf,[c("div",nf,[t[0]||(t[0]=c("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"},[c("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"}),c("path",{d:"M13 5v2M13 17v2M13 11v2"})],-1)),c("span",null,I(n.data.reference),1)]),c("span",{class:ee(["wm-art__badge","wm-tk__badge",`wm-art__badge--${n.data.status.tone||"neutral"}`])},[t[1]||(t[1]=c("span",{class:"wm-tk__dot","aria-hidden":"true"},null,-1)),Xn(" "+I(n.data.status.label),1)],2)]),n.data.body?(h(),g("div",sf,I(n.data.body),1)):B("",!0)]),s.fields.length?(h(),g("div",rf,[(h(!0),g(Q,null,Ae(s.fields,(o,a)=>(h(),g("div",{key:a,class:"wm-art__field"},[c("div",of,I(o.label),1),c("div",{class:ee(["wm-art__fieldValue",{"wm-art__fieldValue--multi":o.multiline}])},[s.isPriority(o.label)?(h(),g("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]=[c("rect",{x:"1",y:"8",width:"2",height:"3",rx:"0.5"},null,-1),c("rect",{x:"5",y:"5",width:"2",height:"6",rx:"0.5"},null,-1),c("rect",{x:"9",y:"2",width:"2",height:"9",rx:"0.5"},null,-1)])],8,af)):s.isDate(o.label)?(h(),g("svg",lf,[...t[3]||(t[3]=[c("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"},null,-1),c("path",{d:"M16 2v4M8 2v4M3 10h18"},null,-1)])])):B("",!0),c("span",null,I(o.value),1)],2)]))),128))])):B("",!0),n.data.created_at?(h(),g("div",cf,[t[4]||(t[4]=c("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"},[c("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),c("path",{d:"M16 2v4M8 2v4M3 10h18"})],-1)),c("span",null,I(s.formattedDate),1)])):B("",!0)])}const df=we(Xd,[["render",uf],["__scopeId","data-v-5f30c914"]]),ff={form_response:Nd,info_card:Yd,ticket:df},hf={name:"WmArtifactRenderer",props:{artifact:{type:Object,required:!0}},computed:{component(){var t;const e=(t=this.artifact)==null?void 0:t.kind;return e&&ff[e]||null}}};function mf(e,t,n,r,i,s){return s.component?(h(),_e(Ss(s.component),{key:0,data:n.artifact.data},null,8,["data"])):B("",!0)}const pf=we(hf,[["render",mf]]),gf={name:"WmAttachmentPreview",inject:{signAttachmentFn:{default:null},t:{default:()=>Oe()}},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()}}},_f=["href"],vf=["src","alt"],yf=["src"],bf=["src"],wf=["href","download"],kf={class:"wm-att__main"},Cf={class:"wm-att__name"},Sf={key:0,class:"wm-att__meta"},Af={key:0,class:"wm-att__spin","aria-hidden":"true"};function xf(e,t,n,r,i,s){return h(),g("div",{class:ee(["wm-att",["wm-att--"+(s.kind||"file")]])},[s.kind==="image"&&i.url?(h(),g("a",{key:0,href:s.safeHref,target:"_blank",rel:"noopener",class:"wm-att__imgWrap"},[c("img",{src:i.url,alt:s.displayName,loading:"lazy"},null,8,vf)],8,_f)):s.kind==="audio"&&i.url?(h(),g("audio",{key:1,src:i.url,controls:"",preload:"metadata"},null,8,yf)):s.kind==="video"&&i.url?(h(),g("video",{key:2,src:i.url,controls:"",preload:"metadata"},null,8,bf)):(h(),g("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]=c("span",{class:"wm-att__icon"},[c("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"},[c("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),c("path",{d:"M14 2v6h6"})])],-1)),c("span",kf,[c("span",Cf,I(s.displayName),1),s.sizeLabel?(h(),g("span",Sf,I(s.sizeLabel),1)):B("",!0)]),i.loading?(h(),g("span",Af)):B("",!0)],8,wf))],2)}const Tf=we(gf,[["render",xf],["__scopeId","data-v-0c877a62"]]),Mf={name:"WmBubble",props:{role:{type:String,default:"ai"},text:{type:String,default:""}},computed:{rendered(){return wu(this.text)}}},Ef=["innerHTML"];function Of(e,t,n,r,i,s){return h(),g("div",{class:ee(["wm-bubble","wm-bubble--"+n.role])},[Ia(e.$slots,"default",{},()=>[c("span",{innerHTML:s.rendered},null,8,Ef)])],2)}const If=we(Mf,[["render",Of],["__scopeId","data-v-7ab13147"]]),Lf={name:"WmTyping"},Rf={class:"wm-typing"};function Bf(e,t,n,r,i,s){return h(),g("div",Rf,[...t[0]||(t[0]=[c("span",{style:{"animation-delay":"0s"}},null,-1),c("span",{style:{"animation-delay":"0.2s"}},null,-1),c("span",{style:{"animation-delay":"0.4s"}},null,-1)])])}const Pf=we(Lf,[["render",Bf],["__scopeId","data-v-df2447fd"]]);function Tt(e){return e?e.client_msg_id||e.id:""}const Nf={transferred_to_human:"system.transferredToHuman",assigned:"system.assigned",unassigned:"system.unassigned",resolved:"system.resolved",reopened:"system.reopened",idle:"system.idle"},Ff=80,Df=200,jf={name:"WmMessageList",components:{AIAvatar:wn,HumanAvatar:Xs,Bubble:If,Typing:Pf,ActionResult:Td,AttachmentPreview:Tf,ArtifactRenderer:pf},inject:{t:{default:()=>Oe()},wmLocale:{default:()=>()=>"fr"}},props:{messages:{type:Array,default:()=>[]},streamingActive:{type:Boolean,default:!1},dateLabel:{type:String,default:""},conversationId:{type:[String,Number],default:null},loadingMore:{type:Boolean,default:!1},hasMore:{type:Boolean,default:!1},unreadAnchorId:{type:Number,default:null},unreadBoundaryTs:{type:String,default:""},aiAgentName:{type:String,default:""},aiAgentAvatarUrl:{type:String,default:null}},emits:["load-more"],data(){return{silentFades:!1,widthByKey:Object.freeze({}),showScrollDown:!1,pressedItemKey:null}},computed:{historyExhausted(){return!this.hasMore&&!this.loadingMore&&this.messages.length>=20},groups(){var n,r,i,s;const e=[];for(const o of this.messages){const a=this.roleOf(o);if(a==="system"){if(((n=o==null?void 0:o.payload)==null?void 0:n.event)==="action_admin_pending"){const u=e[e.length-1];u&&u.role==="ai"?u.messages.push(o):e.push({key:`g-${Tt(o)}`,role:"ai",agentName:"",agentAvatarUrl:null,messages:[o],items:[]});continue}e.push({key:`sys-${Tt(o)}`,role:a,messages:[o],items:[],systemLabel:this.systemLabel(o)});continue}const l=e[e.length-1];l&&l.role===a&&(a==="ai"||l.agentName===(((r=o==null?void 0:o.author)==null?void 0:r.name)||""))?l.messages.push(o):e.push({key:`g-${Tt(o)}`,role:a,agentName:((i=o==null?void 0:o.author)==null?void 0:i.name)||"",agentAvatarUrl:((s=o==null?void 0:o.author)==null?void 0:s.avatar_url)||null,messages:[o],items:[]})}for(const o of e){if(o.role==="system")continue;const a=[];for(const l of o.messages)for(const f of this.itemsOf(l))a.push(f);o.items=a}const t=[];for(const o of e){if(o.role!=="system"&&!o.items.length)continue;const a=t[t.length-1];if(a&&a.role!=="system"&&a.role===o.role&&(o.role==="ai"||a.agentName===o.agentName)){a.messages.push(...o.messages),a.items.push(...o.items);continue}t.push(o)}for(const o of t)o.role!=="system"&&(o.key=this.stableGroupKey(o.messages));return t},unreadGroupKey(){if(this.unreadAnchorId==null)return null;const e=this.unreadAnchorId,t=this.unreadBoundaryTs;for(const n of this.groups){if(n.role==="user"||n.role==="system"||!n.items.length)continue;const r=n.messages[0];if(!r)continue;const i=ut(r.id);if(i!=null&&!(i<=e)&&!(t&&r.created_at&&r.created_at>t))return n.key}return null}},watch:{messages:{handler:"snapshotAndRestore",deep:!0},conversationId(e,t){e!==t&&(this._groupIdByMsgKey=null,this.silentFades=!1)},loadingMore(e){e||(this._pendingLoadMore=!1),e&&(this.silentFades=!0),this.snapshotAndRestore()},streamingActive:"snapshotAndRestore"},mounted(){this._lastSeenConvId=this.conversationId,this.scrollToBottom(),this._measureFrame=null,this._ro=new ResizeObserver(()=>this.scheduleMeasure()),this.$refs.scrollEl&&this._ro.observe(this.$refs.scrollEl),this.$nextTick(()=>this.measureRows())},beforeUnmount(){var e;(e=this._ro)==null||e.disconnect(),this._measureFrame&&cancelAnimationFrame(this._measureFrame),this._pressTimer&&clearTimeout(this._pressTimer)},updated(){this.scheduleMeasure()},methods:{messageKey:Tt,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=Tt(r);if(i&&t.has(i)){n=t.get(i);break}}n==null&&(n=++this._groupIdCounter);for(const r of e){const i=Tt(r);i&&t.set(i,n)}return`g-${n}`},isAtBottom(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=Ff},onScroll(){const e=this.$refs.scrollEl;e&&(this.showScrollDown=!this.isAtBottom(e),!(this.loadingMore||!this.hasMore)&&(this._pendingLoadMore||e.scrollTop<=Df&&(this._pendingLoadMore=!0,this.$emit("load-more"))))},snapshotAndRestore(){const e=this.$refs.scrollEl;if(!e||this._scrollSnap)return;const t=this._lastSeenConvId!==this.conversationId;this._lastSeenConvId=this.conversationId;const n=this.isAtBottom(e);let r=null;if(!t&&!n){const s=this.pickAnchor(e);if(s!=null&&s.rowKey){const o=this.findRowByKey(e,s.rowKey);if(o){const a=e.getBoundingClientRect().top;r={rowKey:s.rowKey,relY:o.getBoundingClientRect().top-a}}}}const i={forceBottom:t,wasPinned:n,anchor:r};this._scrollSnap=i,this.$nextTick(()=>{if(this._scrollSnap=null,i.forceBottom||i.wasPinned){e.scrollTop=e.scrollHeight;return}if(!i.anchor)return;const s=()=>{const o=i.anchor,a=this.findRowByKey(e,o.rowKey);if(!a)return;const f=a.getBoundingClientRect().top-e.getBoundingClientRect().top-o.relY;Math.abs(f)>.5&&(e.scrollTop+=f)};s(),requestAnimationFrame(()=>{s(),requestAnimationFrame(s)})})},pickAnchor(e){const t=e.getBoundingClientRect().top,n=e.querySelectorAll(".wm-list__row[data-row-key]");let r=null;for(const i of n)if(r||(r=i),i.getBoundingClientRect().bottom>=t)return{rowKey:i.dataset.rowKey};return r?{rowKey:r.dataset.rowKey}:null},findRowByKey(e,t){if(!t)return null;const n=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&");return e.querySelector(`.wm-list__row[data-row-key="${n}"]`)},roleOf(e){var n,r;if((e==null?void 0:e.type)==="system"||((n=e==null?void 0:e.payload)==null?void 0:n.type)==="system")return"system";const t=(r=e==null?void 0:e.author)==null?void 0:r.type;return t==="user"?"user":t==="agent_human"?"human":"ai"},roleLabel(e){if(e.role==="human")return e.agentName||this.t("common.agent");const t=this.t("common.aiAssistant");return this.aiAgentName?`${this.aiAgentName} โ€ข ${t}`:t},itemsOf(e){var t;if(!e)return[];if(e.type==="system"&&((t=e==null?void 0:e.payload)==null?void 0:t.event)==="action_admin_pending")return[{message:e,partKey:"main",renderAs:"admin-pending",kind:{top:"bubble",bottom:"bubble"}}];if(e.type==="action"&&e.payload&&e.payload.state!=="pending"){const n=[{message:e,partKey:"main",renderAs:"action",kind:{top:"bubble",bottom:"bubble"}}];return this.actionArtifact(e)&&n.push({message:e,partKey:"artifact",renderAs:"artifact-of-action",kind:{top:"card",bottom:"card"}}),n}return this.artifactOf(e)?[{message:e,partKey:"main",renderAs:"artifact",kind:{top:"card",bottom:"card"}}]:e.text_md||this.attachmentsOf(e).length?[{message:e,partKey:"main",renderAs:"bubble",kind:{top:"bubble",bottom:"bubble"}}]:[]},cornersFor(e,t){var H,se,ge;const n=e.items,r=(H=n[t])==null?void 0:H.kind,i=(se=n[t-1])==null?void 0:se.kind,s=(ge=n[t+1])==null?void 0:ge.kind,o=e.role==="user",a=14,l=4,f=i==null?void 0:i.bottom,u=s==null?void 0:s.top,_=this.widthByKey[this.rowKeyOf(e,t)],A=this.widthByKey[this.rowKeyOf(e,t-1)],k=this.widthByKey[this.rowKeyOf(e,t+1)],$=.5,T=(he,ke,G)=>he!=null&&_!=null?he+$>=_:ke===G||ke==="card"&&G==="bubble";let J=a,U=a,q=a,Z=a;return o?(f&&(U=l),(u||!s)&&(q=l),f&&T(A,f,r==null?void 0:r.top)&&(J=l),u&&T(k,u,r==null?void 0:r.bottom)&&(Z=l)):(f&&(J=l),(u||!s)&&(Z=l),f&&T(A,f,r==null?void 0:r.top)&&(U=l),u&&T(k,u,r==null?void 0:r.bottom)&&(q=l)),{tl:J,tr:U,br:q,bl:Z}},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?`${Tt(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 Ls(new Date(e.created_at),Vt(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 Ls(new Date(n.created_at),Vt(this.wmLocale()))}catch{return""}},hasTrailingOverlay(e){if(!e.messages.length)return!1;const t=e.messages[e.messages.length-1],n=e.items[e.items.length-1];return!!t&&(n==null?void 0:n.message)!==t},attachmentsOf(e){var n;const t=(n=e==null?void 0:e.payload)==null?void 0:n.attachments;return Array.isArray(t)?t:[]},artifactOf(e){var n;const t=(n=e==null?void 0:e.metadata)==null?void 0:n.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},actionLabel(e){var t;return((t=e==null?void 0:e.payload)==null?void 0:t.name)||(e==null?void 0:e.text_md)||this.t("common.action")},actionDetail(e){var n,r,i,s,o,a;const t=e==null?void 0:e.payload;return t?t.state==="success"?((n=t.success)==null?void 0:n.summary)||((i=(r=t.success)==null?void 0:r.metadata)==null?void 0:i.description)||"":t.state==="rejected"?((s=t.rejected)==null?void 0:s.reason)||this.t("action.rejectedByUser"):t.state==="failure"&&(((o=t.failure)==null?void 0:o.summary)||((a=t.failure)==null?void 0:a.error))||"":""},actionArtifact(e){var n,r;const t=(r=(n=e==null?void 0:e.payload)==null?void 0:n.success)==null?void 0:r.artifact;return!t||typeof t!="object"||typeof t.kind!="string"?null:t},systemLabel(e){var i,s,o;const t=(i=e==null?void 0:e.payload)==null?void 0:i.event,n=Nf[t],r=((s=e==null?void 0:e.metadata)==null?void 0:s.agent_name)||((o=e==null?void 0:e.author)==null?void 0:o.name)||this.t("messageList.anAgent");return n?this.t(n,{name:r}):(e==null?void 0:e.text_md)||this.t("messageList.conversationUpdate")},scrollToBottom(){const e=this.$refs.scrollEl;e&&(e.scrollTop=e.scrollHeight),this.showScrollDown=!1},scrollToBottomSmooth(){const e=this.$refs.scrollEl;e&&(typeof e.scrollTo=="function"?e.scrollTo({top:e.scrollHeight,behavior:"smooth"}):e.scrollTop=e.scrollHeight,this.showScrollDown=!1)}}},Uf={class:"wm-list__wrap"},Hf={key:0,class:"wm-list__loadMore",role:"status","aria-live":"polite"},Vf={class:"wm-list__loadMore-lbl"},$f={key:1,class:"wm-list__historyEnd"},Kf={key:2,class:"wm-list__sep"},zf={class:"wm-list__sep-label"},qf={key:0,class:"wm-list__sep wm-list__sep--unread"},Wf={class:"wm-list__sep-label wm-list__sep-label--unread"},Gf={key:0,class:"wm-list__sysep"},Yf={class:"wm-list__sysep-label"},Jf=["data-row-key","onPointerdown"],Xf={key:0,class:"wm-list__avatarSlot"},Qf={key:5,class:"wm-list__body"},Zf={key:0},eh={key:1,"aria-hidden":"true"},th={key:2},nh={key:0},sh={key:1,"aria-hidden":"true"},rh={key:2},ih={key:3,class:"wm-list__row wm-list__row--ai fade-up"},oh={class:"wm-list__avatarSlot"},ah=["aria-label","title"];function lh(e,t,n,r,i,s){const o=ye("AIAvatar"),a=ye("HumanAvatar"),l=ye("ActionResult"),f=ye("ArtifactRenderer"),u=ye("Bubble"),_=ye("AttachmentPreview"),A=ye("Typing");return h(),g("div",Uf,[c("div",{ref:"scrollEl",class:ee(["wm-list",{"wm-list--silent":i.silentFades}]),onScrollPassive:t[4]||(t[4]=(...k)=>s.onScroll&&s.onScroll(...k))},[n.loadingMore?(h(),g("div",Hf,[t[6]||(t[6]=c("span",{class:"wm-list__loadMore-spinner","aria-hidden":"true"},null,-1)),c("span",Vf,I(s.t("messageList.loadingHistory")),1)])):s.historyExhausted?(h(),g("div",$f,I(s.t("messageList.conversationStart")),1)):B("",!0),n.dateLabel?(h(),g("div",Kf,[t[7]||(t[7]=c("div",{class:"wm-list__line"},null,-1)),c("span",zf,I(n.dateLabel),1),t[8]||(t[8]=c("div",{class:"wm-list__line"},null,-1))])):B("",!0),(h(!0),g(Q,null,Ae(s.groups,(k,$)=>(h(),g(Q,{key:k.key},[k.key===s.unreadGroupKey?(h(),g("div",qf,[t[9]||(t[9]=c("div",{class:"wm-list__line wm-list__line--unread"},null,-1)),c("span",Wf,I(s.t("messageList.unread")),1),t[10]||(t[10]=c("div",{class:"wm-list__line wm-list__line--unread"},null,-1))])):B("",!0),k.role==="system"||k.items.length?(h(),g("div",{key:1,class:ee(["wm-list__group","wm-list__group--"+k.role])},[k.role==="system"?(h(),g("div",Gf,[t[11]||(t[11]=c("div",{class:"wm-list__line wm-list__line--strong"},null,-1)),c("span",Yf,I(k.systemLabel),1),t[12]||(t[12]=c("div",{class:"wm-list__line wm-list__line--strong"},null,-1))])):(h(),g(Q,{key:1},[(h(!0),g(Q,null,Ae(k.items,(T,J)=>(h(),g(Q,{key:`${s.messageKey(T.message)}-${T.partKey}`},[c("div",{"data-row-key":`${s.messageKey(T.message)}-${T.partKey}`,class:ee(["wm-list__row fade-up",["wm-list__row--"+k.role,{"is-pending":T.message._pending,"is-failed":T.message._failed}]]),style:Se(s.cornersStyle(k,J)),onPointerdown:U=>s.onPressStart(`${s.messageKey(T.message)}-${T.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]=dt(()=>{},["prevent"]))},[k.role!=="user"?(h(),g("div",Xf,[J===k.items.length-1?(h(),g(Q,{key:0},[k.role==="ai"?(h(),_e(o,{key:0,size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])):(h(),_e(a,{key:1,name:k.agentName,"avatar-url":k.agentAvatarUrl,size:26,tail:!0},null,8,["name","avatar-url"]))],64)):B("",!0)])):B("",!0),T.renderAs==="action"?(h(),_e(l,{key:1,state:T.message.payload.state,label:s.actionLabel(T.message),detail:s.actionDetail(T.message)},null,8,["state","label","detail"])):T.renderAs==="admin-pending"?(h(),_e(l,{key:2,state:"awaiting",label:s.t("messageList.approvalRequestSent"),detail:T.message.text_md||""},null,8,["label","detail"])):T.renderAs==="artifact-of-action"?(h(),_e(f,{key:3,artifact:s.actionArtifact(T.message)},null,8,["artifact"])):T.renderAs==="artifact"?(h(),_e(f,{key:4,artifact:s.artifactOf(T.message)},null,8,["artifact"])):(h(),g("div",Qf,[T.message.text_md?(h(),_e(u,{key:0,role:k.role,text:T.message.text_md},null,8,["role","text"])):B("",!0),s.attachmentsOf(T.message).length?(h(),g("div",{key:1,class:ee(["wm-list__atts",{"wm-list__atts--align-end":k.role==="user"}])},[(h(!0),g(Q,null,Ae(s.attachmentsOf(T.message),(U,q)=>(h(),_e(_,{key:`${s.messageKey(T.message)}-att-${q}`,attachment:U},null,8,["attachment"]))),128))],2)):B("",!0)]))],46,Jf),J<k.items.length-1&&i.pressedItemKey===`${s.messageKey(T.message)}-${T.partKey}`&&(k.role!=="user"||s.timeOf(T.message))?(h(),g("div",{key:0,class:ee(["wm-list__meta wm-list__meta--press",{"wm-list__meta--right":k.role==="user"}])},[k.role!=="user"?(h(),g("span",Zf,I(s.roleLabel(k)),1)):B("",!0),k.role!=="user"&&s.timeOf(T.message)?(h(),g("span",eh,"ยท")):B("",!0),s.timeOf(T.message)?(h(),g("span",th,I(s.timeOf(T.message)),1)):B("",!0)],2)):B("",!0)],64))),128)),(k.role!=="user"||s.lastTimeOf(k))&&!s.hasTrailingOverlay(k)?(h(),g("div",{key:0,class:ee(["wm-list__meta",{"wm-list__meta--right":k.role==="user"}])},[k.role!=="user"?(h(),g("span",nh,I(s.roleLabel(k)),1)):B("",!0),k.role!=="user"&&s.lastTimeOf(k)?(h(),g("span",sh,"ยท")):B("",!0),s.lastTimeOf(k)?(h(),g("span",rh,I(s.lastTimeOf(k)),1)):B("",!0)],2)):B("",!0)],64))],2)):B("",!0)],64))),128)),n.streamingActive?(h(),g("div",ih,[c("div",oh,[ve(o,{size:26,tail:!0,name:n.aiAgentName,"image-url":n.aiAgentAvatarUrl},null,8,["name","image-url"])]),ve(A)])):B("",!0)],34),ve(yo,{name:"wm-scrollDown"},{default:Ks(()=>[i.showScrollDown?(h(),g("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]=(...k)=>s.scrollToBottomSmooth&&s.scrollToBottomSmooth(...k))},[...t[13]||(t[13]=[c("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"},[c("path",{d:"M6 9l6 6 6-6"})],-1)])],8,ah)):B("",!0)]),_:1})])}const ch=we(jf,[["render",lh],["__scopeId","data-v-9ddbd0e3"]]),Fn=typeof navigator<"u"&&!!navigator.mediaDevices&&typeof navigator.mediaDevices.getDisplayMedia=="function",Qs=typeof window<"u"&&typeof window.MediaRecorder<"u";function uh(){return Qs&&["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 So({audio:e}){return{video:!0,audio:!!e,selfBrowserSurface:"include",surfaceSwitching:"include",systemAudio:e?"include":"exclude"}}async function dh(){if(!Fn)return null;let e;try{e=await navigator.mediaDevices.getDisplayMedia(So({audio:!1}))}catch(t){return(t==null?void 0:t.name)!=="NotAllowedError"&&console.error("[media] screenshot picker",t),null}try{return await fh(e)}catch(t){return console.error("[media] screenshot capture",t),null}finally{e.getTracks().forEach(t=>{t.stop()})}}async function fh(e){const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.srcObject=e,await t.play(),await new Promise(a=>requestAnimationFrame(a));const n=t.videoWidth||1280,r=t.videoHeight||720,i=document.createElement("canvas");i.width=n,i.height=r,i.getContext("2d").drawImage(t,0,0,n,r);const s=await new Promise((a,l)=>{i.toBlob(f=>f?a(f):l(new Error("toBlob failed")),"image/png")}),o=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);return new File([s],`capture-${o}.png`,{type:"image/png"})}async function hh(e={}){var f;if(!Fn||!Qs)return null;let t;try{t=await navigator.mediaDevices.getDisplayMedia(So({audio:!0}))}catch(u){return(u==null?void 0:u.name)!=="NotAllowedError"&&console.error("[media] record picker",u),null}const n=uh();let r;try{r=n?new window.MediaRecorder(t,{mimeType:n}):new window.MediaRecorder(t)}catch(u){return console.error("[media] recorder init",u),t.getTracks().forEach(_=>{_.stop()}),null}const i=[];let s=null,o=!1;r.addEventListener("dataavailable",u=>{u.data&&u.data.size>0&&i.push(u.data)}),r.addEventListener("stop",()=>{var u,_;if(s&&clearInterval(s),t.getTracks().forEach(A=>{A.stop()}),i.length){const A=r.mimeType||n||"video/webm",k=new Blob(i,{type:A}),$=/mp4/.test(A)?"mp4":"webm",T=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),J=new File([k],`ecran-${T}.${$}`,{type:A});(u=e.onfinalize)==null||u.call(e,J)}else(_=e.oncancel)==null||_.call(e)}),t.getVideoTracks().forEach(u=>{u.addEventListener("ended",()=>a(),{once:!0})});function a(){if(!o&&(o=!0,r.state!=="inactive"))try{r.stop()}catch(u){console.error("[media] recorder stop",u)}}try{r.start(1e3)}catch(u){return console.error("[media] recorder start",u),t.getTracks().forEach(_=>{_.stop()}),null}(f=e.onstart)==null||f.call(e);const l=Date.now();return s=setInterval(()=>{var u;(u=e.ontick)==null||u.call(e,Date.now()-l)},500),{stop:a,get state(){return r.state}}}const mh=[{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"}],ph={name:"WmComposer",inject:{t:{default:()=>Oe()}},props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"ร‰crivez votre messageโ€ฆ"},disabled:{type:Boolean,default:!1},attachLabel:{type:String,default:"Joindre"},displayMode:{type:String,default:"floating"}},emits:["update:modelValue","send","attach"],data(){return{local:this.modelValue,attachOpen:!1,recording:!1,recordingElapsed:0,recorder:null,kbOffset:0}},computed:{canSend(){return!this.disabled&&!!this.local.trim()},attachItems(){return mh.map(e=>({...e,label:this.t(e.labelKey),disabled:e.action==="screenshot"&&!Fn||e.action==="record"&&(!Fn||!Qs)}))},recordingElapsedLabel(){const e=Math.floor(this.recordingElapsed/1e3),t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}},watch:{modelValue(e){e!==this.local&&(this.local=e,this.$nextTick(()=>this.autosize()))},local(e){this.$emit("update:modelValue",e)}},mounted(){this.autosize(),this.displayMode==="sheet"&&this.setupKeyboardTracking()},beforeUnmount(){if(this.recorder)try{this.recorder.stop()}catch{}this.teardownKeyboardTracking()},methods:{focus(){const e=this.$refs.inputEl;if(!(!e||this.disabled))try{e.focus({preventScroll:!0})}catch{e.focus()}},onSubmit(){if(!this.canSend)return;const e=this.local.trim();this.local="",this.$emit("send",e),this.$nextTick(()=>this.autosize())},onKeydown(e){e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.isComposing&&(e.preventDefault(),this.onSubmit())},autosize(){const e=this.$refs.inputEl;e&&(e.clientWidth<80||(e.style.height="auto",e.style.height=`${e.scrollHeight}px`))},onFile(e){const t=Array.from(e.target.files||[]);for(const n of t)this.$emit("attach",n);e.target.value=""},onAttachAction(e){this.attachOpen=!1,e==="file"?this.pickFile():e==="screenshot"?this.captureScreenshot():e==="record"&&this.startRecording()},pickFile(){var e;(e=this.$refs.fileEl)==null||e.click()},async captureScreenshot(){if(this.disabled)return;const e=await dh();e&&this.$emit("attach",e)},async startRecording(){if(this.recording||this.disabled)return;this.recordingElapsed=0;const e=await hh({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)}}},gh={key:0,class:"wm-rec"},_h={class:"wm-rec__lbl"},vh={key:1,class:"wm-compose__menu",role:"menu"},yh=["disabled","onClick"],bh={class:"wm-compose__menuIcon"},wh={viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},kh=["d"],Ch=["placeholder","disabled"],Sh={class:"wm-compose__actions"},Ah=["title","aria-label","disabled"],xh=["disabled","aria-label"];function Th(e,t,n,r,i,s){return h(),g("div",{class:ee(["wm-compose-wrap",{"wm-compose-wrap--sheet":n.displayMode==="sheet"}]),style:Se(i.kbOffset?{transform:`translateY(-${i.kbOffset}px)`}:null)},[i.recording?(h(),g("div",gh,[t[8]||(t[8]=c("span",{class:"wm-rec__dot","aria-hidden":"true"},null,-1)),c("span",_h,I(s.t("composer.recording",{time:s.recordingElapsedLabel})),1),c("button",{type:"button",class:"wm-rec__stop",onClick:t[0]||(t[0]=(...o)=>s.stopRecording&&s.stopRecording(...o))},I(s.t("composer.stop")),1)])):B("",!0),c("form",{class:ee(["wm-compose",{"has-attach":i.attachOpen}]),onSubmit:t[7]||(t[7]=dt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]))},[c("input",{ref:"fileEl",type:"file",hidden:"",multiple:"",onChange:t[1]||(t[1]=(...o)=>s.onFile&&s.onFile(...o))},null,544),i.attachOpen?(h(),g("div",{key:0,class:"wm-compose__overlay",onClick:t[2]||(t[2]=o=>i.attachOpen=!1)})):B("",!0),i.attachOpen?(h(),g("div",vh,[(h(!0),g(Q,null,Ae(s.attachItems,o=>(h(),g("button",{key:o.action,type:"button",class:"wm-compose__menuItem",disabled:o.disabled,onClick:a=>s.onAttachAction(o.action)},[c("span",bh,[(h(),g("svg",wh,[c("path",{d:o.path,stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,kh)]))]),c("span",null,I(o.label),1)],8,yh))),128))])):B("",!0),it(c("textarea",{ref:"inputEl","onUpdate:modelValue":t[3]||(t[3]=o=>i.local=o),class:"wm-compose__input",rows:"3",placeholder:n.placeholder,disabled:n.disabled,onKeydown:t[4]||(t[4]=(...o)=>s.onKeydown&&s.onKeydown(...o)),onInput:t[5]||(t[5]=(...o)=>s.autosize&&s.autosize(...o))},null,40,Ch),[[Ot,i.local]]),c("div",Sh,[c("button",{type:"button",class:ee(["wm-compose__icon",{"is-open":i.attachOpen}]),title:n.attachLabel,"aria-label":n.attachLabel,disabled:i.recording,onClick:t[6]||(t[6]=o=>i.attachOpen=!i.attachOpen)},[...t[9]||(t[9]=[c("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"},[c("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})],-1)])],10,Ah),c("button",{type:"submit",class:ee(["wm-compose__send",{"is-empty":!s.canSend}]),disabled:!s.canSend,"aria-label":s.t("composer.send")},[...t[10]||(t[10]=[c("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"},[c("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"})],-1)])],10,xh)])],34)],6)}const Mh=we(ph,[["render",Th],["__scopeId","data-v-01e81a27"]]),Eh={name:"WmSuggestionChips",props:{items:{type:Array,default:()=>[]},baseDelay:{type:Number,default:360},stepDelay:{type:Number,default:90}},emits:["select"],computed:{batchKey(){return this.items.map(e=>(e==null?void 0:e.label)||(e==null?void 0:e.text)||"").join("ยง")}}},Oh=["onClick"];function Ih(e,t,n,r,i,s){return n.items.length?(h(),g("div",{key:s.batchKey,class:"wm-chips"},[(h(!0),g(Q,null,Ae(n.items,(o,a)=>(h(),g("button",{key:a,type:"button",class:"wm-chip",style:Se({animationDelay:n.baseDelay+a*n.stepDelay+"ms"}),onClick:l=>e.$emit("select",o)},I(o.label),13,Oh))),128))])):B("",!0)}const Lh=we(Eh,[["render",Ih],["__scopeId","data-v-47ad8085"]]),Rh={name:"WmApprovalCard",components:{AIAvatar:wn},inject:{t:{default:()=>Oe()}},props:{action:{type:String,required:!0},detail:{type:String,default:""},callbacks:{type:Array,default:()=>[]},agentName:{type:String,default:""},agentAvatarUrl:{type:String,default:null}},emits:["callback"],computed:{approveCallback(){return this.callbacks.find(e=>e.id==="approve"||e.style==="primary")||this.callbacks[0]},rejectCallback(){return this.callbacks.find(e=>e.id==="reject"||e.style==="danger"||e.style==="neutral")||(this.callbacks.length>1?this.callbacks[1]:null)},approveId(){var e;return(e=this.approveCallback)==null?void 0:e.id},rejectId(){var e;return(e=this.rejectCallback)==null?void 0:e.id},approveLabel(){var e;return((e=this.approveCallback)==null?void 0:e.label)||this.t("approval.approve")},rejectLabel(){var e;return((e=this.rejectCallback)==null?void 0:e.label)||this.t("approval.reject")}}},Bh={class:"wm-approval"},Ph={class:"wm-approval__head"},Nh={class:"wm-approval__icon"},Fh={class:"wm-approval__main"},Dh={class:"wm-approval__title"},jh={key:0,class:"wm-approval__detail"},Uh={class:"wm-approval__actions"};function Hh(e,t,n,r,i,s){const o=ye("AIAvatar");return h(),g("div",Bh,[c("div",Ph,[c("div",Nh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),c("div",Fh,[c("div",Dh,I(n.action),1),n.detail?(h(),g("div",jh,I(n.detail),1)):B("",!0)])]),c("div",Uh,[s.rejectId?(h(),g("button",{key:0,type:"button",class:"wm-approval__btn wm-approval__btn--neutral",onClick:t[0]||(t[0]=a=>e.$emit("callback",s.rejectId))},I(s.rejectLabel),1)):B("",!0),s.approveId?(h(),g("button",{key:1,type:"button",class:"wm-approval__btn wm-approval__btn--primary",onClick:t[1]||(t[1]=a=>e.$emit("callback",s.approveId))},I(s.approveLabel),1)):B("",!0)])])}const Vh=we(Rh,[["render",Hh],["__scopeId","data-v-a2bed37e"]]);let Yr=0;const $h=new Set(["text","textarea","number","boolean","select","multiselect","date"]),Kh={name:"WmFormCard",components:{AIAvatar:wn},inject:{t:{default:()=>Oe()}},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 Yr+=1,{_uid:Yr,values:{},busy:!1,error:""}},computed:{normalizedFields(){var t;return(Array.isArray((t=this.form)==null?void 0:t.fields)?this.form.fields:[]).filter(n=>!(!(n!=null&&n.key)||!(n!=null&&n.label)||!$h.has(n==null?void 0:n.type)||(n.type==="select"||n.type==="multiselect")&&(!Array.isArray(n.options)||n.options.length===0)))}},created(){this.resetValues()},methods:{resetValues(){const e=this.initialValues&&typeof this.initialValues=="object"?this.initialValues:{},t={};for(const n of this.normalizedFields){if(e[n.key]!==void 0){t[n.key]=e[n.key];continue}n.type==="boolean"?t[n.key]=!1:n.type==="multiselect"?t[n.key]=[]:t[n.key]=""}this.values=t,this.error=""},toggleMulti(e,t,n){const r=Array.isArray(this.values[e])?this.values[e].slice():[],i=r.indexOf(t);n&&i===-1?r.push(t):!n&&i!==-1&&r.splice(i,1),this.values={...this.values,[e]:r}},validate(){for(const e of this.normalizedFields){if(!e.required)continue;const t=this.values[e.key];if(e.type!=="boolean"){if(e.type==="multiselect"){if(!Array.isArray(t)||t.length===0)return this.t("form.fieldRequired",{label:e.label});continue}if(t==null||t==="")return this.t("form.fieldRequired",{label:e.label})}}return""},async onSubmit(){if(this.readOnly||this.busy)return;const e=this.validate();if(e){this.error=e;return}this.error="",this.busy=!0;try{await this.$emit("submit",{values:this.values})}finally{this.busy=!1}}}},zh={class:"wm-form"},qh={class:"wm-form__head"},Wh={class:"wm-form__icon"},Gh={class:"wm-form__main"},Yh={class:"wm-form__title"},Jh={key:0,class:"wm-form__detail"},Xh=["for"],Qh={key:0,class:"wm-form__req","aria-hidden":"true"},Zh=["id","onUpdate:modelValue","placeholder","required","disabled"],em=["id","onUpdate:modelValue","placeholder","required","disabled"],tm=["id","onUpdate:modelValue","placeholder","required","disabled"],nm=["id","onUpdate:modelValue","required","disabled"],sm={key:4,class:"wm-form__bool"},rm=["id","onUpdate:modelValue","disabled"],im=["id","onUpdate:modelValue","required","disabled"],om={value:"",disabled:""},am=["value"],lm={key:6,class:"wm-form__multi"},cm=["value","checked","disabled","onChange"],um={key:0,class:"wm-form__err"},dm=["disabled"],fm={key:0,class:"wm-form__spinner","aria-hidden":"true"},hm={key:2,class:"wm-form__doneLbl"};function mm(e,t,n,r,i,s){const o=ye("AIAvatar");return h(),g("div",zh,[c("div",qh,[c("div",Wh,[ve(o,{size:24,name:n.agentName,"image-url":n.agentAvatarUrl},null,8,["name","image-url"])]),c("div",Gh,[c("div",Yh,I(n.form.title||s.t("form.title")),1),n.form.description?(h(),g("div",Jh,I(n.form.description),1)):B("",!0)])]),c("form",{class:"wm-form__body",onSubmit:t[0]||(t[0]=dt((...a)=>s.onSubmit&&s.onSubmit(...a),["prevent"]))},[(h(!0),g(Q,null,Ae(s.normalizedFields,a=>(h(),g("div",{key:a.key,class:"wm-form__field"},[c("label",{for:`wm-f-${i._uid}-${a.key}`,class:"wm-form__label"},[Xn(I(a.label),1),a.required?(h(),g("span",Qh,"*")):B("",!0)],8,Xh),a.type==="text"?it((h(),g("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,Zh)),[[Ot,i.values[a.key]]]):a.type==="textarea"?it((h(),g("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,em)),[[Ot,i.values[a.key]]]):a.type==="number"?it((h(),g("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,tm)),[[Ot,i.values[a.key],void 0,{number:!0}]]):a.type==="date"?it((h(),g("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,nm)),[[Ot,i.values[a.key]]]):a.type==="boolean"?(h(),g("label",sm,[it(c("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,rm),[[zl,i.values[a.key]]]),c("span",null,I(a.placeholder||s.t("common.yes")),1)])):a.type==="select"?it((h(),g("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},[c("option",om,I(a.placeholder||s.t("form.choose")),1),(h(!0),g(Q,null,Ae(a.options,l=>(h(),g("option",{key:l.value,value:l.value},I(l.label),9,am))),128))],8,im)),[[ql,i.values[a.key]]]):a.type==="multiselect"?(h(),g("div",lm,[(h(!0),g(Q,null,Ae(a.options,l=>(h(),g("label",{key:l.value,class:"wm-form__multiItem"},[c("input",{type:"checkbox",value:l.value,checked:Array.isArray(i.values[a.key])&&i.values[a.key].includes(l.value),disabled:n.readOnly||i.busy,onChange:f=>s.toggleMulti(a.key,l.value,f.target.checked)},null,40,cm),c("span",null,I(l.label),1)]))),128))])):B("",!0)]))),128)),i.error?(h(),g("div",um,I(i.error),1)):B("",!0),n.readOnly?(h(),g("div",hm,I(s.t("form.responseSent")),1)):(h(),g("button",{key:1,type:"submit",class:"wm-form__submit",disabled:i.busy},[i.busy?(h(),g("span",fm)):B("",!0),c("span",null,I(i.busy?s.t("common.sending"):n.form.submit_label||s.t("common.send")),1)],8,dm))],32)])}const pm=we(Kh,[["render",mm],["__scopeId","data-v-fe65cc56"]]),gm={name:"WmFeedback",inject:{t:{default:()=>Oe()}},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})}}},_m={class:"wm-fb"},vm={class:"wm-fb__title"},ym={class:"wm-fb__sub"},bm={class:"wm-fb__row"},wm=["onClick"],km={class:"wm-fb__emoji"},Cm={class:"wm-fb__label"},Sm=["disabled"],Am={key:1,class:"wm-fb__done"},xm={class:"wm-fb__doneTitle"},Tm={class:"wm-fb__doneSub"};function Mm(e,t,n,r,i,s){return h(),g("div",_m,[n.done?(h(),g("div",Am,[t[1]||(t[1]=c("div",{class:"wm-fb__check"},[c("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"},[c("path",{d:"M20 6L9 17l-5-5"})])],-1)),c("div",xm,I(s.t("feedback.doneTitle")),1),c("div",Tm,I(s.t("feedback.doneSubtitle")),1)])):(h(),g(Q,{key:0},[c("div",vm,I(s.t("feedback.question")),1),c("div",ym,I(s.t("feedback.subtitle")),1),c("div",bm,[(h(!0),g(Q,null,Ae(s.options,o=>(h(),g("button",{key:o.v,type:"button",class:ee(["wm-fb__opt",{"is-selected":i.sel===o.v}]),onClick:a=>i.sel=o.v},[c("span",km,I(o.e),1),c("span",Cm,I(o.l),1)],10,wm))),128))]),c("button",{type:"button",class:"wm-fb__send",disabled:!i.sel||n.busy,onClick:t[0]||(t[0]=(...o)=>s.onSend&&s.onSend(...o))},I(n.busy?s.t("common.sending"):s.t("feedback.submit")),9,Sm)],64))])}const Em=we(gm,[["render",Mm],["__scopeId","data-v-9b630564"]]),Om={name:"WmMoreMenu",inject:{t:{default:()=>Oe()}},props:{canRename:{type:Boolean,default:!0},canExport:{type:Boolean,default:!0},soundEnabled:{type:Boolean,default:!0},browserNotifEnabled:{type:Boolean,default:!1},statusUrl:{type:String,default:""},helpUrl:{type:String,default:""}},emits:["close","action","sound-toggle","browser-notif-toggle"],data(){return{soundOn:this.soundEnabled,browserNotifOn:this.browserNotifEnabled}},watch:{soundEnabled(e){this.soundOn=!!e},browserNotifEnabled(e){this.browserNotifOn=!!e}},methods:{emit(e){this.$emit("action",e)},toggleSound(){this.soundOn=!this.soundOn,this.$emit("sound-toggle",this.soundOn)},toggleBrowserNotif(){this.browserNotifOn=!this.browserNotifOn,this.$emit("browser-notif-toggle",this.browserNotifOn)}}},Im={class:"wm-mm"},Lm={class:"wm-mm__pop",role:"menu"},Rm={key:0,class:"wm-mm__section"},Bm={class:"wm-mm__label"},Pm={class:"wm-mm__label"},Nm={key:1,class:"wm-mm__sep"},Fm={class:"wm-mm__section"},Dm={class:"wm-mm__label"},jm={class:"wm-mm__label"},Um={class:"wm-mm__section"},Hm={class:"wm-mm__label"},Vm={class:"wm-mm__label"};function $m(e,t,n,r,i,s){return h(),g("div",Im,[c("div",{class:"wm-mm__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),c("div",Lm,[n.canRename||n.canExport?(h(),g("div",Rm,[n.canRename?(h(),g("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[1]||(t[1]=o=>s.emit("rename"))},[t[7]||(t[7]=c("span",{class:"wm-mm__icon"},[c("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"},[c("path",{d:"M12 20h9"}),c("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z"})])],-1)),c("span",Bm,I(s.t("moreMenu.editTitle")),1)])):B("",!0),n.canExport?(h(),g("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[2]||(t[2]=o=>s.emit("export"))},[t[8]||(t[8]=c("span",{class:"wm-mm__icon"},[c("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"},[c("path",{d:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13"})])],-1)),c("span",Pm,I(s.t("moreMenu.exportTranscript")),1),t[9]||(t[9]=c("span",{class:"wm-mm__hint"},".txt",-1))])):B("",!0)])):B("",!0),n.canRename||n.canExport?(h(),g("div",Nm)):B("",!0),c("div",Fm,[c("button",{type:"button",class:"wm-mm__item",onClick:t[3]||(t[3]=(...o)=>s.toggleSound&&s.toggleSound(...o))},[t[11]||(t[11]=c("span",{class:"wm-mm__icon"},[c("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"},[c("path",{d:"M11 5L6 9H2v6h4l5 4V5z"}),c("path",{d:"M15.54 8.46a5 5 0 010 7.07M19.07 4.93a10 10 0 010 14.14"})])],-1)),c("span",Dm,I(s.t("moreMenu.sound")),1),c("span",{class:ee(["wm-mm__toggle",{"wm-mm__toggle--on":i.soundOn}])},[...t[10]||(t[10]=[c("span",{class:"wm-mm__knob"},null,-1)])],2)]),c("button",{type:"button",class:"wm-mm__item",onClick:t[4]||(t[4]=(...o)=>s.toggleBrowserNotif&&s.toggleBrowserNotif(...o))},[t[13]||(t[13]=c("span",{class:"wm-mm__icon"},[c("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"},[c("path",{d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.2V11a6 6 0 10-12 0v3.2c0 .5-.2 1-.6 1.4L4 17h5m6 0a3 3 0 11-6 0"})])],-1)),c("span",jm,I(s.t("moreMenu.browserNotifications")),1),c("span",{class:ee(["wm-mm__toggle",{"wm-mm__toggle--on":i.browserNotifOn}])},[...t[12]||(t[12]=[c("span",{class:"wm-mm__knob"},null,-1)])],2)])]),t[16]||(t[16]=c("div",{class:"wm-mm__sep"},null,-1)),c("div",Um,[n.statusUrl?(h(),g("button",{key:0,type:"button",class:"wm-mm__item",onClick:t[5]||(t[5]=o=>s.emit("status"))},[t[14]||(t[14]=c("span",{class:"wm-mm__icon"},[c("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"},[c("path",{d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zM10 6v4l3 2"})])],-1)),c("span",Hm,I(s.t("moreMenu.serviceStatus")),1)])):B("",!0),n.helpUrl?(h(),g("button",{key:1,type:"button",class:"wm-mm__item",onClick:t[6]||(t[6]=o=>s.emit("help"))},[t[15]||(t[15]=c("span",{class:"wm-mm__icon"},[c("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"},[c("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)),c("span",Vm,I(s.t("moreMenu.helpCenter")),1)])):B("",!0)])])])}const Km=we(Om,[["render",$m],["__scopeId","data-v-76281e95"]]),zm={name:"WmRenameDialog",inject:{t:{default:()=>Oe()}},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"},Wm={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"},ep=["disabled"];function tp(e,t,n,r,i,s){return h(),g("div",qm,[c("div",{class:"wm-dialog__scrim",onClick:t[0]||(t[0]=o=>e.$emit("close"))}),c("div",Wm,[c("div",Gm,[c("div",Ym,I(n.title||s.t("rename.title")),1),c("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]=[c("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"},[c("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Jm)]),c("div",Xm,[it(c("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]=Nn(dt((...o)=>s.onSubmit&&s.onSubmit(...o),["prevent"]),["enter"])),t[4]||(t[4]=Nn(dt(o=>e.$emit("close"),["prevent"]),["esc"]))]},null,40,Qm),[[Ot,i.value]])]),c("div",Zm,[c("button",{type:"button",class:"wm-dialog__btn",onClick:t[5]||(t[5]=o=>e.$emit("close"))},I(s.t("common.cancel")),1),c("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))},I(s.t("common.save")),9,ep)])])])}const np=we(zm,[["render",tp],["__scopeId","data-v-6d5f94a8"]]),Jr="ww-messenger-tokens",sp={name:"Messenger",components:{Launcher:Wc,Header:vu,Onboarding:pd,MessageList:ch,Composer:Mh,SuggestionChips:Lh,ApprovalCard:Vh,FormCard:pm,Feedback:Em,MoreMenu:Km,RenameDialog:np},mixins:[vc,Sc,Ac,Tc],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:uc},widgetId:{type:String,default:""},context:{type:Object,default:null},displayMode:{type:String,default:"floating"},devtools:{type:Boolean,default:!1},language:{type:String,default:""}},data(){return{transport:null,store:null,isOpen:!1,launcherHovered:!1,draft:"",busy:!1,bootError:null,pendingAttachments:[],feedbackBusy:!1,feedbackDone:!1,convOpenedAt:0,moreOpen:!1,renameDialogOpen:!1,draftConv:null,activeConvId:null,showOnboarding:!1,dismissedPeeks:{},floatHeight:0,floatRO:null,parentOrigin:"",parentToken:"",parentContext: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 Js(this.language||this.customerLanguage||((e=this.widget)==null?void 0:e.default_language)||"")},translator(){return Oe(this.locale)},error(){var e;return this.bootError||((e=this.s)==null?void 0:e.error)||null},canBoot(){return!!(this.baseUrl&&this.widgetId)},s(){var e;return((e=this.store)==null?void 0:e.state)||null},ready(){var e;return!!((e=this.s)!=null&&e.ready)},allConversations(){var t;const e=(t=this.s)==null?void 0:t.conversations;return Array.isArray(e)?e:[]},drawerConversations(){var n;const e=((n=this.s)==null?void 0:n.messagesByConv)||{},t=this.revealedAt;return this.allConversations.map(r=>{var f;const i=e[r.id]||[],s=ut(r.last_read_message_id);let o=0,a=null;for(let u=i.length-1;u>=0;u--){const _=i[u];if(!_)continue;if(((f=_.author)==null?void 0:f.type)==="user")break;const A=ut(_.id);if(A!=null){if(s!=null&&A<=s)break;t[_.id]!==0&&(!a&&_.author&&(a=_.author),o++)}}if(!i.length){const u=ut(r.last_message_id);u!=null&&(s==null||u>s)&&(o=1,a=r.last_message_author||null)}const l=i.filter(u=>!((u==null?void 0:u.id)!=null&&t[u.id]===0));return{...r,_preview:mc(r,l),_unread:o>0,_unreadCount:o,_lastAuthor:a}})},unreadCount(){return this.drawerConversations.filter(e=>e._unread).length},openThreads(){var t;const e=((t=this.s)==null?void 0:t.messagesByConv)||{};return this.drawerConversations.filter(n=>n.status!=="resolved").map(n=>({id:n.id,title:n.name||this.t("common.newConversation"),preview:n._preview||this.t("onboarding.newMessage"),unread:!!n._unread,author:n._lastAuthor||null,_ts: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)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},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?{"--wm-primary":e}:null},widgetWelcomeMessage(){var e;return((e=this.widget)==null?void 0:e.welcome_message)||""},widgetSubtitle(){var e;return((e=this.widget)==null?void 0:e.subtitle)||""},defaultIconUrl(){var e;return((e=this.widget)==null?void 0:e.default_icon_url)||null},agentName(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.name)||""},agentAvatarUrl(){var e,t,n;return((n=(t=(e=this.s)==null?void 0:e.config)==null?void 0:t.agent)==null?void 0:n.avatar_url)||null},quickLinks(){var t;const e=(t=this.widget)==null?void 0:t.quick_links;return Array.isArray(e)?e:[]},teamMembers(){var t;const e=(t=this.widget)==null?void 0:t.team_members;return Array.isArray(e)?e:[]},responseLabel(){var e;return((e=this.widget)==null?void 0:e.response_time_label)||""},humanMessageAuthor(){var t,n,r;if(!this.currentConv)return null;const e=((t=this.s.messagesByConv)==null?void 0:t[this.currentConv.id])||[];for(let i=e.length-1;i>=0;i--)if(((r=(n=e[i])==null?void 0:n.author)==null?void 0:r.type)==="agent_human")return e[i].author;return null},humanAgentName(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.name)||""},humanAgentAvatarUrl(){var e;return((e=this.humanMessageAuthor)==null?void 0:e.avatar_url)||null},isEscalated(){return!!this.humanMessageAuthor},isWaitingHuman(){var t;const e=(t=this.currentConv)==null?void 0:t.status;return e==="waiting"||e==="handled"},headerTitle(){var e,t;return((e=this.currentConv)==null?void 0:e.name)||((t=this.widget)==null?void 0:t.name)||this.t("common.newConversation")},composerPlaceholder(){return this.isEscalated&&this.humanAgentName?this.t("composer.replyTo",{name:this.humanAgentName.split(" ")[0]}):this.isWaitingHuman?this.t("composer.agentTakingOver"):this.t("composer.placeholder")},displayedMessages(){var n,r;const e=this.currentConv;if(!e)return[];if(!e._draft){const i=(r=(n=this.s)==null?void 0:n.paginationByConv)==null?void 0:r[e.id];if(!(i!=null&&i.loaded))return[]}const t=this.revealedAt;return(this.s.messagesByConv[e.id]||[]).filter(i=>{var s,o,a,l,f;return(i==null?void 0:i.type)==="action"&&((s=i==null?void 0:i.payload)==null?void 0:s.state)==="pending"||_n(i)&&!(t[i.id]>0)?!1:(i==null?void 0:i.type)==="action"||(i==null?void 0:i.type)==="system"||((o=i==null?void 0:i.payload)==null?void 0:o.type)==="system"||Array.isArray((a=i==null?void 0:i.payload)==null?void 0:a.attachments)&&i.payload.attachments.length||(l=i==null?void 0:i.metadata)!=null&&l.artifact||(f=i==null?void 0:i.metadata)!=null&&f.form?!0:typeof(i==null?void 0:i.text_md)=="string"&&i.text_md.trim().length>0})},streamingActive(){var n,r,i;const e=this.currentConv;return e?Object.keys(((n=this.s)==null?void 0:n.streamingByMsgId)||{}).length>0?!0:this.actionInFlight?!1:(((i=(r=this.s)==null?void 0:r.messagesByConv)==null?void 0:i[e.id])||[]).some(s=>_n(s)&&!(this.revealedAt[s.id]>0)):!1},currentConvMessages(){var t,n,r;const e=(t=this.currentConv)==null?void 0:t.id;return e?((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e])||[]:[]},pendingApproval(){return!this.currentConv||!this.store||this.actionInFlight?null:this.store.getPendingApproval(this.currentConv.id)},approvalReady(){return this.pendingApproval?this.pendingApproval.id===this.approvalLatchId?!0:!(this.streamingActive||!this.approvalSettled):!1},approvalTitle(){var e,t,n;return((t=(e=this.pendingApproval)==null?void 0:e.payload)==null?void 0:t.name)||((n=this.pendingApproval)==null?void 0:n.text_md)||this.t("action.title")},approvalDetail(){var r,i,s,o,a,l;const e=(s=(i=(r=this.pendingApproval)==null?void 0:r.payload)==null?void 0:i.pending)==null?void 0:s.user_explanation;if(typeof e=="string"&&e.trim())return e.trim();const t=(l=(a=(o=this.pendingApproval)==null?void 0:o.payload)==null?void 0:a.pending)==null?void 0:l.prepared_params;if(!t||typeof t!="object")return"";const n=Object.entries(t);return n.length?n.slice(0,2).map(([f,u])=>`${f}: ${u}`).join(" ยท "):""},actionInFlight(){var e,t;return!this.currentConv||!this.store?null:((t=(e=this.store).getActionInFlight)==null?void 0:t.call(e,this.currentConv.id))||null},actionInFlightName(){var t;const e=this.actionInFlight;return e?((t=e.payload)==null?void 0:t.name)||e.text_md||this.t("common.action"):""},suggestions(){return!this.currentConv||!this.store?[]:this.streamingActive?[]:this.pendingForm?[]:this.store.getLatestSuggestions(this.currentConv.id)},pendingForm(){var e,t;return!this.currentConv||!this.store||this.pendingApproval||this.actionInFlight||this.streamingActive||!this.approvalSettled?null:((t=(e=this.store).getLatestForm)==null?void 0:t.call(e,this.currentConv.id))||null},showFeedback(){var t;const e=this.currentConv;return e?this.feedbackDone?!0:e.status!=="resolved"?!1:!((t=e.metadata)!=null&&t.feedback):!1},floatVisible(){return this.approvalReady||!!this.pendingForm||this.showFeedback||this.suggestions.length>0},dateLabel(){var n,r,i;const e=this.currentConv;let t=new Date;if(e){const o=((i=(((r=(n=this.s)==null?void 0:n.messagesByConv)==null?void 0:r[e.id])||[]).find(a=>a==null?void 0:a.created_at))==null?void 0:i.created_at)||e.created_at;if(o){const a=new Date(o);Number.isNaN(a.getTime())||(t=a)}}return this.t("messageList.today",{time:Ls(t,Vt(this.locale))})},paginationState(){var n,r,i;const e=(n=this.currentConv)==null?void 0:n.id,t=e?(i=(r=this.s)==null?void 0:r.paginationByConv)==null?void 0:i[e]:null;return{loading:!!(t!=null&&t.loading),hasMore:!!(t!=null&&t.nextCursor)}}},watch:{latestUnreads:{handler(e){const t=new Set(e.map(o=>o.convId)),n=this.dismissedPeeks||{},r=Object.keys(n);if(!r.length)return;const i={};let s=!1;for(const o of r)t.has(o)?i[o]=n[o]:s=!0;s&&(this.dismissedPeeks=i)},deep:!0},"currentConv.id":{handler(e){var t;this.resetRevealQueue(),this.convOpenedAt=Date.now(),this.moreOpen=!1,this.renameDialogOpen=!1,this.resetApprovalPacing(),this.isViewingThread&&(this.unreadAnchorId=ut((t=this.currentConv)==null?void 0:t.last_read_message_id),this.unreadBoundaryTs=e?new Date().toISOString():"")},immediate:!0},isViewingThread(e,t){var n;e&&!t?(this.unreadAnchorId=ut((n=this.currentConv)==null?void 0:n.last_read_message_id),this.unreadBoundaryTs=new Date().toISOString()):e||(this.unreadAnchorId=null,this.unreadBoundaryTs="")},pendingApproval:{handler(e,t){if(e&&!t){const n=e!=null&&e.created_at?Date.parse(e.created_at):NaN;if(!(Number.isFinite(n)&&n>=this.convOpenedAt)){this.resetApprovalPacing();return}this.bumpApprovalSettle(2600)}else!e&&t&&this.resetApprovalPacing()},immediate:!1},streamingActive(e,t){e!==t&&this.pendingApproval&&this.pendingApproval.id!==this.approvalLatchId&&this.bumpApprovalSettle()},approvalReady(e){e&&this.pendingApproval&&(this.approvalLatchId=this.pendingApproval.id)},floatVisible:{handler(e){this.$nextTick(()=>this.syncFloatObserver(e))},immediate:!0},currentConvMessages(e){var t;this.paceMessages(e,(t=this.currentConv)==null?void 0:t.id),(this.isOpen||this.isEmbedded)&&this.currentConv&&this.markConvRead(this.currentConv)}},async mounted(){if(typeof document<"u"&&!document.getElementById(Jr)){const e=document.createElement("style");e.id=Jr,e.textContent=wo,document.head.appendChild(e)}this._parentMessageHandler=this.onParentMessage.bind(this),window.addEventListener("message",this._parentMessageHandler),window.parent&&window.parent!==window&&window.parent.postMessage({type:"READY"},"*"),this.isEmbedded?(await this.boot(),this.store&&await this.open()):(await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize())},beforeUnmount(){this._parentMessageHandler&&(window.removeEventListener("message",this._parentMessageHandler),this._parentMessageHandler=null),this._launcherRo&&(this._launcherRo.disconnect(),this._launcherRo=null),this.cancelReveals(),this.teardownLiveReveal(),this.disconnectFloatRO(),this.resetApprovalPacing(),this.teardownNotifications(),this.store&&this.store.destroy()},methods:{t(e,t){return this.translator(e,t)},waitForParentInit(){if(this.parentInitReceived)return Promise.resolve();if(!this.parentInitDeferred){let e;this.parentInitDeferred=new Promise(t=>{e=t}),this.parentInitDeferred._resolve=e}return this.parentInitDeferred},onParentMessage(e){var n;const t=e==null?void 0:e.data;!t||typeof t!="object"||t.type!=="INIT"||(this.parentOrigin=e.origin,this.parentToken=typeof t.token=="string"?t.token:"",this.parentContext=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(){var e,t;if(!this.canBoot){console.warn("[messenger] boot skipped โ€” missing creds");return}try{await this.waitForParentInit(),this.transport=ks(ic({baseUrl:this.baseUrl,widgetId:this.widgetId})),this.store=ks(cc(this.transport)),this.hydrateNotifPref();const n=((e=this.parentContext)==null?void 0:e.customer)||((t=this.context)==null?void 0:t.customer);await this.store.start({origin:this.parentOrigin,token:this.parentToken||void 0,allowUnauthenticated:this.parentAllowUnauthenticated,customer:n&&typeof n=="object"?n:void 0}),this.setupLiveReveal()}catch(n){console.error("[ww-messenger] bootstrap failed",n),this.bootError=(n==null?void 0:n.message)||String(n)}},async refresh(){this.store&&this.store.destroy(),this.cancelReveals(),this.teardownLiveReveal(),this.teardownNotifications(),this.convOpenedAt=0,this.transport=null,this.store=null,this.isOpen=!1,this.draft="",this.busy=!1,this.bootError=null,this.pendingAttachments=[],this.feedbackBusy=!1,this.feedbackDone=!1,this.moreOpen=!1,this.renameDialogOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!1,await this.boot(),this.isEmbedded&&this.store&&await this.open()},syncFloatObserver(e){if(this.disconnectFloatRO(),!e){this.floatHeight=0;return}const t=this.$refs.floatEl;if(t){if(typeof ResizeObserver>"u"){this.floatHeight=Math.ceil(t.getBoundingClientRect().height+8);return}this.floatRO=new ResizeObserver(n=>{const r=n[0];if(!r)return;const i=Math.ceil(r.contentRect.height+8);i!==this.floatHeight&&(this.floatHeight=i,this.$nextTick(()=>{var s,o;(o=(s=this.$refs.messageList)==null?void 0:s.scrollToBottom)==null||o.call(s)}))}),this.floatRO.observe(t)}},disconnectFloatRO(){if(this.floatRO){try{this.floatRO.disconnect()}catch{}this.floatRO=null}},async open(){this.isOpen=!0,this.notifyParentResize("open"),this._launcherRo&&this._launcherRo.disconnect(),this.store||await this.boot(),this.store&&this.store.setPanelOpen(!0);const e=this.currentConv;if(e&&!e._draft){this.activeConvId==null&&(this.activeConvId=e.id);try{await this.store.openConversation(e.id)}catch(t){console.error("[ww-messenger] load messages failed",t)}this.markConvRead(e)}},async close(){this.isOpen=!1,await this.$nextTick(),this.sendCurrentLauncherSize(),this.observeLauncherSize(),this.store&&this.store.setPanelOpen(!1)},notifyParentResize(e,t){if(window.parent&&window.parent!==window)try{window.parent.postMessage({type:"RESIZE",state:e,displayMode:this.displayMode,...t||{}},"*")}catch(n){console.warn("[ww-messenger] notifyParentResize failed",n)}},onLauncherHover(e){this.launcherHovered=e,this.sendCurrentLauncherSize()},sendCurrentLauncherSize(){var u,_,A,k,$,T,J;if(this.isOpen)return;const e=(_=(u=this.$el)==null?void 0:u.querySelector)==null?void 0:_.call(u,".wm-launcherWrap");if(!e)return;const t=e.getBoundingClientRect();if(!t.width||!t.height)return;const n=(((A=this.launcherPeeks)==null?void 0:A.length)??0)>0,r=16,i=Math.ceil(t.width),s=Math.ceil(t.height),o=($=(k=this.$el)==null?void 0:k.querySelector)==null?void 0:$.call(k,".wm-launcher"),a=(J=(T=this.$el)==null?void 0:T.querySelectorAll)==null?void 0:J.call(T,".wm-peek"),l=a&&a.length?a[a.length-1]:null;let f=null;if(l){const U=l.getBoundingClientRect();f={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:f,peekHovered:this.launcherHovered&&n})},observeLauncherSize(){var n,r;if(typeof ResizeObserver>"u")return;const e=(r=(n=this.$el)==null?void 0:n.querySelector)==null?void 0:r.call(n,".wm-launcherWrap");if(!e)return;this._launcherRo&&this._launcherRo.disconnect();const t=new ResizeObserver(()=>{this.isOpen||this.sendCurrentLauncherSize()});t.observe(e),this._launcherRo=t},async openFromPeek(e){var n,r;const t=e||((n=this.latestUnreads[0])==null?void 0:n.convId);t&&t!==((r=this.currentConv)==null?void 0:r.id)&&(this.draftConv=null,this.activeConvId=t,this.showOnboarding=!1),await this.open()},dismissPeek(e){const t=this.latestUnreads.find(n=>n.convId===e);t&&(this.dismissedPeeks={...this.dismissedPeeks,[e]:t.ts})},startConv(){this.draftConv={id:"__draft__",_draft:!0,name:"",created_at:new Date().toISOString()},this.activeConvId=null,this.showOnboarding=!1,this.focusComposer()},async ensureRealConv(){const e=this.currentConv;if(!e)return null;if(!e._draft)return e;if(this.busy)return null;this.busy=!0;try{const t=await this.store.createConversation({});return this.draftConv=null,this.activeConvId=t.id,await this.store.openConversation(t.id),this.markConvRead(t),t}catch(t){return console.error("[ww-messenger] create conv failed",t),this.bootError=(t==null?void 0:t.message)||String(t),null}finally{this.busy=!1}},focusComposer(){this.$nextTick(()=>{var e;return(e=this.$refs.composer)==null?void 0:e.focus()})},toggleMore(){this.moreOpen=!this.moreOpen},goHome(){this.moreOpen=!1,this.draftConv=null,this.activeConvId=null,this.showOnboarding=!0},async onDrawerPick(e){if(!(e!=null&&e.id)||!this.store)return;this.draftConv=null,this.activeConvId=e.id,this.showOnboarding=!1;try{await this.store.openConversation(e.id)}catch(n){console.error("[ww-messenger] open conv failed",n)}const t=this.allConversations.find(n=>n.id===e.id);t&&this.markConvRead(t)},async onMoreAction(e){var t,n;switch(this.moreOpen=!1,e){case"rename":this.openRenameDialog();break;case"export":_c(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(this.statusUrl)try{window.open(this.statusUrl,"_blank","noopener")}catch{}break;case"help":if(this.helpUrl)try{window.open(this.helpUrl,"_blank","noopener")}catch{}break}},openRenameDialog(){const e=this.currentConv;!e||e._draft||(this.renameDialogOpen=!0)},async onRenameSubmit(e){const t=this.currentConv;if(this.renameDialogOpen=!1,!t||t._draft||!this.store)return;const n=(e||"").trim();if(!(!n||n===t.name))try{await this.store.patchConversation(t.id,{name:n})}catch(r){console.error("[ww-messenger] rename failed",r)}},async onSend(e){let t=this.currentConv;if(!t&&(this.startConv(),t=this.currentConv,!t)||t._draft&&(t=await this.ensureRealConv(),!t))return;const n=t.id,r=this.pendingAttachments.slice();this.pendingAttachments=[],this.unreadAnchorId=null,this.unreadBoundaryTs="",await this.store.send(n,e,{attachments:r.length?r:void 0})},async onSuggestion(e){const t=e==null?void 0:e.label;t&&await this.onSend(t)},async onLoadMore(){var t;const e=(t=this.currentConv)==null?void 0:t.id;!e||!this.store||await this.store.loadMore(e)},async onApprovalCallback(e){const t=this.pendingApproval;t&&await this.store.clickCallback(t.id,e)},async onFormSubmit({values:e}){const t=this.pendingForm;if(!(t!=null&&t.form))return;const n=fc(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:hc(t.form,e,this.translator)}}))},async onAttach(e){if(!(!e||!this.transport))try{const t=await this.transport.uploadAttachment(e);this.pendingAttachments.push({type:t.type||"file",path:t.path,name:e.name||this.t("attachment.fileFallbackName"),mime_type:e.type,size_bytes:e.size})}catch(t){console.error("[ww-messenger] attachment upload failed",t)}},onPanelClick(e){const t=e.target&&e.target.closest?e.target.closest('a[href^="#"]'):null;t&&(e.preventDefault(),this.openInternalUrl(t.getAttribute("href")))},async openInternalUrl(e){if(typeof e!="string"||!e.startsWith("#"))return!1;const t=e.slice(1);if(t==="new"||t==="new-conversation")return this.isOpen||await this.open(),this.startConv(),!0;if(t.startsWith("conversation/")){const n=t.slice(13);return n&&await this.openFromPeek(n),!0}return console.warn("[messenger] unknown internal url",e),!0},async onQuickLink(e){if(e){if(e.url){if(await this.openInternalUrl(e.url))return;try{window.open(e.url,"_blank","noopener")}catch{}return}this.currentConv||this.startConv(),await this.onSend(e.label)}},async onFeedback({rating:e,comment:t}){if(this.currentConv){this.feedbackBusy=!0;try{await this.store.submitFeedback(this.currentConv.id,{rating:e,comment:t}),this.feedbackDone=!0}catch(n){console.error("[ww-messenger] feedback failed",n)}finally{this.feedbackBusy=!1}}}}},rp={key:0,class:"wm-loading","aria-busy":"true","aria-live":"polite"},ip=["aria-label"],op={key:0,class:"wm-state"},ap={class:"wm-state__err"},lp={class:"wm-state__errTitle"},cp={class:"wm-state__errSub"},up={class:"wm-bottom"},dp={key:0,ref:"floatEl",class:"wm-float"},fp={key:1,class:"wm-actionWait",role:"status","aria-live":"polite"},hp={class:"wm-actionWait__lbl"},mp={key:2,class:"wm-attached"},pp=["aria-label","onClick"];function gp(e,t,n,r,i,s){const o=ye("Launcher"),a=ye("Header"),l=ye("Onboarding"),f=ye("MessageList"),u=ye("ApprovalCard"),_=ye("FormCard"),A=ye("Feedback"),k=ye("SuggestionChips"),$=ye("Composer"),T=ye("MoreMenu"),J=ye("RenameDialog");return h(),g("div",{class:ee(["wm-root",`wm-root--${n.displayMode}`]),style:Se(s.rootStyle)},[!i.isOpen&&!s.isEmbedded?(h(),_e(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"])):B("",!0),i.isOpen||s.isEmbedded?(h(),g("section",{key:1,class:ee(["wm-panel",`wm-panel--${n.displayMode}`,{"wm-panel--welcome":s.ready&&!s.error&&!s.currentConv}]),style:Se(i.floatHeight?{"--wm-float-h":i.floatHeight+"px"}:null),role:"dialog","aria-label":"Messenger",onClick:t[5]||(t[5]=(...U)=>s.onPanelClick&&s.onPanelClick(...U))},[!s.ready&&!s.error?(h(),g("div",rp,[s.isEmbedded?B("",!0):(h(),g("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[6]||(t[6]=[c("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"},[c("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,ip)),t[7]||(t[7]=c("div",{class:"wm-loading__spinner","aria-hidden":"true"},null,-1))])):(h(),g(Q,{key:1},[ve(a,{title:s.headerTitle,"team-members":s.teamMembers,"response-label":s.responseLabel,"show-identity":!!s.currentConv,"show-back":s.canBack,"show-close":!s.isEmbedded,"more-active":i.moreOpen,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onBack:s.goHome,onMore:s.toggleMore,onClose:s.close},null,8,["title","team-members","response-label","show-identity","show-back","show-close","more-active","agent-name","agent-avatar-url","onBack","onMore","onClose"]),s.error?(h(),g("div",op,[c("div",ap,[t[8]||(t[8]=c("div",{class:"wm-state__errIcon"},[c("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"},[c("path",{d:"M18 6L6 18M6 6l12 12"})])],-1)),c("div",null,[c("div",lp,I(s.t("error.connectionFailed")),1),c("div",cp,I(s.error),1)])])])):s.currentConv?(h(),g(Q,{key:2},[ve(f,{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"]),c("div",up,[s.floatVisible?(h(),g("div",dp,[s.approvalReady?(h(),_e(u,{key:0,action:s.approvalTitle,detail:s.approvalDetail,callbacks:s.pendingApproval.callbacks,"agent-name":s.agentName,"agent-avatar-url":s.agentAvatarUrl,onCallback:s.onApprovalCallback},null,8,["action","detail","callbacks","agent-name","agent-avatar-url","onCallback"])):s.pendingForm?(h(),_e(_,{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(),_e(A,{key:2,busy:i.feedbackBusy,done:i.feedbackDone,onSubmit:s.onFeedback},null,8,["busy","done","onSubmit"])):(h(),_e(k,{key:3,items:s.suggestions,onSelect:s.onSuggestion},null,8,["items","onSelect"]))],512)):B("",!0),s.actionInFlight?(h(),g("div",fp,[t[9]||(t[9]=c("span",{class:"wm-actionWait__spinner","aria-hidden":"true"},null,-1)),c("span",hp,I(s.t("action.inProgress",{name:s.actionInFlightName})),1)])):(h(),_e($,{key:2,ref:"composer",modelValue:i.draft,"onUpdate:modelValue":t[1]||(t[1]=U=>i.draft=U),placeholder:s.composerPlaceholder,disabled:!!s.pendingApproval,"attach-label":s.t("composer.attachFile"),"display-mode":n.displayMode,onSend:s.onSend,onAttach:s.onAttach},null,8,["modelValue","placeholder","disabled","attach-label","display-mode","onSend","onAttach"]))]),i.moreOpen?(h(),_e(T,{key:0,"can-rename":!!s.currentConv&&!s.currentConv._draft,"can-export":!!s.currentConv&&!s.currentConv._draft,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[2]||(t[2]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["can-rename","can-export","sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):B("",!0),i.renameDialogOpen&&s.currentConv&&!s.currentConv._draft?(h(),_e(J,{key:1,"initial-value":s.currentConv.name||"",title:s.t("rename.dialogTitle"),onClose:t[3]||(t[3]=U=>i.renameDialogOpen=!1),onSubmit:s.onRenameSubmit},null,8,["initial-value","title","onSubmit"])):B("",!0),i.pendingAttachments.length?(h(),g("div",mp,[(h(!0),g(Q,null,Ae(i.pendingAttachments,(U,q)=>(h(),g("div",{key:q,class:"wm-attached__chip"},[t[11]||(t[11]=c("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[c("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)),c("span",null,I(U.name),1),c("button",{type:"button","aria-label":s.t("attachment.remove"),onClick:Z=>i.pendingAttachments.splice(q,1)},[...t[10]||(t[10]=[c("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[c("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,pp)]))),128))])):B("",!0)],64)):(h(),_e(l,{key:1,"welcome-message":s.widgetWelcomeMessage,subtitle:s.widgetSubtitle,"agent-name":s.agentName,"default-icon-url":s.defaultIconUrl,"quick-links":s.quickLinks,"open-threads":s.openThreads,busy:i.busy,onStart:s.startConv,onSelect:s.onQuickLink,onResume:s.onDrawerPick},null,8,["welcome-message","subtitle","agent-name","default-icon-url","quick-links","open-threads","busy","onStart","onSelect","onResume"])),i.moreOpen&&!s.currentConv?(h(),_e(T,{key:3,"can-rename":!1,"can-export":!1,"sound-enabled":e.soundEnabled,"browser-notif-enabled":e.browserNotifEnabled,"status-url":s.statusUrl,"help-url":s.helpUrl,onClose:t[4]||(t[4]=U=>i.moreOpen=!1),onSoundToggle:e.onSoundToggle,onBrowserNotifToggle:e.onBrowserNotifToggle,onAction:s.onMoreAction},null,8,["sound-enabled","browser-notif-enabled","status-url","help-url","onSoundToggle","onBrowserNotifToggle","onAction"])):B("",!0)],64))],6)):B("",!0)],6)}const _p=we(sp,[["render",gp],["__scopeId","data-v-0d59093c"]]),Xr=window.__WIDGET_ID,Qr=window.__BASE_URL,vp=window.__DISPLAY_MODE||"floating",Zr=window.__LANGUAGE||"";window.__MESSENGER_IFRAME_VERSION="0.5.41";if(!Xr||!Qr)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=wo,document.head.appendChild(e)}Ql({render:()=>go(_p,{baseUrl:Qr,widgetId:Xr,displayMode:vp,...Zr?{language:Zr}:{}})}).mount("#app")}