@sy-design/svelte 1.0.5 → 1.0.6

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.umd.js CHANGED
@@ -1,31 +1,31 @@
1
- (function(re,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(re=typeof globalThis<"u"?globalThis:re||self,Z(re["@sy-design/svelte"]=re["@sy-design/svelte"]||{}))})(this,function(re){"use strict";var cl=Object.defineProperty;var ii=re=>{throw TypeError(re)};var ul=(re,Z,xe)=>Z in re?cl(re,Z,{enumerable:!0,configurable:!0,writable:!0,value:xe}):re[Z]=xe;var ne=(re,Z,xe)=>ul(re,typeof Z!="symbol"?Z+"":Z,xe),fl=(re,Z,xe)=>Z.has(re)||ii("Cannot "+xe);var oi=(re,Z,xe)=>Z.has(re)?ii("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(re):Z.set(re,xe);var $t=(re,Z,xe)=>(fl(re,Z,"access private method"),xe);var tt,Nn,li;function Z(){}function xe(s){return s()}function Pn(){return Object.create(null)}function me(s){s.forEach(xe)}function en(s){return typeof s=="function"}function Ct(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function ri(s){return Object.keys(s).length===0}function ai(s,...e){if(s==null){for(const n of e)n(void 0);return Z}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const Fn=typeof window<"u";let Hn=Fn?()=>window.performance.now():()=>Date.now(),Bn=Fn?s=>requestAnimationFrame(s):Z;const it=new Set;function Un(s){it.forEach(e=>{e.c(s)||(it.delete(e),e.f())}),it.size!==0&&Bn(Un)}function ci(s){let e;return it.size===0&&Bn(Un),{promise:new Promise(t=>{it.add(e={c:s,f:t})}),abort(){it.delete(e)}}}function m(s,e){s.appendChild(e)}function W(s,e,t){s.insertBefore(e,t||null)}function U(s){s.parentNode&&s.parentNode.removeChild(s)}function ui(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function x(s){return document.createElement(s)}function Q(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function we(s){return document.createTextNode(s)}function G(){return we(" ")}function Lt(){return we("")}function H(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function jn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function r(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function fi(s){return Array.from(s.childNodes)}function Le(s,e){e=""+e,s.data!==e&&(s.data=e)}function ot(s,e){s.value=e??""}function N(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function K(s,e,t){s.classList.toggle(e,!!t)}let mt;function wt(s){mt=s}function tn(){if(!mt)throw new Error("Function called outside component initialization");return mt}function Wn(s){tn().$$.on_mount.push(s)}function pi(s){tn().$$.after_update.push(s)}function hi(s){tn().$$.on_destroy.push(s)}const lt=[],rt=[];let at=[];const Gn=[],di=Promise.resolve();let nn=!1;function gi(){nn||(nn=!0,di.then(qn))}function sn(s){at.push(s)}const on=new Set;let ct=0;function qn(){if(ct!==0)return;const s=mt;do{try{for(;ct<lt.length;){const e=lt[ct];ct++,wt(e),mi(e.$$)}}catch(e){throw lt.length=0,ct=0,e}for(wt(null),lt.length=0,ct=0;rt.length;)rt.pop()();for(let e=0;e<at.length;e+=1){const t=at[e];on.has(t)||(on.add(t),t())}at.length=0}while(lt.length);for(;Gn.length;)Gn.pop()();nn=!1,on.clear(),wt(s)}function mi(s){if(s.fragment!==null){s.update(),me(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(sn)}}function wi(s){const e=[],t=[];at.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),at=e}const Mt=new Set;let Ke;function ln(){Ke={r:0,c:[],p:Ke}}function rn(){Ke.r||me(Ke.c),Ke=Ke.p}function Me(s,e){s&&s.i&&(Mt.delete(s),s.i(e))}function We(s,e,t,n){if(s&&s.o){if(Mt.has(s))return;Mt.add(s),Ke.c.push(()=>{Mt.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function ut(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function Yn(s,e){s.d(1),e.delete(s.key)}function Zn(s,e,t,n,i,o,l,a,c,u,p,h){let g=s.length,d=o.length,w=g;const E={};for(;w--;)E[s[w].key]=w;const z=[],M=new Map,y=new Map,_=[];for(w=d;w--;){const A=h(i,o,w),C=t(A);let R=l.get(C);R?_.push(()=>R.p(A,e)):(R=u(C,A),R.c()),M.set(C,z[w]=R),C in E&&y.set(C,Math.abs(w-E[C]))}const k=new Set,S=new Set;function b(A){Me(A,1),A.m(a,p),l.set(A.key,A),p=A.first,d--}for(;g&&d;){const A=z[d-1],C=s[g-1],R=A.key,P=C.key;A===C?(p=A.first,g--,d--):M.has(P)?!l.has(R)||k.has(R)?b(A):S.has(P)?g--:y.get(R)>y.get(P)?(S.add(R),b(A)):(k.add(P),g--):(c(C,l),g--)}for(;g--;){const A=s[g];M.has(A.key)||c(A,l)}for(;d;)b(z[d-1]);return me(_),z}function an(s){s&&s.c()}function Ot(s,e,t){const{fragment:n,after_update:i}=s.$$;n&&n.m(e,t),sn(()=>{const o=s.$$.on_mount.map(xe).filter(en);s.$$.on_destroy?s.$$.on_destroy.push(...o):me(o),s.$$.on_mount=[]}),i.forEach(sn)}function Dt(s,e){const t=s.$$;t.fragment!==null&&(wi(t.after_update),me(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function ki(s,e){s.$$.dirty[0]===-1&&(lt.push(s),gi(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function cn(s,e,t,n,i,o,l=null,a=[-1]){const c=mt;wt(s);const u=s.$$={fragment:null,ctx:[],props:o,update:Z,not_equal:i,bound:Pn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Pn(),dirty:a,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let p=!1;if(u.ctx=t?t(s,e.props||{},(h,g,...d)=>{const w=d.length?d[0]:g;return u.ctx&&i(u.ctx[h],u.ctx[h]=w)&&(!u.skip_bound&&u.bound[h]&&u.bound[h](w),p&&ki(s,h)),g}):[],u.update(),p=!0,me(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const h=fi(e.target);u.fragment&&u.fragment.l(h),h.forEach(U)}else u.fragment&&u.fragment.c();e.intro&&Me(s.$$.fragment),Ot(s,e.target,e.anchor),qn()}wt(c)}class un{constructor(){ne(this,"$$");ne(this,"$$set")}$destroy(){Dt(this,1),this.$destroy=Z}$on(e,t){if(!en(t))return Z;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!ri(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const _i="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_i);const ft=[];function bi(s,e=Z){let t;const n=new Set;function i(a){if(Ct(s,a)&&(s=a,t)){const c=!ft.length;for(const u of n)u[1](),ft.push(u,s);if(c){for(let u=0;u<ft.length;u+=2)ft[u][0](ft[u+1]);ft.length=0}}}function o(a){i(a(s))}function l(a,c=Z){const u=[a,c];return n.add(u),n.size===1&&(t=e(i,o)||Z),a(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:i,update:o,subscribe:l}}function Xn(s){return Object.prototype.toString.call(s)==="[object Date]"}function fn(s,e,t,n){if(typeof t=="number"||Xn(t)){const i=n-t,o=(t-e)/(s.dt||1/60),l=s.opts.stiffness*i,a=s.opts.damping*o,c=(l-a)*s.inv_mass,u=(o+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(i)<s.opts.precision?n:(s.settled=!1,Xn(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((i,o)=>fn(s,e[o],t[o],n[o]));if(typeof t=="object"){const i={};for(const o in t)i[o]=fn(s,e[o],t[o],n[o]);return i}else throw new Error(`Cannot spring ${typeof t} values`)}}function yi(s,e={}){const t=bi(s),{stiffness:n=.15,damping:i=.8,precision:o=.01}=e;let l,a,c,u=s,p=s,h=1,g=0,d=!1;function w(z,M={}){p=z;const y=c={};return s==null||M.hard||E.stiffness>=1&&E.damping>=1?(d=!0,l=Hn(),u=z,t.set(s=p),Promise.resolve()):(M.soft&&(g=1/((M.soft===!0?.5:+M.soft)*60),h=0),a||(l=Hn(),d=!1,a=ci(_=>{if(d)return d=!1,a=null,!1;h=Math.min(h+g,1);const k={inv_mass:h,opts:E,settled:!0,dt:(_-l)*60/1e3},S=fn(k,u,s,p);return l=_,u=s,t.set(s=S),k.settled&&(a=null),!k.settled})),new Promise(_=>{a.promise.then(()=>{y===c&&_()})}))}const E={set:w,update:(z,M)=>w(z(p,s),M),subscribe:t.subscribe,stiffness:n,damping:i,precision:o};return E}async function Ti(s,e){const t=s.getReader();let n;for(;!(n=await t.read()).done;)e(n.value)}function vi(s){let e,t,n,i=!1;return function(l){e===void 0?(e=l,t=0,n=-1):e=Si(e,l);const a=e.length;let c=0;for(;t<a;){i&&(e[t]===10&&(c=++t),i=!1);let u=-1;for(;t<a&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:i=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===a?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Ei(s,e,t){let n=Vn();const i=new TextDecoder;return function(l,a){if(l.length===0)t==null||t(n),n=Vn();else if(a>0){const c=i.decode(l.subarray(0,a)),u=a+(l[a+1]===32?2:1),p=i.decode(l.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
2
- `+p:p;break;case"event":n.event=p;break;case"id":s(n.id=p);break;case"retry":const h=parseInt(p,10);isNaN(h)||e(n.retry=h);break}}}}function Si(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function Vn(){return{data:"",event:"",id:"",retry:void 0}}var Ai=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(s);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(s,n[i])&&(t[n[i]]=s[n[i]]);return t};const pn="text/event-stream",xi=1e3,Qn="last-event-id";function Ri(s,e){var{signal:t,headers:n,onopen:i,onmessage:o,onclose:l,onerror:a,openWhenHidden:c,fetch:u}=e,p=Ai(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((h,g)=>{const d=Object.assign({},n);d.accept||(d.accept=pn);let w;function E(){w.abort(),document.hidden||S()}c||document.addEventListener("visibilitychange",E);let z=xi,M=0;function y(){document.removeEventListener("visibilitychange",E),window.clearTimeout(M),w.abort()}t==null||t.addEventListener("abort",()=>{y(),h()});const _=u??window.fetch,k=i??Ii;async function S(){var b;w=new AbortController;try{const A=await _(s,Object.assign(Object.assign({},p),{headers:d,signal:w.signal}));await k(A),await Ti(A.body,vi(Ei(C=>{C?d[Qn]=C:delete d[Qn]},C=>{z=C},o))),l==null||l(),y(),h()}catch(A){if(!w.signal.aborted)try{const C=(b=a==null?void 0:a(A))!==null&&b!==void 0?b:z;window.clearTimeout(M),M=window.setTimeout(S,C)}catch(C){y(),g(C)}}}S()})}function Ii(s){const e=s.headers.get("content-type");if(!(e!=null&&e.startsWith(pn)))throw new Error(`Expected content-type to be ${pn}, Actual: ${e}`)}function hn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Je=hn();function Kn(s){Je=s}const Jn=/[&<>"']/,zi=new RegExp(Jn.source,"g"),$n=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ci=new RegExp($n.source,"g"),Li={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},es=s=>Li[s];function Re(s,e){if(e){if(Jn.test(s))return s.replace(zi,es)}else if($n.test(s))return s.replace(Ci,es);return s}const Mi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Oi(s){return s.replace(Mi,(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 Di=/(^|[^\[])\^/g;function $(s,e){let t=typeof s=="string"?s:s.source;e=e||"";const n={replace:(i,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(Di,"$1"),t=t.replace(i,l),n},getRegex:()=>new RegExp(t,e)};return n}function ts(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}const kt={exec:()=>null};function ns(s,e){const t=s.replace(/\|/g,(o,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let i=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(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Nt(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n;){const o=s.charAt(n-i-1);if(o===e&&!t)i++;else if(o!==e&&t)i++;else break}return s.slice(0,n-i)}function Ni(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function ss(s,e,t,n){const i=e.href,o=e.title?Re(e.title):null,l=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:t,href:i,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:o,text:Re(l)}}function Pi(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
1
+ (function(J,H){typeof exports=="object"&&typeof module!="undefined"?H(exports):typeof define=="function"&&define.amd?define(["exports"],H):(J=typeof globalThis!="undefined"?globalThis:J||self,H(J["@sy-design/svelte"]=J["@sy-design/svelte"]||{}))})(this,function(J){"use strict";var dl=Object.defineProperty,gl=Object.defineProperties;var ml=Object.getOwnPropertyDescriptors;var ui=Object.getOwnPropertySymbols;var wl=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable;var fi=J=>{throw TypeError(J)};var Wn=(J,H,oe)=>H in J?dl(J,H,{enumerable:!0,configurable:!0,writable:!0,value:oe}):J[H]=oe,ne=(J,H)=>{for(var oe in H||(H={}))wl.call(H,oe)&&Wn(J,oe,H[oe]);if(ui)for(var oe of ui(H))kl.call(H,oe)&&Wn(J,oe,H[oe]);return J},_e=(J,H)=>gl(J,ml(H));var ie=(J,H,oe)=>Wn(J,typeof H!="symbol"?H+"":H,oe),_l=(J,H,oe)=>H.has(J)||fi("Cannot "+oe);var hi=(J,H,oe)=>H.has(J)?fi("Cannot add the same private member more than once"):H instanceof WeakSet?H.add(J):H.set(J,oe);var an=(J,H,oe)=>(_l(J,H,"access private method"),oe);var Le=(J,H,oe)=>new Promise((Ht,ge)=>{var Tt=Xe=>{try{vt(oe.next(Xe))}catch(ct){ge(ct)}},at=Xe=>{try{vt(oe.throw(Xe))}catch(ct){ge(ct)}},vt=Xe=>Xe.done?Ht(Xe.value):Promise.resolve(Xe.value).then(Tt,at);vt((oe=oe.apply(J,H)).next())});var lt,Gn,pi;function H(){}function oe(s){return s()}function Ht(){return Object.create(null)}function ge(s){s.forEach(oe)}function Tt(s){return typeof s=="function"}function at(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function vt(s){return Object.keys(s).length===0}function Xe(s,...e){if(s==null){for(const n of e)n(void 0);return H}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const ct=typeof window!="undefined";let qn=ct?()=>window.performance.now():()=>Date.now(),Yn=ct?s=>requestAnimationFrame(s):H;const ut=new Set;function Zn(s){ut.forEach(e=>{e.c(s)||(ut.delete(e),e.f())}),ut.size!==0&&Yn(Zn)}function di(s){let e;return ut.size===0&&Yn(Zn),{promise:new Promise(t=>{ut.add(e={c:s,f:t})}),abort(){ut.delete(e)}}}function m(s,e){s.appendChild(e)}function G(s,e,t){s.insertBefore(e,t||null)}function j(s){s.parentNode&&s.parentNode.removeChild(s)}function gi(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function x(s){return document.createElement(s)}function Q(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function be(s){return document.createTextNode(s)}function q(){return be(" ")}function Bt(){return be("")}function B(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function Xn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function r(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function mi(s){return Array.from(s.childNodes)}function De(s,e){e=""+e,s.data!==e&&(s.data=e)}function ft(s,e){s.value=e==null?"":e}function P(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function K(s,e,t){s.classList.toggle(e,!!t)}let Et;function St(s){Et=s}function cn(){if(!Et)throw new Error("Function called outside component initialization");return Et}function Vn(s){cn().$$.on_mount.push(s)}function wi(s){cn().$$.after_update.push(s)}function ki(s){cn().$$.on_destroy.push(s)}const ht=[],pt=[];let dt=[];const Qn=[],_i=Promise.resolve();let un=!1;function bi(){un||(un=!0,_i.then(Kn))}function fn(s){dt.push(s)}const hn=new Set;let gt=0;function Kn(){if(gt!==0)return;const s=Et;do{try{for(;gt<ht.length;){const e=ht[gt];gt++,St(e),yi(e.$$)}}catch(e){throw ht.length=0,gt=0,e}for(St(null),ht.length=0,gt=0;pt.length;)pt.pop()();for(let e=0;e<dt.length;e+=1){const t=dt[e];hn.has(t)||(hn.add(t),t())}dt.length=0}while(ht.length);for(;Qn.length;)Qn.pop()();un=!1,hn.clear(),St(s)}function yi(s){if(s.fragment!==null){s.update(),ge(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(fn)}}function Ti(s){const e=[],t=[];dt.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),dt=e}const Ut=new Set;let nt;function pn(){nt={r:0,c:[],p:nt}}function dn(){nt.r||ge(nt.c),nt=nt.p}function Ne(s,e){s&&s.i&&(Ut.delete(s),s.i(e))}function Ve(s,e,t,n){if(s&&s.o){if(Ut.has(s))return;Ut.add(s),nt.c.push(()=>{Ut.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function mt(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function Jn(s,e){s.d(1),e.delete(s.key)}function $n(s,e,t,n,i,o,l,a,c,u,h,p){let g=s.length,d=o.length,w=g;const S={};for(;w--;)S[s[w].key]=w;const z=[],M=new Map,y=new Map,_=[];for(w=d;w--;){const A=p(i,o,w),C=t(A);let R=l.get(C);R?_.push(()=>R.p(A,e)):(R=u(C,A),R.c()),M.set(C,z[w]=R),C in S&&y.set(C,Math.abs(w-S[C]))}const k=new Set,v=new Set;function b(A){Ne(A,1),A.m(a,h),l.set(A.key,A),h=A.first,d--}for(;g&&d;){const A=z[d-1],C=s[g-1],R=A.key,F=C.key;A===C?(h=A.first,g--,d--):M.has(F)?!l.has(R)||k.has(R)?b(A):v.has(F)?g--:y.get(R)>y.get(F)?(v.add(R),b(A)):(k.add(F),g--):(c(C,l),g--)}for(;g--;){const A=s[g];M.has(A.key)||c(A,l)}for(;d;)b(z[d-1]);return ge(_),z}function gn(s){s&&s.c()}function jt(s,e,t){const{fragment:n,after_update:i}=s.$$;n&&n.m(e,t),fn(()=>{const o=s.$$.on_mount.map(oe).filter(Tt);s.$$.on_destroy?s.$$.on_destroy.push(...o):ge(o),s.$$.on_mount=[]}),i.forEach(fn)}function Wt(s,e){const t=s.$$;t.fragment!==null&&(Ti(t.after_update),ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function vi(s,e){s.$$.dirty[0]===-1&&(ht.push(s),bi(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function mn(s,e,t,n,i,o,l=null,a=[-1]){const c=Et;St(s);const u=s.$$={fragment:null,ctx:[],props:o,update:H,not_equal:i,bound:Ht(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Ht(),dirty:a,skip_bound:!1,root:e.target||c.$$.root};l&&l(u.root);let h=!1;if(u.ctx=t?t(s,e.props||{},(p,g,...d)=>{const w=d.length?d[0]:g;return u.ctx&&i(u.ctx[p],u.ctx[p]=w)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](w),h&&vi(s,p)),g}):[],u.update(),h=!0,ge(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=mi(e.target);u.fragment&&u.fragment.l(p),p.forEach(j)}else u.fragment&&u.fragment.c();e.intro&&Ne(s.$$.fragment),jt(s,e.target,e.anchor),Kn()}St(c)}class wn{constructor(){ie(this,"$$");ie(this,"$$set")}$destroy(){Wt(this,1),this.$destroy=H}$on(e,t){if(!Tt(t))return H;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!vt(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ei="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ei);const wt=[];function Si(s,e=H){let t;const n=new Set;function i(a){if(at(s,a)&&(s=a,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 o(a){i(a(s))}function l(a,c=H){const u=[a,c];return n.add(u),n.size===1&&(t=e(i,o)||H),a(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:i,update:o,subscribe:l}}function es(s){return Object.prototype.toString.call(s)==="[object Date]"}function kn(s,e,t,n){if(typeof t=="number"||es(t)){const i=n-t,o=(t-e)/(s.dt||1/60),l=s.opts.stiffness*i,a=s.opts.damping*o,c=(l-a)*s.inv_mass,u=(o+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(i)<s.opts.precision?n:(s.settled=!1,es(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((i,o)=>kn(s,e[o],t[o],n[o]));if(typeof t=="object"){const i={};for(const o in t)i[o]=kn(s,e[o],t[o],n[o]);return i}else throw new Error(`Cannot spring ${typeof t} values`)}}function Ai(s,e={}){const t=Si(s),{stiffness:n=.15,damping:i=.8,precision:o=.01}=e;let l,a,c,u=s,h=s,p=1,g=0,d=!1;function w(z,M={}){h=z;const y=c={};return s==null||M.hard||S.stiffness>=1&&S.damping>=1?(d=!0,l=qn(),u=z,t.set(s=h),Promise.resolve()):(M.soft&&(g=1/((M.soft===!0?.5:+M.soft)*60),p=0),a||(l=qn(),d=!1,a=di(_=>{if(d)return d=!1,a=null,!1;p=Math.min(p+g,1);const k={inv_mass:p,opts:S,settled:!0,dt:(_-l)*60/1e3},v=kn(k,u,s,h);return l=_,u=s,t.set(s=v),k.settled&&(a=null),!k.settled})),new Promise(_=>{a.promise.then(()=>{y===c&&_()})}))}const S={set:w,update:(z,M)=>w(z(h,s),M),subscribe:t.subscribe,stiffness:n,damping:i,precision:o};return S}function xi(s,e){return Le(this,null,function*(){const t=s.getReader();let n;for(;!(n=yield t.read()).done;)e(n.value)})}function Ri(s){let e,t,n,i=!1;return function(l){e===void 0?(e=l,t=0,n=-1):e=zi(e,l);const a=e.length;let c=0;for(;t<a;){i&&(e[t]===10&&(c=++t),i=!1);let u=-1;for(;t<a&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:i=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===a?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Ii(s,e,t){let n=ts();const i=new TextDecoder;return function(l,a){if(l.length===0)t==null||t(n),n=ts();else if(a>0){const c=i.decode(l.subarray(0,a)),u=a+(l[a+1]===32?2:1),h=i.decode(l.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
2
+ `+h:h;break;case"event":n.event=h;break;case"id":s(n.id=h);break;case"retry":const p=parseInt(h,10);isNaN(p)||e(n.retry=p);break}}}}function zi(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function ts(){return{data:"",event:"",id:"",retry:void 0}}var Ci=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(s);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(s,n[i])&&(t[n[i]]=s[n[i]]);return t};const _n="text/event-stream",Li=1e3,ns="last-event-id";function Mi(s,e){var{signal:t,headers:n,onopen:i,onmessage:o,onclose:l,onerror:a,openWhenHidden:c,fetch:u}=e,h=Ci(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,g)=>{const d=Object.assign({},n);d.accept||(d.accept=_n);let w;function S(){w.abort(),document.hidden||v()}c||document.addEventListener("visibilitychange",S);let z=Li,M=0;function y(){document.removeEventListener("visibilitychange",S),window.clearTimeout(M),w.abort()}t==null||t.addEventListener("abort",()=>{y(),p()});const _=u!=null?u:window.fetch,k=i!=null?i:Oi;function v(){return Le(this,null,function*(){var b;w=new AbortController;try{const A=yield _(s,Object.assign(Object.assign({},h),{headers:d,signal:w.signal}));yield k(A),yield xi(A.body,Ri(Ii(C=>{C?d[ns]=C:delete d[ns]},C=>{z=C},o))),l==null||l(),y(),p()}catch(A){if(!w.signal.aborted)try{const C=(b=a==null?void 0:a(A))!==null&&b!==void 0?b:z;window.clearTimeout(M),M=window.setTimeout(v,C)}catch(C){y(),g(C)}}})}v()})}function Oi(s){const e=s.headers.get("content-type");if(!(e!=null&&e.startsWith(_n)))throw new Error(`Expected content-type to be ${_n}, Actual: ${e}`)}function bn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let st=bn();function ss(s){st=s}const is=/[&<>"']/,Di=new RegExp(is.source,"g"),os=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ni=new RegExp(os.source,"g"),Pi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ls=s=>Pi[s];function Me(s,e){if(e){if(is.test(s))return s.replace(Di,ls)}else if(os.test(s))return s.replace(Ni,ls);return s}const Fi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Hi(s){return s.replace(Fi,(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 Bi=/(^|[^\[])\^/g;function ee(s,e){let t=typeof s=="string"?s:s.source;e=e||"";const n={replace:(i,o)=>{let l=typeof o=="string"?o:o.source;return l=l.replace(Bi,"$1"),t=t.replace(i,l),n},getRegex:()=>new RegExp(t,e)};return n}function rs(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch(e){return null}return s}const At={exec:()=>null};function as(s,e){const t=s.replace(/\|/g,(o,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let i=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(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Gt(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n;){const o=s.charAt(n-i-1);if(o===e&&!t)i++;else if(o!==e&&t)i++;else break}return s.slice(0,n-i)}function Ui(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function cs(s,e,t,n){const i=e.href,o=e.title?Me(e.title):null,l=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:t,href:i,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:o,text:Me(l)}}function ji(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
3
3
  `).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[l]=o;return l.length>=n.length?i.slice(n.length):i}).join(`
4
- `)}class Pt{constructor(e){ne(this,"options");ne(this,"rules");ne(this,"lexer");this.options=e||Je}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:Nt(n,`
5
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=Pi(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=Nt(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.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=Nt(t[0].replace(/^ *>[ \t]?/gm,""),`
6
- `),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(n);return this.lexer.state.top=i,{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 i=n.length>1,o={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const l=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",c="",u=!1;for(;e;){let p=!1;if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let h=t[2].split(`
4
+ `)}class qt{constructor(e){ie(this,"options");ie(this,"rules");ie(this,"lexer");this.options=e||st}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:Gt(n,`
5
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=ji(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=Gt(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.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=Gt(t[0].replace(/^ *>[ \t]?/gm,""),`
6
+ `),i=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(n);return this.lexer.state.top=i,{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 i=n.length>1,o={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const l=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",c="",u=!1;for(;e;){let h=!1;if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let p=t[2].split(`
7
7
  `,1)[0].replace(/^\t+/,M=>" ".repeat(3*M.length)),g=e.split(`
8
- `,1)[0],d=0;this.options.pedantic?(d=2,c=h.trimStart()):(d=t[2].search(/[^ ]/),d=d>4?1:d,c=h.slice(d),d+=t[1].length);let w=!1;if(!h&&/^ *$/.test(g)&&(a+=g+`
9
- `,e=e.substring(g.length+1),p=!0),!p){const M=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),y=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),_=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){const S=e.split(`
10
- `,1)[0];if(g=S,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),_.test(g)||k.test(g)||M.test(g)||y.test(e))break;if(g.search(/[^ ]/)>=d||!g.trim())c+=`
11
- `+g.slice(d);else{if(w||h.search(/[^ ]/)>=4||_.test(h)||k.test(h)||y.test(h))break;c+=`
12
- `+g}!w&&!g.trim()&&(w=!0),a+=S+`
13
- `,e=e.substring(S.length+1),h=g.slice(d)}}o.loose||(u?o.loose=!0:/\n *\n *$/.test(a)&&(u=!0));let E=null,z;this.options.gfm&&(E=/^\[[ xX]\] /.exec(c),E&&(z=E[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:a,task:!!E,checked:z,loose:!1,text:c,tokens:[]}),o.raw+=a}o.items[o.items.length-1].raw=a.trimEnd(),o.items[o.items.length-1].text=c.trimEnd(),o.raw=o.raw.trimEnd();for(let p=0;p<o.items.length;p++)if(this.lexer.state.top=!1,o.items[p].tokens=this.lexer.blockTokens(o.items[p].text,[]),!o.loose){const h=o.items[p].tokens.filter(d=>d.type==="space"),g=h.length>0&&h.some(d=>/\n.*\n/.test(d.raw));o.loose=g}if(o.loose)for(let p=0;p<o.items.length;p++)o.items[p].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," "),i=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:i,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=ns(t[1]),i=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===i.length){for(const a of i)/^ *-+: *$/.test(a)?l.align.push("right"):/^ *:-+: *$/.test(a)?l.align.push("center"):/^ *:-+ *$/.test(a)?l.align.push("left"):l.align.push(null);for(const a of n)l.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of o)l.rows.push(ns(a,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:Re(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=Nt(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{const l=Ni(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 i=t[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),ss(t,{href:i&&i.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 i=(n[2]||n[1]).replace(/\s+/g," "),o=t[i.toLowerCase()];if(!o){const l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return ss(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const l=[...i[0]].length-1;let a,c,u=l,p=0;const h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+l);(i=h.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&l%3&&!((l+c)%3)){p+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+p);const g=[...i[0]][0].length,d=e.slice(0,l+i.index+g+c);if(Math.min(l,c)%2){const E=d.slice(1,-1);return{type:"em",raw:d,text:E,tokens:this.lexer.inlineTokens(E)}}const w=d.slice(2,-2);return{type:"strong",raw:d,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=Re(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,i;return t[2]==="@"?(n=Re(t[1]),i="mailto:"+n):(n=Re(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,o;if(t[2]==="@")i=Re(t[0]),o="mailto:"+i;else{let l;do l=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(l!==t[0]);i=Re(t[0]),t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=Re(t[0]),{type:"text",raw:t[0],text:n}}}}const Fi=/^(?: *(?:\n|$))+/,Hi=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Bi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_t=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ui=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,is=/(?:[*+-]|\d{1,9}[.)])/,os=$(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,is).getRegex(),dn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ji=/^[^\n]+/,gn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Wi=$(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",gn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gi=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,is).getRegex(),Ft="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",mn=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,qi=$("^ {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",mn).replace("tag",Ft).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ls=$(dn).replace("hr",_t).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",Ft).getRegex(),wn={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ls).getRegex(),code:Hi,def:Wi,fences:Bi,heading:Ui,hr:_t,html:qi,lheading:os,list:Gi,newline:Fi,paragraph:ls,table:kt,text:ji},rs=$("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_t).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",Ft).getRegex(),Yi={...wn,table:rs,paragraph:$(dn).replace("hr",_t).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rs).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",Ft).getRegex()},Zi={...wn,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mn).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:kt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(dn).replace("hr",_t).replace("heading",` *#{1,6} *[^
16
- ]`).replace("lheading",os).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},as=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Xi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cs=/^( {2,}|\\)\n(?!\s*$)/,Vi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bt="\\p{P}$+<=>`^|~",Qi=$(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,bt).getRegex(),Ki=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,Ji=$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,bt).getRegex(),$i=$("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,bt).getRegex(),eo=$("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,bt).getRegex(),to=$(/\\([punct])/,"gu").replace(/punct/g,bt).getRegex(),no=$(/^<(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(),so=$(mn).replace("(?:-->|$)","-->").getRegex(),io=$("^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",so).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ht=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oo=$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ht).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),us=$(/^!?\[(label)\]\[(ref)\]/).replace("label",Ht).replace("ref",gn).getRegex(),fs=$(/^!?\[(ref)\](?:\[\])?/).replace("ref",gn).getRegex(),lo=$("reflink|nolink(?!\\()","g").replace("reflink",us).replace("nolink",fs).getRegex(),kn={_backpedal:kt,anyPunctuation:to,autolink:no,blockSkip:Ki,br:cs,code:Xi,del:kt,emStrongLDelim:Ji,emStrongRDelimAst:$i,emStrongRDelimUnd:eo,escape:as,link:oo,nolink:fs,punctuation:Qi,reflink:us,reflinkSearch:lo,tag:io,text:Vi,url:kt},ro={...kn,link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",Ht).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ht).getRegex()},_n={...kn,escape:$(as).replace("])","~|])").getRegex(),url:$(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},ao={..._n,br:$(cs).replace("{2,}","*").getRegex(),text:$(_n.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bt={normal:wn,gfm:Yi,pedantic:Zi},yt={normal:kn,gfm:_n,breaks:ao,pedantic:ro};class Ne{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||Je,this.options.tokenizer=this.options.tokenizer||new Pt,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:Bt.normal,inline:yt.normal};this.options.pedantic?(t.block=Bt.pedantic,t.inline=yt.pedantic):this.options.gfm&&(t.block=Bt.gfm,this.options.breaks?t.inline=yt.breaks:t.inline=yt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Bt,inline:yt}}static lex(e,t){return new Ne(t).lex(e)}static lexInline(e,t){return new Ne(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
8
+ `,1)[0],d=0;this.options.pedantic?(d=2,c=p.trimStart()):(d=t[2].search(/[^ ]/),d=d>4?1:d,c=p.slice(d),d+=t[1].length);let w=!1;if(!p&&/^ *$/.test(g)&&(a+=g+`
9
+ `,e=e.substring(g.length+1),h=!0),!h){const M=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),y=new RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),_=new RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){const v=e.split(`
10
+ `,1)[0];if(g=v,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),_.test(g)||k.test(g)||M.test(g)||y.test(e))break;if(g.search(/[^ ]/)>=d||!g.trim())c+=`
11
+ `+g.slice(d);else{if(w||p.search(/[^ ]/)>=4||_.test(p)||k.test(p)||y.test(p))break;c+=`
12
+ `+g}!w&&!g.trim()&&(w=!0),a+=v+`
13
+ `,e=e.substring(v.length+1),p=g.slice(d)}}o.loose||(u?o.loose=!0:/\n *\n *$/.test(a)&&(u=!0));let S=null,z;this.options.gfm&&(S=/^\[[ xX]\] /.exec(c),S&&(z=S[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:a,task:!!S,checked:z,loose:!1,text:c,tokens:[]}),o.raw+=a}o.items[o.items.length-1].raw=a.trimEnd(),o.items[o.items.length-1].text=c.trimEnd(),o.raw=o.raw.trimEnd();for(let h=0;h<o.items.length;h++)if(this.lexer.state.top=!1,o.items[h].tokens=this.lexer.blockTokens(o.items[h].text,[]),!o.loose){const p=o.items[h].tokens.filter(d=>d.type==="space"),g=p.length>0&&p.some(d=>/\n.*\n/.test(d.raw));o.loose=g}if(o.loose)for(let h=0;h<o.items.length;h++)o.items[h].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," "),i=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:i,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=as(t[1]),i=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===i.length){for(const a of i)/^ *-+: *$/.test(a)?l.align.push("right"):/^ *:-+: *$/.test(a)?l.align.push("center"):/^ *:-+ *$/.test(a)?l.align.push("left"):l.align.push(null);for(const a of n)l.header.push({text:a,tokens:this.lexer.inline(a)});for(const a of o)l.rows.push(as(a,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:Me(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=Gt(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{const l=Ui(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 i=t[2],o="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],o=l[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),cs(t,{href:i&&i.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 i=(n[2]||n[1]).replace(/\s+/g," "),o=t[i.toLowerCase()];if(!o){const l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return cs(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const l=[...i[0]].length-1;let a,c,u=l,h=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+l);(i=p.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&l%3&&!((l+c)%3)){h+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+h);const g=[...i[0]][0].length,d=e.slice(0,l+i.index+g+c);if(Math.min(l,c)%2){const S=d.slice(1,-1);return{type:"em",raw:d,text:S,tokens:this.lexer.inlineTokens(S)}}const w=d.slice(2,-2);return{type:"strong",raw:d,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=Me(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,i;return t[2]==="@"?(n=Me(t[1]),i="mailto:"+n):(n=Me(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,i;let t;if(t=this.rules.inline.url.exec(e)){let o,l;if(t[2]==="@")o=Me(t[0]),l="mailto:"+o;else{let a;do a=t[0],t[0]=(i=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?i:"";while(a!==t[0]);o=Me(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=Me(t[0]),{type:"text",raw:t[0],text:n}}}}const Wi=/^(?: *(?:\n|$))+/,Gi=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,qi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,us=/(?:[*+-]|\d{1,9}[.)])/,fs=ee(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,us).getRegex(),yn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Zi=/^[^\n]+/,Tn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Xi=ee(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Tn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vi=ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,us).getRegex(),Yt="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",vn=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Qi=ee("^ {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",vn).replace("tag",Yt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hs=ee(yn).replace("hr",xt).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",Yt).getRegex(),En={blockquote:ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",hs).getRegex(),code:Gi,def:Xi,fences:qi,heading:Yi,hr:xt,html:Qi,lheading:fs,list:Vi,newline:Wi,paragraph:hs,table:At,text:Zi},ps=ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xt).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",Yt).getRegex(),Ki=_e(ne({},En),{table:ps,paragraph:ee(yn).replace("hr",xt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ps).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",Yt).getRegex()}),Ji=_e(ne({},En),{html:ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vn).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:At,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ee(yn).replace("hr",xt).replace("heading",` *#{1,6} *[^
16
+ ]`).replace("lheading",fs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),ds=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$i=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gs=/^( {2,}|\\)\n(?!\s*$)/,eo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Rt="\\p{P}$+<=>`^|~",to=ee(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Rt).getRegex(),no=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,so=ee(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Rt).getRegex(),io=ee("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Rt).getRegex(),oo=ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Rt).getRegex(),lo=ee(/\\([punct])/,"gu").replace(/punct/g,Rt).getRegex(),ro=ee(/^<(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(),ao=ee(vn).replace("(?:-->|$)","-->").getRegex(),co=ee("^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",ao).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,uo=ee(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Zt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ms=ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Zt).replace("ref",Tn).getRegex(),ws=ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tn).getRegex(),fo=ee("reflink|nolink(?!\\()","g").replace("reflink",ms).replace("nolink",ws).getRegex(),Sn={_backpedal:At,anyPunctuation:lo,autolink:ro,blockSkip:no,br:gs,code:$i,del:At,emStrongLDelim:so,emStrongRDelimAst:io,emStrongRDelimUnd:oo,escape:ds,link:uo,nolink:ws,punctuation:to,reflink:ms,reflinkSearch:fo,tag:co,text:eo,url:At},ho=_e(ne({},Sn),{link:ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Zt).getRegex(),reflink:ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zt).getRegex()}),An=_e(ne({},Sn),{escape:ee(ds).replace("])","~|])").getRegex(),url:ee(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),po=_e(ne({},An),{br:ee(gs).replace("{2,}","*").getRegex(),text:ee(An.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Xt={normal:En,gfm:Ki,pedantic:Ji},It={normal:Sn,gfm:An,breaks:po,pedantic:ho};class Be{constructor(e){ie(this,"tokens");ie(this,"options");ie(this,"state");ie(this,"tokenizer");ie(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||st,this.options.tokenizer=this.options.tokenizer||new qt,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:Xt.normal,inline:It.normal};this.options.pedantic?(t.block=Xt.pedantic,t.inline=It.pedantic):this.options.gfm&&(t.block=Xt.gfm,this.options.breaks?t.inline=It.breaks:t.inline=It.gfm),this.tokenizer.rules=t}static get rules(){return{block:Xt,inline:It}}static lex(e,t){return new Be(t).lex(e)}static lexInline(e,t){return new Be(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
17
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,(a,c,u)=>c+" ".repeat(u.length));let n,i,o,l;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.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
18
  `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
19
19
  `+n.raw,i.text+=`
20
20
  `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.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),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
21
21
  `+n.raw,i.text+=`
22
- `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.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 a=1/0;const c=e.slice(1);let u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},c),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){i=t[t.length-1],l&&i.type==="paragraph"?(i.raw+=`
22
+ `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.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 a=1/0;const c=e.slice(1);let u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(o))){i=t[t.length-1],l&&i.type==="paragraph"?(i.raw+=`
23
23
  `+n.raw,i.text+=`
24
24
  `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.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),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
25
25
  `+n.raw,i.text+=`
26
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,o,l=e,a,c,u;if(this.tokens.links){const p=Object.keys(this.tokens.links);if(p.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)p.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,a.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(p=>(n=p.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),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.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),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.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 p=1/0;const h=e.slice(1);let g;this.options.extensions.startInline.forEach(d=>{g=d.call({lexer:this},h),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(o=e.substring(0,p+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}}class Ut{constructor(e){ne(this,"options");this.options=e||Je}code(e,t,n){var o;const i=(o=(t||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
27
- `,i?'<pre><code class="language-'+Re(i)+'">'+(n?e:Re(e,!0))+`</code></pre>
28
- `:"<pre><code>"+(n?e:Re(e,!0))+`</code></pre>
26
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,o,l=e,a,c,u;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)h.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,a.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(h=>(n=h.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),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.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),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.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 h=1/0;const p=e.slice(1);let g;this.options.extensions.startInline.forEach(d=>{g=d.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(o=e.substring(0,h+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class Vt{constructor(e){ie(this,"options");this.options=e||st}code(e,t,n){var o;const i=(o=(t||"").match(/^\S*/))==null?void 0:o[0];return e=e.replace(/\n$/,"")+`
27
+ `,i?'<pre><code class="language-'+Me(i)+'">'+(n?e:Me(e,!0))+`</code></pre>
28
+ `:"<pre><code>"+(n?e:Me(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}>
@@ -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 i=ts(e);if(i===null)return n;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const i=ts(e);if(i===null)return n;e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class bn{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 Pe{constructor(e){ne(this,"options");ne(this,"renderer");ne(this,"textRenderer");this.options=e||Je,this.options.renderer=this.options.renderer||new Ut,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new bn}static parse(e,t){return new Pe(t).parse(e)}static parseInline(e,t){return new Pe(t).parseInline(e)}parse(e,t=!0){let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const l=o,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){n+=a||"";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,Oi(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 a="",c="";for(let p=0;p<l.header.length;p++)c+=this.renderer.tablecell(this.parseInline(l.header[p].tokens),{header:!0,align:l.align[p]});a+=this.renderer.tablerow(c);let u="";for(let p=0;p<l.rows.length;p++){const h=l.rows[p];c="";for(let g=0;g<h.length;g++)c+=this.renderer.tablecell(this.parseInline(h[g].tokens),{header:!1,align:l.align[g]});u+=this.renderer.tablerow(c)}n+=this.renderer.table(a,u);continue}case"blockquote":{const l=o,a=this.parse(l.tokens);n+=this.renderer.blockquote(a);continue}case"list":{const l=o,a=l.ordered,c=l.start,u=l.loose;let p="";for(let h=0;h<l.items.length;h++){const g=l.items[h],d=g.checked,w=g.task;let E="";if(g.task){const z=this.renderer.checkbox(!!d);u?g.tokens.length>0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=z+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=z+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:z+" "}):E+=z+" "}E+=this.parse(g.tokens,u),p+=this.renderer.listitem(E,w,!!d)}n+=this.renderer.list(p,a,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,a=l.tokens?this.parseInline(l.tokens):l.text;for(;i+1<e.length&&e[i+1].type==="text";)l=e[++i],a+=`
45
- `+(l.tokens?this.parseInline(l.tokens):l.text);n+=t?this.renderer.paragraph(a):a;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 i=0;i<e.length;i++){const o=e[i];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 Tt{constructor(e){ne(this,"options");this.options=e||Je}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ne(Tt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class co{constructor(...e){oi(this,tt);ne(this,"defaults",hn());ne(this,"options",this.setOptions);ne(this,"parse",$t(this,tt,Nn).call(this,Ne.lex,Pe.parse));ne(this,"parseInline",$t(this,tt,Nn).call(this,Ne.lexInline,Pe.parseInline));ne(this,"Parser",Pe);ne(this,"Renderer",Ut);ne(this,"TextRenderer",bn);ne(this,"Lexer",Ne);ne(this,"Tokenizer",Pt);ne(this,"Hooks",Tt);this.use(...e)}walkTokens(e,t){var i,o;let n=[];for(const l of e)switch(n=n.concat(t.call(this,l)),l.type){case"table":{const a=l;for(const c of a.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of a.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const a=l;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=l;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{const u=a[c].flat(1/0);n=n.concat(this.walkTokens(u,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.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(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=l.apply(this,a)),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)}),i.extensions=t),n.renderer){const o=this.defaults.renderer||new Ut(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 a=l,c=n.renderer[a],u=o[a];o[a]=(...p)=>{let h=c.apply(o,p);return h===!1&&(h=u.apply(o,p)),h||""}}i.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new Pt(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 a=l,c=n.tokenizer[a],u=o[a];o[a]=(...p)=>{let h=c.apply(o,p);return h===!1&&(h=u.apply(o,p)),h}}i.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new Tt;for(const l in n.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(l==="options")continue;const a=l,c=n.hooks[a],u=o[a];Tt.passThroughHooks.has(l)?o[a]=p=>{if(this.defaults.async)return Promise.resolve(c.call(o,p)).then(g=>u.call(o,g));const h=c.call(o,p);return u.call(o,h)}:o[a]=(...p)=>{let h=c.apply(o,p);return h===!1&&(h=u.apply(o,p)),h}}i.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,l=n.walkTokens;i.walkTokens=function(a){let c=[];return c.push(l.call(this,a)),o&&(c=c.concat(o.call(this,a))),c}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ne.lex(e,t??this.defaults)}parser(e,t){return Pe.parse(e,t??this.defaults)}}tt=new WeakSet,Nn=function(e,t){return(n,i)=>{const o={...i},l={...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 a=$t(this,tt,li).call(this,!!l.silent,!!l.async);if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(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(a);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 a(c)}}},li=function(e,t){return n=>{if(n.message+=`
46
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Re(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}};const $e=new co;function J(s,e){return $e.parse(s,e)}J.options=J.setOptions=function(s){return $e.setOptions(s),J.defaults=$e.defaults,Kn(J.defaults),J},J.getDefaults=hn,J.defaults=Je,J.use=function(...s){return $e.use(...s),J.defaults=$e.defaults,Kn(J.defaults),J},J.walkTokens=function(s,e){return $e.walkTokens(s,e)},J.parseInline=$e.parseInline,J.Parser=Pe,J.parser=Pe.parse,J.Renderer=Ut,J.TextRenderer=bn,J.Lexer=Ne,J.lexer=Ne.lex,J.Tokenizer=Pt,J.Hooks=Tt,J.parse=J,J.options,J.setOptions,J.use,J.walkTokens,J.parseInline,Pe.parse,Ne.lex;/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */const{entries:ps,setPrototypeOf:hs,isFrozen:uo,getPrototypeOf:fo,getOwnPropertyDescriptor:po}=Object;let{freeze:ye,seal:Oe,create:ds}=Object,{apply:yn,construct:Tn}=typeof Reflect<"u"&&Reflect;ye||(ye=function(e){return e}),Oe||(Oe=function(e){return e}),yn||(yn=function(e,t,n){return e.apply(t,n)}),Tn||(Tn=function(e,t){return new e(...t)});const jt=Ie(Array.prototype.forEach),gs=Ie(Array.prototype.pop),vt=Ie(Array.prototype.push),Wt=Ie(String.prototype.toLowerCase),vn=Ie(String.prototype.toString),ms=Ie(String.prototype.match),Et=Ie(String.prototype.replace),ho=Ie(String.prototype.indexOf),go=Ie(String.prototype.trim),De=Ie(Object.prototype.hasOwnProperty),Te=Ie(RegExp.prototype.test),St=mo(TypeError);function Ie(s){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return yn(s,e,n)}}function mo(s){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tn(s,t)}}function q(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wt;hs&&hs(s,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=t(i);o!==i&&(uo(e)||(e[n]=o),i=o)}s[i]=!0}return s}function wo(s){for(let e=0;e<s.length;e++)De(s,e)||(s[e]=null);return s}function et(s){const e=ds(null);for(const[t,n]of ps(s))De(s,t)&&(Array.isArray(n)?e[t]=wo(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=et(n):e[t]=n);return e}function At(s,e){for(;s!==null;){const n=po(s,e);if(n){if(n.get)return Ie(n.get);if(typeof n.value=="function")return Ie(n.value)}s=fo(s)}function t(){return null}return t}const ws=ye(["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"]),En=ye(["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"]),Sn=ye(["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"]),ko=ye(["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"]),An=ye(["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"]),_o=ye(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ks=ye(["#text"]),_s=ye(["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"]),xn=ye(["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"]),bs=ye(["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"]),Gt=ye(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bo=Oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yo=Oe(/<%[\w\W]*|[\w\W]*%>/gm),To=Oe(/\$\{[\w\W]*}/gm),vo=Oe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Eo=Oe(/^aria-[\-\w]+$/),ys=Oe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),So=Oe(/^(?:\w+script|data):/i),Ao=Oe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ts=Oe(/^html$/i),xo=Oe(/^[a-z][.\w]*(-[.\w]+)+$/i);var vs=Object.freeze({__proto__:null,ARIA_ATTR:Eo,ATTR_WHITESPACE:Ao,CUSTOM_ELEMENT:xo,DATA_ATTR:vo,DOCTYPE_NAME:Ts,ERB_EXPR:yo,IS_ALLOWED_URI:ys,IS_SCRIPT_OR_DATA:So,MUSTACHE_EXPR:bo,TMPLIT_EXPR:To});const xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ro=function(){return typeof window>"u"?null:window},Io=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Es=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ss(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ro();const e=D=>Ss(D);if(e.version="3.2.3",e.removed=[],!s||!s.document||s.document.nodeType!==xt.document)return e.isSupported=!1,e;let{document:t}=s;const n=t,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:a,Element:c,NodeFilter:u,NamedNodeMap:p=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:h,DOMParser:g,trustedTypes:d}=s,w=c.prototype,E=At(w,"cloneNode"),z=At(w,"remove"),M=At(w,"nextSibling"),y=At(w,"childNodes"),_=At(w,"parentNode");if(typeof l=="function"){const D=t.createElement("template");D.content&&D.content.ownerDocument&&(t=D.content.ownerDocument)}let k,S="";const{implementation:b,createNodeIterator:A,createDocumentFragment:C,getElementsByTagName:R}=t,{importNode:P}=n;let I=Es();e.isSupported=typeof ps=="function"&&typeof _=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:X,TMPLIT_EXPR:Y,DATA_ATTR:ae,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:ue}=vs;let{IS_ALLOWED_URI:Fe}=vs,ie=null;const Ge=q({},[...ws,...En,...Sn,...An,...ks]);let se=null;const ke=q({},[..._s,...xn,...bs,...Gt]);let ee=Object.seal(ds(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}})),Se=null,_e=null,qe=!0,O=!0,te=!1,F=!0,V=!1,ze=!0,Ce=!1,Xe=!1,nt=!1,Ve=!1,pt=!1,ht=!1,Yt=!0,Zt=!1;const Cn="user-content-";let Rt=!0,st=!1,T={},j=null;const oe=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 pe=null;const He=q({},["audio","video","img","source","image","track"]);let Qe=null;const Be=q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xt="http://www.w3.org/1998/Math/MathML",Vt="http://www.w3.org/2000/svg",Ye="http://www.w3.org/1999/xhtml";let dt=Ye,Ln=!1,Mn=null;const nl=q({},[Xt,Vt,Ye],vn);let Qt=q({},["mi","mo","mn","ms","mtext"]),Kt=q({},["annotation-xml"]);const sl=q({},["title","style","font","a","script"]);let It=null;const il=["application/xhtml+xml","text/html"],ol="text/html";let de=null,gt=null;const ll=t.createElement("form"),Ys=function(f){return f instanceof RegExp||f instanceof Function},On=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(gt&&gt===f)){if((!f||typeof f!="object")&&(f={}),f=et(f),It=il.indexOf(f.PARSER_MEDIA_TYPE)===-1?ol:f.PARSER_MEDIA_TYPE,de=It==="application/xhtml+xml"?vn:Wt,ie=De(f,"ALLOWED_TAGS")?q({},f.ALLOWED_TAGS,de):Ge,se=De(f,"ALLOWED_ATTR")?q({},f.ALLOWED_ATTR,de):ke,Mn=De(f,"ALLOWED_NAMESPACES")?q({},f.ALLOWED_NAMESPACES,vn):nl,Qe=De(f,"ADD_URI_SAFE_ATTR")?q(et(Be),f.ADD_URI_SAFE_ATTR,de):Be,pe=De(f,"ADD_DATA_URI_TAGS")?q(et(He),f.ADD_DATA_URI_TAGS,de):He,j=De(f,"FORBID_CONTENTS")?q({},f.FORBID_CONTENTS,de):oe,Se=De(f,"FORBID_TAGS")?q({},f.FORBID_TAGS,de):{},_e=De(f,"FORBID_ATTR")?q({},f.FORBID_ATTR,de):{},T=De(f,"USE_PROFILES")?f.USE_PROFILES:!1,qe=f.ALLOW_ARIA_ATTR!==!1,O=f.ALLOW_DATA_ATTR!==!1,te=f.ALLOW_UNKNOWN_PROTOCOLS||!1,F=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=f.SAFE_FOR_TEMPLATES||!1,ze=f.SAFE_FOR_XML!==!1,Ce=f.WHOLE_DOCUMENT||!1,Ve=f.RETURN_DOM||!1,pt=f.RETURN_DOM_FRAGMENT||!1,ht=f.RETURN_TRUSTED_TYPE||!1,nt=f.FORCE_BODY||!1,Yt=f.SANITIZE_DOM!==!1,Zt=f.SANITIZE_NAMED_PROPS||!1,Rt=f.KEEP_CONTENT!==!1,st=f.IN_PLACE||!1,Fe=f.ALLOWED_URI_REGEXP||ys,dt=f.NAMESPACE||Ye,Qt=f.MATHML_TEXT_INTEGRATION_POINTS||Qt,Kt=f.HTML_INTEGRATION_POINTS||Kt,ee=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Ys(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Ys(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),V&&(O=!1),pt&&(Ve=!0),T&&(ie=q({},ks),se=[],T.html===!0&&(q(ie,ws),q(se,_s)),T.svg===!0&&(q(ie,En),q(se,xn),q(se,Gt)),T.svgFilters===!0&&(q(ie,Sn),q(se,xn),q(se,Gt)),T.mathMl===!0&&(q(ie,An),q(se,bs),q(se,Gt))),f.ADD_TAGS&&(ie===Ge&&(ie=et(ie)),q(ie,f.ADD_TAGS,de)),f.ADD_ATTR&&(se===ke&&(se=et(se)),q(se,f.ADD_ATTR,de)),f.ADD_URI_SAFE_ATTR&&q(Qe,f.ADD_URI_SAFE_ATTR,de),f.FORBID_CONTENTS&&(j===oe&&(j=et(j)),q(j,f.FORBID_CONTENTS,de)),Rt&&(ie["#text"]=!0),Ce&&q(ie,["html","head","body"]),ie.table&&(q(ie,["tbody"]),delete Se.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=f.TRUSTED_TYPES_POLICY,S=k.createHTML("")}else k===void 0&&(k=Io(d,i)),k!==null&&typeof S=="string"&&(S=k.createHTML(""));ye&&ye(f),gt=f}},Zs=q({},[...En,...Sn,...ko]),Xs=q({},[...An,..._o]),rl=function(f){let v=_(f);(!v||!v.tagName)&&(v={namespaceURI:dt,tagName:"template"});const L=Wt(f.tagName),le=Wt(v.tagName);return Mn[f.namespaceURI]?f.namespaceURI===Vt?v.namespaceURI===Ye?L==="svg":v.namespaceURI===Xt?L==="svg"&&(le==="annotation-xml"||Qt[le]):!!Zs[L]:f.namespaceURI===Xt?v.namespaceURI===Ye?L==="math":v.namespaceURI===Vt?L==="math"&&Kt[le]:!!Xs[L]:f.namespaceURI===Ye?v.namespaceURI===Vt&&!Kt[le]||v.namespaceURI===Xt&&!Qt[le]?!1:!Xs[L]&&(sl[L]||!Zs[L]):!!(It==="application/xhtml+xml"&&Mn[f.namespaceURI]):!1},Ue=function(f){vt(e.removed,{element:f});try{_(f).removeChild(f)}catch{z(f)}},Jt=function(f,v){try{vt(e.removed,{attribute:v.getAttributeNode(f),from:v})}catch{vt(e.removed,{attribute:null,from:v})}if(v.removeAttribute(f),f==="is")if(Ve||pt)try{Ue(v)}catch{}else try{v.setAttribute(f,"")}catch{}},Vs=function(f){let v=null,L=null;if(nt)f="<remove></remove>"+f;else{const ge=ms(f,/^[\r\n\t ]+/);L=ge&&ge[0]}It==="application/xhtml+xml"&&dt===Ye&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const le=k?k.createHTML(f):f;if(dt===Ye)try{v=new g().parseFromString(le,It)}catch{}if(!v||!v.documentElement){v=b.createDocument(dt,"template",null);try{v.documentElement.innerHTML=Ln?S:le}catch{}}const be=v.body||v.documentElement;return f&&L&&be.insertBefore(t.createTextNode(L),be.childNodes[0]||null),dt===Ye?R.call(v,Ce?"html":"body")[0]:Ce?v.documentElement:be},Qs=function(f){return A.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Dn=function(f){return f instanceof h&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof p)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Ks=function(f){return typeof a=="function"&&f instanceof a};function Ze(D,f,v){jt(D,L=>{L.call(e,f,v,gt)})}const Js=function(f){let v=null;if(Ze(I.beforeSanitizeElements,f,null),Dn(f))return Ue(f),!0;const L=de(f.nodeName);if(Ze(I.uponSanitizeElement,f,{tagName:L,allowedTags:ie}),f.hasChildNodes()&&!Ks(f.firstElementChild)&&Te(/<[/\w]/g,f.innerHTML)&&Te(/<[/\w]/g,f.textContent)||f.nodeType===xt.progressingInstruction||ze&&f.nodeType===xt.comment&&Te(/<[/\w]/g,f.data))return Ue(f),!0;if(!ie[L]||Se[L]){if(!Se[L]&&ei(L)&&(ee.tagNameCheck instanceof RegExp&&Te(ee.tagNameCheck,L)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(L)))return!1;if(Rt&&!j[L]){const le=_(f)||f.parentNode,be=y(f)||f.childNodes;if(be&&le){const ge=be.length;for(let Ae=ge-1;Ae>=0;--Ae){const je=E(be[Ae],!0);je.__removalCount=(f.__removalCount||0)+1,le.insertBefore(je,M(f))}}}return Ue(f),!0}return f instanceof c&&!rl(f)||(L==="noscript"||L==="noembed"||L==="noframes")&&Te(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ue(f),!0):(V&&f.nodeType===xt.text&&(v=f.textContent,jt([B,X,Y],le=>{v=Et(v,le," ")}),f.textContent!==v&&(vt(e.removed,{element:f.cloneNode()}),f.textContent=v)),Ze(I.afterSanitizeElements,f,null),!1)},$s=function(f,v,L){if(Yt&&(v==="id"||v==="name")&&(L in t||L in ll))return!1;if(!(O&&!_e[v]&&Te(ae,v))){if(!(qe&&Te(ce,v))){if(!se[v]||_e[v]){if(!(ei(f)&&(ee.tagNameCheck instanceof RegExp&&Te(ee.tagNameCheck,f)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(f))&&(ee.attributeNameCheck instanceof RegExp&&Te(ee.attributeNameCheck,v)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(v))||v==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Te(ee.tagNameCheck,L)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(L))))return!1}else if(!Qe[v]){if(!Te(Fe,Et(L,Ee,""))){if(!((v==="src"||v==="xlink:href"||v==="href")&&f!=="script"&&ho(L,"data:")===0&&pe[f])){if(!(te&&!Te(he,Et(L,Ee,"")))){if(L)return!1}}}}}}return!0},ei=function(f){return f!=="annotation-xml"&&ms(f,ue)},ti=function(f){Ze(I.beforeSanitizeAttributes,f,null);const{attributes:v}=f;if(!v||Dn(f))return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se,forceKeepAttr:void 0};let le=v.length;for(;le--;){const be=v[le],{name:ge,namespaceURI:Ae,value:je}=be,zt=de(ge);let ve=ge==="value"?je:go(je);if(L.attrName=zt,L.attrValue=ve,L.keepAttr=!0,L.forceKeepAttr=void 0,Ze(I.uponSanitizeAttribute,f,L),ve=L.attrValue,Zt&&(zt==="id"||zt==="name")&&(Jt(ge,f),ve=Cn+ve),ze&&Te(/((--!?|])>)|<\/(style|title)/i,ve)){Jt(ge,f);continue}if(L.forceKeepAttr||(Jt(ge,f),!L.keepAttr))continue;if(!F&&Te(/\/>/i,ve)){Jt(ge,f);continue}V&&jt([B,X,Y],si=>{ve=Et(ve,si," ")});const ni=de(f.nodeName);if($s(ni,zt,ve)){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Ae)switch(d.getAttributeType(ni,zt)){case"TrustedHTML":{ve=k.createHTML(ve);break}case"TrustedScriptURL":{ve=k.createScriptURL(ve);break}}try{Ae?f.setAttributeNS(Ae,ge,ve):f.setAttribute(ge,ve),Dn(f)?Ue(f):gs(e.removed)}catch{}}}Ze(I.afterSanitizeAttributes,f,null)},al=function D(f){let v=null;const L=Qs(f);for(Ze(I.beforeSanitizeShadowDOM,f,null);v=L.nextNode();)Ze(I.uponSanitizeShadowNode,v,null),Js(v),ti(v),v.content instanceof o&&D(v.content);Ze(I.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(D){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=null,L=null,le=null,be=null;if(Ln=!D,Ln&&(D="<!-->"),typeof D!="string"&&!Ks(D))if(typeof D.toString=="function"){if(D=D.toString(),typeof D!="string")throw St("dirty is not a string, aborting")}else throw St("toString is not a function");if(!e.isSupported)return D;if(Xe||On(f),e.removed=[],typeof D=="string"&&(st=!1),st){if(D.nodeName){const je=de(D.nodeName);if(!ie[je]||Se[je])throw St("root node is forbidden and cannot be sanitized in-place")}}else if(D instanceof a)v=Vs("<!---->"),L=v.ownerDocument.importNode(D,!0),L.nodeType===xt.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?v=L:v.appendChild(L);else{if(!Ve&&!V&&!Ce&&D.indexOf("<")===-1)return k&&ht?k.createHTML(D):D;if(v=Vs(D),!v)return Ve?null:ht?S:""}v&&nt&&Ue(v.firstChild);const ge=Qs(st?D:v);for(;le=ge.nextNode();)Js(le),ti(le),le.content instanceof o&&al(le.content);if(st)return D;if(Ve){if(pt)for(be=C.call(v.ownerDocument);v.firstChild;)be.appendChild(v.firstChild);else be=v;return(se.shadowroot||se.shadowrootmode)&&(be=P.call(n,be,!0)),be}let Ae=Ce?v.outerHTML:v.innerHTML;return Ce&&ie["!doctype"]&&v.ownerDocument&&v.ownerDocument.doctype&&v.ownerDocument.doctype.name&&Te(Ts,v.ownerDocument.doctype.name)&&(Ae="<!DOCTYPE "+v.ownerDocument.doctype.name+`>
47
- `+Ae),V&&jt([B,X,Y],je=>{Ae=Et(Ae,je," ")}),k&&ht?k.createHTML(Ae):Ae},e.setConfig=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};On(D),Xe=!0},e.clearConfig=function(){gt=null,Xe=!1},e.isValidAttribute=function(D,f,v){gt||On({});const L=de(D),le=de(f);return $s(L,le,v)},e.addHook=function(D,f){typeof f=="function"&&vt(I[D],f)},e.removeHook=function(D){return gs(I[D])},e.removeHooks=function(D){I[D]=[]},e.removeAllHooks=function(){I=Es()},e}var As=Ss();function xs(s,e,t){const n=s.slice();return n[24]=e[t],n}function Rs(s){let e,t=s[9].text+"",n;return{c(){e=x("div"),n=we(t),r(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(i,o){W(i,e,o),m(e,n)},p(i,o){o&512&&t!==(t=i[9].text+"")&&Le(n,t),o&512&&N(e,"left",i[9].x+"px"),o&512&&N(e,"top",i[9].y+"px"),o&8&&N(e,"z-index",i[3]+3)},d(i){i&&U(e)}}}function zo(s){let e=[],t=new Map,n,i,o=ut(s[0]);const l=c=>c[24].id;for(let c=0;c<o.length;c+=1){let u=xs(s,o,c),p=l(u);t.set(p,e[c]=Is(p,u))}let a=s[5]&&zs();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=G(),a&&a.c(),i=Lt()},m(c,u){for(let p=0;p<e.length;p+=1)e[p]&&e[p].m(c,u);W(c,n,u),a&&a.m(c,u),W(c,i,u)},p(c,u){u&8261&&(o=ut(c[0]),e=Zn(e,u,l,1,c,o,t,n.parentNode,Yn,Is,n,xs)),c[5]?a||(a=zs(),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},d(c){c&&(U(n),U(i));for(let u=0;u<e.length;u+=1)e[u].d(c);a&&a.d(c)}}}function Co(s){let e,t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话",n;return{c(){e=x("div"),n=we(t),r(e,"class","sy-session-empty svelte-1g6fj9a")},m(i,o){W(i,e,o),m(e,n)},p(i,o){o&48&&t!==(t=i[4]?"未找到相关会话":i[5]?"加载中...":"暂无历史会话")&&Le(n,t)},d(i){i&&U(e)}}}function Is(s,e){let t,n,i,o,l=e[24].title+"",a,c,u,p=Ls(e[24].timestamp)+"",h,g,d,w,E,z,M,y,_,k,S;function b(){return e[17](e[24])}function A(...C){return e[18](e[24],...C)}return{key:s,first:null,c(){t=x("div"),n=x("button"),i=x("div"),o=x("div"),a=we(l),c=G(),u=x("div"),h=we(p),g=G(),d=x("button"),w=Q("svg"),E=Q("path"),z=Q("path"),M=Q("path"),r(o,"class","sy-session-title svelte-1g6fj9a"),r(u,"class","sy-session-time svelte-1g6fj9a"),r(i,"class","sy-session-info svelte-1g6fj9a"),r(n,"class","sy-session-select svelte-1g6fj9a"),r(E,"d","M3 6h18"),r(z,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),r(M,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),r(w,"xmlns","http://www.w3.org/2000/svg"),r(w,"width","16"),r(w,"height","16"),r(w,"viewBox","0 0 24 24"),r(w,"fill","none"),r(w,"stroke","currentColor"),r(w,"stroke-width","2"),r(w,"stroke-linecap","round"),r(w,"stroke-linejoin","round"),r(d,"class","sy-session-delete svelte-1g6fj9a"),d.disabled=y=e[6]===e[24].id,r(d,"aria-label","删除会话"),r(t,"class","sy-session-item svelte-1g6fj9a"),r(t,"data-session-id",_=e[24].id),K(t,"deleting",e[24].deleting),this.first=t},m(C,R){W(C,t,R),m(t,n),m(n,i),m(i,o),m(o,a),m(i,c),m(i,u),m(u,h),m(t,g),m(t,d),m(d,w),m(w,E),m(w,z),m(w,M),k||(S=[H(n,"click",b),H(d,"click",A)],k=!0)},p(C,R){e=C,R&1&&l!==(l=e[24].title+"")&&Le(a,l),R&1&&p!==(p=Ls(e[24].timestamp)+"")&&Le(h,p),R&65&&y!==(y=e[6]===e[24].id)&&(d.disabled=y),R&1&&_!==(_=e[24].id)&&r(t,"data-session-id",_),R&1&&K(t,"deleting",e[24].deleting)},d(C){C&&U(t),k=!1,me(S)}}}function zs(s){let e;return{c(){e=x("div"),e.innerHTML='<span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span>',r(e,"class","sy-session-loading svelte-1g6fj9a")},m(t,n){W(t,e,n)},d(t){t&&U(e)}}}function Cs(s){let e,t,n,i,o,l,a,c,u;return{c(){e=x("div"),t=x("div"),t.textContent="确认删除此会话?",n=G(),i=x("div"),o=x("button"),o.textContent="取消",l=G(),a=x("button"),a.textContent="删除",r(t,"class","sy-session-confirm-content svelte-1g6fj9a"),r(o,"class","sy-session-confirm-cancel svelte-1g6fj9a"),r(a,"class","sy-session-confirm-delete svelte-1g6fj9a"),r(i,"class","sy-session-confirm-actions svelte-1g6fj9a"),r(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(p,h){W(p,e,h),m(e,t),m(e,n),m(e,i),m(i,o),m(i,l),m(i,a),c||(u=[H(o,"click",s[19]),H(a,"click",s[14])],c=!0)},p(p,h){h&256&&N(e,"left",p[8].x+"px"),h&256&&N(e,"top",p[8].y+"px"),h&8&&N(e,"z-index",p[3]+3)},d(p){p&&U(e),c=!1,me(u)}}}function Lo(s){let e,t,n,i,o,l,a,c,u,p,h,g,d,w,E,z,M,y,_,k=s[9]&&Rs(s);function S(R,P){return R[0].length===0?Co:zo}let b=S(s),A=b(s),C=s[7]&&Cs(s);return{c(){e=x("div"),t=x("div"),n=x("h2"),n.textContent="历史会话",i=G(),o=x("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(),a=x("div"),c=x("input"),u=G(),p=Q("svg"),h=Q("circle"),g=Q("line"),d=G(),k&&k.c(),w=G(),E=x("div"),A.c(),z=G(),C&&C.c(),M=Lt(),r(n,"class","svelte-1g6fj9a"),r(o,"class","sy-session-close svelte-1g6fj9a"),r(o,"aria-label","关闭历史会话"),r(t,"class","sy-session-header svelte-1g6fj9a"),r(c,"type","text"),r(c,"class","sy-session-search-input svelte-1g6fj9a"),r(c,"placeholder","搜索历史会话..."),r(h,"cx","11"),r(h,"cy","11"),r(h,"r","8"),r(g,"x1","21"),r(g,"y1","21"),r(g,"x2","16.65"),r(g,"y2","16.65"),r(p,"class","sy-session-search-icon svelte-1g6fj9a"),r(p,"xmlns","http://www.w3.org/2000/svg"),r(p,"width","16"),r(p,"height","16"),r(p,"viewBox","0 0 24 24"),r(p,"fill","none"),r(p,"stroke","currentColor"),r(p,"stroke-width","2"),r(p,"stroke-linecap","round"),r(p,"stroke-linejoin","round"),r(a,"class","sy-session-search svelte-1g6fj9a"),r(E,"class","sy-session-list svelte-1g6fj9a"),r(e,"class","sy-session-history svelte-1g6fj9a"),N(e,"z-index",s[3]+2)},m(R,P){W(R,e,P),m(e,t),m(t,n),m(t,i),m(t,o),m(e,l),m(e,a),m(a,c),ot(c,s[4]),m(a,u),m(a,p),m(p,h),m(p,g),m(e,d),k&&k.m(e,null),m(e,w),m(e,E),A.m(E,null),W(R,z,P),C&&C.m(R,P),W(R,M,P),y||(_=[H(o,"click",function(){en(s[1])&&s[1].apply(this,arguments)}),H(o,"mouseenter",s[15]),H(o,"mouseleave",s[12]),H(c,"input",s[16]),H(E,"scroll",s[10])],y=!0)},p(R,[P]){s=R,P&16&&c.value!==s[4]&&ot(c,s[4]),s[9]?k?k.p(s,P):(k=Rs(s),k.c(),k.m(e,w)):k&&(k.d(1),k=null),b===(b=S(s))&&A?A.p(s,P):(A.d(1),A=b(s),A&&(A.c(),A.m(E,null))),P&8&&N(e,"z-index",s[3]+2),s[7]?C?C.p(s,P):(C=Cs(s),C.c(),C.m(M.parentNode,M)):C&&(C.d(1),C=null)},i:Z,o:Z,d(R){R&&(U(e),U(z),U(M)),k&&k.d(),A.d(),C&&C.d(R),y=!1,me(_)}}}const Rn=10;function Ls(s){return new Date(s).toLocaleString()}function Mo(s,e,t){let{sessions:n=[]}=e,{onClose:i}=e,{onSelect:o}=e,{zIndex:l}=e,a=!1,c=!0,u=0,p="",h=null,g=null,d={x:0,y:0};async function w(){if(!(a||!c)){t(5,a=!0);try{const I=await fetch("/aiops/aigc/chat/record/session/list/query",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({start:u,length:Rn,keyword:p})});if(!I.ok)throw new Error("Failed to load sessions");const B=await I.json();if(B.code===0){const X=B.data.sessionList.map(Y=>({id:Y.session_id,title:Y.name,timestamp:new Date(Y.createDate).getTime()}));t(0,n=[...n,...X]),u+=Rn,c=X.length===Rn}}catch(I){console.error("Failed to load sessions:",I)}finally{t(5,a=!1)}}}function E(I){const B=I.target,{scrollTop:X,scrollHeight:Y,clientHeight:ae}=B;Y-X-ae<50&&w()}Wn(()=>{w()});let z=null;function M(I,B){const Y=I.currentTarget.getBoundingClientRect();t(9,z={text:B,x:Y.left+Y.width/2,y:Y.bottom+8})}function y(){t(9,z=null)}function _(I,B){const Y=I.currentTarget.getBoundingClientRect();t(8,d={x:Y.left-16,y:Y.top+Y.height/2}),t(7,g=B)}async function k(I){if(I&&!h)try{t(6,h=I),t(7,g=null);const B=document.querySelector(`[data-session-id="${I}"]`);B&&B.classList.add("deleting"),await new Promise(ae=>setTimeout(ae,300));const X=await fetch("/aiops/aigc/chat/record/session/delete",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:I})});if(!X.ok)throw new Error("Delete request failed");const Y=await X.json();if(Y.code===0&&Y.data.respCode===0)t(0,n=n.map(ae=>({...ae,deleting:ae.id===I}))),setTimeout(()=>{t(0,n=n.filter(ae=>!ae.deleting))},300);else throw new Error("Delete failed: "+Y.message)}catch(B){console.error("Failed to delete session:",B);const X=document.querySelector(`[data-session-id="${I}"]`);X&&X.classList.remove("deleting")}finally{t(6,h=null)}}function S(){g&&k(g)}const b=I=>M(I,"关闭历史会话");function A(){p=this.value,t(4,p)}const C=I=>o(I.id),R=(I,B)=>_(B,I.id),P=()=>t(7,g=null);return s.$$set=I=>{"sessions"in I&&t(0,n=I.sessions),"onClose"in I&&t(1,i=I.onClose),"onSelect"in I&&t(2,o=I.onSelect),"zIndex"in I&&t(3,l=I.zIndex)},s.$$.update=()=>{s.$$.dirty&16&&p!==void 0&&(t(0,n=[]),u=0,c=!0,w())},[n,i,o,l,p,a,h,g,d,z,E,M,y,_,S,b,A,C,R,P]}class Ms extends un{constructor(e){super(),cn(this,e,Mo,Lo,Ct,{sessions:0,onClose:1,onSelect:2,zIndex:3})}}function Os(s,e,t){const n=s.slice();return n[60]=e[t],n[61]=e,n[62]=t,n}function Ds(s,e,t){const n=s.slice();return n[63]=e[t],n[65]=t,n}function Oo(s){let e,t=[],n=new Map,i=ut(s[3]);const o=l=>l[60].id;for(let l=0;l<i.length;l+=1){let a=Os(s,i,l),c=o(a);n.set(c,t[l]=js(c,a))}return{c(){e=x("div");for(let l=0;l<t.length;l+=1)t[l].c();r(e,"class","sy-assistant-message-list svelte-46wzni")},m(l,a){W(l,e,a);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);s[46](e)},p(l,a){a[0]&267665145&&(i=ut(l[3]),t=Zn(t,a,o,1,l,i,n,e,Yn,js,null,Os))},i:Z,o:Z,d(l){l&&U(e);for(let a=0;a<t.length;a+=1)t[a].d();s[46](null)}}}function Do(s){let e,t;return e=new Ms({props:{sessions:s[16],onClose:s[29],onSelect:s[30],zIndex:s[0]}}),{c(){an(e.$$.fragment)},m(n,i){Ot(e,n,i),t=!0},p(n,i){const o={};i[0]&65536&&(o.sessions=n[16]),i[0]&1&&(o.zIndex=n[0]),e.$set(o)},i(n){t||(Me(e.$$.fragment,n),t=!0)},o(n){We(e.$$.fragment,n),t=!1},d(n){Dt(e,n)}}}function No(s){let e;return{c(){e=x("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>',r(e,"class","sy-assistant-avatar user svelte-46wzni")},m(t,n){W(t,e,n)},d(t){t&&U(e)}}}function Po(s){let e;return{c(){e=x("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>',r(e,"class","sy-assistant-avatar assistant svelte-46wzni")},m(t,n){W(t,e,n)},d(t){t&&U(e)}}}function Fo(s){let e,t=s[18](s[60].content)+"";return{c(){e=x("div"),r(e,"class","markdown-content svelte-46wzni")},m(n,i){W(n,e,i),e.innerHTML=t},p(n,i){i[0]&8&&t!==(t=n[18](n[60].content)+"")&&(e.innerHTML=t)},d(n){n&&U(e)}}}function Ho(s){let e;return{c(){e=x("span"),e.innerHTML='<span class="dot svelte-46wzni">.</span> <span class="dot svelte-46wzni">.</span> <span class="dot svelte-46wzni">.</span>',r(e,"class","sy-assistant-loading svelte-46wzni")},m(t,n){W(t,e,n)},p:Z,d(t){t&&U(e)}}}function Ns(s){let e,t=ut(s[60].attachments),n=[];for(let i=0;i<t.length;i+=1)n[i]=Hs(Ds(s,t,i));return{c(){e=x("div");for(let i=0;i<n.length;i+=1)n[i].c();r(e,"class","sy-assistant-attachments svelte-46wzni")},m(i,o){W(i,e,o);for(let l=0;l<n.length;l+=1)n[l]&&n[l].m(e,null)},p(i,o){if(o[0]&3145849){t=ut(i[60].attachments);let l;for(l=0;l<t.length;l+=1){const a=Ds(i,t,l);n[l]?n[l].p(a,o):(n[l]=Hs(a),n[l].c(),n[l].m(e,null))}for(;l<n.length;l+=1)n[l].d(1);n.length=t.length}},d(i){i&&U(e),ui(n,i)}}}function Ps(s){let e,t,n;function i(...o){return s[33](s[63],...o)}return{c(){e=x("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-46wzni"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',r(e,"class","sy-assistant-attachment-toggle svelte-46wzni"),r(e,"aria-label","查看详情")},m(o,l){W(o,e,l),t||(n=[H(e,"mouseenter",i),H(e,"mouseleave",s[21])],t=!0)},p(o,l){s=o},d(o){o&&U(e),t=!1,me(n)}}}function Fs(s){let e,t=s[4].replace(/\n/g,"<br>")+"",n,i;return{c(){e=x("div"),r(e,"class","sy-assistant-tooltip svelte-46wzni"),r(e,"role","tooltip"),N(e,"left",s[5].x+"px"),N(e,"top",s[5].y+"px"),N(e,"z-index",s[0]+3),K(e,"align-right",s[5].alignRight)},m(o,l){W(o,e,l),e.innerHTML=t,n||(i=[H(e,"mouseenter",s[35]),H(e,"mouseleave",s[36])],n=!0)},p(o,l){l[0]&16&&t!==(t=o[4].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),l[0]&32&&N(e,"left",o[5].x+"px"),l[0]&32&&N(e,"top",o[5].y+"px"),l[0]&1&&N(e,"z-index",o[0]+3),l[0]&32&&K(e,"align-right",o[5].alignRight)},d(o){o&&U(e),n=!1,me(i)}}}function Hs(s){let e,t,n,i,o,l,a,c,u,p=qt(s[63].content_title).name+"",h,g,d,w=qt(s[63].content_title).ext+"",E,z,M,y,_,k,S,b,A,C,R=s[63].tips&&Ps(s);function P(){return s[34](s[63])}let I=s[4]&&Fs(s);return{c(){e=x("div"),t=x("div"),n=x("div"),i=Q("svg"),o=Q("path"),l=Q("polyline"),a=G(),c=x("div"),u=x("span"),h=we(p),g=G(),d=x("span"),E=we(w),M=G(),y=x("div"),R&&R.c(),_=G(),k=x("button"),k.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-46wzni"><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>',S=G(),I&&I.c(),b=G(),r(o,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),r(l,"points","13 2 13 9 20 9"),r(i,"xmlns","http://www.w3.org/2000/svg"),r(i,"width","16"),r(i,"height","16"),r(i,"viewBox","0 0 24 24"),r(i,"fill","none"),r(i,"stroke","currentColor"),r(i,"stroke-width","2"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(u,"class","sy-assistant-filename svelte-46wzni"),r(d,"class","sy-assistant-attachment-ext svelte-46wzni"),r(c,"class","sy-assistant-attachment-name svelte-46wzni"),r(c,"title",z=s[63].content_title),r(n,"class","sy-assistant-attachment-title svelte-46wzni"),r(k,"class","sy-assistant-attachment-toggle svelte-46wzni"),r(k,"aria-label","下载文件"),r(y,"class","sy-assistant-attachment-actions svelte-46wzni"),r(t,"class","sy-assistant-attachment-header svelte-46wzni"),r(e,"class","sy-assistant-attachment svelte-46wzni")},m(B,X){W(B,e,X),m(e,t),m(t,n),m(n,i),m(i,o),m(i,l),m(n,a),m(n,c),m(c,u),m(u,h),m(c,g),m(c,d),m(d,E),m(t,M),m(t,y),R&&R.m(y,null),m(y,_),m(y,k),m(e,S),I&&I.m(e,null),m(e,b),A||(C=H(k,"click",P),A=!0)},p(B,X){s=B,X[0]&8&&p!==(p=qt(s[63].content_title).name+"")&&Le(h,p),X[0]&8&&w!==(w=qt(s[63].content_title).ext+"")&&Le(E,w),X[0]&8&&z!==(z=s[63].content_title)&&r(c,"title",z),s[63].tips?R?R.p(s,X):(R=Ps(s),R.c(),R.m(y,_)):R&&(R.d(1),R=null),s[4]?I?I.p(s,X):(I=Fs(s),I.c(),I.m(e,b)):I&&(I.d(1),I=null)},d(B){B&&U(e),R&&R.d(),I&&I.d(),A=!1,C()}}}function Bs(s){let e,t,n,i,o,l,a,c,u,p,h;function g(b,A){return b[9][b[60].id]?Uo:Bo}let d=g(s),w=d(s);function E(){return s[37](s[60])}function z(...b){return s[38](s[60],...b)}function M(){return s[39](s[60])}function y(...b){return s[40](s[60],...b)}function _(...b){return s[41](s[60],...b)}function k(...b){return s[42](s[60],...b)}let S=s[12]&&s[10][s[60].id]==="dislike"&&Us(s);return{c(){e=x("div"),t=x("button"),w.c(),i=G(),o=x("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(),a=x("button"),a.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(),S&&S.c(),u=Lt(),r(t,"class","sy-assistant-action-button svelte-46wzni"),r(t,"aria-label",n=s[9][s[60].id]?"已复制":"复制内容"),K(t,"copied",s[9][s[60].id]),r(o,"class","sy-assistant-action-button svelte-46wzni"),r(o,"aria-label","点赞"),K(o,"active",s[10][s[60].id]==="like"),r(a,"class","sy-assistant-action-button svelte-46wzni"),r(a,"aria-label","点踩"),K(a,"active",s[10][s[60].id]==="dislike"),r(e,"class","sy-assistant-message-actions svelte-46wzni")},m(b,A){W(b,e,A),m(e,t),w.m(t,null),m(e,i),m(e,o),m(e,l),m(e,a),W(b,c,A),S&&S.m(b,A),W(b,u,A),p||(h=[H(t,"click",E),H(t,"mouseenter",z),H(t,"mouseleave",s[27]),H(o,"click",M),H(o,"mouseenter",y),H(o,"mouseleave",s[27]),H(a,"click",_),H(a,"mouseenter",k),H(a,"mouseleave",s[27])],p=!0)},p(b,A){s=b,d!==(d=g(s))&&(w.d(1),w=d(s),w&&(w.c(),w.m(t,null))),A[0]&520&&n!==(n=s[9][s[60].id]?"已复制":"复制内容")&&r(t,"aria-label",n),A[0]&520&&K(t,"copied",s[9][s[60].id]),A[0]&1032&&K(o,"active",s[10][s[60].id]==="like"),A[0]&1032&&K(a,"active",s[10][s[60].id]==="dislike"),s[12]&&s[10][s[60].id]==="dislike"?S?S.p(s,A):(S=Us(s),S.c(),S.m(u.parentNode,u)):S&&(S.d(1),S=null)},d(b){b&&(U(e),U(c),U(u)),w.d(),S&&S.d(b),p=!1,me(h)}}}function Bo(s){let e,t,n;return{c(){e=Q("svg"),t=Q("rect"),n=Q("path"),r(t,"x","9"),r(t,"y","9"),r(t,"width","13"),r(t,"height","13"),r(t,"rx","2"),r(t,"ry","2"),r(n,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round")},m(i,o){W(i,e,o),m(e,t),m(e,n)},d(i){i&&U(e)}}}function Uo(s){let e,t;return{c(){e=Q("svg"),t=Q("polyline"),r(t,"points","20 6 9 17 4 12"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round")},m(n,i){W(n,e,i),m(e,t)},d(n){n&&U(e)}}}function Us(s){let e,t,n,i,o,l,a,c,u;function p(){s[43].call(t,s[60])}function h(){return s[44](s[60])}function g(){return s[45](s[60])}return{c(){e=x("div"),t=x("textarea"),n=G(),i=x("div"),o=x("button"),o.textContent="取消",l=G(),a=x("button"),a.textContent="提交",r(t,"class","sy-assistant-dislike-input svelte-46wzni"),r(t,"placeholder","请输入您的反馈意见..."),r(o,"class","sy-assistant-popup-cancel svelte-46wzni"),r(a,"class","sy-assistant-popup-submit svelte-46wzni"),r(i,"class","sy-assistant-popup-actions svelte-46wzni"),r(e,"class","sy-assistant-dislike-popup svelte-46wzni"),N(e,"left",s[13].x+"px"),N(e,"top",s[13].y+"px"),N(e,"z-index",s[0]+3)},m(d,w){W(d,e,w),m(e,t),ot(t,s[11][s[60].id]),m(e,n),m(e,i),m(i,o),m(i,l),m(i,a),c||(u=[H(t,"input",p),H(o,"click",h),H(a,"click",g)],c=!0)},p(d,w){s=d,w[0]&2056&&ot(t,s[11][s[60].id]),w[0]&8192&&N(e,"left",s[13].x+"px"),w[0]&8192&&N(e,"top",s[13].y+"px"),w[0]&1&&N(e,"z-index",s[0]+3)},d(d){d&&U(e),c=!1,me(u)}}}function js(s,e){let t,n,i,o,l,a,c,u,p=new Date(e[60].timestamp).toLocaleTimeString()+"",h,g;function d(S,b){return S[60].type==="assistant"?Po:No}let w=d(e),E=w(e);function z(S,b){return S[7]&&S[60].id===S[3][S[3].length-1].id&&S[60].type==="assistant"&&!S[60].content?Ho:Fo}let M=z(e),y=M(e),_=e[60].attachments&&Ns(e),k=e[60].id!=="-1"&&e[60].type==="assistant"&&!e[7]&&Bs(e);return{key:s,first:null,c(){t=x("div"),E.c(),n=G(),i=x("div"),o=x("div"),y.c(),l=G(),_&&_.c(),a=G(),k&&k.c(),c=G(),u=x("div"),h=we(p),g=G(),r(o,"class","sy-assistant-message-content svelte-46wzni"),r(u,"class","sy-assistant-message-time svelte-46wzni"),r(i,"class","sy-assistant-message-bubble svelte-46wzni"),r(t,"class","sy-assistant-message svelte-46wzni"),K(t,"user",e[60].type==="user"),this.first=t},m(S,b){W(S,t,b),E.m(t,null),m(t,n),m(t,i),m(i,o),y.m(o,null),m(o,l),_&&_.m(o,null),m(o,a),k&&k.m(o,null),m(i,c),m(i,u),m(u,h),m(t,g)},p(S,b){e=S,w!==(w=d(e))&&(E.d(1),E=w(e),E&&(E.c(),E.m(t,n))),M===(M=z(e))&&y?y.p(e,b):(y.d(1),y=M(e),y&&(y.c(),y.m(o,l))),e[60].attachments?_?_.p(e,b):(_=Ns(e),_.c(),_.m(o,a)):_&&(_.d(1),_=null),e[60].id!=="-1"&&e[60].type==="assistant"&&!e[7]?k?k.p(e,b):(k=Bs(e),k.c(),k.m(o,null)):k&&(k.d(1),k=null),b[0]&8&&p!==(p=new Date(e[60].timestamp).toLocaleTimeString()+"")&&Le(h,p),b[0]&8&&K(t,"user",e[60].type==="user")},d(S){S&&U(t),E.d(),y.d(),_&&_.d(),k&&k.d()}}}function Ws(s){let e,t,n,i,o,l,a,c,u,p,h,g,d,w,E,z,M,y,_,k,S,b,A,C;return{c(){e=x("div"),t=x("div"),n=x("button"),n.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>',i=G(),o=x("button"),o.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>',l=G(),a=x("div"),c=x("div"),u=x("div"),p=x("div"),h=x("textarea"),g=G(),d=x("div"),w=we(s[2]),E=we("/"),z=we(In),M=G(),y=x("button"),_=Q("svg"),k=Q("line"),S=Q("polygon"),r(n,"class","sy-assistant-icon-button svelte-46wzni"),r(n,"aria-label","历史会话"),r(o,"class","sy-assistant-icon-button svelte-46wzni"),r(o,"aria-label","新建会话"),r(t,"class","sy-assistant-chat-actions svelte-46wzni"),r(e,"class","sy-assistant-chat-footer svelte-46wzni"),r(h,"class","sy-assistant-textarea svelte-46wzni"),r(h,"placeholder","输入您的问题..."),r(h,"maxlength",In),r(h,"rows","3"),r(d,"class","sy-assistant-char-count svelte-46wzni"),K(d,"over-limit",s[17]),r(p,"class","sy-assistant-textarea-container svelte-46wzni"),r(u,"class","sy-assistant-input-wrapper svelte-46wzni"),r(k,"x1","22"),r(k,"y1","2"),r(k,"x2","11"),r(k,"y2","13"),r(S,"points","22 2 15 22 11 13 2 9 22 2"),r(_,"xmlns","http://www.w3.org/2000/svg"),r(_,"width","20"),r(_,"height","20"),r(_,"viewBox","0 0 24 24"),r(_,"fill","none"),r(_,"stroke","currentColor"),r(_,"stroke-width","2"),r(_,"stroke-linecap","round"),r(_,"stroke-linejoin","round"),r(y,"class","sy-assistant-send-button svelte-46wzni"),y.disabled=b=!s[1].trim()||s[17],r(y,"aria-label","发送消息"),r(c,"class","sy-assistant-input-container svelte-46wzni"),r(a,"class","sy-assistant-input-area svelte-46wzni")},m(R,P){W(R,e,P),m(e,t),m(t,n),m(t,i),m(t,o),W(R,l,P),W(R,a,P),m(a,c),m(c,u),m(u,p),m(p,h),ot(h,s[1]),m(p,g),m(p,d),m(d,w),m(d,E),m(d,z),m(c,M),m(c,y),m(y,_),m(_,k),m(_,S),A||(C=[H(n,"click",s[28]),H(n,"mouseenter",s[47]),H(n,"mouseleave",s[27]),H(n,"blur",s[27]),H(o,"click",s[31]),H(o,"mouseenter",s[48]),H(o,"mouseleave",s[27]),H(h,"input",s[49]),H(h,"keydown",s[50]),H(y,"click",s[19]),H(y,"mouseenter",s[51]),H(y,"mouseleave",s[27])],A=!0)},p(R,P){P[0]&2&&ot(h,R[1]),P[0]&4&&Le(w,R[2]),P[0]&131072&&K(d,"over-limit",R[17]),P[0]&131074&&b!==(b=!R[1].trim()||R[17])&&(y.disabled=b)},d(R){R&&(U(e),U(l),U(a)),A=!1,me(C)}}}function Gs(s){let e,t=s[14].text+"",n;return{c(){e=x("div"),n=we(t),r(e,"class","sy-assistant-button-tooltip svelte-46wzni"),N(e,"left",s[14].x+"px"),N(e,"top",s[14].y+"px")},m(i,o){W(i,e,o),m(e,n)},p(i,o){o[0]&16384&&t!==(t=i[14].text+"")&&Le(n,t),o[0]&16384&&N(e,"left",i[14].x+"px"),o[0]&16384&&N(e,"top",i[14].y+"px")},d(i){i&&U(e)}}}function jo(s){let e,t,n,i,o,l,a;const c=[Do,Oo],u=[];function p(d,w){return d[15]?0:1}t=p(s),n=u[t]=c[t](s);let h=!s[15]&&Ws(s),g=s[14]&&Gs(s);return{c(){e=x("div"),n.c(),i=G(),h&&h.c(),o=G(),g&&g.c(),l=Lt(),r(e,"class","sy-assistant-chat-container svelte-46wzni"),N(e,"z-index",s[0]+2)},m(d,w){W(d,e,w),u[t].m(e,null),m(e,i),h&&h.m(e,null),s[52](e),W(d,o,w),g&&g.m(d,w),W(d,l,w),a=!0},p(d,w){let E=t;t=p(d),t===E?u[t].p(d,w):(ln(),We(u[E],1,1,()=>{u[E]=null}),rn(),n=u[t],n?n.p(d,w):(n=u[t]=c[t](d),n.c()),Me(n,1),n.m(e,i)),d[15]?h&&(h.d(1),h=null):h?h.p(d,w):(h=Ws(d),h.c(),h.m(e,null)),(!a||w[0]&1)&&N(e,"z-index",d[0]+2),d[14]?g?g.p(d,w):(g=Gs(d),g.c(),g.m(l.parentNode,l)):g&&(g.d(1),g=null)},i(d){a||(Me(n),a=!0)},o(d){We(n),a=!1},d(d){d&&(U(e),U(o),U(l)),u[t].d(),h&&h.d(),s[52](null),g&&g.d(d)}}}let In=500;function Wo(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 qt(s){const e=s.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:s,ext:""}}async function Go(s,e){try{const t=await fetch("/aiops/aigc/file/downloadFile",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({fileName:s,fileUrl:e})});if(!t.ok)throw new Error("Download failed");const n=t.headers.get("content-type")||"application/octet-stream",i=await t.blob(),o=window.URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=s,document.body.appendChild(l),l.click(),window.URL.revokeObjectURL(o),document.body.removeChild(l)}catch(t){console.error("Failed to download file:",t)}}function qo(s,e,t){let n,i,o="",l=[{id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],a="",c=null,u=null,p={x:0,y:0,alignRight:!1},h=null,g=!1;J.setOptions({breaks:!0,gfm:!0});function d(T){try{const j=J(T);return As.sanitize(j)}catch(j){console.warn("Markdown parsing failed, fallback to HTML:",j);try{const oe=T.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return As.sanitize(oe)}catch(oe){return console.error("HTML fallback failed:",oe),T}}}let w;function E(T=!1){w&&w.scrollTo({top:w.scrollHeight,behavior:T?"smooth":"auto"})}pi(()=>{E(!1)});let{sessionId:z}=e;async function M(){if(!o.trim()||i)return;if(!z){console.error("No session ID available");return}const T={id:Date.now().toString(),type:"user",content:o.trim(),timestamp:Date.now()};t(3,l=[...l,T]);const j=o.trim();t(1,o="");const oe=(Date.now()+1).toString();a="",t(3,l=[...l,{id:oe,type:"assistant",content:"",timestamp:Date.now()}]),t(7,g=!0),c&&c.abort(),c=new AbortController;try{await Ri("/aiops/aigc/chat/sse",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:z,requestId:Date.now().toString(),keyword:j,flowId:"1"}),signal:c.signal,onmessage(pe){try{const He=pe.data;if(He){const Qe=Wo(He);Qe?(t(3,l=l.map(Be=>Be.id===oe?{...Be,attachments:Qe}:Be)),E(!0)):(a+=He,t(3,l=l.map(Be=>Be.id===oe?{...Be,content:a}:Be)),E(!1))}}catch(He){console.error("Failed to process SSE message:",He)}},onerror(pe){console.error("SSE error:",pe),c=null,t(7,g=!1)},onclose(){c=null,t(7,g=!1)}})}catch(pe){console.error("Failed to send message:",pe),t(7,g=!1)}}function y(T,j,oe){const pe=oe.getBoundingClientRect(),He=w.getBoundingClientRect(),Qe=pe.left<He.width/2;t(4,u=j),t(5,p={x:pe.left,y:pe.top+pe.height/2,alignRight:Qe})}function _(){t(6,h=setTimeout(()=>{t(4,u=null),t(6,h=null)},200))}hi(()=>{c&&c.abort(),h&&clearTimeout(h)});let k={};async function S(T,j){try{const oe=j.replace(/<br\s*\/?>/g,`
48
- `).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();await navigator.clipboard.writeText(oe),t(9,k[T]=!0,k),setTimeout(()=>{t(9,k[T]=!1,k),t(9,k)},1500)}catch(oe){console.error("Failed to copy:",oe)}}let b={},A={},C=!1;async function R(T,j){if(b[T]===j){t(10,b[T]=null,b),t(10,b);return}if(t(10,b[T]=j,b),t(10,b),j==="like")try{if(!(await fetch("/aiops/aigc/chat/record/feedback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:z,requestId:T,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch(oe){console.error("Failed to send feedback:",oe),t(10,b[T]=null,b),t(10,b)}else t(12,C=!0)}async function P(T){var j;if((j=A[T])!=null&&j.trim())try{if(!(await fetch("/aiops/aigc/chat/record/feedback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:z,requestId:T,feedBackFlag:"0",feedBackContent:A[T]})})).ok)throw new Error("Feedback failed");t(12,C=!1),t(11,A[T]="",A),t(11,A)}catch(oe){console.error("Failed to send feedback:",oe),t(10,b[T]=null,b),t(10,b)}}let I={x:0,y:0};function B(T,j){const pe=T.currentTarget.getBoundingClientRect();t(13,I={x:pe.left-290,y:pe.top-160}),R(j,"dislike")}let X=null;function Y(T,j){const pe=T.currentTarget.getBoundingClientRect();t(14,X={text:j,x:pe.left+pe.width/2,y:pe.top-8})}function ae(){t(14,X=null)}let ce=!1,he=[],Ee=Date.now().toString();function ue(){ae(),t(15,ce=!0)}function Fe(){ae(),t(15,ce=!1)}function ie(T){Ee=T,t(15,ce=!1)}async function Ge(){const T=await se();if(!T){console.error("Failed to create new session");return}Ee=T,t(3,l=[{id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(1,o="")}async function se(){try{const T=await fetch("/aiops/aigc/chat/getSessionId",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!T.ok)throw new Error("Failed to get session ID");const j=await T.json();if(j.code===0)return Ee=j.data.sessionId,Ee;throw new Error(j.message||"Failed to get session ID")}catch(T){return console.error("Failed to get session ID:",T),null}}let{zIndex:ke}=e;const ee=(T,j)=>y(j,T.tips,j.currentTarget),Se=T=>Go(T.content_title,T.link),_e=()=>{h&&(clearTimeout(h),t(6,h=null))},qe=()=>{t(4,u=null)},O=T=>S(T.id,T.content),te=(T,j)=>Y(j,k[T.id]?"已复制":"复制内容"),F=T=>R(T.id,"like"),V=(T,j)=>Y(j,b[T.id]==="like"?"取消点赞":"点赞"),ze=(T,j)=>B(j,T.id),Ce=(T,j)=>Y(j,b[T.id]==="dislike"?"取消点踩":"点踩");function Xe(T){A[T.id]=this.value,t(11,A)}const nt=T=>{t(12,C=!1),t(10,b[T.id]=null,b),t(10,b)},Ve=T=>P(T.id);function pt(T){rt[T?"unshift":"push"](()=>{w=T,t(8,w)})}const ht=T=>Y(T,"历史会话"),Yt=T=>Y(T,"新建会话");function Zt(){o=this.value,t(1,o)}const Cn=T=>T.key==="Enter"&&!T.shiftKey&&(M(),T.preventDefault()),Rt=T=>Y(T,"发送消息");function st(T){rt[T?"unshift":"push"](()=>{w=T,t(8,w)})}return s.$$set=T=>{"sessionId"in T&&t(32,z=T.sessionId),"zIndex"in T&&t(0,ke=T.zIndex)},s.$$.update=()=>{s.$$.dirty[0]&2&&t(2,n=o.length),s.$$.dirty[0]&4&&t(17,i=n>In)},[ke,o,n,l,u,p,h,g,w,k,b,A,C,I,X,ce,he,i,d,M,y,_,S,R,P,B,Y,ae,ue,Fe,ie,Ge,z,ee,Se,_e,qe,O,te,F,V,ze,Ce,Xe,nt,Ve,pt,ht,Yt,Zt,Cn,Rt,st]}class Yo extends un{constructor(e){super(),cn(this,e,qo,jo,Ct,{sessionId:32,zIndex:0},null,[-1,-1,-1])}}function qs(s){let e,t,n,i,o=s[3].title+"",l,a,c,u,p,h,g,d,w,E=s[2]?"退出全屏":"全屏显示",z,M,y,_,k,S,b,A,C=s[7]?"取消吸附":"吸附到边缘",R,P,I,B,X,Y,ae,ce,he,Ee=`${s[3].height}px`,ue,Fe,ie;function Ge(F,V){return F[2]?Xo:Zo}let se=Ge(s),ke=se(s);function ee(F,V){return F[7]?Qo:Vo}let Se=ee(s),_e=Se(s);const qe=[Jo,Ko],O=[];function te(F,V){return F[8]?0:1}return ce=te(s),he=O[ce]=qe[ce](s),{c(){e=x("div"),t=x("div"),n=x("div"),i=x("h3"),l=we(o),a=G(),c=x("div"),u=x("div"),p=x("button"),h=Q("svg"),ke.c(),d=G(),w=x("span"),z=we(E),M=G(),y=x("div"),_=x("button"),k=Q("svg"),_e.c(),b=G(),A=x("span"),R=we(C),P=G(),I=x("div"),B=x("button"),B.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>',X=G(),Y=x("span"),Y.textContent="关闭助手",ae=G(),he.c(),r(i,"class","svelte-1dubpto"),r(h,"xmlns","http://www.w3.org/2000/svg"),r(h,"width","18"),r(h,"height","18"),r(h,"viewBox","0 0 24 24"),r(h,"fill","none"),r(h,"stroke","currentColor"),r(h,"stroke-width","2"),r(h,"stroke-linecap","round"),r(h,"stroke-linejoin","round"),r(p,"class","sy-assistant-action-button svelte-1dubpto"),r(p,"aria-label",g=s[2]?"退出全屏":"全屏显示"),K(p,"active",s[2]),r(w,"class","sy-assistant-tooltip svelte-1dubpto"),r(u,"class","sy-assistant-tooltip-wrapper svelte-1dubpto"),r(k,"xmlns","http://www.w3.org/2000/svg"),r(k,"width","18"),r(k,"height","18"),r(k,"viewBox","0 0 24 24"),r(k,"fill","none"),r(k,"stroke","currentColor"),r(k,"stroke-width","2"),r(k,"stroke-linecap","round"),r(k,"stroke-linejoin","round"),r(_,"class","sy-assistant-action-button svelte-1dubpto"),r(_,"aria-label",S=s[7]?"取消吸附":"吸附到边缘"),K(_,"active",s[7]),r(A,"class","sy-assistant-tooltip svelte-1dubpto"),r(y,"class","sy-assistant-tooltip-wrapper svelte-1dubpto"),r(B,"class","sy-assistant-close-button svelte-1dubpto"),r(B,"aria-label","关闭助手"),r(Y,"class","sy-assistant-tooltip svelte-1dubpto"),r(I,"class","sy-assistant-tooltip-wrapper svelte-1dubpto"),r(c,"class","sy-assistant-header-actions svelte-1dubpto"),r(n,"class","sy-assistant-drawer-header svelte-1dubpto"),r(n,"role","button"),r(n,"tabindex","0"),r(n,"aria-label","拖动助手窗口"),K(n,"dragging",s[6]),K(n,"fullscreen",s[2]),K(n,"snapped",s[7]),r(t,"class","sy-assistant-drawer-content svelte-1dubpto"),r(e,"class","sy-assistant-drawer svelte-1dubpto"),K(e,"fullscreen",s[2]),N(e,"height",Ee)},m(F,V){W(F,e,V),m(e,t),m(t,n),m(n,i),m(i,l),m(n,a),m(n,c),m(c,u),m(u,p),m(p,h),ke.m(h,null),m(u,d),m(u,w),m(w,z),m(c,M),m(c,y),m(y,_),m(_,k),_e.m(k,null),m(y,b),m(y,A),m(A,R),m(c,P),m(c,I),m(I,B),m(I,X),m(I,Y),m(t,ae),O[ce].m(t,null),ue=!0,Fe||(ie=[H(p,"click",s[16]),H(_,"click",s[18]),H(B,"click",s[15]),H(n,"mousedown",jn(s[17]))],Fe=!0)},p(F,V){(!ue||V[0]&8)&&o!==(o=F[3].title+"")&&Le(l,o),se!==(se=Ge(F))&&(ke.d(1),ke=se(F),ke&&(ke.c(),ke.m(h,null))),(!ue||V[0]&4&&g!==(g=F[2]?"退出全屏":"全屏显示"))&&r(p,"aria-label",g),(!ue||V[0]&4)&&K(p,"active",F[2]),(!ue||V[0]&4)&&E!==(E=F[2]?"退出全屏":"全屏显示")&&Le(z,E),Se!==(Se=ee(F))&&(_e.d(1),_e=Se(F),_e&&(_e.c(),_e.m(k,null))),(!ue||V[0]&128&&S!==(S=F[7]?"取消吸附":"吸附到边缘"))&&r(_,"aria-label",S),(!ue||V[0]&128)&&K(_,"active",F[7]),(!ue||V[0]&128)&&C!==(C=F[7]?"取消吸附":"吸附到边缘")&&Le(R,C),(!ue||V[0]&64)&&K(n,"dragging",F[6]),(!ue||V[0]&4)&&K(n,"fullscreen",F[2]),(!ue||V[0]&128)&&K(n,"snapped",F[7]);let ze=ce;ce=te(F),ce===ze?O[ce].p(F,V):(ln(),We(O[ze],1,1,()=>{O[ze]=null}),rn(),he=O[ce],he?he.p(F,V):(he=O[ce]=qe[ce](F),he.c()),Me(he,1),he.m(t,null)),(!ue||V[0]&4)&&K(e,"fullscreen",F[2]),V[0]&8&&Ee!==(Ee=`${F[3].height}px`)&&N(e,"height",Ee)},i(F){ue||(Me(he),ue=!0)},o(F){We(he),ue=!1},d(F){F&&U(e),ke.d(),_e.d(),O[ce].d(),Fe=!1,me(ie)}}}function Zo(s){let e;return{c(){e=Q("path"),r(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){W(t,e,n)},d(t){t&&U(e)}}}function Xo(s){let e;return{c(){e=Q("path"),r(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){W(t,e,n)},d(t){t&&U(e)}}}function Vo(s){let e,t;return{c(){e=Q("rect"),t=Q("line"),r(e,"x","3"),r(e,"y","3"),r(e,"width","18"),r(e,"height","18"),r(e,"rx","2"),r(e,"ry","2"),r(t,"x1","16"),r(t,"y1","6"),r(t,"x2","16"),r(t,"y2","18")},m(n,i){W(n,e,i),W(n,t,i)},d(n){n&&(U(e),U(t))}}}function Qo(s){let e,t;return{c(){e=Q("rect"),t=Q("rect"),r(e,"x","3"),r(e,"y","3"),r(e,"width","18"),r(e,"height","18"),r(e,"rx","2"),r(e,"ry","2"),r(t,"x","12"),r(t,"y","10"),r(t,"width","6"),r(t,"height","8"),r(t,"rx","1"),r(t,"ry","1")},m(n,i){W(n,e,i),W(n,t,i)},d(n){n&&(U(e),U(t))}}}function Ko(s){let e,t;return e=new Yo({props:{zIndex:s[3].zIndex||1e3,sessionId:s[9]}}),{c(){an(e.$$.fragment)},m(n,i){Ot(e,n,i),t=!0},p(n,i){const o={};i[0]&8&&(o.zIndex=n[3].zIndex||1e3),i[0]&512&&(o.sessionId=n[9]),e.$set(o)},i(n){t||(Me(e.$$.fragment,n),t=!0)},o(n){We(e.$$.fragment,n),t=!1},d(n){Dt(e,n)}}}function Jo(s){let e,t;return e=new Ms({props:{sessions:s[13],onClose:s[26],onSelect:s[19],zIndex:s[3].zIndex||1e3}}),{c(){an(e.$$.fragment)},m(n,i){Ot(e,n,i),t=!0},p(n,i){const o={};i[0]&256&&(o.onClose=n[26]),i[0]&8&&(o.zIndex=n[3].zIndex||1e3),e.$set(o)},i(n){t||(Me(e.$$.fragment,n),t=!0)},o(n){We(e.$$.fragment,n),t=!1},d(n){Dt(e,n)}}}function $o(s){let e,t,n=`${s[12]}px`,i,o,l,a,c,u,p,h,g,d,w,E,z,M,y=s[12]>0&&qs(s);return{c(){e=x("div"),t=x("div"),y&&y.c(),i=G(),o=x("button"),l=Q("svg"),a=Q("path"),c=Q("path"),u=Q("path"),p=Q("path"),h=Q("path"),g=Q("path"),d=Q("path"),r(t,"class","sy-assistant-drawer-wrapper svelte-1dubpto"),K(t,"fullscreen",s[2]),N(t,"width",n),r(a,"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"),r(a,"fill","#6F8698"),r(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"),r(c,"fill","#3677FF"),r(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"),r(u,"fill","#D0D5F1"),r(p,"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"),r(p,"fill","#3677FF"),r(h,"d","M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),r(h,"fill","#FFFFFF"),r(g,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),r(g,"fill","#FFFFFF"),r(d,"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"),r(d,"fill","#8896A4"),r(l,"class","sy-assistant-icon"),r(l,"viewBox","0 0 1024 1024"),r(l,"version","1.1"),r(l,"xmlns","http://www.w3.org/2000/svg"),r(l,"width","32"),r(l,"height","32"),r(l,"fill","currentColor"),r(l,"aria-label","助手图标"),r(o,"class","sy-assistant-floating-button svelte-1dubpto"),r(o,"aria-label","打开助手"),r(o,"style",w=s[10]+" z-index: "+((s[3].zIndex||1e3)+1)+";"),r(e,"class","sy-assistant-container sy-assistant-theme svelte-1dubpto"),K(e,"fullscreen",s[2]),K(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||1e3)},m(_,k){W(_,e,k),m(e,t),y&&y.m(t,null),m(e,i),m(e,o),m(o,l),m(l,a),m(l,c),m(l,u),m(l,p),m(l,h),m(l,g),m(l,d),s[27](o),s[29](e),E=!0,z||(M=[H(o,"click",s[15]),H(o,"mousedown",jn(s[28]))],z=!0)},p(_,k){_[12]>0?y?(y.p(_,k),k[0]&4096&&Me(y,1)):(y=qs(_),y.c(),Me(y,1),y.m(t,null)):y&&(ln(),We(y,1,1,()=>{y=null}),rn()),(!E||k[0]&4)&&K(t,"fullscreen",_[2]),k[0]&4096&&n!==(n=`${_[12]}px`)&&N(t,"width",n),(!E||k[0]&1032&&w!==(w=_[10]+" z-index: "+((_[3].zIndex||1e3)+1)+";"))&&r(o,"style",w),(!E||k[0]&4)&&K(e,"fullscreen",_[2]),(!E||k[0]&128)&&K(e,"snapped",_[7]),k[0]&8&&N(e,"position",_[3].position),k[0]&129&&N(e,"right",_[7]?0:`${_[0]}px`),k[0]&130&&N(e,"bottom",_[7]?0:`${_[1]}px`),k[0]&132&&N(e,"top",_[7]||_[2]?"0":"auto"),k[0]&4&&N(e,"left",_[2]?"0":"auto"),k[0]&8&&N(e,"z-index",_[3].zIndex||1e3)},i(_){E||(Me(y),E=!0)},o(_){We(y),E=!1},d(_){_&&U(e),y&&y.d(),s[27](null),s[29](null),z=!1,me(M)}}}const zn=48,fe=20;function el(s,e,t){let n,i,o,l,a=Z,c=()=>(a(),a=ai(i,O=>t(12,l=O)),i);s.$$.on_destroy.push(()=>a());const u={position:"fixed",width:480,height:600,title:"智慧运维助手",initialState:"default",defaultPosition:{right:fe,bottom:fe},snappedWidth:480,drawerWidth:480,zIndex:1e3};let{target:p="body"}=e,{options:h={}}=e,g,d=null,w=!1,E,z=!1,M=0,y=0,_=fe,k=20,S=_,b=k,A=!1,C=fe,R=50,P=!1,I={width:0,height:0,right:0,bottom:0},B=!1,X=!1,Y=[],ae=null;async function ce(){try{const O=await fetch("/aiops/aigc/chat/getSessionId",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!O.ok)throw new Error("Failed to get session ID");const te=await O.json();if(te.code===0)return t(9,ae=te.data.sessionId),ae;throw new Error(te.message||"Failed to get session ID")}catch(O){return console.error("Failed to get session ID:",O),null}}function he(O,te=!1){te?t(23,A=!0):t(6,z=!0),M=O.clientX,y=O.clientY,_=te?C:S,k=te?R:b,O.preventDefault()}function Ee(O){if(!z&&!A)return;const te=M-O.clientX,F=y-O.clientY;if(A){const V=_+te,ze=O.clientY;t(24,C=Math.max(fe,Math.min(window.innerWidth-zn-fe,V)));const Ce=window.innerHeight-zn-fe,nt=Math.max(fe,Math.min(Ce,ze));t(25,R=(window.innerHeight-nt-zn)/window.innerHeight*100)}else{const V=n.width||0,ze=n.height||0,Ce=_+te;t(0,S=Math.max(fe,Math.min(window.innerWidth-V-fe,Ce)));const Xe=k+F;t(1,b=Math.max(fe,Math.min(window.innerHeight-ze-fe,Xe)))}}function ue(){t(6,z=!1),t(23,A=!1)}Wn(()=>{typeof p=="string"?d=document.querySelector(p)||document.body:d=p||document.body;const O=F=>Ee(F),te=()=>ue();return document.addEventListener("mousemove",O),document.addEventListener("mouseup",te),g&&d&&d.appendChild(g),E&&E.getBoundingClientRect().left,t(7,B=n.initialState==="snapped"),t(2,P=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,S=0),t(1,b=0),t(3,n={...n,height:typeof window<"u"?window.innerHeight:n.height,width:n.snappedWidth||n.width})):n.initialState==="fullscreen"&&(t(0,S=0),t(1,b=0),t(3,n={...n,width:typeof window<"u"?window.innerWidth:n.width,height:typeof window<"u"?window.innerHeight:n.height})),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",te),d&&g&&d.removeChild(g)}});async function Fe(){w||await ce(),t(22,w=!w)}function ie(){var O,te,F,V;t(2,P=!P),P?(I.width||(I={width:u.width,height:u.height,right:((O=u.defaultPosition)==null?void 0:O.right)||fe,bottom:((te=u.defaultPosition)==null?void 0:te.bottom)||fe}),B&&t(7,B=!1),t(20,h={...n,width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth}),t(0,S=0),t(1,b=0)):(t(20,h={...n,width:u.width,height:u.height,drawerWidth:u.drawerWidth}),t(0,S=((F=u.defaultPosition)==null?void 0:F.right)||fe),t(1,b=((V=u.defaultPosition)==null?void 0:V.bottom)||fe))}function Ge(O){P||he(O)}function se(){var O,te;P&&(t(2,P=!1),t(20,h={...n,width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(7,B=!B),B?(n.height,t(0,S=0),t(1,b=0),t(20,h={...n,height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width})):(t(20,h={...n,width:u.width,height:u.height,drawerWidth:u.drawerWidth}),t(0,S=((O=u.defaultPosition)==null?void 0:O.right)||fe),t(1,b=((te=u.defaultPosition)==null?void 0:te.bottom)||fe))}function ke(O){t(8,X=!1)}const ee=()=>t(8,X=!1);function Se(O){rt[O?"unshift":"push"](()=>{E=O,t(5,E)})}const _e=O=>he(O,!0);function qe(O){rt[O?"unshift":"push"](()=>{g=O,t(4,g)})}return s.$$set=O=>{"target"in O&&t(21,p=O.target),"options"in O&&t(20,h=O.options)},s.$$.update=()=>{s.$$.dirty[0]&1048576&&t(3,n={...u,...h,defaultPosition:{...u.defaultPosition,...h.defaultPosition}}),s.$$.dirty[0]&4194316&&c(t(11,i=yi(w?P?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),s.$$.dirty[0]&11&&typeof window<"u"&&(t(0,S=Math.max(fe,Math.min(window.innerWidth-(n.width||0),S))),t(1,b=Math.max(fe,Math.min(window.innerHeight-(n.height||0),b)))),s.$$.dirty[0]&62914560&&t(10,o=w?"display: none;":`position: fixed; right: ${C}px; bottom: ${R}%; transform: none; cursor: ${A?"grabbing":"grab"};`)},[S,b,P,n,g,E,z,B,X,ae,o,i,l,Y,he,Fe,ie,Ge,se,ke,h,p,w,A,C,R,ee,Se,_e,qe]}class tl extends un{constructor(e){super(),cn(this,e,el,$o,Ct,{target:21,options:20},null,[-1,-1])}}re.SyAssistant=tl,Object.defineProperty(re,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 i=rs(e);if(i===null)return n;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const i=rs(e);if(i===null)return n;e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class xn{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 Ue{constructor(e){ie(this,"options");ie(this,"renderer");ie(this,"textRenderer");this.options=e||st,this.options.renderer=this.options.renderer||new Vt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new xn}static parse(e,t){return new Ue(t).parse(e)}static parseInline(e,t){return new Ue(t).parseInline(e)}parse(e,t=!0){let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const l=o,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){n+=a||"";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,Hi(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 a="",c="";for(let h=0;h<l.header.length;h++)c+=this.renderer.tablecell(this.parseInline(l.header[h].tokens),{header:!0,align:l.align[h]});a+=this.renderer.tablerow(c);let u="";for(let h=0;h<l.rows.length;h++){const p=l.rows[h];c="";for(let g=0;g<p.length;g++)c+=this.renderer.tablecell(this.parseInline(p[g].tokens),{header:!1,align:l.align[g]});u+=this.renderer.tablerow(c)}n+=this.renderer.table(a,u);continue}case"blockquote":{const l=o,a=this.parse(l.tokens);n+=this.renderer.blockquote(a);continue}case"list":{const l=o,a=l.ordered,c=l.start,u=l.loose;let h="";for(let p=0;p<l.items.length;p++){const g=l.items[p],d=g.checked,w=g.task;let S="";if(g.task){const z=this.renderer.checkbox(!!d);u?g.tokens.length>0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=z+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=z+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:z+" "}):S+=z+" "}S+=this.parse(g.tokens,u),h+=this.renderer.listitem(S,w,!!d)}n+=this.renderer.list(h,a,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,a=l.tokens?this.parseInline(l.tokens):l.text;for(;i+1<e.length&&e[i+1].type==="text";)l=e[++i],a+=`
45
+ `+(l.tokens?this.parseInline(l.tokens):l.text);n+=t?this.renderer.paragraph(a):a;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 i=0;i<e.length;i++){const o=e[i];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){ie(this,"options");this.options=e||st}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ie(zt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class go{constructor(...e){hi(this,lt);ie(this,"defaults",bn());ie(this,"options",this.setOptions);ie(this,"parse",an(this,lt,Gn).call(this,Be.lex,Ue.parse));ie(this,"parseInline",an(this,lt,Gn).call(this,Be.lexInline,Ue.parseInline));ie(this,"Parser",Ue);ie(this,"Renderer",Vt);ie(this,"TextRenderer",xn);ie(this,"Lexer",Be);ie(this,"Tokenizer",qt);ie(this,"Hooks",zt);this.use(...e)}walkTokens(e,t){var i,o;let n=[];for(const l of e)switch(n=n.concat(t.call(this,l)),l.type){case"table":{const a=l;for(const c of a.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of a.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const a=l;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=l;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[a.type]?this.defaults.extensions.childTokens[a.type].forEach(c=>{const u=a[c].flat(1/0);n=n.concat(this.walkTokens(u,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i=ne({},n);if(i.async=this.defaults.async||i.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(...a){let c=o.renderer.apply(this,a);return c===!1&&(c=l.apply(this,a)),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)}),i.extensions=t),n.renderer){const o=this.defaults.renderer||new Vt(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 a=l,c=n.renderer[a],u=o[a];o[a]=(...h)=>{let p=c.apply(o,h);return p===!1&&(p=u.apply(o,h)),p||""}}i.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new qt(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 a=l,c=n.tokenizer[a],u=o[a];o[a]=(...h)=>{let p=c.apply(o,h);return p===!1&&(p=u.apply(o,h)),p}}i.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 a=l,c=n.hooks[a],u=o[a];zt.passThroughHooks.has(l)?o[a]=h=>{if(this.defaults.async)return Promise.resolve(c.call(o,h)).then(g=>u.call(o,g));const p=c.call(o,h);return u.call(o,p)}:o[a]=(...h)=>{let p=c.apply(o,h);return p===!1&&(p=u.apply(o,h)),p}}i.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,l=n.walkTokens;i.walkTokens=function(a){let c=[];return c.push(l.call(this,a)),o&&(c=c.concat(o.call(this,a))),c}}this.defaults=ne(ne({},this.defaults),i)}),this}setOptions(e){return this.defaults=ne(ne({},this.defaults),e),this}lexer(e,t){return Be.lex(e,t!=null?t:this.defaults)}parser(e,t){return Ue.parse(e,t!=null?t:this.defaults)}}lt=new WeakSet,Gn=function(e,t){return(n,i)=>{const o=ne({},i),l=ne(ne({},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 a=an(this,lt,pi).call(this,!!l.silent,!!l.async);if(typeof n=="undefined"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(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(a);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 a(c)}}},pi=function(e,t){return n=>{if(n.message+=`
46
+ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Me(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}};const it=new go;function $(s,e){return it.parse(s,e)}$.options=$.setOptions=function(s){return it.setOptions(s),$.defaults=it.defaults,ss($.defaults),$},$.getDefaults=bn,$.defaults=st,$.use=function(...s){return it.use(...s),$.defaults=it.defaults,ss($.defaults),$},$.walkTokens=function(s,e){return it.walkTokens(s,e)},$.parseInline=it.parseInline,$.Parser=Ue,$.parser=Ue.parse,$.Renderer=Vt,$.TextRenderer=xn,$.Lexer=Be,$.lexer=Be.lex,$.Tokenizer=qt,$.Hooks=zt,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Ue.parse,Be.lex;/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */const{entries:ks,setPrototypeOf:_s,isFrozen:mo,getPrototypeOf:wo,getOwnPropertyDescriptor:ko}=Object;let{freeze:Ae,seal:Pe,create:bs}=Object,{apply:Rn,construct:In}=typeof Reflect!="undefined"&&Reflect;Ae||(Ae=function(e){return e}),Pe||(Pe=function(e){return e}),Rn||(Rn=function(e,t,n){return e.apply(t,n)}),In||(In=function(e,t){return new e(...t)});const Qt=Oe(Array.prototype.forEach),ys=Oe(Array.prototype.pop),Ct=Oe(Array.prototype.push),Kt=Oe(String.prototype.toLowerCase),zn=Oe(String.prototype.toString),Ts=Oe(String.prototype.match),Lt=Oe(String.prototype.replace),_o=Oe(String.prototype.indexOf),bo=Oe(String.prototype.trim),Fe=Oe(Object.prototype.hasOwnProperty),xe=Oe(RegExp.prototype.test),Mt=yo(TypeError);function Oe(s){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Rn(s,e,n)}}function yo(s){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return In(s,t)}}function Z(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Kt;_s&&_s(s,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=t(i);o!==i&&(mo(e)||(e[n]=o),i=o)}s[i]=!0}return s}function To(s){for(let e=0;e<s.length;e++)Fe(s,e)||(s[e]=null);return s}function ot(s){const e=bs(null);for(const[t,n]of ks(s))Fe(s,t)&&(Array.isArray(n)?e[t]=To(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ot(n):e[t]=n);return e}function Ot(s,e){for(;s!==null;){const n=ko(s,e);if(n){if(n.get)return Oe(n.get);if(typeof n.value=="function")return Oe(n.value)}s=wo(s)}function t(){return null}return t}const vs=Ae(["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"]),Cn=Ae(["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"]),Ln=Ae(["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"]),vo=Ae(["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"]),Mn=Ae(["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"]),Eo=Ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Es=Ae(["#text"]),Ss=Ae(["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"]),On=Ae(["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"]),As=Ae(["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"]),Jt=Ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),So=Pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ao=Pe(/<%[\w\W]*|[\w\W]*%>/gm),xo=Pe(/\$\{[\w\W]*}/gm),Ro=Pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Io=Pe(/^aria-[\-\w]+$/),xs=Pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zo=Pe(/^(?:\w+script|data):/i),Co=Pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rs=Pe(/^html$/i),Lo=Pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var Is=Object.freeze({__proto__:null,ARIA_ATTR:Io,ATTR_WHITESPACE:Co,CUSTOM_ELEMENT:Lo,DATA_ATTR:Ro,DOCTYPE_NAME:Rs,ERB_EXPR:Ao,IS_ALLOWED_URI:xs,IS_SCRIPT_OR_DATA:zo,MUSTACHE_EXPR:So,TMPLIT_EXPR:xo});const Dt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Mo=function(){return typeof window=="undefined"?null:window},Oo=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));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}},zs=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cs(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Mo();const e=D=>Cs(D);if(e.version="3.2.3",e.removed=[],!s||!s.document||s.document.nodeType!==Dt.document)return e.isSupported=!1,e;let{document:t}=s;const n=t,i=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:a,Element:c,NodeFilter:u,NamedNodeMap:h=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:p,DOMParser:g,trustedTypes:d}=s,w=c.prototype,S=Ot(w,"cloneNode"),z=Ot(w,"remove"),M=Ot(w,"nextSibling"),y=Ot(w,"childNodes"),_=Ot(w,"parentNode");if(typeof l=="function"){const D=t.createElement("template");D.content&&D.content.ownerDocument&&(t=D.content.ownerDocument)}let k,v="";const{implementation:b,createNodeIterator:A,createDocumentFragment:C,getElementsByTagName:R}=t,{importNode:F}=n;let I=zs();e.isSupported=typeof ks=="function"&&typeof _=="function"&&b&&b.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:U,ERB_EXPR:V,TMPLIT_EXPR:X,DATA_ATTR:ue,ARIA_ATTR:fe,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:Ie,CUSTOM_ELEMENT:he}=Is;let{IS_ALLOWED_URI:je}=Is,re=null;const Qe=Z({},[...vs,...Cn,...Ln,...Mn,...Es]);let le=null;const ye=Z({},[...Ss,...On,...As,...Jt]);let te=Object.seal(bs(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}})),ze=null,Te=null,Ke=!0,O=!0,se=!1,N=!0,Y=!1,ve=!0,Ee=!1,He=!1,We=!1,et=!1,kt=!1,_t=!1,en=!0,tn=!1;const Fn="user-content-";let Nt=!0,rt=!1,T={},W=null;const ae=Z({},["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 de=null;const Ge=Z({},["audio","video","img","source","image","track"]);let tt=null;const qe=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nn="http://www.w3.org/1998/Math/MathML",sn="http://www.w3.org/2000/svg",Je="http://www.w3.org/1999/xhtml";let bt=Je,Hn=!1,Bn=null;const rl=Z({},[nn,sn,Je],zn);let on=Z({},["mi","mo","mn","ms","mtext"]),ln=Z({},["annotation-xml"]);const al=Z({},["title","style","font","a","script"]);let Pt=null;const cl=["application/xhtml+xml","text/html"],ul="text/html";let we=null,yt=null;const fl=t.createElement("form"),Js=function(f){return f instanceof RegExp||f instanceof Function},Un=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(yt&&yt===f)){if((!f||typeof f!="object")&&(f={}),f=ot(f),Pt=cl.indexOf(f.PARSER_MEDIA_TYPE)===-1?ul:f.PARSER_MEDIA_TYPE,we=Pt==="application/xhtml+xml"?zn:Kt,re=Fe(f,"ALLOWED_TAGS")?Z({},f.ALLOWED_TAGS,we):Qe,le=Fe(f,"ALLOWED_ATTR")?Z({},f.ALLOWED_ATTR,we):ye,Bn=Fe(f,"ALLOWED_NAMESPACES")?Z({},f.ALLOWED_NAMESPACES,zn):rl,tt=Fe(f,"ADD_URI_SAFE_ATTR")?Z(ot(qe),f.ADD_URI_SAFE_ATTR,we):qe,de=Fe(f,"ADD_DATA_URI_TAGS")?Z(ot(Ge),f.ADD_DATA_URI_TAGS,we):Ge,W=Fe(f,"FORBID_CONTENTS")?Z({},f.FORBID_CONTENTS,we):ae,ze=Fe(f,"FORBID_TAGS")?Z({},f.FORBID_TAGS,we):{},Te=Fe(f,"FORBID_ATTR")?Z({},f.FORBID_ATTR,we):{},T=Fe(f,"USE_PROFILES")?f.USE_PROFILES:!1,Ke=f.ALLOW_ARIA_ATTR!==!1,O=f.ALLOW_DATA_ATTR!==!1,se=f.ALLOW_UNKNOWN_PROTOCOLS||!1,N=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=f.SAFE_FOR_TEMPLATES||!1,ve=f.SAFE_FOR_XML!==!1,Ee=f.WHOLE_DOCUMENT||!1,et=f.RETURN_DOM||!1,kt=f.RETURN_DOM_FRAGMENT||!1,_t=f.RETURN_TRUSTED_TYPE||!1,We=f.FORCE_BODY||!1,en=f.SANITIZE_DOM!==!1,tn=f.SANITIZE_NAMED_PROPS||!1,Nt=f.KEEP_CONTENT!==!1,rt=f.IN_PLACE||!1,je=f.ALLOWED_URI_REGEXP||xs,bt=f.NAMESPACE||Je,on=f.MATHML_TEXT_INTEGRATION_POINTS||on,ln=f.HTML_INTEGRATION_POINTS||ln,te=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Js(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(te.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Js(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(te.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(te.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(O=!1),kt&&(et=!0),T&&(re=Z({},Es),le=[],T.html===!0&&(Z(re,vs),Z(le,Ss)),T.svg===!0&&(Z(re,Cn),Z(le,On),Z(le,Jt)),T.svgFilters===!0&&(Z(re,Ln),Z(le,On),Z(le,Jt)),T.mathMl===!0&&(Z(re,Mn),Z(le,As),Z(le,Jt))),f.ADD_TAGS&&(re===Qe&&(re=ot(re)),Z(re,f.ADD_TAGS,we)),f.ADD_ATTR&&(le===ye&&(le=ot(le)),Z(le,f.ADD_ATTR,we)),f.ADD_URI_SAFE_ATTR&&Z(tt,f.ADD_URI_SAFE_ATTR,we),f.FORBID_CONTENTS&&(W===ae&&(W=ot(W)),Z(W,f.FORBID_CONTENTS,we)),Nt&&(re["#text"]=!0),Ee&&Z(re,["html","head","body"]),re.table&&(Z(re,["tbody"]),delete ze.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=f.TRUSTED_TYPES_POLICY,v=k.createHTML("")}else k===void 0&&(k=Oo(d,i)),k!==null&&typeof v=="string"&&(v=k.createHTML(""));Ae&&Ae(f),yt=f}},$s=Z({},[...Cn,...Ln,...vo]),ei=Z({},[...Mn,...Eo]),hl=function(f){let E=_(f);(!E||!E.tagName)&&(E={namespaceURI:bt,tagName:"template"});const L=Kt(f.tagName),ce=Kt(E.tagName);return Bn[f.namespaceURI]?f.namespaceURI===sn?E.namespaceURI===Je?L==="svg":E.namespaceURI===nn?L==="svg"&&(ce==="annotation-xml"||on[ce]):!!$s[L]:f.namespaceURI===nn?E.namespaceURI===Je?L==="math":E.namespaceURI===sn?L==="math"&&ln[ce]:!!ei[L]:f.namespaceURI===Je?E.namespaceURI===sn&&!ln[ce]||E.namespaceURI===nn&&!on[ce]?!1:!ei[L]&&(al[L]||!$s[L]):!!(Pt==="application/xhtml+xml"&&Bn[f.namespaceURI]):!1},Ye=function(f){Ct(e.removed,{element:f});try{_(f).removeChild(f)}catch(E){z(f)}},rn=function(f,E){try{Ct(e.removed,{attribute:E.getAttributeNode(f),from:E})}catch(L){Ct(e.removed,{attribute:null,from:E})}if(E.removeAttribute(f),f==="is")if(et||kt)try{Ye(E)}catch(L){}else try{E.setAttribute(f,"")}catch(L){}},ti=function(f){let E=null,L=null;if(We)f="<remove></remove>"+f;else{const ke=Ts(f,/^[\r\n\t ]+/);L=ke&&ke[0]}Pt==="application/xhtml+xml"&&bt===Je&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ce=k?k.createHTML(f):f;if(bt===Je)try{E=new g().parseFromString(ce,Pt)}catch(ke){}if(!E||!E.documentElement){E=b.createDocument(bt,"template",null);try{E.documentElement.innerHTML=Hn?v:ce}catch(ke){}}const Se=E.body||E.documentElement;return f&&L&&Se.insertBefore(t.createTextNode(L),Se.childNodes[0]||null),bt===Je?R.call(E,Ee?"html":"body")[0]:Ee?E.documentElement:Se},ni=function(f){return A.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},jn=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")},si=function(f){return typeof a=="function"&&f instanceof a};function $e(D,f,E){Qt(D,L=>{L.call(e,f,E,yt)})}const ii=function(f){let E=null;if($e(I.beforeSanitizeElements,f,null),jn(f))return Ye(f),!0;const L=we(f.nodeName);if($e(I.uponSanitizeElement,f,{tagName:L,allowedTags:re}),f.hasChildNodes()&&!si(f.firstElementChild)&&xe(/<[/\w]/g,f.innerHTML)&&xe(/<[/\w]/g,f.textContent)||f.nodeType===Dt.progressingInstruction||ve&&f.nodeType===Dt.comment&&xe(/<[/\w]/g,f.data))return Ye(f),!0;if(!re[L]||ze[L]){if(!ze[L]&&li(L)&&(te.tagNameCheck instanceof RegExp&&xe(te.tagNameCheck,L)||te.tagNameCheck instanceof Function&&te.tagNameCheck(L)))return!1;if(Nt&&!W[L]){const ce=_(f)||f.parentNode,Se=y(f)||f.childNodes;if(Se&&ce){const ke=Se.length;for(let Ce=ke-1;Ce>=0;--Ce){const Ze=S(Se[Ce],!0);Ze.__removalCount=(f.__removalCount||0)+1,ce.insertBefore(Ze,M(f))}}}return Ye(f),!0}return f instanceof c&&!hl(f)||(L==="noscript"||L==="noembed"||L==="noframes")&&xe(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ye(f),!0):(Y&&f.nodeType===Dt.text&&(E=f.textContent,Qt([U,V,X],ce=>{E=Lt(E,ce," ")}),f.textContent!==E&&(Ct(e.removed,{element:f.cloneNode()}),f.textContent=E)),$e(I.afterSanitizeElements,f,null),!1)},oi=function(f,E,L){if(en&&(E==="id"||E==="name")&&(L in t||L in fl))return!1;if(!(O&&!Te[E]&&xe(ue,E))){if(!(Ke&&xe(fe,E))){if(!le[E]||Te[E]){if(!(li(f)&&(te.tagNameCheck instanceof RegExp&&xe(te.tagNameCheck,f)||te.tagNameCheck instanceof Function&&te.tagNameCheck(f))&&(te.attributeNameCheck instanceof RegExp&&xe(te.attributeNameCheck,E)||te.attributeNameCheck instanceof Function&&te.attributeNameCheck(E))||E==="is"&&te.allowCustomizedBuiltInElements&&(te.tagNameCheck instanceof RegExp&&xe(te.tagNameCheck,L)||te.tagNameCheck instanceof Function&&te.tagNameCheck(L))))return!1}else if(!tt[E]){if(!xe(je,Lt(L,Ie,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&f!=="script"&&_o(L,"data:")===0&&de[f])){if(!(se&&!xe(me,Lt(L,Ie,"")))){if(L)return!1}}}}}}return!0},li=function(f){return f!=="annotation-xml"&&Ts(f,he)},ri=function(f){$e(I.beforeSanitizeAttributes,f,null);const{attributes:E}=f;if(!E||jn(f))return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0};let ce=E.length;for(;ce--;){const Se=E[ce],{name:ke,namespaceURI:Ce,value:Ze}=Se,Ft=we(ke);let Re=ke==="value"?Ze:bo(Ze);if(L.attrName=Ft,L.attrValue=Re,L.keepAttr=!0,L.forceKeepAttr=void 0,$e(I.uponSanitizeAttribute,f,L),Re=L.attrValue,tn&&(Ft==="id"||Ft==="name")&&(rn(ke,f),Re=Fn+Re),ve&&xe(/((--!?|])>)|<\/(style|title)/i,Re)){rn(ke,f);continue}if(L.forceKeepAttr||(rn(ke,f),!L.keepAttr))continue;if(!N&&xe(/\/>/i,Re)){rn(ke,f);continue}Y&&Qt([U,V,X],ci=>{Re=Lt(Re,ci," ")});const ai=we(f.nodeName);if(oi(ai,Ft,Re)){if(k&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Ce)switch(d.getAttributeType(ai,Ft)){case"TrustedHTML":{Re=k.createHTML(Re);break}case"TrustedScriptURL":{Re=k.createScriptURL(Re);break}}try{Ce?f.setAttributeNS(Ce,ke,Re):f.setAttribute(ke,Re),jn(f)?Ye(f):ys(e.removed)}catch(ci){}}}$e(I.afterSanitizeAttributes,f,null)},pl=function D(f){let E=null;const L=ni(f);for($e(I.beforeSanitizeShadowDOM,f,null);E=L.nextNode();)$e(I.uponSanitizeShadowNode,E,null),ii(E),ri(E),E.content instanceof o&&D(E.content);$e(I.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(D){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,L=null,ce=null,Se=null;if(Hn=!D,Hn&&(D="<!-->"),typeof D!="string"&&!si(D))if(typeof D.toString=="function"){if(D=D.toString(),typeof D!="string")throw Mt("dirty is not a string, aborting")}else throw Mt("toString is not a function");if(!e.isSupported)return D;if(He||Un(f),e.removed=[],typeof D=="string"&&(rt=!1),rt){if(D.nodeName){const Ze=we(D.nodeName);if(!re[Ze]||ze[Ze])throw Mt("root node is forbidden and cannot be sanitized in-place")}}else if(D instanceof a)E=ti("<!---->"),L=E.ownerDocument.importNode(D,!0),L.nodeType===Dt.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?E=L:E.appendChild(L);else{if(!et&&!Y&&!Ee&&D.indexOf("<")===-1)return k&&_t?k.createHTML(D):D;if(E=ti(D),!E)return et?null:_t?v:""}E&&We&&Ye(E.firstChild);const ke=ni(rt?D:E);for(;ce=ke.nextNode();)ii(ce),ri(ce),ce.content instanceof o&&pl(ce.content);if(rt)return D;if(et){if(kt)for(Se=C.call(E.ownerDocument);E.firstChild;)Se.appendChild(E.firstChild);else Se=E;return(le.shadowroot||le.shadowrootmode)&&(Se=F.call(n,Se,!0)),Se}let Ce=Ee?E.outerHTML:E.innerHTML;return Ee&&re["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&xe(Rs,E.ownerDocument.doctype.name)&&(Ce="<!DOCTYPE "+E.ownerDocument.doctype.name+`>
47
+ `+Ce),Y&&Qt([U,V,X],Ze=>{Ce=Lt(Ce,Ze," ")}),k&&_t?k.createHTML(Ce):Ce},e.setConfig=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Un(D),He=!0},e.clearConfig=function(){yt=null,He=!1},e.isValidAttribute=function(D,f,E){yt||Un({});const L=we(D),ce=we(f);return oi(L,ce,E)},e.addHook=function(D,f){typeof f=="function"&&Ct(I[D],f)},e.removeHook=function(D){return ys(I[D])},e.removeHooks=function(D){I[D]=[]},e.removeAllHooks=function(){I=zs()},e}var Ls=Cs();function Ms(s,e,t){const n=s.slice();return n[24]=e[t],n}function Os(s){let e,t=s[9].text+"",n;return{c(){e=x("div"),n=be(t),r(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),P(e,"left",s[9].x+"px"),P(e,"top",s[9].y+"px"),P(e,"z-index",s[3]+3)},m(i,o){G(i,e,o),m(e,n)},p(i,o){o&512&&t!==(t=i[9].text+"")&&De(n,t),o&512&&P(e,"left",i[9].x+"px"),o&512&&P(e,"top",i[9].y+"px"),o&8&&P(e,"z-index",i[3]+3)},d(i){i&&j(e)}}}function Do(s){let e=[],t=new Map,n,i,o=mt(s[0]);const l=c=>c[24].id;for(let c=0;c<o.length;c+=1){let u=Ms(s,o,c),h=l(u);t.set(h,e[c]=Ds(h,u))}let a=s[5]&&Ns();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=q(),a&&a.c(),i=Bt()},m(c,u){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(c,u);G(c,n,u),a&&a.m(c,u),G(c,i,u)},p(c,u){u&8261&&(o=mt(c[0]),e=$n(e,u,l,1,c,o,t,n.parentNode,Jn,Ds,n,Ms)),c[5]?a||(a=Ns(),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},d(c){c&&(j(n),j(i));for(let u=0;u<e.length;u+=1)e[u].d(c);a&&a.d(c)}}}function No(s){let e,t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话",n;return{c(){e=x("div"),n=be(t),r(e,"class","sy-session-empty svelte-1g6fj9a")},m(i,o){G(i,e,o),m(e,n)},p(i,o){o&48&&t!==(t=i[4]?"未找到相关会话":i[5]?"加载中...":"暂无历史会话")&&De(n,t)},d(i){i&&j(e)}}}function Ds(s,e){let t,n,i,o,l=e[24].title+"",a,c,u,h=Fs(e[24].timestamp)+"",p,g,d,w,S,z,M,y,_,k,v;function b(){return e[17](e[24])}function A(...C){return e[18](e[24],...C)}return{key:s,first:null,c(){t=x("div"),n=x("button"),i=x("div"),o=x("div"),a=be(l),c=q(),u=x("div"),p=be(h),g=q(),d=x("button"),w=Q("svg"),S=Q("path"),z=Q("path"),M=Q("path"),r(o,"class","sy-session-title svelte-1g6fj9a"),r(u,"class","sy-session-time svelte-1g6fj9a"),r(i,"class","sy-session-info svelte-1g6fj9a"),r(n,"class","sy-session-select svelte-1g6fj9a"),r(S,"d","M3 6h18"),r(z,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),r(M,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),r(w,"xmlns","http://www.w3.org/2000/svg"),r(w,"width","16"),r(w,"height","16"),r(w,"viewBox","0 0 24 24"),r(w,"fill","none"),r(w,"stroke","currentColor"),r(w,"stroke-width","2"),r(w,"stroke-linecap","round"),r(w,"stroke-linejoin","round"),r(d,"class","sy-session-delete svelte-1g6fj9a"),d.disabled=y=e[6]===e[24].id,r(d,"aria-label","删除会话"),r(t,"class","sy-session-item svelte-1g6fj9a"),r(t,"data-session-id",_=e[24].id),K(t,"deleting",e[24].deleting),this.first=t},m(C,R){G(C,t,R),m(t,n),m(n,i),m(i,o),m(o,a),m(i,c),m(i,u),m(u,p),m(t,g),m(t,d),m(d,w),m(w,S),m(w,z),m(w,M),k||(v=[B(n,"click",b),B(d,"click",A)],k=!0)},p(C,R){e=C,R&1&&l!==(l=e[24].title+"")&&De(a,l),R&1&&h!==(h=Fs(e[24].timestamp)+"")&&De(p,h),R&65&&y!==(y=e[6]===e[24].id)&&(d.disabled=y),R&1&&_!==(_=e[24].id)&&r(t,"data-session-id",_),R&1&&K(t,"deleting",e[24].deleting)},d(C){C&&j(t),k=!1,ge(v)}}}function Ns(s){let e;return{c(){e=x("div"),e.innerHTML='<span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span>',r(e,"class","sy-session-loading svelte-1g6fj9a")},m(t,n){G(t,e,n)},d(t){t&&j(e)}}}function Ps(s){let e,t,n,i,o,l,a,c,u;return{c(){e=x("div"),t=x("div"),t.textContent="确认删除此会话?",n=q(),i=x("div"),o=x("button"),o.textContent="取消",l=q(),a=x("button"),a.textContent="删除",r(t,"class","sy-session-confirm-content svelte-1g6fj9a"),r(o,"class","sy-session-confirm-cancel svelte-1g6fj9a"),r(a,"class","sy-session-confirm-delete svelte-1g6fj9a"),r(i,"class","sy-session-confirm-actions svelte-1g6fj9a"),r(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),P(e,"left",s[8].x+"px"),P(e,"top",s[8].y+"px"),P(e,"z-index",s[3]+3)},m(h,p){G(h,e,p),m(e,t),m(e,n),m(e,i),m(i,o),m(i,l),m(i,a),c||(u=[B(o,"click",s[19]),B(a,"click",s[14])],c=!0)},p(h,p){p&256&&P(e,"left",h[8].x+"px"),p&256&&P(e,"top",h[8].y+"px"),p&8&&P(e,"z-index",h[3]+3)},d(h){h&&j(e),c=!1,ge(u)}}}function Po(s){let e,t,n,i,o,l,a,c,u,h,p,g,d,w,S,z,M,y,_,k=s[9]&&Os(s);function v(R,F){return R[0].length===0?No:Do}let b=v(s),A=b(s),C=s[7]&&Ps(s);return{c(){e=x("div"),t=x("div"),n=x("h2"),n.textContent="历史会话",i=q(),o=x("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=q(),a=x("div"),c=x("input"),u=q(),h=Q("svg"),p=Q("circle"),g=Q("line"),d=q(),k&&k.c(),w=q(),S=x("div"),A.c(),z=q(),C&&C.c(),M=Bt(),r(n,"class","svelte-1g6fj9a"),r(o,"class","sy-session-close svelte-1g6fj9a"),r(o,"aria-label","关闭历史会话"),r(t,"class","sy-session-header svelte-1g6fj9a"),r(c,"type","text"),r(c,"class","sy-session-search-input svelte-1g6fj9a"),r(c,"placeholder","搜索历史会话..."),r(p,"cx","11"),r(p,"cy","11"),r(p,"r","8"),r(g,"x1","21"),r(g,"y1","21"),r(g,"x2","16.65"),r(g,"y2","16.65"),r(h,"class","sy-session-search-icon svelte-1g6fj9a"),r(h,"xmlns","http://www.w3.org/2000/svg"),r(h,"width","16"),r(h,"height","16"),r(h,"viewBox","0 0 24 24"),r(h,"fill","none"),r(h,"stroke","currentColor"),r(h,"stroke-width","2"),r(h,"stroke-linecap","round"),r(h,"stroke-linejoin","round"),r(a,"class","sy-session-search svelte-1g6fj9a"),r(S,"class","sy-session-list svelte-1g6fj9a"),r(e,"class","sy-session-history svelte-1g6fj9a"),P(e,"z-index",s[3]+2)},m(R,F){G(R,e,F),m(e,t),m(t,n),m(t,i),m(t,o),m(e,l),m(e,a),m(a,c),ft(c,s[4]),m(a,u),m(a,h),m(h,p),m(h,g),m(e,d),k&&k.m(e,null),m(e,w),m(e,S),A.m(S,null),G(R,z,F),C&&C.m(R,F),G(R,M,F),y||(_=[B(o,"click",function(){Tt(s[1])&&s[1].apply(this,arguments)}),B(o,"mouseenter",s[15]),B(o,"mouseleave",s[12]),B(c,"input",s[16]),B(S,"scroll",s[10])],y=!0)},p(R,[F]){s=R,F&16&&c.value!==s[4]&&ft(c,s[4]),s[9]?k?k.p(s,F):(k=Os(s),k.c(),k.m(e,w)):k&&(k.d(1),k=null),b===(b=v(s))&&A?A.p(s,F):(A.d(1),A=b(s),A&&(A.c(),A.m(S,null))),F&8&&P(e,"z-index",s[3]+2),s[7]?C?C.p(s,F):(C=Ps(s),C.c(),C.m(M.parentNode,M)):C&&(C.d(1),C=null)},i:H,o:H,d(R){R&&(j(e),j(z),j(M)),k&&k.d(),A.d(),C&&C.d(R),y=!1,ge(_)}}}const Dn=10;function Fs(s){return new Date(s).toLocaleString()}function Fo(s,e,t){let{sessions:n=[]}=e,{onClose:i}=e,{onSelect:o}=e,{zIndex:l}=e,a=!1,c=!0,u=0,h="",p=null,g=null,d={x:0,y:0};function w(){return Le(this,null,function*(){if(!(a||!c)){t(5,a=!0);try{const I=yield fetch("/aiops/aigc/chat/record/session/list/query",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({start:u,length:Dn,keyword:h})});if(!I.ok)throw new Error("Failed to load sessions");const U=yield I.json();if(U.code===0){const V=U.data.sessionList.map(X=>({id:X.session_id,title:X.name,timestamp:new Date(X.createDate).getTime()}));t(0,n=[...n,...V]),u+=Dn,c=V.length===Dn}}catch(I){console.error("Failed to load sessions:",I)}finally{t(5,a=!1)}}})}function S(I){const U=I.target,{scrollTop:V,scrollHeight:X,clientHeight:ue}=U;X-V-ue<50&&w()}Vn(()=>{w()});let z=null;function M(I,U){const X=I.currentTarget.getBoundingClientRect();t(9,z={text:U,x:X.left+X.width/2,y:X.bottom+8})}function y(){t(9,z=null)}function _(I,U){const X=I.currentTarget.getBoundingClientRect();t(8,d={x:X.left-16,y:X.top+X.height/2}),t(7,g=U)}function k(I){return Le(this,null,function*(){if(I&&!p)try{t(6,p=I),t(7,g=null);const U=document.querySelector(`[data-session-id="${I}"]`);U&&U.classList.add("deleting"),yield new Promise(ue=>setTimeout(ue,300));const V=yield fetch("/aiops/aigc/chat/record/session/delete",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:I})});if(!V.ok)throw new Error("Delete request failed");const X=yield V.json();if(X.code===0&&X.data.respCode===0)t(0,n=n.map(ue=>_e(ne({},ue),{deleting:ue.id===I}))),setTimeout(()=>{t(0,n=n.filter(ue=>!ue.deleting))},300);else throw new Error("Delete failed: "+X.message)}catch(U){console.error("Failed to delete session:",U);const V=document.querySelector(`[data-session-id="${I}"]`);V&&V.classList.remove("deleting")}finally{t(6,p=null)}})}function v(){g&&k(g)}const b=I=>M(I,"关闭历史会话");function A(){h=this.value,t(4,h)}const C=I=>o(I.id),R=(I,U)=>_(U,I.id),F=()=>t(7,g=null);return s.$$set=I=>{"sessions"in I&&t(0,n=I.sessions),"onClose"in I&&t(1,i=I.onClose),"onSelect"in I&&t(2,o=I.onSelect),"zIndex"in I&&t(3,l=I.zIndex)},s.$$.update=()=>{s.$$.dirty&16&&h!==void 0&&(t(0,n=[]),u=0,c=!0,w())},[n,i,o,l,h,a,p,g,d,z,S,M,y,_,v,b,A,C,R,F]}class Hs extends wn{constructor(e){super(),mn(this,e,Fo,Po,at,{sessions:0,onClose:1,onSelect:2,zIndex:3})}}function Bs(s,e,t){const n=s.slice();return n[60]=e[t],n[61]=e,n[62]=t,n}function Us(s,e,t){const n=s.slice();return n[63]=e[t],n[65]=t,n}function Ho(s){let e,t=[],n=new Map,i=mt(s[3]);const o=l=>l[60].id;for(let l=0;l<i.length;l+=1){let a=Bs(s,i,l),c=o(a);n.set(c,t[l]=Xs(c,a))}return{c(){e=x("div");for(let l=0;l<t.length;l+=1)t[l].c();r(e,"class","sy-assistant-message-list svelte-46wzni")},m(l,a){G(l,e,a);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);s[46](e)},p(l,a){a[0]&267665145&&(i=mt(l[3]),t=$n(t,a,o,1,l,i,n,e,Jn,Xs,null,Bs))},i:H,o:H,d(l){l&&j(e);for(let a=0;a<t.length;a+=1)t[a].d();s[46](null)}}}function Bo(s){let e,t;return e=new Hs({props:{sessions:s[16],onClose:s[29],onSelect:s[30],zIndex:s[0]}}),{c(){gn(e.$$.fragment)},m(n,i){jt(e,n,i),t=!0},p(n,i){const o={};i[0]&65536&&(o.sessions=n[16]),i[0]&1&&(o.zIndex=n[0]),e.$set(o)},i(n){t||(Ne(e.$$.fragment,n),t=!0)},o(n){Ve(e.$$.fragment,n),t=!1},d(n){Wt(e,n)}}}function Uo(s){let e;return{c(){e=x("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>',r(e,"class","sy-assistant-avatar user svelte-46wzni")},m(t,n){G(t,e,n)},d(t){t&&j(e)}}}function jo(s){let e;return{c(){e=x("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>',r(e,"class","sy-assistant-avatar assistant svelte-46wzni")},m(t,n){G(t,e,n)},d(t){t&&j(e)}}}function Wo(s){let e,t=s[18](s[60].content)+"";return{c(){e=x("div"),r(e,"class","markdown-content svelte-46wzni")},m(n,i){G(n,e,i),e.innerHTML=t},p(n,i){i[0]&8&&t!==(t=n[18](n[60].content)+"")&&(e.innerHTML=t)},d(n){n&&j(e)}}}function Go(s){let e;return{c(){e=x("span"),e.innerHTML='<span class="dot svelte-46wzni">.</span> <span class="dot svelte-46wzni">.</span> <span class="dot svelte-46wzni">.</span>',r(e,"class","sy-assistant-loading svelte-46wzni")},m(t,n){G(t,e,n)},p:H,d(t){t&&j(e)}}}function js(s){let e,t=mt(s[60].attachments),n=[];for(let i=0;i<t.length;i+=1)n[i]=qs(Us(s,t,i));return{c(){e=x("div");for(let i=0;i<n.length;i+=1)n[i].c();r(e,"class","sy-assistant-attachments svelte-46wzni")},m(i,o){G(i,e,o);for(let l=0;l<n.length;l+=1)n[l]&&n[l].m(e,null)},p(i,o){if(o[0]&3145849){t=mt(i[60].attachments);let l;for(l=0;l<t.length;l+=1){const a=Us(i,t,l);n[l]?n[l].p(a,o):(n[l]=qs(a),n[l].c(),n[l].m(e,null))}for(;l<n.length;l+=1)n[l].d(1);n.length=t.length}},d(i){i&&j(e),gi(n,i)}}}function Ws(s){let e,t,n;function i(...o){return s[33](s[63],...o)}return{c(){e=x("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-46wzni"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',r(e,"class","sy-assistant-attachment-toggle svelte-46wzni"),r(e,"aria-label","查看详情")},m(o,l){G(o,e,l),t||(n=[B(e,"mouseenter",i),B(e,"mouseleave",s[21])],t=!0)},p(o,l){s=o},d(o){o&&j(e),t=!1,ge(n)}}}function Gs(s){let e,t=s[4].replace(/\n/g,"<br>")+"",n,i;return{c(){e=x("div"),r(e,"class","sy-assistant-tooltip svelte-46wzni"),r(e,"role","tooltip"),P(e,"left",s[5].x+"px"),P(e,"top",s[5].y+"px"),P(e,"z-index",s[0]+3),K(e,"align-right",s[5].alignRight)},m(o,l){G(o,e,l),e.innerHTML=t,n||(i=[B(e,"mouseenter",s[35]),B(e,"mouseleave",s[36])],n=!0)},p(o,l){l[0]&16&&t!==(t=o[4].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),l[0]&32&&P(e,"left",o[5].x+"px"),l[0]&32&&P(e,"top",o[5].y+"px"),l[0]&1&&P(e,"z-index",o[0]+3),l[0]&32&&K(e,"align-right",o[5].alignRight)},d(o){o&&j(e),n=!1,ge(i)}}}function qs(s){let e,t,n,i,o,l,a,c,u,h=$t(s[63].content_title).name+"",p,g,d,w=$t(s[63].content_title).ext+"",S,z,M,y,_,k,v,b,A,C,R=s[63].tips&&Ws(s);function F(){return s[34](s[63])}let I=s[4]&&Gs(s);return{c(){e=x("div"),t=x("div"),n=x("div"),i=Q("svg"),o=Q("path"),l=Q("polyline"),a=q(),c=x("div"),u=x("span"),p=be(h),g=q(),d=x("span"),S=be(w),M=q(),y=x("div"),R&&R.c(),_=q(),k=x("button"),k.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-46wzni"><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>',v=q(),I&&I.c(),b=q(),r(o,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),r(l,"points","13 2 13 9 20 9"),r(i,"xmlns","http://www.w3.org/2000/svg"),r(i,"width","16"),r(i,"height","16"),r(i,"viewBox","0 0 24 24"),r(i,"fill","none"),r(i,"stroke","currentColor"),r(i,"stroke-width","2"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(u,"class","sy-assistant-filename svelte-46wzni"),r(d,"class","sy-assistant-attachment-ext svelte-46wzni"),r(c,"class","sy-assistant-attachment-name svelte-46wzni"),r(c,"title",z=s[63].content_title),r(n,"class","sy-assistant-attachment-title svelte-46wzni"),r(k,"class","sy-assistant-attachment-toggle svelte-46wzni"),r(k,"aria-label","下载文件"),r(y,"class","sy-assistant-attachment-actions svelte-46wzni"),r(t,"class","sy-assistant-attachment-header svelte-46wzni"),r(e,"class","sy-assistant-attachment svelte-46wzni")},m(U,V){G(U,e,V),m(e,t),m(t,n),m(n,i),m(i,o),m(i,l),m(n,a),m(n,c),m(c,u),m(u,p),m(c,g),m(c,d),m(d,S),m(t,M),m(t,y),R&&R.m(y,null),m(y,_),m(y,k),m(e,v),I&&I.m(e,null),m(e,b),A||(C=B(k,"click",F),A=!0)},p(U,V){s=U,V[0]&8&&h!==(h=$t(s[63].content_title).name+"")&&De(p,h),V[0]&8&&w!==(w=$t(s[63].content_title).ext+"")&&De(S,w),V[0]&8&&z!==(z=s[63].content_title)&&r(c,"title",z),s[63].tips?R?R.p(s,V):(R=Ws(s),R.c(),R.m(y,_)):R&&(R.d(1),R=null),s[4]?I?I.p(s,V):(I=Gs(s),I.c(),I.m(e,b)):I&&(I.d(1),I=null)},d(U){U&&j(e),R&&R.d(),I&&I.d(),A=!1,C()}}}function Ys(s){let e,t,n,i,o,l,a,c,u,h,p;function g(b,A){return b[9][b[60].id]?Yo:qo}let d=g(s),w=d(s);function S(){return s[37](s[60])}function z(...b){return s[38](s[60],...b)}function M(){return s[39](s[60])}function y(...b){return s[40](s[60],...b)}function _(...b){return s[41](s[60],...b)}function k(...b){return s[42](s[60],...b)}let v=s[12]&&s[10][s[60].id]==="dislike"&&Zs(s);return{c(){e=x("div"),t=x("button"),w.c(),i=q(),o=x("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=q(),a=x("button"),a.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(),v&&v.c(),u=Bt(),r(t,"class","sy-assistant-action-button svelte-46wzni"),r(t,"aria-label",n=s[9][s[60].id]?"已复制":"复制内容"),K(t,"copied",s[9][s[60].id]),r(o,"class","sy-assistant-action-button svelte-46wzni"),r(o,"aria-label","点赞"),K(o,"active",s[10][s[60].id]==="like"),r(a,"class","sy-assistant-action-button svelte-46wzni"),r(a,"aria-label","点踩"),K(a,"active",s[10][s[60].id]==="dislike"),r(e,"class","sy-assistant-message-actions svelte-46wzni")},m(b,A){G(b,e,A),m(e,t),w.m(t,null),m(e,i),m(e,o),m(e,l),m(e,a),G(b,c,A),v&&v.m(b,A),G(b,u,A),h||(p=[B(t,"click",S),B(t,"mouseenter",z),B(t,"mouseleave",s[27]),B(o,"click",M),B(o,"mouseenter",y),B(o,"mouseleave",s[27]),B(a,"click",_),B(a,"mouseenter",k),B(a,"mouseleave",s[27])],h=!0)},p(b,A){s=b,d!==(d=g(s))&&(w.d(1),w=d(s),w&&(w.c(),w.m(t,null))),A[0]&520&&n!==(n=s[9][s[60].id]?"已复制":"复制内容")&&r(t,"aria-label",n),A[0]&520&&K(t,"copied",s[9][s[60].id]),A[0]&1032&&K(o,"active",s[10][s[60].id]==="like"),A[0]&1032&&K(a,"active",s[10][s[60].id]==="dislike"),s[12]&&s[10][s[60].id]==="dislike"?v?v.p(s,A):(v=Zs(s),v.c(),v.m(u.parentNode,u)):v&&(v.d(1),v=null)},d(b){b&&(j(e),j(c),j(u)),w.d(),v&&v.d(b),h=!1,ge(p)}}}function qo(s){let e,t,n;return{c(){e=Q("svg"),t=Q("rect"),n=Q("path"),r(t,"x","9"),r(t,"y","9"),r(t,"width","13"),r(t,"height","13"),r(t,"rx","2"),r(t,"ry","2"),r(n,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round")},m(i,o){G(i,e,o),m(e,t),m(e,n)},d(i){i&&j(e)}}}function Yo(s){let e,t;return{c(){e=Q("svg"),t=Q("polyline"),r(t,"points","20 6 9 17 4 12"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"width","14"),r(e,"height","14"),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","2"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round")},m(n,i){G(n,e,i),m(e,t)},d(n){n&&j(e)}}}function Zs(s){let e,t,n,i,o,l,a,c,u;function h(){s[43].call(t,s[60])}function p(){return s[44](s[60])}function g(){return s[45](s[60])}return{c(){e=x("div"),t=x("textarea"),n=q(),i=x("div"),o=x("button"),o.textContent="取消",l=q(),a=x("button"),a.textContent="提交",r(t,"class","sy-assistant-dislike-input svelte-46wzni"),r(t,"placeholder","请输入您的反馈意见..."),r(o,"class","sy-assistant-popup-cancel svelte-46wzni"),r(a,"class","sy-assistant-popup-submit svelte-46wzni"),r(i,"class","sy-assistant-popup-actions svelte-46wzni"),r(e,"class","sy-assistant-dislike-popup svelte-46wzni"),P(e,"left",s[13].x+"px"),P(e,"top",s[13].y+"px"),P(e,"z-index",s[0]+3)},m(d,w){G(d,e,w),m(e,t),ft(t,s[11][s[60].id]),m(e,n),m(e,i),m(i,o),m(i,l),m(i,a),c||(u=[B(t,"input",h),B(o,"click",p),B(a,"click",g)],c=!0)},p(d,w){s=d,w[0]&2056&&ft(t,s[11][s[60].id]),w[0]&8192&&P(e,"left",s[13].x+"px"),w[0]&8192&&P(e,"top",s[13].y+"px"),w[0]&1&&P(e,"z-index",s[0]+3)},d(d){d&&j(e),c=!1,ge(u)}}}function Xs(s,e){let t,n,i,o,l,a,c,u,h=new Date(e[60].timestamp).toLocaleTimeString()+"",p,g;function d(v,b){return v[60].type==="assistant"?jo:Uo}let w=d(e),S=w(e);function z(v,b){return v[7]&&v[60].id===v[3][v[3].length-1].id&&v[60].type==="assistant"&&!v[60].content?Go:Wo}let M=z(e),y=M(e),_=e[60].attachments&&js(e),k=e[60].id!=="-1"&&e[60].type==="assistant"&&!e[7]&&Ys(e);return{key:s,first:null,c(){t=x("div"),S.c(),n=q(),i=x("div"),o=x("div"),y.c(),l=q(),_&&_.c(),a=q(),k&&k.c(),c=q(),u=x("div"),p=be(h),g=q(),r(o,"class","sy-assistant-message-content svelte-46wzni"),r(u,"class","sy-assistant-message-time svelte-46wzni"),r(i,"class","sy-assistant-message-bubble svelte-46wzni"),r(t,"class","sy-assistant-message svelte-46wzni"),K(t,"user",e[60].type==="user"),this.first=t},m(v,b){G(v,t,b),S.m(t,null),m(t,n),m(t,i),m(i,o),y.m(o,null),m(o,l),_&&_.m(o,null),m(o,a),k&&k.m(o,null),m(i,c),m(i,u),m(u,p),m(t,g)},p(v,b){e=v,w!==(w=d(e))&&(S.d(1),S=w(e),S&&(S.c(),S.m(t,n))),M===(M=z(e))&&y?y.p(e,b):(y.d(1),y=M(e),y&&(y.c(),y.m(o,l))),e[60].attachments?_?_.p(e,b):(_=js(e),_.c(),_.m(o,a)):_&&(_.d(1),_=null),e[60].id!=="-1"&&e[60].type==="assistant"&&!e[7]?k?k.p(e,b):(k=Ys(e),k.c(),k.m(o,null)):k&&(k.d(1),k=null),b[0]&8&&h!==(h=new Date(e[60].timestamp).toLocaleTimeString()+"")&&De(p,h),b[0]&8&&K(t,"user",e[60].type==="user")},d(v){v&&j(t),S.d(),y.d(),_&&_.d(),k&&k.d()}}}function Vs(s){let e,t,n,i,o,l,a,c,u,h,p,g,d,w,S,z,M,y,_,k,v,b,A,C;return{c(){e=x("div"),t=x("div"),n=x("button"),n.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>',i=q(),o=x("button"),o.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>',l=q(),a=x("div"),c=x("div"),u=x("div"),h=x("div"),p=x("textarea"),g=q(),d=x("div"),w=be(s[2]),S=be("/"),z=be(Nn),M=q(),y=x("button"),_=Q("svg"),k=Q("line"),v=Q("polygon"),r(n,"class","sy-assistant-icon-button svelte-46wzni"),r(n,"aria-label","历史会话"),r(o,"class","sy-assistant-icon-button svelte-46wzni"),r(o,"aria-label","新建会话"),r(t,"class","sy-assistant-chat-actions svelte-46wzni"),r(e,"class","sy-assistant-chat-footer svelte-46wzni"),r(p,"class","sy-assistant-textarea svelte-46wzni"),r(p,"placeholder","输入您的问题..."),r(p,"maxlength",Nn),r(p,"rows","3"),r(d,"class","sy-assistant-char-count svelte-46wzni"),K(d,"over-limit",s[17]),r(h,"class","sy-assistant-textarea-container svelte-46wzni"),r(u,"class","sy-assistant-input-wrapper svelte-46wzni"),r(k,"x1","22"),r(k,"y1","2"),r(k,"x2","11"),r(k,"y2","13"),r(v,"points","22 2 15 22 11 13 2 9 22 2"),r(_,"xmlns","http://www.w3.org/2000/svg"),r(_,"width","20"),r(_,"height","20"),r(_,"viewBox","0 0 24 24"),r(_,"fill","none"),r(_,"stroke","currentColor"),r(_,"stroke-width","2"),r(_,"stroke-linecap","round"),r(_,"stroke-linejoin","round"),r(y,"class","sy-assistant-send-button svelte-46wzni"),y.disabled=b=!s[1].trim()||s[17],r(y,"aria-label","发送消息"),r(c,"class","sy-assistant-input-container svelte-46wzni"),r(a,"class","sy-assistant-input-area svelte-46wzni")},m(R,F){G(R,e,F),m(e,t),m(t,n),m(t,i),m(t,o),G(R,l,F),G(R,a,F),m(a,c),m(c,u),m(u,h),m(h,p),ft(p,s[1]),m(h,g),m(h,d),m(d,w),m(d,S),m(d,z),m(c,M),m(c,y),m(y,_),m(_,k),m(_,v),A||(C=[B(n,"click",s[28]),B(n,"mouseenter",s[47]),B(n,"mouseleave",s[27]),B(n,"blur",s[27]),B(o,"click",s[31]),B(o,"mouseenter",s[48]),B(o,"mouseleave",s[27]),B(p,"input",s[49]),B(p,"keydown",s[50]),B(y,"click",s[19]),B(y,"mouseenter",s[51]),B(y,"mouseleave",s[27])],A=!0)},p(R,F){F[0]&2&&ft(p,R[1]),F[0]&4&&De(w,R[2]),F[0]&131072&&K(d,"over-limit",R[17]),F[0]&131074&&b!==(b=!R[1].trim()||R[17])&&(y.disabled=b)},d(R){R&&(j(e),j(l),j(a)),A=!1,ge(C)}}}function Qs(s){let e,t=s[14].text+"",n;return{c(){e=x("div"),n=be(t),r(e,"class","sy-assistant-button-tooltip svelte-46wzni"),P(e,"left",s[14].x+"px"),P(e,"top",s[14].y+"px")},m(i,o){G(i,e,o),m(e,n)},p(i,o){o[0]&16384&&t!==(t=i[14].text+"")&&De(n,t),o[0]&16384&&P(e,"left",i[14].x+"px"),o[0]&16384&&P(e,"top",i[14].y+"px")},d(i){i&&j(e)}}}function Zo(s){let e,t,n,i,o,l,a;const c=[Bo,Ho],u=[];function h(d,w){return d[15]?0:1}t=h(s),n=u[t]=c[t](s);let p=!s[15]&&Vs(s),g=s[14]&&Qs(s);return{c(){e=x("div"),n.c(),i=q(),p&&p.c(),o=q(),g&&g.c(),l=Bt(),r(e,"class","sy-assistant-chat-container svelte-46wzni"),P(e,"z-index",s[0]+2)},m(d,w){G(d,e,w),u[t].m(e,null),m(e,i),p&&p.m(e,null),s[52](e),G(d,o,w),g&&g.m(d,w),G(d,l,w),a=!0},p(d,w){let S=t;t=h(d),t===S?u[t].p(d,w):(pn(),Ve(u[S],1,1,()=>{u[S]=null}),dn(),n=u[t],n?n.p(d,w):(n=u[t]=c[t](d),n.c()),Ne(n,1),n.m(e,i)),d[15]?p&&(p.d(1),p=null):p?p.p(d,w):(p=Vs(d),p.c(),p.m(e,null)),(!a||w[0]&1)&&P(e,"z-index",d[0]+2),d[14]?g?g.p(d,w):(g=Qs(d),g.c(),g.m(l.parentNode,l)):g&&(g.d(1),g=null)},i(d){a||(Ne(n),a=!0)},o(d){Ve(n),a=!1},d(d){d&&(j(e),j(o),j(l)),u[t].d(),p&&p.d(),s[52](null),g&&g.d(d)}}}let Nn=500;function Xo(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 $t(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 Vo(s,e){return Le(this,null,function*(){try{const t=yield fetch("/aiops/aigc/file/downloadFile",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({fileName:s,fileUrl:e})});if(!t.ok)throw new Error("Download failed");const n=t.headers.get("content-type")||"application/octet-stream",i=yield t.blob(),o=window.URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=s,document.body.appendChild(l),l.click(),window.URL.revokeObjectURL(o),document.body.removeChild(l)}catch(t){console.error("Failed to download file:",t)}})}function Qo(s,e,t){let n,i,o="",l=[{id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],a="",c=null,u=null,h={x:0,y:0,alignRight:!1},p=null,g=!1;$.setOptions({breaks:!0,gfm:!0});function d(T){try{const W=$(T);return Ls.sanitize(W)}catch(W){console.warn("Markdown parsing failed, fallback to HTML:",W);try{const ae=T.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return Ls.sanitize(ae)}catch(ae){return console.error("HTML fallback failed:",ae),T}}}let w;function S(T=!1){w&&w.scrollTo({top:w.scrollHeight,behavior:T?"smooth":"auto"})}wi(()=>{S(!1)});let{sessionId:z}=e;function M(){return Le(this,null,function*(){if(!o.trim()||i)return;if(!z){console.error("No session ID available");return}const T={id:Date.now().toString(),type:"user",content:o.trim(),timestamp:Date.now()};t(3,l=[...l,T]);const W=o.trim();t(1,o="");const ae=(Date.now()+1).toString();a="",t(3,l=[...l,{id:ae,type:"assistant",content:"",timestamp:Date.now()}]),t(7,g=!0),c&&c.abort(),c=new AbortController;try{yield Mi("/aiops/aigc/chat/sse",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:z,requestId:Date.now().toString(),keyword:W,flowId:"1"}),signal:c.signal,onmessage(de){try{const Ge=de.data;if(Ge){const tt=Xo(Ge);tt?(t(3,l=l.map(qe=>qe.id===ae?_e(ne({},qe),{attachments:tt}):qe)),S(!0)):(a+=Ge,t(3,l=l.map(qe=>qe.id===ae?_e(ne({},qe),{content:a}):qe)),S(!1))}}catch(Ge){console.error("Failed to process SSE message:",Ge)}},onerror(de){console.error("SSE error:",de),c=null,t(7,g=!1)},onclose(){c=null,t(7,g=!1)}})}catch(de){console.error("Failed to send message:",de),t(7,g=!1)}})}function y(T,W,ae){const de=ae.getBoundingClientRect(),Ge=w.getBoundingClientRect(),tt=de.left<Ge.width/2;t(4,u=W),t(5,h={x:de.left,y:de.top+de.height/2,alignRight:tt})}function _(){t(6,p=setTimeout(()=>{t(4,u=null),t(6,p=null)},200))}ki(()=>{c&&c.abort(),p&&clearTimeout(p)});let k={};function v(T,W){return Le(this,null,function*(){try{const ae=W.replace(/<br\s*\/?>/g,`
48
+ `).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();yield navigator.clipboard.writeText(ae),t(9,k[T]=!0,k),setTimeout(()=>{t(9,k[T]=!1,k),t(9,k)},1500)}catch(ae){console.error("Failed to copy:",ae)}})}let b={},A={},C=!1;function R(T,W){return Le(this,null,function*(){if(b[T]===W){t(10,b[T]=null,b),t(10,b);return}if(t(10,b[T]=W,b),t(10,b),W==="like")try{if(!(yield fetch("/aiops/aigc/chat/record/feedback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:z,requestId:T,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch(ae){console.error("Failed to send feedback:",ae),t(10,b[T]=null,b),t(10,b)}else t(12,C=!0)})}function F(T){return Le(this,null,function*(){var W;if((W=A[T])!=null&&W.trim())try{if(!(yield fetch("/aiops/aigc/chat/record/feedback",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:JSON.stringify({sessionId:z,requestId:T,feedBackFlag:"0",feedBackContent:A[T]})})).ok)throw new Error("Feedback failed");t(12,C=!1),t(11,A[T]="",A),t(11,A)}catch(ae){console.error("Failed to send feedback:",ae),t(10,b[T]=null,b),t(10,b)}})}let I={x:0,y:0};function U(T,W){const de=T.currentTarget.getBoundingClientRect();t(13,I={x:de.left-290,y:de.top-160}),R(W,"dislike")}let V=null;function X(T,W){const de=T.currentTarget.getBoundingClientRect();t(14,V={text:W,x:de.left+de.width/2,y:de.top-8})}function ue(){t(14,V=null)}let fe=!1,me=[],Ie=Date.now().toString();function he(){ue(),t(15,fe=!0)}function je(){ue(),t(15,fe=!1)}function re(T){Ie=T,t(15,fe=!1)}function Qe(){return Le(this,null,function*(){const T=yield le();if(!T){console.error("Failed to create new session");return}Ie=T,t(3,l=[{id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(1,o="")})}function le(){return Le(this,null,function*(){try{const T=yield fetch("/aiops/aigc/chat/getSessionId",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!T.ok)throw new Error("Failed to get session ID");const W=yield T.json();if(W.code===0)return Ie=W.data.sessionId,Ie;throw new Error(W.message||"Failed to get session ID")}catch(T){return console.error("Failed to get session ID:",T),null}})}let{zIndex:ye}=e;const te=(T,W)=>y(W,T.tips,W.currentTarget),ze=T=>Vo(T.content_title,T.link),Te=()=>{p&&(clearTimeout(p),t(6,p=null))},Ke=()=>{t(4,u=null)},O=T=>v(T.id,T.content),se=(T,W)=>X(W,k[T.id]?"已复制":"复制内容"),N=T=>R(T.id,"like"),Y=(T,W)=>X(W,b[T.id]==="like"?"取消点赞":"点赞"),ve=(T,W)=>U(W,T.id),Ee=(T,W)=>X(W,b[T.id]==="dislike"?"取消点踩":"点踩");function He(T){A[T.id]=this.value,t(11,A)}const We=T=>{t(12,C=!1),t(10,b[T.id]=null,b),t(10,b)},et=T=>F(T.id);function kt(T){pt[T?"unshift":"push"](()=>{w=T,t(8,w)})}const _t=T=>X(T,"历史会话"),en=T=>X(T,"新建会话");function tn(){o=this.value,t(1,o)}const Fn=T=>T.key==="Enter"&&!T.shiftKey&&(M(),T.preventDefault()),Nt=T=>X(T,"发送消息");function rt(T){pt[T?"unshift":"push"](()=>{w=T,t(8,w)})}return s.$$set=T=>{"sessionId"in T&&t(32,z=T.sessionId),"zIndex"in T&&t(0,ye=T.zIndex)},s.$$.update=()=>{s.$$.dirty[0]&2&&t(2,n=o.length),s.$$.dirty[0]&4&&t(17,i=n>Nn)},[ye,o,n,l,u,h,p,g,w,k,b,A,C,I,V,fe,me,i,d,M,y,_,v,R,F,U,X,ue,he,je,re,Qe,z,te,ze,Te,Ke,O,se,N,Y,ve,Ee,He,We,et,kt,_t,en,tn,Fn,Nt,rt]}class Ko extends wn{constructor(e){super(),mn(this,e,Qo,Zo,at,{sessionId:32,zIndex:0},null,[-1,-1,-1])}}function Ks(s){let e,t,n,i,o=s[3].title+"",l,a,c,u,h,p,g,d,w,S=s[2]?"退出全屏":"全屏显示",z,M,y,_,k,v,b,A,C=s[7]?"取消吸附":"吸附到边缘",R,F,I,U,V,X,ue,fe,me,Ie=`${s[3].height}px`,he,je,re;function Qe(N,Y){return N[2]?$o:Jo}let le=Qe(s),ye=le(s);function te(N,Y){return N[7]?tl:el}let ze=te(s),Te=ze(s);const Ke=[sl,nl],O=[];function se(N,Y){return N[8]?0:1}return fe=se(s),me=O[fe]=Ke[fe](s),{c(){e=x("div"),t=x("div"),n=x("div"),i=x("h3"),l=be(o),a=q(),c=x("div"),u=x("div"),h=x("button"),p=Q("svg"),ye.c(),d=q(),w=x("span"),z=be(S),M=q(),y=x("div"),_=x("button"),k=Q("svg"),Te.c(),b=q(),A=x("span"),R=be(C),F=q(),I=x("div"),U=x("button"),U.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>',V=q(),X=x("span"),X.textContent="关闭助手",ue=q(),me.c(),r(i,"class","svelte-1dubpto"),r(p,"xmlns","http://www.w3.org/2000/svg"),r(p,"width","18"),r(p,"height","18"),r(p,"viewBox","0 0 24 24"),r(p,"fill","none"),r(p,"stroke","currentColor"),r(p,"stroke-width","2"),r(p,"stroke-linecap","round"),r(p,"stroke-linejoin","round"),r(h,"class","sy-assistant-action-button svelte-1dubpto"),r(h,"aria-label",g=s[2]?"退出全屏":"全屏显示"),K(h,"active",s[2]),r(w,"class","sy-assistant-tooltip svelte-1dubpto"),r(u,"class","sy-assistant-tooltip-wrapper svelte-1dubpto"),r(k,"xmlns","http://www.w3.org/2000/svg"),r(k,"width","18"),r(k,"height","18"),r(k,"viewBox","0 0 24 24"),r(k,"fill","none"),r(k,"stroke","currentColor"),r(k,"stroke-width","2"),r(k,"stroke-linecap","round"),r(k,"stroke-linejoin","round"),r(_,"class","sy-assistant-action-button svelte-1dubpto"),r(_,"aria-label",v=s[7]?"取消吸附":"吸附到边缘"),K(_,"active",s[7]),r(A,"class","sy-assistant-tooltip svelte-1dubpto"),r(y,"class","sy-assistant-tooltip-wrapper svelte-1dubpto"),r(U,"class","sy-assistant-close-button svelte-1dubpto"),r(U,"aria-label","关闭助手"),r(X,"class","sy-assistant-tooltip svelte-1dubpto"),r(I,"class","sy-assistant-tooltip-wrapper svelte-1dubpto"),r(c,"class","sy-assistant-header-actions svelte-1dubpto"),r(n,"class","sy-assistant-drawer-header svelte-1dubpto"),r(n,"role","button"),r(n,"tabindex","0"),r(n,"aria-label","拖动助手窗口"),K(n,"dragging",s[6]),K(n,"fullscreen",s[2]),K(n,"snapped",s[7]),r(t,"class","sy-assistant-drawer-content svelte-1dubpto"),r(e,"class","sy-assistant-drawer svelte-1dubpto"),K(e,"fullscreen",s[2]),P(e,"height",Ie)},m(N,Y){G(N,e,Y),m(e,t),m(t,n),m(n,i),m(i,l),m(n,a),m(n,c),m(c,u),m(u,h),m(h,p),ye.m(p,null),m(u,d),m(u,w),m(w,z),m(c,M),m(c,y),m(y,_),m(_,k),Te.m(k,null),m(y,b),m(y,A),m(A,R),m(c,F),m(c,I),m(I,U),m(I,V),m(I,X),m(t,ue),O[fe].m(t,null),he=!0,je||(re=[B(h,"click",s[16]),B(_,"click",s[18]),B(U,"click",s[15]),B(n,"mousedown",Xn(s[17]))],je=!0)},p(N,Y){(!he||Y[0]&8)&&o!==(o=N[3].title+"")&&De(l,o),le!==(le=Qe(N))&&(ye.d(1),ye=le(N),ye&&(ye.c(),ye.m(p,null))),(!he||Y[0]&4&&g!==(g=N[2]?"退出全屏":"全屏显示"))&&r(h,"aria-label",g),(!he||Y[0]&4)&&K(h,"active",N[2]),(!he||Y[0]&4)&&S!==(S=N[2]?"退出全屏":"全屏显示")&&De(z,S),ze!==(ze=te(N))&&(Te.d(1),Te=ze(N),Te&&(Te.c(),Te.m(k,null))),(!he||Y[0]&128&&v!==(v=N[7]?"取消吸附":"吸附到边缘"))&&r(_,"aria-label",v),(!he||Y[0]&128)&&K(_,"active",N[7]),(!he||Y[0]&128)&&C!==(C=N[7]?"取消吸附":"吸附到边缘")&&De(R,C),(!he||Y[0]&64)&&K(n,"dragging",N[6]),(!he||Y[0]&4)&&K(n,"fullscreen",N[2]),(!he||Y[0]&128)&&K(n,"snapped",N[7]);let ve=fe;fe=se(N),fe===ve?O[fe].p(N,Y):(pn(),Ve(O[ve],1,1,()=>{O[ve]=null}),dn(),me=O[fe],me?me.p(N,Y):(me=O[fe]=Ke[fe](N),me.c()),Ne(me,1),me.m(t,null)),(!he||Y[0]&4)&&K(e,"fullscreen",N[2]),Y[0]&8&&Ie!==(Ie=`${N[3].height}px`)&&P(e,"height",Ie)},i(N){he||(Ne(me),he=!0)},o(N){Ve(me),he=!1},d(N){N&&j(e),ye.d(),Te.d(),O[fe].d(),je=!1,ge(re)}}}function Jo(s){let e;return{c(){e=Q("path"),r(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&&j(e)}}}function $o(s){let e;return{c(){e=Q("path"),r(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&&j(e)}}}function el(s){let e,t;return{c(){e=Q("rect"),t=Q("line"),r(e,"x","3"),r(e,"y","3"),r(e,"width","18"),r(e,"height","18"),r(e,"rx","2"),r(e,"ry","2"),r(t,"x1","16"),r(t,"y1","6"),r(t,"x2","16"),r(t,"y2","18")},m(n,i){G(n,e,i),G(n,t,i)},d(n){n&&(j(e),j(t))}}}function tl(s){let e,t;return{c(){e=Q("rect"),t=Q("rect"),r(e,"x","3"),r(e,"y","3"),r(e,"width","18"),r(e,"height","18"),r(e,"rx","2"),r(e,"ry","2"),r(t,"x","12"),r(t,"y","10"),r(t,"width","6"),r(t,"height","8"),r(t,"rx","1"),r(t,"ry","1")},m(n,i){G(n,e,i),G(n,t,i)},d(n){n&&(j(e),j(t))}}}function nl(s){var n;let e,t;return e=new Ko({props:{zIndex:(n=s[3].zIndex)!=null?n:1e3,sessionId:s[9]}}),{c(){gn(e.$$.fragment)},m(i,o){jt(e,i,o),t=!0},p(i,o){var a;const l={};o[0]&8&&(l.zIndex=(a=i[3].zIndex)!=null?a:1e3),o[0]&512&&(l.sessionId=i[9]),e.$set(l)},i(i){t||(Ne(e.$$.fragment,i),t=!0)},o(i){Ve(e.$$.fragment,i),t=!1},d(i){Wt(e,i)}}}function sl(s){var n;let e,t;return e=new Hs({props:{sessions:s[13],onClose:s[26],onSelect:s[19],zIndex:(n=s[3].zIndex)!=null?n:1e3}}),{c(){gn(e.$$.fragment)},m(i,o){jt(e,i,o),t=!0},p(i,o){var a;const l={};o[0]&256&&(l.onClose=i[26]),o[0]&8&&(l.zIndex=(a=i[3].zIndex)!=null?a:1e3),e.$set(l)},i(i){t||(Ne(e.$$.fragment,i),t=!0)},o(i){Ve(e.$$.fragment,i),t=!1},d(i){Wt(e,i)}}}function il(s){let e,t,n=`${s[12]}px`,i,o,l,a,c,u,h,p,g,d,w,S,z,M,y=s[12]>0&&Ks(s);return{c(){var _,k;e=x("div"),t=x("div"),y&&y.c(),i=q(),o=x("button"),l=Q("svg"),a=Q("path"),c=Q("path"),u=Q("path"),h=Q("path"),p=Q("path"),g=Q("path"),d=Q("path"),r(t,"class","sy-assistant-drawer-wrapper svelte-1dubpto"),K(t,"fullscreen",s[2]),P(t,"width",n),r(a,"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"),r(a,"fill","#6F8698"),r(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"),r(c,"fill","#3677FF"),r(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"),r(u,"fill","#D0D5F1"),r(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"),r(h,"fill","#3677FF"),r(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"),r(p,"fill","#FFFFFF"),r(g,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),r(g,"fill","#FFFFFF"),r(d,"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"),r(d,"fill","#8896A4"),r(l,"class","sy-assistant-icon"),r(l,"viewBox","0 0 1024 1024"),r(l,"version","1.1"),r(l,"xmlns","http://www.w3.org/2000/svg"),r(l,"width","32"),r(l,"height","32"),r(l,"fill","currentColor"),r(l,"aria-label","助手图标"),r(o,"class","sy-assistant-floating-button svelte-1dubpto"),r(o,"aria-label","打开助手"),r(o,"style",w=s[10]+" z-index: "+(((_=s[3].zIndex)!=null?_:1e3)+1)+";"),r(e,"class","sy-assistant-container sy-assistant-theme svelte-1dubpto"),K(e,"fullscreen",s[2]),K(e,"snapped",s[7]),P(e,"position",s[3].position),P(e,"right",s[7]?0:`${s[0]}px`),P(e,"bottom",s[7]?0:`${s[1]}px`),P(e,"top",s[7]||s[2]?"0":"auto"),P(e,"left",s[2]?"0":"auto"),P(e,"z-index",(k=s[3].zIndex)!=null?k:1e3)},m(_,k){G(_,e,k),m(e,t),y&&y.m(t,null),m(e,i),m(e,o),m(o,l),m(l,a),m(l,c),m(l,u),m(l,h),m(l,p),m(l,g),m(l,d),s[27](o),s[29](e),S=!0,z||(M=[B(o,"click",s[15]),B(o,"mousedown",Xn(s[28]))],z=!0)},p(_,k){var v,b;_[12]>0?y?(y.p(_,k),k[0]&4096&&Ne(y,1)):(y=Ks(_),y.c(),Ne(y,1),y.m(t,null)):y&&(pn(),Ve(y,1,1,()=>{y=null}),dn()),(!S||k[0]&4)&&K(t,"fullscreen",_[2]),k[0]&4096&&n!==(n=`${_[12]}px`)&&P(t,"width",n),(!S||k[0]&1032&&w!==(w=_[10]+" z-index: "+(((v=_[3].zIndex)!=null?v:1e3)+1)+";"))&&r(o,"style",w),(!S||k[0]&4)&&K(e,"fullscreen",_[2]),(!S||k[0]&128)&&K(e,"snapped",_[7]),k[0]&8&&P(e,"position",_[3].position),k[0]&129&&P(e,"right",_[7]?0:`${_[0]}px`),k[0]&130&&P(e,"bottom",_[7]?0:`${_[1]}px`),k[0]&132&&P(e,"top",_[7]||_[2]?"0":"auto"),k[0]&4&&P(e,"left",_[2]?"0":"auto"),k[0]&8&&P(e,"z-index",(b=_[3].zIndex)!=null?b:1e3)},i(_){S||(Ne(y),S=!0)},o(_){Ve(y),S=!1},d(_){_&&j(e),y&&y.d(),s[27](null),s[29](null),z=!1,ge(M)}}}const Pn=48,pe=20;function ol(s,e,t){let n,i,o,l,a=H,c=()=>(a(),a=Xe(i,O=>t(12,l=O)),i);s.$$.on_destroy.push(()=>a());const u={position:"fixed",width:480,height:600,title:"智慧运维助手",initialState:"default",defaultPosition:{right:pe,bottom:pe},snappedWidth:480,drawerWidth:480,zIndex:1e3};let{target:h="body"}=e,{options:p={}}=e,g,d=null,w=!1,S,z=!1,M=0,y=0,_=pe,k=20,v=_,b=k,A=!1,C=pe,R=50,F=!1,I={width:0,height:0,right:0,bottom:0},U=!1,V=!1,X=[],ue=null;function fe(){return Le(this,null,function*(){try{const O=yield fetch("/aiops/aigc/chat/getSessionId",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!O.ok)throw new Error("Failed to get session ID");const se=yield O.json();if(se.code===0)return t(9,ue=se.data.sessionId),ue;throw new Error(se.message||"Failed to get session ID")}catch(O){return console.error("Failed to get session ID:",O),null}})}function me(O,se=!1){se?t(23,A=!0):t(6,z=!0),M=O.clientX,y=O.clientY,_=se?C:v,k=se?R:b,O.preventDefault()}function Ie(O){if(!z&&!A)return;const se=M-O.clientX,N=y-O.clientY;if(A){const Y=_+se,ve=O.clientY;t(24,C=Math.max(pe,Math.min(window.innerWidth-Pn-pe,Y)));const Ee=window.innerHeight-Pn-pe,We=Math.max(pe,Math.min(Ee,ve));t(25,R=(window.innerHeight-We-Pn)/window.innerHeight*100)}else{const Y=n.width||0,ve=n.height||0,Ee=_+se;t(0,v=Math.max(pe,Math.min(window.innerWidth-Y-pe,Ee)));const He=k+N;t(1,b=Math.max(pe,Math.min(window.innerHeight-ve-pe,He)))}}function he(){t(6,z=!1),t(23,A=!1)}Vn(()=>{typeof h=="string"?d=document.querySelector(h)||document.body:d=h||document.body;const O=N=>Ie(N),se=()=>he();return document.addEventListener("mousemove",O),document.addEventListener("mouseup",se),g&&d&&d.appendChild(g),S&&S.getBoundingClientRect().left,t(7,U=n.initialState==="snapped"),t(2,F=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,v=0),t(1,b=0),t(3,n=_e(ne({},n),{height:typeof window!="undefined"?window.innerHeight:n.height,width:n.snappedWidth||n.width}))):n.initialState==="fullscreen"&&(t(0,v=0),t(1,b=0),t(3,n=_e(ne({},n),{width:typeof window!="undefined"?window.innerWidth:n.width,height:typeof window!="undefined"?window.innerHeight:n.height}))),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",se),d&&g&&d.removeChild(g)}});function je(){return Le(this,null,function*(){w||(yield fe()),t(22,w=!w)})}function re(){var O,se,N,Y,ve,Ee,He,We;t(2,F=!F),F?(I.width||(I={width:u.width,height:u.height,right:(se=(O=u.defaultPosition)==null?void 0:O.right)!=null?se:pe,bottom:(Y=(N=u.defaultPosition)==null?void 0:N.bottom)!=null?Y:pe}),U&&t(7,U=!1),t(20,p=_e(ne({},n),{width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth})),t(0,v=0),t(1,b=0)):(t(20,p=_e(ne({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,v=(Ee=(ve=u.defaultPosition)==null?void 0:ve.right)!=null?Ee:pe),t(1,b=(We=(He=u.defaultPosition)==null?void 0:He.bottom)!=null?We:pe))}function Qe(O){F||me(O)}function le(){var O,se,N,Y;F&&(t(2,F=!1),t(20,p=_e(ne({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth}))),t(7,U=!U),U?(n.height,t(0,v=0),t(1,b=0),t(20,p=_e(ne({},n),{height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width}))):(t(20,p=_e(ne({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,v=(se=(O=u.defaultPosition)==null?void 0:O.right)!=null?se:pe),t(1,b=(Y=(N=u.defaultPosition)==null?void 0:N.bottom)!=null?Y:pe))}function ye(O){t(8,V=!1)}const te=()=>t(8,V=!1);function ze(O){pt[O?"unshift":"push"](()=>{S=O,t(5,S)})}const Te=O=>me(O,!0);function Ke(O){pt[O?"unshift":"push"](()=>{g=O,t(4,g)})}return s.$$set=O=>{"target"in O&&t(21,h=O.target),"options"in O&&t(20,p=O.options)},s.$$.update=()=>{s.$$.dirty[0]&1048576&&t(3,n=_e(ne(ne({},u),p),{defaultPosition:ne(ne({},u.defaultPosition),p.defaultPosition)})),s.$$.dirty[0]&4194316&&c(t(11,i=Ai(w?F?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),s.$$.dirty[0]&11&&typeof window!="undefined"&&(t(0,v=Math.max(pe,Math.min(window.innerWidth-(n.width||0),v))),t(1,b=Math.max(pe,Math.min(window.innerHeight-(n.height||0),b)))),s.$$.dirty[0]&62914560&&t(10,o=w?"display: none;":`position: fixed; right: ${C}px; bottom: ${R}%; transform: none; cursor: ${A?"grabbing":"grab"};`)},[v,b,F,n,g,S,z,U,V,ue,o,i,l,X,me,je,re,Qe,le,ye,p,h,w,A,C,R,te,ze,Te,Ke]}class ll extends wn{constructor(e){super(),mn(this,e,ol,il,at,{target:21,options:20},null,[-1,-1])}}J.SyAssistant=ll,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});