"use strict";(self.webpackChunkflow_web_extension=self.webpackChunkflow_web_extension||[]).push([["97049"],{376180:function(e,n,i){i.d(n,{Ts:()=>a,ev:()=>s,sl:()=>d});var t,s=((t={}).Auto="2",t.On="1",t.Off="0",t),a=(e,n)=>{var{deepThinkingAutoCotMode:i,deepThinkingSwitchUseAutoCot:t,deepThinkingSwitchValue:s,enableDeepThinkingAutoMode:a}=e;return n?"0":("optional"===i&&t||"hidden_force"===i)&&a?"2":s?"1":"0"},d=()=>!0},83345:function(e,n,i){i.r(n),i.d(n,{DemoMessageLifeCyclePlugin:()=>c});var t=i(698127),s=i(706790),a=i(407690),d=i(932842),o=i(595159),r=i(376180),l=i(825010),g=i(26980),_=i(195693),u=(e,n,i,s)=>{try{var a,d,o=g.vh.get("chatTeaService"),r={total_duration:Date.now()-(null!=n?n:0),first_token_duration:i,is_finished:1,whether_browsing:null!=s?s:0,skill_id:null==e?void 0:null===(a=e.skill)||void 0===a?void 0:a.skill_id_no_default,skill_name:(0,_.Nu)(null==e?void 0:null===(d=e.skill)||void 0===d?void 0:d.skill_type_no_default),conversation_id:null==e?void 0:e.conversation_id,bot_id:null==e?void 0:e.bot_id,message_id:null==e?void 0:e.message_id};null==o||o.trackEvent("deep_thinking_main_text_end",(0,t._)({},r))}catch(e){}};class v{static getInstance(){return v.instance||(v.instance=new v),v.instance}setReceivingMessageStartTime(e,n){e&&"number"==typeof n&&this.messageIdToStartTimeMap.set(e,n)}setMessageSendingEndTime(e,n){e&&"number"==typeof n&&this.messageIdToSendingEndTimeMap.set(e,n)}getReceivingMessageStartTime(e){var n;return null!==(n=this.messageIdToStartTimeMap.get(e))&&void 0!==n?n:0}getMessageSendingEndTime(e){var n;return null!==(n=this.messageIdToSendingEndTimeMap.get(e))&&void 0!==n?n:0}resetMessageTime(e,n){e&&this.messageIdToStartTimeMap.has(e)&&this.messageIdToStartTimeMap.delete(e),n&&this.messageIdToSendingEndTimeMap.has(n)&&this.messageIdToSendingEndTimeMap.delete(n)}constructor(){this.messageIdToStartTimeMap=new Map,this.messageIdToSendingEndTimeMap=new Map}}class c{processMessageBefore(e,n){var i=(0,d.GX)("deepThinkingControlStore");if(!i.uiHasDeepThinkBtn)return n;var a=(0,r.Ts)(i,i.uiHasDeepThinkBtnDisabled);return n.map(e=>{var n;return(0,s._)((0,t._)({},e),{extraExt:(null===(n=e.extraExt)||void 0===n?void 0:n.use_deep_think)?e.extraExt:(0,s._)((0,t._)({},e.extraExt),{use_deep_think:a})})})}beforeMessageSending(e,n){if(!n.content_blocks_v2)return n;var i=(0,d.GX)("deepThinkingControlStore");if(!i.uiHasDeepThinkBtn)return n;var a=(0,r.Ts)(i,i.uiHasDeepThinkBtnDisabled);return n.ext=(0,s._)((0,t._)({},n.ext),{use_deep_think:a}),n}onMessageSendingEnd(e,n){return n.message_id&&v.getInstance().setMessageSendingEndTime(n.message_id,Date.now()),n}onMessageReceivingStart(e,n){return n.message_id&&v.getInstance().setReceivingMessageStartTime(n.message_id,Date.now()),n}onMessageReceivingEnd(e,n){try{if((0,o.Rp)(n)){var i,t,s,d,r,l=v.getInstance().getReceivingMessageStartTime(null!==(d=n.message_id)&&void 0!==d?d:""),g=v.getInstance().getMessageSendingEndTime(null!==(r=n.reply_id)&&void 0!==r?r:""),_=!!((null==n?void 0:null===(t=n.content_blocks)||void 0===t?void 0:t.some(e=>(null==e?void 0:e.block_type)===a.zc.BLOCK_SEARCH_QUERY_RESULT))||(null==n?void 0:null===(s=n.content_blocks_v2)||void 0===s?void 0:s.some(e=>(null==e?void 0:e.block_type)===a.zc.BLOCK_SEARCH_QUERY_RESULT)));u(n,l,l-g,+!!_)}n.message_id&&v.getInstance().resetMessageTime(n.message_id,null!==(i=n.reply_id)&&void 0!==i?i:"")}catch(e){}return n}constructor(){this.pluginIdentifier=l.f}}}}]);
//# sourceMappingURL=97049.js.map