import{k as e,f as t,a5 as n,j as o,r as a,w as i,E as r,m as s,x as u,a6 as l,o as c,y as d,b as p,c as v,d as _,A as f,F as m,z as h,C as g,B as y,D as w,e as k,H as A}from"./index-909bd241.js";import{h as b}from"./moment-6961f857.js";import{e as x,_ as S,a as T}from"./emoEnergyConverter-3c4902e7.js";import{m as I}from"./marketTemperature-7b8efb57.js";import{_ as P}from"./plugin-vue_export-helper-46f75680.js";import{u as D}from"./chat-822ca9b3.js";import{m as L}from"./marked.esm-cf4f21f5.js";import{u as E}from"./userPessionCode-0483d378.js";var O,C="/aixiaocaishen/static/images/思考-36f0ab2d.gif",M="/aixiaocaishen/static/images/解析-09c80e32.gif",H="/aixiaocaishen/static/images/生成-34d79152.gif",B={}; /*! * howler.js v2.2.4 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */ O=B,function(){var t=function(){this.init()};t.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||n;if(e=parseFloat(e),t.ctx||c(),void 0!==e&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var o=0;o=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,c()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx&&e.ctx.state||"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(e._canPlayEvent="canplay")}catch(t){e.noAudio=!0}else e.noAudio=!0;try{(new Audio).muted&&(e.noAudio=!0)}catch(t){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,t=null;try{t="undefined"!=typeof Audio?new Audio:null}catch(c){return e}if(!t||"function"!=typeof t.canPlayType)return e;var o=t.canPlayType("audio/mpeg;").replace(/^no$/,""),a=e._navigator?e._navigator.userAgent:"",i=a.match(/OPR\/(\d+)/g),r=i&&parseInt(i[0].split("/")[1],10)<33,s=-1!==a.indexOf("Safari")&&-1===a.indexOf("Chrome"),u=a.match(/Version\/(.*?) /),l=s&&u&&parseInt(u[1],10)<15;return e._codecs={mp3:!(r||!o&&!t.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!o,opus:!!t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(t.canPlayType('audio/wav; codecs="1"')||t.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!t.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!t.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(t.canPlayType("audio/x-m4b;")||t.canPlayType("audio/m4b;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(t.canPlayType("audio/x-mp4;")||t.canPlayType("audio/mp4;")||t.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(l||!t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!t.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(t.canPlayType("audio/x-flac;")||t.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n;if(!e._audioUnlocked&&e.ctx){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length0?s._seek:o._sprite[e][0]/1e3),c=Math.max(0,(o._sprite[e][0]+o._sprite[e][1])/1e3-l),d=1e3*c/Math.abs(s._rate),p=o._sprite[e][0]/1e3,v=(o._sprite[e][0]+o._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var _=function(){s._paused=!1,s._seek=l,s._start=p,s._stop=v,s._loop=!(!s._loop&&!o._sprite[e][2])};if(!(l>=v)){var f=s._node;if(o._webAudio){var m=function(){o._playLock=!1,_(),o._refreshBuffer(s);var e=s._muted||o._muted?0:s._volume;f.gain.setValueAtTime(e,n.ctx.currentTime),s._playStart=n.ctx.currentTime,void 0===f.bufferSource.start?s._loop?f.bufferSource.noteGrainOn(0,l,86400):f.bufferSource.noteGrainOn(0,l,c):s._loop?f.bufferSource.start(0,l,86400):f.bufferSource.start(0,l,c),d!==1/0&&(o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),d)),t||setTimeout((function(){o._emit("play",s._id),o._loadQueue()}),0)};"running"===n.state&&"interrupted"!==n.ctx.state?m():(o._playLock=!0,o.once("resume",m),o._clearTimer(s._id))}else{var h=function(){f.currentTime=l,f.muted=s._muted||o._muted||n._muted||f.muted,f.volume=s._volume*n.volume(),f.playbackRate=s._rate;try{var a=f.play();if(a&&"undefined"!=typeof Promise&&(a instanceof Promise||"function"==typeof a.then)?(o._playLock=!0,_(),a.then((function(){o._playLock=!1,f._unlocked=!0,t?o._loadQueue():o._emit("play",s._id)})).catch((function(){o._playLock=!1,o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):t||(o._playLock=!1,_(),o._emit("play",s._id)),f.playbackRate=s._rate,f.paused)return void o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||s._loop?o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),d):(o._endTimers[s._id]=function(){o._ended(s),f.removeEventListener("ended",o._endTimers[s._id],!1)},f.addEventListener("ended",o._endTimers[s._id],!1))}catch(i){o._emit("playerror",s._id,i)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===f.src&&(f.src=o._src,f.load());var g=window&&window.ejecta||!f.readyState&&n._navigator.isCocoonJS;if(f.readyState>=3||g)h();else{o._playLock=!0,o._state="loading";var y=function(){o._state="loaded",h(),f.removeEventListener(n._canPlayEvent,y,!1)};f.addEventListener(n._canPlayEvent,y,!1),o._clearTimer(s._id)}}return s._id}o._ended(s)},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),o=0;o=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else i.length>=2&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if(!(void 0!==e&&e>=0&&e<=1))return(o=t?a._soundById(t):a._sounds[0])?o._volume:0;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"volume",action:function(){a.volume.apply(a,i)}}),a;void 0===t&&(a._volume=e),t=a._getSoundIds(t);for(var u=0;u0?o/l:o),d=Date.now();e._fadeTo=n,e._interval=setInterval((function(){var a=(Date.now()-d)/o;d=Date.now(),s+=u*a,s=Math.round(100*s)/100,s=u<0?Math.max(n,s):Math.min(n,s),r._webAudio?e._volume=s:r.volume(s,e._id,!0),i&&(r._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,r.volume(n,e._id),r._emit("fade",e._id))}),c)},_stopFade:function(e){var t=this,o=t._soundById(e);return o&&o._interval&&(t._webAudio&&o._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(o._interval),o._interval=null,t.volume(o._fadeTo,e),o._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,o=this,a=arguments;if(0===a.length)return o._loop;if(1===a.length){if("boolean"!=typeof a[0])return!!(n=o._soundById(parseInt(a[0],10)))&&n._loop;e=a[0],o._loop=e}else 2===a.length&&(e=a[0],t=parseInt(a[1],10));for(var i=o._getSoundIds(t),r=0;r=0?t=parseInt(i[0],10):e=parseFloat(i[0])}else 2===i.length&&(e=parseFloat(i[0]),t=parseInt(i[1],10));if("number"!=typeof e)return(o=a._soundById(t))?o._rate:a._rate;if("loaded"!==a._state||a._playLock)return a._queue.push({event:"rate",action:function(){a.rate.apply(a,i)}}),a;void 0===t&&(a._rate=e),t=a._getSoundIds(t);for(var u=0;u=0?t=parseInt(a[0],10):o._sounds.length&&(t=o._sounds[0]._id,e=parseFloat(a[0]))}else 2===a.length&&(e=parseFloat(a[0]),t=parseInt(a[1],10));if(void 0===t)return 0;if("number"==typeof e&&("loaded"!==o._state||o._playLock))return o._queue.push({event:"seek",action:function(){o.seek.apply(o,a)}}),o;var s=o._soundById(t);if(s){if(!("number"==typeof e&&e>=0)){if(o._webAudio){var u=o.playing(t)?n.ctx.currentTime-s._playStart:0,l=s._rateSeek?s._rateSeek-s._seek:0;return s._seek+(l+u*Math.abs(s._rate))}return s._node.currentTime}var c=o.playing(t);c&&o.pause(t,!0),s._seek=e,s._ended=!1,o._clearTimer(t),o._webAudio||!s._node||isNaN(s._node.duration)||(s._node.currentTime=e);var d=function(){c&&o.play(t,!0),o._emit("seek",t)};if(c&&!o._webAudio){var p=function(){o._playLock?setTimeout(p,0):d()};setTimeout(p,0)}else d()}return o},playing:function(e){var t=this;if("number"==typeof e){var n=t._soundById(e);return!!n&&!n._paused}for(var o=0;o=0&&n._howls.splice(a,1);var r=!0;for(o=0;o=0){r=!1;break}return i&&r&&delete i[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,t,n,o){var a=this["_on"+e];return"function"==typeof t&&a.push(o?{id:n,fn:t,once:o}:{id:n,fn:t}),this},off:function(e,t,n){var o=this,a=o["_on"+e],i=0;if("number"==typeof t&&(n=t,t=null),t||n)for(i=0;i=0;i--)a[i].id&&a[i].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(o,a[i].fn),0),a[i].once&&o.off(e,a[i].fn,a[i].id));return o._loadQueue(e),o},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,o=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;o--){if(n<=t)return;e._sounds[o]._ended&&(e._webAudio&&e._sounds[o]._node&&e._sounds[o]._node.disconnect(0),e._sounds.splice(o,1),n--)}}},_getSoundIds:function(e){if(void 0===e){for(var t=[],n=0;n=0;if(!e.bufferSource)return this;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(o){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(e){this._parent=e,this.init()};a.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,o=n._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(o,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener("ended",e._endFn,!1),e._node.src=t._src,e._node.preload=!0===t._preload?"auto":t._preload,e._node.volume=o*n.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(10*e._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(e)),e._node.removeEventListener("ended",e._endFn,!1)}};var i={},r=function(e){var t=e._src;if(i[t])return e._duration=i[t].duration,void l(e);if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(",")[1]),o=new Uint8Array(n.length),a=0;a0?(i[t._src]=e,l(t,e)):o()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(o):n.ctx.decodeAudioData(e,a,o)},l=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},c=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(i){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),t=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),o=t?parseInt(t[1],10):null;if(e&&o&&o<9){var a=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!a&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};O.Howler=n,O.Howl=o,void 0!==e?(e.HowlerGlobal=t,e.Howler=n,e.Howl=o,e.Sound=a):"undefined"!=typeof window&&(window.HowlerGlobal=t,window.Howler=n,window.Howl=o,window.Sound=a)}(), /*! * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported. * * howler.js v2.2.4 * howlerjs.com * * (c) 2013-2020, James Simpson of GoldFire Studios * goldfirestudios.com * * MIT License */ function(){var e;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var o=this;return o.ctx&&o.ctx.listener?(t="number"!=typeof t?o._pos[1]:t,n="number"!=typeof n?o._pos[2]:n,"number"!=typeof e?o._pos:(o._pos=[e,t,n],void 0!==o.ctx.listener.positionX?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]),o)):o},HowlerGlobal.prototype.orientation=function(e,t,n,o,a,i){var r=this;if(!r.ctx||!r.ctx.listener)return r;var s=r._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,o="number"!=typeof o?s[3]:o,a="number"!=typeof a?s[4]:a,i="number"!=typeof i?s[5]:i,"number"!=typeof e?s:(r._orientation=[e,t,n,o,a,i],void 0!==r.ctx.listener.forwardX?(r.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),r.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),r.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),r.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),r.ctx.listener.upY.setTargetAtTime(a,Howler.ctx.currentTime,.1),r.ctx.listener.upZ.setTargetAtTime(i,Howler.ctx.currentTime,.1)):r.ctx.listener.setOrientation(e,t,n,o,a,i),r)},Howl.prototype.init=(e=Howl.prototype.init,function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:360,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:360,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:0,distanceModel:void 0!==t.distanceModel?t.distanceModel:"inverse",maxDistance:void 0!==t.maxDistance?t.maxDistance:1e4,panningModel:void 0!==t.panningModel?t.panningModel:"HRTF",refDistance:void 0!==t.refDistance?t.refDistance:1,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}),Howl.prototype.stereo=function(e,n){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"stereo",action:function(){o.stereo(e,n)}}),o;var a=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===n){if("number"!=typeof e)return o._stereo;o._stereo=e,o._pos=[e,0,0]}for(var i=o._getSoundIds(n),r=0;r({soundInstance:null,isPlaying:!1,isVoiceEnabled:!0,playbackPosition:0,lastVoiceState:null,ttsUrl:"",isNewInstance:!1,nowSound:"",currentAudioUrl:"",isPaused:!1,duration:0}),actions:{setAudioInstance(e){this.soundInstance=e},play(){!this.soundInstance&&this.currentAudioUrl&&this.createAudioInstance(this.currentAudioUrl),this.soundInstance&&(this.isPaused&&this.playbackPosition>0&&this.soundInstance.seek(this.playbackPosition),this.soundInstance.play(),this.isPlaying=!0,this.isPaused=!1)},pause(){this.soundInstance&&this.isPlaying&&(this.playbackPosition=this.soundInstance.seek()||0,this.soundInstance.pause(),this.isPlaying=!1,this.isPaused=!0)},stop(){this.soundInstance&&(this.soundInstance.stop(),this.isPlaying=!1,this.isPaused=!1,this.playbackPosition=0)},togglePlayPause(){this.isPlaying?this.pause():this.play()},setCurrentAudioUrl(e){this.currentAudioUrl!==e&&(this.stop(),this.currentAudioUrl=e,this.playbackPosition=0,this.isPaused=!1)},toggleVoice(){this.isVoiceEnabled=!this.isVoiceEnabled,this.isVoiceEnabled||this.stop()},resetAudioState(){this.stop(),this.currentAudioUrl="",this.ttsUrl="",this.soundInstance=null,this.nowSound=""},createAudioInstance(e){this.soundInstance&&this.soundInstance.stop();const t=new B.Howl({src:[e],html5:!0,format:["mp3","wav"],onplay:()=>{this.isPlaying=!0},onend:()=>{this.isPlaying=!1,this.isPaused=!1,this.playbackPosition=0},onstop:()=>{this.isPlaying=!1},onpause:()=>{this.isPlaying=!1},onerror:e=>{this.isPlaying=!1},onload:()=>{this.duration=t.duration()}});this.soundInstance=t,this.nowSound=t}}});const R="https://api.homilychart.com/link",W=function(e){return n({url:`${R}/api/workflow/aiGodSecond`,method:"post",data:{language:"cn",parentId:e.parentId,recordId:e.recordId,stockId:e.stockId,token:localStorage.getItem("localToken")}})},q=t("emotion",{state:()=>({history:[],stockList:[],activeStockIndex:0,conversations:[]}),persist:{key:"emotion-store",storage:sessionStorage,paths:["history","stockList","activeStockIndex","conversations"]},getters:{activeStock:e=>e.stockList[e.activeStockIndex]||null,stockCount:e=>e.stockList.length,conversationCount:e=>e.conversations.length,recentConversations:e=>e.conversations.slice(-20)},actions:{addHistory(e){this.history.unshift(e)},clearHistory(){this.history=[]},addStock(e){var t,n;if(!(null==(t=e.stockInfo)?void 0:t.code)||!(null==(n=e.stockInfo)?void 0:n.market)||!e.timestamp)return!1;const o=this.generateStockUniqueId(e),a=this.stockList.find((e=>this.generateStockUniqueId(e)===o));if(a){const e=this.stockList.indexOf(a);return this.switchStock(e),!1}const i={...e,uniqueId:o};return this.stockList.push(i),this.activeStockIndex=this.stockList.length-1,!0},switchStock(e){e>=0&&e=0&&e=this.stockList.length?this.activeStockIndex=Math.max(0,this.stockList.length-1):this.activeStockIndex>e&&this.activeStockIndex--)},updateStockData(e,t){e>=0&&e=0&&e{this.addConversation(e)}))},clearConversations(){this.conversations=[]},getConversations(){return this.conversations},removeConversation(e){e>=0&&e=0&&eKe.isVoiceEnabled)),et=D();function tt(e){if(!e)return"未知错误";try{L.setOptions({breaks:!0,gfm:!0,sanitize:!1,smartLists:!0,smartypants:!0,xhtml:!1});const t=L(e),n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||e}catch(t){return e}}E();const nt=a([]),ot=a([]),at=a([]),it=a([]),rt=a(null),st=a([]),ut=a(new Set),lt=()=>{pt.value||O.stockList.forEach((e=>{var t;if(!(null==(t=null==e?void 0:e.stockInfo)?void 0:t.code)||!(null==e?void 0:e.timestamp)||!(null==e?void 0:e.queryText))return;const n=Dt(e);if(n&&!ut.value.has(n)){st.value.find((t=>"user"===t.sender&&t.text===e.queryText));O.getConversations().find((t=>"user"===t.sender&&t.text===e.queryText)),ut.value.add(n)}}))};t({handleSendMessage:async function(e,t){if(gt.value=!0,dt.value=!1,!e||!e.trim())return r.warning("输入内容不能为空"),void(t&&"function"==typeof t&&(t(),Lt.value=null));ct.value=!1,pt.value=!0;const o=[...st.value];st.value=[];const a=s({sender:"user",text:e});st.value.push(a),O.addConversation({sender:"user",text:e,timestamp:(new Date).toISOString()});const i=await async function(e=null){const t=s({sender:"ai",text:"AI情绪大模型正在思考",gif:C,flag:!0});st.value.push(t),await new Promise((e=>setTimeout(e,1500))),st.value.pop();const n=s({sender:"ai",text:"正在解析关键数据",gif:M,flag:!0});if(st.value.push(n),!e)return n;await new Promise((e=>setTimeout(e,1500))),st.value.pop();const o=s({sender:"ai",text:`正在生成${e}量子四维矩阵图`,gif:H,flag:!0});st.value.push(o),await new Promise((e=>setTimeout(e,1500))),st.value.pop();const a=s({sender:"ai",text:"报告已生成!"});return st.value.push(a),await new Promise((e=>setTimeout(e,1500))),st.value.pop(),null}();let l=null;try{const r=await(c={token:localStorage.getItem("localToken"),language:"cn",marketList:"hk,cn,usa,my,sg,vi,in,gb",content:a.text},n({url:`${R}/api/workflow/aiGodFirst`,method:"post",data:{token:localStorage.getItem("localToken"),language:"cn",marketList:"hk,cn,usa,my,sg,vi,in,gb",content:c.content}})),p=r.data;if(400===r.code){if(i){const e=st.value.indexOf(i);e>-1&&st.value.splice(e,1)}ct.value=!1;const e=r.msg||"用户输入内容不合法,请重新输入",n=s({sender:"ai",text:tt(e)});return st.value.push(n),O.addConversation({sender:"ai",text:tt(e),timestamp:(new Date).toISOString()}),pt.value=!1,st.value=[...o,...st.value],u((()=>{mn()})),void(t&&"function"==typeof t&&(t(),Lt.value=null))}if(406===r.code){if(i){const e=st.value.indexOf(i);e>-1&&st.value.splice(e,1)}ct.value=!1;const e=tt(r.msg||"您的使用次数已用完,请联系客服或购买服务包").replace(/获取token次数/g,'获取token次数'),n=s({sender:"ai",text:e,isHtml:!0});return st.value.push(n),O.addConversation({sender:"ai",text:e,isHtml:!0,timestamp:(new Date).toISOString()}),pt.value=!1,st.value=[...o,...st.value],u((()=>{mn()})),void(t&&"function"==typeof t&&(t(),Lt.value=null))}if(200!==r.code){if(i){const e=st.value.indexOf(i);e>-1&&st.value.splice(e,1)}ct.value=!1;const e=r.msg||"系统异常,请稍后再试",n=s({sender:"ai",text:tt(e)});return st.value.push(n),O.addConversation({sender:"ai",text:tt(e),timestamp:(new Date).toISOString()}),pt.value=!1,st.value=[...o,...st.value],u((()=>{mn()})),void(t&&"function"==typeof t&&(t(),Lt.value=null))}if(!p||!p.market||!p.code){if(i){const e=st.value.indexOf(i);e>-1&&st.value.splice(e,1)}ct.value=!1;const e=r&&r.msg?r.msg:"系统正在为您努力加载中,请稍后再试",n=s({sender:"ai",text:tt(e)});return st.value.push(n),O.addConversation({sender:"ai",text:tt(e),timestamp:(new Date).toISOString()}),pt.value=!1,st.value=[...o,...st.value],u((()=>{mn()})),void(t&&"function"==typeof t&&(t(),Lt.value=null))}i&&p.name&&(l=await async function(e,t){if(!e||!t)return;await new Promise((e=>setTimeout(e,1500)));const n=st.value.indexOf(e);n>-1&&st.value.splice(n,1);const o=s({sender:"ai",text:`正在生成${t}量子四维矩阵图`,gif:H,flag:!0});return st.value.push(o),o}(i,p.name)),ct.value=!1;const v={recordId:p.recordId,parentId:p.parentId,stockId:p.stockId,token:localStorage.getItem("localToken"),language:"cn"},_=`${p.code}_${p.market}_${(new Date).toISOString()}`,f=!xt.value.has(_);f&>.value?(St.value.set(_,{one1:"",one2:"",two:"",three:"",four:"",disclaimer:""}),Tt.value.set(_,{one:!1,two:!1,three:!1,four:!1,disclaimer:!1})):(St.value.delete(_),Tt.value.delete(_),f&&(xt.value.set(_,!0),It.value.set(_,!0)));const[m,h]=await Promise.all([W(v),an(p.code,p.market,p.name||"未知股票",e.trim(),p.stockId,_)]),g=m;if(g&&200!==g.code){if(l){const e=st.value.indexOf(l);e>-1&&st.value.splice(e,1)}const e=g.msg||"系统正在为您努力加载中,请稍后再试",n=s({sender:"ai",text:e});return st.value.push(n),pt.value=!1,st.value=[...o,...st.value],void(t&&"function"==typeof t&&(t(),Lt.value=null))}if(!(g&&g.data&&h)){if(l){const e=st.value.indexOf(l);e>-1&&st.value.splice(e,1)}if(!g||!g.data){const e=s({sender:"ai",text:"系统正在为您努力加载中,请稍后再试"});st.value.push(e)}return pt.value=!1,st.value=[...o,...st.value],ct.value&&O.activeStock&&O.activeStock.apiData&&u((()=>{un(O.activeStock.apiData)})),void(t&&"function"==typeof t&&(t(),Lt.value=null))}l&&await async function(e){if(!e)return;await new Promise((e=>setTimeout(e,1500)));const t=st.value.indexOf(e);t>-1&&st.value.splice(t,1);const n=s({sender:"ai",text:"报告已生成!"});st.value.push(n),await new Promise((e=>setTimeout(e,1500))),st.value.pop()}(l),vt.value=g.data,O.updateActiveStockConclusion(g.data);Dt(p)&&u((()=>{})),ct.value=!0,u((()=>{st.value=[],ut.value.clear(),yt.value=!1,mn()}));try{await et.getUserCount()}catch(d){}try{et.searchRecord=!0}catch(d){}u((()=>{if(Vt.value&&Vt.value.apiData){if(un(Vt.value.apiData),gt.value&&Gt.value&&Et.value){const e=Dt(Vt.value);e&&!xt.value.has(e)?(It.value.has(e)?Zt(Gt.value,e,t):(It.value.set(e,!0),nn(Gt.value,!0,t)),xt.value.set(e,!0)):t&&"function"==typeof t&&(t(),Lt.value=null)}gt.value=!1}}))}catch(d){if(l){const e=st.value.indexOf(l);e>-1&&st.value.splice(e,1)}return O.stockList.length>0&&O.activeStock?(ct.value=!0,u((()=>{st.value=[],yt.value=!1,mn()})),u((()=>{un(O.activeStock.apiData)}))):ct.value=!1,pt.value=!1,st.value=[...o,...st.value],ct.value&&O.activeStock&&O.activeStock.apiData&&u((()=>{un(O.activeStock.apiData)})),void(t&&"function"==typeof t&&(t(),Lt.value=null))}finally{pt.value&&(pt.value=!1)}var c},clearConversations:()=>{st.value=[],O.clearConversations(),ut.value.clear()},addStock:e=>{if(e&&e.stockInfo&&e.stockInfo.code){if(dt.value=!0,gt.value=!1,yt.value=!1,ct.value=!1,O.clearAllStocks(),O.clearConversations(),st.value=[],ut.value.clear(),on(),Et.value="",Ke.resetAudioState(),Yt(),ft.value=!1,mt.value=!1,xt.value.clear(),It.value.clear(),At.value={marketTemperature:!1,emotionDecod:!1,emotionalBottomRadar:!1,emoEnergyConverter:!1},O.addStock(e),ct.value=!0,e.conclusionData){const t=Dt(e);t&&(xt.value.set(t,!0),It.value.set(t,!0))}u((()=>{yn("enableInput")}))}else yn("enableInput")}});const ct=a(!1),dt=a(!1),pt=a(!1);a(1);const vt=a("");a(!1),a(0),a([]);const _t=a(null),ft=a(!1),mt=a(!1),ht=a(null),gt=a(!1),yt=a(!1),wt=a(!1),kt=a(null),At=a({marketTemperature:!0,emotionDecod:!0,emotionalBottomRadar:!0,emoEnergyConverter:!0}),bt=a([]),xt=a(new Map),St=a(new Map),Tt=a(new Map),It=a(new Map),Pt=a(new Map),Dt=e=>{var t,n;if(!e||"object"!=typeof e)return null;if(e.uniqueId)return e.uniqueId;const o=(null==(t=e.stockInfo)?void 0:t.code)||(null==(n=e.stockInfo)?void 0:n.symbol),a=e.timestamp;return o&&a?`${o}_${a}`:null},Lt=a(null),Et=a(""),Ot=a(!1),Ct=e=>{const t=Dt(e);return t&&Pt.value.get(t)||{isPlaying:!1,isPaused:!1}},Mt=(e,t)=>{const n=Dt(e);n&&t&&"object"==typeof t&&Pt.value.set(n,{...t})},Ht=()=>{for(const[e,t]of Pt.value.entries())Pt.value.set(e,{isPlaying:!1,isPaused:!1})},Bt=a(!1),Vt=o((()=>O.activeStock));o((()=>{var e;return(null==(e=Vt.value)?void 0:e.stockInfo.name)||""})),o((()=>{var e,t;return(null==(e=Vt.value)?void 0:e.stockInfo.code)||(null==(t=Vt.value)?void 0:t.stockInfo.symbol)||""})),o((()=>Vt.value?Dt(Vt.value):"")),o((()=>{var e,t;if(!(null==(e=Vt.value)?void 0:e.apiData))return"";const n=null==(t=Vt.value.apiData.GSWDJ)?void 0:t.at(-1);if(!n||!n[0])return"";const o=n[0],a=o.match(/(\d{4})[\-\/](\d{1,2})[\-\/](\d{1,2})/);if(a){const[,e,t,n]=a;return`更新时间:${n.padStart(2,"0")}/${t.padStart(2,"0")}/${e}`}return o})),o((()=>{var e,t;if(!(null==(e=Vt.value)?void 0:e.apiData))return null;const n=null==(t=Vt.value.apiData.GSWDJ)?void 0:t.at(-1);return n?Math.round(n[1]):null})),o((()=>{var e,t;if(!(null==(e=Vt.value)?void 0:e.apiData))return null;const n=null==(t=Vt.value.apiData.GSWDJ)?void 0:t.at(-1);return n?Math.round(n[2]):null}));const Ft=o((()=>{var e;return(null==(e=Vt.value)?void 0:e.conclusionData)||""})),Gt=o((()=>{if(!Ft.value)return null;if("object"==typeof Ft.value)return Ft.value;try{return JSON.parse(Ft.value)}catch(e){return null}})),Rt=o((()=>O.stockList.filter((e=>{var t;return(null==(t=e.stockInfo)?void 0:t.name)&&e.apiData&&e.queryText})).sort(((e,t)=>new Date(e.timestamp)-new Date(t.timestamp))))),Wt=e=>{var t;if(!(null==e?void 0:e.apiData))return"";const n=null==(t=e.apiData.GSWDJ)?void 0:t.at(-1);if(!n||!n[0])return"";const o=n[0],a=o.match(/(\d{4})[\-\/](\d{1,2})[\-\/](\d{1,2})/);if(a){const[,e,t,n]=a;return`更新时间:${n.padStart(2,"0")}/${t.padStart(2,"0")}/${e}`}return o},qt=e=>{var t;if(!(null==e?void 0:e.apiData))return null;const n=null==(t=e.apiData.GSWDJ)?void 0:t.at(-1);return n?Math.round(n[1]):null},Xt=e=>{var t;if(!(null==e?void 0:e.apiData))return null;const n=null==(t=e.apiData.GSWDJ)?void 0:t.at(-1);return n?Math.round(n[2]):null},jt=e=>{if(!(null==e?void 0:e.conclusionData))return null;if("object"==typeof e.conclusionData)return e.conclusionData;try{return JSON.parse(e.conclusionData)}catch(t){return null}},Nt=e=>{const t=Dt(e);if(!t)return null;return St.value.get(t)||null},Qt=e=>{const t=Dt(e);return t&&Tt.value.get(t)||null},Ut=e=>{const t=Dt(e);if(!t)return!1;if(!jt(e))return!1;return!!xt.value.has(t)||!gt.value||(St.value.has(t)||St.value.set(t,{one1:"",one2:"",two:"",three:"",four:"",disclaimer:""}),Tt.value.has(t)||Tt.value.set(t,{one:!1,two:!1,three:!1,four:!1,disclaimer:!1}),!0)};function Zt(e,t,n){if(!t&&O.activeStock&&(t=Dt(O.activeStock)),!t)return;Lt.value=n,bt.value.forEach((e=>clearTimeout(e))),bt.value=[],St.value.has(t)||St.value.set(t,{one1:"",one2:"",two:"",three:"",four:"",disclaimer:""}),Tt.value.has(t)||Tt.value.set(t,{one:!1,two:!1,three:!1,four:!1,disclaimer:!1}),St.value.set(t,{one1:"",one2:"",two:"",three:"",four:"",disclaimer:""}),Tt.value.set(t,{one:!1,two:!1,three:!1,four:!1,disclaimer:!1});let o=0;[{key:"one",title:"L1: 情绪监控",contents:[{key:"one1",text:e.one1},{key:"one2",text:e.one2}]},{key:"two",title:"L2: 情绪解码",contents:[{key:"two",text:e.two}]},{key:"three",title:"L3: 情绪推演",contents:[{key:"three",text:e.three}]},{key:"four",title:"L4: 情绪套利",contents:[{key:"four",text:e.four}]}].forEach((e=>{if(!e.contents.some((e=>e.text&&e.text.trim())))return;const n=setTimeout((()=>{const n=Tt.value.get(t);n&&(n[e.key]=!0,Tt.value.set(t,{...n}))}),o);bt.value.push(n),o+=100,e.contents.forEach((e=>{if(e.text&&e.text.trim()){for(let n=0;n<=e.text.length;n++){const a=setTimeout((()=>{const o=St.value.get(t);o&&(o[e.key]=e.text.substring(0,n),St.value.set(t,{...o}))}),o+200*n);bt.value.push(a)}o+=200*e.text.length+200}})),o+=800}));const a="该内容由AI生成,请注意甄别",i=setTimeout((()=>{const e=Tt.value.get(t);e&&(e.disclaimer=!0,Tt.value.set(t,{...e}))}),o);bt.value.push(i),o+=100;for(let r=0;r<=a.length;r++){const e=setTimeout((()=>{const e=St.value.get(t);e&&(e.disclaimer=a.substring(0,r),St.value.set(t,{...e})),r===a.length&&n&&"function"==typeof n&&(n(),Lt.value=null)}),o+200*r);bt.value.push(e)}}function Yt(){bt.value.forEach((e=>clearTimeout(e))),bt.value=[]}i((()=>O.stockList),(e=>{0===e.length?(ct.value=!1,on(),Et.value="",Ke.resetAudioState(),Yt(),ft.value=!1,mt.value=!1,xt.value.clear(),It.value.clear(),ut.value.clear(),At.value={marketTemperature:!1,emotionDecod:!1,emotionalBottomRadar:!1,emoEnergyConverter:!1}):lt()}),{deep:!0}),i(Vt,(e=>{if(e&&e.apiData){on(),Et.value="",Ke.resetAudioState(),Yt(),ft.value=!1,mt.value=!1;const n=Dt(e);if(e.conclusionData)try{const t="object"==typeof e.conclusionData?e.conclusionData:JSON.parse(e.conclusionData);if(!(n&&St.value.has(n))){let e=null;t.one1_url?e=t.one1_url.toString().trim().replace(/[`\s]/g,""):t.one2_url?e=t.one2_url.toString().trim().replace(/[`\s]/g,""):t.two_url?e=t.two_url.toString().trim().replace(/[`\s]/g,""):t.three_url?e=t.three_url.toString().trim().replace(/[`\s]/g,""):t.four_url?e=t.four_url.toString().trim().replace(/[`\s]/g,""):t.url?e=t.url.toString().trim().replace(/[`\s]/g,""):t.audioUrl?e=t.audioUrl.toString().trim().replace(/[`\s]/g,""):t.voice_url?e=t.voice_url.toString().trim().replace(/[`\s]/g,""):t.audio?e=t.audio.toString().trim().replace(/[`\s]/g,""):t.tts_url&&(e=t.tts_url.toString().trim().replace(/[`\s]/g,"")),e&&e.startsWith("http")&&(Et.value=e,Ke.setCurrentAudioUrl(e))}}catch(t){}else Et.value="",Ke.resetAudioState();ct.value&&u((()=>{un(e.apiData),setTimeout((()=>{if(_t.value&&_t.value instanceof Element&&Gt.value){if(n&&xt.value.has(n))return;const e=_t.value.getBoundingClientRect();if(e.top0&&n)if(xt.value.has(n)){const e=Gt.value;displayedTexts.value={one1:e.one1||"",one2:e.one2||"",two:e.two||"",three:e.three||"",four:e.four||"",disclaimer:"该内容由AI生成,请注意甄别"},displayedTitles.value={one:"L1: 情绪监控",two:"L2: 情绪解码",three:"L3: 情绪推演",four:"L4: 情绪套利"},moduleVisibility.value={one:!(!e.one1&&!e.one2),two:!!e.two,three:!!e.three,four:!!e.four,disclaimer:!0}}else if(gt.value&&Et.value)mt.value=!0,ft.value=!0,It.value.has(n)?Zt(Gt.value,n):(It.value.set(n,!0),nn(Gt.value,!0)),xt.value.set(n,!0);else{if(gt.value&&!Et.value)return;Gt.value,xt.value.set(n,!0),It.value.set(n,!0)}}}),500)}))}else At.value={marketTemperature:!1,emotionDecod:!1,emotionalBottomRadar:!1,emoEnergyConverter:!1}}),{immediate:!0}),i(Gt,(e=>{if(e){let t=null;e.one1_url?t=e.one1_url.toString().trim().replace(/[`\s]/g,""):e.one2_url?t=e.one2_url.toString().trim().replace(/[`\s]/g,""):e.two_url?t=e.two_url.toString().trim().replace(/[`\s]/g,""):e.three_url?t=e.three_url.toString().trim().replace(/[`\s]/g,""):e.four_url?t=e.four_url.toString().trim().replace(/[`\s]/g,""):e.url?t=e.url.toString().trim().replace(/[`\s]/g,""):e.audioUrl?t=e.audioUrl.toString().trim().replace(/[`\s]/g,""):e.voice_url?t=e.voice_url.toString().trim().replace(/[`\s]/g,""):e.audio?t=e.audio.toString().trim().replace(/[`\s]/g,""):e.tts_url&&(t=e.tts_url.toString().trim().replace(/[`\s]/g,"")),t&&t.startsWith("http")&&(Et.value=t,Ke.setCurrentAudioUrl(t))}}),{immediate:!0});const zt=a([]),Jt=a(!1);let Kt=0,$t=!1;const en={one1_url:1,one2_url:2,two_url:3,three_url:4,four_url:5,url:6,audioUrl:7,voice_url:8,audio:9,tts_url:10},tn=()=>{if(0===zt.value.length||Jt.value||$t)return;Kt>=zt.value.length&&zt.value.length>0&&(Kt=0,$t=!1),$t=!0,Jt.value=!0;const e=zt.value[Kt];Ke.nowSound&&Ke.nowSound.playing()&&Ke.nowSound.stop();const t=new B.Howl({src:[e.url],html5:!1,format:["mp3","wav"],onplay:()=>{Ot.value=!0,Jt.value=!0,Ke.isPlaying=!0;const t=O.activeStock;if(t&&Mt(t,{isPlaying:!0,isPaused:!1}),0===Kt&&e.shouldStartTypewriter&&Gt.value&&!Ke.isPaused&&0===Ke.playbackPosition){const n=t?Dt(t):null;Zt(Gt.value,n,e.onComplete)}else 0===Kt&&e.shouldStartTypewriter},onpause:()=>{Ke.isPlaying=!1,Ke.isPaused=!0,t&&t.seek&&(Ke.playbackPosition=t.seek()||0);const e=O.activeStock;e&&Mt(e,{isPlaying:!1,isPaused:!0})},onresume:()=>{Ke.isPlaying=!0,Ke.isPaused=!1,Ke.playbackPosition>0&&t&&t.seek&&t.seek(Ke.playbackPosition);const e=O.activeStock;e&&Mt(e,{isPlaying:!0,isPaused:!1})},onend:()=>{if(Ke.isPaused=!1,Ke.playbackPosition=0,Kt++,Kt{$t=!1,Jt.value=!1,Ke.isPlaying=!0;const e=zt.value[Kt];e&&e.url&&Ke.setCurrentAudioUrl(e.url),tn()}),500);else{Ke.nowSound=null,$t=!1,Ke.isPlaying=!1,Ke.isPaused=!1,Ke.playbackPosition=0,Ot.value=!1,Jt.value=!1;const t=O.activeStock;t&&Mt(t,{isPlaying:!1,isPaused:!1}),e.onComplete&&"function"==typeof e.onComplete&&e.onComplete()}},onstop:()=>{Ke.isPlaying=!1,Ke.isPaused=!1,Ke.playbackPosition=0,Ot.value=!1,Jt.value=!1;const e=O.activeStock;e&&Mt(e,{isPlaying:!1,isPaused:!1})},onerror:e=>{Ot.value=!1,Jt.value=!1,$t=!1,setTimeout((()=>{tn()}),100)},onload:()=>{Ke.duration=t.duration()}});Ke.setCurrentAudioUrl(e.url),Ke.nowSound=t,Ke.setAudioInstance(t),t.play()};function nn(e,t=!1,n=null){if(e&&Ke.isVoiceEnabled)try{const o="object"==typeof e?e:JSON.parse(e);zt.value=[],Kt=0,$t=!1,Jt.value=!1;if([{key:"one1_url",name:"one1_url"},{key:"one2_url",name:"one2_url"},{key:"two_url",name:"two_url"},{key:"three_url",name:"three_url"},{key:"four_url",name:"four_url"},{key:"url",name:"url"},{key:"audioUrl",name:"audioUrl"},{key:"voice_url",name:"voice_url"},{key:"audio",name:"audio"},{key:"tts_url",name:"tts_url"}].forEach((e=>{if(o[e.key]){const a=o[e.key].toString().trim().replace(/[`\s]/g,"");a&&a.startsWith("http")&&((e,t,n=!1,o=null)=>{if(e&&Ke.isVoiceEnabled){const a={url:e,name:t,order:en[t]||999,shouldStartTypewriter:n,onComplete:o};zt.value.push(a),zt.value.sort(((e,t)=>e.order-t.order)),Jt.value||Ke.isPlaying||1!==zt.value.length||tn()}})(a,e.name,t&&0===zt.value.length,n)}})),0===zt.value.length){if(t){const e=O.activeStock,t=e?Dt(e):null;Zt(o,t,n)}}else{const e=O.activeStock;e&&Mt(e,{isPlaying:!0,isPaused:!1})}}catch(o){}}function on(){Ke.nowSound&&Ke.nowSound.stop(),Ot.value=!1}async function an(e,t,n,o,a,i=null){try{const r={stockId:a},c=(await l.post("https://api.homilychart.com/link/api/workflow/getStockData",r,{headers:{"Content-Type":"application/json"}})).data;if(200===c.code&&c.data){if(!rn(c.data).isValid){O.stockList.length>0&&O.activeStock?(ct.value=!0,u((()=>{st.value=[],yt.value=!1,mn()})),u((()=>{un(O.activeStock.apiData)}))):ct.value=!1;const e=s({sender:"ai",text:"系统正在为您努力加载中,请稍后再试"});return st.value.push(e),O.addConversation({sender:"ai",text:"系统正在为您努力加载中,请稍后再试",timestamp:(new Date).toISOString()}),!1}const a={queryText:o,stockInfo:{name:n,code:e,market:t},apiData:c.data,conclusionData:vt.value,timestamp:(new Date).toISOString(),uniqueId:i||`${e}_${t}_${(new Date).toISOString()}`};return O.addStock(a),!0}{O.stockList.length>0&&O.activeStock?(ct.value=!0,u((()=>{st.value=[],yt.value=!1,mn()})),u((()=>{un(O.activeStock.apiData)}))):ct.value=!1;const e=s({sender:"ai",text:"系统正在为您努力加载中,请稍后再试"});return st.value.push(e),O.addConversation({sender:"ai",text:"系统正在为您努力加载中,请稍后再试",timestamp:(new Date).toISOString()}),!1}}catch(r){O.stockList.length>0&&O.activeStock?(ct.value=!0,u((()=>{st.value=[],yt.value=!1,mn()})),u((()=>{un(O.activeStock.apiData)}))):ct.value=!1;const e=s({sender:"ai",text:"系统正在为您努力加载中,请稍后再试"});return st.value.push(e),O.addConversation({sender:"ai",text:"系统正在为您努力加载中,请稍后再试",timestamp:(new Date).toISOString()}),!1}}function rn(e){const t=["GSWDJ","KLine20","QXJMQ","QXTDLD","WDRL"],n=[];for(const o of t)(!e[o]||Array.isArray(e[o])&&0===e[o].length||"object"==typeof e[o]&&!sn(e[o]))&&n.push(o);return{isValid:0===n.length,missingFields:n}}function sn(e){if(!e||"object"!=typeof e)return!1;for(const t in e)if(e.hasOwnProperty(t)){const n=e[t];if("string"==typeof n){if(""!==n.trim())return!0}else if(Array.isArray(n)){if(n.length>0)return!0}else{if("number"==typeof n&&0!==n)return!0;if("boolean"==typeof n&&!0===n)return!0;if("object"==typeof n&&null!==n&&sn(n))return!0}}return!1}function un(e){const t=JSON.parse(JSON.stringify(e)),n=rn(t);if(!n.isValid){const e=s({sender:"ai",text:`数据不完整,缺少以下关键数据:${n.missingFields.join("、")}。请稍后重试或联系客服。`});return st.value.push(e),O.addConversation({sender:"ai",text:`数据不完整,缺少以下关键数据:${n.missingFields.join("、")}。请稍后重试或联系客服。`,timestamp:(new Date).toISOString()}),void(ct.value=!1)}At.value={marketTemperature:!!(t.GSWDJ&&t.GSWDJ.length>0),emotionDecod:!!(t.QXJMQ&&t.QXJMQ.length>0),emotionalBottomRadar:!!(t.QXTDLD&&t.QXTDLD.length>0),emoEnergyConverter:!(!t.QXNLZHQ||!(Array.isArray(t.QXNLZHQ)?t.QXNLZHQ.length>0:sn(t.QXNLZHQ)))},u((()=>{setTimeout((()=>{try{document.querySelector("emo-energy-converter");setTimeout((()=>{ot.value}),1e3),O.stockList.forEach(((e,t)=>{e.apiData&&async function(e,t=0){const n=[{name:"股市温度计",ref:nt.value[t],visibility:At.value.marketTemperature,method:"initChart",params:[e.GSWDJ,e.KLine20,e.WDRL]},{name:"情绪解码器",ref:at.value[t],visibility:At.value.emotionDecod,method:"initQXNLZHEcharts",params:[e.KLine20,e.QXJMQ]},{name:"情绪探底雷达",ref:it.value[t],visibility:At.value.emotionalBottomRadar,method:"initEmotionalBottomRadar",params:[e.KLine20,e.QXTDLD]},{name:"情绪能量转化器",ref:ot.value[t],visibility:At.value.emoEnergyConverter,method:"initQXNLZHEcharts",params:[e.KLine20,e.QXNLZHQ]}];for(const a of n)if(a.ref&&a.visibility&&"function"==typeof a.ref[a.method])try{const e=0===t?100:300+100*t;await new Promise((t=>setTimeout(t,e))),a.ref[a.method](...a.params),await new Promise((e=>setTimeout(e,800)))}catch(o){}}(e.apiData,t)}))}catch(e){const t=s({sender:"ai",text:"图表渲染失败,请重试"});st.value.push(t),O.addConversation({sender:"ai",text:"系统正在为您努力加载中,请稍后再试",timestamp:(new Date).toISOString()})}}),500)}))}const ln=()=>{wt.value=!0,kt.value&&clearTimeout(kt.value),kt.value=setTimeout((()=>{wt.value=!1}),2e3)},cn=e=>{ln()},dn=e=>{ln()};function pn(){if(!(_t.value&&_t.value instanceof Element))return;const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const e=Vt.value?Dt(Vt.value):null;Gt.value&&e&&(xt.value.has(e)||(gt.value&&Et.value?(It.value.set(e,!0),nn(Gt.value,!0),xt.value.set(e,!0)):(xt.value.set(e,!0),It.value.set(e,!0))))}}))}),{threshold:.3,rootMargin:"0px 0px -100px 0px"});e.observe(_t.value),ht.value=e}const vn=()=>{const e=document.getElementById("top-anchor");e?e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}):window.scrollTo({top:0,behavior:"smooth"}),setTimeout((()=>{(window.pageYOffset||document.documentElement.scrollTop)>50&&(document.documentElement.scrollTop=0,document.body.scrollTop=0)}),1e3)},_n=a(null),fn=a(!1),mn=()=>{u((()=>{yn("scrollToBottom")}))},hn=()=>{const e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;Bt.value=e>200},gn=()=>{const e=rt.value;if(e){e.scrollTop>200&&(Bt.value=!0)}};c((async()=>{window.handleTokenClick=()=>{yn("showCount")},(()=>{const e=O.getConversations();st.value=e.map((e=>({sender:e.sender,text:e.text,isHtml:e.isHtml||!1})))})(),lt();const e=function(e,t){let n;return function(...o){clearTimeout(n),n=setTimeout((()=>{clearTimeout(n),e(...o)}),t)}}((()=>{const e=document.querySelector(".main");e&&(e.style.display="none",e.offsetHeight,e.style.display="");const t=[window.emoEnergyConverterResizeHandler,window.marketTempResizeHandler,window.emotionalBottomRadarResizeHandler,window.emotionDecodResizeHandler];t.forEach((e=>{if("function"==typeof e)try{e()}catch(t){}})),setTimeout((()=>{t.forEach((e=>{if("function"==typeof e)try{e()}catch(t){}}))}),100)}),150);window.aiEmotionGlobalResizeHandler&&window.removeEventListener("resize",window.aiEmotionGlobalResizeHandler),window.addEventListener("resize",e),window.aiEmotionGlobalResizeHandler=e;const t=rt.value;t&&(t.addEventListener("wheel",cn,{passive:!0}),t.addEventListener("touchmove",dn,{passive:!0}),t.addEventListener("scroll",ln,{passive:!0}),t.addEventListener("scroll",gn,{passive:!0})),window.addEventListener("scroll",hn,{passive:!0}),document.addEventListener("scroll",hn,{passive:!0}),pt.value=!0,setTimeout((()=>{pt.value=!1}),5e3),O.stockList.length>0&&O.activeStock?(ct.value=!0,u((()=>{st.value=[],yt.value=!1})),u((()=>{const e=O.activeStock;if(e&&e.apiData&&(un(e.apiData),e.conclusionData)){vt.value=e.conclusionData,vt.value=e.conclusionData;const t=Dt(e);t&&(xt.value.set(t,!0),It.value.set(t,!0))}pn()}))):u((()=>{pn()}))})),d((()=>{Yt(),Lt.value&&"function"==typeof Lt.value&&(Lt.value(),Lt.value=null),on(),ft.value=!1,mt.value=!1,fn.value=!1,_n.value&&(_n.value.disconnect(),_n.value.mutationObserver&&(_n.value.mutationObserver.disconnect(),_n.value.mutationObserver=null),_n.value=null),kt.value&&(clearTimeout(kt.value),kt.value=null),ht.value&&(ht.value.disconnect(),ht.value=null),window.aiEmotionGlobalResizeHandler&&(window.removeEventListener("resize",window.aiEmotionGlobalResizeHandler),window.aiEmotionGlobalResizeHandler=null);const e=rt.value;e&&(e.removeEventListener("wheel",cn),e.removeEventListener("touchmove",dn),e.removeEventListener("scroll",ln),e.removeEventListener("scroll",gn)),window.removeEventListener("scroll",hn),document.removeEventListener("scroll",hn)}));const yn=P;return(e,t)=>(p(),v(m,null,[t[19]||(t[19]=_("div",{id:"top-anchor",class:"top-anchor"},null,-1)),_("div",X,[_("div",{class:"ai-emotion-container",ref_key:"userInputDisplayRef",ref:rt},[_("div",j,[_("img",{src:"/aixiaocaishen/static/images/金轮-858e9d26.png",class:f(["golden-wheel-img",{"rotating-image":pt.value}]),alt:"金轮图标"},null,2)]),st.value.length>0&&!dt.value?(p(),v("div",N,[_("div",Q,[(p(!0),v(m,null,h(st.value,((e,n)=>(p(),v("div",{key:n,class:f(["message-item",{"user-message-item":"user"===e.sender,"ai-message-item":"ai"===e.sender}])},["user"===e.sender?(p(),v("div",U,[_("div",Z,y(e.text),1)])):(p(),v("div",Y,[_("div",z,[e.gif?(p(),v("img",{key:0,src:e.gif,alt:"思考过程",class:"thinking-gif"},null,8,J)):g("",!0),_("div",K,[e.flag?(p(),v("div",$,[_("span",null,y(e.text),1),t[0]||(t[0]=w('......',1))])):(p(),v("div",ee,[e.isHtml?(p(),v("div",{key:0,innerHTML:e.text},null,8,te)):(p(),v("div",ne,y(e.text),1))]))])])]))],2)))),128))])])):g("",!0)],512),e.isLoading?(p(),v("div",oe,t[1]||(t[1]=[_("div",{class:"loading-content"},[_("div",{class:"loading-spinner"}),_("div",{class:"loading-text"},"AI情绪大模型正在努力为您加载,请稍候...")],-1)]))):g("",!0),ct.value?(p(!0),v(m,{key:1},h(Rt.value,((e,n)=>{var o;return p(),v("div",{class:"master",key:`stock-${n}-${e.timestamp}`},[_("div",ae,[_("div",ie,[_("div",re,[_("div",se,[_("img",{src:$e.value&&Ct(e).isPlaying?k(V):k(F),class:f(["user-message-speaker",{"speaker-active":$e.value&&Ct(e).isPlaying}]),onClick:()=>(e=>{if(Ke.isVoiceEnabled){const t=jt(e),n=Ct(e),o=Ke.isPlaying||n.isPlaying;n.isPlaying?(Ke.nowSound&&Ke.nowSound.playing()&&(Ke.nowSound.pause(),Ke.isPaused=!0,Ke.isPlaying=!1),Mt(e,{isPlaying:!1,isPaused:!0})):n.isPaused?(Ke.nowSound&&(Ke.playbackPosition>0&&Ke.nowSound.seek(Ke.playbackPosition),Ke.nowSound.play(),Ke.isPaused=!1,Ke.isPlaying=!0),Mt(e,{isPlaying:!0,isPaused:!1})):(o&&(on(),Ke.resetAudioState()),Ht(),t&&(t.one1_url||t.two_url||t.three_url||t.four_url)&&(Mt(e,{isPlaying:!0,isPaused:!1}),nn(t,!1,(()=>{Mt(e,{isPlaying:!1,isPaused:!1})}))))}else Ke.toggleVoice()})(e),alt:"喇叭"},null,10,ue),_("div",le,y(e.queryText),1)]),dt.value?(p(),v("div",ce,y(k(b)(e.timestamp).format("YYYY-MM-DD HH:mm:ss")),1)):g("",!0)])])]),_("div",de,[_("div",pe,[_("div",ve,[_("div",_e,y(e.stockInfo.name)+y(e.stockInfo.name?"量子四维矩阵图":""),1),_("div",fe,y(Wt(e)),1)]),At.value.marketTemperature?(p(),v("div",me,t[2]||(t[2]=[_("img",{src:"/aixiaocaishen/static/images/L1-bf15f913.png",alt:"情绪监控图标"},null,-1)]))):g("",!0),At.value.marketTemperature?(p(),v("div",he,[_("div",ge,[t[3]||(t[3]=_("div",{class:"content1"},[_("img",{src:"/aixiaocaishen/static/images/温度计-7ba6b126.png",alt:"温度计图标"}),_("span",{class:"matrix-main-title"},"股市温度计")],-1)),_("div",ye,[_("div",we," 股票温度:"+y(null!=(o=Xt(e))?o:"NA"),1),_("div",ke," 市场温度:"+y(qt(e)),1)])]),A(I,{ref_for:!0,ref:e=>nt.value[n]=e,companyName:e.stockInfo.name,stockCode:e.stockInfo.code},null,8,["companyName","stockCode"])])):g("",!0)]),At.value.emotionDecod?(p(),v("div",Ae,t[4]||(t[4]=[_("img",{src:"/aixiaocaishen/static/images/L2-c8e914de.png",alt:"情绪解码图标"},null,-1)]))):g("",!0),At.value.emotionDecod?(p(),v("div",be,[t[5]||(t[5]=_("div",{class:"emotion-decoder-header"},[_("img",{src:"/aixiaocaishen/static/images/emotionDecod-ea6f54b2.png",alt:"情绪解码器图标"}),_("span",{class:"emotion-decoder-text"},"情绪解码器")],-1)),_("div",xe,[A(x,{ref_for:!0,ref:e=>at.value[n]=e},null,512)])])):g("",!0),At.value.emotionalBottomRadar?(p(),v("div",Se,t[6]||(t[6]=[_("img",{src:"/aixiaocaishen/static/images/L3-6a18856c.png",alt:"情绪推演图标"},null,-1)]))):g("",!0),At.value.emotionalBottomRadar?(p(),v("div",Te,[t[7]||(t[7]=_("div",{class:"bottom-radar-header"},[_("img",{src:"/aixiaocaishen/static/images/探底雷达-7ca9f208.png",alt:"探底雷达图表"}),_("span",{class:"bottom-radar-text"},"情绪探底雷达")],-1)),_("div",Ie,[A(S,{ref_for:!0,ref:e=>it.value[n]=e},null,512)])])):g("",!0),At.value.emoEnergyConverter?(p(),v("div",Pe,t[8]||(t[8]=[_("img",{src:"/aixiaocaishen/static/images/L4-62e261b3.png",alt:"情绪套利"},null,-1)]))):g("",!0),At.value.emoEnergyConverter?(p(),v("div",De,[t[9]||(t[9]=_("div",{class:"energy-converter-header"},[_("img",{src:"/aixiaocaishen/static/images/能量转化器-3a087b39.png",alt:"能量转化器图标"}),_("span",{class:"energy-converter-text"},"情绪能量转化器")],-1)),_("div",Le,[A(T,{ref_for:!0,ref:e=>ot.value[n]=e},null,512)])])):g("",!0),t[17]||(t[17]=w('
核心看点字样

情绪监控-金融宇宙的【量子检测网络】核心任务:构建全市场情绪引力场雷达,实时监测资金流向和情绪波动

情绪解码-主力思维的【神经破译矩阵】核心任务:解构资金行为的量子密码,破译主力操盘意图和策略布局

情绪推演-未来战争的【时空推演舱】核心任务:基于情绪数据推演未来走势,预测市场转折点和机会窗口

情绪套利-财富裂变的【粒子对撞机】核心任务:将情绪差转化为收益粒子流,实现情绪能量的价值转换

核心逻辑字样
树标题
',4)),_("div",{class:"scenario-application-section",ref_for:!0,ref_key:"scenarioApplicationRef",ref:_t},[t[16]||(t[16]=_("img",{src:"/aixiaocaishen/static/images/场景应用-d0ed55f3.png",alt:"场景应用标题"},null,-1)),_("div",Ee,[Ut(e)?(p(),v("div",Oe,[Qt(e)&&Qt(e).one||jt(e)&&!Nt(e)&&(jt(e).one1||jt(e).one2)?(p(),v("div",Ce,[t[10]||(t[10]=_("h4",{class:"conclusion-title"},"L1: 情绪监控",-1)),Nt(e)&&Nt(e).one1?(p(),v("p",Me,y(Nt(e).one1),1)):g("",!0),Nt(e)&&Nt(e).one2?(p(),v("p",He,y(Nt(e).one2),1)):g("",!0),!Nt(e)&&jt(e)&&jt(e).one1?(p(),v("p",Be,y(jt(e).one1),1)):g("",!0),!Nt(e)&&jt(e)&&jt(e).one2?(p(),v("p",Ve,y(jt(e).one2),1)):g("",!0)])):g("",!0),Qt(e)&&Qt(e).two||jt(e)&&!Nt(e)&&jt(e).two?(p(),v("div",Fe,[t[11]||(t[11]=_("h4",{class:"conclusion-title"},"L2: 情绪解码",-1)),Nt(e)&&Nt(e).two?(p(),v("p",Ge,y(Nt(e).two),1)):g("",!0),!Nt(e)&&jt(e)&&jt(e).two?(p(),v("p",Re,y(jt(e).two),1)):g("",!0)])):g("",!0),Qt(e)&&Qt(e).three||jt(e)&&!Nt(e)&&jt(e).three?(p(),v("div",We,[t[12]||(t[12]=_("h4",{class:"conclusion-title"},"L3: 情绪推演",-1)),Nt(e)&&Nt(e).three?(p(),v("p",qe,y(Nt(e).three),1)):g("",!0),!Nt(e)&&jt(e)&&jt(e).three?(p(),v("p",Xe,y(jt(e).three),1)):g("",!0)])):g("",!0),Qt(e)&&Qt(e).four||jt(e)&&!Nt(e)&&jt(e).four?(p(),v("div",je,[t[13]||(t[13]=_("h4",{class:"conclusion-title"},"L4: 情绪套利",-1)),Nt(e)&&Nt(e).four?(p(),v("p",Ne,y(Nt(e).four),1)):g("",!0),!Nt(e)&&jt(e)&&jt(e).four?(p(),v("p",Qe,y(jt(e).four),1)):g("",!0)])):g("",!0)])):g("",!0),!Ut(e)&&jt(e)?(p(),v("div",Ue,t[14]||(t[14]=[_("p",null,"请稍候...",-1)]))):g("",!0),jt(e)&&(jt(e).one1||jt(e).one2||jt(e).two||jt(e).three||jt(e).four)?g("",!0):(p(),v("div",Ze,t[15]||(t[15]=[_("p",null,"等待股票分析结论...",-1)])))]),Qt(e)&&Qt(e).disclaimer||jt(e)&&!Nt(e)?(p(),v("div",Ye,[Nt(e)&&Nt(e).disclaimer?(p(),v("p",ze,y(Nt(e).disclaimer),1)):g("",!0),!Nt(e)&&jt(e)?(p(),v("p",Je," 该内容由AI生成,请注意甄别 ")):g("",!0)])):g("",!0)],512)])])})),128)):g("",!0),Rt.value.length>0||st.value.length>0?(p(),v("div",{key:2,class:"back-to-top",onClick:vn},t[18]||(t[18]=[_("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M12 4L12 20M12 4L6 10M12 4L18 10",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):g("",!0)])],64))}},[["__scopeId","data-v-6bf18334"]]),$e=Object.freeze(Object.defineProperty({__proto__:null,default:Ke},Symbol.toStringTag,{value:"Module"}));export{Ke as A,F as a,M as b,$e as c,H as g,B as h,C as t,G as u,V as v};