Files
deepdata/my_ops/markitdown_parser/index_files/result_3080785_g4-m.js
沃巴蒂 ff22ed3a8b feat(deepdata): 引入修改密码、文件预览组件与清洗算子增强,deepflow 改名为 deep-flow
本次同步 09-12 至 09-28 的代码变更,主要内容:

新增功能
- 修改密码:后端新增 ChangePasswordRequest DTO 与UserController/UserService
  对应接口,前端新增 ChangePasswordDialog 并在 Header 接入入口
- 文件预览组件重构:file-preview 目录拆分出 VideoPreview(支持 blobUrl 直传)、
  ImagePreview、AudioPreview,index.tsx 统一调度各类型预览器
- 新增 my_ops 算子模块:markitdown_parser、mineru_pdf_parser、text_quality_evaluator
- 新增 tools/minio-file-server MinIO 文件服务

功能增强
- 数据清洗:cleaning_task_service/scheduler/routes 重构,
  data_juicer_executor 与 wrapper 增强,OperatorTable/LogsTable/TaskDetail 同步调整
- 数据标注:annotation sync.py、project.py 接口与schema 更新
- 数据采集、算子市场、首页与菜单路由相关页面调整
- DataJuicer 算子接入(useOperatorOperations、dj_ops_schema)

结构调整
- deepflow/ 更名为 deep-flow/(419 个文件重命名)
- 新增 helm 部署编排、GitHub Actions 之外的自建镜像构建脚本

未纳入本次提交
- scripts-backup/、runtime/python-executor-backup/、components_backup/(备份目录)
- *.backup*、__pycache__ 产物
- zh_core_web_sm-3.8.0-py3-none-any.whl(46MB 构建产物)
- DataX/(内嵌独立仓库,远程亦未收录其源码)
2026-10-03 22:44:56 +08:00

1 line
122 KiB
JavaScript

define("superman-san/app/message-center/result_3080785",["san","tslib","@searchfe/inject-js"],function(n,i,s){return a={0:function(e,t){e.exports=n},1:function(e,t){e.exports=i},2:function(e,t,n){t=function(){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function o(e){return typeof e}:function o(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=n(0).defineComponent;function r(e){if(null===e||e===undefined)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!==i&&i!==undefined)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}e.exports=function(e,t,n){for(var i=function(e){var t=[e];"function"==typeof e&&(t.push(e.prototype),e.prototype.constructor&&t.push(e.prototype.constructor.prototype));return t}(e),s=0;s<i.length;s++)t&&("string"==typeof t?i[s].template=t:t instanceof Array?i[s].aPack=t:i[s].aNode=t),n.length&&function(e,t){for(var n={},i=0;i<t.length;i++)r(n,t[i]);var s=e.initData;e.initData=s?function(){return r({},s.call(this),{$style:n})}:function(){return{$style:n}}}(i[s],n);return"object"===o(e)?a(e):e}}.apply(t,[]);t===undefined||(e.exports=t)},28:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TTS_ERROR_TEXT=t.VOICE_LIST_ORIGINAL=t.DEFAULT_TONE=t.TTS_TEXT=t.IS_TTS_SHIELD=t.STORAGE_KEY=t.TTS_LOG_CONFIG=t.TTS_API=t.FEED_LIST_OFFLINE_HOST=t.GLOBAL_EVENT=t.TTS_EVENT=void 0,t.TTS_EVENT={BTN_CLICK:"tts.btn.click",STATE_CHANGE:"tts.play.statechange",PLAYLIST_UPDATE:"tts.playlist.update",CLOSE:"tts.close",SWITCH_OPEN:"ttsswitch.open",SWITCH_CLOSE:"ttsswitch.close"},t.GLOBAL_EVENT={INDEX_OFF:"index_off",SWITCH_TAB:"switchTab",AGING_TOOLS_CLOSE:"aging-tools.close",CHAT_INPUT_FIRST_CLICK:"chatinput.firstclick"};var i,s,o,a,r="https://mbd.baidu.com";t.FEED_LIST_OFFLINE_HOST="http://m1-feed-170092326.m1.baidu.com:8059",t.TTS_API={GET_VOICE_LIST:r+"/newspage/api/getpcvoicelist",EDIT_VOICE_LIST:r+"/newspage/api/updateuservoice",REQUEST_URL:r+"/newspage/api/getttsurllist"},t.TTS_LOG_CONFIG={LOG_FROM:"feed_index",CLICK_TID:"11546",SHOW_TID:"11545",DURATION_TID:"11549"},t.STORAGE_KEY={TTS_SETTING:"set_result_tts",TTS_GUIDE_SHOWN:"tts_guide_shown"},t.IS_TTS_SHIELD=(i=navigator.userAgent,s=Boolean(i.match(/(iPad)/))||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints,o=/Android/i.test(i)&&!/Mobile/i.test(i),a=(/ArkWeb/i.test(i)||/OpenHarmony/i.test(i))&&/Tablet/i.test(i),r=/Tablet/i.test(i),r=s||o||a||r,!(!(i.includes("compatible")&&i.includes("MSIE")||i.includes("Trident")||document.documentMode)&&!r)),t.TTS_TEXT={SWITCH_OPEN:"已开启看听模式",SWITCH_CLOSE:"已退出看听模式",GUIDE_TOOLTIP:"点击顶部「设置」-「看听模式」按钮,开启听功能"},t.DEFAULT_TONE="4100",t.VOICE_LIST_ORIGINAL=[{displayName:"成熟女声",onlineId:"4100",displayIndex:"1",coverImg:"https://b.bdstatic.com/searchbox/icms/searchbox/img/cheng_girl.png",isSelected:!1,speakerId:"gezi"},{displayName:"成熟男声",onlineId:"4003",displayIndex:"2",coverImg:"https://b.bdstatic.com/searchbox/icms/searchbox/img/cheng_boy.png",isSelected:!1,speakerId:"duxiaoyao"},{displayName:"磁性男声",onlineId:"4106",displayIndex:"3",coverImg:"https://b.bdstatic.com/searchbox/icms/searchbox/img/ci_boy.png",isSelected:!1,speakerId:"wangyige"},{displayName:"年轻女声",onlineId:"4118",displayIndex:"4",coverImg:"https://b.bdstatic.com/searchbox/icms/searchbox/img/young_girl.png",isSelected:!1,speakerId:"duxiaolu"},{displayName:"情感男声",onlineId:"4115",displayIndex:"5",coverImg:"https://b.bdstatic.com/searchbox/icms/searchbox/img/young_boy.png",isSelected:!1,speakerId:"duxiaoxian"}],t.TTS_ERROR_TEXT={SDK_LOAD_FAIL:"播放器加载失败,请刷新页面重试",PLAYER_INIT_FAIL:"播放器初始化失败,请刷新页面重试",COMMON_ERROR:"网络异常,请你稍后再试",PLAY_ERROR:"播放出错,请稍后重试",PLAY_TIMEOUT:"加载超时,请稍后重试",UPDATE_VOICE_ERROR:"切换音色失败,请你稍后再试"}},357:function(e,t){e.exports=' <div class="message-center-container"> <div s-ref="message-center-icon" class="message-center-icon" on-mouseenter="handleMouseEnter" on-mouseleave="handleMouseLeave"> 通知 <div s-if="unreadCount > 0" class="message-unread-dot"></div> </div> </div> '},358:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,s=n(1),o=n(0),a=(0,s.__importStar)(n(836)),l=n(9),c=n(837),u="https://chat.baidu.com",n=n(5),n=(i=o.Component,(0,s.__extends)(r,i),r.prototype.initData=function(){return{unreadCount:0,token:"",hitRecommendSample:!1}},r.prototype.attached=function(){var r=this;this.ubc=(0,l.getUbcInstanceWithUbcid)(19057),this.observer=new IntersectionObserver(function(e){e.forEach(function(e){var t,n,i,s;e.isIntersecting?(r.sendUbcLog("show","notice_access"),t=function(){var e=+new Date,t=(null===(n=window.s_session)||void 0===n?void 0:n.qid)||"",n=r.data.get("token");return btoa(n+"||"+e+"|"+t)+"-"+t},r.asyncTaskService=new a.AsyncTaskService(u,t),r.asyncTaskService.init(),n=(s=function(e){var t=document.querySelector("."+e);if(t)return t;t=document.createElement("div");return t.className=e,document.querySelector("#head").appendChild(t),t})("message-panel-container-wrapper"),i=s("message-center-push-container"),e=s("message-center-settings-modal-container"),s=window.bds.comm.ishome,r.messageCenter=new a["default"]({baseUrl:u,enableRecommend:r.data.get("hitRecommendSample")&&s,showSettings:r.data.get("hitRecommendSample"),from:s?"home_page":"result_page",enableListPolling:!0,maxLimitMessages:100,maxLimitTime:2592e6,logContainer:document.body,messageCenterIcon:r.ref("message-center-icon"),messagePanelContainer:n,pushNotificationsContainer:i,settingsModalContainer:e,onMessageClick:function(e){r.onMessageClick(e)},onNotificationClick:function(e){window.focus(),r.onMessageClick(e,!0)},onUnreadCountUpdate:function(e){r.data.set("unreadCount",e)},getToken:t}),r.initMessageCenterTimer(),r.messageCenter.on("log",function(e){try{var t=e.type,n=e.logData,i=JSON.parse(null!=n?n:"{}"),s=i.value,o=i.ext;r.sendUbcLog(t,s,o)}catch(a){}})):(null!==(t=r.messageCenter)&&void 0!==t&&t.destroy(),null!==(t=r.asyncTaskService)&&void 0!==t&&t.dispose(),r.messageCenter=null,r.asyncTaskService=null)})},{threshold:.6}),this.observer.observe(this.el),this.onVisibilityChange=this.visibilityChange.bind(this),document.addEventListener("visibilitychange",this.onVisibilityChange),$(window).on(c.TOOLTIP_EVENT.SHOW,function(){var e;null!==(e=r.messageCenter)&&void 0!==e&&e.hidePanel(),null!==(e=r.messageCenter)&&void 0!==e&&e.stopPolling()}),$(window).on(c.TOOLTIP_EVENT.HIDE,function(){var e;null!==(e=r.messageCenter)&&void 0!==e&&e.startPolling()})},r.prototype.visibilityChange=function(){var e;"visible"===document.visibilityState?(null!==(e=this.messageCenter)&&void 0!==e&&e.startPolling(),null!==(e=this.messageCenter)&&void 0!==e&&e.startListPolling()):(null!==(e=this.messageCenter)&&void 0!==e&&e.stopPolling(),null!==(e=this.messageCenter)&&void 0!==e&&e.stopListPolling())},r.prototype.initMessageCenterTimer=function(){var e,t=this;!function(){try{var e=(new Date).toISOString().split("T")[0];return localStorage.getItem("INPUT_ANIME_LAST_SHOWN_DATE")!==e?!0:!1}catch(t){return!1}}()?!function(){try{var e=Number(localStorage.getItem("SUPERPAGE_VISITED_TIMES")),t=localStorage.getItem("INPUT_ANIME_LAST_SHOWN_DATE"),n=(new Date).toISOString().split("T")[0];return!e||t!==n}catch(i){return!1}}()?null!==(e=this.messageCenter)&&void 0!==e&&e.startPolling():setTimeout(function(){var e;null!==(e=t.messageCenter)&&void 0!==e&&e.startPolling()},3e3):setTimeout(function(){var e;null!==(e=t.messageCenter)&&void 0!==e&&e.startPolling()},5e3)},r.prototype.detached=function(){var e;this.observer.disconnect(),null!==(e=this.messageCenter)&&void 0!==e&&e.destroy(),this.onVisibilityChange&&(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)},r.prototype.onMessageClick=function(e,t){var n;e&&("sendPrompt"===(n=e.notifyInfo.action)?this.sendPrompt(e,t):"jump"===n&&this.jumpHistory(e))},r.prototype.sendPrompt=function(e,t){var n=e.notifyType,e=e.notifyInfo.query,n={enter_type:(t?"sysbrowser":"home")+"_notice_"+n,sa:(t?"sysbrowser":"home")+"_notice_"+n},n=u+"/search?word="+encodeURIComponent(e)+"&extParams="+encodeURIComponent(JSON.stringify(n));window.open(n,"_blank")},r.prototype.jumpHistory=function(e,t){var n=e.notifyType,i=e.notifyInfo,s=i.sessionId,o=i.qid,a=i.taskId,i=i.taskGroup,e={ori_lid:s,enter_type:(t?"sysbrowser":"home")+"_notice_"+n,subEnterType:"his_middle",messageCenterInfo:{query:null===(t=null==e?void 0:e.notifyInfo)||void 0===t?void 0:t.query,functionType:null===(t=null==e?void 0:e.notifyInfo)||void 0===t?void 0:t.subType,noticeType:n,noticeContent:null===(e=null==e?void 0:e.showData)||void 0===e?void 0:e.content,referenceQid:o}};this.asyncTaskService&&a&&this.asyncTaskService.updateTaskReadStatus({sessionId:s,qid:o,taskId:a,taskGroup:i});e=u+"/search?extParams="+encodeURIComponent(JSON.stringify(e));window.open(e,"_blank")},r.prototype.togglePanel=function(e){var t;e?null!==(t=this.messageCenter)&&void 0!==t&&t.showPanel():null!==(t=this.messageCenter)&&void 0!==t&&t.hidePanel()},r.prototype.handleMouseEnter=function(){this.togglePanel(!0)},r.prototype.handleMouseLeave=function(){this.togglePanel(!1)},r.prototype.sendUbcLog=function(e,t,n){void 0===n&&(n={});var i=this.ubc||(0,l.getUbcInstanceWithUbcid)(19057);"click"===e?null!=i&&i.sendClickLog(t,n):"show"===e?null!=i&&i.sendShowLog(t,n):null!=i&&i.sendLog(e,t,n)},(0,s.__decorate)([n.injectable],r));function r(e){e=i.call(this,e)||this;return e.ubc=null,e.asyncTaskService=null,e.onVisibilityChange=null,e}t["default"]=n},5:function(e,t){e.exports=s},54:function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.sendDistributeLog=i.sendListenBtnShowLog=i.sendListenBtnClickLog=i.sendTooltipLog=i.LOG_TYPE=i.UBC_ID=void 0;var s=t(9),o="bdpcfeed";i.UBC_ID={TOOLTIP:20160,LISTEN_BTN_CLICK:20161,LISTEN_BTN_SHOW:20162,DISTRIBUTE:6518},(t=i.LOG_TYPE||(i.LOG_TYPE={})).SHOW="show",t.CLICK="click",t.STATUS="status",t.TTSCLK="ttsclk",t.TTSAUTO="ttsauto";var a=null,r=null,l=null,c=null;i.sendTooltipLog=function(e){var t=e.type,n=e.value,e=e.ext,e=void 0===e?{}:e;return null===(a=a||(0,s.getUbcInstanceWithUbcid)(i.UBC_ID.TOOLTIP,o,"tool","home"))||void 0===a?void 0:a.sendLog(t,n,e)};i.sendListenBtnClickLog=function(e){var t=e.type,n=e.value,e=e.ext,e=void 0===e?{}:e;return null===(r=r||(0,s.getUbcInstanceWithUbcid)(i.UBC_ID.LISTEN_BTN_CLICK,o,"feed","home"))||void 0===r?void 0:r.sendLog(t,n,e)};i.sendListenBtnShowLog=function(e){var t=e.type,n=e.value,e=e.ext,e=void 0===e?{}:e;return null===(l=l||(0,s.getUbcInstanceWithUbcid)(i.UBC_ID.LISTEN_BTN_SHOW,o,"feed","home"))||void 0===l?void 0:l.sendLog(t,n,e)};i.sendDistributeLog=function(e){var t=e.type,n=e.value,e=e.ext,e=void 0===e?{}:e;return null===(c=c||(0,s.getUbcInstanceWithUbcid)(i.UBC_ID.DISTRIBUTE,o,"feed_pc","list"))||void 0===c?void 0:c.sendLog(t,n,e)}},833:function(e,t,n){e.exports=n(834)},834:function(e,t,n){var i=n(2);n(835);var s=n(357),o=n(358)["default"];e.exports=n(358),e.exports["default"]=i(o,s,[])},835:function(e,t,n){"use strict";n.r(t)},836:function(t,n,i){var s,o,a;o=[],(a=function(){"use strict";function Me(){return(Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,i=arguments[t];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Ne(e){return(Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function Ne(e){return typeof e}:function Ne(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var e;e=function(e,t){function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function l(e,t,n,i,s,o,a){try{var r=e[o](a),l=r.value}catch(e){return n(e),0}r.done?t(l):Promise.resolve(l).then(i,s)}function r(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var i=r.apply(e,a);function s(e){l(i,t,n,s,o,"next",e)}function o(e){l(i,t,n,s,o,"throw",e)}s(void 0)})}}function n(e,t,n){return t=u(t),function(e,t){if(t&&("object"==Ne(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,v(i.key),i)}}function o(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function d(){return!!e})()}function h(){var p,m,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function i(e,t,n,i){var s,o,a,r,l,c,u,g,d,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return y(t,"_invoke",(s=e,o=n,u=i||[],g=!1,d={p:c=0,n:0,v:p,a:h,f:h.bind(p,4),d:function h(e,t){return a=e,r=0,l=p,d.n=t,f}},function(e,t,n){if(1<c)throw TypeError("Generator is already running");for(g&&1===t&&h(t,n),r=t,l=n;(m=r<2?p:l)||!g;){a||(r?r<3?(1<r&&(d.n=-1),h(r,l)):d.n=l:d.v=l);try{if(c=2,a){if(m=a[e=!r?"next":e]){if(!(m=m.call(a,l)))throw TypeError("iterator result is not an object");if(!m.done)return m;l=m.value,r<2&&(r=0)}else 1===r&&(m=a["return"])&&m.call(a),r<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),r=1);a=p}else if((m=(g=d.n<0)?l:s.call(o,d))!==f)break}catch(m){a=p,r=1,l=m}finally{c=1}}return{value:m,done:g}}),!0),t;function h(e,t){for(r=e,l=t,m=0;!g&&c&&!n&&m<u.length;m++){var n,i=u[m],s=d.p,o=i[2];3<e?(n=o===t)&&(l=i[(r=i[4])?5:r=3],i[4]=i[5]=p):i[0]<=s&&((n=e<2&&s<i[1])?(r=0,d.v=t,d.n=i[1]):s<o&&(n=e<3||i[0]>t||o<t)&&(i[4]=e,i[5]=t,d.n=o,r=0))}if(n||1<e)return f;throw g=!0,t}}var f={};function v(){}function s(){}function o(){}m=Object.getPrototypeOf;var e=[][t]?m(m([][t]())):(y(m={},t,function(){return this}),m),a=o.prototype=v.prototype=Object.create(e);function r(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,y(e,n,"GeneratorFunction")),e.prototype=Object.create(a),e}return y(a,"constructor",s.prototype=o),y(o,"constructor",s),y(o,n,s.displayName="GeneratorFunction"),y(a),y(a,n,"Generator"),y(a,t,function(){return this}),y(a,"toString",function(){return"[object Generator]"}),(h=function h(){return{w:i,m:r}})()}function y(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(y=function(e,t,n,i){function s(t,n){y(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(s("next",0),s("throw",1),s("return",2))})(e,t,n,i)}function p(e,t){return(p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(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 i,s,o,a,r=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(r.push(i.value),r.length!==t);l=!0);}catch(e){c=!0,s=e}finally{try{if(!l&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(c)throw s}}return r}}(e,t)||k(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 f(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}()||k(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 v(e){e=function(e){if("object"!=Ne(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!=Ne(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e);return"symbol"==Ne(e)?e:e+""}function b(e){return(b="function"==typeof Symbol&&"symbol"==Ne(Symbol.iterator)?function(e){return Ne(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":Ne(e)})(e)}function k(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}var w,T,P,S,x,I,E,C,L,M,N,O,_,U,D,R="/aichat/api/messages/list",A="/aichat/api/messages/update",j="messageCenter_notificationEnabled",H="messageCenter_recommendNotificationEnabled",G=o(function O(e,t,n,i){a(this,O),this.unreadCount=0,this.getToken=null,this.from=null,this.getFromHandler=null,this.onNewMessage=null,this.onMessageRead=null,this.baseUrl=e.replace(/\/$/,""),this.getToken=t||null,this.from=n||"",this.getFromHandler=i||null},[{key:"getFrom",value:function(){var e;return(null===(e=this.getFromHandler)||void 0===e?void 0:e.call(this))||this.from||""}},{key:"setOnNewMessage",value:function(e){this.onNewMessage=e}},{key:"setOnMessageRead",value:function(e){this.onMessageRead=e}},{key:"getUnreadCount",value:function(){return this.unreadCount}},{key:"addIncrementalMessages",value:function(e){var t=this;!Array.isArray(e)||0===e.length||0<(e=e.filter(function(e){return!e.read})).length&&(this.unreadCount+=e.length,this.onNewMessage&&e.forEach(function(e){t.onNewMessage(e)}))}},{key:"addMessage",value:function(e){var t,e={id:e.id||"msg_".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,11)),read:void 0!==e.read&&e.read,notifyType:e.notifyType,notifyInfo:e.notifyInfo,priority:e.priority,showData:{title:null===(t=e.showData)||void 0===t?void 0:t.title,content:null===(t=e.showData)||void 0===t?void 0:t.content,text:null===(t=e.showData)||void 0===t?void 0:t.text,icon:null===(t=e.showData)||void 0===t?void 0:t.icon,createTime:(null===(e=e.showData)||void 0===e?void 0:e.createTime)||Date.now()}};return e.read||(this.unreadCount++,this.onNewMessage&&this.onNewMessage(e)),e}},{key:"removeMessage",value:(U=r(h().m(function O(t){var n,i=arguments;return h().w(function(e){for(;;)if(0===e.n)return n=1<i.length&&void 0!==i[1]&&i[1],e.a(2,this.deleteMessages([t],n))},O,this)})),function(e){return U.apply(this,arguments)})},{key:"deleteMessages",value:(_=r(h().m(function O(t){var n,i,s,o,a,r,l=arguments;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=1<l.length&&void 0!==l[1]&&l[1],t&&0!==t.length){e.n=1;break}return e.a(2,!1);case 1:return e.p=1,s="",this.getToken&&(i=this.getToken())&&(s=i),o=new URLSearchParams,s&&o.append("tk",s),(s=this.getFrom())&&o.append("from",s),o=o.toString(),o="".concat(this.baseUrl).concat(A).concat(o?"?"+o:""),e.n=2,fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({operation:n?"click":"delete",range:"part",messageIds:t})});case 2:if((a=e.v).ok){e.n=3;break}return e.a(2,!1);case 3:return e.n=4,a.json();case 4:if((r=e.v)&&0===r.status)return--this.unreadCount,e.a(2,!0);e.n=5;break;case 5:e.n=7;break;case 6:e.p=6,r=e.v,console.error("删除消息失败:",r);case 7:return e.a(2,!1)}},O,this,[[1,6]])})),function(e){return _.apply(this,arguments)})},{key:"clearMessages",value:(O=r(h().m(function O(){var t,n,i,s,o;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,n="",this.getToken&&(t=this.getToken())&&(n=t),i=new URLSearchParams,n&&i.append("tk",n),(n=this.getFrom())&&i.append("from",n),i=i.toString(),i="".concat(this.baseUrl).concat(A).concat(i?"?"+i:""),e.n=1,fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({operation:"delete",range:"all"})});case 1:if((s=e.v).ok){e.n=2;break}return e.a(2,!1);case 2:return e.n=3,s.json();case 3:if((o=e.v)&&0===o.status)return this.unreadCount=0,e.a(2,!0);e.n=4;break;case 4:e.n=6;break;case 5:e.p=5,o=e.v,console.error("清空消息失败:",o);case 6:return e.a(2,!1)}},O,this,[[0,5]])})),function(){return O.apply(this,arguments)})},{key:"setUnreadCount",value:function(e){this.unreadCount=e}},{key:"incrementUnreadCount",value:function(e){0<e&&(this.unreadCount+=e)}},{key:"updateUnreadCountDynamically",value:function(e){0<=e&&(this.unreadCount=e)}}]),F=o(function T(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:20,i=3<arguments.length?arguments[3]:void 0,s=4<arguments.length?arguments[4]:void 0,o=5<arguments.length?arguments[5]:void 0;a(this,T),this.pollingIntervals=new Map,this.pollingStates=new Map,this.getToken=null,this.from=null,this.getFromHandler=null,this.onMessagesUpdate=null,this.onError=null,this.onCheckHasPushNotification=null,this.pageSize=20,this.currentPage=1,this.hasMorePages=!0,this.isLoadingMore=!1,this.listPollingTimer=null,this.isListPolling=!1,this.listPollingInterval=5e3,this.isListPollingRequestInProgress=!1,this.listPollingMaxTimer=null,this.listPollingMaxDuration=null,this.listPollingDegraded=!1,this.onUnreadCountUpdate=null,this.onRiskListUpdate=null,this.baseUrl=e.replace(/\/$/,""),this.pageSize=n,this.getToken=i||null,this.from=s||"",this.getFromHandler=o||null,"number"==typeof t?(this.pollingIntervals.set("recTask",t),this.pollingIntervals.set("asyncTask",t)):t&&"object"===b(t)?(o=t["default"]||5e3,this.pollingIntervals.set("recTask",t.recTask||o),this.pollingIntervals.set("asyncTask",t.asyncTask||o)):(this.pollingIntervals.set("recTask",5e3),this.pollingIntervals.set("asyncTask",5e3)),this.pollingStates.set("recTask",{pollingTimer:null,maxPollingTimer:null,maxPollingDuration:null,isPolling:!1,isPollingRequestInProgress:!1,lastTimeStamp:0}),this.pollingStates.set("asyncTask",{pollingTimer:null,maxPollingTimer:null,maxPollingDuration:null,isPolling:!1,isPollingRequestInProgress:!1,lastTimeStamp:0})},[{key:"getFrom",value:function(){var e;return(null===(e=this.getFromHandler)||void 0===e?void 0:e.call(this))||this.from||""}},{key:"getPollingState",value:function(e){var t=this.pollingStates.get(e);if(!t)throw new Error("Unknown notify type: ".concat(e));return t}},{key:"getPollingInterval",value:function(e){return e}},{key:"getPollingIntervalByType",value:function(e){return this.pollingIntervals.get(e)||5e3}},{key:"secondsToMilliseconds",value:function(e){e="string"==typeof e?parseFloat(e):e;return isNaN(e)||e<=0?5e3:Math.round(1e3*e)}},{key:"updateListPollingInterval",value:function(e){var t=this.listPollingInterval;this.listPollingInterval=e,this.isListPolling&&t!==e&&(this.listPollingTimer&&(clearTimeout(this.listPollingTimer),this.listPollingTimer=null),this.isListPolling=!0,this.scheduleNextListPoll())}},{key:"fetchAndUpdatePollingConfig",value:(N=r(h().m(function T(){var t,n,i;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.fetchPollingConfig();case 1:if(!(n=e.v)||0!==n.status){e.n=3;break}if(Array.isArray(n.data)||!0!==(null===(t=n.data)||void 0===t?void 0:t.degrade)){e.n=2;break}return this.stopPolling(),this.stopListPolling(),e.a(2);case 2:i=(null==n?void 0:n.data)||[],this.updatePollingConfigs(i);case 3:e.n=5;break;case 4:e.p=4,i=e.v,console.warn("获取轮询配置失败:",i);case 5:return e.a(2)}},T,this,[[0,4]])})),function(){return N.apply(this,arguments)})},{key:"fetchPollingConfig",value:(M=r(h().m(function T(){var t,n,i,s,o;return h().w(function(e){for(;;)switch(e.n){case 0:return s="".concat(this.baseUrl).concat("/aichat/api/messages/conf"),i=new URLSearchParams,n="",(n=this.getToken&&(t=this.getToken())?t:n)&&i.append("tk",n),(n=this.getFrom())&&i.append("from",n),i=i.toString(),s=i?"".concat(s,"?").concat(i):s,e.n=1,fetch(s,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});case 1:if((o=e.v).ok){e.n=2;break}throw new Error("HTTP error! status: ".concat(o.status));case 2:return e.n=3,o.json();case 3:return e.a(2,e.v)}},T,this)})),function(){return M.apply(this,arguments)})},{key:"updatePollingConfigs",value:function(e){var o=this;Array.isArray(e)&&0!==e.length&&e.forEach(function(e){var t,n,i,s=o.secondsToMilliseconds(e.avgCost);"list"===e.pollingType?(o.updateListPollingInterval(s),e.maxPollingCost&&o.handleMaxPollingCost("list",e.maxPollingCost)):"query"===e.pollingType&&e.messageType&&(t=null,"async"===e.messageType?t="asyncTask":"recommend"===e.messageType&&(t="recTask"),t&&(n=o.pollingIntervals.get(t),o.pollingIntervals.set(t,s),(i=o.getPollingState(t)).isPolling&&n!==s&&(i.pollingTimer&&(clearTimeout(i.pollingTimer),i.pollingTimer=null),i.isPolling=!0,o.scheduleNextPoll(t)),e.maxPollingCost&&o.handleMaxPollingCost(t,e.maxPollingCost)))})}},{key:"setOnMessagesUpdate",value:function(e){this.onMessagesUpdate=e}},{key:"setOnError",value:function(e){this.onError=e}},{key:"setOnCheckHasPushNotification",value:function(e){this.onCheckHasPushNotification=e}},{key:"handleError",value:function(e){this.onError?this.onError(e):console.error("消息轮询失败:",e)}},{key:"startPolling",value:function(e){var t;e?(t=this.getPollingState(e)).isPolling||(t.isPolling=!0,this.scheduleNextPoll(e),t.maxPollingDuration&&this.restartMaxPollingTimer(e,t.maxPollingDuration)):(this.startPolling("recTask"),this.startPolling("asyncTask"))}},{key:"stopPolling",value:function(e){e?((e=this.getPollingState(e)).pollingTimer&&(clearTimeout(e.pollingTimer),e.pollingTimer=null),e.isPolling=!1):(this.stopPolling("recTask"),this.stopPolling("asyncTask"))}},{key:"pollOnce",value:function(e){return e?this.pollMessages(e):Promise.all([this.pollMessages("recTask"),this.pollMessages("asyncTask")]).then(function(){})}},{key:"loadFullMessages",value:(L=r(h().m(function T(){var t,n,i;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,this.currentPage=1,this.hasMorePages=!0,e.n=1,this.fetchFullMessages(1,this.pageSize);case 1:if(!(n=e.v)||0!==n.status){e.n=3;break}if(!0===(null===(t=n.data)||void 0===t?void 0:t.degrade))return this.stopPolling(),this.stopListPolling(),e.a(2);e.n=2;break;case 2:0===(i=(null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.messages)||[]).length?this.hasMorePages=!1:this.hasMorePages=i.length>=this.pageSize,this.onMessagesUpdate&&this.onMessagesUpdate(i,!0,!1),this.getPollingState("recTask").lastTimeStamp=Date.now(),this.getPollingState("asyncTask").lastTimeStamp=Date.now();case 3:e.n=5;break;case 4:throw e.p=4,(i=e.v)instanceof Error?i:new Error(String(i));case 5:return e.a(2)}},T,this,[[0,4]])})),function(){return L.apply(this,arguments)})},{key:"pollMessages",value:(C=r(h().m(function T(t){var n,i,s,o,a,r,l;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if((i=this.getPollingState(t)).isPollingRequestInProgress)return e.a(2);e.n=1;break;case 1:return i.isPollingRequestInProgress=!0,e.p=2,e.n=3,this.checkNewMessages(t,i.lastTimeStamp);case 3:if(!(s=e.v)||0!==s.status){e.n=7;break}if(!0===(null===(n=s.data)||void 0===n?void 0:n.degrade))return this.stopPolling(t),e.a(2);e.n=4;break;case 4:if(r=(null==s?void 0:s.data)||{},o=r.messages,"recTask"!==t){e.n=6;break}if("-"===(a=r.nextPolling))return this.stopPolling("recTask"),i.lastTimeStamp=Date.now(),o&&Array.isArray(o)&&0<o.length&&this.onMessagesUpdate&&this.onMessagesUpdate(o,!1),e.a(2);e.n=5;break;case 5:null!=a&&""!==a&&(r="number"==typeof a?a:Number(a),Number.isNaN(r)||(l=r-Date.now(),l=Math.max(2e4,l),this.pollingIntervals.set("recTask",l)));case 6:o&&Array.isArray(o)&&0<o.length&&this.onMessagesUpdate&&this.onMessagesUpdate(o,!1),i.lastTimeStamp=Date.now();case 7:e.n=9;break;case 8:e.p=8,l=e.v,this.handleError(l instanceof Error?l:new Error(String(l)));case 9:return e.p=9,i.isPollingRequestInProgress=!1,e.f(9);case 10:return e.a(2)}},T,this,[[2,8,9,10]])})),function(e){return C.apply(this,arguments)})},{key:"fetchFullMessages",value:(E=r(h().m(function T(t,n){var i,s,o,a,r,l;return h().w(function(e){for(;;)switch(e.n){case 0:return r="".concat(this.baseUrl).concat(R),a=new URLSearchParams,o="",this.getToken&&(i=this.getToken())&&(o=i),s={},void 0!==t&&void 0!==n&&(s.page=t,s.pageSize=n),o&&a.append("tk",o),(o=this.getFrom())&&a.append("from",o),a=a.toString(),r=a?"".concat(r,"?").concat(a):r,e.n=1,fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(s)});case 1:if((l=e.v).ok){e.n=2;break}throw new Error("HTTP error! status: ".concat(l.status));case 2:return e.n=3,l.json();case 3:return e.a(2,e.v)}},T,this)})),function(e,t){return E.apply(this,arguments)})},{key:"fetchUnreadCount",value:(I=r(h().m(function T(){var t,n,i,s,o;return h().w(function(e){for(;;)switch(e.n){case 0:return o="".concat(this.baseUrl).concat(R),i=new URLSearchParams,n="",this.getToken&&(t=this.getToken())&&(n=t),i.append("countOnly","1"),n&&i.append("tk",n),(n=this.getFrom())&&i.append("from",n),(n={}).page=1,n.pageSize=20,i=i.toString(),o=i?"".concat(o,"?").concat(i):o,e.n=1,fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),credentials:"include"});case 1:if((s=e.v).ok){e.n=2;break}throw new Error("HTTP error! status: ".concat(s.status));case 2:return e.n=3,s.json();case 3:return(o=e.v)&&0===o.status&&!0===(null===(n=o.data)||void 0===n?void 0:n.degrade)&&(this.listPollingDegraded=!0,this.stopListPolling()),e.a(2,o)}},T,this)})),function(){return I.apply(this,arguments)})},{key:"checkNewMessages",value:(x=r(h().m(function T(t,n){var i,s,o,a,r;return h().w(function(e){for(;;)switch(e.n){case 0:return a="".concat(this.baseUrl).concat("/aichat/api/messages/query"),o=new URLSearchParams,s="",this.getToken&&(i=this.getToken())&&(s=i),o.append("notifyType",t),0<n&&o.append("lastTimeStamp",String(n)),s&&o.append("tk",s),(s=this.getFrom())&&o.append("from",s),o=o.toString(),a=o?"".concat(a,"?").concat(o):a,e.n=1,fetch(a,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});case 1:if((r=e.v).ok){e.n=2;break}throw new Error("HTTP error! status: ".concat(r.status));case 2:return e.n=3,r.json();case 3:return e.a(2,e.v)}},T,this)})),function(e,t){return x.apply(this,arguments)})},{key:"reloadFullMessages",value:(S=r(h().m(function T(){return h().w(function(e){for(;;)switch(e.n){case 0:return this.currentPage=1,this.hasMorePages=!0,e.n=1,this.loadFullMessages();case 1:return e.a(2)}},T,this)})),function(){return S.apply(this,arguments)})},{key:"loadMoreMessages",value:(P=r(h().m(function T(){var t,n,i,s;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.hasMorePages||this.isLoadingMore)return e.a(2,!1);e.n=1;break;case 1:return this.isLoadingMore=!0,e.p=2,t=this.currentPage+1,e.n=3,this.fetchFullMessages(t,this.pageSize);case 3:if(!(n=e.v)||0!==n.status){e.n=5;break}if(0===(i=(null===(s=null==n?void 0:n.data)||void 0===s?void 0:s.messages)||[]).length)return this.hasMorePages=!1,e.a(2,!1);e.n=4;break;case 4:return this.currentPage=t,this.hasMorePages=i.length>=this.pageSize,this.onMessagesUpdate&&this.onMessagesUpdate(i,!1,!0),e.a(2,this.hasMorePages);case 5:return e.a(2,!1);case 6:return e.p=6,s=e.v,this.handleError(s instanceof Error?s:new Error(String(s))),e.a(2,!1);case 7:return e.p=7,this.isLoadingMore=!1,e.f(7);case 8:return e.a(2)}},T,this,[[2,6,7,8]])})),function(){return P.apply(this,arguments)})},{key:"getHasMorePages",value:function(){return this.hasMorePages}},{key:"getIsLoadingMore",value:function(){return this.isLoadingMore}},{key:"getIsPolling",value:function(e){return e?this.getPollingState(e).isPolling:this.getPollingState("recTask").isPolling||this.getPollingState("asyncTask").isPolling}},{key:"getIsPollingRequestInProgress",value:function(e){return e?this.getPollingState(e).isPollingRequestInProgress:this.getPollingState("recTask").isPollingRequestInProgress||this.getPollingState("asyncTask").isPollingRequestInProgress}},{key:"handleMaxPollingCost",value:function(e,t){t=this.secondsToMilliseconds(t);"list"===e?(this.listPollingMaxDuration=t,this.restartListPollingMaxTimer(t)):(this.getPollingState(e).maxPollingDuration=t,this.restartMaxPollingTimer(e,t))}},{key:"restartMaxPollingTimer",value:function(e,t){var n=this,i=this.getPollingState(e);i.maxPollingTimer&&(clearTimeout(i.maxPollingTimer),i.maxPollingTimer=null),i.maxPollingTimer=setTimeout(function(){i.isPolling&&n.stopPolling(e)},t)}},{key:"startListPolling",value:function(e){this.listPollingDegraded||this.isListPolling||(void 0!==e&&(this.listPollingInterval=e),this.isListPolling=!0,this.scheduleNextListPoll(),this.listPollingMaxDuration&&this.restartListPollingMaxTimer(this.listPollingMaxDuration))}},{key:"stopListPolling",value:function(){this.listPollingTimer&&(clearTimeout(this.listPollingTimer),this.listPollingTimer=null),this.isListPolling=!1,this.listPollingMaxTimer&&(clearTimeout(this.listPollingMaxTimer),this.listPollingMaxTimer=null)}},{key:"setOnUnreadCountUpdate",value:function(e){this.onUnreadCountUpdate=e}},{key:"setOnRiskListUpdate",value:function(e){this.onRiskListUpdate=e}},{key:"scheduleNextListPoll",value:function(){var e=this;this.isListPolling&&(this.listPollingTimer=setTimeout(function(){e.listPollingTimer=null,e.pollListMessages()["finally"](function(){e.isListPolling&&e.scheduleNextListPoll()})},this.listPollingInterval))}},{key:"scheduleNextPoll",value:function(e){var t,n=this,i=this.getPollingState(e);i.isPolling&&(t=this.pollingIntervals.get(e)||5e3,i.pollingTimer=setTimeout(function(){i.pollingTimer=null,n.pollMessages(e)["finally"](function(){i.isPolling&&n.scheduleNextPoll(e)})},t))}},{key:"getIsListPolling",value:function(){return this.isListPolling}},{key:"restartListPollingMaxTimer",value:function(e){var t=this;this.listPollingMaxTimer&&(clearTimeout(this.listPollingMaxTimer),this.listPollingMaxTimer=null),this.listPollingMaxTimer=setTimeout(function(){t.isListPolling&&t.stopListPolling()},e)}},{key:"pollListMessages",value:(T=r(h().m(function T(){var t,n,i;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.isListPollingRequestInProgress)return e.a(2);e.n=1;break;case 1:return this.isListPollingRequestInProgress=!0,e.p=2,e.n=3,this.fetchUnreadCount();case 3:if(!(n=e.v)||0!==n.status){e.n=5;break}if(!0===(null===(t=n.data)||void 0===t?void 0:t.degrade))return this.stopListPolling(),e.a(2);e.n=4;break;case 4:this.onUnreadCountUpdate&&this.onUnreadCountUpdate(null===(i=n.data)||void 0===i?void 0:i.count),i=null===(i=n.data)||void 0===i?void 0:i.riskList,this.onRiskListUpdate&&Array.isArray(i)&&0<i.length&&this.onRiskListUpdate(i);case 5:e.n=7;break;case 6:e.p=6,i=e.v,this.handleError(i instanceof Error?i:new Error(String(i)));case 7:return e.p=7,this.isListPollingRequestInProgress=!1,e.f(7);case 8:return e.a(2)}},T,this,[[2,6,7,8]])})),function(){return T.apply(this,arguments)})},{key:"destroy",value:function(){this.stopPolling(),this.stopListPolling(),this.pollingStates.forEach(function(e){e.maxPollingTimer&&(clearTimeout(e.maxPollingTimer),e.maxPollingTimer=null)}),this.pollingStates.clear(),this.pollingIntervals.clear(),this.onMessagesUpdate=null,this.onError=null,this.onCheckHasPushNotification=null,this.onUnreadCountUpdate=null,this.onRiskListUpdate=null}}]);(D=D=D||{}).PERSONALIZED_RECOMMENDATION="personalized_recommendation",D.ASYNC_TASK="async_task",(ee=ee=ee||{}).SEND_PROMPT="sendPrompt",ee.JUMP="jump",(ee=w=w||{}).GRANTED="granted",ee.DENIED="denied",ee.DEFAULT="default",ee.UNSUPPORTED="unsupported";var B,q,V,z,W,Y=o(function B(){a(this,B),this.enabled=!0,this.supportInfo=null,this.defaultIcon="https://gips0.baidu.com/it/u=1125504705,2263448440&fm=3028&app=3028&f=PNG&fmt=auto&q=75&size=f72_72",this.onNotificationClick=null,this.detectSupport()},[{key:"detectSupport",value:function(){if("undefined"!=typeof window&&"Notification"in window){var e=Notification.permission,e="granted"===e?w.GRANTED:"denied"===e?w.DENIED:w.DEFAULT;this.supportInfo={supported:!0,api:"standard",permission:e}}else{if("undefined"!=typeof window&&"webkitNotifications"in window){e=window.webkitNotifications;if(e&&"function"==typeof e.checkPermission){e=e.checkPermission();return void(this.supportInfo={supported:0===e,api:"webkit",permission:0===e?w.GRANTED:1===e?w.DEFAULT:w.DENIED})}}this.supportInfo={supported:!1,api:"none",permission:w.UNSUPPORTED}}}},{key:"isSecureContext",value:function(){return"undefined"!=typeof window&&("https:"===window.location.protocol||"localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||"[::1]"===window.location.hostname)}},{key:"setEnabled",value:function(e){this.enabled=e}},{key:"getEnabled",value:function(){return this.enabled}},{key:"setDefaultIcon",value:function(e){this.defaultIcon=e}},{key:"setOnNotificationClick",value:function(e){this.onNotificationClick=e}},{key:"showStandardNotification",value:(W=r(h().m(function B(t){var n,i,s,o=this;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if("Notification"in window){e.n=1;break}throw new Error("标准 Notification API 不可用");case 1:if(this.isSecureContext()){e.n=2;break}return console.warn("通知需要在 HTTPS 或 localhost 环境下使用"),e.a(2);case 2:if("granted"!==Notification.permission)return e.a(2);e.n=3;break;case 3:e.p=3,s={body:(null===(s=t.showData)||void 0===s?void 0:s.content)||(null===(n=t.showData)||void 0===n?void 0:n.text)||"",icon:null!==(n=null===(s=t.showData)||void 0===s?void 0:s.icon)&&void 0!==n?n:this.defaultIcon,tag:t.id},"badge"in Notification.prototype&&(s.badge=this.defaultIcon),s.requireInteraction=!1,s.silent=!1,n=(null===(n=t.showData)||void 0===n?void 0:n.title)||"新消息",(i=new Notification(n,s)).onclick=function(){o.onNotificationClick?o.onNotificationClick(t):window.focus(),i.close()},i.onerror=function(e){console.error("通知显示错误:",e)},setTimeout(i.close,5e3),e.n=5;break;case 4:throw e.p=4,s=e.v,console.error("创建系统通知失败:",s),s;case 5:return e.a(2)}},B,this,[[3,4]])})),function(e){return W.apply(this,arguments)})},{key:"showWebkitNotification",value:(z=r(h().m(function B(t){var n,i;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=window.webkitNotifications){e.n=1;break}throw new Error("webkitNotifications API 不可用");case 1:if(e.p=1,0!==n.checkPermission())return e.a(2);e.n=2;break;case 2:return e.n=3,this.createWebkitNotification(t,n);case 3:e.n=5;break;case 4:throw e.p=4,i=e.v,console.error("创建 webkit 通知失败:",i),i;case 5:return e.a(2)}},B,this,[[1,4]])})),function(e){return z.apply(this,arguments)})},{key:"createWebkitNotification",value:(V=r(h().m(function B(t,n){var i,s,o,a,r=this;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:e.p=0,s=(null===(i=t.showData)||void 0===i?void 0:i.title)||"新消息",(o=n.createNotification((null===(i=t.showData)||void 0===i?void 0:i.icon)||this.defaultIcon,s,(null===(s=t.showData)||void 0===s?void 0:s.content)||(null===(a=t.showData)||void 0===a?void 0:a.text)||"")).show(),o.onclick=function(){if(r.onNotificationClick)try{r.onNotificationClick(t)}catch(e){console.error("通知点击回调执行失败:",e)}else window.focus();o.cancel()},setTimeout(function(){try{o.cancel()}catch(e){}},5e3),e.n=2;break;case 1:throw e.p=1,a=e.v,console.error("创建 webkit 通知失败:",a),a;case 2:return e.a(2)}},B,this,[[0,1]])})),function(e,t){return V.apply(this,arguments)})},{key:"showSystemNotification",value:(q=r(h().m(function B(t){var n;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.enabled){e.n=1;break}return e.a(2);case 1:if(this.detectSupport(),this.supportInfo&&this.supportInfo.supported){e.n=2;break}return e.a(2);case 2:if(e.p=2,"standard"===this.supportInfo.api)return e.n=3,this.showStandardNotification(t);e.n=4;break;case 3:e.n=5;break;case 4:if("webkit"===this.supportInfo.api)return e.n=5,this.showWebkitNotification(t);e.n=5;break;case 5:e.n=7;break;case 6:e.p=6,n=e.v,console.error("显示系统通知失败:",n);case 7:return e.a(2)}},B,this,[[2,6]])})),function(e){return q.apply(this,arguments)})},{key:"checkPermission",value:function(){return this.detectSupport(),this.supportInfo?this.supportInfo.permission:w.UNSUPPORTED}},{key:"requestPermission",value:(B=r(h().m(function B(){var t,n,i;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this.detectSupport(),this.supportInfo&&this.supportInfo.supported){e.n=1;break}return e.a(2,w.UNSUPPORTED);case 1:if("standard"!==this.supportInfo.api){e.n=8;break}if("Notification"in window){e.n=2;break}return e.a(2,w.UNSUPPORTED);case 2:if("granted"===Notification.permission)return e.a(2,w.GRANTED);e.n=3;break;case 3:return e.p=3,e.n=4,Notification.requestPermission();case 4:if("granted"===(t=e.v))return e.a(2,w.GRANTED);e.n=5;break;case 5:if("denied"===t)return e.a(2,w.DENIED);e.n=6;break;case 6:return e.a(2,w.DEFAULT);case 7:return e.p=7,i=e.v,console.error("请求通知权限失败:",i),e.a(2,w.DENIED);case 8:if("webkit"!==this.supportInfo.api){e.n=11;break}if(n=window.webkitNotifications){e.n=9;break}return e.a(2,w.UNSUPPORTED);case 9:if(0===n.checkPermission())return e.a(2,w.GRANTED);e.n=10;break;case 10:return e.a(2,new Promise(function(t){n.requestPermission(function(e){t(0===e?w.GRANTED:1===e?w.DEFAULT:w.DENIED)})}));case 11:return e.a(2,w.UNSUPPORTED)}},B,this,[[3,7]])})),function(){return B.apply(this,arguments)})},{key:"isSupported",value:function(){var e;return this.detectSupport(),(null===(e=this.supportInfo)||void 0===e?void 0:e.supported)||!1}},{key:"getSupportInfo",value:function(){return this.detectSupport(),this.supportInfo}}]),X=o(function e(){a(this,e),this.clickHandler=null,this.intersectionObserver=null,this.mutationObserver=null,this.observedElements=new Set,this.exposedElements=new Set,this.container=null,this.onLogCallback=null},[{key:"init",value:function(e,t){this.container=e,this.onLogCallback=t||null,this.setupClickListener(e),this.setupExposureListener(e),this.setupMutationObserver(e)}},{key:"setupClickListener",value:function(i){var s=this;this.clickHandler=function(e){e=e.target;if(e)for(var t=e;t&&t!==i;){var n=t.getAttribute("message-center-click-log");if(n){s.triggerLogEvent(t,"click",n);break}t=t.parentElement}},i.addEventListener("click",this.clickHandler,!0)}},{key:"setupExposureListener",value:function(e){var s=this;"undefined"!=typeof IntersectionObserver&&(this.intersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){var t,n=e.target,i=n.getAttribute("message-center-show-log");i&&(t="true"===n.getAttribute("message-center-is-single"),e.isIntersecting&&t&&!s.exposedElements.has(n)?(s.exposedElements.add(n),s.triggerLogEvent(n,"show",i)):e.isIntersecting&&!t?s.triggerLogEvent(n,"show",i):e.isIntersecting||t||s.exposedElements["delete"](n))})},{threshold:.6,root:null,rootMargin:"0px"}),this.observeElements(e))}},{key:"observeElements",value:function(e){var t=this;this.intersectionObserver&&e.querySelectorAll("[message-center-show-log]").forEach(function(e){t.observedElements.has(e)||(t.observedElements.add(e),t.intersectionObserver.observe(e))})}},{key:"triggerLogEvent",value:function(e,t,n){t={logData:n,element:e,type:t};if(this.onLogCallback)try{this.onLogCallback(t)}catch(e){console.error("日志事件回调执行失败:",e)}}},{key:"setupMutationObserver",value:function(t){var i=this;"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){var n=!1;e.forEach(function(e){e.addedNodes.forEach(function(e){var t;e.nodeType===Node.ELEMENT_NODE&&(e=null===(e=(t=e).querySelectorAll)||void 0===e?void 0:e.call(t,"[message-center-show-log]"),(t.hasAttribute&&t.hasAttribute("message-center-show-log")||e&&0<e.length)&&(n=!0))})}),n&&i.observeElements(t)}),this.mutationObserver.observe(t,{childList:!0,subtree:!0}))}},{key:"observeNewElements",value:function(e){this.observeElements(e)}},{key:"destroy",value:function(e){this.clickHandler&&(e.removeEventListener("click",this.clickHandler,!0),this.clickHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.observedElements.clear(),this.exposedElements.clear(),this.container=null}}]);function J(e,t){var n,i=(t=void 0===t?{}:t).insertAt;e&&"undefined"!=typeof document&&(n=document.head||document.getElementsByTagName("head")[0],(t=document.createElement("style")).type="text/css","top"===i&&n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)))}J(".message-panel-container-wrapper{pointer-events:auto;z-index:301}.message-panel-container-wrapper .message-center-panel{animation:messagePanelFadeIn .2s ease-out;background-color:#fff;border:.5px solid #dbdce0;border-radius:var(--cos-rounded-md,12px);box-shadow:0 2px 20px 0 #0b0a211f;box-sizing:border-box;color:var(--cos-color-text-slim,#626675);font-size:13px;line-height:13px;max-height:400px;min-height:124px;overflow:hidden;padding:18px 2px 0;width:344px;z-index:301}.message-panel-container-wrapper .message-center-panel-header{align-items:center;display:flex;height:16px;justify-content:space-between;padding:0 16px}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-title{color:var(--cos-color-text,#333);font-size:var(--cos-text-subtitle,16px);font-weight:500;line-height:var(--cos-text-subtitle,16px)}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-actions{align-items:center;display:flex}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-actions .clear-all-btn{color:var(--cos-color-text-minor,#9195a3);cursor:pointer;font-size:13px;line-height:13px;margin-right:12px}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-actions .clear-all-btn.mr-0{margin-right:0}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-actions .clear-all-btn:hover{color:#4e6ef2}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-actions svg{cursor:pointer}.message-panel-container-wrapper .message-center-panel-header .message-center-panel-actions svg:hover path{fill:#4e6ef2}.message-panel-container-wrapper .message-center-panel .message-center-list{background:#fff;border-radius:var(--cos-rounded-md,12px);margin-top:8px;max-height:339px;overflow-y:auto;padding:7px 0 15px;position:relative;scrollbar-width:none!important}.message-panel-container-wrapper .message-center-panel .message-center-list.message-center-list-empty{margin-top:0;min-height:120px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-empty{align-items:center;color:var(--cos-color-text-minor,#9195a3);display:flex;flex-direction:column;font-size:var(--cos-text-body,14px);font-weight:400;height:120px;justify-content:center;left:0;line-height:var(--cos-text-body,14px);position:absolute;text-align:center;top:0;width:100%}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-empty svg{height:40px;margin-bottom:9px;width:40px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content{display:flex;flex-direction:column;justify-content:space-between}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper{margin:9px 7px 0;padding:0 9px;position:relative}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper:first-of-type{margin-top:0}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper:hover{background:rgba(78,110,242,.09);border-radius:10px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper:hover .message-item-close-btn,.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper:hover .message-item-view-mask{opacity:1}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper:hover .message-center-message-icon{border:.5px solid #fff}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper .message-item-view-mask{background:linear-gradient(270deg,#eff2fe,#eff2fe 65.04%,rgba(239,242,254,0));border-bottom-right-radius:12px;border-top-right-radius:12px;height:100%;opacity:0;position:absolute;right:0;top:0;width:71px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper .message-item-view-mask .message-item-view{align-items:center;background-color:#fff;border-radius:12px;color:var(--cos-color-text,#333);cursor:pointer;display:flex;font-size:12px;font-weight:500;height:24px;justify-content:center;line-height:12px;padding:6px 12x;position:absolute;right:9px;top:50%;transform:translateY(-50%);width:48px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper .message-item-view-mask .message-item-view:hover{background-color:rgba(0,0,0,.03);color:#4e6ef2}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-list-content .message-item-wrapper .message-item-close-btn{cursor:pointer;height:14px;opacity:0;position:absolute;right:-6px;top:-6px;width:14px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-loading{align-items:center;display:flex;justify-content:center;padding-top:9px}.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-load-error,.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-load-more,.message-panel-container-wrapper .message-center-panel .message-center-list .message-center-no-more{padding-top:12px;text-align:center}.message-panel-container-wrapper .message-center-panel-mask{background:linear-gradient(180deg,hsla(0,0%,100%,0),#fff);border-bottom-left-radius:var(--cos-rounded-md,12px);border-bottom-right-radius:var(--cos-rounded-md,12px);bottom:0;height:60px;left:0;pointer-events:none;position:absolute;width:100%;z-index:1}@keyframes messagePanelFadeIn{0%{opacity:0}to{opacity:1}}"),J(".message-panel-container-wrapper .message-center-message-item{box-sizing:border-box;display:flex;height:58px;overflow:hidden;padding:9px 0;position:relative}.message-panel-container-wrapper .message-center-message-item .message-center-message-icon{border:.5px solid transparent;border-radius:20px;flex-shrink:0;height:40px;margin-right:9px;object-fit:cover;width:40px}.message-panel-container-wrapper .message-center-message-item .message-center-message-icon.message-center-push-icon-recommend{border-radius:999px}.message-panel-container-wrapper .message-center-message-item .message-center-message-body{flex:1;min-width:0;padding:3px 0 1px}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-title-wrapper{align-items:center;display:flex;justify-content:space-between}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-title-wrapper .message-title-text{color:var(--cos-color-text,#000311);flex:1;font-size:var(--cos-text-subtitle-sm,14px);font-weight:500;line-height:var(--cos-text-subtitle-sm,14px);margin-right:9px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-title-wrapper .message-title-time{color:var(--cos-color-text-minor,#848691);flex-shrink:0;font-size:13px;line-height:13px;white-space:nowrap}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper{height:100%;margin-top:0}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper .message-content-without-title{display:flex;flex-direction:column;height:100%;justify-content:center}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper .message-content-without-title .message-content-line{color:var(--cos-color-text,#000311);font-size:var(--cos-text-subtitle-sm,14px);line-height:16px}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper .message-content-without-title .message-content-line.message-content-line-first{margin-top:0;overflow:hidden;white-space:nowrap}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper .message-content-without-title .message-content-line.message-content-line-second{align-items:center;display:flex;justify-content:space-between;margin-top:4px}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper .message-content-without-title .message-content-line.message-content-line-second .message-content-second-text{flex:1;margin-right:8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-content-wrapper .message-content-without-title .message-content-line.message-content-line-second .message-content-time{color:var(--cos-color-text-minor,#848691);flex-shrink:0;font-size:13px;line-height:13px;white-space:nowrap}.message-panel-container-wrapper .message-center-message-item .message-center-message-body .message-center-message-content{line-clamp:1;-webkit-line-clamp:1;-webkit-box-orient:vertical;color:var(--cos-color-text-minor,#848691);display:-webkit-box;font-size:13px;line-height:13px;margin-top:9px;overflow:hidden;text-overflow:ellipsis}");var K={"mcp-skillagent-wise":"deep_decision",deep_decision:"deep_decision",cron_task:"deep_decision"},Z={cron_task:"scheduled_task"};function $(e){e=(null==(e=e.notifyInfo)?void 0:e.taskType)||(null==e?void 0:e.subType)||(null==e?void 0:e.taskGroup)||"";return K[e]||e}function Q(e){e=(null===(e=e.notifyInfo)||void 0===e?void 0:e.subType)||"";return Z[e]||e}var ee=(g(te,t.Component),o(te,[{key:"initData",value:function(){return{message:{},contentFirstLine:"",contentSecondLine:""}}},{key:"attached",value:function(){this.updateContentLines()}},{key:"updated",value:function(){this.updateContentLines()}},{key:"updateContentLines",value:function(){var e,n=this,t=this.data.get("message");if(t&&(null===(e=t.showData)||void 0===e||!e.title)){var i=(null===(e=t.showData)||void 0===e?void 0:e.content)||(null===(t=t.showData)||void 0===t?void 0:t.text)||"";if(!i)return this.data.set("contentFirstLine",""),void this.data.set("contentSecondLine","");requestAnimationFrame(function(){requestAnimationFrame(function(){var e=null===(t=n.el)||void 0===t?void 0:t.querySelector(".message-content-without-title");if(e){var t=e.offsetWidth;if(!(t<=0)){t=n.splitTextIntoLines(i,t,e,1)[0]||"";if(t.length>=i.length)return n.data.set("contentFirstLine",t),void n.data.set("contentSecondLine","");e=i.substring(t.length);n.data.set("contentFirstLine",t),n.data.set("contentSecondLine",e)}}})})}}},{key:"formatTime",value:function(e){var t=new Date,n=+e,i=new Date(n),s=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),o=s-864e5,a=o-864e5;if(s<=n){e=i.getHours(),s=i.getMinutes();return"".concat(String(e).padStart(2,"0"),":").concat(String(s).padStart(2,"0"))}if(o<=n)return"昨天";if(a<=n)return"前天";a=i.getFullYear(),n=i.getMonth()+1,i=i.getDate();return(a!==t.getFullYear()?"".concat(a,"-"):"").concat(n,"-").concat(i)}},{key:"handleClick",value:function(){var e=this.data.get("message");this.fire("click",e)}},{key:"getShowLog",value:function(){var e,t=this.data.get("message"),t={value:"notice_list_details",ext:{task_type:$(t),sub_type:Q(t),recommend_cont:null===(e=t.showData)||void 0===e?void 0:e.content,recommend_query:null===(e=t.notifyInfo)||void 0===e?void 0:e.query,notice_id:t.id}};return JSON.stringify(t)}},{key:"splitTextIntoLines",value:function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:2;if(t<=0||!e)return[e||"",""];var s=document.createElement("span");s.className="message-content-line",s.style.visibility="hidden",s.style.position="absolute",s.style.whiteSpace="nowrap",n.appendChild(s);var o=function o(e){return s.textContent=e,s.offsetWidth};try{if(o(e)<=t)return[e,""];for(var a=0,r=e.length,l=0;a<r;){var c=Math.floor((a+r)/2);o(e.substring(0,c))<=t?a=(l=c)+1:r=c}var u=e.substring(0,l),g=e.substring(l);if(1===i)return[u,""];var d=g;if(g&&o(g)>t){for(var h=g.length,p=g.length;0<=p;p--)if(o(g.substring(0,p)+"...")<=t){h=p;break}d=g.substring(0,h)+"..."}return[u,d]}catch(e){console.error("Error in splitTextIntoLines",e)}finally{n.removeChild(s)}}}]));function te(){return a(this,te),n(this,te,arguments)}ee.template='\n <div \n class="message-center-message-item"\n on-click="handleClick"\n message-center-show-log="{{getShowLog()}}"\n message-center-is-single="true"\n >\n <img class="message-center-message-icon\n {{message.notifyType === \'recTask\' ? \'message-center-push-icon-recommend\' : \'\'}}"\n src="{{message.showData.icon}}" />\n <div class="message-center-message-body">\n <div class="message-title-wrapper" s-if="message.showData.title">\n <span class="message-title-text">{{message.showData.title}}</span>\n <span class="message-title-time">{{formatTime(message.showData.createTime || Date.now())}}</span>\n </div>\n <div class="message-content-wrapper" s-else>\n <div class="message-content-without-title">\n <div class="message-content-line message-content-line-first">{{contentFirstLine}}</div>\n <div class="message-content-line message-content-line-second">\n <span class="message-content-second-text">{{contentSecondLine}}</span>\n <span class="message-content-time">\n {{formatTime(message.showData.createTime || Date.now())}}\n </span>\n </div>\n </div>\n </div>\n <div class="message-center-message-content" s-if="message.showData.title">\n {{message.showData.content || message.showData.text || \'\'}}\n </div>\n </div>\n </div>\n ';var ne=(g(ie,t.Component),o(ie,[{key:"initData",value:function(){return{messages:[],hasMore:!1,isLoadingMore:!1,isLoading:!1,loadError:!1,notificationSupported:!1,notificationEnabled:!1,isScrolledToBottom:!1,isContentOverflow:!1,showPanel:!1,maxLimitMessages:void 0,maxLimitTime:void 0,showSettings:!0}}},{key:"handleScroll",value:function(){var e,t,n=this.ref("listContainer");n&&(t=n.scrollTop,e=n.scrollHeight-t-n.clientHeight,t=this.data.get("hasMore"),n=this.data.get("isLoadingMore"),this.data.set("isScrolledToBottom",e<=1),e<50&&t&&!n&&this.loadMore())}},{key:"checkContentOverflow",value:function(){var e=this.ref("listContainer");e&&(e=e.scrollHeight>e.clientHeight,this.data.set("isContentOverflow",e))}},{key:"attached",value:function(){var n=this;this.nextTick(function(){n.checkContentOverflow()}),this.watch("messages",function(){n.nextTick(function(){n.checkContentOverflow()})}),this.watch("showPanel",function(e,t){t=t.oldValue;e&&!t&&n.nextTick(function(){n.checkContentOverflow()})})}},{key:"loadMore",value:function(){this.data.get("isLoadingMore")||this.fire("load-more")}},{key:"handleMessageClick",value:function(e){this.fire("message-click",e)}},{key:"handleMessageRemove",value:function(e,t){t.stopPropagation(),this.fire("message-remove",e)}},{key:"handleClearAll",value:function(){this.fire("clear-all")}},{key:"handleNotificationToggle",value:function(e){e=e.target.checked;this.fire("notification-toggle",e)}},{key:"handleMouseEnter",value:function(){this.fire("mouseenter")}},{key:"handleMouseLeave",value:function(){this.fire("mouseleave")}},{key:"handleSettingsClick",value:function(){this.fire("close-panel"),this.fire("show-settings-modal")}},{key:"handleClose",value:function(){this.fire("close-panel")}},{key:"getItemClickLog",value:function(e,t){var n,t={value:"notice_list_details",ext:{task_type:$(e),sub_type:Q(e),recommend_cont:null===(n=e.showData)||void 0===n?void 0:n.content,recommend_query:null===(n=e.notifyInfo)||void 0===n?void 0:n.query,notice_id:e.id,click_area:t}};return JSON.stringify(t)}},{key:"getShowLog",value:function(){return JSON.stringify({value:"notice_list"})}},{key:"getClickLog",value:function(e){return JSON.stringify({value:"notice_list",ext:{click_area:e}})}},{key:"isOverLimit",value:function(){var e=this.data.get("messages");if(!e||0===e.length)return!1;var t=this.data.get("maxLimitMessages");return null!=t&&e.length>=t}},{key:"getNoMoreText",value:function(){var e=this.data.get("messages");if(!e||0===e.length)return"";var t=this.data.get("maxLimitMessages");return null!=t&&e.length>=t?"仅展示最近".concat(t,"条通知"):""}}]));function ie(){return a(this,ie),n(this,ie,arguments)}ne.template='\n <div \n class="message-center-panel"\n message-center-show-log="{{getShowLog()}}"\n on-mouseenter="handleMouseEnter"\n on-mouseleave="handleMouseLeave"\n >\n \x3c!-- 面板头部 --\x3e\n <div class="message-center-panel-header">\n <span class="message-center-panel-title">通知</span>\n <div class="message-center-panel-actions">\n <div \n class="panel-action-btn clear-all-btn {{showSettings ? \'\' : \'mr-0\'}}"\n message-center-click-log="{{getClickLog(\'clear\')}}"\n on-click="handleClearAll"\n s-if="filteredMessages.length > 0"\n >\n 全部清除\n </div>\n <svg\n s-if="showSettings"\n width="16"\n height="16" \n viewBox="0 0 16 16" \n fill="none" \n xmlns="http://www.w3.org/2000/svg"\n message-center-click-log="{{getClickLog(\'settings\')}}"\n on-click="handleSettingsClick"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M6.81483 1.18525C7.54822 0.761819 8.4518 0.761819 9.1852 1.18525L13.3092 3.56625C14.0426 3.98968 14.4944 4.7722 14.4944 5.61905V10.3811C14.4944 11.2279 14.0426 12.0104 13.3092 12.4339L9.1852 14.8149C8.4518 15.2383 7.54822 15.2383 6.81483 14.8149L2.6908 12.4339C1.95741 12.0104 1.50562 11.2279 1.50562 10.3811V5.61905C1.50562 4.7722 1.95741 3.98968 2.6908 3.56625L6.81483 1.18525ZM8.5926 2.21165C8.22591 1.99993 7.77412 1.99993 7.40742 2.21165L3.28339 4.59265C2.9167 4.80437 2.6908 5.19563 2.6908 5.61905V10.3811C2.6908 10.8045 2.9167 11.1958 3.28339 11.4075L7.40742 13.7885C7.77412 14.0002 8.22591 14.0002 8.5926 13.7885L12.7166 11.4075C13.0833 11.1958 13.3092 10.8045 13.3092 10.3811V5.61905C13.3092 5.19563 13.0833 4.80437 12.7166 4.59265L8.5926 2.21165Z"\n fill="#333333"/>\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M8.00001 6.51858C7.18181 6.51858 6.51853 7.18186 6.51853 8.00006C6.51853 8.81826 7.18181 9.48154 8.00001 9.48154C8.81821 9.48154 9.48149 8.81826 9.48149 8.00006C9.48149 7.18186 8.81821 6.51858 8.00001 6.51858ZM5.33334 8.00006C5.33334 6.5273 6.52725 5.33339 8.00001 5.33339C9.47277 5.33339 10.6667 6.5273 10.6667 8.00006C10.6667 9.47282 9.47277 10.6667 8.00001 10.6667C6.52725 10.6667 5.33334 9.47282 5.33334 8.00006Z"\n fill="#333333"/>\n </svg>\n </div>\n </div>\n\n\n \x3c!-- 消息列表 --\x3e\n <div \n class="message-center-list {{messages.length === 0 ? \'message-center-list-empty\' : \'\'}}"\n s-ref="listContainer"\n on-scroll="handleScroll"\n >\n \x3c!-- 空状态 --\x3e\n <div s-if="filteredMessages.length === 0" class="message-center-empty">\n <svg\n width="54"\n height="54"\n viewBox="0 0 54 54"\n fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_394_7641)">\n <path d="M17.7985 26.8C19.124 26.8 20.1985 25.7255 20.1985 24.4C20.1985 23.0745 19.124 22 17.7985 22C16.4731 22 15.3985 23.0745 15.3985 24.4C15.3985 25.7255 16.4731 26.8 17.7985 26.8Z" fill="#DBDCE0"/>\n <path d="M29.3985 24.4C29.3985 25.7255 28.324 26.8 26.9985 26.8C25.6731 26.8 24.5985 25.7255 24.5985 24.4C24.5985 23.0745 25.6731 22 26.9985 22C28.324 22 29.3985 23.0745 29.3985 24.4Z" fill="#DBDCE0"/>\n <path d="M36.1985 26.8C37.524 26.8 38.5985 25.7255 38.5985 24.4C38.5985 23.0745 37.524 22 36.1985 22C34.8731 22 33.7985 23.0745 33.7985 24.4C33.7985 25.7255 34.8731 26.8 36.1985 26.8Z" fill="#DBDCE0"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.7985 8H13.1985C9.77437 8 6.99854 10.7758 6.99854 14.2V34.4667L6.99937 34.5692C7.05412 37.9461 9.80861 40.6667 13.1985 40.6667L17.6651 40.6664L17.6652 44L17.6658 44.052C17.7043 45.6382 19.5009 46.5564 20.8121 45.6384L27.9147 40.6664L40.7985 40.6667C44.2227 40.6667 46.9985 37.8908 46.9985 34.4667V14.2C46.9985 10.7758 44.2227 8 40.7985 8ZM13.1985 12H40.7985C42.0136 12 42.9985 12.985 42.9985 14.2V34.4667C42.9985 35.6817 42.0136 36.6667 40.7985 36.6667L27.2841 36.6666L27.2118 36.6679C26.8269 36.6818 26.4536 36.8067 26.1372 37.0282L21.6649 40.1586L21.6651 38.6666C21.6651 37.562 20.7697 36.6666 19.6651 36.6666L13.1985 36.6667C11.9835 36.6667 10.9985 35.6817 10.9985 34.4667V14.2C10.9985 12.985 11.9835 12 13.1985 12Z" fill="#DBDCE0"/>\n </g>\n <defs>\n <clipPath id="clip0_394_7641">\n <rect width="54" height="54" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n 暂无新通知\n </div>\n \x3c!-- 正常消息列表 --\x3e\n <div\n s-else\n class="message-center-list-content">\n <div\n class="message-item-wrapper"\n s-for="message in filteredMessages"\n on-click="handleMessageClick(message)"\n message-center-click-log="{{getItemClickLog(message, \'view\')}}"\n data-message-id="{{message.id}}"\n >\n <message-item message="{{message}}" />\n \x3c!-- 查看 --\x3e\n <div class="message-item-view-mask">\n <div\n class="message-item-view"\n >查看</div>\n </div>\n \x3c!-- 关闭按钮 --\x3e\n <svg\n width="16" \n height="16" \n viewBox="0 0 16 16" \n fill="none" \n xmlns="http://www.w3.org/2000/svg"\n class="message-item-close-btn"\n message-center-click-log="{{getItemClickLog(message, \'close\')}}"\n on-click="handleMessageRemove(message, $event)"\n >\n <path\n d="M7.64819 0.583496C11.55 0.583496 14.7126 3.74618 14.7126 7.64795C14.7126 11.5497 11.55 14.7124 7.64819 14.7124C3.74642 14.7124 0.58374 11.5497 0.58374 7.64795C0.58376 3.74619 3.74644 0.583515 7.64819 0.583496Z"\n fill="white"\n stroke="white"\n stroke-width="1.16667"/>\n <path\n d="M7.64725 14.1295C11.2269 14.1295 14.1287 11.2276 14.1287 7.64799C14.1287 4.06837 11.2269 1.1665 7.64725 1.1665C4.06763 1.1665 1.16577 4.06837 1.16577 7.64799C1.16577 11.2276 4.06763 14.1295 7.64725 14.1295ZM10.0879 5.94056L8.38052 7.64799L10.0879 9.35542L9.35463 10.0887L7.6472 8.38127L5.9398 10.0887L5.20648 9.35542L6.91391 7.64799L5.20648 5.94056L5.9398 5.20727L7.6472 6.9147L9.35463 5.20727L10.0879 5.94056Z"\n fill="#626675"/>\n </svg>\n </div>\n \n \x3c!-- 加载更多相关提示 --\x3e\n <div s-if="isLoadingMore" class="message-center-loading">\n <div class="loading-text">正在加载...</div>\n </div>\n <div s-else>\n <div s-if="hasMore && !isOverLimit() && (isContentOverflow ? isScrolledToBottom : false)" class="message-center-load-more">\n <div class="load-more-trigger" on-click="loadMore">加载更多</div>\n </div>\n <div s-else-if="loadError" class="message-center-load-error">\n <div class="error-text">加载失败,请重试</div>\n </div>\n <div s-else-if="isOverLimit()" class="message-center-no-more">\n <div s-if="getNoMoreText()" class="no-more-text">{{getNoMoreText()}}</div>\n </div>\n </div>\n </div>\n </div>\n \x3c!-- 底部半透明遮罩层 --\x3e\n <div\n s-if="isContentOverflow && !isScrolledToBottom"\n class="message-center-panel-mask">\n </div>\n </div>\n ',ne.components={"message-item":ee},ne.computed={filteredMessages:function(){var e=this.data.get("messages");if(!e||0===e.length)return[];var t=e,e=this.data.get("maxLimitMessages");return t=null!=e?t.slice(0,e):t}},J(".message-center-push-container{pointer-events:auto;z-index:300}.message-center-push-container .message-center-push{background:linear-gradient(90deg,#f8fbff,#f7f9ff 44.18%,#fefdff);border:.5px solid #dbdce0;border-radius:12px;box-shadow:0 2px 20px 0 #0b0a211f;box-sizing:border-box;cursor:pointer;height:60px;padding:10px 12px;pointer-events:auto;width:320px}.message-center-push-container .message-center-push.message-center-push-slide-in{animation:mc-slide-in-right .3s ease forwards;opacity:0;transform:translateX(100%)}.message-center-push-container .message-center-push.message-center-push-show{opacity:1;transform:translateX(0)}.message-center-push-container .message-center-push.message-center-push-hide{animation:mc-slide-out-right .3s ease forwards;opacity:0;transform:translateX(100%)}.message-center-push-container .message-center-push .message-center-push-content{align-items:center;display:flex;justify-content:center;position:relative}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-icon{border:.5px solid var(--cos-color-border-tiny,#dbdce0);border-radius:20px;box-sizing:border-box;flex-shrink:0;height:40px;margin-right:9px;object-fit:cover;width:40px}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-icon.message-center-push-icon-recommend{border:none;border-radius:999px}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-body{flex:1;height:36px;margin-right:9px;overflow:hidden;position:relative}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-body .message-center-push-title{align-self:flex-start;color:var(--cos-color-text,#000311);font-size:var(--cos-text-subtitle-sm,14px);font-weight:500;line-height:var(--cos-text-subtitle-sm,14px);margin-top:0}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-body .message-center-push-text{line-clamp:1;-webkit-line-clamp:1;-webkit-box-orient:vertical;color:var(--cos-color-text-minor,#848691);display:-webkit-box;font-size:var(--cos-text-body,14px);font-weight:400;line-height:var(--cos-text-body,14px);margin-top:0;overflow:hidden;text-overflow:ellipsis}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-body .message-center-push-title+.message-center-push-text{margin-top:6px}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-body .push-content-without-title{display:flex;flex-direction:column;height:100%}.message-center-push-container .message-center-push .message-center-push-content .message-center-push-body .push-content-without-title .push-content-text{line-clamp:2;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--cos-color-text,#000311);display:-webkit-box;font-size:var(--cos-text-body,14px);line-height:18px;margin-top:0;overflow:hidden;text-overflow:ellipsis;white-space:normal}@keyframes mc-slide-in-right{0%{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}@keyframes mc-slide-out-right{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}");var se=(g(oe,t.Component),o(oe,[{key:"initData",value:function(){return{message:{},animationClass:"message-center-push-show"}}},{key:"attached",value:function(){var e=this;this.nextTick(function(){e.data.set("animationClass","message-center-push-slide-in")}),this.startAutoRemove()}},{key:"startAutoRemove",value:function(){var e=this;this.clearAutoRemoveTimer(),this.autoRemoveTimer=setTimeout(function(){e.handleAutoRemove()},5e3)}},{key:"clearAutoRemoveTimer",value:function(){this.autoRemoveTimer&&(clearTimeout(this.autoRemoveTimer),this.autoRemoveTimer=null),this.hoverLeaveTimer&&(clearTimeout(this.hoverLeaveTimer),this.hoverLeaveTimer=null)}},{key:"handleAutoRemove",value:function(){var e=this,t=this.data.get("message"),n=null==t?void 0:t.id;n&&(this.data.set("animationClass","message-center-push-hide"),setTimeout(function(){e.fire("close",n)},300))}},{key:"handleMouseEnter",value:function(){this.isHovering=!0,this.clearAutoRemoveTimer()}},{key:"handleMouseLeave",value:function(){var e=this;this.isHovering=!1,this.clearAutoRemoveTimer(),this.hoverLeaveTimer=setTimeout(function(){e.handleAutoRemove()},1e3)}},{key:"getIsHovering",value:function(){return this.isHovering}},{key:"handleClick",value:function(){this.clearAutoRemoveTimer();var e=this.data.get("message");this.fire("click",e);e=null==e?void 0:e.id;e&&this.fire("close",e)}},{key:"handleClose",value:function(e){var t=this;e.stopPropagation(),e.preventDefault(),this.clearAutoRemoveTimer();var e=this.data.get("message"),n=null==e?void 0:e.id;n&&(this.data.set("animationClass","message-center-push-hide"),setTimeout(function(){t.fire("close",n)},300))}},{key:"detached",value:function(){this.clearAutoRemoveTimer()}},{key:"getClickLog",value:function(e){var t,n=this.data.get("message"),e={value:"notice_bub",ext:{task_type:$(n),sub_type:Q(n),recommend_cont:null===(t=n.showData)||void 0===t?void 0:t.content,recommend_query:null===(n=n.notifyInfo)||void 0===n?void 0:n.query,click_area:e}};return JSON.stringify(e)}},{key:"getShowLog",value:function(){var e,t=this.data.get("message"),t={value:"notice_bub",ext:{task_type:$(t),sub_type:Q(t),recommend_cont:null===(e=t.showData)||void 0===e?void 0:e.content,recommend_query:null===(t=t.notifyInfo)||void 0===t?void 0:t.query}};return JSON.stringify(t)}}]));function oe(){var e;return a(this,oe),(e=n(this,oe,arguments)).autoRemoveTimer=null,e.hoverLeaveTimer=null,e.isHovering=!1,e}se.template='\n <div \n class="message-center-push {{animationClass}}"\n on-click="handleClick"\n on-mouseenter="handleMouseEnter"\n on-mouseleave="handleMouseLeave"\n message-center-click-log="{{getClickLog(\'main\')}}"\n message-center-show-log="{{getShowLog()}}"\n message-center-is-single="true"\n >\n <div class="message-center-push-content">\n <img\n class="message-center-push-icon\n {{message.notifyType === \'recTask\' ? \'message-center-push-icon-recommend\' : \'\'}}"\n src="{{message.showData.icon}}" />\n <div class="message-center-push-body">\n <div class="message-center-push-title" s-if="message.showData.title">\n {{message.showData.title}}\n </div>\n <div class="message-center-push-text" s-if="message.showData.title">\n {{message.showData.content || message.showData.text || \'\'}}\n </div>\n <div class="push-content-without-title" s-if="!message.showData.title">\n <div class="push-content-text">{{message.showData.content || message.showData.text || \'\'}}</div>\n </div>\n </div>\n <svg\n width="16"\n height="16"\n viewBox="0 0 16 16"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n message-center-click-log="{{getClickLog(\'close\')}}"\n on-click="handleClose"\n class="message-center-push-close-btn">\n <path\n d="M13.238 3.59912L8.83862 7.99756L13.24 12.3989L12.4021 13.2368L8.00073 8.83545L3.60034 13.2368L2.76245 12.3989L7.16284 7.99756L2.7644 3.59912L3.60229 2.76123L8.00073 7.15967L12.4001 2.76123L13.238 3.59912Z"\n fill="#848691"/>\n </svg>\n </div>\n </div>\n ',J('.message-center-settings-modal-container{pointer-events:auto}.message-center-settings-modal-container .mc-settings-modal{align-items:center;background:var(--cos-color-bg-mask,rgba(0,0,0,.5));bottom:0;display:flex;height:100vh;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1000}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content{background:#fff;border-radius:var(--cos-rounded-md,12px);box-shadow:0 6px 21px 0 rgba(30,31,36,.2);max-width:90vw;overflow:hidden;padding:var(--cos-space-xl,21px);width:400px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-header{align-items:center;display:flex;justify-content:space-between}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-header .mc-settings-modal-title{color:var(--cos-color-text,#000311);font-size:var(--cos-text-headline-sm,18px);font-weight:600;line-height:var(--cos-text-headline-sm,18px)}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-header .mc-settings-modal-close{cursor:pointer}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch{align-items:center;display:flex;justify-content:space-between;margin-top:15px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch-label{display:flex;flex-direction:column}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch-label-text{color:var(--cos-color-text,#000311);font-size:var(--cos-text-body,14px lg);line-height:var(--cos-text-body,14px lg)}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch-label-description{color:var(--cos-color-text-minor,#9195a3);font-size:13px;line-height:13px;margin-top:6px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch input[type=checkbox]{appearance:none;background:var(--cos-color-bg-raised-inverse,#00000033);border-radius:var(--cos-rounded-full,9999px);cursor:pointer;height:20px;margin:0;position:relative;transition:background .3s ease;width:36px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch input[type=checkbox]:before{background:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2);content:"";height:14px;left:3px;position:absolute;top:3px;transition:transform .3s ease;width:14px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch input[type=checkbox]:checked{background:#1890ff}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-notification-switch input[type=checkbox]:checked:before{transform:translateX(16px)}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-warning-area{background:var(--cos-color-bg-alive-light,#ffede8);border-radius:9px;color:var(--cos-color-text,#333);font-size:var(--cos-text-body,14px);line-height:18px;margin-top:15px;padding:12px;position:relative}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-warning-area+.mc-warning-area{margin-top:9px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-warning-area.mc-warning-area-blink{animation:blink-warning .6s ease-in-out}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-warning-area .mc-warning-icon{height:16px;left:12px;position:absolute;top:12px;width:16px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-warning-area .mc-warning-text{margin-left:24px}.message-center-settings-modal-container .mc-settings-modal .mc-settings-modal-content .mc-settings-modal-body .mc-warning-area .mc-warning-image{border-radius:9px;height:100%;margin-top:9px;object-fit:cover;width:100%}@keyframes blink-warning{0%,to{background:var(--cos-color-bg-alive-light,#ffede8)}25%{background:rgba(255,130,0,.3)}50%{background:var(--cos-color-bg-alive-light,#ffede8)}75%{background:rgba(255,130,0,.3)}}');var ae,re,le,ce=(g(ue,t.Component),o(ue,[{key:"initData",value:function(){return{isOpen:!1,notificationEnabled:!1,recommendNotificationEnabled:!0,enableRecommend:!0,browserNotificationPermissionGranted:!1,browserNotificationPermissionDenied:!1,shouldBlinkWarning:!1}}},{key:"attached",value:function(){var t=this;this.checkBrowserNotificationPermission(),this.watch("browserNotificationPermissionGranted",function(e){e||t.nextTick(function(){t.data.set("notificationEnabled",!1)})})}},{key:"checkBrowserNotificationPermission",value:function(){this.fire("check-permission")}},{key:"handleBackdropClick",value:function(e){e.target.classList.contains("mc-settings-modal")&&(this.fire("close"),this.checkBrowserNotificationPermission())}},{key:"handleContentClick",value:function(e){e.stopPropagation()}},{key:"handleClose",value:function(){this.fire("close"),this.checkBrowserNotificationPermission()}},{key:"handleRecommendToggle",value:function(e){e=e.target;this.fire("toggle-recommend",e.checked)}},{key:"getClickLog",value:function(e){return JSON.stringify({value:e})}}]));function ue(){return a(this,ue),n(this,ue,arguments)}ce.template='\n <div class="mc-settings-modal" s-if="isOpen" on-click="handleBackdropClick">\n <div class="mc-settings-modal-content" on-click="handleContentClick">\n <div class="mc-settings-modal-header">\n <span class="mc-settings-modal-title">通知设置</span>\n <svg\n width="18"\n height="18"\n viewBox="0 0 18 18"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n on-click="handleClose"\n class="mc-settings-modal-close">\n <path\n d="M14.2531 3.08105L15.1958 4.02372L10.0813 9.13817L15.1958 14.2526L14.2531 15.1953L9.13866 10.0808L4.02421 15.1953L3.08154 14.2526L8.196 9.13817L3.08154 4.02372L4.02421 3.08105L9.13866 8.19551L14.2531 3.08105Z"\n fill="#9195A3"/>\n </svg>\n </div>\n <div class="mc-settings-modal-body">\n <div class="mc-notification-switch">\n <div class="mc-notification-switch-label">\n <div class="mc-notification-switch-label-text">个性化推荐通知</div>\n <div class="mc-notification-switch-label-description">关闭后,将不再收到推荐内容。</div>\n </div>\n <input\n type="checkbox"\n message-center-click-log="{{getClickLog(\'per_notice_setting\')}}"\n checked="{=recommendNotificationEnabled=}"\n on-change="handleRecommendToggle"\n />\n </div>\n </div>\n </div>\n </div>\n ',(t=ae=ae||{})[t.UNDONE=1]="UNDONE",t[t.UNREAD=2]="UNREAD",(t=Ce=Ce||{}).VIDEO="video",t.DEEP_RESEARCH="deepResearch",t.MUSIC="music",t.PPT="ppt",t.PODCAST="podcast",(t=re=re||{}).MAGIC_PEN="magicPen",t.NEW_MAGIC_PEN="mcp-agent-magicPen",t.MUSE_STREAM="museStream",t.AI_MUSIC="mcp-server-music",t.TEXT_TO_VIDEO="mcp-server-text2video",t.IMAGE_TO_VIDEO="mcp-server-image2video",t.REFERENCE_TO_VIDEO="mcp-agent-video",t.DEEP_RESEARCH="deepResearch",t.PPT="mcp-server-ppt-wise",t.PPT_PC="mcp-server-ppt-pc",t.AI_PODCAST="mcp-agent-podcast",t.CRON_TASK="cron_task",(t=le=le||{})[t.INITIAL=0]="INITIAL",t[t.IN_PROGRESS=1]="IN_PROGRESS",t[t.SUCCESS=2]="SUCCESS",t[t.FAILED=3]="FAILED",(Ee=Ee=Ee||{})[Ee.UNREAD=0]="UNREAD",Ee[Ee.READ=1]="READ",c(c(c(c(c(c(c(c(c(c(Ee={},re.MAGIC_PEN,Ce.VIDEO),re.NEW_MAGIC_PEN,Ce.VIDEO),re.MUSE_STREAM,Ce.VIDEO),re.AI_MUSIC,Ce.MUSIC),re.TEXT_TO_VIDEO,Ce.VIDEO),re.IMAGE_TO_VIDEO,Ce.VIDEO),re.REFERENCE_TO_VIDEO,Ce.VIDEO),re.DEEP_RESEARCH,Ce.DEEP_RESEARCH),re.PPT,Ce.PPT),re.PPT_PC,Ce.PPT),c(Ee,re.AI_PODCAST,Ce.PODCAST),c(c(c(c(c({},Ce.VIDEO,"videoGenerate"),Ce.DEEP_RESEARCH,"editor-workspace-viewer"),Ce.MUSIC,"musicPlayer"),Ce.PPT,"ppt-previewer"),Ce.PODCAST,"podcastGenerate");var ge,de,he,pe,me,fe,ve,ye,be,ke,we,Te,Pe,Se,xe,Ie,Ee=o(function we(e,t){var n=this;a(this,we),this.taskPollingTimers=new Map,this.taskPollingInterval=1e3,this.currentPollingTasks=new Map,this.handleVisibilityChange=function(){"visible"===document.visibilityState?n.startPolling():n.stopPolling()},this.sseHost=e,this.getToken=t},[{key:"init",value:function(){this.startPolling(),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),document.addEventListener("visibilitychange",this.handleVisibilityChange)}},{key:"dispose",value:function(){this.stopPolling(),document.removeEventListener("visibilitychange",this.handleVisibilityChange)}},{key:"getTaskListByStatus",value:(Ie=r(h().m(function we(t){var n,i,s;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,i=this.buildQueryString({taskType:t,token:this.getToken()}),i="".concat(this.sseHost,"/aichat/longtask/list?").concat(i),e.n=1,fetch(i,{credentials:"include"});case 1:return s=e.v,e.n=2,s.json();case 2:if(0===(null==(s=e.v)?void 0:s.status)&&null!==(n=null==s?void 0:s.data)&&void 0!==n&&n.taskItems)return e.a(2,s.data.taskItems);e.n=3;break;case 3:e.n=5;break;case 4:e.p=4,e.v;case 5:return e.a(2,[])}},we,this,[[0,4]])})),function(e){return Ie.apply(this,arguments)})},{key:"getTaskLists",value:(xe=r(h().m(function we(){var t,n;return h().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([this.getTaskListByStatus(ae.UNDONE),this.getTaskListByStatus(ae.UNREAD)]);case 1:return t=e.v,n=m(t,2),t=n[0],n=n[1],e.a(2,{undone:t,unread:n})}},we,this)})),function(){return xe.apply(this,arguments)})},{key:"getTaskStatus",value:(Se=r(h().m(function we(t){var n,i,s,o,a,r,l,c=arguments;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=1<c.length&&void 0!==c[1]?c[1]:0,n=t.sessionId,i=t.qid,s=t.taskId,o=t.taskGroup,a=t.retryTimes,a=void 0===a?0:a,e.p=1,r=this.buildQueryString({sessionId:n,qid:i,taskId:s,taskGroup:o,seqId:r,token:this.getToken()}),r="".concat(this.sseHost,"/aichat/longtask/query?").concat(r),e.n=2,fetch(r,{credentials:"include"});case 2:return r=e.v,e.n=3,r.json();case 3:if(0===(null==(l=e.v)?void 0:l.status)&&void 0!==(null==l?void 0:l.data))return e.a(2,{taskInfo:l.data.message.content.taskInfo,historyData:l.data.historyData,bindData:l.data.bindData});e.n=4;break;case 4:return l=a+1,l={taskId:s,taskStatus:le.IN_PROGRESS,taskIsDeleted:0,retryTimes:l},3<=a&&(l.taskIsDeleted=1),e.a(2,{taskInfo:l,historyData:[],bindData:{}});case 5:return e.p=5,e.v,e.a(2,null)}},we,this,[[1,5]])})),function(e){return Se.apply(this,arguments)})},{key:"updateTaskReadStatus",value:(Pe=r(h().m(function we(t){var n,i,s,o,a;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.sessionId,i=t.qid,s=t.taskId,o=t.taskGroup,e.p=1,o===re.CRON_TASK)return a=this.buildQueryString({tk:this.getToken()}),e.n=2,fetch("".concat(this.sseHost,"/aichat/api/messages/update?").concat(a),{method:"POST",credentials:"include",body:JSON.stringify({operation:"click",range:"part",messageIds:[s]})});e.n=3;break;case 2:e.n=4;break;case 3:return a=this.buildQueryString({token:this.getToken()}),e.n=4,fetch("".concat(this.sseHost,"/aichat/longtask/update?").concat(a),{method:"POST",credentials:"include",body:JSON.stringify({sessionId:n,qid:i,taskId:s})});case 4:e.n=6;break;case 5:e.p=5,e.v;case 6:return e.a(2)}},we,this,[[1,5]])})),function(e){return Pe.apply(this,arguments)})},{key:"startPolling",value:function(){this.pollTaskList()}},{key:"stopPolling",value:function(){this.taskPollingTimers.forEach(function(e){clearInterval(e)}),this.taskPollingTimers.clear(),this.currentPollingTasks.clear()}},{key:"pollTaskList",value:(Te=r(h().m(function we(){var t,n,i=this;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getTaskListByStatus(ae.UNDONE);case 1:(t=e.v).filter(function(e){return!i.currentPollingTasks.has(e.taskId)}).forEach(function(e){i.startTaskPolling(e)}),n=new Set(t.map(function(e){return e.taskId})),this.currentPollingTasks.forEach(function(e,t){n.has(t)||i.stopTaskPolling(t)}),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},we,this,[[0,2]])})),function(){return Te.apply(this,arguments)})},{key:"calculateTaskPollingInterval",value:function(e){if(e.avgCost){e=e.avgCost/10;return Math.max(e,1e3)}return this.taskPollingInterval}},{key:"startTaskPolling",value:function(e){var t=this;this.taskPollingTimers.has(e.taskId)&&this.stopTaskPolling(e.taskId),this.currentPollingTasks.set(e.taskId,e),this.pollTask(e);var n=this.calculateTaskPollingInterval(e),n=window.setInterval(function(){t.pollTask(e)},n);this.taskPollingTimers.set(e.taskId,n)}},{key:"stopTaskPolling",value:function(e){var t=this.taskPollingTimers.get(e);t&&(clearInterval(t),this.taskPollingTimers["delete"](e)),this.currentPollingTasks["delete"](e)}},{key:"pollTask",value:(we=r(h().m(function we(t){var n,i,s;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.getTaskStatus(t,0);case 1:if(n=e.v){e.n=2;break}return e.a(2);case 2:s=n.taskInfo,i=s.taskStatus,s=s.taskIsDeleted,this.onTaskUpdate&&this.onTaskUpdate(t,n),i!==le.SUCCESS&&i!==le.FAILED&&1!==s||this.stopTaskPolling(t.taskId),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},we,this,[[0,3]])})),function(e){return we.apply(this,arguments)})},{key:"buildQueryString",value:function(t){var n=new URLSearchParams;return Object.keys(t).forEach(function(e){void 0!==t[e]&&null!==t[e]&&n.append(e,String(t[e]))}),n.toString()}}]),Ce=o(Le,[{key:"emitMessagesUpdate",value:function(e,t){var n,i,s;"init"===e?(s=this.getSortedMessages(),null===(i=(n=this.config).onMessagesUpdate)||void 0===i||i.call(n,s.map(function(e){return Me({},e)}),e)):null===(i=(s=this.config).onMessagesUpdate)||void 0===i||i.call(s,(null==t?void 0:t.map(function(e){return Me({},e)}))||[],e)}},{key:"getUnreadCount",value:function(){return this.messageManager.getUnreadCount()}},{key:"addMessage",value:function(e){this.messageManager.addMessage(e),this.emitMessagesUpdate("add",[e]),this.notifyUIUpdate()}},{key:"removeMessage",value:(ke=r(h().m(function Le(t){var n,i=arguments;return h().w(function(e){for(;;)switch(e.n){case 0:return n=1<i.length&&void 0!==i[1]&&i[1],e.n=1,this.messageManager.removeMessage(t,n);case 1:e.v&&(this.panelMessages=this.panelMessages.filter(function(e){return e.id!==t}),this.notifyUIUpdate(),this.refillAfterDeleteIfNeeded());case 2:return e.a(2)}},Le,this)})),function(e){return ke.apply(this,arguments)})},{key:"refillAfterDeleteIfNeeded",value:(be=r(h().m(function Le(){return h().w(function(e){for(;;)switch(e.n){case 0:if(!this.isPanelOpen||this.isRefillingAfterDelete||!this.pollingService.getHasMorePages()||this.pollingService.getIsLoadingMore())return e.a(2);e.n=1;break;case 1:if(20<=this.panelMessages.length)return e.a(2);e.n=2;break;case 2:return this.isRefillingAfterDelete=!0,e.n=3,this.pollingService.reloadFullMessages();case 3:this.isRefillingAfterDelete=!1;case 4:return e.a(2)}},Le,this)})),function(){return be.apply(this,arguments)})},{key:"clearMessages",value:(ye=r(h().m(function Le(){var t;return h().w(function(e){for(;;)switch(e.n){case 0:return t=f(this.panelMessages),e.n=1,this.messageManager.clearMessages();case 1:e.v&&(this.panelMessages=[],this.emitMessagesUpdate("delete",t),this.notifyUIUpdate());case 2:return e.a(2)}},Le,this)})),function(){return ye.apply(this,arguments)})},{key:"startPolling",value:function(e){e?"asyncTask"!==e||this.pollingService.getIsPolling("asyncTask")?"recTask"===e&&this.enableRecommend&&this.recommendNotificationEnabled&&!this.pollingService.getIsPolling("recTask")&&this.pollingService.startPolling("recTask"):this.pollingService.startPolling("asyncTask"):(this.pollingService.getIsPolling("asyncTask")||this.pollingService.startPolling("asyncTask"),this.enableRecommend&&this.recommendNotificationEnabled&&!this.pollingService.getIsPolling("recTask")&&this.pollingService.startPolling("recTask"))}},{key:"stopPolling",value:function(){this.pollingService.stopPolling()}},{key:"startListPolling",value:function(){this.enableListPolling&&this.pollingService.startListPolling()}},{key:"stopListPolling",value:function(){this.enableListPolling&&this.pollingService.stopListPolling()}},{key:"pollOnce",value:function(e){return e?"recTask"!==e||this.enableRecommend&&this.recommendNotificationEnabled?this.pollingService.pollOnce(e):Promise.resolve():this.enableRecommend&&this.recommendNotificationEnabled?this.pollingService.pollOnce():this.pollingService.pollOnce("asyncTask")}},{key:"showPanel",value:function(){var e,t,n=this;this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null),this.isPanelOpen||(this.isPanelOpen=!0,this.pollingService.stopListPolling(),this.pollingService.getIsPolling()&&(this.wasPollingBeforeOpen=!0,this.pollingService.stopPolling()),this.reloadMessages()["catch"](function(e){console.error("加载消息列表失败:",e),n.handleLoadError()})),this.clearPushNotifications(),null===(t=(e=this.config).onPanelStateUpdate)||void 0===t||t.call(e,!0),this.notifyUIUpdate()}},{key:"hidePanel",value:function(){var n=this;this.hideTimeout&&clearTimeout(this.hideTimeout),this.hideTimeout=setTimeout(function(){var e,t;n.isPanelOpen&&(n.isPanelOpen=!1,n.clearPushNotifications(),n.enableListPolling&&n.pollingService.startListPolling(),n.wasPollingBeforeOpen&&(n.pollingService.startPolling("asyncTask"),n.enableRecommend&&n.recommendNotificationEnabled&&n.pollingService.startPolling("recTask"),n.wasPollingBeforeOpen=!1)),null===(t=(e=n.config).onPanelStateUpdate)||void 0===t||t.call(e,!1),n.notifyUIUpdate(),n.hideTimeout=null},200)}},{key:"togglePanel",value:function(){this.isPanelOpen?this.hidePanel():this.showPanel()}},{key:"reloadMessages",value:(ve=r(h().m(function Le(){var t;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return this.setLoadingState(!0,!1),e.p=1,e.n=2,this.pollingService.reloadFullMessages();case 2:this.setLoadingState(!1,!1),this.notifyUIUpdate(),e.n=4;break;case 3:throw e.p=3,t=e.v,this.handleLoadError(),t;case 4:return e.a(2)}},Le,this,[[1,3]])})),function(){return ve.apply(this,arguments)})},{key:"setLoadingState",value:function(e,t){var n;this.messagePanelInstance&&((n=this.messagePanelInstance.data).set("isLoading",e),n.set("loadError",t))}},{key:"handleLoadError",value:function(){var e=this;this.setLoadingState(!1,!0),this.notifyUIUpdate(),this.loadErrorTimeout&&clearTimeout(this.loadErrorTimeout),this.loadErrorTimeout=setTimeout(function(){e.setLoadingState(!1,!1),e.notifyUIUpdate(),e.loadErrorTimeout=null},2e3)}},{key:"loadMoreMessages",value:(fe=r(h().m(function Le(){return h().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.pollingService.loadMoreMessages();case 1:return e.a(2,e.v)}},Le,this)})),function(){return fe.apply(this,arguments)})},{key:"checkNotificationPermission",value:function(){return this.notificationService.checkPermission()}},{key:"getToken",value:function(){return this.config.getToken?this.config.getToken():null}},{key:"fetchUnreadCount",value:(me=r(h().m(function Le(){var t,n,i;return h().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.pollingService.fetchUnreadCount();case 1:return!(i=e.v)||0!==i.status||null!==(t=i.data)&&void 0!==t&&t.degrade||(null===(t=(n=this.pollingService).onUnreadCountUpdate)||void 0===t||t.call(n,null!==(n=null===(n=i.data)||void 0===n?void 0:n.count)&&void 0!==n?n:0)),e.a(2,i)}},Le,this)})),function(){return me.apply(this,arguments)})},{key:"getPollingIntervalByType",value:function(e){return this.pollingService.getPollingIntervalByType(e)}},{key:"requestNotificationPermission",value:(pe=r(h().m(function Le(){return h().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.notificationService.requestPermission();case 1:return e.a(2,e.v)}},Le,this)})),function(){return pe.apply(this,arguments)})},{key:"isNotificationSupported",value:function(){return this.notificationService.isSupported()}},{key:"toggleNotification",value:(he=r(h().m(function Le(t){var n;return h().w(function(e){for(;;)switch(e.n){case 0:if(t)return e.n=1,this.requestNotificationPermission();e.n=2;break;case 1:n=e.v,this.notificationService.setEnabled(n===w.GRANTED),localStorage.setItem(j,String(n===w.GRANTED)),e.n=3;break;case 2:this.notificationService.setEnabled(!1),localStorage.setItem(j,"false");case 3:this.notifyUIUpdate();case 4:return e.a(2)}},Le,this)})),function(e){return he.apply(this,arguments)})},{key:"toggleRecommendNotification",value:function(e){this.recommendNotificationEnabled=e,localStorage.setItem(H,String(e)),this.enableRecommend&&(e?this.pollingService.startPolling("recTask"):this.pollingService.stopPolling("recTask")),this.notifyUIUpdate()}},{key:"destroy",value:function(){var e,t,n;this.loadErrorTimeout&&(clearTimeout(this.loadErrorTimeout),this.loadErrorTimeout=null),this.messagePanelInstance&&(null===(t=(e=this.messagePanelInstance).dispose)||void 0===t||t.call(e)),this.settingsModalInstance&&(null===(n=(t=this.settingsModalInstance).dispose)||void 0===n||n.call(t)),this.clearPushNotifications(),this.pollingService.destroy(),this.logListener&&"undefined"!=typeof document&&((n=this.config.logContainer)&&this.logListener.destroy(n),this.logListener=null),this.eventListeners.clear()}},{key:"init",value:function(){var t=this,e=localStorage.getItem(H);this.recommendNotificationEnabled=null===e||"true"===e,this.setupCallbacks(),this.syncNotificationState(),this.setupLogListener(),this.pollingService.fetchAndUpdatePollingConfig().then(function(){t.enableListPolling&&t.pollingService.startListPolling()})["catch"](function(e){console.error("Fetch polling config failed:",e),t.enableListPolling&&t.pollingService.startListPolling()}),this.enableListPolling&&this.fetchInitialUnreadCount()["catch"](function(e){return console.error("Init unread count failed:",e)}),this.preloadMessages()}},{key:"setupLogListener",value:function(){var e,t=this;"undefined"==typeof document||(e=this.config.logContainer)&&(this.logListener=new X,this.logListener.init(e,function(e){t.emit("log",e)}))}},{key:"on",value:function(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}},{key:"off",value:function(e,t){e=this.eventListeners.get(e);e&&(t?e["delete"](t):e.clear())}},{key:"emit",value:function(t,n){var e=this.eventListeners.get(t);e&&e.forEach(function(e){try{e(n)}catch(n){console.error("事件 ".concat(t," 的回调执行失败:"),n)}})}},{key:"setupCallbacks",value:function(){var o,a=this;this.messageManager.setOnNewMessage(function(e){a.shouldPush(e)&&(a.isPageVisible()||a.notificationService.showSystemNotification(e)["catch"](function(e){console.error("显示系统通知失败:",e)}),a.notifyUIUpdate([e]))}),this.messageManager.setOnMessageRead(function(){a.notifyUIUpdate()}),this.pollingService.setOnCheckHasPushNotification(function(){return 0<a.pushNotificationInstances.size}),this.pollingService.setOnUnreadCountUpdate((o=r(h().m(function o(t){var n,i,s;return h().w(function(e){for(;;)switch(e.n){case 0:if(s=a.messageManager.getUnreadCount(),a.messageManager.updateUnreadCountDynamically(t),null===(i=(n=a.config).onUnreadCountUpdate)||void 0===i||i.call(n,t),s<t)return e.n=1,a.pollOnce();e.n=1;break;case 1:t===s||a.isPanelOpen||a.preloadMessages();case 2:return e.a(2)}},o)})),function(e){return o.apply(this,arguments)})),this.pollingService.setOnRiskListUpdate(function(e){var t,n;null===(n=(t=a.config).onRiskListUpdate)||void 0===n||n.call(t,e)}),this.pollingService.setOnMessagesUpdate(function(e,t,n){var i,e=e;t?(i=(a.panelMessages=e).filter(function(e){return!e.read}).length,a.messageManager.setUnreadCount(i),a.emitMessagesUpdate("init"),a.notifyUIUpdate()):n?(a.panelMessages=[].concat(f(a.panelMessages),f(e)),a.messageManager.addIncrementalMessages(e,!0),a.emitMessagesUpdate("add",e),a.notifyUIUpdate()):(a.messageManager.addIncrementalMessages(e,!1),a.emitMessagesUpdate("add",e),!a.isPanelOpen&&0<e.length&&a.preloadMessages(),n=0<(i=e.filter(function(e){return!e.read})).length,e=a.isPageVisible(),n&&e?a.notifyUIUpdate(i):(n&&!e&&i.forEach(function(e){a.shouldPush(e)&&a.notificationService.showSystemNotification(e)["catch"](function(e){console.error("显示系统通知失败:",e)})}),a.notifyUIUpdate()))})}},{key:"notifyUIUpdate",value:function(e){var t,n,i=this.messageManager.getUnreadCount();null===(n=(t=this.config).onUnreadCountUpdate)||void 0===n||n.call(t,i),this.handlePushNotifications(e),this.config.messagePanelContainer&&this.renderMessagePanel()}},{key:"getSortedMessages",value:function(){return this.panelMessages}},{key:"renderMessagePanel",value:function(){var e,n,i,s=this;if(e=this.config.messagePanelContainer){var t=this.getSortedMessages();if(this.updatePanelPosition(),this.messagePanelInstance)this.messagePanelInstance.data.assign({hasMore:this.pollingService.getHasMorePages(),isLoadingMore:this.pollingService.getIsLoadingMore(),messages:t,notificationSupported:this.notificationService.isSupported(),notificationEnabled:this.notificationService.getEnabled(),showPanel:this.isPanelOpen,maxLimitMessages:this.maxLimitMessages,maxLimitTime:this.maxLimitTime,showSettings:this.showSettings}),this.isPanelOpen?this.attachMessagePanel(e):this.messagePanelInstance.detach();else{if(!this.isPanelOpen)return;this.messagePanelInstance=new ne({data:{hasMore:this.pollingService.getHasMorePages(),isLoadingMore:this.pollingService.getIsLoadingMore(),isLoading:!1,loadError:!1,messages:t,notificationSupported:this.notificationService.isSupported(),notificationEnabled:this.notificationService.getEnabled(),showPanel:this.isPanelOpen,maxLimitMessages:this.maxLimitMessages,maxLimitTime:this.maxLimitTime,showSettings:this.showSettings}}),this.messagePanelInstance.on("mouseenter",function(){return s.showPanel()}),this.messagePanelInstance.on("mouseleave",function(){return s.hidePanel()}),this.messagePanelInstance.on("message-click",(i=r(h().m(function i(t){return h().w(function(e){for(;;)switch(e.n){case 0:return s.emitMessagesUpdate("delete",[t]),e.n=1,s.removeMessage(t.id,!0);case 1:s.config.onMessageClick&&s.config.onMessageClick(t),s.hidePanel();case 2:return e.a(2)}},i)})),function(e){return i.apply(this,arguments)})),this.messagePanelInstance.on("message-remove",(n=r(h().m(function n(t){return h().w(function(e){for(;;)switch(e.n){case 0:return s.emitMessagesUpdate("delete",[t]),e.n=1,s.removeMessage(t.id);case 1:return e.a(2)}},n)})),function(e){return n.apply(this,arguments)})),this.messagePanelInstance.on("load-more",r(h().m(function e(){return h().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s.loadMoreMessages();case 1:s.notifyUIUpdate();case 2:return e.a(2)}},e)}))),this.messagePanelInstance.on("clear-all",r(h().m(function e(){return h().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,s.clearMessages();case 1:return e.a(2)}},e)}))),this.messagePanelInstance.on("notification-toggle",function(e){return s.toggleNotification(e)}),this.messagePanelInstance.on("close-panel",function(){return s.hidePanel()}),this.messagePanelInstance.on("show-settings-modal",function(){return s.showSettingsModal()}),this.attachMessagePanel(e)}this.renderSettingsModal()}}},{key:"showSettingsModal",value:function(){this.syncNotificationState(),this.syncRecommendNotificationState(),this.isSettingsModalOpen=!0,this.renderSettingsModal()}},{key:"syncRecommendNotificationState",value:function(){var e=localStorage.getItem(H);this.recommendNotificationEnabled=null===e||"true"===e}},{key:"hideSettingsModal",value:function(){this.isSettingsModalOpen=!1,this.renderSettingsModal()}},{key:"renderSettingsModal",value:function(){var e,t,n=this,i=this.config.settingsModalContainer;i&&(this.settingsModalInstance?(e=(t=this.notificationService.checkPermission())!==w.DENIED&&this.notificationService.getEnabled(),this.settingsModalInstance.data.assign({isOpen:this.isSettingsModalOpen,notificationSupported:this.notificationService.isSupported(),notificationEnabled:e,recommendNotificationEnabled:this.recommendNotificationEnabled,enableRecommend:this.enableRecommend,browserNotificationPermissionGranted:t===w.GRANTED,browserNotificationPermissionDenied:t===w.DENIED})):(t=(e=this.notificationService.checkPermission())!==w.DENIED&&this.notificationService.getEnabled(),this.settingsModalInstance=new ce({data:{isOpen:this.isSettingsModalOpen,notificationSupported:this.notificationService.isSupported(),notificationEnabled:t,recommendNotificationEnabled:this.recommendNotificationEnabled,enableRecommend:this.enableRecommend,browserNotificationPermissionGranted:e===w.GRANTED,browserNotificationPermissionDenied:e===w.DENIED}}),this.settingsModalInstance.on("close",function(){return n.hideSettingsModal()}),this.settingsModalInstance.on("toggle-recommend",function(e){n.toggleRecommendNotification(e)}),this.settingsModalInstance.on("toggle-notification",function(e){n.toggleNotification(e)}),this.settingsModalInstance.on("check-permission",function(){var e=n.notificationService.checkPermission(),t=e!==w.DENIED&&n.notificationService.getEnabled();n.settingsModalInstance.data.assign({browserNotificationPermissionGranted:e===w.GRANTED,browserNotificationPermissionDenied:e===w.DENIED,notificationEnabled:t})}),this.settingsModalInstance.attach(i)))}},{key:"updateContainerPosition",value:function(e,t){var n=this.config.messageCenterIcon;n&&e&&(e.style.position="fixed",n=n.getBoundingClientRect(),e.style.top="".concat(n.bottom+t,"px"),this.updateContainerRightOffset(e))}},{key:"updateContainerRightOffset",value:function(e){var t,n,i;"undefined"!=typeof window&&(t=window.innerWidth||(null===(i=document.documentElement)||void 0===i?void 0:i.clientWidth)||0,i=null!==(i=null==(i=null===(i=null==(n=this.config.referenceSelector?document.querySelector(this.config.referenceSelector):document.body)?void 0:n.getBoundingClientRect)||void 0===i?void 0:i.call(n))?void 0:i.right)&&void 0!==i?i:t,i=Math.max(0,t-i+Le.RIGHT_GAP_PX),e.style.right="".concat(i,"px"),e.style.left="auto")}},{key:"updatePanelPosition",value:function(){this.updateContainerPosition(this.config.messagePanelContainer,9)}},{key:"updatePushNotificationsPosition",value:function(){this.updateContainerPosition(this.config.pushNotificationsContainer,18)}},{key:"handlePushNotifications",value:function(e){e&&0<e.length&&((e=e.slice().filter(function(e){return!e.read}).sort(function(e,t){var n=null!==(i=e.priority)&&void 0!==i?i:0,i=null!==(i=t.priority)&&void 0!==i?i:0;if(n!==i)return i-n;e=(null===(e=e.showData)||void 0===e?void 0:e.createTime)||0;return((null===(t=t.showData)||void 0===t?void 0:t.createTime)||0)-e})[0])&&e.id&&!this.shownPushIds.has(e.id)&&this.addPushNotification(e))}},{key:"addPushNotification",value:function(e){var t=this;if(this.shouldPush(e))if(e.id){if(0<this.pushNotificationInstances.size){var n=!1;if(this.pushNotificationInstances.forEach(function(e){e&&"function"==typeof e.getIsHovering&&e.getIsHovering()&&(n=!0)}),n)return;this.clearPushNotifications()}if(this.updatePushNotificationsPosition(),this.shownPushIds.add(e.id),this.config.pushNotificationsContainer)try{var i=new se({data:{message:Me({},e)}});i.on("close",function(e){return t.removePushNotification(e)}),i.on("click",function(e){t.emitMessagesUpdate("delete",[e]),t.removeMessage(e.id,!0),t.config.onMessageClick&&t.config.onMessageClick(e)}),i.attach(this.config.pushNotificationsContainer),this.pushNotificationInstances.set(e.id,i),this.observeNewElements(this.config.pushNotificationsContainer)}catch(t){console.error("创建推送通知失败:",t),this.shownPushIds["delete"](e.id)}}else console.warn("消息缺少 ID,无法显示推送通知")}},{key:"attachMessagePanel",value:function(e){this.messagePanelInstance.attach(e),this.config.messagePanelContainer&&this.observeNewElements(this.config.messagePanelContainer),this.updatePanelPosition()}},{key:"observeNewElements",value:function(e){this.logListener&&e&&this.logListener.observeNewElements(e)}},{key:"disposePushNotificationInstance",value:function(e){"function"==typeof e.dispose?e.dispose():"function"==typeof e.detach&&e.detach()}},{key:"removePushNotification",value:function(e){var t;e&&(this.shownPushIds["delete"](e),(t=this.pushNotificationInstances.get(e))&&(this.disposePushNotificationInstance(t),this.pushNotificationInstances["delete"](e)))}},{key:"clearPushNotifications",value:function(){var t=this;this.shownPushIds.clear(),this.pushNotificationInstances.forEach(function(e){t.disposePushNotificationInstance(e)}),this.pushNotificationInstances.clear(),this.config.pushNotificationsContainer&&(this.config.pushNotificationsContainer.innerHTML="")}},{key:"syncNotificationState",value:function(){var e=this.notificationService.checkPermission(),t=!1;try{var n,t=(null===(n=localStorage.getItem(j))||"true"===n)&&e===w.GRANTED}catch(n){t=e===w.GRANTED}this.notificationService.setEnabled(t)}},{key:"isPageVisible",value:function(){return"undefined"!=typeof document&&!document.hidden&&"visible"===document.visibilityState}},{key:"shouldPush",value:function(t){if(t.id&&this.panelMessages.some(function(e){return e.id===t.id}))return!1;if(this.config.shouldPushNotification)try{return!0===this.config.shouldPushNotification(t)}catch(t){return console.warn("推送判断函数执行失败,默认允许推送:",t),!0}return!0}},{key:"preloadMessages",value:(de=r(h().m(function Le(){var t;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.pollingService.reloadFullMessages();case 1:e.n=3;break;case 2:e.p=2,t=e.v,console.warn("预加载消息列表失败:",t);case 3:return e.a(2)}},Le,this,[[0,2]])})),function(){return de.apply(this,arguments)})},{key:"fetchInitialUnreadCount",value:(ge=r(h().m(function Le(){var t,n,i;return h().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this.pollingService.fetchUnreadCount();case 1:!(n=e.v)||0!==n.status||null!==(t=n.data)&&void 0!==t&&t.degrade||(this.messageManager.updateUnreadCountDynamically(null===(i=n.data)||void 0===i?void 0:i.count),null===(i=(t=this.config).onUnreadCountUpdate)||void 0===i||i.call(t,null===(n=n.data)||void 0===n?void 0:n.count)),e.n=3;break;case 2:e.p=2,i=e.v,console.error("初始化获取未读数量失败:",i);case 3:return e.a(2)}},Le,this,[[0,2]])})),function(){return ge.apply(this,arguments)})}]);function Le(e){a(this,Le),this.messagePanelInstance=null,this.pushNotificationInstances=new Map,this.shownPushIds=new Set,this.wasPollingBeforeOpen=!1,this.isPanelOpen=!1,this.hideTimeout=null,this.settingsModalInstance=null,this.isSettingsModalOpen=!1,this.loadErrorTimeout=null,this.logListener=null,this.recommendNotificationEnabled=!0,this.showSettings=!0,this.enableRecommend=!0,this.enableListPolling=!1,this.maxLimitMessages=void 0,this.maxLimitTime=void 0,this.isRefillingAfterDelete=!1,this.panelMessages=[],this.eventListeners=new Map;var t=e.shouldPushNotification;this.config={baseUrl:e.baseUrl||"/",messageCenterIcon:e.messageCenterIcon,logContainer:e.logContainer,messagePanelContainer:e.messagePanelContainer,pushNotificationsContainer:e.pushNotificationsContainer,settingsModalContainer:e.settingsModalContainer,referenceSelector:e.referenceSelector,onMessageClick:e.onMessageClick||null,onMessagesUpdate:e.onMessagesUpdate,onUnreadCountUpdate:e.onUnreadCountUpdate,onPanelStateUpdate:e.onPanelStateUpdate,onRiskListUpdate:e.onRiskListUpdate,shouldPushNotification:"function"==typeof t?t:null,onNotificationClick:e.onNotificationClick||null,getToken:"function"==typeof e.getToken?e.getToken:null,from:e.from||"",getFrom:"function"==typeof e.getFrom?e.getFrom:null},this.enableRecommend=null===(t=e.enableRecommend)||void 0===t||t,this.enableListPolling=null!==(t=e.enableListPolling)&&void 0!==t&&t,this.maxLimitMessages=e.maxLimitMessages,this.maxLimitTime=e.maxLimitTime,this.showSettings=null===(e=e.showSettings)||void 0===e||e,this.messageManager=new G(this.config.baseUrl,this.config.getToken,this.config.from,this.config.getFrom),this.pollingService=new F(this.config.baseUrl,{recTask:5e4,asyncTask:8e3},20,this.config.getToken,this.config.from,this.config.getFrom),this.notificationService=new Y,this.config.onNotificationClick&&this.notificationService.setOnNotificationClick(this.config.onNotificationClick),this.init()}Ce.RIGHT_GAP_PX=24,e.AsyncTaskService=Ee,e.MessageCenter=Ce,e["default"]=Ce,Object.defineProperty(e,"__esModule",{value:!0})},"object"==Ne(n)&&void 0!==t?e(n,i(0)):(o=[n,i(0)],(a="function"==typeof(s=e)?s.apply(n,o):s)===undefined||(t.exports=a))}.apply(n,o))===undefined||(t.exports=a)},837:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initTtsGuide=t.TOOLTIP_EVENT=t.dismissTooltip=t.showTooltip=void 0;var d=n(54),c=n(28),h="feed-list-tooltip-style",p="feed-tooltip:show",m="feed-tooltip:hide",f="feed-tooltip:destroy",v=6,y=3;function u(e){var t=window.$,n=e.root,i=e.text,s=void 0===i?"":i,o=e.time,a=void 0===o?3e3:o,i=e.position,o=void 0===i?"top":i,i=e.edgeThreshold,e=void 0===i?8:i;document.getElementById(h)||((l=document.createElement("style")).id=h,l.textContent="\n .feed-tooltip-wrap {\n position: absolute;\n z-index: 10000;\n pointer-events: none;\n opacity: 0;\n transition: opacity .25s ease;\n }\n .feed-tooltip-wrap.feed-tooltip-visible {\n opacity: 1;\n }\n .feed-tooltip-bubble {\n position: relative;\n padding: 13.5px 12px;\n background-color: #FFFFFF;\n border-radius: 12px;\n color: var(--exp-color-text-deep, #333333);\n font-size: 13px;\n line-height: 13px;\n white-space: nowrap;\n box-shadow: 0 6px 21px #1e1f2433;\n }\n .feed-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-style: solid;\n }\n /* top: 气泡在 root 上方,三角在气泡底部向下指 */\n .feed-tooltip-wrap.feed-tooltip-pos-top .feed-tooltip-arrow {\n bottom: -"+v+"px;\n left: 50%;\n transform: translateX(-50%);\n border-width: "+v+"px "+v+"px 0 "+v+"px;\n border-color: #ffffff transparent transparent transparent;\n }\n /* bottom: 气泡在 root 下方,三角在气泡顶部向上指 */\n .feed-tooltip-wrap.feed-tooltip-pos-bottom .feed-tooltip-arrow {\n top: -"+v+"px;\n left: 50%;\n transform: translateX(-50%);\n border-width: 0 "+v+"px "+v+"px "+v+"px;\n border-color: transparent transparent #ffffff transparent;\n }\n /* left: 气泡在 root 左侧,三角在气泡右侧向右指 */\n .feed-tooltip-wrap.feed-tooltip-pos-left .feed-tooltip-arrow {\n right: -"+v+"px;\n top: 50%;\n transform: translateY(-50%);\n border-width: "+v+"px 0 "+v+"px "+v+"px;\n border-color: transparent transparent transparent #ffffff;\n }\n /* right: 气泡在 root 右侧,三角在气泡左侧向左指 */\n .feed-tooltip-wrap.feed-tooltip-pos-right .feed-tooltip-arrow {\n left: -"+v+"px;\n top: 50%;\n transform: translateY(-50%);\n border-width: "+v+"px "+v+"px "+v+"px 0;\n border-color: transparent #ffffff transparent transparent;\n }\n ",document.head.appendChild(l));i=n.offsetParent||document.body;"static"===getComputedStyle(i).position&&(i.style.position="relative");var r=document.createElement("div");r.className="feed-tooltip-wrap feed-tooltip-pos-"+o;var l=document.createElement("div");l.className="feed-tooltip-bubble",l.textContent=s;s=document.createElement("div");s.className="feed-tooltip-arrow",l.appendChild(s),r.appendChild(l),i.appendChild(r),function(e,t,n,i,s){var o=e.getBoundingClientRect(),a=t.getBoundingClientRect(),e=(f=e.offsetParent||document.body).getBoundingClientRect(),r=o.left-e.left+f.scrollLeft,l=o.top-e.top+f.scrollTop,c=o.width,u=o.height,g=a.width,d=a.height,o=window.innerWidth,h=0,p=0;switch(i){case"top":h=r+(c-g)/2,p=l-d-y;break;case"bottom":h=r+(c-g)/2,p=l+u+y;break;case"left":h=r-g-y,p=l+(u-d)/2;break;case"right":h=r+c+y,p=l+(u-d)/2}var m,e=(a=h+e.left-f.scrollLeft)+g,f=0;"top"!==i&&"bottom"!==i||(a<s?(h+=m=s-a,f=-m):o-s<e&&(h-=m=e-(o-s),f=m)),t.style.left=h+"px",t.style.top=p+"px",0!==f&&("top"!==i&&"bottom"!==i||(n.style.left="calc(50% + "+f+"px)"))}(n,r,s,o,e);var c=!1,u=null,g=function(){var e;c||(c=!0,r.classList.remove("feed-tooltip-visible"),e=function(){r.removeEventListener("transitionend",e),r.parentNode&&r.parentNode.removeChild(r)},r.addEventListener("transitionend",e),setTimeout(e,350),u&&clearTimeout(u),t(window).trigger(m))};return t(window).on(f,function(){g()}),r.offsetHeight,r.classList.add("feed-tooltip-visible"),t(window).trigger(p),(0,d.sendTooltipLog)({type:d.LOG_TYPE.SHOW,value:"kt_tooltip"}),u=setTimeout(g,a),{destroy:g}}function g(){(0,window.$)(window).trigger(f)}t.showTooltip=u,t.dismissTooltip=g,t.TOOLTIP_EVENT={SHOW:p,HIDE:m,DESTROY:f},t.initTtsGuide=function(){var e,t,n,i,s,o,a,r,l;c.IS_TTS_SHIELD||(e=window.$,"open"!==localStorage.getItem(c.STORAGE_KEY.TTS_SETTING)&&"1"!==localStorage.getItem(c.STORAGE_KEY.TTS_GUIDE_SHOWN)&&(n=t=!1,l=o=null,(i=document.querySelector("#s-usersetting-top"))&&(i.addEventListener("mouseenter",function(){n=!0,g(),o&&(clearTimeout(o),o=null)}),i.addEventListener("mouseleave",function(){n=!1})),s=function(){t||n||(t=!0,localStorage.setItem(c.STORAGE_KEY.TTS_GUIDE_SHOWN,"1"),u({root:i,text:c.TTS_TEXT.GUIDE_TOOLTIP,time:3e3,position:"bottom",edgeThreshold:18}))},o=setTimeout(s,3e3),(a=document.querySelector("#chat-textarea"))&&a.addEventListener("input",function(){o&&(clearTimeout(o),o=null),t||n||(o=setTimeout(s,3e3))}),r=document.querySelector("#head"),l=function(){s(),r&&l&&(r.removeEventListener("scroll",l),l=null)},r&&l&&r.addEventListener("scroll",l),e(window).on(c.GLOBAL_EVENT.CHAT_INPUT_FIRST_CLICK,function(){t||o&&(clearTimeout(o),o=null)})))}},9:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUbcInstanceWithUbcid=t.getUbcInstance=void 0;var o=(i.getInstance=function(){return i.instance||(i.instance=new i).initUbc(),i.instance},i.prototype.initUbc=function(t,n,i,s){var o=this;void 0===t&&(t=19632),void 0===n&&(n="pcsearch"),void 0===i&&(i="search"),void 0===s&&(s="home"),this.ubcInstance||window.require(["superman/components/ubc"],function(e){o.ubcInstance||(e=e.Ubc,o.ubcInstance=new e(window.require,{ubcid:t,appname:n,from:i,page:s}))})},i.prototype.getUbc=function(){return this.ubcInstance},i);function i(){this.ubcInstance=null}t.getUbcInstance=function(){return o.getInstance().getUbc()},t.getUbcInstanceWithUbcid=function(e,t,n,i){var s=new o;return null!=s&&s.initUbc(e,t,n,i),null==s?void 0:s.getUbc()}}},r={},o.m=a,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="https://pss.bdstatic.com",o(o.s=833);function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}var a,r});