@sy-design/svelte 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -4589,7 +4589,7 @@ function rl(s) {
4589
4589
  props: {
4590
4590
  zIndex: (
4591
4591
  /*mergedOptions*/
4592
- s[3].zIndex ?? 1e3
4592
+ s[3].zIndex || 1e3
4593
4593
  ),
4594
4594
  sessionId: (
4595
4595
  /*currentSessionId*/
@@ -4607,7 +4607,7 @@ function rl(s) {
4607
4607
  const o = {};
4608
4608
  i[0] & /*mergedOptions*/
4609
4609
  8 && (o.zIndex = /*mergedOptions*/
4610
- n[3].zIndex ?? 1e3), i[0] & /*currentSessionId*/
4610
+ n[3].zIndex || 1e3), i[0] & /*currentSessionId*/
4611
4611
  512 && (o.sessionId = /*currentSessionId*/
4612
4612
  n[9]), e.$set(o);
4613
4613
  },
@@ -4640,7 +4640,7 @@ function al(s) {
4640
4640
  ),
4641
4641
  zIndex: (
4642
4642
  /*mergedOptions*/
4643
- s[3].zIndex ?? 1e3
4643
+ s[3].zIndex || 1e3
4644
4644
  )
4645
4645
  }
4646
4646
  }), {
@@ -4656,7 +4656,7 @@ function al(s) {
4656
4656
  256 && (o.onClose = /*func*/
4657
4657
  n[26]), i[0] & /*mergedOptions*/
4658
4658
  8 && (o.zIndex = /*mergedOptions*/
4659
- n[3].zIndex ?? 1e3), e.$set(o);
4659
+ n[3].zIndex || 1e3), e.$set(o);
4660
4660
  },
4661
4661
  i(n) {
4662
4662
  t || (Ce(e.$$.fragment, n), t = !0);
@@ -4684,7 +4684,7 @@ function cl(s) {
4684
4684
  s[2]
4685
4685
  ), 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(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 = /*buttonStyle*/
4686
4686
  s[10] + " z-index: " + /*mergedOptions*/
4687
- ((s[3].zIndex ?? 1e3) + 1) + ";"), r(e, "class", "sy-assistant-container sy-assistant-theme svelte-1dubpto"), Q(
4687
+ ((s[3].zIndex || 1e3) + 1) + ";"), r(e, "class", "sy-assistant-container sy-assistant-theme svelte-1dubpto"), Q(
4688
4688
  e,
4689
4689
  "fullscreen",
4690
4690
  /*isFullscreen*/
@@ -4726,7 +4726,7 @@ function cl(s) {
4726
4726
  e,
4727
4727
  "z-index",
4728
4728
  /*mergedOptions*/
4729
- s[3].zIndex ?? 1e3
4729
+ s[3].zIndex || 1e3
4730
4730
  );
4731
4731
  },
4732
4732
  m(_, k) {
@@ -4759,7 +4759,7 @@ function cl(s) {
4759
4759
  _[12]}px`) && N(t, "width", n), (!E || k[0] & /*buttonStyle, mergedOptions*/
4760
4760
  1032 && w !== (w = /*buttonStyle*/
4761
4761
  _[10] + " z-index: " + /*mergedOptions*/
4762
- ((_[3].zIndex ?? 1e3) + 1) + ";")) && r(o, "style", w), (!E || k[0] & /*isFullscreen*/
4762
+ ((_[3].zIndex || 1e3) + 1) + ";")) && r(o, "style", w), (!E || k[0] & /*isFullscreen*/
4763
4763
  4) && Q(
4764
4764
  e,
4765
4765
  "fullscreen",
@@ -4809,7 +4809,7 @@ function cl(s) {
4809
4809
  e,
4810
4810
  "z-index",
4811
4811
  /*mergedOptions*/
4812
- _[3].zIndex ?? 1e3
4812
+ _[3].zIndex || 1e3
4813
4813
  );
4814
4814
  },
4815
4815
  i(_) {
@@ -4904,8 +4904,8 @@ function ul(s, e, t) {
4904
4904
  t(2, P = !P), P ? (I.width || (I = {
4905
4905
  width: u.width,
4906
4906
  height: u.height,
4907
- right: ((O = u.defaultPosition) == null ? void 0 : O.right) ?? ue,
4908
- bottom: ((ee = u.defaultPosition) == null ? void 0 : ee.bottom) ?? ue
4907
+ right: ((O = u.defaultPosition) == null ? void 0 : O.right) || ue,
4908
+ bottom: ((ee = u.defaultPosition) == null ? void 0 : ee.bottom) || ue
4909
4909
  }), B && t(7, B = !1), t(20, p = {
4910
4910
  ...n,
4911
4911
  width: window.innerWidth,
@@ -4916,7 +4916,7 @@ function ul(s, e, t) {
4916
4916
  width: u.width,
4917
4917
  height: u.height,
4918
4918
  drawerWidth: u.drawerWidth
4919
- }), t(0, S = ((F = u.defaultPosition) == null ? void 0 : F.right) ?? ue), t(1, b = ((X = u.defaultPosition) == null ? void 0 : X.bottom) ?? ue));
4919
+ }), t(0, S = ((F = u.defaultPosition) == null ? void 0 : F.right) || ue), t(1, b = ((X = u.defaultPosition) == null ? void 0 : X.bottom) || ue));
4920
4920
  }
4921
4921
  function Ue(O) {
4922
4922
  P || fe(O);
@@ -4938,7 +4938,7 @@ function ul(s, e, t) {
4938
4938
  width: u.width,
4939
4939
  height: u.height,
4940
4940
  drawerWidth: u.drawerWidth
4941
- }), t(0, S = ((O = u.defaultPosition) == null ? void 0 : O.right) ?? ue), t(1, b = ((ee = u.defaultPosition) == null ? void 0 : ee.bottom) ?? ue));
4941
+ }), t(0, S = ((O = u.defaultPosition) == null ? void 0 : O.right) || ue), t(1, b = ((ee = u.defaultPosition) == null ? void 0 : ee.bottom) || ue));
4942
4942
  }
4943
4943
  function de(O) {
4944
4944
  t(8, Z = !1);
package/dist/index.umd.js CHANGED
@@ -45,4 +45,4 @@ ${e}</tr>
45
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
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
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"})});
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"})});
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "name": "@sy-design/svelte",
3
- "version": "1.0.4",
4
- "description": "跨框架组件封装",
5
- "type": "module",
6
- "module": "dist/index.es.js",
7
- "main": "dist/index.umd.js",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/index.es.js",
11
- "require": "./dist/index.umd.js"
12
- },
13
- "./style.css": "./dist/style.css"
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "scripts": {
19
- "build": "vite build"
20
- },
21
- "dependencies": {
22
- "svelte": "^4.2.10",
23
- "@microsoft/fetch-event-source": "^2.0.1",
24
- "marked": "^11.1.0",
25
- "dompurify": "^3.0.6"
26
- },
27
- "devDependencies": {
28
- "@sveltejs/package": "^2.2.6",
29
- "@sveltejs/vite-plugin-svelte": "^3.0.2",
30
- "@tsconfig/svelte": "^5.0.2",
31
- "svelte-check": "^3.6.3",
32
- "svelte-preprocess": "^5.1.3",
33
- "typescript": "^5.2.2",
34
- "tslib": "^2.6.2",
35
- "vite": "^5.0.10"
36
- }
37
- }
1
+ {
2
+ "name": "@sy-design/svelte",
3
+ "version": "1.0.5",
4
+ "description": "跨框架组件封装",
5
+ "type": "module",
6
+ "module": "dist/index.es.js",
7
+ "main": "dist/index.umd.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.es.js",
11
+ "require": "./dist/index.umd.js"
12
+ },
13
+ "./style.css": "./dist/style.css"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "vite build"
20
+ },
21
+ "dependencies": {
22
+ "svelte": "^4.2.10",
23
+ "@microsoft/fetch-event-source": "^2.0.1",
24
+ "marked": "^11.1.0",
25
+ "dompurify": "^3.0.6"
26
+ },
27
+ "devDependencies": {
28
+ "@sveltejs/package": "^2.2.6",
29
+ "@sveltejs/vite-plugin-svelte": "^3.0.2",
30
+ "@tsconfig/svelte": "^5.0.2",
31
+ "svelte-check": "^3.6.3",
32
+ "svelte-preprocess": "^5.1.3",
33
+ "typescript": "^5.2.2",
34
+ "tslib": "^2.6.2",
35
+ "vite": "^5.0.10"
36
+ }
37
+ }