HEX
Server: nginx/1.28.3
System: Linux ip-172-31-12-242 6.17.0-1007-aws #7~24.04.1-Ubuntu SMP Thu Jan 22 21:04:49 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/server/panel/BTPanel/static/js/index-legacy110.js
!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],o=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}}}throw new TypeError(e(t)+" is not iterable")}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach(function(t){a(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function a(t,n,o){return(n=function(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var a=o.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,a=function(){};return{s:a,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,i=!0,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){r=!0,l=e},f:function(){try{i||null==n.return||n.return()}finally{if(r)throw l}}}}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,o,a,l){var i=o&&o.prototype instanceof u?o:u,c=Object.create(i.prototype);return r(c,"_invoke",function(n,o,a){var l,i,r,u=0,c=a||[],d=!1,v={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return l=t,i=0,r=e,v.n=n,s}};function f(n,o){for(i=n,r=o,t=0;!d&&u&&!a&&t<c.length;t++){var a,l=c[t],f=v.p,p=l[2];n>3?(a=p===o)&&(r=l[(i=l[4])?5:(i=3,3)],l[4]=l[5]=e):l[0]<=f&&((a=n<2&&f<l[1])?(i=0,v.v=o,v.n=l[1]):f<p&&(a=n<3||l[0]>o||o>p)&&(l[4]=n,l[5]=o,v.n=p,i=0))}if(a||n>1)return s;throw d=!0,o}return function(a,c,p){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,p),i=c,r=p;(t=i<2?e:r)||!d;){l||(i?i<3?(i>1&&(v.n=-1),f(i,r)):v.n=r:v.v=r);try{if(u=2,l){if(i||(a="next"),t=l[a]){if(!(t=t.call(l,r)))throw TypeError("iterator result is not an object");if(!t.done)return t;r=t.value,i<2&&(i=0)}else 1===i&&(t=l.return)&&t.call(l),i<2&&(r=TypeError("The iterator does not provide a '"+a+"' method"),i=1);l=e}else if((t=(d=v.n<0)?r:n.call(o,v))!==s)break}catch(t){l=e,i=1,r=t}finally{u=1}}return{value:t,done:d}}}(n,a,l),!0),c}var s={};function u(){}function c(){}function d(){}t=Object.getPrototypeOf;var v=[][o]?t(t([][o]())):(r(t={},o,function(){return this}),t),f=d.prototype=u.prototype=Object.create(v);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=d,r(f,"constructor",d),r(d,"constructor",c),c.displayName="GeneratorFunction",r(d,a,"GeneratorFunction"),r(f),r(f,a,"Generator"),r(f,o,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(i=function(){return{w:l,m:p}})()}function r(e,t,n,o){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}r=function(e,t,n,o){function l(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(l("next",0),l("throw",1),l("return",2))},r(e,t,n,o)}function s(e,t,n,o,a,l,i){try{var r=e[l](i),s=r.value}catch(e){return void n(e)}r.done?t(s):Promise.resolve(s).then(o,a)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(o,a){var l=e.apply(t,n);function i(e){s(l,o,a,i,r,"next",e)}function r(e){s(l,o,a,i,r,"throw",e)}i(void 0)})}}function c(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,a,l,i,r=[],s=!0,u=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(o=l.call(n)).done)&&(r.push(o.value),r.length!==t);s=!0);}catch(e){u=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw a}}return r}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}System.register(["./base-lib-legacy.js?v=1777008528","./utils-lib-legacy.js?v=1777008528","./index-legacy3.js?v=1777008528","./index-legacy219.js?v=1777008528","./useController-legacy24.js?v=1777008528","./chat-utils-legacy.js?v=1777008528","./ai-legacy.js?v=1777008528","./hooks-legacy.js?v=1777008528","./index-legacy116.js?v=1777008528","./index-legacy117.js?v=1777008528","./index-legacy118.js?v=1777008528","./index-legacy119.js?v=1777008528","./index-legacy120.js?v=1777008528","./index-legacy121.js?v=1777008528","./__commonjsHelpers__-legacy.js?v=1777008528","./marked.esm-legacy.js?v=1777008528"],function(e,n){"use strict";var a,r,s,v,f,p,m,h,g,y,w,b,k,_,C,x,M,T,S,L,B,A,I,E,P,O,j,R,z,D,N,U,H,V,W,F,q,Z,$,G,K,J,X,Q,Y,ee,te,ne,oe,ae,le,ie,re,se,ue,ce,de,ve,fe,pe,me,he,ge,ye,we,be,ke,_e,Ce,xe,Me,Te,Se,Le,Be,Ae,Ie,Ee,Pe,Oe,je,Re,ze,De,Ne,Ue,He,Ve,We,Fe,qe,Ze,$e,Ge,Ke,Je,Xe,Qe,Ye,et,tt,nt,ot,at,lt,it,rt,st,ut,ct,dt,vt,ft,pt,mt,ht,gt,yt,wt,bt,kt,_t,Ct,xt,Mt,Tt,St,Lt,Bt,At,It,Et,Pt,Ot,jt,Rt,zt;return{setters:[function(e){a=e.c,r=e.aI,s=e.a7,v=e.g,f=e.p,p=e.j,m=e.k,h=e.q,g=e.L,y=e.e,w=e.v,b=e.M,k=e.F,_=e.B,C=e.s,x=e.y,M=e.bS,T=e.aB,S=e.r,L=e.w,B=e.aN,A=e.aH,I=e.o,E=e.J,P=e.K,O=e.m,j=e.aW,R=e.i,z=e.R,D=e.A,N=e.x,U=e.C,H=e.bm,V=e.b3,W=e.n,F=e.a8,q=e.bu,Z=e.cb,$=e.Q,G=e.cc,K=e.cd,J=e.b,X=e.t,Q=e.ce,Y=e.a3,ee=e.cf,te=e.z,ne=e.bi,oe=e.aV,ae=e.ab,le=e.ad,ie=e.at,re=e.as,se=e.ar,ue=e.cg,ce=e.aA,de=e.T,ve=e.ay,fe=e.an,pe=e.am,me=e.H,he=e.a_,ge=e.O,ye=e.ch,we=e.ci,be=e.b$},function(e){ke=e.c,_e=e.i9,Ce=e.ia,xe=e.ib,Me=e.q,Te=e.T,Se=e.p,Le=e.t,Be=e.cZ,Ae=e.lh,Ie=e.f,Ee=e.jA,Pe=e.w,Oe=e.M,je=e.e,Re=e._,ze=e.lP,De=e.iA,Ne=e.lQ,Ue=e.b,He=e.lR,Ve=e.K,We=e.cO,Fe=e.c7,qe=e.d3,Ze=e.d8,$e=e.u,Ge=e.i,Ke=e.ds,Je=e.r,Xe=e.G,Qe=e.dm,Ye=e.li,et=e.lS,tt=e.Q,nt=e.j,ot=e.cs},function(e){at=e.w,lt=e.o,it=e.h,rt=e.dN,st=e.k,ut=e.a0,ct=e.ca},function(e){dt=e.default},function(e){vt=e.b,ft=e.c,pt=e.e,mt=e.j,ht=e.k,gt=e.l,yt=e.m,wt=e.n,bt=e.o,kt=e.p,_t=e.r,Ct=e.t,xt=e.u},function(e){Mt=e.p,Tt=e.i,St=e.f,Lt=e.a,Bt=e.r},function(e){At=e.p},function(e){It=e.u},function(e){Et=e._},function(e){Pt=e._},function(e){Ot=e._},function(e){jt=e._},function(e){Rt=e.B},function(e){zt=e._},null,null],execute:function(){var Dt={key:0,class:"dev-theme-switcher"},Nt={class:"switcher-content"},Ut={class:"theme-btn color-trigger-btn",title:"切换主题色"},Ht={class:"color-popover-inner"},Vt={class:"color-grid"},Wt=["title","onClick"],Ft={class:"color-label"},qt=Be(a({__name:"dev-theme-switcher",setup:function(e){var t=r(ke()),n=t.globalTheme,o=t.scheme,a=s(),l=v(function(){var e=n.value.theme.preset||o.value;return"auto"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e||"light"}),i=function(e,t){l.value!==e&&Me(t,function(){n.value.theme.preset=e,o.value=e,window.vite_public_panel_theme.theme.preset=e,Te.updateThemePreset(e),a.value="auto"===e?"dark"===Se():"dark"===e})},u=v(function(){return Object.entries(_e).filter(function(e){var t=d(e,1)[0];return!["grey","light"].includes(t)}).map(function(e){var t,o=d(e,2),a=o[0],l=o[1];return{value:a,label:l.label,gradient:l.gradient,active:Ce(l.primary,(null===(t=n.value.theme)||void 0===t?void 0:t.color)||"")}})}),S=v(function(){var e;return!xe((null===(e=n.value.theme)||void 0===e?void 0:e.color)||"")}),L=v(function(){return"dark"===l.value?"dark":"light"}),B=function(e){var t=Le(e);t&&(n.value.theme.color=t,window.vite_public_panel_theme.theme.color=t,Te.updateThemeColor(t,L.value))},A=function(e){e&&Te.updateThemeColor(e,L.value)};return function(e,t){var o=M,a=T;return f(false)?(p(),m("div",Dt,[h("div",Nt,[h("button",{class:g(["theme-btn",{active:"light"===l.value}]),title:"切换到亮色模式",onClick:t[0]||(t[0]=function(e){return i("light",e)})},c(t[3]||(t[3]=[h("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},[h("path",{fill:"currentColor",d:"M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})],-1)])),2),h("button",{class:g(["theme-btn",{active:"dark"===l.value}]),title:"切换到暗色模式",onClick:t[1]||(t[1]=function(e){return i("dark",e)})},c(t[4]||(t[4]=[h("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},[h("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})],-1)])),2),t[7]||(t[7]=h("div",{class:"switcher-divider"},null,-1)),y(a,{placement:"top-end",width:220,trigger:"click","popper-class":"dev-color-popover","show-arrow":!1},{reference:w(function(){return[h("button",Ut,[h("span",{class:"color-dot",style:b({background:f(n).theme.color})},null,4)])]}),default:w(function(){return[h("div",Ht,[t[6]||(t[6]=h("p",{class:"color-popover-title"},"主题色",-1)),h("div",Vt,[(p(!0),m(k,null,_(u.value,function(e){return p(),m("div",{key:e.value,class:g(["color-swatch-item",{active:e.active}]),title:e.label,onClick:function(t){return B(e.value)}},[h("div",{class:"color-swatch",style:b({background:e.gradient})},null,4),h("span",Ft,C(e.label),1)],10,Wt)}),128)),h("div",{class:g(["color-swatch-item color-swatch-item--custom",{active:S.value}]),title:"自定义"},[y(o,{modelValue:f(n).theme.color,"onUpdate:modelValue":t[2]||(t[2]=function(e){return f(n).theme.color=e}),size:"small",onChange:B,onActiveChange:A},null,8,["modelValue"]),t[5]||(t[5]=h("span",{class:"color-label"},"自定义",-1))],2)])])]}),_:1})])])):x("",!0)}}}),[["__scopeId","data-v-bf4839f3"]]),Zt=["src"],$t=a({__name:"index",setup:function(e){var t=ke().pluginInfo,n=Ie(),o=S(),a=S(0),l=S();return L(function(){return t.value.visible},function(e){e?l.value=n.load("正在加载插件数据,请稍候..."):l.value.close()}),B(function(){t.value.visible&&t.value.init&&function(){var e=t.value,n=e.id,a=e.name,l=e.built;if(l)t.value.visible=!1;else{var i={pluginName:n,pluginTitle:a,pluginBuilt:l};o.value.contentWindow.postMessage("".concat(JSON.stringify(i)),"*"),"function"==typeof t.value.callback&&t.value.callback(o.value.contentWindow)}}()}),A(function(){a.value&&clearInterval(a.value)}),I(function(){window.addEventListener("message",function(){var e=u(i().m(function e(o){var a,r,s,u,c,d,v;return i().w(function(e){for(;;)switch(e.n){case 0:s=o.data,"string"==typeof o.data&&-1!==(null===(a=o.data)||void 0===a?void 0:a.indexOf("&"))&&(u=o.data.split("&"),s=u[0]),v=s,e.n="closePlugin"===v?1:"refreshMain"===v?2:"pluginLoad"===v?3:4;break;case 1:return t.value.visible=!1,document.getElementById("app-container").style.position="relative",t.value.visible=!1,-1!==(null===(r=o.data)||void 0===r?void 0:r.indexOf("&"))&&(c=o.data.split("&"),d=!1,"success"===String(c[2])&&(d=!0),n.request({status:d,msg:String(c[1])}),t.value.visible=!1),e.a(3,4);case 2:return window.location.reload(),e.a(3,4);case 3:return l.value.close(),e.a(3,4);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()),o.value.onload=function(){t.value.init=!0}}),function(e,n){return E((p(),m("iframe",{ref_key:"iframeRef",ref:o,src:f(Ae)?"/software.html":"/software",class:"w-full h-full !fixed z-999999 min-h-[45rem] top-0 bg-transparent"},null,8,Zt)),[[P,f(t).visible]])}}}),Gt=Be($t,[["__scopeId","data-v-836e8177"]]);var Kt=a({name:"BtTooltip",setup:function(e,t){var n=t.attrs,o=t.slots;return function(){return y(j,O(n,e),"function"==typeof(t=o)||"[object Object]"===Object.prototype.toString.call(t)&&!R(t)?o:{default:function(){return[o]}});var t}}});function Jt(e){try{var t=JSON.parse(e).todos;if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))return t}catch(n){}}function Xt(e){try{var t=e.match(/<toolcall_result>\s*([\s\S]*?)\s*<\/toolcall_result>/);if(!t)return;var n=t[1].trim(),o=JSON.parse(n);if(Array.isArray(o))return o}catch(a){}}var Qt=S(""),Yt=S([]),en=S([]),tn=S(null),nn=S(!1),on=S(!1),an=S(!1),ln=S([]),rn=S(!1),sn=S([]),un=S(""),cn=S([]),dn=S([]),vn=S(!1),fn=S(!1),pn=S(!1),mn=S(!1),hn=S(!0);function gn(){var e=function(e){for(var t=[],n=0;n<e.length;){var o=e[n];if("user"===o.role)t.push({role:"user",content:o.content,time:new Date(1e3*o.timestamp).toISOString(),id:o.id}),n++;else if("assistant"===o.role){var a=[];if(o.reasoning_content&&a.push({type:"think",content:o.reasoning_content,collapsed:!0}),o.tool_calls&&o.tool_calls.length>0){var i,r=l(o.tool_calls);try{var s=function(){var t=i.value,n="TodoWrite"===t.function.name,o=function(){try{return JSON.parse(t.function.arguments).description}catch(e){return}}(),l={type:"tool_call",tool:t.function.name,args:t.function.arguments,id:t.id,status:"calling",collapsed:!n,description:o,todoItems:n?Jt(t.function.arguments):void 0},r=e.find(function(e){return"tool"===e.role&&e.tool_call_id===t.id});r&&(l.result=r.content,l.status="completed"),a.push(l)};for(r.s();!(i=r.n()).done;)s()}catch(d){r.e(d)}finally{r.f()}}var u=o.content;if(Array.isArray(o.content)){var c=o.content.find(function(e){return"text"===e.type});u=(null==c?void 0:c.text)||""}for(u&&a.push({type:"message",content:u}),t.push({role:"assistant",content:u||"",time:new Date(1e3*o.timestamp).toISOString(),contentBlocks:a.length>0?a:void 0,id:o.id}),n++;n<e.length&&"tool"===e[n].role;)n++}else o.role,n++}return t},t=function(){var e=u(i().m(function e(){var t,n;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,vt({sessions_dir:"aics_sessions"});case 1:t=e.v,(n=t.data).status&&Array.isArray(n.data)&&(en.value=n.data.map(function(e){var t;return{id:e.session_id,title:Array.isArray(e.title)?(null===(t=e.title.find(function(e){return"text"===e.type}))||void 0===t?void 0:t.text)||"图片信息":e.title,messages:[],updatedAt:e.time_str}}));case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),n=function(){var t=u(i().m(function t(n){var o,a,l,r,s;return i().w(function(t){for(;;)switch(t.n){case 0:if(!((o=en.value.find(function(e){return e.id===n}))&&o.messages.length>0)){t.n=1;break}return tn.value=n,Yt.value=c(o.messages),t.a(2);case 1:return t.n=2,ft({session_id:n,sessions_dir:"aics_sessions"});case 2:a=t.v,(l=a.data).data&&Array.isArray(l.data)&&(r=e(l.data),(s=en.value.findIndex(function(e){return e.id===n}))>=0&&(en.value[s].messages=r),tn.value=n,Yt.value=r);case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),o=function(){var e=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,pt({session_id:t,sessions_dir:"aics_sessions"});case 1:e.v.status&&(en.value=en.value.filter(function(e){return e.id!==t}),tn.value===t&&a());case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),a=function(){tn.value=null,Yt.value=[],ln.value=[]};return{inputMessage:Qt,currentMessages:Yt,conversations:en,currentConversationId:tn,historyPanelVisible:nn,isTyping:on,isSending:an,streamingContentBlocks:ln,streamingThinkCollapsed:rn,modelsList:sn,currentModel:un,toolsList:cn,selectedTools:dn,showToolPopover:vn,modelsLoading:fn,toolsLoading:pn,webSearchEnabled:mn,smartMode:hn,loadConversations:t,saveConversation:function(){if(tn.value&&0!==Yt.value.length){var e=Yt.value.find(function(e){return"user"===e.role}),t="新对话";if(e)if("string"==typeof e.content)t=e.content.substring(0,30);else if(Array.isArray(e.content)){var n=e.content.find(function(e){return"text"===e.type});t=null!=n&&n.text?n.text.substring(0,30):"[图片消息]"}var o={id:tn.value,title:t,messages:Yt.value,updatedAt:(new Date).toISOString()},a=en.value.findIndex(function(e){return e.id===tn.value});a>=0?en.value[a]=o:en.value.unshift(o)}},loadConversation:n,deleteConversation:o,createNewConversation:a,getTimeAgo:function(e){var t=(new Date).getTime()-e.getTime(),n=Math.floor(t/6e4),o=Math.floor(t/36e5),a=Math.floor(t/864e5);return n<1?"刚刚":n<60?"".concat(n,"分钟前"):o<24?"".concat(o,"小时前"):a<7?"".concat(a,"天前"):e.toLocaleDateString("zh-CN",{month:"numeric",day:"numeric"})}}}var yn={class:"history-panel-header"},wn={class:"history-list"},bn={key:0,class:"history-empty"},kn=["onClick"],_n={class:"history-item-title"},Cn={class:"history-item-time"},xn=["onClick"],Mn=a({__name:"ChatSidebar",props:{conversations:{},currentConversationId:{},panelVisible:{type:Boolean},getTimeAgo:{type:Function},isSending:{type:Boolean}},emits:["showPanel","hidePanel","startHideTimer","clearHideTimer","loadConversation","deleteConversation"],setup:function(e,t){var n=t.emit;function o(){return(o=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Pe({title:"删除对话",content:"确定要删除这个对话吗?",type:"default top-index"});case 1:n("deleteConversation",t);case 2:return e.a(2)}},e)}))).apply(this,arguments)}return function(t,n){return p(),m("div",{class:g(["history-panel",{"show-panel":e.panelVisible}]),onMouseenter:n[1]||(n[1]=function(e){return t.$emit("clearHideTimer")}),onMouseleave:n[2]||(n[2]=function(e){return t.$emit("startHideTimer")})},[h("div",yn,[n[4]||(n[4]=h("h4",null,"历史对话",-1)),h("button",{class:"close-panel-btn",onClick:n[0]||(n[0]=function(e){return t.$emit("hidePanel")})},c(n[3]||(n[3]=[h("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),h("div",wn,[0===e.conversations.length?(p(),m("div",bn,c(n[5]||(n[5]=[h("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})],-1),h("div",{class:"empty-title"},"暂无历史对话",-1),h("div",{class:"empty-desc"},"开始新对话后会显示在这里",-1)])))):(p(!0),m(k,{key:1},_(e.conversations,function(a){return p(),m("div",{key:a.id,class:g(["history-item",{active:a.id===e.currentConversationId}]),onClick:function(e){return t.$emit("loadConversation",a.id)}},[h("div",_n,C(a.title),1),h("div",Cn,C(e.getTimeAgo(new Date(a.updatedAt))),1),h("button",{class:"history-item-delete",title:"删除对话",onClick:z(function(e){return function(e){return o.apply(this,arguments)}(a.id)},["stop"])},c(n[6]||(n[6]=[D('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-9a9ac381><polyline points="3 6 5 6 21 6" data-v-9a9ac381></polyline><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" data-v-9a9ac381></path><line x1="10" y1="11" x2="10" y2="17" data-v-9a9ac381></line><line x1="14" y1="11" x2="14" y2="17" data-v-9a9ac381></line></svg>',1)])),8,xn)],10,kn)}),128))])],34)}}}),Tn=Be(Mn,[["__scopeId","data-v-9a9ac381"]]),Sn=S(!1),Ln=S("");function Bn(e){return e.contentBlocks&&e.contentBlocks.length>0?e.contentBlocks.filter(function(e){return"message"===e.type}).map(function(e){return e.content}).join("\n"):"string"==typeof e.content?e.content:""}function An(e){e.collapsed=!e.collapsed}function In(e){e.collapsed=!e.collapsed}function En(e){Ln.value=e,Sn.value=!0}function Pn(){Sn.value=!1,Ln.value=""}var On={key:0,class:"message-content user-message-content"},jn={key:0,class:"user-images"},Rn=["src","onClick"],zn=["innerHTML"],Dn=["onClick"],Nn=["innerHTML"],Un=["onClick"],Hn={class:"tool-name"},Vn={key:0,class:"tool-call-description"},Wn={class:"tool-call-details"},Fn={key:0,class:"todo-list"},qn={class:"todo-status-icon"},Zn={key:0,class:"todo-icon-spin",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},$n={key:1,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Gn={key:2,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Kn={key:3,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Jn={class:"todo-description"},Xn={class:"tool-call-args"},Qn={key:0,class:"tool-result-content"},Yn=["innerHTML"],eo={key:2,class:"continue-section"},to={key:2,class:"message-actions"},no=["src"],oo=a({__name:"MessageItem",props:{msg:{},isLastAssistant:{type:Boolean},isLast:{type:Boolean},isSending:{type:Boolean}},emits:["copy","regenerate","delete","toggleThink","continue"],setup:function(e,t){var n=t.emit,o=e,a=n;function l(){return function(e){if("string"==typeof e.content)return e.content;if(Array.isArray(e.content)){var t=e.content.find(function(e){return"text"===e.type});return(null==t?void 0:t.text)||""}return""}(o.msg)}function i(){return e=o.msg,Array.isArray(e.content)?e.content.filter(function(e){return"image_url"===e.type}).map(function(e){var t;return(null===(t=e.image_url)||void 0===t?void 0:t.url)||""}).filter(function(e){return e}):[];var e}function r(){return e=o.msg,Array.isArray(e.content)?e.content.filter(function(e){return"file"===e.type&&e.source&&e.path}).map(function(e){return{value:e.source.value,path:e.path,start:e.source.start,end:e.source.end}}):[];var e}function s(){return e=o.msg,Array.isArray(e.content)?e.content.filter(function(e){return"site"===e.type&&e.source&&e.name}).map(function(e){return{value:e.source.value,name:e.name,start:e.source.start,end:e.source.end}}):[];var e}var u=v(function(){return e=o.msg,t=o.isLast||!1,!("assistant"!==e.role||!t)&&Bn(e).includes("max_tool_iterations");var e,t});function d(){var e=Bn(o.msg);a("copy",e)}return function(t,n){return p(),m("div",{class:g(["message",e.msg.role])},["user"===e.msg.role?(p(),m("div",On,[i().length>0?(p(),m("div",jn,[(p(!0),m(k,null,_(i(),function(e,t){return p(),m("img",{key:t,src:e,alt:"图片",class:"user-image",onClick:function(t){return f(En)(e)}},null,8,Rn)}),128))])):x("",!0),l()?(p(),m("div",{key:1,innerHTML:(o=l(),v=r(),b=s(),Bt(o,v,b))},null,8,zn)):x("",!0)])):"assistant"===e.msg.role?(p(),m(k,{key:1},[e.msg.contentBlocks&&e.msg.contentBlocks.length>0?(p(!0),m(k,{key:0},_(e.msg.contentBlocks,function(e,t){return p(),m(k,{key:t},["think"===e.type?(p(),m("div",{key:0,class:g(["think-section",{collapsed:e.collapsed}])},[h("div",{class:"think-title",onClick:function(t){return f(An)(e)}},c(n[4]||(n[4]=[D('<svg class="think-toggle-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-daeff49f><polyline points="6 9 12 15 18 9" data-v-daeff49f></polyline></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-daeff49f><circle cx="12" cy="12" r="10" data-v-daeff49f></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" data-v-daeff49f></path><line x1="12" y1="17" x2="12.01" y2="17" data-v-daeff49f></line></svg> 思考过程 ',3)])),8,Dn),E(h("div",{class:"think-content"},C(e.content),513),[[P,!e.collapsed]])],2)):"message"===e.type?(p(),m("div",{key:1,class:"message-content",innerHTML:f(Mt)(e.content)},null,8,Nn)):"tool_call"===e.type?(p(),m("div",{key:2,class:g(["tool-call-card",{completed:"TodoWrite"===e.tool?f(Tt)(e):"completed"===e.status,collapsed:e.collapsed,"todo-card":"TodoWrite"===e.tool}])},[h("div",{class:"tool-call-header",onClick:function(t){return f(In)(e)}},[n[5]||(n[5]=h("svg",{class:"tool-toggle-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"6 9 12 15 18 9"})],-1)),h("span",Hn,[N(C("TodoWrite"===e.tool?"任务计划":e.tool)+" ",1),e.description?(p(),m("div",Vn,C(e.description),1)):x("",!0)]),"TodoWrite"===e.tool?(p(),m("span",{key:0,class:g(["tool-badge",{success:f(Tt)(e)}])},C("calling"===e.status?"更新中":f(Tt)(e)?"已完成":"进行中"),3)):(p(),m("span",{key:1,class:g(["tool-badge",{success:"completed"===e.status}])},C("calling"===e.status?"调用中":"完成"),3))],8,Un),E(h("div",Wn,["TodoWrite"===e.tool&&e.todoItems&&e.todoItems.length>0?(p(),m("div",Fn,[(p(!0),m(k,null,_(e.todoItems,function(e){return p(),m("div",{key:e.id,class:g(["todo-item","todo-"+e.status])},[h("span",qn,["in_progress"===e.status?(p(),m("svg",Zn,c(n[6]||(n[6]=[h("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])))):"completed"===e.status?(p(),m("svg",$n,c(n[7]||(n[7]=[h("polyline",{points:"20 6 9 17 4 12"},null,-1)])))):"cancelled"===e.status?(p(),m("svg",Gn,c(n[8]||(n[8]=[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)])))):(p(),m("svg",Kn,c(n[9]||(n[9]=[h("circle",{cx:"12",cy:"12",r:"9"},null,-1)]))))]),h("span",Jn,C(e.content||e.description),1)],2)}),128))])):(p(),m(k,{key:1},[h("div",Xn,[n[10]||(n[10]=h("div",{class:"tool-args-label"},"参数:",-1)),h("code",null,C(f(St)(e.args)),1)]),e.result?(p(),m("div",Qn,[n[11]||(n[11]=h("div",{class:"tool-result-label"},"结果:",-1)),N(" "+C(f(Lt)(e.result)),1)])):x("",!0)],64))],512),[[P,!e.collapsed]])],2)):x("",!0)],64)}),128)):(p(),m("div",{key:1,class:"message-content",innerHTML:f(Mt)(e.msg.content)},null,8,Yn)),u.value?(p(),m("div",eo,[h("button",{class:"continue-btn",onClick:n[0]||(n[0]=function(e){return a("continue")})},c(n[12]||(n[12]=[h("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"23 4 23 10 17 10"}),h("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1),N(" 继续 ",-1)])))])):x("",!0)],64)):x("",!0),"assistant"===e.msg.role&&e.msg.content?(p(),m("div",to,[h("button",{class:"message-action-btn",title:"复制",onClick:d},c(n[13]||(n[13]=[h("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),h("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})],-1)])))])):x("",!0),(p(),U(V,{to:"body"},[y(H,{name:"preview-fade"},{default:w(function(){return[f(Sn)?(p(),m("div",{key:0,class:"image-preview-overlay",onClick:n[3]||(n[3]=function(){return f(Pn)&&f(Pn).apply(void 0,arguments)})},[h("img",{src:f(Ln),alt:"预览图片",class:"image-preview-full",onClick:n[1]||(n[1]=z(function(){},["stop"]))},null,8,no),h("button",{class:"image-preview-close",onClick:n[2]||(n[2]=function(){return f(Pn)&&f(Pn).apply(void 0,arguments)})},c(n[14]||(n[14]=[h("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))])):x("",!0)]}),_:1})]))],2);var o,v,b}}}),ao=Be(oo,[["__scopeId","data-v-daeff49f"]]),lo=S(null),io=S(!1),ro=S(!1),so=S(!0),uo=null;function co(){ro.value||(so.value=function(){if(!lo.value)return!0;var e=lo.value,t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return n-t-o<150}(),io.value=!0,uo&&clearTimeout(uo),uo=setTimeout(function(){io.value=!1},500))}function vo(){io.value||so.value&&W(function(){lo.value&&(ro.value=!0,so.value=!0,lo.value.scrollTo({top:lo.value.scrollHeight,behavior:"smooth"}),setTimeout(function(){ro.value=!1},500))})}function fo(){io.value=!1,so.value=!0,W(function(){lo.value&&(ro.value=!0,lo.value.scrollTo({top:lo.value.scrollHeight,behavior:"smooth"}),setTimeout(function(){ro.value=!1},500))})}function po(e){return mo.apply(this,arguments)}function mo(){return(mo=u(i().m(function e(t){var n,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,!navigator.clipboard){e.n=2;break}return e.n=1,navigator.clipboard.writeText(t);case 1:e.n=3;break;case 2:(n=document.createElement("textarea")).value=t,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n);case 3:Oe.request({status:!0,msg:"复制成功"}),e.n=5;break;case 4:e.p=4,o=e.v,Oe.request({status:!1,msg:"复制失败"}),console.error("复制失败:",o);case 5:return e.a(2)}},e,null,[[0,4]])}))).apply(this,arguments)}function ho(e){e.collapsed=!e.collapsed}function go(e){e.collapsed=!e.collapsed}var yo={key:0,class:"welcome-message"},wo={class:"suggestion-cards"},bo=["onClick"],ko={key:1,class:"message assistant"},_o=["onClick"],Co=["innerHTML"],xo=["onClick"],Mo={class:"tool-name"},To={key:0,class:"tool-call-description"},So={class:"tool-call-details"},Lo={key:0,class:"todo-list"},Bo={class:"todo-status-icon"},Ao={key:0,class:"todo-icon-spin",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Io={key:1,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Eo={key:2,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},Po={key:3,width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Oo={class:"todo-description"},jo={class:"tool-call-args"},Ro={key:0,class:"tool-result-content"},zo={key:2,class:"typing-indicator"},Do=a({__name:"ChatMain",props:{messages:{},isTyping:{type:Boolean},streamingContentBlocks:{},streamingThinkCollapsed:{type:Boolean},suggestions:{},isSending:{type:Boolean}},emits:["update:streamingThinkCollapsed","suggestionClick","regenerate","deleteMessage","continue"],setup:function(e,t){var n=t.expose,o=(t.emit,e);function a(e){return function(e,t){for(var n=e.length-1;n>=0;n--)if("assistant"===e[n].role)return n===t;return!1}(o.messages,e)}return I(function(){lo.value&&lo.value.addEventListener("scroll",co,{passive:!0})}),F(function(){return lo.value&&lo.value.removeEventListener("scroll",co),void(uo&&clearTimeout(uo))}),n({scrollToBottom:vo,forceScrollToBottom:fo}),function(t,n){return p(),m("div",{ref_key:"chatMessagesRef",ref:lo,class:"chat-messages"},[0===e.messages.length?(p(),m("div",yo,[n[1]||(n[1]=h("h2",null,"有什么我能帮你的吗?",-1)),h("div",wo,[(p(!0),m(k,null,_(e.suggestions,function(e,n){return p(),m("button",{key:n,class:"suggestion-card",onClick:function(n){return t.$emit("suggestionClick",e)}},C(e.question),9,bo)}),128))])])):x("",!0),(p(!0),m(k,null,_(e.messages,function(l,i){return p(),U(ao,{key:i,msg:l,isSending:e.isSending,"is-last-assistant":a(i),"is-last":i===e.messages.length-1,onCopy:f(po),onRegenerate:function(e){return t.$emit("regenerate",i)},onDelete:function(e){return t.$emit("deleteMessage",i)},onToggleThink:function(e){return function(e){!function(e,t){var n=e[t];n&&n.contentBlocks&&n.contentBlocks.forEach(function(e){"think"===e.type&&(e.collapsed=!e.collapsed)})}(o.messages,e)}(i)},onContinue:n[0]||(n[0]=function(e){return t.$emit("continue")})},null,8,["msg","isSending","is-last-assistant","is-last","onCopy","onRegenerate","onDelete","onToggleThink"])}),128)),e.streamingContentBlocks.length>0?(p(),m("div",ko,[(p(!0),m(k,null,_(e.streamingContentBlocks,function(e,t){return p(),m(k,{key:t},["think"===e.type?(p(),m("div",{key:0,class:g(["think-section",{collapsed:e.collapsed}])},[h("div",{class:"think-title",onClick:function(t){return f(ho)(e)}},c(n[2]||(n[2]=[D('<svg class="think-toggle-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-55f36d11><polyline points="6 9 12 15 18 9" data-v-55f36d11></polyline></svg><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-55f36d11><circle cx="12" cy="12" r="10" data-v-55f36d11></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" data-v-55f36d11></path><line x1="12" y1="17" x2="12.01" y2="17" data-v-55f36d11></line></svg> 思考过程 ',3)])),8,_o),E(h("div",{class:"think-content"},C(e.content),513),[[P,!e.collapsed]])],2)):"message"===e.type?(p(),m("div",{key:1,class:"message-content",innerHTML:f(Mt)(e.content)},null,8,Co)):"tool_call"===e.type?(p(),m("div",{key:2,class:g(["tool-call-card",{completed:"TodoWrite"===e.tool?f(Tt)(e):"completed"===e.status,collapsed:e.collapsed,"todo-card":"TodoWrite"===e.tool}])},[h("div",{class:"tool-call-header",onClick:function(t){return f(go)(e)}},[n[3]||(n[3]=h("svg",{class:"tool-toggle-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"6 9 12 15 18 9"})],-1)),h("span",Mo,[N(C("TodoWrite"===e.tool?"任务计划":e.tool)+" ",1),e.description?(p(),m("div",To,C(e.description),1)):x("",!0)]),"TodoWrite"===e.tool?(p(),m("span",{key:0,class:g(["tool-badge",{success:f(Tt)(e)}])},C("calling"===e.status?"更新中":f(Tt)(e)?"已完成":"进行中"),3)):(p(),m("span",{key:1,class:g(["tool-badge",{success:"completed"===e.status}])},C("calling"===e.status?"调用中":"完成"),3))],8,xo),E(h("div",So,["TodoWrite"===e.tool&&e.todoItems&&e.todoItems.length>0?(p(),m("div",Lo,[(p(!0),m(k,null,_(e.todoItems,function(e){return p(),m("div",{key:e.id,class:g(["todo-item","todo-"+e.status])},[h("span",Bo,["in_progress"===e.status?(p(),m("svg",Ao,c(n[4]||(n[4]=[h("path",{d:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"},null,-1)])))):"completed"===e.status?(p(),m("svg",Io,c(n[5]||(n[5]=[h("polyline",{points:"20 6 9 17 4 12"},null,-1)])))):"cancelled"===e.status?(p(),m("svg",Eo,c(n[6]||(n[6]=[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)])))):(p(),m("svg",Po,c(n[7]||(n[7]=[h("circle",{cx:"12",cy:"12",r:"9"},null,-1)]))))]),h("span",Oo,C(e.content||e.description),1)],2)}),128))])):(p(),m(k,{key:1},[h("div",jo,[n[8]||(n[8]=h("div",{class:"tool-args-label"},"参数:",-1)),h("code",null,C(f(St)(e.args)),1)]),e.result?(p(),m("div",Ro,[n[9]||(n[9]=h("div",{class:"tool-result-label"},"结果:",-1)),N(" "+C(f(Lt)(e.result)),1)])):x("",!0)],64))],512),[[P,!e.collapsed]])],2)):x("",!0)],64)}),128))])):x("",!0),e.isTyping?(p(),m("div",zo,c(n[10]||(n[10]=[h("div",{class:"typing-dots"},[h("div",{class:"typing-dot"}),h("div",{class:"typing-dot"}),h("div",{class:"typing-dot"})],-1)])))):x("",!0)],512)}}}),No=Be(Do,[["__scopeId","data-v-55f36d11"]]),Uo={class:"chat-input-container"},Ho={key:0,class:"selected-tools-tags"},Vo={class:"tool-tag-name"},Wo=["onClick"],Fo={key:0,class:"tool-tag tool-tag-overflow"},qo={class:"tool-tag-name"},Zo={class:"tool-overflow-tooltip"},$o=["onClick"],Go={key:1,class:"image-preview-container"},Ko=["src","onClick"],Jo=["onClick"],Xo={key:2,class:"upload-progress-container"},Qo={class:"upload-file-info"},Yo={class:"upload-file-name"},ea={class:"upload-file-size"},ta={class:"upload-progress-bar"},na={class:"input-toolbar"},oa={style:{position:"relative"}},aa={style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},la=["title"],ia={style:{position:"relative"}},ra=["title"],sa={key:0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ua={key:1,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"},ca={class:"popover-header"},da={class:"tool-search-bar"},va={class:"popover-content"},fa={key:0,class:"popover-loading"},pa={key:1,class:"tool-search-empty"},ma={key:2,class:"tool-list"},ha=["onClick"],ga=["onClick"],ya={class:"tool-info"},wa={class:"tool-name"},ba={key:0,class:"risk-badge"},ka={class:"popover-header"},_a={key:0,class:"site-search-loading"},Ca={key:1,class:"site-search-empty"},xa=["onClick","onMouseenter"],Ma={class:"site-name"},Ta={class:"site-type-badge"},Sa=["innerHTML"],La=["src"],Ba=a({__name:"ChatInput",props:{inputMessage:{},selectedTools:{},toolsList:{},showToolPopover:{type:Boolean},toolsLoading:{type:Boolean},isSending:{type:Boolean},webSearchEnabled:{type:Boolean},smartMode:{type:Boolean}},emits:["update:inputMessage","update:showToolPopover","update:webSearchEnabled","update:smartMode","sendMessage","stopMessage","removeSelectedTool","toggleToolSelection","batchToggleTools","openSettings","openPluginView"],setup:function(e,n){var o=n.expose,a=n.emit,r=e,s=a,d=S(null),f=S(null),M=S(""),T=S(null),B=S(!1),A=S(""),I=S({top:"0px",left:"0px"}),P=S([]),O=S([]),j=S(!1),R=S(!1),D=S(""),N=S([]),F=S(!1),Z=S(null),$=S(null),G=S(null),K=S({bottom:"0px",left:"0px"}),J=S([]),X=S(!1),Q=S([]),Y=S(!1),ee=S(0),te=null,ne=S(!1),oe=S({bottom:"0px",left:"0px",width:"0px"}),ae=S(null),le=S(null),ie=S(0),re=S({bottom:"0px",left:"0px"});L(function(){return r.inputMessage},function(e){d.value&&d.value.textContent!==e&&(d.value.textContent=e)});var se=v(function(){return r.selectedTools.slice(0,5)}),ue=v(function(){return r.selectedTools.slice(5)}),ce=v(function(){var e=M.value.trim().toLowerCase(),t=r.toolsList,n=e?t.filter(function(t){return t.name.toLowerCase().includes(e)}):t,o={};return n.forEach(function(e){var t=e.category||"其他";o[t]||(o[t]=[]),o[t].push(e)}),o});function de(){d.value&&(d.value.style.height="auto",d.value.style.height="".concat(Math.min(d.value.scrollHeight,120),"px"),ne.value&&fe())}function ve(e){var t=e.target,n=e.target.innerHTML.replace(/\s|&nbsp;/g,"");"<br>"!==n&&"<div><br></div>"!==n&&"<p><br></p>"!==n||(t.innerText=""),s("update:inputMessage",t.textContent||""),W(function(){de()}),function(){if(!d.value)return;var e=window.getSelection();if(!e||0===e.rangeCount)return void(ne.value=!1);var t=e.getRangeAt(0),n=t.startContainer;if(n.nodeType!==Node.TEXT_NODE)return void(ne.value=!1);var o=n.textContent||"",a=t.startOffset;if(a>0&&"@"===o[a-1]){if(X.value)return void(ne.value=!1);ae.value=a-1,le.value=n,ie.value=0,X.value=!1,ne.value=!0,fe()}else ne.value=!1,X.value||(ae.value=null,le.value=null)}(),function(){if(!d.value)return;if(!X.value)return;var e=window.getSelection();if(!e||0===e.rangeCount)return void(X.value=!1);var t=e.getRangeAt(0),n=t.startContainer;if(n.nodeType!==Node.TEXT_NODE)return void(X.value=!1);var o=n.textContent||"",a=t.startOffset,l="@site:",i=o.indexOf(l);if(-1!==i&&a>i){return void be(o.substring(i+l.length))}X.value=!1}()}function fe(){if(d.value){var e=document.querySelector(".small-ai-chat.ai-chat-wrapper"),t=null==e?void 0:e.getBoundingClientRect();if(t){var n=document.querySelector(".small-ai-chat .chat-input-wrapper"),o=null==n?void 0:n.getBoundingClientRect();if(o){oe.value={bottom:"".concat(o.bottom-o.top+45,"px"),left:"".concat(o.left-t.left,"px"),width:"".concat(o.width,"px")}}}}}function pe(){var e=document.getElementById("tool-tooltip"),t=localStorage.getItem("showToolTooltip");e&&!t&&(e.classList.add("show"),localStorage.setItem("showToolTooltip","true"),setTimeout(function(){e.classList.remove("show")},3e3))}function me(){}function he(e){if(!e.isComposing){if(ne.value){if("ArrowUp"===e.key)return e.preventDefault(),void(ie.value=0===ie.value?1:0);if("ArrowDown"===e.key)return e.preventDefault(),void(ie.value=1===ie.value?0:1);if("Enter"===e.key&&!e.shiftKey)return e.preventDefault(),void(0===ie.value?ge():we());if("Escape"===e.key)return ne.value=!1,ae.value=null,void(le.value=null)}if(X.value){if("Enter"===e.key&&!e.shiftKey)return e.preventDefault(),void _e();if("ArrowUp"===e.key)return e.preventDefault(),void(ee.value=ee.value>0?ee.value-1:Q.value.length-1);if("ArrowDown"===e.key)return e.preventDefault(),void(ee.value=ee.value<Q.value.length-1?ee.value+1:0);if("Escape"===e.key)return void(X.value=!1)}"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s("sendMessage"))}}function ge(){ne.value=!1,at({type:"all",path:"/",change:function(e){ye(e)}},{customClass:"top-index"})}function ye(e){if(d.value){var t=e.split("/").pop()||e,n=Date.now().toString(),o=document.createElement("span");if(o.className="file-tag truncate",o.contentEditable="false",o.dataset.id=n,o.dataset.path=e,o.textContent="@".concat(t),le.value&&null!==ae.value){var a=le.value,l=a.textContent||"",i=ae.value;if("@"===l[i]){var r=l.substring(0,i),u=l.substring(i+1);a.textContent=r+u;var c=document.createRange();c.setStart(a,i),c.setEnd(a,i),c.insertNode(o);var v=document.createTextNode(" ");c.setStartAfter(o),c.insertNode(v),c.setStartAfter(v),c.collapse(!0);var f=window.getSelection();f&&(f.removeAllRanges(),f.addRange(c)),O.value.push({id:n,path:e,name:t}),ae.value=null,le.value=null,s("update:inputMessage",d.value.textContent||""),W(function(){return de()})}else Ve(e)}else Ve(e)}}function we(){var e;if(ne.value=!1,le.value&&null!==ae.value){var t=le.value,n=t.textContent||"",o=ae.value;if("@"===n[o]){var a=n.substring(0,o),l=n.substring(o+1);t.textContent=a+"@site:"+l;var i=window.getSelection();if(i){var r=document.createRange(),u=o+6;r.setStart(t,Math.min(u,t.textContent.length)),r.collapse(!0),i.removeAllRanges(),i.addRange(r)}}X.value=!0,ee.value=0,fe(),be(""),s("update:inputMessage",(null===(e=d.value)||void 0===e?void 0:e.textContent)||"")}}function be(e){te&&clearTimeout(te),te=setTimeout(function(){!function(e){ke.apply(this,arguments)}(e)},300)}function ke(){return(ke=u(i().m(function e(t){var n,o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return Y.value=!0,e.p=1,e.n=2,At({name:t,limit:5});case 2:n=e.v,(o=n.data).status?(Q.value=o.data||[],ee.value=0):Q.value=[],e.n=4;break;case 3:e.p=3,e.v,Q.value=[];case 4:return e.p=4,Y.value=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))).apply(this,arguments)}function _e(){if(0!==Q.value.length){var e=Q.value[ee.value];e&&(X.value=!1,te&&(clearTimeout(te),te=null),function(e){if(!d.value)return;var t=Date.now().toString(),n="@site:".concat(e),o=document.createElement("span");if(o.className="site-tag truncate",o.contentEditable="false",o.dataset.id=t,o.dataset.name=e,o.textContent=n,le.value&&null!==ae.value){var a=le.value,l=a.textContent||"",i=ae.value,r=i+1;for("@site:"===l.substring(i,i+6)&&(r=i+6);r<l.length&&" "!==l[r]&&" "!==l[r];)r++;var u=l.substring(0,i),c=l.substring(r);a.textContent=u+c;var v=document.createRange();v.setStart(a,i),v.collapse(!0),v.insertNode(o);var f=document.createTextNode(" ");v.setStartAfter(o),v.insertNode(f),v.setStartAfter(f),v.collapse(!0);var p=window.getSelection();p&&(p.removeAllRanges(),p.addRange(v))}else{d.value.focus();var m=window.getSelection();if(m&&m.rangeCount>0){var h=m.getRangeAt(0);if(d.value.contains(h.commonAncestorContainer)){h.deleteContents(),h.insertNode(o);var g=document.createTextNode(" ");h.setStartAfter(o),h.insertNode(g),h.setStartAfter(g),h.collapse(!0),m.removeAllRanges(),m.addRange(h)}else{d.value.appendChild(o);var y=document.createTextNode(" ");d.value.appendChild(y),He()}}else{d.value.appendChild(o);var w=document.createTextNode(" ");d.value.appendChild(w),He()}}J.value.push({id:t,name:e}),ae.value=null,le.value=null,s("update:inputMessage",d.value.textContent||""),W(function(){return de()})}(e.name))}}function Ce(e){var t,n=null===(t=e.clipboardData)||void 0===t?void 0:t.items;if(n){var o,a=l(n);try{for(a.s();!(o=a.n()).done;){var i=o.value;if(i.type.startsWith("image/")){e.preventDefault();var r=i.getAsFile();r&&Ae(r);break}}}catch(s){a.e(s)}finally{a.f()}}}function xe(e){var t;null!==(t=e.dataTransfer)&&void 0!==t&&t.types.includes("Files")&&(j.value=!0)}function Me(e){var t=e.currentTarget;t&&!t.contains(e.relatedTarget)&&(j.value=!1)}function Te(e){return Se.apply(this,arguments)}function Se(){return(Se=u(i().m(function e(t){var n,o,a,l,r,s,u,c,d,v,f,p,m,h,g,y,w,b,k;return i().w(function(e){for(;;)switch(e.n){case 0:if(j.value=!1,o=null===(n=t.dataTransfer)||void 0===n?void 0:n.items){e.n=1;break}return e.a(2);case 1:a=[],l=[],r=0,s=Array.from(o);case 2:if(!(r<s.length)){e.n=8;break}if("file"!==(u=s[r]).kind){e.n=7;break}if(!(d=null===(c=u.webkitGetAsEntry)||void 0===c?void 0:c.call(u))){e.n=6;break}if(!d.isDirectory){e.n=4;break}return e.n=3,Le(d);case 3:(v=e.v).files.length>0&&l.push(v),e.n=5;break;case 4:d.isFile&&(f=u.getAsFile())&&a.push(f);case 5:e.n=7;break;case 6:(p=u.getAsFile())&&a.push(p);case 7:r++,e.n=2;break;case 8:for(m=0,h=a;m<h.length;m++)(g=h[m]).type.startsWith("image/")?Ae(g):Ie(g);for(y=0,w=l;y<w.length;y++)b=w[y],(k=b.files).length>0&&Ee(k,b.name);case 9:return e.a(2)}},e)}))).apply(this,arguments)}function Le(e){return new Promise(function(n){var o=[],a=e.name,r=function(e){e.readEntries(function(){var s=u(i().m(function s(u){var d,v,f,p;return i().w(function(s){for(;;)switch(s.p=s.n){case 0:if(0!==u.length){s.n=1;break}return n({files:o,name:a}),s.a(2);case 1:d=l(u),s.p=2,f=i().m(function e(){var t,n,a,l;return i().w(function(e){for(;;)switch(e.n){case 0:if(!(t=v.value).isFile){e.n=2;break}return n=t,e.n=1,new Promise(function(e){n.file(e)});case 1:a=e.v,o.push(a),e.n=4;break;case 2:if(!t.isDirectory){e.n=4;break}return e.n=3,Le(t);case 3:l=e.v,o.push.apply(o,c(l.files));case 4:return e.a(2)}},e)}),d.s();case 3:if((v=d.n()).done){s.n=5;break}return s.d(t(f()),4);case 4:s.n=3;break;case 5:s.n=7;break;case 6:s.p=6,p=s.v,d.e(p);case 7:return s.p=7,d.f(),s.f(7);case 8:r(e);case 9:return s.a(2)}},s,null,[[2,6,7,8]])}));return function(e){return s.apply(this,arguments)}}())};r(e.createReader())})}function Be(e){return e.replace(/[<>:"/\\|?*\x00-\x1f]/g,"_")}function Ae(e){if(e.size>5242880)Oe.error("图片大小不能超过 5MB,当前文件大小: ".concat((e.size/1024/1024).toFixed(2),"MB"));else{var t=new FileReader;t.onload=function(e){var t,n=null===(t=e.target)||void 0===t?void 0:t.result;n&&P.value.push(n)},t.readAsDataURL(e)}}function Ie(e){if(e.size>10485760)Oe.error("文件大小不能超过 10MB,当前文件大小: ".concat((e.size/1024/1024).toFixed(2),"MB"));else{var t=Date.now().toString(),n=Be(e.name);N.value.push({id:t,name:n,size:e.size,uploaded:0,status:"uploading"});var o="/www/server/panel/plugin/bt_agent/upload",a=function(l){var i=Math.min(e.size,l+2097152),r=new FormData;r.append("f_path",o),r.append("f_name",n),r.append("f_size",e.size.toString()),r.append("f_start",l.toString()),r.append("blob",e.slice(l,i)),fetch("/files?action=upload",{method:"POST",body:r}).then(function(e){return e.json()}).then(function(l){if("number"==typeof l){var i=N.value.find(function(e){return e.id===t});i&&(i.uploaded=l),a(l)}else if(l.status){var r=N.value.find(function(e){return e.id===t});r&&(r.status="success",r.uploaded=e.size),Ve("".concat(o,"/").concat(n)),setTimeout(function(){N.value=N.value.filter(function(e){return e.id!==t})},500)}else{var s=N.value.find(function(e){return e.id===t});s&&(s.status="error"),Oe.error("文件上传失败:".concat(l.msg||"未知错误"))}}).catch(function(){var e=N.value.find(function(e){return e.id===t});e&&(e.status="error"),Oe.error("文件上传出现问题!")})};a(0)}}function Ee(e,t){return Pe.apply(this,arguments)}function Pe(){return(Pe=u(i().m(function e(t,n){var o,a,r,s,u,c,d,v,f,p;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:o=Date.now().toString(),a="".concat("/www/server/panel/plugin/bt_agent/upload","/").concat(Be(n)),r={id:o,name:"".concat(n,"/ (").concat(t.length," 个文件)"),size:t.reduce(function(e,t){return e+t.size},0),uploaded:0,status:"uploading"},N.value.push(r),s=0,u=[],c=l(t),e.p=1,c.s();case 2:if((d=c.n()).done){e.n=7;break}return v=d.value,e.p=3,e.n=4,je(v,a);case 4:f=e.v,u.push(f),s+=v.size,r.uploaded=s,e.n=6;break;case 5:e.p=5,e.v;case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,p=e.v,c.e(p);case 9:return e.p=9,c.f(),e.f(9);case 10:r.status="success",r.uploaded=r.size,We(a,n,u),setTimeout(function(){N.value=N.value.filter(function(e){return e.id!==o})},500);case 11:return e.a(2)}},e,null,[[3,5],[1,8,9,10]])}))).apply(this,arguments)}function je(e,t){return new Promise(function(n,o){var a=Be(e.name),l=function(i){var r=Math.min(e.size,i+2097152),s=new FormData;s.append("f_path",t),s.append("f_name",a),s.append("f_size",e.size.toString()),s.append("f_start",i.toString()),s.append("blob",e.slice(i,r)),fetch("/files?action=upload",{method:"POST",body:s}).then(function(e){return e.json()}).then(function(e){"number"==typeof e?l(e):e.status?n("".concat(t,"/").concat(a)):o(new Error(e.msg||"上传失败"))}).catch(function(e){o(e)})};l(0)})}function Re(){R.value=!1,D.value=""}function ze(e){e.stopPropagation(),s("update:showToolPopover",!1);var t=!F.value;F.value=t,t&&W(function(){K.value=Xe(Z.value)})}function De(){var e;F.value=!1,null===(e=$.value)||void 0===e||e.click()}function Ne(){var e;F.value=!1,null===(e=G.value)||void 0===e||e.click()}function Ue(){F.value=!1,at({type:"all",path:"/",change:function(e){ye(e)}},{customClass:"top-index"})}function He(){if(d.value){var e=window.getSelection();if(e){var t=document.createRange();t.selectNodeContents(d.value),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}}}function Ve(e){if(d.value){var t=e.split("/").pop()||e,n=Date.now().toString(),o=document.createElement("span");o.className="file-tag truncate",o.contentEditable="false",o.dataset.id=n,o.dataset.path=e,o.textContent="@".concat(t),d.value.focus();var a=window.getSelection();if(a){var l;if(a.rangeCount>0)if(l=a.getRangeAt(0),d.value.contains(l.commonAncestorContainer)){l.deleteContents(),l.insertNode(o);var i=document.createTextNode(" ");l.setStartAfter(o),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),a.removeAllRanges(),a.addRange(l)}else{d.value.appendChild(o);var r=document.createTextNode(" ");d.value.appendChild(r),He()}else{d.value.appendChild(o);var u=document.createTextNode(" ");d.value.appendChild(u),He()}}else{d.value.appendChild(o);var c=document.createTextNode(" ");d.value.appendChild(c),He()}O.value.push({id:n,path:e,name:t}),s("update:inputMessage",d.value.textContent||""),W(function(){return de()})}}function We(e,t,n){if(d.value){var o=Date.now().toString(),a=document.createElement("span");a.className="file-tag dir-tag truncate",a.contentEditable="false",a.dataset.id=o,a.dataset.path=e,a.dataset.files=JSON.stringify(n),a.dataset.isDir="true",a.textContent="@".concat(t,"/"),d.value.focus();var l=window.getSelection();if(l){var i;if(l.rangeCount>0)if(i=l.getRangeAt(0),d.value.contains(i.commonAncestorContainer)){i.deleteContents(),i.insertNode(a);var r=document.createTextNode(" ");i.setStartAfter(a),i.insertNode(r),i.setStartAfter(r),i.collapse(!0),l.removeAllRanges(),l.addRange(i)}else{d.value.appendChild(a);var u=document.createTextNode(" ");d.value.appendChild(u),He()}else{d.value.appendChild(a);var c=document.createTextNode(" ");d.value.appendChild(c),He()}}else{d.value.appendChild(a);var v=document.createTextNode(" ");d.value.appendChild(v),He()}O.value.push({id:o,path:e,name:"".concat(t,"/"),isDir:!0,files:n}),s("update:inputMessage",d.value.textContent||""),W(function(){return de()})}}function Fe(e){var t=e.target,n=t.files;if(n){for(var o=0,a=Array.from(n);o<a.length;o++){var l=a[o];l.type.startsWith("image/")?Ae(l):Ie(l)}t.value=""}}function qe(e){var t=e.target,n=t.files;if(n&&0!==n.length){var o=n[0].webkitRelativePath.split("/")[0],a=Array.from(n).filter(function(e){return!e.type.startsWith("image/")});if(0===a.length)return Oe.error("目录中没有可上传的文件(图片文件不支持目录上传)"),void(t.value="");Ee(a,o),t.value=""}}function Ze(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,t)).toFixed(2))," ").concat(["B","KB","MB","GB"][t])}function $e(e){e.stopPropagation(),F.value=!1;var t=!r.showToolPopover;s("update:showToolPopover",t),t&&W(function(){re.value=Xe(f.value)})}function Ge(e){return r.selectedTools.some(function(t){return t.id===e})}function Ke(e){return e.length>0&&e.every(function(e){return Ge(e.id)})}function Je(e){var t=e.filter(function(e){return Ge(e.id)}).length;return t>0&&t<e.length}function Xe(e){if(!e)return{bottom:"0px",left:"0px"};var t=e.getBoundingClientRect(),n=window.innerHeight-t.top+8,o=t.left;return o+350>window.innerWidth-8&&(o=window.innerWidth-350-8),o<8&&(o=8),{bottom:"".concat(n,"px"),left:"".concat(o,"px")}}return L(function(){return r.showToolPopover},function(e){e?W(function(){var e;re.value=Xe(f.value),null===(e=T.value)||void 0===e||e.focus()}):M.value=""}),o({autoResizeTextarea:de,getPendingImages:function(){return c(P.value)},clearImages:function(){P.value=[]},addImages:function(e){P.value=[];var t,n=l(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;P.value.push(o)}}catch(a){n.e(a)}finally{n.f()}},getTextContent:function(){var e;return(null===(e=d.value)||void 0===e?void 0:e.innerText)||""},getPendingFiles:function(){return c(O.value)},getPendingSites:function(){return c(J.value)},clearAll:function(){d.value&&(d.value.innerHTML=""),P.value=[],O.value=[],J.value=[]},focus:function(){var e;null===(e=d.value)||void 0===e||e.focus(),He()}}),function(t,n){return p(),m("div",Uo,[h("div",{class:g(["chat-input-wrapper",{"drag-over":j.value}]),onDragover:z(xe,["prevent"]),onDragleave:Me,onDrop:z(Te,["prevent"])},[e.selectedTools.length>0&&!e.smartMode?(p(),m("div",Ho,[(p(!0),m(k,null,_(se.value,function(e){return p(),m("div",{key:e.id,class:"tool-tag"},[h("span",Vo,C(e.name),1),h("button",{class:"tool-tag-remove",title:"移除工具",onClick:function(n){return t.$emit("removeSelectedTool",e.id)}},c(n[12]||(n[12]=[h("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])),8,Wo)])}),128)),ue.value.length>0?(p(),m("div",Fo,[h("span",qo,"+"+C(ue.value.length),1),h("div",Zo,[(p(!0),m(k,null,_(ue.value,function(e){return p(),m("div",{key:e.id,class:"tool-overflow-item"},[h("span",null,C(e.name),1),h("button",{class:"tool-tag-remove",title:"移除工具",onClick:function(n){return t.$emit("removeSelectedTool",e.id)}},c(n[13]||(n[13]=[h("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])),8,$o)])}),128))])])):x("",!0)])):x("",!0),P.value.length>0?(p(),m("div",Go,[(p(!0),m(k,null,_(P.value,function(e,t){return p(),m("div",{key:t,class:"image-preview-item"},[h("img",{src:e,alt:"预览图片",class:"image-preview-thumb",onClick:function(t){return n=e,D.value=n,void(R.value=!0);var n}},null,8,Ko),h("button",{class:"image-preview-remove",title:"移除图片",onClick:z(function(e){return function(e){P.value.splice(e,1)}(t)},["stop"])},c(n[14]||(n[14]=[h("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])),8,Jo)])}),128))])):x("",!0),N.value.length>0?(p(),m("div",Xo,[(p(!0),m(k,null,_(N.value,function(e){return p(),m("div",{key:e.id,class:g(["upload-progress-item",{error:"error"===e.status,success:"success"===e.status}])},[h("div",Qo,[n[15]||(n[15]=h("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),h("polyline",{points:"14 2 14 8 20 8"})],-1)),h("span",Yo,C(e.name),1),h("span",ea,"("+C(Ze(e.uploaded))+"/"+C(Ze(e.size))+")",1)]),h("div",ta,[h("div",{class:"upload-progress-fill",style:b({width:"".concat(e.uploaded/e.size*100,"%")})},null,4)])],2)}),128))])):x("",!0),h("div",{ref_key:"editorRef",ref:d,class:"chat-input",contenteditable:"true","aria-label":"输入框","data-placeholder":"输入消息,按 Shift + Enter 换行,@ 打开引用菜单,可拖拽上传文件,可粘贴图片,按 Enter 发送",onInput:ve,onBlur:me,onFocus:pe,onPaste:Ce,onKeydown:he},null,544),h("div",na,[h("div",oa,[h("button",{ref_key:"uploadBtnRef",ref:Z,class:"toolbar-button",style:{padding:"0"},title:"上传文件",onClick:ze},[(p(),m("svg",aa,c(n[16]||(n[16]=[h("line",{x1:"12",y1:"5",x2:"12",y2:"19"},null,-1),h("line",{x1:"5",y1:"12",x2:"19",y2:"12"},null,-1)]))))],512)]),h("button",{class:g(["toolbar-button",{"toolbar-button-active":e.smartMode}]),title:e.smartMode?"智能模式已开启,AI将自动判断是否使用工具和联网搜索":"智能模式已关闭,可手动选择工具和联网搜索",onClick:n[0]||(n[0]=function(n){return t.$emit("update:smartMode",!e.smartMode)})},[n[17]||(n[17]=h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),h("path",{d:"M2 17l10 5 10-5"}),h("path",{d:"M2 12l10 5 10-5"})],-1)),h("span",null,C((e.smartMode,"智能模式")),1)],10,la),e.smartMode?x("",!0):(p(),m(k,{key:0},[h("div",ia,[h("button",{ref_key:"toolBtnRef",ref:f,class:"toolbar-button",title:"使用工具",onClick:$e},[n[18]||(n[18]=h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z"})],-1)),h("span",null,"使用工具"+C(e.selectedTools.length>0?" (".concat(e.selectedTools.length,")"):""),1)],512)]),h("button",{class:g(["toolbar-button",{"toolbar-button-active":e.webSearchEnabled}]),title:"联网搜索",onClick:n[1]||(n[1]=function(n){return t.$emit("update:webSearchEnabled",!e.webSearchEnabled)})},c(n[19]||(n[19]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("circle",{cx:"12",cy:"12",r:"10"}),h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),h("path",{d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})],-1),h("span",null,"联网搜索",-1)])),2)],64)),h("button",{class:g(["send-button",{"stop-button":e.isSending}]),title:e.isSending?"停止生成":"发送消息",onClick:n[2]||(n[2]=function(n){return e.isSending?t.$emit("stopMessage"):t.$emit("sendMessage")})},[e.isSending?(p(),m("svg",ua,c(n[21]||(n[21]=[h("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"},null,-1)])))):(p(),m("svg",sa,c(n[20]||(n[20]=[h("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"},null,-1)]))))],10,ra)])],34),n[40]||(n[40]=h("div",{class:"ai-disclaimer"}," 内容由 AI 生成,仅供参考,您据此所作判断及操作均由您自行承担责任。 ",-1)),y(H,{name:"popover-fade"},{default:w(function(){return[e.showToolPopover?(p(),m("div",{key:0,class:"custom-popover",style:b(re.value)},[h("div",ca,[n[23]||(n[23]=h("span",{class:"popover-title"},"选择工具",-1)),h("button",{class:"popover-close",onClick:n[3]||(n[3]=function(e){return t.$emit("update:showToolPopover",!1)})},c(n[22]||(n[22]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),h("div",da,[n[25]||(n[25]=h("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"tool-search-icon"},[h("circle",{cx:"11",cy:"11",r:"8"}),h("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),E(h("input",{ref_key:"toolSearchInputRef",ref:T,"onUpdate:modelValue":n[4]||(n[4]=function(e){return M.value=e}),class:"tool-search-input",placeholder:"搜索工具名称...",type:"text"},null,512),[[q,M.value]]),M.value?(p(),m("button",{key:0,class:"tool-search-clear",onClick:n[5]||(n[5]=z(function(e){return M.value=""},["stop"]))},c(n[24]||(n[24]=[h("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))):x("",!0)]),h("div",va,[e.toolsLoading?(p(),m("div",fa,c(n[26]||(n[26]=[h("div",{class:"loading-spinner"},null,-1),h("span",null,"加载中...",-1)])))):0===Object.keys(ce.value).length?(p(),m("div",pa," 未找到匹配的工具 ")):(p(),m("div",ma,[(p(!0),m(k,null,_(ce.value,function(e,o){return p(),m(k,{key:o},[h("div",{class:"tool-category",onClick:function(t){return function(e){var t=Ke(e),n=e.filter(function(e){var n=Ge(e.id);return t?n:!n});s("batchToggleTools",n,!t)}(e)}},[h("span",null,C(o),1),h("div",{class:g(["category-switch",{active:Ke(e),partial:Je(e)}])},c(n[27]||(n[27]=[h("div",{class:"category-switch-slider"},null,-1)])),2)],8,ha),(p(!0),m(k,null,_(e,function(e){return p(),m("div",{key:e.id,class:"tool-item",onClick:function(n){return t.$emit("toggleToolSelection",e)}},[h("div",ya,[h("span",wa,C(e.name),1),e.risk_level&&"low"!==e.risk_level?(p(),m("span",ba," 风险 ")):x("",!0)]),h("div",{class:g(["tool-switch",{active:Ge(e.id)}])},c(n[28]||(n[28]=[h("div",{class:"tool-switch-slider"},null,-1)])),2)],8,ga)}),128))],64)}),128))]))])],4)):x("",!0)]}),_:1}),y(H,{name:"popover-fade"},{default:w(function(){return[F.value?(p(),m("div",{key:0,class:"custom-popover upload-popover",style:b(K.value)},[h("div",ka,[n[30]||(n[30]=h("span",{class:"popover-title"},"上传文件",-1)),h("button",{class:"popover-close",onClick:n[6]||(n[6]=function(e){return F.value=!1})},c(n[29]||(n[29]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))]),h("div",{class:"popover-content"},[h("div",{class:"upload-option",onClick:De},c(n[31]||(n[31]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),h("polyline",{points:"17 8 12 3 7 8"}),h("line",{x1:"12",y1:"3",x2:"12",y2:"15"})],-1),h("span",null,"本地文件上传",-1)]))),h("div",{class:"upload-option",onClick:Ne},c(n[32]||(n[32]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"})],-1),h("span",null,"本地目录上传",-1)]))),h("div",{class:"upload-option",onClick:Ue},c(n[33]||(n[33]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),h("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),h("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),h("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),h("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),h("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),h("line",{x1:"17",y1:"7",x2:"22",y2:"7"})],-1),h("span",null,"从服务器选择",-1)])))])],4)):x("",!0)]}),_:1}),y(H,{name:"popover-fade"},{default:w(function(){return[ne.value?(p(),m("div",{key:0,class:"at-mention-popover",style:b(oe.value)},[h("div",{class:g(["at-mention-option",{active:0===ie.value}]),onClick:n[7]||(n[7]=function(e){ie.value=0,ge()}),onMouseenter:n[8]||(n[8]=function(e){return ie.value=0})},c(n[34]||(n[34]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("rect",{x:"2",y:"2",width:"20",height:"20",rx:"2.18",ry:"2.18"}),h("line",{x1:"7",y1:"2",x2:"7",y2:"22"}),h("line",{x1:"17",y1:"2",x2:"17",y2:"22"}),h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),h("line",{x1:"2",y1:"7",x2:"7",y2:"7"}),h("line",{x1:"2",y1:"17",x2:"7",y2:"17"}),h("line",{x1:"17",y1:"17",x2:"22",y2:"17"}),h("line",{x1:"17",y1:"7",x2:"22",y2:"7"})],-1),h("span",null,"从服务器选择文件",-1),h("span",{class:"at-mention-hint"},"按 Enter 选择",-1)])),34),h("div",{class:g(["at-mention-option",{active:1===ie.value}]),onClick:n[9]||(n[9]=function(e){ie.value=1,we()}),onMouseenter:n[10]||(n[10]=function(e){return ie.value=1})},c(n[35]||(n[35]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("circle",{cx:"12",cy:"12",r:"10"}),h("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),h("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})],-1),h("span",null,"选择网站",-1),h("span",{class:"at-mention-hint"},"按 Enter 选择",-1)])),34)],4)):x("",!0)]}),_:1}),y(H,{name:"popover-fade"},{default:w(function(){return[X.value?(p(),m("div",{key:0,class:"at-mention-popover site-search-popover",style:b(oe.value)},[n[38]||(n[38]=h("div",{class:"site-search-tip"},"输入自动搜索域名",-1)),Y.value?(p(),m("div",_a,c(n[36]||(n[36]=[h("span",null,"搜索中...",-1)])))):0===Q.value.length?(p(),m("div",Ca,c(n[37]||(n[37]=[h("span",null,"无匹配网站",-1)])))):(p(!0),m(k,{key:2},_(Q.value,function(e,t){return p(),m("div",{key:e.name,class:g(["site-search-item",{active:t===ee.value}]),onClick:function(e){ee.value=t,_e()},onMouseenter:function(e){return ee.value=t}},[h("span",{class:g(["site-status-dot",{online:"1"===e.status}])},null,2),h("span",Ma,C(e.name),1),h("span",Ta,C(e.project_type),1)],42,xa)}),128))],4)):x("",!0)]}),_:1}),h("input",{ref_key:"fileInputRef",ref:$,type:"file",multiple:"",style:{display:"none"},onChange:Fe},null,544),h("input",{ref_key:"dirInputRef",ref:G,type:"file",webkitdirectory:"",directory:"",multiple:"",style:{display:"none"},onChange:qe},null,544),y(H,{name:"tooltip-fade"},{default:w(function(){return[B.value&&e.showToolPopover?(p(),m("div",{key:0,class:"tool-tooltip",style:b(I.value)},[h("div",{class:"tool-tooltip-content",innerHTML:(t=A.value,t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/\\n/g,"<br>").replace(/\n/g,"<br>"):"")},null,8,Sa)],4)):x("",!0)];var t}),_:1}),(p(),U(V,{to:"body"},[y(H,{name:"preview-fade"},{default:w(function(){return[R.value?(p(),m("div",{key:0,class:"image-preview-overlay",onClick:Re},[h("img",{src:D.value,alt:"预览图片",class:"image-preview-full",onClick:n[11]||(n[11]=z(function(){},["stop"]))},null,8,La),h("button",{class:"image-preview-close",onClick:Re},c(n[39]||(n[39]=[h("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),h("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])))])):x("",!0)]}),_:1})]))])}}}),Aa=Be(Ba,[["__scopeId","data-v-f4277da2"]]),Ia=S({system_prompt:"",api_base_url:"",api_key:"",models:[],embedding:{embedding_api_key:"",embedding_base_url:"",embedding_model_name:""},rag:{sliding_window_size:10,rag_trigger_threshold:3,rag_retrieval_count:10,rag_final_count:5},agent:{max_tool_iterations:10,temperature:1,top_p:1},default_headers:{}}),Ea=S([]),Pa=S(!1),Oa=S(""),ja=S([]),Ra=S(!1),za=S({}),Da=v(function(){var e,t={},n=l(ja.value);try{for(n.s();!(e=n.n()).done;){var o=e.value;t[o.category]||(t[o.category]=[]),t[o.category].push(o)}}catch(a){n.e(a)}finally{n.f()}return t}),Na=S(null),Ua=S(!1),Ha=S([]);function Va(e){var t;return null!==(t={low:"低风险",medium:"中风险",high:"高风险"}[e])&&void 0!==t?t:e}function Wa(e){return e.every(function(e){return e.show})}function Fa(e){var t=e.filter(function(e){return e.show}).length;return t>0&&t<e.length}function qa(){return Za.apply(this,arguments)}function Za(){return(Za=u(i().m(function e(){var t,n,o,a;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(Ia.value.api_base_url&&Ia.value.api_key){e.n=1;break}return Oa.value="请先填写 API Base URL 和 API Key",e.a(2);case 1:return Pa.value=!0,Oa.value="",e.p=2,e.n=3,mt({base_url:Ia.value.api_base_url,key:Ia.value.api_key});case 3:o=e.v,Pa.value=!1,a=null!==(t=null===(n=o.data)||void 0===n?void 0:n.data)&&void 0!==t?t:o.data,Array.isArray(a)&&a.length>0?(Ea.value=a.map(function(e){return{id:e}}),Oa.value=""):(Ea.value=[],Oa.value="未获取到任何模型"),e.n=5;break;case 4:e.p=4,e.v,Pa.value=!1,Oa.value="获取模型列表失败,请检查 API 配置",Ea.value=[];case 5:return e.a(2)}},e,null,[[2,4]])}))).apply(this,arguments)}function $a(){return($a=u(i().m(function e(){var t,n,o,a,r,s,u,c,v,f,p,m,h,g;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return Ra.value=!0,e.p=1,e.n=2,yt();case 2:o=e.v,a=null!==(t=null===(n=o.data)||void 0===n?void 0:n.data)&&void 0!==t?t:o.data,ja.value=Array.isArray(a)?a:[],r={},s=l(ja.value);try{for(s.s();!(u=s.n()).done;)c=u.value,r[c.category]||(r[c.category]=[]),r[c.category].push(c)}catch(i){s.e(i)}finally{s.f()}for(v={},f=0,p=Object.entries(r);f<p.length;f++)m=d(p[f],2),h=m[0],g=m[1],v[h]=g.every(function(e){return!e.show});za.value=v,e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,Ra.value=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))).apply(this,arguments)}function Ga(){return(Ga=u(i().m(function e(){var t,n,o,a;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return Ua.value=!0,e.p=1,e.n=2,wt();case 2:o=e.v,a=null!==(t=null===(n=o.data)||void 0===n?void 0:n.data)&&void 0!==t?t:o.data,Na.value=a,e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,Ua.value=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))).apply(this,arguments)}function Ka(e){za.value[e]=!za.value[e]}function Ja(e){return Xa.apply(this,arguments)}function Xa(){return(Xa=u(i().m(function e(t){var n;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return t._loading=!0,n=!t.show,e.p=1,e.n=2,ht({tool_id:t.id,show:n?"True":"False"});case 2:e.v.status&&(t.show=n),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,t._loading=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))).apply(this,arguments)}function Qa(e,t){return Ya.apply(this,arguments)}function Ya(){return(Ya=u(i().m(function e(t,n){var o;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(o=Da.value[t]){e.n=1;break}return e.a(2);case 1:return o.forEach(function(e){e._loading=!0}),e.p=2,e.n=3,ht({category:t,show:n?"True":"False"});case 3:e.v.status&&o.forEach(function(e){e.show=n}),e.n=5;break;case 4:e.p=4,e.v;case 5:return e.p=5,o.forEach(function(e){e._loading=!1}),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}))).apply(this,arguments)}function el(e){return tl.apply(this,arguments)}function tl(){return(tl=u(i().m(function e(t){return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return t._loading=!0,e.p=1,e.n=2,gt({skill_name:t.name,enabled:!t.enabled});case 2:e.v.status&&(t.enabled=!t.enabled,Na.value&&(Na.value.enabled=Na.value.skills.filter(function(e){return e.enabled}).length,Na.value.disabled=Na.value.total-Na.value.enabled)),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,t._loading=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))).apply(this,arguments)}function nl(){var e="header_".concat(Date.now());Ia.value.default_headers[e]="",Ha.value.push(e)}function ol(e){delete Ia.value.default_headers[e];var t=Ha.value.indexOf(e);t>-1&&Ha.value.splice(t,1)}function al(e,t){var n=Ha.value[e];if(n!==t&&n){var o=Ia.value.default_headers[t];delete Ia.value.default_headers[t],Ia.value.default_headers[n]=o}}function ll(e,t){var n=L(e,function(e){!function(e){var t,n,o,a,l,i,r,s,u,c,d,v;e&&(Ia.value={system_prompt:e.system_prompt||"",api_base_url:e.api_base_url||"",api_key:e.api_key||"",models:e.models||[],embedding:{embedding_api_key:(null===(t=e.embedding)||void 0===t?void 0:t.embedding_api_key)||"",embedding_base_url:(null===(n=e.embedding)||void 0===n?void 0:n.embedding_base_url)||"",embedding_model_name:(null===(o=e.embedding)||void 0===o?void 0:o.embedding_model_name)||""},rag:{sliding_window_size:(null===(a=e.rag)||void 0===a?void 0:a.sliding_window_size)||10,rag_trigger_threshold:(null===(l=e.rag)||void 0===l?void 0:l.rag_trigger_threshold)||3,rag_retrieval_count:(null===(i=e.rag)||void 0===i?void 0:i.rag_retrieval_count)||10,rag_final_count:(null===(r=e.rag)||void 0===r?void 0:r.rag_final_count)||5},agent:{max_tool_iterations:(null===(s=e.agent)||void 0===s?void 0:s.max_tool_iterations)||10,temperature:null!==(u=null===(c=e.agent)||void 0===c?void 0:c.temperature)&&void 0!==u?u:1,top_p:null!==(d=null===(v=e.agent)||void 0===v?void 0:v.top_p)&&void 0!==d?d:1},default_headers:e.default_headers||{}},Ha.value=Object.keys(Ia.value.default_headers))}(e)},{immediate:!0,deep:!0}),o=L(t,function(e){e&&(Ia.value.api_base_url&&Ia.value.api_key&&qa(),function(){$a.apply(this,arguments)}(),function(){Ga.apply(this,arguments)}())});return function(){n(),o()}}var il={mounted:function(e,t){e.indeterminate=t.value},updated:function(e,t){e.indeterminate=t.value}},rl={class:"drawer-content"},sl={class:"form-section"},ul={class:"form-section-group"},cl={class:"form-section"},dl={class:"form-section"},vl={class:"form-section"},fl={class:"form-label-with-action"},pl=["disabled","title"],ml={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},hl={key:1,class:"spinning",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},gl={key:0,class:"empty-models"},yl={key:1,class:"error-message"},wl={key:2,class:"models-checkbox-group"},bl=["value"],kl={class:"model-name"},_l={class:"form-section-group"},Cl={key:0,class:"skills-loading"},xl={key:1,class:"empty-skills"},Ml={key:2,class:"tool-groups"},Tl=["onClick"],Sl={class:"tool-group-left"},Ll={class:"tool-group-name"},Bl={class:"tool-group-count"},Al=["checked","disabled","onChange"],Il={class:"tool-item-list"},El=["onClick"],Pl={class:"tool-item-info"},Ol={class:"tool-item-title"},jl={class:"tool-item-name"},Rl={class:"tool-item-desc"},zl=["checked","disabled","onClick"],Dl={class:"form-section-group"},Nl={class:"skills-header"},Ul={key:0,class:"skills-stats"},Hl={class:"stats-badge stats-enabled"},Vl={class:"stats-badge stats-total"},Wl={key:0,class:"skills-loading"},Fl={key:1,class:"empty-skills"},ql={key:2,class:"skills-list"},Zl={class:"skill-info"},$l={class:"skill-name"},Gl={class:"skill-desc"},Kl={class:"skill-actions"},Jl=["disabled","onClick"],Xl={key:0,class:"spinning",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ql={class:"form-section-group"},Yl={class:"form-section"},ei={class:"form-section"},ti={class:"form-section"},ni={class:"form-section-group"},oi={class:"form-section"},ai={class:"form-section"},li={class:"form-section"},ii={class:"form-section"},ri={class:"form-section-group"},si={class:"form-section"},ui={class:"form-section"},ci={class:"form-section"},di={class:"form-section-group"},vi=["onUpdate:modelValue","onBlur"],fi=["onUpdate:modelValue"],pi=["onClick"],mi=a({__name:"SettingsDrawer",props:{visible:{type:Boolean},config:{}},emits:["close","save"],setup:function(e,t){var n,o=t.emit,a=e,l=o;function i(){l("close")}function r(){var e=function(){if(Ea.value.length>0){var e=Ea.value.map(function(e){return e.id});Ia.value.models=Ia.value.models.filter(function(t){return e.includes(t)})}return Ia.value}();l("save",e)}return I(function(){n=ll(function(){return a.config},function(){return a.visible})}),F(function(){n&&n()}),function(t,n){return p(),m("div",{class:g(["settings-drawer-overlay",{show:e.visible}]),onClick:i},[h("div",{class:g(["settings-drawer",{show:e.visible}]),onClick:n[17]||(n[17]=z(function(){},["stop"]))},[n[63]||(n[63]=h("div",{class:"drawer-header"},[h("h3",null,"全局参数配置")],-1)),h("div",rl,[h("div",sl,[n[18]||(n[18]=h("label",{class:"form-label"},"System Prompt",-1)),E(h("textarea",{"onUpdate:modelValue":n[0]||(n[0]=function(e){return f(Ia).system_prompt=e}),class:"form-textarea",rows:"6",placeholder:"请输入系统提示词..."},null,512),[[q,f(Ia).system_prompt]])]),h("div",ul,[n[27]||(n[27]=h("h4",{class:"section-title"},"API 配置",-1)),h("div",cl,[n[19]||(n[19]=h("label",{class:"form-label"},"API Base URL",-1)),n[20]||(n[20]=h("div",{class:"form-hint"},"大模型 API 服务接口地址",-1)),E(h("input",{"onUpdate:modelValue":n[1]||(n[1]=function(e){return f(Ia).api_base_url=e}),type:"text",class:"form-input",placeholder:"https://api.openai.com/v1"},null,512),[[q,f(Ia).api_base_url]])]),h("div",dl,[n[21]||(n[21]=h("label",{class:"form-label"},"API Key",-1)),n[22]||(n[22]=h("div",{class:"form-hint"},"调用 API 的密钥或密码",-1)),E(h("input",{"onUpdate:modelValue":n[2]||(n[2]=function(e){return f(Ia).api_key=e}),type:"text",class:"form-input",placeholder:"请输入 API Key"},null,512),[[q,f(Ia).api_key]])]),h("div",vl,[h("div",fl,[n[25]||(n[25]=h("label",{class:"form-label"},"Models",-1)),h("button",{class:"fetch-models-btn",disabled:f(Pa)||!f(Ia).api_base_url||!f(Ia).api_key,title:f(Ia).api_base_url&&f(Ia).api_key?"获取模型列表":"请先填写 API Base URL 和 API Key",onClick:n[3]||(n[3]=function(){return f(qa)&&f(qa).apply(void 0,arguments)})},[f(Pa)?(p(),m("svg",hl,c(n[24]||(n[24]=[h("path",{d:"M21 12a9 9 0 11-6.219-8.56"},null,-1)])))):(p(),m("svg",ml,c(n[23]||(n[23]=[h("path",{d:"M21 12a9 9 0 11-6.219-8.56"},null,-1)])))),N(" "+C(f(Pa)?"获取中...":"获取模型列表"),1)],8,pl)]),n[26]||(n[26]=h("div",{class:"form-hint"},"选择要使用的模型",-1)),0!==f(Ea).length||f(Pa)?x("",!0):(p(),m("div",gl,' 点击"获取模型列表"按钮加载可用模型 ')),f(Oa)?(p(),m("div",yl,C(f(Oa)),1)):x("",!0),f(Ea).length>0?(p(),m("div",wl,[(p(!0),m(k,null,_(f(Ea),function(e){return p(),m("label",{key:e.id,class:"model-checkbox-item"},[E(h("input",{"onUpdate:modelValue":n[4]||(n[4]=function(e){return f(Ia).models=e}),type:"checkbox",value:e.id,class:"model-checkbox"},null,8,bl),[[Z,f(Ia).models]]),h("span",kl,C(e.id),1)])}),128))])):x("",!0)])]),h("div",_l,[n[30]||(n[30]=h("h4",{class:"section-title"},"工具配置",-1)),n[31]||(n[31]=h("div",{class:"form-hint",style:{"margin-bottom":"12px"}},"控制 Agent 可调用的工具,可按分类或单个工具管理显示状态",-1)),f(Ra)?(p(),m("div",Cl,c(n[28]||(n[28]=[h("svg",{class:"spinning",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M21 12a9 9 0 11-6.219-8.56"})],-1),N(" 加载中... ",-1)])))):f(ja).length?(p(),m("div",Ml,[(p(!0),m(k,null,_(f(Da),function(e,t){return p(),m("div",{key:t,class:"tool-group"},[h("div",{class:"tool-group-header",onClick:function(e){return f(Ka)(t)}},[h("div",Sl,[(p(),m("svg",{class:g(["collapse-chevron",{collapsed:f(za)[t]}]),width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},c(n[29]||(n[29]=[h("polyline",{points:"6 9 12 15 18 9"},null,-1)])),2)),h("span",Ll,C(t),1),h("span",Bl,C(e.filter(function(e){return e.show}).length)+"/"+C(e.length),1)]),E(h("input",{type:"checkbox",class:"tool-checkbox",checked:f(Wa)(e),disabled:e.some(function(e){return e._loading}),onClick:n[5]||(n[5]=z(function(){},["stop"])),onChange:z(function(n){return f(Qa)(t,!f(Wa)(e))},["stop"])},null,40,Al),[[f(il),f(Fa)(e)]])],8,Tl),E(h("div",Il,[(p(!0),m(k,null,_(e,function(e){return p(),m("div",{key:e.id,class:g(["tool-item",{"tool-item-loading":e._loading}]),onClick:function(t){return!e._loading&&f(Ja)(e)}},[h("div",Pl,[h("div",Ol,[h("span",jl,C(e.name_cn||e.id),1),h("span",{class:g(["tool-risk-badge","risk-".concat(e.risk_level)])},C(f(Va)(e.risk_level)),3)]),h("div",Rl,C(e.description),1)]),h("input",{type:"checkbox",class:"tool-checkbox",checked:e.show,disabled:e._loading,onClick:z(function(t){return!e._loading&&f(Ja)(e)},["stop"])},null,8,zl)],10,El)}),128))],512),[[P,!f(za)[t]]])])}),128))])):(p(),m("div",xl," 暂无可用工具 "))]),h("div",Dl,[h("div",Nl,[n[32]||(n[32]=h("h4",{class:"section-title",style:{"margin-bottom":"0"}},"Skills 配置",-1)),f(Na)?(p(),m("div",Ul,[h("span",Hl,"已启用 "+C(f(Na).enabled),1),h("span",Vl,"共 "+C(f(Na).total),1)])):x("",!0)]),n[35]||(n[35]=h("div",{class:"form-hint",style:{"margin-top":"6px","margin-bottom":"12px"}},"管理已安装的 Agent Skills,可单独启用或禁用",-1)),f(Ua)?(p(),m("div",Wl,c(n[33]||(n[33]=[h("svg",{class:"spinning",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M21 12a9 9 0 11-6.219-8.56"})],-1),N(" 加载中... ",-1)])))):f(Na)&&f(Na).skills.length?(p(),m("div",ql,[(p(!0),m(k,null,_(f(Na).skills,function(e){return p(),m("div",{key:e.name,class:"skill-item"},[h("div",Zl,[h("div",$l,C(e.name),1),h("div",Gl,C(e.description),1)]),h("div",Kl,[h("span",{class:g(["skill-status-badge",e.enabled?"badge-enabled":"badge-disabled"])},C(e.enabled?"已启用":"已禁用"),3),h("button",{class:g(["skill-toggle-btn",e.enabled?"btn-disable":"btn-enable"]),disabled:e._loading,onClick:function(t){return f(el)(e)}},[e._loading?(p(),m("svg",Xl,c(n[34]||(n[34]=[h("path",{d:"M21 12a9 9 0 11-6.219-8.56"},null,-1)])))):x("",!0),N(" "+C(e.enabled?"禁用":"启用"),1)],10,Jl)])])}),128))])):(p(),m("div",Fl," 暂无可用 Skills "))]),h("div",Ql,[n[42]||(n[42]=h("h4",{class:"section-title"},"Embedding 配置",-1)),h("div",Yl,[n[36]||(n[36]=h("label",{class:"form-label"},"Embedding Base URL",-1)),n[37]||(n[37]=h("div",{class:"form-hint"},"向量模型 API 服务地址",-1)),E(h("input",{"onUpdate:modelValue":n[6]||(n[6]=function(e){return f(Ia).embedding.embedding_base_url=e}),type:"text",class:"form-input",placeholder:"https://api.openai.com/v1/embeddings"},null,512),[[q,f(Ia).embedding.embedding_base_url]])]),h("div",ei,[n[38]||(n[38]=h("label",{class:"form-label"},"Embedding API Key",-1)),n[39]||(n[39]=h("div",{class:"form-hint"},"向量模型 API 密钥或密码",-1)),E(h("input",{"onUpdate:modelValue":n[7]||(n[7]=function(e){return f(Ia).embedding.embedding_api_key=e}),type:"text",class:"form-input",placeholder:"请输入 Embedding API Key"},null,512),[[q,f(Ia).embedding.embedding_api_key]])]),h("div",ti,[n[40]||(n[40]=h("label",{class:"form-label"},"Embedding Model Name",-1)),n[41]||(n[41]=h("div",{class:"form-hint"},"使用的向量模型名称",-1)),E(h("input",{"onUpdate:modelValue":n[8]||(n[8]=function(e){return f(Ia).embedding.embedding_model_name=e}),type:"text",class:"form-input",placeholder:"text-embedding-v4"},null,512),[[q,f(Ia).embedding.embedding_model_name]])])]),h("div",ni,[n[51]||(n[51]=h("h4",{class:"section-title"},"RAG 配置",-1)),h("div",oi,[n[43]||(n[43]=h("label",{class:"form-label"},"Sliding Window Size",-1)),n[44]||(n[44]=h("div",{class:"form-hint"},"每次滑动窗口的大小, 在条格数",-1)),E(h("input",{"onUpdate:modelValue":n[9]||(n[9]=function(e){return f(Ia).rag.sliding_window_size=e}),type:"number",class:"form-input",placeholder:"10"},null,512),[[q,f(Ia).rag.sliding_window_size,void 0,{number:!0}]])]),h("div",ai,[n[45]||(n[45]=h("label",{class:"form-label"},"Trigger Threshold",-1)),n[46]||(n[46]=h("div",{class:"form-hint"},"对话超过 N 轮触发 RAG",-1)),E(h("input",{"onUpdate:modelValue":n[10]||(n[10]=function(e){return f(Ia).rag.rag_trigger_threshold=e}),type:"number",class:"form-input",placeholder:"3"},null,512),[[q,f(Ia).rag.rag_trigger_threshold,void 0,{number:!0}]])]),h("div",li,[n[47]||(n[47]=h("label",{class:"form-label"},"Retrieval Count",-1)),n[48]||(n[48]=h("div",{class:"form-hint"},"从向量库中召回 N 条相关",-1)),E(h("input",{"onUpdate:modelValue":n[11]||(n[11]=function(e){return f(Ia).rag.rag_retrieval_count=e}),type:"number",class:"form-input",placeholder:"10"},null,512),[[q,f(Ia).rag.rag_retrieval_count,void 0,{number:!0}]])]),h("div",ii,[n[49]||(n[49]=h("label",{class:"form-label"},"Final Count",-1)),n[50]||(n[50]=h("div",{class:"form-hint"},"最终拼接进 Prompt 的参考条数",-1)),E(h("input",{"onUpdate:modelValue":n[12]||(n[12]=function(e){return f(Ia).rag.rag_final_count=e}),type:"number",class:"form-input",placeholder:"5"},null,512),[[q,f(Ia).rag.rag_final_count,void 0,{number:!0}]])])]),h("div",ri,[n[58]||(n[58]=h("h4",{class:"section-title"},"Agent 配置",-1)),h("div",si,[n[52]||(n[52]=h("label",{class:"form-label"},"Max Tool Iterations",-1)),n[53]||(n[53]=h("div",{class:"form-hint"},"单次工具调用次数, 防止循环",-1)),E(h("input",{"onUpdate:modelValue":n[13]||(n[13]=function(e){return f(Ia).agent.max_tool_iterations=e}),type:"number",class:"form-input",placeholder:"10"},null,512),[[q,f(Ia).agent.max_tool_iterations,void 0,{number:!0}]])]),h("div",ui,[n[54]||(n[54]=h("label",{class:"form-label"},"Temperature",-1)),n[55]||(n[55]=h("div",{class:"form-hint"},"温度值 (0-2), 控制随机性",-1)),E(h("input",{"onUpdate:modelValue":n[14]||(n[14]=function(e){return f(Ia).agent.temperature=e}),type:"number",step:"0.1",min:"0",max:"2",class:"form-input",placeholder:"1"},null,512),[[q,f(Ia).agent.temperature,void 0,{number:!0}]])]),h("div",ci,[n[56]||(n[56]=h("label",{class:"form-label"},"Top P",-1)),n[57]||(n[57]=h("div",{class:"form-hint"},"采样值 (0-1), 控制输出稳定性",-1)),E(h("input",{"onUpdate:modelValue":n[15]||(n[15]=function(e){return f(Ia).agent.top_p=e}),type:"number",step:"0.1",min:"0",max:"1",class:"form-input",placeholder:"1"},null,512),[[q,f(Ia).agent.top_p,void 0,{number:!0}]])])]),h("div",di,[n[61]||(n[61]=h("h4",{class:"section-title"},"Default Headers",-1)),n[62]||(n[62]=h("div",{class:"form-hint",style:{"margin-bottom":"12px"}},"自定义请求头",-1)),(p(!0),m(k,null,_(f(Ia).default_headers,function(e,t,o){return p(),m("div",{key:o,class:"header-item"},[E(h("input",{"onUpdate:modelValue":function(e){return f(Ha)[o]=e},type:"text",class:"form-input header-key",placeholder:"键",onBlur:function(e){return f(al)(o,t)}},null,40,vi),[[q,f(Ha)[o]]]),E(h("input",{"onUpdate:modelValue":function(e){return f(Ia).default_headers[t]=e},type:"text",class:"form-input header-value",placeholder:"值"},null,8,fi),[[q,f(Ia).default_headers[t]]]),h("button",{class:"delete-header-btn",title:"删除",onClick:function(e){return f(ol)(t)}},c(n[59]||(n[59]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"3 6 5 6 21 6"}),h("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})],-1)])),8,pi)])}),128)),h("button",{class:"add-header-btn",onClick:n[16]||(n[16]=function(){return f(nl)&&f(nl).apply(void 0,arguments)})},c(n[60]||(n[60]=[h("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M12 5v14M5 12h14"})],-1),N(" 添加 ",-1)])))])]),h("div",{class:"drawer-footer"},[h("button",{class:"save-btn",onClick:r},"保存")])],2)],2)}}}),hi=Be(mi,[["__scopeId","data-v-138c9e9f"]]),gi={class:"ai-chat-title"},yi={class:"ai-chat-actions"},wi=["disabled"],bi=["disabled"],ki={key:0,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},_i={key:1,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},Ci={key:0,class:"quota-item"},xi={class:"quota-item"},Mi={key:0},Ti={key:1},Si={class:"chat-main"},Li=a({__name:"index",props:{windowMode:{}},emits:["close","update:windowMode"],setup:function(e,a){var r=a.expose,s=a.emit,d=e,v=s,b=gn(),_=b.inputMessage,M=b.currentMessages,B=b.conversations,A=b.currentConversationId,E=b.historyPanelVisible,P=b.isTyping,O=b.isSending,R=b.streamingContentBlocks,z=b.streamingThinkCollapsed,H=b.modelsList,V=b.currentModel,q=b.toolsList,Z=b.selectedTools,G=b.showToolPopover,K=b.toolsLoading,J=b.webSearchEnabled,X=b.smartMode,Q=b.loadConversations,Y=b.saveConversation,ee=b.loadConversation,te=b.deleteConversation,ne=b.createNewConversation,oe=b.getTimeAgo,ae=ke().payment,le=function(){var e=null;function t(){return t=u(i().m(function t(n,a,r,s,u,c,d,v,f,p,m,h,g,y){var w,b,k,_,C,x,M,T,S,L,B,A,I,E,P,O,j,R,z,D,N,U,H;return i().w(function(t){for(;;)switch(t.p=t.n){case 0:return e&&e.abort(),e=new AbortController,w=e.signal,t.p=1,k=Date.now(),_=window.vite_public_proxy_key||"",Ee(String(k).concat(Ee(_))),t.n=2,fetch("".concat("","/mod/agent/com/chat").concat(""),{method:"POST",headers:{"Content-Type":"application/json","x-http-token":window.vite_public_request_token},body:JSON.stringify(o(o({sessions_dir:"aics_sessions",prompt_id:"agent_aics",message:"string"==typeof n?n:JSON.stringify(n)},d?{web_search:!0,tools:u.map(function(e){return e.id})}:o({tools:s.map(function(e){return e.id})},c?{web_search:!0}:{})),{},{session_id:a})),signal:w});case 2:if(C=t.v,x=null===(b=C.body)||void 0===b?void 0:b.getReader()){t.n=3;break}throw new Error("无法获取响应流");case 3:M=new TextDecoder("utf-8");case 4:return t.n=5,x.read();case 5:if(T=t.v,S=T.done,L=T.value,!S){t.n=6;break}return t.a(3,26);case 6:B=M.decode(L,{stream:!0}),A=B.split("\n"),I=void 0,E={onThink:m,onChunk:v,onError:p,onComplete:f,onToolCall:h,onToolResult:g,onMetaInfo:y},P=l(A),t.p=7,P.s();case 8:if((O=P.n()).done){t.n=22;break}if(""!==(j=(j=O.value).replace(/\r$/,""))){t.n=9;break}return t.a(3,21);case 9:if(!j.startsWith("event:")){t.n=19;break}U=j.slice(6).trim(),t.n="message_think"===U?10:"message"===U?11:"tool_call"===U?12:"tool_result"===U?13:"meta_info"===U?14:"message_end"===U?15:"error"===U?16:"usage"===U?17:18;break;case 10:return I="onThink",t.a(3,18);case 11:return I="onChunk",t.a(3,18);case 12:return I="onToolCall",t.a(3,18);case 13:return I="onToolResult",t.a(3,18);case 14:return I="onMetaInfo",t.a(3,18);case 15:return f(),t.a(3,18);case 16:return I="onError",t.a(3,18);case 17:return I="",t.a(3,18);case 18:t.n=21;break;case 19:if(!j.startsWith("data:")){t.n=21;break}if(((R=j.slice(5).slice(1)).startsWith('"')&&R.endsWith('"')||R.startsWith("'")&&R.endsWith("'"))&&(R=R.slice(1,-1)),I){t.n=20;break}return t.a(3,21);case 20:if("onToolCall"===I||"onToolResult"===I||"onMetaInfo"===I)try{D=JSON.parse(R),null===(z=E[I])||void 0===z||z.call(E,D)}catch(i){}else R=R.replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t"),null===(N=E[I])||void 0===N||N.call(E,R);case 21:t.n=8;break;case 22:t.n=24;break;case 23:t.p=23,H=t.v,P.e(H);case 24:return t.p=24,P.f(),t.f(24);case 25:t.n=4;break;case 26:e=null,t.n=29;break;case 27:if(t.p=27,"AbortError"!==t.v.name){t.n=28;break}return e=null,t.a(2);case 28:p("抱歉,连接AI服务时出现错误,请稍后再试。"),e=null;case 29:return t.a(2)}},t,null,[[7,23,24,25],[1,27]])})),t.apply(this,arguments)}return{getAIResponseStream:function(e,n,o,a,l,i,r,s,u,c,d,v,f,p){return t.apply(this,arguments)},abortCurrentRequest:function(){e&&(e.abort(),e=null)}}}(),ie=le.getAIResponseStream,re=le.abortCurrentRequest,se=S(null),ue=S(null),ce=S(null),de=null,ve=!1,fe=0,pe=0,me=0,he=0;function ge(){var e;return null===(e=se.value)||void 0===e?void 0:e.closest(".ai-chat-wrapper")}function ye(e){if("popup"===d.windowMode&&!e.target.closest("button")&&!e.target.closest(".el-popover")){var t=ge();if(t){ve=!0,fe=e.clientX,pe=e.clientY;var n=t.getBoundingClientRect();me=n.top,he=n.left,t.style.top="".concat(n.top,"px"),t.style.left="".concat(n.left,"px"),t.style.bottom="auto",t.style.right="auto",document.addEventListener("mousemove",we),document.addEventListener("mouseup",be),e.preventDefault()}}}function we(e){if(ve){var t=ge();if(t){var n=t.offsetWidth,o=t.offsetHeight,a=Math.max(0,Math.min(me+e.clientY-pe,window.innerHeight-o)),l=Math.max(0,Math.min(he+e.clientX-fe,window.innerWidth-n));t.style.top="".concat(a,"px"),t.style.left="".concat(l,"px")}}}function be(){ve=!1,document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",be)}var _e=null;function Ce(){P.value=!1,_e&&clearTimeout(_e),_e=setTimeout(function(){O.value&&(P.value=!0)},3e3)}function xe(){_e&&(clearTimeout(_e),_e=null),P.value=!1}function Me(){"snap"===d.windowMode?v("update:windowMode","popup"):v("update:windowMode","snap")}L(function(){return d.windowMode},function(){W(function(){var e;(e=ge())&&(e.style.top="",e.style.left="",e.style.bottom="",e.style.right="")})});var Te=S(!1),Se=S({remain:0,total:0,resetTime:"",exhausted:!1}),Le=S({remain:0,total:0,exhausted:!1}),Be=S(!1),Ae=S({system_prompt:"",api_base_url:"",api_key:"",models:[],embedding:{embedding_api_key:"",embedding_base_url:"",embedding_model_name:""},rag:{sliding_window_size:10,rag_trigger_threshold:3,rag_retrieval_count:10,rag_final_count:5},agent:{max_tool_iterations:10,temperature:1,top_p:1},default_headers:{},questions:[]});function Ie(e){if(e){Te.value=!0;var t=(e.total||0)-(e.used||0);Se.value={remain:Math.max(0,t),total:e.total||0,resetTime:e.reset_time||"",exhausted:t<=0};var n=e.common_packages;if(n&&n.total_count>0){var o=n.total_count-n.used_count;Le.value={remain:Math.max(0,o),total:n.total_count,exhausted:o<=0}}else Le.value={remain:0,total:0,exhausted:!1};e.gift&&Ct()}}var ze=function(){var e=u(i().m(function e(){var t,n;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,bt({type:"aics"});case 1:(n=e.v).data&&null!==(t=n.data.data)&&void 0!==t&&t.daily_quota&&(Ie(n.data.data.daily_quota),window.dispatchEvent(new CustomEvent("update-sidebar-info",{detail:{data:n.data}})));case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),De=function(){var e=u(i().m(function e(){return i().w(function(e){for(;;)switch(e.n){case 0:je({title:"额度充值",area:80,btn:!1,showFooter:!1,customClass:"top-index ",compData:{callback:function(){var e=u(i().m(function e(){var t;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,bt({type:"aics"});case 1:(t=e.v).status&&Ne(t.data.data);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}()},component:function(){return Re(function(){return n.import("./index-legacy493.js?v=1777008528")},void 0,n.meta.url)}});case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();function Ne(e){var t,n,o,a,l,i,r,s,u,c,d,v;e&&e.config&&(Ae.value={system_prompt:e.config.system_prompt||"",api_base_url:e.config.api_base_url||"",api_key:e.config.api_key||"",models:e.config.models||[],embedding:{embedding_api_key:(null===(t=e.config.embedding)||void 0===t?void 0:t.embedding_api_key)||"",embedding_base_url:(null===(n=e.config.embedding)||void 0===n?void 0:n.embedding_base_url)||"",embedding_model_name:(null===(o=e.config.embedding)||void 0===o?void 0:o.embedding_model_name)||""},rag:{sliding_window_size:(null===(a=e.config.rag)||void 0===a?void 0:a.sliding_window_size)||10,rag_trigger_threshold:(null===(l=e.config.rag)||void 0===l?void 0:l.rag_trigger_threshold)||3,rag_retrieval_count:(null===(i=e.config.rag)||void 0===i?void 0:i.rag_retrieval_count)||10,rag_final_count:(null===(r=e.config.rag)||void 0===r?void 0:r.rag_final_count)||5},agent:{max_tool_iterations:(null===(s=e.config.agent)||void 0===s?void 0:s.max_tool_iterations)||10,temperature:null!==(u=null===(c=e.config.agent)||void 0===c?void 0:c.temperature)&&void 0!==u?u:1,top_p:null!==(d=null===(v=e.config.agent)||void 0===v?void 0:v.top_p)&&void 0!==d?d:1},default_headers:e.config.default_headers||{}},H.value=e.config.models||[],H.value.length>0&&(V.value=e.config.default_model||H.value[0]));e&&e.questions&&(Ae.value.questions=e.questions),e&&e.daily_quota&&Ie(e.daily_quota)}var Ue=function(){lt({name:"bt_agent"}),v("close")};function He(){re(),xe(),O.value=!1,R.value.length>0&&(R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),M.value.push({role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:c(R.value)})),R.value=[],Y(),ze()}function Ve(){return We.apply(this,arguments)}function We(){return(We=u(i().m(function e(){var n,o,a,r,s,u,d,v,f,p,m,h,g,y,w,b,k,C,x,T,S,L,B,I,E;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(ae.value.bindUser){e.n=1;break}return Oe.error("请先绑定用户"),it(),e.a(2);case 1:if(u=_.value,d=(null===(n=ce.value)||void 0===n?void 0:n.getPendingImages())||[],v=(null===(o=ce.value)||void 0===o?void 0:o.getPendingFiles())||[],f=null===(a=ce.value)||void 0===a?void 0:a.getPendingSites(),(u||0!==d.length||0!==v.length||0!==((null==f?void 0:f.length)||0))&&!O.value){e.n=2;break}return e.a(2);case 2:A.value||(A.value=Date.now().toString()),O.value=!0,_.value="",null===(r=ce.value)||void 0===r||r.clearAll(),W(function(){var e;null===(e=ce.value)||void 0===e||e.autoResizeTextarea()}),p=[],u&&p.push({type:"text",text:u}),m=new Set,h=l(v),e.p=3,y=i().m(function e(){var t,n,o,a,l,r;return i().w(function(e){for(;;)switch(e.n){case 0:o=g.value,a="@".concat(o.name),l=p.find(function(e){var t;return"file"===e.type&&"source"in e&&(null===(t=e.source)||void 0===t?void 0:t.value)===a}),-1!==(r=u.indexOf(a,null!==(t=null==l||null===(n=l.source)||void 0===n?void 0:n.end)&&void 0!==t?t:0))&&(p.push({type:"file",source:{value:a,start:r,end:r+a.length},path:o.path}),m.add(a));case 1:return e.a(2)}},e)}),h.s();case 4:if((g=h.n()).done){e.n=6;break}return e.d(t(y()),5);case 5:e.n=4;break;case 6:e.n=8;break;case 7:e.p=7,E=e.v,h.e(E);case 8:return e.p=8,h.f(),e.f(8);case 9:w=l(f||[]);try{for(w.s();!(b=w.n()).done;)k=b.value,C="@site:".concat(k.name),-1!==(x=u.indexOf(C))&&p.push({type:"site",source:{value:C,start:x,end:x+C.length},name:k.name})}catch(j){w.e(j)}finally{w.f()}if(d.length>0){T=l(d);try{for(T.s();!(S=T.n()).done;)L=S.value,p.push({type:"image_url",image_url:{url:L}})}catch(j){T.e(j)}finally{T.f()}}return B=p,I=M.value.length,M.value.push({role:"user",content:B,time:(new Date).toISOString()}),P.value=!0,null===(s=ue.value)||void 0===s||s.forceScrollToBottom(),R.value=[],z.value=!1,e.n=10,ie(B,A.value,V.value,Z.value,q.value,J.value,X.value,function(e){Ce();var t=R.value[R.value.length-1];t&&"message"===t.type?t.content+=e:R.value.push({type:"message",content:e}),R.value.some(function(e){return"think"===e.type})&&(z.value=!0),W(function(){var e;null===(e=ue.value)||void 0===e||e.scrollToBottom()})},function(){if(xe(),R.value.length>0){R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)});var e=window.__temp_ai_msg_id;delete window.__temp_ai_msg_id,M.value.push({role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:c(R.value),id:e})}R.value=[],O.value=!1,Y(),ze(),W(function(){var e;null===(e=ue.value)||void 0===e||e.scrollToBottom()})},function(e){xe(),R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),R.value.push({type:"message",content:e}),M.value.push({role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:c(R.value)}),R.value=[],O.value=!1,Y(),ze()},function(e){Ce();var t=R.value[R.value.length-1];t&&"think"===t.type?t.content+=e:(R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),R.value.push({type:"think",content:e,collapsed:!1})),W(function(){var e;null===(e=ue.value)||void 0===e||e.scrollToBottom()})},function(e){Ce();var t=function(){try{return JSON.parse(e.args).description}catch(t){return}}();if("TodoWrite"===e.tool){var n=Jt(e.args);if(n&&n.length>0){var o=R.value.findIndex(function(e){return"tool_call"===e.type&&"TodoWrite"===e.tool});-1!==o&&R.value.splice(o,1),R.value.push({type:"tool_call",tool:e.tool,args:e.args,id:e.id,status:"calling",collapsed:!1,todoItems:n,description:t})}}else{var a=R.value.find(function(t){return"tool_call"===t.type&&t.id===e.id});a&&"tool_call"===a.type?(a.args=e.args,a.status="calling",t&&(a.description=t)):R.value.push({type:"tool_call",tool:e.tool,args:e.args,id:e.id,status:"calling",collapsed:!0,description:t})}W(function(){var e;null===(e=ue.value)||void 0===e||e.scrollToBottom()})},function(e){Ce();var t=R.value.find(function(t){return"tool_call"===t.type&&t.id===e.id});if(t&&"tool_call"===t.type&&(t.result=e.result,t.status="completed","TodoWrite"===t.tool)){var n=Xt(e.result);n&&(t.todoItems=n)}W(function(){var e;null===(e=ue.value)||void 0===e||e.scrollToBottom()})},function(e){M.value[I]&&(M.value[I].id=e.user_msg_id),window.__temp_ai_msg_id=e.ai_msg_id});case 10:return e.a(2)}},e,null,[[3,7,8,9]])}))).apply(this,arguments)}function Fe(e){return qe.apply(this,arguments)}function qe(){return qe=u(i().m(function e(t){var n,o;return i().w(function(e){for(;;)switch(e.n){case 0:n="",o=t-1;case 1:if(!(o>=0)){e.n=3;break}if("user"!==M.value[o].role){e.n=2;break}return n=M.value[o].content,e.a(3,3);case 2:o--,e.n=1;break;case 3:if(n){e.n=4;break}return e.a(2);case 4:return M.value.splice(t,1),P.value=!0,O.value=!0,R.value=[],z.value=!1,e.n=5,ie(n,A.value||Date.now().toString(),V.value,Z.value,q.value,J.value,X.value,function(e){var t;Ce();var n=R.value[R.value.length-1];n&&"message"===n.type?n.content+=e:R.value.push({type:"message",content:e}),null===(t=ue.value)||void 0===t||t.scrollToBottom()},function(){if(xe(),R.value.length>0){R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)});var e=window.__temp_ai_msg_id_regen;delete window.__temp_ai_msg_id_regen,M.value.splice(t,0,{role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:c(R.value),id:e})}R.value=[],O.value=!1,Y(),ze()},function(e){xe(),R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),R.value.push({type:"message",content:e}),M.value.splice(t,0,{role:"assistant",content:"",time:(new Date).toISOString(),contentBlocks:c(R.value)}),R.value=[],O.value=!1,Y(),ze()},function(e){var t;Ce();var n=R.value[R.value.length-1];n&&"think"===n.type?n.content+=e:(R.value.forEach(function(e){"think"===e.type&&(e.collapsed=!0)}),R.value.push({type:"think",content:e,collapsed:!1})),null===(t=ue.value)||void 0===t||t.scrollToBottom()},function(e){var t;Ce();var n=function(){try{return JSON.parse(e.args).description}catch(t){return}}();if("TodoWrite"===e.tool){var o=Jt(e.args);if(o&&o.length>0){var a=R.value.findIndex(function(e){return"tool_call"===e.type&&"TodoWrite"===e.tool});-1!==a&&R.value.splice(a,1),R.value.push({type:"tool_call",tool:e.tool,args:e.args,id:e.id,status:"calling",collapsed:!1,todoItems:o,description:n})}}else{var l=R.value.find(function(t){return"tool_call"===t.type&&t.id===e.id});l&&"tool_call"===l.type?(l.args=e.args,l.status="calling",n&&(l.description=n)):R.value.push({type:"tool_call",tool:e.tool,args:e.args,id:e.id,status:"calling",collapsed:!0,description:n})}null===(t=ue.value)||void 0===t||t.scrollToBottom()},function(e){var t;Ce();var n=R.value.find(function(t){return"tool_call"===t.type&&t.id===e.id});if(n&&"tool_call"===n.type&&(n.result=e.result,n.status="completed","TodoWrite"===n.tool)){var o=Xt(e.result);o&&(n.todoItems=o)}null===(t=ue.value)||void 0===t||t.scrollToBottom()},function(e){window.__temp_ai_msg_id_regen=e.ai_msg_id});case 5:return e.a(2)}},e)})),qe.apply(this,arguments)}function Ze(e){return $e.apply(this,arguments)}function $e(){return $e=u(i().m(function e(t){var n,o,a;return i().w(function(e){for(;;)switch(e.n){case 0:return n=M.value[t],o=function(){var e=u(i().m(function e(){return i().w(function(e){for(;;)switch(e.n){case 0:if(n.id&&A.value){e.n=1;break}return M.value.splice(t,1),Y(),0===M.value.length&&ne(),e.a(2);case 1:return e.n=2,xt({session_id:A.value,sessions_dir:"aics_sessions",id:n.id});case 2:e.v.status&&(M.value.splice(t,1),Y(),0===M.value.length&&ne());case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),a=n.id?"删除后,聊天记录不可恢复,对话内的文件也将被彻底删除":"是否删除该条消息?",e.n=1,Pe({title:"删除消息",content:a});case 1:return e.n=2,o();case 2:return e.a(2)}},e)})),$e.apply(this,arguments)}function Ge(e){if(_.value=e.question,e.tools&&e.tools.length>0){var t=e.tools.map(function(e){return q.value.find(function(t){return t.id===e})}).filter(function(e){return void 0!==e});Z.value=t}W(function(){var e;null===(e=ce.value)||void 0===e||e.autoResizeTextarea()})}function Ke(){Qe(),E.value=!0}function Je(){E.value=!1}function Xe(){de=setTimeout(function(){Je()},200)}function Qe(){de&&(clearTimeout(de),de=null)}function Ye(e){return et.apply(this,arguments)}function et(){return(et=u(i().m(function e(t){var n;return i().w(function(e){for(;;)switch(e.n){case 0:return Je(),e.n=1,ee(t);case 1:null===(n=ue.value)||void 0===n||n.forceScrollToBottom();case 2:return e.a(2)}},e)}))).apply(this,arguments)}function tt(e){return nt.apply(this,arguments)}function nt(){return nt=u(i().m(function e(t){var n;return i().w(function(e){for(;;)switch(e.n){case 0:localStorage.getItem("isPanelRiskConfirm"),(n=Z.value.findIndex(function(e){return e.id===t.id}))>-1?Z.value.splice(n,1):Z.value.push(t);case 1:return e.a(2)}},e)})),nt.apply(this,arguments)}function ot(e,t){if(t)e.forEach(function(e){Z.value.some(function(t){return t.id===e.id})||Z.value.push(e)});else{var n=new Set(e.map(function(e){return e.id}));Z.value=Z.value.filter(function(e){return!n.has(e.id)})}}function at(e){var t=Z.value.findIndex(function(t){return t.id===e});t>-1&&Z.value.splice(t,1)}function rt(e){var t=e.target;t.closest(".custom-popover")||t.closest(".toolbar-button")||(G.value=!1)}function st(){return ut.apply(this,arguments)}function ut(){return(ut=u(i().m(function e(){var t,n;return i().w(function(e){for(;;)switch(e.n){case 0:return Be.value=!1,e.n=1,kt();case 1:(n=e.v).data&&Array.isArray(null===(t=n.data)||void 0===t?void 0:t.data)&&(q.value=n.data.data||[]);case 2:return e.a(2)}},e)}))).apply(this,arguments)}function ct(e){return vt.apply(this,arguments)}function vt(){return(vt=u(i().m(function e(t){var n,o,a;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,_t({config:t});case 1:if(!e.v.status){e.n=3;break}return Ae.value=t,st(),null===(n=window.layer)||void 0===n||n.msg("配置保存成功",{icon:1}),e.n=2,bt({type:"aics"});case 2:(o=e.v).data&&Ne(o.data),e.n=4;break;case 3:null===(a=window.layer)||void 0===a||a.msg("配置保存失败",{icon:2});case 4:return e.a(2)}},e)}))).apply(this,arguments)}function ft(){return(ft=u(i().m(function e(t,n,o){var a,l;return i().w(function(e){for(;;)switch(e.n){case 0:if(!O.value){e.n=1;break}return _.value=t,o&&o.length>0&&(null===(a=ce.value)||void 0===a||a.addImages(o)),W(function(){var e;null===(e=ce.value)||void 0===e||e.autoResizeTextarea()}),e.a(2);case 1:return ne(),_.value="",e.n=2,W();case 2:_.value=t,o&&o.length>0&&(null===(l=ce.value)||void 0===l||l.addImages(o)),W(function(){var e,t;(null===(e=ce.value)||void 0===e||e.autoResizeTextarea(),n)?Ve():null===(t=ce.value)||void 0===t||t.focus()});case 3:return e.a(2)}},e)}))).apply(this,arguments)}function pt(){O.value||(_.value="继续",W(function(){Ve()}))}return I(u(i().m(function e(){var t,n,o;return i().w(function(e){for(;;)switch(e.n){case 0:return Q(),document.addEventListener("click",rt),e.n=1,bt({type:"aics"});case 1:return(n=e.v).status&&Ne(n.data.data),K.value=!0,e.n=2,kt();case 2:(o=e.v).data&&Array.isArray(null===(t=o.data)||void 0===t?void 0:t.data)&&(q.value=o.data.data||[]),K.value=!1;case 3:return e.a(2)}},e)}))),F(function(){document.removeEventListener("click",rt),document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",be),re(),xe(),ze()}),r({sendMessage:Ve,isSending:O,inputMessage:_,createNewConversation:ne,fillMessageAndSend:function(e,t,n){return ft.apply(this,arguments)},scrollToBottom:function(){var e;null===(e=ue.value)||void 0===e||e.forceScrollToBottom()}}),function(t,n){var o=dt,a=T,l=j;return p(),m("div",{ref_key:"containerRef",ref:se,class:g(["ai-chat-container",e.windowMode])},[h("div",{class:"ai-chat-header",onMousedown:ye},[h("div",gi,[n[10]||(n[10]=D('<span class="ai-icon" data-v-24495a99>✦</span><div class="ai-title-text" data-v-24495a99><span class="ai-title-main" data-v-24495a99>宝塔 AI 助手</span><span class="ai-title-status" data-v-24495a99><span class="status-dot" data-v-24495a99></span> 在线 </span></div>',2)),y(a,{placement:"bottom","popper-style":{padding:"0"},teleported:!1,width:200,trigger:"hover"},{reference:w(function(){return c(n[9]||(n[9]=[h("div",{class:"customer-btn",title:"人工客服"},[h("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[h("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),h("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]),h("span",null,"人工客服")],-1)]))}),default:w(function(){return[y(o)]}),_:1})]),h("div",yi,[y(l,{content:"新建对话",placement:"bottom",teleported:!1},{default:w(function(){return[h("button",{class:"action-btn",disabled:f(O),onClick:n[0]||(n[0]=function(){return f(ne)&&f(ne).apply(void 0,arguments)})},c(n[11]||(n[11]=[h("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M12 5v14M5 12h14"})],-1)])),8,wi)]}),_:1}),h("button",{class:"action-btn",disabled:f(O),onMouseenter:n[1]||(n[1]=function(e){return!f(O)&&Ke()}),onMouseleave:n[2]||(n[2]=function(e){return!f(O)&&Xe()})},c(n[12]||(n[12]=[h("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("circle",{cx:"12",cy:"12",r:"10"}),h("polyline",{points:"12 6 12 12 16 14"})],-1)])),40,bi),"auto-fullscreen"!==e.windowMode?(p(),U(l,{key:0,content:"snap"===e.windowMode?"取消吸附":"吸附到侧边",placement:"bottom",teleported:!1},{default:w(function(){return[h("button",{class:"action-btn",onClick:Me},["snap"!==e.windowMode?(p(),m("svg",ki,c(n[13]||(n[13]=[h("rect",{x:"13",y:"3",width:"8",height:"18",rx:"1"},null,-1),h("path",{d:"M3 3h6v18H3z",opacity:"0.4"},null,-1)])))):(p(),m("svg",_i,c(n[14]||(n[14]=[h("rect",{x:"3",y:"6",width:"18",height:"13",rx:"1"},null,-1),h("path",{d:"M8 6V4M16 6V4"},null,-1)]))))])]}),_:1},8,["content"])):x("",!0),h("button",{class:"action-btn action-btn-close",onClick:n[3]||(n[3]=function(e){return t.$emit("close")})},c(n[15]||(n[15]=[h("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])))])],32),Te.value?(p(),m("div",{key:0,class:g(["quota-bar",{"quota-bar--exhausted":Le.value.total>0?Se.value.exhausted&&Le.value.exhausted:Se.value.exhausted}])},[Se.value.total>0?(p(),m("span",Ci,[n[16]||(n[16]=N(" 每日剩余 ",-1)),h("strong",null,C(Se.value.remain),1),n[17]||(n[17]=N(" 次 ",-1)),Se.value.resetTime?(p(),m(k,{key:0},[N("· 于"+C(Se.value.resetTime)+"刷新",1)],64)):x("",!0)])):x("",!0),h("span",xi,[Le.value.total>0?(p(),m("span",Mi,[n[18]||(n[18]=N("资源包剩余 ",-1)),h("strong",null,C(Le.value.remain),1),n[19]||(n[19]=N(" 次 ",-1))])):x("",!0),n[20]||(n[20]=N()),0===Le.value.total?(p(),m("span",Ti,"当前暂无额度,")):x("",!0),h("span",{class:"bt-link !text-[11px]",onClick:De},"点击充值")])],2)):x("",!0),h("div",Si,[y(Tn,{conversations:f(B),"current-conversation-id":f(A),"panel-visible":f(E),"get-time-ago":f(oe),"is-sending":f(O),onShowPanel:Ke,onHidePanel:Je,onStartHideTimer:Xe,onClearHideTimer:Qe,onLoadConversation:Ye,onDeleteConversation:f(te)},null,8,["conversations","current-conversation-id","panel-visible","get-time-ago","is-sending","onDeleteConversation"]),y(No,{ref_key:"chatMainRef",ref:ue,messages:f(M),"is-typing":f(P),isSending:f(O),"streaming-content-blocks":f(R),"streaming-think-collapsed":f(z),suggestions:Ae.value.questions,"onUpdate:streamingThinkCollapsed":n[4]||(n[4]=function(e){return z.value=e}),onSuggestionClick:Ge,onRegenerate:Fe,onDeleteMessage:Ze,onContinue:pt},null,8,["messages","is-typing","isSending","streaming-content-blocks","streaming-think-collapsed","suggestions"]),y(Aa,{ref_key:"chatInputRef",ref:ce,inputMessage:f(_),"onUpdate:inputMessage":n[5]||(n[5]=function(e){return $(_)?_.value=e:null}),showToolPopover:f(G),"onUpdate:showToolPopover":n[6]||(n[6]=function(e){return $(G)?G.value=e:null}),webSearchEnabled:f(J),"onUpdate:webSearchEnabled":n[7]||(n[7]=function(e){return $(J)?J.value=e:null}),smartMode:f(X),"onUpdate:smartMode":n[8]||(n[8]=function(e){return $(X)?X.value=e:null}),"selected-tools":f(Z),"tools-list":f(q),"tools-loading":f(K),"is-sending":f(O),onSendMessage:Ve,onStopMessage:He,onRemoveSelectedTool:at,onToggleToolSelection:tt,onBatchToggleTools:ot,onOpenPluginView:Ue},null,8,["inputMessage","showToolPopover","webSearchEnabled","smartMode","selected-tools","tools-list","tools-loading","is-sending"])]),y(hi,{visible:Be.value,config:Ae.value,onClose:st,onSave:ct},null,8,["visible","config"])],2)}}}),Bi=Be(Li,[["__scopeId","data-v-24495a99"]]),Ai={class:"toolbar-right"},Ii="ai_window_mode",Ei=a({__name:"index",setup:function(e){var t=ke(),n=t.panel,o=(t.payment,t.getGlobalInfo);S(!0),S(!1),S(!1);var a=S(!1),l=S("popup");S(!1);var r=S(null);function s(){var e=localStorage.getItem(Ii);return e&&["popup","snap","fullscreen"].includes(e)?window.innerWidth<920||window.innerHeight<500?"auto-fullscreen":e:window.innerWidth<920||window.innerHeight<500?"auto-fullscreen":"popup"}function d(){return v.apply(this,arguments)}function v(){return(v=u(i().m(function e(){return i().w(function(e){for(;;)switch(e.n){case 0:a.value?b():(l.value=s(),a.value=!0,setTimeout(function(){var e;null===(e=r.value)||void 0===e||e.scrollToBottom()},100));case 1:return e.a(2)}},e)}))).apply(this,arguments)}function b(){"auto-fullscreen"!==l.value&&localStorage.setItem(Ii,l.value),a.value=!1}function _(){return C.apply(this,arguments)}function C(){return C=u(i().m(function e(){var t,a;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=n.value.isShowCustomer,a=n.value.isShowEvaluate,e.p=1,!t||!a){e.n=3;break}return e.n=2,Pe({content:"您确定要永久关闭吗?",title:"关闭悬浮按钮",width:"42rem",type:"check",check:{content:"仅关闭AI助手",value:!0,onConfirm:function(){var e=u(i().m(function e(t){var a;return i().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,De();case 1:if(a=e.v,!t){e.n=2;break}return a.status?(n.value.isShowCustomer=!1,Oe.success("已关闭AI助手"),o()):Oe.error("操作失败"),e.a(2);case 2:return e.n=3,Ne();case 3:e.v.status?(n.value.isShowEvaluate=!1,Oe.success("已关闭"),o()):Oe.error("操作失败");case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()}});case 2:e.n=9;break;case 3:if(!t){e.n=6;break}return e.n=4,Pe({content:"您确定要永久关闭吗?",title:"关闭悬浮按钮",width:"42rem"});case 4:return e.n=5,De();case 5:e.v.status?(n.value.isShowCustomer=!1,Oe.success("已关闭AI助手"),o()):Oe.error("操作失败"),e.n=9;break;case 6:if(!a){e.n=9;break}return e.n=7,Pe({content:"您确定要永久关闭吗?",title:"关闭悬浮按钮",width:"42rem"});case 7:return e.n=8,Ne();case 8:e.v.status?(n.value.isShowEvaluate=!1,Oe.success("已关闭"),o()):Oe.error("操作失败");case 9:e.n=11;break;case 10:e.p=10,e.v;case 11:return e.a(2)}},e,null,[[1,10]])})),C.apply(this,arguments)}function M(){if(a.value){var e=window.innerWidth<920||window.innerHeight<500;e&&"auto-fullscreen"!==l.value?l.value="auto-fullscreen":e||"auto-fullscreen"!==l.value||(l.value="popup")}}function T(e){var t=e.detail,n=t.message,o=t.autoSend,i=t.windowMode,u=t.images;if(a.value){var c;null===(c=r.value)||void 0===c||c.fillMessageAndSend(n,null!=o&&o,u)}else{i&&["popup","snap","fullscreen"].includes(i)?l.value=i:l.value=s(),a.value=!0;var d=function(){r.value?r.value.fillMessageAndSend(n,null!=o&&o,u):W(d)};W(d)}}return I(u(i().m(function e(){var t;return i().w(function(e){for(;;)switch(e.n){case 0:if(window.addEventListener("resize",M),window.addEventListener("open-ai-chat",T),n.value.panelNps){e.n=2;break}return e.n=1,ze({version:"v2",productType:0,softwareName:"panel"});case 1:(t=e.v).data.nps&&t.data.safe_day>=15&&rt();case 2:return e.a(2)}},e)}))),F(function(){window.removeEventListener("resize",M),window.removeEventListener("open-ai-chat",T),clearTimeout(0),clearTimeout(0)}),function(e,t){var o=Kt,i=Ue;return p(),m(k,null,[h("div",Ai,[h("span",{class:"svgtofont-el-close",onClick:_}),y(o,{effect:"dark",content:"AI 助手",placement:"left",enterable:!1},{default:w(function(){return[h("div",{class:g(["icon-menu flex-col !h-[9rem]",{"icon-menu-active":f(a),"!hidden":!f(n).isShowCustomer}]),onClick:d},c(t[2]||(t[2]=[h("div",{class:"ml-[-.3rem]"},[h("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 17 24",width:"24.000000",height:"33.000000",fill:"none",customFrame:"#000000"},[h("defs",null,[h("clipPath",{id:"clipPath_0"},[h("rect",{width:"13.000000",height:"13.000000",x:"3.175781",y:"12.000000",fill:"rgb(255,255,255)"})]),h("linearGradient",{id:"paint_linear_5",x1:"9.67578125",x2:"9.67578125",y1:"12.2714844",y2:"25",gradientUnits:"userSpaceOnUse"},[h("stop",{"stop-color":"rgb(207,86,255)",offset:"0","stop-opacity":"1"}),h("stop",{"stop-color":"rgb(139,136,240)",offset:"1","stop-opacity":"1"})]),h("linearGradient",{id:"paint_linear_6",x1:"9.5",x2:"9.5",y1:"14",y2:"24",gradientUnits:"userSpaceOnUse"},[h("stop",{"stop-color":"rgb(207,86,255)",offset:"0","stop-opacity":"1"}),h("stop",{"stop-color":"rgb(139,136,240)",offset:"1","stop-opacity":"1"})]),h("clipPath",{id:"clipPath_1"},[h("rect",{width:"7.000000",height:"7.000000",x:"6.175781",y:"4.000000",fill:"rgb(255,255,255)"})]),h("linearGradient",{id:"paint_linear_7",x1:"9.68390274",x2:"9.68390274",y1:"4.32434082",y2:"10.6896744",gradientUnits:"userSpaceOnUse"},[h("stop",{"stop-color":"rgb(255,192,8)",offset:"0","stop-opacity":"1"}),h("stop",{"stop-color":"rgb(255,222,124)",offset:"1","stop-opacity":"1"})]),h("linearGradient",{id:"paint_linear_8",x1:"1.98535156",x2:"1.98535156",y1:"0",y2:"3.97070312",gradientUnits:"userSpaceOnUse"},[h("stop",{"stop-color":"rgb(255,15,0)",offset:"0","stop-opacity":"1"}),h("stop",{"stop-color":"rgb(255,15,0)",offset:"1","stop-opacity":"0"})]),h("linearGradient",{id:"paint_linear_9",x1:"1.98339844",x2:"1.98339844",y1:"0",y2:"3.96679688",gradientUnits:"userSpaceOnUse"},[h("stop",{"stop-color":"rgb(0,136,255)",offset:"0","stop-opacity":"1"}),h("stop",{"stop-color":"rgb(0,136,255)",offset:"1","stop-opacity":"0"})]),h("linearGradient",{id:"paint_linear_10",x1:"1",x2:"1",y1:"0",y2:"2",gradientUnits:"userSpaceOnUse"},[h("stop",{"stop-color":"rgb(0,255,129)",offset:"0","stop-opacity":"1"}),h("stop",{"stop-color":"rgb(0,255,129)",offset:"1","stop-opacity":"0"})])]),h("g",{id:"组合 286"},[h("g",{id:"svg 155",opacity:"0","clip-path":"url(#clipPath_0)",customFrame:"url(#clipPath_0)"},[h("rect",{id:"svg 155",width:"13.000000",height:"13.000000",x:"3.175781",y:"12.000000"}),h("path",{id:"合并",d:"M10.2174 13.6896C10.3837 13.5406 10.4883 13.3245 10.4883 13.084C10.4883 12.9289 10.4439 12.777 10.3603 12.6463C10.2767 12.5156 10.1575 12.4115 10.0166 12.3464C9.87581 12.2814 9.71929 12.258 9.56558 12.279C9.41188 12.3 9.26741 12.3646 9.14925 12.4652C9.0311 12.5657 8.94419 12.698 8.89882 12.8463C8.85344 12.9947 8.85148 13.1529 8.89318 13.3024C8.93487 13.4518 9.01848 13.5862 9.13411 13.6896L9.13411 14.709L6.42578 14.709C6.14053 14.709 5.86031 14.7841 5.61328 14.9267C5.36625 15.0693 5.16111 15.2745 5.01849 15.5215C4.87587 15.7685 4.80078 16.0488 4.80078 16.334L4.80078 21.7507C4.80078 22.0359 4.87587 22.3161 5.01849 22.5632C5.16111 22.8102 5.36625 23.0153 5.61328 23.158C5.86031 23.3006 6.14053 23.3757 6.42578 23.3757L12.9258 23.3757C13.211 23.3757 13.4912 23.3006 13.7383 23.158C13.9853 23.0153 14.1904 22.8102 14.3331 22.5632C14.4757 22.3161 14.5508 22.0359 14.5508 21.7507L14.5508 16.334C14.5508 16.0488 14.4757 15.7685 14.3331 15.5215C14.1904 15.2745 13.9853 15.0693 13.7383 14.9267C13.4912 14.7841 13.211 14.709 12.9258 14.709L10.2174 14.709L10.2174 13.6896ZM4.25911 17.4173L3.17578 17.4173L3.17578 20.6673L4.25911 20.6673L4.25911 17.4173ZM15.0924 17.4173L16.1758 17.4173L16.1758 20.6673L15.0924 20.6673L15.0924 17.4173ZM8.52836 19.6997C8.38954 19.8005 8.22236 19.8548 8.05078 19.8548C7.8792 19.8548 7.71202 19.8005 7.57321 19.6997C7.43439 19.5988 7.33107 19.4566 7.27805 19.2934C7.22503 19.1302 7.22503 18.9544 7.27805 18.7913C7.33107 18.6281 7.43439 18.4859 7.57321 18.385C7.71202 18.2842 7.8792 18.2298 8.05078 18.2298C8.22236 18.2298 8.38954 18.2842 8.52836 18.385C8.66717 18.4859 8.77049 18.6281 8.82351 18.7913C8.87654 18.9544 8.87654 19.1302 8.82351 19.2934C8.77049 19.4566 8.66717 19.5988 8.52836 19.6997ZM11.5519 18.2696C11.715 18.3226 11.8573 18.4259 11.9581 18.5648C12.059 18.7036 12.1133 18.8708 12.1133 19.0423C12.1133 19.2139 12.059 19.3811 11.9581 19.5199C11.8573 19.6587 11.715 19.762 11.5519 19.8151C11.3887 19.8681 11.2129 19.8681 11.0497 19.8151C10.8865 19.762 10.7443 19.6587 10.6435 19.5199C10.5426 19.3811 10.4883 19.2139 10.4883 19.0423C10.4883 18.8708 10.5426 18.7036 10.6435 18.5648C10.7443 18.4259 10.8865 18.3226 11.0497 18.2696C11.2129 18.2166 11.3887 18.2166 11.5519 18.2696ZM13.1758 24.5C13.1758 24.2239 12.9519 24 12.6758 24L6.67578 24C6.39964 24 6.17578 24.2239 6.17578 24.5C6.17578 24.7761 6.39964 25 6.67578 25L12.6758 25C12.9519 25 13.1758 24.7761 13.1758 24.5Z",fill:"url(#paint_linear_5)","fill-rule":"evenodd"})]),h("g",{id:"组合 302"},[h("path",{id:"合并",d:"M11.3235 14.9659C11.6203 14.7183 11.61 14.0359 11.858 14.0093C12.4372 13.9472 13.1075 14.188 12.5669 14.9628C12.386 15.2222 12.0044 15.5484 11.5768 15.8676C11.7643 15.8935 11.9503 15.9222 12.1341 15.9532C12.9111 15.3147 14.3915 14.1808 14.9377 14.3283C15.4628 14.4701 15.1245 15.7963 14.8697 16.5908C15.9414 16.9049 16.6428 17.1837 16.6428 17.1837C16.6428 17.1837 17 18.2593 15.214 18.6192C14.6008 18.7427 14.7913 18.9199 15.2188 19.3176C15.422 19.5067 15.6788 19.7456 15.9284 20.0523C16.683 20.9798 17 22.5628 17 22.5628L14.857 21.8466L15.5712 22.9217L14.4998 22.9213L14.8569 23.9986L14.1426 23.2806L13.5384 23.9984L12.7146 23.9975L6.29425 23.9974L6.28544 23.9989L5.46131 23.9971L4.85743 23.282L4.14314 24L4.50021 22.9227L3.4288 22.9231L4.14295 21.848L2 22.5642C2 22.5642 2.31699 20.9812 3.07164 20.0537C3.32118 19.747 3.57798 19.5081 3.78121 19.319C4.20873 18.9213 4.39916 18.7441 3.78601 18.6206C1.99995 18.2607 2.35723 17.1851 2.35723 17.1851C2.35723 17.1851 3.05857 16.9063 4.13026 16.5922C3.87555 15.7977 3.53719 14.4715 4.06231 14.3297C4.60851 14.1822 6.08893 15.3161 6.86593 15.9546C7.0497 15.9236 7.23569 15.8949 7.42319 15.869C6.99561 15.5498 6.61404 15.2236 6.43307 14.9642C5.89247 14.1894 6.56276 13.9487 7.14196 14.0107C7.38998 14.0373 7.3797 14.7197 7.6765 14.9673C7.89071 15.1461 7.89864 15.0288 7.9076 14.8963C7.91522 14.7836 7.92357 14.66 8.06005 14.698C8.35707 14.7807 8.51548 14.8066 8.51968 15.0414C8.5217 15.1545 8.48678 15.2615 8.45302 15.365C8.41677 15.4761 8.38186 15.583 8.39545 15.6892C8.39935 15.7196 8.40974 15.7426 8.42535 15.7609C8.74972 15.7364 9.07491 15.7225 9.39745 15.7218C9.78695 15.7156 10.1814 15.7297 10.5746 15.7595C10.5903 15.7412 10.6006 15.7182 10.6045 15.6878C10.6181 15.5816 10.5832 15.4747 10.547 15.3636C10.5132 15.2601 10.4783 15.1531 10.4803 15.04C10.4845 14.8052 10.6429 14.7793 10.9399 14.6966C11.0764 14.6586 11.0848 14.7822 11.0924 14.8949C11.1014 15.0274 11.1093 15.1447 11.3235 14.9659Z",fill:"url(#paint_linear_6)","fill-rule":"evenodd"}),h("ellipse",{id:"椭圆 85",rx:"0.576923",ry:"0.579347",cx:"7.19215727",cy:"21.531496",fill:"rgb(255,255,255)"}),h("ellipse",{id:"椭圆 86",rx:"0.576923",ry:"0.579347",cx:"11.8076363",cy:"21.531496",fill:"rgb(255,255,255)"}),h("path",{id:"椭圆 87",d:"M8.47187 21.8046C8.27093 21.6029 7.99841 21.4895 7.71425 21.4895C7.43009 21.4895 7.15757 21.6029 6.95664 21.8046C6.7557 22.0064 6.64282 22.2801 6.64282 22.5654L6.95076 22.5654C6.95076 22.3621 7.0312 22.1671 7.17438 22.0233C7.31757 21.8795 7.51176 21.7987 7.71425 21.7987C7.91674 21.7987 8.11094 21.8795 8.25412 22.0233C8.3973 22.1671 8.47774 22.3621 8.47774 22.5654L8.78568 22.5654C8.78568 22.2801 8.6728 22.0064 8.47187 21.8046Z",opacity:"0",fill:"rgb(255,255,255)","fill-rule":"evenodd"}),h("path",{id:"椭圆 88",d:"M12.0434 21.8046C11.8425 21.6029 11.5699 21.4895 11.2858 21.4895C11.0016 21.4895 10.7291 21.6029 10.5282 21.8046C10.3272 22.0064 10.2144 22.2801 10.2144 22.5654L10.5223 22.5654C10.5223 22.3621 10.6027 22.1671 10.7459 22.0233C10.8891 21.8795 11.0833 21.7987 11.2858 21.7987C11.4883 21.7987 11.6825 21.8795 11.8257 22.0233C11.9688 22.1671 12.0493 22.3621 12.0493 22.5654L12.3572 22.5654C12.3572 22.2801 12.2443 22.0064 12.0434 21.8046Z",opacity:"0",fill:"rgb(255,255,255)","fill-rule":"evenodd"}),h("path",{id:"矢量 2577",d:"M9.49975 22.1108L9.50002 22.8831L10.0769 23.2692M9.50002 22.8831L8.9231 23.2695",stroke:"rgb(255,255,255)","stroke-linecap":"round","stroke-width":"0.200000"})]),h("g",{id:"svg 154","clip-path":"url(#clipPath_1)",customFrame:"url(#clipPath_1)",class:"lightbulb-glow"},[h("rect",{id:"svg 154",width:"7.000000",height:"7.000000",x:"6.175781",y:"4.000000"}),h("path",{id:"矢量 2565",d:"M7.59674 7.16634C7.59674 7.07301 7.60374 6.97967 7.6154 6.89101L6.91074 6.89101C6.80107 6.89101 6.7124 6.97734 6.7124 7.08467C6.7124 7.19201 6.80107 7.27834 6.91074 7.27834L7.59907 7.27834C7.59674 7.24101 7.59674 7.20367 7.59674 7.16634ZM7.58274 8.86967C7.50574 8.94667 7.50574 9.06801 7.58274 9.14501C7.65974 9.21967 7.78574 9.21967 7.86274 9.14501L8.2244 8.79034C8.14274 8.69934 8.0564 8.59901 7.97707 8.48467L7.58274 8.86967ZM8.0844 5.78967C8.16607 5.68701 8.25707 5.59367 8.3574 5.50734L7.86507 5.02434C7.78807 4.94734 7.66207 4.94734 7.58507 5.02434C7.50807 5.09901 7.50807 5.22267 7.58507 5.29967L8.0844 5.78967ZM10.1891 10.3187L9.18107 10.3187C9.07607 10.3187 8.99207 10.4027 8.99207 10.503C8.99207 10.6057 9.07607 10.6897 9.18107 10.6897L10.1891 10.6897C10.2941 10.6897 10.3781 10.6057 10.3781 10.503C10.3781 10.4003 10.2917 10.3187 10.1891 10.3187ZM9.68507 5.16667L9.68974 5.16667C9.75507 5.16667 9.81807 5.17134 9.88107 5.17601L9.88107 4.51801C9.88107 4.41067 9.7924 4.32434 9.68274 4.32434C9.57307 4.32434 9.4844 4.41067 9.4844 4.51801L9.4844 5.17601C9.5474 5.16901 9.61274 5.16667 9.67574 5.16667L9.68507 5.16667ZM11.2857 5.78967L11.7851 5.29967C11.8621 5.22501 11.8621 5.10134 11.7851 5.02434C11.7081 4.94734 11.5821 4.94734 11.5051 5.02434L11.0127 5.50734C11.1107 5.59367 11.2017 5.68701 11.2857 5.78967ZM11.3884 8.48234C11.3067 8.59901 11.2227 8.69701 11.1411 8.78801L11.5027 9.14267C11.5797 9.21734 11.7057 9.21734 11.7827 9.14267C11.8597 9.06567 11.8597 8.94434 11.7827 8.86734L11.3884 8.48234ZM10.1891 9.84967L9.18107 9.84967C9.07607 9.84967 8.99207 9.93134 8.99207 10.0363C8.99207 10.139 9.07607 10.2207 9.18107 10.2207L10.1891 10.2207C10.2941 10.2207 10.3781 10.1367 10.3781 10.0363C10.3781 9.93134 10.2917 9.84967 10.1891 9.84967ZM12.4571 6.89101L11.7524 6.89101C11.7641 6.98201 11.7711 7.07301 11.7711 7.16634C11.7711 7.20367 11.7711 7.24101 11.7687 7.27834L12.4571 7.27834C12.5667 7.27834 12.6554 7.19201 12.6554 7.08467C12.6531 6.97734 12.5667 6.89101 12.4571 6.89101ZM11.4934 7.16634C11.4934 6.76501 11.3581 6.39401 11.1271 6.09534C10.9264 5.83401 10.6511 5.62867 10.3337 5.50967L10.3361 5.50034L10.2007 5.46067C10.0957 5.43034 9.98607 5.40934 9.8764 5.39767L9.86007 5.39534C9.8064 5.39067 9.7504 5.38601 9.68974 5.38601L9.6804 5.38601C9.62207 5.38601 9.56607 5.39067 9.51007 5.39534L9.49373 5.39767C9.38407 5.40934 9.2744 5.43034 9.1694 5.46067L9.03873 5.49801L9.04107 5.50734C8.7214 5.62867 8.44607 5.83401 8.24307 6.09534C8.0144 6.39401 7.87674 6.76501 7.87674 7.16634C7.87674 7.45567 7.92807 7.69134 8.0074 7.88734C8.1264 8.18134 8.30607 8.37967 8.45307 8.53134C8.5254 8.60601 8.59074 8.67134 8.63274 8.72501C8.67707 8.78101 8.69807 8.82301 8.70507 8.85567C8.73773 9.02134 8.74007 9.22901 8.74007 9.28034L8.74007 9.29667C8.74007 9.53467 8.93607 9.72601 9.17873 9.72601L9.5194 9.72601L9.5194 8.04601L9.0294 7.55834C8.96873 7.50001 8.96873 7.40201 9.0294 7.34367C9.09007 7.28534 9.18573 7.28534 9.24407 7.34367L9.67107 7.76834L10.0981 7.34367C10.1587 7.28534 10.2544 7.28534 10.3127 7.34367C10.3734 7.40201 10.3734 7.50001 10.3127 7.55834L9.82273 8.04601L9.82273 9.72367L10.1914 9.72367C10.4341 9.72367 10.6301 9.53001 10.6301 9.29434L10.6301 9.28034C10.6301 9.22901 10.6324 9.01901 10.6651 8.85567C10.6697 8.83234 10.6791 8.80667 10.7001 8.77401C10.7351 8.71801 10.8004 8.64801 10.8821 8.56634C11.0034 8.44034 11.1574 8.28167 11.2811 8.05767C11.4047 7.83601 11.4934 7.54434 11.4934 7.16634Z",fill:"url(#paint_linear_7)","fill-rule":"nonzero"})]),h("g",{class:"star-animate star-1"},[h("path",{id:"星形 13",d:"M2.52162 1.44908L3.9707 1.98535L2.52162 2.52162L1.98535 3.9707L1.44908 2.52162L2.22045e-16 1.98535L1.44908 1.44908L1.98535 0L2.52162 1.44908Z",fill:"url(#paint_linear_8)","fill-rule":"evenodd",transform:"matrix(0.930482,0.366337,-0.366337,0.930482,12.6309,0)"})]),h("g",{class:"star-animate star-2"},[h("path",{id:"星形 12",d:"M2.51914 1.44765L3.9668 1.9834L2.51914 2.51914L1.9834 3.9668L1.44765 2.51914L2.22045e-16 1.9834L1.44765 1.44765L1.9834 0L2.51914 1.44765Z",fill:"url(#paint_linear_9)","fill-rule":"evenodd",transform:"matrix(0.96896,-0.247217,0.247217,0.96896,0,8.04492)"})]),h("g",{class:"star-animate star-3"},[h("path",{id:"星形 11",d:"M1.27011 0.729885L2 1L1.27011 1.27011L1 2L0.729885 1.27011L1.11022e-16 1L0.729885 0.729885L1 0L1.27011 0.729885Z",fill:"url(#paint_linear_10)","fill-rule":"evenodd",transform:"matrix(0.891472,0.453075,-0.453075,0.891472,15.082,10)"})])])])],-1),h("span",{class:"icon-text"},"AI",-1),h("span",{class:"icon-text",style:{"writing-mode":"vertical-rl"}},"助手",-1)])),2)]}),_:1}),y(o,{effect:"dark",content:"点击打开调查问卷",placement:"left",enterable:!0},{default:w(function(){return[h("div",{class:g(["icon-menu",{"!hidden":!f(n).isShowEvaluate}]),onClick:t[0]||(t[0]=function(){return f(rt)&&f(rt).apply(void 0,arguments)})},[y(i,{icon:"evaluation-feedback",size:45,color:"var(--el-color-primary)"})],2)]}),_:1})]),(p(),U(V,{to:"body"},[y(H,{name:"ai-chat-fade"},{default:w(function(){return[f(a)?(p(),m("div",{key:0,class:g(["ai-chat-wrapper small-ai-chat",f(l)])},[y(Bi,{ref_key:"aiAssistantRef",ref:r,"window-mode":f(l),onClose:b,"onUpdate:windowMode":t[1]||(t[1]=function(e){return l.value=e})},null,8,["window-mode"])],2)):x("",!0)]}),_:1})]))],64)}}}),Pi=Be(Ei,[["__scopeId","data-v-68fe4706"]]);var Oi=a({name:"BtContainer",setup:function(e,t){var n=t.attrs,o=t.slots;return function(){return y(G,n,"function"==typeof(e=o)||"[object Object]"===Object.prototype.toString.call(e)&&!R(e)?o:{default:function(){return[o]}});var e}}});var ji=a({name:"BtAside",setup:function(e,t){var n=t.attrs,o=t.slots;return function(){return y(K,O(e,n),"function"==typeof(t=o)||"[object Object]"===Object.prototype.toString.call(t)&&!R(t)?o:{default:function(){return[o]}});var t}}}),Ri=v(function(){var e;return(null===(e=J())||void 0===e?void 0:e.path)||""}),zi=ke(),Di=zi.title,Ni=zi.panel,Ui=zi.robserver,Hi=zi.layoutBody,Vi=zi.mainWidth,Wi=zi.mainHeight,Fi=zi.updateTaskCount,qi=zi.mountMessage,Zi=zi.payment,$i=zi.aliyunEcsLtd,Gi=zi.isAapanel,Ki=function(){Ui.value&&Ui.value.disconnect&&(Ui.value.disconnect(),Ui.value=null)},Ji=function(){return It({vue:{defineComponent:a,version:ee},components:{BtDialog:Ve,BtInput:We,BtLink:Fe,BtInputIcon:Et,BtSvgIcon:Pt,BtTable:qe,BtTableGroup:Ot,ElButton:te,ElCard:ne,ElAlert:oe,ElForm:ae,ElFormItem:le,ElDropdownItem:ie,ElDropdownMenu:re,ElDropdown:se,ElTooltip:j,ElIcon:ue,ElPopover:T,ElTable:ce,ElInput:de,ElTableColumn:ve,BtDivider:jt,BtImage:Ze,ElSelect:fe,ElOption:pe},hooks:{useMessage:Ie,useDialog:je,useAxios:$e,useConfirm:Pe,Message:Oe,isUndefined:Ge,inputFocus:Ke,rsaEncrypt:Je,isDev:Ae},utils:{getByteUnit:Xe,getRandomPwd:Qe},dialog:{fileSelectionDialog:at},vueMethods:{ref:S,unref:f,reactive:me,watch:L,computed:v,onMounted:I,onBeforeUnmount:A}})},Xi=function(){var e=X(Ni.value).msgBoxTaskCount;L(Di,function(e){return Q(e)}),L(e,Fi),L($i,function(e){e&&"ltd"!==Zi.value.authType&&st({compulsionLtd:!0,showClose:!1,disableEsc:!0})},{immediate:!0}),Q(Di),setTimeout(function(){var e;Ye({request:(e=u(i().m(function e(){return i().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,"/waf"===Ri.value){e.n=1;break}return e.n=1,et();case 1:e.n=4;break;case 2:return e.p=2,e.v,e.n=3,Pe({title:"登录验证已失效",content:"当前面板登录验证已失效,确认后重新登录",showClose:!1});case 3:window.location.href="/login";case 4:return e.a(2)}},e,null,[[0,2]])})),function(){return e.apply(this,arguments)}),timeout:6e5})},6e5),He(),Ui.value=Y(Hi,function(e){var t=e[0].contentRect.height,n=document.getElementById("layout-footer"),o=null==n?void 0:n.getBoundingClientRect(),a=(null==o?void 0:o.height)||0,l=(null==o?void 0:o.width)||0,i=document.getElementById("layout-main"),r=null==i?void 0:i.getBoundingClientRect(),s=(null==r?void 0:r.width)||0;Vi.value=(l||s)-32,Wi.value=parseInt("".concat(t-a-(Gi.value?16:30)),10)}),qi(),window.$extension=Ji},Qi={class:"mr-[8px] text-tertiary text-small"},Yi={class:"flex bt-link-info items-center"},er={class:"w-full flex items-center justify-center"},tr={class:"flex bt-link-info items-center"},nr={class:"w-full flex items-center justify-center"},or=Be(a({__name:"footer",setup:function(e){var t=J(),n=v(function(){return!t.path.includes("waf")}),o=window,a=o.vite_public_brand,l=o.vite_public_product,i=o.vite_public_year,r=ke().globalTheme,s=v(function(){return"1400px"!==r.value.interface.container_width?{}:{"max-width":"1376px",position:"relative",left:"50%",transform:"translateX(-50%)",margin:"12px 0 0"}});return function(e,t){var o=jt,r=zt,u=Fe,c=Ze,d=Rt;return f(n)?(p(),m("footer",{key:0,id:"layout-footer",class:"flex items-center items-end w-full h-[30px] mb-[14px] text-base justify-center relative z-90 mt-[14px]",style:b(f(s))},[h("span",Qi,C(f(a))+C(f(l))+"©2014-"+C(f(i))+" 广东堡塔安全技术有限公司 (bt.cn)",1),y(o),y(u,{class:"bt-link-info",href:"http://www.bt.cn/bbs"},{default:w(function(){return[y(r,{name:"tools-help",size:"14",class:"mr-[.2rem]",color:"var(--el-color-primary)"}),t[0]||(t[0]=h("span",{class:"h-[1.2rem] flex items-center text-tertiary"},"论坛求助",-1))]}),_:1}),y(o),y(u,{class:"bt-link-info",href:"https://docs.bt.cn"},{default:w(function(){return[y(r,{name:"tools-manual",size:"14",class:"mr-[.2rem]"}),t[1]||(t[1]=h("span",{class:"h-[1.2rem] flex items-center text-tertiary"},"使用手册",-1))]}),_:1}),y(o),y(d,{placement:"top-start","popper-class":"white-tips-popover",width:"160",trigger:"hover"},{reference:w(function(){return[h("span",Yi,[y(r,{name:"tools-wechat",size:"14",class:"mr-[.2rem]"}),t[2]||(t[2]=h("span",{class:"text-small h-[1.2rem] flex items-center text-tertiary cursor-pointer"},"微信公众号",-1))])]}),default:w(function(){return[h("div",er,[y(c,{src:"/other/bt_wx.jpg"})])]}),_:1}),y(o),y(u,{class:"bt-link-info",href:"https://www.bt.cn/auth"},{default:w(function(){return[y(r,{name:"tools-check",size:"14",class:"mr-[.2rem]"}),t[3]||(t[3]=h("span",{class:"h-[1.2rem] flex items-center text-tertiary"},"正版查询",-1))]}),_:1}),y(o),y(d,{placement:"top-start","popper-class":"white-tips-popover",width:"160",trigger:"hover"},{reference:w(function(){return[h("span",tr,[y(r,{name:"tools-customer",size:"14",class:"mr-[.2rem]"}),t[4]||(t[4]=h("span",{class:"text-small h-[1.2rem] flex items-center text-tertiary cursor-pointer"},"联系人工客服",-1))])]}),default:w(function(){return[h("div",nr,[y(c,{src:"/other/customer-qrcode.png",class:"w-[150px]"})])]}),_:1})],4)):x("",!0)}}}),[["__scopeId","data-v-b9535e1e"]]),ar=a({__name:"main",setup:function(e){var t=ke(),n=t.mainHeight,o=t.globalTheme;return J(),function(e,t){var a=he("router-view");return p(),m("section",{id:"layout-main",class:g({"w-full":"100%"===f(o).interface.container_width}),style:b({"min-height":f(n)+"px","max-width":"100%"===f(o).interface.container_width?void 0:f(o).interface.container_width,margin:"100%"===f(o).interface.container_width?void 0:"0 auto"})},[y(a,null,{default:w(function(e){var t=e.Component;return[y(H,{class:"animate-animated",name:"fade",mode:"out-in"},{default:w(function(){return[(p(),U(ge(t)))]}),_:2},1024)]}),_:1})],6)}}}),lr=Be(ar,[["__scopeId","data-v-fd5194a3"]]);var ir=a({name:"BtScrollbar",props:o({},ye),setup:function(e,t){var n=t.attrs,o=t.slots;return function(){return y(we,O(e,n),"function"==typeof(t=o)||"[object Object]"===Object.prototype.toString.call(t)&&!R(t)?o:{default:function(){return[o]}});var t}}}),rr=ke(),sr=rr.disableSidebar,ur=rr.serverIp,cr=rr.menuControl,dr=rr.cutCollapseView,vr=function(){sr.value||ut()},fr=function(){var e=u(i().m(function e(){return i().w(function(e){for(;;)switch(e.n){case 0:tt({value:ur.value});case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),pr=function(e){return nt.currentRoute.value.path.split("/")[1]===e.name},mr=function(e){cr.value.menuName=e},hr=function(e){cr.value.menuName=""},gr=function(e){return pr(e)?"is-active":""},yr=function(){var e=u(i().m(function e(){var t;return i().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Pe({icon:"warning-filled",title:"退出登录",content:"退出面板登录,是否继续?"});case 1:setTimeout(function(){window.location.href="/login?dologin=True"},400),e.n=3;break;case 2:e.p=2,t=e.v,console.error(t);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),wr=function(){var e=u(i().m(function e(){return i().w(function(e){for(;;)switch(e.n){case 0:if(!sr.value){e.n=1;break}return e.a(2);case 1:ct();case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),br=function(){var e=u(i().m(function e(){var t,n;return i().w(function(e){for(;;)switch(e.n){case 0:if(dr(),nt.currentRoute.value.path.includes("/waf")){e.n=1;break}return e.a(2);case 1:(n=document.getElementById("ifrramApp"))&&(null===(t=n.contentWindow)||void 0===t||t.check_shrink(cr.value.collapse));case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),kr={class:"sidebar"},_r={class:"flex-shrink-0"},Cr=["src"],xr={class:"flex-1 overflow-y-auto overflow-hidden"},Mr={class:"relative h-full"},Tr=["onMouseenter","onMouseleave"],Sr=["href","onClick"],Lr={class:"flex-shrink-0"},Br={class:"cursor-pointer"},Ar={class:"cursor-pointer"},Ir=a({__name:"index",setup:function(e){be(function(e){return{e1ccd318:f(S)}});var t=ke(),n=t.menuControl,o=t.panel,a=t.serverIp,l=t.messageNumberStyle,i=t.messageIpNumberLength,r=t.menuControlIcon,s=t.menuCollapseMouseleave,u=t.menuCollapseMouseenter,c=t.cutMenuRouter,d=t.menuLogo,b=t.globalTheme,M=t.isAapanel,T=function(e){M.value&&document.documentElement.classList.contains("dark");var t=M.value?"menu-aapanel-":"menu-",o=(M.value?pr(e):pr(e)||n.value.menuName===e.name)?"".concat(e.name,"-active"):e.name;return"".concat(t).concat(o)},S=v(function(){return M.value?document.documentElement.classList.contains("dark")?"/src/icons/menu-aapanel/dark/":"/static/images/menu-aapanel/":"/static/images/menu/"}),L=function(){M.value&&document.documentElement.classList.contains("dark");var e=M.value?"menu-aapanel-":"menu-",t=!M.value&&"dologin"===n.value.menuName?"exit-active":"exit";return"".concat(e).concat(t)};return function(e,t){var v=zt,M=Oi,S=ir,B=Ue,A=Kt;return p(),m("section",kr,[h("div",_r,[y(M,{class:g(["layout-message",f(n).collapse?"!justify-center":"!justify-start"])},{default:w(function(){return["/static/icons/logo-white.svg"===f(b).logo.image?(p(),U(v,{key:0,name:"tools-logo",size:"22"})):(p(),m("img",{key:1,src:f(d),alt:"logo-white",class:g("w-[2rem] "+(f(n).collapse?"":"mr-[.4rem]"))},null,10,Cr)),f(n).collapse?x("",!0):(p(),m("div",{key:2,class:g(["flex leading-normal truncate font-600 w-[15rem] pl-[.8rem]",f(i)>=11?"text-small":"text-base"]),title:"双击可复制IP",onDblclick:t[0]||(t[0]=function(){return f(fr)&&f(fr).apply(void 0,arguments)})},C(f(o).sidebarTitle||f(a)),35)),h("div",{class:g(f(l)),onClick:t[1]||(t[1]=function(){return f(vr)&&f(vr).apply(void 0,arguments)})},C(f(o).msgBoxTaskCount),3)]}),_:1},8,["class"])]),h("div",xr,[h("div",Mr,[y(S,null,{default:w(function(){return[h("ul",{class:g(["bt-menu",{"is-cut-menu":f(n).collapse,"hover-menu-bg":f(n).mouserover}])},[(p(!0),m(k,null,_(f(ot),function(e){return p(),m(k,{key:e.path},["dologin"!=e.name&&e.show?(p(),m("li",{key:e.path,class:g(["menu-item","menu-".concat(String(e.name)),f(gr)(e)]),onMouseenter:function(t){return f(mr)(e.name)},onMouseleave:function(t){return f(hr)(e.name)}},[h("a",{href:e.path,onClick:z(function(t){return f(c)(e.path)},["prevent"])},[y(v,{name:T(e),color:"#fff",size:"21"},null,8,["name"]),h("span",null,C(e.title),1)],8,Sr)],42,Tr)):x("",!0)],64)}),128)),h("li",{class:"menu-item menu-exit",onClick:t[4]||(t[4]=function(){return f(yr)&&f(yr).apply(void 0,arguments)})},[h("a",{href:"javascript:;",onMouseenter:t[2]||(t[2]=function(e){return f(mr)("dologin")}),onMouseleave:t[3]||(t[3]=function(e){return f(hr)("dologin")})},[y(v,{name:L(),size:"22"},null,8,["name"]),t[9]||(t[9]=h("span",null,"退出",-1))],32)])],2)]}),_:1})])]),h("div",Lr,[h("div",{class:g(["menu-toolbar",{"justify-between":!f(n).collapse}])},[h("div",Br,[y(A,{class:"item",effect:"dark",content:"点击伸缩菜单栏",placement:"top",enterable:!1},{default:w(function(){return[h("div",{class:"setting-hover",onClick:t[5]||(t[5]=function(){return f(br)&&f(br).apply(void 0,arguments)}),onMouseleave:t[6]||(t[6]=function(){return f(s)&&f(s).apply(void 0,arguments)}),onMouseenter:t[7]||(t[7]=function(){return f(u)&&f(u).apply(void 0,arguments)})},[y(B,{icon:f(r)?"display-menu":"shrink-menu"},null,8,["icon"])],32)]}),_:1})]),h("div",Ar,[f(n).collapse?x("",!0):(p(),U(A,{key:0,class:"item",effect:"dark",content:"点击设置菜单显示隐藏",placement:"top",enterable:!1},{default:w(function(){return[h("div",{class:"setting-hover",onClick:t[8]||(t[8]=function(){return f(wr)&&f(wr).apply(void 0,arguments)})},[y(B,{icon:"menu-setting"})])]}),_:1}))])],2)])])}}}),Er=Be(Ir,[["__scopeId","data-v-f92a9e4e"]]),Pr={class:"h-full"},Or=a({__name:"index",setup:function(e){var t=ke(),n=t.layoutSidebarStyle,o=t.layoutBodyStyle,a=(t.panel,t.layoutBody),l=t.menuCollapseMouseenter,i=t.menuCollapseMouseleave,r=J();return I(function(){Xi()}),F(Ki),function(e,t){var s=ji,u=Oi,c=Pi,d=Gt,v=qt;return p(),m("div",Pr,[y(u,{id:"app-container",class:"h-full"},{default:w(function(){return[y(s,{width:"auto",class:g(["h-full layout-left-menu",f(n)]),onMouseenter:f(l),onMouseleave:f(i)},{default:w(function(){return[y(Er)]}),_:1},8,["class","onMouseenter","onMouseleave"]),y(u,{id:"layout-body",ref_key:"layoutBody",ref:a,class:g(f(o))},{default:w(function(){return[y(lr),y(or)]}),_:1},8,["class"]),y(c)]}),_:1}),f(r).path.includes("bind")?x("",!0):(p(),U(d,{key:0})),f(false)?(p(),U(v,{key:1})):x("",!0)])}}});e("default",Be(Or,[["__scopeId","data-v-ddf49f0c"]]))}}})}();