@sy-design/svelte 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +3349 -2620
- package/dist/index.umd.js +35 -35
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
(function(te,U){typeof exports=="object"&&typeof module!="undefined"?U(exports):typeof define=="function"&&define.amd?define(["exports"],U):(te=typeof globalThis!="undefined"?globalThis:te||self,U(te["@sy-design/svelte"]=te["@sy-design/svelte"]||{}))})(this,function(te){"use strict";var El=Object.defineProperty,Sl=Object.defineProperties;var Al=Object.getOwnPropertyDescriptors;var bi=Object.getOwnPropertySymbols;var xl=Object.prototype.hasOwnProperty,Il=Object.prototype.propertyIsEnumerable;var yi=te=>{throw TypeError(te)};var Yn=(te,U,ue)=>U in te?El(te,U,{enumerable:!0,configurable:!0,writable:!0,value:ue}):te[U]=ue,le=(te,U)=>{for(var ue in U||(U={}))xl.call(U,ue)&&Yn(te,ue,U[ue]);if(bi)for(var ue of bi(U))Il.call(U,ue)&&Yn(te,ue,U[ue]);return te},Ee=(te,U)=>Sl(te,Al(U));var ce=(te,U,ue)=>Yn(te,typeof U!="symbol"?U+"":U,ue),Rl=(te,U,ue)=>U.has(te)||yi("Cannot "+ue);var Ti=(te,U,ue)=>U.has(te)?yi("Cannot add the same private member more than once"):U instanceof WeakSet?U.add(te):U.set(te,ue);var pn=(te,U,ue)=>(Rl(te,U,"access private method"),ue);var Re=(te,U,ue)=>new Promise((Wt,we)=>{var Et=Ke=>{try{St(ue.next(Ke))}catch(dt){we(dt)}},pt=Ke=>{try{St(ue.throw(Ke))}catch(dt){we(dt)}},St=Ke=>Ke.done?Wt(Ke.value):Promise.resolve(Ke.value).then(Et,pt);St((ue=ue.apply(te,U)).next())});var ft,Zn,vi;function U(){}function ue(s){return s()}function Wt(){return Object.create(null)}function we(s){s.forEach(ue)}function Et(s){return typeof s=="function"}function pt(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function St(s){return Object.keys(s).length===0}function Ke(s,...e){if(s==null){for(const n of e)n(void 0);return U}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const dt=typeof window!="undefined";let Xn=dt?()=>window.performance.now():()=>Date.now(),Vn=dt?s=>requestAnimationFrame(s):U;const mt=new Set;function Qn(s){mt.forEach(e=>{e.c(s)||(mt.delete(e),e.f())}),mt.size!==0&&Vn(Qn)}function Ei(s){let e;return mt.size===0&&Vn(Qn),{promise:new Promise(t=>{mt.add(e={c:s,f:t})}),abort(){mt.delete(e)}}}function d(s,e){s.appendChild(e)}function G(s,e,t){s.insertBefore(e,t||null)}function W(s){s.parentNode&&s.parentNode.removeChild(s)}function Jn(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function S(s){return document.createElement(s)}function J(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Se(s){return document.createTextNode(s)}function q(){return Se(" ")}function qt(){return Se("")}function Y(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function Kn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function a(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function Si(s){return Array.from(s.childNodes)}function Fe(s,e){e=""+e,s.data!==e&&(s.data=e)}function nt(s,e){s.value=e==null?"":e}function N(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function $n(s,e,t){for(let n=0;n<s.options.length;n+=1){const o=s.options[n];if(o.__value===e){o.selected=!0;return}}(!t||e!==void 0)&&(s.selectedIndex=-1)}function Ai(s){const e=s.querySelector(":checked");return e&&e.__value}function $(s,e,t){s.classList.toggle(e,!!t)}let At;function xt(s){At=s}function dn(){if(!At)throw new Error("Function called outside component initialization");return At}function mn(s){dn().$$.on_mount.push(s)}function xi(s){dn().$$.after_update.push(s)}function Ii(s){dn().$$.on_destroy.push(s)}const gt=[],It=[];let kt=[];const es=[],Ri=Promise.resolve();let gn=!1;function Ci(){gn||(gn=!0,Ri.then(ts))}function Gt(s){kt.push(s)}const kn=new Set;let _t=0;function ts(){if(_t!==0)return;const s=At;do{try{for(;_t<gt.length;){const e=gt[_t];_t++,xt(e),Li(e.$$)}}catch(e){throw gt.length=0,_t=0,e}for(xt(null),gt.length=0,_t=0;It.length;)It.pop()();for(let e=0;e<kt.length;e+=1){const t=kt[e];kn.has(t)||(kn.add(t),t())}kt.length=0}while(gt.length);for(;es.length;)es.pop()();gn=!1,kn.clear(),xt(s)}function Li(s){if(s.fragment!==null){s.update(),we(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(Gt)}}function Mi(s){const e=[],t=[];kt.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),kt=e}const Yt=new Set;let rt;function _n(){rt={r:0,c:[],p:rt}}function wn(){rt.r||we(rt.c),rt=rt.p}function je(s,e){s&&s.i&&(Yt.delete(s),s.i(e))}function $e(s,e,t,n){if(s&&s.o){if(Yt.has(s))return;Yt.add(s),rt.c.push(()=>{Yt.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function st(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function ns(s,e){s.d(1),e.delete(s.key)}function ss(s,e,t,n,o,l,i,r,c,u,h,p){let m=s.length,g=l.length,k=m;const T={};for(;k--;)T[s[k].key]=k;const R=[],L=new Map,A=new Map,w=[];for(k=g;k--;){const x=p(o,l,k),M=t(x);let O=i.get(M);O?w.push(()=>O.p(x,e)):(O=u(M,x),O.c()),L.set(M,R[k]=O),M in T&&A.set(M,Math.abs(k-T[M]))}const _=new Set,b=new Set;function v(x){je(x,1),x.m(r,h),i.set(x.key,x),h=x.first,g--}for(;m&&g;){const x=R[g-1],M=s[m-1],O=x.key,X=M.key;x===M?(h=x.first,m--,g--):L.has(X)?!i.has(O)||_.has(O)?v(x):b.has(X)?m--:A.get(O)>A.get(X)?(b.add(O),v(x)):(_.add(X),m--):(c(M,i),m--)}for(;m--;){const x=s[m];L.has(x.key)||c(x,i)}for(;g;)v(R[g-1]);return we(w),R}function bn(s){s&&s.c()}function Zt(s,e,t){const{fragment:n,after_update:o}=s.$$;n&&n.m(e,t),Gt(()=>{const l=s.$$.on_mount.map(ue).filter(Et);s.$$.on_destroy?s.$$.on_destroy.push(...l):we(l),s.$$.on_mount=[]}),o.forEach(Gt)}function Xt(s,e){const t=s.$$;t.fragment!==null&&(Mi(t.after_update),we(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Oi(s,e){s.$$.dirty[0]===-1&&(gt.push(s),Ci(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function yn(s,e,t,n,o,l,i=null,r=[-1]){const c=At;xt(s);const u=s.$$={fragment:null,ctx:[],props:l,update:U,not_equal:o,bound:Wt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Wt(),dirty:r,skip_bound:!1,root:e.target||c.$$.root};i&&i(u.root);let h=!1;if(u.ctx=t?t(s,e.props||{},(p,m,...g)=>{const k=g.length?g[0]:m;return u.ctx&&o(u.ctx[p],u.ctx[p]=k)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](k),h&&Oi(s,p)),m}):[],u.update(),h=!0,we(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=Si(e.target);u.fragment&&u.fragment.l(p),p.forEach(W)}else u.fragment&&u.fragment.c();e.intro&&je(s.$$.fragment),Zt(s,e.target,e.anchor),ts()}xt(c)}class Tn{constructor(){ce(this,"$$");ce(this,"$$set")}$destroy(){Xt(this,1),this.$destroy=U}$on(e,t){if(!Et(t))return U;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const o=n.indexOf(t);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!St(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const zi="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(zi);const wt=[];function Di(s,e=U){let t;const n=new Set;function o(r){if(pt(s,r)&&(s=r,t)){const c=!wt.length;for(const u of n)u[1](),wt.push(u,s);if(c){for(let u=0;u<wt.length;u+=2)wt[u][0](wt[u+1]);wt.length=0}}}function l(r){o(r(s))}function i(r,c=U){const u=[r,c];return n.add(u),n.size===1&&(t=e(o,l)||U),r(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:o,update:l,subscribe:i}}function is(s){return Object.prototype.toString.call(s)==="[object Date]"}function vn(s,e,t,n){if(typeof t=="number"||is(t)){const o=n-t,l=(t-e)/(s.dt||1/60),i=s.opts.stiffness*o,r=s.opts.damping*l,c=(i-r)*s.inv_mass,u=(l+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(o)<s.opts.precision?n:(s.settled=!1,is(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((o,l)=>vn(s,e[l],t[l],n[l]));if(typeof t=="object"){const o={};for(const l in t)o[l]=vn(s,e[l],t[l],n[l]);return o}else throw new Error(`Cannot spring ${typeof t} values`)}}function Pi(s,e={}){const t=Di(s),{stiffness:n=.15,damping:o=.8,precision:l=.01}=e;let i,r,c,u=s,h=s,p=1,m=0,g=!1;function k(R,L={}){h=R;const A=c={};return s==null||L.hard||T.stiffness>=1&&T.damping>=1?(g=!0,i=Xn(),u=R,t.set(s=h),Promise.resolve()):(L.soft&&(m=1/((L.soft===!0?.5:+L.soft)*60),p=0),r||(i=Xn(),g=!1,r=Ei(w=>{if(g)return g=!1,r=null,!1;p=Math.min(p+m,1);const _={inv_mass:p,opts:T,settled:!0,dt:(w-i)*60/1e3},b=vn(_,u,s,h);return i=w,u=s,t.set(s=b),_.settled&&(r=null),!_.settled})),new Promise(w=>{r.promise.then(()=>{A===c&&w()})}))}const T={set:k,update:(R,L)=>k(R(h,s),L),subscribe:t.subscribe,stiffness:n,damping:o,precision:l};return T}function Ni(s,e){return Re(this,null,function*(){const t=s.getReader();let n;for(;!(n=yield t.read()).done;)e(n.value)})}function Fi(s){let e,t,n,o=!1;return function(i){e===void 0?(e=i,t=0,n=-1):e=Bi(e,i);const r=e.length;let c=0;for(;t<r;){o&&(e[t]===10&&(c=++t),o=!1);let u=-1;for(;t<r&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:o=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===r?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Hi(s,e,t){let n=os();const o=new TextDecoder;return function(i,r){if(i.length===0)t==null||t(n),n=os();else if(r>0){const c=o.decode(i.subarray(0,r)),u=r+(i[r+1]===32?2:1),h=o.decode(i.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
|
2
|
-
`+
|
3
|
-
`).map(
|
4
|
-
`)}class
|
5
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],
|
6
|
-
`),
|
7
|
-
`,1)[0].replace(/^\t+/,
|
8
|
-
`,1)[0],
|
9
|
-
`,e=e.substring(
|
10
|
-
`,1)[0];if(
|
11
|
-
`+
|
12
|
-
`+
|
13
|
-
`,e=e.substring(
|
14
|
-
`):[],
|
15
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:
|
16
|
-
]`).replace("lheading",
|
17
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(r,c,u)=>c+" ".repeat(u.length));let n,o,l
|
18
|
-
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),
|
19
|
-
`+n.raw,
|
20
|
-
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=
|
21
|
-
`+n.raw,
|
22
|
-
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=
|
23
|
-
`+n.raw,
|
24
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=
|
25
|
-
`+n.raw,
|
26
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=
|
27
|
-
`,
|
28
|
-
`:"<pre><code>"+(n?e:
|
1
|
+
(function(ie,j){typeof exports=="object"&&typeof module!="undefined"?j(exports):typeof define=="function"&&define.amd?define(["exports"],j):(ie=typeof globalThis!="undefined"?globalThis:ie||self,j(ie["@sy-design/svelte"]=ie["@sy-design/svelte"]||{}))})(this,function(ie){"use strict";var Hl=Object.defineProperty,ql=Object.defineProperties;var Bl=Object.getOwnPropertyDescriptors;var Ms=Object.getOwnPropertySymbols;var jl=Object.prototype.hasOwnProperty,Ul=Object.prototype.propertyIsEnumerable;var Cs=ie=>{throw TypeError(ie)};var Jn=(ie,j,de)=>j in ie?Hl(ie,j,{enumerable:!0,configurable:!0,writable:!0,value:de}):ie[j]=de,fe=(ie,j)=>{for(var de in j||(j={}))jl.call(j,de)&&Jn(ie,de,j[de]);if(Ms)for(var de of Ms(j))Ul.call(j,de)&&Jn(ie,de,j[de]);return ie},Re=(ie,j)=>ql(ie,Bl(j));var ne=(ie,j,de)=>Jn(ie,typeof j!="symbol"?j+"":j,de),Wl=(ie,j,de)=>j.has(ie)||Cs("Cannot "+de);var xs=(ie,j,de)=>j.has(ie)?Cs("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(ie):j.set(ie,de);var bn=(ie,j,de)=>(Wl(ie,j,"access private method"),de);var Fe=(ie,j,de)=>new Promise((nn,_e)=>{var Ft=tt=>{try{gt(de.next(tt))}catch(Nt){_e(Nt)}},At=tt=>{try{gt(de.throw(tt))}catch(Nt){_e(Nt)}},gt=tt=>tt.done?nn(tt.value):Promise.resolve(tt.value).then(Ft,At);gt((de=de.apply(ie,j)).next())});var St,Kn,Ls;function j(){}function de(i){return i()}function nn(){return Object.create(null)}function _e(i){i.forEach(de)}function Ft(i){return typeof i=="function"}function At(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let gt;function tt(i,e){return i===e?!0:(gt||(gt=document.createElement("a")),gt.href=e,i===gt.href)}function Nt(i){return Object.keys(i).length===0}function zs(i,...e){if(i==null){for(const n of e)n(void 0);return j}const t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const $n=typeof window!="undefined";let ei=$n?()=>window.performance.now():()=>Date.now(),ti=$n?i=>requestAnimationFrame(i):j;const It=new Set;function ni(i){It.forEach(e=>{e.c(i)||(It.delete(e),e.f())}),It.size!==0&&ti(ni)}function Ds(i){let e;return It.size===0&&ti(ni),{promise:new Promise(t=>{It.add(e={c:i,f:t})}),abort(){It.delete(e)}}}function w(i,e){i.appendChild(e)}function q(i,e,t){i.insertBefore(e,t||null)}function H(i){i.parentNode&&i.parentNode.removeChild(i)}function ii(i,e){for(let t=0;t<i.length;t+=1)i[t]&&i[t].d(e)}function S(i){return document.createElement(i)}function V(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Me(i){return document.createTextNode(i)}function G(){return Me(" ")}function Rt(){return Me("")}function U(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function si(i){return function(e){return e.preventDefault(),i.call(this,e)}}function a(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Os(i){return Array.from(i.childNodes)}function We(i,e){e=""+e,i.data!==e&&(i.data=e)}function wt(i,e){i.value=e==null?"":e}function F(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,"")}function oi(i,e,t){for(let n=0;n<i.options.length;n+=1){const s=i.options[n];if(s.__value===e){s.selected=!0;return}}(!t||e!==void 0)&&(i.selectedIndex=-1)}function Ps(i){const e=i.querySelector(":checked");return e&&e.__value}function x(i,e,t){i.classList.toggle(e,!!t)}function Fs(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}class Ns{constructor(e=!1){ne(this,"is_svg",!1);ne(this,"e");ne(this,"n");ne(this,"t");ne(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=V(t.nodeName):this.e=S(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)q(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(H)}}let Ht;function qt(i){Ht=i}function sn(){if(!Ht)throw new Error("Function called outside component initialization");return Ht}function kn(i){sn().$$.on_mount.push(i)}function Hs(i){sn().$$.after_update.push(i)}function qs(i){sn().$$.on_destroy.push(i)}function Bs(){const i=sn();return(e,t,{cancelable:n=!1}={})=>{const s=i.$$.callbacks[e];if(s){const o=Fs(e,t,{cancelable:n});return s.slice().forEach(l=>{l.call(i,o)}),!o.defaultPrevented}return!0}}const Mt=[],Bt=[];let Ct=[];const li=[],js=Promise.resolve();let yn=!1;function Us(){yn||(yn=!0,js.then(ri))}function on(i){Ct.push(i)}const Tn=new Set;let xt=0;function ri(){if(xt!==0)return;const i=Ht;do{try{for(;xt<Mt.length;){const e=Mt[xt];xt++,qt(e),Ws(e.$$)}}catch(e){throw Mt.length=0,xt=0,e}for(qt(null),Mt.length=0,xt=0;Bt.length;)Bt.pop()();for(let e=0;e<Ct.length;e+=1){const t=Ct[e];Tn.has(t)||(Tn.add(t),t())}Ct.length=0}while(Mt.length);for(;li.length;)li.pop()();yn=!1,Tn.clear(),qt(i)}function Ws(i){if(i.fragment!==null){i.update(),_e(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(on)}}function Gs(i){const e=[],t=[];Ct.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),Ct=e}const ln=new Set;let yt;function vn(){yt={r:0,c:[],p:yt}}function Sn(){yt.r||_e(yt.c),yt=yt.p}function Ze(i,e){i&&i.i&&(ln.delete(i),i.i(e))}function ft(i,e,t,n){if(i&&i.o){if(ln.has(i))return;ln.add(i),yt.c.push(()=>{ln.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function _t(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function ai(i,e){i.d(1),e.delete(i.key)}function ci(i,e,t,n,s,o,l,r,c,u,f,p){let d=i.length,m=o.length,g=d;const _={};for(;g--;)_[i[g].key]=g;const R=[],C=new Map,A=new Map,y=[];for(g=m;g--;){const I=p(s,o,g),M=t(I);let L=l.get(M);L?y.push(()=>L.p(I,e)):(L=u(M,I),L.c()),C.set(M,R[g]=L),M in _&&A.set(M,Math.abs(g-_[M]))}const b=new Set,T=new Set;function E(I){Ze(I,1),I.m(r,f),l.set(I.key,I),f=I.first,m--}for(;d&&m;){const I=R[m-1],M=i[d-1],L=I.key,$=M.key;I===M?(f=I.first,d--,m--):C.has($)?!l.has(L)||b.has(L)?E(I):T.has($)?d--:A.get(L)>A.get($)?(T.add(L),E(I)):(b.add($),d--):(c(M,l),d--)}for(;d--;){const I=i[d];C.has(I.key)||c(I,l)}for(;m;)E(R[m-1]);return _e(y),R}function En(i){i&&i.c()}function rn(i,e,t){const{fragment:n,after_update:s}=i.$$;n&&n.m(e,t),on(()=>{const o=i.$$.on_mount.map(de).filter(Ft);i.$$.on_destroy?i.$$.on_destroy.push(...o):_e(o),i.$$.on_mount=[]}),s.forEach(on)}function an(i,e){const t=i.$$;t.fragment!==null&&(Gs(t.after_update),_e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Zs(i,e){i.$$.dirty[0]===-1&&(Mt.push(i),Us(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function An(i,e,t,n,s,o,l=null,r=[-1]){const c=Ht;qt(i);const u=i.$$={fragment:null,ctx:[],props:o,update:j,not_equal:s,bound:nn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:nn(),dirty:r,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let f=!1;if(u.ctx=t?t(i,e.props||{},(p,d,...m)=>{const g=m.length?m[0]:d;return u.ctx&&s(u.ctx[p],u.ctx[p]=g)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](g),f&&Zs(i,p)),d}):[],u.update(),f=!0,_e(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=Os(e.target);u.fragment&&u.fragment.l(p),p.forEach(H)}else u.fragment&&u.fragment.c();e.intro&&Ze(i.$$.fragment),rn(i,e.target,e.anchor),ri()}qt(c)}class In{constructor(){ne(this,"$$");ne(this,"$$set")}$destroy(){an(this,1),this.$destroy=j}$on(e,t){if(!Ft(t))return j;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!Nt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ys="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ys);const Lt=[];function Xs(i,e=j){let t;const n=new Set;function s(r){if(At(i,r)&&(i=r,t)){const c=!Lt.length;for(const u of n)u[1](),Lt.push(u,i);if(c){for(let u=0;u<Lt.length;u+=2)Lt[u][0](Lt[u+1]);Lt.length=0}}}function o(r){s(r(i))}function l(r,c=j){const u=[r,c];return n.add(u),n.size===1&&(t=e(s,o)||j),r(i),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:s,update:o,subscribe:l}}function ui(i){return Object.prototype.toString.call(i)==="[object Date]"}function Rn(i,e,t,n){if(typeof t=="number"||ui(t)){const s=n-t,o=(t-e)/(i.dt||1/60),l=i.opts.stiffness*s,r=i.opts.damping*o,c=(l-r)*i.inv_mass,u=(o+c)*i.dt;return Math.abs(u)<i.opts.precision&&Math.abs(s)<i.opts.precision?n:(i.settled=!1,ui(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((s,o)=>Rn(i,e[o],t[o],n[o]));if(typeof t=="object"){const s={};for(const o in t)s[o]=Rn(i,e[o],t[o],n[o]);return s}else throw new Error(`Cannot spring ${typeof t} values`)}}function Vs(i,e={}){const t=Xs(i),{stiffness:n=.15,damping:s=.8,precision:o=.01}=e;let l,r,c,u=i,f=i,p=1,d=0,m=!1;function g(R,C={}){f=R;const A=c={};return i==null||C.hard||_.stiffness>=1&&_.damping>=1?(m=!0,l=ei(),u=R,t.set(i=f),Promise.resolve()):(C.soft&&(d=1/((C.soft===!0?.5:+C.soft)*60),p=0),r||(l=ei(),m=!1,r=Ds(y=>{if(m)return m=!1,r=null,!1;p=Math.min(p+d,1);const b={inv_mass:p,opts:_,settled:!0,dt:(y-l)*60/1e3},T=Rn(b,u,i,f);return l=y,u=i,t.set(i=T),b.settled&&(r=null),!b.settled})),new Promise(y=>{r.promise.then(()=>{A===c&&y()})}))}const _={set:g,update:(R,C)=>g(R(f,i),C),subscribe:t.subscribe,stiffness:n,damping:s,precision:o};return _}function Qs(i,e){return Fe(this,null,function*(){const t=i.getReader();let n;for(;!(n=yield t.read()).done;)e(n.value)})}function Js(i){let e,t,n,s=!1;return function(l){e===void 0?(e=l,t=0,n=-1):e=$s(e,l);const r=e.length;let c=0;for(;t<r;){s&&(e[t]===10&&(c=++t),s=!1);let u=-1;for(;t<r&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:s=!0;case 10:u=t;break}if(u===-1)break;i(e.subarray(c,u),n),c=t,n=-1}c===r?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Ks(i,e,t){let n=fi();const s=new TextDecoder;return function(l,r){if(l.length===0)t==null||t(n),n=fi();else if(r>0){const c=s.decode(l.subarray(0,r)),u=r+(l[r+1]===32?2:1),f=s.decode(l.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
|
2
|
+
`+f:f;break;case"event":n.event=f;break;case"id":i(n.id=f);break;case"retry":const p=parseInt(f,10);isNaN(p)||e(n.retry=p);break}}}}function $s(i,e){const t=new Uint8Array(i.length+e.length);return t.set(i),t.set(e,i.length),t}function fi(){return{data:"",event:"",id:"",retry:void 0}}var eo=function(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t};const Mn="text/event-stream",to=1e3,hi="last-event-id";function no(i,e){var{signal:t,headers:n,onopen:s,onmessage:o,onclose:l,onerror:r,openWhenHidden:c,fetch:u}=e,f=eo(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,d)=>{const m=Object.assign({},n);m.accept||(m.accept=Mn);let g;function _(){g.abort(),document.hidden||T()}c||document.addEventListener("visibilitychange",_);let R=to,C=0;function A(){document.removeEventListener("visibilitychange",_),window.clearTimeout(C),g.abort()}t==null||t.addEventListener("abort",()=>{A(),p()});const y=u!=null?u:window.fetch,b=s!=null?s:io;function T(){return Fe(this,null,function*(){var E;g=new AbortController;try{const I=yield y(i,Object.assign(Object.assign({},f),{headers:m,signal:g.signal}));yield b(I),yield Qs(I.body,Js(Ks(M=>{M?m[hi]=M:delete m[hi]},M=>{R=M},o))),l==null||l(),A(),p()}catch(I){if(!g.signal.aborted)try{const M=(E=r==null?void 0:r(I))!==null&&E!==void 0?E:R;window.clearTimeout(C),C=window.setTimeout(T,M)}catch(M){A(),d(M)}}})}T()})}function io(i){const e=i.headers.get("content-type");if(!(e!=null&&e.startsWith(Mn)))throw new Error(`Expected content-type to be ${Mn}, Actual: ${e}`)}function Cn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Tt=Cn();function di(i){Tt=i}const pi=/[&<>"']/,so=new RegExp(pi.source,"g"),mi=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,oo=new RegExp(mi.source,"g"),lo={"&":"&","<":"<",">":">",'"':""","'":"'"},gi=i=>lo[i];function Ge(i,e){if(e){if(pi.test(i))return i.replace(so,gi)}else if(mi.test(i))return i.replace(oo,gi);return i}const ro=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ao(i){return i.replace(ro,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const co=/(^|[^\[])\^/g;function he(i,e){let t=typeof i=="string"?i:i.source;e=e||"";const n={replace:(s,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(co,"$1"),t=t.replace(s,l),n},getRegex:()=>new RegExp(t,e)};return n}function wi(i){try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}const jt={exec:()=>null};function _i(i,e){const t=i.replace(/\|/g,(o,l,r)=>{let c=!1,u=l;for(;--u>=0&&r[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function cn(i,e,t){const n=i.length;if(n===0)return"";let s=0;for(;s<n&&i.charAt(n-s-1)===e;)s++;return i.slice(0,n-s)}function uo(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<i.length;n++)if(i[n]==="\\")n++;else if(i[n]===e[0])t++;else if(i[n]===e[1]&&(t--,t<0))return n;return-1}function bi(i,e,t,n){const s=e.href,o=e.title?Ge(e.title):null,l=i[1].replace(/\\([\[\]])/g,"$1");if(i[0].charAt(0)!=="!"){n.state.inLink=!0;const r={type:"link",raw:t,href:s,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,r}return{type:"image",raw:t,href:s,title:o,text:Ge(l)}}function fo(i,e){const t=i.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
|
3
|
+
`).map(s=>{const o=s.match(/^\s+/);if(o===null)return s;const[l]=o;return l.length>=n.length?s.slice(n.length):s}).join(`
|
4
|
+
`)}class un{constructor(e){ne(this,"options");ne(this,"rules");ne(this,"lexer");this.options=e||Tt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:cn(n,`
|
5
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=fo(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const s=cn(n,"#");(this.options.pedantic||!s||/ $/.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=cn(t[0].replace(/^ *>[ \t]?/gm,""),`
|
6
|
+
`),s=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(n);return this.lexer.state.top=s,{type:"blockquote",raw:t[0],tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,o={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const l=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let r="",c="",u=!1;for(;e;){let f=!1;if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let p=t[2].split(`
|
7
|
+
`,1)[0].replace(/^\t+/,C=>" ".repeat(3*C.length)),d=e.split(`
|
8
|
+
`,1)[0],m=0;this.options.pedantic?(m=2,c=p.trimStart()):(m=t[2].search(/[^ ]/),m=m>4?1:m,c=p.slice(m),m+=t[1].length);let g=!1;if(!p&&/^ *$/.test(d)&&(r+=d+`
|
9
|
+
`,e=e.substring(d.length+1),f=!0),!f){const C=new RegExp(`^ {0,${Math.min(3,m-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),A=new RegExp(`^ {0,${Math.min(3,m-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),y=new RegExp(`^ {0,${Math.min(3,m-1)}}(?:\`\`\`|~~~)`),b=new RegExp(`^ {0,${Math.min(3,m-1)}}#`);for(;e;){const T=e.split(`
|
10
|
+
`,1)[0];if(d=T,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),y.test(d)||b.test(d)||C.test(d)||A.test(e))break;if(d.search(/[^ ]/)>=m||!d.trim())c+=`
|
11
|
+
`+d.slice(m);else{if(g||p.search(/[^ ]/)>=4||y.test(p)||b.test(p)||A.test(p))break;c+=`
|
12
|
+
`+d}!g&&!d.trim()&&(g=!0),r+=T+`
|
13
|
+
`,e=e.substring(T.length+1),p=d.slice(m)}}o.loose||(u?o.loose=!0:/\n *\n *$/.test(r)&&(u=!0));let _=null,R;this.options.gfm&&(_=/^\[[ xX]\] /.exec(c),_&&(R=_[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:r,task:!!_,checked:R,loose:!1,text:c,tokens:[]}),o.raw+=r}o.items[o.items.length-1].raw=r.trimEnd(),o.items[o.items.length-1].text=c.trimEnd(),o.raw=o.raw.trimEnd();for(let f=0;f<o.items.length;f++)if(this.lexer.state.top=!1,o.items[f].tokens=this.lexer.blockTokens(o.items[f].text,[]),!o.loose){const p=o.items[f].tokens.filter(m=>m.type==="space"),d=p.length>0&&p.some(m=>/\n.*\n/.test(m.raw));o.loose=d}if(o.loose)for(let f=0;f<o.items.length;f++)o.items[f].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),s=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=_i(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
|
14
|
+
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const r of s)/^ *-+: *$/.test(r)?l.align.push("right"):/^ *:-+: *$/.test(r)?l.align.push("center"):/^ *:-+ *$/.test(r)?l.align.push("left"):l.align.push(null);for(const r of n)l.header.push({text:r,tokens:this.lexer.inline(r)});for(const r of o)l.rows.push(_i(r,l.header.length).map(c=>({text:c,tokens:this.lexer.inline(c)})));return l}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
15
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ge(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const l=cn(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{const l=uo(t[2],"()");if(l>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);l&&(s=l[1],o=l[3])}else o=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(this.options.pedantic&&!/>$/.test(n)?s=s.slice(1):s=s.slice(1,-1)),bi(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(/\s+/g," "),o=t[s.toLowerCase()];if(!o){const l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return bi(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const l=[...s[0]].length-1;let r,c,u=l,f=0;const p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+l);(s=p.exec(t))!=null;){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(c=[...r].length,s[3]||s[4]){u+=c;continue}else if((s[5]||s[6])&&l%3&&!((l+c)%3)){f+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+f);const d=[...s[0]][0].length,m=e.slice(0,l+s.index+d+c);if(Math.min(l,c)%2){const _=m.slice(1,-1);return{type:"em",raw:m,text:_,tokens:this.lexer.inlineTokens(_)}}const g=m.slice(2,-2);return{type:"strong",raw:m,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const s=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return s&&o&&(n=n.substring(1,n.length-1)),n=Ge(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=Ge(t[1]),s="mailto:"+n):(n=Ge(t[1]),s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,s;let t;if(t=this.rules.inline.url.exec(e)){let o,l;if(t[2]==="@")o=Ge(t[0]),l="mailto:"+o;else{let r;do r=t[0],t[0]=(s=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?s:"";while(r!==t[0]);o=Ge(t[0]),t[1]==="www."?l="http://"+t[0]:l=t[0]}return{type:"link",raw:t[0],text:o,href:l,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=Ge(t[0]),{type:"text",raw:t[0],text:n}}}}const ho=/^(?: *(?:\n|$))+/,po=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,mo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ut=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,go=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ki=/(?:[*+-]|\d{1,9}[.)])/,yi=he(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ki).getRegex(),xn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,wo=/^[^\n]+/,Ln=/(?!\s*\])(?:\\.|[^\[\]\\])+/,_o=he(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Ln).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bo=he(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ki).getRegex(),fn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zn=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ko=he("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",zn).replace("tag",fn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ti=he(xn).replace("hr",Ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fn).getRegex(),Dn={blockquote:he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ti).getRegex(),code:po,def:_o,fences:mo,heading:go,hr:Ut,html:ko,lheading:yi,list:bo,newline:ho,paragraph:Ti,table:jt,text:wo},vi=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fn).getRegex(),yo=Re(fe({},Dn),{table:vi,paragraph:he(xn).replace("hr",Ut).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",vi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fn).getRegex()}),To=Re(fe({},Dn),{html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:jt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he(xn).replace("hr",Ut).replace("heading",` *#{1,6} *[^
|
16
|
+
]`).replace("lheading",yi).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Si=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ei=/^( {2,}|\\)\n(?!\s*$)/,So=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wt="\\p{P}$+<=>`^|~",Eo=he(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Wt).getRegex(),Ao=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Io=he(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Wt).getRegex(),Ro=he("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Wt).getRegex(),Mo=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Wt).getRegex(),Co=he(/\\([punct])/,"gu").replace(/punct/g,Wt).getRegex(),xo=he(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Lo=he(zn).replace("(?:-->|$)","-->").getRegex(),zo=he("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Lo).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),hn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Do=he(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",hn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ai=he(/^!?\[(label)\]\[(ref)\]/).replace("label",hn).replace("ref",Ln).getRegex(),Ii=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ln).getRegex(),Oo=he("reflink|nolink(?!\\()","g").replace("reflink",Ai).replace("nolink",Ii).getRegex(),On={_backpedal:jt,anyPunctuation:Co,autolink:xo,blockSkip:Ao,br:Ei,code:vo,del:jt,emStrongLDelim:Io,emStrongRDelimAst:Ro,emStrongRDelimUnd:Mo,escape:Si,link:Do,nolink:Ii,punctuation:Eo,reflink:Ai,reflinkSearch:Oo,tag:zo,text:So,url:jt},Po=Re(fe({},On),{link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",hn).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",hn).getRegex()}),Pn=Re(fe({},On),{escape:he(Si).replace("])","~|])").getRegex(),url:he(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Fo=Re(fe({},Pn),{br:he(Ei).replace("{2,}","*").getRegex(),text:he(Pn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),dn={normal:Dn,gfm:yo,pedantic:To},Gt={normal:On,gfm:Pn,breaks:Fo,pedantic:Po};class nt{constructor(e){ne(this,"tokens");ne(this,"options");ne(this,"state");ne(this,"tokenizer");ne(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Tt,this.options.tokenizer=this.options.tokenizer||new un,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:dn.normal,inline:Gt.normal};this.options.pedantic?(t.block=dn.pedantic,t.inline=Gt.pedantic):this.options.gfm&&(t.block=dn.gfm,this.options.breaks?t.inline=Gt.breaks:t.inline=Gt.gfm),this.tokenizer.rules=t}static get rules(){return{block:dn,inline:Gt}}static lex(e,t){return new nt(t).lex(e)}static lexInline(e,t){return new nt(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
17
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(r,c,u)=>c+" ".repeat(u.length));let n,s,o,l;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
18
|
+
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=`
|
19
|
+
`+n.raw,s.text+=`
|
20
|
+
`+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=`
|
21
|
+
`+n.raw,s.text+=`
|
22
|
+
`+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let r=1/0;const c=e.slice(1);let u;this.options.extensions.startBlock.forEach(f=>{u=f.call({lexer:this},c),typeof u=="number"&&u>=0&&(r=Math.min(r,u))}),r<1/0&&r>=0&&(o=e.substring(0,r+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){s=t[t.length-1],l&&s.type==="paragraph"?(s.raw+=`
|
23
|
+
`+n.raw,s.text+=`
|
24
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),l=o.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=`
|
25
|
+
`+n.raw,s.text+=`
|
26
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,o,l=e,r,c,u;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)f.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,r.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(f=>(n=f.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,l,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let f=1/0;const p=e.slice(1);let d;this.options.extensions.startInline.forEach(m=>{d=m.call({lexer:this},p),typeof d=="number"&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(o=e.substring(0,f+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),c=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(e){const f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return t}}class pn{constructor(e){ne(this,"options");this.options=e||Tt}code(e,t,n){var o;const s=(o=(t||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
|
27
|
+
`,s?'<pre><code class="language-'+Ge(s)+'">'+(n?e:Ge(e,!0))+`</code></pre>
|
28
|
+
`:"<pre><code>"+(n?e:Ge(e,!0))+`</code></pre>
|
29
29
|
`}blockquote(e){return`<blockquote>
|
30
30
|
${e}</blockquote>
|
31
31
|
`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>
|
32
32
|
`}hr(){return`<hr>
|
33
|
-
`}list(e,t,n){const
|
34
|
-
`+e+"</"+
|
33
|
+
`}list(e,t,n){const s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
|
34
|
+
`+e+"</"+s+`>
|
35
35
|
`}listitem(e,t,n){return`<li>${e}</li>
|
36
36
|
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
|
37
37
|
`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
|
@@ -41,8 +41,8 @@ ${e}</blockquote>
|
|
41
41
|
`}tablerow(e){return`<tr>
|
42
42
|
${e}</tr>
|
43
43
|
`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
44
|
-
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const
|
45
|
-
`+(
|
46
|
-
Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+He(n.message+"",!0)+"</pre>";return t?Promise.resolve(o):o}if(t)return Promise.reject(n);throw n}};const ct=new So;function se(s,e){return ct.parse(s,e)}se.options=se.setOptions=function(s){return ct.setOptions(s),se.defaults=ct.defaults,rs(se.defaults),se},se.getDefaults=Sn,se.defaults=at,se.use=function(...s){return ct.use(...s),se.defaults=ct.defaults,rs(se.defaults),se},se.walkTokens=function(s,e){return ct.walkTokens(s,e)},se.parseInline=ct.parseInline,se.Parser=Ve,se.parser=Ve.parse,se.Renderer=en,se.TextRenderer=Mn,se.Lexer=Xe,se.lexer=Xe.lex,se.Tokenizer=Qt,se.Hooks=Ot,se.parse=se,se.options,se.setOptions,se.use,se.walkTokens,se.parseInline,Ve.parse,Xe.lex;/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:Ts,setPrototypeOf:vs,isFrozen:Ao,getPrototypeOf:xo,getOwnPropertyDescriptor:Io}=Object;let{freeze:Ce,seal:Ue,create:Es}=Object,{apply:On,construct:zn}=typeof Reflect!="undefined"&&Reflect;Ce||(Ce=function(e){return e}),Ue||(Ue=function(e){return e}),On||(On=function(e,t,n){return e.apply(t,n)}),zn||(zn=function(e,t){return new e(...t)});const tn=Me(Array.prototype.forEach),Ro=Me(Array.prototype.lastIndexOf),Ss=Me(Array.prototype.pop),zt=Me(Array.prototype.push),Co=Me(Array.prototype.splice),nn=Me(String.prototype.toLowerCase),Dn=Me(String.prototype.toString),As=Me(String.prototype.match),Dt=Me(String.prototype.replace),Lo=Me(String.prototype.indexOf),Mo=Me(String.prototype.trim),Ye=Me(Object.prototype.hasOwnProperty),Le=Me(RegExp.prototype.test),Pt=Oo(TypeError);function Me(s){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return On(s,e,n)}}function Oo(s){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return zn(s,t)}}function Q(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nn;vs&&vs(s,null);let n=e.length;for(;n--;){let o=e[n];if(typeof o=="string"){const l=t(o);l!==o&&(Ao(e)||(e[n]=l),o=l)}s[o]=!0}return s}function zo(s){for(let e=0;e<s.length;e++)Ye(s,e)||(s[e]=null);return s}function ut(s){const e=Es(null);for(const[t,n]of Ts(s))Ye(s,t)&&(Array.isArray(n)?e[t]=zo(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ut(n):e[t]=n);return e}function Nt(s,e){for(;s!==null;){const n=Io(s,e);if(n){if(n.get)return Me(n.get);if(typeof n.value=="function")return Me(n.value)}s=xo(s)}function t(){return null}return t}const xs=Ce(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pn=Ce(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Nn=Ce(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Do=Ce(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Fn=Ce(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Po=Ce(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Is=Ce(["#text"]),Rs=Ce(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Hn=Ce(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Cs=Ce(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),sn=Ce(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),No=Ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Fo=Ue(/<%[\w\W]*|[\w\W]*%>/gm),Ho=Ue(/\$\{[\w\W]*/gm),Bo=Ue(/^data-[\-\w.\u00B7-\uFFFF]+$/),jo=Ue(/^aria-[\-\w]+$/),Ls=Ue(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Uo=Ue(/^(?:\w+script|data):/i),Wo=Ue(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ms=Ue(/^html$/i),qo=Ue(/^[a-z][.\w]*(-[.\w]+)+$/i);var Os=Object.freeze({__proto__:null,ARIA_ATTR:jo,ATTR_WHITESPACE:Wo,CUSTOM_ELEMENT:qo,DATA_ATTR:Bo,DOCTYPE_NAME:Ms,ERB_EXPR:Fo,IS_ALLOWED_URI:Ls,IS_SCRIPT_OR_DATA:Uo,MUSTACHE_EXPR:No,TMPLIT_EXPR:Ho});const Ft={element:1,text:3,progressingInstruction:7,comment:8,document:9},Go=function(){return typeof window=="undefined"?null:window},Yo=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const l="dompurify"+(n?"#"+n:"");try{return e.createPolicy(l,{createHTML(i){return i},createScriptURL(i){return i}})}catch(i){return console.warn("TrustedTypes policy "+l+" could not be created."),null}},zs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ds(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Go();const e=P=>Ds(P);if(e.version="3.2.4",e.removed=[],!s||!s.document||s.document.nodeType!==Ft.document||!s.Element)return e.isSupported=!1,e;let{document:t}=s;const n=t,o=n.currentScript,{DocumentFragment:l,HTMLTemplateElement:i,Node:r,Element:c,NodeFilter:u,NamedNodeMap:h=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:p,DOMParser:m,trustedTypes:g}=s,k=c.prototype,T=Nt(k,"cloneNode"),R=Nt(k,"remove"),L=Nt(k,"nextSibling"),A=Nt(k,"childNodes"),w=Nt(k,"parentNode");if(typeof i=="function"){const P=t.createElement("template");P.content&&P.content.ownerDocument&&(t=P.content.ownerDocument)}let _,b="";const{implementation:v,createNodeIterator:x,createDocumentFragment:M,getElementsByTagName:O}=t,{importNode:X}=n;let H=zs();e.isSupported=typeof Ts=="function"&&typeof w=="function"&&v&&v.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:I,ERB_EXPR:C,TMPLIT_EXPR:j,DATA_ATTR:V,ARIA_ATTR:ie,IS_SCRIPT_OR_DATA:_e,ATTR_WHITESPACE:We,CUSTOM_ELEMENT:de}=Os;let{IS_ALLOWED_URI:qe}=Os,ne=null;const Ze=Q({},[...xs,...Pn,...Nn,...Fn,...Is]);let oe=null;const Oe=Q({},[...Rs,...Hn,...Cs,...sn]);let ee=Object.seal(Es(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),De=null,xe=null,et=!0,F=!0,ae=!1,D=!0,Z=!1,be=!0,ye=!1,Pe=!1,Be=!1,it=!1,bt=!1,yt=!1,ln=!0,rn=!1;const Wn="user-content-";let Ht=!0,ht=!1,ot={},lt=null;const an=Q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let cn=null;const un=Q({},["audio","video","img","source","image","track"]);let Bt=null;const y=Q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),B="http://www.w3.org/1998/Math/MathML",K="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let he=fe,Te=!1,me=null;const Tt=Q({},[B,K,fe],Dn);let Ge=Q({},["mi","mo","mn","ms","mtext"]),fn=Q({},["annotation-xml"]);const _l=Q({},["title","style","font","a","script"]);let jt=null;const wl=["application/xhtml+xml","text/html"],bl="text/html";let ve=null,vt=null;const yl=t.createElement("form"),ai=function(f){return f instanceof RegExp||f instanceof Function},qn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(vt&&vt===f)){if((!f||typeof f!="object")&&(f={}),f=ut(f),jt=wl.indexOf(f.PARSER_MEDIA_TYPE)===-1?bl:f.PARSER_MEDIA_TYPE,ve=jt==="application/xhtml+xml"?Dn:nn,ne=Ye(f,"ALLOWED_TAGS")?Q({},f.ALLOWED_TAGS,ve):Ze,oe=Ye(f,"ALLOWED_ATTR")?Q({},f.ALLOWED_ATTR,ve):Oe,me=Ye(f,"ALLOWED_NAMESPACES")?Q({},f.ALLOWED_NAMESPACES,Dn):Tt,Bt=Ye(f,"ADD_URI_SAFE_ATTR")?Q(ut(y),f.ADD_URI_SAFE_ATTR,ve):y,cn=Ye(f,"ADD_DATA_URI_TAGS")?Q(ut(un),f.ADD_DATA_URI_TAGS,ve):un,lt=Ye(f,"FORBID_CONTENTS")?Q({},f.FORBID_CONTENTS,ve):an,De=Ye(f,"FORBID_TAGS")?Q({},f.FORBID_TAGS,ve):{},xe=Ye(f,"FORBID_ATTR")?Q({},f.FORBID_ATTR,ve):{},ot=Ye(f,"USE_PROFILES")?f.USE_PROFILES:!1,et=f.ALLOW_ARIA_ATTR!==!1,F=f.ALLOW_DATA_ATTR!==!1,ae=f.ALLOW_UNKNOWN_PROTOCOLS||!1,D=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=f.SAFE_FOR_TEMPLATES||!1,be=f.SAFE_FOR_XML!==!1,ye=f.WHOLE_DOCUMENT||!1,it=f.RETURN_DOM||!1,bt=f.RETURN_DOM_FRAGMENT||!1,yt=f.RETURN_TRUSTED_TYPE||!1,Be=f.FORCE_BODY||!1,ln=f.SANITIZE_DOM!==!1,rn=f.SANITIZE_NAMED_PROPS||!1,Ht=f.KEEP_CONTENT!==!1,ht=f.IN_PLACE||!1,qe=f.ALLOWED_URI_REGEXP||Ls,he=f.NAMESPACE||fe,Ge=f.MATHML_TEXT_INTEGRATION_POINTS||Ge,fn=f.HTML_INTEGRATION_POINTS||fn,ee=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&ai(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&ai(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(F=!1),bt&&(it=!0),ot&&(ne=Q({},Is),oe=[],ot.html===!0&&(Q(ne,xs),Q(oe,Rs)),ot.svg===!0&&(Q(ne,Pn),Q(oe,Hn),Q(oe,sn)),ot.svgFilters===!0&&(Q(ne,Nn),Q(oe,Hn),Q(oe,sn)),ot.mathMl===!0&&(Q(ne,Fn),Q(oe,Cs),Q(oe,sn))),f.ADD_TAGS&&(ne===Ze&&(ne=ut(ne)),Q(ne,f.ADD_TAGS,ve)),f.ADD_ATTR&&(oe===Oe&&(oe=ut(oe)),Q(oe,f.ADD_ATTR,ve)),f.ADD_URI_SAFE_ATTR&&Q(Bt,f.ADD_URI_SAFE_ATTR,ve),f.FORBID_CONTENTS&&(lt===an&&(lt=ut(lt)),Q(lt,f.FORBID_CONTENTS,ve)),Ht&&(ne["#text"]=!0),ye&&Q(ne,["html","head","body"]),ne.table&&(Q(ne,["tbody"]),delete De.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=f.TRUSTED_TYPES_POLICY,b=_.createHTML("")}else _===void 0&&(_=Yo(g,o)),_!==null&&typeof b=="string"&&(b=_.createHTML(""));Ce&&Ce(f),vt=f}},ci=Q({},[...Pn,...Nn,...Do]),ui=Q({},[...Fn,...Po]),Tl=function(f){let E=w(f);(!E||!E.tagName)&&(E={namespaceURI:he,tagName:"template"});const z=nn(f.tagName),pe=nn(E.tagName);return me[f.namespaceURI]?f.namespaceURI===K?E.namespaceURI===fe?z==="svg":E.namespaceURI===B?z==="svg"&&(pe==="annotation-xml"||Ge[pe]):!!ci[z]:f.namespaceURI===B?E.namespaceURI===fe?z==="math":E.namespaceURI===K?z==="math"&&fn[pe]:!!ui[z]:f.namespaceURI===fe?E.namespaceURI===K&&!fn[pe]||E.namespaceURI===B&&!Ge[pe]?!1:!ui[z]&&(_l[z]||!ci[z]):!!(jt==="application/xhtml+xml"&&me[f.namespaceURI]):!1},Qe=function(f){zt(e.removed,{element:f});try{w(f).removeChild(f)}catch(E){R(f)}},hn=function(f,E){try{zt(e.removed,{attribute:E.getAttributeNode(f),from:E})}catch(z){zt(e.removed,{attribute:null,from:E})}if(E.removeAttribute(f),f==="is")if(it||bt)try{Qe(E)}catch(z){}else try{E.setAttribute(f,"")}catch(z){}},fi=function(f){let E=null,z=null;if(Be)f="<remove></remove>"+f;else{const Ae=As(f,/^[\r\n\t ]+/);z=Ae&&Ae[0]}jt==="application/xhtml+xml"&&he===fe&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const pe=_?_.createHTML(f):f;if(he===fe)try{E=new m().parseFromString(pe,jt)}catch(Ae){}if(!E||!E.documentElement){E=v.createDocument(he,"template",null);try{E.documentElement.innerHTML=Te?b:pe}catch(Ae){}}const Ie=E.body||E.documentElement;return f&&z&&Ie.insertBefore(t.createTextNode(z),Ie.childNodes[0]||null),he===fe?O.call(E,ye?"html":"body")[0]:ye?E.documentElement:Ie},hi=function(f){return x.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Gn=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof h)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},pi=function(f){return typeof r=="function"&&f instanceof r};function tt(P,f,E){tn(P,z=>{z.call(e,f,E,vt)})}const di=function(f){let E=null;if(tt(H.beforeSanitizeElements,f,null),Gn(f))return Qe(f),!0;const z=ve(f.nodeName);if(tt(H.uponSanitizeElement,f,{tagName:z,allowedTags:ne}),f.hasChildNodes()&&!pi(f.firstElementChild)&&Le(/<[/\w]/g,f.innerHTML)&&Le(/<[/\w]/g,f.textContent)||f.nodeType===Ft.progressingInstruction||be&&f.nodeType===Ft.comment&&Le(/<[/\w]/g,f.data))return Qe(f),!0;if(!ne[z]||De[z]){if(!De[z]&&gi(z)&&(ee.tagNameCheck instanceof RegExp&&Le(ee.tagNameCheck,z)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(z)))return!1;if(Ht&&!lt[z]){const pe=w(f)||f.parentNode,Ie=A(f)||f.childNodes;if(Ie&&pe){const Ae=Ie.length;for(let Ne=Ae-1;Ne>=0;--Ne){const Je=T(Ie[Ne],!0);Je.__removalCount=(f.__removalCount||0)+1,pe.insertBefore(Je,L(f))}}}return Qe(f),!0}return f instanceof c&&!Tl(f)||(z==="noscript"||z==="noembed"||z==="noframes")&&Le(/<\/no(script|embed|frames)/i,f.innerHTML)?(Qe(f),!0):(Z&&f.nodeType===Ft.text&&(E=f.textContent,tn([I,C,j],pe=>{E=Dt(E,pe," ")}),f.textContent!==E&&(zt(e.removed,{element:f.cloneNode()}),f.textContent=E)),tt(H.afterSanitizeElements,f,null),!1)},mi=function(f,E,z){if(ln&&(E==="id"||E==="name")&&(z in t||z in yl))return!1;if(!(F&&!xe[E]&&Le(V,E))){if(!(et&&Le(ie,E))){if(!oe[E]||xe[E]){if(!(gi(f)&&(ee.tagNameCheck instanceof RegExp&&Le(ee.tagNameCheck,f)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(f))&&(ee.attributeNameCheck instanceof RegExp&&Le(ee.attributeNameCheck,E)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(E))||E==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Le(ee.tagNameCheck,z)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(z))))return!1}else if(!Bt[E]){if(!Le(qe,Dt(z,We,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&f!=="script"&&Lo(z,"data:")===0&&cn[f])){if(!(ae&&!Le(_e,Dt(z,We,"")))){if(z)return!1}}}}}}return!0},gi=function(f){return f!=="annotation-xml"&&As(f,de)},ki=function(f){tt(H.beforeSanitizeAttributes,f,null);const{attributes:E}=f;if(!E||Gn(f))return;const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let pe=E.length;for(;pe--;){const Ie=E[pe],{name:Ae,namespaceURI:Ne,value:Je}=Ie,Ut=ve(Ae);let ze=Ae==="value"?Je:Mo(Je);if(z.attrName=Ut,z.attrValue=ze,z.keepAttr=!0,z.forceKeepAttr=void 0,tt(H.uponSanitizeAttribute,f,z),ze=z.attrValue,rn&&(Ut==="id"||Ut==="name")&&(hn(Ae,f),ze=Wn+ze),be&&Le(/((--!?|])>)|<\/(style|title)/i,ze)){hn(Ae,f);continue}if(z.forceKeepAttr||(hn(Ae,f),!z.keepAttr))continue;if(!D&&Le(/\/>/i,ze)){hn(Ae,f);continue}Z&&tn([I,C,j],wi=>{ze=Dt(ze,wi," ")});const _i=ve(f.nodeName);if(mi(_i,Ut,ze)){if(_&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Ne)switch(g.getAttributeType(_i,Ut)){case"TrustedHTML":{ze=_.createHTML(ze);break}case"TrustedScriptURL":{ze=_.createScriptURL(ze);break}}try{Ne?f.setAttributeNS(Ne,Ae,ze):f.setAttribute(Ae,ze),Gn(f)?Qe(f):Ss(e.removed)}catch(wi){}}}tt(H.afterSanitizeAttributes,f,null)},vl=function P(f){let E=null;const z=hi(f);for(tt(H.beforeSanitizeShadowDOM,f,null);E=z.nextNode();)tt(H.uponSanitizeShadowNode,E,null),di(E),ki(E),E.content instanceof l&&P(E.content);tt(H.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(P){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,z=null,pe=null,Ie=null;if(Te=!P,Te&&(P="<!-->"),typeof P!="string"&&!pi(P))if(typeof P.toString=="function"){if(P=P.toString(),typeof P!="string")throw Pt("dirty is not a string, aborting")}else throw Pt("toString is not a function");if(!e.isSupported)return P;if(Pe||qn(f),e.removed=[],typeof P=="string"&&(ht=!1),ht){if(P.nodeName){const Je=ve(P.nodeName);if(!ne[Je]||De[Je])throw Pt("root node is forbidden and cannot be sanitized in-place")}}else if(P instanceof r)E=fi("<!---->"),z=E.ownerDocument.importNode(P,!0),z.nodeType===Ft.element&&z.nodeName==="BODY"||z.nodeName==="HTML"?E=z:E.appendChild(z);else{if(!it&&!Z&&!ye&&P.indexOf("<")===-1)return _&&yt?_.createHTML(P):P;if(E=fi(P),!E)return it?null:yt?b:""}E&&Be&&Qe(E.firstChild);const Ae=hi(ht?P:E);for(;pe=Ae.nextNode();)di(pe),ki(pe),pe.content instanceof l&&vl(pe.content);if(ht)return P;if(it){if(bt)for(Ie=M.call(E.ownerDocument);E.firstChild;)Ie.appendChild(E.firstChild);else Ie=E;return(oe.shadowroot||oe.shadowrootmode)&&(Ie=X.call(n,Ie,!0)),Ie}let Ne=ye?E.outerHTML:E.innerHTML;return ye&&ne["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&Le(Ms,E.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+E.ownerDocument.doctype.name+`>
|
47
|
-
`+Ne),Z&&tn([I,C,j],Je=>{Ne=Dt(Ne,Je," ")}),_&&yt?_.createHTML(Ne):Ne},e.setConfig=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(P),Pe=!0},e.clearConfig=function(){vt=null,Pe=!1},e.isValidAttribute=function(P,f,E){vt||qn({});const z=ve(P),pe=ve(f);return mi(z,pe,E)},e.addHook=function(P,f){typeof f=="function"&&zt(H[P],f)},e.removeHook=function(P,f){if(f!==void 0){const E=Ro(H[P],f);return E===-1?void 0:Co(H[P],E,1)[0]}return Ss(H[P])},e.removeHooks=function(P){H[P]=[]},e.removeAllHooks=function(){H=zs()},e}var Ps=Ds();function Ns(s){var n;if(typeof document=="undefined")return null;const t=`; ${document.cookie}`.split(`; ${s}=`);return t.length===2&&((n=t.pop())==null?void 0:n.split(";").shift())||null}const ge=()=>{if(typeof window=="undefined")return null;const s=Ns("access_token");if(s)return s;const e=Ns("auth_token");if(e)return e;const t=sessionStorage.getItem("vuex");if(t)try{const n=JSON.parse(t);if(n!=null&&n.token)return n.token}catch(n){console.error("Failed to parse vuex data:",n)}return null};function Fs(s,e,t){const n=s.slice();return n[25]=e[t],n}function Hs(s){let e,t=s[9].text+"",n;return{c(){e=S("div"),n=Se(t),a(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),N(e,"left",s[9].x+"px"),N(e,"top",s[9].y+"px"),N(e,"z-index",s[3]+3)},m(o,l){G(o,e,l),d(e,n)},p(o,l){l&512&&t!==(t=o[9].text+"")&&Fe(n,t),l&512&&N(e,"left",o[9].x+"px"),l&512&&N(e,"top",o[9].y+"px"),l&8&&N(e,"z-index",o[3]+3)},d(o){o&&W(e)}}}function Zo(s){let e=[],t=new Map,n,o,l=st(s[0]);const i=c=>c[25].sessionId;for(let c=0;c<l.length;c+=1){let u=Fs(s,l,c),h=i(u);t.set(h,e[c]=Bs(h,u))}let r=s[5]&&js();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=q(),r&&r.c(),o=qt()},m(c,u){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(c,u);G(c,n,u),r&&r.m(c,u),G(c,o,u)},p(c,u){u&8261&&(l=st(c[0]),e=ss(e,u,i,1,c,l,t,n.parentNode,ns,Bs,n,Fs)),c[5]?r||(r=js(),r.c(),r.m(o.parentNode,o)):r&&(r.d(1),r=null)},d(c){c&&(W(n),W(o));for(let u=0;u<e.length;u+=1)e[u].d(c);r&&r.d(c)}}}function Xo(s){let e,t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话",n;return{c(){e=S("div"),n=Se(t),a(e,"class","sy-session-empty svelte-1g6fj9a")},m(o,l){G(o,e,l),d(e,n)},p(o,l){l&48&&t!==(t=o[4]?"未找到相关会话":o[5]?"加载中...":"暂无历史会话")&&Fe(n,t)},d(o){o&&W(e)}}}function Bs(s,e){let t,n,o,l,i=e[25].title+"",r,c,u,h=Ws(e[25].timestamp)+"",p,m,g,k,T,R,L,A,w,_,b;function v(){return e[18](e[25])}function x(...M){return e[19](e[25],...M)}return{key:s,first:null,c(){t=S("div"),n=S("button"),o=S("div"),l=S("div"),r=Se(i),c=q(),u=S("div"),p=Se(h),m=q(),g=S("button"),k=J("svg"),T=J("path"),R=J("path"),L=J("path"),a(l,"class","sy-session-title svelte-1g6fj9a"),a(u,"class","sy-session-time svelte-1g6fj9a"),a(o,"class","sy-session-info svelte-1g6fj9a"),a(n,"class","sy-session-select svelte-1g6fj9a"),a(T,"d","M3 6h18"),a(R,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),a(L,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),a(k,"xmlns","http://www.w3.org/2000/svg"),a(k,"width","16"),a(k,"height","16"),a(k,"viewBox","0 0 24 24"),a(k,"fill","none"),a(k,"stroke","currentColor"),a(k,"stroke-width","2"),a(k,"stroke-linecap","round"),a(k,"stroke-linejoin","round"),a(g,"class","sy-session-delete svelte-1g6fj9a"),g.disabled=A=e[6]===e[25].sessionId,a(g,"aria-label","删除会话"),a(t,"class","sy-session-item svelte-1g6fj9a"),a(t,"data-session-id",w=e[25].sessionId),$(t,"deleting",e[25].deleting),this.first=t},m(M,O){G(M,t,O),d(t,n),d(n,o),d(o,l),d(l,r),d(o,c),d(o,u),d(u,p),d(t,m),d(t,g),d(g,k),d(k,T),d(k,R),d(k,L),_||(b=[Y(n,"click",v),Y(g,"click",x)],_=!0)},p(M,O){e=M,O&1&&i!==(i=e[25].title+"")&&Fe(r,i),O&1&&h!==(h=Ws(e[25].timestamp)+"")&&Fe(p,h),O&65&&A!==(A=e[6]===e[25].sessionId)&&(g.disabled=A),O&1&&w!==(w=e[25].sessionId)&&a(t,"data-session-id",w),O&1&&$(t,"deleting",e[25].deleting)},d(M){M&&W(t),_=!1,we(b)}}}function js(s){let e;return{c(){e=S("div"),e.innerHTML='<span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span>',a(e,"class","sy-session-loading svelte-1g6fj9a")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function Us(s){let e,t,n,o,l,i,r,c,u;return{c(){e=S("div"),t=S("div"),t.textContent="确认删除此会话?",n=q(),o=S("div"),l=S("button"),l.textContent="取消",i=q(),r=S("button"),r.textContent="删除",a(t,"class","sy-session-confirm-content svelte-1g6fj9a"),a(l,"class","sy-session-confirm-cancel svelte-1g6fj9a"),a(r,"class","sy-session-confirm-delete svelte-1g6fj9a"),a(o,"class","sy-session-confirm-actions svelte-1g6fj9a"),a(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),N(e,"left",s[8].x+"px"),N(e,"top",s[8].y+"px"),N(e,"z-index",s[3]+3)},m(h,p){G(h,e,p),d(e,t),d(e,n),d(e,o),d(o,l),d(o,i),d(o,r),c||(u=[Y(l,"click",s[20]),Y(r,"click",s[14])],c=!0)},p(h,p){p&256&&N(e,"left",h[8].x+"px"),p&256&&N(e,"top",h[8].y+"px"),p&8&&N(e,"z-index",h[3]+3)},d(h){h&&W(e),c=!1,we(u)}}}function Vo(s){let e,t,n,o,l,i,r,c,u,h,p,m,g,k,T,R,L,A,w,_=s[9]&&Hs(s);function b(O,X){return O[0].length===0?Xo:Zo}let v=b(s),x=v(s),M=s[7]&&Us(s);return{c(){e=S("div"),t=S("div"),n=S("h2"),n.textContent="历史会话",o=q(),l=S("button"),l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',i=q(),r=S("div"),c=S("input"),u=q(),h=J("svg"),p=J("circle"),m=J("line"),g=q(),_&&_.c(),k=q(),T=S("div"),x.c(),R=q(),M&&M.c(),L=qt(),a(n,"class","svelte-1g6fj9a"),a(l,"class","sy-session-close svelte-1g6fj9a"),a(l,"aria-label","关闭历史会话"),a(t,"class","sy-session-header svelte-1g6fj9a"),a(c,"type","text"),a(c,"class","sy-session-search-input svelte-1g6fj9a"),a(c,"placeholder","搜索历史会话..."),a(p,"cx","11"),a(p,"cy","11"),a(p,"r","8"),a(m,"x1","21"),a(m,"y1","21"),a(m,"x2","16.65"),a(m,"y2","16.65"),a(h,"class","sy-session-search-icon svelte-1g6fj9a"),a(h,"xmlns","http://www.w3.org/2000/svg"),a(h,"width","16"),a(h,"height","16"),a(h,"viewBox","0 0 24 24"),a(h,"fill","none"),a(h,"stroke","currentColor"),a(h,"stroke-width","2"),a(h,"stroke-linecap","round"),a(h,"stroke-linejoin","round"),a(r,"class","sy-session-search svelte-1g6fj9a"),a(T,"class","sy-session-list svelte-1g6fj9a"),a(e,"class","sy-session-history svelte-1g6fj9a"),N(e,"z-index",s[3]+2)},m(O,X){G(O,e,X),d(e,t),d(t,n),d(t,o),d(t,l),d(e,i),d(e,r),d(r,c),nt(c,s[4]),d(r,u),d(r,h),d(h,p),d(h,m),d(e,g),_&&_.m(e,null),d(e,k),d(e,T),x.m(T,null),G(O,R,X),M&&M.m(O,X),G(O,L,X),A||(w=[Y(l,"click",function(){Et(s[1])&&s[1].apply(this,arguments)}),Y(l,"mouseenter",s[16]),Y(l,"mouseleave",s[12]),Y(c,"input",s[17]),Y(T,"scroll",s[10])],A=!0)},p(O,[X]){s=O,X&16&&c.value!==s[4]&&nt(c,s[4]),s[9]?_?_.p(s,X):(_=Hs(s),_.c(),_.m(e,k)):_&&(_.d(1),_=null),v===(v=b(s))&&x?x.p(s,X):(x.d(1),x=v(s),x&&(x.c(),x.m(T,null))),X&8&&N(e,"z-index",s[3]+2),s[7]?M?M.p(s,X):(M=Us(s),M.c(),M.m(L.parentNode,L)):M&&(M.d(1),M=null)},i:U,o:U,d(O){O&&(W(e),W(R),W(L)),_&&_.d(),x.d(),M&&M.d(O),A=!1,we(w)}}}const Bn=10;function Ws(s){return new Date(s).toLocaleString()}function Qo(s,e,t){let{sessions:n=[]}=e,{onClose:o}=e,{onSelect:l}=e,{zIndex:i}=e,{apiPrefix:r}=e,c=!1,u=!0,h=0,p="",m=null,g=null,k={x:0,y:0};function T(){return Re(this,null,function*(){if(!(c||!u)){t(5,c=!0);try{const I=yield fetch(`${r}/chat/record/session/list/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({start:h,length:Bn,keyword:p})});if(!I.ok)throw new Error("Failed to load sessions");const C=yield I.json();if(C.code===0){const j=C.data.sessionList.map(V=>({sessionId:V.sessionId,title:V.name,timestamp:new Date(V.createDate).getTime()}));t(0,n=[...n,...j]),h+=Bn,u=j.length===Bn}}catch(I){console.error("Failed to load sessions:",I)}finally{t(5,c=!1)}}})}function R(I){const C=I.target,{scrollTop:j,scrollHeight:V,clientHeight:ie}=C;V-j-ie<50&&T()}mn(()=>{T()});let L=null;function A(I,C){const V=I.currentTarget.getBoundingClientRect();t(9,L={text:C,x:V.left+V.width/2,y:V.bottom+8})}function w(){t(9,L=null)}function _(I,C){const V=I.currentTarget.getBoundingClientRect();t(8,k={x:V.left-16,y:V.top+V.height/2}),t(7,g=C)}function b(I){return Re(this,null,function*(){if(I&&!m)try{t(6,m=I),t(7,g=null);const C=document.querySelector(`[data-session-id="${I}"]`);C&&C.classList.add("deleting"),yield new Promise(ie=>setTimeout(ie,300));const j=yield fetch(`${r}/chat/record/session/delete`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({sessionId:I})});if(!j.ok)throw new Error("Delete request failed");const V=yield j.json();if(V.code===0&&V.data.respCode===0)t(0,n=n.map(ie=>Ee(le({},ie),{deleting:ie.sessionId===I}))),setTimeout(()=>{t(0,n=n.filter(ie=>!ie.deleting))},300);else throw new Error("Delete failed: "+V.message)}catch(C){console.error("Failed to delete session:",C);const j=document.querySelector(`[data-session-id="${I}"]`);j&&j.classList.remove("deleting")}finally{t(6,m=null)}})}function v(){g&&b(g)}const x=I=>A(I,"关闭历史会话");function M(){p=this.value,t(4,p)}const O=I=>l(I.sessionId),X=(I,C)=>_(C,I.sessionId),H=()=>t(7,g=null);return s.$$set=I=>{"sessions"in I&&t(0,n=I.sessions),"onClose"in I&&t(1,o=I.onClose),"onSelect"in I&&t(2,l=I.onSelect),"zIndex"in I&&t(3,i=I.zIndex),"apiPrefix"in I&&t(15,r=I.apiPrefix)},s.$$.update=()=>{s.$$.dirty&16&&p!==void 0&&(t(0,n=[]),h=0,u=!0,T())},[n,o,l,i,p,c,m,g,k,L,R,A,w,_,v,r,x,M,O,X,H]}class qs extends Tn{constructor(e){super(),yn(this,e,Qo,Vo,pt,{sessions:0,onClose:1,onSelect:2,zIndex:3,apiPrefix:15})}}function Gs(s,e,t){const n=s.slice();return n[65]=e[t],n}function Ys(s,e,t){const n=s.slice();return n[68]=e[t],n[69]=e,n[70]=t,n}function Zs(s,e,t){const n=s.slice();return n[71]=e[t],n[73]=t,n}function Jo(s){let e,t=[],n=new Map,o=st(s[5]);const l=i=>i[68].id;for(let i=0;i<o.length;i+=1){let r=Ys(s,o,i),c=l(r);n.set(c,t[i]=ei(c,r))}return{c(){e=S("div");for(let i=0;i<t.length;i+=1)t[i].c();a(e,"class","sy-assistant-message-list svelte-mogmt")},m(i,r){G(i,e,r);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);s[51](e)},p(i,r){r[0]&2141447137|r[1]&1&&(o=st(i[5]),t=ss(t,r,l,1,i,o,n,e,ns,ei,null,Ys))},i:U,o:U,d(i){i&&W(e);for(let r=0;r<t.length;r+=1)t[r].d();s[51](null)}}}function Ko(s){let e,t;return e=new qs({props:{sessions:s[32],onClose:s[34],onSelect:s[35],zIndex:s[0],apiPrefix:s[2]}}),{c(){bn(e.$$.fragment)},m(n,o){Zt(e,n,o),t=!0},p(n,o){const l={};o[0]&1&&(l.zIndex=n[0]),o[0]&4&&(l.apiPrefix=n[2]),e.$set(l)},i(n){t||(je(e.$$.fragment,n),t=!0)},o(n){$e(e.$$.fragment,n),t=!1},d(n){Xt(e,n)}}}function $o(s){let e;return{c(){e=S("div"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"></path></svg>',a(e,"class","sy-assistant-avatar user svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function el(s){let e;return{c(){e=S("div"),e.innerHTML='<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',a(e,"class","sy-assistant-avatar assistant svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function tl(s){let e,t=s[21](s[68].content)+"";return{c(){e=S("div"),a(e,"class","markdown-content svelte-mogmt")},m(n,o){G(n,e,o),e.innerHTML=t},p(n,o){o[0]&32&&t!==(t=n[21](n[68].content)+"")&&(e.innerHTML=t)},d(n){n&&W(e)}}}function nl(s){let e;return{c(){e=S("span"),e.innerHTML='<span class="dot svelte-mogmt">.</span> <span class="dot svelte-mogmt">.</span> <span class="dot svelte-mogmt">.</span>',a(e,"class","sy-assistant-loading svelte-mogmt")},m(t,n){G(t,e,n)},p:U,d(t){t&&W(e)}}}function Xs(s){let e,t=st(s[68].attachments),n=[];for(let o=0;o<t.length;o+=1)n[o]=Js(Zs(s,t,o));return{c(){e=S("div");for(let o=0;o<n.length;o+=1)n[o].c();a(e,"class","sy-assistant-attachments svelte-mogmt")},m(o,l){G(o,e,l);for(let i=0;i<n.length;i+=1)n[i]&&n[i].m(e,null)},p(o,l){if(l[0]&58720737){t=st(o[68].attachments);let i;for(i=0;i<t.length;i+=1){const r=Zs(o,t,i);n[i]?n[i].p(r,l):(n[i]=Js(r),n[i].c(),n[i].m(e,null))}for(;i<n.length;i+=1)n[i].d(1);n.length=t.length}},d(o){o&&W(e),Jn(n,o)}}}function Vs(s){let e,t,n;function o(...l){return s[38](s[71],...l)}return{c(){e=S("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-mogmt"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',a(e,"class","sy-assistant-attachment-toggle svelte-mogmt"),a(e,"aria-label","查看详情")},m(l,i){G(l,e,i),t||(n=[Y(e,"mouseenter",o),Y(e,"mouseleave",s[24])],t=!0)},p(l,i){s=l},d(l){l&&W(e),t=!1,we(n)}}}function Qs(s){let e,t=s[6].replace(/\n/g,"<br>")+"",n,o;return{c(){e=S("div"),a(e,"class","sy-assistant-tooltip svelte-mogmt"),a(e,"role","tooltip"),N(e,"left",s[7].x+"px"),N(e,"top",s[7].y+"px"),N(e,"z-index",s[0]+3),$(e,"align-right",s[7].alignRight)},m(l,i){G(l,e,i),e.innerHTML=t,n||(o=[Y(e,"mouseenter",s[40]),Y(e,"mouseleave",s[41])],n=!0)},p(l,i){i[0]&64&&t!==(t=l[6].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),i[0]&128&&N(e,"left",l[7].x+"px"),i[0]&128&&N(e,"top",l[7].y+"px"),i[0]&1&&N(e,"z-index",l[0]+3),i[0]&128&&$(e,"align-right",l[7].alignRight)},d(l){l&&W(e),n=!1,we(o)}}}function Js(s){let e,t,n,o,l,i,r,c,u,h=on(s[71].content_title).name+"",p,m,g,k=on(s[71].content_title).ext+"",T,R,L,A,w,_,b,v,x,M,O=s[71].tips&&Vs(s);function X(){return s[39](s[71])}let H=s[6]&&Qs(s);return{c(){e=S("div"),t=S("div"),n=S("div"),o=J("svg"),l=J("path"),i=J("polyline"),r=q(),c=S("div"),u=S("span"),p=Se(h),m=q(),g=S("span"),T=Se(k),L=q(),A=S("div"),O&&O.c(),w=q(),_=S("button"),_.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-mogmt"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>',b=q(),H&&H.c(),v=q(),a(l,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),a(i,"points","13 2 13 9 20 9"),a(o,"xmlns","http://www.w3.org/2000/svg"),a(o,"width","16"),a(o,"height","16"),a(o,"viewBox","0 0 24 24"),a(o,"fill","none"),a(o,"stroke","currentColor"),a(o,"stroke-width","2"),a(o,"stroke-linecap","round"),a(o,"stroke-linejoin","round"),a(u,"class","sy-assistant-filename svelte-mogmt"),a(g,"class","sy-assistant-attachment-ext svelte-mogmt"),a(c,"class","sy-assistant-attachment-name svelte-mogmt"),a(c,"title",R=s[71].content_title),a(n,"class","sy-assistant-attachment-title svelte-mogmt"),a(_,"class","sy-assistant-attachment-toggle svelte-mogmt"),a(_,"aria-label","下载文件"),a(A,"class","sy-assistant-attachment-actions svelte-mogmt"),a(t,"class","sy-assistant-attachment-header svelte-mogmt"),a(e,"class","sy-assistant-attachment svelte-mogmt")},m(I,C){G(I,e,C),d(e,t),d(t,n),d(n,o),d(o,l),d(o,i),d(n,r),d(n,c),d(c,u),d(u,p),d(c,m),d(c,g),d(g,T),d(t,L),d(t,A),O&&O.m(A,null),d(A,w),d(A,_),d(e,b),H&&H.m(e,null),d(e,v),x||(M=Y(_,"click",X),x=!0)},p(I,C){s=I,C[0]&32&&h!==(h=on(s[71].content_title).name+"")&&Fe(p,h),C[0]&32&&k!==(k=on(s[71].content_title).ext+"")&&Fe(T,k),C[0]&32&&R!==(R=s[71].content_title)&&a(c,"title",R),s[71].tips?O?O.p(s,C):(O=Vs(s),O.c(),O.m(A,w)):O&&(O.d(1),O=null),s[6]?H?H.p(s,C):(H=Qs(s),H.c(),H.m(e,v)):H&&(H.d(1),H=null)},d(I){I&&W(e),O&&O.d(),H&&H.d(),x=!1,M()}}}function Ks(s){let e,t,n,o,l,i,r,c,u,h,p;function m(v,x){return v[13][v[68].id]?il:sl}let g=m(s),k=g(s);function T(){return s[42](s[68])}function R(...v){return s[43](s[68],...v)}function L(){return s[44](s[68])}function A(...v){return s[45](s[68],...v)}function w(...v){return s[46](s[68],...v)}function _(...v){return s[47](s[68],...v)}let b=s[16]&&s[14][s[68].id]==="dislike"&&$s(s);return{c(){e=S("div"),t=S("button"),k.c(),o=q(),l=S("button"),l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>',i=q(),r=S("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-3"></path></svg>',c=q(),b&&b.c(),u=qt(),a(t,"class","sy-assistant-action-button svelte-mogmt"),a(t,"aria-label",n=s[13][s[68].id]?"已复制":"复制内容"),$(t,"copied",s[13][s[68].id]),a(l,"class","sy-assistant-action-button svelte-mogmt"),a(l,"aria-label","点赞"),$(l,"active",s[14][s[68].id]==="like"),a(r,"class","sy-assistant-action-button svelte-mogmt"),a(r,"aria-label","点踩"),$(r,"active",s[14][s[68].id]==="dislike"),a(e,"class","sy-assistant-message-actions svelte-mogmt")},m(v,x){G(v,e,x),d(e,t),k.m(t,null),d(e,o),d(e,l),d(e,i),d(e,r),G(v,c,x),b&&b.m(v,x),G(v,u,x),h||(p=[Y(t,"click",T),Y(t,"mouseenter",R),Y(t,"mouseleave",s[31]),Y(l,"click",L),Y(l,"mouseenter",A),Y(l,"mouseleave",s[31]),Y(r,"click",w),Y(r,"mouseenter",_),Y(r,"mouseleave",s[31])],h=!0)},p(v,x){s=v,g!==(g=m(s))&&(k.d(1),k=g(s),k&&(k.c(),k.m(t,null))),x[0]&8224&&n!==(n=s[13][s[68].id]?"已复制":"复制内容")&&a(t,"aria-label",n),x[0]&8224&&$(t,"copied",s[13][s[68].id]),x[0]&16416&&$(l,"active",s[14][s[68].id]==="like"),x[0]&16416&&$(r,"active",s[14][s[68].id]==="dislike"),s[16]&&s[14][s[68].id]==="dislike"?b?b.p(s,x):(b=$s(s),b.c(),b.m(u.parentNode,u)):b&&(b.d(1),b=null)},d(v){v&&(W(e),W(c),W(u)),k.d(),b&&b.d(v),h=!1,we(p)}}}function sl(s){let e,t,n;return{c(){e=J("svg"),t=J("rect"),n=J("path"),a(t,"x","9"),a(t,"y","9"),a(t,"width","13"),a(t,"height","13"),a(t,"rx","2"),a(t,"ry","2"),a(n,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(o,l){G(o,e,l),d(e,t),d(e,n)},d(o){o&&W(e)}}}function il(s){let e,t;return{c(){e=J("svg"),t=J("polyline"),a(t,"points","20 6 9 17 4 12"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(n,o){G(n,e,o),d(e,t)},d(n){n&&W(e)}}}function $s(s){let e,t,n,o,l,i,r,c,u,h,p;function m(){s[48].call(o,s[68])}function g(){return s[49](s[68])}function k(){return s[50](s[68])}return{c(){e=S("div"),t=S("div"),t.textContent="反馈意见",n=q(),o=S("textarea"),l=q(),i=S("div"),r=S("button"),r.textContent="取消",c=q(),u=S("button"),u.textContent="提交",a(t,"class","sy-assistant-dislike-title svelte-mogmt"),a(o,"class","sy-assistant-dislike-input svelte-mogmt"),a(o,"placeholder","请输入您的反馈意见..."),a(r,"class","sy-assistant-popup-cancel svelte-mogmt"),a(u,"class","sy-assistant-popup-submit svelte-mogmt"),a(i,"class","sy-assistant-popup-actions svelte-mogmt"),a(e,"class","sy-assistant-dislike-popup svelte-mogmt"),N(e,"left",s[17].x+"px"),N(e,"top",s[17].y+"px"),N(e,"z-index",s[0]+3)},m(T,R){G(T,e,R),d(e,t),d(e,n),d(e,o),nt(o,s[15][s[68].id]),d(e,l),d(e,i),d(i,r),d(i,c),d(i,u),h||(p=[Y(o,"input",m),Y(r,"click",g),Y(u,"click",k)],h=!0)},p(T,R){s=T,R[0]&32800&&nt(o,s[15][s[68].id]),R[0]&131072&&N(e,"left",s[17].x+"px"),R[0]&131072&&N(e,"top",s[17].y+"px"),R[0]&1&&N(e,"z-index",s[0]+3)},d(T){T&&W(e),h=!1,we(p)}}}function ei(s,e){let t,n,o,l,i,r,c,u,h=new Date(e[68].timestamp).toLocaleString()+"",p,m;function g(b,v){return b[68].type==="assistant"?el:$o}let k=g(e),T=k(e);function R(b,v){return b[9]&&b[68].id===b[5][b[5].length-1].id&&b[68].type==="assistant"&&!b[68].content?nl:tl}let L=R(e),A=L(e),w=e[68].attachments&&Xs(e),_=e[68].id!=="-1"&&e[68].type==="assistant"&&!e[9]&&Ks(e);return{key:s,first:null,c(){t=S("div"),T.c(),n=q(),o=S("div"),l=S("div"),A.c(),i=q(),w&&w.c(),r=q(),_&&_.c(),c=q(),u=S("div"),p=Se(h),m=q(),a(l,"class","sy-assistant-message-content svelte-mogmt"),a(u,"class","sy-assistant-message-time svelte-mogmt"),a(o,"class","sy-assistant-message-bubble svelte-mogmt"),a(t,"class","sy-assistant-message svelte-mogmt"),$(t,"user",e[68].type==="user"),this.first=t},m(b,v){G(b,t,v),T.m(t,null),d(t,n),d(t,o),d(o,l),A.m(l,null),d(l,i),w&&w.m(l,null),d(l,r),_&&_.m(l,null),d(o,c),d(o,u),d(u,p),d(t,m)},p(b,v){e=b,k!==(k=g(e))&&(T.d(1),T=k(e),T&&(T.c(),T.m(t,n))),L===(L=R(e))&&A?A.p(e,v):(A.d(1),A=L(e),A&&(A.c(),A.m(l,i))),e[68].attachments?w?w.p(e,v):(w=Xs(e),w.c(),w.m(l,r)):w&&(w.d(1),w=null),e[68].id!=="-1"&&e[68].type==="assistant"&&!e[9]?_?_.p(e,v):(_=Ks(e),_.c(),_.m(l,null)):_&&(_.d(1),_=null),v[0]&32&&h!==(h=new Date(e[68].timestamp).toLocaleString()+"")&&Fe(p,h),v[0]&32&&$(t,"user",e[68].type==="user")},d(b){b&&W(t),T.d(),A.d(),w&&w.d(),_&&_.d()}}}function ti(s){let e,t,n,o,l,i,r,c,u,h,p,m,g,k,T,R,L,A,w,_,b,v,x,M,O,X,H,I=s[1]&&ni(s),C=!s[1]&&ii();return{c(){e=S("div"),t=S("div"),I&&I.c(),n=q(),C&&C.c(),o=q(),l=S("div"),i=S("button"),i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8v4l3 3"></path><circle cx="12" cy="12" r="10"></circle></svg>',r=q(),c=S("button"),c.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',u=q(),h=S("div"),p=S("div"),m=S("div"),g=S("div"),k=S("textarea"),T=q(),R=S("div"),L=Se(s[4]),A=Se("/"),w=Se(jn),_=q(),b=S("button"),v=J("svg"),x=J("line"),M=J("polygon"),a(i,"class","sy-assistant-icon-button svelte-mogmt"),a(i,"aria-label","历史会话"),a(c,"class","sy-assistant-icon-button svelte-mogmt"),a(c,"aria-label","新建会话"),a(l,"class","sy-assistant-chat-actions-btns svelte-mogmt"),a(t,"class","sy-assistant-chat-actions svelte-mogmt"),a(e,"class","sy-assistant-chat-footer svelte-mogmt"),a(k,"class","sy-assistant-textarea svelte-mogmt"),a(k,"placeholder","输入您的问题..."),a(k,"maxlength",jn),a(k,"rows","3"),a(R,"class","sy-assistant-char-count svelte-mogmt"),$(R,"over-limit",s[20]),a(g,"class","sy-assistant-textarea-container svelte-mogmt"),a(m,"class","sy-assistant-input-wrapper svelte-mogmt"),a(x,"x1","22"),a(x,"y1","2"),a(x,"x2","11"),a(x,"y2","13"),a(M,"points","22 2 15 22 11 13 2 9 22 2"),a(v,"xmlns","http://www.w3.org/2000/svg"),a(v,"width","20"),a(v,"height","20"),a(v,"viewBox","0 0 24 24"),a(v,"fill","none"),a(v,"stroke","currentColor"),a(v,"stroke-width","2"),a(v,"stroke-linecap","round"),a(v,"stroke-linejoin","round"),a(b,"class","sy-assistant-send-button svelte-mogmt"),b.disabled=O=!s[3].trim()||s[20],a(b,"aria-label","发送消息"),a(p,"class","sy-assistant-input-container svelte-mogmt"),a(h,"class","sy-assistant-input-area svelte-mogmt")},m(j,V){G(j,e,V),d(e,t),I&&I.m(t,null),d(t,n),C&&C.m(t,null),d(t,o),d(t,l),d(l,i),d(l,r),d(l,c),G(j,u,V),G(j,h,V),d(h,p),d(p,m),d(m,g),d(g,k),nt(k,s[3]),d(g,T),d(g,R),d(R,L),d(R,A),d(R,w),d(p,_),d(p,b),d(b,v),d(v,x),d(v,M),X||(H=[Y(i,"click",s[33]),Y(i,"mouseenter",s[53]),Y(i,"mouseleave",s[31]),Y(c,"click",s[36]),Y(c,"mouseenter",s[54]),Y(c,"mouseleave",s[31]),Y(k,"input",s[55]),Y(k,"keydown",s[56]),Y(b,"click",s[22]),Y(b,"mouseenter",s[57]),Y(b,"mouseleave",s[31])],X=!0)},p(j,V){j[1]?I?I.p(j,V):(I=ni(j),I.c(),I.m(t,n)):I&&(I.d(1),I=null),j[1]?C&&(C.d(1),C=null):C||(C=ii(),C.c(),C.m(t,o)),V[0]&8&&nt(k,j[3]),V[0]&16&&Fe(L,j[4]),V[0]&1048576&&$(R,"over-limit",j[20]),V[0]&1048584&&O!==(O=!j[3].trim()||j[20])&&(b.disabled=O)},d(j){j&&(W(e),W(u),W(h)),I&&I.d(),C&&C.d(),X=!1,we(H)}}}function ni(s){let e,t,n,o,l=st(s[11]),i=[];for(let r=0;r<l.length;r+=1)i[r]=si(Gs(s,l,r));return{c(){e=S("div"),t=S("select");for(let r=0;r<i.length;r+=1)i[r].c();a(t,"class","sy-assistant-select svelte-mogmt"),s[12]===void 0&&Gt(()=>s[52].call(t)),a(e,"class","sy-assistant-scene-select svelte-mogmt")},m(r,c){G(r,e,c),d(e,t);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(t,null);$n(t,s[12],!0),n||(o=Y(t,"change",s[52]),n=!0)},p(r,c){if(c[0]&2048){l=st(r[11]);let u;for(u=0;u<l.length;u+=1){const h=Gs(r,l,u);i[u]?i[u].p(h,c):(i[u]=si(h),i[u].c(),i[u].m(t,null))}for(;u<i.length;u+=1)i[u].d(1);i.length=l.length}c[0]&6144&&$n(t,r[12])},d(r){r&&W(e),Jn(i,r),n=!1,o()}}}function si(s){let e,t=s[65].name+"",n,o,l;return{c(){e=S("option"),n=Se(t),o=q(),e.__value=l=s[65].code,nt(e,e.__value)},m(i,r){G(i,e,r),d(e,n),d(e,o)},p(i,r){r[0]&2048&&t!==(t=i[65].name+"")&&Fe(n,t),r[0]&2048&&l!==(l=i[65].code)&&(e.__value=l,nt(e,e.__value))},d(i){i&&W(e)}}}function ii(s){let e;return{c(){e=S("div"),a(e,"class","sy-assistant-scene-select svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function oi(s){let e,t=s[18].text+"",n;return{c(){e=S("div"),n=Se(t),a(e,"class","sy-assistant-button-tooltip svelte-mogmt"),N(e,"left",s[18].x+"px"),N(e,"top",s[18].y+"px")},m(o,l){G(o,e,l),d(e,n)},p(o,l){l[0]&262144&&t!==(t=o[18].text+"")&&Fe(n,t),l[0]&262144&&N(e,"left",o[18].x+"px"),l[0]&262144&&N(e,"top",o[18].y+"px")},d(o){o&&W(e)}}}function ol(s){let e,t,n,o,l,i,r;const c=[Ko,Jo],u=[];function h(g,k){return g[19]?0:1}t=h(s),n=u[t]=c[t](s);let p=!s[19]&&ti(s),m=s[18]&&oi(s);return{c(){e=S("div"),n.c(),o=q(),p&&p.c(),l=q(),m&&m.c(),i=qt(),a(e,"class","sy-assistant-chat-container svelte-mogmt"),N(e,"z-index",s[0]+2)},m(g,k){G(g,e,k),u[t].m(e,null),d(e,o),p&&p.m(e,null),G(g,l,k),m&&m.m(g,k),G(g,i,k),r=!0},p(g,k){let T=t;t=h(g),t===T?u[t].p(g,k):(_n(),$e(u[T],1,1,()=>{u[T]=null}),wn(),n=u[t],n?n.p(g,k):(n=u[t]=c[t](g),n.c()),je(n,1),n.m(e,o)),g[19]?p&&(p.d(1),p=null):p?p.p(g,k):(p=ti(g),p.c(),p.m(e,null)),(!r||k[0]&1)&&N(e,"z-index",g[0]+2),g[18]?m?m.p(g,k):(m=oi(g),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null)},i(g){r||(je(n),r=!0)},o(g){$e(n),r=!1},d(g){g&&(W(e),W(l),W(i)),u[t].d(),p&&p.d(),m&&m.d(g)}}}let jn=500;function ll(s){const e=s.match(/source#\[(.*)\]#source/);return e?s.replace(`source#[${e[1]}]#source`,""):s}function li(s){const e=s.match(/source#\[(.*)\]#source/);if(e)try{return JSON.parse(`[${e[1]}]`)}catch(t){console.error("Failed to parse attachments:",t)}return null}function on(s){const e=s.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:s,ext:""}}function rl(s,e,t){let n,o,l="",i=[{sessionId:"",requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],r="",c=null,u=null,h={x:0,y:0,alignRight:!1},p=null,m=!1;se.setOptions({breaks:!0,gfm:!0});function g(y){try{const B=se(y);return Ps.sanitize(B)}catch(B){console.warn("Markdown parsing failed, fallback to HTML:",B);try{const K=y.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return Ps.sanitize(K)}catch(K){return console.error("HTML fallback failed:",K),y}}}let k;function T(y=!1){k&&k.scrollTo({top:k.scrollHeight,behavior:y?"smooth":"auto"})}xi(()=>{T(!1)});let{zIndex:R}=e,{sessionId:L}=e,{hasScene:A}=e,{apiPrefix:w}=e,_=[],b="";function v(){return Re(this,null,function*(){if(A)try{const y=yield fetch(`${w}/chat/getSceneList`,{headers:{"Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`}});if(!y.ok)throw new Error("Failed to fetch scenes");const B=yield y.json();B.code===0&&(t(11,_=B.data.sceneList||[]),_.length>0&&t(12,b=_[0].code))}catch(y){console.error("Failed to fetch scenes:",y)}})}mn(()=>{v()});function x(){return Re(this,null,function*(){if(!l.trim()||o)return;if(!L){console.error("No session ID available");return}const y=Date.now().toString(),B=Date.now().toString()+Math.random().toString().slice(2,8),K={sessionId:L,requestId:B,id:y,type:"user",content:l.trim(),timestamp:Date.now()};t(5,i=[...i,K]);const fe=l.trim();t(3,l="");const he=(Date.now()+1).toString();r="",t(5,i=[...i,{sessionId:L,requestId:B,id:he,type:"assistant",content:"",timestamp:Date.now()}]),t(9,m=!0),c&&c.abort(),c=new AbortController;try{yield Wi(`${w}/chat/sse`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({sessionId:L,requestId:B,keyword:fe,flowId:"1",extendKeys:A?{sceneCode:b}:void 0}),signal:c.signal,onmessage(Te){try{const me=Te.data;if(me){const Tt=li(me);Tt?(t(5,i=i.map(Ge=>Ge.id===he?Ee(le({},Ge),{attachments:Tt}):Ge)),T(!0)):(r+=me,t(5,i=i.map(Ge=>Ge.id===he?Ee(le({},Ge),{content:r}):Ge)),T(!1))}}catch(me){console.error("Failed to process SSE message:",me)}},onerror(Te){throw r="请求异常,请重试",t(5,i=i.map(me=>me.id===he?Ee(le({},me),{content:r}):me)),T(!1),console.error("SSE error:",Te),c=null,t(9,m=!1),Te},onclose(){c=null,t(9,m=!1)}})}catch(Te){console.error("Failed to send message:",Te),t(9,m=!1)}})}function M(y,B,K){const fe=K.getBoundingClientRect(),he=k.getBoundingClientRect(),Te=fe.left<he.width/2;t(6,u=B),t(7,h={x:fe.left,y:fe.top+fe.height/2,alignRight:Te})}function O(){t(8,p=setTimeout(()=>{t(6,u=null),t(8,p=null)},200))}Ii(()=>{c&&c.abort(),p&&clearTimeout(p)});function X(y,B){return Re(this,null,function*(){try{const K=yield fetch(`${w}/file/downloadFile`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({fileName:y,fileUrl:B})});if(!K.ok)throw new Error("Download failed");const fe=K.headers.get("content-type")||"application/octet-stream",he=yield K.blob(),Te=window.URL.createObjectURL(he),me=document.createElement("a");me.href=Te,me.download=y,document.body.appendChild(me),me.click(),window.URL.revokeObjectURL(Te),document.body.removeChild(me)}catch(K){console.error("Failed to download file:",K)}})}let H={};function I(y,B){return Re(this,null,function*(){try{const K=B.replace(/<br\s*\/?>/g,`
|
48
|
-
`).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();yield navigator.clipboard.writeText(K),t(13,H[y]=!0,H),setTimeout(()=>{t(13,H[y]=!1,H),t(13,H)},1500)}catch(K){console.error("Failed to copy:",K)}})}let C={},j={},V=!1;function ie(y,B){return Re(this,null,function*(){if(C[y]===B){t(14,C[y]=null,C),t(14,C);return}if(t(14,C[y]=B,C),t(14,C),B==="like")try{if(!(yield fetch(`${w}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({sessionId:L,requestId:y,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch(K){console.error("Failed to send feedback:",K),t(14,C[y]=null,C),t(14,C)}else t(16,V=!0)})}function _e(y){return Re(this,null,function*(){var B;if((B=j[y])!=null&&B.trim())try{if(!(yield fetch(`${w}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({sessionId:L,requestId:y,feedBackFlag:"0",feedBackContent:j[y]})})).ok)throw new Error("Feedback failed");t(16,V=!1),t(15,j[y]="",j),t(15,j)}catch(K){console.error("Failed to send feedback:",K),t(14,C[y]=null,C),t(14,C)}})}let We={x:0,y:0};function de(y,B){const fe=y.currentTarget.getBoundingClientRect();t(17,We={x:fe.left-290,y:fe.top-160}),ie(B,"dislike")}let qe=null;function ne(y,B){const fe=y.currentTarget.getBoundingClientRect();t(18,qe={text:B,x:fe.left+fe.width/2,y:fe.top-8})}function Ze(){t(18,qe=null)}let oe=!1,Oe=[],ee=Date.now().toString();function De(){Ze(),t(19,oe=!0)}function xe(){Ze(),t(19,oe=!1)}function et(y){return Re(this,null,function*(){if(!m){t(9,m=!0);try{const B=yield fetch(`${w}/chat/record/session/detail/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`},body:JSON.stringify({sessionId:y})});if(!B.ok)throw new Error("Failed to load sessions");const K=yield B.json();if(K.code===0){ee=y,t(19,oe=!1);const fe=K.data.map((he,Te)=>{const me=li(he.answer),Tt=ll(he.answer);return[{sessionId:he.sessionId,requestId:he.requestId,id:(Date.now()+2*Te).toString(),type:"user",content:he.keyword,timestamp:new Date(he.createDate).getTime()},{sessionId:he.sessionId,requestId:he.requestId,id:(Date.now()+2*Te+1).toString(),type:"assistant",content:Tt,attachments:me,timestamp:new Date(he.createDate).getTime()}]});t(5,i=fe.flat())}}catch(B){console.error("Failed to load sessions:",B)}finally{t(9,m=!1)}}})}function F(){return Re(this,null,function*(){const y=yield ae();if(!y){console.error("Failed to create new session");return}ee=y,t(5,i=[{sessionId:ee,requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(3,l="")})}function ae(){return Re(this,null,function*(){try{const y=yield fetch(`${w}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`}});if(!y.ok)throw new Error("Failed to get session ID");const B=yield y.json();if(B.code===0)return ee=B.data.sessionId,ee;throw new Error(B.message||"Failed to get session ID")}catch(y){return console.error("Failed to get session ID:",y),null}})}const D=(y,B)=>M(B,y.tips,B.currentTarget),Z=y=>X(y.content_title,y.link),be=()=>{p&&(clearTimeout(p),t(8,p=null))},ye=()=>{t(6,u=null)},Pe=y=>I(y.id,y.content),Be=(y,B)=>ne(B,H[y.id]?"已复制":"复制内容"),it=y=>ie(y.id,"like"),bt=(y,B)=>ne(B,C[y.id]==="like"?"取消点赞":"点赞"),yt=(y,B)=>de(B,y.id),ln=(y,B)=>ne(B,C[y.id]==="dislike"?"取消点踩":"点踩");function rn(y){j[y.id]=this.value,t(15,j)}const Wn=y=>{t(16,V=!1),t(14,C[y.id]=null,C),t(14,C)},Ht=y=>_e(y.id);function ht(y){It[y?"unshift":"push"](()=>{k=y,t(10,k)})}function ot(){b=Ai(this),t(12,b),t(11,_)}const lt=y=>ne(y,"历史会话"),an=y=>ne(y,"新建会话");function cn(){l=this.value,t(3,l)}const un=y=>y.key==="Enter"&&!y.shiftKey&&(x(),y.preventDefault()),Bt=y=>ne(y,"发送消息");return s.$$set=y=>{"zIndex"in y&&t(0,R=y.zIndex),"sessionId"in y&&t(37,L=y.sessionId),"hasScene"in y&&t(1,A=y.hasScene),"apiPrefix"in y&&t(2,w=y.apiPrefix)},s.$$.update=()=>{s.$$.dirty[0]&8&&t(4,n=l.length),s.$$.dirty[0]&16&&t(20,o=n>jn)},[R,A,w,l,n,i,u,h,p,m,k,_,b,H,C,j,V,We,qe,oe,o,g,x,M,O,X,I,ie,_e,de,ne,Ze,Oe,De,xe,et,F,L,D,Z,be,ye,Pe,Be,it,bt,yt,ln,rn,Wn,Ht,ht,ot,lt,an,cn,un,Bt]}class al extends Tn{constructor(e){super(),yn(this,e,rl,ol,pt,{zIndex:0,sessionId:37,hasScene:1,apiPrefix:2},null,[-1,-1,-1])}}function ri(s){let e,t,n,o,l=s[3].title+"",i,r,c,u,h,p,m,g,k,T=s[2]?"退出全屏":"全屏显示",R,L,A,w,_,b,v,x,M=s[7]?"取消吸附":"吸附到边缘",O,X,H,I,C,j,V,ie,_e,We=`${s[3].height}px`,de,qe,ne;function Ze(D,Z){return D[2]?ul:cl}let oe=Ze(s),Oe=oe(s);function ee(D,Z){return D[7]?hl:fl}let De=ee(s),xe=De(s);const et=[dl,pl],F=[];function ae(D,Z){return D[8]?0:1}return ie=ae(s),_e=F[ie]=et[ie](s),{c(){var D,Z,be;e=S("div"),t=S("div"),n=S("div"),o=S("h3"),i=Se(l),r=q(),c=S("div"),u=S("div"),h=S("button"),p=J("svg"),Oe.c(),g=q(),k=S("span"),R=Se(T),L=q(),A=S("div"),w=S("button"),_=J("svg"),xe.c(),v=q(),x=S("span"),O=Se(M),X=q(),H=S("div"),I=S("button"),I.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',C=q(),j=S("span"),j.textContent="关闭助手",V=q(),_e.c(),a(o,"class","svelte-1427avp"),a(p,"xmlns","http://www.w3.org/2000/svg"),a(p,"width","18"),a(p,"height","18"),a(p,"viewBox","0 0 24 24"),a(p,"fill","none"),a(p,"stroke","currentColor"),a(p,"stroke-width","2"),a(p,"stroke-linecap","round"),a(p,"stroke-linejoin","round"),a(h,"class","sy-assistant-action-button svelte-1427avp"),a(h,"aria-label",m=s[2]?"退出全屏":"全屏显示"),$(h,"active",s[2]),a(k,"class","sy-assistant-tooltip svelte-1427avp"),N(k,"z-index",((D=s[3].zIndex)!=null?D:1e3)+3),a(u,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(_,"xmlns","http://www.w3.org/2000/svg"),a(_,"width","18"),a(_,"height","18"),a(_,"viewBox","0 0 24 24"),a(_,"fill","none"),a(_,"stroke","currentColor"),a(_,"stroke-width","2"),a(_,"stroke-linecap","round"),a(_,"stroke-linejoin","round"),a(w,"class","sy-assistant-action-button svelte-1427avp"),a(w,"aria-label",b=s[7]?"取消吸附":"吸附到边缘"),$(w,"active",s[7]),a(x,"class","sy-assistant-tooltip svelte-1427avp"),N(x,"z-index",((Z=s[3].zIndex)!=null?Z:1e3)+3),a(A,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(I,"class","sy-assistant-close-button svelte-1427avp"),a(I,"aria-label","关闭助手"),a(j,"class","sy-assistant-tooltip svelte-1427avp"),N(j,"z-index",((be=s[3].zIndex)!=null?be:1e3)+3),a(H,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(c,"class","sy-assistant-header-actions svelte-1427avp"),a(n,"class","sy-assistant-drawer-header svelte-1427avp"),a(n,"role","button"),a(n,"tabindex","0"),a(n,"aria-label","拖动助手窗口"),$(n,"dragging",s[6]),$(n,"fullscreen",s[2]),$(n,"snapped",s[7]),a(t,"class","sy-assistant-drawer-content svelte-1427avp"),a(e,"class","sy-assistant-drawer svelte-1427avp"),$(e,"fullscreen",s[2]),N(e,"height",We)},m(D,Z){G(D,e,Z),d(e,t),d(t,n),d(n,o),d(o,i),d(n,r),d(n,c),d(c,u),d(u,h),d(h,p),Oe.m(p,null),d(u,g),d(u,k),d(k,R),d(c,L),d(c,A),d(A,w),d(w,_),xe.m(_,null),d(A,v),d(A,x),d(x,O),d(c,X),d(c,H),d(H,I),d(H,C),d(H,j),d(t,V),F[ie].m(t,null),de=!0,qe||(ne=[Y(h,"click",s[16]),Y(w,"click",s[18]),Y(I,"click",s[15]),Y(n,"mousedown",Kn(s[17]))],qe=!0)},p(D,Z){var ye,Pe,Be;(!de||Z[0]&8)&&l!==(l=D[3].title+"")&&Fe(i,l),oe!==(oe=Ze(D))&&(Oe.d(1),Oe=oe(D),Oe&&(Oe.c(),Oe.m(p,null))),(!de||Z[0]&4&&m!==(m=D[2]?"退出全屏":"全屏显示"))&&a(h,"aria-label",m),(!de||Z[0]&4)&&$(h,"active",D[2]),(!de||Z[0]&4)&&T!==(T=D[2]?"退出全屏":"全屏显示")&&Fe(R,T),Z[0]&8&&N(k,"z-index",((ye=D[3].zIndex)!=null?ye:1e3)+3),De!==(De=ee(D))&&(xe.d(1),xe=De(D),xe&&(xe.c(),xe.m(_,null))),(!de||Z[0]&128&&b!==(b=D[7]?"取消吸附":"吸附到边缘"))&&a(w,"aria-label",b),(!de||Z[0]&128)&&$(w,"active",D[7]),(!de||Z[0]&128)&&M!==(M=D[7]?"取消吸附":"吸附到边缘")&&Fe(O,M),Z[0]&8&&N(x,"z-index",((Pe=D[3].zIndex)!=null?Pe:1e3)+3),Z[0]&8&&N(j,"z-index",((Be=D[3].zIndex)!=null?Be:1e3)+3),(!de||Z[0]&64)&&$(n,"dragging",D[6]),(!de||Z[0]&4)&&$(n,"fullscreen",D[2]),(!de||Z[0]&128)&&$(n,"snapped",D[7]);let be=ie;ie=ae(D),ie===be?F[ie].p(D,Z):(_n(),$e(F[be],1,1,()=>{F[be]=null}),wn(),_e=F[ie],_e?_e.p(D,Z):(_e=F[ie]=et[ie](D),_e.c()),je(_e,1),_e.m(t,null)),(!de||Z[0]&4)&&$(e,"fullscreen",D[2]),Z[0]&8&&We!==(We=`${D[3].height}px`)&&N(e,"height",We)},i(D){de||(je(_e),de=!0)},o(D){$e(_e),de=!1},d(D){D&&W(e),Oe.d(),xe.d(),F[ie].d(),qe=!1,we(ne)}}}function cl(s){let e;return{c(){e=J("path"),a(e,"d","M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function ul(s){let e;return{c(){e=J("path"),a(e,"d","M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function fl(s){let e,t;return{c(){e=J("rect"),t=J("line"),a(e,"x","3"),a(e,"y","3"),a(e,"width","18"),a(e,"height","18"),a(e,"rx","2"),a(e,"ry","2"),a(t,"x1","16"),a(t,"y1","6"),a(t,"x2","16"),a(t,"y2","18")},m(n,o){G(n,e,o),G(n,t,o)},d(n){n&&(W(e),W(t))}}}function hl(s){let e,t;return{c(){e=J("rect"),t=J("rect"),a(e,"x","3"),a(e,"y","3"),a(e,"width","18"),a(e,"height","18"),a(e,"rx","2"),a(e,"ry","2"),a(t,"x","12"),a(t,"y","10"),a(t,"width","6"),a(t,"height","8"),a(t,"rx","1"),a(t,"ry","1")},m(n,o){G(n,e,o),G(n,t,o)},d(n){n&&(W(e),W(t))}}}function pl(s){var n,o,l;let e,t;return e=new al({props:{zIndex:(n=s[3].zIndex)!=null?n:1e3,sessionId:s[9],hasScene:(o=s[3].hasScene)!=null?o:!1,apiPrefix:(l=s[3].apiPrefix)!=null?l:"/aiops/aigc"}}),{c(){bn(e.$$.fragment)},m(i,r){Zt(e,i,r),t=!0},p(i,r){var u,h,p;const c={};r[0]&8&&(c.zIndex=(u=i[3].zIndex)!=null?u:1e3),r[0]&512&&(c.sessionId=i[9]),r[0]&8&&(c.hasScene=(h=i[3].hasScene)!=null?h:!1),r[0]&8&&(c.apiPrefix=(p=i[3].apiPrefix)!=null?p:"/aiops/aigc"),e.$set(c)},i(i){t||(je(e.$$.fragment,i),t=!0)},o(i){$e(e.$$.fragment,i),t=!1},d(i){Xt(e,i)}}}function dl(s){var n,o;let e,t;return e=new qs({props:{sessions:s[13],onClose:s[26],onSelect:s[19],zIndex:(n=s[3].zIndex)!=null?n:1e3,apiPrefix:(o=s[3].apiPrefix)!=null?o:"/aiops/aigc"}}),{c(){bn(e.$$.fragment)},m(l,i){Zt(e,l,i),t=!0},p(l,i){var c,u;const r={};i[0]&256&&(r.onClose=l[26]),i[0]&8&&(r.zIndex=(c=l[3].zIndex)!=null?c:1e3),i[0]&8&&(r.apiPrefix=(u=l[3].apiPrefix)!=null?u:"/aiops/aigc"),e.$set(r)},i(l){t||(je(e.$$.fragment,l),t=!0)},o(l){$e(e.$$.fragment,l),t=!1},d(l){Xt(e,l)}}}function ml(s){let e,t,n=`${s[12]}px`,o,l,i,r,c,u,h,p,m,g,k,T,R,L,A=s[12]>0&&ri(s);return{c(){var w,_;e=S("div"),t=S("div"),A&&A.c(),o=q(),l=S("button"),i=J("svg"),r=J("path"),c=J("path"),u=J("path"),h=J("path"),p=J("path"),m=J("path"),g=J("path"),a(t,"class","sy-assistant-drawer-wrapper svelte-1427avp"),$(t,"fullscreen",s[2]),N(t,"width",n),a(r,"d","M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z"),a(r,"fill","#6F8698"),a(c,"d","M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z"),a(c,"fill","#3677FF"),a(u,"d","M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z"),a(u,"fill","#D0D5F1"),a(h,"d","M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z"),a(h,"fill","#3677FF"),a(p,"d","M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(p,"fill","#FFFFFF"),a(m,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(m,"fill","#FFFFFF"),a(g,"d","M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z"),a(g,"fill","#8896A4"),a(i,"class","sy-assistant-icon"),a(i,"viewBox","0 0 1024 1024"),a(i,"version","1.1"),a(i,"xmlns","http://www.w3.org/2000/svg"),a(i,"width","32"),a(i,"height","32"),a(i,"fill","currentColor"),a(i,"aria-label","助手图标"),a(l,"class","sy-assistant-floating-button svelte-1427avp"),a(l,"aria-label","打开助手"),a(l,"style",k=s[10]+" z-index: "+(((w=s[3].zIndex)!=null?w:1e3)+1)+";"),a(e,"class","sy-assistant-container sy-assistant-theme svelte-1427avp"),$(e,"fullscreen",s[2]),$(e,"snapped",s[7]),N(e,"position",s[3].position),N(e,"right",s[7]?0:`${s[0]}px`),N(e,"bottom",s[7]?0:`${s[1]}px`),N(e,"top",s[7]||s[2]?"0":"auto"),N(e,"left",s[2]?"0":"auto"),N(e,"z-index",(_=s[3].zIndex)!=null?_:1e3)},m(w,_){G(w,e,_),d(e,t),A&&A.m(t,null),d(e,o),d(e,l),d(l,i),d(i,r),d(i,c),d(i,u),d(i,h),d(i,p),d(i,m),d(i,g),s[27](l),s[29](e),T=!0,R||(L=[Y(l,"click",s[15]),Y(l,"mousedown",Kn(s[28]))],R=!0)},p(w,_){var b,v;w[12]>0?A?(A.p(w,_),_[0]&4096&&je(A,1)):(A=ri(w),A.c(),je(A,1),A.m(t,null)):A&&(_n(),$e(A,1,1,()=>{A=null}),wn()),(!T||_[0]&4)&&$(t,"fullscreen",w[2]),_[0]&4096&&n!==(n=`${w[12]}px`)&&N(t,"width",n),(!T||_[0]&1032&&k!==(k=w[10]+" z-index: "+(((b=w[3].zIndex)!=null?b:1e3)+1)+";"))&&a(l,"style",k),(!T||_[0]&4)&&$(e,"fullscreen",w[2]),(!T||_[0]&128)&&$(e,"snapped",w[7]),_[0]&8&&N(e,"position",w[3].position),_[0]&129&&N(e,"right",w[7]?0:`${w[0]}px`),_[0]&130&&N(e,"bottom",w[7]?0:`${w[1]}px`),_[0]&132&&N(e,"top",w[7]||w[2]?"0":"auto"),_[0]&4&&N(e,"left",w[2]?"0":"auto"),_[0]&8&&N(e,"z-index",(v=w[3].zIndex)!=null?v:1e3)},i(w){T||(je(A),T=!0)},o(w){$e(A),T=!1},d(w){w&&W(e),A&&A.d(),s[27](null),s[29](null),R=!1,we(L)}}}const Un=48,ke=20;function gl(s,e,t){let n,o,l,i,r=U,c=()=>(r(),r=Ke(o,F=>t(12,i=F)),o);s.$$.on_destroy.push(()=>r());const u={position:"fixed",width:480,height:600,title:"智慧运维助手",initialState:"default",defaultPosition:{right:ke,bottom:ke},snappedWidth:480,drawerWidth:480,zIndex:1e3,hasScene:!1,apiPrefix:"/aiops/aigc"};let{target:h="body"}=e,{options:p={}}=e,m,g=null,k=!1,T,R=!1,L=0,A=0,w=ke,_=20,b=w,v=_,x=!1,M=ke,O=50,X=!1,H={width:0},I=!1,C=!1,j=[],V=null;function ie(){return Re(this,null,function*(){try{const F=yield fetch(`${n.apiPrefix}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ge()}`,Authorization:`bearer ${ge()}`}});if(!F.ok)throw new Error("Failed to get session ID");const ae=yield F.json();if(ae.code===0)return t(9,V=ae.data.sessionId),V;throw new Error(ae.message||"Failed to get session ID")}catch(F){return console.error("Failed to get session ID:",F),null}})}function _e(F,ae=!1){ae?t(23,x=!0):t(6,R=!0),L=F.clientX,A=F.clientY,w=ae?M:b,_=ae?O:v,F.preventDefault()}function We(F){if(!R&&!x)return;const ae=L-F.clientX,D=A-F.clientY;if(x){const Z=w+ae,be=F.clientY;t(24,M=Math.max(ke,Math.min(window.innerWidth-Un-ke,Z)));const ye=window.innerHeight-Un-ke,Be=Math.max(ke,Math.min(ye,be));t(25,O=(window.innerHeight-Be-Un)/window.innerHeight*100)}else{const Z=n.width||0,be=n.height||0,ye=w+ae;t(0,b=Math.max(ke,Math.min(window.innerWidth-Z-ke,ye)));const Pe=_+D;t(1,v=Math.max(ke,Math.min(window.innerHeight-be-ke,Pe)))}}function de(){t(6,R=!1),t(23,x=!1)}mn(()=>{typeof h=="string"?g=document.querySelector(h)||document.body:g=h||document.body;const F=D=>We(D),ae=()=>de();return document.addEventListener("mousemove",F),document.addEventListener("mouseup",ae),m&&g&&g.appendChild(m),T&&T.getBoundingClientRect().left,t(7,I=n.initialState==="snapped"),t(2,X=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,b=0),t(1,v=0),t(3,n=Ee(le({},n),{height:typeof window!="undefined"?window.innerHeight:n.height,width:n.snappedWidth||n.width}))):n.initialState==="fullscreen"&&(t(0,b=0),t(1,v=0),t(3,n=Ee(le({},n),{width:typeof window!="undefined"?window.innerWidth:n.width,height:typeof window!="undefined"?window.innerHeight:n.height}))),()=>{document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",ae),g&&m&&g.removeChild(m)}});function qe(){return Re(this,null,function*(){k||(yield ie()),t(22,k=!k)})}function ne(){var F,ae,D,Z,be,ye,Pe,Be;t(2,X=!X),X?(H.width||(H={width:u.width,height:u.height,right:(ae=(F=u.defaultPosition)==null?void 0:F.right)!=null?ae:ke,bottom:(Z=(D=u.defaultPosition)==null?void 0:D.bottom)!=null?Z:ke}),I&&t(7,I=!1),t(20,p=Ee(le({},n),{width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth})),t(0,b=0),t(1,v=0)):(t(20,p=Ee(le({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,b=(ye=(be=u.defaultPosition)==null?void 0:be.right)!=null?ye:ke),t(1,v=(Be=(Pe=u.defaultPosition)==null?void 0:Pe.bottom)!=null?Be:ke))}function Ze(F){X||_e(F)}function oe(){var F,ae,D,Z;X&&(t(2,X=!1),t(20,p=Ee(le({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth}))),t(7,I=!I),I?(n.height,t(0,b=0),t(1,v=0),t(20,p=Ee(le({},n),{height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width}))):(t(20,p=Ee(le({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,b=(ae=(F=u.defaultPosition)==null?void 0:F.right)!=null?ae:ke),t(1,v=(Z=(D=u.defaultPosition)==null?void 0:D.bottom)!=null?Z:ke))}function Oe(F){t(8,C=!1)}const ee=()=>t(8,C=!1);function De(F){It[F?"unshift":"push"](()=>{T=F,t(5,T)})}const xe=F=>_e(F,!0);function et(F){It[F?"unshift":"push"](()=>{m=F,t(4,m)})}return s.$$set=F=>{"target"in F&&t(21,h=F.target),"options"in F&&t(20,p=F.options)},s.$$.update=()=>{s.$$.dirty[0]&1048576&&t(3,n=Ee(le(le({},u),p),{defaultPosition:le(le({},u.defaultPosition),p.defaultPosition)})),s.$$.dirty[0]&4194316&&c(t(11,o=Pi(k?X?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),s.$$.dirty[0]&11&&typeof window!="undefined"&&(t(0,b=Math.max(ke,Math.min(window.innerWidth-(n.width||0),b))),t(1,v=Math.max(ke,Math.min(window.innerHeight-(n.height||0),v)))),s.$$.dirty[0]&62914560&&t(10,l=k?"display: none;":`position: fixed; right: ${M}px; bottom: ${O}%; transform: none; cursor: ${x?"grabbing":"grab"};`)},[b,v,X,n,m,T,R,I,C,V,l,o,i,j,_e,qe,ne,Ze,oe,Oe,p,h,k,x,M,O,ee,De,xe,et]}class kl extends Tn{constructor(e){super(),yn(this,e,gl,ml,pt,{target:21,options:20},null,[-1,-1])}}te.SyAssistant=kl,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})});
|
44
|
+
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const s=wi(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const s=wi(e);if(s===null)return n;e=s;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class Fn{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class it{constructor(e){ne(this,"options");ne(this,"renderer");ne(this,"textRenderer");this.options=e||Tt,this.options.renderer=this.options.renderer||new pn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fn}static parse(e,t){return new it(t).parse(e)}static parseInline(e,t){return new it(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const o=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const l=o,r=this.options.extensions.renderers[l.type].call({parser:this},l);if(r!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){n+=r||"";continue}}switch(o.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const l=o;n+=this.renderer.heading(this.parseInline(l.tokens),l.depth,ao(this.parseInline(l.tokens,this.textRenderer)));continue}case"code":{const l=o;n+=this.renderer.code(l.text,l.lang,!!l.escaped);continue}case"table":{const l=o;let r="",c="";for(let f=0;f<l.header.length;f++)c+=this.renderer.tablecell(this.parseInline(l.header[f].tokens),{header:!0,align:l.align[f]});r+=this.renderer.tablerow(c);let u="";for(let f=0;f<l.rows.length;f++){const p=l.rows[f];c="";for(let d=0;d<p.length;d++)c+=this.renderer.tablecell(this.parseInline(p[d].tokens),{header:!1,align:l.align[d]});u+=this.renderer.tablerow(c)}n+=this.renderer.table(r,u);continue}case"blockquote":{const l=o,r=this.parse(l.tokens);n+=this.renderer.blockquote(r);continue}case"list":{const l=o,r=l.ordered,c=l.start,u=l.loose;let f="";for(let p=0;p<l.items.length;p++){const d=l.items[p],m=d.checked,g=d.task;let _="";if(d.task){const R=this.renderer.checkbox(!!m);u?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=R+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=R+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:R+" "}):_+=R+" "}_+=this.parse(d.tokens,u),f+=this.renderer.listitem(_,g,!!m)}n+=this.renderer.list(f,r,c);continue}case"html":{const l=o;n+=this.renderer.html(l.text,l.block);continue}case"paragraph":{const l=o;n+=this.renderer.paragraph(this.parseInline(l.tokens));continue}case"text":{let l=o,r=l.tokens?this.parseInline(l.tokens):l.text;for(;s+1<e.length&&e[s+1].type==="text";)l=e[++s],r+=`
|
45
|
+
`+(l.tokens?this.parseInline(l.tokens):l.text);n+=t?this.renderer.paragraph(r):r;continue}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const o=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=l||"";continue}}switch(o.type){case"escape":{const l=o;n+=t.text(l.text);break}case"html":{const l=o;n+=t.html(l.text);break}case"link":{const l=o;n+=t.link(l.href,l.title,this.parseInline(l.tokens,t));break}case"image":{const l=o;n+=t.image(l.href,l.title,l.text);break}case"strong":{const l=o;n+=t.strong(this.parseInline(l.tokens,t));break}case"em":{const l=o;n+=t.em(this.parseInline(l.tokens,t));break}case"codespan":{const l=o;n+=t.codespan(l.text);break}case"br":{n+=t.br();break}case"del":{const l=o;n+=t.del(this.parseInline(l.tokens,t));break}case"text":{const l=o;n+=t.text(l.text);break}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}}class Zt{constructor(e){ne(this,"options");this.options=e||Tt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ne(Zt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class No{constructor(...e){xs(this,St);ne(this,"defaults",Cn());ne(this,"options",this.setOptions);ne(this,"parse",bn(this,St,Kn).call(this,nt.lex,it.parse));ne(this,"parseInline",bn(this,St,Kn).call(this,nt.lexInline,it.parseInline));ne(this,"Parser",it);ne(this,"Renderer",pn);ne(this,"TextRenderer",Fn);ne(this,"Lexer",nt);ne(this,"Tokenizer",un);ne(this,"Hooks",Zt);this.use(...e)}walkTokens(e,t){var s,o;let n=[];for(const l of e)switch(n=n.concat(t.call(this,l)),l.type){case"table":{const r=l;for(const c of r.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of r.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const r=l;n=n.concat(this.walkTokens(r.items,t));break}default:{const r=l;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[r.type]?this.defaults.extensions.childTokens[r.type].forEach(c=>{const u=r[c].flat(1/0);n=n.concat(this.walkTokens(u,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s=fe({},n);if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const l=t.renderers[o.name];l?t.renderers[o.name]=function(...r){let c=o.renderer.apply(this,r);return c===!1&&(c=l.apply(this,r)),c}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[o.level];l?l.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),s.extensions=t),n.renderer){const o=this.defaults.renderer||new pn(this.defaults);for(const l in n.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(l==="options")continue;const r=l,c=n.renderer[r],u=o[r];o[r]=(...f)=>{let p=c.apply(o,f);return p===!1&&(p=u.apply(o,f)),p||""}}s.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new un(this.defaults);for(const l in n.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const r=l,c=n.tokenizer[r],u=o[r];o[r]=(...f)=>{let p=c.apply(o,f);return p===!1&&(p=u.apply(o,f)),p}}s.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new Zt;for(const l in n.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(l==="options")continue;const r=l,c=n.hooks[r],u=o[r];Zt.passThroughHooks.has(l)?o[r]=f=>{if(this.defaults.async)return Promise.resolve(c.call(o,f)).then(d=>u.call(o,d));const p=c.call(o,f);return u.call(o,p)}:o[r]=(...f)=>{let p=c.apply(o,f);return p===!1&&(p=u.apply(o,f)),p}}s.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,l=n.walkTokens;s.walkTokens=function(r){let c=[];return c.push(l.call(this,r)),o&&(c=c.concat(o.call(this,r))),c}}this.defaults=fe(fe({},this.defaults),s)}),this}setOptions(e){return this.defaults=fe(fe({},this.defaults),e),this}lexer(e,t){return nt.lex(e,t!=null?t:this.defaults)}parser(e,t){return it.parse(e,t!=null?t:this.defaults)}}St=new WeakSet,Kn=function(e,t){return(n,s)=>{const o=fe({},s),l=fe(fe({},this.defaults),o);this.defaults.async===!0&&o.async===!1&&(l.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),l.async=!0);const r=bn(this,St,Ls).call(this,!!l.silent,!!l.async);if(typeof n=="undefined"||n===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l),l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then(c=>e(c,l)).then(c=>l.hooks?l.hooks.processAllTokens(c):c).then(c=>l.walkTokens?Promise.all(this.walkTokens(c,l.walkTokens)).then(()=>c):c).then(c=>t(c,l)).then(c=>l.hooks?l.hooks.postprocess(c):c).catch(r);try{l.hooks&&(n=l.hooks.preprocess(n));let c=e(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let u=t(c,l);return l.hooks&&(u=l.hooks.postprocess(u)),u}catch(c){return r(c)}}},Ls=function(e,t){return n=>{if(n.message+=`
|
46
|
+
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+Ge(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}};const vt=new No;function le(i,e){return vt.parse(i,e)}le.options=le.setOptions=function(i){return vt.setOptions(i),le.defaults=vt.defaults,di(le.defaults),le},le.getDefaults=Cn,le.defaults=Tt,le.use=function(...i){return vt.use(...i),le.defaults=vt.defaults,di(le.defaults),le},le.walkTokens=function(i,e){return vt.walkTokens(i,e)},le.parseInline=vt.parseInline,le.Parser=it,le.parser=it.parse,le.Renderer=pn,le.TextRenderer=Fn,le.Lexer=nt,le.lexer=nt.lex,le.Tokenizer=un,le.Hooks=Zt,le.parse=le,le.options,le.setOptions,le.use,le.walkTokens,le.parseInline,it.parse,nt.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:Ri,setPrototypeOf:Mi,isFrozen:Ho,getPrototypeOf:qo,getOwnPropertyDescriptor:Bo}=Object;let{freeze:Ne,seal:Ye,create:Ci}=Object,{apply:Nn,construct:Hn}=typeof Reflect!="undefined"&&Reflect;Ne||(Ne=function(e){return e}),Ye||(Ye=function(e){return e}),Nn||(Nn=function(e,t,n){return e.apply(t,n)}),Hn||(Hn=function(e,t){return new e(...t)});const mn=qe(Array.prototype.forEach),jo=qe(Array.prototype.lastIndexOf),xi=qe(Array.prototype.pop),Yt=qe(Array.prototype.push),Uo=qe(Array.prototype.splice),gn=qe(String.prototype.toLowerCase),qn=qe(String.prototype.toString),Li=qe(String.prototype.match),Xt=qe(String.prototype.replace),Wo=qe(String.prototype.indexOf),Go=qe(String.prototype.trim),Ve=qe(Object.prototype.hasOwnProperty),He=qe(RegExp.prototype.test),Vt=Zo(TypeError);function qe(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Nn(i,e,n)}}function Zo(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Hn(i,t)}}function J(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gn;Mi&&Mi(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const o=t(s);o!==s&&(Ho(e)||(e[n]=o),s=o)}i[s]=!0}return i}function Yo(i){for(let e=0;e<i.length;e++)Ve(i,e)||(i[e]=null);return i}function ht(i){const e=Ci(null);for(const[t,n]of Ri(i))Ve(i,t)&&(Array.isArray(n)?e[t]=Yo(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ht(n):e[t]=n);return e}function Qt(i,e){for(;i!==null;){const n=Bo(i,e);if(n){if(n.get)return qe(n.get);if(typeof n.value=="function")return qe(n.value)}i=qo(i)}function t(){return null}return t}const zi=Ne(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Bn=Ne(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),jn=Ne(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Xo=Ne(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Un=Ne(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Vo=Ne(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Di=Ne(["#text"]),Oi=Ne(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Wn=Ne(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pi=Ne(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wn=Ne(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qo=Ye(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Jo=Ye(/<%[\w\W]*|[\w\W]*%>/gm),Ko=Ye(/\$\{[\w\W]*/gm),$o=Ye(/^data-[\-\w.\u00B7-\uFFFF]+$/),el=Ye(/^aria-[\-\w]+$/),Fi=Ye(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tl=Ye(/^(?:\w+script|data):/i),nl=Ye(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ni=Ye(/^html$/i),il=Ye(/^[a-z][.\w]*(-[.\w]+)+$/i);var Hi=Object.freeze({__proto__:null,ARIA_ATTR:el,ATTR_WHITESPACE:nl,CUSTOM_ELEMENT:il,DATA_ATTR:$o,DOCTYPE_NAME:Ni,ERB_EXPR:Jo,IS_ALLOWED_URI:Fi,IS_SCRIPT_OR_DATA:tl,MUSTACHE_EXPR:Qo,TMPLIT_EXPR:Ko});const Jt={element:1,text:3,progressingInstruction:7,comment:8,document:9},sl=function(){return typeof window=="undefined"?null:window},ol=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch(l){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},qi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Bi(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:sl();const e=P=>Bi(P);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==Jt.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:r,Element:c,NodeFilter:u,NamedNodeMap:f=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:m}=i,g=c.prototype,_=Qt(g,"cloneNode"),R=Qt(g,"remove"),C=Qt(g,"nextSibling"),A=Qt(g,"childNodes"),y=Qt(g,"parentNode");if(typeof l=="function"){const P=t.createElement("template");P.content&&P.content.ownerDocument&&(t=P.content.ownerDocument)}let b,T="";const{implementation:E,createNodeIterator:I,createDocumentFragment:M,getElementsByTagName:L}=t,{importNode:$}=n;let B=qi();e.isSupported=typeof Ri=="function"&&typeof y=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:Y,TMPLIT_EXPR:se,DATA_ATTR:te,ARIA_ATTR:ee,IS_SCRIPT_OR_DATA:Ee,ATTR_WHITESPACE:Ae,CUSTOM_ELEMENT:ae}=Hi;let{IS_ALLOWED_URI:Qe}=Hi,Z=null;const xe=J({},[...zi,...Bn,...jn,...Un,...Di]);let oe=null;const Ce=J({},[...Oi,...Wn,...Pi,...wn]);let ce=Object.seal(Ci(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,be=null,Je=!0,ge=!0,Xe=!1,W=!0,X=!1,Ie=!0,je=!1,st=!1,ot=!1,lt=!1,bt=!1,rt=!1,Dt=!0,Ot=!1;const Kt="user-content-";let Et=!0,D=!1,Q={},ue=null;const ve=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Le=null;const ze=J({},["audio","video","img","source","image","track"]);let Be=null;const Ke=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),at="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let kt=$e,$t=!1,en=null;const Yn=J({},[at,ct,$e],qn);let k=J({},["mi","mo","mn","ms","mtext"]),N=J({},["annotation-xml"]);const re=J({},["title","style","font","a","script"]);let we=null;const ye=["application/xhtml+xml","text/html"],De="text/html";let K=null,et=null;const dt=t.createElement("form"),ws=function(h){return h instanceof RegExp||h instanceof Function},Xn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(et&&et===h)){if((!h||typeof h!="object")&&(h={}),h=ht(h),we=ye.indexOf(h.PARSER_MEDIA_TYPE)===-1?De:h.PARSER_MEDIA_TYPE,K=we==="application/xhtml+xml"?qn:gn,Z=Ve(h,"ALLOWED_TAGS")?J({},h.ALLOWED_TAGS,K):xe,oe=Ve(h,"ALLOWED_ATTR")?J({},h.ALLOWED_ATTR,K):Ce,en=Ve(h,"ALLOWED_NAMESPACES")?J({},h.ALLOWED_NAMESPACES,qn):Yn,Be=Ve(h,"ADD_URI_SAFE_ATTR")?J(ht(Ke),h.ADD_URI_SAFE_ATTR,K):Ke,Le=Ve(h,"ADD_DATA_URI_TAGS")?J(ht(ze),h.ADD_DATA_URI_TAGS,K):ze,ue=Ve(h,"FORBID_CONTENTS")?J({},h.FORBID_CONTENTS,K):ve,Te=Ve(h,"FORBID_TAGS")?J({},h.FORBID_TAGS,K):ht({}),be=Ve(h,"FORBID_ATTR")?J({},h.FORBID_ATTR,K):ht({}),Q=Ve(h,"USE_PROFILES")?h.USE_PROFILES:!1,Je=h.ALLOW_ARIA_ATTR!==!1,ge=h.ALLOW_DATA_ATTR!==!1,Xe=h.ALLOW_UNKNOWN_PROTOCOLS||!1,W=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,X=h.SAFE_FOR_TEMPLATES||!1,Ie=h.SAFE_FOR_XML!==!1,je=h.WHOLE_DOCUMENT||!1,lt=h.RETURN_DOM||!1,bt=h.RETURN_DOM_FRAGMENT||!1,rt=h.RETURN_TRUSTED_TYPE||!1,ot=h.FORCE_BODY||!1,Dt=h.SANITIZE_DOM!==!1,Ot=h.SANITIZE_NAMED_PROPS||!1,Et=h.KEEP_CONTENT!==!1,D=h.IN_PLACE||!1,Qe=h.ALLOWED_URI_REGEXP||Fi,kt=h.NAMESPACE||$e,k=h.MATHML_TEXT_INTEGRATION_POINTS||k,N=h.HTML_INTEGRATION_POINTS||N,ce=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&ws(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&ws(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(ge=!1),bt&&(lt=!0),Q&&(Z=J({},Di),oe=[],Q.html===!0&&(J(Z,zi),J(oe,Oi)),Q.svg===!0&&(J(Z,Bn),J(oe,Wn),J(oe,wn)),Q.svgFilters===!0&&(J(Z,jn),J(oe,Wn),J(oe,wn)),Q.mathMl===!0&&(J(Z,Un),J(oe,Pi),J(oe,wn))),h.ADD_TAGS&&(Z===xe&&(Z=ht(Z)),J(Z,h.ADD_TAGS,K)),h.ADD_ATTR&&(oe===Ce&&(oe=ht(oe)),J(oe,h.ADD_ATTR,K)),h.ADD_URI_SAFE_ATTR&&J(Be,h.ADD_URI_SAFE_ATTR,K),h.FORBID_CONTENTS&&(ue===ve&&(ue=ht(ue)),J(ue,h.FORBID_CONTENTS,K)),Et&&(Z["#text"]=!0),je&&J(Z,["html","head","body"]),Z.table&&(J(Z,["tbody"]),delete Te.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=h.TRUSTED_TYPES_POLICY,T=b.createHTML("")}else b===void 0&&(b=ol(m,s)),b!==null&&typeof T=="string"&&(T=b.createHTML(""));Ne&&Ne(h),et=h}},_s=J({},[...Bn,...jn,...Xo]),bs=J({},[...Un,...Vo]),Fl=function(h){let v=y(h);(!v||!v.tagName)&&(v={namespaceURI:kt,tagName:"template"});const O=gn(h.tagName),pe=gn(v.tagName);return en[h.namespaceURI]?h.namespaceURI===ct?v.namespaceURI===$e?O==="svg":v.namespaceURI===at?O==="svg"&&(pe==="annotation-xml"||k[pe]):!!_s[O]:h.namespaceURI===at?v.namespaceURI===$e?O==="math":v.namespaceURI===ct?O==="math"&&N[pe]:!!bs[O]:h.namespaceURI===$e?v.namespaceURI===ct&&!N[pe]||v.namespaceURI===at&&!k[pe]?!1:!bs[O]&&(re[O]||!_s[O]):!!(we==="application/xhtml+xml"&&en[h.namespaceURI]):!1},ut=function(h){Yt(e.removed,{element:h});try{y(h).removeChild(h)}catch(v){R(h)}},Pt=function(h,v){try{Yt(e.removed,{attribute:v.getAttributeNode(h),from:v})}catch(O){Yt(e.removed,{attribute:null,from:v})}if(v.removeAttribute(h),h==="is")if(lt||bt)try{ut(v)}catch(O){}else try{v.setAttribute(h,"")}catch(O){}},ks=function(h){let v=null,O=null;if(ot)h="<remove></remove>"+h;else{const Se=Li(h,/^[\r\n\t ]+/);O=Se&&Se[0]}we==="application/xhtml+xml"&&kt===$e&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const pe=b?b.createHTML(h):h;if(kt===$e)try{v=new d().parseFromString(pe,we)}catch(Se){}if(!v||!v.documentElement){v=E.createDocument(kt,"template",null);try{v.documentElement.innerHTML=$t?T:pe}catch(Se){}}const Oe=v.body||v.documentElement;return h&&O&&Oe.insertBefore(t.createTextNode(O),Oe.childNodes[0]||null),kt===$e?L.call(v,je?"html":"body")[0]:je?v.documentElement:Oe},ys=function(h){return I.call(h.ownerDocument||h,h,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Vn=function(h){return h instanceof p&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof f)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},Ts=function(h){return typeof r=="function"&&h instanceof r};function pt(P,h,v){mn(P,O=>{O.call(e,h,v,et)})}const vs=function(h){let v=null;if(pt(B.beforeSanitizeElements,h,null),Vn(h))return ut(h),!0;const O=K(h.nodeName);if(pt(B.uponSanitizeElement,h,{tagName:O,allowedTags:Z}),Ie&&h.hasChildNodes()&&!Ts(h.firstElementChild)&&He(/<[/\w!]/g,h.innerHTML)&&He(/<[/\w!]/g,h.textContent)||h.nodeType===Jt.progressingInstruction||Ie&&h.nodeType===Jt.comment&&He(/<[/\w]/g,h.data))return ut(h),!0;if(!Z[O]||Te[O]){if(!Te[O]&&Es(O)&&(ce.tagNameCheck instanceof RegExp&&He(ce.tagNameCheck,O)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(O)))return!1;if(Et&&!ue[O]){const pe=y(h)||h.parentNode,Oe=A(h)||h.childNodes;if(Oe&&pe){const Se=Oe.length;for(let Ue=Se-1;Ue>=0;--Ue){const mt=_(Oe[Ue],!0);mt.__removalCount=(h.__removalCount||0)+1,pe.insertBefore(mt,C(h))}}}return ut(h),!0}return h instanceof c&&!Fl(h)||(O==="noscript"||O==="noembed"||O==="noframes")&&He(/<\/no(script|embed|frames)/i,h.innerHTML)?(ut(h),!0):(X&&h.nodeType===Jt.text&&(v=h.textContent,mn([z,Y,se],pe=>{v=Xt(v,pe," ")}),h.textContent!==v&&(Yt(e.removed,{element:h.cloneNode()}),h.textContent=v)),pt(B.afterSanitizeElements,h,null),!1)},Ss=function(h,v,O){if(Dt&&(v==="id"||v==="name")&&(O in t||O in dt))return!1;if(!(ge&&!be[v]&&He(te,v))){if(!(Je&&He(ee,v))){if(!oe[v]||be[v]){if(!(Es(h)&&(ce.tagNameCheck instanceof RegExp&&He(ce.tagNameCheck,h)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(h))&&(ce.attributeNameCheck instanceof RegExp&&He(ce.attributeNameCheck,v)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(v))||v==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&He(ce.tagNameCheck,O)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(O))))return!1}else if(!Be[v]){if(!He(Qe,Xt(O,Ae,""))){if(!((v==="src"||v==="xlink:href"||v==="href")&&h!=="script"&&Wo(O,"data:")===0&&Le[h])){if(!(Xe&&!He(Ee,Xt(O,Ae,"")))){if(O)return!1}}}}}}return!0},Es=function(h){return h!=="annotation-xml"&&Li(h,ae)},As=function(h){pt(B.beforeSanitizeAttributes,h,null);const{attributes:v}=h;if(!v||Vn(h))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let pe=v.length;for(;pe--;){const Oe=v[pe],{name:Se,namespaceURI:Ue,value:mt}=Oe,tn=K(Se),Qn=mt;let Pe=Se==="value"?Qn:Go(Qn);if(O.attrName=tn,O.attrValue=Pe,O.keepAttr=!0,O.forceKeepAttr=void 0,pt(B.uponSanitizeAttribute,h,O),Pe=O.attrValue,Ot&&(tn==="id"||tn==="name")&&(Pt(Se,h),Pe=Kt+Pe),Ie&&He(/((--!?|])>)|<\/(style|title)/i,Pe)){Pt(Se,h);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){Pt(Se,h);continue}if(!W&&He(/\/>/i,Pe)){Pt(Se,h);continue}X&&mn([z,Y,se],Rs=>{Pe=Xt(Pe,Rs," ")});const Is=K(h.nodeName);if(!Ss(Is,tn,Pe)){Pt(Se,h);continue}if(b&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Ue)switch(m.getAttributeType(Is,tn)){case"TrustedHTML":{Pe=b.createHTML(Pe);break}case"TrustedScriptURL":{Pe=b.createScriptURL(Pe);break}}if(Pe!==Qn)try{Ue?h.setAttributeNS(Ue,Se,Pe):h.setAttribute(Se,Pe),Vn(h)?ut(h):xi(e.removed)}catch(Rs){Pt(Se,h)}}pt(B.afterSanitizeAttributes,h,null)},Nl=function P(h){let v=null;const O=ys(h);for(pt(B.beforeSanitizeShadowDOM,h,null);v=O.nextNode();)pt(B.uponSanitizeShadowNode,v,null),vs(v),As(v),v.content instanceof o&&P(v.content);pt(B.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(P){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=null,O=null,pe=null,Oe=null;if($t=!P,$t&&(P="<!-->"),typeof P!="string"&&!Ts(P))if(typeof P.toString=="function"){if(P=P.toString(),typeof P!="string")throw Vt("dirty is not a string, aborting")}else throw Vt("toString is not a function");if(!e.isSupported)return P;if(st||Xn(h),e.removed=[],typeof P=="string"&&(D=!1),D){if(P.nodeName){const mt=K(P.nodeName);if(!Z[mt]||Te[mt])throw Vt("root node is forbidden and cannot be sanitized in-place")}}else if(P instanceof r)v=ks("<!---->"),O=v.ownerDocument.importNode(P,!0),O.nodeType===Jt.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?v=O:v.appendChild(O);else{if(!lt&&!X&&!je&&P.indexOf("<")===-1)return b&&rt?b.createHTML(P):P;if(v=ks(P),!v)return lt?null:rt?T:""}v&&ot&&ut(v.firstChild);const Se=ys(D?P:v);for(;pe=Se.nextNode();)vs(pe),As(pe),pe.content instanceof o&&Nl(pe.content);if(D)return P;if(lt){if(bt)for(Oe=M.call(v.ownerDocument);v.firstChild;)Oe.appendChild(v.firstChild);else Oe=v;return(oe.shadowroot||oe.shadowrootmode)&&(Oe=$.call(n,Oe,!0)),Oe}let Ue=je?v.outerHTML:v.innerHTML;return je&&Z["!doctype"]&&v.ownerDocument&&v.ownerDocument.doctype&&v.ownerDocument.doctype.name&&He(Ni,v.ownerDocument.doctype.name)&&(Ue="<!DOCTYPE "+v.ownerDocument.doctype.name+`>
|
47
|
+
`+Ue),X&&mn([z,Y,se],mt=>{Ue=Xt(Ue,mt," ")}),b&&rt?b.createHTML(Ue):Ue},e.setConfig=function(){let P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xn(P),st=!0},e.clearConfig=function(){et=null,st=!1},e.isValidAttribute=function(P,h,v){et||Xn({});const O=K(P),pe=K(h);return Ss(O,pe,v)},e.addHook=function(P,h){typeof h=="function"&&Yt(B[P],h)},e.removeHook=function(P,h){if(h!==void 0){const v=jo(B[P],h);return v===-1?void 0:Uo(B[P],v,1)[0]}return xi(B[P])},e.removeHooks=function(P){B[P]=[]},e.removeAllHooks=function(){B=qi()},e}var ji=Bi();function Ui(i){var n;if(typeof document=="undefined")return null;const t=`; ${document.cookie}`.split(`; ${i}=`);return t.length===2&&((n=t.pop())==null?void 0:n.split(";").shift())||null}const ke=()=>{if(typeof window=="undefined")return null;const i=Ui("access_token");if(i)return i;const e=Ui("auth_token");if(e)return e;const t=sessionStorage.getItem("vuex");if(t)try{const n=JSON.parse(t);if(n!=null&&n.token)return n.token}catch(n){console.error("Failed to parse vuex data:",n)}return null};function Wi(i,e,t){const n=i.slice();return n[25]=e[t],n}function Gi(i){let e,t=i[9].text+"",n;return{c(){e=S("div"),n=Me(t),a(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),F(e,"left",i[9].x+"px"),F(e,"top",i[9].y+"px"),F(e,"z-index",i[3]+3)},m(s,o){q(s,e,o),w(e,n)},p(s,o){o&512&&t!==(t=s[9].text+"")&&We(n,t),o&512&&F(e,"left",s[9].x+"px"),o&512&&F(e,"top",s[9].y+"px"),o&8&&F(e,"z-index",s[3]+3)},d(s){s&&H(e)}}}function ll(i){let e=[],t=new Map,n,s,o=_t(i[0]);const l=c=>c[25].sessionId;for(let c=0;c<o.length;c+=1){let u=Wi(i,o,c),f=l(u);t.set(f,e[c]=Zi(f,u))}let r=i[5]&&Yi();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=G(),r&&r.c(),s=Rt()},m(c,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(c,u);q(c,n,u),r&&r.m(c,u),q(c,s,u)},p(c,u){u&8261&&(o=_t(c[0]),e=ci(e,u,l,1,c,o,t,n.parentNode,ai,Zi,n,Wi)),c[5]?r||(r=Yi(),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(c){c&&(H(n),H(s));for(let u=0;u<e.length;u+=1)e[u].d(c);r&&r.d(c)}}}function rl(i){let e,t=i[4]?"未找到相关会话":i[5]?"加载中...":"暂无历史会话",n;return{c(){e=S("div"),n=Me(t),a(e,"class","sy-session-empty svelte-1g6fj9a")},m(s,o){q(s,e,o),w(e,n)},p(s,o){o&48&&t!==(t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话")&&We(n,t)},d(s){s&&H(e)}}}function Zi(i,e){let t,n,s,o,l=e[25].title+"",r,c,u,f=Vi(e[25].timestamp)+"",p,d,m,g,_,R,C,A,y,b,T;function E(){return e[18](e[25])}function I(...M){return e[19](e[25],...M)}return{key:i,first:null,c(){t=S("div"),n=S("button"),s=S("div"),o=S("div"),r=Me(l),c=G(),u=S("div"),p=Me(f),d=G(),m=S("button"),g=V("svg"),_=V("path"),R=V("path"),C=V("path"),a(o,"class","sy-session-title svelte-1g6fj9a"),a(u,"class","sy-session-time svelte-1g6fj9a"),a(s,"class","sy-session-info svelte-1g6fj9a"),a(n,"class","sy-session-select svelte-1g6fj9a"),a(_,"d","M3 6h18"),a(R,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),a(C,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),a(g,"xmlns","http://www.w3.org/2000/svg"),a(g,"width","16"),a(g,"height","16"),a(g,"viewBox","0 0 24 24"),a(g,"fill","none"),a(g,"stroke","currentColor"),a(g,"stroke-width","2"),a(g,"stroke-linecap","round"),a(g,"stroke-linejoin","round"),a(m,"class","sy-session-delete svelte-1g6fj9a"),m.disabled=A=e[6]===e[25].sessionId,a(m,"aria-label","删除会话"),a(t,"class","sy-session-item svelte-1g6fj9a"),a(t,"data-session-id",y=e[25].sessionId),x(t,"deleting",e[25].deleting),this.first=t},m(M,L){q(M,t,L),w(t,n),w(n,s),w(s,o),w(o,r),w(s,c),w(s,u),w(u,p),w(t,d),w(t,m),w(m,g),w(g,_),w(g,R),w(g,C),b||(T=[U(n,"click",E),U(m,"click",I)],b=!0)},p(M,L){e=M,L&1&&l!==(l=e[25].title+"")&&We(r,l),L&1&&f!==(f=Vi(e[25].timestamp)+"")&&We(p,f),L&65&&A!==(A=e[6]===e[25].sessionId)&&(m.disabled=A),L&1&&y!==(y=e[25].sessionId)&&a(t,"data-session-id",y),L&1&&x(t,"deleting",e[25].deleting)},d(M){M&&H(t),b=!1,_e(T)}}}function Yi(i){let e;return{c(){e=S("div"),e.innerHTML='<span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span>',a(e,"class","sy-session-loading svelte-1g6fj9a")},m(t,n){q(t,e,n)},d(t){t&&H(e)}}}function Xi(i){let e,t,n,s,o,l,r,c,u;return{c(){e=S("div"),t=S("div"),t.textContent="确认删除此会话?",n=G(),s=S("div"),o=S("button"),o.textContent="取消",l=G(),r=S("button"),r.textContent="删除",a(t,"class","sy-session-confirm-content svelte-1g6fj9a"),a(o,"class","sy-session-confirm-cancel svelte-1g6fj9a"),a(r,"class","sy-session-confirm-delete svelte-1g6fj9a"),a(s,"class","sy-session-confirm-actions svelte-1g6fj9a"),a(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),F(e,"left",i[8].x+"px"),F(e,"top",i[8].y+"px"),F(e,"z-index",i[3]+3)},m(f,p){q(f,e,p),w(e,t),w(e,n),w(e,s),w(s,o),w(s,l),w(s,r),c||(u=[U(o,"click",i[20]),U(r,"click",i[14])],c=!0)},p(f,p){p&256&&F(e,"left",f[8].x+"px"),p&256&&F(e,"top",f[8].y+"px"),p&8&&F(e,"z-index",f[3]+3)},d(f){f&&H(e),c=!1,_e(u)}}}function al(i){let e,t,n,s,o,l,r,c,u,f,p,d,m,g,_,R,C,A,y,b=i[9]&&Gi(i);function T(L,$){return L[0].length===0?rl:ll}let E=T(i),I=E(i),M=i[7]&&Xi(i);return{c(){e=S("div"),t=S("div"),n=S("h2"),n.textContent="历史会话",s=G(),o=S("button"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',l=G(),r=S("div"),c=S("input"),u=G(),f=V("svg"),p=V("circle"),d=V("line"),m=G(),b&&b.c(),g=G(),_=S("div"),I.c(),R=G(),M&&M.c(),C=Rt(),a(n,"class","svelte-1g6fj9a"),a(o,"class","sy-session-close svelte-1g6fj9a"),a(o,"aria-label","关闭历史会话"),a(t,"class","sy-session-header svelte-1g6fj9a"),a(c,"type","text"),a(c,"class","sy-session-search-input svelte-1g6fj9a"),a(c,"placeholder","搜索历史会话..."),a(p,"cx","11"),a(p,"cy","11"),a(p,"r","8"),a(d,"x1","21"),a(d,"y1","21"),a(d,"x2","16.65"),a(d,"y2","16.65"),a(f,"class","sy-session-search-icon svelte-1g6fj9a"),a(f,"xmlns","http://www.w3.org/2000/svg"),a(f,"width","16"),a(f,"height","16"),a(f,"viewBox","0 0 24 24"),a(f,"fill","none"),a(f,"stroke","currentColor"),a(f,"stroke-width","2"),a(f,"stroke-linecap","round"),a(f,"stroke-linejoin","round"),a(r,"class","sy-session-search svelte-1g6fj9a"),a(_,"class","sy-session-list svelte-1g6fj9a"),a(e,"class","sy-session-history svelte-1g6fj9a"),F(e,"z-index",i[3]+2)},m(L,$){q(L,e,$),w(e,t),w(t,n),w(t,s),w(t,o),w(e,l),w(e,r),w(r,c),wt(c,i[4]),w(r,u),w(r,f),w(f,p),w(f,d),w(e,m),b&&b.m(e,null),w(e,g),w(e,_),I.m(_,null),q(L,R,$),M&&M.m(L,$),q(L,C,$),A||(y=[U(o,"click",function(){Ft(i[1])&&i[1].apply(this,arguments)}),U(o,"mouseenter",i[16]),U(o,"mouseleave",i[12]),U(c,"input",i[17]),U(_,"scroll",i[10])],A=!0)},p(L,[$]){i=L,$&16&&c.value!==i[4]&&wt(c,i[4]),i[9]?b?b.p(i,$):(b=Gi(i),b.c(),b.m(e,g)):b&&(b.d(1),b=null),E===(E=T(i))&&I?I.p(i,$):(I.d(1),I=E(i),I&&(I.c(),I.m(_,null))),$&8&&F(e,"z-index",i[3]+2),i[7]?M?M.p(i,$):(M=Xi(i),M.c(),M.m(C.parentNode,C)):M&&(M.d(1),M=null)},i:j,o:j,d(L){L&&(H(e),H(R),H(C)),b&&b.d(),I.d(),M&&M.d(L),A=!1,_e(y)}}}const Gn=10;function Vi(i){return new Date(i).toLocaleString()}function cl(i,e,t){let{sessions:n=[]}=e,{onClose:s}=e,{onSelect:o}=e,{zIndex:l}=e,{apiPrefix:r}=e,c=!1,u=!0,f=0,p="",d=null,m=null,g={x:0,y:0};function _(){return Fe(this,null,function*(){if(!(c||!u)){t(5,c=!0);try{const z=yield fetch(`${r}/chat/record/session/list/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({start:f,length:Gn,keyword:p})});if(!z.ok)throw new Error("Failed to load sessions");const Y=yield z.json();if(Y.code===0){const se=Y.data.sessionList.map(te=>({sessionId:te.sessionId,title:te.name,timestamp:new Date(te.createDate).getTime()}));t(0,n=[...n,...se]),f+=Gn,u=se.length===Gn}}catch(z){console.error("Failed to load sessions:",z)}finally{t(5,c=!1)}}})}function R(z){const Y=z.target,{scrollTop:se,scrollHeight:te,clientHeight:ee}=Y;te-se-ee<50&&_()}kn(()=>{_()});let C=null;function A(z,Y){const te=z.currentTarget.getBoundingClientRect();t(9,C={text:Y,x:te.left+te.width/2,y:te.bottom+8})}function y(){t(9,C=null)}function b(z,Y){const te=z.currentTarget.getBoundingClientRect();t(8,g={x:te.left-16,y:te.top+te.height/2}),t(7,m=Y)}function T(z){return Fe(this,null,function*(){if(z&&!d)try{t(6,d=z),t(7,m=null);const Y=document.querySelector(`[data-session-id="${z}"]`);Y&&Y.classList.add("deleting"),yield new Promise(ee=>setTimeout(ee,300));const se=yield fetch(`${r}/chat/record/session/delete`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({sessionId:z})});if(!se.ok)throw new Error("Delete request failed");const te=yield se.json();if(te.code===0&&te.data.respCode===0)t(0,n=n.map(ee=>Re(fe({},ee),{deleting:ee.sessionId===z}))),setTimeout(()=>{t(0,n=n.filter(ee=>!ee.deleting))},300);else throw new Error("Delete failed: "+te.message)}catch(Y){console.error("Failed to delete session:",Y);const se=document.querySelector(`[data-session-id="${z}"]`);se&&se.classList.remove("deleting")}finally{t(6,d=null)}})}function E(){m&&T(m)}const I=z=>A(z,"关闭历史会话");function M(){p=this.value,t(4,p)}const L=z=>o(z.sessionId),$=(z,Y)=>b(Y,z.sessionId),B=()=>t(7,m=null);return i.$$set=z=>{"sessions"in z&&t(0,n=z.sessions),"onClose"in z&&t(1,s=z.onClose),"onSelect"in z&&t(2,o=z.onSelect),"zIndex"in z&&t(3,l=z.zIndex),"apiPrefix"in z&&t(15,r=z.apiPrefix)},i.$$.update=()=>{i.$$.dirty&16&&p!==void 0&&(t(0,n=[]),f=0,u=!0,_())},[n,s,o,l,p,c,d,m,g,C,R,A,y,b,E,r,I,M,L,$,B]}class Qi extends In{constructor(e){super(),An(this,e,cl,al,At,{sessions:0,onClose:1,onSelect:2,zIndex:3,apiPrefix:15})}}function Ji(i,e,t){const n=i.slice();return n[73]=e[t],n}function Ki(i,e,t){const n=i.slice();return n[76]=e[t],n[77]=e,n[78]=t,n}function $i(i,e,t){const n=i.slice();return n[79]=e[t],n[81]=t,n}function ul(i){let e,t=[],n=new Map,s=_t(i[11]);const o=l=>l[76].id;for(let l=0;l<s.length;l+=1){let r=Ki(i,s,l),c=o(r);n.set(c,t[l]=ls(c,r))}return{c(){e=S("div");for(let l=0;l<t.length;l+=1)t[l].c();a(e,"class","sy-assistant-message-list svelte-ynwtqm")},m(l,r){q(l,e,r);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);i[57](e)},p(l,r){r[0]&1761147305|r[1]&127&&(s=_t(l[11]),t=ci(t,r,o,1,l,s,n,e,ai,ls,null,Ki))},i:j,o:j,d(l){l&&H(e);for(let r=0;r<t.length;r+=1)t[r].d();i[57](null)}}}function fl(i){let e,t;return e=new Qi({props:{sessions:i[38],onClose:i[40],onSelect:i[41],zIndex:i[0],apiPrefix:i[2]}}),{c(){En(e.$$.fragment)},m(n,s){rn(e,n,s),t=!0},p(n,s){const o={};s[0]&1&&(o.zIndex=n[0]),s[0]&4&&(o.apiPrefix=n[2]),e.$set(o)},i(n){t||(Ze(e.$$.fragment,n),t=!0)},o(n){ft(e.$$.fragment,n),t=!1},d(n){an(e,n)}}}function hl(i){let e,t=zt(i[8],'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',"100%","100%")+"";return{c(){e=S("div"),a(e,"class","sy-assistant-avatar user svelte-ynwtqm"),x(e,"screen-theme",i[3]==="screen")},m(n,s){q(n,e,s),e.innerHTML=t},p(n,s){s[0]&256&&t!==(t=zt(n[8],'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',"100%","100%")+"")&&(e.innerHTML=t),s[0]&8&&x(e,"screen-theme",n[3]==="screen")},d(n){n&&H(e)}}}function dl(i){let e,t=zt(i[7],'<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',"100%","100%")+"";return{c(){e=S("div"),a(e,"class","sy-assistant-avatar assistant svelte-ynwtqm"),x(e,"screen-theme",i[3]==="screen")},m(n,s){q(n,e,s),e.innerHTML=t},p(n,s){s[0]&128&&t!==(t=zt(n[7],'<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',"100%","100%")+"")&&(e.innerHTML=t),s[0]&8&&x(e,"screen-theme",n[3]==="screen")},d(n){n&&H(e)}}}function pl(i){let e,t=i[27](i[76].content)+"";return{c(){e=S("div"),a(e,"class","markdown-content svelte-ynwtqm")},m(n,s){q(n,e,s),e.innerHTML=t},p(n,s){s[0]&2048&&t!==(t=n[27](n[76].content)+"")&&(e.innerHTML=t)},d(n){n&&H(e)}}}function ml(i){let e;return{c(){e=S("span"),e.innerHTML='<span class="dot svelte-ynwtqm">.</span> <span class="dot svelte-ynwtqm">.</span> <span class="dot svelte-ynwtqm">.</span>',a(e,"class","sy-assistant-loading svelte-ynwtqm")},m(t,n){q(t,e,n)},p:j,d(t){t&&H(e)}}}function es(i){let e,t=_t(i[76].attachments),n=[];for(let s=0;s<t.length;s+=1)n[s]=is($i(i,t,s));return{c(){e=S("div");for(let s=0;s<n.length;s+=1)n[s].c();a(e,"class","sy-assistant-attachments svelte-ynwtqm")},m(s,o){q(s,e,o);for(let l=0;l<n.length;l+=1)n[l]&&n[l].m(e,null)},p(s,o){if(o[0]&1610643457|o[1]&1){t=_t(s[76].attachments);let l;for(l=0;l<t.length;l+=1){const r=$i(s,t,l);n[l]?n[l].p(r,o):(n[l]=is(r),n[l].c(),n[l].m(e,null))}for(;l<n.length;l+=1)n[l].d(1);n.length=t.length}},d(s){s&&H(e),ii(n,s)}}}function ts(i){let e,t,n;function s(...o){return i[44](i[79],...o)}return{c(){e=S("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-ynwtqm"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',a(e,"class","sy-assistant-attachment-toggle svelte-ynwtqm"),a(e,"aria-label","查看详情")},m(o,l){q(o,e,l),t||(n=[U(e,"mouseenter",s),U(e,"mouseleave",i[30])],t=!0)},p(o,l){i=o},d(o){o&&H(e),t=!1,_e(n)}}}function ns(i){let e,t=i[12].replace(/\n/g,"<br>")+"",n,s;return{c(){e=S("div"),a(e,"class","sy-assistant-tooltip svelte-ynwtqm"),a(e,"role","tooltip"),F(e,"left",i[13].x+"px"),F(e,"top",i[13].y+"px"),F(e,"z-index",i[0]+3),x(e,"align-right",i[13].alignRight)},m(o,l){q(o,e,l),e.innerHTML=t,n||(s=[U(e,"mouseenter",i[46]),U(e,"mouseleave",i[47])],n=!0)},p(o,l){l[0]&4096&&t!==(t=o[12].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),l[0]&8192&&F(e,"left",o[13].x+"px"),l[0]&8192&&F(e,"top",o[13].y+"px"),l[0]&1&&F(e,"z-index",o[0]+3),l[0]&8192&&x(e,"align-right",o[13].alignRight)},d(o){o&&H(e),n=!1,_e(s)}}}function is(i){let e,t,n,s,o,l,r,c,u,f=_n(i[79].content_title).name+"",p,d,m,g=_n(i[79].content_title).ext+"",_,R,C,A,y,b,T,E,I,M,L=i[79].tips&&ts(i);function $(){return i[45](i[79])}let B=i[12]&&ns(i);return{c(){e=S("div"),t=S("div"),n=S("div"),s=V("svg"),o=V("path"),l=V("polyline"),r=G(),c=S("div"),u=S("span"),p=Me(f),d=G(),m=S("span"),_=Me(g),C=G(),A=S("div"),L&&L.c(),y=G(),b=S("button"),b.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-ynwtqm"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>',T=G(),B&&B.c(),E=G(),a(o,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),a(l,"points","13 2 13 9 20 9"),a(s,"xmlns","http://www.w3.org/2000/svg"),a(s,"width","16"),a(s,"height","16"),a(s,"viewBox","0 0 24 24"),a(s,"fill","none"),a(s,"stroke","currentColor"),a(s,"stroke-width","2"),a(s,"stroke-linecap","round"),a(s,"stroke-linejoin","round"),a(u,"class","sy-assistant-filename svelte-ynwtqm"),a(m,"class","sy-assistant-attachment-ext svelte-ynwtqm"),a(c,"class","sy-assistant-attachment-name svelte-ynwtqm"),a(c,"title",R=i[79].content_title),a(n,"class","sy-assistant-attachment-title svelte-ynwtqm"),a(b,"class","sy-assistant-attachment-toggle svelte-ynwtqm"),a(b,"aria-label","下载文件"),a(A,"class","sy-assistant-attachment-actions svelte-ynwtqm"),a(t,"class","sy-assistant-attachment-header svelte-ynwtqm"),a(e,"class","sy-assistant-attachment svelte-ynwtqm")},m(z,Y){q(z,e,Y),w(e,t),w(t,n),w(n,s),w(s,o),w(s,l),w(n,r),w(n,c),w(c,u),w(u,p),w(c,d),w(c,m),w(m,_),w(t,C),w(t,A),L&&L.m(A,null),w(A,y),w(A,b),w(e,T),B&&B.m(e,null),w(e,E),I||(M=U(b,"click",$),I=!0)},p(z,Y){i=z,Y[0]&2048&&f!==(f=_n(i[79].content_title).name+"")&&We(p,f),Y[0]&2048&&g!==(g=_n(i[79].content_title).ext+"")&&We(_,g),Y[0]&2048&&R!==(R=i[79].content_title)&&a(c,"title",R),i[79].tips?L?L.p(i,Y):(L=ts(i),L.c(),L.m(A,y)):L&&(L.d(1),L=null),i[12]?B?B.p(i,Y):(B=ns(i),B.c(),B.m(e,E)):B&&(B.d(1),B=null)},d(z){z&&H(e),L&&L.d(),B&&B.d(),I=!1,M()}}}function ss(i){let e,t,n,s,o,l,r,c,u,f,p;function d(E,I){return E[19][E[76].id]?wl:gl}let m=d(i),g=m(i);function _(){return i[48](i[76])}function R(...E){return i[49](i[76],...E)}function C(){return i[50](i[76])}function A(...E){return i[51](i[76],...E)}function y(...E){return i[52](i[76],...E)}function b(...E){return i[53](i[76],...E)}let T=i[22]&&i[20][i[76].id]==="dislike"&&os(i);return{c(){e=S("div"),t=S("button"),g.c(),s=G(),o=S("button"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>',l=G(),r=S("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-3"></path></svg>',c=G(),T&&T.c(),u=Rt(),a(t,"class","sy-assistant-action-button svelte-ynwtqm"),a(t,"aria-label",n=i[19][i[76].id]?"已复制":"复制内容"),x(t,"copied",i[19][i[76].id]),a(o,"class","sy-assistant-action-button svelte-ynwtqm"),a(o,"aria-label","点赞"),x(o,"active",i[20][i[76].id]==="like"),a(r,"class","sy-assistant-action-button svelte-ynwtqm"),a(r,"aria-label","点踩"),x(r,"active",i[20][i[76].id]==="dislike"),a(e,"class","sy-assistant-message-actions svelte-ynwtqm")},m(E,I){q(E,e,I),w(e,t),g.m(t,null),w(e,s),w(e,o),w(e,l),w(e,r),q(E,c,I),T&&T.m(E,I),q(E,u,I),f||(p=[U(t,"click",_),U(t,"mouseenter",R),U(t,"mouseleave",i[37]),U(o,"click",C),U(o,"mouseenter",A),U(o,"mouseleave",i[37]),U(r,"click",y),U(r,"mouseenter",b),U(r,"mouseleave",i[37])],f=!0)},p(E,I){i=E,m!==(m=d(i))&&(g.d(1),g=m(i),g&&(g.c(),g.m(t,null))),I[0]&526336&&n!==(n=i[19][i[76].id]?"已复制":"复制内容")&&a(t,"aria-label",n),I[0]&526336&&x(t,"copied",i[19][i[76].id]),I[0]&1050624&&x(o,"active",i[20][i[76].id]==="like"),I[0]&1050624&&x(r,"active",i[20][i[76].id]==="dislike"),i[22]&&i[20][i[76].id]==="dislike"?T?T.p(i,I):(T=os(i),T.c(),T.m(u.parentNode,u)):T&&(T.d(1),T=null)},d(E){E&&(H(e),H(c),H(u)),g.d(),T&&T.d(E),f=!1,_e(p)}}}function gl(i){let e,t,n;return{c(){e=V("svg"),t=V("rect"),n=V("path"),a(t,"x","9"),a(t,"y","9"),a(t,"width","13"),a(t,"height","13"),a(t,"rx","2"),a(t,"ry","2"),a(n,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(s,o){q(s,e,o),w(e,t),w(e,n)},d(s){s&&H(e)}}}function wl(i){let e,t;return{c(){e=V("svg"),t=V("polyline"),a(t,"points","20 6 9 17 4 12"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(n,s){q(n,e,s),w(e,t)},d(n){n&&H(e)}}}function os(i){let e,t,n,s,o,l,r,c,u,f,p;function d(){i[54].call(s,i[76])}function m(){return i[55](i[76])}function g(){return i[56](i[76])}return{c(){e=S("div"),t=S("div"),t.textContent="反馈意见",n=G(),s=S("textarea"),o=G(),l=S("div"),r=S("button"),r.textContent="取消",c=G(),u=S("button"),u.textContent="提交",a(t,"class","sy-assistant-dislike-title svelte-ynwtqm"),a(s,"class","sy-assistant-dislike-input svelte-ynwtqm"),a(s,"placeholder","请输入您的反馈意见..."),a(r,"class","sy-assistant-popup-cancel svelte-ynwtqm"),a(u,"class","sy-assistant-popup-submit svelte-ynwtqm"),a(l,"class","sy-assistant-popup-actions svelte-ynwtqm"),a(e,"class","sy-assistant-dislike-popup svelte-ynwtqm"),F(e,"left",i[23].x+"px"),F(e,"top",i[23].y+"px"),F(e,"z-index",i[0]+3)},m(_,R){q(_,e,R),w(e,t),w(e,n),w(e,s),wt(s,i[21][i[76].id]),w(e,o),w(e,l),w(l,r),w(l,c),w(l,u),f||(p=[U(s,"input",d),U(r,"click",m),U(u,"click",g)],f=!0)},p(_,R){i=_,R[0]&2099200&&wt(s,i[21][i[76].id]),R[0]&8388608&&F(e,"left",i[23].x+"px"),R[0]&8388608&&F(e,"top",i[23].y+"px"),R[0]&1&&F(e,"z-index",i[0]+3)},d(_){_&&H(e),f=!1,_e(p)}}}function ls(i,e){let t,n,s,o,l,r,c,u,f=new Date(e[76].timestamp).toLocaleString()+"",p,d;function m(T,E){return T[76].type==="assistant"?dl:hl}let g=m(e),_=g(e);function R(T,E){return T[15]&&T[76].id===T[11][T[11].length-1].id&&T[76].type==="assistant"&&!T[76].content?ml:pl}let C=R(e),A=C(e),y=e[76].attachments&&es(e),b=e[76].id!=="-1"&&e[76].type==="assistant"&&!e[15]&&e[5]&&ss(e);return{key:i,first:null,c(){t=S("div"),_.c(),n=G(),s=S("div"),o=S("div"),A.c(),l=G(),y&&y.c(),r=G(),b&&b.c(),c=G(),u=S("div"),p=Me(f),d=G(),a(o,"class","sy-assistant-message-content svelte-ynwtqm"),x(o,"screen-theme",e[3]==="screen"),a(u,"class","sy-assistant-message-time svelte-ynwtqm"),a(s,"class","sy-assistant-message-bubble svelte-ynwtqm"),x(s,"screen-theme",e[3]==="screen"),a(t,"class","sy-assistant-message svelte-ynwtqm"),x(t,"user",e[76].type==="user"),x(t,"screen-theme",e[3]==="screen"),this.first=t},m(T,E){q(T,t,E),_.m(t,null),w(t,n),w(t,s),w(s,o),A.m(o,null),w(o,l),y&&y.m(o,null),w(o,r),b&&b.m(o,null),w(s,c),w(s,u),w(u,p),w(t,d)},p(T,E){e=T,g===(g=m(e))&&_?_.p(e,E):(_.d(1),_=g(e),_&&(_.c(),_.m(t,n))),C===(C=R(e))&&A?A.p(e,E):(A.d(1),A=C(e),A&&(A.c(),A.m(o,l))),e[76].attachments?y?y.p(e,E):(y=es(e),y.c(),y.m(o,r)):y&&(y.d(1),y=null),e[76].id!=="-1"&&e[76].type==="assistant"&&!e[15]&&e[5]?b?b.p(e,E):(b=ss(e),b.c(),b.m(o,null)):b&&(b.d(1),b=null),E[0]&8&&x(o,"screen-theme",e[3]==="screen"),E[0]&2048&&f!==(f=new Date(e[76].timestamp).toLocaleString()+"")&&We(p,f),E[0]&8&&x(s,"screen-theme",e[3]==="screen"),E[0]&2048&&x(t,"user",e[76].type==="user"),E[0]&8&&x(t,"screen-theme",e[3]==="screen")},d(T){T&&H(t),_.d(),A.d(),y&&y.d(),b&&b.d()}}}function rs(i){let e,t,n,s,o,l,r,c,u,f,p,d,m,g=zt(i[6],'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>')+"",_,R,C,A=i[5]&&as(i);return{c(){A&&A.c(),e=G(),t=S("div"),n=S("div"),s=S("div"),o=S("textarea"),l=G(),r=S("div"),c=S("div"),u=Me(i[10]),f=Me("/"),p=Me(Zn),d=G(),m=S("button"),a(o,"class","sy-assistant-textarea svelte-ynwtqm"),a(o,"placeholder","输入您的问题..."),a(o,"maxlength",Zn),a(o,"rows","3"),x(o,"screen-theme",i[3]==="screen"),a(s,"class","sy-assistant-textarea-container svelte-ynwtqm"),a(c,"class","sy-assistant-char-count svelte-ynwtqm"),x(c,"over-limit",i[26]),a(m,"class","sy-assistant-send-button svelte-ynwtqm"),m.disabled=_=!i[9].trim()||i[26],a(m,"aria-label","发送消息"),a(r,"class","sy-assistant-operation-area svelte-ynwtqm"),a(n,"class","sy-assistant-input-container svelte-ynwtqm"),x(n,"screen-theme",i[3]==="screen"),a(t,"class","sy-assistant-input-area svelte-ynwtqm"),x(t,"screen-theme",i[3]==="screen")},m(y,b){A&&A.m(y,b),q(y,e,b),q(y,t,b),w(t,n),w(n,s),w(s,o),wt(o,i[9]),w(n,l),w(n,r),w(r,c),w(c,u),w(c,f),w(c,p),w(r,d),w(r,m),m.innerHTML=g,R||(C=[U(o,"input",i[61]),U(o,"keydown",i[62]),U(m,"click",i[28]),U(m,"mouseenter",i[63]),U(m,"mouseleave",i[37])],R=!0)},p(y,b){y[5]?A?A.p(y,b):(A=as(y),A.c(),A.m(e.parentNode,e)):A&&(A.d(1),A=null),b[0]&512&&wt(o,y[9]),b[0]&8&&x(o,"screen-theme",y[3]==="screen"),b[0]&1024&&We(u,y[10]),b[0]&67108864&&x(c,"over-limit",y[26]),b[0]&64&&g!==(g=zt(y[6],'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>')+"")&&(m.innerHTML=g),b[0]&67109376&&_!==(_=!y[9].trim()||y[26])&&(m.disabled=_),b[0]&8&&x(n,"screen-theme",y[3]==="screen"),b[0]&8&&x(t,"screen-theme",y[3]==="screen")},d(y){y&&(H(e),H(t)),A&&A.d(y),R=!1,_e(C)}}}function as(i){let e,t,n,s,o,l,r,c,u,f=i[1]&&cs(i),p=!i[1]&&fs(),d=i[4]!==!1&&hs(i);return{c(){e=S("div"),t=S("div"),f&&f.c(),n=G(),p&&p.c(),s=G(),o=S("div"),d&&d.c(),l=G(),r=S("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',a(r,"class","sy-assistant-icon-button svelte-ynwtqm"),a(r,"aria-label","新建会话"),a(o,"class","sy-assistant-chat-actions-btns svelte-ynwtqm"),a(t,"class","sy-assistant-chat-actions svelte-ynwtqm"),a(e,"class","sy-assistant-chat-footer svelte-ynwtqm")},m(m,g){q(m,e,g),w(e,t),f&&f.m(t,null),w(t,n),p&&p.m(t,null),w(t,s),w(t,o),d&&d.m(o,null),w(o,l),w(o,r),c||(u=[U(r,"click",i[42]),U(r,"mouseenter",i[60]),U(r,"mouseleave",i[37])],c=!0)},p(m,g){m[1]?f?f.p(m,g):(f=cs(m),f.c(),f.m(t,n)):f&&(f.d(1),f=null),m[1]?p&&(p.d(1),p=null):p||(p=fs(),p.c(),p.m(t,s)),m[4]!==!1?d?d.p(m,g):(d=hs(m),d.c(),d.m(o,l)):d&&(d.d(1),d=null)},d(m){m&&H(e),f&&f.d(),p&&p.d(),d&&d.d(),c=!1,_e(u)}}}function cs(i){let e,t,n,s,o=_t(i[17]),l=[];for(let r=0;r<o.length;r+=1)l[r]=us(Ji(i,o,r));return{c(){e=S("div"),t=S("select");for(let r=0;r<l.length;r+=1)l[r].c();a(t,"class","sy-assistant-select svelte-ynwtqm"),i[18]===void 0&&on(()=>i[58].call(t)),a(e,"class","sy-assistant-scene-select svelte-ynwtqm")},m(r,c){q(r,e,c),w(e,t);for(let u=0;u<l.length;u+=1)l[u]&&l[u].m(t,null);oi(t,i[18],!0),n||(s=U(t,"change",i[58]),n=!0)},p(r,c){if(c[0]&131072){o=_t(r[17]);let u;for(u=0;u<o.length;u+=1){const f=Ji(r,o,u);l[u]?l[u].p(f,c):(l[u]=us(f),l[u].c(),l[u].m(t,null))}for(;u<l.length;u+=1)l[u].d(1);l.length=o.length}c[0]&393216&&oi(t,r[18])},d(r){r&&H(e),ii(l,r),n=!1,s()}}}function us(i){let e,t=i[73].name+"",n,s,o;return{c(){e=S("option"),n=Me(t),s=G(),e.__value=o=i[73].code,wt(e,e.__value)},m(l,r){q(l,e,r),w(e,n),w(e,s)},p(l,r){r[0]&131072&&t!==(t=l[73].name+"")&&We(n,t),r[0]&131072&&o!==(o=l[73].code)&&(e.__value=o,wt(e,e.__value))},d(l){l&&H(e)}}}function fs(i){let e;return{c(){e=S("div"),a(e,"class","sy-assistant-scene-select svelte-ynwtqm")},m(t,n){q(t,e,n)},d(t){t&&H(e)}}}function hs(i){let e,t,n;return{c(){e=S("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8v4l3 3"></path><circle cx="12" cy="12" r="10"></circle></svg>',a(e,"class","sy-assistant-icon-button svelte-ynwtqm"),a(e,"aria-label","历史会话")},m(s,o){q(s,e,o),t||(n=[U(e,"click",i[39]),U(e,"mouseenter",i[59]),U(e,"mouseleave",i[37])],t=!0)},p:j,d(s){s&&H(e),t=!1,_e(n)}}}function ds(i){let e,t=i[24].text+"",n;return{c(){e=S("div"),n=Me(t),a(e,"class","sy-assistant-button-tooltip svelte-ynwtqm"),F(e,"left",i[24].x+"px"),F(e,"top",i[24].y+"px")},m(s,o){q(s,e,o),w(e,n)},p(s,o){o[0]&16777216&&t!==(t=s[24].text+"")&&We(n,t),o[0]&16777216&&F(e,"left",s[24].x+"px"),o[0]&16777216&&F(e,"top",s[24].y+"px")},d(s){s&&H(e)}}}function _l(i){let e,t,n,s,o,l,r;const c=[fl,ul],u=[];function f(m,g){return m[25]?0:1}t=f(i),n=u[t]=c[t](i);let p=!i[25]&&rs(i),d=i[24]&&ds(i);return{c(){e=S("div"),n.c(),s=G(),p&&p.c(),o=G(),d&&d.c(),l=Rt(),a(e,"class","sy-assistant-chat-container svelte-ynwtqm"),F(e,"z-index",i[0]+2)},m(m,g){q(m,e,g),u[t].m(e,null),w(e,s),p&&p.m(e,null),q(m,o,g),d&&d.m(m,g),q(m,l,g),r=!0},p(m,g){let _=t;t=f(m),t===_?u[t].p(m,g):(vn(),ft(u[_],1,1,()=>{u[_]=null}),Sn(),n=u[t],n?n.p(m,g):(n=u[t]=c[t](m),n.c()),Ze(n,1),n.m(e,s)),m[25]?p&&(p.d(1),p=null):p?p.p(m,g):(p=rs(m),p.c(),p.m(e,null)),(!r||g[0]&1)&&F(e,"z-index",m[0]+2),m[24]?d?d.p(m,g):(d=ds(m),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null)},i(m){r||(Ze(n),r=!0)},o(m){ft(n),r=!1},d(m){m&&(H(e),H(o),H(l)),u[t].d(),p&&p.d(),d&&d.d(m)}}}let Zn=500;function bl(i){const e=i.match(/source#\[(.*)\]#source/);return e?i.replace(`source#[${e[1]}]#source`,""):i}function ps(i){const e=i.match(/source#\[(.*)\]#source/);if(e)try{return JSON.parse(`[${e[1]}]`)}catch(t){console.error("Failed to parse attachments:",t)}return null}function zt(i,e,t,n){if(!i)return e;if(i.startsWith("data:image")||i.startsWith("data:image/svg+xml"))return`<img src="${i}" alt="图标" style="width: ${t||"100%"}; height: ${n||"100%"};" />`;if(i.includes("<svg")){let s=i;return t&&(s=s.replace(/width="[^"]*"/,`width="${t}"`)),n&&(s=s.replace(/height="[^"]*"/,`height="${n}"`)),s}return e}function _n(i){const e=i.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:i,ext:""}}function kl(i,e,t){let n,s;const o=Bs();let l="",r=[{sessionId:"",requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],c="",u=null,f=null,p={x:0,y:0,alignRight:!1},d=null,m=!1,g=!1;le.setOptions({breaks:!0,gfm:!0});function _(k){try{const N=le(k);return ji.sanitize(N)}catch(N){console.warn("Markdown parsing failed, fallback to HTML:",N);try{const re=k.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return ji.sanitize(re)}catch(re){return console.error("HTML fallback failed:",re),k}}}let R;function C(k=!1){R&&R.scrollTo({top:R.scrollHeight,behavior:k?"smooth":"auto"})}Hs(()=>{C(!1)});let{zIndex:A}=e,{sessionId:y}=e,{hasScene:b}=e,{apiPrefix:T}=e,{theme:E="default"}=e,{showHistory:I=!0}=e,{showActions:M=!0}=e,{sendIcon:L=""}=e,{robotIcon:$=""}=e,{userIcon:B=""}=e,z=[],Y="";function se(){return Fe(this,null,function*(){if(b)try{const k=yield fetch(`${T}/chat/getSceneList`,{headers:{"Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`}});if(!k.ok)throw new Error("Failed to fetch scenes");const N=yield k.json();N.code===0&&(t(17,z=N.data.sceneList||[]),z.length>0&&t(18,Y=z[0].code))}catch(k){console.error("Failed to fetch scenes:",k)}})}kn(()=>{se()});function te(){return Fe(this,null,function*(){if(!l.trim()||s)return;if(!y){console.error("No session ID available");return}const k=Date.now().toString(),N=Date.now().toString()+Math.random().toString().slice(2,8),re={sessionId:y,requestId:N,id:k,type:"user",content:l.trim(),timestamp:Date.now()};t(11,r=[...r,re]);const we=l.trim();t(9,l="");const ye=(Date.now()+1).toString();c="",t(11,r=[...r,{sessionId:y,requestId:N,id:ye,type:"assistant",content:"",timestamp:Date.now()}]),t(15,m=!0),g=!1,u&&u.abort(),u=new AbortController;try{yield no(`${T}/chat/sse`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({sessionId:y,requestId:N,keyword:we,flowId:"1",extendKeys:b?{sceneCode:Y}:void 0}),signal:u.signal,onmessage(De){try{const K=De.data;if(K){g||(g=!0,o("firstResponse",{sessionId:y,requestId:N,content:K,timestamp:Date.now()}));const et=ps(K);et?(t(11,r=r.map(dt=>dt.id===ye?Re(fe({},dt),{attachments:et}):dt)),C(!0)):(c+=K,t(11,r=r.map(dt=>dt.id===ye?Re(fe({},dt),{content:c}):dt)),C(!1))}}catch(K){console.error("Failed to process SSE message:",K)}},onerror(De){throw c="请求异常,请重试",t(11,r=r.map(K=>K.id===ye?Re(fe({},K),{content:c}):K)),C(!1),console.error("SSE error:",De),u=null,t(15,m=!1),De},onclose(){u=null,t(15,m=!1)}})}catch(De){console.error("Failed to send message:",De),t(15,m=!1)}})}function ee(k,N,re){const we=re.getBoundingClientRect(),ye=R.getBoundingClientRect(),De=we.left<ye.width/2;t(12,f=N),t(13,p={x:we.left,y:we.top+we.height/2,alignRight:De})}function Ee(){t(14,d=setTimeout(()=>{t(12,f=null),t(14,d=null)},200))}qs(()=>{u&&u.abort(),d&&clearTimeout(d)});function Ae(k,N){return Fe(this,null,function*(){try{const re=yield fetch(`${T}/file/downloadFile`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({fileName:k,fileUrl:N})});if(!re.ok)throw new Error("Download failed");const we=re.headers.get("content-type")||"application/octet-stream",ye=yield re.blob(),De=window.URL.createObjectURL(ye),K=document.createElement("a");K.href=De,K.download=k,document.body.appendChild(K),K.click(),window.URL.revokeObjectURL(De),document.body.removeChild(K)}catch(re){console.error("Failed to download file:",re)}})}let ae={};function Qe(k,N){return Fe(this,null,function*(){try{const re=N.replace(/<br\s*\/?>/g,`
|
48
|
+
`).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();yield navigator.clipboard.writeText(re),t(19,ae[k]=!0,ae),setTimeout(()=>{t(19,ae[k]=!1,ae),t(19,ae)},1500)}catch(re){console.error("Failed to copy:",re)}})}let Z={},xe={},oe=!1;function Ce(k,N){return Fe(this,null,function*(){if(Z[k]===N){t(20,Z[k]=null,Z),t(20,Z);return}if(t(20,Z[k]=N,Z),t(20,Z),N==="like")try{if(!(yield fetch(`${T}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({sessionId:y,requestId:k,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch(re){console.error("Failed to send feedback:",re),t(20,Z[k]=null,Z),t(20,Z)}else t(22,oe=!0)})}function ce(k){return Fe(this,null,function*(){var N;if((N=xe[k])!=null&&N.trim())try{if(!(yield fetch(`${T}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({sessionId:y,requestId:k,feedBackFlag:"0",feedBackContent:xe[k]})})).ok)throw new Error("Feedback failed");t(22,oe=!1),t(21,xe[k]="",xe),t(21,xe)}catch(re){console.error("Failed to send feedback:",re),t(20,Z[k]=null,Z),t(20,Z)}})}let Te={x:0,y:0};function be(k,N){const we=k.currentTarget.getBoundingClientRect();t(23,Te={x:we.left-290,y:we.top-160}),Ce(N,"dislike")}let Je=null;function ge(k,N){const we=k.currentTarget.getBoundingClientRect();t(24,Je={text:N,x:we.left+we.width/2,y:we.top-8})}function Xe(){t(24,Je=null)}let W=[],X=Date.now().toString(),Ie=!1;function je(){Xe(),t(25,Ie=!0)}function st(){Xe(),t(25,Ie=!1)}function ot(k){return Fe(this,null,function*(){if(!m){t(15,m=!0);try{const N=yield fetch(`${T}/chat/record/session/detail/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`},body:JSON.stringify({sessionId:k})});if(!N.ok)throw new Error("Failed to load sessions");const re=yield N.json();if(re.code===0){X=k,t(25,Ie=!1);const we=re.data.map((ye,De)=>{const K=ps(ye.answer),et=bl(ye.answer);return[{sessionId:ye.sessionId,requestId:ye.requestId,id:(Date.now()+2*De).toString(),type:"user",content:ye.keyword,timestamp:new Date(ye.createDate).getTime()},{sessionId:ye.sessionId,requestId:ye.requestId,id:(Date.now()+2*De+1).toString(),type:"assistant",content:et,attachments:K,timestamp:new Date(ye.createDate).getTime()}]});t(11,r=we.flat())}}catch(N){console.error("Failed to load sessions:",N)}finally{t(15,m=!1)}}})}function lt(){return Fe(this,null,function*(){const k=yield bt();if(!k){console.error("Failed to create new session");return}X=k,t(11,r=[{sessionId:X,requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(9,l="")})}function bt(){return Fe(this,null,function*(){try{const k=yield fetch(`${T}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`}});if(!k.ok)throw new Error("Failed to get session ID");const N=yield k.json();if(N.code===0)return X=N.data.sessionId,X;throw new Error(N.message||"Failed to get session ID")}catch(k){return console.error("Failed to get session ID:",k),null}})}const rt=(k,N)=>ee(N,k.tips,N.currentTarget),Dt=k=>Ae(k.content_title,k.link),Ot=()=>{d&&(clearTimeout(d),t(14,d=null))},Kt=()=>{t(12,f=null)},Et=k=>Qe(k.id,k.content),D=(k,N)=>ge(N,ae[k.id]?"已复制":"复制内容"),Q=k=>Ce(k.id,"like"),ue=(k,N)=>ge(N,Z[k.id]==="like"?"取消点赞":"点赞"),ve=(k,N)=>be(N,k.id),Le=(k,N)=>ge(N,Z[k.id]==="dislike"?"取消点踩":"点踩");function ze(k){xe[k.id]=this.value,t(21,xe)}const Be=k=>{t(22,oe=!1),t(20,Z[k.id]=null,Z),t(20,Z)},Ke=k=>ce(k.id);function at(k){Bt[k?"unshift":"push"](()=>{R=k,t(16,R)})}function ct(){Y=Ps(this),t(18,Y),t(17,z)}const $e=k=>ge(k,"历史会话"),kt=k=>ge(k,"新建会话");function $t(){l=this.value,t(9,l)}const en=k=>k.key==="Enter"&&!k.shiftKey&&(te(),k.preventDefault()),Yn=k=>ge(k,"发送消息");return i.$$set=k=>{"zIndex"in k&&t(0,A=k.zIndex),"sessionId"in k&&t(43,y=k.sessionId),"hasScene"in k&&t(1,b=k.hasScene),"apiPrefix"in k&&t(2,T=k.apiPrefix),"theme"in k&&t(3,E=k.theme),"showHistory"in k&&t(4,I=k.showHistory),"showActions"in k&&t(5,M=k.showActions),"sendIcon"in k&&t(6,L=k.sendIcon),"robotIcon"in k&&t(7,$=k.robotIcon),"userIcon"in k&&t(8,B=k.userIcon)},i.$$.update=()=>{i.$$.dirty[0]&512&&t(10,n=l.length),i.$$.dirty[0]&1024&&t(26,s=n>Zn)},[A,b,T,E,I,M,L,$,B,l,n,r,f,p,d,m,R,z,Y,ae,Z,xe,oe,Te,Je,Ie,s,_,te,ee,Ee,Ae,Qe,Ce,ce,be,ge,Xe,W,je,st,ot,lt,y,rt,Dt,Ot,Kt,Et,D,Q,ue,ve,Le,ze,Be,Ke,at,ct,$e,kt,$t,en,Yn]}class yl extends In{constructor(e){super(),An(this,e,kl,_l,At,{zIndex:0,sessionId:43,hasScene:1,apiPrefix:2,theme:3,showHistory:4,showActions:5,sendIcon:6,robotIcon:7,userIcon:8},null,[-1,-1,-1])}}function ms(i){let e,t,n,s,o=i[3].title+"",l,r,c,u,f,p,d,m,g,_=i[2]?"退出全屏":"全屏显示",R,C,A,y,b,T,E,I,M=i[8]?"取消吸附":"吸附到边缘",L,$,B,z,Y,se,te,ee,Ee,Ae=`${i[3].height}px`,ae,Qe,Z;function xe(W,X){return W[2]?vl:Tl}let oe=xe(i),Ce=oe(i);function ce(W,X){return W[8]?El:Sl}let Te=ce(i),be=Te(i);const Je=[Il,Al],ge=[];function Xe(W,X){return W[9]?0:1}return ee=Xe(i),Ee=ge[ee]=Je[ee](i),{c(){var W,X,Ie;e=S("div"),t=S("div"),n=S("div"),s=S("h3"),l=Me(o),r=G(),c=S("div"),u=S("div"),f=S("button"),p=V("svg"),Ce.c(),m=G(),g=S("span"),R=Me(_),C=G(),A=S("div"),y=S("button"),b=V("svg"),be.c(),E=G(),I=S("span"),L=Me(M),$=G(),B=S("div"),z=S("button"),z.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',Y=G(),se=S("span"),se.textContent="关闭助手",te=G(),Ee.c(),a(s,"class","svelte-1h7dpbq"),a(p,"xmlns","http://www.w3.org/2000/svg"),a(p,"width","18"),a(p,"height","18"),a(p,"viewBox","0 0 24 24"),a(p,"fill","none"),a(p,"stroke","currentColor"),a(p,"stroke-width","2"),a(p,"stroke-linecap","round"),a(p,"stroke-linejoin","round"),a(f,"class","sy-assistant-action-button svelte-1h7dpbq"),a(f,"aria-label",d=i[2]?"退出全屏":"全屏显示"),x(f,"active",i[2]),a(g,"class","sy-assistant-tooltip svelte-1h7dpbq"),F(g,"z-index",((W=i[3].zIndex)!=null?W:1e3)+3),a(u,"class","sy-assistant-tooltip-wrapper svelte-1h7dpbq"),a(b,"xmlns","http://www.w3.org/2000/svg"),a(b,"width","18"),a(b,"height","18"),a(b,"viewBox","0 0 24 24"),a(b,"fill","none"),a(b,"stroke","currentColor"),a(b,"stroke-width","2"),a(b,"stroke-linecap","round"),a(b,"stroke-linejoin","round"),a(y,"class","sy-assistant-action-button svelte-1h7dpbq"),a(y,"aria-label",T=i[8]?"取消吸附":"吸附到边缘"),x(y,"active",i[8]),a(I,"class","sy-assistant-tooltip svelte-1h7dpbq"),F(I,"z-index",((X=i[3].zIndex)!=null?X:1e3)+3),a(A,"class","sy-assistant-tooltip-wrapper svelte-1h7dpbq"),a(z,"class","sy-assistant-close-button svelte-1h7dpbq"),a(z,"aria-label","关闭助手"),a(se,"class","sy-assistant-tooltip svelte-1h7dpbq"),F(se,"z-index",((Ie=i[3].zIndex)!=null?Ie:1e3)+3),a(B,"class","sy-assistant-tooltip-wrapper svelte-1h7dpbq"),a(c,"class","sy-assistant-header-actions svelte-1h7dpbq"),a(n,"class","sy-assistant-drawer-header svelte-1h7dpbq"),a(n,"role","button"),a(n,"tabindex","0"),a(n,"aria-label","拖动助手窗口"),x(n,"dragging",i[6]),x(n,"fullscreen",i[2]),x(n,"snapped",i[8]),a(t,"class","sy-assistant-drawer-content svelte-1h7dpbq"),a(e,"class","sy-assistant-drawer svelte-1h7dpbq"),x(e,"fullscreen",i[2]),x(e,"screen-theme",i[3].theme==="screen"),F(e,"height",Ae)},m(W,X){q(W,e,X),w(e,t),w(t,n),w(n,s),w(s,l),w(n,r),w(n,c),w(c,u),w(u,f),w(f,p),Ce.m(p,null),w(u,m),w(u,g),w(g,R),w(c,C),w(c,A),w(A,y),w(y,b),be.m(b,null),w(A,E),w(A,I),w(I,L),w(c,$),w(c,B),w(B,z),w(B,Y),w(B,se),w(t,te),ge[ee].m(t,null),ae=!0,Qe||(Z=[U(f,"click",i[17]),U(y,"click",i[19]),U(z,"click",i[16]),U(n,"mousedown",si(i[18]))],Qe=!0)},p(W,X){var je,st,ot;(!ae||X[0]&8)&&o!==(o=W[3].title+"")&&We(l,o),oe!==(oe=xe(W))&&(Ce.d(1),Ce=oe(W),Ce&&(Ce.c(),Ce.m(p,null))),(!ae||X[0]&4&&d!==(d=W[2]?"退出全屏":"全屏显示"))&&a(f,"aria-label",d),(!ae||X[0]&4)&&x(f,"active",W[2]),(!ae||X[0]&4)&&_!==(_=W[2]?"退出全屏":"全屏显示")&&We(R,_),X[0]&8&&F(g,"z-index",((je=W[3].zIndex)!=null?je:1e3)+3),Te!==(Te=ce(W))&&(be.d(1),be=Te(W),be&&(be.c(),be.m(b,null))),(!ae||X[0]&256&&T!==(T=W[8]?"取消吸附":"吸附到边缘"))&&a(y,"aria-label",T),(!ae||X[0]&256)&&x(y,"active",W[8]),(!ae||X[0]&256)&&M!==(M=W[8]?"取消吸附":"吸附到边缘")&&We(L,M),X[0]&8&&F(I,"z-index",((st=W[3].zIndex)!=null?st:1e3)+3),X[0]&8&&F(se,"z-index",((ot=W[3].zIndex)!=null?ot:1e3)+3),(!ae||X[0]&64)&&x(n,"dragging",W[6]),(!ae||X[0]&4)&&x(n,"fullscreen",W[2]),(!ae||X[0]&256)&&x(n,"snapped",W[8]);let Ie=ee;ee=Xe(W),ee===Ie?ge[ee].p(W,X):(vn(),ft(ge[Ie],1,1,()=>{ge[Ie]=null}),Sn(),Ee=ge[ee],Ee?Ee.p(W,X):(Ee=ge[ee]=Je[ee](W),Ee.c()),Ze(Ee,1),Ee.m(t,null)),(!ae||X[0]&4)&&x(e,"fullscreen",W[2]),(!ae||X[0]&8)&&x(e,"screen-theme",W[3].theme==="screen"),X[0]&8&&Ae!==(Ae=`${W[3].height}px`)&&F(e,"height",Ae)},i(W){ae||(Ze(Ee),ae=!0)},o(W){ft(Ee),ae=!1},d(W){W&&H(e),Ce.d(),be.d(),ge[ee].d(),Qe=!1,_e(Z)}}}function Tl(i){let e;return{c(){e=V("path"),a(e,"d","M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3")},m(t,n){q(t,e,n)},d(t){t&&H(e)}}}function vl(i){let e;return{c(){e=V("path"),a(e,"d","M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3")},m(t,n){q(t,e,n)},d(t){t&&H(e)}}}function Sl(i){let e,t;return{c(){e=V("rect"),t=V("line"),a(e,"x","3"),a(e,"y","3"),a(e,"width","18"),a(e,"height","18"),a(e,"rx","2"),a(e,"ry","2"),a(t,"x1","16"),a(t,"y1","6"),a(t,"x2","16"),a(t,"y2","18")},m(n,s){q(n,e,s),q(n,t,s)},d(n){n&&(H(e),H(t))}}}function El(i){let e,t;return{c(){e=V("rect"),t=V("rect"),a(e,"x","3"),a(e,"y","3"),a(e,"width","18"),a(e,"height","18"),a(e,"rx","2"),a(e,"ry","2"),a(t,"x","12"),a(t,"y","10"),a(t,"width","6"),a(t,"height","8"),a(t,"rx","1"),a(t,"ry","1")},m(n,s){q(n,e,s),q(n,t,s)},d(n){n&&(H(e),H(t))}}}function Al(i){var n,s,o,l,r,c,u,f,p;let e,t;return e=new yl({props:{zIndex:(n=i[3].zIndex)!=null?n:1e3,sessionId:i[10],hasScene:(s=i[3].hasScene)!=null?s:!1,apiPrefix:(o=i[3].apiPrefix)!=null?o:"/aiops/aigc",theme:(l=i[3].theme)!=null?l:"default",showHistory:(r=i[3].showHistory)!=null?r:!0,showActions:(c=i[3].showActions)!=null?c:!0,sendIcon:(u=i[3].sendIcon)!=null?u:"",robotIcon:(f=i[3].robotIcon)!=null?f:"",userIcon:(p=i[3].userIcon)!=null?p:""}}),{c(){En(e.$$.fragment)},m(d,m){rn(e,d,m),t=!0},p(d,m){var _,R,C,A,y,b,T,E,I;const g={};m[0]&8&&(g.zIndex=(_=d[3].zIndex)!=null?_:1e3),m[0]&1024&&(g.sessionId=d[10]),m[0]&8&&(g.hasScene=(R=d[3].hasScene)!=null?R:!1),m[0]&8&&(g.apiPrefix=(C=d[3].apiPrefix)!=null?C:"/aiops/aigc"),m[0]&8&&(g.theme=(A=d[3].theme)!=null?A:"default"),m[0]&8&&(g.showHistory=(y=d[3].showHistory)!=null?y:!0),m[0]&8&&(g.showActions=(b=d[3].showActions)!=null?b:!0),m[0]&8&&(g.sendIcon=(T=d[3].sendIcon)!=null?T:""),m[0]&8&&(g.robotIcon=(E=d[3].robotIcon)!=null?E:""),m[0]&8&&(g.userIcon=(I=d[3].userIcon)!=null?I:""),e.$set(g)},i(d){t||(Ze(e.$$.fragment,d),t=!0)},o(d){ft(e.$$.fragment,d),t=!1},d(d){an(e,d)}}}function Il(i){var n,s;let e,t;return e=new Qi({props:{sessions:i[14],onClose:i[31],onSelect:Dl,zIndex:(n=i[3].zIndex)!=null?n:1e3,apiPrefix:(s=i[3].apiPrefix)!=null?s:"/aiops/aigc"}}),{c(){En(e.$$.fragment)},m(o,l){rn(e,o,l),t=!0},p(o,l){var c,u;const r={};l[0]&512&&(r.onClose=o[31]),l[0]&8&&(r.zIndex=(c=o[3].zIndex)!=null?c:1e3),l[0]&8&&(r.apiPrefix=(u=o[3].apiPrefix)!=null?u:"/aiops/aigc"),e.$set(r)},i(o){t||(Ze(e.$$.fragment,o),t=!0)},o(o){ft(e.$$.fragment,o),t=!1},d(o){an(e,o)}}}function Rl(i){let e,t,n,s,o,l,r,c,u,f;return{c(){e=V("svg"),t=V("path"),n=V("path"),s=V("path"),o=V("path"),l=V("path"),r=V("path"),c=V("path"),a(t,"d","M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z"),a(t,"fill","#6F8698"),a(n,"d","M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z"),a(n,"fill","#3677FF"),a(s,"d","M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z"),a(s,"fill","#D0D5F1"),a(o,"d","M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z"),a(o,"fill","#3677FF"),a(l,"d","M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(l,"fill","#FFFFFF"),a(r,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(r,"fill","#FFFFFF"),a(c,"d","M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z"),a(c,"fill","#8896A4"),a(e,"class","sy-assistant-icon"),a(e,"viewBox","0 0 1024 1024"),a(e,"version","1.1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width",u=i[3].isSelf?void 0:i[3].iconWidth),a(e,"height",f=i[3].isSelf?void 0:i[3].iconHeight),a(e,"fill","currentColor"),a(e,"aria-label","助手图标")},m(p,d){q(p,e,d),w(e,t),w(e,n),w(e,s),w(e,o),w(e,l),w(e,r),w(e,c)},p(p,d){d[0]&8&&u!==(u=p[3].isSelf?void 0:p[3].iconWidth)&&a(e,"width",u),d[0]&8&&f!==(f=p[3].isSelf?void 0:p[3].iconHeight)&&a(e,"height",f)},d(p){p&&H(e)}}}function Ml(i){let e,t,n;function s(r,c){return c[0]&8&&(e=null),c[0]&8&&(t=null),e==null&&(e=!!(r[3].icon.startsWith("data:image")||r[3].icon.startsWith("data:image/svg+xml"))),e?Ll:(t==null&&(t=!!r[3].icon.includes("<svg")),t?xl:Cl)}let o=s(i,[-1,-1]),l=o(i);return{c(){l.c(),n=Rt()},m(r,c){l.m(r,c),q(r,n,c)},p(r,c){o===(o=s(r,c))&&l?l.p(r,c):(l.d(1),l=o(r),l&&(l.c(),l.m(n.parentNode,n)))},d(r){r&&H(n),l.d(r)}}}function Cl(i){let e,t,n,s,o,l,r,c,u,f;return{c(){e=V("svg"),t=V("path"),n=V("path"),s=V("path"),o=V("path"),l=V("path"),r=V("path"),c=V("path"),a(t,"d","M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z"),a(t,"fill","#6F8698"),a(n,"d","M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z"),a(n,"fill","#3677FF"),a(s,"d","M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z"),a(s,"fill","#D0D5F1"),a(o,"d","M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z"),a(o,"fill","#3677FF"),a(l,"d","M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(l,"fill","#FFFFFF"),a(r,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(r,"fill","#FFFFFF"),a(c,"d","M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z"),a(c,"fill","#8896A4"),a(e,"class","sy-assistant-icon"),a(e,"viewBox","0 0 1024 1024"),a(e,"version","1.1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width",u=i[3].isSelf?void 0:i[3].iconWidth),a(e,"height",f=i[3].isSelf?void 0:i[3].iconHeight),a(e,"fill","currentColor"),a(e,"aria-label","助手图标")},m(p,d){q(p,e,d),w(e,t),w(e,n),w(e,s),w(e,o),w(e,l),w(e,r),w(e,c)},p(p,d){d[0]&8&&u!==(u=p[3].isSelf?void 0:p[3].iconWidth)&&a(e,"width",u),d[0]&8&&f!==(f=p[3].isSelf?void 0:p[3].iconHeight)&&a(e,"height",f)},d(p){p&&H(e)}}}function xl(i){let e,t=(i[3].isSelf?i[3].icon:i[3].icon.replace(/width="[^"]*"/,`width="${i[3].iconWidth}"`).replace(/height="[^"]*"/,`height="${i[3].iconHeight}"`))+"",n;return{c(){e=new Ns(!1),n=Rt(),e.a=n},m(s,o){e.m(t,s,o),q(s,n,o)},p(s,o){o[0]&8&&t!==(t=(s[3].isSelf?s[3].icon:s[3].icon.replace(/width="[^"]*"/,`width="${s[3].iconWidth}"`).replace(/height="[^"]*"/,`height="${s[3].iconHeight}"`))+"")&&e.p(t)},d(s){s&&(H(n),e.d())}}}function Ll(i){let e,t,n;return{c(){e=S("img"),tt(e.src,t=i[3].icon)||a(e,"src",t),a(e,"alt","助手图标"),a(e,"style",n=i[3].isSelf?"":`width: ${i[3].iconWidth}px; height: ${i[3].iconHeight}px;`)},m(s,o){q(s,e,o)},p(s,o){o[0]&8&&!tt(e.src,t=s[3].icon)&&a(e,"src",t),o[0]&8&&n!==(n=s[3].isSelf?"":`width: ${s[3].iconWidth}px; height: ${s[3].iconHeight}px;`)&&a(e,"style",n)},d(s){s&&H(e)}}}function zl(i){let e,t,n=`${i[13]}px`,s,o,l,r,c,u,f=i[13]>0&&ms(i);function p(g,_){return g[3].icon?Ml:Rl}let d=p(i),m=d(i);return{c(){var g,_;e=S("div"),t=S("div"),f&&f.c(),s=G(),o=S("button"),m.c(),a(t,"class","sy-assistant-drawer-wrapper svelte-1h7dpbq"),x(t,"fullscreen",i[2]),F(t,"width",n),a(o,"class","sy-assistant-floating-button svelte-1h7dpbq"),a(o,"aria-label","打开助手"),a(o,"style",l=i[11]+" z-index: "+(((g=i[3].zIndex)!=null?g:1e3)+1)+"; "+i[20]()),x(o,"isSelf",i[3].isSelf),x(o,"hidden-left",i[7]==="left"),x(o,"hidden-right",i[7]==="right"),x(o,"hidden-top",i[7]==="top"),x(o,"hidden-bottom",i[7]==="bottom"),a(e,"class","sy-assistant-container sy-assistant-theme svelte-1h7dpbq"),x(e,"fullscreen",i[2]),x(e,"snapped",i[8]),x(e,"screen-theme",i[3].theme==="screen"),F(e,"position",i[3].position),F(e,"right",i[8]?0:`${i[0]}px`),F(e,"bottom",i[8]?0:`${i[1]}px`),F(e,"top",i[8]||i[2]?"0":"auto"),F(e,"left",i[2]?"0":"auto"),F(e,"z-index",(_=i[3].zIndex)!=null?_:1e3)},m(g,_){q(g,e,_),w(e,t),f&&f.m(t,null),w(e,s),w(e,o),m.m(o,null),i[32](o),i[34](e),r=!0,c||(u=[U(o,"click",i[16]),U(o,"mousedown",si(i[33])),U(o,"mouseenter",i[21]),U(o,"mouseleave",i[22])],c=!0)},p(g,_){var R,C;g[13]>0?f?(f.p(g,_),_[0]&8192&&Ze(f,1)):(f=ms(g),f.c(),Ze(f,1),f.m(t,null)):f&&(vn(),ft(f,1,1,()=>{f=null}),Sn()),(!r||_[0]&4)&&x(t,"fullscreen",g[2]),_[0]&8192&&n!==(n=`${g[13]}px`)&&F(t,"width",n),d===(d=p(g))&&m?m.p(g,_):(m.d(1),m=d(g),m&&(m.c(),m.m(o,null))),(!r||_[0]&2056&&l!==(l=g[11]+" z-index: "+(((R=g[3].zIndex)!=null?R:1e3)+1)+"; "+g[20]()))&&a(o,"style",l),(!r||_[0]&8)&&x(o,"isSelf",g[3].isSelf),(!r||_[0]&128)&&x(o,"hidden-left",g[7]==="left"),(!r||_[0]&128)&&x(o,"hidden-right",g[7]==="right"),(!r||_[0]&128)&&x(o,"hidden-top",g[7]==="top"),(!r||_[0]&128)&&x(o,"hidden-bottom",g[7]==="bottom"),(!r||_[0]&4)&&x(e,"fullscreen",g[2]),(!r||_[0]&256)&&x(e,"snapped",g[8]),(!r||_[0]&8)&&x(e,"screen-theme",g[3].theme==="screen"),_[0]&8&&F(e,"position",g[3].position),_[0]&257&&F(e,"right",g[8]?0:`${g[0]}px`),_[0]&258&&F(e,"bottom",g[8]?0:`${g[1]}px`),_[0]&260&&F(e,"top",g[8]||g[2]?"0":"auto"),_[0]&4&&F(e,"left",g[2]?"0":"auto"),_[0]&8&&F(e,"z-index",(C=g[3].zIndex)!=null?C:1e3)},i(g){r||(Ze(f),r=!0)},o(g){ft(f),r=!1},d(g){g&&H(e),f&&f.d(),m.d(),i[32](null),i[34](null),c=!1,_e(u)}}}const gs=48,me=20;function Dl(i){}function Ol(i,e,t){let n,s,o,l,r=j,c=()=>(r(),r=zs(s,D=>t(13,l=D)),s);i.$$.on_destroy.push(()=>r());const u={position:"fixed",width:480,height:800,title:"智慧运维助手",initialState:"default",defaultPosition:{right:me,bottom:me},snappedWidth:480,drawerWidth:480,zIndex:1e3,hasScene:!1,apiPrefix:"/aiops/aigc",isSelf:!1,icon:"",iconWidth:void 0,iconHeight:void 0,theme:"default",showHistory:!0,showActions:!0,sendIcon:"",robotIcon:"",userIcon:"",hideEnabled:!1,hideDelay:5e3};let{target:f="body"}=e,{options:p={}}=e,d,m=null,g=!1,_,R=!1,C=0,A=0,y=me,b=20,T=y,E=b,I=!1,M=me,L=50,$=!1,B=!1,z=null,Y=null,se="",te={left:"auto",right:`${me}px`,top:"auto",bottom:"50%"},ee=!1,Ee={width:0},Ae=!1,ae=!1,Qe=[],Z=null;function xe(){return Fe(this,null,function*(){try{const D=yield fetch(`${n.apiPrefix}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${ke()}`,Authorization:`bearer ${ke()}`}});if(!D.ok)throw new Error("Failed to get session ID");const Q=yield D.json();if(Q.code===0)return t(10,Z=Q.data.sessionId),Z;throw new Error(Q.message||"Failed to get session ID")}catch(D){return console.error("Failed to get session ID:",D),null}})}function oe(D,Q=!1){Q?t(26,I=!0):t(6,R=!0),C=D.clientX,A=D.clientY,y=Q?M:T,b=Q?L:E,D.preventDefault()}function Ce(D){if(!R&&!I)return;const Q=C-D.clientX,ue=A-D.clientY;if(I){const ve=y+Q,Le=D.clientY,ze=rt();t(27,M=Math.max(me,Math.min(window.innerWidth-ze-me,ve)));const Be=window.innerHeight-ze-me,at=Math.max(me,Math.min(Be,Le));L=(window.innerHeight-at-ze)/window.innerHeight*100,t(30,te={left:"auto",right:`${M}px`,top:"auto",bottom:`${L}%`}),t(29,se=""),t(7,Y=null)}else{const ve=n.width||0,Le=n.height||0,ze=y+Q;t(0,T=Math.max(me,Math.min(window.innerWidth-ve-me,ze)));const Be=b+ue;t(1,E=Math.max(me,Math.min(window.innerHeight-Le-me,Be)))}}function ce(){const D=I;t(6,R=!1),t(26,I=!1),D&&n.hideEnabled&&!g&&!$&&Te()}function Te(){!n.hideEnabled||g||$||(be(),z=setTimeout(()=>{ge()},n.hideDelay))}function be(){z&&(clearTimeout(z),z=null)}function Je(){const D=window.innerWidth,Q=window.innerHeight,ue=rt(),ve=D-M-ue,Le=Q-L/100*Q-ue,ze=ve,Be=D-ve-ue,Ke=Le,at=Q-Le-ue,ct=Math.min(ze,Be,Ke,at);return ct===ze?{direction:"left",position:{left:`${-ue/2}px`,right:"auto",top:`${Le}px`,bottom:"auto"},transform:"rotate(45deg) scale(0.8)"}:ct===Be?{direction:"right",position:{left:"auto",right:`${-ue/2}px`,top:`${Le}px`,bottom:"auto"},transform:"rotate(-45deg) scale(0.8)"}:ct===Ke?{direction:"top",position:{left:`${ve}px`,right:"auto",top:`${-ue/2}px`,bottom:"auto"},transform:"rotate(180deg) scale(0.7)"}:{direction:"bottom",position:{left:`${ve}px`,right:"auto",top:"auto",bottom:`${-ue/2}px`},transform:"scale(0.7)"}}function ge(){if(g||$)return;const D=Je();t(7,Y=D.direction),t(30,te=D.position),t(29,se=D.transform),B=!0}function Xe(){B&&(t(7,Y=null),t(30,te={left:"auto",right:`${M}px`,top:"auto",bottom:`${L}%`}),t(29,se=""),B=!1)}kn(()=>{typeof f=="string"?m=document.querySelector(f)||document.body:m=f||document.body;const D=ue=>Ce(ue),Q=()=>ce();return document.addEventListener("mousemove",D),document.addEventListener("mouseup",Q),d&&m&&m.appendChild(d),_&&_.getBoundingClientRect().left,t(8,Ae=n.initialState==="snapped"),t(2,ee=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,T=0),t(1,E=0),t(3,n=Re(fe({},n),{height:typeof window!="undefined"?window.innerHeight:n.height,width:n.snappedWidth||n.width}))):n.initialState==="fullscreen"&&(t(0,T=0),t(1,E=0),t(3,n=Re(fe({},n),{width:typeof window!="undefined"?window.innerWidth:n.width,height:typeof window!="undefined"?window.innerHeight:n.height}))),n.hideEnabled&&Te(),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",Q),be(),m&&d&&m.removeChild(d)}});function W(){return Fe(this,null,function*(){g?n.hideEnabled&&Te():(yield xe(),be(),B&&Xe()),t(25,g=!g)})}function X(){var D,Q,ue,ve,Le,ze,Be,Ke;t(2,ee=!ee),ee?(Ee.width||(Ee={width:u.width,height:u.height,right:(Q=(D=u.defaultPosition)==null?void 0:D.right)!=null?Q:me,bottom:(ve=(ue=u.defaultPosition)==null?void 0:ue.bottom)!=null?ve:me}),Ae&&t(8,Ae=!1),t(23,p=Re(fe({},n),{width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth})),t(0,T=0),t(1,E=0)):(t(23,p=Re(fe({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,T=(ze=(Le=u.defaultPosition)==null?void 0:Le.right)!=null?ze:me),t(1,E=(Ke=(Be=u.defaultPosition)==null?void 0:Be.bottom)!=null?Ke:me))}function Ie(D){ee||oe(D)}function je(){var D,Q,ue,ve;ee&&(t(2,ee=!1),t(23,p=Re(fe({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth}))),t(8,Ae=!Ae),Ae?(n.height,t(0,T=0),t(1,E=0),t(23,p=Re(fe({},n),{height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width}))):(t(23,p=Re(fe({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,T=(Q=(D=u.defaultPosition)==null?void 0:D.right)!=null?Q:me),t(1,E=(ve=(ue=u.defaultPosition)==null?void 0:ue.bottom)!=null?ve:me))}function st(){return n.isSelf?n.iconWidth!==void 0&&n.iconHeight!==void 0?`width: ${n.iconWidth}px; height: ${n.iconHeight}px;`:"":n.iconWidth!==void 0&&n.iconHeight!==void 0?`width: ${n.iconWidth}px; height: ${n.iconHeight}px;`:"width: 48px; height: 48px;"}function ot(){t(28,$=!0),be(),B&&Xe()}function lt(){t(28,$=!1),n.hideEnabled&&!g&&Te()}function bt(){if(n.isSelf&&_){const D=_.querySelector("img, svg");if(D){const Q=D.getBoundingClientRect();if(Q.width>0&&Q.height>0)return{width:Q.width,height:Q.height}}}return n.iconWidth&&n.iconHeight?{width:n.iconWidth,height:n.iconHeight}:{width:gs,height:gs}}function rt(){const{width:D,height:Q}=bt();return Math.max(D,Q)}const Dt=()=>t(9,ae=!1);function Ot(D){Bt[D?"unshift":"push"](()=>{_=D,t(5,_)})}const Kt=D=>oe(D,!0);function Et(D){Bt[D?"unshift":"push"](()=>{d=D,t(4,d)})}return i.$$set=D=>{"target"in D&&t(24,f=D.target),"options"in D&&t(23,p=D.options)},i.$$.update=()=>{if(i.$$.dirty[0]&8388608&&t(3,n=Re(fe(fe({},u),p),{defaultPosition:fe(fe({},u.defaultPosition),p.defaultPosition)})),i.$$.dirty[0]&33554444&&c(t(12,s=Vs(g?ee?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),i.$$.dirty[0]&134217739&&typeof window!="undefined"){t(0,T=Math.max(me,Math.min(window.innerWidth-(n.width||0),T))),t(1,E=Math.max(me,Math.min(window.innerHeight-(n.height||0),E)));const D=rt();t(27,M=Math.max(me,Math.min(window.innerWidth-D-me,M)))}i.$$.dirty[0]&301989896&&(n.hideEnabled&&!g&&!$?Te():be()),i.$$.dirty[0]&1711276032&&t(11,o=g?"display: none;":`position: fixed; left: ${te.left}; right: ${te.right}; top: ${te.top}; bottom: ${te.bottom}; transform: ${se}; cursor: ${I?"grabbing":"grab"};`)},[T,E,ee,n,d,_,R,Y,Ae,ae,Z,o,s,l,Qe,oe,W,X,Ie,je,st,ot,lt,p,f,g,I,M,$,se,te,Dt,Ot,Kt,Et]}class Pl extends In{constructor(e){super(),An(this,e,Ol,zl,At,{target:24,options:23},null,[-1,-1])}}ie.SyAssistant=Pl,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});
|