Files
deepdata/my_ops/markitdown_parser/index_files/all-async-search-b0909bd9_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

11 lines
773 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
define('all_async_search',['require','exports','san','head-script/pc/static/index','head-script/pc/static/page-log/ubc-log','bottom-script/pc/static/instant-search-newi','modules/pc/static/services/load-more/results-page-context','modules/pc/static/page/main-page.module','@baidu/webb','@baidu/chat-pcsearch-common','@baidu/inject-js','@baidu/www-api','@baidu/ai-search-box-entry'],(function(require,exports,san,headScript_pc_static_index,headScript_pc_static_pageLog_ubcLog,bottomScript_pc_static_instantSearchNewi,modules_pc_static_services_loadMore_resultsPageContext,modules_pc_static_page_mainPage_module,Webb,chatPcsearchCommon,modules_pc_static_services_injectJs,wwwApi,aiSearchBoxEntry){;"use strict";var CardLogManager=function(){function e(){this.sendLogList=[],this.sendSubLogList=[],this.exposed=new Map,this.cardExtraMap=new Map,this.cardExtra={},this.domMutationObserver=null,this.observedSubEls="undefined"!=typeof WeakSet?new WeakSet:null,this.observedSubElsFallback=[],this.areaMap={left:"LEFT",right:"RIGHT",top:"TOP"};this.cardObserver=new IntersectionObserver(this.callback.bind(this),{root:null,rootMargin:"0px",threshold:.6}),"undefined"!=typeof MutationObserver&&(this.domMutationObserver=new MutationObserver(this.handleMutations.bind(this)))}return e.prototype.checkAndLogExposure=function(e){var t;for(var n in e)for(var i=e[n],a=0;a<i.length;a++){var o=i[a],s=o.isSubEl?o.subEl:o,r=this.cardExtraMap.get(s)||{};o.isSubEl?this.cardExtra=Object.assign(r,{area:this.areaMap[n],cardEl:o.cardEl,isSubEl:!0}):this.cardExtra=Object.assign(r,{area:this.areaMap[n]}),this.cardExtraMap.set(s,this.cardExtra),null===(t=this.cardObserver)||void 0===t||t.observe(s)}},e.prototype.getSubElements=function(e){var t=[];return null==e||e.forEach((function(e){var n;null===(n=null==Array?void 0:Array.from(null==e?void 0:e.querySelectorAll("[sub-show]")))||void 0===n||n.forEach((function(n){t.push({cardEl:e,subEl:n,isSubEl:!0})}))})),t},e.prototype.setPosition=function(){var e=$("#content_left").find(".result-op, .result").get(),t=$("#content_right").find(".result-op, .result").get(),n=$("#con-at").find(".result-op, .result").get(),i={};return i.left=e.concat(this.getSubElements(e)),i.right=t.concat(this.getSubElements(t)),i.top=n.concat(this.getSubElements(n)),i},e.prototype.callback=function(e,t){var n=this;null==e||e.forEach((function(e){var t,i=null==e?void 0:e.target;if(null==e?void 0:e.isIntersecting){if(!n.exposed.get(i)){var a=n.cardExtraMap.get(i)||{};n.cardExtra=Object.assign(a,{show_ts:Date.now()+""}),n.cardExtraMap.set(i,n.cardExtra),(null===(t=n.cardExtra)||void 0===t?void 0:t.isSubEl)?(n.sendSubLogList.push({el:i,card_extra:n.cardExtraMap.get(i)}),5===n.sendSubLogList.length&&(headScript_pc_static_pageLog_ubcLog.sendCardLog(19134,n.sendSubLogList),n.sendSubLogList=[])):(n.sendLogList.push({el:i,card_extra:n.cardExtraMap.get(i)}),5===n.sendLogList.length&&(headScript_pc_static_pageLog_ubcLog.sendCardLog(19083,n.sendLogList),n.sendLogList=[])),n.exposed.set(i,!0)}}else n.exposed.set(i,!1)}))},e.prototype.handleDomReady=function(){bds.comm&&!bds.comm.ishome&&headScript_pc_static_pageLog_ubcLog.sendUbcLog(19052,"display");var e=this.setPosition();this.checkAndLogExposure(e),this.startDomObserve()},e.prototype.observeChunk=function(e){if(e){var t=Array.from(e.querySelectorAll(".result-op, .result"));t.length&&this.checkAndLogExposure({left:t.concat(this.getSubElements(t))})}},e.prototype.flushLogs=function(){this.sendLogList.length>0&&(headScript_pc_static_pageLog_ubcLog.sendCardLog(19083,this.sendLogList),headScript_pc_static_pageLog_ubcLog.sendCardLog(19134,this.sendSubLogList),this.sendLogList=[],this.sendSubLogList=[]),this.stopDomObserve()},e.prototype.destroy=function(){var e;this.flushLogs(),null===(e=this.cardObserver)||void 0===e||e.disconnect(),this.exposed.clear(),this.cardExtraMap.clear()},e.prototype.hasObserved=function(e){return this.observedSubEls?this.observedSubEls.has(e):-1!==this.observedSubElsFallback.indexOf(e)},e.prototype.markObserved=function(e){this.observedSubEls?this.observedSubEls.add(e):this.observedSubElsFallback.push(e)},e.prototype.getAreaByCardEl=function(e){var t=document.getElementById("content_left"),n=document.getElementById("content_right"),i=document.getElementById("con-at");return t&&t.contains(e)?"left":n&&n.contains(e)?"right":i&&i.contains(e)?"top":null},e.prototype.observeDynamicSubElement=function(e,t,n){if(!this.hasObserved(t)){this.markObserved(t);var i={area:this.areaMap[n],cardEl:e,isSubEl:!0};this.cardExtraMap.set(t,i),this.cardObserver.observe(t)}},e.prototype.handleMutations=function(e){var t,n,i=this;try{for(var a=headScript_pc_static_index.__values(e),o=a.next();!o.done;o=a.next()){var s=o.value.addedNodes;s&&s.length&&s.forEach((function(e){if(1===e.nodeType){var t=e,n=t.closest(".result-op, .result");if(n){var a=i.getAreaByCardEl(n);a&&(t.hasAttribute("sub-show")&&i.observeDynamicSubElement(n,t,a),t.querySelectorAll("[sub-show]").forEach((function(e){i.observeDynamicSubElement(n,e,a)})))}}}))}}catch(r){t={error:r}}finally{try{o&&!o.done&&(n=a["return"])&&n.call(a)}finally{if(t)throw t.error}}},e.prototype.startDomObserve=function(){var e=this;this.domMutationObserver&&["content_left","content_right","con-at"].forEach((function(t){var n=document.getElementById(t);n&&e.domMutationObserver.observe(n,{childList:!0,subtree:!0})}))},e.prototype.stopDomObserve=function(){this.domMutationObserver&&this.domMutationObserver.disconnect()},e}(),instance=null;function getCardLogManager(){return instance||(instance=new CardLogManager),instance}function destroyCardLogManager(){instance&&(null==instance||instance.destroy(),instance=null)}function isOldIE(){return!!window.ActiveXObject&&(!document.documentMode||document.documentMode<=9)}window.__getCardLogManager=getCardLogManager;var feedbackIconShow="https://pss.bdstatic.com/r/www/cache/static/protocol/https/feedback/pc/static/img/feedback_icon_show-f6c1ec579cc656ac.png",feedbackCloseIcon="https://pss.bdstatic.com/r/www/cache/static/protocol/https/feedback/pc/static/img/feedback_close_icon-b224e1d4818f59a3.png",feedbackUp="https://pss.bdstatic.com/r/www/cache/static/protocol/https/feedback/pc/static/img/feedback_up-015662e59a0dcd48.png",feedbackSFZ="https://pss.bdstatic.com/r/www/cache/static/protocol/https/feedback/pc/static/img/feedback_sfz-076d5afd393985de.png",feedbackSFZ1="https://pss.bdstatic.com/r/www/cache/static/protocol/https/feedback/pc/static/img/feedback_sfz1-5a4bd4a1ec33c705.png";function feedbackInit(){var e=".result-op, .result-wise, .result-molecule, .result";function t(){var e=window.bds.comm.nodeSample||[];return"1"===(window.bds.comm.sampleVariable||{}).PC_RESULT_LOAD_MORE||e.indexOf("PC_RESULT_LOAD_MORE")>-1}function n(t){return(t&&t.length?t:$("#content_left > .page-bd")).children("div").filter((function(){var t=$(this);return!t.hasClass("page-bd")&&!t.hasClass("fb-list-container")&&!t.hasClass("fb-list-container-first")&&!t.is("script,style")&&(t.is(e)||!!t.attr("data-click")||!!t.attr("m-name")||t.children().length>0||""!==$.trim(t.text()))}))}function i(e){e.hover((function(e){$(e.currentTarget).children().length||o($(e.currentTarget))}),(function(e){a($(e.currentTarget))!=bds.se.ShortCut.key&&s($(e.currentTarget))})),e.on("click",(function(e){$(".c-container").first().children(".fb-hint-tip").remove(),$(".c-container").first().children(".fb-list-container-first").remove(),bds.se.ShortCut.ldialog&&bds.se.ShortCut.ldialog.destory(),s($(".fb-list-container")),a($(e.currentTarget))==bds.se.ShortCut.key?(bds.se.ShortCut.key=0,bds.se.ShortCut.rdialog&&bds.se.ShortCut.rdialog.grayed(0)):(bds.se.ShortCut.key=a($(e.currentTarget)),bds.se.ShortCut.curListDom=$(e.currentTarget),bds.se.ShortCut.ldialog=new u(l($(e.currentTarget))),bds.se.ShortCut.rdialog&&bds.se.ShortCut.rdialog.grayed(1),o($(e.currentTarget))),e.stopPropagation(),e.preventDefault()}))}function a(e){if(e=l(e),t()){var n=e.closest(".page-bd");return(n.attr("rank")||"0")+"_"+n.children("div").index(e)+"_"+(e.attr("id")||e.attr("data-click")&&$.parseJSON(e.attr("data-click")).rsv_srcid||e.attr("class")||"-1")}return e.attr("id")||e.attr("data-click")&&$.parseJSON(e.attr("data-click")).rsv_srcid||e.attr("class")||"-1"}function o(e){var t=l(e).clone();t.unbind(),t.children(".fb-list-container").remove(),t.children(".fb-list-container-first").remove(),t.children(".fb-hint-tip").remove(),t.removeAttr("style"),t.css("margin","0"),e.append(t),e.addClass("fb-list-container-hover")}function s(e){e.empty(),e.removeClass("fb-list-container-hover")}function r(){bds.se.ShortCut.reloadPage(),$(".fb-hint-tip").remove(),$(".fb-list-container-first").remove(),bds.se.ShortCut.ldialog&&bds.se.ShortCut.ldialog.destory(),bds.se.ShortCut.rdialog&&bds.se.ShortCut.rdialog.destory(),bds.se.ShortCut.clearAppendResultRootListener&&bds.se.ShortCut.clearAppendResultRootListener(),bds.se.ShortCut.ldialog=0,bds.se.ShortCut.rdialog=0,$(".fb-mask").remove(),$(".fb-list-container").remove()}function l(n){return n.closest("#rs").length?n.closest("#rs"):n.closest("#rs_new").length?n.closest("#rs_new"):n.closest("#con-ar").length?n.closest(".result-op"):t()?function(t){var n=t.closest(".page-bd");if(!n.length)return t.closest(e);var i=n.children("div").filter((function(){return $(this).has(t).length||$(this).is(t)})).first();return i.length?i:t.closest(e)}(n):n.closest("#content_left > div")}function c(e){var t="";t=(t=t+'<input type="hidden" class="fb-select-value" name="type" value="'+e[0].key+'">')+'<div class="fb-select"><div class="fb-select-shorter"><div class="fb-type-selected">'+e[0].value+'<div class="fb-select-icon"></div></div><div class="fb-type-container">';for(var n=0;n<e.length;n++)t=t+"<div class='fb-type-item' value='"+e[n].key+"'>"+e[n].value+"</div>";return t+="</div></div></div>"}function d(e,t,n,i){this.init=function(){var n=new Date;return this.title=e,this.query=decodeURIComponent(bds.comm.query),this.srcid=t&&t.attr("srcid")||"-1",this.tpl=t&&t.attr("tpl")||"",this.url=window.location.href||"",this.time=n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate()+" "+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds(),this.username=bds.comm.username||"",this.order=t&&t.attr("id")||"",this.entry="1",this.build(),this.bindEvent(),this.render(),this},this.build=function(){var e;if("sug"===i){var t="<div class='fb-list-wrapper'>";n.forEach((function(e,n){t+="<div class='fb-checkbox'><div style='font-size: 13px;color:#333;float: left'>"+e+"</div><span style='position: absolute;right:0;width: 11px;height: 11px;border: 1px solid #ccc;top:10px;'><i class='fb-selected'></i></span></div>"}));var a=t+="</div>",o='<div class="fb-textarea fb-content-block fb-textarea-sug"><textarea maxlength="400" class ="fb-des-content" name="content" placeholder="请详细说明,以便于我们定位和解决问题,如:内容有误/定位地点不准确等(字数限制在300字以内)"></textarea></div>'}else a=c([{key:"27642",value:"申请删除提示词"},{key:"27464",value:"内容或图片陈旧"},{key:"27465",value:"变形、错乱、乱码等问题"},{key:"27469",value:"页面结果与搜索词无关"},{key:"27467",value:"其他问题及建议"}]),o='<div class="fb-textarea fb-content-block"><textarea maxlength="400" class ="fb-des-content" name="content" placeholder="请详细说明,以便于我们定位和解决问题,如:内容有误/定位地点不准确等(字数限制在300字以内)"></textarea></div>';var s="",r="";bds.se.ShortCut.uploadImg&&"sug"!==i&&(s='<div class="fb-block fb-cut-block" ><div class="fb-cut-input c-icon c-icon-success" ></div><span class="fb-shangchuan">包含屏幕截图</span></div>',r='<div class="fb-block fb-canvas-block"><img src=""/><input type="hidden" name="img_base64" class="fb-img"></div>');var l="搜索结果反馈";"sug"===i&&(l="搜索联想词反馈"),e='<div class="fb-modal "><div class="fb-header" id="fb_dialog_header" unselectable="on" onselectstart="return false;"><a class="fb-close" id="fb_close_x">×</a><h3 class="fb-header-tips">'+l+'</h3></div><div class="fb-body" id="fb_qa_feedback_body"><div class="fb-action"><form id="fb_right_post_form" enctype="multipart/form-data" onsubmit = "return false;">'+a+o+s+r+'<div class="fb-block fb-email-block"><input type="text" class="fb-email" name="email" maxlength="100" placeholder="联系邮箱(留下联系邮箱,以便我们快速反馈)"></div></form> </div><div class="fb-hint fb-hint-no-content"><span>请填写描述反馈</span></div><div class="fb-hint fb-hint-no-email"><span>请留下您的联系方式</span></div><div class="fb-hint fb-hint-error-email"><span>邮箱格式不正确</span></div><div class="fb-footer"><div class="fb-btn fb-btn-primary" id="fb_right_post_save">提交反馈</div></div><div class="fb-guide fb-guide-block"><span><a style="text-decoration:underline;" href="http://ufo.baidu.com/listen/myhistory?product_line=20018&appid=215622&type=commonQA" target="_blank">常见解决办法</a></span><span><a style="text-decoration:underline;float:right;margin-right: -5px;" href="http://ufo.baidu.com/listen/myhistory?type=myhistory&product_line=20018&appid=215622" target="_blank">我的反馈</a></span></div></div></div><div class="fb-mask" style="display:none" data-html2canvas-ignore="true"></div><div class="fb-vertify" style="display:none"><div class="fb-header" id="fb_dialog_header" unselectable="on" onselectstart="return false;"><a class="fb-close" id="fb_close_x">×</a><h3 class="fb-header-tips">安全验证</h3></div><div id="fb_vertify"></div></div><div class="fb-success" style="display:none" ><div class="fb-header" id="fb_dialog_header" unselectable="on" onselectstart="return false;"><a class="fb-close" id="fb_close_x">×</a><h3 class="fb-header-tips">非常感谢</h3></div><div class="fb-body" id="fb_qa_feedback_body"><div class="fb-success-text fb-success-text-title"><i class="c-icon c-icon-right-empty"></i>提交成功</div><div class="fb-success-text">感谢您的宝贵意见</div></div></div>';var d=document.createElement("div");d.id="fb_baidu_right_dialog",d.className="fb-feedback-right-dialog",d.className="fb-feedback-right-dialog",d.setAttribute("data-html2canvas-ignore","true"),d.innerHTML=e,this.dom=d},this.bindEvent=function(){var e=this;$(this.dom).find(".fb-close").on("click",(function(){r()})),$(this.dom).find("#fb_right_post_save").on("click",(function(){$(e.dom).find(".fb-textarea textarea").val()?-1==[27642].indexOf(Number($(e.dom).find(".fb-select-value").val()))||$(e.dom).find(".fb-email").val()?$(e.dom).find(".fb-email").val()&&!/^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/.test($(e.dom).find(".fb-email").val())?($(e.dom).find(".fb-hint-error-email").css("display","block"),setTimeout((function(){$(e.dom).find(".fb-hint-error-email").css("opacity","1"),setTimeout((function(){$(e.dom).find(".fb-hint-error-email").removeAttr("style")}),1500)}),50)):($(e.dom).find(".fb-modal ").css("display","none"),e.post()):($(e.dom).find(".fb-hint-no-email").css("display","block"),setTimeout((function(){$(e.dom).find(".fb-hint-no-email").css("opacity","1"),setTimeout((function(){$(e.dom).find(".fb-hint-no-email").removeAttr("style")}),1500)}),50)):($(e.dom).find(".fb-hint-no-content").css("display","block"),setTimeout((function(){$(e.dom).find(".fb-hint-no-content").css("opacity","1"),setTimeout((function(){$(e.dom).find(".fb-hint-no-content").removeAttr("style")}),1500)}),50))})),$(this.dom).find(".fb-cut-input").on("click",(function(){$(e.dom).find(".fb-cut-input").hasClass("c-icon")?($(e.dom).find(".fb-cut-input").removeClass("c-icon"),$(e.dom).find(".fb-cut-input").removeClass("c-icon-success"),$(e.dom).find(".fb-canvas-block").css("display","none")):($(e.dom).find(".fb-cut-input").addClass("c-icon"),$(e.dom).find(".fb-cut-input").addClass("c-icon-success"),$(e.dom).find(".fb-canvas-block").css("display","block"))})),$(this.dom).find(".fb-type-selected").on("click",(function(t){"block"==$(e.dom).find(".fb-type-container").css("display")?$(e.dom).find(".fb-type-container").hide():$(e.dom).find(".fb-type-container").show()})),$(this.dom).find(".fb-checkbox").on("click",(function(e){"block"==$(e.currentTarget).find(".fb-selected").css("display")?($(e.currentTarget).find(".fb-selected").css("display","none"),$(e.currentTarget).removeClass("fb-checkbox-selected")):($(e.currentTarget).find(".fb-selected").css("display","block"),$(e.currentTarget).addClass("fb-checkbox-selected"))})),$(this.dom).find(".fb-type-item").on("click",(function(t){$(e.dom).find(".fb-type-container").hide(),$(e.dom).find(".fb-type-selected").html($(t.currentTarget).text()+"<div class='fb-select-icon'></div>"),$(e.dom).find(".fb-select-value").val($(t.currentTarget).attr("value"))})),$(this.dom).find(".fb-des-content").on("click",(function(e){$(".c-container").first().children(".fb-hint-tip").remove(),$(".c-container").first().children(".fb-list-container-first").remove()}))},this.render=function(){$("body").append(this.dom)},this.grayed=function(e){e?$(this.dom).css("visibility","hidden"):$(this.dom).removeAttr("style")},this.destory=function(){$(this.dom).remove(),$(document).off("scroll.feedback")},this.post=function(){var e=this;this.content=$(this.dom).find(".fb-des-content").val(),this.type=$(this.dom).find(".fb-select-value").val(),this.email=$(this.dom).find(".fb-email").val();var t=$(this.dom).find(".fb-checkbox.fb-checkbox-selected"),n=[];t.each((function(e,t){n.push($(t).find("div").text())})),this.sugText=n.join("&"),e.type,"27642"!=this.type&&"27643"!=this.type&&"33081"!=this.type||this.type,e.type,e.type;var a={appid:218102,content:this.content,kw:this.query,email:this.email,extend_feedback_channel:32892,feedback_type:this.type,extend_url:this.url,extrastring:JSON.stringify({feedback_source_text:"",relation_words:this.sugText})};"sug"===i?a.extend_feedback_channel=33182:a.screenshot=[bds.se.ShortCut.cropViewport()];$.ajax({url:"https://ufosdk.baidu.com/?m=Api&a=postMsg",type:"post",data:a,timeout:5e3,xhrFields:{withCredentials:!0},complete:function(){$(e.dom).find(".fb-vertify").remove(),$(e.dom).find(".fb-mask").remove(),$(e.dom).find(".fb-success").css("display","block"),setTimeout((function(){r()}),1500)}})},this.init()}function u(e,t){this.init=function(){var t=new Date;if(this.query=decodeURIComponent(bds.comm.query),this.srcid=e&&e.attr("srcid")||"-1",this.tpl=e&&e.attr("tpl")||"",this.cururl=e&&e.find("a").eq(0).attr("href")||"",this.url=window.location.href||"",this.time=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds(),this.username=bds.comm.username||"",e)if(e.closest("#con-ar").length){this.order="con-ar";var n=[{key:"27642",value:"申请删除提示词"},{key:"33081",value:"侵犯个人隐私与权益"},{key:"27464",value:"内容或图片陈旧"},{key:"27465",value:"变形、错乱、乱码等问题"},{key:"27469",value:"页面结果与搜索词无关"},{key:"27467",value:"其他问题及建议"}];this.content_tips_div=c(n)}else if(e.attr("id")&&"rs"==e.attr("id")){this.order="rs";n=[{key:"27642",value:"申请删除提示词"},{key:"33081",value:"侵犯个人隐私与权益"}];this.content_tips_div=c(n)}else if(e.attr("tpl")&&"se_com_default"!=e.attr("tpl")){this.order=e.attr("id")||"-1";n=[{key:"27464",value:"内容或图片陈旧"},{key:"33081",value:"侵犯个人隐私与权益"},{key:"27465",value:"变形、错乱、乱码等问题"},{key:"27466",value:"这条结果与搜索词无关"},{key:"27467",value:"其他问题及建议"}];this.content_tips_div=c(n)}else if(e.attr("tpl")){this.order=e.attr("id")||"-1";n=[{key:"46918",value:"网页打不开、提示内容已删除和无法找到该网页"},{key:"46919",value:"搜索展现的内容和实际网页不一致"},{key:"33081",value:"侵犯个人隐私与权益"},{key:"27464",value:"内容或图片陈旧"},{key:"27465",value:"变形、错乱、乱码等问题"},{key:"27466",value:"这条结果与搜索词无关"},{key:"27467",value:"其他问题及建议"}];this.content_tips_div=c(n)}else{this.order="ec";var n=[{key:"27470",value:"推广信息侵权"},{key:"33081",value:"侵犯个人隐私与权益"},{key:"27471",value:"推广信息质量差"},{key:"27472",value:"推广信息与搜索词无关"},{key:"27473",value:"其他问题及产品建议"}];this.content_tips_div=c(n)}return this.entry="2",this.top=e.offset().top-4,this.visualHeight=document.body.offsetHeight-this.top,e.closest("#content_right").length?this.left=e.offset().left-390-23:this.left=e.offset().left+e.width()+30,this.build(),this.bindEvent(),this.render(),this},this.build=function(){var e,t='<div class="fb-block fb-photo-block" upload_num=0><p class="fb-photo-block-title">请上传照片及身份证照片<span class="fb-photo-block-title-ex"><img src="'+feedbackIconShow+'">示例<span></p><div class="fb-photo-sub-block"><img src="'+feedbackUp+'" class="fb-photo-block-upinfo"></div><div class="fb-block fb-photo-update-block fb-photo-update-hide"><div class="fb-photo-update-item-block"><img src="" class="fb-photo-update-item-show-img"><img src="'+feedbackCloseIcon+'" alt="" class="fb-photo-update-item-close"></div><div class="fb-photo-update-item-block"><img src="" class="fb-photo-update-item-show-img"><img src="'+feedbackCloseIcon+'" alt="" class="fb-photo-update-item-close"></div><div class="fb-photo-update-item-block"><img src="" class="fb-photo-update-item-show-img"><img src="'+feedbackCloseIcon+'" alt="" class="fb-photo-update-item-close"></div><div class="fb-photo-update-item-block"><img src="" class="fb-photo-update-item-show-img"><img src="'+feedbackCloseIcon+'" alt="" class="fb-photo-update-item-close"></div><input type="file" name="img_base64_1" accept="image/*;capture=camera"><input type="file" name="img_base64_2" accept="image/*;capture=camera"><input type="file" name="img_base64_3" accept="image/*;capture=camera"><input type="file" name="img_base64_4" accept="image/*;capture=camera"></div></div>',n='<div class="fb-photo-block-example"><div class="fb-photo-block-example-header"><p>示例</p><img src="'+feedbackCloseIcon+'" alt=""></div> <div class="fb-photo-block-example-title"><p class="fb-photo-block-example-title-big">身份证正反面照示例</p><p class="fb-photo-block-example-title-small">身份证照片需要信息清晰,仅仅用于审核,百度会保证隐私安全</p></div><div class="fb-photo-block-example-img"><img src="'+feedbackSFZ+'" alt=""><img src="'+feedbackSFZ1+'" alt=""></div></div>';e='<div class="fb-modal" ><div class="fb-header" id="fb_dialog_header" unselectable="on" onselectstart="return false;"><a class="fb-close" id="fb_close_x">×</a><h3 class="fb-header-tips">意见反馈</h3></div><div class="fb-body" id="fb_qa_feedback_body"><div class="fb-action"><form id="fb_right_post_form" enctype="multipart/form-data" method="post" onsubmit = "return false;">'+this.content_tips_div+'<div class="fb-textarea fb-content-block"><textarea maxlength="400" class ="fb-des-content" name="content" placeholder="请详细说明,以便于我们定位和解决问题,如:内容有误/定位地点不准确等(字数限制在300字以内)"></textarea></div><div class="fb-block fb-email-block"><input type="text" class="fb-email" maxlength="100" name="email" placeholder="联系邮箱(留下联系邮箱,以便我们快速反馈)"></div>'+t+'</form> </div><div class="fb-hint fb-hint-no-content"><span>请填写描述反馈</span></div><div class="fb-hint fb-hint-error-photo"><span>请提交图片</span></div><div class="fb-hint fb-hint-no-email"><span>请留下您的联系方式</span></div><div class="fb-hint fb-hint-error-email"><span>邮箱格式不正确</span></div><div class="fb-footer"><div class="fb-btn fb-btn-primary" id="fb_list_post_save">提交反馈</div></div><div class="fb-guide fb-guide-block"><span><a style="text-decoration:underline;" href="http://ufo.baidu.com/listen/myhistory?product_line=20018&appid=215622&type=commonQA" target="_blank">常见解决办法</a></span><span><a style="text-decoration:underline;float:right;margin-right: -5px;" href="http://ufo.baidu.com/listen/myhistory?type=myhistory&product_line=20018&appid=215622" target="_blank">我的反馈</a></span></div></div></div><div class="fb-vertify" style="display:none"><div class="fb-header" id="fb_dialog_header" unselectable="on" onselectstart="return false;"><a class="fb-close" id="fb_close_x">×</a><h3 class="fb-header-tips">安全验证</h3></div><div id="fb_vertify_list"></div></div><div class="fb-success" style="display:none" ><div class="fb-header" id="fb_dialog_header" unselectable="on" onselectstart="return false;"><a class="fb-close" id="fb_close_x">×</a><h3 class="fb-header-tips">非常感谢</h3></div><div class="fb-body" id="fb_qa_feedback_body"><div class="fb-success-text fb-success-text-title"><i class="c-icon c-icon-right-empty"></i>提交成功</div><div class="fb-success-text">感谢您的宝贵意见</div></div></div>'+n;var i=document.createElement("div");i.id="fb_baidu_list_dialog",i.className="fb-feedback-list-dialog",i.setAttribute("data-html2canvas-ignore","true"),i.innerHTML=e,this.dom=i,$(this.dom).css("top",this.top),$(this.dom).css("left",this.left),this.visualHeight<278&&$(this.dom).find(".fb-modal").css("margin-top",this.visualHeight-288+"px"),"con-ar"==this.order&&$(this.dom).attr("class","fb-feedback-list-dialog-left")},this.bindEvent=function(){var e=this;$(this.dom).find(".fb-close").on("click",(function(){e.destory(),s($(".fb-list-container")),bds.se.ShortCut.key=0,bds.se.ShortCut.rdialog&&bds.se.ShortCut.rdialog.grayed(0),bds.se.ShortCut.rdialog||r()})),$(this.dom).find("#fb_list_post_save").on("click",(function(){$(e.dom).find(".fb-textarea textarea").val()?-1==[27642,27643].indexOf(Number($(e.dom).find(".fb-select-value").val()))||$(e.dom).find(".fb-email").val()?$(e.dom).find(".fb-email").val()&&!/^(\w)+(\.\w+)*@([\w_\-\.])+((\.\w{2,3}){1,3})$/.test($(e.dom).find(".fb-email").val())?($(e.dom).find(".fb-hint-error-email").css("display","block"),setTimeout((function(){$(e.dom).find(".fb-hint-error-email").css("opacity","1"),setTimeout((function(){$(e.dom).find(".fb-hint-error-email").removeAttr("style")}),1500)}),50)):($(e.dom).find(".fb-modal").css("display","none"),e.post()):($(e.dom).find(".fb-hint-no-email").css("display","block"),setTimeout((function(){$(e.dom).find(".fb-hint-no-email").css("opacity","1"),setTimeout((function(){$(e.dom).find(".fb-hint-no-email").removeAttr("style")}),1500)}),50)):($(e.dom).find(".fb-hint-no-content").css("display","block"),setTimeout((function(){$(e.dom).find(".fb-hint-no-content").css("opacity","1"),setTimeout((function(){$(e.dom).find(".fb-hint-no-content").removeAttr("style")}),1500)}),50))})),$(this.dom).find(".fb-type-selected").on("click",(function(t){"block"==$(e.dom).find(".fb-type-container").css("display")?$(e.dom).find(".fb-type-container").hide():$(e.dom).find(".fb-type-container").show()})),$(this.dom).find(".fb-type-item").on("click",(function(t){$(e.dom).find(".fb-type-container").hide(),$(e.dom).find(".fb-type-selected").html($(t.currentTarget).text()+"<div class='fb-select-icon'></div>"),$(e.dom).find(".fb-select-value").val($(t.currentTarget).attr("value")),33081==$(t.currentTarget).attr("value")?$(e.dom).find(".fb-photo-block").css("display","block"):$(e.dom).find(".fb-photo-block").css("display","none")})),$(this.dom).find(".fb-photo-sub-block").on("click",(function(t){$(this).addClass("fb-photo-sub-block-hide"),$(e.dom).find(".fb-photo-update-hide").removeClass("fb-photo-update-hide"),$(e.dom).find(".fb-photo-update-hide").removeClass("fb-photo-update-hide")})),$(this.dom).find(".fb-photo-update-item-block").on("click",(function(){var t=$(e.dom),n=$(this),i=$(this).index(),a=$(e.dom).find(".fb-photo-update-block").find("input").get(i);a.click(),$(a).on("change",(function(e){var i=a.files[0],o=i.type;if(o&&("image/png"==o||"image/jpg"==o||"image/jpeg"==o||"image/jpeg"==o)&&$(e.currentTarget).val()&&i.size<2097152){var s=new FileReader;s.addEventListener("load",(function(){n.find(".fb-photo-update-item-show-img").attr("src",s.result),n.find(".fb-photo-update-item-close").css("display","block"),n.find(".fb-photo-update-item-show-img").css("display","block");var e=t.find(".fb-photo-block"),i=e.attr("upload_num");e.attr("upload_num",Number(i)+1)}),!1),s.readAsDataURL(i)}}))})),$(this.dom).find(".fb-photo-update-item-close").on("click",(function(t){var n=$(e);t.stopPropagation();var i=$(this).parent(".fb-photo-update-item-block").index();$(this).siblings("img").attr("src",""),$(".fb-photo-update-block").find("input").eq(i).val(""),$(this).css("display","none"),$(this).siblings("img").css("display","none");var a=n.find(".fb-photo-block"),o=a.attr("upload_num");a.attr("upload_num",Number(o)+1)})),$(this.dom).find(".fb-photo-block-title-ex").on("click",(function(t){t.stopPropagation(),$(e.dom).find(".fb-modal").css("display","none"),$(e.dom).find(".fb-photo-block-example").css("display","block")})),$(this.dom).find(".fb-photo-block-example-header img").on("click",(function(t){t.stopPropagation(),$(e.dom).find(".fb-modal").css("display","block"),$(e.dom).find(".fb-photo-block-example").css("display","none")}))},this.render=function(){$("body").append(this.dom)},this.destory=function(){$(this.dom).remove()},this.post=function(){var e=this;this.content=$(this.dom).find(".fb-des-content").val(),this.type=$(this.dom).find(".fb-select-value").val(),this.email=$(this.dom).find(".fb-email").val();var n=$(this.dom).find(".fb-photo-block").find(".fb-photo-update-item-show-img");bds.se.ShortCut.get_Snapshot_list(bds.se.ShortCut.curListDom[0],bds.se.ShortCut.curListDom.width()+20,bds.se.ShortCut.curListDom.height()+12,(function(){e.type,"27642"!=e.type&&"27643"!=e.type&&"33081"!=e.type||e.type,e.type,e.type;var i={appid:218102,content:e.content,kw:e.query,email:e.email,screenshot:[bds.se.ShortCut.img_base64_list,n.eq(0).attr("src"),n.eq(1).attr("src"),n.eq(2).attr("src"),n.eq(3).attr("src")],resource_id:e.srcid,extend_feedback_channel:32893,feedback_type:e.type,extend_url:e.url,fb_url:e.cururl,extrastring:JSON.stringify({feedback_source_text:"",relation_words:""})};"con-ar"===e.order&&(i.extend_feedback_channel=32894),isNaN(Number(e.order))||(i.feedback_position=Number(e.order)),t&&(i.ala=1);$.ajax({url:"https://ufosdk.baidu.com/?m=Api&a=postMsg",type:"post",data:i,timeout:5e3,xhrFields:{withCredentials:!0},complete:function(){$(e.dom).find(".fb-vertify").remove(),$(e.dom).find(".fb-mask").remove(),$(e.dom).find(".fb-success").css("display","block"),setTimeout((function(){r()}),1500)}})}))},this.init()}bds&&bds.se&&(bds.se.ShortCut={base_url_path:"http://f3.baidu.com",up_file:!1,is_feedbacking:!1,product_id:0,entrance_id:0,send_img:!1,img_data:"",onlyUpFile:!1,pro_data:"",scrollTop:0,ldiaInf:{},rdiaInf:{},canvas_block_height:0,key:0,domain:bds.util.domain.get("api.open.baidu.com")+"/pae/common/api/feedback",img_base64:"",img_base64_list:"",fullCanvas:null,isFromLoginDialog:!1,isLoadMoreFeedback:!1,appendResultRootHandler:null,snapshotTimer:0,snapshotCapturing:!1,snapshotPending:!1,initRightBar:function(e){this.isFromLoginDialog=e||!1,this.isLoadMoreFeedback=t(),this.html2canvas(),this._getCss(),this._identifyCanvas()&&this._identifyCors()?(bds.se.ShortCut.uploadImg=!0,this.get_Snapshot()):bds.se.ShortCut.uploadImg=!1},reloadPage:function(){if(this.isFromLoginDialog){if(this.isFromLoginDialog=!1,this.isLoadMoreFeedback)return;window.document.location.reload(!0)}},initSugBar:function(e){$(window).scrollTop(0),$(".fb-mask").length>0&&r(),bds.se.ShortCut.rdialog=new d("","",e,"sug"),$("#container").append("<div class='fb-mask'></div>"),$(".fb-mask").on("click",(function(e){r(),bds.se.ShortCut.ldialog&&bds.se.ShortCut.ldialog.destory()}))},_getCss:function(){this.isLoadMoreFeedback?headScript_pc_static_index.addStyle("#content_left > .page-bd > div,#rs,#rs_new,#con-ar .result-op{position: relative;}"):headScript_pc_static_index.addStyle("#content_left > div,#rs,#rs_new,#con-ar .result-op{position: relative;}")},_identifyCanvas:function(){try{document.createElement("canvas").getContext("2d");return null,!0}catch(e){return!1}},_identifyCors:function(){return"withCredentials"in new XMLHttpRequest},init_ala:function(e){this.html2canvas(),this._identifyCanvas()&&this._identifyCors()?bds.se.ShortCut.uploadImg=!0:bds.se.ShortCut.uploadImg=!1,$("#container").append("<div class='fb-mask' data-html2canvas-ignore='true'></div>"),e.append("<div class='fb-list-container' data-html2canvas-ignore='true'></div>"),e.find(".fb-list-container").css("width",e.width()+20),e.find(".fb-list-container").css("height",e.height()+10),o(e.find(".fb-list-container")),bds.se.ShortCut.ldialog=new u(e,1),bds.se.ShortCut.curListDom=e.find(".fb-list-container"),$(".fb-mask").on("click",(function(e){r(),bds.se.ShortCut.ldialog&&bds.se.ShortCut.ldialog.destory()}))},init_shade:function(){$("#container").append("<div class='fb-mask' data-html2canvas-ignore='true'></div>"),function(){var e=t()?n():$("#content_left > div");e.append("<div class='fb-list-container' data-html2canvas-ignore='true'></div>"),t()?(e.css("overflow","visible"),e.css("position","relative")):$("#content_left > div").css("overflow","visible"),$(".leftBlock .fb-list-container").remove(),$(".hit_top_new .fb-list-container").remove(),e.each((function(){$(this).find(".fb-list-container").css("width",$(this).width()+20),$(this).find(".fb-list-container").css("height",$(this).height()+10)})),$(".c-container").first().append("<div class='fb-list-container-first' data-html2canvas-ignore='true'></div>"),$(".c-container").first().find(".fb-list-container-first").css("width",$(".c-container").first().width()+20),$(".c-container").first().find(".fb-list-container-first").css("height",$(".c-container").first().height()+10),$(".c-container").first().append('<div class="fb-hint-tip" data-html2canvas-ignore="true"><span>鼠标点击,可对单条结果进行反馈</span></div>');var i=$("#rs").length?$("#rs"):$("#rs_new");i.append("<div class='fb-list-container' data-html2canvas-ignore='true'></div>"),i.find(".fb-list-container").css("width",i.width()+20),i.find(".fb-list-container").css("height",i.height()+10);var a=$("#con-ar .result-op");a.append("<div class='fb-list-container' data-html2canvas-ignore='true'></div>"),a.each((function(){$(this).find(".fb-list-container").css("width",$(this).width()+20),$(this).find(".fb-list-container").css("height",$(this).height()+10)}))}(),i($(".fb-list-container")),$(".fb-mask").on("click",(function(e){bds.se.ShortCut.ldialog&&bds.se.ShortCut.ldialog.destory(),bds.se.ShortCut.key=0,bds.se.ShortCut.rdialog&&bds.se.ShortCut.rdialog.grayed(0),s($(".fb-list-container"))}))},clearAppendResultRootListener:function(){this.appendResultRootHandler&&(document.removeEventListener("appendResultRoot",this.appendResultRootHandler),this.appendResultRootHandler=null),this.snapshotTimer&&(clearTimeout(this.snapshotTimer),this.snapshotTimer=0),this.snapshotPending=!1},scheduleViewportSnapshot:function(e){if(this.isLoadMoreFeedback&&this.uploadImg&&$(".fb-canvas-block").length){var t=this;this.snapshotTimer&&clearTimeout(this.snapshotTimer),this.snapshotTimer=setTimeout((function(){t.snapshotTimer=0,t.snapshotCapturing?t.snapshotPending=!0:t.captureSnapshot()}),e||300)}},bindAppendResultRootListener:function(){if(this.isLoadMoreFeedback){this.clearAppendResultRootListener();var e=this;this.appendResultRootHandler=function(t){var a=$(t&&t.detail&&t.detail.root);a.length&&(n(a).each((function(){var e=$(this);e.children(".fb-list-container").length||(e.append("<div class='fb-list-container' data-html2canvas-ignore='true'></div>"),e.css("overflow","visible"),e.css("position","relative"),e.find(".fb-list-container").css("width",e.width()+20),e.find(".fb-list-container").css("height",e.height()+10))})),i(a.find(".fb-list-container"))),e.uploadImg&&$(".fb-canvas-block").length&&e.scheduleViewportSnapshot(300)},document.addEventListener("appendResultRoot",this.appendResultRootHandler)}},renderSnapshot:function(e){var t=this;if($(".fb-canvas-block").removeClass("c-loading"),this.isLoadMoreFeedback)return bds.se.ShortCut.fullCanvas=e,bds.se.ShortCut.img_base64=e.toDataURL("image/png"),this.showViewportSnapshot(e),$(document).off("scroll.feedback"),void $(document).on("scroll.feedback",(function(){t.scheduleViewportSnapshot(300)}));var n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0),bds.se.ShortCut.fullCanvas=n,bds.se.ShortCut.img_base64=n.toDataURL("image/png"),$(".fb-canvas-block img").attr("src",bds.se.ShortCut.img_base64),$(document).off("scroll.feedback"),$(document).on("scroll.feedback",(function(){t.updateSnapshotScroll()})),t.updateSnapshotScroll()},showViewportSnapshot:function(e){var t=$(".fb-canvas-block"),n=t.find("img");if(n.length){var i=t.height()/$(window).height();n.attr("src",bds.se.ShortCut.img_base64),n.css({width:e.width*i,height:e.height*i,top:0,left:0})}},updateSnapshotScroll:function(){var e=bds.se.ShortCut.fullCanvas,t=$(".fb-canvas-block img");if(e&&t.length){var n=$(".fb-canvas-block").height(),i=$(window).height(),a=$(window).scrollTop(),o=n/i;t.css({width:e.width*o,height:e.height*o,top:-a*o,left:0})}},cropViewport:function(){var e=bds.se.ShortCut.fullCanvas;if(!e)return bds.se.ShortCut.img_base64;if(bds.se.ShortCut.isLoadMoreFeedback)return bds.se.ShortCut.img_base64;var t=Math.min($(window).width(),e.width),n=Math.min($(window).height(),e.height),i=$(window).scrollTop();i=Math.max(0,Math.min(i,e.height-n));var a=document.createElement("canvas");return a.width=t,a.height=n,a.getContext("2d").drawImage(e,0,i,t,n,0,0,t,n),a.toDataURL("image/png")},captureSnapshot:function(e){var t=this,n=this.isLoadMoreFeedback,i=e&&!n,a=$(window).scrollTop();i&&$(window).scrollTop(0),$(".fb-canvas-block").addClass("c-loading"),this.snapshotCapturing=!0,html2canvas(document.body,{width:n?$(window).width():null,height:n?$(window).height():null,onrendered:function(e){t.renderSnapshot(e),i&&$(window).scrollTop(a),t.snapshotCapturing=!1,t.snapshotPending&&(t.snapshotPending=!1,t.scheduleViewportSnapshot(0))}})},get_Snapshot:function(){var e=this;bds.se.ShortCut.rdialog=new d,e.init_shade(),e.captureSnapshot(!0),e.bindAppendResultRootListener()},refresh_Snapshot:function(){this.scheduleViewportSnapshot(0)},get_Snapshot_list:function(e,t,n,i){html2canvas(e,{onrendered:function(e){var a=document.createElement("canvas");a.width=t,a.height=n,a.getContext("2d").drawImage(e,0,0),bds.se.ShortCut.img_base64_list=a.toDataURL("image/png"),i()}})},html2canvas:function(){!function(e,t,n){var i,a,o,s={};function r(t){s.logging&&e.console&&e.console.log&&e.console.log(t)}function l(e,t,n,i,a,o){var r,l,c,d,u=s.Util.getCSS(t,e,a);if(1===u.length&&(d=u[0],(u=[])[0]=d,u[1]=d),-1!==u[0].toString().indexOf("%"))c=parseFloat(u[0])/100,l=n.width*c,"backgroundSize"!==e&&(l-=(o||i).width*c);else if("backgroundSize"===e)if("auto"===u[0])l=i.width;else if(u[0].match(/contain|cover/)){var p=s.Util.resizeBounds(i.width,i.height,n.width,n.height,u[0]);l=p.width,r=p.height}else l=parseInt(u[0],10);else l=parseInt(u[0],10);return"auto"===u[1]?r=l/i.width*i.height:-1!==u[1].toString().indexOf("%")?(c=parseFloat(u[1])/100,r=n.height*c,"backgroundSize"!==e&&(r-=(o||i).height*c)):r=parseInt(u[1],10),[l,r]}function c(e){return{zindex:e,children:[]}}s.Util={},s.Util.trimText=(a=String.prototype.trim,function(e){return a?a.apply(e):((e||"")+"").replace(/^\s+|\s+$/g,"")}),s.Util.parseBackgroundImage=function(e){var t,n,i,a,o,s,r,l,c=[],d=0,u=0,p=function(){t&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)),n&&l.push(n),"-"===t.substr(0,1)&&(a=t.indexOf("-",1)+1)>0&&(i=t.substr(0,a),t=t.substr(a)),c.push({prefix:i,method:t.toLowerCase(),value:o,args:l})),l=[],t=i=n=o=""};p();for(var h=0,f=e.length;h<f;h++)if(s=e[h],!(0===d&&" \r\n\t".indexOf(s)>-1)){switch(s){case'"':r?r===s&&(r=null):r=s;break;case"(":if(r)break;if(0===d){d=1,o+=s;continue}u++;break;case")":if(r)break;if(1===d){if(0===u){d=0,o+=s,p();continue}u--}break;case",":if(r)break;if(0===d){p();continue}if(1===d&&0===u&&!t.match(/^url$/i)){l.push(n),n="",o+=s;continue}}o+=s,0===d?t+=s:n+=s}return p(),c},s.Util.OutsideViewport=function(n){if(!bds.se.ShortCut.isLoadMoreFeedback||!n||!n.getBoundingClientRect)return!1;var i=n.getBoundingClientRect();if(!i.width||!i.height)return!1;var a=e.innerHeight||t.documentElement.clientHeight;return i.bottom<-200||i.top>a+200},s.Util.Bounds=function(e){var t,n={};if(e.getBoundingClientRect)return t=e.getBoundingClientRect(),n.top=t.top,n.bottom=t.bottom||t.top+t.height,n.left=t.left,n.width=t.width||t.right-t.left,n.height=t.height||t.bottom-t.top,n},s.Util.getCSS=function(e,a,o){var r,l=a.match(/^background(Size|Position)$/);function c(t,n){var i,a=e.runtimeStyle&&e.runtimeStyle[t],o=e.style;return!/^-?[0-9]+\.?[0-9]*(?:px)?$/i.test(n)&&/^-?\d/.test(n)&&(i=o.left,a&&(e.runtimeStyle.left=e.currentStyle.left),o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=i,a&&(e.runtimeStyle.left=a)),/^(thin|medium|thick)$/i.test(n)?n:Math.round(parseFloat(n))+"px"}if(undefined!==e&&(i=t.defaultView.getComputedStyle(e,null)),r=i[a],l)if(r=(r=(r||"").split(","))[o||0]||r[0]||"auto",r=s.Util.trimText(r).split(" "),"backgroundSize"!==a||r[0]&&!r[0].match(/cover|contain|auto/)){if(r[0]=-1===r[0].indexOf("%")?c(a+"X",r[0]):r[0],r[1]===n){if("backgroundSize"===a)return r[1]="auto",r;r[1]=r[0]}r[1]=-1===r[1].indexOf("%")?c(a+"Y",r[1]):r[1]}else;else if(/border(Top|Bottom)(Left|Right)Radius/.test(a)){var d=r.split(" ");d.length<=1&&(d[1]=d[0]),d[0]=parseInt(d[0],10),d[1]=parseInt(d[1],10),r=d}return r},s.Util.resizeBounds=function(e,t,n,i,a){var o,s,r=e/t;return a&&"auto"!==a?n/i<r^"contain"===a?(s=i,o=i*r):(o=n,s=n/r):(o=n,s=i),{width:o,height:s}},s.Util.BackgroundPosition=function(e,t,n,i,a){var o=l("backgroundPosition",e,t,n,i,a);return{left:o[0],top:o[1]}},s.Util.BackgroundSize=function(e,t,n,i){var a=l("backgroundSize",e,t,n,i);return{width:a[0],height:a[1]}},s.Util.Extend=function(e,t){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},s.Util.Children=function(e){var t,i,a;try{t=e.nodeName&&"IFRAME"===e.nodeName.toUpperCase()?e.contentDocument||e.contentWindow.document:(i=e.childNodes,a=[],null!==i&&function(e,t){var i=e.length,a=0;if("number"==typeof t.length)for(var o=t.length;a<o;a++)e[i++]=t[a];else for(;t[a]!==n;)e[i++]=t[a++];e.length=i}(a,i),a)}catch(o){r("html2canvas.Util.Children failed with exception: "+o.message),t=[]}return t},s.Util.Font=(o={},function(e,t,i){if(o[e+"-"+t]!==n)return o[e+"-"+t];var a,s,r=i.createElement("div"),l=i.createElement("img"),c=i.createElement("span"),d="Hidden Text";return r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin=0,r.style.padding=0,i.body.appendChild(r),l.src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=",l.width=1,l.height=1,l.style.margin=0,l.style.padding=0,l.style.verticalAlign="baseline",c.style.fontFamily=e,c.style.fontSize=t,c.style.margin=0,c.style.padding=0,c.appendChild(i.createTextNode(d)),r.appendChild(c),r.appendChild(l),a=l.offsetTop-c.offsetTop+1,r.removeChild(c),r.appendChild(i.createTextNode(d)),r.style.lineHeight="normal",l.style.verticalAlign="super",s={baseline:a,lineWidth:1,middle:l.offsetTop-r.offsetTop+1},o[e+"-"+t]=s,i.body.removeChild(r),s}),function(){s.Generate={};var e=[/^(-webkit-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-linear-gradient)\(([a-z\s]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-gradient)\((linear|radial),\s((?:\d{1,3}%?)\s(?:\d{1,3}%?),\s(?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)\-]+)\)$/,/^(-moz-linear-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?))([\w\d\.\s,%\(\)]+)\)$/,/^(-webkit-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/,/^(-moz-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s?([a-z\-]*)([\w\d\.\s,%\(\)]+)\)$/,/^(-o-radial-gradient)\(((?:\d{1,3}%?)\s(?:\d{1,3}%?)),\s(\w+)\s([a-z\-]+)([\w\d\.\s,%\(\)]+)\)$/];s.Generate.parseGradient=function(t,n){var i,a,o,s,r,l,c,d,u,p,h,f,m=e.length;for(a=0;a<m&&!(o=t.match(e[a]));a+=1);if(o)switch(o[1]){case"-webkit-linear-gradient":case"-o-linear-gradient":if(i={type:"linear",x0:null,y0:null,x1:null,y1:null,colorStops:[]},r=o[2].match(/\w+/g))for(l=r.length,a=0;a<l;a+=1)switch(r[a]){case"top":i.y0=0,i.y1=n.height;break;case"right":i.x0=n.width,i.x1=0;break;case"bottom":i.y0=n.height,i.y1=0;break;case"left":i.x0=0,i.x1=n.width}if(null===i.x0&&null===i.x1&&(i.x0=i.x1=n.width/2),null===i.y0&&null===i.y1&&(i.y0=i.y1=n.height/2),r=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g))for(l=r.length,c=1/Math.max(l-1,1),a=0;a<l;a+=1)(d=r[a].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/))[2]?(s=parseFloat(d[2]),"%"===d[3]?s/=100:s/=n.width):s=a*c,i.colorStops.push({color:d[1],stop:s});break;case"-webkit-gradient":if(i={type:"radial"===o[2]?"circle":o[2],x0:0,y0:0,x1:0,y1:0,colorStops:[]},(r=o[3].match(/(\d{1,3})%?\s(\d{1,3})%?,\s(\d{1,3})%?\s(\d{1,3})%?/))&&(i.x0=r[1]*n.width/100,i.y0=r[2]*n.height/100,i.x1=r[3]*n.width/100,i.y1=r[4]*n.height/100),r=o[4].match(/((?:from|to|color-stop)\((?:[0-9\.]+,\s)?(?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)\))+/g))for(l=r.length,a=0;a<l;a+=1)d=r[a].match(/(from|to|color-stop)\(([0-9\.]+)?(?:,\s)?((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\)/),s=parseFloat(d[2]),"from"===d[1]&&(s=0),"to"===d[1]&&(s=1),i.colorStops.push({color:d[3],stop:s});break;case"-moz-linear-gradient":if(i={type:"linear",x0:0,y0:0,x1:0,y1:0,colorStops:[]},(r=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/))&&(i.x0=r[1]*n.width/100,i.y0=r[2]*n.height/100,i.x1=n.width-i.x0,i.y1=n.height-i.y0),r=o[3].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}%)?)+/g))for(l=r.length,c=1/Math.max(l-1,1),a=0;a<l;a+=1)(d=r[a].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%)?/))[2]?(s=parseFloat(d[2]),d[3]&&(s/=100)):s=a*c,i.colorStops.push({color:d[1],stop:s});break;case"-webkit-radial-gradient":case"-moz-radial-gradient":case"-o-radial-gradient":if(i={type:"circle",x0:0,y0:0,x1:n.width,y1:n.height,cx:0,cy:0,rx:0,ry:0,colorStops:[]},(r=o[2].match(/(\d{1,3})%?\s(\d{1,3})%?/))&&(i.cx=r[1]*n.width/100,i.cy=r[2]*n.height/100),r=o[3].match(/\w+/),d=o[4].match(/[a-z\-]*/),r&&d)switch(d[0]){case"farthest-corner":case"cover":case"":u=Math.sqrt(Math.pow(i.cx,2)+Math.pow(i.cy,2)),p=Math.sqrt(Math.pow(i.cx,2)+Math.pow(i.y1-i.cy,2)),h=Math.sqrt(Math.pow(i.x1-i.cx,2)+Math.pow(i.y1-i.cy,2)),f=Math.sqrt(Math.pow(i.x1-i.cx,2)+Math.pow(i.cy,2)),i.rx=i.ry=Math.max(u,p,h,f);break;case"closest-corner":u=Math.sqrt(Math.pow(i.cx,2)+Math.pow(i.cy,2)),p=Math.sqrt(Math.pow(i.cx,2)+Math.pow(i.y1-i.cy,2)),h=Math.sqrt(Math.pow(i.x1-i.cx,2)+Math.pow(i.y1-i.cy,2)),f=Math.sqrt(Math.pow(i.x1-i.cx,2)+Math.pow(i.cy,2)),i.rx=i.ry=Math.min(u,p,h,f);break;case"farthest-side":"circle"===r[0]?i.rx=i.ry=Math.max(i.cx,i.cy,i.x1-i.cx,i.y1-i.cy):(i.type=r[0],i.rx=Math.max(i.cx,i.x1-i.cx),i.ry=Math.max(i.cy,i.y1-i.cy));break;case"closest-side":case"contain":"circle"===r[0]?i.rx=i.ry=Math.min(i.cx,i.cy,i.x1-i.cx,i.y1-i.cy):(i.type=r[0],i.rx=Math.min(i.cx,i.x1-i.cx),i.ry=Math.min(i.cy,i.y1-i.cy))}if(r=o[5].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\)(?:\s\d{1,3}(?:%|px))?)+/g))for(l=r.length,c=1/Math.max(l-1,1),a=0;a<l;a+=1)(d=r[a].match(/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/))[2]?(s=parseFloat(d[2]),"%"===d[3]?s/=100:s/=n.width):s=a*c,i.colorStops.push({color:d[1],stop:s})}return i},s.Generate.Gradient=function(e,n){if(0!==n.width&&0!==n.height){var i,a,o,l,c=t.createElement("canvas"),d=c.getContext("2d");if(c.width=n.width,c.height=n.height,i=s.Generate.parseGradient(e,n))if("linear"===i.type){for(a=d.createLinearGradient(i.x0,i.y0,i.x1,i.y1),o=0,l=i.colorStops.length;o<l;o+=1)try{a.addColorStop(i.colorStops[o].stop,i.colorStops[o].color)}catch(m){r(["failed to add color stop: ",m,"; tried to add: ",i.colorStops[o],"; stop: ",o,"; in: ",e])}d.fillStyle=a,d.fillRect(0,0,n.width,n.height)}else if("circle"===i.type){for(a=d.createRadialGradient(i.cx,i.cy,0,i.cx,i.cy,i.rx),o=0,l=i.colorStops.length;o<l;o+=1)try{a.addColorStop(i.colorStops[o].stop,i.colorStops[o].color)}catch(m){r(["failed to add color stop: ",m,"; tried to add: ",i.colorStops[o],"; stop: ",o,"; in: ",e])}d.fillStyle=a,d.fillRect(0,0,n.width,n.height)}else if("ellipse"===i.type){var u=t.createElement("canvas"),p=u.getContext("2d"),h=Math.max(i.rx,i.ry),f=2*h;for(u.width=u.height=f,a=p.createRadialGradient(i.rx,i.ry,0,i.rx,i.ry,h),o=0,l=i.colorStops.length;o<l;o+=1)try{a.addColorStop(i.colorStops[o].stop,i.colorStops[o].color)}catch(m){r(["failed to add color stop: ",m,"; tried to add: ",i.colorStops[o],"; stop: ",o,"; in: ",e])}p.fillStyle=a,p.fillRect(0,0,f,f),d.fillStyle=i.colorStops[o-1].color,d.fillRect(0,0,c.width,c.height),d.drawImage(u,i.cx-i.rx,i.cy-i.ry,2*i.rx,2*i.ry)}return c}},s.Generate.ListAlpha=function(e){var t,n="";do{t=e%26,n=String.fromCharCode(t+64)+n,e/=26}while(26*e>26);return n},s.Generate.ListRoman=function(e){var t,n=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"],i=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],a="",o=n.length;if(e<=0||e>=4e3)return e;for(t=0;t<o;t+=1)for(;e>=i[t];)e-=i[t],a+=n[t];return a}}(),s.Parse=function(i,a){bds.se.ShortCut.scrollTop=e.pageYOffset||t.documentElement.scrollTop||t.body.scrollTop,bds.se.ShortCut.isLoadMoreFeedback||e.scroll(0,0);var o=a.elements===n?t.body:a.elements[0],l=o.ownerDocument,d=s.Util.Support(a,l),u=new RegExp("("+a.ignoreElements+")"),p=l.body,h=s.Util.getCSS,f="___html2canvas___pseudoelement",m=l.createElement("style");function g(){return Math.max(Math.max(l.body.scrollWidth,l.documentElement.scrollWidth),Math.max(l.body.offsetWidth,l.documentElement.offsetWidth),Math.max(l.body.clientWidth,l.documentElement.clientWidth))}function _(){return Math.max(Math.max(l.body.scrollHeight,l.documentElement.scrollHeight),Math.max(l.body.offsetHeight,l.documentElement.offsetHeight),Math.max(l.body.clientHeight,l.documentElement.clientHeight))}function v(e,t){var n=parseInt(h(e,t),10);return isNaN(n)?0:n}function b(e,t,n,i,a,o){"transparent"!==o&&(e.setVariable("fillStyle",o),e.fillRect(t,n,i,a))}function y(e,t,n,i){null!==e&&s.Util.trimText(e).length>0&&i.fillText(e,t,n)}function w(e,t,n,i){var a=h(t,"fontWeight"),o=h(t,"fontFamily"),r=h(t,"fontSize");switch(parseInt(a,10)){case 401:a="bold";break;case 400:a="normal"}if(e.setVariable("fillStyle",i),e.setVariable("font",[h(t,"fontStyle"),h(t,"fontVariant"),a,r,o].join(" ")),e.setVariable("textAlign","left"),"none"!==n)return s.Util.Font(o,r,l)}function S(e,t,n,i){var a;if(d.rangeBounds)"none"===n&&0===s.Util.trimText(t).length||(a=function(e,t,n){var i=l.createRange();return i.setStart(t,n),i.setEnd(t,n+e.length),i.getBoundingClientRect()}(t,e.node,e.textOffset)),e.textOffset+=t.length;else if(e.node&&"string"==typeof e.node.nodeValue){var o=i?e.node.splitText(t.length):null;a=function(e){var t=e.parentNode,n=l.createElement("wrapper"),i=e.cloneNode(!0);n.appendChild(e.cloneNode(!0)),t.replaceChild(n,e);var a=s.Util.Bounds(n);return t.replaceChild(i,n),a}(e.node),e.node=o}return a}function C(e,t,n){var i,o,r,l=n.ctx,c=h(e,"color"),d=h(e,"textDecoration"),u=h(e,"textAlign"),p={node:t,textOffset:0};s.Util.trimText(t.nodeValue).length>0&&(t.nodeValue=function(e,t){switch(t){case"lowercase":return e.toLowerCase();case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,(function(e,t,n){if(e.length>0)return t+n.toUpperCase()}));case"uppercase":return e.toUpperCase();default:return e}}(t.nodeValue,h(e,"textTransform")),u=u.replace(["-webkit-auto"],["auto"]),o=!a.letterRendering&&/^(left|right|justify|auto)$/.test(u)&&(r=h(e,"letterSpacing"),/^(normal|none|0px)$/.test(r))?t.nodeValue.split(/(\b| )/):t.nodeValue.split(""),i=w(l,e,d,c),a.chinese&&o.forEach((function(e,t){/.*[\u4E00-\u9FA5].*$/.test(e)&&((e=e.split("")).unshift(t,1),o.splice.apply(o,e))})),o.forEach((function(e,t){var n=S(p,e,d,t<o.length-1);n&&(y(e,n.left,n.bottom,l),function(e,t,n,i,a){switch(t){case"underline":b(e,n.left,Math.round(n.top+i.baseline+i.lineWidth),n.width,1,a);break;case"overline":b(e,n.left,Math.round(n.top),n.width,1,a);break;case"line-through":b(e,n.left,Math.ceil(n.top+i.middle+i.lineWidth),n.width,1,a)}}(l,d,n,i,c))})))}function T(e,t,n){var i,a,o=t.ctx,r=h(e,"listStyleType");if(/^(decimal|decimal-leading-zero|upper-alpha|upper-latin|upper-roman|lower-alpha|lower-greek|lower-latin|lower-roman)$/i.test(r)){if(i=function(e,t){var n,i=function(e){var t=-1,n=1,i=e.parentNode.childNodes;if(e.parentNode){for(;i[++t]!==e;)1===i[t].nodeType&&n++;return n}return-1}(e);switch(t){case"decimal":n=i;break;case"decimal-leading-zero":n=1===i.toString().length?i="0"+i.toString():i.toString();break;case"upper-roman":n=s.Generate.ListRoman(i);break;case"lower-roman":n=s.Generate.ListRoman(i).toLowerCase();break;case"lower-alpha":n=s.Generate.ListAlpha(i).toLowerCase();break;case"upper-alpha":n=s.Generate.ListAlpha(i)}return n+". "}(e,r),a=function(e,t){var n,i,a=l.createElement("boundelement");return a.style.display="inline",n=e.style.listStyleType,e.style.listStyleType="none",a.appendChild(l.createTextNode(t)),e.insertBefore(a,e.firstChild),i=s.Util.Bounds(a),e.removeChild(a),e.style.listStyleType=n,i}(e,i),w(o,e,"none",h(e,"color")),"inside"!==h(e,"listStylePosition"))return;o.setVariable("textAlign","left"),y(i,n.left,a.bottom,o)}}function k(e){var t=i[e];return!(!t||!0!==t.succeeded)&&t.img}function x(e,t){var n=Math.max(e.left,t.left),i=Math.max(e.top,t.top);return{left:n,top:i,width:Math.min(e.left+e.width,t.left+t.width)-n,height:Math.min(e.top+e.height,t.top+t.height)-i}}function E(e,t,n,i,a){var o=v(t,"paddingLeft"),s=v(t,"paddingTop"),r=v(t,"paddingRight"),l=v(t,"paddingBottom");F(e,n,0,0,n.width,n.height,i.left+o+a[3].width,i.top+s+a[0].width,i.width-(a[1].width+a[3].width+o+r),i.height-(a[0].width+a[2].width+s+l))}function I(e){return["Top","Right","Bottom","Left"].map((function(t){return{width:v(e,"border"+t+"Width"),color:h(e,"border"+t+"Color")}}))}m.innerHTML="."+f+'-before:before { content: "" !important; display: none !important; }.'+f+'-after:after { content: "" !important; display: none !important; }',p.appendChild(m),i=i||{};var L,A,P=(L=(Math.sqrt(2)-1)/3*4,function(e,t,n,i){var a=n*L,o=i*L,s=e+n,r=t+i;return{topLeft:D({x:e,y:r},{x:e,y:r-o},{x:s-a,y:t},{x:s,y:t}),topRight:D({x:e,y:t},{x:e+a,y:t},{x:s,y:r-o},{x:s,y:r}),bottomRight:D({x:s,y:t},{x:s,y:t+o},{x:e+a,y:r},{x:e,y:r}),bottomLeft:D({x:s,y:r},{x:s-a,y:r},{x:e,y:t+o},{x:e,y:t})}});function D(e,t,n,i){var a=function(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}};return{start:e,startControl:t,endControl:n,end:i,subdivide:function(o){var s=a(e,t,o),r=a(t,n,o),l=a(n,i,o),c=a(s,r,o),d=a(r,l,o),u=a(c,d,o);return[D(e,s,c,u),D(u,d,l,i)]},curveTo:function(e){e.push(["bezierCurve",t.x,t.y,n.x,n.y,i.x,i.y])},curveToReversed:function(i){i.push(["bezierCurve",n.x,n.y,t.x,t.y,e.x,e.y])}}}function N(e,t,n,i,a,o,s){t[0]>0||t[1]>0?(e.push(["line",i[0].start.x,i[0].start.y]),i[0].curveTo(e),i[1].curveTo(e)):e.push(["line",o,s]),(n[0]>0||n[1]>0)&&e.push(["line",a[0].start.x,a[0].start.y])}function M(e,t,n,i,a,o,s){var r=[];return t[0]>0||t[1]>0?(r.push(["line",i[1].start.x,i[1].start.y]),i[1].curveTo(r)):r.push(["line",e.c1[0],e.c1[1]]),n[0]>0||n[1]>0?(r.push(["line",o[0].start.x,o[0].start.y]),o[0].curveTo(r),r.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(r)):(r.push(["line",e.c2[0],e.c2[1]]),r.push(["line",e.c3[0],e.c3[1]])),t[0]>0||t[1]>0?(r.push(["line",a[1].end.x,a[1].end.y]),a[1].curveToReversed(r)):r.push(["line",e.c4[0],e.c4[1]]),r}function O(e,t,n,i,a){var o=[];switch(h(e,"backgroundClip")){case"content-box":case"padding-box":N(o,i[0],i[1],t.topLeftInner,t.topRightInner,a.left+n[3].width,a.top+n[0].width),N(o,i[1],i[2],t.topRightInner,t.bottomRightInner,a.left+a.width-n[1].width,a.top+n[0].width),N(o,i[2],i[3],t.bottomRightInner,t.bottomLeftInner,a.left+a.width-n[1].width,a.top+a.height-n[2].width),N(o,i[3],i[0],t.bottomLeftInner,t.topLeftInner,a.left+n[3].width,a.top+a.height-n[2].width);break;default:N(o,i[0],i[1],t.topLeftOuter,t.topRightOuter,a.left,a.top),N(o,i[1],i[2],t.topRightOuter,t.bottomRightOuter,a.left+a.width,a.top),N(o,i[2],i[3],t.bottomRightOuter,t.bottomLeftOuter,a.left+a.width,a.top+a.height),N(o,i[3],i[0],t.bottomLeftOuter,t.topLeftOuter,a.left,a.top+a.height)}return o}function B(e,t,n){var i,a,o,s,r,l,c=t.left,d=t.top,u=t.width,p=t.height,f=function(e){return["TopLeft","TopRight","BottomRight","BottomLeft"].map((function(t){return h(e,"border"+t+"Radius")}))}(e),m=function(e,t,n){var i=e.left,a=e.top,o=e.width,s=e.height,r=t[0][0],l=t[0][1],c=t[1][0],d=t[1][1],u=t[2][0],p=t[2][1],h=t[3][0],f=t[3][1],m=o-c,g=s-u,_=o-p,v=s-f;return{topLeftOuter:P(i,a,r,l).topLeft.subdivide(.5),topLeftInner:P(i+n[3].width,a+n[0].width,Math.max(0,r-n[3].width),Math.max(0,l-n[0].width)).topLeft.subdivide(.5),topRightOuter:P(i+m,a,c,d).topRight.subdivide(.5),topRightInner:P(i+Math.min(m,o+n[3].width),a+n[0].width,m>o+n[3].width?0:c-n[3].width,d-n[0].width).topRight.subdivide(.5),bottomRightOuter:P(i+_,a+g,p,u).bottomRight.subdivide(.5),bottomRightInner:P(i+Math.min(_,o+n[3].width),a+Math.min(g,s+n[0].width),Math.max(0,p-n[1].width),Math.max(0,u-n[2].width)).bottomRight.subdivide(.5),bottomLeftOuter:P(i,a+v,h,f).bottomLeft.subdivide(.5),bottomLeftInner:P(i+n[3].width,a+v,Math.max(0,h-n[3].width),Math.max(0,f-n[2].width)).bottomLeft.subdivide(.5)}}(t,f,n),g={clip:O(e,m,n,f,t),borders:[]};for(i=0;i<4;i++)if(n[i].width>0){switch(a=c,o=d,s=u,r=p-n[2].width,i){case 0:r=n[0].width,l=M({c1:[a,o],c2:[a+s,o],c3:[a+s-n[1].width,o+r],c4:[a+n[3].width,o+r]},f[0],f[1],m.topLeftOuter,m.topLeftInner,m.topRightOuter,m.topRightInner);break;case 1:l=M({c1:[(a=c+u-n[1].width)+(s=n[1].width),o],c2:[a+s,o+r+n[2].width],c3:[a,o+r],c4:[a,o+n[0].width]},f[1],f[2],m.topRightOuter,m.topRightInner,m.bottomRightOuter,m.bottomRightInner);break;case 2:l=M({c1:[a+s,(o=o+p-n[2].width)+(r=n[2].width)],c2:[a,o+r],c3:[a+n[3].width,o],c4:[a+s-n[2].width,o]},f[2],f[3],m.bottomRightOuter,m.bottomRightInner,m.bottomLeftOuter,m.bottomLeftInner);break;case 3:s=n[3].width,l=M({c1:[a,o+r+n[2].width],c2:[a,o],c3:[a+s,o+n[0].width],c4:[a+s,o+r]},f[3],f[0],m.bottomLeftOuter,m.bottomLeftInner,m.topLeftOuter,m.topLeftInner)}g.borders.push({args:l,color:n[i].color})}return g}function R(e,t){var n=e.drawShape();return t.forEach((function(e,t){n[0===t?"moveTo":e[0]+"To"].apply(null,e.slice(1))})),n}function $(e,t,n){var i,a,o=l.createElement("valuewrap");["lineHeight","textAlign","fontFamily","color","fontSize","paddingLeft","paddingTop","width","height","border","borderLeftWidth","borderTopWidth"].forEach((function(t){try{o.style[t]=h(e,t)}catch(n){r("html2canvas: Parse: Exception caught in renderFormValue: "+n.message)}})),o.style.borderColor="black",o.style.borderStyle="solid",o.style.display="block",o.style.position="absolute",(/^(submit|reset|button|text|password)$/.test(e.type)||"SELECT"===e.nodeName)&&(o.style.lineHeight=h(e,"height")),o.style.top=t.top+"px",o.style.left=t.left+"px",(i="SELECT"===e.nodeName?(e.options[e.selectedIndex]||0).text:e.value)||(i=e.placeholder),a=l.createTextNode(i),o.appendChild(a),p.appendChild(o),C(e,a,n),p.removeChild(o)}function F(e){e.drawImage.apply(e,Array.prototype.slice.call(arguments,1))}function U(n,i){var a=e.getComputedStyle(n,i);if(a&&a.content&&"none"!==a.content&&"-moz-alt-content"!==a.content){var o=a.content+"",l=o.substr(0,1);l===o.substr(o.length-1)&&l.match(/'|"/)&&(o=o.substr(1,o.length-2));var c="url"===o.substr(0,3),d=t.createElement(c?"img":"span");return d.className=f+"-before "+f+"-after",Object.keys(a).filter(H).forEach((function(e){try{d.style[e]=a[e]}catch(t){r(["Tried to assign readonly property ",e,"Error:",t])}})),c?d.src=s.Util.parseBackgroundImage(o)[0].args[0]:d.innerHTML=o,d}}function H(t){return isNaN(e.parseInt(t,10))}function V(e,t,n,i){var a=Math.round(i.left+n.left),o=Math.round(i.top+n.top);e.createPattern(t),e.translate(a,o),e.fill(),e.translate(-a,-o)}function q(e,t,n,i,a,o,s,r){var l=[];l.push(["line",Math.round(a),Math.round(o)]),l.push(["line",Math.round(a+s),Math.round(o)]),l.push(["line",Math.round(a+s),Math.round(r+o)]),l.push(["line",Math.round(a),Math.round(r+o)]),R(e,l),e.save(),e.clip(),V(e,t,n,i),e.restore()}function W(e,t,n,i,a){var o=s.Util.BackgroundSize(e,t,i,a),r=s.Util.BackgroundPosition(e,t,i,a,o),c=h(e,"backgroundRepeat").split(",").map((function(e){return e.trim()}));switch(i=function(e,t){if(e.width===t.width&&e.height===t.height)return e;var n,i=l.createElement("canvas");return i.width=t.width,i.height=t.height,n=i.getContext("2d"),F(n,e,0,0,e.width,e.height,0,0,t.width,t.height),i}(i,o),c=c[a]||c[0]){case"repeat-x":q(n,i,r,t,t.left,t.top+r.top,99999,i.height);break;case"repeat-y":q(n,i,r,t,t.left+r.left,t.top,i.width,99999);break;case"no-repeat":q(n,i,r,t,t.left+r.left,t.top+r.top,i.width,i.height);break;default:V(n,i,r,{top:t.top,left:t.left,width:i.width,height:i.height})}}function j(e,t,n){var i=h(t,"opacity")*(n?n.opacity:1);return e.setVariable("globalAlpha",i),i}function G(e,t,n){var i,o=s.Util.Bounds(e),l=u.test(e.nodeName)?"#efefef":h(e,"backgroundColor"),d=function(e,t,n){var i,o,r,l,d,u,p=(l=t?n.width:g(),d=t?n.height:_(),{storage:u=[],width:l,height:d,clip:function(){u.push({type:"function",name:"clip",arguments:arguments})},translate:function(){u.push({type:"function",name:"translate",arguments:arguments})},fill:function(){u.push({type:"function",name:"fill",arguments:arguments})},save:function(){u.push({type:"function",name:"save",arguments:arguments})},restore:function(){u.push({type:"function",name:"restore",arguments:arguments})},fillRect:function(){u.push({type:"function",name:"fillRect",arguments:arguments})},createPattern:function(){u.push({type:"function",name:"createPattern",arguments:arguments})},drawShape:function(){var e=[];return u.push({type:"function",name:"drawShape",arguments:e}),{moveTo:function(){e.push({name:"moveTo",arguments:arguments})},lineTo:function(){e.push({name:"lineTo",arguments:arguments})},arcTo:function(){e.push({name:"arcTo",arguments:arguments})},bezierCurveTo:function(){e.push({name:"bezierCurveTo",arguments:arguments})},quadraticCurveTo:function(){e.push({name:"quadraticCurveTo",arguments:arguments})}}},drawImage:function(){u.push({type:"function",name:"drawImage",arguments:arguments})},fillText:function(){u.push({type:"function",name:"fillText",arguments:arguments})},setVariable:function(e,t){u.push({type:"variable",name:e,arguments:t})}}),f={ctx:p,zIndex:(i=h(e,"zIndex"),o=t?t.zIndex:null,o?"auto"!==i?(r=c(i),o.children.push(r),r):o:r=c(0)),opacity:j(p,e,t),cssPosition:h(e,"position"),borders:I(e),clip:t&&t.clip?s.Util.Extend({},t.clip):null};return!0===a.useOverflow&&!0===/(hidden|scroll|auto)/.test(h(e,"overflow"))&&!1===/(BODY)/i.test(e.nodeName)&&(f.clip=f.clip?x(f.clip,n):n),f.zIndex.children.push(f),f}(e,t,o),p=d.borders,m=d.ctx,v=function(e,t,n){var i={left:t.left+e[3].width,top:t.top+e[0].width,width:t.width-(e[1].width+e[3].width),height:t.height-(e[0].width+e[2].width)};return n&&(i=x(i,n)),i}(p,o,d.clip),y=B(e,o,p);switch(R(m,y.clip),m.save(),m.clip(),v.height>0&&v.width>0&&(function(e,t,n){b(e,t.left,t.top,t.width,t.height,n)}(m,o,l),function(e,t,n){for(var i,a=h(e,"backgroundImage"),o=s.Util.parseBackgroundImage(a),l=o.length;l--;)(a=o[l]).args&&0!==a.args.length&&((i=k("url"===a.method?a.args[0]:a.value))?W(e,t,n,i,l):r("html2canvas: Error loading background:"))}(e,v,m)),m.restore(),y.borders.forEach((function(e){!function(e,t,n){"transparent"!==n&&(e.setVariable("fillStyle",n),R(e,t),e.fill())}(m,e.args,e.color)})),n||function(e,t){var n=U(e,":before"),i=U(e,":after");(n||i)&&(n&&(e.className+=" "+f+"-before",e.parentNode.insertBefore(n,e),z(n,t,!0),e.parentNode.removeChild(n),e.className=e.className.replace(f+"-before","").trim()),i&&(e.className+=" "+f+"-after",e.appendChild(i),z(i,t,!0),e.removeChild(i),e.className=e.className.replace(f+"-after","").trim()))}(e,d),e.nodeName){case"IMG":(i=k(e.getAttribute("src")))?E(m,e,i,o,p):r("html2canvas: Error loading <img>:"+e.getAttribute("src"));break;case"INPUT":/^(text|url|email|submit|button|reset)$/.test(e.type)&&(e.value||e.placeholder).length>0&&$(e,o,d);break;case"TEXTAREA":(e.value||e.placeholder||"").length>0&&$(e,o,d);break;case"SELECT":(e.options||e.placeholder||"").length>0&&$(e,o,d);break;case"LI":T(e,d,v);break;case"CANVAS":E(m,e,e,o,p)}return d}function z(e,t,n){(function(e){return"none"!==h(e,"display")&&"hidden"!==h(e,"visibility")&&!e.hasAttribute("data-html2canvas-ignore")})(e)&&!s.Util.OutsideViewport(e)&&(t=G(e,t,n)||t,u.test(e.nodeName)||s.Util.Children(e).forEach((function(i){1===i.nodeType?z(i,t,n):3===i.nodeType&&C(e,i,t)})))}return A=G(o,null),d.svgRendering&&function(e,t){var n=new Image,i=g(),a=_(),o="";!function r(e){var t,n,i,a,l,c=s.Util.Children(e),d=c.length;for(l=0;l<d;l+=1)if(3===(a=c[l]).nodeType)o+=a.nodeValue.replace(/</g,"&lt;").replace(/>/g,"&gt;");else if(1===a.nodeType&&!/^(script|meta|title)$/.test(a.nodeName.toLowerCase())){if(o+="<"+a.nodeName.toLowerCase(),a.hasAttributes())for(i=(t=a.attributes).length,n=0;n<i;n+=1)o+=" "+t[n].name+'="'+t[n].value+'"';o+=">",r(a),o+="</"+a.nodeName.toLowerCase()+">"}}(e),n.src=["data:image/svg+xml,","<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='"+i+"' height='"+a+"'>","<foreignObject width='"+i+"' height='"+a+"'>","<html xmlns='http://www.w3.org/1999/xhtml' style='margin:0;'>",o.replace(/\#/g,"%23"),"</html>","</foreignObject>","</svg>"].join(""),n.onload=function(){t.svgRender=n}}(t.documentElement,A),Array.prototype.slice.call(o.children,0).forEach((function(e){z(e,A)})),A.backgroundColor=h(t.documentElement,"backgroundColor"),p.removeChild(m),A},s.Preload=function(i){var a,o,l,c,d={numLoaded:0,numFailed:0,numTotal:0,cleanupDone:!1},u=0,p=i.elements[0]||t.body,h=p.ownerDocument,f=h.images,m=f.length,g=h.createElement("a"),_=(new Image).crossOrigin!==n;function v(){r("html2canvas: start: images: "+d.numLoaded+" / "+d.numTotal+" (failed: "+d.numFailed+")"),!d.firstRun&&d.numLoaded>=d.numTotal&&(r("Finished loading images: # "+d.numTotal+" (failed: "+d.numFailed+")"),"function"==typeof i.complete&&i.complete(d))}function b(t,a,o){var s,r,l=i.proxy;g.href=t,t=g.href,s="html2canvas_"+u++,o.callbackname=s,l.indexOf("?")>-1?l+="&":l+="?",l+="url="+encodeURIComponent(t)+"&callback="+s,r=h.createElement("script"),e[s]=function(t){"error:"===t.substring(0,6)?(o.succeeded=!1,d.numLoaded++,d.numFailed++,v()):(C(a,o),a.src=t),e[s]=n;try{delete e[s]}catch(i){}r.parentNode.removeChild(r),r=null,delete o.script,delete o.callbackname},r.setAttribute("type","text/javascript"),r.setAttribute("src",l),o.script=r,e.document.body.appendChild(r)}function y(t,n){var i=e.getComputedStyle(t,n),a=i.content;"url"===a.substr(0,3)&&o.loadImage(s.Util.parseBackgroundImage(a)[0].args[0]),S(i.backgroundImage,t)}function w(e){return e&&e.method&&e.args&&e.args.length>0}function S(e,t){var i;s.Util.parseBackgroundImage(e).filter(w).forEach((function(e){"url"===e.method?o.loadImage(e.args[0]):e.method.match(/\-?gradient$/)&&(i===n&&(i=s.Util.Bounds(t)),function(e,t){var i=s.Generate.Gradient(e,t);i!==n&&(d[e]={img:i,succeeded:!0},d.numTotal++,d.numLoaded++,v())}(e.value,i))}))}function C(t,a){t.onload=function(){a.timer!==n&&e.clearTimeout(a.timer),d.numLoaded++,a.succeeded=!0,t.onerror=t.onload=null,v()},t.onerror=function(){if("anonymous"===t.crossOrigin&&(e.clearTimeout(a.timer),i.proxy)){var n=t.src;return t=new Image,a.img=t,t.src=n,void b(t.src,t,a)}d.numLoaded++,d.numFailed++,a.succeeded=!1,t.onerror=t.onload=null,v()}}for(g.href=e.location.href,a=g.protocol+g.host,o={loadImage:function(t){var o,s,r;t&&d[t]===n&&(o=new Image,t.match(/data:image\/.*;base64,/i)?(o.src=t.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),s=d[t]={img:o},d.numTotal++,C(o,s)):(r=t,g.href=r,g.href=g.href,g.protocol+g.host===a||!0===i.allowTaint?(s=d[t]={img:o},d.numTotal++,C(o,s),o.src=t):_&&!i.allowTaint&&i.useCORS?(o.crossOrigin="anonymous",s=d[t]={img:o},d.numTotal++,C(o,s),o.src=t,o.customComplete=function(){this.img.complete?this.img.onerror():this.timer=e.setTimeout(this.img.customComplete,100)}.bind(s),o.customComplete()):i.proxy&&(s=d[t]={img:o},d.numTotal++,b(t,o,s))))},cleanupDOM:function(a){var o,s;if(!d.cleanupDone){for(s in r(a&&"string"==typeof a?"html2canvas: Cleanup because: "+a:"html2canvas: Cleanup after timeout: "+i.timeout+" ms."),d)if(d.hasOwnProperty(s)&&"object"==typeof(o=d[s])&&o.callbackname&&o.succeeded===n){e[o.callbackname]=n;try{delete e[o.callbackname]}catch(l){}o.script&&o.script.parentNode&&(o.script.setAttribute("src","about:blank"),o.script.parentNode.removeChild(o.script)),d.numLoaded++,d.numFailed++,r("html2canvas: Cleaned up failed img: '"+s+"' Steps: "+d.numLoaded+" / "+d.numTotal)}e.stop!==n?e.stop():t.execCommand!==n&&t.execCommand("Stop",!1),t.close!==n&&t.close(),d.cleanupDone=!0,a&&"string"==typeof a||v()}},renderingDone:function(){c&&e.clearTimeout(c)}},i.timeout>0&&(c=e.setTimeout(o.cleanupDOM,i.timeout)),r("html2canvas: Preload starts: finding background-images"),d.firstRun=!0,function u(e){var t=!1;if(!s.Util.OutsideViewport(e)){try{s.Util.Children(e).forEach((function(e){u(e)}))}catch(i){}try{t=e.nodeType}catch(a){t=!1,r("html2canvas: failed to access some element's nodeType - Exception: "+a.message)}if(1===t||t===n){!function(e){y(e,":before"),y(e,":after")}(e);try{S(s.Util.getCSS(e,"backgroundImage"),e)}catch(i){r("html2canvas: failed to get background-image - Exception: "+i.message)}S(e)}}}(p),r("html2canvas: Preload: Finding images"),l=0;l<m;l+=1)s.Util.OutsideViewport(f[l])||o.loadImage(f[l].getAttribute("src"));return d.firstRun=!1,r("html2canvas: Preload: Done."),d.numTotal===d.numLoaded&&v(),o},s.Renderer=function(e,i){return function(e){var t;if("string"==typeof i.renderer&&s.Renderer[e]!==n)t=s.Renderer[e](i);else{if("function"!=typeof e)throw new Error("Unknown renderer");t=e(i)}if("function"!=typeof t)throw new Error("Invalid renderer defined");return t}(i.renderer)(e,i,t,function(e){var t=[],n=function(e){var i=[],a=[];e.children.forEach((function(e){e.children&&e.children.length>0?(i.push(e),a.push(e.zindex)):t.push(e)})),a.sort((function(e,t){return e-t})),a.forEach((function(e){var t;i.some((function(n,i){return t=i,n.zindex===e})),n(i.splice(t,1)[0])}))};return e&&e.zIndex&&n(e.zIndex),t}(e),s)},s.Util.Support=function(e,t){return{rangeBounds:(o=!1,t.createRange&&(i=t.createRange()).getBoundingClientRect&&((a=t.createElement("boundtest")).style.height="123px",a.style.display="block",t.body.appendChild(a),i.selectNode(a),123===i.getBoundingClientRect().height&&(o=!0),t.body.removeChild(a)),o),svgRendering:e.svgRendering&&function(){var e=new Image,i=t.createElement("canvas"),a=i.getContext!==n&&i.getContext("2d");if(!1===a)return!1;i.width=i.height=10,e.src=["data:image/svg+xml,","<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10'>","<foreignObject width='10' height='10'>","<div xmlns='http://www.w3.org/1999/xhtml' style='width:10;height:10;'>","sup","</div>","</foreignObject>","</svg>"].join("");try{a.drawImage(e,0,0),i.toDataURL()}catch(o){return!1}return r("html2canvas: Parse: SVG powered rendering available"),!0}()};var i,a,o},e.html2canvas=function(t,n){var i,a,o={logging:!1,elements:t=t.length?t:[t],background:"#fff",proxy:null,timeout:0,useCORS:!1,allowTaint:!1,svgRendering:!1,ignoreElements:"IFRAME|OBJECT|PARAM",useOverflow:!0,letterRendering:!1,chinese:!1,width:null,height:null,taintTest:!0,renderer:"Canvas"};return o=s.Util.Extend(n,o),s.logging=o.logging,o.complete=function(e){"function"==typeof o.onpreloaded&&!1===o.onpreloaded(e)||(i=s.Parse(e,o),"function"==typeof o.onparsed&&!1===o.onparsed(i)||(a=s.Renderer(i,o),"function"==typeof o.onrendered&&o.onrendered(a)))},e.setTimeout((function(){s.Preload(o)}),0),{render:function(e,t){return s.Renderer(e,s.Util.Extend(t,o))},parse:function(e,t){return s.Parse(e,s.Util.Extend(t,o))},preload:function(e){return s.Preload(s.Util.Extend(e,o))},log:r}},e.html2canvas.log=r,e.html2canvas.Renderer={Canvas:n},s.Renderer.Canvas=function(e){e=e||{};var i=t,a=[],o=t.createElement("canvas"),s=o.getContext("2d"),l=e.canvas||i.createElement("canvas");function c(t,n){switch(n.type){case"variable":t[n.name]=n.arguments;break;case"function":if("createPattern"===n.name){if(n.arguments[0].width>0&&n.arguments[0].height>0)try{t.fillStyle=t.createPattern(n.arguments[0],"repeat")}catch(l){r("html2canvas: Renderer: Error creating pattern",l.message)}}else"drawShape"===n.name?function(e,t){e.beginPath(),t.forEach((function(t){e[t.name].apply(e,t.arguments)})),e.closePath()}(t,n.arguments):"drawImage"===n.name?n.arguments[8]>0&&n.arguments[7]>0&&(!e.taintTest||e.taintTest&&function(e){if(-1===a.indexOf(e.arguments[0].src)){s.drawImage(e.arguments[0],0,0);try{s.getImageData(0,0,1,1)}catch(l){return o=i.createElement("canvas"),s=o.getContext("2d"),!1}a.push(e.arguments[0].src)}return!0}(n))&&t.drawImage.apply(t,n.arguments):t[n.name].apply(t,n.arguments)}}return function(e,t,i,a,o){var s,d,u,p,h,f,m,g=l.getContext("2d");if(l.width=l.style.width=t.width||e.ctx.width,l.height=l.style.height=t.height||e.ctx.height,f=g.fillStyle,g.fillStyle="transparent"!==(m=e.backgroundColor)&&"rgba(0, 0, 0, 0)"!==m||t.background===n?e.backgroundColor:t.background,g.fillRect(0,0,l.width,l.height),g.fillStyle=f,t.svgRendering&&e.svgRender!==n)g.drawImage(e.svgRender,0,0);else for(d=0,u=a.length;d<u;d+=1)(s=a.splice(0,1)[0]).canvasPosition=s.canvasPosition||{},g.textBaseline="bottom",s.clip&&(g.save(),g.beginPath(),g.rect(s.clip.left,s.clip.top,s.clip.width,s.clip.height),g.clip()),s.ctx.storage&&s.ctx.storage.forEach(c.bind(null,g)),s.clip&&g.restore();return r("html2canvas: Renderer: Canvas renderer done - returning canvas obj"),1===(u=t.elements.length)&&"object"==typeof t.elements[0]&&"BODY"!==t.elements[0].nodeName?(h=o.Util.Bounds(t.elements[0]),(p=i.createElement("canvas")).width=h.width,p.height=h.height,(g=p.getContext("2d")).drawImage(l,h.left,h.top,h.width,h.height,0,0,h.width,h.height),l=null,p):l}}}(window,document)}})}var feedbackListenerReady=!1;function handleShowLogin(e){return"1"!==headScript_pc_static_index.BDSInstance.comm.isUserLogin&&!headScript_pc_static_index.BDSInstance.comm.user&&(headScript_pc_static_index.BDSInstance.se.login.open((function(t){1===t&&"function"==typeof e&&e()})),!0)}function addFeedbackListener(){return headScript_pc_static_index.__awaiter(this,void 0,void 0,(function(){var e=this;return headScript_pc_static_index.__generator(this,(function(t){return feedbackListenerReady=!0,isOldIE()?!feedbackListenerReady&&document.addEventListener("click",(function(t){-1!==t.srcElement.className.indexOf("feedback")&&new Promise((function(e,t){require(['feedback/pc/static/feedback-init-old'],e,t)})).then((function(){var t={product_id:18,entrance_id:e.getAttribute("data-feedbackid")||1},n={username:headScript_pc_static_index.BDSInstance.comm.username,query:headScript_pc_static_index.BDSInstance.comm.query,fb_qid:headScript_pc_static_index.BDSInstance.comm.qid};handleShowLogin((function(){headScript_pc_static_index.BDSInstance.qa.ShortCut.initRightBar(t,n,!0)}))||headScript_pc_static_index.BDSInstance.qa.ShortCut.initRightBar(t,n)}))})):document.querySelectorAll(".feedback").forEach((function(e){e.addEventListener("click",(function(){handleShowLogin((function(){headScript_pc_static_index.BDSInstance.se.ShortCut.initRightBar(!0)}))||headScript_pc_static_index.BDSInstance.se.ShortCut.initRightBar()}))})),[2]}))}))}function feedbackEntry(){feedbackInit(),headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){addFeedbackListener()}))}var clickReport=function(e,t){var n,i,a="string"==typeof t&&t?t:headScript_pc_static_index.BDSInstance.comm.queryId,o=e.p1;if("alop"===e.fm&&!e.rsv_xpath&&(!o||headScript_pc_static_index.getElement(o)&&"6677"!==headScript_pc_static_index.getElement(o).getAttribute("srcid")))return!0;o&&!e.p5&&(e.p5=o);var s,r="",l=window["BD_PS_C"+(new Date).getTime()]=new Image;if(e.title){var c=e.title.replace(/<[^<>]+>/g,"");(null==c?void 0:c.length)>100&&(c=c.substring(0,100)),e.title=encodeURIComponent(c)}if(e.mu=e.mu&&escape(e.mu)||"",e.url=e.url&&escape(e.url)||"",!e.mu){var d=headScript_pc_static_index.getElement(e.p1);e.p2&&(null==d?void 0:d.getAttribute("mu"))&&"pl"!==e.fm&&(r="&mu=".concat(escape(d.getAttribute("mu"))))}s=headScript_pc_static_index.objToStr(e,"&",{encode:!1,supportNoMeaningVal:!0});var u={rsv_sid:headScript_pc_static_index.BDSInstance.comm.sid,cid:headScript_pc_static_index.BDSInstance.comm.cid,qid:a,t:+Date.now(),rsv_inter:headScript_pc_static_index.BDSInstance.comm.inter,rsv_pstg:null===(n=headScript_pc_static_index.BDSInstance.comm.seinfo)||void 0===n?void 0:n.rsv_pstg,rsv_cftime:headScript_pc_static_index.BDSInstance.comm.cftime,rsv_iorr:headScript_pc_static_index.BDSInstance.comm.resultPage?1:0,rsv_tn:headScript_pc_static_index.BDSInstance.comm.tn,rsv_isid:headScript_pc_static_index.BDSInstance.comm.indexSid,rsv_lavo:headScript_pc_static_index.BDSInstance.comm.lastVoiceQuery?encodeURIComponent(headScript_pc_static_index.BDSInstance.comm.lastVoiceQuery):"",rsv_ispeed:null===(i=window.Cookie)||void 0===i?void 0:i.get("ispeed")},p=headScript_pc_static_index.objToStr(u,"&",{encode:!1}),h="".concat(headScript_pc_static_index.BDSInstance.comm.ubsurl,"?q=").concat(headScript_pc_static_index.BDSInstance.comm.queryEnc,"&").concat(s)+r+"&".concat(p);location.href.includes("ssl_sample")&&(h+="&rsv_"+location.href.match(/ssl_sample=[^=&]+/i)[0]);location.href.includes("ssl_s=")&&(h+="&rsv_"+location.href.match(/ssl_s=[^=&]+/i)[0]);var f={rsv_ssl:"https:"===location.protocol?1:0,path:encodeURIComponent(location.href),rsv_did:headScript_pc_static_index.BDSInstance.comm.did},m=headScript_pc_static_index.objToStr(f,"&",{encode:!1});return h+="&".concat(m),l.src=h,!0};function addModuleUpdateListener(e,t){headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){e.destroyResult()})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapDomReady((function(n){e.initLoadMoreService(),e.updated(),!t&&e.addResult(n.resultRoot)}))}function initPageModule(e){void 0===e&&(e=!1),new Promise((function(e,t){require(['modules/pc/static/page/main-page.module'],e,t)})).then((function(e){return e.EslModuleExport38})).then((function(t){var n=new t.MainPageModule(e);headScript_pc_static_index.BDSInstance.comm.ishome?addModuleUpdateListener(n,e):headScript_pc_static_index.BDSInstance.lifecycle.onJSReady((function(){addModuleUpdateListener(n,e)}),{once:!0})}))}function qaInit(e){var t=e.bds,n=getUrlParam();if("1"===t.comm.isUserLogin&&n.kgq_encodeid)try{t.amd.addPaths({"mkt/qa-sdk":"https://psstatic.cdn.bcebos.com/operation/index_1751265849000"});var i=document.createElement("div");i.id="qa-sdk-container",window.__MKT_QA_PC_SDK_CONTAINER=i,document.body.appendChild(i),require(["mkt/qa-sdk"],(function(e){new e(i,{isLogin:"1"===t.comm.isUserLogin,login:t.se.login,urlParams:n})}))}catch(a){}}function getUrlParam(e){var t,n,i=e||window.location.href,a={};try{if(-1!==i.indexOf("?")){var o=i.substring(i.indexOf("?")+1).split("&");try{for(var s=headScript_pc_static_index.__values(o),r=s.next();!r.done;r=s.next()){var l=r.value;if(l){var c=l.split("=");if(c.length>=2){var d=decodeURIComponent(c[0]),u=decodeURIComponent(c[1]);a[d]=u}}}}catch(p){t={error:p}}finally{try{r&&!r.done&&(n=s["return"])&&n.call(s)}finally{if(t)throw t.error}}}}catch(h){}return a}function parse(e){var t=eval;if(e=e.replace(/^\s+|\s+$/g,""),/^[\],:{}\s]*$/.test(e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return t("("+e+")");throw new Error("Invalid JSON string")}function stringify(e){var t,n,i,a;if("object"!=typeof e||null===e)return"string"==typeof e?'"'+e+'"':String(e);if(e instanceof Array){var o=[];try{for(var s=headScript_pc_static_index.__values(e),r=s.next();!r.done;r=s.next()){var l=r.value;o.push(stringify(l))}}catch(g){t={error:g}}finally{try{r&&!r.done&&(n=s["return"])&&n.call(s)}finally{if(t)throw t.error}}return"["+o.join(",")+"]"}var c=[],d=Object.keys(e);try{for(var u=headScript_pc_static_index.__values(d),p=u.next();!p.done;p=u.next()){var h=p.value,f=stringify(h),m=stringify(e[h]);c.push("".concat(f,":").concat(m))}}catch(_){i={error:_}}finally{try{p&&!p.done&&(a=u["return"])&&a.call(u)}finally{if(i)throw i.error}}return"{"+c.join(",")+"}"}function JsonPolyfill(){return{parse:parse,stringify:stringify}}var globalVariables={currentEnv:null,currentCacheItem:null,oldCacheItem:{},isEcomSug:0,defaultOptions:{use_cache_repeatedly:!0,index_form:"#form",kw:"#kw",result_form:"#form"},sendConfirmTimeout:!1,sendConfirmTimeoutFunc:function(){},hideKwTip:!1,disablePreload:!1,disablePredict:!1,pageStartTime:0,preloadLogs:[],preload_num:0,preload_cnt:0,hsug:[],afterUserSubmit:!1};window.__globalVariables=globalVariables;var resultForm=$("#form"),indexForm=headScript_pc_static_index.getElement("form"),kw=$("#kw"),INIT_DATA_CONTENT_ID="init-data-content",LONG_QUERY_MAX_LEN=1e3,PageEnv=function(){function e(e,t){this.compareParams=["wd","pn","nojc","cl","cq","srcid","gpc","tfflag","si","sl_lang","rsv_srlang","rqlang"],this.allParamKeys=["wd","cl","ct","tn","rn","ie","f","lm","si","gpc","tfflag","usm","z","ch","sts","vit","dsp","trh","trb","tre","la","lo","st","nojc","haobd","rtt","bsst","gvideo","__eis","__eist","oq","fenlei","sid","rsv_idx","rsv_stat","rsv_bp","rqlang"],this.wdSameNameKeys=["w","word"],this.headerParams={},this.params={},t||this.initIndexFormData(),this.initParams(e)}return e.prototype.initIndexFormData=function(){var e=this;$("#form").serializeArray().forEach((function(t){var n=t.name,i=t.value;e.getParams(n)||e.setParams(n,i)}))},e.prototype.initParams=function(e){var t=this;void 0===e&&(e={}),Object.entries(e).forEach((function(e){var n=headScript_pc_static_index.__read(e,2),i=n[0],a=n[1];t.setParams(i,a)}))},e.prototype.initHeaderParams=function(e){this.headerParams=Object.assign(this.headerParams,e)},e.prototype.serializeHeaderParams=function(){var e={};return Object.entries(this.headerParams).forEach((function(t){var n=headScript_pc_static_index.__read(t,2),i=n[0],a=n[1];if(headScript_pc_static_index.isObject(a)){var o=Object.keys(a),s=[];o.forEach((function(e){headScript_pc_static_index.isArray(a[e])?s.push("".concat(e,"=").concat(a[e].join("|"))):s.push("".concat(e,"=").concat(a[e]))})),e[i]=s.join("&")}e[i]=a})),e},e.prototype.buildSearchUrl=function(e){return"".concat(location.protocol,"//").concat(location.host).concat(location.pathname).concat(location.search,"#").concat(this.buildQueryString(e))},e.prototype.buildSyncSearchUrl=function(e){return"".concat(location.protocol,"//").concat(location.host,"/s?").concat(this.buildQueryString(e))},e.prototype.buildQueryString=function(e){var t=this.getCloneParams(this.params);headScript_pc_static_index.isObject(e)&&Object.assign(t,e);return t.wd=(t.wd||"").slice(0,LONG_QUERY_MAX_LEN),headScript_pc_static_index.objToStr(t,"&",{encode:!0}).replace(/'/g,"%27")},e.prototype.getClonePageEnvInstance=function(t){var n=this;void 0===t&&(t={});var i=new e(this.getCloneParams(this.params),!1);return Object.keys(t).forEach((function(e){n.allParamKeys.includes(e)&&i.setParams(e,t[e])})),Object.entries(t).forEach((function(e){var t=headScript_pc_static_index.__read(e,2),a=t[0],o=t[1];n.allParamKeys.includes(a)&&i.setParams(a,o)})),i},e.prototype.getCloneParams=function(e){return"object"==typeof e?Object.assign({},e):e},e.prototype.setParams=function(e,t){this.wdSameNameKeys.includes(e)&&(e="wd"),this.params[e]=t},e.prototype.getParams=function(e){return this.wdSameNameKeys.includes(e)&&(e="wd"),this.params[e]},e.prototype.equals=function(e){var t,n;if(!e||!e.getParams)return!1;try{for(var i=headScript_pc_static_index.__values(this.compareParams),a=i.next();!a.done;a=i.next()){var o=a.value;if("pn"===o){if((this.getParams("pn")?this.getParams("pn"):"0")!==(e.getParams("pn")?e.getParams("pn"):"0"))return!1}else if(this.getParams(o)!==e.getParams(o))return!1}}catch(s){t={error:s}}finally{try{a&&!a.done&&(n=i["return"])&&n.call(i)}finally{if(t)throw t.error}}return!0},e.prototype.hashCode=function(){var e,t,n=[];if(!this.getParams("wd"))return"";try{for(var i=headScript_pc_static_index.__values(this.compareParams),a=i.next();!a.done;a=i.next()){var o=a.value;"pn"!==o||this.getParams(o)?n.push(this.getParams(o)):n.push("0")}}catch(s){e={error:s}}finally{try{a&&!a.done&&(t=i["return"])&&t.call(i)}finally{if(e)throw e.error}}return n.join("\t")},e.prototype.filterParams=function(){var e=this;Object.keys(this.params).forEach((function(t){e.allParamKeys.includes(t)||delete e.params[t]}))},e.prototype.initWdSameName=function(){var e=this;this.wdSameNameKeys.forEach((function(t){e.params[t]&&(e.params.wd=e.params[t])}))},e}();function sslEnableTest(){var e=+new Date,t={gt1:"https://gt1.baidu.com/nocache/imgdata/sp613.gif?t=".concat(e),gt2:"https://gt2.baidu.com/nocache/imgdata/sp613.gif?t=".concat(e)};setTimeout((function(){var n,i,a=[],o=[],s={},r=Object.keys(t),l=function(e){var t="_SSL_LOG_".concat(e,"_").concat(+new Date),n=new Image,i=new Date;s[e]=new Promise((function(o){n.onload=function(){a.push("".concat(e,"_success=").concat(+new Date-+i)),o(),delete window[t]},n.onerror=function(){a.push("".concat(e,"_error=").concat(+new Date-+i)),o(),delete window[t]}})),o.push(s[e])};try{for(var c=headScript_pc_static_index.__values(r),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(u){n={error:u}}finally{try{d&&!d.done&&(i=c["return"])&&i.call(c)}finally{if(n)throw n.error}}Promise.all(o)["finally"]((function(){var t=a.join("&"),n=new Image,i="_HM_LOG_".concat(+new Date);n.onload=function(){delete window[i]},window[i]=n,n.src="//www.baidu.com/nocache/fesplg/s.gif?log_type=hm&type=ssl&"+t+"&_tt="+e}))}),1e3)}function initSSLEnableTest(){var e=Math.random();e>.1&&e<.11&&sslEnableTest()}var lastTarget=null,timeDiff=-1,timeStart=0,x1=-1,y1=-1,x2=-1,y2=-1,submit=0;function ckLogMouseDown(e){if(e){x2=e.pageX,y2=e.pageY,lastTarget=e.target;var t=$(e.target);"submit"===t.attr("type")&&(submit=1);var n=t.offset();x1=x2-n.left,y1=y2-n.top,timeStart=+new Date}}function ckLogMouseUp(e){e&&e.target===lastTarget&&(timeDiff=+new Date-timeStart)}function ckLog(e){headScript_pc_static_index.BDSInstance.comm.query&&(e=headScript_pc_static_index.BDSInstance.comm.query);var t="".concat(submit,".").concat(timeDiff,".").concat(x1,".").concat(y1,".").concat(x2,".").concat(y2);return t="".concat(headScript_pc_static_index.crc32(t+e),".").concat(t)}function ckLogClear(){timeDiff=-1,timeStart=0,x1=-1,y1=-1,x2=-1,y2=-1,submit=0}function preloadLogsStr(){return globalVariables.preloadLogs.length}function sendSE(){headScript_pc_static_index.BDSInstance.comm.seinfo&&(headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_pre=encodeURIComponent(preloadLogsStr()),headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_reh=window.reh_rec(),headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_scr=window.scr_rec());var e=null;if(headScript_pc_static_index.BDSInstance.comm.personalData)try{"string"==typeof headScript_pc_static_index.BDSInstance.comm.personalData&&(headScript_pc_static_index.BDSInstance.comm.personalData=JSON.parse(headScript_pc_static_index.BDSInstance.comm.personalData)),e=headScript_pc_static_index.BDSInstance.comm.personalData?headScript_pc_static_index.BDSInstance.comm.personalData.fullSkinName&&headScript_pc_static_index.BDSInstance.comm.personalData.fullSkinName.value:null}catch(i){e=null}if(e&&(headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_skin=e),headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_psid=headScript_pc_static_index.getCookie("BIDUPSID"),headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_pstm=headScript_pc_static_index.getCookie("PSTM"),headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_idc=function(){var e=headScript_pc_static_index.BDSInstance.comm.speedInfo||[];try{e=JSON.parse(e)}catch(i){e=[]}for(var t=0,n=e.length;t<n;t++)if(9540===e[t].ModuleId)return e[t].Idc||"";return""}(),clickReport(headScript_pc_static_index.BDSInstance.comm.seinfo),"ON"===headScript_pc_static_index.BDSInstance.comm._se_click_track_flag){var t=new Image,n="//www.baidu.com/s?wd="+headScript_pc_static_index.BDSInstance.comm.queryEnc+"&qid="+headScript_pc_static_index.BDSInstance.comm.queryId+"&lts=91";t.src=n}initSSLEnableTest()}function initPreloadGlobal(){"clearissw"===headScript_pc_static_index.BDSInstance.comm.query&&bottomScript_pc_static_instantSearchNewi.cookieInstance.clear("ISSW");var e=$.Deferred();headScript_pc_static_index.BDSInstance.comm.registerUnloadHandler=function(t){e.done(t)},headScript_pc_static_index.BDSInstance.comm.resolveUnloadHandler=function(){e.resolve(),e=$.Deferred()},window.b_rec=function(e){var t="";if(e)t=navigator.userAgent;else try{t=window.external&&window.external.twGetRunPath?window.external.twGetRunPath():""}catch(n){t=""}return t=t.replace(/:/,"~").replace(/\t/,"`")},window.scr_rec=function(){var e="";try{e+=[document.body.clientWidth,document.body.clientHeight,window.screenTop,window.screenLeft,window.screen.height,window.screen.width].join("_")}catch(t){console.log("scr_rec error")}return e},window.reh_rec=function(){var e=[],t=[];try{$("#content_left").children(".result,.result-op").each((function(t,n){e.push($(n).height())}))}catch(n){console.log("reh_rec error")}try{$("#con-ar").children(".result,.result-op").each((function(e,n){t.push($(n).height())}))}catch(n){console.log("reh_rec error")}return e.join("_")+"|"+t.join("_")},window.hash=function(e,t){if(e){var n=globalVariables.currentEnv;if(e&&!t&&n)return n.getParams(e);e&&t&&n&&(n.setParams(e,t),location.href=n.buildSearchUrl())}}}function initPredictState(){var e,t;(null===(e=headScript_pc_static_index.BDSInstance.comm.indexSid)||void 0===e?void 0:e.includes("28883"))&&(window.__disable_preload=1,window.__disable_predict=1),(null===(t=headScript_pc_static_index.BDSInstance.comm.sid)||void 0===t?void 0:t.includes("28883"))&&(window.__disable_preload=1,window.__disable_predict=1)}function setBaiduIdAndSessionId(){for(var e=bottomScript_pc_static_instantSearchNewi.cookieInstance.get("BAIDUID","nobdid").split(":")[0],t="".concat(e.substr(0,6)).concat(e.substr(e.length-5,5)).concat(parseInt(99999*Math.random()));t.length<16;)t+="0";globalVariables.sessionId=encodeURIComponent(t)}function initPreState(){globalVariables.disablePreload=window.__disable_preload,globalVariables.disablePreload=window.__disable_predict,globalVariables.defaultDisablePreload=globalVariables.disablePreload,globalVariables.defaultDisablePredict=globalVariables.disablePredict}function redirectToSearch(e){if(!e.support()){function t(){/[^a-zA-Z0-9](wd|word)=/.exec(location.hash)&&location.replace("//www.baidu.com/s?"+/#(.*)$/.exec(location.href)[1])}if(/[^a-zA-Z0-9](wd|word)=/.exec(location.hash))throw location.replace("//www.baidu.com/s?"+/#(.*)$/.exec(location.href)[1]),new Error("redirect");headScript_pc_static_index.getElement("wrapper").style.display="block","onhashchange"in window?window.onhashchange=t:window.onhashchange=setInterval(t,200),globalVariables.defaultDisablePreload=!0,globalVariables.disablePreload=!0}}function appendHtml(e,t,n){var i=t.find('script:not([src], [type="application/json"])'),a=0,o=$.globalEval;$.globalEval=function(e){window.currentScriptElem=i[a],a++;try{o.apply($,arguments)}catch(t){window.console&&console.error&&(console.error(e),console.error(t)),window._spySendError&&window._spySendError(t)}},"insertBefore"===n?t.insertBefore(e):"insertAfter"===n?t.insertAfter(e):e.append(t),window.currentScriptElem=null,$.globalEval=o}function clearCache(){globalVariables.preloadLogs=[],globalVariables.preload_num=0,globalVariables.afterUserSubmit=!1,clearTimeout(globalVariables.afterUserSubmitTimeout)}function setissw(){bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ISSW","1",undefined,undefined,new Date((new Date).getTime()+3e5))}function setiswr(e,t){void 0===t&&(t=3),bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ISWR",e,undefined,undefined,new Date((new Date).getTime()+1e3*t))}function mergePreloadLog(e,t){e&&Object.assign(e.log,t)}function normalize(e){return e.trim().replace(/\s+/g," ")}function genSendConfirm(e,t,n){var i=n.URL;return function(n){var a,o;void 0===n&&(n={});var s=Object.assign({},n);if(e&&!e.confirm){headScript_pc_static_index.BDSInstance.comm.cur_query=e.real_wd,!headScript_pc_static_index.BDSInstance.comm.supportis&&e&&(t=e.pstg||0),e.confirm=!0,globalVariables.sendConfirmTimeout=!1,globalVariables.sendConfirmTimeoutFunc=function(){};var r={};r.is_referer=location.protocol+"//"+location.host+location.pathname+location.search,r.is_xhr="1";var l=new PageEnv(headScript_pc_static_index.parseUrlParams(i.getQueryString()),!0);e.env.equals(l)||e.env.getClonePageEnvInstance({wd:e.prw}).equals(l)||i.setUrl(e.env),e.seq?e.seq++:e.seq=1,e.pdc&&(20!==t&&headScript_pc_static_index.BDSInstance.comm.supportis&&e.pdc.mark("st"),e.pdc&&e.pdc.setParam&&e.pdc.setParam("cus_pstg",t),e.force&&e.pdc.setParam("f4s",1),e.pdc.trigger("confirm"),null===(a=window.PRE_CONN)||void 0===a||a.startTimer()),headScript_pc_static_index.executeAndLog((function(){headScript_pc_static_index.eventBus.app.confirm.emit({cacheItem:e,pstg:t})}));var c={ie:"utf-8",csq:e.seq,pstg:t,_cktip:s.tipConfirm?1:"",mod:2,newMode:1,isbd:headScript_pc_static_index.BDSInstance.comm.supportis?1:"",cqid:e.qid,istc:+new Date-e.startTime,ver:headScript_pc_static_index.BDSInstance.comm.baiduis_verify,chk:e.chk,isid:globalVariables.sessionId,f4s:e.force?1:"",_ck:"function"==typeof ckLog?ckLog(e.env.getParams("wd")):""};(null===(o=headScript_pc_static_index.BDSInstance.comm)||void 0===o?void 0:o.SyncSample)&&(c.SyncSample=headScript_pc_static_index.BDSInstance.comm.SyncSample);var d=headScript_pc_static_index.objToStr(c,"&",{encode:!1}),u="/s?".concat(d,"&").concat(e.env.buildQueryString());if(headScript_pc_static_index.BDSInstance.comm.indexSid&&(headScript_pc_static_index.BDSInstance.comm.indexSid.includes("9998_")&&"https:"===location.protocol&&(headScript_pc_static_index.BDSInstance.comm.indexSid=headScript_pc_static_index.BDSInstance.comm.indexSid.replace("9998","8499")),u+="&rsv_isid="+headScript_pc_static_index.BDSInstance.comm.indexSid),e.no_predict&&(u+="&isnop="+(globalVariables.preload_cnt<=1?0:1)),e&&e.pstg&&(u+="&isctg="+e.pstg),globalVariables.preload_cnt=0,Promise.resolve().then((function(){$.ajax({headers:r,url:u}).done((function(){var e,t="";(null===(e=headScript_pc_static_index.BDSInstance.comm.search_tool)||void 0===e?void 0:e.actualResultLang)&&(t=headScript_pc_static_index.BDSInstance.comm.search_tool.actualResultLang),$('#form input[name="rqlang"]').val(t||"cn"),$('#form input[name="rsv_bp"]').val(1)})).fail((function(e){console.warn("genSendConfirm ajax error",e)}))})),headScript_pc_static_index.BDSInstance.comm.seinfo){headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_prw=encodeURIComponent(kw.val()),headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_pstg=t,headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_svoice=window.__supportvoice?"1":"0",e.cftime+=1,headScript_pc_static_index.BDSInstance.comm.cftime=e.cftime+"";var p=e.env.getParams("rsv_bak");p&&(headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_bak=p)}headScript_pc_static_index.BDSInstance.comm.confirmQuery=headScript_pc_static_index.BDSInstance.comm.query,headScript_pc_static_index.BDSInstance.comm.confirmQid=headScript_pc_static_index.BDSInstance.comm.qid,sendSE(),globalVariables.sessionId=e.qid,window.cfpromise.resolve()}}}function jumpToSync(e){setissw(),location.replace(e.buildSyncSearchUrl())}window.__ckLog=ckLog;var MAX_CACHE_TIME=6e4,MAX_CACHE_ENTRY=15,HtmlCache=function(){function e(){this.cacheItem=[]}return e.prototype.find=function(e){return this.cacheItem.filter(e)},e.prototype.getCacheList=function(){return this.cacheItem.map((function(e){return e&&(new Date).getTime()-e.startTime>MAX_CACHE_TIME?null:e.querySign})).filter((function(e){return!!e})).join("\t")},e.prototype.hasCache=function(e,t){void 0===t&&(t={});var n=this.getCache(e,t);return n&&+new Date-n.startTime>MAX_CACHE_TIME&&(this.deleteCache(n),n=!1),n},e.prototype.getCache=function(e,t){if(!e.getParams("wd"))return!1;var n=null;return this.cacheItem.filter((function(i){if(t.loaded&&!i.loaded)return!1;var a=i.real_wd?i.env.getClonePageEnvInstance({wd:i.real_wd}):i.env;e.equals(a)&&(n=i)})),n},e.prototype.addCache=function(e){var t,n;if(!this.cacheItem.includes(e)&&!(null===(t=e.env)||void 0===t?void 0:t.getParams("srcid"))&&!(null===(n=e.env)||void 0===n?void 0:n.getParams("cq")))for(this.cacheItem.unshift(e);this.cacheItem.length>MAX_CACHE_ENTRY;)this.destroyCacheItem(this.cacheItem.pop())},e.prototype.deleteCache=function(e){this.destroyCacheItem(e),this.cacheItem=this.cacheItem.filter((function(t){return t!==e}))},e.prototype.deleteCacheByEnv=function(){var e=this;this.cacheItem=this.cacheItem.filter((function(t){var n=t.env.equals(t.env);return n&&e.destroyCacheItem(t),!n}))},e.prototype.clearCache=function(){var e=this;this.cacheItem=this.cacheItem.filter((function(t){return t===globalVariables.currentCacheItem||(e.destroyCacheItem(t),!1)}))},e.prototype.getCacheBySign=function(e){var t=!1;return this.cacheItem.forEach((function(n){t||!n.loaded||n.querySign!==e||n.env.getParams("pn")&&"0"!==n.env.getParams("pn")||(t=n)})),t},e.prototype.destroyCacheItem=function(e){var t;"object"==typeof e&&null!==e&&((null===(t=e.xhr)||void 0===t?void 0:t.abort)&&e.xhr.abort(),e.base64&&e.base64.destroy(),e.pdc&&e.pdc.destroy(),e.backspace_preload_timeout_id&&clearTimeout(e.backspace_preload_timeout_id),delete e.xhr,delete e.html)},e}(),Mask$1=function(){function e(){this.slowMsg=!1,this.hasMask=!1}return e.prototype.addMask=function(e){if(void 0===e&&(e={}),!this.hasMask){var t=Object.assign({top:112,"z-index":300},e),n=window.document.documentElement.clientHeight;headScript_pc_static_index.eventBus.mask.show.emit({height:"".concat(n-t.top,"px")}),this.hasMask=!0,this.loadingIconTimeout=setTimeout(this.addLoadingIcon.bind(this),3e3),this.slowMsgTimeout=setTimeout(this.showSlowMsg.bind(this),7e3)}},e.prototype.removeMask=function(){var e=this;if(this.hasMask){this.hasMask=!1,headScript_pc_static_index.eventBus.mask.hide.emit({});["loadingIcon","slowMsg"].forEach((function(t){e[t]&&e[t].remove()}));["loadingIconTimeout","slowMsgTimeout"].forEach((function(t){clearTimeout(e[t]),e[t]=!1}))}},e.prototype.addStyle=function(e){var t=document.createElement("style");t.type="text/css",t.innerHTML=e,t.setAttribute("data-for","result"),document.head.appendChild(t)},e.prototype.addLoadingIcon=function(){var e=this;headScript_pc_static_index.eventBus.mask.show.emit({showLoadingIcon:!0}),this.loadingIcon||(this.addStyle(".slowmsg{z-index:301;background-color:#fff;border:1px solid #f0f0f0;position:fixed;_position:absolute;top:144px;left:212px;height:95px;width:360px;box-shadow:0 0 5px rgba(0,0,0,0.05)}.slowmsg .ball{width:40px;margin:41px auto 0;position:relative;}.slowmsg .b{left:20px;position:absolute;width:10px;height:10px;-moz-border-radius: 50%;-webkit-border-radius: 50%;border-radius: 50%;}.pc-fresh-wrapper .slowmsg{top:min(30%,200px);left:50%;transform:translateX(-50%) translateY(-50%);}"),this.loadingIcon=$('<div class="slowmsg"><div class="ball"><div class="b"/><div class="b"/><div class="b"/></div></div>'),this.loadingIcon.find(".b").each((function(t,n){var i=[[0,40],[20,20],[40,0]][t],a=["rgb(55,137,250)","rgb(99,99,99)","rgb(235,67,70)"],o=0;$(n).css({"background-color":a[t]}),function s(){this.loadingicon_timeout?($(n).animate({left:i[o%2]},{duration:800,easing:"swing",progress:function(e,i){i>=.5&&$(n).css({"background-color":a[(o+t)%3]})},complete:function(){s()}}),o++):setTimeout(s,400)}.call(e)})),this.loadingIcon.appendTo(document.body),headScript_pc_static_index.initNsClickForWWW(headScript_pc_static_index.BDSInstance)({pj_name:"loading_msg"}))},e.prototype.showSlowMsg=function(){var e=+new Date;bottomScript_pc_static_instantSearchNewi.cookieInstance.set("rsv_jmp_slow",e),bottomScript_pc_static_instantSearchNewi.cookieInstance.set("WWW_ST",e,null,null,new Date(e+3e4));var t="".concat(location.href).concat(location.href.includes("?")?"&":"?","rsv_jmp=slow");location.replace(t)},e}(),mask=new Mask$1;function footJS(e,t,n){var i=null;if(n||(n=0),t&&(i=t.html),headScript_pc_static_index.executeAndLog((function(){resultForm.get(0).f.value=8})),headScript_pc_static_index.executeAndLog((function(){var e=(new Date).getTime();t&&t.base64&&(t.base64.setDomLoad("left"),t.base64.setDomLoad("right")),mergePreloadLog(t,{base64time:(new Date).getTime()-e})})),headScript_pc_static_index.executeAndLog((function(){var e=+new Date;headScript_pc_static_index.BDSInstance.lifecycle.fireJSReady(),headScript_pc_static_index.BDSInstance.doReady(),mergePreloadLog(t,{bdstime:+new Date-e})})),headScript_pc_static_index.executeAndLog((function(){var e=+new Date;i&&$.globalEval(i.find("#ecomScript").html()),mergePreloadLog(t,{ecomtime:(new Date).getTime()-e})})),headScript_pc_static_index.executeAndLog((function(){var e,n=+new Date;headScript_pc_static_index.BDSInstance.se.tools&&(globalVariables.toolsTimeout&&clearTimeout(globalVariables.toolsTimeout),globalVariables.toolsTimeout=setTimeout((function(){headScript_pc_static_index.BDSInstance.se.tools()}),600)),(null===(e=headScript_pc_static_index.BDSInstance.se.certification)||void 0===e?void 0:e.build)&&(globalVariables.certificationTimeout&&clearTimeout(globalVariables.certificationTimeout),globalVariables.certificationTimeout=setTimeout((function(){$(".certification").size()>0&&headScript_pc_static_index.BDSInstance.se.certification.build.init()}),1e3)),headScript_pc_static_index.BDSInstance.se.safeTip&&(globalVariables.unsafeIconTimeout&&clearTimeout(globalVariables.unsafeIconTimeout),globalVariables.unsafeIconTimeout=setTimeout((function(){$(".unsafe_ico_new").size()>0&&BDS.se.safeTip.init()}),1200)),mergePreloadLog(t,{tiptime:+new Date-n})})),headScript_pc_static_index.executeAndLog((function(){var e=+new Date;window.initResultClickLog(),mergePreloadLog(t,{clicktime:+new Date-e})})),headScript_pc_static_index.executeAndLog((function(){mergePreloadLog(t,{rtime:+new Date-n,used:1}),headScript_pc_static_index.BDSInstance.comm.seinfo&&t&&(headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_pstg=t.type)})),headScript_pc_static_index.executeAndLog((function(){headScript_pc_static_index.BDSInstance.lifecycle.fireSwapEnd({cacheItem:t,env:e}),clearCache(globalVariables),globalVariables.pageStartTime=+new Date,t&&t.pdc&&(t.pdc.mark("js"),t.pdc.trigger("swap_end"))})),i){var a=i.find(".foot-async-script"),o=$(".foot-async-script"),s=o.children(),r=$("body");s.size()&&o.remove(),a.children().size()&&appendHtml(r,a)}}function changeChatBoxToResult(){var e=$("#wrapper"),t=$("#chat-input-main"),n=$("#ci-main");t.length&&t.css("left",""),e.hasClass("smart_input_superman")&&(document.activeElement!==document.querySelector("#chat-textarea")&&t.addClass("one-line-input"),e.addClass("smart_input_wrapper"),e.removeClass("smart_input_superman"),e.removeClass("smart_input_height_superman"),t.length&&t.trigger("homepredict"),n.length&&n.trigger("homepredict")),bds.comm.nodeSample.includes("PC_HEAD_TAG_HAS_ICON")||e.addClass("hide_tab_icon");var i=$("#head");i.length&&i.hasClass("ai-dashboard-fixed")&&i.removeClass("ai-dashboard-fixed"),e.hasClass("login-ai-dashboard-index")&&e.removeClass("login-ai-dashboard-index"),e.hasClass("no-login-ai-dashboard-index")&&e.removeClass("no-login-ai-dashboard-index")}function swapToResult(e){changeChatBoxToResult(),window.index_off&&window.index_off(),window.pageState=1,headScript_pc_static_index.BDSInstance.comm.ishome=0,headScript_pc_static_index.setContainerWidth(headScript_pc_static_index.BDSInstance),headScript_pc_static_index.BDSInstance.lifecycle.fireIndexOff({env:e}),$(window).trigger("index_off",e)}function startWithResult(){window.index_off&&window.index_off(),window.pageState=1,headScript_pc_static_index.BDSInstance.comm.ishome=0,headScript_pc_static_index.BDSInstance.comm.cur_query=headScript_pc_static_index.BDSInstance.comm.query,globalVariables.currentEnv=new PageEnv,globalVariables.currentCacheItem={env:globalVariables.currentEnv,real_wd:headScript_pc_static_index.BDSInstance.comm.query,force:!0,confirm:!0},headScript_pc_static_index.BDSInstance.lifecycle.fireIndexOff(),$(window).trigger("index_off"),headScript_pc_static_index.setContainerWidth(headScript_pc_static_index.BDSInstance),headScript_pc_static_index.executeAndLog((function(){headScript_pc_static_index.BDSInstance.lifecycle.fireSwapDomReady()})),window.__lazy_foot_js?setTimeout((function(){footJS()}),0):footJS()}var Url=function(){function e(){this.isSupportHashChange="undefined"!=typeof window.onhashchange,this.isSupportPopstate="undefined"!=typeof window.onpopstate,this.searchURL=location.pathname.length>1?location.pathname:"/s",this.getBrowserAbility(),this.currentState=this.getState(),this.currentHash=this.getHash()}return e.prototype.getBrowserAbility=function(){window.__disable_popstate&&(this.isSupportPopstate=!1),(/MSIE (6|7)/.exec(navigator.userAgent)||document.documentMode<8)&&(this.isSupportHashChange=!1,this.isSupportPopstate=!1),this.isSupportPopstate||this.isSupportHashChange||setissw()},e.prototype.setUrl=function(e){this.isSupportPopstate?this.triggerPopState(!1,e):this.isSupportHashChange&&this.triggerHashChange(!1,e)},e.prototype.triggerHashChange=function(e,t){t&&(this.currentHash=t.buildQueryString(),location.hash=this.currentHash),(e||this.currentHash!==this.getHash())&&(this.urlchange(e),this.currentHash=this.getHash())},e.prototype.triggerPopState=function(e,t){t&&(this.currentState=t.buildQueryString(),window.history.pushState(t,"",t.buildSyncSearchUrl())),e||this.currentState!==this.getState()?(this.urlchange(e),this.currentState=this.getState()):mask.removeMask()},e.prototype.getHash=function(){var e=/#+(.*)$/.exec(location.href);return e?e[1].replace(/\+/g,"%2B"):""},e.prototype.getState=function(){var e=/\?([^#]+)/.exec(location.href);return e?e[1].replace(/\?/g,"&"):""},e.prototype.urlchange=function(e){var t=new PageEnv(headScript_pc_static_index.parseUrlParams(this.getQueryString()),!0);t.hashCode()?0===window.pageState&&swapToResult(t):(0!==window.pageState||0===window.pageState&&location.search!==location.search.replace(/([?&])isidx=[^&*]&?/,"$1"))&&location.replace(location.pathname+location.search.replace(/([?&])isidx=[^&*]&?/,"$1")),this.onurlchange(t,e)},e.prototype.getQueryString=function(){return this.isSupportPopstate?this.getState():this.getHash().includes("wd=")?this.getHash():this.getState()},e.prototype.onurlchange=function(e,t){},e.prototype.init=function(){var e=this;if(this.isSupportPopstate){var t=location.href,n=!1;headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){n=!0})),window.addEventListener("popstate",(function(){!n&&t&&t===location.href||e.triggerPopState(),t=""})),window.addEventListener("hashchange",(function(){var t=e.getHash();t.includes("wd=")&&location.replace("".concat(e.searchURL,"?").concat(t))}))}else this.isSupportHashChange&&(window.addEventListener("hashchange",(function(){e.triggerHashChange()})),document.addEventListener("DOMContentLoaded",(function(){e.triggerHashChange()})));var i=this.getHash();i.includes("wd=")&&(this.isSupportPopstate?(window.history.replaceState(null,"","".concat(this.searchURL,"?").concat(i,"&rpf=pc")),this.triggerPopState()):this.isSupportHashChange?this.triggerHashChange():location.replace("".concat(this.searchURL,"?").concat(i)))},e.prototype.support=function(){return(this.isSupportHashChange||this.isSupportPopstate)&&1!=+bottomScript_pc_static_instantSearchNewi.cookieInstance.get("ISSW")&&!window.__disable_preload},e.prototype.cleanLinkParam=function(e,t){var n="";if("1"===window._thirdLinkSpeed&&(n="&qid=".concat(headScript_pc_static_index.BDSInstance.comm.queryId)),window._bdlksmp>0&&(n="&bdlksmp=".concat(window._bdlksmp)),"1"===window._eclipse&&t.startsWith("link"))return"wd=&eqid=".concat(headScript_pc_static_index.BDSInstance.comm.eqid).concat(this.getUrlParamString(["pn","rn","ie"],e)).concat(n);var i=new PageEnv(headScript_pc_static_index.parseUrlParams(e));return i.getParams("wd")?i.buildQueryString().replace(/&rsv[^=]*=[^&]*/g,"").replace(/[^a-zA-Z0-9]url=/g,"")+n:void 0},e.prototype.getUrlParamString=function(e,t){var n=headScript_pc_static_index.parseUrlParams(t),i={};return e.forEach((function(e){i[e]=n[e]||""})),headScript_pc_static_index.objToStr(i,"&",{encode:!0})},e.prototype.getLinkParams=function(e){if(!this.isSupportPopstate){var t=this.getHash();return""===t&&(t=this.getState()),this.cleanLinkParam(t,e)}if("https:"===location.protocol||"1"===window._eclipse){var n=this.getState();return n||(n=this.getHash()),this.cleanLinkParam(n,e)}return!1},e.prototype.clickResultLink=function(e,t,n){if(this.isSupportPopstate)return window.history.pushState(null,"",new PageEnv(n,!0).buildSyncSearchUrl()),this.triggerPopState(),!1;e.attr("href",t.buildSearchUrl(n)).attr("target","_self")},e.prototype.submit=function(e,t){var n=this,i=headScript_pc_static_index.BDSInstance.comm.submitType;if(headScript_pc_static_index.BDSInstance.comm&&headScript_pc_static_index.BDSInstance.comm.kuangRec){var a=headScript_pc_static_index.BDSInstance.comm.kuangRec;if(a&&a.query===e.getParams("wd"))(s=a.sa)&&i&&(s=s.replace(/^([^_]+)_/,"$1_"+i+"_")),e.setParams("rsv_dl",s),headScript_pc_static_index.BDSInstance.comm.kuangRec={}}if(headScript_pc_static_index.BDSInstance.comm.isVoice){var o=headScript_pc_static_index.BDSInstance.comm.ishome?"ivoice":"bvoice";e.setParams("rsv_dl",o)}if(i){var s;(s=e.getParams("rsv_dl"))&&/^(ib_pre|tb_pre|ib|tb|ivoice_pre|bvoice_pre|ivoice|bvoice)$/.test(s)&&e.setParams("rsv_dl",s+"_"+i)}setTimeout((function(){headScript_pc_static_index.BDSInstance.comm.ishome&&headScript_pc_static_index.isHitSampling(headScript_pc_static_index.BDSInstance,"close_predict_b")?location.href=e.buildSyncSearchUrl():(n.isSupportPopstate?(window.history.pushState(e,"",e.buildSyncSearchUrl()),n.triggerPopState(t)):n.isSupportHashChange?(location.href=e.buildSearchUrl(),n.triggerHashChange(t)):location.href=e.buildSyncSearchUrl(),delete headScript_pc_static_index.BDSInstance.comm.submitType)}),0)},e}();function initPDCAsync(){var e=globalVariables.currentCacheItem,t={};window.PDC_ASYNC={setParams:function(t,n){(null==e?void 0:e.pdc)&&e.pdc.setParams(t,n)},setLinkData:function(e,n){t[e]=n},sendLinkLog:function(){var e={link_t:+new Date-t.click_t,query:headScript_pc_static_index.BDSInstance.comm.queryEnc||"",qid:headScript_pc_static_index.BDSInstance.comm.queryId,linkpreload:t.linkpreload||""},n=headScript_pc_static_index.objToStr(e,"&",{encode:!1});if(Math.random()<.01){var i=new Image,a="LINK_IMG_".concat(+new Date);window[a]=i,i.onload=function(){delete window[a]},i.src="".concat("//www.baidu.com/nocache/fesplg/s.gif?log_type=linksp").concat(n)}}},window.bds&&(window.bds.pdc=window.PDC_ASYNC)}var SpeedRobot=function(){function e(e,t){void 0===t&&(t=250),this.container=[],this.index=0,this.isWork=0,this.timer=!1,this.interval=t,this.UPS=e}return e.prototype.start=function(){var e=this;if(1!==this.isWork&&(this.isWork=1,this.clear()),1===this.isWork){var t=+new Date,n=!1,i=this.interval,a=function(){var o=+new Date,s=o-t-e.interval,r=e.isHidden();s<0&&(s=0),r||n||(e.container[e.index]=s,e.index=(e.index+1)%20),n=r,1===e.isWork&&(t=o,e.timer=setTimeout(a,i))};this.timer=setTimeout(a,i)}},e.prototype.stop=function(){this.clear(),this.isWork=0},e.prototype.getData=function(){return this.container.slice(this.index).concat(this.container.slice(0,this.index))},e.prototype.monitor=function(e){var t,n;try{var i=0,a=Math.max.apply(null,e),o=4,s=bottomScript_pc_static_instantSearchNewi.cookieInstance.get("ispeed_lsm"),r=0,l=new Date,c=0;l.setTime(l.getTime()+2592e6);try{for(var d=headScript_pc_static_index.__values(e),u=d.next();!u.done;u=d.next()){i+=u.value}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=d["return"])&&n.call(d)}finally{if(t)throw t.error}}return i=Math.round(i/e.length),a>1e3||i>150?((r=s?parseInt(s):0)>=30&&r<40&&(c=1,bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ispeed",2,document.domain,"/",l)),r<60&&(r=r+10>60?60:r+10,bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ispeed_lsm",r,document.domain,"/",l))):(s&&parseInt(s)>40&&(o=5),s&&parseInt(s)>=o&&(parseInt(s)<=40+o&&parseInt(s)>40&&(c=2,bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ispeed",1,document.domain,"/",l)),r=parseInt(s)-o,bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ispeed_lsm",r,document.domain,"/",l))),c}catch(h){console.warn("SpeedRobot monitor call error",h.message)}},e.prototype.isSlow=function(){return!(!bottomScript_pc_static_instantSearchNewi.cookieInstance.get("ispeed")||1!=+this.UPS.get("isSwitch"))&&2===parseInt(+bottomScript_pc_static_instantSearchNewi.cookieInstance.get("ispeed"))},e.prototype.clear=function(){window.clearTimeout(this.timer)},e.prototype.isHidden=function(){var e,t;if("hidden"in document)return document.hidden;try{for(var n=headScript_pc_static_index.__values(["webkit","moz","ms","o"]),i=n.next();!i.done;i=n.next()){var a=i.value;if("".concat(a,"Hidden")in document)return document["".concat(a,"Hidden")]}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n["return"])&&t.call(n)}finally{if(e)throw e.error}}return!1},e}(),speedRobot=new SpeedRobot(bottomScript_pc_static_instantSearchNewi.syncUpsToCookie),kwTip=null;function updateKwTip(e){void 0===e&&(e="");var t=$("#kw");if(!window.__disable_is2||e.trim()!==t.val().trim())if(!globalVariables.hideKwTip&&headScript_pc_static_index.BDSInstance.comm.supportis){if(0!==window.pageState&&!window.__disable_kw_tip)if(kwTip)if(kwTip.text(e),""!==e){var n=t.textWidth();kwTip.css({opacity:0,"margin-left":n+20+"px","max-width":kwTip.parent().width()-n-14+"px"}).text(e),window.__disable_is2&&kwTip.css("z-index",1),kwTip.show()}else kwTip.hide();else headScript_pc_static_index.eventBus.searchbox.attached.on((function(){if((kwTip=$('<div id="kw_tip" style="width:initial"\n unselectable="on" onselectstart="return false;" class="s_ipt_tip"/>').insertBefore(t)).parent().click((function(){var e=t.get(0);e.focus();var n=e.value.length;if(document.selection){var i=e.createTextRange();i.moveStart("character",n),i.collapse(),i.select()}else"number"==typeof e.selectionStart&&"number"==typeof e.selectionEnd&&(e.selectionStart=e.selectionEnd=n);return!1})),kwTip&&kwTip.text(e),""!==e){var n=t.textWidth();kwTip.css({opacity:0,"margin-left":n+20+"px","max-width":kwTip.parent().width()-n-14+"px"}).text(e),window.__disable_is2&&kwTip.css("z-index",1),kwTip.show()}else kwTip.hide()}))}else kwTip&&kwTip.html("")}function updateJc(e){e&&(normalize(kw.val())===(null==e?void 0:e.real_wd)&&$("#super_se_tip").remove())}function getLinkString(e,t,n){var i=t.prefix,a=null,o=e.attr("href");if(i&&o&&0===o.indexOf(i)&&(o=o.substring(i.length)),!i&&o){var s=o.match(/^http:\/\/[^\/]+/);if(!s)return;i=s[0],o=o.replace(/^http:\/\/[^\/]+/,"")}if(o&&(a=o.match(/^\/*(link|baidu.php)\?(.*)$/),a=o.match(t.regex)),!(a&&a[2]&&/&(wd|word)=/.exec(a[2]))){if(o&&a){t.convertTable&&t.convertTable[a[1]]&&(a[1]=t.convertTable[a[1]]);var r=n.getLinkParams(o);r&&("https:"===location.protocol&&/Chrome|Safari/.test(navigator.userAgent)&&(i=i.replace(/^http:\/\/www\.baidu\.com/,"https://www.baidu.com")),o=i+"/"+a[1]+"?"+a[2]+"&"+r,e.attr("href",i+"/"+a[1]+"?"+a[2]+"&"+r),e.click((function(){window.PDC_ASYNC.setLinkData("click_t",(new Date).getTime()),window.PDC_ASYNC.setLinkData("linkpreload",$(this).attr("linkpreload"))})))}return o}}function addJumpParams(e,t){$(document).delegate("a","mousedown",(function(){getLinkString($(this),e,t)}))}function processJump(e){var t,n,i=[{prefix:"http://www.baidu.com",regex:/^\/*(link)\?(.*)$/},{prefix:"//www.baidu.com",regex:/^\/*(link)\?(.*)$/},{prefix:"http://www.baidu.com",convertTable:{"aladdin.php":"aladdin.php","siva.php":"siva.php","adrc.php":"adrc.php","zhixin.php":"zhixin.php"},regex:/^\/*(aladdin\.php|siva\.php|adrc\.php|zhixin\.php)\?(.*)$/},{prefix:"http://bzclk.baidu.com",regex:/^\/*(adrc\.php)\?(.*)$/},{prefix:"https://sp0.baidu.com/9q9JcDHa2gU2pMbgoY3K",regex:/^\/*(adrc\.php)\?(.*)$/}];"www.baidu.com"!==location.host&&i.push({prefix:"",convertTable:{"aladdin.php":"aladdin.php","siva.php":"siva.php","adrc.php":"adrc.php","zhixin.php":"zhixin.php"},regex:/^\/*(aladdin\.php|siva\.php|adrc\.php|zhixin\.php)\?(.*)$/});try{for(var a=headScript_pc_static_index.__values(i),o=a.next();!o.done;o=a.next()){addJumpParams(o.value,e)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=a["return"])&&n.call(a)}finally{if(t)throw t.error}}}function sendFesplg(e){var t=$(e).attr("href")||"";if(Math.random()<.01&&!t.includes("www.baidu.com")&&t.startsWith("http")){var n=new Image,i="".concat("//www.baidu.com/nocache/fesplg/s.gif?log_type=hm","&c_url=").concat(encodeURIComponent(t)),a="_LOG_".concat(+new Date);n.onload=function(){delete window[a]},window[a]=n,n.src=i}}function swapToAsyncUrl(e,t){var n=location.protocol+"//"+location.host,i=$(e);if(!(i.attr("target")&&"_self"!==i.attr("target")||i.attr("sync")&&"true"===i.attr("sync"))){var a=(i.attr("href")||"").trim();a&&a.startsWith(n)&&(a=a.substring(n.length));var o=null;if(a&&(o=/^\/*s\?(.*)/.exec(a)),a&&o){var s=headScript_pc_static_index.parseUrlParams(o[0]);s.pn||(s.pn="");var r="";if(!s.tn||!["baidurt","baiduwb","baidufir","SE_baiduxueshu_c1gjeupa"].includes(s.tn)){var l=i.parents("#con-at");l.size()>0&&mask.addMask({top:l.offset().top+l.height()}),r=t.clickResultLink(i,globalVariables.currentEnv,s)}return r}}}function swapATagHref(e){var t=$(e),n=t.attr("href")||"",i={"http://v.baidu.com":"/?fr=bd"};i&&i[n]&&t.attr("href",n+i[n])}function getElementStyle(e){var t=e.prev();return t&&"STYLE"===t.prop("tagName")?t:null}function swapElement(e,t,n){var i=getElementStyle(e),a=getElementStyle(t);e.length>0&&(t&&t.hide(),!a&&i&&i.insertBefore(t),e.insertBefore(t)),t&&t.remove();var o=e.attr("m-selector");if(o){var s=n.find("#m-data-".concat(o)),r=t.attr("m-selector"),l=r&&document.getElementById("m-data-".concat(r));l&&l.remove(),s&&s.insertAfter(e)}}function appendElement(e,t,n,i){var a=t.find(e);if(a.length){var o=getElementStyle(a);o&&appendHtml(n,o,i),appendHtml(n,a,i);var s=a.attr("m-selector");if(s){var r=t.find("#m-data-".concat(s));r&&appendHtml(n,r,i)}return a}}function swapTag(e){var t=e.find("#search-tag"),n=$("#search-tag");n.length>0?swapElement(t,n,e):appendElement("#search-tag",e,$("#wrapper_wrapper"),"insertBefore"),t.get(0)&&headScript_pc_static_index.eventBus.app.partHydrate.emit(t.get(0))}function swapTab(e){var t=e.find("#head-tab"),n=$("#s_tab"),i=$("#head-tab");swapElement(t,i.length>0?i:n.length>0?n:null,e),headScript_pc_static_index.eventBus.app.partHydrate.emit(t.get(0))}function swapTopResult(e,t,n){var i=n.cacheItem,a=n.oldEnv,o=e.find("#con-at"),s=$("#con-at"),r=s.children().children();if(!r.size())return o.children().size()&&(appendHtml(t,o,"insertBefore"),headScript_pc_static_index.eventBus.app.partHydrate.emit(o.get(0))),!1;if(!o.children().size())return s.remove(),headScript_pc_static_index.eventBus.topResult.remove.emit({}),!1;var l=o.children().children(),c=globalVariables.currentEnv;return!(r.attr("cq")!==l.attr("cq")||r.attr("srcid")!==l.attr("srcid")||i.force&&a&&a.equals(c)||!c.getParams("cq")||!c.getParams("srcid")||1===c.getParams("_trf"))||(s.remove(),headScript_pc_static_index.eventBus.topResult.remove.emit({}),appendHtml(t,o,"insertBefore"),headScript_pc_static_index.eventBus.app.partHydrate.emit(o.get(0)),!1)}function swapTopAd(e){var t=e.find("#top-ad"),n=$("#top-ad"),i=n.children(),a=$("#s_tab"),o=!!t.children().size();i.size()&&n.remove(),o&&appendHtml(a,t,"insertAfter")}var mouseDeferredTimer=null;function resetMouseSetting(){clearTimeout(mouseDeferredTimer),mouseDeferredTimer=null}var chatInput_umd={exports:{}};(function(module,exports){function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _regeneratorKeys(e){var t=Object(e),n=[];for(var i in t)n.unshift(i);return function a(){for(;n.length;)if((i=n.pop())in t)return a.value=i,a.done=!1,a;return a.done=!0,a}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,i,a,o){var l=i&&i.prototype instanceof r?i:r,c=Object.create(l.prototype);return _regeneratorDefine2(c,"_invoke",function(n,i,a){var o,r,l,c=0,d=a||[],u=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,r=0,l=e,p.n=n,s}};function h(n,i){for(r=n,l=i,t=0;!u&&c&&!a&&t<d.length;t++){var a,o=d[t],h=p.p,f=o[2];n>3?(a=f===i)&&(l=o[(r=o[4])?5:(r=3,3)],o[4]=o[5]=e):o[0]<=h&&((a=n<2&&h<o[1])?(r=0,p.v=i,p.n=o[1]):h<f&&(a=n<3||o[0]>i||i>f)&&(o[4]=n,o[5]=i,p.n=f,r=0))}if(a||n>1)return s;throw u=!0,i}return function(a,d,f){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&h(d,f),r=d,l=f;(t=r<2?e:l)||!u;){o||(r?r<3?(r>1&&(p.n=-1),h(r,l)):p.n=l:p.v=l);try{if(c=2,o){if(r||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,r<2&&(r=0)}else 1===r&&(t=o["return"])&&t.call(o),r<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),r=1);o=e}else if((t=(u=p.n<0)?l:n.call(i,p))!==s)break}catch(t){o=e,r=1,l=t}finally{c=1}}return{value:t,done:u}}}(n,a,o),!0),c}var s={};function r(){}function l(){}function c(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(_regeneratorDefine2(t={},i,(function(){return this})),t),u=c.prototype=r.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_regeneratorDefine2(e,a,"GeneratorFunction")),e.prototype=Object.create(u),e}return l.prototype=c,_regeneratorDefine2(u,"constructor",c),_regeneratorDefine2(c,"constructor",l),l.displayName="GeneratorFunction",_regeneratorDefine2(c,a,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,a,"Generator"),_regeneratorDefine2(u,i,(function(){return this})),_regeneratorDefine2(u,"toString",(function(){return"[object Generator]"})),(_regenerator=function(){return{w:o,m:p}})()}function _regeneratorDefine2(e,t,n,i){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}_regeneratorDefine2=function(e,t,n,i){function o(t,n){_regeneratorDefine2(e,t,(function(e){return this._invoke(t,n,e)}))}t?a?a(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,t,n,i)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){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 _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,a,o,s,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,a=e}finally{try{if(!l&&null!=n["return"]&&(s=n["return"](),Object(s)!==s))return}finally{if(c)throw a}}return r}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperty(e,t,n){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(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,_toPropertyKey(i.key),i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _callSuper(e,t,n){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,n||[],_getPrototypeOf(e).constructor):t.apply(e,n))}function _possibleConstructorReturn(e,t){if(t&&("object"==_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inherits(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&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createForOfIteratorHelper(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){r=!0,o=e},f:function(){try{s||null==n["return"]||n["return"]()}finally{if(r)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(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 _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var e,t;e=headScript_pc_static_index.commonjsGlobal,t=function(exports,san){var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=function(e,t,n){return t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},__spreadValues=function(e,t){for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols){var i,a=_createForOfIteratorHelper(__getOwnPropSymbols(t));try{for(a.s();!(i=a.n()).done;)n=i.value,__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n])}catch(o){a.e(o)}finally{a.f()}}return e},__spreadProps=function(e,t){return __defProps(e,__getOwnPropDescs(t))},__objRest=function(e,t){var n={};for(var i in e)__hasOwnProp.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&__getOwnPropSymbols){var a,o=_createForOfIteratorHelper(__getOwnPropSymbols(e));try{for(o.s();!(a=o.n()).done;)i=a.value,t.indexOf(i)<0&&__propIsEnum.call(e,i)&&(n[i]=e[i])}catch(s){o.e(s)}finally{o.f()}}return n},__async=function(e,t,n){return new Promise((function(i,a){var o=function(e){try{r(n.next(e))}catch(t){a(t)}},s=function(e){try{r(n["throw"](e))}catch(t){a(t)}},r=function(e){return e.done?i(e.value):Promise.resolve(e.value).then(o,s)};r((n=n.apply(e,t)).next())}))},_a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q,_r,_s,_t,_u,_v,_w,Main$m=(_a=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{visible:!1,isView:!1,message:"",duration:2e3,timer:null}}},{key:"attached",value:function(){var e=this.el;e&&e.parentNode!==document.body&&(document.body.appendChild(e),this.bodyAppended=!0)}},{key:"show",value:function(e){var t=this;"string"==typeof e&&this.data.set("message",e),this.data.set("visible",!0),this.nextTick((function(){t.data.set("isView",!0),clearTimeout(t.data.get("timer")),clearTimeout(t.hideTimer);var e=setTimeout((function(){t.hide()}),t.data.get("duration"));t.data.set("timer",e)}))}},{key:"hide",value:function(){var e=this;this.data.set("isView",!1),clearTimeout(this.data.get("timer")),clearTimeout(this.hideTimer),this.hideTimer=setTimeout((function(){e.data.set("visible",!1),e.hideTimer=null}),300),this.data.set("timer",null)}},{key:"detached",value:function(){clearTimeout(this.data.get("timer")),clearTimeout(this.hideTimer);var e=this.el;this.bodyAppended&&e&&e.parentNode===document.body&&document.body.removeChild(e)}}])}(san.Component),_a.template='\n <div class="ci-toast-portal">\n <div\n s-if="visible"\n class="ci-toast-root {{isView ? \'ci-toast-root-view\' : \'\'}}"\n >\n <div class="ci-toast-content">{{ message }}</div>\n </div>\n </div>\n ',_a),EventsBinder=function(){return _createClass((function e(){_classCallCheck(this,e),this.bindings=[]}),[{key:"add",value:function(e,t,n,i,a){e&&n&&(e.addEventListener(t,n,a),this.bindings.push({el:e,type:t,handler:n,options:a,eventType:i}))}},{key:"clear",value:function(e){e||(this.bindings.forEach((function(e){var t=e.el,n=e.type,i=e.handler,a=e.options;i&&t.removeEventListener(n,i,a)})),this.bindings=[]),this.bindings.forEach((function(t){var n=t.el,i=t.type,a=t.handler,o=t.options;t.eventType===e&&a&&n.removeEventListener(i,a,o)}))}}])}(),EventEmitter=function(){return _createClass((function e(){_classCallCheck(this,e),this.listeners={}}),[{key:"on",value:function(e,t){var n;(null==(n=this.listeners)?void 0:n[e])||(this.listeners[e]=[]),this.listeners[e].push(t)}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a;null==(a=this.listeners[e])||a.forEach((function(e){e.apply(null,n)}))}},{key:"off",value:function(e,t){var n,i=this.listeners[e];i&&(t?(this.listeners[e]=i.filter((function(e){return e!==t})),(null==(n=this.listeners[e])?void 0:n.length)||delete this.listeners[e]):delete this.listeners[e])}}])}();function emitBeforePrefixChange(e,t){var n={action:t.action,fromType:t.fromType||"",toType:t.toType||"",hasTargetPrefix:t.hasTargetPrefix,defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0},"continue":t.onContinue};return e.emit("before-prefix-change",n),n.defaultPrevented}var DISPATCH_COMMON_EVENT="ci-common",FIRE_EVENTS=(e=FIRE_EVENTS||{},e.PAUSE="pause",e.SUBMIT="submit",e.SUG_CLICK="sug-click",e.SUG_SELECT="sug-select",e.INPUT_CHANGE="input-change",e.SEND_LOG="send-log",e.DEEP_SEARCH_CHANGE="deep-search-change",e.DEEP_SEARCH_CLICK="deep-search-click",e.MODEL_CHANGE="model-change",e.CHAT_MODE_CHANGE="chat-mode-change",e.MODEL_CLICK_ALL="model-click-all",e.INPUT_VALUE_CHANGE="input-value-change",e.INPUT_STATUS_CHANGE="input-status-change",e.FILE_CHANGE="file-change",e.HEIGHT_CHANGE="height-change",e.UPLOAD_FILE_SCENE="upload-file-scene",e.OPEN_SELECT_MORE="open-select-more",e.DRAWPANEL_TOOL_CLICK="drawpanel-tool-click",e.VOICE_INPUT_START="voice-input-start",e.VOICE_INPUT_STOP="voice-input-stop",e.PANEL_CHANGE="panel-change",e.IMAGE_FILE_SELECT="image-file-select",e.REGISTER_PANEL_TOOLTIP="register-panel-tooltip",e.SHOW_LOGIN="show-login",e.WENXIN_SUBMIT="wenxin-submit",e),EVENTS=function(e){return e.PANEL_DETACH="panel-detach",e.PANEL_OPEN="panel-open",e.PANEL_CLOSE="panel-close",e.MUSIC_PANEL_OPEN="MUSIC_PANEL_OPEN",e.MUSIC_PANEL_CHANGE="MUSIC_PANEL_CHANGE",e.MUSIC_PLAY="music-play",e.VOICE_INPUT_STOP="voice-input-stop",e.VOICE_INPUT_COMPLETE="voice-input-complete",e.VOICE_INPUT_START="voice-input-start",e.VOICE_INPUT_TRIGGER="voice-input-trigger",e.VOICE_TIP_SHOW="voice-tip-show",e.VOICE_TIP_HIDE="voice-tip-hide",e.SET_PLACEHOLDER="placeholder",e.UPLOAD_FILE="uploader_file",e.DELETE_FILE="delete_file",e.CLEAR_ALL_FILES="clear_all_files",e.KEYDOWN="keydown",e.INPUT_STATUS_CHANGE="change-input",e.MODE_CHANGE="mode-change",e.VALUE_CHANGE="value-change",e.SHOW_PREFIX="show-prefix",e.TOAST_SHOW="toast-show",e.FILE_CHANGE="file-change",e.PREFIX_CLOSE="prefix-close",e.BEFORE_PREFIX_CHANGE="before-prefix-change",e.CLEAR="clear",e.INPUT="input",e.HIDE_SUG="HIDE_SUG",e.AI_SUG_CHANGE="ai-sug-change",e.INPUT_MODE_DELETE="input-mode-delete",e.OPEN_MERGE_UPLOAD="open-merge-upload",e}(EVENTS||{}),e,UPLOAD_FILE_MAX_SIZE_MB=100,UPLOAD_IMAGE_MAX_SIZE_MB=10,AI_SCENE="AI",AI_MODE="AI",LEFT_TOOLS_ICON_ONLY_WIDTH=580,INPUT_LINE_MODE={SINGLE:"single",MULTI:"multi"},DRAGCONTENT={IMG:"https://gips2.baidu.com/it/u=1627277417,3307578141&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f526_253",TITLE:"在此处拖放文件/图片,文心助手帮你解读",FILETEXT:"支持PDF、Word、Excel、PPT、txt、Python、Java等文件,最大".concat(UPLOAD_FILE_MAX_SIZE_MB,"MB;"),IMAGETEXT:"支持jpg、png、jpeg等图片,最大".concat(UPLOAD_IMAGE_MAX_SIZE_MB,"MB")},FILE_PANEL_TYPES=["ai_read","ai_translate","deep_decision"],hoverText={ASKAIHOVER:"点我去文心助手回答,已接入DeepSeek、文心4.5,深入思考提供更优质答案,快来试试吧~",DEFAULTFILE:"快速理解总结文件,支持PDF、Word、Excel、PPT、TXT、Python、Java等,最多maxNum个,最大".concat(UPLOAD_FILE_MAX_SIZE_MB,"MB"),FULLFILE:"上传文件最多支持maxNum个",PIC:"一键解读图片内容,支持jpg、png、jpeg等,最多maxNum个,最大".concat(UPLOAD_IMAGE_MAX_SIZE_MB,"MB"),FULLPIC:"上传图片最多支持maxNum个",MERGETEXT:"暂不支持文件、图片混合上传"},LINE_TRANSITION_DURATION=100,LINE_FILE_TRANSITION_DURATION=160,PREFIX_NAME_MAP={photo_editing:"AI生图"},DEEP_DECISION_DISPLAY_NAME="任务模式";function normalizePanelType(e){return e?e.replace(/^new_/,""):""}function isDeepDecisionPanelType(e){return"deep_decision"===normalizePanelType(e)}function getPanelDisplayText(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=arguments.length>1&&arguments[1]!==undefined&&arguments[1],n=e.text||"";return t?n.replace(/^AI\s?/,""):n}var REFERENCE_NON_EXCLUSIVE_PANEL_TYPES=[],FOCUS_SOURCE={USER_CLICK:"user_click",INITIAL:"initial_focus"},AI_HOST="https://chat.baidu.com",PANEL_MODE={OFFICE_CREATE:"office_create",PHOTO_EDITING:"photo_editing",AI_READ:"ai_read",AI_PPT:"ai_ppt",AI_CODE:"ai_code",AI_MUSIC_CREATE:"ai_music_create",DEEP_RESEARCH:"deep_research",AI_NUMERO:"ai_numerology",AI_TRANSLATE:"ai_translate"},PANEL_MODE_CONFIG=[{mode:7,type:PANEL_MODE.OFFICE_CREATE},{mode:8,type:PANEL_MODE.PHOTO_EDITING},{mode:9,type:PANEL_MODE.AI_PPT},{mode:10,type:PANEL_MODE.AI_READ},{mode:11,type:PANEL_MODE.AI_CODE},{mode:12,type:PANEL_MODE.DEEP_RESEARCH},{mode:13,type:PANEL_MODE.AI_MUSIC_CREATE},{mode:16,type:PANEL_MODE.AI_NUMERO},{mode:22,type:PANEL_MODE.AI_TRANSLATE}];PANEL_MODE_CONFIG.reduce((function(e,t){var n=t.mode,i=t.type;return e[n]=i,e}),{});var PANEL_INPUT_MODE=PANEL_MODE_CONFIG.reduce((function(e,t){var n=t.mode,i=t.type;return e[i]=n,e["new_".concat(i)]=n,e}),{});function processQuery(e,t){var n=!1,i=!1,a=[];return t.length>0&&(a=t.filter((function(e){return 2===e.status})).map((function(e){var t=e.uploadType;return"image"===t?n=!0:"file"===t&&(i=!0),{type:null==t?void 0:t.toUpperCase(),data:_defineProperty({},t,__spreadValues(_defineProperty(_defineProperty({},"".concat(t,"_url"),e.url),"".concat(t,"_id"),e.fileId),"file"===t?{file_name:e.fileName,file_type:e.fileType,file_size:e.fileSize}:{}))}}))),e&&0!==(null==a?void 0:a.length)&&a.unshift({data:{text:{query:e}},type:"TEXT"}),{query:e,sseQuery:a,hasImage:n,hasFile:i}}var tabList=["video","note","news","image"];function go2AiChat(e,t,n,i){var a,o,s,r,l=n.getFileList(),c=n.rootCmpt.getToolInfo("left","draw"),d=n.getRootData("scene"),u=n.getRootData("input.aiSuffix")||"",p=tabList.includes(d)?"b_".concat(d):"a",h=processQuery(e,l),f=h.sseQuery,m=h.hasImage,g=h.hasFile;f=f.concat((null==(a=null==i?void 0:i.otherData)?void 0:a.fileInfo)||[]);var _="aiinput_longq",v="aiinput_longq",b={ai_chat:"aidialog",ai_ppt:"ppt",office_create:"office",photo_editing:"pic",ai_read:"read",ai_translate:"translate"},y=n.getInputInfo().prefix.type;-1!==["ai_chat","ai_ppt","office_create","photo_editing","ai_read","ai_translate"].indexOf(y)?(_="functab_"+b[y],v="functab_"+b[y]):"wenxin"===t?(_="home_wenxin",v=e?"home_wenxin_text":"home_wenxin_empty"):"askAi"===t?(_="aiinput_askai",v=e||0!==f.length?"aiinput_aiaskedit":"aiinput_aiaskdefaultq"):m?(_="aiinput_duomo_pic",v="aiinput_duomo_pic"):g&&(_="aiinput_duomo_file",v="aiinput_duomo_file"),i&&(void 0!==i.enterType&&(_=i.enterType),void 0!==i.sa&&(v=i.sa));var w="his"===t&&_.includes("his_aihis");try{var S=JSON.parse(localStorage.getItem("HIS_AI_LIST")||"[]");e.length<40&&!m&&!g&&(S.unshift({kw:u&&!w?e+"图片":e,time:Math.round((new Date).getTime()/1e3),aiflag:1}),localStorage.setItem("HIS_AI_LIST",JSON.stringify(S))),(m||g)&&""===e&&f.push({data:{text:{query:m?"解读图片":"总结文档"}},type:"TEXT"})}catch(P){}var C=null;"aisearch"===t&&(C={modelName:"smartMode",modelFunction:{deepSearch:"1"}});var T=e,k="";u&&!w&&(T+=u,k=e),c&&(T+=Object.keys(c).filter((function(e){return Object.keys(c[e]).length})).map((function(e){return"style"===e?",图片风格为".concat(c[e].text):",比例".concat(c[e].text)})).join(""));var x=[];T&&x.push("word=".concat(encodeURIComponent(T))),x.push("enter_type=".concat(encodeURIComponent("".concat(p,"_").concat(_)))),e&&x.push("sa=".concat(encodeURIComponent("".concat(p,"_").concat(v)))),(null==i?void 0:i.ext)&&Object.entries(i.ext).forEach((function(e){var t=_slicedToArray(e,2),n=t[0],i=t[1];null!=i&&""!==i&&x.push("".concat(n,"=").concat(encodeURIComponent(String(i))))})),k&&x.push("showQuery=".concat(encodeURIComponent(k)));var E=PANEL_INPUT_MODE[y]||(null==(o=null==i?void 0:i.otherData)?void 0:o.openInputMode);E&&x.push("openInputMode=".concat(encodeURIComponent(String(E)))),C&&(C.modelName&&x.push("um.modelName=".concat(encodeURIComponent(C.modelName))),C.modelFunction&&Object.entries(C.modelFunction).forEach((function(e){var t=_slicedToArray(e,2),n=t[0],i=t[1];x.push("um.modelFunction.".concat(n,"=").concat(encodeURIComponent(String(i))))}))),f.forEach((function(e){x.push("fileInfo=".concat(encodeURIComponent(JSON.stringify(e))))}));var I="https://chat.baidu.com/?".concat(x.join("&")),L=null!=(r=null!=(s=null==i?void 0:i.openInNewTab)?s:n.getRootData("option.goToChatInNewTab"))&&r;L||n.rootCmpt.reset();var A=L?window.open("","_blank"):null;n.rootCmpt.nextTick((function(){A?A.location.href=I:window.location.href=I}))}function isObject(e){return null!==e&&"object"==_typeof(e)}function debounce(e,t){var n,i,a,o,s,r,l=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},c=0,d=!1,u=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var a=n,s=i;return n=i=void 0,r=t,o=e.apply(s,a)}function f(e){var n=e-r;return void 0===r||n>=t||n<0||u&&e-c>=a}function m(){var e=Date.now();if(f(e))return g(e);s=setTimeout(m,function(e){var n=e-c,i=t-(e-r);return u?Math.min(i,a-n):i}(e))}function g(e){return s=void 0,p&&n?h(e):(n=i=void 0,o)}function _(){var e=Date.now(),a=f(e);if(n=Array.prototype.slice.call(arguments),i=this,r=e,a){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),d?h(e):o}(r);if(u)return s=setTimeout(m,t),h(r)}return void 0===s&&(s=setTimeout(m,t)),o}return t=+t||0,isObject(l)&&(d=!!l.leading,a=(u="maxWait"in l)?Math.max(void 0===l.maxWait?0:+l.maxWait,t):a,p="trailing"in l?!!l.trailing:p),_.cancel=function(){void 0!==s&&clearTimeout(s),c=0,n=i=s=void 0},_.flush=function(){return void 0===s?o:g(Date.now())},_}function throttle(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},i=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return isObject(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),debounce(e,t,{leading:i,maxWait:t,trailing:a})}var Main$l=(_b=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{showLeftButton:!1,showRightButton:!1,isScrolling:!1}}},{key:"attached",value:function(){var e=this;setTimeout((function(){e.updateButtonVisibility()}),50);var t=this.ref("scrollContainer");t&&(this.observer=new MutationObserver((function(){e.updateButtonVisibility()})),this.observer.observe(t,{childList:!0,subtree:!0}),this.updateButtonVisibilityThrottle=throttle(this.updateButtonVisibility.bind(this),300),this.resizeObserver=new ResizeObserver(this.updateButtonVisibilityThrottle),this.resizeObserver.observe(t))}},{key:"updateButtonVisibility",value:function(){var e=this.ref("scrollContainer");if(e&&e.ownerDocument){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;this.data.set("showLeftButton",Math.floor(t)>0),this.data.set("showRightButton",Math.ceil(t)<n-i)}}},{key:"handleScrollAction",value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:300;this.data.get("isScrolling")||(this.data.set("isScrolling",!0),e(),setTimeout((function(){return t.data.set("isScrolling",!1)}),n))}},{key:"handleScroll",value:function(e){var t=this;this.handleScrollAction((function(){var n=t.ref("scrollContainer");if(n&&n.ownerDocument){var i=n.clientWidth;n.scrollBy({left:"left"===e?-i:i,behavior:"smooth"})}}))}},{key:"disposed",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}}])}(san.Component),_b.template='\n <div class="ci-file-swiper-container">\n <div class="ci-file-swiper-left-button {{!showLeftButton ? \'ci-file-swiper-hidden\' : \'\'}}">\n <div\n class="ci-file-left-icon-wrapper"\n on-click="handleScroll(\'left\')"\n >\n <div class="ci-file-cs-icon-left">\n <img\n class="ci-file-cs-icon-arrow-left"\n src="https://psstatic.cdn.bcebos.com/basics/aichat/pc-arrow-swiper_1756446190000.svg"\n alt=""\n >\n </div>\n </div>\n </div>\n <div class="ci-file-swiper-right-button {{!showRightButton ? \'ci-file-swiper-hidden\' : \'\'}}">\n <div\n class="ci-file-right-icon-wrapper"\n on-click="handleScroll(\'right\')"\n >\n <div class="ci-file-cs-icon-right">\n <img\n class="ci-file-cs-icon-arrow-right"\n src="https://psstatic.cdn.bcebos.com/basics/aichat/pc-arrow-swiper_1756446190000.svg"\n alt=""\n >\n </div>\n </div>\n </div>\n <div\n class="ci-file-swiper-scroll-container"\n s-ref="scrollContainer"\n on-scroll="updateButtonVisibility"\n >\n <div class="ci-file-swiper-wrapper">\n <slot></slot>\n </div>\n </div>\n</div>\n ',_b),_CreateItemPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{data:{},selected:!1,order:-1}}}])}(san.Component);_CreateItemPanel.template='\n <div\n s-ref="creatItem"\n class="\n ci-create-panel-item\n {{selected ? \'ci-create-panel-item-selected\' : \'\'}}\n "\n >\n <img\n class="ci-create-panel-item-img"\n src="{{data.icon}}"\n />\n <div class="ci-create-panel-item-text">\n <div\n class="ci-create-panel-item-title"\n >\n {{data.text}}\n </div>\n <div class="ci-create-panel-item-desc">\n <img\n s-if="data.desc_icon"\n class="ci-create-panel-item-logo"\n src="{{data.desc_icon}}"\n />\n {{data.desc}}\n </div>\n </div>\n </div>\n ';var CreateItemPanel=_CreateItemPanel,_CreatePanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{list:[],place_holdaer:"",tab_list:[],title:"",selectedTab:"all",type:""}}},{key:"handleTabClick",value:function(e){this.data.get("selectedTab")!==e&&this.data.set("selectedTab",e)}},{key:"handleItemClick",value:function(e,t){this.data.set("selectedBtn",e.button_id);var n=this.data.get("selectedTab"),i=e.button_id,a=(null==e?void 0:e["function"])||{};if("input"===a.type){var o=a.data.input||{},s=null==o?void 0:o.interactionType;this.fire("click",__spreadProps(__spreadValues({agentInfo:o.agentInfo,inputCustom:null==o?void 0:o.input_custom},s?{interactionType:s}:{}),{functionTab:n,functionName:i,functionData:a,index:t}))}}}])}(san.Component);_CreatePanel.template='\n <div class="ci-create-panel">\n <ci-swiper spaceBetween="9">\n <div class="ci-create-panel-tab">\n <div\n s-for="item in tabList"\n class="\n ci-create-panel-tab-item\n {{selectedTab === item.tab_id ? \'ci-create-panel-tab-item-selected\' : \'\'}}\n "\n on-click="handleTabClick(item.tab_id)"\n >\n {{item.tab_name}}\n </div>\n </div>\n </ci-swiper>\n <div class="ci-create-panel-content">\n <create-item\n s-for="item, index in showContentList"\n data="{{item}}"\n order="{{index + 1}}"\n selected="{{selectedBtn === item.button_id}}"\n on-click="native:handleItemClick(item, index)"\n />\n </div>\n </div>\n ',_CreatePanel.components={"create-item":CreateItemPanel,"ci-swiper":Main$l},_CreatePanel.computed={tabList:function(){var e=(this.data.get("tab_list")||[]).slice();return e.unshift({tab_id:"all",tab_name:"全部"}),e},showContentList:function(){var e=this.data.get("selectedTab"),t=this.data.get("list")||[];return"all"===e?t:t.filter((function(t){return(null==t?void 0:t.tab_id)===e}))}};var CreatePanel=_CreatePanel,_DrawItemPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{data:{},order:-1}}},{key:"handleBtnClick",value:function(){this.fire("btn-click",this.data.get("data"))}}])}(san.Component);_DrawItemPanel.template='\n <div class="ci-draw-panel-item" on-click="handleBtnClick">\n <img class="ci-draw-panel-item-img" src="{{data.icon}}" />\n <div class="ci-draw-panel-item-text">{{desc}}</div>\n <div\n class="ci-draw-panel-item-btn"\n >\n 做同款\n </div>\n </div>\n ',_DrawItemPanel.computed={desc:function(){var e=this.data.get("data.text"),t=this.data.get("data.agentInfo");return(null==t?void 0:t.agentName)?"@".concat(t.agentName):e}};var DrawItemPanel=_DrawItemPanel;function isArray(e){return Array.isArray(e)}function getMillisecondFromSecond(e){return e<1e10?1e3*e:e}function getDayDiff(e){var t=e||(new Date).getTime();t=getMillisecondFromSecond(t);var n=new Date(t),i=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),a=new Date,o=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime();return Math.floor((o-i)/864e5)}function shuffleArray(e){if(!isArray(e))return[];for(var t=e.slice(),n=t.length-1;n>0;n--){var i=Math.floor(Math.random()*(n+1)),a=[t[i],t[n]];t[n]=a[0],t[i]=a[1]}return t}var SHUFFLE_STORAGE_KEY="SUPERPAGE_SEARCH_DRAW_ITEM_SHUFFLE",SHUFFLE_TIME_STORAGE_KEY="SUPERPAGE_SEARCH_DRAW_ITEM_SHUFFLE_TIME",_DrawPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{tools:{},sameStyle:{},place_holdaer:"",default_content:""}}},{key:"attached",value:function(){this.data.set("showContentList",this.getRandomContentList())}},{key:"getRandomContentList",value:function(){var e=[],t=0;try{e=JSON.parse(localStorage.getItem(SHUFFLE_STORAGE_KEY)||"[]"),t=Number(localStorage.getItem(SHUFFLE_TIME_STORAGE_KEY)||0)}catch(s){e=[],t=0}var n=this.data.get("same_style.list")||[];(!t||e.length!==n.length||getDayDiff(t)>0)&&(e=shuffleArray(Array.from({length:n.length},(function(e,t){return t}))),localStorage.setItem(SHUFFLE_STORAGE_KEY,JSON.stringify(e)),localStorage.setItem(SHUFFLE_TIME_STORAGE_KEY,String(+new Date)));var i=[];return e.forEach((function(e,t){i[e]=n[t]})),i}},{key:"detached",value:function(){this.data.set("showContentList",this.getRandomContentList())}},{key:"handleToolsBtnClick",value:function(e){var t=(null==e?void 0:e["function"])||{},n=e.button_id;this.fire("click",{functionData:t,functionName:n,clickType:"pic-tool"})}},{key:"handleDrawBtnClick",value:function(e,t){var n=e.button_id,i=(null==e?void 0:e["function"])||{},a=null==e?void 0:e.order,o=null==e?void 0:e.text,s=null==e?void 0:e.agentInfo;if("input"===i.type){var r=i.data.input||{};this.fire("click",{inputCustom:null==r?void 0:r.input_custom,functionName:n,functionData:i,text:o,index:t,order:a,agentInfo:s})}}}])}(san.Component);_DrawPanel.template='\n <div class="ci-draw-panel">\n <ci-swiper>\n <div class="ci-draw-panel-tools">\n <div\n s-for="item, index in tools.list"\n class="ci-draw-panel-tools-list-item"\n on-click="native:handleToolsBtnClick(item, index)"\n >\n <img class="ci-draw-panel-tools-list-item-icon" src="{{item.icon}}" />\n {{item.text}}\n </div>\n </div>\n </ci-swiper>\n <div class="ci-draw-panel-content">\n <draw-item\n s-for="item, index in showContentList"\n class="ci-draw-panel-content-list-item-btn"\n data="{{item}}"\n order="{{index + 1}}"\n on-btn-click="handleDrawBtnClick(item, index)"\n />\n </div>\n </div>\n ',_DrawPanel.components={"ci-swiper":Main$l,"draw-item":DrawItemPanel};var DrawPanel=_DrawPanel,_SnapTextItem=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{data:{},hoverText:"做同款"}}}])}(san.Component);_SnapTextItem.template='\n <div\n class="ci-snap-text-item"\n >\n <div class="ci-snap-text-item-img-container">\n <div\n s-if="data.usedModel && data.usedModel.modelTitle"\n class="ci-snap-text-model-tag"\n >{{data.usedModel.modelTitle}}</div>\n <img class="ci-snap-text-item-img" src="{{data.backgroundUrl}}" />\n <div class="ci-snap-text-item-hover-mask"></div>\n </div>\n <div class="ci-snap-text-item-text">{{data.text}}</div>\n <div\n class="ci-snap-text-item-btn"\n >\n {{hoverText}}\n </div>\n </div>\n ';var SnapTextItem=_SnapTextItem,_SnapTextPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{list:[],hoverText:"做同款"}}},{key:"handleItemClick",value:function(e,t){var n=e.button_id,i=(null==e?void 0:e["function"])||{},a=(null==e?void 0:e.fileInfo)||{},o=null==e?void 0:e.usedModel;if("input"===i.type){var s=i.data.input||{};this.fire("click",{inputCustom:null==s?void 0:s.input_custom,fileInfo:a,functionData:i,functionName:n,index:t,usedModel:o})}this.$input.emit(EVENTS.CLEAR_ALL_FILES),(null==a?void 0:a.file_path)&&this.$input.emit(EVENTS.UPLOAD_FILE,{uploadFile:a,direct:!0})}}])}(san.Component);_SnapTextPanel.template='\n <div\n class="ci-snap-text-panel"\n >\n <div class="ci-snap-text-panel-content">\n <snap-text-item\n s-for="item, index in list"\n hover-text="{{hoverText}}"\n data="{{item}}"\n on-click="native:handleItemClick(item, index)"\n />\n </div>\n </div>\n ',_SnapTextPanel.components={"snap-text-item":SnapTextItem};var SnapTextPanel=_SnapTextPanel,_MusicItemPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{data:{},order:-1,currentPlayOrder:-1,isPlaying:!1}}},{key:"getColorByHue",value:function(e){var t=Number(e);if(!isNaN(t)){var n,i=_createForOfIteratorHelper([{color:"#F98989",ranges:[[310,359],[0,5]]},{color:"#F29D61",ranges:[[6,40]]},{color:"#FAD932",ranges:[[41,61]]},{color:"#7FD977",ranges:[[62,150]]},{color:"#57D9D9",ranges:[[151,185]]},{color:"#619DF2",ranges:[[186,220]]},{color:"#A288F7",ranges:[[221,309]]}]);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.ranges.some((function(e){var n=_slicedToArray(e,2),i=n[0],a=n[1];return t>=i&&t<=a})))return a.color}}catch(o){i.e(o)}finally{i.f()}}}},{key:"attached",value:function(){var e,t,n,i=this;this.data.set("musicPlayerCssVars",{"--music-item-height":this.ref("musicPlayer").clientHeight+"px","--music-item-width":this.ref("musicPlayer").clientWidth+"px","--domin-color":(null==(e=this.data.get("data"))?void 0:e.dominColor)||"217, 204, 255","--sub-color":(null==(t=this.data.get("data"))?void 0:t.subColor)||"204, 225, 255","--hue-color":this.getColorByHue((null==(n=this.data.get("data"))?void 0:n.hueColor)||"0")}),this.checkSeekAble(),this.loadSong(this.data.get("data"));var a=this.ref("audioPlayer");this._updateTimeDisplay=this.updateTimeDisplay.bind(this),this._resetSong=this.resetSong.bind(this),a.addEventListener("timeupdate",this._updateTimeDisplay),a.addEventListener("ended",this._resetSong),this.watch("currentPlayOrder",(function(e){var t=i.ref("musicPlayer"),n=i.ref("progress"),a=t.classList.contains("playing");e!==i.data.get("order")&&(a||n.style.width)&&i.resetSong()}))}},{key:"checkSeekAble",value:function(){var e=this,t=this.ref("audioPlayer");if(t&&t.readyState>=4)this.data.set("isSeekable",!0);else var n=setTimeout((function(){e.checkSeekAble(),clearTimeout(n)}),500)}},{key:"loadSong",value:function(e){return __async(this,null,_regenerator().m((function t(){return _regenerator().w((function(t){for(;;)switch(t.n){case 0:if(e){t.n=1;break}return t.a(2);case 1:this.ref("audioPlayer").src=e.url;case 2:return t.a(2)}}),t,this)})))}},{key:"formatTime",value:function(e){if(isNaN(e))return"00:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))}},{key:"updateTimeDisplay",value:function(){var e=this.ref("progress"),t=this.ref("audioPlayer");if(t){var n=t.currentTime/t.duration*100;e.style.width="".concat(n,"%")}}},{key:"resetSong",value:function(){this.pauseSong(),this.loadSong(this.data.get("data")),this.ref("progress").style.width=""}},{key:"playSong",value:function(){return __async(this,null,_regenerator().m((function e(){var t,n,i;return _regenerator().w((function(e){for(;;)switch(e.n){case 0:if(t=this.ref("musicPlayer"),n=this.ref("playBtn"),!(i=this.ref("audioPlayer"))){e.n=2;break}return e.n=1,i.play();case 1:n.classList.add("playing-icon"),t.classList.add("playing"),this.fire("select-music-item-play",this.data.get("order"));case 2:return e.a(2)}}),e,this)})))}},{key:"pauseSong",value:function(){var e=this.ref("playBtn"),t=this.ref("musicPlayer"),n=this.ref("audioPlayer");n&&(t.classList.remove("playing"),e.classList.remove("playing-icon"),n.pause())}},{key:"playBtnClick",value:function(e){e.stopPropagation();var t=this.ref("musicPlayer").classList.contains("playing");this.data.set("isPlaying",!t),t?this.pauseSong():this.playSong()}},{key:"handleBtnClick",value:function(e){e.stopPropagation(),this.fire("btn-click",this.data.get("data"))}},{key:"detached",value:function(){var e=this.ref("audioPlayer");e&&(e.pause(),e.removeEventListener("timeupdate",this._updateTimeDisplay),e.removeEventListener("ended",this._resetSong))}}])}(san.Component);_MusicItemPanel.template='\n <div class="ci-music-panel-item-container">\n <div\n s-ref="musicPlayer"\n class="ci-music-panel-item"\n style="{{musicPlayerCssVars}}"\n on-click="handleBtnClick"\n >\n <div class="ci-music-panel-item-img-wrapper">\n <img\n class="\n ci-music-panel-item-img\n {{isPlayingItem && isPlaying ? \'ci-music-panel-item-img-animation\' : \'\'}}\n "\n src="{{data.backgroundUrl}}"\n />\n <div class="ci-music-panel-item-btn">\n 做同款\n </div>\n </div>\n <div class="ci-music-panel-item-func">\n <div class="ci-music-panel-item-text">\n <div class="ci-music-panel-item-title">\n {{ data.text }}\n </div>\n <div class="ci-music-panel-item-desc">\n <div>{{ musicStyle }}</div>\n <div class="ci-music-panel-item-timbre">{{ timbre }}</div>\n </div>\n </div>\n <div\n s-ref="playBtn"\n class="ci-music-panel-item-play"\n on-click="playBtnClick"\n ></div>\n </div>\n <div class="progress-box">\n <div\n s-ref="progressContainer"\n class="progress-container"\n >\n <div s-ref="progress" class="progress">\n </div>\n </div>\n </div>\n <audio s-ref="audioPlayer"></audio>\n </div>\n </div>\n ',_MusicItemPanel.computed={musicStyle:function(){var e;return null==(e=(this.data.get("data.property")||[]).find((function(e){return"musicStyle"===e.type})))?void 0:e.text},timbre:function(){var e;return null==(e=(this.data.get("data.property")||[]).find((function(e){return"timbre"===e.type})))?void 0:e.text},isPlayingItem:function(){return this.data.get("order")===this.data.get("currentPlayOrder")}};var MusicItemPanel=_MusicItemPanel,_MusicPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{list:[],currentPlayOrder:-1,itemsPerRow:4}}},{key:"attached",value:function(){this.pauseSong=this.pauseSong.bind(this),this.$input.on(EVENTS.VOICE_INPUT_START,this.pauseSong)}},{key:"pauseSong",value:function(){var e=this.data.get("currentPlayOrder");-1!==e&&this.ref("music-item-".concat(e)).pauseSong()}},{key:"detached",value:function(){this.$input.off(EVENTS.VOICE_INPUT_START,this.pauseSong)}},{key:"handleSelectMusicItemPlay",value:function(e){this.data.set("currentPlayOrder",e),this.$input.emit(EVENTS.MUSIC_PLAY)}},{key:"handleMusicBtnClick",value:function(e,t){this.data.set("currentPlayOrder",t-1);var n=e.button_id,i=(null==e?void 0:e["function"])||{};if("input"===i.type){var a=i.data.input||{},o=a.interactionType;this.$input.emit(EVENTS.MUSIC_PANEL_CHANGE,__spreadProps(__spreadValues({inputCustom:a.input_custom,buttonProperty:e.property||[]},o?{interactionType:o}:{}),{functionName:n,index:t})),this.fire("click",__spreadProps(__spreadValues({inputCustom:a.input_custom,functionData:i,buttonProperty:e.property||[]},o?{interactionType:o}:{}),{functionName:n,index:t}))}}}])}(san.Component);_MusicPanel.template='\n <div class="ci-music-panel">\n <div class="ci-music-panel-content">\n <music-item\n s-for="item, index in list"\n data="{{item}}"\n order="{{index + 1}}"\n s-ref="music-item-{{index + 1}}"\n current-play-order="{{currentPlayOrder}}"\n on-btn-click="handleMusicBtnClick(item, index)"\n on-select-music-item-play="handleSelectMusicItemPlay"\n />\n </div>\n </div>x\n ',_MusicPanel.components={"music-item":MusicItemPanel};var MusicPanel=_MusicPanel,_FortuneDrawItemPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{data:{},order:-1}}},{key:"handleBtnClick",value:function(){this.fire("btn-click",this.data.get("data"))}}])}(san.Component);_FortuneDrawItemPanel.template='\n <div class="ci-fortune-draw-item" on-click="handleBtnClick">\n <img class="ci-fortune-draw-item-img" src="{{data.icon}}" />\n <div class="ci-fortune-draw-item-text">{{data.text}}</div>\n <div class="ci-fortune-draw-item-subtext">{{data.subText}}</div>\n <div class="ci-fortune-draw-item-btn">\n 测一测\n </div>\n </div>\n ';var FortuneDrawItemPanel=_FortuneDrawItemPanel,_NumeroPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{showFortuneList:[],itemsPerRow:4,itemGap:12,panelWidth:700,downImg:"https://gips1.baidu.com/it/u=1583088710,3173621938&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f48_48",isFold:!0}}},{key:"handleShowMore",value:function(){this.data.set("isFold",!1)}},{key:"handleNumeroClick",value:function(e,t){var n=e.button_id,i=(null==e?void 0:e["function"])||{};if("input"===i.type){var a=i.data.input||{};this.fire("click",{inputCustom:null==a?void 0:a.input_custom,functionName:n,functionData:i,index:t})}}}])}(san.Component);_NumeroPanel.template='\n <div class="ci-numero-panel">\n \x3c!-- 上半部分:推荐提示词 --\x3e\n <div class="ci-numero-recommend-section">\n <div class="ci-button-list {{isFold ? \'fold\' : \'unfold\'}}">\n <div\n s-for="item in recommend_prompt.list"\n class="ci-recommend-button"\n on-click="handleNumeroClick(item, index)"\n >\n <span class="button-icon button-text">{{item.icon}}</span>\n <span class="button-text">{{item.text}}</span>\n </div>\n </div>\n <div\n s-if="isShrink && isFold"\n class="recommend-more-btn"\n on-click="handleShowMore"\n >\n <span>展开</span>\n <img src="{{downImg}}">\n </div>\n </div>\n\n \x3c!-- 下半部分:运势方向 --\x3e\n <div class="ci-fortune-section">\n <fortune-item\n s-for="item, index in showFortuneList"\n data="{{item}}"\n order="{{index + 1}}"\n on-btn-click="handleNumeroClick(item, index)"\n />\n </div>\n </div>\n ',_NumeroPanel.components={"fortune-item":FortuneDrawItemPanel,"ci-swiper":Main$l},_NumeroPanel.computed={showFortuneList:function(){return this.data.get("fortune_direction.list")||[]},isShrink:function(){return this.data.get("panelWidth")<687}};var NumeroPanel=_NumeroPanel,DEFAULT_RECOMMEND_ICON="https://gips1.baidu.com/it/u=2867338985,4190565947&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f42_42",_DeepDecisionItem=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{data:{},displayMode:"card",defaultRecommendIcon:DEFAULT_RECOMMEND_ICON}}}])}(san.Component);_DeepDecisionItem.template='\n <div class="ci-deep-decision-item ci-deep-decision-item-{{displayMode}}">\n <template s-if="displayMode === \'card\'">\n <div class="ci-deep-decision-card-cover">\n <img\n class="ci-deep-decision-card-cover-img"\n src="{{data.icon}}"\n alt=""\n />\n <div class="ci-deep-decision-card-btn">试一试</div>\n </div>\n <div class="ci-deep-decision-card-title">{{data.text}}</div>\n <div s-if="data.desc" class="ci-deep-decision-card-desc">{{data.desc}}</div>\n </template>\n <template s-else>\n <img\n class="ci-deep-decision-recommend-icon"\n src="{{defaultRecommendIcon}}"\n alt=""\n />\n <span class="ci-deep-decision-recommend-title">{{data.text}}</span>\n </template>\n </div>\n ';var DeepDecisionItem=_DeepDecisionItem,fileNameSuffixReg=/\.(\w+)$/,UPLOAD_IMAGE_SUFFIXES=[".jpeg",".png",".jpg",".bmp",".webp",".heic",".heif",".avif",".tiff",".tif"],UPLOAD_FILE_SUFFIXES=[".pdf",".doc",".docx",".txt",".xls",".xlsx",".csv",".ppt",".pptx",".py",".java",".js",".html",".css",".ts",".c",".cpp",".cc",".h",".go",".xml",".md"],fileTypeMap={pdf:"PDF",doc:"Word",docx:"Word",txt:"TXT",xls:"Excel",xlsx:"Excel",ppt:"PPT",pptx:"PPT",csv:"Excel",py:"Code",java:"Code",js:"Code",html:"Code",css:"Code",ts:"Code",c:"Code",cpp:"Code",cc:"Code",h:"Code",go:"Code",xml:"XML",md:"MD",jpeg:"IMAGE",jpg:"IMAGE",png:"IMAGE",bmp:"IMAGE",webp:"IMAGE"},suffixToFileType=function(e){if(!e)return"unknown";var t=e.toLowerCase();return fileTypeMap[t]||"unknown"},getFileType=function(e){var t=fileNameSuffixReg.exec(e);return t?suffixToFileType(t[1]):"unknown"},getFileNameSuffix=function(e){var t=fileNameSuffixReg.exec(e);return t?t[0]:""},fetchInterceptor={};function getChatParams(){var e;if("undefined"==typeof document)return{};var t=document.querySelector('script[name="aiTabFrameBaseData"]'),n=(null==t?void 0:t.innerHTML)||"{}";try{return(null==(e=JSON.parse(n))?void 0:e.chatParams)||{}}catch(i){return{}}}function addQueryParam(e,t){return t?"".concat(e).concat(e.includes("?")?"&":"?").concat(t):e}function reportFetchError(e,t,n,i){fetchInterceptor.onError&&fetchInterceptor.onError({url:e,options:t,status:null==n?void 0:n.status,logid:null==n?void 0:n.logid,message:null==n?void 0:n.message,stack:null==n?void 0:n.stack,response:null==n?void 0:n.response})}function jsonpFetch(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise((function(n,i){var a=t.callbackName||"jsonpCallback".concat(Date.now()).concat(Math.round(1e3*Math.random())),o=document.createElement("script"),s=function(){document.body.removeChild(o),delete window[a]};o.onerror=function(){s(),i(new Error("JSONP request failed"))},window[a]=function(e){s(),n(e)};var r=new URLSearchParams;Object.entries(t.data||{}).forEach((function(e){var t=_slicedToArray(e,2),n=t[0],i=t[1];r.append(n,String(i))})),r.append("callback",a),o.src=addQueryParam(e,r.toString()),document.body.appendChild(o)}))}var chatParams=getChatParams(),SSE_HOST=(null==chatParams?void 0:chatParams.sse_host)||"";function timeoutFetch(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:5e3,i=arguments.length>3&&arguments[3]!==undefined&&arguments[3],a=null,o=e;e.startsWith("http://")||e.startsWith("https://")||(o=SSE_HOST+e);var s="jsonp"===String(t.method).toLowerCase(),r=__spreadValues({credentials:"include"},t);return Promise.race([s?jsonpFetch(o,t):fetch(o,r).then((function(e){if(e.ok){var t=e.headers.get("Content-Type");return i&&t&&t.includes("text/html")?e.text():e.json()}var n=new Error("Http error: "+e.statusText);return n.status=e.status,n.response=e,Promise.reject(n)})),new Promise((function(t,i){a=setTimeout((function(){var t=new Error("Timeout : "+n+e);t.status=-9999,i(t)}),n)}))]).then((function(e){return e.status&&reportFetchError(o,t,{status:e.status,message:"Response body error: "+e.message}),e}))["catch"]((function(e){throw reportFetchError(o,t,e),e}))["finally"]((function(){a&&(clearTimeout(a),a=null)}))}function fetchGet(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5e3;return timeoutFetch(addQueryParam(e,new URLSearchParams(t).toString()),__spreadValues({method:"GET"},n),i)}null==chatParams||chatParams.sse_task_mode_host,null==chatParams||chatParams.card_host,null==chatParams||chatParams.sse_ws_host;var CHAT_SEARCH_API={uploadSts:"/aichat/api/file/sts",upload:"/aichat/api/file/upload",fileLoop:"/aichat/api/file/loop",fileDelete:"/aichat/api/knowledge/file/delete"},UploadStatus=function(e){return e[e.INIT=-1]="INIT",e[e.STSSUCCESS=0]="STSSUCCESS",e[e.UPLOADING=1]="UPLOADING",e[e.BOS_SUCCESS=2]="BOS_SUCCESS",e[e.NETWORK_ERROR=3]="NETWORK_ERROR",e[e.RISK_DENY=4]="RISK_DENY",e[e.FILE_NUM_EXCEED_LIMIT=5]="FILE_NUM_EXCEED_LIMIT",e[e.FILE_SIZE_EXCEED_LIMIT=6]="FILE_SIZE_EXCEED_LIMIT",e[e.KNOWLEDGE_SUCCESS=7]="KNOWLEDGE_SUCCESS",e[e.KNOWLEDGE_ERROR=8]="KNOWLEDGE_ERROR",e[e.SET_FILE_NUM=9]="SET_FILE_NUM",e[e.NOT_AVAILABLE=10]="NOT_AVAILABLE",e[e.FILE_REUPLOAD=11]="FILE_REUPLOAD",e[e.FILE_SIZE_BELOW_LIMIT=12]="FILE_SIZE_BELOW_LIMIT",e[e.IMAGE_INFO_SUCCESS=13]="IMAGE_INFO_SUCCESS",e}(UploadStatus||{}),imageAcceptBase=".jpeg, .png, .jpg, .bmp, .webp",imageAcceptExtra=".heic, .heif, .avif, .tiff, .tif",imageAccept="".concat(imageAcceptBase,", ").concat(imageAcceptExtra),fileAccept=".pdf, .doc, .docx, .txt, .xls, .xlsx, .csv, .ppt, .pptx, .xml, .md",BROWSER_NON_DECODABLE_IMAGE_TYPES=new Set(["image/heic","image/heif","image/tiff"]),codeAccept=".py, .java, .js, .css, .ts, .c, .cpp, .cc, .h, .go";function nanoid(){var e="",t=new Uint8Array(6);crypto.getRandomValues(t);for(var n=0;n<6;n++)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"[t[n]%63];return e}var UploadFile=function(){function e(t,n){_classCallCheck(this,e),this.files=[],this.inLoop=!1,this.preventUploadSet=new Set,this.uploadMap=new Map,this.options=t,this.sdk=n}return _createClass(e,[{key:"getApiUrl",value:function(e){return this.options.isChatSearch?e:AI_HOST+e}},{key:"getFile",value:function(t){return __async(this,null,_regenerator().m((function n(){var i=this;return _regenerator().w((function(n){for(;;)if(0===n.n)return n.a(2,new Promise((function(n,a){try{var o=document.createElement("input"),s=i.options,r=s.type,l=s.maxNum,c=e.resolveImageAccept(i.options.enableExtendedPicFormats),d="".concat(c,", ").concat(fileAccept);o.type="file",o.accept="all"===r?d:"image"===r?c:"".concat(fileAccept,", ").concat(codeAccept),o.multiple=l>1,o.onchange=function(e){return i.handleFileChange(e,n,a,t)},o.click()}catch(o){a(o)}})))}),n)})))}},{key:"getCouldUploadFiles",value:function(t){var n="".concat(e.resolveImageAccept(this.options.enableExtendedPicFormats),", ").concat(fileAccept),i=t.filter((function(e){var t=e.name.split(".")||[],i=null==t?void 0:t[t.length-1];return i&&"".concat(n,", ").concat(codeAccept).includes(i.toLocaleLowerCase())}));if(i.length!==t.length){var a=Array.from(new Set(t.filter((function(e){return!i.includes(e)})).map((function(e){var t=e.name.split(".")||[];return e.type||(null==t?void 0:t[t.length-1])||""})).filter(Boolean)));this.options.callback({status:10,fileInfo:{fileType:a.join(",")}})}return i}},{key:"checkFileValid",value:function(e){return e.size>1024*this.options.maxSize*1024?(this.options.callback({status:6}),!1):0!==e.size||(this.options.callback({status:12}),!1)}},{key:"filterInvalidFile",value:function(e,t){var n=this.getCouldUploadFiles(e);if(t&&!t(n))return[];n.length>this.options.maxNum&&(this.options.callback({status:5}),n.splice(this.options.maxNum)),this.options.callback({status:9,num:n.length});for(var i=n.length-1;i>=0;i--)this.checkFileValid(n[i])||n.splice(i,1);return n}},{key:"handleFileChange",value:function(e,t,n,i){return __async(this,null,_regenerator().m((function a(){var o,s,r,l,c=this;return _regenerator().w((function(a){for(;;)switch(a.p=a.n){case 0:return a.p=0,o=null==e?void 0:e.target,s=Array.from(o.files||[]),r=this.filterInvalidFile(s,i),a.n=1,Promise.all(r.map((function(e,t){return c.uploadFile(e,t)})));case 1:t(),a.n=3;break;case 2:a.p=2,l=a.v,n(l);case 3:return a.a(2)}}),a,this,[[0,2]])})))}},{key:"uploadFiles",value:function(e){var t=this;return Promise.all(this.filterInvalidFile(e).map((function(e,n){return t.uploadFile(e,n)})))}},{key:"uploadFile",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return __async(this,null,_regenerator().m((function n(){var i,a=this;return _regenerator().w((function(n){for(;;)if(0===n.n)return i=Date.now()+t+nanoid(),n.a(2,(this.options.callback({status:-1,progress:0,fileInfo:{fileName:e.name,fileType:e.type,fileSize:e.size,fileIndex:t,fileToken:i}}),new Promise((function(n,o){return __async(a,null,_regenerator().m((function s(){var a,r,l,c,d,u,p,h,f,m,g,_,v,b,y,w,S,C=this;return _regenerator().w((function(s){for(;;)switch(s.p=s.n){case 0:if(s.p=0,e){s.n=1;break}return s.a(2);case 1:return this.files||(this.files=[]),this.files.push({file:e,fileToken:i}),this.sdk||navigator.onLine||this.options.callback({status:3,fileInfo:{fileIndex:t,fileToken:i,fileType:e.type}}),s.n=2,this.getSts();case 2:if(r=s.v,l=r.ak,c=r.sk,d=r.token,u=r.preFixPath,p=r.recommendWord,this.options.callback({status:0,progress:0,fileInfo:{fileName:e.name,fileType:e.type,fileSize:e.size,fileIndex:t,fileToken:i},recommendWord:p}),!(e instanceof File&&e.type.startsWith("image/"))||BROWSER_NON_DECODABLE_IMAGE_TYPES.has(e.type)){s.n=4;break}return s.n=3,this.getImageInfo(e);case 3:h=s.v,this.options.callback({status:13,progress:0,fileInfo:{imageWidth:h.width,imageHeight:h.height,fileToken:i}});case 4:return f=this.sdk.BosClient,m=new f({endpoint:"https://aisearch.bj.bcebos.com",credentials:{ak:l,sk:c},sessionToken:d}),g=null==(a=e.name)?void 0:a.split(".").pop(),_=this.sdk.MimeType.guess(g),v=i+"."+g,_.startsWith("text/")&&(_+="; charset=UTF-8"),b=m.putSuperObject({bucketName:"aisearch",objectName:"".concat(u).concat(v),chunkSize:1048576,ContentLength:e.size,ContentType:_,data:e,onProgress:function(e){var n=e.progress;C.options.callback({status:1,progress:n,fileInfo:{fileIndex:t,fileToken:i}})},onStateChange:function(a,s){return __async(C,null,_regenerator().m((function r(){var l,c,d,u,p,h,f,m,g;return _regenerator().w((function(r){for(;;)switch(r.p=r.n){case 0:if("completed"!==a){r.n=7;break}return r.p=1,this.options.callback({status:1,progress:1,fileInfo:{fileIndex:t,fileToken:i}}),l=s.data.key,c=btoa(l.split("/").pop()),r.n=2,this.upLoadConfirm({path:l,size:e.size,name:e.name,id:c,type:"all"===this.options.type?e.type.startsWith("image/")?"image":"file":this.options.type});case 2:if(d=r.v,u=d.file_url,p=d.image_info,h=d.id,this.options.callback({status:2,progress:1,fileInfo:{fileIndex:t,fileId:h||c,fileUrl:u,filePath:l,fileToken:i,fileType:e.type}}),BROWSER_NON_DECODABLE_IMAGE_TYPES.has(e.type)&&(null==p?void 0:p.width)&&(null==p?void 0:p.height)&&this.options.callback({status:13,progress:0,fileInfo:{imageWidth:p.width,imageHeight:p.height,fileToken:i}}),!this.options.knowledgeId||this.preventUploadSet.has(i)){r.n=4;break}return r.n=3,this.getUploadKnowledgeStatus(c);case 3:this.options.callback({status:7,fileInfo:{fileToken:i,fileUrl:u}});case 4:n(),r.n=6;break;case 5:r.p=5,g=r.v,m=(null==(f=g)?void 0:f.status)||3,this.options.callback({status:m,fileInfo:{fileIndex:t,fileToken:i,fileType:e.type}}),o(f);case 6:r.n=8;break;case 7:"failed"===a&&(this.options.callback({status:3,fileInfo:{fileIndex:t,fileToken:i,fileType:e.type}}),o(new Error("Network disconnected")));case 8:return r.a(2)}}),r,this,[[1,5]])})))}}),s.n=5,b.start();case 5:s.n=7;break;case 6:s.p=6,S=s.v,w=(null==(y=S)?void 0:y.status)||3,this.options.callback({status:w,fileInfo:{fileIndex:t,fileToken:i,fileType:e.type}}),o(y);case 7:return s.a(2)}}),s,this,[[0,6]])})))}))))}),n,this)})))}},{key:"reTryUpload",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:if(!(n=(this.files||[]).find((function(t){return t.fileToken===e})))){t.n=2;break}return this.options.callback({status:11,fileInfo:{fileToken:e}}),t.n=1,this.uploadFile(n.file,0);case 1:i=t.v,t.n=3;break;case 2:i=Promise.resolve();case 3:return t.a(2,i)}}),t,this)})))}},{key:"getSts",value:function(){return __async(this,null,_regenerator().m((function e(){var t=this;return _regenerator().w((function(e){for(;;)if(0===e.n)return e.a(2,new Promise((function(e,n){return __async(t,null,_regenerator().m((function i(){var t,a;return _regenerator().w((function(i){for(;;)switch(i.p=i.n){case 0:return i.p=0,t={tk:this.options.token,isPrivateChat:this.options.privateChat},this.options.knowledgeId&&(t.knowledgeId=this.options.knowledgeId),i.n=1,fetchGet(this.getApiUrl(CHAT_SEARCH_API.uploadSts),t,{mode:"cors"});case 1:0===(a=i.v).status?e(a.data):n({status:3}),i.n=3;break;case 2:i.p=2,i.v,n({status:3});case 3:return i.a(2)}}),i,this,[[0,2]])})))})))}),e)})))}},{key:"upLoadConfirm",value:function(e){return __async(this,null,_regenerator().m((function t(){var n=this;return _regenerator().w((function(t){for(;;)if(0===t.n)return t.a(2,new Promise((function(t,i){return __async(n,null,_regenerator().m((function a(){var n,o,s,r,l;return _regenerator().w((function(a){for(;;)switch(a.p=a.n){case 0:return a.p=0,n=CHAT_SEARCH_API.upload+"?tk=".concat(this.options.token),a.n=1,timeoutFetch(this.getApiUrl(n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.assign({},e,this.options.uploadBody))},6e4);case 1:if(o=a.v,r=(s=o||{}).status,l=s.data,0!==r){a.n=2;break}t(l),a.n=5;break;case 2:if(-5!==r){a.n=3;break}i({status:4}),a.n=5;break;case 3:if(-1!==r){a.n=4;break}throw{status:3};case 4:i({status:3});case 5:a.n=7;break;case 6:a.p=6,a.v,i({status:3});case 7:return a.a(2)}}),a,this,[[0,6]])})))})))}),t)})))}},{key:"loop",value:function(){return __async(this,null,_regenerator().m((function e(){var t,n,i,a,o,s,r,l,c,d,u,p,h,f,m,g,_,v,b,y,w,S,C,T,k=this;return _regenerator().w((function(e){for(;;)switch(e.p=e.n){case 0:if(this.uploadMap.size){e.n=1;break}return e.a(2);case 1:n=Date.now(),i=0,a=Array.from(this.uploadMap.keys());case 2:if(!(i<a.length)){e.n=5;break}if(o=a[i],s=this.uploadMap.get(o)){e.n=3;break}return e.a(3,4);case 3:r=_slicedToArray(s,3),l=r[0],c=r[2],n-l>11e3&&(c({status:8}),this.uploadMap["delete"](o));case 4:i++,e.n=2;break;case 5:return d=Array.from(this.uploadMap.keys()),e.p=6,e.n=7,fetchGet(this.getApiUrl(CHAT_SEARCH_API.fileLoop),{knowledgeId:this.options.knowledgeId,fids:d.join(","),tk:this.options.token});case 7:if(u=e.v,p=null==(t=null==u?void 0:u.data)?void 0:t.data){e.n=8;break}return e.a(2);case 8:S=_regeneratorKeys(p);case 9:if((C=S()).done){e.n=11;break}if(h=C.value,f=this.uploadMap.get(h)){e.n=10;break}return e.a(3,9);case 10:m=_slicedToArray(f,3),g=m[1],_=m[2],1===p[h]?g():_({status:8}),this.uploadMap["delete"](h),e.n=9;break;case 11:e.n=20;break;case 12:e.p=12,e.v,v=_createForOfIteratorHelper(d),e.p=13,v.s();case 14:if((b=v.n()).done){e.n=17;break}if(y=b.value,w=this.uploadMap.get(y)){e.n=15;break}return e.a(3,16);case 15:(0,_slicedToArray(w,3)[2])({status:8}),this.uploadMap["delete"](y);case 16:e.n=14;break;case 17:e.n=19;break;case 18:e.p=18,T=e.v,v.e(T);case 19:return e.p=19,v.f(),e.f(19);case 20:return e.p=20,this.uploadMap.size?setTimeout((function(){return k.loop()}),1e3):this.inLoop=!1,e.f(20);case 21:return e.a(2)}}),e,this,[[13,18,19,20],[6,12,20,21]])})))}},{key:"getUploadKnowledgeStatus",value:function(e){return __async(this,null,_regenerator().m((function t(){var n=this;return _regenerator().w((function(t){for(;;)if(0===t.n)return t.a(2,new Promise((function(t,i){return __async(n,null,_regenerator().m((function a(){return _regenerator().w((function(n){for(;;)switch(n.n){case 0:this.uploadMap.set(e,[Date.now(),t,i]),this.inLoop||(this.inLoop=!0,this.loop());case 1:return n.a(2)}}),a,this)})))})))}),t)})))}},{key:"getImageInfo",value:function(e){return __async(this,null,_regenerator().m((function t(){return _regenerator().w((function(t){for(;;)if(0===t.n)return t.a(2,new Promise((function(t,n){var i=new FileReader,a=new Image;i.onload=function(e){a.src=e.target.result},a.onload=function(){t({width:a.width,height:a.height})},a.onerror=function(e){n(new Error("图片加载失败"))},i.onerror=function(){n(new Error("文件读取失败"))},i.readAsDataURL(e)})))}),t)})))}}],[{key:"create",value:function(t){return __async(this,null,_regenerator().m((function n(){var i;return _regenerator().w((function(n){for(;;)if(0===n.n)return i=t.sdk,n.a(2,new e(t,i))}),n)})))}},{key:"resolveImageAccept",value:function(e){return e?imageAccept:imageAcceptBase}},{key:"getOriginFile",value:function(t,n,i){return new Promise((function(a,o){try{var s=document.createElement("input"),r=e.resolveImageAccept(i),l="".concat(r,", ").concat(fileAccept);s.type="file",s.accept="all"===t?l:"image"===t?r:"".concat(fileAccept,", ").concat(codeAccept),s.multiple=n>1,s.onchange=function(e){var t=e.target.files;if(t&&t.length>0){var i=Array.from(t).slice(0,n);a({files:i,exceeded:t.length>n})}else a({files:[],exceeded:!1})},s.click()}catch(r){o(r)}}))}},{key:"uploadAllFile",value:function(t,n){var i=t.files,a=t.fid;return function(){var t=[],o=0,s=function(){if(o>=i.length)return Promise.resolve(t);var r=i.slice(o,o+5).map((function(t){return e.uploadNotRealFileStatic(a,t,n)}));return o+=5,Promise.all(r).then((function(e){return t.push.apply(t,e),s()}))};return s()}()}},{key:"uploadNotRealFileStatic",value:function(e,t,n){return new Promise((function(i,a){var o=JSON.stringify({from:"his",id:t.file_id,name:t.file_name,path:t.file_path||"",size:t.file_size,type:judeFileType(t.file_type)});timeoutFetch(CHAT_SEARCH_API.upload+"?tk=".concat(n),{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:o,mode:"cors"}).then((function(e){var t=e||{},n=t.status,o=t.data;0===n?i(o):a({status:3})}))["catch"]((function(n){console.error("虚拟文件上传失败:",{error:n,fileData:t,fid:e}),a(n)}))}))}}])}();function generateRandomString(){var e="",t=new Uint8Array(6);crypto.getRandomValues(t);for(var n=0;n<6;n++)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"[t[n]%62];return e}function generateHighPrecision(e){var t=Date.now(),n=generateRandomString(),i=null==e?void 0:e.split(".").pop();return btoa("".concat(t).concat(n,".").concat(i))}function stringCamelCase(){return(arguments.length>0&&arguments[0]!==undefined?arguments[0]:"").replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()}))}function judeFileType(e){return fileTypeMap[e]?"file":"image"}var _DeepDecisionPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{list:[],tab_list:[],selectedTab:"all",hoverText:""}}},{key:"attached",value:function(){var e=this;this.ensureSelectedTab(),this.watch("list",(function(){return e.ensureSelectedTab()})),this.watch("tab_list",(function(){return e.ensureSelectedTab()}))}},{key:"ensureSelectedTab",value:function(){var e=this.data.get("tabList")||[],t=this.data.get("selectedTab");e.length?e.some((function(e){return e.tab_id===t}))||this.data.set("selectedTab",e[0].tab_id):this.data.set("selectedTab","")}},{key:"handleTabClick",value:function(e){this.data.set("selectedTab",e)}},{key:"handleItemClick",value:function(e,t){var n,i=e.button_id,a=null==e?void 0:e["function"];if("input"===(null==a?void 0:a.type)){var o=(null==(n=a.data)?void 0:n.input)||{},s=this.normalizeAttachmentList(o.file_list,"file").concat(this.normalizeAttachmentList(o.image_list,"image"));this.fire("click",{inputCustom:null==o?void 0:o.input_custom,fileList:s,functionData:a,functionName:i,functionTab:this.data.get("selectedTab"),index:t})}}},{key:"normalizeAttachmentList",value:function(e,t){var n=this;return Array.isArray(e)?e.map((function(e){return n.normalizeAttachment(e,t)})).filter((function(e){return!!e})):[]}},{key:"normalizeAttachment",value:function(e,t){var n,i="image"===t&&e.imageUrl||e.fileUrl,a="image"===t?e.imageId||e.fileId||e.filePath||i:e.fileId||e.filePath||i;if(!i||!a)return null;var o=e.fileName||this.getFileNameFromUrl(i),s=this.normalizeFileSize(e.fileSize),r=(null==(n=(o||i).match(/\.([^.]+)$/))?void 0:n[1])||"",l="image"===t?e.imageType||e.fileType||r.toUpperCase()||"PNG":e.fileType||getFileType(o||i);return{status:UploadStatus.BOS_SUCCESS,url:i,fileId:a,fileName:o,fileType:l,fileSize:s,filePath:e.filePath,uploadType:t,timeStamp:Date.now(),imageWidth:e.imageWidth,imageHeight:e.imageHeight}}},{key:"normalizeFileSize",value:function(e){return"number"==typeof e?e:"string"==typeof e&&/^\d+$/.test(e)?Number(e):void 0}},{key:"getFileNameFromUrl",value:function(e){var t=e.split("?")[0].split("/").pop()||"";try{return decodeURIComponent(t)}catch(n){return t}}}])}(san.Component);_DeepDecisionPanel.template='\n <div class="ci-deep-decision-panel">\n <div s-if="tabList.length" class="ci-deep-decision-tabs">\n <button\n s-for="tab in tabList"\n type="button"\n class="ci-deep-decision-tab {{selectedTab === tab.tab_id ? \'ci-deep-decision-tab-active\' : \'\'}}"\n on-click="handleTabClick(tab.tab_id)"\n >\n {{tab.tab_name}}\n </button>\n </div>\n <div class="ci-deep-decision-list ci-deep-decision-list-{{displayMode}}">\n <deep-decision-item\n s-for="item, index in filteredList"\n data="{{item}}"\n display-mode="{{displayMode}}"\n on-click="native:handleItemClick(item, index)"\n />\n </div>\n </div>\n ',_DeepDecisionPanel.components={"deep-decision-item":DeepDecisionItem},_DeepDecisionPanel.computed={tabList:function(){var e=this.data.get("tab_list")||[];return e.length?[{tab_id:"all",tab_name:"全部"}].concat(_toConsumableArray(e)):[]},filteredList:function(){var e=this.data.get("list")||[],t=this.data.get("selectedTab");return t&&"all"!==t?e.filter((function(e){return e.tab_id===t})):e},displayMode:function(){return(this.data.get("tab_list")||[]).length?"card":"recommend"}};var DeepDecisionPanel=_DeepDecisionPanel,ChatPanel=function(e){return e.CREATE="office_create",e.PHOTO="photo_editing",e.READ="ai_read",e.TRANSLATE="ai_translate",e.CODE="ai_code",e.PPT="ai_ppt",e.DEEP_RESEARCH="deep_research",e.DEEP_DECISION="deep_decision",e.MUSIC="ai_music_create",e.NUMERO="ai_numerology",e}(ChatPanel||{}),ListenerEventType=function(e){return e.INPUT="input",e.SUG="sug",e.TOOLS="tools",e.OTHER="other",e.PANEL="panel",e}(ListenerEventType||{}),uploadFileMaxNum=10,uploadImageMaxNum=10,UploadActionType={SELECT_FILE:"select_file",PASTE:"paste",DRAG:"drag"},FILE_ICON_PREFIX="https://psstatic.cdn.bcebos.com/basics/",VALID_FILE_ICONS={PDF:FILE_ICON_PREFIX+"aichat/pdf_1779880204000.png",Word:FILE_ICON_PREFIX+"aichat/word_1779880138000.png",PPT:FILE_ICON_PREFIX+"aichat/ppt_1779880234000.png",TXT:FILE_ICON_PREFIX+"aichat/txt_1779880276000.png",Excel:FILE_ICON_PREFIX+"aichat/excel_1779880300000.png",Code:FILE_ICON_PREFIX+"aichat/code_1753701401000.png",MD:FILE_ICON_PREFIX+"aichat/md_1775804217000.png",XML:FILE_ICON_PREFIX+"aichat/code_1753701401000.png",IMAGE:FILE_ICON_PREFIX+"aichat/image_1780032089000.png",unknown:FILE_ICON_PREFIX+"aichat/unknow_1780031597000.png"},deleteIcon="https://gips2.baidu.com/it/u=3959794902,1704569041&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f40_40",uploadIcon="https://psstatic.cdn.bcebos.com/basics/aichat/pc-image-loading-upload_1757305079000.png",loadingIcon="https://gips0.baidu.com/it/u=1698361030,3674932214&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f48_48",reuploadIcon="https://psstatic.cdn.bcebos.com/basics/aichat/image-loading_1757410860000.png",folderIcon="https://psstatic.cdn.bcebos.com/basics/aichat/folder-%20color_1756432409000.png";function getInputType(e){var t=e.getValue(),n=e.getFileList(),i=processQuery(t,n).hasImage;return t?0===n.length?"text":i?"text_pic":"text_file":0===n.length?"blank":i?"pic":"file"}var TransLogService=function(){return _createClass((function e(t){var n=this;_classCallCheck(this,e),this.observed=new WeakSet,this.$input=t,this.observer=new IntersectionObserver((function(e){return n.handleIntersect(e)}),{threshold:[.6]})}),[{key:"observe",value:function(e){this.observed.has(e)||(this.observed.add(e),this.observer.observe(e))}},{key:"scan",value:function(e){var t=this;void 0!==e.getAttribute("data-ci-show-item")&&this.observe(e),Array.from(e.querySelectorAll("[data-ci-show-item]")).forEach((function(e){return t.observe(e)}))}},{key:"handleIntersect",value:function(e){var t=this;e.forEach((function(e){if(!(e.intersectionRatio<.6)){var n=e.target,i=n.getAttribute("data-ci-show-ext");if(i&&!t.closestBlockLog(n)){var a=null;try{a=JSON.parse(i)}catch(s){return}t.send(a)}}}))}},{key:"closestBlockLog",value:function(e){try{for(var t=e;t&&t!==document.body;t=t.parentElement)if(t.hasAttribute("data-block-log")&&"true"===t.dataset.blockLog)return t;return!1}catch(t){return!1}}},{key:"send",value:function(e){this.$input.sendLog("show",e.value,e.ext,!0)}},{key:"unobserve",value:function(e){var t=this;this.observer.unobserve(e),this.observed["delete"](e),Array.from(e.querySelectorAll("[data-ci-show-item]")).forEach((function(e){t.observed.has(e)&&(t.observed["delete"](e),t.observer.unobserve(e))}))}},{key:"destroy",value:function(){this.observer.disconnect()}}])}(),AsyncSequencer=function(){return _createClass((function e(){_classCallCheck(this,e),this.queues={}}),[{key:"wait",value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:100;this.queues[e]||(this.queues[e]=[]);var i={resolve:null,reject:null,timeoutId:null},a=new Promise((function(a,o){i.resolve=a,i.reject=o,i.timeoutId=setTimeout((function(){a(e+" timeout");var n=t.queues[e];if(n){var o=n.findIndex((function(e){return e.resolve===i.resolve}));-1!==o&&n.splice(o,1)}}),n)}));return this.queues[e].push({resolve:function(){var e;i.timeoutId&&clearTimeout(i.timeoutId),null==(e=i.resolve)||e.call(i)},reject:i.reject,promise:a}),a}},{key:"next",value:function(e){var t=this.queues[e];if(t&&0!==t.length){for(;t.length>0;)t.shift().resolve();delete this.queues[e]}}}])}(),panelsMap=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},ChatPanel.CREATE,CreatePanel),ChatPanel.PHOTO,DrawPanel),ChatPanel.DEEP_DECISION,DeepDecisionPanel),ChatPanel.MUSIC,MusicPanel),ChatPanel.NUMERO,NumeroPanel),DEFAULT_PANEL_MODE_NAME="fast",InputApi=function(){return _createClass((function e(t,n){_classCallCheck(this,e),this.currentCmpt=t;var i=n||this.__findRootCmpt();this.rootCmpt=i,i.__initEvent||(i.__initEvent=!0,i.__ciEvent=new EventEmitter,i.__ciEventBinder=new EventsBinder,i.__translogInstance=new TransLogService(this),i.asyncSequencer=new AsyncSequencer)}),[{key:"__findRootCmpt",value:function(){if(this.rootCmpt)return this.rootCmpt;var e=this.currentCmpt;if(e.constructor.__ciroot)return this.rootCmpt=e,e;for(;e.owner;){if(e.owner.constructor.__ciroot)return e.owner;e=e.owner}return null}},{key:"translog",value:function(){return this.rootCmpt.__translogInstance}},{key:"getRootData",value:function(e){return this.rootCmpt.data.get(e)}},{key:"on",value:function(e,t){this.rootCmpt.__ciEvent.on(e,t)}},{key:"emit",value:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];(t=this.rootCmpt.__ciEvent).emit.apply(t,[e].concat(i))}},{key:"off",value:function(e,t){this.rootCmpt.__ciEvent.off(e,t)}},{key:"addEvent",value:function(){var e;(e=this.rootCmpt.__ciEventBinder).add.apply(e,arguments)}},{key:"offEvent",value:function(){var e;(e=this.rootCmpt.__ciEventBinder).clear.apply(e,arguments)}},{key:"setMode",value:function(e){this.rootCmpt.setMode(e)}},{key:"setValue",value:function(e){this.rootCmpt.setValue(e)}},{key:"clearValue",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{keepPrefix:!1};this.rootCmpt.clearValue(e)}},{key:"getValue",value:function(e){return this.rootCmpt.getValue(e)}},{key:"getInputInfo",value:function(){return this.rootCmpt.getInputInfo()}},{key:"isAiEditor",value:function(){return this.rootCmpt.data.get("mode")===AI_MODE}},{key:"getFileType",value:function(){return this.rootCmpt.data.get("fileType")}},{key:"getFileList",value:function(){return this.rootCmpt.getFileList()}},{key:"focus",value:function(e){this.rootCmpt.focus(e)}},{key:"blur",value:function(){this.rootCmpt.blur()}},{key:"trigger",value:function(e,t){this.rootCmpt.trigger(e,t)}},{key:"getModeBtnName",value:function(e){return e||this.rootCmpt.data.get("tools.left.modeSelect.current")||DEFAULT_PANEL_MODE_NAME}},{key:"getPanelApi",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a,o=this;return _regenerator().w((function(n){for(;;)if(0===n.n)return t=this.getModeBtnName(t),i=this.rootCmpt.panelDataMap.get(t),a=(null==i?void 0:i.get(e))||(null==i?void 0:i.get("new_"+e)),n.a(2,(null==a?void 0:a.modeName)===t?a.data:timeoutFetch("https://chat.baidu.com/aichat/api/getChatTools?type="+e).then((function(n){var i=n.data;if(!i||0!==n.status)return Promise.reject(new Error("status erro"));var a=o.rootCmpt.panelDataMap.get(t)||new Map;return a.set(e,{modeName:t,data:i}),o.rootCmpt.panelDataMap.set(t,a),i})))}),n,this)})))}},{key:"openPanel",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a,o,s,r,l;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:return i=this.rootCmpt.ref("panel"),a=this.getModeBtnName(),this.sendLog("click","capsule_bub"),t.n=1,this.getPanelData(e,a);case 1:if(o=t.v,s=o.panel,r=o.panelPropsData,l=o.externalProps,this.emit(EVENTS.SET_PLACEHOLDER,(null==r?void 0:r.place_holder)||"问我任何问题"),panelsMap[s.type]||(null==(n=null==r?void 0:r.list)?void 0:n.length)){t.n=2;break}return t.a(2,(this.detachPanel(),void this.rootCmpt.closePanel({})));case 2:return t.n=3,this.renderPanelFromSanComponent(i,s.type,r,__spreadProps(__spreadValues({},l),{curUploadType:this.getFileType(),position:this.rootCmpt.data.get("panels.position")}),a);case 3:this.emit(EVENTS.PANEL_OPEN,{panel:s,externalProps:l}),this.rootCmpt.data.set("initialFocus",!0),this.rootCmpt.handlePanelChange({open:!0});case 4:return t.a(2)}}),t,this)})))}},{key:"getPanelData",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a,o,s,r,l,c,d,u=this;return _regenerator().w((function(n){for(;;)switch(n.n){case 0:return t=this.getModeBtnName(t),l=e.replace(/^new_/,""),n.n=1,this.getPanelApi(l,t);case 1:if(c=n.v,this.currentPanelType=e,c){n.n=2;break}return n.a(2,Promise.reject(new Error("data null")));case 2:return d=(null==(a=null==(i=null==c?void 0:c.jump_panel)?void 0:i.data)?void 0:a[e])||(null==(s=null==(o=null==c?void 0:c.jump_panel)?void 0:o.data)?void 0:s["new_"+e])||{},n.a(2,([{key:"musicOptions",value:c.musicOptions},{key:"translateOption",value:c.translateOption}].forEach((function(e){var t=e.key,n=e.value||u.rootCmpt.data.get("panels.panelOptions.".concat(t));n&&u.rootCmpt.initPanelOptions(t,n)})),Object.assign(d,{"function":null==(r=c.data)?void 0:r["function"],hoverText:d.hover_text}),{panel:__spreadProps(__spreadValues({},c),{type:l}),panelPropsData:d,externalProps:{}}))}}),n,this)})))}},{key:"setAiPlaceholder",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a;return _regenerator().w((function(n){for(;;)switch(n.n){case 0:return t=this.getModeBtnName(t),n.n=1,this.getPanelData(e,t);case 1:i=n.v,a=i.panelPropsData,this.emit(EVENTS.SET_PLACEHOLDER,(null==a?void 0:a.place_holder)||"问我任何问题");case 2:return n.a(2)}}),n,this)})))}},{key:"closePanel",value:function(){this.rootCmpt.closePanel()}},{key:"detachPanel",value:function(){var e,t=this.rootCmpt.currentPanelInstance;t&&(null==(e=t.dispose)||e.call(t),this.rootCmpt.currentPanelInstance=null)}},{key:"uploadFile",value:function(e){this.rootCmpt.uploadFile(e)}},{key:"getBaidubceSdk",value:function(){return this.rootCmpt.__baidubceSdkPromise()}},{key:"getVoiceController",value:function(){return this.rootCmpt.voiceController}},{key:"wait",value:function(e){return __async(this,null,_regenerator().m((function t(){return _regenerator().w((function(t){for(;;)if(0===t.n)return t.a(2,this.rootCmpt.asyncSequencer.wait(e))}),t,this)})))}},{key:"next",value:function(e){this.rootCmpt.asyncSequencer.next(e)}},{key:"sendLog",value:function(e,t,n){var i,a=arguments.length>3&&arguments[3]!==undefined&&arguments[3],o=this.rootCmpt.data,s={};if(o.get("scene")!==AI_SCENE&&o.get("mode")!==AI_MODE)Object.assign(s,{is_query_over:this.rootCmpt.queryOverShow()?"1":"0",aisou_btn:o.get("mode")===AI_MODE?"1":"0",aisou_text:"问AI",is_log:o.get("user.isLogin")?"1":"0",query:this.rootCmpt.getValue()});else{var r=this.rootCmpt.getToolInfo("left","model")||{},l=this.rootCmpt.getInputInfo(),c=o.get("tools.left.modeSelect");Object.assign(s,__spreadValues({query:this.rootCmpt.getValue(),function_type:(null==(i=l.prefix)?void 0:i.type)||"",is_online:r.internetSearch?"1":"0",is_deepsearch:r.deepSearch?"1":"0",position:"top"===o.get("panels.position")?"bottom":"top"},c?{mode:c.current,model:r.modelName}:{}))}var d={type:e,value:t,ext:__spreadValues(__spreadProps(__spreadValues({},s),{file_status:getInputType(this),file_type:this.getFileType()}),n)};a?this.currentCmpt.fire(FIRE_EVENTS.SEND_LOG,d):this.currentCmpt.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SEND_LOG,data:d})}},{key:"renderPanelFromSanComponent",value:function(e,t,n){return __async(this,arguments,(function(e,t,n){var i=this,a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},o=arguments.length>4?arguments[4]:undefined;return _regenerator().m((function s(){var r,l,c,d,u,p,h,f,m,g,_,v;return _regenerator().w((function(s){for(;;)switch(s.p=s.n){case 0:if(o=i.getModeBtnName(o),l=e){s.n=1;break}return s.a(2,Promise.reject(new Error("panelWrapper null")));case 1:if(c=i.rootCmpt.el.clientWidth,d=__spreadProps(__spreadValues(__spreadValues({},n||{}),a||{}),{panelWidth:c}),u=i.rootCmpt.currentPanelInstance,p=null==u?void 0:u.el,h=p&&l.contains(p),!u||i.rootCmpt.__moduleName!==t||i.rootCmpt.__moduleModeName!==o||!h){s.n=2;break}return s.a(2,(u.data&&"function"==typeof u.data.set&&Object.keys(d).forEach((function(e){u.data.set(e,d[e])})),i.rootCmpt.handlePanelChange({open:!0}),Promise.resolve()));case 2:return(f=e.querySelector(".ci-panel-container"))&&f.remove(),(m=document.createElement("div")).className="ci-panel-container",s.p=3,g=panelsMap[t]||SnapTextPanel,u&&(null==(r=u.dispose)||r.call(u),i.rootCmpt.currentPanelInstance=null,m.innerHTML=""),_=new g({data:d}),s.a(2,(_.$input=i.rootCmpt.$input,_.on("click",(function(e){var n=e.inputCustom,a=Array.isArray(e.fileList)?e.fileList:void 0;if(n){var o={show:!0,type:t,functionName:e.functionName,functionTab:e.functionTab};e.usedModel&&(o.commonData={usedModel:e.usedModel}),i.setValue({value:e.inputCustom,prefix:o})}a&&i.rootCmpt.setState("fileList",(function(){return a})),i.sendLog("click","function_panel",{function_tab:i.currentPanelType,function_name:e.functionName,agent_id:"",agent_name:"",valueInfo:[{function_click_type:"text",function_name:e.functionName,function_pos:e.index,agent_id:"",agent_name:""}],trigger_type:"search_box"}),"pic-tool"===e.clickType&&i.currentCmpt.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.DRAWPANEL_TOOL_CLICK,data:__spreadValues({},e)})})),_.attach(m),l.appendChild(m),i.rootCmpt.currentPanelInstance=_,i.rootCmpt.__moduleName=t,i.rootCmpt.__moduleModeName=o,Promise.resolve()));case 4:return s.p=4,v=s.v,s.a(2,(console.error("面板加载失败",v),Promise.reject(new Error("panel load error"))))}}),s,null,[[3,4]])}))()}))}},{key:"updatePanelProps",value:function(e){var t=this.rootCmpt.currentPanelInstance;t&&t.data&&"function"==typeof t.data.set&&Object.keys(e).forEach((function(n){t.data.set(n,e[n])}))}}])}(),_ApiCmpt=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"created",value:function(){this.$input=new InputApi(this)}}])}(san.Component);_ApiCmpt.template="";var ApiCmpt=_ApiCmpt,SafeLimitMap={mobile:{welt:9,padding:9},pc:{welt:16,padding:8}},MARGIN=15,TOOLTIP_GAP=8,Main$k=(_c=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{content:"",position:"top",open:!1,getPopupContainer:null,bubbleClass:"",_ownerEl:null,_tipPosition:{}}}},{key:"open",value:function(){this.data.set("_tipPosition",{});var e=this.data.get("_ownerEl"),t=this.data.get("position"),n=this.data.get("getPopupContainer"),i=n?n():document.body,a=i===document.body,o=this.ref("arrow").getBoundingClientRect(),s=i.getBoundingClientRect(),r=e.getBoundingClientRect();if(r.height&&r.width){var l=this.el.getBoundingClientRect(),c=this.getPlacements(s,r,l,o,t,!0,a);this.data.set("_tipPosition",c),this.data.set("open",!0)}}},{key:"hide",value:function(){this.data.set("open",!1)}},{key:"getVisibleHeight",value:function(e,t){var n=window.innerHeight;if(t)return n;var i=e.top,a=e.bottom;if(i>=n||a<=0)return 0;var o=Math.max(i,0);return Math.min(a,n)-o}},{key:"getPlacements",value:function(e,t,n,i,a,o,s){var r,l,c={top:t.top-e.top,left:t.left-e.left,bottom:t.bottom-e.top,right:t.right-e.left,width:t.width,height:t.height},d=this.data.get("_platform"),u=n.width,p=n.height,h=null,f=null,m=null,g=null,_=null;switch(a){case"top-start":case"bottom-start":h=c.left,_=e.width-c.left,m=MARGIN;break;case"top-end":case"bottom-end":f=e.width-c.right,_=c.right,g=MARGIN;break;case"left-start":case"left":case"left-end":f=e.width-c.left+TOOLTIP_GAP,_=c.left;break;case"right-start":case"right":case"right-end":h=c.right+TOOLTIP_GAP,_=e.width-c.right;break;default:h=c.left+c.width/2-u/2,_=e.width;var v=n.width/2-i.width/2-MARGIN,b=n.width+h,y=0;h<0?y=h<-v?v:-h:b>e.width&&(y=e.width-b<-v?-v:e.width-b),h+=y,m=u/2-y-i.width/2;var w=e.left-document.body.getBoundingClientRect().left+h,S=Math.abs(document.body.scrollWidth-e.left-h-n.width);e.left>=0&&w<SafeLimitMap[d].welt?(h+=SafeLimitMap[d].welt-w,m-=SafeLimitMap[d].welt-w):S<SafeLimitMap[d].welt&&(h-=SafeLimitMap[d].welt-S,m+=SafeLimitMap[d].welt-S)}var C=null,T=null,k=null,x=null;switch(a){case"top-start":case"top":case"top-end":var E=Number(null==(l=null==(r=getComputedStyle(this.el))?void 0:r.paddingBottom)?void 0:l.split("px")[0])||0;E=0===E?SafeLimitMap[d].padding:0,C=c.top-n.height-E-TOOLTIP_GAP,T=c.top,T=e.top<0?T+e.top:T;break;case"bottom-start":case"bottom":case"bottom-end":C=c.bottom+TOOLTIP_GAP,T=this.getVisibleHeight(e,s)-c.bottom,T=e.top<0?T-e.top:T;break;case"left-start":case"right-start":C=c.top,T=this.getVisibleHeight(e,s)-c.top,T=e.top<0?T-e.top:T,k=MARGIN;break;case"left":case"right":C=c.top+c.height/2-p/2,T=this.getVisibleHeight(e,s);var I=n.height/2-i.width/2-MARGIN,L=e.top<0?C+e.top:C,A=0;L<0?A=L<-I?I:-L:T-L<n.height&&(A=(A=T-L-n.height)<-I?-I:A),C+=A,k=p/2-i.height/2-A;break;default:C=c.bottom-n.height,T=c.bottom,T=e.top<0?T+e.top:T,x=MARGIN}var P="",D=a.split("-"),N=a.includes("top")||a.includes("bottom");if(_<u&&(N?(a.includes("end")||a.includes("start"))&&(P=a.includes("end")?"start":"end",D=(P="".concat(D[0],"-").concat(P)).split("-")):(P=a.includes("left")?"right":"left",D=(P+=D[1]?"-".concat(D[1]):"").split("-"))),T<p&&(N?(P=a.includes("top")?"bottom":"top",P+=D[1]?"-".concat(D[1]):""):(a.includes("end")||a.includes("start"))&&(P=a.includes("end")?"start":"end",P="".concat(D[0],"-").concat(P))),P&&o){var M=this.getPlacements(e,t,n,i,P,!1,s),O=P.split("-")[1],B=D[1]&&O[1]&&D[1]!==O[1];if(N&&M.availableHeight>T||N&&B&&M.availableHeight===T||!N&&M.availableWidth>_||!N&&B&&M.availableWidth===_)return M}return{position:a,left:h,right:f,top:C,bottom:null,availableHeight:T,availableWidth:_,arrowTop:k,arrowRight:g,arrowBottom:x,arrowLeft:m}}}])}(san.Component),_c.template='\n <div\n class="ci-tooltip ci-tooltip-trigger{{bubbleClass ? \' \' + bubbleClass : \'\'}} {{_tipPosition.position | direction}}\n {{open ? \'\' : \' ci-tooltip-trigger-hidden\'}}"\n style="top:{{_tipPosition.top}}px;\n bottom:{{_tipPosition.bottom}}px;\n left:{{_tipPosition.left}}px;\n right:{{_tipPosition.right}}px;"\n >\n <div class="ci-tooltip-content">\n <template s-if="isArray">\n <div s-for="item, index in content">{{item}}</div>\n </template>\n <span s-else>{{content}}</span>\n <slot s-if="!content"></slot>\n </div>\n <div\n s-ref="arrow"\n class="ci-tooltip-arrow"\n style="top:{{_tipPosition.arrowTop}}px;\n right:{{_tipPosition.arrowRight}}px;\n bottom:{{_tipPosition.arrowBottom}}px;\n left:{{_tipPosition.arrowLeft}}px;"\n >\n </div>\n </div>\n ',_c.trimWhitespace="all",_c.filters={direction:function(e){return"ci-tooltip-".concat(null==e?void 0:e.split("-")[0])}},_c.computed={isArray:function(){return Array.isArray(this.data.get("content"))}},_c);function isInShadow(e){for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1}var Main$j=(_d=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{content:"",trigger:"hover",position:"top",disabled:!1,openDelay:0,closeDelay:0,open:!1,getPopupContainer:null,_ownerEl:null,_hoverTarget:!1,_hoverTooltip:!1,_platform:"pc",bubbleClass:""}}},{key:"attached",value:function(){var e=this,t=this.el;this.beforeClose=debounce(this.beforeClose.bind(this),10),this.data.set("_ownerEl",t),"custom"===this.data.get("trigger")?(this.data.get("open")&&this.beforeOpen(),this.watch("open",(function(t){t?e.beforeOpen():e.beforeClose()}))):this.data.get("disabled")||this.addListener(t),this.watch("disabled",(function(n){n?(e.close(),e.removeListener()):e.addListener(t)}));var n=this.data.get("getPopupContainer");n&&n()!==document.body||(this.pagePositionChange=function(){var t;e.data.get("open")&&(null==(t=e.tooltip)||t.open())},"mobile"===this.data.get("_platform")?window.addEventListener("app_font_change",this.pagePositionChange):window.addEventListener("resize",this.pagePositionChange))}},{key:"addListener",value:function(e){var t=this,n=this.data.get("trigger");"click"===n?(this.click=function(e){t.handleClick(e)},document.addEventListener("click",this.click)):"hover"===n&&(this.mouseenter=function(){t.data.set("_hoverTarget",!0),t.beforeOpen()},this.mouseleave=function(){t.data.set("_hoverTarget",!1),t.beforeClose()},e.addEventListener("mouseenter",this.mouseenter),e.addEventListener("mouseleave",this.mouseleave))}},{key:"removeListener",value:function(){this.clearDelayTimer();var e=this.data.get("trigger");if("click"===e&&this.click)document.removeEventListener("click",this.click);else if("hover"===e&&this.mouseenter&&this.mouseleave){var t=this.el;null==t||t.removeEventListener("mouseenter",this.mouseenter),null==t||t.removeEventListener("mouseleave",this.mouseleave)}}},{key:"detached",value:function(){this.removeListener(),this.pagePositionChange&&("mobile"===this.data.get("_platform")?window.removeEventListener("app_font_change",this.pagePositionChange):window.removeEventListener("resize",this.pagePositionChange))}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"toggle",value:function(){this.data.get("open")?this.beforeClose():this.beforeOpen()}},{key:"close",value:function(){var e;null==(e=this.tooltip)||e.hide(),this.data.get("open")&&(this.fire("toggle",!1),this.data.set("open",!1))}},{key:"open",value:function(){this.tooltip?this.tooltip.open():this.createTooltipTrigger(),this.fire("toggle",!0),this.data.set("open",!0)}},{key:"createTooltipTrigger",value:function(){var e,t=this;this.tooltip=new Main$k({owner:this,source:'\n <cos-tooltip-trigger\n content="{{content}}"\n position="{{position}}"\n bubbleClass="{{bubbleClass}}"\n getPopupContainer="{{getPopupContainer}}"\n _ownerEl="{{_ownerEl}}"\n _platform="{{_platform}}"\n >\n <slot name="content"></slot>\n </cos-tooltip-trigger>\n '});var n=this.data.get("getPopupContainer"),i=n?n():document.body;this.tooltip.attach(i);var a=null==(e=this.tooltip)?void 0:e.el;"hover"===this.data.get("trigger")&&(null==a||a.addEventListener("mouseenter",(function(){t.data.set("_hoverTooltip",!0),t.beforeOpen()})),null==a||a.addEventListener("mouseleave",(function(){t.data.set("_hoverTooltip",!1),t.beforeClose()}))),this.nextTick((function(){var e;null==(e=t.tooltip)||e.open()}))}},{key:"delaySetTooltipVisible",value:function(e,t){this.delayTimer=setTimeout((function(){t()}),e)}},{key:"beforeOpen",value:function(){var e=this;if("custom"!==this.data.get("trigger")&&this.data.get("open")||this.data.get("disabled"))return!0;this.clearDelayTimer();var t=this.data.get("openDelay");t?this.delaySetTooltipVisible(t,(function(){var t=e.data.get("trigger");("hover"===t&&e.data.get("_hoverTarget")||"hover"!==t)&&e.open()})):this.open()}},{key:"beforeClose",value:function(){var e=this;if(!("custom"!==this.data.get("trigger")&&!this.data.get("open")||this.data.get("_hoverTooltip")||this.data.get("_hoverTarget"))){var t=this.data.get("closeDelay");this.clearDelayTimer(),t?this.delaySetTooltipVisible(t,(function(){e.close()})):this.close()}}},{key:"handleClick",value:function(e){var t=this.el,n=e.target;if(!this.data.get("disabled")){if(isInShadow(t)){var i=e.composedPath();n=i&&i[0]}(null==t?void 0:t.contains)&&(null==t?void 0:t.contains(n))?this.toggle():this.beforeClose()}}},{key:"updatePosition",value:function(){var e;this.data.get("open")&&(null==(e=this.tooltip)||e.open())}}])}(san.Component),_d.template='\n <span class="ci-tooltip">\n <slot />\n </span>\n ',_d.trimWhitespace="all",_d),_DrawRatio=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{drawData:{}}}},{key:"handleBtnClick",value:function(e){this.fire("btn-click",__spreadValues({optionType:"ratio"},e)),this.$input.sendLog("click","searchbox_createpic_ratio",{button_text:e.text})}}])}(ApiCmpt);_DrawRatio.template='\n <div class="draw-ratio-wrapper">\n <div class="draw-ratio-title">选择比例</div>\n <div class="draw-ratio-content-wrapper">\n <fragment s-for="item in drawData.data">\n <div\n class="draw-ratio-content-item\n {{activeValue.text === item.text ? \'draw-ratio-content-item-active\' : \'\'}}"\n on-click="handleBtnClick(item)"\n >\n <img src="{{item.icon}}" alt="">\n <span>{{item.text}}</span>\n </div>\n </fragment>\n </div>\n </div>\n ';var DrawRatio=_DrawRatio,_DrawRecommend=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{drawData:{data:[]}}}},{key:"handleBtnClick",value:function(e,t){this.fire("btn-click",{optionType:"recommend",text:e}),this.$input.sendLog("click","searchbox_createpic_recom",{recom_word_type:t,button_text:e})}}])}(ApiCmpt);_DrawRecommend.template='\n <div class="draw-recommend-wrapper">\n <div class="draw-recommend-title">推荐词</div>\n <div class="draw-recommend-content-container">\n <fragment s-for="itemData in drawData.data">\n <div class="draw-recommend-content-wrapper">\n <div>{{itemData.text}}</div>\n <div\n class="draw-recommend-content"\n >\n <fragment s-for="word in itemData.recommendData">\n <span\n class="draw-recommend-content-text"\n on-click="handleBtnClick(word, item.text)"\n data-click-log="{{ubcClickLog(itemData.text, word)}}"\n >\n {{word}}\n </span>\n </fragment>\n </div>\n </div>\n </fragment>\n </div>\n </div>\n ';var DrawRecommend=_DrawRecommend;function splitArrayToN(e,t){for(var n=[],i=0;i<e.length;i+=t)n.push(e.slice(i,i+t));return n}var _DrawStyle=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{drawStyleData:[[]]}}},{key:"attached",value:function(){this.data.set("drawStyleData",splitArrayToN(this.data.get("drawData.data"),6))}},{key:"handleBtnClick",value:function(e){this.fire("btn-click",__spreadValues({optionType:"style"},e)),this.$input.sendLog("click","searchbox_createpic_ratio",{button_text:e.text})}}])}(ApiCmpt);_DrawStyle.template='\n <div class="draw-style-wrapper" >\n <div class="draw-style-title">选择风格</div>\n <div class="draw-style-content-wrapper">\n <div s-for="itemList in drawStyleData" class="draw-style-content-list">\n <fragment s-for="item in itemList">\n <div\n class="draw-style-content-item"\n on-click="handleBtnClick(item)"\n >\n <div\n class="draw-style-content-item-img\n {{item.text === activeValue.text ? \'draw-style-content-item-img-active\' :\'\'}}"\n >\n <img src="{{item.icon}}" alt="">\n </div>\n <span\n class="draw-style-content-item-text\n {{item.text === activeValue.text ? \'draw-style-content-item-text-active\' : \'\'}}"\n >\n {{item.text}}\n </span>\n </div>\n </fragment>\n </div>\n </div>\n </div>\n ';var DrawStyle=_DrawStyle,drawButtonsComponents={style:"cs-input-style",ratio:"cs-input-ratio",recommend:"cs-input-recommend"},DrawButtons$1=(_e=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{drawButtonsComponents:drawButtonsComponents,open:"",downImg:"https://psstatic.cdn.bcebos.com/aife/image/12_12_1760441491000.png",upImg:"https://psstatic.cdn.bcebos.com/aife/static/cc_1760512076000.png",useNewArrow:!1,isShrink:!1,drawData:{}}}},{key:"attached",value:function(){this.abortController=new AbortController,this.handleWindowResizeThrottle=throttle(this.handleWindowResize.bind(this),100)}},{key:"detached",value:function(){var e;window.removeEventListener("resize",this.handleWindowResizeThrottle),null==(e=this.abortController)||e.abort(),this.abortController=null}},{key:"handleTooltipChange",value:function(e){var t=this.data.get("open");t===e?this.closeTooltip(e):(t&&this.closeTooltip(t),this.openTooltip(e))}},{key:"openTooltip",value:function(e){var t,n=this;if(null==(t=this.abortController)||t.abort(),this.abortController=new AbortController,this.data.get("open")!==e){var i=this.data.get("open");i&&this.closeTooltip(i),this.data.set("open",e),document.addEventListener("click",(function(t){var i=document.querySelector("#draw-tooltip-".concat(e)),a=t.target.closest("#draw-button-container-".concat(e));!i||i.contains(t.target)||a||n.closeTooltip(e)}),{capture:!0,signal:this.abortController.signal}),this.nextTick((function(){return n.handleTooltipPosition(e)}))}}},{key:"closeTooltip",value:function(e){var t;this.data.get("open")===e&&(this.data.set("open",""),null==(t=this.abortController)||t.abort(),this.abortController=null)}},{key:"handleDrawBtnClick",value:function(e){"recommend"!==e.optionType&&this.closeTooltip(e.optionType),this.dispatch("ui:draw-button-click",e)}},{key:"handleTooltipPosition",value:function(e){var t=this.el.closest(".draw-buttons-wrapper").querySelector("#draw-tooltip-".concat(e)),n=this.el.closest(".ci-container"),i=this.el.closest(".input-sticky-bottom, [input-sticky-bottom]");if(t&&n&&"top"===this.data.get("drawData.position")){var a="recommend"===e;t.style.position=a?"fixed":"absolute",t.style.bottom=a&&!i?"auto":"calc(100% + 6px)",t.style.top="auto",t.style.left="auto",t.style.right="auto";var o=n.getBoundingClientRect();a&&!i&&(t.style.top=o.top-t.offsetHeight-4+"px")}}},{key:"handleWindowResize",value:function(){var e=this.data.get("open");e&&this.handleTooltipPosition(e)}},{key:"handleBtnClick",value:function(e){this.$input.sendLog("click","searchbox_createpic_func",{button:e})}},{key:"handleClick",value:function(e){e.stopPropagation()}}])}(ApiCmpt),_e.template='\n <div class="draw-buttons-wrapper {{isShrink ? \'draw-buttons-wrapper-compact\' : \'\'}}" on-click="handleClick">\n <fragment s-for="item,index in drawButtonsData">\n <div\n class="draw-button-area"\n on-click="handleBtnClick(item.optionType)"\n >\n <tooltip\n content="{{toolTipContentArr[index]}}"\n position="top"\n disabled="{{!isShrink || open}}"\n >\n <div\n id="{{\'draw-button-container-\' + item.optionType}}"\n class="draw-button-container\n {{open === item.optionType ? \'draw-button-container-active\' : \'\'}}"\n on-click="handleTooltipChange(item.optionType)"\n >\n <img\n data-exclude-filter="false"\n class="shrink-draw-button shrink-show"\n src="{{item.icon}}"\n >\n <div class="draw-buttons-text shrink-hide">\n {{drawButtonActiveValue[item.optionType].text || item.defaultText}}\n </div>\n <svg\n s-if="useNewArrow"\n class="{{$style[\'draw-button-icon\']}} shrink-hide"\n width="12"\n height="12"\n viewBox="0 0 12 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n aria-hidden="true"\n >\n <path d="M10.4435 4.4248L7.29114 7.57617C6.58809 8.27853 5.44892 8.27801 4.74622 7.5752L1.59583 4.42383L2.44348 3.57617L5.59485 6.72656C5.82911 6.96086 6.20914 6.96172 6.44348 6.72754L9.59583 3.5752L10.4435 4.4248Z" fill="currentColor" />\n </svg>\n <img\n s-else\n data-exclude-filter="false"\n class="{{$style[\'draw-button-icon\']}} shrink-hide"\n src="{{position === \'bottom\' ?\n open === item.optionType ? upImg : downImg\n : open === item.optionType ? downImg : upImg\n }}"\n >\n </div>\n </tooltip>\n <div\n id="{{\'draw-tooltip-\' + item.optionType}}"\n s-is="{{drawButtonsComponents[item.optionType]}}"\n s-show="{{open === item.optionType}}"\n class="draw-button-tooltip\n {{\'draw-button-tooltip-\' + tooltipPosition}}\n {{item.optionType === \'recommend\' ? \'draw-button-tooltip-recommend\' : \'\'}}"\n drawData="{{item}}"\n active-value="{{drawButtonActiveValue[item.optionType]}}"\n on-btn-click="handleDrawBtnClick"\n ></div>\n </div>\n </fragment>\n </div>\n ',_e.components={tooltip:Main$j,"cs-input-ratio":DrawRatio,"cs-input-recommend":DrawRecommend,"cs-input-style":DrawStyle},_e.computed={tooltipPosition:function(){return this.data.get("drawData.position")||"bottom"},toolTipContentArr:function(){return(this.data.get("drawButtonsData")||[]).map((function(e){return("recommend"===e.optionType?"":"选")+e.defaultText}))}},_e),_DrawButtons=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{drawButtonsData:[],drawButtonActiveValue:{style:{},ratio:{},recommend:{}},openPanelType:"",drawData:{}}}},{key:"attached",value:function(){var e=this;this.listenDrawButton=function(t){if("init"===t.type)e.data.set("drawButtonsData",t.pictureOptions);else if("show"===t.type){var n=t||{},i=n.openPanelMode,a=void 0===i?"":i,o=n.extData,s=void 0===o?{}:o;e.fire("outside-panel-click",{needShowPlaceholder:!1,openPanelMode:a});var r=s.aiPictureCreate||{};e.handleInvalidDrawData(r)}else"change"===t.type&&e.handleInvalidDrawData(t.drawStyle)}}},{key:"handleDrawButtonClick",value:function(e){switch(e.optionType){case"recommend":var t=this.$input.getValue(),n=t.trim()?","+e.text:e.text;this.$input.setValue(t+n);break;case"style":this.data.set("drawButtonActiveValue.style",e);break;case"ratio":this.data.set("drawButtonActiveValue.ratio",e)}}},{key:"handleInvalidDrawData",value:function(e){var t=this.data.get("drawButtonActiveValue"),n=this.data.get("drawButtonsData"),i={};n.forEach((function(e){i[e.optionType]=e.data}));var a={};Object.keys(e).forEach((function(t){var n=e[t];if(n){var o=(i[t]||[]).find((function(e){return e.text===n}));a[t]=o?{optionType:t,text:o.text,icon:o.icon}:{optionType:t,text:"",icon:""}}})),this.data.set("drawButtonActiveValue",__spreadValues(__spreadValues({},t),a))}},{key:"resetDrawButtonActive",value:function(){this.data.set("drawButtonActiveValue",{style:{},ratio:{},recommend:{}})}},{key:"getDrawInfo",value:function(){return this.data.get("drawButtonActiveValue")}},{key:"detached",value:function(){}}])}(ApiCmpt);_DrawButtons.template='\n <div>\n <cs-draw-button\n draw-buttons-data="{{drawButtonsData}}"\n draw-button-active-value="{{drawButtonActiveValue}}"\n draw-data="{{drawData}}"\n on-btn-click="handleDrawButtonClick"\n is-shrink="{{isShrink}}"\n use-new-arrow="{{useNewArrow}}"\n />\n </div>',_DrawButtons.components={"cs-draw-button":DrawButtons$1},_DrawButtons.computed={drawButtonsData:function(){return this.data.get("drawData").list}},_DrawButtons.messages={"ui:draw-button-click":function(e){this.handleDrawButtonClick(e.value)}};var DrawButtons=_DrawButtons,Main$i=(_f=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{content:"",top:"",bottom:"",maxWidth:"",isShowTooltip:!1,anchor:"center",position:"bottom",showContent:!0,actualPosition:"bottom",autoFlipRightEdge:!1}}},{key:"showTooltip",value:function(){var e=this;this.data.set("actualPosition",this.data.get("position")),this.data.set("isShowTooltip",!0),this.nextTick((function(){e.adjustPosition()})),this.fire("hover",{})}},{key:"adjustPosition",value:function(){if(this.data.get("autoFlipRightEdge")&&"right"===this.data.get("position")){var e=this.ref("content");e&&window.innerWidth-e.getBoundingClientRect().right<24&&this.data.set("actualPosition","left")}}},{key:"hideTooltip",value:function(){this.data.set("isShowTooltip",!1)}}])}(san.Component),_f.template='\n <div\n class="\n ci-tooltip-wrapper\n {{anchor === \'center\' ? \'ci-tooltip-anchor-center\' : \'ci-tooltip-anchor-left\'}}\n "\n >\n <div\n on-mouseenter="showTooltip"\n on-mouseleave="hideTooltip"\n >\n <slot></slot>\n </div>\n <div\n s-if="{{showContent && isShowTooltip && content}}"\n style="{{getTooltipStyle}}"\n s-ref="content"\n class="ci-tooltip-content ci-tooltip-content-{{actualPosition}} {{isShowTooltip ? \'ci-tooltip-visible\' : \'\'}}"\n >\n <span>{{content}}</span>\n </div>\n </div>\n ',_f.trimWhitespace="all",_f.computed={getTooltipStyle:function(){var e=this.data.get("bottom"),t=this.data.get("top"),n=this.data.get("actualPosition"),i=this.data.get("maxWidth"),a="";return e&&"bottom"===n&&(a+="top: ".concat(e,"px;")),t&&"top"===n&&(a+="top: -".concat(t,"px;")),i&&(a+="max-width: ".concat(i,"px;")),a}},_f),Main$h=(_g=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).stopAnimation=null,e.hoverAngle=0,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){var e=function(){var e="border-anim-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8));return{hoverId:"".concat(e,"-hover"),incomeId:"".concat(e,"-income")}}();return{id:"",type:"hover",width:0,height:0,padding:5,borderRadius:0,strokeWidth:1,linerColorConfig:[],hoverAnimationId:e.hoverId,incomeAnimationId:e.incomeId}}},{key:"showIncomeAnimation",value:function(){var e=this,t=this.ref("animation-rect"),n=this.data.get("incomeAnimationId");if(t){var i=null;if(/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)){var a=document.querySelector("#".concat(n)),o=0;i=setInterval((function(){o=(o+2)%360,a.setAttribute("gradientTransform","rotate(".concat(o," .5 .5)"))}),30)}t.setAttribute("stroke","url(#".concat(n,")")),t.style.opacity="1",setTimeout((function(){t.style.transition="opacity 1s ease-in",t.style.opacity="0"}),2500),setTimeout((function(){t.style.opacity="",t.style.transition="",e.switchHoverAnimation(),i&&clearInterval(i)}),3500)}}},{key:"switchHoverAnimation",value:function(){var e=this.ref("animation-rect");if(e){var t=this.data.get("hoverAnimationId");e.setAttribute("stroke","url(#".concat(t,")")),this.data.set("type","hover")}}},{key:"showHover",value:function(){var e=this;if("hover"===this.data.get("type")){var t=this.ref("animation-rect"),n=this.data.get("hoverAnimationId"),i=document.querySelector("#".concat(n));if(t){t.style.transition="400ms ease-in opacity",t.style.opacity="1";var a=.45,o=null,s=!0,r=function(t){o||(o=t);var n=t-o;o=t,s&&(e.hoverAngle=(e.hoverAngle+a*n)%360,null==i||i.setAttribute("gradientTransform","rotate(".concat(e.hoverAngle," .5 .5)"))),s&&requestAnimationFrame(r)};requestAnimationFrame(r),setTimeout((function(){!function(e){a=360/e}(8e3)}),800),this.stopAnimation=function(){s=!1}}}}},{key:"hideHover",value:function(){if("hover"===this.data.get("type")){var e=this.ref("animation-rect");e&&(e.style.transition="160ms ease-in opacity",e.style.opacity="0"),this.stopAnimation&&(this.stopAnimation(),this.stopAnimation=null)}}}])}(san.Component),_g.template='\n <svg\n class="border-animation-svg"\n style="--svg-padding: {{padding}}px"\n width="{{svgWidth}}"\n height="{{svgHeight}}"\n viewBox="0 0 {{svgWidth}} {{svgHeight}}"\n xmlns="http://www.w3.org/2000/svg"\n >\n <defs>\n <linearGradient\n s-if="incomeAnimationId"\n id="{{incomeAnimationId}}"\n x1="0%"\n y1="0%"\n x2="100%"\n y2="0%"\n >\n <template s-for="stopItem in linerColorConfig">\n <stop\n offset="{{stopItem.offset}}"\n stop-color="{{stopItem.color}}"\n stop-opacity="{{stopItem.opacity}}"\n />\n </template>\n <animateTransform\n attributeName="gradientTransform"\n type="rotate"\n dur="3.5s"\n repeatCount="1"\n values="0 0.5 0.5;360 0.5 0.5;540 0.5 0.5;900 0.5 0.5"\n keyTimes="0;0.2857;0.7143;1"\n calcMode="linear"\n fill="freeze"\n />\n </linearGradient>\n\n <linearGradient\n id="{{hoverAnimationId}}"\n x1="0%"\n y1="0%"\n x2="100%"\n y2="0%"\n gradientTransform="rotate(0 .5 .5)"\n >\n <template s-for="stopItem in linerColorConfig">\n <stop\n offset="{{stopItem.offset}}"\n stop-color="{{stopItem.color}}"\n stop-opacity="{{stopItem.opacity}}"\n />\n </template>\n </linearGradient>\n </defs>\n\n <rect\n s-ref="animation-rect"\n x="{{padding}}"\n y="{{padding}}"\n width="{{width}}"\n height="{{height}}"\n fill="none"\n rx="{{borderRadius}}"\n ry="{{borderRadius}}"\n stroke="{{ \'url(#\' + hoverAnimationId + \')\' }}"\n stroke-width="{{strokeWidth}}"\n />\n </svg>\n ',_g.trimWhitespace="all",_g.computed={svgWidth:function(){var e=this.data.get("padding"),t=this.data.get("width");return 2*Number(e)+Number(t)},svgHeight:function(){var e=this.data.get("padding"),t=this.data.get("height");return 2*Number(e)+Number(t)}},_g),_AskAiButton=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{show:!1,tooltipText:"",tooltipTop:48,maxWidth:350,isAiSearch:!1,borderWidth:0,borderHeight:0,borderRadius:12,borderPadding:2,linerColorConfig:[{offset:"0%",color:"#fff",opacity:"1"},{offset:"30%",color:"#fff",opacity:"0.2"},{offset:"60%",color:"#6547FF",opacity:"0.4"},{offset:"90%",color:"#4769FF",opacity:"0.5"},{offset:"100%",color:"#0090FE",opacity:"0.7"}]}}},{key:"attached",value:function(){var e=this;this.nextTick((function(){var t;e.updateBorderSize();var n=e.ref("border");null==(t=null==n?void 0:n.hideHover)||t.call(n)}))}},{key:"updated",value:function(){var e=this;this.nextTick((function(){return e.updateBorderSize()}))}},{key:"handleHover",value:function(){this.fire("hover")}},{key:"handleClick",value:function(){this.fire("click")}},{key:"handleMouseEnter",value:function(){this.updateBorderSize();var e=this.ref("border");this.nextTick((function(){var t;return null==(t=null==e?void 0:e.showHover)?void 0:t.call(e)})),this.$input.sendLog("show","aisou_hover")}},{key:"handleMouseLeave",value:function(){var e,t=this.ref("border");null==(e=null==t?void 0:t.hideHover)||e.call(t)}},{key:"updateBorderSize",value:function(){var e=this.ref("button");if(e){var t=e.offsetWidth,n=e.offsetHeight;t===this.data.get("borderWidth")&&n===this.data.get("borderHeight")||(this.data.set("borderWidth",t),this.data.set("borderHeight",n))}}}])}(ApiCmpt);_AskAiButton.template='\n <div s-if="{{show}}" class="ask-ai-button-wrapper">\n <tooltip\n content="{{tooltipText}}"\n on-hover="handleHover"\n bottom="{{tooltipTop}}"\n max-width="{{maxWidth}}"\n anchor="left"\n >\n <div\n s-ref="button"\n class="aisearch-btn\n {{wenAiButtonIconSample ? \'\' : \'aisearch-btn-wenxin\'}}"\n on-click="handleClick"\n on-mouseenter="handleMouseEnter"\n on-mouseleave="handleMouseLeave"\n >\n <svg\n s-if="wenAiButtonIconSample"\n xmlns="http://www.w3.org/2000/svg"\n width="18"\n height="18"\n viewBox="0 0 18 18"\n fill="currentColor"\n >\n <path\n d="M9.35022 1C9.95062 1 10.5348 1.07134 11.0953 1.20215L10.9371 1.60449L9.23206 2.27734C5.76587 2.34054 2.97522 5.16693 2.97522 8.64746C2.97522 9.5194 3.15036 10.2454 3.32581 10.7539C3.41335 11.0077 3.50003 11.2063 3.56409 11.3398C3.59601 11.4064 3.62299 11.4569 3.64124 11.4912C3.64941 11.5066 3.65598 11.5187 3.66174 11.5293L3.6637 11.5332L3.67542 11.5537C3.67724 11.5572 3.68135 11.5653 3.68616 11.5752C3.68758 11.5781 3.68933 11.583 3.69202 11.5889L3.6969 11.5977C3.69841 11.6005 3.70003 11.6041 3.70178 11.6074C3.70452 11.6126 3.70834 11.6189 3.71155 11.625C3.73338 11.6668 3.76369 11.7275 3.79749 11.8018C3.86422 11.9484 3.94725 12.1575 4.00061 12.4014C4.00765 12.4336 4.0146 12.4647 4.02112 12.4941C4.09124 12.811 4.13046 12.9902 4.13049 13.4395C4.13049 13.7122 4.06465 14.1884 3.93323 14.6572C3.90089 14.7726 3.86175 14.8977 3.81506 15.0254L9.35022 15.0234C12.8319 15.0234 15.6593 12.2325 15.7213 8.76562L16.3932 7.06055L16.7965 6.90137C16.9278 7.46297 16.9996 8.04779 16.9996 8.64941C16.9996 12.874 13.5748 16.2988 9.35022 16.2988L2.76624 16.2998C2.42272 16.2997 2.19847 16.0579 2.12756 15.8271C2.06032 15.6082 2.10261 15.33 2.31213 15.1348C2.44224 15.0134 2.59138 14.7212 2.70569 14.3135C2.8144 13.9257 2.85608 13.5677 2.85608 13.4395C2.85606 13.1291 2.83844 13.0529 2.77698 12.7754C2.77009 12.7443 2.76257 12.7106 2.75452 12.6738C2.72644 12.5455 2.68054 12.425 2.63733 12.3301C2.61619 12.2836 2.59618 12.2445 2.58069 12.2148L2.55823 12.1719C2.55498 12.1657 2.54938 12.1545 2.54358 12.1426C2.54264 12.1407 2.54099 12.1385 2.53967 12.1357C2.53768 12.1321 2.53538 12.1278 2.53284 12.123C2.52796 12.114 2.5227 12.103 2.51624 12.0908C2.49119 12.0438 2.45577 11.9763 2.41467 11.8906C2.33266 11.7196 2.22635 11.476 2.12073 11.1699C1.90961 10.5579 1.69983 9.68977 1.69983 8.64746C1.69983 4.4226 5.12616 1.00023 9.35022 1ZM13.3932 1.35254C13.4911 1.10469 13.8422 1.10463 13.9401 1.35254L14.6588 3.17578C14.6887 3.2514 14.7492 3.31098 14.8248 3.34082L16.6471 4.05957C16.8952 4.15741 16.8951 4.50854 16.6471 4.60645L14.8248 5.3252C14.7491 5.35507 14.6887 5.41546 14.6588 5.49121L13.9401 7.31348C13.8422 7.56158 13.491 7.56158 13.3932 7.31348L12.6744 5.49121C12.6446 5.41546 12.5842 5.35507 12.5084 5.3252L10.6862 4.60645C10.4381 4.5086 10.4381 4.15742 10.6862 4.05957L12.5084 3.34082C12.5841 3.31097 12.6445 3.25144 12.6744 3.17578L13.3932 1.35254Z"\n />\n </svg>\n <img\n s-if="wenAiButtonIconSample"\n class="ci-ask-ai-icon"\n src="https://psstatic.cdn.bcebos.com/aife/static/wenAI_1761814195000.png"\n >\n <img\n s-if="!wenAiButtonIconSample"\n class="ci-ask-wenxin-icon"\n src="https://psstatic.cdn.bcebos.com/basics/aichat/wenwenxin_127_1769511848000.png"\n >\n </div>\n </tooltip>\n <border-animation-svg\n class="ask-ai-button-border"\n s-ref="border"\n width="{{borderWidth}}"\n height="{{borderHeight}}"\n border-radius="{{borderRadius}}"\n padding="{{borderPadding}}"\n liner-color-config="{{linerColorConfig}}"\n />\n </div>\n ',_AskAiButton.components={tooltip:Main$i,"border-animation-svg":Main$h};var AskAiButton=_AskAiButton,Main$g=(_h=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{title:"",optionType:"",musicData:{},activeValue:{}}}},{key:"showActiveItemClass",value:function(e,t){var n=this.data.get("musicData.defaultText"),i=this.data.get("musicData.data"),a=i&&i[0]&&i[0].text||"";return(null==e?void 0:e.text)?e.text===t.text:[a,n].includes(t.text)}},{key:"handleBtnClick",value:function(e){this.fire("btn-click",__spreadValues({optionType:this.data.get("optionType")},e))}}])}(san.Component),_h.trimWhitespace="all",_h.template='\n <div class="music-directive-btn-panel">\n <h3 class="directive-title">\n {{ title }}\n </h3>\n <div class="music-button-panel-container">\n <fragment s-for="item in musicData.data">\n <div\n class="\n music-directive-button\n {{showActiveItemClass(activeValue, item) ? \'music-directive-button-selected\' : \'\'}}\n "\n on-click="handleBtnClick(item)"\n >\n {{ item.text }}\n </div>\n </fragment>\n </div>\n </div>\n ',_h),musicButtonsComponents={musicStyle:"cs-music-tooltip",timbre:"cs-music-tooltip",wordMethod:"cs-music-tooltip"},musicButtonsTitles={musicStyle:"选择曲风",timbre:"选择音色",wordMethod:"选择生成方式"},Main$f=(_i=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{musicButtonData:[],downImg:"https://psstatic.cdn.bcebos.com/aife/image/12_12_1760441491000.png",upImg:"https://psstatic.cdn.bcebos.com/aife/image/upas_1760441610000.png",useNewArrow:!1,musicButtonsComponents:musicButtonsComponents,musicButtonsTitles:musicButtonsTitles,musicButtonActiveValue:{musicStyle:{},timbre:{},wordMethod:{text:"AI写歌词"}},isShrink:!1,musicShrinkImgMap:{wordMethod:"https://gips3.baidu.com/it/u=4278659419,3861171115&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f60_60",timbre:"https://gips3.baidu.com/it/u=3760888329,1025469087&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f60_60",musicStyle:"https://gips2.baidu.com/it/u=485499343,251777994&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f60_60"}}}},{key:"attached",value:function(){var e=this;this.watch("musicButtonActiveValue",(function(t){if(Array.isArray(t)){var n=t.reduce((function(e,t){return t&&t.type&&(e[t.type]=t),e}),{});e.data.set("musicButtonActiveValue",__spreadValues({},n))}}))}},{key:"detached",value:function(){var e;window.removeEventListener("resize",this.listener),null==(e=this.abortController)||e.abort(),this.abortController=null,this.listener=null}},{key:"getFirstOptionText",value:function(e){var t=this.data.get("musicButtonData").find((function(t){return t.optionType===e}));return t&&Array.isArray(t.data)&&t.data[0]&&t.data[0].text||""}},{key:"sendUbcLog",value:function(e,t){}},{key:"openPanel",value:function(e){var t,n=this;if(null==(t=this.abortController)||t.abort(),this.abortController=new AbortController,this.data.get("openType")!==e){var i=this.data.get("openType");i&&this.closePanel(i),this.data.set("openType",e),this.listener=function(t){var i=document.querySelector("#music-panel-".concat(e)),a=t.target.closest("#music-music-button-panel-container-".concat(e));!i||i.contains(t.target)||a||n.closePanel(e)},document.addEventListener("click",this.listener,{capture:!0,signal:this.abortController.signal})}}},{key:"closePanel",value:function(e){var t;this.data.get("openType")===e&&(this.data.set("openType",""),null==(t=this.abortController)||t.abort(),this.abortController=null)}},{key:"handleButtonClick",value:function(e,t){var n=e.optionType,i=this.data.get("openType");this.sendUbcLog("click","searchkuang_option",{function_type:"cys",function_pos:t+1,option_type:n,button_text:e.defaultText}),i===n?this.closePanel(n):(i&&this.closePanel(i),this.openPanel(n))}},{key:"getMusicBtnVal",value:function(e){return(null==e?void 0:e.data[0]).value}},{key:"handleMusicButtonClick",value:function(e){switch(e.optionType){case"musicStyle":this.data.apply("musicButtonActiveValue",(function(t){return __spreadProps(__spreadValues({},t),{musicStyle:e})}));break;case"timbre":this.data.apply("musicButtonActiveValue",(function(t){return __spreadProps(__spreadValues({},t),{timbre:e})}));break;case"wordMethod":this.data.apply("musicButtonActiveValue",(function(t){return __spreadProps(__spreadValues({},t),{wordMethod:e})})),this.data.set("musicPlaceHolder",e.inputPanelText)}}}])}(ApiCmpt),_i.trimWhitespace="all",_i.template='\n <div class="music-buttons-container">\n <fragment s-for="button, index in musicButtonData">\n <tooltip\n content="{{button.defaultText}}"\n position="top"\n disabled="{{!isShrink || openType}}"\n >\n <div\n s-if="!button.notShow"\n id="{{\'music-music-button-panel-container-\' + button.optionType}}"\n class="music-button {{openType === button.optionType ? \'music-button-active\' : \'\'}}"\n on-click="handleButtonClick(button, index)"\n >\n <div id="music-btn-content" class="music-btn-content">\n <img\n class="music-buttons-shrink-img shrink-show"\n src="{{ musicShrinkImgMap[button.optionType] }}"\n />\n <span class="music-button-text shrink-hide">\n {{ musicButtonActiveValue[button.optionType].text | buttonText(button.defaultText) }}\n </span>\n <svg\n s-if="useNewArrow"\n class="music-icon shrink-hide"\n width="12"\n height="12"\n viewBox="0 0 12 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n aria-hidden="true"\n >\n <path d="M10.4435 4.4248L7.29114 7.57617C6.58809 8.27853 5.44892 8.27801 4.74622 7.5752L1.59583 4.42383L2.44348 3.57617L5.59485 6.72656C5.82911 6.96086 6.20914 6.96172 6.44348 6.72754L9.59583 3.5752L10.4435 4.4248Z" fill="currentColor" />\n </svg>\n <img\n s-else\n class="music-icon shrink-hide"\n src="{{openType === button.optionType ? upImg : downImg}}"\n >\n </div>\n <div\n s-is="{{musicButtonsComponents[button.optionType]}}"\n s-show="openType === button.optionType"\n id="{{\'music-panel-\' + button.optionType}}"\n class="music-button-panel"\n open="{{openType === button.optionType}}"\n panel-data="{{button.data}}"\n music-btn-value="{{getMusicBtnVal(button)}}"\n title="{{musicButtonsTitles[button.optionType]}}"\n option-type="{{button.optionType}}"\n music-data="{{button}}"\n active-value="{{musicButtonActiveValue[button.optionType]}}"\n on-btn-click="handleMusicButtonClick"\n />\n </div>\n </tooltip>\n </fragment>\n </div>\n ',_i.filters={buttonText:function(e,t){return[this.getFirstOptionText("musicStyle"),this.getFirstOptionText("timbre")].includes(e)||!e?t:e}},_i.components={"cs-music-tooltip":Main$g,tooltip:Main$j},_i),TASK_MODE_NAME="task",InternetSearch=function(e){return e.OPEN="1",e.CLOSE="0",e}(InternetSearch||{}),ThinkModeStatus=function(e){return e.OPEN="1",e.CLOSE="0",e}(ThinkModeStatus||{}),ModelIdEnum=function(e){return e.DeepSeek="DeepSeek",e.DeepSeek_V4="DeepSeek-V4",e.DeepSeek_V4_Flash="DeepSeek-V4-Flash",e.DeepSeek_R1="DeepSeek-R1",e.ERINE="ERINE",e.ERINE_4_5="ERINE-4.5",e.ERNIE_5_1="ERNIE-5.1",e.ERINE_X1="ERINE-X1",e.SMART_MODE="smartMode",e}(ModelIdEnum||{}),Animations={panel:{enter:function(e,t){if(!e)return t();e.style.transform="translateY(18px)",e.style.opacity="0",e.style.transition="none",setTimeout((function(){if(!e)return t();e.style.transition="all 240ms cubic-bezier(0,0,0.4,1)",e.style.transform="translateY(0)",e.style.opacity="100",setTimeout((function(){e&&t()}),240)}),50)},leave:function(e,t){if(!e)return t();e.style.transition="all 160ms cubic-bezier(0.4,0,1,1)",e.style.transform="translateY(18px)",e.style.opacity="0",setTimeout((function(){e&&t()}),160)}}},_Popover=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).transition=Animations.panel,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{open:!1}}},{key:"attached",value:function(){this.closePopupFn=this.closePopup.bind(this),document.addEventListener("click",this.closePopupFn)}},{key:"detached",value:function(){document.removeEventListener("click",this.closePopupFn)}},{key:"closePopup",value:function(e){if(this.data.get("open")){var t=this.el;this.contains(e,t)||(this.data.set("open",!1),this.fire("close"))}}},{key:"contains",value:function(e,t){var n=e.target;return!(!(null==t?void 0:t.contains)||!(null==t?void 0:t.contains(n)))}}])}(san.Component);_Popover.trimWhitespace="all",_Popover.template='\n <div\n s-if="open"\n class="ci-popover"\n s-transition="transition"\n >\n <slot />\n </div>\n ';var Popover=_Popover,_Switcher=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{checked:!1,size:"md",disabled:!1}}},{key:"swiperClick",value:function(e){if(!this.data.get("disabled")){var t=this.data.get("checked");this.data.set("checked",!t),this.fire("change",{event:e,checked:!t})}}}])}(san.Component);_Switcher.trimWhitespace="all",_Switcher.template="\n <div\n class=\"ci-switcher{{\n disabled ? ' ci-disabled' : ''}}{{\n size === 'md' ? ' ci-md' : ' ci-sm'}}{{\n checked ? ' ci-checked' : ''}}\"\n on-click=\"swiperClick\"\n >\n <div class=\"ci-switcher-slider\"/>\n </div>\n ";var Switcher=_Switcher,Main$e=(_j=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).iconOnlyObserver=null,e.modelChangePending=!1,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{tools:{},scene:"",iconMap:{deepSearch:{active:"https://gips1.baidu.com/it/u=2131022959,2083152099&fm=3028&app=3028&f=PNG&fmt=auto&q=75&size=f60_60",inactive:"https://gips2.baidu.com/it/u=3008689286,1786773582&fm=3028&app=3028&f=PNG&fmt=auto&q=75&size=f48_48"}},popOpen:!1,loadingModel:"",modelAction:{},newInputBox:!1,modelTop:126,indexPage:!1,deepSearchHoverLock:!1,usedModel:{},thinkModeCheck:!1,userThinkModeCheck:!1,internetCheck:!1,deepSearchCheck:!1,iconOnly:!1,isCapsuleInside:!1}}},{key:"inited",value:function(){var e,t,n,i=this.data.get("tools.modelSelect.usedModel")||{};this.data.set("deepSearchCheck","1"===(null==(e=i.modelFunction)?void 0:e.deepSearch));var a=null==(t=i.modelFunction)?void 0:t.thinkMode,o=(null==a?void 0:a.status)===ThinkModeStatus.OPEN;this.data.set("thinkModeCheck",o);var s=i.modelName===ModelIdEnum.SMART_MODE||!!(null==a?void 0:a.disabled);this.data.set("userThinkModeCheck",!s&&o),this.data.set("internetCheck",(null==(n=i.modelFunction)?void 0:n.internetSearch)===InternetSearch.OPEN)}},{key:"attached",value:function(){var e=this;this.data.set("usedModel",this.data.get("tools.modelSelect.usedModel")||{}),this.data.get("capsuleInside")||this.observeIconOnly(),this.watch("deepSearchCheck",(function(t,n){e.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.DEEP_SEARCH_CHANGE,data:{value:t,watcher:n}})})),this.watch("currentModel",(function(t,n){var i;if(null==t?void 0:t.modelName){var a=t.modelName===ModelIdEnum.SMART_MODE?null==(i=n.oldValue)?void 0:i.modelName:t.modelName;e.data.set("showModelName",a),t.modelButton&&e.data.set("targetModelLabel",t.modelButton),e.dispatchModelChange()}})),this.$input.translog().scan(this.el)}},{key:"detached",value:function(){var e;this.$input.translog().unobserve(this.el),null==(e=this.iconOnlyObserver)||e.disconnect(),this.iconOnlyObserver=null}},{key:"observeIconOnly",value:function(){var e,t=this,n=null==(e=this.el)?void 0:e.closest(".ci-root");if(n){var i=function(){var e=n.offsetWidth<=580;e!==t.data.get("iconOnly")&&t.data.set("iconOnly",e)};i(),this.iconOnlyObserver=new ResizeObserver(i),this.iconOnlyObserver.observe(n)}}},{key:"dispatchModelChange",value:function(){var e=this;this.modelChangePending||(this.modelChangePending=!0,Promise.resolve().then((function(){var t;e.modelChangePending=!1;var n=e.data.get("currentModel");if(n&&n.modelName){var i={deepSearch:e.data.get("deepSearchCheck")?"1":"0"};e.data.get("hasThinkMode")?i.thinkMode=__spreadProps(__spreadValues({},(null==(t=n.modelFunction)?void 0:t.thinkMode)||{}),{status:e.data.get("thinkModeCheck")?ThinkModeStatus.OPEN:ThinkModeStatus.CLOSE}):i.internetSearch=e.data.get("internetCheck")?InternetSearch.OPEN:InternetSearch.CLOSE,e.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.MODEL_CHANGE,data:{value:__spreadProps(__spreadValues({},n),{showModelName:e.data.get("showModelName"),modelFunction:i,targetModelLabel:n.modelButton})}})}})))}},{key:"handleClickInputModel",value:function(e){e&&e.stopPropagation(),this.fire("handleBlur")}},{key:"handleChangePopover",value:function(e){var t=this.data.get("open"),n=this.data.get("currentModel");this.sendModelNetworkSelectClick("right"),!t&&(null==n?void 0:n.modelName)&&this.$input.sendLog("show","model_capsule_pop",__spreadValues({current_model:n.modelName},this.getCapsulePanelLogExt())),e&&this.handleClickInputModel(e),this.data.set("modelTop",this.el.closest(".ci-root").clientHeight-9),this.data.set("open",!t),(null==n?void 0:n.modelName)===ModelIdEnum.SMART_MODE&&this.handleToggleModel()}},{key:"handleModelChange",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a,o,s,r,l,c,d,u;return _regenerator().w((function(n){for(;;)switch(n.n){case 0:if(this.handleClickInputModel(e),!(null==t?void 0:t.disabled)){n.n=1;break}return n.a(2);case 1:if(a=t.name,o=this.data.get("usableModel"),s=this.data.get("currentModel"),r=o.filter((function(e){return e.modelName===a}))[0],r&&(null==s?void 0:s.modelName)){n.n=2;break}return n.a(2);case 2:this.data.set("deepSearchCheck",!1),l=!1,r.modelName===s.modelName&&s.modelName!==ModelIdEnum.SMART_MODE?(l=!0,this.setSmartMode()):(c=null==(i=r.modelFunction)?void 0:i.thinkMode,d=__spreadValues({},r.modelFunction),this.data.get("hasThinkMode")?(null==c?void 0:c.disabled)?(this.data.set("thinkModeCheck",c.status===ThinkModeStatus.OPEN),d.thinkMode=c):(u=!!this.data.get("userThinkModeCheck"),this.data.set("thinkModeCheck",u),d.thinkMode=__spreadProps(__spreadValues({},c||{}),{status:u?ThinkModeStatus.OPEN:ThinkModeStatus.CLOSE})):d.internetSearch=this.data.get("internetCheck")?InternetSearch.OPEN:InternetSearch.CLOSE,this.data.set("usedModel",__spreadProps(__spreadValues({},r),{modelFunction:d}))),this.$input.sendLog("click","model_capsule_pop",__spreadValues({current_model:s.modelName,goal_model:l?ModelIdEnum.SMART_MODE:null==t?void 0:t.name},this.getCapsulePanelLogExt()));case 3:return n.a(2)}}),n,this)})))}},{key:"setSmartMode",value:function(){var e=this.data.get("usableModel").filter((function(e){return e.modelName===ModelIdEnum.SMART_MODE}));this.data.set("thinkModeCheck",!1),this.data.set("usedModel",e[0])}},{key:"handleDeepSearchChange",value:function(e){return __async(this,null,_regenerator().m((function t(){var n;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:this.handleClickInputModel(e),this.data.set("open",!1),n=!this.data.get("deepSearchCheck"),this.data.set("deepSearchCheck",n),this.setSmartMode(),this.$input.sendLog("click","deepsearch_btn",{is_open:n?"0":"1"}),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.DEEP_SEARCH_CLICK,data:{value:n}});case 1:return t.a(2)}}),t,this)})))}},{key:"handleToggleModel",value:function(){var e,t=this;this.sendModelNetworkSelectClick("left");var n=this.data.get("currentModel.modelName")===ModelIdEnum.SMART_MODE,i=this.data.get("usableModel"),a=n?(null==(e=i.find((function(e){var n=e.modelTitle;return(e.modelButton||n)===t.data.get("targetModelLabel")})))?void 0:e.modelName)||ModelIdEnum.DeepSeek_R1:ModelIdEnum.SMART_MODE;this.handleModelChange(null,{name:a,disabled:!1}),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.MODEL_CLICK_ALL,data:{value:n}})}},{key:"handleModelThinkMode",value:function(e){var t,n,i=e.checked,a=this.data.get("usedModel");(null==(n=null==(t=null==a?void 0:a.modelFunction)?void 0:t.thinkMode)?void 0:n.disabled)||(this.data.set("thinkModeCheck",i),this.data.set("userThinkModeCheck",i),this.$input.sendLog("click","model_capsule_pop_other",{current_model:a.modelName||"",is_open:i?"1":"0",mode:"think_mode",is_online:this.getIsOnline()}))}},{key:"handleModelInternet",value:function(e){var t=e.checked,n=this.data.get("usedModel");this.data.set("internetCheck",t),this.$input.sendLog("click","model_capsule_pop_online",{current_model:n.modelName||"",is_open:t?"1":"0",mode:"internet_search",is_online:t?"1":"0"})}},{key:"getCapsulePanelLogExt",value:function(){return{mode:this.data.get("hasThinkMode")?"think_mode":"internet_search",is_online:this.getIsOnline()}}},{key:"getIsOnline",value:function(){return this.data.get("hasThinkMode")?this.data.get("thinkModeCheck")?"1":"0":this.data.get("internetCheck")?"1":"0"}},{key:"sendModelNetworkSelectClick",value:function(e){var t=this.data.get("usedModel");this.$input.sendLog("click","ask_model_capsule",{area:e,is_open:this.getIsOnline(),current_model:t.modelName||""})}},{key:"getModelInfo",value:function(){return __spreadProps(__spreadValues({},this.data.get("currentModel")),{deepSearch:this.data.get("deepSearchCheck"),thinkMode:this.data.get("thinkModeCheck"),internetSearch:this.data.get("internetCheck"),showModelName:this.data.get("showModelName")})}}])}(ApiCmpt),_j.template='\n <div\n class="\n model-select-wrapper\n model-select-wrapper-new\n {{indexPage ? \'\' : \'result-page-module-box\'}}\n {{iconOnly ? \'model-select-wrapper-icon-only\' : \'\'}}\n "\n >\n <popover\n open="{=open=}"\n style="{{getModelTop}}"\n >\n <div class="ci-capsules-model-list">\n <div s-for="item, index in modelList">\n <div\n s-if="{{index !== 0}}"\n class="ci-divider ci-capsules-model-list-item-divider">\n </div>\n <div\n class="ci-capsules-model-list-item\n {{ item.disabled ? \'ci-capsules-model-list-item-disabled\' : \'\' }}"\n on-click="handleModelChange($event, item)"\n >\n <div class="ci-capsules-model-list-item-text">\n <div class="ci-capsules-model-list-item-title">{{ item.title }}</div>\n <div class="ci-capsules-model-list-item-desc">{{ item.desc }}</div>\n </div>\n <img\n s-if="item.name === currentModel.modelName"\n src="https://psstatic.cdn.bcebos.com/aife/static/check-circle-fill_1761212501000.svg"\n class="ci-capsules-model-list-item-icon"\n />\n </div>\n </div>\n <div class="ci-divider ci-capsules-model-list-item-divider" />\n <div s-if="{{hasThinkMode}}" class="internet-search-switch">\n <div class="internet-search-switch-label">思考模式</div>\n <tooltip\n content="{{thinkModeDisabledTip}}"\n position="bottom"\n disabled="{{!thinkModeDisabledTip}}"\n >\n <switcher\n size="sm"\n disabled="{{isThinkModeDisabled}}"\n checked="{=thinkModeCheck=}"\n on-change="handleModelThinkMode"\n />\n </tooltip>\n </div>\n <div s-else class="internet-search-switch">\n <div class="internet-search-switch-label">联网搜索</div>\n <switcher\n size="sm"\n disabled="{{currentModel.modelName === \'smartMode\'}}"\n checked="{=internetCheck=}"\n on-change="handleModelInternet"\n />\n </div>\n </div>\n </popover>\n \x3c!--深度搜索按钮--\x3e\n <tooltip\n s-if="{{tools.deepsearch}}"\n content="深度思考"\n position="{{indexPage ? \'bottom\' : \'top\'}}"\n disabled="{{!iconOnly || deepSearchCheck}}"\n >\n <div\n on-click="handleDeepSearchChange"\n class="\n ci-model-button\n cos-space-ml-xxs\n {{\'ci-model-button-\' + (deepSearchCheck ? \'active\' : \'inactive\')}}\n "\n data-ci-show-ext="{{deepsearchBtnShowExt}}"\n data-ci-show-item\n >\n <div\n class="internet-search-icon"\n data-show-ext="{{deepSearchLog}}"\n data-show-area\n >\n <svg\n s-if="{{isCapsuleInside}}"\n class="deep-search-icon"\n width="18"\n height="18"\n viewBox="1.6 1.6 18 18"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <g clip-path="url(#clip0_173_39329)">\n <path d="M4.19223 4.19359C4.96267 3.42323 6.35967 3.20817 8.19802 3.76477C10.006 4.31218 12.0695 5.56742 13.9281 7.42598C15.7866 9.28453 17.0419 11.3481 17.5893 13.156C18.1459 14.9944 17.9308 16.3914 17.1605 17.1618C16.39 17.9322 14.9931 18.1473 13.1547 17.5906C11.3467 17.0432 9.28321 15.788 7.42462 13.9294C5.56604 12.0708 4.31081 10.0074 3.76341 8.19938C3.2068 6.36098 3.42182 4.964 4.19223 4.19359Z" stroke="#333333" stroke-width="1.33"/>\n <path d="M17.1604 4.19321C17.9308 4.96364 18.1458 6.36065 17.5892 8.199C17.0418 10.007 15.7866 12.0705 13.928 13.929C12.0695 15.7876 10.0059 17.0428 8.19798 17.5903C6.35963 18.1469 4.96262 17.9318 4.19219 17.1614C3.42177 16.391 3.20675 14.9941 3.76337 13.1556C4.31078 11.3477 5.56599 9.28419 7.42458 7.4256C9.28317 5.56701 11.3467 4.31179 13.1546 3.76439C14.993 3.20778 16.39 3.42279 17.1604 4.19321Z" stroke="#333333" stroke-width="1.33"/>\n </g>\n <path d="M10.5543 8.74594C10.6161 8.58924 10.838 8.58924 10.8998 8.74594L11.3538 9.89704C11.3727 9.94489 11.4106 9.98278 11.4584 10.0017L12.6095 10.4557C12.7662 10.5175 12.7662 10.7394 12.6095 10.8012L11.4584 11.2552C11.4106 11.2741 11.3727 11.3119 11.3538 11.3598L10.8998 12.5109C10.838 12.6676 10.6161 12.6676 10.5543 12.5109L10.1003 11.3598C10.0814 11.3119 10.0435 11.2741 9.99568 11.2552L8.84458 10.8012C8.68788 10.7394 8.68788 10.5175 8.84458 10.4557L9.99568 10.0017C10.0435 9.98278 10.0814 9.94489 10.1003 9.89704L10.5543 8.74594Z" fill="#333333"/>\n <defs>\n <clipPath id="clip0_173_39329">\n <rect width="21.3526" height="21.3526" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n <svg\n s-else\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n class="deep-search-icon"\n >\n <g clip-path="url(#clip0_316_49520)">\n <g clip-path="url(#clip1_316_49520)">\n <path d="M3.52575 3.62476C4.26327 2.88731 5.62027 2.6644 7.4466 3.21734C9.23872 3.75995 11.2907 5.00646 13.1414 6.85715C14.9921 8.70784 16.2386 10.7599 16.7812 12.552C17.3342 14.3783 17.1113 15.7353 16.3738 16.4728C15.6363 17.2103 14.2793 17.4332 12.453 16.8802C10.6608 16.3376 8.60883 15.0911 6.75814 13.2404C4.90745 11.3898 3.66093 9.33773 3.11833 7.54561C2.56541 5.71927 2.78825 4.36225 3.52575 3.62476Z" stroke="#333333" stroke-width="1.5"/>\n <path d="M16.3733 3.6234C17.1107 4.36093 17.3336 5.71792 16.7807 7.54425C16.2381 9.33637 14.9916 11.3884 13.1409 13.2391C11.2902 15.0898 9.23819 16.3363 7.44607 16.8789C5.61972 17.4318 4.26275 17.2089 3.52521 16.4715C2.78771 15.734 2.56486 14.377 3.1178 12.5506C3.6604 10.7585 4.90691 8.70649 6.7576 6.85579C8.60829 5.00511 10.6603 3.75859 12.4524 3.21599C14.2788 2.66307 15.6358 2.88591 16.3733 3.6234Z" stroke="#333333" stroke-width="1.5"/>\n </g>\n <path d="M10.2359 7.59489C10.1654 7.41629 9.91268 7.41629 9.84224 7.59489L9.2624 9.06508C9.2409 9.11961 9.19774 9.16277 9.14321 9.18428L7.67301 9.76412C7.49441 9.83455 7.49441 10.0873 7.67301 10.1578L9.14321 10.7376C9.19774 10.7591 9.2409 10.8023 9.2624 10.8568L9.84224 12.327C9.91268 12.5056 10.1654 12.5056 10.2359 12.327L10.8157 10.8568C10.8372 10.8023 10.8804 10.7591 10.9349 10.7376L12.4051 10.1578C12.5837 10.0873 12.5837 9.83455 12.4051 9.76412L10.9349 9.18428C10.8804 9.16277 10.8372 9.11961 10.8157 9.06508L10.2359 7.59489Z" fill="#333333"/>\n </g>\n <defs>\n <clipPath id="clip0_316_49520">\n <rect width="20" height="20" fill="white"/>\n </clipPath>\n <clipPath id="clip1_316_49520">\n <rect width="21.3526" height="21.3526" fill="white" transform="translate(-0.726562 -0.628906)"/>\n </clipPath>\n </defs>\n </svg>\n <span class="deep-search-text">深度思考</span>\n </div>\n </div>\n </tooltip>\n \x3c!--智能模式外的模型及联网切换--\x3e\n <div\n class="\n model-network-select\n ci-model-button\n {{\'ci-model-button-\' + (currentModel.modelName === \'smartMode\' ? \'inactive\' : \'active\')}}"\n data-ci-show-ext="{{modelNetworkShowLog}}"\n data-ci-show-item\n >\n <div class="model-toggle" on-click="handleToggleModel">\n <svg s-if="isErineModel" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M7.81855 1.31637L2.93661 4.13503C2.20585 4.55685 1.75517 5.33769 1.75517 6.18134V11.8187C1.75517 12.6632 2.20585 13.4431 2.93661 13.865L7.81855 16.6836C8.54932 17.1055 9.45068 17.1055 10.1814 16.6836L15.0634 13.865C15.7942 13.4431 16.2448 12.6623 16.2448 11.8187V6.18134C16.2448 5.33684 15.7942 4.55685 15.0634 4.13503L10.1814 1.31637C9.44983 0.894544 8.54932 0.894544 7.81855 1.31637ZM4.46434 5.92672L8.60618 3.53582C8.84977 3.39493 9.15023 3.39493 9.39381 3.53582L12.2244 5.17049L7.97727 7.6225C7.55205 7.86778 7.28979 8.32186 7.28979 8.81328V13.7054L4.46434 12.0741C4.22075 11.9332 4.07052 11.6735 4.07052 11.3917V6.6091C4.07052 6.32732 4.22075 6.06761 4.46434 5.92672ZM9.606 14.342V10.341C9.606 9.73076 9.93107 9.1672 10.4598 8.8625L13.9295 6.85948V11.3909C13.9295 11.6727 13.7792 11.9324 13.5357 12.0733L9.606 14.342Z" fill="url(#paint0_linear_400_16982)" fill="currentColor"/>\n <defs>\n <linearGradient id="paint0_linear_400_16982" x1="12.6223" y1="2.72553" x2="5.37735" y2="15.2742" gradientUnits="userSpaceOnUse">\n <stop stop-color="#333333"/>\n </linearGradient>\n </defs>\n </svg>\n <svg s-else xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">\n <path d="M17.8108 3.37383C17.6202 3.2785 17.5379 3.4602 17.4266 3.55254C17.3886 3.58233 17.3562 3.62106 17.3238 3.6568C17.0453 3.96061 16.7199 4.1602 16.2943 4.13637C15.6725 4.10063 15.1415 4.3002 14.6724 4.78573C14.5726 4.187 14.2412 3.82957 13.7367 3.6002C13.4723 3.48106 13.2057 3.3619 13.0207 3.10274C12.8919 2.91807 12.8569 2.71254 12.7921 2.51C12.7511 2.38787 12.7102 2.26277 12.5724 2.24191C12.4223 2.21807 12.3639 2.34617 12.3051 2.4534C12.0705 2.89127 11.9793 3.37383 11.9886 3.86233C12.0087 4.96149 12.4637 5.83722 13.367 6.45978C13.4697 6.53126 13.4962 6.60275 13.4638 6.70699C13.4023 6.92146 13.3286 7.12998 13.2642 7.34445C13.2232 7.48148 13.1618 7.51125 13.0177 7.45168C12.5221 7.24019 12.0939 6.92742 11.7153 6.54915C11.073 5.91466 10.4921 5.21466 9.76793 4.66659C9.60026 4.54016 9.428 4.41993 9.2515 4.30616C8.5124 3.5734 9.3483 2.9717 9.54193 2.9002C9.7441 2.82574 9.6123 2.56957 8.9581 2.57254C8.3039 2.57551 7.70554 2.79893 6.94298 3.0968C6.8313 3.14147 6.71398 3.17424 6.59411 3.20106C5.90155 3.06701 5.18295 3.03723 4.43192 3.1236C3.01816 3.28446 1.88884 3.96659 1.05854 5.13126C0.0614084 6.53126 -0.17355 8.12191 0.114277 9.78104C0.415874 11.5296 1.29048 12.9772 2.6339 14.1091C4.02719 15.2827 5.63161 15.8576 7.46204 15.7474C8.57384 15.6819 9.81149 15.53 11.2078 14.3236C11.56 14.5023 11.9297 14.5738 12.5426 14.6274C13.0151 14.6721 13.4697 14.6036 13.8216 14.5291C14.373 14.41 14.3347 13.8887 14.1355 13.7934C12.5191 13.0249 12.874 13.3376 12.5515 13.0844C13.3729 12.0925 14.6106 11.0619 15.0946 7.72275C15.133 7.45765 15.1006 7.29084 15.0946 7.07638C15.0916 6.94531 15.1207 6.89466 15.2678 6.87978C15.6725 6.83212 16.0657 6.71892 16.4265 6.51638C17.4735 5.93255 17.8961 4.97339 17.9959 3.8236C18.0108 3.64786 17.9929 3.46616 17.8108 3.37383ZM8.68517 13.7219C7.11911 12.4649 6.35915 12.0508 6.04528 12.0687C5.75188 12.0866 5.80475 12.4291 5.86915 12.6525C5.93655 12.873 6.02479 13.0249 6.14802 13.2185C6.23294 13.3466 6.29177 13.5372 6.06278 13.6802C5.55825 13.9989 4.68139 13.573 4.64045 13.5521C3.61949 12.9385 2.7657 12.1283 2.16437 11.0202C1.58353 9.9538 1.24657 8.80998 1.19071 7.58871C1.17581 7.29381 1.26108 7.18955 1.54817 7.13592C1.92624 7.06227 2.31395 7.0522 2.69533 7.10615C4.29418 7.34447 5.65544 8.07424 6.79628 9.23C7.44751 9.88827 7.94011 10.6747 8.44798 11.4432C8.9875 12.2593 9.56836 13.0368 10.3075 13.6742C10.5685 13.8976 10.7766 14.0674 10.9762 14.1925C10.3748 14.261 9.37139 14.2759 8.68517 13.7219ZM9.43617 8.79211C9.43617 8.66104 9.53896 8.55678 9.66813 8.55678C9.69742 8.55729 9.72373 8.56225 9.74707 8.57168C9.79152 8.58876 9.82969 8.61904 9.85645 8.65844C9.88321 8.69784 9.89727 8.74448 9.89676 8.79211C9.89716 8.82281 9.89146 8.85328 9.88001 8.88177C9.86856 8.91025 9.85157 8.93619 9.83004 8.95807C9.8085 8.97995 9.78284 8.99735 9.75454 9.00925C9.72624 9.02116 9.69587 9.02734 9.66516 9.02744C9.63458 9.02735 9.60432 9.02115 9.57616 9.00921C9.54801 8.99728 9.52252 8.97984 9.50119 8.95792C9.47986 8.936 9.46312 8.91004 9.45195 8.88157C9.44079 8.8531 9.43542 8.82268 9.43617 8.79211ZM11.7681 10.0134C11.6188 10.0759 11.4692 10.1296 11.3251 10.1355C11.1024 10.1474 10.8589 10.0551 10.7271 9.9419C10.5216 9.76614 10.3748 9.66784 10.3134 9.36104C10.287 9.22997 10.3015 9.02744 10.325 8.91127C10.3778 8.66104 10.319 8.5002 10.1462 8.35424C10.0055 8.23508 9.82637 8.20231 9.6298 8.20231C9.55643 8.20231 9.48906 8.16957 9.43916 8.14275C9.41486 8.13111 9.39323 8.11459 9.37562 8.0942C9.35801 8.07381 9.34481 8.05001 9.33684 8.02428C9.32887 7.99855 9.3263 7.97144 9.3293 7.94467C9.3323 7.9179 9.3408 7.89204 9.35426 7.86871C9.37473 7.82701 9.47453 7.72572 9.49799 7.70785C9.76494 7.55295 10.0729 7.60361 10.3573 7.71978C10.6213 7.82998 10.8205 8.03254 11.1084 8.3185C11.4018 8.66403 11.4546 8.75936 11.6214 9.0185C11.7536 9.22104 11.8739 9.42956 11.9558 9.66784C12.0061 9.8168 11.9413 9.93891 11.7681 10.0134Z" fill="currentColor"/>\n </svg>\n <span class="target-model-label">{{targetModelLabel}}</span>\n </div>\n <tooltip\n content="切换模型"\n position="{{tools.modelSelect.position}}"\n >\n <div class="model-select-toggle" on-click="handleChangePopover">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1275_570)"><path d="M13.3208 10.1277C14.3531 10.1279 14.7615 11.4647 13.9058 12.0417L10.4995 14.3367L9.66164 13.0935L11.8355 11.6277H1.76222V10.1277H13.3208ZM6.3384 2.90698L4.16359 4.3728H14.2378V5.8728H2.67922C1.64691 5.87274 1.23855 4.53589 2.09426 3.95874L5.50051 1.66284L6.3384 2.90698Z" fill="currentColor"></path></g><defs><clipPath id="clip0_1275_570"><rect width="12.7378" height="12.6738" fill="white" transform="translate(1.6311 1.66284)"></rect></clipPath></defs></svg>\n </div>\n </tooltip>\n </div>\n </div>\n ',_j.components={popover:Popover,tooltip:Main$j,switcher:Switcher},_j.computed={usableModel:function(){return this.data.get("tools.modelSelect.usableModel")||[]},getModelTop:function(){var e="top"!==this.data.get("tools.modelSelect.position")?this.data.get("modelTop"):0;return e?"top:".concat(e,"px; left:123px"):""},modelList:function(){var e=this.data.get("usableModel"),t=this.data.get("usedModel");return e&&e.length&&t?e.map((function(e){return{title:e.modelTitle,desc:e.modelSubTitle||"",name:e.modelName,disabled:!e.modelAvailable,checked:e.modelName===t.modelName}})).filter((function(e){return e.name!==ModelIdEnum.SMART_MODE})):[]},currentModel:function(){var e=this.data.get("usedModel"),t=this.data.get("usableModel"),n=this.data.get("deepSearchCheck"),i=this.data.get("thinkModeCheck"),a=this.data.get("internetCheck");if(!e||!t)return{modelName:"",modelFunction:{}};var o=t.find((function(t){return t.modelName===e.modelName}))||{};return __spreadProps(__spreadValues({},e),{modelTitle:o.modelTitle,modelName:o.modelName,modelButton:o.modelButton,modelIcon:o.modelIcon,thinkModeShow:i?"1":"0",internetShow:a?"1":"0",deepSearchShow:n?"1":"0"})},isErineModel:function(){var e,t=this;return((null==(e=(this.data.get("usableModel")||[]).find((function(e){var n=e.modelTitle;return(e.modelButton||n)===t.data.get("targetModelLabel")})))?void 0:e.modelName)||"").indexOf("ERINE")>-1},modelNetworkShowLog:function(){var e=this.data.get("usedModel")||{};return JSON.stringify({value:"ask_model_capsule",ext:{is_open:e.modelName===ModelIdEnum.SMART_MODE?"0":"1",current_model:e.modelName||""}})},deepsearchBtnShowExt:function(){return JSON.stringify({value:"deepsearch_btn",ext:{is_open:this.data.get("deepSearchCheck")?"1":"0"}})},targetModelLabel:function(){return this.data.get("tools.modelSelect.targetModelLabel")||""},hasThinkMode:function(){return(this.data.get("usableModel")||[]).some((function(e){var t;return!!(null==(t=null==e?void 0:e.modelFunction)?void 0:t.thinkMode)}))},isThinkModeDisabled:function(){var e,t,n=this.data.get("currentModel");return!n||n.modelName===ModelIdEnum.SMART_MODE||!!(null==(t=null==(e=n.modelFunction)?void 0:e.thinkMode)?void 0:t.disabled)},thinkModeDisabledTip:function(){var e,t=this.data.get("currentModel"),n=null==(e=null==t?void 0:t.modelFunction)?void 0:e.thinkMode;return(null==n?void 0:n.disabled)&&(null==n?void 0:n.disabledTip)||""}},_j),NEW_MESSAGE_SEEN_KEY="CI_INPUT_MODE_NEW_MESSAGE_SEEN",BUTTON_NEW_MESSAGE_SEEN_KEY="CI_INPUT_MODE_BUTTON_NEW_MESSAGE_SEEN",BADGE_NEW_MESSAGE_SEEN_KEY="CI_INPUT_MODE_BADGE_NEW_MESSAGE_SEEN",MODE_KEY_PREFIX="mode",MODEL_KEY_SEGMENT="model",readSeen=function(e){try{if("undefined"==typeof localStorage)return[];var t=localStorage.getItem(e),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter((function(e){return"string"==typeof e})):[]}catch(t){return[]}},writeSeen=function(e,t){try{if("undefined"==typeof localStorage)return;localStorage.setItem(e,JSON.stringify(t))}catch(n){}},getModeNewMessageKey=function(e){return e.newMessage?"".concat(MODE_KEY_PREFIX,"-").concat(e.modelName,"-").concat(e.newMessage):""},getModelNewMessageKey=function(e,t){return t.newMessage?"".concat(MODE_KEY_PREFIX,"-").concat(e,"-").concat(MODEL_KEY_SEGMENT,"-").concat(t.modelName,"-").concat(t.newMessage):""},getAllNewMessageKeys=function(e){var t=[];return e.forEach((function(e){t.push(getModeNewMessageKey(e)),(e.modelList||[]).forEach((function(n){t.push(getModelNewMessageKey(e.modelName,n))}))})),t.filter(Boolean)},hasUnseenNewMessage=function(e,t){return Boolean(e)&&!t.includes(e)},getAutoModel=function(e){var t=[];return e.forEach((function(e){(e.modelList||[]).forEach((function(e){return t.push(e)}))})),t.find((function(e){return e.modelName===ModelIdEnum.SMART_MODE}))||{modelName:ModelIdEnum.SMART_MODE,modelTitle:"自动",modelSubTitle:"",modelButton:"自动",modelIcon:"",modelFunction:{}}},_InputMode=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{open:!1,modelCascadeOpen:!1,usableModel:[],usedModel:{},hostModeName:"",selectedModeName:"",selectedModel:{},position:"bottom",modeModelMemory:{},newMessageSeen:readSeen(NEW_MESSAGE_SEEN_KEY),buttonNewMessageSeen:readSeen(BUTTON_NEW_MESSAGE_SEEN_KEY),badgeNewMessageSeen:readSeen(BADGE_NEW_MESSAGE_SEEN_KEY)}}},{key:"attached",value:function(){var e=this;this.syncModeFromHost(),this.syncModelFromHost(),this.watch("usableModel",(function(){e.syncModeFromHost(),e.syncModelFromHost()})),this.watch("hostModeName",(function(){return e.syncModeFromHost()})),this.watch("usedModel",(function(){return e.syncModelFromHost()})),this.watch("modelCascadeOpen",(function(t){t&&(e.markModelNewMessagesSeen(),e.sendModelEntryShowLog())})),this.$input.sendLog("show","mode_btn")}},{key:"syncModeFromHost",value:function(){var e,t=this.data.get("usableModel"),n=this.data.get("hostModeName"),i=t.some((function(e){return e.modelName===n}))?n:null==(e=t[0])?void 0:e.modelName;this.data.set("selectedModeName",i)}},{key:"syncModelFromHost",value:function(){var e=this.data.get("usedModel"),t=this.data.get("modelList").find((function(t){return t.modelName===(null==e?void 0:e.modelName)}));if(t)return this.data.set("selectedModel",__spreadProps(__spreadValues({},t),{modelFunction:e.modelFunction||t.modelFunction})),void this.rememberModel(t.modelName);this.restoreModelForSelectedMode(!1)}},{key:"togglePanel",value:function(e){e.stopPropagation();var t=!this.data.get("open");this.data.set("open",t),this.$input.sendLog("click","mode_btn"),t?(this.markButtonNewMessagesSeen(),this.$input.sendLog("show","model_panel",{area:"mode"})):this.closePanels()}},{key:"closePanels",value:function(){this.data.set("open",!1),this.data.set("modelCascadeOpen",!1)}},{key:"selectMode",value:function(e){this.data.set("modelCascadeOpen",!1);var t=(this.data.get("usableModel")||[]).find((function(t){return t.modelName===e}));this.markBadgeNewMessageSeen(t?getModeNewMessageKey(t):""),this.$input.sendLog("click","model_panel",{area:"mode"}),e!==this.data.get("selectedModeName")&&(this.data.set("selectedModeName",e),this.restoreModelForSelectedMode(!0),this.closePanels(),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.CHAT_MODE_CHANGE,data:{value:e}}))}},{key:"handleModelRowClick",value:function(e){e.stopPropagation(),this.data.get("modelSelectionDisabled")&&this.$input.sendLog("show","model_panel",{area:"model_entry"})}},{key:"selectModel",value:function(e){var t=this.data.get("selectedModeName");this.markBadgeNewMessageSeen(getModelNewMessageKey(t,e)),this.setSelectedModel(e,!0),this.closePanels(),this.$input.sendLog("click","model_panel",{area:"model"})}},{key:"restoreModelForSelectedMode",value:function(e){var t=this.data.get("modelList");if(t.length){var n=this.data.get("selectedModeName"),i=this.data.get("modeModelMemory")[n],a=t.find((function(e){return e.modelName===i}))||t[0];this.setSelectedModel(a,e)}else{var o=this.data.get("usableModel"),s=this.data.get("selectedModeItem"),r=getAutoModel(o);this.setSelectedModel(__spreadProps(__spreadValues({},r),{modelFunction:(null==s?void 0:s.modelFunction)||r.modelFunction}),e)}}},{key:"setSelectedModel",value:function(e,t){this.data.set("selectedModel",e),this.rememberModel(e.modelName),t&&this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.MODEL_CHANGE,data:{value:{modelName:e.modelName,modelFunction:e.modelFunction||{},showModelName:e.modelName,targetModelLabel:e.modelButton||e.modelTitle}}})}},{key:"rememberModel",value:function(e){if(this.data.get("modelList").some((function(t){return t.modelName===e}))){var t=this.data.get("selectedModeName");this.data.set("modeModelMemory",__spreadProps(__spreadValues({},this.data.get("modeModelMemory")),_defineProperty({},t,e)))}}},{key:"getModelInfo",value:function(){var e=this.data.get("selectedModel");return{modeName:this.data.get("selectedModeName"),modelName:null==e?void 0:e.modelName,modelFunction:(null==e?void 0:e.modelFunction)||{},showModelName:(null==e?void 0:e.modelName)||""}}},{key:"handleCascadeMouseEnter",value:function(){this.data.get("modelSelectionDisabled")||this.data.set("modelCascadeOpen",!0)}},{key:"handleCascadeMouseLeave",value:function(e){var t=e.relatedTarget,n=e.currentTarget;t&&n.contains(t)||this.data.set("modelCascadeOpen",!1)}},{key:"sendModelEntryShowLog",value:function(){this.$input.sendLog("show","model_panel",{area:"model_entry"})}},{key:"markButtonNewMessagesSeen",value:function(){var e=this.data.get("usableModel")||[],t=getAllNewMessageKeys(e),n=this.data.get("buttonNewMessageSeen")||[],i=t.filter((function(e){return!n.includes(e)}));if(i.length){var a=[].concat(_toConsumableArray(n),_toConsumableArray(i));this.data.set("buttonNewMessageSeen",a),writeSeen(BUTTON_NEW_MESSAGE_SEEN_KEY,a)}}},{key:"markBadgeNewMessageSeen",value:function(e){if(e){var t=this.data.get("badgeNewMessageSeen")||[];if(!t.includes(e)){var n=[].concat(_toConsumableArray(t),[e]);this.data.set("badgeNewMessageSeen",n),writeSeen(BADGE_NEW_MESSAGE_SEEN_KEY,n)}}}},{key:"markModelNewMessagesSeen",value:function(){var e=this.data.get("selectedModeName"),t=this.data.get("modelList")||[];this.markNewMessagesSeen(t.map((function(t){return getModelNewMessageKey(e,t)})))}},{key:"markNewMessagesSeen",value:function(e){var t=e.filter(Boolean);if(t.length){var n=this.data.get("newMessageSeen")||[],i=t.filter((function(e){return!n.includes(e)}));if(i.length){var a=[].concat(_toConsumableArray(n),_toConsumableArray(i));this.data.set("newMessageSeen",a),writeSeen(NEW_MESSAGE_SEEN_KEY,a)}}}}])}(ApiCmpt);_InputMode.template='\n <div class="\n ci-input-mode-wrapper\n {{position === \'bottom\' ? \'ci-input-mode-position-bottom\' : \'\'}}\n ">\n <popover open="{=open=}" on-close="closePanels">\n <div class="ci-input-mode-panel" role="menu" aria-label="选择回答模式">\n <button\n s-for="mode in displayModes"\n type="button"\n class="ci-input-mode-item {{mode.modelName === selectedModeName ? \'ci-input-mode-item-active\' : \'\'}}"\n role="menuitemradio"\n aria-checked="{{mode.modelName === selectedModeName ? \'true\' : \'false\'}}"\n data-chat-mode="{{mode.modelName}}"\n on-click="selectMode(mode.modelName)"\n >\n <span class="ci-input-mode-copy">\n <span class="ci-input-mode-title-row">\n <span class="ci-input-mode-title">{{mode.modelTitle}}</span>\n <span\n s-if="mode.showNewMessage"\n class="ci-input-mode-new-badge"\n data-testid="chat-mode-new-badge"\n >{{mode.newMessage}}</span>\n </span>\n <span s-if="mode.modelSubTitle" class="ci-input-mode-desc">{{mode.modelSubTitle}}</span>\n </span>\n <img\n s-if="mode.modelName === selectedModeName"\n class="ci-input-mode-check"\n src="https://psstatic.cdn.bcebos.com/aife/static/check-circle-fill_1761212501000.svg"\n alt=""\n aria-hidden="true"\n />\n </button>\n\n <div\n class="ci-input-mode-model-section\n {{modelSelectionDisabled ? \'ci-input-mode-model-section-disabled\' : \'\'}}\n {{modelCascadeOpen ? \'ci-input-mode-model-section-open\' : \'\'}}"\n data-disabled-tip="{{disabledTip}}"\n on-mouseleave="handleCascadeMouseLeave"\n >\n <div class="ci-input-mode-divider" />\n <div\n class="ci-input-mode-model-row\n {{modelCascadeOpen ? \'ci-input-mode-model-row-open\' : \'\'}}\n {{modelSelectionDisabled ? \'ci-input-mode-model-row-disabled\' : \'\'}}"\n data-testid="chat-mode-model-row"\n on-mouseenter="handleCascadeMouseEnter"\n on-click="handleModelRowClick"\n >\n <span class="ci-input-mode-model-label">模型</span>\n <span class="ci-input-mode-model-value">\n <span class="ci-input-mode-model-name">{{modelLabel}}</span>\n <svg\n class="ci-input-mode-arrow ci-input-mode-model-arrow"\n width="12"\n height="12"\n viewBox="0 0 12 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n aria-hidden="true"\n >\n <path d="M10.4435 4.4248L7.29114 7.57617C6.58809 8.27853 5.44892 8.27801 4.74622 7.5752L1.59583 4.42383L2.44348 3.57617L5.59485 6.72656C5.82911 6.96086 6.20914 6.96172 6.44348 6.72754L9.59583 3.5752L10.4435 4.4248Z" fill="currentColor" />\n </svg>\n </span>\n </div>\n <div\n s-if="{{!modelSelectionDisabled}}"\n class="ci-input-mode-cascade-panel\n {{modelCascadeOpen ? \'ci-input-mode-cascade-panel-open\' : \'\'}}"\n role="menu"\n aria-label="选择模型"\n on-mouseenter="handleCascadeMouseEnter"\n >\n <button\n s-for="model in displayModelList"\n type="button"\n class="ci-input-mode-cascade-item {{model.modelName === selectedModel.modelName ? \'ci-input-mode-cascade-item-active\' : \'\'}}"\n role="menuitemradio"\n aria-checked="{{model.modelName === selectedModel.modelName ? \'true\' : \'false\'}}"\n data-model-name="{{model.modelName}}"\n on-click="selectModel(model)"\n >\n <span class="ci-input-mode-cascade-title">{{model.modelTitle}}</span>\n <span\n s-if="model.showNewMessage"\n class="ci-input-mode-new-badge"\n data-testid="chat-mode-new-badge"\n >{{model.newMessage}}</span>\n <img\n s-if="model.modelName === selectedModel.modelName"\n class="ci-input-mode-cascade-check"\n src="https://psstatic.cdn.bcebos.com/aife/static/check-circle-fill_1761212501000.svg"\n alt=""\n aria-hidden="true"\n />\n </button>\n </div>\n </div>\n\n <span\n s-if="showModelNewDot"\n class="ci-new-dot ci-input-mode-model-dot"\n data-testid="chat-mode-model-dot"\n aria-hidden="true"\n />\n </div>\n </popover>\n\n <button\n type="button"\n class="ci-input-mode-button {{open ? \'ci-input-mode-button-open\' : \'\'}} {{showButtonNewDot ? \'ci-new-dot\' : \'\'}}"\n data-testid="chat-mode-selector"\n aria-haspopup="menu"\n aria-expanded="{{open ? \'true\' : \'false\'}}"\n on-click="togglePanel"\n >\n <img\n s-if="selectedModeItem.modelIcon"\n class="ci-input-mode-button-icon"\n src="{{selectedModeItem.modelIcon}}"\n alt=""\n />\n <span class="ci-input-mode-button-text">{{selectedModeItem.modelTitle}}</span>\n <svg\n class="ci-input-mode-arrow"\n width="12"\n height="12"\n viewBox="0 0 12 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n aria-hidden="true"\n >\n <path d="M10.4435 4.4248L7.29114 7.57617C6.58809 8.27853 5.44892 8.27801 4.74622 7.5752L1.59583 4.42383L2.44348 3.57617L5.59485 6.72656C5.82911 6.96086 6.20914 6.96172 6.44348 6.72754L9.59583 3.5752L10.4435 4.4248Z" fill="currentColor" />\n </svg>\n </button>\n </div>\n ',_InputMode.components={popover:Popover},_InputMode.computed={selectedModeItem:function(){var e=this.data.get("usableModel"),t=this.data.get("selectedModeName");return e.find((function(e){return e.modelName===t}))||e[0]},modelList:function(){var e=this.data.get("selectedModeItem");return Array.isArray(null==e?void 0:e.modelList)?e.modelList:[]},displayModes:function(){var e=this.data.get("usableModel")||[],t=this.data.get("badgeNewMessageSeen")||[];return e.map((function(e){return __spreadProps(__spreadValues({},e),{showNewMessage:hasUnseenNewMessage(getModeNewMessageKey(e),t)})}))},displayModelList:function(){var e=this.data.get("modelList")||[],t=this.data.get("selectedModeName"),n=this.data.get("badgeNewMessageSeen")||[];return e.map((function(e){return __spreadProps(__spreadValues({},e),{showNewMessage:hasUnseenNewMessage(getModelNewMessageKey(t,e),n)})}))},showModelNewDot:function(){var e=this.data.get("modelList")||[],t=this.data.get("selectedModeName"),n=this.data.get("newMessageSeen")||[];return e.some((function(e){return hasUnseenNewMessage(getModelNewMessageKey(t,e),n)}))},showButtonNewDot:function(){var e=this.data.get("usableModel")||[],t=this.data.get("buttonNewMessageSeen")||[];return getAllNewMessageKeys(e).some((function(e){return hasUnseenNewMessage(e,t)}))},modelSelectionDisabled:function(){var e=this.data.get("selectedModeItem");return!Array.isArray(null==e?void 0:e.modelList)},disabledTip:function(){var e=this.data.get("selectedModeItem");return this.data.get("modelSelectionDisabled")&&(null==e?void 0:e.modelHoverMessage)||""},modelLabel:function(){var e,t;if(this.data.get("modelSelectionDisabled"))return"自动";var n=this.data.get("modelList"),i=this.data.get("selectedModel");return(null==(e=n.find((function(e){return e.modelName===(null==i?void 0:i.modelName)})))?void 0:e.modelTitle)||(null==(t=n[0])?void 0:t.modelTitle)||"自动"}};var InputMode=_InputMode,_LanguageSelector=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{selectedLanguage:""}}},{key:"selectLanguage",value:function(e,t){e.stopPropagation(),this.fire("panel-action",t)}}])}(ApiCmpt);_LanguageSelector.template='\n <div class="ci-language-selector-wrapper">\n <div class="ci-language-selector-body">\n <div\n s-for="language, index in languageList"\n class="\n ci-language-item\n {{selectedLanguage === language.label ? \'ci-language-item-selected\' : \'\'}}\n {{index === 0 ? \'ci-language-item-first\' : \'\'}}\n "\n on-click="selectLanguage($event, language)"\n >\n <div class="ci-language-item-content">\n <span class="ci-language-label">{{language.label}}</span>\n <span class="ci-language-value">{{language.value}}</span>\n </div>\n <span\n s-if="{{selectedLanguage === language.label}}"\n class="ci-language-selected-icon icon cos-icon cos-icon-check-circle-fill"\n ></span>\n </div>\n </div>\n </div>\n ';var LanguageSelector=_LanguageSelector,browserLanguageLabel="浏览器语言",COMMON_LANGUAGES=[{value:"zh",label:"中文"},{value:"en",label:"英语"},{value:"es",label:"西班牙语"},{value:"fr",label:"法语"},{value:"de",label:"德语"},{value:"it",label:"意大利语"},{value:"ja",label:"日语"},{value:"ko",label:"韩语"},{value:"ru",label:"俄语"},{value:"pt",label:"葡萄牙语"},{value:"ar",label:"阿拉伯语"}],_TranslateButton=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).abortController=null,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{isOpen:!1,selectedLanguage:browserLanguageLabel,languageList:COMMON_LANGUAGES,abortController:null,position:"bottom",arrowIcon:"https://psstatic.cdn.bcebos.com/aife/superman/arrow-right_1765817762000.svg",downIcon:"https://psstatic.cdn.bcebos.com/aife/image/12_12_1760441491000.png",upIcon:"https://psstatic.cdn.bcebos.com/aife/static/cc_1760512076000.png",useNewArrow:!1,shrinkImg:"https://gips0.baidu.com/it/u=997202575,4105139896&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f60_60",isShrink:!1}}},{key:"attached",value:function(){var e=this;this.generateLanguageList(),this.watch("translateOption",(function(){e.generateLanguageList()}))}},{key:"generateLanguageList",value:function(){var e=this.data.get("translateOption")||[],t={value:navigator.language,label:browserLanguageLabel};this.data.set("defaultLang",t),e.length>0?this.data.set("languageList",[t].concat(_toConsumableArray(e))):this.data.set("languageList",[t].concat(COMMON_LANGUAGES))}},{key:"detached",value:function(){var e;null==(e=this.abortController)||e.abort(),this.abortController=null}},{key:"handleLanguageButtonClick",value:function(e){e.stopPropagation(),this.data.get("isOpen")?this.closeLanguagePanel():this.openLanguagePanel(),this.$input.sendLog("click","language_choose")}},{key:"openLanguagePanel",value:function(){var e,t=this;null==(e=this.abortController)||e.abort(),this.abortController=new AbortController,this.data.set("isOpen",!0),document.addEventListener("click",(function(e){var n=document.querySelector("#translate-language-panel"),i=document.querySelector("#translate-language-button");i&&i.contains(e.target)||n&&!n.contains(e.target)&&t.closeLanguagePanel()}),{capture:!0,signal:this.abortController.signal})}},{key:"closeLanguagePanel",value:function(){var e;this.data.set("isOpen",!1),null==(e=this.abortController)||e.abort(),this.abortController=null}},{key:"handleLanguageAction",value:function(e){var t=this;this.$input.sendLog("click","language_choose_board"),this.data.set("selectedLanguage",e.label),setTimeout((function(){t.closeLanguagePanel()}),10)}},{key:"getTranslateInfo",value:function(){var e,t=this.data.get("selectedLanguage"),n=this.data.get("languageList");if(t===browserLanguageLabel){var i=null==(e=this.data.get("defaultLang"))?void 0:e.value,a="";try{var o=i.split("-")[0];a=new Intl.DisplayNames(["zh"],{type:"language"}).of(o)||""}catch(r){a=""}if(!a){var s=n.find((function(e){return i.includes(e.logogram)}));a=s?s.label:i}return{targetLanguage:a}}return{targetLanguage:t}}},{key:"setTranslateInfo",value:function(e){e&&e.targetLanguage&&this.data.set("selectedLanguage",e.targetLanguage)}}])}(ApiCmpt);_TranslateButton.template='\n <div class="ci-translate-button-container">\n <div class="ci-translate-button">\n <span class="ci-translate-text">自动检测</span>\n </div>\n <div class="ci-translate-arrow-container">\n <img class="ci-translate-arrow-icon" src="{{arrowIcon}}" />\n </div>\n <tooltip\n content="翻译"\n position="top"\n disabled="{{!isShrink || isOpen}}"\n >\n <div\n id="translate-language-button"\n class="ci-language-select-button {{isOpen ? \'ci-language-select-button-active\' : \'\'}}"\n on-click="handleLanguageButtonClick"\n >\n <img\n class="ci-selected-language-shrink-img"\n src="{{shrinkImg}}"\n >\n <span class="ci-selected-language-text">{{displayLanguageText}}</span>\n <svg\n s-if="useNewArrow"\n class="ci-dropdown-icon"\n width="12"\n height="12"\n viewBox="0 0 12 12"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n aria-hidden="true"\n >\n <path d="M10.4435 4.4248L7.29114 7.57617C6.58809 8.27853 5.44892 8.27801 4.74622 7.5752L1.59583 4.42383L2.44348 3.57617L5.59485 6.72656C5.82911 6.96086 6.20914 6.96172 6.44348 6.72754L9.59583 3.5752L10.4435 4.4248Z" fill="currentColor" />\n </svg>\n <img\n s-else\n class="ci-dropdown-icon"\n src="{{position === \'top\' ? (isOpen ? downIcon : upIcon) : (isOpen ? upIcon : downIcon)}}"\n />\n <language-selector\n s-ref="language-selector-panel"\n s-show="isOpen"\n id="translate-language-panel"\n class="ci-language-panel {{position === \'top\' ? \'ci-language-panel-top\' : \'\'}}"\n language-list="{{languageList}}"\n selected-language="{{selectedLanguage}}"\n on-panel-action="handleLanguageAction"\n />\n </div>\n </tooltip>\n </div>\n ',_TranslateButton.components={"language-selector":LanguageSelector,tooltip:Main$j},_TranslateButton.computed={displayLanguageText:function(){return this.data.get("selectedLanguage")||"选择语言"}};var TranslateButton=_TranslateButton,Main$d=(_k=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{icon:"https://aisearch.cdn.bcebos.com/homepage/chat_tool/v2/ai_more.png"}}},{key:"handleMenuClick",value:function(e){e.stopPropagation(),e.target!==e.currentTarget&&this.close()}},{key:"fireShowLog",value:function(){this.fire("menu-show",{})}},{key:"close",value:function(){var e=this.ref("menu");e&&(e.style.display="none",setTimeout((function(){e.style.display=""}),100))}}])}(san.Component),_k.template='\n <div\n s-ref="container"\n class="more-dropdown-container {{wrapperClass}}"\n on-mouseenter="fireShowLog"\n >\n <div class="more-dropdown-trigger {{btnClass}}">\n <slot name="btn-text">\n <img\n class="more-dropdown-trigger-icon"\n src="{{icon}}"\n />\n <span class="more-dropdown-trigger-text">更多</span>\n </slot>\n </div>\n <div class="more-dropdown-menu-wrapper {{menuWrapperClass}}">\n <div\n class="more-dropdown-menu {{menuClass}}"\n s-ref="menu"\n on-click="handleMenuClick"\n >\n <slot></slot>\n </div>\n </div>\n </div>\n ',_k),DEFAULT_BUTTON_WIDTH_OPTIONS={fontSize:14,fontWeight:500,fontFamily:"PingFang SC, Arial, sans-serif",horizontalPadding:18,iconWidth:20,iconTextGap:6},measureContext;function getCssNumber(e,t,n){var i=parseFloat(e.getPropertyValue(t));return Number.isFinite(i)?i:n}function getButtonBarLayout(e){var t=getComputedStyle(e),n=getCssNumber(t,"--ci-button-padding-inline",18),i={fontSize:getCssNumber(t,"--ci-button-font-size",DEFAULT_BUTTON_WIDTH_OPTIONS.fontSize),fontWeight:getCssNumber(t,"--ci-button-font-weight",DEFAULT_BUTTON_WIDTH_OPTIONS.fontWeight),fontFamily:t.getPropertyValue("--ci-button-font-family").trim()||DEFAULT_BUTTON_WIDTH_OPTIONS.fontFamily,horizontalPadding:2*n,iconWidth:getCssNumber(t,"--ci-button-icon-size",DEFAULT_BUTTON_WIDTH_OPTIONS.iconWidth),iconTextGap:getCssNumber(t,"--ci-button-icon-text-gap",DEFAULT_BUTTON_WIDTH_OPTIONS.iconTextGap)};return{buttonGap:getCssNumber(t,"--ci-button-gap",9),defaultMinWidth:getCssNumber(t,"--ci-button-min-width",110),moreButtonWidth:getCssNumber(t,"--ci-more-button-width",calculateButtonWidth("更多",i)),buttonWidthOptions:i}}function calculateButtonWidth(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=__spreadValues(__spreadValues({},DEFAULT_BUTTON_WIDTH_OPTIONS),t);void 0===measureContext&&"undefined"!=typeof document&&(measureContext=document.createElement("canvas").getContext("2d"));var i=0;return measureContext?(measureContext.font="".concat(n.fontWeight," ").concat(n.fontSize,"px ").concat(n.fontFamily),i=measureContext.measureText(e).width):i=Array.from(e).reduce((function(e,t){return e+(/^[\x00-\xff]$/.test(t)?n.fontSize/2:n.fontSize)}),0),Math.ceil(i+n.horizontalPadding+n.iconWidth+n.iconTextGap)}function calculateBreakpoints(e,t){var n=t.defaultMinWidth,i=t.buttonGap,a=t.moreButtonWidth;return e.map((function(t,o){var s=o+1,r=e.slice(0,s).reduce((function(e,t){return e+(t.btnWidth||t.minWidth||n)}),0);return{visibleCount:s,minWidth:s<e.length?r+(a||n)+s*i:r+(s-1)*i}}))}function getVisibleButtonCount(e,t){for(var n=t.length-1;n>=0;n--)if(e>=t[n].minWidth)return t[n].visibleCount;return 0}function splitButtons(e,t){return{visibleButtons:e.slice(0,t),hiddenButtons:e.slice(t)}}function calculateAdaptiveButtonBar(e,t){return splitButtons(e,getVisibleButtonCount(t.containerWidth,calculateBreakpoints(e,{defaultMinWidth:t.defaultMinWidth,buttonGap:t.buttonGap,moreButtonWidth:t.moreButtonWidth})))}var AdaptiveButtonBarManager=function(){return _createClass((function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,e),this.resizeObserver=null,this.containerWidth=0,this.lastResult=null,this.config=t,this.callbacks=n,this.container=t.container,this.setupResizeObserver(),this.bindContainer()}),[{key:"update",value:function(){this.container&&(this.updateContainerWidth(),this.calculateAndNotify())}},{key:"getCurrentResult",value:function(){return this.lastResult?this.lastResult:null}},{key:"destroy",value:function(){this.resizeObserver&&(this.resizeObserver.unobserve(this.container),this.resizeObserver.disconnect(),this.resizeObserver=null),this.lastResult=null}},{key:"bindContainer",value:function(){this.container&&this.resizeObserver&&(this.resizeObserver.observe(this.container),this.updateContainerWidth())}},{key:"setupResizeObserver",value:function(){var e=this;this.resizeObserver=new ResizeObserver((function(){requestAnimationFrame((function(){e.updateContainerWidth(),e.calculateAndNotify()}))}))}},{key:"updateContainerWidth",value:function(){var e=getComputedStyle(this.container),t=parseFloat(e.paddingLeft)||0,n=parseFloat(e.paddingRight)||0,i=this.container.clientWidth-t-n;i!==this.containerWidth&&(this.containerWidth=i)}},{key:"calculateAndNotify",value:function(){if(!(this.containerWidth<=0)){var e=this.config,t=e.buttons,n=e.defaultMinWidth,i=e.buttonGap,a=e.moreButtonWidth,o=calculateAdaptiveButtonBar(t,{containerWidth:this.containerWidth,defaultMinWidth:n,buttonGap:i,moreButtonWidth:a});this.lastResult=o,this.callbacks.onUpdate&&this.callbacks.onUpdate(o)}}}])}(),INPUT_PANEL_BTN_CLICKED_GUIDE="INPUT_PANEL_BTN_CLICKED_GUIDE",AI_SEARCH_CLICK_COUNT="AI_SEARCH_CLICK_COUNT",AI_SEARCH_ANIMATION_LAST_DATE="AI_SEARCH_ANIMATION_LAST_DATE",Main$c=(_l=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).rightClick=!1,e.carousel=null,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{panel:{},pos:0,isHover:!1,isShowGuide:!1,capsuleInside:!1,hideAi:!1,showHoverAnimation:!1,linerColorConfig:[{offset:"0%",color:"#fff",opacity:"1"},{offset:"30%",color:"#fff",opacity:"0.2"},{offset:"60%",color:"#6547FF",opacity:"0.4"},{offset:"90%",color:"#4769FF",opacity:"0.5"},{offset:"100%",color:"#0090FE",opacity:"0.7"}],showDeepResearchGuide:!1,deepResearchGuideText:""}}},{key:"inited",value:function(){var e,t;if("ai_search"===this.data.get("panel.type")){var n=this.data.get("panel.scrollTextList"),i=n&&(null==n?void 0:n.length)?null==(e=n[0])?void 0:e.text:this.data.get("panel.text"),a=n&&(null==n?void 0:n.length)?null==(t=n[0])?void 0:t.url:this.data.get("panel.url");this.data.set("panel.text",i),this.data.set("panel.url",a),this.data.set("emojiText",i)}}},{key:"attached",value:function(){var e=this,t=this.data.get("panel");if(t.guide){var n=this.checkShowGuide();this.data.set("isShowGuide",n),this.getShowDeepResearchGuide()}this.$input.translog().scan(this.el),"ai_search"===(null==t?void 0:t.type)&&this.getAiSearchClickCount()<8&&this.shouldShowAnimationToday()&&setTimeout((function(){var t=document.querySelector("#ci-anime-video"),n=e.ref("border-animation");!t&&n&&(e.updateAnimationLastDate(),n.showIncomeAnimation())}),100)}},{key:"handlePanelBtnClick",value:function(){var e=this.data.get("panel");this.dispatch("input-panel-btn-click",e);var t="ai_search"===(null==e?void 0:e.type);if(t&&this.incrementAiSearchClickCount(),e.guide){this.data.set("isShowGuide",!1);var n=localStorage.getItem(INPUT_PANEL_BTN_CLICKED_GUIDE),i={};try{n?(i=JSON.parse(n))[e.type]="1":i=_defineProperty({},e.type,"1"),localStorage.setItem(INPUT_PANEL_BTN_CLICKED_GUIDE,JSON.stringify(i))}catch(o){console.warn(o)}}var a=t?this.rightClick?"right":"left":this.data.get("area");this.rightClick=void 0,this.fire("click",{panel:e,pos:this.data.get("pos"),content:this.data.get("panel.content")||this.data.get("panel.text"),area:a})}},{key:"checkShowGuide",value:function(){var e=this.data.get("panel");if(e.guide){var t=localStorage.getItem(INPUT_PANEL_BTN_CLICKED_GUIDE);try{var n=t&&JSON.parse(t)||{};return!t||!n[e.type]}catch(n){return console.warn(n),!1}}return!1}},{key:"showHover",value:function(){this.data.set("isHover",!0);var e=this.ref("border-animation");e&&e.showHover(),this.getShowDeepResearchGuide()}},{key:"hideHover",value:function(){this.data.set("isHover",!1);var e=this.ref("border-animation");e&&e.hideHover()}},{key:"getAiSearchClickCount",value:function(){try{var e=localStorage.getItem(AI_SEARCH_CLICK_COUNT);return e?parseInt(e,10):0}catch(e){return console.warn(e),0}}},{key:"incrementAiSearchClickCount",value:function(){try{var e=this.getAiSearchClickCount();localStorage.setItem(AI_SEARCH_CLICK_COUNT,String(e+1))}catch(e){console.warn(e)}}},{key:"shouldShowAnimationToday",value:function(){try{var e=localStorage.getItem(AI_SEARCH_ANIMATION_LAST_DATE),t=(new Date).toDateString();return!e||e!==t}catch(e){return console.warn(e),!0}}},{key:"updateAnimationLastDate",value:function(){try{var e=(new Date).toDateString();localStorage.setItem(AI_SEARCH_ANIMATION_LAST_DATE,e)}catch(e){console.warn(e)}}},{key:"handleRightBtnClick",value:function(){this.rightClick=!0}},{key:"getShowDeepResearchGuide",value:function(){var e=this.data.get("panel");if("deep_research"===e.type){if(e.guide){var t=window.localStorage.getItem(INPUT_PANEL_BTN_CLICKED_GUIDE);try{var n=t&&JSON.parse(t)||{};this.data.set("showDeepResearchGuide",!t||!n.deep_research)}catch(n){console.warn(n),this.data.set("showDeepResearchGuide",!1)}}this.data.set("showDeepResearchGuide",!1)}else this.data.set("showDeepResearchGuide",!1)}},{key:"detached",value:function(){this.$input.translog().unobserve(this.el),this.carousel&&(this.carousel.destroy(this.el),this.carousel=void 0)}}])}(ApiCmpt),_l.template='\n <div\n class="\n ci-panel\n {{panel.type === \'ai_search\' ? \'new-search-guide-bub\' : \'\'}}\n {{panel.guide && isShowGuide ? \'ci-new-dot ci-panel-guide\' : \'\'}}\n {{panel.type === \'deep_research\' ? \'deep-research-panel\' : \'\'}}\n {{panel.type === \'deep_decision\' ? \'deep-decision-panel\' : \'\'}}\n {{panel.type === \'gk-report\' ? \'gk-report-panel\' : \'\'}}\n {{hideIconHoverColor ? \'hide-panel-icon-hover\' : \'\'}}\n "\n on-click="handlePanelBtnClick"\n on-mouseenter="showHover"\n on-mouseleave="hideHover"\n data-btn-id="{{panel.button_id}}"\n data-ci-show-item\n data-ci-show-ext="{{ubcShowLog}}"\n >\n <fragment s-if="{{panel.type === \'ai_search\'}}">\n <a\n href="{{panel.url}}"\n target="_blank"\n class="new-search-guide-bub-container"\n >\n <div\n class="new-search-guide-bub-container-center"\n s-ref="text-carousel"\n >\n {{ emojiText | raw }}\n </div>\n <div\n class="new-search-guide-bub-container-right-btn"\n on-click="handleRightBtnClick"\n >\n 问\n <img\n class="right-btn-icon"\n src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAAqCAMAAAAqEZ1jAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAhOAAAITgBRZYxYAAAAKJQTFRFAAAAenb/RpP/k2j/XXf7cXX6P5z7i2n8W3j7ZHP7jmn9VID7Qpf8jWn8Xnr6iWr8YHb7i2n8RJb9dWz8WXr8mWj9RpP8W3n8bW/8l2j+QJz9Q5f9ToT8fWv9ZW/8lWj9VID8YnX7Pp79QZr9pWb+RJT8m2f9k2j9SYz8jWn9hmr8UIT8fmv8VX78Xnn7d2z8ZHT7WHr7bm77Xnb7Z3D7YHH7RJOQRAAAACJ0Uk5TABAgICAwQEBAWF5gZXBwgICbn5+fo7+/vsLP39/f3urv73XwOA8AAAKfSURBVHja7dbJcuIwFIXhIzCxMTMNcdwMDoMZY4NxeP9X66srEckYQlPVvcvPBhZ8dVSIAvz03xNV/Luq4Xq9Hgo8nfDqjXq97hS1yXZNhXg2Z3o+f1KnLqx62y17Pp5smp+158EUaW6I52rkxLF3eoNpt1Ne+bR+Fd8U5Oc8Px6P5M0Evgq11ytpy0jgbk6e5cSxd2pb7yKOikpTouWyhbsNMsnpefZpOzsCI7c8brkM74/LqFSC7HkwVTu9lsB14ZJy745LlDdV5+3iQTXC7s9z3pNEggOh9s3woOFqJT2BmzUSLnMQEEeeh2+rkraiOrjZeL+XXEBwyp71Ybg+hWL+iltGt8ftKQI9QMzSlDxz9VofssIMdxitdJEvbo3jxqAGKXtt6N4OkpvgkmiFa50Ch1UU8zab/Ya4Br/IUnnewHCHg+FEh7/ExUIXdq+KG4N7z3hfzXDkaa5FmGpdMENrYWWjaoDrJtJLu4ajFFfbUduryN1ue4brb2KpjSvgvETe53R24U6Ggz+RYJnsCTMujmMJ9qELErkv9y7cyXAGtNCoI2Dqx9ymAl1bcYMLJ2NO5fZ2dmHLxiBGrJlxEAl7M1HkTFUzseeiWHOxYK+CrwLltRX3qTk7/4PbTXDdaBHLxytMdcllaaA56U1RSEyU56M0jotfYBLvynM091ni0GGtPO73nLkR7AaK6yqOKnG1g+wXrnqZz9nrw87bszdjjn/dDGffbgdX9YmT4HykaoLTp/UABGfyypx7a1yFNb0wpl7BddW8geSO5JU5TE63xhmOPb2uok8reN1Nrn4qjQNBlmfdvkB5beaoMgdP4LpFgbNuX3svtSwABoZ7WPOKa0Inxgl7DurMdfFXVV7savjK8WQ1/cz5+Q9e7A/jUZeiPQO0fwAAAABJRU5ErkJggg=="\n >\n <border-animation-svg\n s-ref="border-animation"\n width="62"\n height="26"\n border-radius="15"\n padding="2"\n liner-color-config="{{linerColorConfig}}"\n />\n </div>\n </a>\n </fragment>\n <fragment s-else>\n <a\n s-if="{{panel.url}}"\n class="tag-a panel-link"\n href="{{panel.url}}"\n target="_blank"\n >\n <img\n src="{{panel.icon}}"\n alt=""\n >\n <span class="capsule-text shrink-hide">{{ displayText }}</span>\n </a>\n <fragment s-else>\n <img\n src="{{panel.icon}}"\n alt=""\n >\n <span class="capsule-text shrink-hide">{{ displayText }}</span>\n </fragment>\n </fragment>\n </div>\n ',_l.trimWhitespace="all",_l.components={"border-animation-svg":Main$h},_l.computed={ubcShowLog:function(){return JSON.stringify({value:"capsule_office",ext:{area:this.data.get("area"),valueInfo:[{component_name:"shortcuts",component_content:this.data.get("panel").button_id}]}})},hideIconHoverColor:function(){var e=this.data.get("panel")||{},t=e.config||{};return Boolean(t.hideIconHoverColor||e.hideIconHoverColor)},displayText:function(){var e=this.data.get("panel")||{},t=this.data.get("hideAi");return e.button_text||getPanelDisplayText(e,t)}},_l);function getCursortPosition(e){var t=0;if(document.selection){e.focus();var n=document.selection.createRange(),i=0;e&&e.value&&(i=e.value.length),n.moveStart("character",-i),t=n.text.length-1}else(e.selectionStart||"0"===e.selectionStart)&&(t=e.selectionStart);return t}var ImeTrack=function(){function e(e){var t=this;t.logs=[],t.opts=e||{},t.opts.logmaxnum=e.logmaxnum||10,t.opts.adv=e.adv||!1,this.onLogChange=e.onLogChange,void 0===t.opts.innerchange&&(t.opts.innerchange=!0),t.ipt=e.ipt,t._kdcode=0,t._kdevt={},t._keyposition=0,t.ipt&&(t.ipt.onkeydown=function(e){var n=e||window.event;t._kdcode=n.keyCode||n.which,t._kdevt=n},t.ipt.onkeyup=function(e){var n=e||window.event,i=n.keyCode||n.which;t._kdcode&&(t.addLog({ku:i,type:"upsave"}),t._kdcode=0,t._kdevt={},t.oldval=t.ipt.value||t.ipt.textContent)},t.ipt.onpaste=function(e){t._kdevt.ctrlKey?t.addLog({type:"unval-paste-key"}):t.addLog({type:"unval-paste-mouse"})},t.oldval=t.ipt.value||t.ipt.textContent||"",t.inputchangeHandle=function(){if(t._kdcode)t.addLog({type:"unval-change-key"});else{var e="";t.logs.length&&(new Date).getTime()-function(){for(var e=t.logs.length-1;e<t.logs.length-1;e--)if(-1===t.logs[e].type.indexOf("unval-"))return t.logs[e].time;return 0}()<300&&(e="unval-"),t.addLog({type:e+"change-unkey"})}},t.timmer,t.opts.innerchange&&(t.ipt.onfocus=function(e){t.timmer=setInterval((function(){t.ipt.value===t.oldval&&t.ipt.textContent===t.oldval||(t.oldval=t.ipt.value||t.ipt.textContent,t.inputchangeHandle())}),200)},t.ipt.onblur=function(){clearInterval(t.timmer)}))}return e.prototype={checkLog:function(e){for(var t=this.logs.length,n=!1;t>0;)t--,-1!==this.logs[t].type.indexOf("unval-")?(e.type=(-1===e.type.indexOf("unval-")?"":"unval-")+this.logs[t].type.replace("unval-","")+"-"+e.type.replace("unval-",""),this.logs[t]=e,n=!0):t=-2;if(n)return!1;for(;this.logs.length>=this.opts.logmaxnum;)this.logs.shift();return!0},analyseLog:function(){var e=this;if(this.logs.length>0&&-1===this.logs[this.logs.length-1].type.indexOf("unval")){var t=this.logs[this.logs.length-1],n=t.val.substring(0,t.start),i=t.val.substring(t.start,t.cursor),a=t.val.substring(t.cursor),o="",s="",r=function(){if(e.opts.adv)for(var t=0;t<i.length;t++)i.charCodeAt(t)>256&&(o=i.substring(0,t+1),s=i.substring(t+1))};229===t.kd?i.charCodeAt(i.length-1)>256||!i.match(/[\x00-\x80]/g)?(this._keyposition=getCursortPosition(this.ipt),t.type+="-endime",0===i.length&&(t.type+="-cancelime")):(t.type+="-imeinput",r()):t.type.indexOf("paste-mouse")>-1?this._keyposition=getCursortPosition(this.ipt):t.type.indexOf("change-unkey")>-1?0===i.length?(this._keyposition=getCursortPosition(this.ipt),this.logs.length>1&&this.logs[this.logs.length-2].type.indexOf("upsave")>-1&&(t.type+="-link")):i.charCodeAt(i.length-1)>256||!i.match(/[\x00-\x80]/g)?(this._keyposition=getCursortPosition(this.ipt),t.type+="-endime"):(t.type+="-imeinput",r()):this._keyposition=getCursortPosition(this.ipt),this.opts.adv&&(t.type+="-adv",t.strA=n,t.strB=i,t.strB1=o,t.strB2=s,t.strC=a),this.onLogChange&&this.onLogChange.call(this,t)}},addLog:function(e){e.kd=this._kdcode,e.val=this.ipt.value||this.ipt.textContent,e.start=this._keyposition,e.cursor=getCursortPosition(this.ipt),e.type=e.type||0,e.time=(new Date).getTime(),0!==this.logs.length&&this.logs[this.logs.length-1].val===e.val&&-1===this.logs[this.logs.length-1].type.indexOf("unval-")&&-1===e.type.indexOf("unval-")||(this.checkLog(e)&&this.logs.push(e),this.analyseLog())},getLog:function(){return this.logs.slice(0)},triggerInputChange:function(){this.inputchangeHandle()},diffLog:function(){for(var e=[],t=!1,n=0;n<this.logs.length;n++)if(0!==n){var i=this.logs[n];if(i.strB&&i.strA){if(0===i.strB.length&&i.strA.length<this.logs[n-1].strA.length){e=[];continue}if(i.type.indexOf("link")>-1||i.type.indexOf("paste")>-1){e=[];continue}}var a=i.time-this.logs[n-1].time;a>3e3&&(e=[]);var o=0,s=(i.val.match(/[^\x00-\x80]/g)||[]).length-(this.logs[n-1].val.match(/[^\x00-\x80]/g)||[]).length;s>0?o=1:s=(i.val.match(/[\x00-\x80]/g)||[]).length-(this.logs[n-1].val.match(/[\x00-\x80]/g)||[]).length,i.type.indexOf("ime")>-1?(o+=2,t=!0):i.type.indexOf("unval")>-1&&t?o+=2:t=!1,s>0&&e.push(o,s,a)}return e}},e}();function getQueryString(e){if("undefined"==typeof window)return"";for(var t=window.location.search.substring(1).split("&"),n=0;n<t.length;n++){var i=t[n].split("=");if(decodeURIComponent(i[0])===e)return decodeURIComponent(i[1]||"")}return""}var store=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=window.bds||{};e.se=e.se||{};var t={},n=window,i=n.document,a="localStorage",o="globalStorage",s="__storejs__",r=null;if(t.disabled=!1,t.set=function(){},t.get=function(){},t.remove=function(){},t.clear=function(){},t.transact=function(e,n,i){var a=t.get(e);null==i&&(i=n,n=null),void 0===a&&(a=n||{}),i(a),t.set(e,a)},t.getAll=function(){},t.serialize=function(e){return String(e)},t.deserialize=function(e){if("string"==typeof e)return e},function(){try{return a in n&&n[a]}catch(e){return!1}}())r=n[a],t.set=function(e,n){if(void 0===n)return t.remove(e);r.setItem(e,t.serialize(n))},t.get=function(e){return t.deserialize(r.getItem(e))},t.remove=function(e){r.removeItem(e)},t.clear=function(){r.clear()},t.getAll=function(){for(var e={},n=0;n<r.length;++n){var i=r.key(n);e[i]=t.get(i)}return e};else if(function(){try{return o in n&&n[o]&&n[o][n.location.hostname]}catch(e){return!1}}())r=n[o][n.location.hostname],t.set=function(e,n){if(void 0===n)return t.remove(e);r[e]=t.serialize(n)},t.get=function(e){return t.deserialize(r[e]&&r[e].value)},t.remove=function(e){delete r[e]},t.clear=function(){for(var e in r)delete r[e]},t.getAll=function(){for(var e={},n=0;n<r.length;++n){var i=r.key(n);e[i]=t.get(i)}return e};else if(i.documentElement.addBehavior){var l,c;try{(c=new ActiveXObject("htmlfile")).open(),c.write("<script>document.w=window<\/script><iframe src='/favicon.ico'></iframe>"),c.close(),l=c.w.frames[0].document.createElement("div")}catch(p){l=i.createElement("div"),c=i.body}var d=function(e){return function(){var n=Array.prototype.slice.call(arguments,0);n.unshift(l),c.appendChild(l),l.addBehavior("#default#userData"),l.load(a);var i=e.apply(t,n);return c.removeChild(l),i}},u=function(e){return"_"+e};t.set=d((function(e,n,i){if(n=u(n),void 0===i)return t.remove(n);e.setAttribute(n,t.serialize(i)),e.save(a)})),t.get=d((function(e,n){return n=u(n),t.deserialize(e.getAttribute(n))})),t.remove=d((function(e,t){t=u(t),e.removeAttribute(t),e.save(a)})),t.clear=d((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(a);for(var n,i=0;n=t[i];i++)e.removeAttribute(n.name);e.save(a)})),t.getAll=d((function(e){var n=e.XMLDocument.documentElement.attributes;e.load(a);for(var i,o={},s=0;i=n[s];++s)o[i]=t.get(i);return o}))}try{t.set(s,s),t.get(s)!=s&&(t.disabled=!0),t.remove(s)}catch(p){t.disabled=!0}return t}}();function checkHsugIn(e){return e.length>=4||encodeURIComponent(e).length>=18}function checkHsugShow(e){return e.length>=1&&encodeURIComponent(e).length>3}function bdsStore(){return store}var _SugFooterComponent=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{showFooter:!1,sugType:"sug",showFeedback:!1,showHistory:!1,isLogin:!1}}},{key:"handleFeedbackClick",value:function(){this.fire("feedback-click")}},{key:"handleCloseHistoryClick",value:function(){this.fire("close-history-click")}},{key:"handleDeleteHistoryClick",value:function(){this.fire("delete-history-click")}},{key:"handleMoreHistoryClick",value:function(){this.fire("more-history-click")}},{key:"handleSearchBtnClick",value:function(){this.fire("search-btn-click")}}])}(san.Component);_SugFooterComponent.trimWhitespace="all",_SugFooterComponent.template='\n <div class="ci-sug-footer-root">\n <div s-if="{{showSearchBtn}}" class="ci-sug-search-btn-wrapper">\n <button class="ci-sug-search-btn" on-click="handleSearchBtnClick"><img src="https://psstatic.cdn.bcebos.com/basics/aichat/search_1777004337000.png" alt="">百度一下</button>\n </div>\n <div class="bdsug-feedback-tool-zone">\n <template s-if="showFooter">\n <span\n s-if="{{sugType !== \'his\' && showFeedback}}"\n class="bdsug-feedback"\n on-click="handleFeedbackClick"\n >反馈</span>\n\n <template s-else-if="{{sugType === \'his\' && showHistory}}">\n <template s-if="isLogin">\n <span\n s-if="showClickHistory"\n class="setup_storeSug"\n on-click="handleCloseHistoryClick"\n >关闭历史</span>\n <span\n class="del_all_storeSug"\n on-click="handleDeleteHistoryClick"\n >删除历史</span>\n <a\n class="more_storeSug"\n href="http://i.baidu.com/my/history?from=pssug"\n target="_blank"\n on-click="handleMoreHistoryClick"\n >更多历史</a>\n </template>\n <span\n s-else-if="showClickHistory"\n class="setup_storeSug"\n on-click="handleCloseHistoryClick"\n >关闭历史</span>\n </template>\n </template>\n </div>\n </div>\n ',_SugFooterComponent.computed={showClickHistory:function(){var e=this.data.get("scene");return"a"===e||"home"===e||"pd"===e}};var SugFooterComponent=_SugFooterComponent,_BoldSugComponent=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{list:[]}}}])}(san.Component);_BoldSugComponent.trimWhitespace="all",_BoldSugComponent.template='\n <span s-for="boldItem in list">\n <b s-if="boldItem.bold">{{boldItem.text}}</b>\n <span class="sug-highlight" s-else-if="boldItem.hightLight">{{boldItem.text}}</span>\n <template s-else>{{boldItem.text}}</template>\n </span>\n ';var BoldSugComponent=_BoldSugComponent;function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var browser={exports:{}},debug$1={exports:{}},s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d,ms=function(e,t){t=t||{};var n=_typeof(e);if("string"===n&&e.length>0)return parse(e);if("number"===n&&!1===isNaN(e))return t.long?fmtLong(e):fmtShort(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function fmtShort(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}!function(e,t){var n;function i(e){function i(){if(i.enabled){var e=i,a=+new Date,o=a-(n||a);e.diff=o,e.prev=n,e.curr=a,n=a;for(var s=new Array(arguments.length),r=0;r<s.length;r++)s[r]=arguments[r];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var l=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,(function(n,i){if("%%"===n)return n;l++;var a=t.formatters[i];if("function"==typeof a){var o=s[l];n=a.call(e,o),s.splice(l,1),l--}return n})),t.formatArgs.call(e,s),(i.log||t.log||console.log.bind(console)).apply(e,s)}}return i.namespace=e,i.enabled=t.enabled(e),i.useColors=t.useColors(),i.color=function(e){var n,i=0;for(n in e)i=(i<<5)-i+e.charCodeAt(n),i|=0;return t.colors[Math.abs(i)%t.colors.length]}(e),"function"==typeof t.init&&t.init(i),i}(t=e.exports=i.debug=i["default"]=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),i=n.length,a=0;a<i;a++)n[a]&&("-"===(e=n[a].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,i;for(n=0,i=t.skips.length;n<i;n++)if(t.skips[n].test(e))return!1;for(n=0,i=t.names.length;n<i;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=ms,t.names=[],t.skips=[],t.formatters={}}(debug$1,debug$1.exports);var debugExports=debug$1.exports;!function(e,t){function n(){var e;try{e=t.storage.debug}catch(n){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=debugExports).log=function(){return"object"==("undefined"==typeof console?"undefined":_typeof(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var a=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(a++,"%c"===e&&(o=a))})),e.splice(o,0,i)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(n){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},t.enable(n())}(browser,browser.exports);var browserExports=browser.exports,debug=browserExports("jsonp"),jsonp_1=jsonp$1,count=0;function noop$1(){}function jsonp$1(e,t,n){"function"==typeof t&&(n=t,t={}),t||(t={});var i,a,o=t.prefix||"__jp",s=t.name||o+count++,r=t.param||"callback",l=null!=t.timeout?t.timeout:6e4,c=encodeURIComponent,d=document.getElementsByTagName("script")[0]||document.head;function u(){i.parentNode&&i.parentNode.removeChild(i),window[s]=noop$1,a&&clearTimeout(a)}return l&&(a=setTimeout((function(){u(),n&&n(new Error("Timeout"))}),l)),window[s]=function(e){debug("jsonp got",e),u(),n&&n(null,e)},e=(e+=(~e.indexOf("?")?"&":"?")+r+"="+c(s)).replace("?&","?"),debug('jsonp req "%s"',e),(i=document.createElement("script")).src=e,d.parentNode.insertBefore(i,d),function(){window[s]&&u()}}var jsonpLib=getDefaultExportFromCjs(jsonp_1),BDSUG_TIMESTAMP_START=14183424e5,BDSUG_QUERY_LEV=4;function deriveSampleConfig(e){return{changeGoSug:!0,aiHoverUpgrade:e.includes("PC_SUG_AI_HOVER_UPGRADE"),aiHoverUpgradeNoAvoid:e.includes("PC_SUG_AI_HOVER_UPGRADE_NO_AVOID"),highlightExperiment:e.includes("PC_SUG_HIGHLIGHT_EXPERIMENT"),aiTagEnable:e.includes("PC_SUG_AI_TAG_ENABLE")}}function judeAiHis(e){return!!e&&["his_pc_aipic","his_pc_aifile","his_pc_aiintention","his_pc_ai","ai_guide"].includes(e)}function argbToRgba(e){if(!e||e.length<9)return"";var t=parseInt(e.slice(1,3),16)/255;return"rgba(".concat(parseInt(e.slice(3,5),16),",").concat(parseInt(e.slice(5,7),16),",").concat(parseInt(e.slice(7,9),16),",").concat(t,")")}function isShowDirectSug(e){if("1020"===e.type&&e.value){var t=e.value.name[0]&&e.value.name[0].text||"",n=e.value.img,i=e.value.brief||"",a=e.value.info||"";if(!t)return!1;if(n&&!i&&!a)return!1}return!0}function getSugData(e,t){var n,i=(t||{}).isHis,a=[];if(Array.isArray(e)&&e.length>0){var o,s=_createForOfIteratorHelper(e);try{for(s.s();!(o=s.n()).done;){var r=o.value;if("sug"===r.type||"direct_new"===r.type||"ai_guide"===r.type){var l,c=!1,d=_createForOfIteratorHelper(a);try{for(d.s();!(l=d.n()).done;){var u=l.value;if("direct"!==u.type&&r.q===u.query&&r.type!==u.type){c=!0;break}}}catch(g){d.e(g)}finally{d.f()}if(!c){var p={};if(r.info&&(null==(n=r.info.vec_str_raw)?void 0:n[0]))try{p=JSON.parse(r.info.vec_str_raw[0])}catch(_){console.error(_)}var h="direct_new"===r.type&&p?p.value:null,f="direct_new"===r.type&&h?h.query||h.name&&h.name[0].text||"":r.q;("sug"===r.type||isShowDirectSug(p))&&a.push({query:f,type:r.type,otherData:r.st,info:p,no_ai_sug:r.no_ai_sug||0,pos:r.pos})}}else{var m=(r.q||"").trim();if(!m)continue;a.push({query:m,type:r.type,otherData:r.st,no_ai_sug:r.no_ai_sug||0,pinyin:i?"|":"",pos:r.pos,payload:r.payload})}}}catch(g){s.e(g)}finally{s.f()}}return a}function findHiddenInput(e,t){if(!e)return null;for(var n=e.querySelectorAll('input[type="hidden"]'),i=0,a=Array.from(n);i<a.length;i++){var o=a[i];if(o.name===t)return o}return null}function xss(e){return e.toString().replace(/[<%3C]/g,"&lt;").replace(/[>%3E]/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function getCursorPosition$1(e){var t=0,n=window.getSelection();if(n.rangeCount>0){var i=n.getRangeAt(0);i.commonAncestorContainer.parentNode===e&&(t=i.startOffset)}return t}function getHisData(){var e=[],t=[];try{var n=bdsStore().get("BDSUGSTORED");t=n&&JSON.parse(n)||[]}catch(r){console.error(r)}var i,a=_createForOfIteratorHelper(t);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=o.t?1*o.t+BDSUG_TIMESTAMP_START:(new Date).getTime(),r={time:s=Math.round(s/1e3),kw:decodeURIComponent(o.q),hide:o.hide};o.s&&o.s>BDSUG_QUERY_LEV&&(r.fq=o.s-BDSUG_QUERY_LEV+1),r.hide||(delete r.hide,e.push(r)),e.length>10&&e.shift()}}catch(l){a.e(l)}finally{a.f()}return e}function limitWd(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:160;if(""===e)return"";var n=(e+="").length,i=0;if(n<=Math.floor(t/2))return e;for(var a=0;a<n;a++){if((i+=e.charCodeAt(a)>255?2:1)===t)return e.substring(0,a+1);if(i>t)return e.substring(0,a)}return e}function subByte(e,t){var n,i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"…",a=[],o=_createForOfIteratorHelper(e);try{for(o.s();!(n=o.n()).done;){var s=n.value;s.charCodeAt(0)>255&&a.push("*"),a.push(s)}}catch(r){o.e(r)}finally{o.f()}return t&&t>0&&a.length>t?a.join("").substring(0,t-1).replace(/\*/g,"")+i:e}function setBold(e,t){var n=subByte(e,66);if(!n)return[];if(!t)return[{text:n}];var i=n.indexOf(t);if(-1===i)return[{text:n,bold:!0}];var a=[];return i>0&&a.push({text:n.slice(0,i)}),a.push({text:n.slice(i,i+t.length)}),i+t.length<n.length&&a.push({text:n.slice(i+t.length),bold:!0}),a}function setHighlightByPos(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:41,i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"…";if(!e)return[];var a=subByte(e,n,i);if(!a)return[];if(!t||0===t.length)return[{text:a}];var o,s=a.endsWith(i)&&a!==e,r=s?a.slice(0,-i.length):a,l=r.length,c=_toConsumableArray(t).filter((function(e){return e.begin>=0&&e.begin<=e.end})).sort((function(e,t){return e.begin-t.begin})),d=[],u=_createForOfIteratorHelper(c);try{for(u.s();!(o=u.n()).done;){var p=o.value,h=Math.min(p.begin,l),f=Math.min(p.end,l-1);if(!(h>f||h>=l))if(0===d.length)d.push({begin:h,end:f});else{var m=d[d.length-1];h<=m.end+1?m.end=Math.max(m.end,f):d.push({begin:h,end:f})}}}catch(w){u.e(w)}finally{u.f()}if(0===d.length)return[{text:a}];for(var g=[],_=0,v=0,b=d;v<b.length;v++){var y=b[v];_<y.begin&&g.push({text:r.slice(_,y.begin)}),g.push({text:r.slice(y.begin,y.end+1),hightLight:!0}),_=y.end+1}return _<l&&g.push({text:r.slice(_)}),s&&g.push({text:i}),g}function getSets(bdsComm){var _ref22=bdsComm||{},personalData=_ref22.personalData;return personalData?"string"==typeof personalData?eval("("+personalData+")"):personalData:{}}function getSetSug(e){var t=!0,n=navigator.cookieEnabled&&/sug=(\d)/.test(document.cookie)?RegExp.$1:3;return 0===e.errno&&e.sugSet&&"SUCCESS"===e.sugSet.ErrMsg?"0"===e.sugSet.value&&(t=!1):"0"===n&&(t=!1),t}function getSetSugStore(e){var t=!0,n=navigator.cookieEnabled&&/sugstore=(\d)/.test(document.cookie)?RegExp.$1:1;return 0===e.errno&&e.sugStoreSet&&"SUCCESS"===e.sugStoreSet.ErrMsg?"0"===e.sugStoreSet.value&&(t=!1):"0"===n&&(t=!1),t}function jsonp(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=t.signal,i=__objRest(t,["signal"]);return new Promise((function(t,a){if(null==n?void 0:n.aborted)return a(new DOMException("Aborted","AbortError"));var o=jsonpLib(e,i,(function(e,n){return e?a(e):t(n)}));n&&n.addEventListener("abort",(function(){o(),a(new DOMException("Aborted","AbortError"))}))}))}var _SugTagStyle=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{tag:{}}}}])}(san.Component);_SugTagStyle.trimWhitespace="all",_SugTagStyle.template='\n <span>\n <span\n s-if="tag.tag_type === 1"\n class="sug-tag-comm sug-tag-text"\n style="\n border-color: {{tag.border_color | argbToRgba}};\n background-color: {{tag.bg_color | argbToRgba}};\n color: {{tag.text_color | argbToRgba}};\n "\n >\n {{tag.text}}\n </span>\n <img\n s-else-if="{{tag.tag_type === 2 && tag.image}}"\n class="sug-tag-comm sug-tag-img"\n src="{{tag.image}}"\n >\n </span>\n ',_SugTagStyle.filters={argbToRgba:argbToRgba};var SugTagStyle=_SugTagStyle,_SugTag=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).components={"sug-tag-style":SugTagStyle},e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{item:{}}}}])}(san.Component);_SugTag.trimWhitespace="all",_SugTag.template='\n <span>\n <template s-if="{{item.tag_style_list}}">\n <sug-tag-style s-for="tag in item.tag_style_list" tag="{{tag}}"/>\n </template>\n\n <sug-tag-style s-if="{{item.tag_style}}" tag="{{item.tag_style}}"></sug-tag-style>\n\n <span s-if="{{item.tag}}" class="sug-tag-comm sug-new-tag sug-new-tag-{{item.tagColor}}">\n {{item.tag}}\n </span>\n </span>\n ';var SugTag=_SugTag,_DirectNewSugComponent=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{item:{}}}}])}(san.Component);_DirectNewSugComponent.trimWhitespace="all",_DirectNewSugComponent.components={"bold-sug":BoldSugComponent,"sug-tag":SugTag},_DirectNewSugComponent.template='\n <div\n s-if="item.isDouble"\n s-is="{{item.link ? \'a\' : \'div\'}}"\n class="direct-sug-wrap"\n target="_blank"\n href="{{item.link}}"\n >\n <template s-if="item.img">\n <div class="left-img-wrap">\n <img class="left-img" src="{{item.img}}" alt="" />\n </div>\n </template>\n <div class="content">\n <div class="header">\n <span class="name">\n {{item.name}}\n </span>\n <sug-tag item="{{item.infoValue}}"></sug-tag>\n </div>\n <div class="more">\n <span s-if="item.brief" class="brief">{{item.brief}}</span>\n <span s-if="item.infoValue.info" class="info">{{item.infoValue.info}}</span>\n </div>\n </div>\n </div>\n <span s-else>\n <bold-sug list="{{item.boldInfo}}"></bold-sug>\n <sug-tag item="{{item.infoValue}}"></sug-tag>\n </span>\n ';var DirectNewSugComponent=_DirectNewSugComponent,_SuggestionsListComponent=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{suggestions:[],activeIndex:-1,sampleConfig:{},showHistory:!1}}},{key:"isAddFilePreffix",value:function(e){var t,n,i,a=e.payload,o=e.query;return((null==(t=null==a?void 0:a.files)?void 0:t.length)&&(null==(i=null==(n=null==a?void 0:a.files[0])?void 0:n.file_name)?void 0:i.length)||0)+o.length<30}},{key:"needFileSuffix",value:function(e){var t=e.payload;if(!t)return!1;var n=null==t?void 0:t.files;return(null==n?void 0:n.length)>1}},{key:"getFileUrl",value:function(e){var t=e.payload.files;if(t.length){var n=t[0],i=suffixToFileType(n.file_type);return VALID_FILE_ICONS[i]||VALID_FILE_ICONS.unknown}return""}},{key:"getItemClass",value:function(e){var t=["bdsug-item","c-line-clamp-1","ask-ai-tail"],n=this.data.get("sampleConfig"),i=n.aiHoverUpgrade,a=n.aiHoverUpgradeNoAvoid;return(i||a)&&t.push("bdsug-ai-hover-upgrade"),this.shouldColorRed(e)&&t.push("bdsug-color-red"),t.join(" ")}},{key:"isHisSug",value:function(e){return e.type.includes("his")||"store"===e.type}},{key:"shouldFullWidth",value:function(e){return e.isDouble||this.isHisSug(e)}},{key:"shouldShowAiHover",value:function(e){return this.data.get("noAvoidAiSug")||!e.no_ai_sug}},{key:"shouldColorRed",value:function(e){return!this.data.get("sampleConfig").highlightExperiment&&!this.isHisSug(e)&&!e.isDouble}},{key:"shouldShowIcon",value:function(e){return"direct_new"!==e.type||!e.isDouble}},{key:"handleClick",value:function(e,t){this.fire("item-click",{item:e,index:t})}},{key:"handleMouseenter",value:function(e,t){this.fire("item-mouseenter",{item:e,index:t})}},{key:"handleMouseleave",value:function(){this.fire("item-mouseleave")}},{key:"handleItemHisDeleteClick",value:function(e,t,n){n.stopPropagation(),this.fire("item-his-delete",{item:e,index:t})}},{key:"handleAskAiClick",value:function(e,t){e.stopPropagation(),this.fire("ask-ai-click",{area:"sug_aihover",item:t})}},{key:"handleAskAiBlankClick",value:function(e,t){e.stopPropagation(),this.fire("ask-ai-click",{area:"sug_aihover_blank",item:t})}},{key:"handleAskAiMouseenter",value:function(e,t){this.fire("ask-ai-mouseenter",{area:"text",item:t})}},{key:"handleAskAiBlankMouseenter",value:function(e,t){this.fire("ask-ai-mouseenter",{area:"blank",item:t})}}])}(san.Component);_SuggestionsListComponent.trimWhitespace="all",_SuggestionsListComponent.components={"direct-new-sug":DirectNewSugComponent,"bold-sug":BoldSugComponent},_SuggestionsListComponent.template='\n <ul>\n <li\n s-for="item, index in suggestions"\n class="\n {{getItemClass(item, sampleConfig)}}\n {{index === activeIndex ? \'bdsug-s\' : \'\'}}"\n data-no-ai-sug="{{item.no_ai_sug || 0}}"\n data-type="{{item.type}}"\n on-click="handleClick(item, index)"\n on-mouseenter="handleMouseenter(item, index)"\n on-mouseleave="handleMouseleave"\n >\n <span class="sug-content {{shouldFullWidth(item) ? \'sug-full-width\' : \'\'}}">\n <span s-if="{{shouldShowIcon(item)}}" class="search-sug-icon {{item.type}}"></span>\n <template s-if="item.type === \'ai_guide\'">\n <bold-sug list="{{item.boldInfo}}"></bold-sug>\n <div class="bdsug-ai-guide">\n 问\n <img class="bdsug-logo" src="https://psstatic.cdn.bcebos.com/basics/aichat/ai-icon_1753948692000.png">\n </div>\n </template>\n <direct-new-sug s-elif="item.type === \'direct_new\'" item="{{item}}"></direct-new-sug>\n <template s-else>\n <bold-sug list="{{item.boldInfo}}"></bold-sug>\n <div s-if="item.payload" class="pc-aifile-img-container">\n <div\n s-if="(item.type === \'his_pc_aipic\' || item.type === \'his_pc_aiintention\') && item.payload.files.length > 1"\n class="img-more-mask"\n >\n {{item.payload.files.length}}\n </div>\n <img\n s-if="item.payload.files.length"\n class="pc-aifile-single-img"\n src="{{getFileUrl(item)}}"\n >\n <div class="pc-aifile-info bdsug-s-aifile">\n <div s-if="isAddFilePreffix(item)" class="file-name">{{item.payload.files[0].file_name}}</div>\n <div s-if="needFileSuffix(item)">等{{item.payload.files.length}}个{{item.type === \'his_pc_aifile\' ? \'文件\' : \'图片\'}}</div>\n </div>\n </div>\n </template>\n <u\n s-if="{{isHisSug(item) && showHistory && isLogin}}"\n class="bdsug-store-del bdsug-store-del-cloud"\n title="如您不需要此搜索历史提示,可在右上角搜索设置中关闭"\n on-click="handleItemHisDeleteClick(item, index, $event)"\n >\n 删除\n </u>\n </span>\n <span\n s-if="{{sampleConfig.aiTagEnable && !isHisSug(item)}}"\n class="ask-ai-tail-wrapper"\n >\n <div\n s-if="shouldShowAiHover(item)"\n class="ask-ai-tail"\n on-click="handleAskAiClick($event, item)"\n on-mouseenter="handleAskAiMouseenter($event, item)"\n >\n <div class="ask-ai-tail-line"></div>\n <div \n class="ask-ai-tail-icon"\n ></div>\n <div class="ask-ai-tail-text">用文心助手回答</div>\n </div>\n <div\n class="ask-ai-tail-blank"\n on-click="handleAskAiBlankClick($event, item)"\n on-mouseenter="handleAskAiBlankMouseenter($event, item)"\n ></div>\n </span>\n </li>\n </ul>\n ',_SuggestionsListComponent.computed={noAvoidAiSug:function(){return this.data.get("sampleConfig.aiHoverUpgradeNoAvoid")}};var SuggestionsListComponent=_SuggestionsListComponent,SugHistoryStore=function(){return _createClass((function n(e){_classCallCheck(this,n),this.storearr=[],this.storestr="[]",this.context=e}),[{key:"write",value:function(){var e=this.context.getBdsCommData(),t=e.pinyin,n=e.query;if(n&&t&&checkHsugIn(n)){this.get();var i=encodeURIComponent(n.toLowerCase()),a=encodeURIComponent(t.toLowerCase()),o=BDSUG_QUERY_LEV,s=(new Date).getTime()-BDSUG_TIMESTAMP_START,r=-1;this.storearr.forEach((function(e,t){e.p===a&&(e.q=i,o=(e.s||BDSUG_QUERY_LEV)+1,e.t=s,r=t)})),r>-1&&this.storearr.splice(r,1);var l=document.location.search||location.search;if(/base_query/.test(l))return;var c=this.context.showsugstore?0:1;this.storearr.push({q:i,p:a,s:o,t:s,hide:c}),this.storearr.length>50&&this.storearr.shift(),this.set()}if(!n&&!t){var d=new URLSearchParams(window.location.search),u=d.get("wd")||d.get("word");if(!u||!checkHsugIn(u))return;this.get();var p=encodeURIComponent(u.toLowerCase()),h=String(Date.now()),f=Date.now()-BDSUG_TIMESTAMP_START,m=this.storearr.findIndex((function(e){return e.q===p}));if(m>-1){var g=_slicedToArray(this.storearr.splice(m,1),1)[0];g.t=f,g.s=(g.s||BDSUG_QUERY_LEV)+1,this.storearr.push(g)}else{var _=this.context.showsugstore?0:1;this.storearr.push({q:p,p:h,s:BDSUG_QUERY_LEV,t:f,hide:_}),this.storearr.length>50&&this.storearr.shift()}this.set()}}},{key:"get",value:function(){try{this.storestr=bdsStore().get("BDSUGSTORED"),this.storearr=this.storestr&&JSON.parse(this.storestr)||[]}catch(e){this.storestr="[]",this.storearr=[]}this.storearr.forEach((function(e){e.t=e.t||0,e.s=e.s||4}))}},{key:"set",value:function(){var e="";this.storearr.forEach((function(t,n){e+=(0===n?"":",")+'{"q":"'+t.q+'","p":"'+t.p+'","s":'+t.s+',"t":'+t.t+',"hide":'+(t.hide||0)+"}"})),this.storestr="["+e+"]";try{bdsStore().set("BDSUGSTORED",this.storestr)}catch(t){console.error(t)}}},{key:"check",value:function(){var e=this,t=[];return this.context.showsugstore&&checkHsugShow(this.context.value)&&(this.get(),this.storearr.forEach((function(n){var i=decodeURIComponent(n.q),a=decodeURIComponent(n.p);(i.startsWith(e.context.value.toLowerCase())||a.startsWith(e.context.value.toLowerCase()))&&t.unshift({value:i,pinyin:a,s:n.s,t:n.t})}))),t}},{key:"deleteByQuery",value:function(e){var t=this.storearr.findIndex((function(t){return encodeURIComponent(e)===t.q}));-1!==t&&(this.storearr.splice(t,1),this.set())}},{key:"clear",value:function(){this.storearr=[],this.set()}}])}(),SugTracker=function(){return _createClass((function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,e),this.stat={},this.form=null,this.scene="",this.bdsComm=null,this.form=t.form||null,this.scene=t.scene||"",this.bdsComm=t.bdsComm||null}),[{key:"setForm",value:function(e){this.form=e}},{key:"setBdsComm",value:function(e){this.bdsComm=e}},{key:"addStat",value:function(e,t){var n=encodeURIComponent(t);if(this.form){this.stat[e]=n;var i=findHiddenInput(this.form,e);if(i)i.value=n;else{var a=document.createElement("input");a.type="hidden",a.name=e,a.value=n,this.form.appendChild(a)}}}},{key:"removeStat",value:function(e){this.form&&this.form.querySelectorAll('input[type="hidden"]').forEach((function(t){t.name===e&&t.remove()})),this.stat&&delete this.stat[e]}},{key:"getStat",value:function(e){return this.stat[e]}},{key:"getAllStats",value:function(){return __spreadValues({},this.stat)}},{key:"setNewsRsv",value:function(e){"news"===this.scene&&this.addStat("rsv_dl",{sug:"news_t_sug",box:"news_t_sk",his:"news_t_his"}[e])}},{key:"clearStat",value:function(e){var t,n,i=null==(t=this.bdsComm)?void 0:t.isAsync,a=null==(n=this.bdsComm)?void 0:n.ishome;i&&(this.removeStat("rsp"),this.removeStat("prefixsug"),1===a?this.addStat("rsv_dl","ib"):(this.setNewsRsv("box"),this.addStat("rsv_dl","tb"))),this.removeStat("rsv_n"),this.removeStat("rsv_sug"),this.removeStat("rsv_sug1"),this.removeStat("rsv_sug2"),this.removeStat("rsv_sug3"),this.removeStat("rsv_sug4"),this.removeStat("rsv_sug5"),this.removeStat("rsv_sug6"),this.removeStat("rsv_sug7"),this.removeStat("rsv_sug8"),this.removeStat("rsv_sug9"),this.stat={},null==e||e()}},{key:"reset",value:function(){this.stat={}}}])}(),sparkMd5={exports:{}},module2;module2=sparkMd5,module2.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],i=e[1],a=e[2],o=e[3];i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&a|~i&o)+t[0]-680876936|0)<<7|n>>>25)+i|0)&i|~n&a)+t[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&i)+t[2]+606105819|0)<<17|a>>>15)+o|0)&o|~a&n)+t[3]-1044525330|0)<<22|i>>>10)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&a|~i&o)+t[4]-176418897|0)<<7|n>>>25)+i|0)&i|~n&a)+t[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&i)+t[6]-1473231341|0)<<17|a>>>15)+o|0)&o|~a&n)+t[7]-45705983|0)<<22|i>>>10)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&a|~i&o)+t[8]+1770035416|0)<<7|n>>>25)+i|0)&i|~n&a)+t[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&i)+t[10]-42063|0)<<17|a>>>15)+o|0)&o|~a&n)+t[11]-1990404162|0)<<22|i>>>10)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&a|~i&o)+t[12]+1804603682|0)<<7|n>>>25)+i|0)&i|~n&a)+t[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&i)+t[14]-1502002290|0)<<17|a>>>15)+o|0)&o|~a&n)+t[15]+1236535329|0)<<22|i>>>10)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&o|a&~o)+t[1]-165796510|0)<<5|n>>>27)+i|0)&a|i&~a)+t[6]-1069501632|0)<<9|o>>>23)+n|0)&i|n&~i)+t[11]+643717713|0)<<14|a>>>18)+o|0)&n|o&~n)+t[0]-373897302|0)<<20|i>>>12)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&o|a&~o)+t[5]-701558691|0)<<5|n>>>27)+i|0)&a|i&~a)+t[10]+38016083|0)<<9|o>>>23)+n|0)&i|n&~i)+t[15]-660478335|0)<<14|a>>>18)+o|0)&n|o&~n)+t[4]-405537848|0)<<20|i>>>12)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&o|a&~o)+t[9]+568446438|0)<<5|n>>>27)+i|0)&a|i&~a)+t[14]-1019803690|0)<<9|o>>>23)+n|0)&i|n&~i)+t[3]-187363961|0)<<14|a>>>18)+o|0)&n|o&~n)+t[8]+1163531501|0)<<20|i>>>12)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i&o|a&~o)+t[13]-1444681467|0)<<5|n>>>27)+i|0)&a|i&~a)+t[2]-51403784|0)<<9|o>>>23)+n|0)&i|n&~i)+t[7]+1735328473|0)<<14|a>>>18)+o|0)&n|o&~n)+t[12]-1926607734|0)<<20|i>>>12)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i^a^o)+t[5]-378558|0)<<4|n>>>28)+i|0)^i^a)+t[8]-2022574463|0)<<11|o>>>21)+n|0)^n^i)+t[11]+1839030562|0)<<16|a>>>16)+o|0)^o^n)+t[14]-35309556|0)<<23|i>>>9)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i^a^o)+t[1]-1530992060|0)<<4|n>>>28)+i|0)^i^a)+t[4]+1272893353|0)<<11|o>>>21)+n|0)^n^i)+t[7]-155497632|0)<<16|a>>>16)+o|0)^o^n)+t[10]-1094730640|0)<<23|i>>>9)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i^a^o)+t[13]+681279174|0)<<4|n>>>28)+i|0)^i^a)+t[0]-358537222|0)<<11|o>>>21)+n|0)^n^i)+t[3]-722521979|0)<<16|a>>>16)+o|0)^o^n)+t[6]+76029189|0)<<23|i>>>9)+a|0,i=((i+=((a=((a+=((o=((o+=((n=((n+=(i^a^o)+t[9]-640364487|0)<<4|n>>>28)+i|0)^i^a)+t[12]-421815835|0)<<11|o>>>21)+n|0)^n^i)+t[15]+530742520|0)<<16|a>>>16)+o|0)^o^n)+t[2]-995338651|0)<<23|i>>>9)+a|0,i=((i+=((o=((o+=(i^((n=((n+=(a^(i|~o))+t[0]-198630844|0)<<6|n>>>26)+i|0)|~a))+t[7]+1126891415|0)<<10|o>>>22)+n|0)^((a=((a+=(n^(o|~i))+t[14]-1416354905|0)<<15|a>>>17)+o|0)|~n))+t[5]-57434055|0)<<21|i>>>11)+a|0,i=((i+=((o=((o+=(i^((n=((n+=(a^(i|~o))+t[12]+1700485571|0)<<6|n>>>26)+i|0)|~a))+t[3]-1894986606|0)<<10|o>>>22)+n|0)^((a=((a+=(n^(o|~i))+t[10]-1051523|0)<<15|a>>>17)+o|0)|~n))+t[1]-2054922799|0)<<21|i>>>11)+a|0,i=((i+=((o=((o+=(i^((n=((n+=(a^(i|~o))+t[8]+1873313359|0)<<6|n>>>26)+i|0)|~a))+t[15]-30611744|0)<<10|o>>>22)+n|0)^((a=((a+=(n^(o|~i))+t[6]-1560198380|0)<<15|a>>>17)+o|0)|~n))+t[13]+1309151649|0)<<21|i>>>11)+a|0,i=((i+=((o=((o+=(i^((n=((n+=(a^(i|~o))+t[4]-145523070|0)<<6|n>>>26)+i|0)|~a))+t[11]-1120210379|0)<<10|o>>>22)+n|0)^((a=((a+=(n^(o|~i))+t[2]+718787259|0)<<15|a>>>17)+o|0)|~n))+t[9]-343485551|0)<<21|i>>>11)+a|0,e[0]=n+e[0]|0,e[1]=i+e[1]|0,e[2]=a+e[2]|0,e[3]=o+e[3]|0}function i(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function a(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function o(e){var t,a,o,s,r,l,c=e.length,d=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(d,i(e.substring(t-64,t)));for(a=(e=e.substring(t-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<a;t+=1)o[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(n(d,o),t=0;t<16;t+=1)o[t]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),l=parseInt(s[1],16)||0,o[14]=r,o[15]=l,n(d,o),d}function s(e){var t,i,o,s,r,l,c=e.length,d=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(d,a(e.subarray(t-64,t)));for(i=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<i;t+=1)o[t>>2]|=e[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(n(d,o),t=0;t<16;t+=1)o[t]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(s[2],16),l=parseInt(s[1],16)||0,o[14]=r,o[15]=l,n(d,o),d}function r(e){var n,i="";for(n=0;n<4;n+=1)i+=t[e>>8*n+4&15]+t[e>>8*n&15];return i}function l(e){var t;for(t=0;t<e.length;t+=1)e[t]=r(e[t]);return e.join("")}function c(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function d(e){var t,n=[],i=e.length;for(t=0;t<i-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function u(){this.reset()}return l(o("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(t,n){var i,a,o,s,r=this.byteLength,l=e(t,r),c=r;return void 0!==n&&(c=e(n,r)),l>c?new ArrayBuffer(0):(i=c-l,a=new ArrayBuffer(i),o=new Uint8Array(a),s=new Uint8Array(this,l,i),o.set(s),a)}}(),u.prototype.append=function(e){return this.appendBinary(c(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,a=this._buff.length;for(t=64;t<=a;t+=64)n(this._hash,i(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},u.prototype.end=function(e){var t,n,i=this._buff,a=i.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<a;t+=1)o[t>>2]|=i.charCodeAt(t)<<(t%4<<3);return this._finish(o,a),n=l(this._hash),e&&(n=d(n)),this.reset(),n},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,t){var i,a,o,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;i=(i=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(i[2],16),o=parseInt(i[1],16)||0,e[14]=a,e[15]=o,n(this._hash,e)},u.hash=function(e,t){return u.hashBinary(c(e),t)},u.hashBinary=function(e,t){var n=l(o(e));return t?d(n):n},u.ArrayBuffer=function(){this.reset()},u.ArrayBuffer.prototype.append=function(e){var t,i=function(e,t,n){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e)),i.set(new Uint8Array(t),e.byteLength),i}(this._buff.buffer,e),o=i.length;for(this._length+=e.byteLength,t=64;t<=o;t+=64)n(this._hash,a(i.subarray(t-64,t)));return this._buff=t-64<o?new Uint8Array(i.buffer.slice(t-64)):new Uint8Array(0),this},u.ArrayBuffer.prototype.end=function(e){var t,n,i=this._buff,a=i.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<a;t+=1)o[t>>2]|=i[t]<<(t%4<<3);return this._finish(o,a),n=l(this._hash),e&&(n=d(n)),this.reset(),n},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e=u.prototype.getState.call(this);return e.buff=function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}(e.buff),e},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var n,i=e.length,a=new ArrayBuffer(i),o=new Uint8Array(a);for(n=0;n<i;n+=1)o[n]=e.charCodeAt(n);return t?o:a}(e.buff,!0),u.prototype.setState.call(this,e)},u.ArrayBuffer.prototype.destroy=u.prototype.destroy,u.ArrayBuffer.prototype._finish=u.prototype._finish,u.ArrayBuffer.hash=function(e,t){var n=l(s(new Uint8Array(e)));return t?d(n):n},u}();var sparkMd5Exports=sparkMd5.exports,SparkMD5=getDefaultExportFromCjs(sparkMd5Exports);function getToken(e,t,n){var i=n||"",a=SparkMD5.hash(i);return"".concat(window.btoa("".concat(t,"|").concat(a,"|").concat(Date.now(),"|").concat(e)),"-").concat(e,"-3")}var _Sug=function(e){function n(){var e;return _classCallCheck(this,n),(e=_callSuper(this,n,arguments)).unsubscribes=[],e.requestSeq=0,e.rsv_sug=0,e.rsv_sug1=0,e.rsv_sug3=0,e.rsv_sug4=0,e.rsv_sug7=[0,0,0],e.inputT=0,e.isDisposed=!1,e.pwd="",e.dataCached={},e.timer=null,e.blockInput=!1,e.value="",e.selectBeforeValue=null,e.jqXhr=null,e.sid="",e.showsug=!1,e.showsugstore=!1,e.hoverSug="",e.clickOrSelectSug="",e.needHoverCache=!0,e.lastHistoryInputClickTime=0,e.isHistoryRequesting=!1,e}return _inherits(n,e),_createClass(n,[{key:"initData",value:function(){return{suggestions:[],visible:!1,activeIndex:-1,sid:"",bds:null,sampleConfig:{},isLogin:!1,sug:{sugHost:"",prod:"",showFeedback:!1,showHistory:!1}}}},{key:"attached",value:function(){var e,t,n=this.data.get("form"),i=this.data.get("scene"),a=this.getBdsCommData();this.tracker=new SugTracker({form:n,scene:i,bdsComm:a}),this.historyStore=new SugHistoryStore(this),this.imt=new ImeTrack({adv:!0,innerchange:!1,ipt:null==(t=null==(e=this.getInputComponent())?void 0:e.currentInput)?void 0:t.call(e)}),this.initSug(),this.initInputListen(),this.replayRecentUserClickFocus(),this.bindForm()}},{key:"initSug",value:function(){this.value=this.$input.getValue({keepWhitespace:!0});var e=deriveSampleConfig(this.data.get("samples")||[]);this.data.set("sampleConfig",e),this.addStat("rsv_bp",1===this.getBdsCommData().ishome?0:1),this.updateInitData(),this.getDnsCache(),this.startCircle(),this.clearStat()}},{key:"initInputListen",value:function(){this.listen(EVENTS.INPUT_STATUS_CHANGE,this.onInputStatusChange),this.listen(EVENTS.HIDE_SUG,this.onHideSugEvent),this.listen(EVENTS.MODE_CHANGE,this.onModeChange),this.listen(EVENTS.KEYDOWN,this.onKeydown),this.listen(EVENTS.VALUE_CHANGE,this.onValueChange),this.listen(EVENTS.FILE_CHANGE,this.onFileChange),this.bindInputContainerMouseEnter()}},{key:"replayRecentUserClickFocus",value:function(){var e,t,n,i=null==(e=this.$input)?void 0:e.rootCmpt,a=null==(n=null==(t=this.getInputComponent())?void 0:t.currentInput)?void 0:n.call(t),o=(null==i?void 0:i._lastInputUserClickTime)||0;!a||document.activeElement!==a||Date.now()-o>1e3||this.onInputStatusChange({status:"focus",value:this.$input.getValue({keepWhitespace:!0})||"",isAiEditor:!1,source:FOCUS_SOURCE.USER_CLICK})}},{key:"bindForm",value:function(){var e=this.data.get("form"),t=window.$;e&&t&&(this.onFormSubmit=this.onFormSubmit.bind(this),t(e).on("submit",this.onFormSubmit))}},{key:"updateInitData",value:function(){var e=getSets(this.getBdsCommData()),t=getSetSug(e),n=getSetSugStore(e);this.sugcookie=navigator.cookieEnabled&&/sug=(\d)/.test(document.cookie)?RegExp.$1:3;var i=bdsStore()&&!bdsStore().disabled&&navigator.cookieEnabled;this.showsug=t,this.showsugstore=this.showsug&&i&&n;var a=this.data.get("sid")||"";this.sid=navigator.cookieEnabled&&/H_PS_PSSID=([0-9_]+)/.test(document.cookie)?RegExp.$1:a,this.writeStore(),bdsStore().set("wwwPassLogout",0)}},{key:"detached",value:function(){this.isDisposed=!0,this.unsubscribes.forEach((function(e){return e()})),this.unsubscribes=[],this.$input.offEvent(ListenerEventType.SUG),this.hideSug({clearData:!0})}},{key:"showSug",value:function(){if(!this.hasFiles()&&(this.setActiveIndex(-1),!this.data.get("visible")&&this.data.get("suggestions.length"))){this.data.set("visible",!0);var e=this.value?"sug_board":"his_board";this.sugHisShowSend(e),this.sendShowLog(),this.addStat("rsv_sug1",this.rsv_sug1),this.addStat("rsv_sug7",this.rsv_sug7.join(""))}}},{key:"hideSug",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this.abortBeforeRequest(),this.lastHistoryInputClickTime=0;var t=e.clearData;void 0!==t&&t&&this.data.set("suggestions",[]),this.data.get("visible")&&(this.needHoverCache=!0,this.dataCached[""]=void 0),this.data.set("visible",!1)}},{key:"handleClick",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a,o,s,r,l,c,d,u,p,h,f,m,g=this;return _regenerator().w((function(t){for(;;)switch(t.p=t.n){case 0:if(i=e.item,a=e.index,o=judeAiHis(i.type),s=i.payload,r=[{type:"TEXT",data:{text:{query:i.query}}}],l={sa:"his_aihis",enterType:"his_aihis",area:"his"},s&&s.openInputMode&&(l.openInputMode=s.openInputMode),!o){t.n=5;break}if(!(null==(n=null==s?void 0:s.files)?void 0:n.length)){t.n=4;break}return c=this.$input.getRootData().input||{},d=getToken(c.searchframeLid,c.token,""),t.p=1,t.n=2,UploadFile.uploadAllFile(s,d);case 2:t.v.forEach((function(e,t){var n=s.files[t],i=g.judeFileType(n.file_type);"image"===i?r.push({type:"IMAGE",data:{image:{image_id:e.id,image_url:e.file_url}}}):"file"===i&&r.push({type:"FILE",data:{file:{file_id:e.id,file_name:n.file_name,file_size:+n.file_size,file_type:n.file_name.split(".").pop(),file_url:e.file_url}}})})),r.length>0&&(l.fileInfo=r),t.n=4;break;case 3:t.p=3,m=t.v,console.error("文件上传失败,跳转时不带文件信息:",m);case 4:return t.a(2,void this.jumpToAiChat(i,l));case 5:if("ai_guide"!==i.type){t.n=6;break}return t.a(2,void this.jumpToAiChat(i,{sa:"iks_purpose_dibu",enterType:"sug_direct",area:"sug"}));case 6:this.clickOrSelectSug=i.query,u=this.value,this.selectByIndex(a),this.startCircle(),this.setOq(),this.setPq(),this.addStat("sug",xss(i.query)),this.addStat("rsv_sug2",1),p=this.isHisSug(i),this.nextTick((function(){g.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUG_CLICK,data:{query:i.query,source:p?"his":"sug",index:a}})})),h=this.data.get("isLogin"),f=i.isDouble?"pic":"common",this.sugHisClickSend("click",!p,u,f,{recom_query:i.query,is_log:h?1:0,order:a+1,area:"sug",aisou_text:"",no_ai_value:i.no_ai_sug});case 7:return t.a(2)}}),t,this,[[1,3]])})))}},{key:"judeFileType",value:function(e){return fileTypeMap[e]?"file":"image"}},{key:"handleMouseenter",value:function(e){var t=e.item,n=e.index;this.hoverSug=t.query,this.stopCircle(),this.setActiveIndex(n,"mouseenter");var i=this.data.get("sug.showHistory"),a=this.isHisSug(t),o=this.data.get("isLogin");i&&a&&o&&this.sendUbcLog("show","single_his_delete",{recom_query:t.query}),a||this.sendUbcLog("show","sug_hover",{query:this.value||"",order:n+1,no_ai_value:t.no_ai_sug,aisou_text:"",recom_query:t.query,sug_type:t.isDouble?"pic":"ai_guide"===t.type?"ai":"common"})}},{key:"handleMouseleave",value:function(){this.startCircle(),this.setActiveIndex(-1)}},{key:"setActiveIndex",value:function(e,t){if(this.data.set("activeIndex",e),-1!==e){var n=this.data.get("suggestions")[e];if(n&&n.query){var i=n.query;switch(t){case"keyboard":this.clickOrSelectSug=-1===e?"":i,this.isHisSug(n)||this.sendUbcLog("show","sug_hover",{query:this.value||"",order:e+1,no_ai_value:n.no_ai_sug,aisou_text:"",recom_query:n.query,sug_type:n.isDouble?"pic":"ai_guide"===n.type?"ai":"common"});break;case"mouseenter":this.hoverSug=-1===e?"":i}this.data.set("activeType",t)}}else this.data.set("activeType","")}},{key:"listen",value:function(e,t){var n=this.$input.rootCmpt;if(null==n?void 0:n.__ciEvent){var i=t.bind(this);n.__ciEvent.on(e,i),this.unsubscribes.push((function(){return n.__ciEvent.off(e,i)}))}}},{key:"getInputComponent",value:function(){var e,t;return null==(t=null==(e=this.$input.rootCmpt)?void 0:e.ref)?void 0:t.call(e,"input")}},{key:"bindInputContainerMouseEnter",value:function(){var e,t,n=this,i=null==(t=null==(e=this.$input)?void 0:e.rootCmpt)?void 0:t.el;i&&i.addEventListener("mouseenter",(function(){var e=n.$input.getValue();!n.needHoverCache&&e||(n.needHoverCache=!1,n.request(e))}))}},{key:"onKeydown",value:function(e){if(this.startCircle(),this.setInputT(),this.setRsvSug4(),this.data.get("suggestions").length)if(this.data.get("visible")){if(40===e.keyCode&&(e.preventDefault(),this.moveActive(1)),38===e.keyCode&&(e.preventDefault(),this.moveActive(-1)),13===e.keyCode){var t=this.data.get("activeIndex"),n=this.data.get("activeType");-1!==t&&"keyboard"===n&&(e.preventDefault(),this.addStat("rsv_sug2",0),this.selectByIndex(this.data.get("activeIndex"))),this.getBdsCommData().ishome||this.sendIptLog("enter")}9!==e.keyCode&&27!==e.keyCode||(this.setActiveIndex(-1),this.hideSug()),86===e.keyCode&&e.ctrlKey&&this.addStat("rsv_n",2)}else"ArrowDown"!==e.key&&"ArrowUp"!==e.key||this.request(this.value,{open:!0})}},{key:"moveActive",value:function(e){var t=this.data.get("suggestions"),n=t.length;if(n){var i=this.data.get("activeIndex"),a=-1;1===e?(a=i+1)>=t.length&&(a=-1):(a=i-1)<-1&&(a=n-1);var o=a>-1?t[a].query:this.selectBeforeValue||"";-1===a?(this.selectBeforeValue=null,this.addStat("sug",xss(o)),this.setOq(),this.setPq(),this.addStat("rsv_n",1)):(null===this.selectBeforeValue&&(this.selectBeforeValue=this.value),this.removeStat("sug"),this.removeStat("rsv_n")),this.setInputValue(o,"sug_move"),this.setActiveIndex(a,"keyboard"),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUG_SELECT,data:[this,a,o]})}}},{key:"selectByIndex",value:function(e){var t=this.data.get("suggestions")[e];t&&this.applySuggestion(t)}},{key:"setInputValue",value:function(e,t){this.$input.setValue({value:e,options:{source:t}}),this.value=e}},{key:"applySuggestion",value:function(e){var t=e.query;t&&("ai_guide"!==e.type?(this.setInputValue(t,"sug_click"),this.$input.blur()):this.jumpToAiChat(e,{sa:"iks_purpose_dibu",enterType:"sug_direct",area:"sug"}))}},{key:"onValueChange",value:function(e){var t=e.value,n=e.isAiEditor,i=e.options,a=this.blockInput,o=this.data.get("visible"),s=i.handleSetValue,r=i.source,l=a||["sug_move","sug_click"].includes(r)||n;s&&(this.value=t,l||(this.needHoverCache=!0,this.data.set("suggestions",[]))),!l&&o&&(this.selectBeforeValue=null,this.setActiveIndex(-1),this.request(t,{open:!0}),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.INPUT_CHANGE,data:{sug:this,value:t}}),this.imt.triggerInputChange())}},{key:"onInputStatusChange",value:function(e){if(e&&!e.isAiEditor)if("blur"!==e.status){if("focus"===e.status){if(e.source!==FOCUS_SOURCE.USER_CLICK)return;this.setRsvSug4(),this.startCircle(),e.value?this.data.get("suggestions").length?this.showSug():this.request(e.value,{open:!0}):(this.lastHistoryInputClickTime=Date.now(),this.request("",{open:!0}))}}else this.hideSug();else this.hideSug()}},{key:"setOq",value:function(){var e=this.getBdsCommData()||{},t=e.ishome,n=e.confirmQuery;0===t&&this.addStat("oq",n?xss(n):"")}},{key:"setPq",value:function(){var e=(this.getBdsCommData()||{}).confirmQid;e&&this.addStat("rsv_pq",e)}},{key:"setInputT",value:function(){0===this.inputT&&(this.inputT=(new Date).getTime())}},{key:"setRsvSug4",value:function(){0===this.rsv_sug4&&(this.rsv_sug4=(new Date).getTime())}},{key:"onHideSugEvent",value:function(e){(null==e?void 0:e.mode)!==AI_MODE&&this.hideSug()}},{key:"onModeChange",value:function(e){(null==e?void 0:e.mode)===AI_MODE&&this.hideSug({clearData:!0})}},{key:"onFileChange",value:function(e){(null==e?void 0:e.fileList)&&e.fileList.length>0&&this.hideSug({clearData:!0})}},{key:"hasFiles",value:function(){var e,t,n;return((null==(n=null==(t=null==(e=this.$input)?void 0:e.rootCmpt)?void 0:t.data)?void 0:n.get("fileList"))||[]).length>0}},{key:"getDnsCache",value:function(){this.data.get("sugdnscached")||timeoutFetch(this.buildRequestUrl("",{isPreReq:!0})),this.data.set("sugdnscached",!0)}},{key:"abortBeforeRequest",value:function(){this.jqXhr&&this.jqXhr.abort(),this.jqXhr=null,this.isHistoryRequesting=!1}},{key:"requestSug",value:function(e){return __async(this,arguments,(function(e){var t=this,n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return _regenerator().m((function i(){var a,o,s,r,l,c,d,u,p,h;return _regenerator().w((function(i){for(;;)switch(i.p=i.n){case 0:if(a=n.mode,!(s=!(o=e||""))||!t.isHistoryRequesting){i.n=1;break}return i.a(2);case 1:if(t.abortBeforeRequest(),r=++t.requestSeq,l=t.buildRequestUrl(o,{mode:a}),c=new AbortController,d=c.signal,t.jqXhr=c,t.isHistoryRequesting=s,i.p=2,!s){i.n=6;break}if(!t.showsugstore){i.n=4;break}return i.n=3,timeoutFetch(l,{signal:d,mode:"cors"});case 3:h=i.v,i.n=5;break;case 4:h={g:[]};case 5:p=h,i.n=8;break;case 6:return i.n=7,jsonp(l,{signal:d,timeout:5e3,callbackName:"cb"});case 7:p=i.v;case 8:if(u=p,!t.isDisposed&&r===t.requestSeq){i.n=9;break}return i.a(2);case 9:t.callback(u,e,n),t.rsv_sug3++,t.addStat("rsv_sug3",t.rsv_sug3),t.isHistoryRequesting=!1,i.n=11;break;case 10:i.p=10,i.v,t.jqXhr=null,t.isHistoryRequesting=!1,t.isDisposed||r!==t.requestSeq||(t.data.set("suggestions",[]),t.hideSug());case 11:return i.a(2)}}),i,null,[[2,10]])}))()}))}},{key:"callback",value:function(e,t){var n=this,i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},a=i.mode,o=this.normalizeResponse(e,t);this.data.set("suggestions",o),this.setActiveIndex(-1),2!==a&&(this.dataCached[t||""]=e,t&&this.dataCached[""]&&(this.dataCached[""]=void 0)),this.getStore(),this.nextTick((function(){n.setStore()}));var s=this.data.get("visible"),r=!t&&Date.now()-this.lastHistoryInputClickTime<=1e3;s?this.sendShowLog():(i.open||r)&&this.$input.getRootData("initialFocus")&&this.showSug(),t||(this.lastHistoryInputClickTime=0)}},{key:"normalizeResponse",value:function(e,t){var n,i=this,a=(null==(n=null==e?void 0:e.data)?void 0:n.g)||(null==e?void 0:e.g)||[];if(!Array.isArray(a)||!a.length)return[];var o=a.some((function(e){return i.isHisSug(e)}));o?(this.rsv_sug7[0]=1,this.rsv_sug=a.filter((function(e){return i.isHisSug(e)})).length):(this.rsv_sug7[2]=1,this.rsv_sug=0);var s=getSugData(a,{isHis:o});return this.buildData(s,t).filter((function(e){return!!e&&!!e.query}))}},{key:"buildData",value:function(e,t){var n=this.data.get("sampleConfig"),i=null==n?void 0:n.highlightExperiment;return e.map((function(e,n){var a,o=i?(null==(a=e.pos)?void 0:a.length)?setHighlightByPos(e.query,e.pos):[{text:subByte(e.query,66)}]:setBold(e.query,t);if("direct_new"===e.type){var s=e.info.value,r=s.name[0]&&s.name[0].text||"";return __spreadProps(__spreadValues({},e),{index:n,infoValue:s,isDouble:!(!s.img&&!s.brief),img:s.img,brief:s.brief,link:s.link,name:r,tag_style:s.tag_style,boldInfo:o})}return __spreadProps(__spreadValues({},e),{index:n,boldInfo:o})}))}},{key:"injectAiGuide",value:function(e){if(e.some((function(e){return"ai_guide"===(null==e?void 0:e.type)})))return e;var t=e.findIndex((function(e){return!e.no_ai_sug&&e.query}));if(-1===t)return e;var n={type:"ai_guide",query:e[t].query};return e.push(n),e}},{key:"buildRequestUrl",value:function(e){var t,n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},i=n.mode,a=n.isPreReq,o=this.data.get("sug.sugHost")||"/sugrec",s=new URLSearchParams({ie:"utf-8",json:"1",from:"pc_web",_:String((new Date).getTime())}),r=getHisData(),l=this.data.get("sid")||"";if(""===e){if(s.set("prod","pc_his"),s.set("sid",l),s.set("imod","2"),s.set("usegosug","1"),s.set("_t",String((new Date).getTime())),r.length){var c=localStorage.getItem("HIS_AI_LIST");if(c){var d=JSON.parse(c),u=r.concat(d);r.sort((function(e,t){return t.time-e.time})),r=u.slice(0,10)}s.set("hisdata",JSON.stringify(r))}a||s.set("sc","eb")}else s.set("pre","1"),s.set("p","3"),s.set("prod",this.data.get("sug.prod")||"pc"),s.set("sugsid",l.replace(/_/g,",")),s.set("wd",e),s["delete"]("usegosug"),r.length&&s.set("his",JSON.stringify(r));if(i&&(s.set("sugmode",i+""),2==+i)){var p=this.getPrevRequestTime(),h=Date.now()-p>72e4?1:0;s.set("hot_launch",h+"")}this.sugcookie>0&&(this.sugcookie=3);var f=this.getBdsCommData(),m=f.supportis,g=f.cur_query,_=f.cur_disp_query;m&&(this.$input,s.set("req","2")),g&&s.set("bs",g),_&&s.set("pbs",_),s.set("usegosug","1");var v=this.getInputComponent(),b=null==(t=null==v?void 0:v.currentInput)?void 0:t.call(v);s.set("csor","".concat(getCursorPosition$1(b)));var y=this.data.get("sampleConfig");return(null==y?void 0:y.highlightExperiment)&&s.set("span_upgrade","1"),this.pwd&&s.set("pwd",this.pwd),this.pwd=e,"".concat(o,"?").concat(s.toString())}},{key:"getPrevRequestTime",value:function(){var e=0;try{e=+(localStorage.getItem("search_request_time")||0)}catch(t){console.error(t)}return e}},{key:"onFormSubmit",value:function(e){return this.setOq(),this.setPq(),this.formSubmit(e),!1}},{key:"formSubmit",value:function(e){var t,n=!0,i=this.getBdsCommData(),a=i.ishome,o=i.supportis,s=1===a?"i":"t",r=this.data.get("form"),l=this.data.get("suggestions"),c=this.data.get("activeIndex"),d=l[c],u=this.$input.getValue(),p=null!=(t=this.selectBeforeValue)?t:u,h="t";if("/"===window.location.pathname&&(h="i"),this.$input.blur(),this.addStat("rsv_btype",h),-1!==c?(this.addStat("f",3),this.addStat("prefixsug",xss(p)),this.addStat("rsp",c),d&&this.isHisSug(d)?(this.setNewsRsv("his"),this.addStat("rsv_dl",s+"h_"+c)):(this.setNewsRsv("sug"),this.addStat("rsv_dl",s+"s_"+c))):this.addStat("f",8),!d||""!==p&&"|"!==d.pinyin||"store"!==d.type)""===p&&this.addStat("rsv_sug9","eb_"+(o?1:0));else{var f="0";0===a?f="0":1===a&&window.s_domain&&"home"===window.s_domain.base?f="2":1===a&&(f="1"),this.addStat("rsv_sug9","es_"+f+"_"+(o?1:0))}this.clickOrSelectSug===u?(this.removeStat("rsv_n"),this.removeStat("sug")):this.hoverSug===this.value&&this.clickOrSelectSug===this.value||(this.setNewsRsv("box"),this.addStat("rsv_dl",s+"b"),this.addStat("f",8)),0!==this.inputT?(this.addStat("inputT",(new Date).getTime()-this.inputT),this.inputT=0):this.removeStat("inputT"),0!==this.rsv_sug4&&(this.addStat("rsv_sug4",(new Date).getTime()-this.rsv_sug4),this.rsv_sug4=0),this.rsv_sug&&this.addStat("rsv_sug",this.rsv_sug);try{!function(){var e=(new Date).getTime();document.cookie="WWW_ST="+e+";expires="+new Date(e+1e4).toUTCString()}()}catch(_){console.error(_)}if("function"==typeof window.form_submit&&(n=window.form_submit.call(r,e),this.hideSug(),this.dataCached={},this.clearStat()),n){var m=this.$input.getValue(),g=this.$input.getInputInfo().placeholder;m?m=limitWd(m):g&&(m=limitWd(g),this.addStat("rsv_dq",1)),this.value=m,this.$input.setValue(m),r.submit()}"_blank"!==r.getAttribute("target")&&this.addStat("rsv_bp",1),this.removeStat("rsv_dq")}},{key:"isHisSug",value:function(e){return e.type.includes("his")||"store"===e.type}},{key:"addStat",value:function(e,t){this.tracker.addStat(e,t)}},{key:"removeStat",value:function(e){this.tracker.removeStat(e)}},{key:"setNewsRsv",value:function(e){this.tracker.setNewsRsv(e)}},{key:"clearStat",value:function(){var e=this;this.tracker.clearStat((function(){e.rsv_sug=0,e.rsv_sug7=[0,0,0]}))}},{key:"check",value:function(){var e=this.$input.getValue({keepWhitespace:!0});this.$input.getRootData("mode")!==AI_MODE&&e!==this.value&&(this.value=e,this.setOq(),this.setPq(),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.INPUT_CHANGE,data:{sug:this,value:e}}),this.request(e,{open:!0}))}},{key:"request",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=limitWd(e);if(this.value=e,this.showsug){var i=this.data.get("sugmode");if(2==+i&&this.data.set("sugmode",void 0),2!==i&&this.dataCached[n||""]){var a=this.dataCached[n||""];return void this.callback(a,n,t)}this.requestSug(n,__spreadValues({mode:i},t))}this.needHoverCache=!1}},{key:"startCircle",value:function(){var e=this;if(!this.timer){this.blockInput=!1;var t=function(){e.check(),e.timer=setTimeout(t,200)};this.timer=setTimeout(t,200)}}},{key:"stopCircle",value:function(){this.timer&&(clearTimeout(this.timer),this.blockInput=!0,this.timer=null)}},{key:"getBdsCommData",value:function(){var e;return(null==(e=null==window?void 0:window.bds)?void 0:e.comm)||this.data.get("bds.comm")||{}}},{key:"handleCloseHistoryClick",value:function(){var e,t,n,i=this,a=this.data.get("isLogin");null==(n=null==(t=null==(e=null==window?void 0:window.bds)?void 0:e.event)?void 0:t.trigger)||n.call(t,"bd.se.loadpanel",{tab:"general",tipsConfig:{content:a?"关闭该账号下所有设备的搜索历史":"该选项可以关闭您的历史记录",wrapper:"#se-setting-5"}}),this.hideSug(),this.nextTick((function(){i.$input.blur()})),this.sendUbcLog("click","close_his")}},{key:"handleDeleteHistoryClick",value:function(){this.sendUbcLog("click","delete_his",{area:"delete"});var e=this.data.get("suggestions");if(e[0]&&e[0].pinyin&&"|"===e[0].pinyin){var t=this.$input.getRootData().input||{};timeoutFetch("https://www.baidu.com/my/clearhistory?tk="+getToken(t.searchframeLid,t.token),{method:"POST",mode:"cors"})}this.historyStore.clear(),this.hideSug()}},{key:"handleMoreHistoryClick",value:function(){this.sendUbcLog("click","more_his")}},{key:"handleSearchBtnClick",value:function(){this.hideSug(),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUBMIT,data:{triggerType:"sug_search_btn"}}),this.$input.sendLog("click","search_kuang",{pos:"se_btn"})}},{key:"requestDelHis",value:function(e,t){var n=new URLSearchParams;n.append("items",JSON.stringify([{query:t?t+e:e,ts:""}])),n.append("imod","2"),fetch("https://www.baidu.com/recsys/hisproxy/data/usrdelete?usegosug=1",{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})}},{key:"handleItemHisDeleteClick",value:function(e){var t=e.item,n=e.index,i=t.payload;-1!==n&&this.data.splice("suggestions",[n,1]);var a=t.query;this.sendUbcLog("click","single_his_delete",{recom_query:a});var o=i&&i.fid;this.requestDelHis(a,o),this.dataCached={},this.historyStore.deleteByQuery(t.query)}},{key:"handleFeedbackClick",value:function(){var e,t,n,i,a=this,o=this.data.get("suggestions").map((function(e){return e.query}));null==(i=null==(n=null==(t=null==(e=null==window?void 0:window.bds)?void 0:e.se)?void 0:t.ShortCut)?void 0:n.initSugBar)||i.call(n,o),this.hideSug(),this.nextTick((function(){a.$input.blur()}))}},{key:"handleAskAiClick",value:function(e){var t=e.item,n=e.area,i=this.getBdsCommData().ishome;this.jumpToAiChat(t,{enterType:(i?"home":"a")+"_sug_aihover",sa:(i?"home":"a")+"_sug_aihover",area:n})}},{key:"handleAskAiMouseenter",value:function(e){var t=e.area,n=e.item;this.sendUbcLog("show","sug_aihover",{query:this.value,recom_query:n.query,order:n.index+1,no_ai_value:n.no_ai_sug,aisou_text:"用文心助手回答",sug_type:n.isDouble?"pic":"common",area:t})}},{key:"jumpToAiChat",value:function(e,t){var n=e.query,i=t.enterType,a=t.sa,o=t.area,s=t.fileInfo,r=t.openInputMode,l=!this.isHisSug(e),c=this.getBdsCommData().qid;this.sugHisClickSend("click",l,n,"ai",{recom_query:n,is_log:this.data.get("isLogin")?1:0,order:e.index+1,no_ai_value:e.no_ai_sug,area:o,aisou_text:""});var d=l?"sug":"his";go2AiChat(e.query,d,this.$input,{sa:a,enterType:i,ext:{apagelid:c,ori_lid:c,aPageWord:String(n)},otherData:__spreadValues(__spreadValues({},{fileInfo:s&&s.length?s:""}),{openInputMode:r||""})})}},{key:"writeStore",value:function(){this.historyStore.write()}},{key:"checkStore",value:function(){return this.historyStore.check()}},{key:"getStore",value:function(){return this.historyStore.get()}},{key:"setStore",value:function(){this.historyStore.set()}},{key:"sendUbcLog",value:function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},i=this.getBdsCommData(),a=i.qid,o=i.ishome,s=Object.assign(__spreadValues({qid:a||"",is_log:o?1:0},o?{status:o?"default":"input"}:{rsv_dl:getQueryString("rsv_dl")}),n);this.$input.sendLog(e,t,s,!0)}},{key:"imgSugSend",value:function(e,t,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};this.sendUbcLog(e,t?"sug_query":"his_query",Object.assign({query:t||"",sug_type:n,rsv_dl:getQueryString("rsv_dl")},i))}},{key:"noAiSugSend",value:function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.sendUbcLog(e,"no_ai_sug",Object.assign({query:t||"",rsv_dl:getQueryString("rsv_dl"),sug_type:"common"},n))}},{key:"sugHisClickSend",value:function(e,t,n,i){var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{},o=t?"sug_query":"his_board",s={query:n,rsv_dl:getQueryString("rsv_dl")};s[t?"sug_type":"his_type"]=i,this.sendUbcLog(e,o,Object.assign(s,a))}},{key:"sugHisShowSend",value:function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.sendUbcLog("show",e,Object.assign({rsv_dl:getQueryString("rsv_dl")},t))}},{key:"aiGuideShowSend",value:function(e){this.sendUbcLog("show","sug_ai_query",Object.assign({rsv_dl:getQueryString("rsv_dl")},e))}},{key:"sendIptLog",value:function(e){var t=this.$input.getValue();this.sendUbcLog("click","search_kuang",{pos:e,query:t})}},{key:"sendShowLog",value:function(){var e=this.data.get("suggestions"),t=e.find((function(e){return"ai_guide"===e.type}));t&&this.aiGuideShowSend({query:this.value||"",recom_query:t.query});var n=e.filter((function(e){return e.no_ai_sug}));n.length&&this.noAiSugSend("show",this.value||"",{no_ai_sug_info:n.map((function(e,t){return{item_name:e.query,item_pos:t+1}}))}),e.find((function(e){return e.isDouble}))&&this.imgSugSend("show",this.value||"","pic")}}])}(san.Component);_Sug.trimWhitespace="all",_Sug.template='\n <div class="ci-normal-sug-panel" s-show="visible && suggestions.length">\n <div class="ai-bdsug ai-bdsug-new">\n <s-suggestions-list\n suggestions="{{suggestions}}"\n activeIndex="{{activeIndex}}"\n sampleConfig="{{sampleConfig}}"\n showHistory="{{sug.showHistory}}"\n isLogin="{{isLogin}}"\n on-item-click="handleClick($event)"\n on-item-mouseenter="handleMouseenter($event)"\n on-item-mouseleave="handleMouseleave"\n on-item-his-delete="handleItemHisDeleteClick"\n on-ask-ai-click="handleAskAiClick"\n on-ask-ai-mouseenter="handleAskAiMouseenter"\n />\n <s-sug-footer\n scene="{{scene}}"\n showFooter="{{showFooter}}"\n sugType="{{sugType}}"\n showFeedback="{{sug.showFeedback}}"\n showHistory="{{showHisFooter}}"\n showSearchBtn="{{sug.showSearchBtn}}"\n isLogin="{{isLogin}}"\n on-feedback-click="handleFeedbackClick"\n on-close-history-click="handleCloseHistoryClick"\n on-delete-history-click="handleDeleteHistoryClick"\n on-more-history-click="handleMoreHistoryClick"\n on-search-btn-click="handleSearchBtnClick"\n />\n </div>\n </div>\n ',_Sug.components={"s-suggestions-list":SuggestionsListComponent,"s-sug-footer":SugFooterComponent},_Sug.computed={sugType:function(){var e=this.data.get("suggestions");if(e.length>0){var t=e[0].type;return t.includes("his")||"store"===t?"his":"sug"}return"sug"},showFooter:function(){var e=this.data.get("sugType");return this.data.get("sug.showFeedback")||"his"===e},showHisFooter:function(){var e=this.data.get("sug.showHistory"),t=this.data.get("suggestions.length")>3;return e&&t},isLogin:function(){return this.data.get("user.isLogin")}};var Sug=_Sug;function initSug(e){var t,n;if(!(null==e?void 0:e.rootCmpt))throw new Error("rootCmpt is required to initialize normal sug");var i=e.mountTarget,a=i.querySelector(".ci-normal-sug-wrapper");a?a.innerHTML="":((a=document.createElement("div")).className="ci-normal-sug-wrapper",i.appendChild(a));var o=e.prod||"pc",s=o&&e.input.value?2:void 0,r=__spreadProps(__spreadValues({},e),{prod:o,sid:(null==(n=null==(t=e.bds)?void 0:t.comm)?void 0:n.sid)||"",bds:e.bds||(null==window?void 0:window.bds)||{},sugmode:s}),l=new Sug({data:r,owner:e.rootCmpt});return l.$input=e.rootCmpt.$input,l.attach(a),l}var Main$b=(_m=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).sugPanelInstance=null,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{scene:AI_SCENE,panels:{},tools:{},input:{row:2},curUploadType:"",visibleButtons:[],panelReady:!1,capsuleInside:!1,visibleCount:0}}},{key:"inited",value:function(){var e=this.data.get("panels.list")||[];this.data.set("visibleButtons",e.slice(0,5)),this.data.set("hiddenButtons",e.slice(5))}},{key:"menuShow",value:function(){this.$input.sendLog("show","capsule_office_more",{valueInfo:[{component_name:"shortcuts",component_content:this.data.get("hiddenButtons").map((function(e){return e.button_id}))}]})}},{key:"getShowMoreGuide",value:function(){var e=this.data.get("hiddenButtons");this.data.set("showGuideClass",(e||[]).some((function(e){if(e.guide){var t=localStorage.getItem(INPUT_PANEL_BTN_CLICKED_GUIDE);try{var n=t&&JSON.parse(t)||{};return!t||!n[e.type]}catch(n){return console.warn(n),!1}}return!1}))?"ci-new-dot":"")}},{key:"handleAsyncPanelList",value:function(){var e=this,t=(this.data.get("panels.list")||[]).map((function(e){return __spreadValues(__spreadValues({},e),"ai_search"===e.type?{minWidth:270}:{})})),n=this.data.get("capsuleInside")?400:724,i=this.ref("panel-list");if(i){var a=(null==i?void 0:i.clientWidth)||n,o=getButtonBarLayout(i),s=o.buttonGap,r=calculateAdaptiveButtonBar(t,{containerWidth:a,defaultMinWidth:o.defaultMinWidth,buttonGap:s,moreButtonWidth:o.moreButtonWidth}),l=r.visibleButtons,c=r.hiddenButtons,d=this.data.get("visibleButtons");l.length===d.length&&l.every((function(e,t){var n;return e.button_id===(null==(n=d[t])?void 0:n.button_id)}))||(this.data.set("panelReady",!1),this.data.set("visibleButtons",l),this.data.set("hiddenButtons",c),this.nextTick((function(){e.data.set("panelReady",!0),e.getShowMoreGuide()})))}}},{key:"attached",value:function(){var e=this,t=this.data.get(),n=t.panels,i=t.scene,a=t.mode;((null==n?void 0:n.list)||a!==AI_MODE||i===AI_SCENE)&&(this.handleButtonList(i),this.nextTick((function(){e.normalSugInit()})),this.registerVisibleButtonTooltip(),this.watch("hiddenButtons",(function(){return e.getShowMoreGuide()})),this.getShowMoreGuide(),this.watch("visibleButtons",(function(t,n){var i=n.oldValue,a=n.newValue;!i.length&&a.length&&e.registerVisibleButtonTooltip()})))}},{key:"handleButtonList",value:function(e){var t=this;e===AI_SCENE&&(this.data.get("capsuleInside")?(this.watch("panels.list",(function(){return t.updateCapsuleButtons(t.data.get("visibleCount"))})),this.watch("visibleCount",(function(e){return t.updateCapsuleButtons(e)})),this.updateCapsuleButtons(this.data.get("visibleCount"))):(this.watch("panels.list",(function(){t.handleAsyncPanelList()})),this.handleAsyncPanelList(),this.$input.getRootData("panels.adaptiveButton")&&(this.adaptiveButton(),this.watch("panels.list",(function(){t.adaptiveButton()})))))}},{key:"adaptiveButton",value:function(){var e=this,t=this.data.get("capsuleInside"),n=this.ref("panel-list");if(n){var i=getButtonBarLayout(n),a=i.buttonGap,o=i.buttonWidthOptions,s=i.defaultMinWidth,r=i.moreButtonWidth,l=(this.data.get("panels.list")||[]).map((function(e){if("ai_search"===e.type)return __spreadProps(__spreadValues({},e),{btnWidth:270});var n=e.button_text||getPanelDisplayText(e,t);return __spreadProps(__spreadValues({},e),{btnWidth:calculateButtonWidth(n,o)})}));this.buttonBarManager=new AdaptiveButtonBarManager({buttons:l,container:n,defaultMinWidth:s,buttonGap:a,moreButtonWidth:r},{onUpdate:function(t){var n,i=t.visibleButtons,a=t.hiddenButtons;i.length===e.data.get("visibleButtons").length&&a.length===((null==(n=e.data.get("hiddenButtons"))?void 0:n.length)||0)||(e.data.set("panelReady",!1),e.data.set("visibleButtons",i),e.data.set("hiddenButtons",a),e.nextTick((function(){e.data.set("panelReady",!0),e.getShowMoreGuide()})))}}),this.buttonBarManager.update()}}},{key:"updateCapsuleButtons",value:function(e){var t=this.data.get("panels.list")||[],n=t.slice(0,e),i=t.slice(e),a=this.data.get("visibleButtons")||[],o=this.data.get("hiddenButtons")||[];n.length===a.length&&i.length===o.length&&n.every((function(e,t){var n;return e.button_id===(null==(n=a[t])?void 0:n.button_id)}))&&i.every((function(e,t){var n;return e.button_id===(null==(n=o[t])?void 0:n.button_id)}))||(this.data.set("visibleButtons",n),this.data.set("hiddenButtons",i),this.getShowMoreGuide(),this.registerVisibleButtonTooltip()),this.revealCapsuleButtons()}},{key:"revealCapsuleButtons",value:function(){this.data.set("panelReady",!0),this.getShowMoreGuide()}},{key:"detached",value:function(){var e;null==(e=this.buttonBarManager)||e.destroy()}},{key:"normalSugInit",value:function(){return __async(this,null,_regenerator().m((function e(){var t,n,i,a,o,s,r,l,c,d;return _regenerator().w((function(e){for(;;)switch(e.n){case 0:if(this.data.get("scene")===AI_SCENE){e.n=2;break}if(n=this.$input.rootCmpt,(i=null==(t=null==n?void 0:n.el)?void 0:t.querySelector("#ci-panel"))&&n){e.n=1;break}return e.a(2);case 1:a=this.$input.getRootData(),o=a.user,s=a.sug,r=a.input,l=a.scene,c=a.samples,d={scene:l,user:o,sug:s,input:r,bds:window.bds,samples:c,form:document.querySelector("#form"),mountTarget:i,rootCmpt:n},this.sugPanelInstance=initSug(d),this.watchUpateSug();case 2:return e.a(2)}}),e,this)})))}},{key:"handleClickPanelBtn",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a,o,s,r,l,c,d,u=this;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:if(r=e.panel,this.nextTick((function(){u.getShowMoreGuide()})),!r.url){t.n=1;break}return t.a(2);case 1:if(l=r.type.replace(/^new_/,""),c=(null==(i=null==(n=this.$input.getInputInfo())?void 0:n.prefix)?void 0:i.type)||"",e.skipPrefixConfirm){t.n=2;break}if(!emitBeforePrefixChange(this.$input,{action:"switch",fromType:c,toType:l,hasTargetPrefix:!0,onContinue:function(){u.handleClickPanelBtn(__spreadProps(__spreadValues({},e),{skipPrefixConfirm:!0}))}})){t.n=2;break}return t.a(2);case 2:if(!noOpenPanelType.includes(l)){t.n=3;break}return t.a(2,void this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.PANEL_CHANGE,data:r}));case 3:this.$input.emit(EVENTS.PANEL_OPEN,{panel:r}),this.$input.openPanel(l),d=null==(s=null==(o=null==(a=null==r?void 0:r["function"])?void 0:a.data)?void 0:o.input)?void 0:s.input_custom,this.$input.emit(EVENTS.SHOW_PREFIX,{name:getPanelDisplayText(r),type:l,inputValue:d}),this.$input.sendLog("click","capsule_office",{area:e.area,valueInfo:[{component_name:"shortcuts",component_content:r.button_id}]});case 4:return t.a(2)}}),t,this)})))}},{key:"watchUpateSug",value:function(){var e=this;this.watch("user",(function(t){e.sugPanelInstance.data.set("user",t)})),this.watch("sug",(function(t){e.sugPanelInstance.data.set("sug",t)}))}},{key:"registerVisibleButtonTooltip",value:function(){var e=this,t=this.data.get("visibleButtons");t.length&&this.nextTick((function(){e.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.REGISTER_PANEL_TOOLTIP,data:t.map((function(t,n){var i;return{panelData:t,ele:null==(i=e.ref("panel-btn-".concat(n)))?void 0:i.el}}))})}))}}])}(ApiCmpt),_m.trimWhitespace="all",_m.template='\n <div\n s-if="{{input.row !== 1}}"\n id="ci-tools"\n class="{{capsuleInside ? \'ci-tools-inside\' : \'ci-tools-\' + panels.position}}"\n >\n <div\n s-ref="panel-list"\n class="ci-panel-list {{panelReady ? \'ci-panel-ready\' : \'\'}}"\n >\n <panel-btn\n s-for="panel, pindex in visibleButtons"\n panel="{{panel}}"\n pos="{{pindex + 1}}"\n area="base"\n capsule-inside="{{capsuleInside}}"\n hide-ai="{{capsuleInside}}"\n tooltip-position="{{panels.tooltipPosition}}"\n on-click="handleClickPanelBtn"\n s-ref="panel-btn-{{pindex}}"\n />\n <drop-down-btn\n s-if="hiddenButtons.length"\n wrapper-class="drop-down-wrapper"\n btn-class="drop-down-btn {{showGuideClass}}"\n menu-wrapper-class="drop-down-menu-wrapper"\n menu-class="drop-down-menu"\n on-menu-show="menuShow"\n >\n <panel-btn\n s-for="panel, pindex in hiddenButtons"\n panel="{{panel}}"\n pos="{{visibleButtons.length + pindex + 1}}"\n area="capsule_bub_more"\n capsule-inside="{{capsuleInside}}"\n on-click="handleClickPanelBtn"\n />\n </drop-down-btn>\n </div>\n </div>\n ',_m.components={"panel-btn":Main$c,"drop-down-btn":Main$d},_m),LEFT_TOOLS_ICON_ONLY_CLASS="ci-left-tools-icon-only",Main$a=(_n=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).capsuleButtonBarManager=null,e.capsuleButtonBarDetached=!1,e.leftToolsIconOnlyObserver=null,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{tools:{},musicButtonActiveValue:"",panelOptions:{},visibleCount:0}}},{key:"attached",value:function(){var e=this;this.capsuleButtonBarDetached=!1,this.nextTick((function(){return e.observeLeftToolsIconOnly()})),this.data.get("capsuleInside")&&(this.nextTick((function(){return e.initCapsuleButtonBar()})),this.watch("panels.list",(function(){return e.nextTick((function(){return e.initCapsuleButtonBar()}))}))),this.musicPanelChangeHandler=this.musicPanelChangeHandler.bind(this),this.$input.on(EVENTS.MUSIC_PANEL_CHANGE,this.musicPanelChangeHandler),this.watch("isShowOverWordTip",(function(t){t&&e.$input.sendLog("show","long_query_toast",{query:e.$input.getValue()})})),this.watch("openPanelType",(function(t){e.data.get("capsuleInside")&&!t&&e.nextTick((function(){var t,n;null==(t=e.capsuleButtonBarManager)||t.update(),null==(n=e.ref("panel-btn-list"))||n.revealCapsuleButtons()}))}));var t=this.$input.getRootData().samples;this.data.set("wenAiButtonIconSample",Array.isArray(t)&&(t.indexOf("PC_WENXIN_BRAND_UPGRADE_1")>-1||t.indexOf("PC_WENXIN_BRAND_UPGRADE_3")>-1)),this.data.set("wenAiButtonNoneSample",Array.isArray(t)&&t.indexOf("PC_AI_SEARCH_BUTTON_NONE")>-1)}},{key:"musicPanelChangeHandler",value:function(e){e.buttonProperty&&this.data.set("musicButtonActiveValue",e.buttonProperty)}},{key:"detached",value:function(){var e,t;this.capsuleButtonBarDetached=!0,null==(e=this.leftToolsIconOnlyObserver)||e.disconnect(),this.leftToolsIconOnlyObserver=null,this.$input.off(EVENTS.MUSIC_PANEL_CHANGE,this.musicPanelChangeHandler),null==(t=this.capsuleButtonBarManager)||t.destroy(),this.capsuleButtonBarManager=null}},{key:"observeLeftToolsIconOnly",value:function(){var e;if(this.data.get("capsuleInside")){var t=this.el,n=null==t?void 0:t.querySelector(".ci-panel-list");if(t&&n){var i=getButtonBarLayout(n).moreButtonWidth,a=function(){t.classList.remove(LEFT_TOOLS_ICON_ONLY_CLASS),t.classList.toggle(LEFT_TOOLS_ICON_ONLY_CLASS,n.offsetWidth<i)};a(),null==(e=this.leftToolsIconOnlyObserver)||e.disconnect(),this.leftToolsIconOnlyObserver=new ResizeObserver(a),this.leftToolsIconOnlyObserver.observe(n)}}}},{key:"initCapsuleButtonBar",value:function(){var e,t=this;if(!this.capsuleButtonBarDetached){var n=this.ref("capsule-layout");if(n){null==(e=this.capsuleButtonBarManager)||e.destroy();var i=getButtonBarLayout(n),a=i.buttonGap,o=i.buttonWidthOptions,s=i.defaultMinWidth,r=i.moreButtonWidth,l=(this.data.get("panels.list")||[]).map((function(e){return __spreadProps(__spreadValues({},e),{btnWidth:calculateButtonWidth(e.button_text||getPanelDisplayText(e,!0),o)})})),c=new AdaptiveButtonBarManager({buttons:l,container:n,defaultMinWidth:s,buttonGap:a,moreButtonWidth:r},{onUpdate:function(e){var n=e.visibleButtons;t.capsuleButtonBarManager===c&&t.data.set("visibleCount",n.length)}});this.capsuleButtonBarManager=c,c.update()}}}},{key:"getAiMusicQuery",value:function(){var e,t,n,i=this.$input.getValue(),a=this.data.get("musicButtonActiveValue")||{},o="请帮我生成音乐:",s=null==(e=a.musicStyle)?void 0:e.text,r=null==(t=a.timbre)?void 0:t.text,l=[];s&&l.push("曲风为“".concat(s,"”")),r&&l.push("音色为“".concat(r,"”"));var c=l.join(",");return"自定义歌词"===(null==(n=null==a?void 0:a.wordMethod)?void 0:n.text)?c?"".concat(o).concat(c,"。\n歌词:\n").concat(i):"".concat(o,"\n歌词:\n").concat(i):c?"".concat(o).concat(i,"。").concat(c,"。"):"".concat(o).concat(i,"。")}},{key:"handleClickAiSearch",value:function(){var e=this.$input.getValue();go2AiChat(e,"askAi",this.$input),this.$input.sendLog("click","deepsearch_btn",{searchkuang_content_type:e?"input_q":"default_q"})}},{key:"getToolInfo",value:function(e){var t,n,i,a;switch(e){case"model":return this.data.get("tools.modeSelect")?(null==(t=this.ref("mode"))?void 0:t.getModelInfo())||null:(null==(n=this.ref("model"))?void 0:n.getModelInfo())||null;case"draw":return(null==(i=this.ref("draw"))?void 0:i.getDrawInfo())||null;case"music":return this.getAiMusicQuery();case"translate":return(null==(a=this.ref("translate"))?void 0:a.getTranslateInfo())||null}return null}},{key:"setToolInfo",value:function(e,t){var n;"translate"===e&&(null==(n=this.ref("translate"))||n.setTranslateInfo(t))}}])}(ApiCmpt),_n.template='\n <div\n class="ci-left-tools-wrapper"\n >\n <ask-ai-button\n show="{{tools.askAi && !wenAiButtonNoneSample && !openPanelType}}"\n tooltip-text="{{mergedHoverText.deepSearch}}"\n is-ai-search="{{isAiSearch}}"\n wen-ai-button-icon-sample="{{wenAiButtonIconSample}}"\n on-click="handleClickAiSearch"\n />\n \x3c!-- 模式 --\x3e\n <cs-input-mode\n s-if="{{tools.modeSelect}}"\n s-show="{{!openPanelType}}"\n s-ref="mode"\n usable-model="{{tools.modeSelect.usableModel}}"\n used-model="{{tools.modeSelect.usedModel}}"\n host-mode-name="{{tools.modeSelect.current}}"\n position="{{tools.modeSelect.position}}"\n />\n \x3c!-- 模型 --\x3e\n <cs-input-model\n s-if="{{!tools.modeSelect && tools.modelSelect && tools.deepsearch && !openPanelType}}"\n s-ref="model"\n index-page="true"\n model-top="{{modelTop}}"\n tools="{{tools}}"\n capsule-inside="{{capsuleInside}}"\n is-capsule-inside="{{capsuleInside}}"\n />\n <cs-draw-button\n s-if="{{tools.draw && openPanelType === \'photo_editing\'}}"\n s-ref="draw"\n draw-data="{{tools.draw}}"\n is-shrink="{{tools.shrinkStatus.draw || compactText}}"\n use-new-arrow="{{useNewArrow}}"\n />\n\n <cs-music-button\n s-if="openPanelType === \'ai_music_create\'"\n s-ref="music"\n music-button-data="{{panelOptions.musicOptions}}"\n music-button-active-value="{=musicButtonActiveValue=}"\n music-place-holder="{=musicPlaceHolder=}"\n is-shrink="{{tools.shrinkStatus.music}}"\n use-new-arrow="{{useNewArrow}}"\n />\n\n <cs-translate-button\n s-if="openPanelType === \'ai_translate\'"\n s-ref="translate"\n translate-option="{{panelOptions.translateOption}}"\n position="{{position}}"\n is-shrink="{{tools.shrinkStatus.translate}}"\n use-new-arrow="{{useNewArrow}}"\n />\n\n <div\n s-show="{{tools.askAi && !openPanelType && isShowOverWordTip && !wenAiButtonNoneSample}}"\n class="ci-overword-tip"\n >\n 👈 复杂问题文心助手回答更优\n </div>\n <div class="left-tools-dynamic-cmpt"></div>\n <div\n s-if="{{capsuleInside}}"\n s-show="{{!openPanelType}}"\n s-ref="capsule-layout"\n class="ci-capsule-layout"\n style="{{prefixShow ? \'visibility: hidden; pointer-events: none\' : \'\'}}"\n >\n <panel-btn-list\n s-ref="panel-btn-list"\n sug="{{sug}}"\n scene="{{scene}}"\n mode="{{mode}}"\n panels="{{panels}}"\n user="{{user}}"\n input="{{input}}"\n capsule-inside="{{true}}"\n visible-count="{{visibleCount}}"\n />\n </div>\n </div>\n',_n.components={"cs-input-mode":InputMode,"cs-input-model":Main$e,"cs-draw-button":DrawButtons,"cs-music-button":Main$f,"cs-translate-button":TranslateButton,"ask-ai-button":AskAiButton,"panel-btn-list":Main$b},_n.computed={isShowOverWordTip:function(){var e=this.data.get("fileList"),t=this.data.get("isOverWord");return!(this.data.get("scene")===AI_SCENE)&&t&&!(null==e?void 0:e.length)},mergedHoverText:function(){return{deepSearch:(this.data.get("hoverText")||{}).deepSearch||hoverText.ASKAIHOVER}},useNewArrow:function(){return!!this.data.get("tools.modeSelect")||!!this.data.get("capsuleInside")}},_n),_Dialog=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{open:!1,title:"",okText:"",cancelText:"",closable:!0,maskClosable:!0,appendToBody:!0,opacity:0}}},{key:"attached",value:function(){var e=this;this.watch("open",(function(t){"undefined"!=typeof document&&(document.body.style.overflow=t?"hidden":"",t&&document.activeElement instanceof HTMLElement&&document.activeElement.blur()),e.nextTick((function(){e.data.set("opacity",t?1:0);var n=e.ref("wrapper");n&&e.data.get("appendToBody")&&n.parentNode!==document.body&&document.body.appendChild(n)}))}))}},{key:"disposed",value:function(){"undefined"!=typeof document&&(document.body.style.overflow="")}},{key:"handleClose",value:function(){this.data.set("open",!1),this.fire("close",{})}},{key:"handleCancel",value:function(){this.data.set("open",!1),this.fire("cancel",{})}},{key:"handleOk",value:function(){this.fire("ok",{})}},{key:"handleMaskClick",value:function(){this.data.get("maskClosable")&&this.handleClose()}},{key:"stopClick",value:function(e){var t,n;null==(t=null==e?void 0:e.stopPropagation)||t.call(e),null==(n=null==e?void 0:e.preventDefault)||n.call(e)}}])}(san.Component);_Dialog.template='\n <div\n s-ref="wrapper"\n s-if="open"\n class="ci-dialog-wrapper"\n on-click="stopClick"\n style="opacity: {{opacity}};"\n >\n <div class="ci-dialog-mask" on-click="handleMaskClick"></div>\n <div class="ci-dialog" role="dialog" aria-modal="true">\n <div class="ci-dialog-header">\n <div class="ci-dialog-title">\n <slot name="title">\n <slot name="header">{{title}}</slot>\n </slot>\n </div>\n <button s-if="closable" class="ci-dialog-close" on-click="handleClose" aria-label="关闭">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n </div>\n <div class="ci-dialog-body">\n <slot></slot>\n </div>\n <div class="ci-dialog-footer">\n <slot name="footer">\n <template s-if="cancelText || okText">\n <button s-if="cancelText" class="ci-dialog-btn ci-dialog-btn-cancel" on-click="handleCancel">{{cancelText}}</button>\n <button s-if="okText" class="ci-dialog-btn ci-dialog-btn-ok" on-click="handleOk">{{okText}}</button>\n </template>\n </slot>\n </div>\n </div>\n </div>\n ',_Dialog.trimWhitespace="all";var Dialog=_Dialog,RecognitionMessageType=function(e){return e.HEARTBEAT="HEARTBEAT",e.MID_TEXT="MID_TEXT",e.FIN_TEXT="FIN_TEXT",e.SESSION_FINISH="SESSION_FINISH",e}(RecognitionMessageType||{}),BUFFER_SIZE=512,INPUT_CHANNELS=1,OUTPUT_CHANNELS=1,SAMPLE_SIZE=16,SAMPLE_RATE=16e3,FINISH_PARAMS=JSON.stringify({type:"FINISH"}),WS_URL="wss://vse.baidu.com/ws_api",pid=8068,key="com.baidu.searchbox.fangyan",audioContent=null,streamSource=null,scriptProcessor=null,m_stream=null,websocket=null,onResultCallback=null,onAmplitudeCallback=null,onErrorCallback=null,amplitudeTimer=null,analyserNode=null,GETUSERMEDIA_CONSTRAINTS={video:!1,audio:{sampleRate:SAMPLE_RATE,sampleSize:SAMPLE_SIZE,channelCount:INPUT_CHANNELS}},prewarmed=!1,audioStreamPromise=null,warmGeneration=0;function sampleData(e,t,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;try{for(var a=i?i.index:0,o=i?i.offset:0,s=0,r=a;r<e.length;r++)s+=e[r].length;s=Math.max(0,s-Math.floor(o));var l=t/n;l>1?s=Math.floor(s/l):(l=1,n=t);for(var c=new Int16Array(s),d=0,u=e.length;a<u;a++){for(var p=e[a],h=o,f=p.length;h<f;){var m=Math.floor(h),g=Math.ceil(h),_=h-m;c[d]=p[m]+(p[g]-p[m])*_,d++,h+=l}o=h-f}return{index:a,offset:o,sampleRate:n,data:c}}catch(a){throw new Error("转音错误了!")}}function convertBuffer(e){for(var t=new Float32Array(e),n=new Int16Array(e.length),i=0;i<t.length;i++){var a=Math.max(-1,Math.min(1,t[i]));n[i]=a<0?32768*a:32767*a}return n}function encodedPcmBuffer(e,t){return sampleData([convertBuffer(e)],t,16e3,null).data}function stopAmplitudeSampling(){if(amplitudeTimer&&(clearInterval(amplitudeTimer),amplitudeTimer=null),analyserNode&&streamSource)try{streamSource.disconnect(analyserNode)}catch(e){}analyserNode=null}function startAmplitudeSampling(e,t){if(onAmplitudeCallback){stopAmplitudeSampling();try{var n=e.createAnalyser();n.fftSize=256;var i=new Uint8Array(n.frequencyBinCount);t.connect(n),analyserNode=n;var a=0,o=function(){n.getByteTimeDomainData(i);for(var e=0,t=0;t<i.length;t++){var o=i[t]-128;e+=o*o}var s=Math.sqrt(e/i.length),r=Math.min(1,s/40);a=.35*a+.65*r;var l=Math.min(1,1.6*a),c=Date.now()/90,d=new Array(5).fill(0).map((function(e,t){var n=.25*Math.sin(c+t),i=Math.max(0,1-.12*t),a=4+10*Math.max(.05,Math.min(1,l*(1+.35*i)+n-.05*t));return Math.round(a)})),u=d.map((function(e){var t=e/4;return Math.max(1,Math.min(3,t))}));null==onAmplitudeCallback||onAmplitudeCallback(u)};o(),amplitudeTimer=setInterval(o,80)}catch(n){stopAmplitudeSampling()}}}function emitRecognitionError(e){onErrorCallback?onErrorCallback(e):console.error(e.message,e.raw)}function doSend(e){websocket&&websocket.readyState===WebSocket.OPEN&&websocket.send(e)}function onOpen(){doSend(JSON.stringify({type:"START",data:{user:"baidu_pc",dev_key:key,dev_pid:pid,cuid:"self_defined_server_id_like_mac_address",sample:16e3,format:"pcm",type:1,role_num:1,vad_type:1,vad_mode:0,channels:1,need_session_finish:!0,punc:!0,start_timestamp:(new Date).valueOf()}}))}function onMessage(e){try{var t=JSON.parse(e.data),n=t.type,i=t.err_no,a=t.err_msg,o=t.result;if(i&&0!==i){if(-3005===i)return;return void emitRecognitionError({message:"语音识别错误: ".concat(null!=a?a:""),code:i,raw:t})}if("HEARTBEAT"===n)return;onResultCallback&&onResultCallback({text:o,type:n})}catch(t){throw emitRecognitionError({message:"解析错误",raw:t}),new Error("解析错误!"+t)}}function onError(e){var t="websocket连接失败"+("data"in e&&"string"==typeof e.data?e.data:"");if(emitRecognitionError({message:t,raw:e}),!onErrorCallback)throw new Error(t)}function startWebSocket(){websocket&&websocket.close();var e=WS_URL+"?sn="+("undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2)));(websocket=new WebSocket(e)).onopen=function(){onOpen()},websocket.onmessage=function(e){onMessage(e)},websocket.onerror=function(e){onError(e)}}function handleAudioprocess(e){var t=e.inputBuffer,n=encodedPcmBuffer(t.getChannelData(0),t.sampleRate);n.some((function(e){return 0!==e}))&&doSend(n)}function initAudio(e){audioContent&&audioContent.close();var t=window.AudioContext||window.webkitAudioContext;audioContent=new t({sampleRate:SAMPLE_RATE}),streamSource=audioContent.createMediaStreamSource(e),scriptProcessor=audioContent.createScriptProcessor(BUFFER_SIZE,INPUT_CHANNELS,OUTPUT_CHANNELS),streamSource.connect(scriptProcessor),scriptProcessor.connect(audioContent.destination),scriptProcessor.onaudioprocess=handleAudioprocess,startAmplitudeSampling(audioContent,streamSource)}function acquireStream(){return isWarmStreamUsable()?Promise.resolve(m_stream):audioStreamPromise||(audioStreamPromise=Promise.resolve().then((function(){return navigator.mediaDevices.getUserMedia(GETUSERMEDIA_CONSTRAINTS)})).then((function(e){return m_stream=e,e}))["catch"]((function(e){throw audioStreamPromise=null,e})),audioStreamPromise)}function isWarmStreamUsable(){return!!m_stream&&m_stream.getTracks().every((function(e){return"live"===e.readyState}))}function prewarmRecorder(){if(prewarmed)return Promise.resolve();onErrorCallback=onErrorCallback||function(){};var e=warmGeneration;return acquireStream().then((function(){if(e!==warmGeneration)return m_stream&&(m_stream.getTracks().forEach((function(e){return e.stop()})),m_stream=null),audioStreamPromise=null,void(prewarmed=!1);prewarmed=!0}))["catch"]((function(){prewarmed=!1}))}function discardPrewarmRecorder(){warmGeneration++,closeAudio();try{websocket&&websocket.close()}catch(e){}websocket=null}function startRecorder(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return onResultCallback=e.onResult||null,onAmplitudeCallback=e.onAmplitude||null,onErrorCallback=e.onError||null,stopAmplitudeSampling(),acquireStream().then((function(e){websocket&&websocket.readyState!==WebSocket.CLOSED||startWebSocket(),initAudio(e)}))["catch"]((function(e){var t="";switch(e.name){case"NotAllowedError":case"PermissionDeniedError":t="用户已禁止网页调用录音设备";break;case"NotFoundError":case"DevicesNotFoundError":t="录音设备未找到";break;case"NotSupportedError":t="不支持录音功能";break;default:t="录音调用错误"}throw new Error(t)}))}function closeAudio(){audioStreamPromise=null,prewarmed=!1,stopAmplitudeSampling(),scriptProcessor&&(scriptProcessor.disconnect(),scriptProcessor.onaudioprocess=null),streamSource&&streamSource.disconnect(),audioContent&&(audioContent.close(),audioContent=null),m_stream&&m_stream.getTracks().forEach((function(e){return e.stop()}))}function stopRecorder(){closeAudio(),doSend(FINISH_PARAMS);try{websocket&&websocket.close()}catch(e){}websocket=null}var DEFAULT_BAR_HEIGHTS=[1,1.5,2,1.5,1],_VoiceInput=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).occlusionCheckTimer=null,e.voiceTrigger="button",e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{showDialog:!1,isRecording:!1,barHeights:DEFAULT_BAR_HEIGHTS.slice(),position:"bottom",tipContent:"点击开启语音输入"}}},{key:"attached",value:function(){var e=this.$input.getRootData("tools.right.voice");e&&e.spaceVoice&&this.data.set("tipContent","点击或按住空格语音输入"),this.stopRecording=this.stopRecording.bind(this),this.handleVisibilityChange=this.handleVisibilityChange.bind(this),this.startRecording=this.startRecording.bind(this),this.$input.on(EVENTS.VOICE_INPUT_STOP,this.stopRecording),this.$input.on(EVENTS.MUSIC_PLAY,this.stopRecording),this.$input.on(EVENTS.VOICE_INPUT_TRIGGER,this.startRecording),this.showVoiceTip=this.showVoiceTip.bind(this),this.hideVoiceTip=this.hideVoiceTip.bind(this),this.$input.on(EVENTS.VOICE_TIP_SHOW,this.showVoiceTip),this.$input.on(EVENTS.VOICE_TIP_HIDE,this.hideVoiceTip),window.addEventListener("beforeunload",this.stopRecording),document.addEventListener("visibilitychange",this.handleVisibilityChange)}},{key:"detached",value:function(){this.stopRecording&&window.removeEventListener("beforeunload",this.stopRecording),this.handleVisibilityChange&&document.removeEventListener("visibilitychange",this.handleVisibilityChange),this.$input.off(EVENTS.VOICE_INPUT_TRIGGER,this.startRecording),this.$input.off(EVENTS.VOICE_TIP_SHOW,this.showVoiceTip),this.$input.off(EVENTS.VOICE_TIP_HIDE,this.hideVoiceTip),this.stopOcclusionCheck(),this.resetRecording()}},{key:"showVoiceTip",value:function(){var e,t=this.ref("tip");null==(e=null==t?void 0:t.showTooltip)||e.call(t)}},{key:"hideVoiceTip",value:function(){var e,t=this.ref("tip");null==(e=null==t?void 0:t.hideTooltip)||e.call(t)}},{key:"handleTipShow",value:function(){this.$input.getRootData().scene!==AI_SCENE&&this.$input.sendLog("show","search_kuang",{pos:"voice_tips"})}},{key:"handleClick",value:function(e){e.stopPropagation(),this.data.get("isRecording")?this.resetRecording():this.startRecording(void 0)}},{key:"startRecording",value:function(e){var t=this;this.data.get("isRecording")||(this.voiceTrigger="space"===e?"space":"button",startRecorder({onResult:function(e){return t.handleRecognition(e)},onAmplitude:function(e){return t.handleAmplitude(e)},onError:function(e){return t.handleRecognitionError(e)}}).then((function(){t.data.set("isRecording",!0),t.startOcclusionCheck(),t.handleVoiceStart()}))["catch"]((function(e){console.error("语音录制启动失败",e),t.resetRecording(!1),t.data.set("showDialog",!0),t.handleVoiceError({message:e.message||"语音输入启动失败"})})))}},{key:"handleRecognition",value:function(e){var t=e.text,n=e.type;n!==RecognitionMessageType.FIN_TEXT?t&&n===RecognitionMessageType.MID_TEXT&&this.data.get("isRecording")&&this.handleVoiceRecognized(t):this.resetRecording()}},{key:"handleAmplitude",value:function(e){this.data.get("isRecording")&&this.data.set("barHeights",e)}},{key:"handleRecognitionError",value:function(e){this.data.get("isRecording")&&this.resetRecording(),this.handleVoiceError(e)}},{key:"stopRecording",value:function(){this.data.get("isRecording")&&this.resetRecording()}},{key:"handleVisibilityChange",value:function(){this.data.get("isRecording")&&document.hidden&&this.resetRecording()}},{key:"handleDialogOk",value:function(){this.data.set("showDialog",!1)}},{key:"checkInputOcclusion",value:function(){var e=this.el;if(!e)return!1;var t=e.getBoundingClientRect();if(0===t.width||0===t.height||t.bottom<0||t.top>window.innerHeight||t.right<0||t.left>window.innerWidth)return!0;var n=t.left+t.width/2,i=t.top+t.height/2,a=document.elementFromPoint(n,i);return!a||!e.contains(a)&&a!==e}},{key:"startOcclusionCheck",value:function(){var e=this;this.stopOcclusionCheck(),this.occlusionCheckTimer=window.setInterval((function(){e.data.get("isRecording")&&e.checkInputOcclusion()&&e.resetRecording()}),500)}},{key:"stopOcclusionCheck",value:function(){null!==this.occlusionCheckTimer&&(window.clearInterval(this.occlusionCheckTimer),this.occlusionCheckTimer=null)}},{key:"resetRecording",value:function(){var e=!(arguments.length>0&&arguments[0]!==undefined)||arguments[0];this.data.get("isRecording")&&(this.data.set("isRecording",!1),this.data.set("barHeights",DEFAULT_BAR_HEIGHTS.slice()),this.stopOcclusionCheck(),e&&stopRecorder(),this.handleVoiceStop())}},{key:"getVoiceController",value:function(){return this.$input.getVoiceController()}},{key:"handleVoiceStart",value:function(){this.getVoiceController().onRecordingStart();var e=this.$input.getRootData().scene,t="space"===this.voiceTrigger&&e===AI_SCENE?"searchkuang_voice_long_press":e===AI_SCENE?"searchkuang_voice_open":"search_kuang";this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.VOICE_INPUT_START,data:{}}),this.$input.emit(EVENTS.VOICE_INPUT_START,{}),this.$input.sendLog("click",t,{pos:"space"===this.voiceTrigger?"voice_long_press":"voice",query:this.$input.getValue(),button_goal_status:"open",voice_time:0,voice_content:""})}},{key:"handleVoiceStop",value:function(){this.getVoiceController().onRecordingStop()}},{key:"handleVoiceRecognized",value:function(e){this.getVoiceController().onRecognized(e)}},{key:"handleVoiceError",value:function(e){this.getVoiceController().onRecordingError(e)}}])}(ApiCmpt);_VoiceInput.template='\n <div class="ci-voice{{isRecording ? \' ci-voice-recording\' : \'\'}}" on-click="handleClick">\n <tooltip\n s-ref="tip"\n content="{{tipContent}}"\n position="{{position}}"\n on-hover="handleTipShow"\n >\n <div class="ci-tool-item ci-weak-svg" aria-pressed="{{isRecording}}">\n <div class="ci-voice-mic-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <rect x="5.91621" y="1.63398" width="8.16801" height="11.6845" rx="4.084" stroke="currentColor" stroke-width="1.6" />\n <path d="M3.48096 12.5547C4.64674 14.9817 7.12786 16.6572 10.0003 16.6572C12.8728 16.6572 15.3539 14.9817 16.5197 12.5547" stroke="currentColor" stroke-width="1.6" stroke-linecap="square" />\n <path d="M10 16.6582V18.6118" stroke="currentColor" stroke-width="1.6" stroke-linecap="square" />\n </svg>\n </div>\n </div>\n </tooltip>\n <tooltip\n s-if="isRecording"\n content="停止语音输入"\n bottom="46"\n position="{{position}}"\n >\n <div class="ci-voice-pill">\n <span class="ci-voice-pill-text">正在听</span>\n <div class="ci-voice-pill-bars" aria-hidden="true">\n <i class="ci-voice-pill-bars-bar" style="height: {{barHeights[0] * 4}}px"></i>\n <i class="ci-voice-pill-bars-bar" style="height: {{barHeights[1] * 4}}px"></i>\n <i class="ci-voice-pill-bars-bar" style="height: {{barHeights[2] * 4}}px"></i>\n <i class="ci-voice-pill-bars-bar" style="height: {{barHeights[3] * 4}}px"></i>\n <i class="ci-voice-pill-bars-bar" style="height: {{barHeights[4] * 4}}px"></i>\n </div>\n </div>\n </tooltip>\n <ci-dialog\n open="{=showDialog=}"\n title="无法使用语音功能,可能存在以下情况"\n ok-text="我知道了"\n closable="{{false}}"\n mask-closable="{{false}}"\n on-ok="handleDialogOk"\n >\n <template slot="title">\n <div class="ci-voice-dialog-title">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="20"\n height="20"\n viewBox="0 0 24 24"\n class="ci-voice-dialog-title-icon"\n >\n <circle cx="12" cy="12" r="10" fill="#FF7D00" />\n <rect x="11" y="6" width="2" height="8" fill="#fff" />\n <circle cx="12" cy="16.5" r="1.2" fill="#fff" />\n </svg>\n <span>无法使用语音功能,可能存在以下情况</span>\n </div>\n </template>\n <div class="ci-voice-dialog-tips">\n <div class="ci-voice-dialog-tips-item">\n <div class="ci-voice-dialog-tips-item-title"><span class="ci-voice-dialog-tips-item-title-index">1.</span> 未开启浏览器麦克风权限</div>\n <div class="ci-voice-dialog-tips-item-desc">可点击浏览器地址栏中的设置按钮,开启麦克风权限开关。</div>\n <div class="ci-voice-dialog-tips-item-img">\n <img\n src="https://psstatic.cdn.bcebos.com/basics/aichat/voice-input-%20permission_1760681796000.png"\n alt="语音权限设置"\n />\n </div>\n </div>\n <div class="ci-voice-dialog-tips-item">\n <div class="ci-voice-dialog-tips-item-title"><span class="ci-voice-dialog-tips-item-title-index">2.</span> 当前浏览器不支持语音</div>\n <div class="ci-voice-dialog-tips-item-desc">可更换Chrome、Edge、Safari等浏览器使用。</div>\n </div>\n <div class="ci-voice-dialog-tips-item">\n <div class="ci-voice-dialog-tips-item-title"><span class="ci-voice-dialog-tips-item-title-index">3.</span> 台式机未插麦克风</div>\n <div class="ci-voice-dialog-tips-item-desc">请插入麦克风后使用语音搜索功能。</div>\n </div>\n </div>\n </ci-dialog>\n </div>\n ',_VoiceInput.trimWhitespace="all",_VoiceInput.components={"ci-dialog":Dialog,tooltip:Main$i};var VoiceInput=_VoiceInput,_UploadTypeSelector=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{position:"top",isPopoverOpen:!1}}},{key:"setPopoverOpen",value:function(e){this.data.set("isPopoverOpen",e)}},{key:"attached",value:function(){this.$input.translog().scan(this.el)}},{key:"updated",value:function(){this.$input.translog().scan(this.el)}},{key:"detached",value:function(){this.$input.translog().unobserve(this.el)}},{key:"handleClick",value:function(e){e.stopPropagation();var t=this.$input.getRootData().isChatSearch;this.$input.sendLog("click",t?"input_function":"search_kuang",{pos:"all_file",query:this.$input.getValue(),button:"all_file"});var n=this.data.get("position");this.$input.emit(EVENTS.OPEN_MERGE_UPLOAD,{targetDom:this.el,triggerCmpt:this,direction:"top"===n?"up":"down",hideDisabled:!1})}}])}(ApiCmpt);_UploadTypeSelector.template='\n <div\n class="ci-merge-upload-wrapper ci-merge-upload-wrapper-{{position}}"\n on-click="handleClick($event)"\n >\n <tooltip content="点击上传图片或文件" position="{{position}}" show-content="{{!isPopoverOpen}}">\n <div\n class="ci-tool-item ci-weak-svg"\n id="ci-merge-upload-btn"\n data-ci-show-item\n data-ci-show-ext="{{showExt}}"\n data-focus-input="1"\n >\n <svg\n width="22"\n height="22"\n viewBox="0 0 22 22"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11 19.5C15.6944 19.5 19.5 15.6944 19.5 11C19.5 6.30558 15.6944 2.5 11 2.5C6.30558 2.5 2.5 6.30558 2.5 11C2.5 15.6944 6.30558 19.5 11 19.5Z"\n stroke="currentColor"\n stroke-width="1.6"\n stroke-linejoin="round"\n />\n <path\n d="M11 7.33398V14.6673"\n stroke="currentColor"\n stroke-width="1.6"\n stroke-linecap="square"\n stroke-linejoin="round"\n />\n <path\n d="M7.33325 11H14.6666"\n stroke="currentColor"\n stroke-width="1.6"\n stroke-linecap="square"\n stroke-linejoin="round"\n />\n </svg>\n </div>\n </tooltip>\n </div>\n ',_UploadTypeSelector.components={tooltip:Main$i},_UploadTypeSelector.computed={showExt:function(){return JSON.stringify({value:"input_function",ext:{button:"all_file"}})}};var UploadTypeSelector=_UploadTypeSelector;function getExt(e){return JSON.stringify({value:"input_function",ext:{button:e}})}var Main$9=(_o=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{tools:{},aiScene:AI_SCENE,scene:"",fileList:[],fileGuideWords:[],position:"top",openPanelType:"",inputUploadType:"",upload:{},submitBtnActive:!1,submitBtnStatus:{pause:!1,active:!1},wenxinImgSrc:"https://psstatic.cdn.bcebos.com/basics/aichat/wenwenxin_1777004036000.png"}}},{key:"updated",value:function(){this.$input.translog().scan(this.el)}},{key:"attached",value:function(){var e=this;this.valueChangeHandler=this.valueChangeHandler.bind(this),this.$input.on(EVENTS.VALUE_CHANGE,this.valueChangeHandler),this.$input.translog().scan(this.el),this.watch("clearBtnShow",(function(t){t&&e.$input.sendLog("show","content_clear")})),this.watch("submitBtnStatus",(function(t){(null==t?void 0:t.pause)||e.syncActive(!0===(null==t?void 0:t.active))})),this.watch("fileList",(function(){e.syncActiveByInputInfo()})),this.watch("openPanelType",(function(){e.syncActiveByInputInfo()})),this.voiceInputCompleteHandler=this.voiceInputCompleteHandler.bind(this),this.$input.on(EVENTS.VOICE_INPUT_COMPLETE,this.voiceInputCompleteHandler)}},{key:"valueChangeHandler",value:function(){this.syncActiveByInputInfo()}},{key:"syncActiveByInputInfo",value:function(){var e=this.data.get("fileList")||[],t=this.$input.getInputInfo(),n=t.canSendPlaceholder,i=t.placeholder,a=t.prefix,o=t.value,s=o||"";"ai_music_create"===(null==a?void 0:a.type)&&s.length<5?this.data.set("submitBtnActive",!1):e.length?this.data.set("submitBtnActive",e.filter((function(e){return 2===e.status})).length>0):this.data.set("submitBtnActive",o||n===i)}},{key:"voiceInputCompleteHandler",value:function(e){var t=this.$input.getRootData().scene===AI_SCENE?"searchkuang_voice_close":"search_kuang";this.$input.sendLog("click",t,{pos:"voice",query:this.$input.getValue(),button_goal_status:"close",voice_time:e.duration,voice_content:e.content})}},{key:"detached",value:function(){this.$input.off(EVENTS.VALUE_CHANGE,this.valueChangeHandler),this.$input.off(EVENTS.VOICE_INPUT_COMPLETE,this.voiceInputCompleteHandler),this.$input.translog().unobserve(this.el)}},{key:"handleClickUploadFile",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a,o,s;return _regenerator().w((function(n){for(;;)switch(n.n){case 0:t.stopPropagation(),i=this.$input.getRootData(),a=i.isChatSearch,o="file"===e?e:"pic",this.$input.sendLog("click",a?"input_function":"search_kuang",{pos:o,query:this.$input.getValue(),button:o}),(s=this.data.get("fileType"))&&e!==s||(this.$input.emit(EVENTS.UPLOAD_FILE,{uploadType:e,uploadScene:"input",targetDom:this.el.querySelector("#ci-right-tool")}),!a&&this.$input.emit(EVENTS.VOICE_INPUT_STOP));case 1:return n.a(2)}}),n,this)})))}},{key:"handleClear",value:function(){this.$input.emit(EVENTS.CLEAR,{setMode:!1}),this.$input.sendLog("click","content_clear")}},{key:"handlePause",value:function(){this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.PAUSE,data:{}}),this.$input.sendLog("click","content_create_stop"),this.data.set("submitBtnStatus.pause",!1)}},{key:"handleSubmit",value:function(){var e,t,n=this.$input.getRootData(),i=n.isChatSearch,a=n.input;i||(null==(e=null==a?void 0:a.prefix)?void 0:e.type)?this.$input.sendLog("click","nonala_cpt",{action:"ask",has_task_addmessage:(null==(t=this.$input.getRootData("reference"))?void 0:t.taskContext)?1:0,valueInfo:[{component_name:"input"}]}):this.$input.sendLog("click","search_kuang",{pos:"se_btn"}),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUBMIT,data:{triggerType:"click"}})}},{key:"handleWenxinSubmit",value:function(){var e;this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.WENXIN_SUBMIT,data:{triggerType:"wenxin"}}),this.$input.sendLog("click","nonala_cpt",{action:"ask",has_task_addmessage:(null==(e=this.$input.getRootData("reference"))?void 0:e.taskContext)?1:0,valueInfo:[{component_name:"input"}]})}},{key:"handleLinkClick",value:function(){var e,t,n,i,a,o,s,r=(this.$input.getRootData().panels.list||[]).find((function(e){return e.type.includes("ai_read")})),l=(null==(t=null==(e=null==r?void 0:r.jump_panel)?void 0:e.data)?void 0:t.new_ai_read)||(null==(i=null==(n=null==r?void 0:r.jump_panel)?void 0:n.data)?void 0:i.ai_read),c=null==(s=null==(o=null==(a=null==l?void 0:l.bottom_bar)?void 0:a["function"])?void 0:o.input)?void 0:s.input_custom;this.$input.setValue({value:c});var d=this.$input.getRootData().isChatSearch;this.$input.sendLog("click",d?"input_function":"search_kuang",{button:"link",function_type:"ai_read"})}},{key:"syncActive",value:function(){var e=arguments.length>0&&arguments[0]!==undefined&&arguments[0],t=this.data.get("fileList");if(t.length)this.data.set("submitBtnActive",t.some((function(e){return 2===e.status})));else{var n=this.$input.getInputInfo(),i=n.canSendPlaceholder,a=n.placeholder,o=n.value;this.data.set("submitBtnActive",e||o||i===a)}}}])}(ApiCmpt),_o.template='\n <div class="right-tools-wrapper" data-focus-input="1">\n <div id="ci-right-tool">\n <div\n s-if="{{clearBtnShow}}"\n class="tools-clear-icon"\n on-click="handleClear"\n >\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="18"\n height="18"\n viewBox="0 0 18 18"\n fill="none"\n >\n <g\n opacity="0.5"\n clip-path="url(#clip0_789_21003)"\n >\n <path\n d="M9.00033 17.3334C13.6027 17.3334 17.3337 13.6024 17.3337 9.00008C17.3337 4.39772 13.6027 0.666748 9.00033 0.666748C4.39796 0.666748 0.666992 4.39772 0.666992 9.00008C0.666992 13.6024 4.39796 17.3334 9.00033 17.3334ZM12.1384 6.80482L9.94309 9.00008L12.1384 11.1953L11.1955 12.1381L9.00026 9.94288L6.80503 12.1381L5.86219 11.1953L8.05746 9.00008L5.86219 6.80482L6.80503 5.86202L9.00026 8.05728L11.1955 5.86202L12.1384 6.80482Z"\n fill="#9195A3"\n />\n </g>\n <defs>\n <clipPath id="clip0_789_21003">\n <rect\n width="18"\n height="18"\n fill="white"\n />\n </clipPath>\n </defs>\n </svg>\n </div>\n <div\n class="ci-right-tool\n {{!isShowFileUpload && !isShowMic ? \'right-tool-no-margin\' : \'\'}}\n "\n >\n <div\n id="ci-smart-mic"\n class="ci-smart-mic"\n s-if="{{tools.voice}}"\n data-ci-show-item\n data-ci-show-ext="{{showExtVoice}}"\n >\n <voice-input\n s-ref="voiceInput"\n position="{{position}}"\n />\n </div>\n <upload-type-selector\n s-if="{{tools.mergeFileImageUpload && showFileUpload}}"\n file-type="{{fileType}}"\n file-list="{{fileList}}"\n upload="{{upload}}"\n merged-hover-text="{{mergedHoverText}}"\n position="{{position}}"\n input-upload-type="{{inputUploadType}}"\n />\n <tooltip\n content="{{fileUploadTooltip}}"\n show-content="{{inputUploadType !== \'file\'}}"\n max-width="320"\n position="{{position}}"\n s-if="{{!tools.mergeFileImageUpload && tools.fileUpload && showFileUpload}}"\n >\n <div\n id="ci-file-upload-btn"\n on-click="handleClickUploadFile(\'file\', $event)"\n data-ci-show-item\n data-ci-show-ext="{{showExtFile}}"\n class="ci-tool-item ci-weak-svg\n {{((fileType &&\n fileType !== \'file\') ||\n (curUploadFileMaxNum && fileList.length >= curUploadFileMaxNum)) ?\n \'upload-btn-disabled\' : \'\'}}"\n >\n <svg\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M11.4405 5.94065L7.25022 10.1309C6.52703 10.8541 6.52703 12.0266 7.25022 12.7498C7.97342 13.473 9.14595 13.473 9.86914 12.7498L11.3095 11.3094L14.0594 8.55957L14.7141 7.90484C16.1605 6.45845 16.1605 4.1134 14.7141 2.66701C13.2677 1.22062 10.9227 1.22062 9.4763 2.66701L3.97658 8.16673C1.807 10.3363 1.807 13.8539 3.97658 16.0235C6.14616 18.1931 9.66374 18.193 11.8333 16.0235L16.6783 11.1785"\n stroke="currentColor"\n stroke-width="1.6"\n />\n </svg>\n </div>\n </tooltip>\n <tooltip\n content="{{imageUploadTooltip}}"\n show-content="{{inputUploadType !== \'image\'}}"\n position="{{position}}"\n s-if="{{!tools.mergeFileImageUpload && tools.imageUpload && showFileUpload}}"\n >\n <div\n id="ci-image-upload-btn"\n on-click="handleClickUploadFile(\'image\', $event)"\n data-ci-show-item\n data-ci-show-ext="{{showExtImage}}"\n class="ci-tool-item ci-weak-svg\n {{((fileType &&\n fileType !== \'image\') ||\n (curUploadImageMaxNum && fileList.length >= curUploadImageMaxNum)) ?\n \'upload-btn-disabled\' : \'\'}}"\n >\n <svg\n width="20"\n height="20"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M1.85278 4.81463C1.85278 3.58733 2.84771 2.59241 4.07501 2.59241H15.9269C17.1542 2.59241 18.1491 3.58733 18.1491 4.81463V15.185C18.1491 16.4123 17.1542 17.4072 15.9269 17.4072H4.075C2.8477 17.4072 1.85278 16.4123 1.85278 15.185V4.81463Z"\n stroke="currentColor"\n stroke-width="1.6"\n />\n <circle\n cx="13.7136"\n cy="7.14282"\n r="2.1"\n fill="currentColor"\n stroke="white"\n stroke-width="0.8"\n />\n <path\n d="M1.85278 14.2326L5.08504 9.72923C5.81909 8.70649 7.25533 8.49716 8.25077 9.26783L17.5001 16.4286"\n stroke="currentColor"\n stroke-width="1.6"\n />\n </svg>\n </div>\n </tooltip>\n <tooltip\n s-if="openPanelType === \'ai_read\'"\n content="支持各类网页链接"\n position="{{position}}"\n >\n <div\n class="ci-tool-item ci-weak-svg"\n data-ci-show-item\n data-ci-show-ext="{{showExtLink}}"\n on-click="handleLinkClick"\n >\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <g clip-path="url(#clip0_1865_9665)">\n <path d="M12.6643 3.18171C13.792 2.05399 15.6406 2.05576 16.7933 3.20843C17.9459 4.3611 17.9477 6.20967 16.82 7.33738L14.558 9.59933L15.6056 10.6469L17.8676 8.38495C19.584 6.66851 19.5618 3.88187 17.8408 2.16086C16.1198 0.439864 13.3332 0.417703 11.6168 2.13414L8.36132 5.38958C6.64488 7.10602 6.66704 9.89266 8.38804 11.6137L8.91182 12.1374L9.95938 11.0899L9.4356 10.5661C8.28293 9.41343 8.28117 7.56486 9.40888 6.43714L12.6643 3.18171Z" fill="currentColor"/>\n <path d="M11.6146 8.19855L11.0909 7.67477L10.0433 8.72234L10.5671 9.24612C11.7197 10.3988 11.7215 12.2474 10.5938 13.3751L7.33836 16.6305C6.21064 17.7582 4.36208 17.7565 3.20941 16.6038C2.05674 15.4511 2.05497 13.6025 3.18269 12.4748L5.44463 10.2129L4.39707 9.16532L2.13512 11.4273C0.41868 13.1437 0.44084 15.9304 2.16184 17.6514C3.88284 19.3724 6.66948 19.3945 8.38592 17.6781L11.6414 14.4226C13.3578 12.7062 13.3356 9.91955 11.6146 8.19855Z" fill="currentColor"/>\n <path d="M12.6643 3.18171C13.792 2.05399 15.6406 2.05576 16.7933 3.20843C17.9459 4.3611 17.9477 6.20967 16.82 7.33738L14.558 9.59933L15.6056 10.6469L17.8676 8.38495C19.584 6.66851 19.5618 3.88187 17.8408 2.16086C16.1198 0.439864 13.3332 0.417703 11.6168 2.13414L8.36132 5.38958C6.64488 7.10602 6.66704 9.89266 8.38804 11.6137L8.91182 12.1374L9.95938 11.0899L9.4356 10.5661C8.28293 9.41343 8.28117 7.56486 9.40888 6.43714L12.6643 3.18171Z" stroke="currentColor" stroke-width="0.15" stroke-linecap="square"/>\n <path d="M11.6146 8.19855L11.0909 7.67477L10.0433 8.72234L10.5671 9.24612C11.7197 10.3988 11.7215 12.2474 10.5938 13.3751L7.33836 16.6305C6.21064 17.7582 4.36208 17.7565 3.20941 16.6038C2.05674 15.4511 2.05497 13.6025 3.18269 12.4748L5.44463 10.2129L4.39707 9.16532L2.13512 11.4273C0.41868 13.1437 0.44084 15.9304 2.16184 17.6514C3.88284 19.3724 6.66948 19.3945 8.38592 17.6781L11.6414 14.4226C13.3578 12.7062 13.3356 9.91955 11.6146 8.19855Z" stroke="currentColor" stroke-width="0.15" stroke-linecap="square"/>\n </g>\n <defs>\n <clipPath id="clip0_1865_9665">\n <rect width="20" height="20" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </div>\n </tooltip>\n </div>\n </div>\n <span\n s-if="{{scene === aiScene || tools.aiBtn}}"\n class="ci-submit-button"\n >\n <img\n s-if="submitBtnStatus.pause"\n class="ci-submit-pause"\n src="https://psstatic.cdn.bcebos.com/basics/chat/pause_1751376511000.png"\n on-click="handlePause"\n data-focus-input="noAgain"\n >\n <img\n s-else\n id="ci-submit-button-ai"\n class="{{submitBtnActive ? \'ci-submit-button-ai-active\' : \'\'}}"\n src="https://psstatic.cdn.bcebos.com/basics/chat/send-icon_1750678058000.svg"\n alt=""\n on-click="handleSubmit"\n data-focus-input="noAgain"\n >\n </span>\n <button\n s-elif="{{tools.wenxinBtn}}"\n id="ci-submit-button"\n class="ci-submit-wenxin"\n on-click="handleWenxinSubmit"\n >\n <img\n src="{{tools.wenxinImgSrc || wenxinImgSrc}}"\n alt="问文心"\n >\n </button>\n <button\n s-else\n id="ci-submit-button"\n class="ci-submit-text"\n on-click="handleSubmit"\n >百度一下</button>\n </div>\n ',_o.components={tooltip:Main$i,"cs-input-model":Main$e,"voice-input":VoiceInput,"upload-type-selector":UploadTypeSelector},_o.computed={showFileUpload:function(){var e=this.data.get("openPanelType");return this.data.get("taskMode")||!e||FILE_PANEL_TYPES.indexOf(e)>-1},curUploadFileMaxNum:function(){var e;return(null==(e=(this.data.get("upload")||{}).file)?void 0:e.uploadMaxNum)||10},curUploadImageMaxNum:function(){var e;return(null==(e=(this.data.get("upload")||{}).image)?void 0:e.uploadMaxNum)||10},mergedHoverText:function(){var e=this.data.get("hoverText")||{};return{deepSearch:e.deepSearch||hoverText.ASKAIHOVER,defaultFile:e.defaultFile||hoverText.DEFAULTFILE,fullFile:e.fullFile||hoverText.FULLFILE,defaultPic:e.defaultPic||hoverText.PIC,fullPic:e.fullPic||hoverText.FULLPIC,mergeText:e.mergeText||hoverText.MERGETEXT}},fileUploadTooltip:function(){var e,t=this.data.get("fileType"),n=this.data.get("fileList")||[],i=(null==(e=(this.data.get("upload")||{}).file)?void 0:e.uploadMaxNum)||10,a=this.data.get("mergedHoverText")||{};return t&&"file"!==t?a.mergeText||"":"file"===t&&n.length>=i?(a.fullFile||"").replace("maxNum",i+""):(a.defaultFile||"").replace("maxNum",i+"")},imageUploadTooltip:function(){var e,t=this.data.get("fileType"),n=this.data.get("fileList")||[],i=(null==(e=(this.data.get("upload")||{}).image)?void 0:e.uploadMaxNum)||10,a=this.data.get("mergedHoverText")||{};return t&&"image"!==t?a.mergeText||"":"image"===t&&n.length>=i?(a.fullPic||"").replace("maxNum",i+""):(a.defaultPic||"").replace("maxNum",i+"")},showExtVoice:function(){return getExt("voice")},showExtLink:function(){return getExt("link")},showExtFile:function(){return getExt("file")},showExtImage:function(){return getExt("pic")}},_o),getUserAgentInfo=function(){var e="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",t=e.includes("iphone")||e.includes("ipod")||e.includes("ipad"),n=e.includes("android"),i=e.includes("baiduboxapp"),a=e.includes("searchcraft"),o=e.includes("theme/dark"),s=e.includes("bdhonorbrowser"),r=e.includes("huawei"),l=e.includes("qqbrowser"),c=e.includes("safari")&&!e.includes("chrome"),d=e.includes("firefox"),u=e.includes("arkweb")&&e.includes("tablet"),p=e.includes("ipad")||u,h=e.includes("arkweb")&&!p;return{isIOS:t,isAndroid:n,isBaiduBox:i,isSearchCraft:a,isDarkMode:o,isQQBrowser:l,isSafari:c,platform:p?"pc":/Mobi|Android|iPhone|ArkWeb/i.test(e||"")?"wise":"pc",isWindows:e.includes("windows"),isFirefox:d,scene:"RECALL_SCENE",isBdhonor:s,isHarmony:h,isHarmonyPad:u,isHuawei:r}},uaInfo=getUserAgentInfo(),isFirefox=function(){return uaInfo.isFirefox},isSafari=function(){return uaInfo.isSafari},INPUT_CUSTOM_CLASS="ci-custom-item",INPUT_NO_WIDTH_ITEM_CLASS="ci-custom-no-width-item",INPUT_CUSTOM_WRAPPER_CLASS="ci-custom-input-wrapper",INPUT_TEXT_NODE_CLASS="ci-text-node",WAIT_DELETE_ATTR="deletion",INPUT_FIELD_CLASS="ci-editor-content",INPUT_CUSTOM_NEED_CLEAR_TEXT_CLASS="ci-custom-need-clear-text",INPUT_PREFIX_WRAPPER_CLASS="ci-prefix-wrapper",INPUT_AGENT_CLASS="cs-pc-input-agent",AI_INPUT_FILE_CLASS="ai-input-file",AI_INPUT_IMAGE_CLASS="ai-input-image";function isInputNode(e){var t;return!!(null==(t=null==e?void 0:e.className)?void 0:t.includes(INPUT_CUSTOM_CLASS))}function isInputNodeWrapper(e){var t;return!!(null==(t=null==e?void 0:e.className)?void 0:t.includes(INPUT_CUSTOM_WRAPPER_CLASS))}function isTextNode(e){var t;return!!(null==(t=null==e?void 0:e.className)?void 0:t.includes(INPUT_TEXT_NODE_CLASS))}function isValidFocusTarget(e){return!!(e&&e instanceof HTMLElement)&&(isInputNode(e)||isTextNode(e))}function setCursorToNodeStart(e){if(e){if(isInputNodeWrapper(e)){var t=e.querySelector(".".concat(INPUT_CUSTOM_CLASS));t&&(e=t)}var n=e.parentNode;if(n&&n instanceof HTMLElement&&n.isContentEditable){var i=document.createRange();if(e.nodeType===Node.TEXT_NODE)i.setStart(e,0);else if(e instanceof HTMLElement){var a=e.firstChild;a&&a.nodeType===Node.TEXT_NODE?i.setStart(a,0):i.setStart(e,0)}else i.setStart(e,0);i.collapse(!0);var o=window.getSelection();null==o||o.removeAllRanges(),null==o||o.addRange(i)}}}function cancelWaitDeleteNode(e){(null==e?void 0:e.setAttribute)&&e.setAttribute(WAIT_DELETE_ATTR,"0")}function deleteWaitNode(e){if(isInputNode(e)){var t=e.parentElement;isInputNodeWrapper(t)&&t.parentNode?t.remove():e.remove()}else e.remove()}function getDeepestLastTextNode(e){for(var t=e;t&&t.lastChild;)t=t.lastChild;return t&&t.nodeType===Node.TEXT_NODE?t:null}function setCursorToNode$1(e){var t,n;if(e){if(isInputNodeWrapper(e)){var i=e.querySelector(".".concat(INPUT_CUSTOM_CLASS));i&&(e=i)}var a=e.parentNode;if(a&&a instanceof HTMLElement&&a.isContentEditable){var o=document.createRange();if(e.nodeType===Node.TEXT_NODE){var r=e;o.setStart(r,r.length)}else if(e instanceof HTMLElement){var l=getDeepestLastTextNode(e);l?o.setStart(l,l.length):o.setStart(e,e.childNodes.length)}else try{o.setStart(e,null!=(n=null==(t=e.childNodes)?void 0:t.length)?n:0)}catch(s){o.setStart(e,0)}o.collapse(!0);var c=window.getSelection();null==c||c.removeAllRanges(),null==c||c.addRange(o)}}}function getCursorPosition(){var e=window.getSelection(),t=null==e?void 0:e.getRangeAt(0);return t?{startContainer:t.startContainer,startOffset:t.startOffset,endOffset:t.endOffset}:{}}function getTextNode(e){var t=document.createElement("span");return t.className=INPUT_TEXT_NODE_CLASS,t.innerText=e.content||e.value||"",t.contentEditable="true",t}function getSpaceTextNode(){return getTextNode({content:" "})}function createZeroWidthSpacer(){var e=document.createElement("span");return e.className=INPUT_NO_WIDTH_ITEM_CLASS,e.contentEditable="false",e.style.fontSize="0px",e.style.verticalAlign="top",e.style.userSelect="none",e.innerHTML="&nbsp;",e}function getInputNode(e,t){var n=document.createElement("span");n.id="cs-custom-input-"+t,n.className="ci-custom-input-wrapper";var i=createZeroWidthSpacer();n.appendChild(i);var a=document.createElement("span");a.contentEditable="true",a.innerText=e.value||e["default"]||"",a.setAttribute("placeholder",e.placeHolder||"填写内容"),e.value||e["default"]||a.setAttribute(WAIT_DELETE_ATTR,"1");var o=[INPUT_CUSTOM_CLASS];(e.value||e["default"])&&o.push(INPUT_CUSTOM_NEED_CLEAR_TEXT_CLASS),a.className=o.join(" "),a.addEventListener("click",(function(e){e.target&&e.target.classList.contains(INPUT_CUSTOM_NEED_CLEAR_TEXT_CLASS)&&(e.target.innerText="",e.target.classList.remove(INPUT_CUSTOM_NEED_CLEAR_TEXT_CLASS),setCursorToNode$1(e.target),e.stopPropagation()),(isFirefox()||isSafari())&&e.target&&!e.target.innerText&&setTimeout((function(){setCursorToNode$1(e.target)}))})),n.appendChild(a);var s=createZeroWidthSpacer();return n.appendChild(s),n}function focusNeedInput(e){for(var t,n=Array.from((null==e?void 0:e.childNodes)||[]),i=null,a=0,o=n;a<o.length;a++){var s=o[a];if(s instanceof HTMLElement&&(null==(t=null==s?void 0:s.className)?void 0:t.includes(INPUT_CUSTOM_CLASS))&&!(null==s?void 0:s.innerText)){i=s;break}if(s instanceof HTMLElement&&isInputNodeWrapper(s)){var r=s.querySelector(".".concat(INPUT_CUSTOM_CLASS));if(r&&!r.innerText){i=r;break}}}(null==n?void 0:n.length)&&i?setCursorToNode$1(getDeepestLastNode(i)):focusCursorToEnd(e)}function handleInputFieldChange(e){var t;(null==(t=null==e?void 0:e.childNodes)?void 0:t.length)&&Array.prototype.forEach.call(e.childNodes,(function(e){e instanceof HTMLElement&&isInputNode(e)&&(e.innerText&&"\n"!==e.innerText?cancelWaitDeleteNode(e):e.innerText="")}))}function isEmptyTextNode(e){if(!isTextNode(e))return!1;var t=(null==e?void 0:e.innerText)||"";return" "===t||" "===t||""===t}function mergeAdjacentEmptyTextNodes(e){if(e)for(var t=Array.from(e.childNodes),n=0;n<t.length-1;){var i=t[n],a=t[n+1];isEmptyTextNode(i)&&isEmptyTextNode(a)?(a.remove(),t.splice(n+1,1)):n++}}function ensureSingleLeadingSpaceAfter(e,t){if(e&&"TEXTAREA"!==e.tagName){var n=e.querySelector(".".concat(INPUT_FIELD_CLASS));if(!n){(n=document.createElement("span")).className=INPUT_FIELD_CLASS;var i=getSpaceTextNode();return n.appendChild(i),e.appendChild(n),void(t&&focusCursorToEnd(n))}if(""===n.innerHTML){var a=getSpaceTextNode();return n.append(a),void(t&&focusCursorToEnd(n))}setTimeout((function(){var e,t=(null==(e=n.innerText)?void 0:e.trim())||"";""!==t&&"\n"!==t||n.querySelectorAll("br").forEach((function(e){return e.remove()}))})),mergeAdjacentEmptyTextNodes(n)}}function mergeEditorContents(e){var t=e.querySelectorAll(".".concat(INPUT_FIELD_CLASS));if(t.length<=1)return!1;for(var n=t[0],i=1;i<t.length;i++){for(var a=t[i];a.firstChild;)n.appendChild(a.firstChild);a.remove()}return mergeAdjacentEmptyTextNodes(n),!0}function findPreviousCiTextNode(e){for(var t=e.previousSibling;t;){if(isTextNode(t))return t;t=t.previousSibling}return null}function handleInputFieldBackspace(e){var t,n,i,a,o,s,r,l,c=getCursorPosition(),d=c.startContainer,u=c.startOffset,p=c.endOffset,h=null;if(d.nodeType===Node.TEXT_NODE)h=d.parentElement;else if(""===d.innerText){null==(t=e.preventDefault)||t.call(e);var f=d;if(isInputNode(d)){var m=d.parentElement;isInputNodeWrapper(m)&&(f=m)}setCursorToNode$1(findPreviousCiTextNode(f)),deleteWaitNode(d)}else h=d;var g=null==h?void 0:h.previousSibling;isInputNode(h)&&(1===(null==(n=null==h?void 0:h.innerText)?void 0:n.length)||0===u&&(null==(i=null==h?void 0:h.innerText)?void 0:i.length)===p&&u!==p?(null==(a=e.preventDefault)||a.call(e),h&&(h.innerText=""),setTimeout((function(){setCursorToNode$1(h)}),0)):0===u&&0===p&&setTimeout((function(){var t;e.preventDefault(),(null==g?void 0:g.nodeType)===Node.TEXT_NODE&&g.textContent&&(g.textContent=null==(t=null==g?void 0:g.textContent)?void 0:t.slice(0,-1),setCursorToNode$1(g))}))),isTextNode(h)&&(0===u&&0===p?g?isInputNodeWrapper(g)&&(null==(o=e.preventDefault)||o.call(e),deleteWaitNode(g)):null==(s=e.preventDefault)||s.call(e):1===(null==(r=null==h?void 0:h.innerText)?void 0:r.length)&&(null==(l=e.preventDefault)||l.call(e),g&&isTextNode(g)&&" "===g.innerText&&g.remove(),h.innerHTML=" ",setCursorToNode$1((null==h?void 0:h.previousSibling)||h)))}function handleArrowKey(e,t){var n,i,a,o=getCursorPosition(),s=o.startContainer,r=o.startOffset;if(s&&(a=s.nodeType===Node.TEXT_NODE?s.parentElement:s)){if(isInputNode(a)){var l=s.nodeType===Node.TEXT_NODE?s.length:(null==(n=a.innerText)?void 0:n.length)||0;if("left"===t&&0===r){e.preventDefault();var c=a.parentElement,d=null;for(d=(null==c?void 0:c.classList.contains("ci-custom-input-wrapper"))?c.previousSibling:a.previousSibling;d&&!isValidFocusTarget(d);)d=d.previousSibling;d&&setCursorToNode$1(d)}else if("right"===t&&r===l){e.preventDefault();var u=a.parentElement,p=null;for(p=isInputNodeWrapper(u)?u.nextSibling:a.nextSibling;p&&!isValidFocusTarget(p);)p=p.nextSibling;p&&setCursorToNodeStart(p)}}if(isTextNode(a)){var h=s.nodeType===Node.TEXT_NODE?s.length:(null==(i=a.innerText)?void 0:i.length)||0;if("left"===t&&0===r){e.preventDefault();for(var f=a.previousSibling;f&&!isValidFocusTarget(f);){if(isInputNodeWrapper(f)){var m=f.querySelector(".".concat(INPUT_CUSTOM_CLASS));if(m)return void setCursorToNode$1(m)}f=f.previousSibling}f&&setCursorToNode$1(f)}else if("right"===t&&r===h){e.preventDefault();for(var g=a.nextSibling;g&&!isValidFocusTarget(g);){if(isInputNodeWrapper(g)){var _=g.querySelector(".".concat(INPUT_CUSTOM_CLASS));if(_)return void setCursorToNodeStart(_)}g=g.nextSibling}g&&setCursorToNodeStart(g)}}}}function handleCustomInputData(e){return e.map((function(e){return __spreadProps(__spreadValues({},e),{realValue:e.value||e["default"]})}))}function insertAtRange(e){var t=document.getSelection();if(null==t?void 0:t.rangeCount){var n=t.getRangeAt(0);n.deleteContents(),n.insertNode(e),n.setStartAfter(e),n.setEndAfter(e),t.removeAllRanges(),t.addRange(n)}}function insertAtTextareaRange(e,t){var n=e.selectionStart,i=e.selectionEnd,a=e.value;e.value="".concat(a.slice(0,n)).concat(t).concat(a.slice(i));var o=n+t.length;e.selectionStart=o,e.selectionEnd=o,t&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function isCursorAtEnd(e){var t=window.getSelection();if(!t||!e)return!1;var n=t.getRangeAt(0),i=n.cloneRange();return i.selectNodeContents(e),i.setStart(n.endContainer,n.endOffset),0===i.toString().length}function getDragFileType(e){var t,n="",i=_createForOfIteratorHelper(Array.from(e.items)||[]);try{for(i.s();!(t=i.n()).done;){var a=t.value;if("file"===a.kind){var o=a.getAsFile();n+=getFileNameSuffix(o.name)}}}catch(s){i.e(s)}finally{i.f()}return n.toLowerCase().replace(/\./g,"")}function createAiInputEditorContent(e){var t,n,i=arguments.length>1&&arguments[1]!==undefined&&arguments[1],a=e.querySelector(".".concat(INPUT_FIELD_CLASS));if(a||((a=document.createElement("span")).className=INPUT_FIELD_CLASS,e.append(a)),i){var o=a.firstChild;if(!o||o.nodeType!==Node.TEXT_NODE||!(null==(t=o.textContent)?void 0:t.startsWith(" "))&&!(null==(n=o.textContent)?void 0:n.startsWith(" "))){var s=document.createTextNode(" ");a.insertBefore(s,o)}}}function handleFileGuideWords(e,t){var n="file"===e?0:1,i=t.find((function(e){return e.type===n}));if(i){var a=i.limit,o=i.textsInfo;return o&&a&&o.slice(0,a)}return null}function getPrivateStatus(){try{var e=sessionStorage.getItem("privateChat");return null!==e?"true"===e:"true"===new URL(window.location.href).searchParams.get("privateChat")}catch(e){console.error("[getPrivateStatus] Failed to access storage:",e);try{return"true"===new URL(window.location.href).searchParams.get("privateChat")}catch(t){return!1}}}var TRADITIONAL_MAX_TEXT_NUM=30;function getMaxLengthToastMsg(e){return"最多发送".concat(e,"字符内容")}function bindPrefixEvent(e,t){if(t){var n=t.querySelector(".close-icon");e.$input.off(EVENTS.PREFIX_CLOSE);var i=function(t){var a;if(t.stopPropagation(),e.$input.sendLog("click","title_hover"),!1!==e.$input.getRootData("input.clearAiModeOnEmptyDelete")){var o=(null==(a=e.data.get("prefix"))?void 0:a.type)||"";if(emitBeforePrefixChange(e.$input,{action:"exit",fromType:o,onContinue:function(){e.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:o,skipPrefixConfirm:!0})}}))return;e.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:o})}null==n||n.removeEventListener("mousedown",i)};t.addEventListener("mousedown",i)}}function getCustomInputNode(e){var t=[];return e.forEach((function(e,n){"text"===e.type?t.push(getTextNode(e)):"input"===e.type&&t.push(getInputNode(e,n))})),t}function addAiInputPrefix(e,t,n,i){normalizeAiInputPrefixDom(t,(function(e){return e===i}),!1);var a=document.createElement("span");a.className=INPUT_PREFIX_WRAPPER_CLASS,a.contentEditable="false";var o=!1!==e.$input.getRootData("input.clearAiModeOnEmptyDelete")?'<img\n src="https://gips3.baidu.com/it/u=3150997865,1151751010&fm=3028&app=3028&f=PNG&fmt=auto&q=100&size=f36_36"\n width="12"\n height="12"\n >':"";a.innerHTML='\n <span class="ci-prefix" data-function-type="'.concat(i,'">\n <span class="ci-prefix-text">').concat(n,"</span>\n ").concat(o,"\n </span>\n "),bindPrefixEvent(e,a),createAiInputEditorContent(t),t.insertBefore(a,t.firstChild),e.$input.sendLog("show","title_hover")}function normalizeAiInputPrefixDom(e,t){var n,i=!(arguments.length>2&&arguments[2]!==undefined)||arguments[2],a=Array.from((null==(n=null==e?void 0:e.querySelectorAll)?void 0:n.call(e,".".concat(INPUT_PREFIX_WRAPPER_CLASS," .ci-prefix[data-function-type]")))||[]).filter((function(e){return t(e.dataset.functionType||"")}));return a.slice(i?1:0).forEach((function(e){var t;null==(t=e.closest(".".concat(INPUT_PREFIX_WRAPPER_CLASS)))||t.remove()})),a.length>0}function setCursorToNode(e){if(e){var t=e.parentNode;if(t&&t instanceof HTMLElement&&t.isContentEditable){var n=document.createRange();if(e.nodeType===Node.TEXT_NODE){var i=e;n.setStart(i,i.length)}else if(e instanceof HTMLElement&&e.childNodes.length>0){var a=e.lastChild;if((null==a?void 0:a.nodeType)===Node.TEXT_NODE){var o=a;n.setStart(o,o.length)}else n.setStart(e,e.childNodes.length)}else n.setStart(e,0);n.collapse(!0);var s=window.getSelection();null==s||s.removeAllRanges(),null==s||s.addRange(n)}}}function buildOffscreenInput(e,t){var n=t.type,i=document.createDocumentFragment();if("text"===n){var a=(e.word||"").split("\n");a.forEach((function(e,t){if(e){var n=getTextNode({content:e});i.appendChild(n)}t<a.length-1&&i.appendChild(document.createElement("br"))}))}else if("input-custom"===n){var o=getCustomInputNode(handleCustomInputData(e));i.appendChild(getSpaceTextNode()),o.forEach((function(e){return i.appendChild(e)})),i.appendChild(getSpaceTextNode())}else if("agent"===n){var s=document.createElement("span");s.className="ci-ai-agent",s.setAttribute("data-agent-name",e.source_name||""),s.setAttribute("data-agent-id",e.agent_id||""),s.textContent=e.source_name||"",i.appendChild(s)}return i}function setPreFixInfo(e,t){var n,i,a=t.functionTab,o=t.functionName;a&&(null==(n=null==e?void 0:e.querySelector(".ci-prefix"))||n.setAttribute("data-function-tab",a)),o&&(null==(i=null==e?void 0:e.querySelector(".ci-prefix"))||i.setAttribute("data-function-name",o))}function getDeepestLastNode(e){for(var t=e;t.lastChild;)t=t.lastChild;return t}function focusCursorToEndSync(e){var t;if(e){var n=getDeepestLastNode(e),i=window.getSelection(),a=document.createRange();n.nodeType===Node.TEXT_NODE?a.setStart(n,n.length):a.setStart(n,(null==(t=n.childNodes)?void 0:t.length)||0),a.collapse(!0),null==i||i.removeAllRanges(),null==i||i.addRange(a)}}function focusCursorToEnd(e){e&&requestAnimationFrame((function(){requestAnimationFrame((function(){var t,n,i=window.getSelection(),a=document.createRange(),o=getDeepestLastNode(e);o.nodeType===Node.TEXT_NODE?(a.setStart(o,o.length),a.setEnd(o,o.length)):(a.setStart(o,(null==(t=o.childNodes)?void 0:t.length)||0),a.setEnd(o,(null==(n=o.childNodes)?void 0:n.length)||0)),null==i||i.removeAllRanges(),null==i||i.addRange(a),e.focus()}))}))}function focusTextareaEnd(e){if(e){e.focus();var t=e.value.length;e.setSelectionRange(t,t),e.scrollTop=e.scrollHeight}}function handlePasteText(e,t){var n=t.value,i=t.isAiEditor,a=t.inputEl,o=t.maxLength,s=t.$input;if(e){var r=0,l=window.getSelection();l&&l.rangeCount>0&&(r=l.toString().length);var c=e.getData("text/plain");if(n.length+c.length-r>=o){s.emit(EVENTS.TOAST_SHOW,getMaxLengthToastMsg(o));var d=o+r-n.length;c=d>0?c.slice(0,d):""}i?document.execCommand("insertText",!1,c):insertAtTextareaRange(a,c),isCursorAtEnd(a)&&(a.scrollTop=a.scrollHeight)}}function getFilesFromEvent(e,t){var n,i;if(!t||!(null==t?void 0:t.items))return{};var a,o=[],s=e?[e]:[],r=[],l=_createForOfIteratorHelper(Array.from(t.items)||[]);try{for(l.s();!(a=l.n()).done;){var c=a.value;if(c.webkitGetAsEntry){var d=c.webkitGetAsEntry();if(d&&d.isDirectory)return{toast:"暂不支持此格式,换个文件试试"}}else 0===(null==(n=t.files)?void 0:n.length)&&console.warn("不支持文件夹拖拽判断");if("file"===c.kind){var u=c.getAsFile(),p=getFileNameSuffix(u.name),h="";if(UPLOAD_FILE_SUFFIXES.includes(p.toLowerCase()))h="file",o.push(u);else{if(!UPLOAD_IMAGE_SUFFIXES.includes(p.toLowerCase())){r.push({format:(null==u?void 0:u.type)||p.replace(/^\./,""),uploadType:(null==(i=null==u?void 0:u.type)?void 0:i.startsWith("image/"))?"image":"file"});continue}h="image",o.push(u)}h&&!s.includes(h)&&s.push(h)}}}catch(g){l.e(g)}finally{l.f()}if(r.length)return{toast:"暂不支持此格式,换个文件试试",rejectedFiles:Array.from(new Map(r.map((function(e){return[e.format,e]}))).values())};if(s.length>1)return{toast:"暂不支持文件、图片混合上传"};var f=s[0]||"",m=o.length;return f&&m?{uploadType:f,uploadFile:o}:{}}function getOriginalValue(e,t){if(!e)return"";if(t){var n=e.querySelector(".".concat(INPUT_FIELD_CLASS));if(!n)return"";var i=Array.from(n.childNodes);return 0===i.length?"":i.filter((function(e){return!(e instanceof HTMLElement&&(e.classList.contains(INPUT_PREFIX_WRAPPER_CLASS)||e.classList.contains(INPUT_AGENT_CLASS)||e.classList.contains(INPUT_NO_WIDTH_ITEM_CLASS)))})).map((function(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent||"";if(e instanceof HTMLElement){if(e.classList.contains(INPUT_CUSTOM_WRAPPER_CLASS)){var t=e.querySelector(".".concat(INPUT_CUSTOM_CLASS));return t?t.innerText:""}return e.innerText}return""})).join("")}return e.value}function calculateStrIsOverWord(e){if("string"!=typeof e)return!1;for(var t=e.length,n=0,i=0;i<t;i++)if((n=null!==e.charAt(i).match(/[^\x00-\xff]/gi)?n+2:n+1)>=TRADITIONAL_MAX_TEXT_NUM)return!0;return!1}var _MergeUploadPanel=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{fileType:"",fileList:[],upload:{},mergedHoverText:{},hideDisabled:!1}}},{key:"stopPropagation",value:function(e){e.stopPropagation()}},{key:"handleSelectFile",value:function(e){e.stopPropagation(),this.data.get("fileDisabled")||this.fire("select-file")}},{key:"handleSelectImage",value:function(e){e.stopPropagation(),this.data.get("imageDisabled")||this.fire("select-image")}},{key:"handleSelectKnowledge",value:function(e){e.stopPropagation(),this.data.get("knowledgeDisabled")||this.fire("select-knowledge")}}])}(san.Component);_MergeUploadPanel.template='\n <div class="ci-merge-upload-popover" on-click="stopPropagation($event)">\n <tooltip\n s-if="{{!hideDisabled || !imageDisabled}}"\n content="{{imageUploadTooltip}}"\n position="right"\n max-width="210"\n auto-flip-right-edge="{{true}}"\n bubble-class="ci-merge-upload-tooltip"\n >\n <div\n class="ci-merge-upload-item {{imageDisabled ? \'ci-merge-upload-item-disabled\' : \'\'}}"\n on-click="handleSelectImage($event)"\n >\n <svg\n width="16"\n height="16"\n viewBox="0 0 20 20"\n fill="none"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n d="M1.85278 4.81463C1.85278 3.58733 2.84771 2.59241 4.07501 2.59241H15.9269C17.1542 2.59241 18.1491 3.58733 18.1491 4.81463V15.185C18.1491 16.4123 17.1542 17.4072 15.9269 17.4072H4.075C2.8477 17.4072 1.85278 16.4123 1.85278 15.185V4.81463Z"\n stroke="currentColor"\n stroke-width="1.6"\n />\n <circle\n cx="13.7136"\n cy="7.14282"\n r="2.1"\n fill="currentColor"\n stroke="white"\n stroke-width="0.8"\n />\n <path\n d="M1.85278 14.2326L5.08504 9.72923C5.81909 8.70649 7.25533 8.49716 8.25077 9.26783L17.5001 16.4286"\n stroke="currentColor"\n stroke-width="1.6"\n />\n </svg>\n <span>上传本地图片</span>\n </div>\n </tooltip>\n <tooltip\n s-if="{{!hideDisabled || !fileDisabled}}"\n content="{{fileUploadTooltip}}"\n position="right"\n max-width="210"\n auto-flip-right-edge="{{true}}"\n bubble-class="ci-merge-upload-tooltip"\n >\n <div\n class="ci-merge-upload-item {{fileDisabled ? \'ci-merge-upload-item-disabled\' : \'\'}}"\n on-click="handleSelectFile($event)"\n >\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.77734 12.2963V3.40738C1.77734 2.58919 2.44063 1.9259 3.25883 1.9259H5.5404C5.97288 1.9259 6.38377 2.11488 6.66523 2.44325L7.55613 3.48263C7.83758 3.811 8.24847 3.99998 8.68095 3.99998H12.7403C13.5585 3.99998 14.2218 4.66326 14.2218 5.48146V12.2963C14.2218 13.1145 13.5585 13.7778 12.7403 13.7778H3.25883C2.44063 13.7778 1.77734 13.1145 1.77734 12.2963Z" stroke="currentColor" stroke-width="1.18519"/>\n <path d="M1.77734 6.66669H14.0736" stroke="currentColor" stroke-width="1.18519"/>\n </svg>\n\n <span>上传本地文件</span>\n </div>\n </tooltip>\n <tooltip\n s-if="{{knowledgeDisabled && !hideDisabled}}"\n content="已达到最大上传数量限制"\n position="left"\n bubble-class="ci-merge-upload-tooltip"\n >\n <div\n class="ci-merge-upload-item ci-merge-upload-item-disabled"\n on-click="handleSelectKnowledge($event)"\n >\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.5111 9.34203C12.5935 9.1331 12.8893 9.1331 12.9717 9.34203L13.577 10.8768C13.6022 10.9405 13.6528 10.9911 13.7165 11.0162L15.2512 11.6215C15.4601 11.704 15.4601 11.9998 15.2512 12.0822L13.7165 12.6875C13.6527 12.7127 13.6022 12.7632 13.577 12.827L12.9717 14.3617C12.8893 14.5705 12.5935 14.5705 12.5111 14.3617L11.9057 12.827C11.8806 12.7632 11.83 12.7127 11.7663 12.6875L10.2316 12.0822C10.0226 11.9998 10.0227 11.704 10.2316 11.6215L11.7663 11.0162C11.83 10.9911 11.8806 10.9405 11.9057 10.8768L12.5111 9.34203Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M7.7058 2.33624C9.66265 2.33626 11.3565 3.4997 12.1931 5.19533C14.0782 5.45594 15.5266 7.13668 15.5267 9.16466C15.5267 9.40617 15.5052 9.64257 15.4659 9.87241C15.1707 9.41025 14.7674 9.02437 14.2912 8.75002C14.1426 7.72436 13.4558 6.88708 12.5458 6.55847L12.4639 6.53184C12.2122 6.44969 11.9491 6.40813 11.6844 6.40858C11.608 6.40859 11.5319 6.41331 11.4558 6.41987L11.4555 6.41958C10.6099 6.49495 9.8773 6.98691 9.44857 7.70343L9.37825 7.82091L8.42339 7.04342L8.48011 6.9543C9.01274 6.11966 9.83811 5.50253 10.8068 5.26651C10.1118 4.25867 8.98003 3.60364 7.70493 3.6036C5.96528 3.60362 4.4927 4.82021 4.0319 6.49076L4.00586 6.60852C3.94173 6.8941 3.90926 7.18591 3.90922 7.4786C3.90922 7.52075 3.911 7.56502 3.91269 7.60997L3.91732 7.73902L3.78856 7.73265C3.75354 7.73096 3.72207 7.72947 3.68815 7.72947C2.59678 7.72952 1.70233 8.65721 1.70233 9.81425C1.70238 10.9418 2.55138 11.8507 3.60337 11.8973L3.64099 11.899H9.19162C9.21721 12.3518 9.33118 12.7808 9.51657 13.1693H3.5565C1.83901 13.0968 0.474664 11.6174 0.474609 9.81425C0.474609 8.3034 1.431 7.02248 2.75181 6.60187C3.19877 4.17669 5.24266 2.33626 7.7058 2.33624ZM2.13057 8.33248C2.1219 8.34246 2.11389 8.35301 2.1054 8.36315C2.1195 8.3463 2.13375 8.32958 2.14822 8.31309L2.13057 8.33248ZM3.26425 7.65598C3.2425 7.66063 3.22094 7.66596 3.19944 7.67131C3.22331 7.66536 3.24733 7.65975 3.27148 7.65453C3.26908 7.65504 3.26665 7.65546 3.26425 7.65598ZM13.7561 7.26882C13.7798 7.29692 13.803 7.32542 13.8256 7.35447C13.7804 7.29628 13.7329 7.24007 13.6835 7.18578L13.7561 7.26882ZM13.5296 7.02924C13.5562 7.05429 13.5824 7.07982 13.608 7.10592C13.5567 7.05366 13.5034 7.00343 13.4483 6.95546L13.5296 7.02924ZM7.19567 3.51911C7.16737 3.52293 7.13929 3.52799 7.11118 3.53242C7.14971 3.52634 7.18837 3.52047 7.22721 3.51535L7.19567 3.51911Z" fill="currentColor"/>\n </svg>\n\n <span>从知识库上传</span>\n </div>\n </tooltip>\n <div\n s-elif="{{!knowledgeDisabled}}"\n class="ci-merge-upload-item"\n on-click="handleSelectKnowledge($event)"\n >\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.5111 9.34203C12.5935 9.1331 12.8893 9.1331 12.9717 9.34203L13.577 10.8768C13.6022 10.9405 13.6528 10.9911 13.7165 11.0162L15.2512 11.6215C15.4601 11.704 15.4601 11.9998 15.2512 12.0822L13.7165 12.6875C13.6527 12.7127 13.6022 12.7632 13.577 12.827L12.9717 14.3617C12.8893 14.5705 12.5935 14.5705 12.5111 14.3617L11.9057 12.827C11.8806 12.7632 11.83 12.7127 11.7663 12.6875L10.2316 12.0822C10.0226 11.9998 10.0227 11.704 10.2316 11.6215L11.7663 11.0162C11.83 10.9911 11.8806 10.9405 11.9057 10.8768L12.5111 9.34203Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M7.7058 2.33624C9.66265 2.33626 11.3565 3.4997 12.1931 5.19533C14.0782 5.45594 15.5266 7.13668 15.5267 9.16466C15.5267 9.40617 15.5052 9.64257 15.4659 9.87241C15.1707 9.41025 14.7674 9.02437 14.2912 8.75002C14.1426 7.72436 13.4558 6.88708 12.5458 6.55847L12.4639 6.53184C12.2122 6.44969 11.9491 6.40813 11.6844 6.40858C11.608 6.40859 11.5319 6.41331 11.4558 6.41987L11.4555 6.41958C10.6099 6.49495 9.8773 6.98691 9.44857 7.70343L9.37825 7.82091L8.42339 7.04342L8.48011 6.9543C9.01274 6.11966 9.83811 5.50253 10.8068 5.26651C10.1118 4.25867 8.98003 3.60364 7.70493 3.6036C5.96528 3.60362 4.4927 4.82021 4.0319 6.49076L4.00586 6.60852C3.94173 6.8941 3.90926 7.18591 3.90922 7.4786C3.90922 7.52075 3.911 7.56502 3.91269 7.60997L3.91732 7.73902L3.78856 7.73265C3.75354 7.73096 3.72207 7.72947 3.68815 7.72947C2.59678 7.72952 1.70233 8.65721 1.70233 9.81425C1.70238 10.9418 2.55138 11.8507 3.60337 11.8973L3.64099 11.899H9.19162C9.21721 12.3518 9.33118 12.7808 9.51657 13.1693H3.5565C1.83901 13.0968 0.474664 11.6174 0.474609 9.81425C0.474609 8.3034 1.431 7.02248 2.75181 6.60187C3.19877 4.17669 5.24266 2.33626 7.7058 2.33624ZM2.13057 8.33248C2.1219 8.34246 2.11389 8.35301 2.1054 8.36315C2.1195 8.3463 2.13375 8.32958 2.14822 8.31309L2.13057 8.33248ZM3.26425 7.65598C3.2425 7.66063 3.22094 7.66596 3.19944 7.67131C3.22331 7.66536 3.24733 7.65975 3.27148 7.65453C3.26908 7.65504 3.26665 7.65546 3.26425 7.65598ZM13.7561 7.26882C13.7798 7.29692 13.803 7.32542 13.8256 7.35447C13.7804 7.29628 13.7329 7.24007 13.6835 7.18578L13.7561 7.26882ZM13.5296 7.02924C13.5562 7.05429 13.5824 7.07982 13.608 7.10592C13.5567 7.05366 13.5034 7.00343 13.4483 6.95546L13.5296 7.02924ZM7.19567 3.51911C7.16737 3.52293 7.13929 3.52799 7.11118 3.53242C7.14971 3.52634 7.18837 3.52047 7.22721 3.51535L7.19567 3.51911Z" fill="currentColor"/>\n </svg>\n <span>从知识库上传</span>\n </div>\n </div>\n ',_MergeUploadPanel.components={tooltip:Main$i},_MergeUploadPanel.computed={fileDisabled:function(){var e,t=this.data.get("fileType"),n=this.data.get("fileList")||[],i=(null==(e=(this.data.get("upload")||{}).file)?void 0:e.uploadMaxNum)||10;return"image"===t||"file"===t&&n.length>=i},imageDisabled:function(){var e,t,n=this.data.get("fileType"),i=this.data.get("fileList")||[],a=this.data.get("upload")||{},o=(null==(e=a.image)?void 0:e.uploadMaxNum)||10;return!!(null==(t=a.image)?void 0:t.disabled)||"file"===n||"image"===n&&i.length>=o},knowledgeDisabled:function(){var e,t,n=this.data.get("fileType"),i=this.data.get("fileList")||[],a=this.data.get("upload")||{},o="image"===n?(null==(e=a.image)?void 0:e.uploadMaxNum)||10:(null==(t=a.file)?void 0:t.uploadMaxNum)||10;return!!n&&i.length>=o},mergedHoverTextData:function(){var e=this.data.get("mergedHoverText")||{};return{defaultFile:e.defaultFile||hoverText.DEFAULTFILE,defaultPic:e.defaultPic||hoverText.PIC,mergeText:e.mergeText||hoverText.MERGETEXT}},fileUploadTooltip:function(){var e,t=this.data.get("fileDisabled"),n=(null==(e=(this.data.get("upload")||{}).file)?void 0:e.uploadMaxNum)||10,i=this.data.get("mergedHoverTextData")||{};if(t){var a=this.data.get("fileType"),o=this.data.get("fileList")||[];return"file"===a&&o.length>=n?"已达到最大上传数量限制":i.mergeText||""}return(i.defaultFile||"").replace("maxNum",n+"")},imageUploadTooltip:function(){var e,t=this.data.get("imageDisabled"),n=(null==(e=(this.data.get("upload")||{}).image)?void 0:e.uploadMaxNum)||10,i=this.data.get("mergedHoverTextData")||{};if(t){var a=this.data.get("fileType"),o=this.data.get("fileList")||[];return"image"===a&&o.length>=n?"已达到最大上传数量限制":i.mergeText||""}return(i.defaultPic||"").replace("maxNum",n+"")}};var MergeUploadPanel=_MergeUploadPanel,ACTIVE_TRIGGER_CLASS="ci-merge-upload-btn-active",_MergeUploadPopover=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments))._targetDom=null,e._triggerCmpt=null,e._uploadScene="",e._scrollContainer=null,e._conversationFlowContainer=null,e._scrollInitialTop=0,e._scrollTicking=!1,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{open:!1,popoverStyle:"",fileType:"",fileList:[],upload:{},hoverText:{},hideDisabled:!1}}},{key:"_calcStyle",value:function(e,t){var n,i=null==(n=this.el)?void 0:n.parentElement;if(!i||!t)return"down"===e?"top: calc(100% + 6px); left: 40px;":"bottom: calc(100% + 6px); left: 19px;";var a=i.getBoundingClientRect(),o=t.getBoundingClientRect(),s=o.left-a.left;return"down"===e?"top: ".concat(o.bottom-a.top+6,"px; left: ").concat(s,"px;"):"top: ".concat(o.top-a.top-6,"px; left: ").concat(s,"px; transform: translateY(-100%);")}},{key:"attached",value:function(){var e=this;this._openHandler=function(t){var n=t.targetDom,i=t.triggerCmpt,a=t.direction,o=void 0===a?"down":a,s=t.hideDisabled,r=void 0!==s&&s,l=t.uploadScene,c=void 0===l?"":l;e.data.get("open")&&e._targetDom===n?e.close():(e._targetDom=n,e._triggerCmpt=i||null,e._uploadScene=c,e._setTriggerActive(!0),e._bindScrollToClose(),e.data.set("hideDisabled",r),e.data.set("popoverStyle",e._calcStyle(o,n)),e.data.set("open",!0),e.$input.sendLog("show","all_file_upload_board"))},this.$input.on(EVENTS.OPEN_MERGE_UPLOAD,this._openHandler),this._valueChangeHandler=function(){e.close()},this.$input.on(EVENTS.VALUE_CHANGE,this._valueChangeHandler),this._docClickHandler=function(t){var n,i=e.ref("popover");!e.data.get("open")||(null==i?void 0:i.contains(t.target))||(null==(n=e._targetDom)?void 0:n.contains(t.target))||e.close()},document.addEventListener("click",this._docClickHandler,!0)}},{key:"detached",value:function(){this.$input.off(EVENTS.OPEN_MERGE_UPLOAD,this._openHandler),this.$input.off(EVENTS.VALUE_CHANGE,this._valueChangeHandler),document.removeEventListener("click",this._docClickHandler,!0),this._unbindScrollToClose()}},{key:"close",value:function(){this.data.set("open",!1),this._setTriggerActive(!1),this._unbindScrollToClose(),this._targetDom=null,this._triggerCmpt=null,this._uploadScene=""}},{key:"_setTriggerActive",value:function(e){var t,n,i,a=null==(t=this._targetDom)?void 0:t.querySelector("#ci-merge-upload-btn");null==a||a.classList.toggle(ACTIVE_TRIGGER_CLASS,e),null==(i=null==(n=this._triggerCmpt)?void 0:n.setPopoverOpen)||i.call(n,e)}},{key:"_bindScrollToClose",value:function(){var e=this;this._unbindScrollToClose();var t=this.$input.getRootData("scrollContainer")||window,n=function(){return t===window?window.scrollY:t.scrollTop};this._scrollContainer=t,this._scrollInitialTop=n(),this._scrollHandler=function(){e.$input.rootCmpt.shouldIgnoreScrollBlur?e.$input.rootCmpt.shouldIgnoreScrollBlur=!1:n()===e._scrollInitialTop||e._scrollTicking||(e._scrollTicking=!0,window.requestAnimationFrame((function(){e.close(),e._scrollTicking=!1})))},t.addEventListener("scroll",this._scrollHandler);var i=document.getElementById("conversation-flow-container");i&&(this._conversationFlowContainer=i,this._conversationFlowHandler=function(){e.close()},i!==t&&i.addEventListener("scroll",this._conversationFlowHandler),i.addEventListener("wheel",this._conversationFlowHandler))}},{key:"_unbindScrollToClose",value:function(){this._scrollContainer&&this._scrollHandler&&this._scrollContainer.removeEventListener("scroll",this._scrollHandler),this._conversationFlowContainer&&this._conversationFlowHandler&&(this._conversationFlowContainer.removeEventListener("scroll",this._conversationFlowHandler),this._conversationFlowContainer.removeEventListener("wheel",this._conversationFlowHandler)),this._scrollContainer=null,this._conversationFlowContainer=null,this._scrollTicking=!1}},{key:"stopPropagation",value:function(e){e.stopPropagation()}},{key:"handleSelectFile",value:function(){this.close(),this.$input.sendLog("click","all_file_upload_board",{button_text:"上传本地文件"});var e={uploadType:"file"};this._uploadScene&&(e.uploadScene=this._uploadScene,e.targetDom=this._targetDom),this.$input.emit(EVENTS.UPLOAD_FILE,e)}},{key:"handleSelectImage",value:function(){this.close(),this.$input.sendLog("click","all_file_upload_board",{button_text:"上传本地图片"});var e={uploadType:"image"};this._uploadScene&&(e.uploadScene=this._uploadScene,e.targetDom=this._targetDom),this.$input.emit(EVENTS.UPLOAD_FILE,e)}},{key:"handleSelectKnowledge",value:function(){this.close(),this.$input.sendLog("click","all_file_upload_board",{button_text:"从知识库上传"});var e=this.$input.getRootData().user;(null==e?void 0:e.isLogin)?this.$input.trigger(FIRE_EVENTS.OPEN_SELECT_MORE,{fileList:this.data.get("fileList")||[]}):this.$input.trigger(FIRE_EVENTS.SHOW_LOGIN,{})}}])}(ApiCmpt);_MergeUploadPopover.template='\n <div\n s-if="{{open}}"\n s-ref="popover"\n class="ci-merge-upload-fixed-popover"\n style="{{popoverStyle}}"\n on-click="stopPropagation($event)"\n >\n <merge-upload-panel\n file-type="{{fileType}}"\n file-list="{{fileList}}"\n upload="{{upload}}"\n merged-hover-text="{{hoverText}}"\n hide-disabled="{{hideDisabled}}"\n on-select-file="handleSelectFile"\n on-select-image="handleSelectImage"\n on-select-knowledge="handleSelectKnowledge"\n />\n </div>\n ',_MergeUploadPopover.components={"merge-upload-panel":MergeUploadPanel};var MergeUploadPopover=_MergeUploadPopover,Main$8=(_p=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{tools:{},scene:"",fileType:"",position:"",inputUploadType:"",isOverWord:!1,panels:{},openPanel:!1,prefixShow:!1,clearBtnShow:!1}}},{key:"inited",value:function(){this.data.get("input.value")&&this.data.set("clearBtnShow",!0)}},{key:"attached",value:function(){this.valueChangeHandler=this.valueChangeHandler.bind(this),this.$input.on(EVENTS.VALUE_CHANGE,this.valueChangeHandler);var e=this.data.get("input.value");e&&this.checkIsOverWord({value:e,isAiEditor:!1})}},{key:"valueChangeHandler",value:function(e){this.data.set("clearBtnShow",!!e.value),this.checkIsOverWord(e)}},{key:"detached",value:function(){this.$input.off(EVENTS.VALUE_CHANGE,this.valueChangeHandler)}},{key:"checkIsOverWord",value:function(e){if(!1!==this.data.get("tools.left.overWordTip")){var t=e||this.$input.getInputInfo(),n=t.value,i=t.isAiEditor;this.data.set("isOverWord",!i&&calculateStrIsOverWord(n||""))}}}])}(ApiCmpt),_p.template='\n <fragment>\n <div\n s-if="input.lineTransition"\n class="ci-tool-placeholder"\n data-focus-input="1"\n >\n </div>\n <div class="ci-tool" data-focus-input="1">\n <right-tools\n s-if="input.lineTransition"\n s-ref="right-tools"\n tools="{{rightToolsData}}"\n scene="{{scene}}"\n input="{{input}}"\n fileType="{{fileType}}"\n fileList="{{fileList}}"\n position="{{position}}"\n openPanelType="{{openPanelType}}"\n submit-btn-status="{{submitBtnStatus}}"\n input-upload-type="{{inputUploadType}}"\n upload="{{upload}}"\n hoverText="{{hoverText}}"\n clear-btn-show="{{clearBtnShow}}"\n task-mode="{{isTaskMode}}"\n />\n <fragment s-else>\n <div id="ci-left-tool" class="ci-left-tool">\n <left-tools\n s-ref="left-tools"\n s-if="{{renderWithIf}}"\n s-show="{{!isSingleLine}}"\n tools="{{leftToolsData}}"\n scene="{{scene}}"\n input="{{input}}"\n fileList="{{fileList}}"\n position="{{position}}"\n openPanelType="{{openPanelType}}"\n panelOptions="{{panelOptions}}"\n capsule-inside="{{panels.capsuleInside}}"\n hoverText="{{hoverText}}"\n isOverWord="{{isOverWord}}"\n sug="{{sug}}"\n mode="{{mode}}"\n panels="{{panels}}"\n user="{{user}}"\n prefix-show="{{prefixShow}}"\n />\n </div>\n <div s-if="{{!panels.capsuleInside || openPanel}}" class="tools-placeholder-wrapper"></div>\n <right-tools\n s-ref="right-tools"\n tools="{{rightToolsData}}"\n scene="{{scene}}"\n input="{{input}}"\n fileType="{{fileType}}"\n fileList="{{fileList}}"\n position="{{position}}"\n openPanelType="{{openPanelType}}"\n submit-btn-status="{{submitBtnStatus}}"\n input-upload-type="{{inputUploadType}}"\n upload="{{upload}}"\n hoverText="{{hoverText}}"\n clear-btn-show="{{clearBtnShow}}"\n task-mode="{{isTaskMode}}"\n />\n </fragment>\n </div>\n <div class="ci-upload-panel">\n <merge-upload-popover\n s-if="{{rightToolsData.mergeFileImageUpload}}"\n file-type="{{fileType}}"\n file-list="{{fileList}}"\n upload="{{upload}}"\n hover-text="{{hoverText}}"\n />\n </div>\n </fragment>\n ',_p.components={"left-tools":Main$a,"right-tools":Main$9,"merge-upload-popover":MergeUploadPopover},_p.computed={renderWithIf:function(){var e=this.data.get("isChatSearch"),t=this.data.get("input.prefix"),n=this.data.get("isSingleLine");return e||(null==t?void 0:t.type)||!n},leftToolsData:function(){return this.data.get("tools.left")||{}},rightToolsData:function(){return this.data.get("tools.right")||{}},isTaskMode:function(){return this.data.get("tools.left.modeSelect.current")===TASK_MODE_NAME}},_p),HIDDEN_TEXTAREA_STYLE={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},forceHiddenStyles=function(e){Object.keys(HIDDEN_TEXTAREA_STYLE).forEach((function(t){e.style.setProperty(t,HIDDEN_TEXTAREA_STYLE[t],"important")}))},hiddenTextarea=null,getHeight=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize};function calculateNodeHeight(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1,i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1/0,a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;hiddenTextarea||((hiddenTextarea=document.createElement("textarea")).setAttribute("tabindex","-1"),hiddenTextarea.setAttribute("aria-hidden","true"),forceHiddenStyles(hiddenTextarea)),null===hiddenTextarea.parentNode&&document.body.appendChild(hiddenTextarea);var o=e.paddingSize,s=e.borderSize,r=e.sizingStyle,l=r.boxSizing;Object.keys(r).forEach((function(e){var t=e;hiddenTextarea.style[t]=r[t]})),hiddenTextarea.style["text-indent"]=a+"px",forceHiddenStyles(hiddenTextarea),hiddenTextarea.value=t;var c=getHeight(hiddenTextarea,e);hiddenTextarea.value=t,c=getHeight(hiddenTextarea,e),hiddenTextarea.value="x";var d=hiddenTextarea.scrollHeight-o,u=d*n;"border-box"===l&&(u=u+o+s),c=Math.max(u,c);var p=d*i;return"border-box"===l&&(p=p+o+s),[c=Math.min(p,c),d]}var pick=function(e,t){return e.reduce((function(e,n){return e[n]=t[n],e}),{})},SIZING_STYLE=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],isIE="undefined"!=typeof document&&!!document.documentElement.currentStyle,getSizingData=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=pick(SIZING_STYLE,t),i=n.boxSizing;return""===i?null:(isIE&&"border-box"===i&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px"),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function getTextIndent(e){var t=e.querySelector(".".concat(INPUT_PREFIX_WRAPPER_CLASS));if(!t)return 0;var n=window.getComputedStyle(t),i=parseFloat(n.marginLeft)||0,a=parseFloat(n.marginRight)||0,o=e.querySelectorAll(".".concat(INPUT_CUSTOM_CLASS)),s=0;return o.forEach((function(e){var t=window.getComputedStyle(e);s+=parseFloat(t.paddingLeft)||0,s+=parseFloat(t.paddingRight)||0,s+=parseFloat(t.marginLeft)||0,s+=parseFloat(t.marginRight)||0})),t.offsetWidth+i+a+s}function normalizeElementsArray(e,t){return"string"==typeof e?Array.from(document.querySelectorAll(e)):e instanceof Element?[e]:Array.isArray(e)?e:"[object NodeList]"===Object.prototype.toString.call(e)?Array.from(e):[]}function remove(e){normalizeElementsArray(e).forEach((function(e){e.parentNode&&e.parentNode.removeChild(e)}))}var Main$7=(_q=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).isComposing=!1,e.isBreakRow=!1,e.isCustomInput=!1,e.isUserInput=!1,e.nextFocusSource=null,e.measurementsCacheRef={AI:null,normal:null},e.lastInputHeight={AI:null,normal:null},e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{mode:"",input:{},upload:{},prefix:{show:!1,type:"",name:"",blockOpenPanel:!1,noOpenPanel:!1,functionName:"",functionTab:"",autoFocus:!0},clearAiModeOnEmptyDelete:!0,aiPlaceholder:""}}},{key:"inited",value:function(){this.data.set("initValue",this.data.get("input.value")),this.data.set("input.mode",this.data.get("mode")),this.data.get("input.aiPlaceholder")&&this.data.set("aiPlaceholder",this.data.get("input.aiPlaceholder"))}},{key:"attached",value:function(){var e=this;this.showPrefixHandler=this.showPrefixHandler.bind(this),this.$input.on(EVENTS.SHOW_PREFIX,this.showPrefixHandler),this.clearHandler=this.clearHandler.bind(this),this.$input.on(EVENTS.CLEAR,this.clearHandler),this.setPlaceholderHandler=this.setPlaceholderHandler.bind(this),this.$input.on(EVENTS.SET_PLACEHOLDER,this.setPlaceholderHandler),this.prefixCloseHandler=this.prefixCloseHandler.bind(this),this.$input.on(EVENTS.PREFIX_CLOSE,this.prefixCloseHandler),this.watch("mode",(function(t){e.nextTick((function(){var n="mode-to-".concat(t||"normal");e.$input.next(n),e.$input.focus({source:n})}))})),this.watch("haveFile",(function(t){t&&e.data.set("input.canSendPlaceholder","")})),this.initPrefix()}},{key:"showPrefixHandler",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:if(n=this.data.get("mode")===AI_MODE,this.$input.setMode(!0),this.$input.rootCmpt.hideSug(),n){t.n=1;break}return t.n=1,this.$input.wait("mode-to-AI");case 1:this.clearValue(),this.data.set("prefix",Object.assign(e,{show:!0})),addAiInputPrefix(this,i=this.currentInput(),e.name,e.type),(a=e.inputValue)?this.$input.setValue({value:a}):setCursorToNode(i.lastChild),this.handleInput();case 2:return t.a(2)}}),t,this)})))}},{key:"initPrefix",value:function(){var e,t=this.data.get("input.prefix")||{};t.type&&(this.initPrefxFocus=null==(e=t.autoFocus)||e,t.autoFocus=this.initPrefxFocus,t.name||(t.name=PREFIX_NAME_MAP[t.type],this.data.set("input.prefix",t)),this.showPrefixHandler(t))}},{key:"clearHandler",value:function(e){var t=this,n=(e||{}).setMode,i=void 0===n||n;this.data.get("isAiEditor")?i?(this.$input.setMode(!1),this.$input.closePanel(),this.$input.emit(EVENTS.PANEL_CLOSE,{detach:!0}),this.nextTick((function(){t.handleInput()}))):(this.clearValue({keepPrefix:!0}),this.handleInput(),focusCursorToEndSync(this.currentInput().querySelector(".".concat(INPUT_FIELD_CLASS)))):(this.clearValue(),this.handleInput())}},{key:"setPlaceholderHandler",value:function(e){this.data.set("aiPlaceholder",e)}},{key:"prefixCloseHandler",value:function(){this.data.set("prefix.show",!1),this.$input.setMode(!1),remove(this.currentInput().querySelector(".".concat(INPUT_PREFIX_WRAPPER_CLASS)))}},{key:"detached",value:function(){this.$input.off(EVENTS.SHOW_PREFIX,this.showPrefixHandler),this.$input.off(EVENTS.CLEAR,this.clearHandler),this.$input.off(EVENTS.SET_PLACEHOLDER,this.setPlaceholderHandler),this.$input.off(EVENTS.PREFIX_CLOSE,this.prefixCloseHandler)}},{key:"handleInput",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};e.target&&(this.isUserInput=!0),!e.handleSetValue&&this.initPrefxFocus&&this.$input.rootCmpt.toggleSingleOrMultiLine(INPUT_LINE_MODE.MULTI);var t=this.getValue(),n=this.getPlaceholder(),i=this.data.get("isAiEditor"),a={isAiEditor:i,value:t,prefix:this.data.get("prefix"),placeholder:n,canSendPlaceholder:this.data.get("input.canSendPlaceholder"),options:e};if(this.$input.emit(EVENTS.VALUE_CHANGE,a),this.data.set("value",t),this.data.set("isEmptyValue",!t),i){var o=this.currentInput();t?o.classList.remove("ci-placeholder"):o.classList.add("ci-placeholder")}"voice"!==e.source&&this.$input.emit(EVENTS.VOICE_INPUT_STOP),i&&(ensureSingleLeadingSpaceAfter(this.currentInput(),this.initPrefxFocus),this.initPrefxFocus=!0);var s=document.activeElement===this.currentInput();this.resizeTextarea(s?"focus":"blur"),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.INPUT_VALUE_CHANGE,data:a})}},{key:"setValue",value:function(e){var t="string"==typeof e?{value:e}:e,n=t.prefix,i=t.value,a=t.options,o=void 0===a?{}:a,s=t.placeholder,r=t.canSendPlaceholder;if(n&&this.data.set("prefix",n),s&&(this.data.set("input.normalPlaceholder",s),this.data.get("haveFile")||this.data.set("input.canSendPlaceholder",r)),i||""===i){if(Array.isArray(i)?this.setAiInputContent({inputCustom:i}):this.data.get("isAiEditor")?this.setAiInputContent({word:i}):this.currentInput().value=null!=i?i:"",i){var l=this.currentInput();l.scrollTop=l.scrollHeight,this.handleInput(__spreadValues({handleSetValue:!0},o))}!0===o.focus&&this.focus({source:o.source})}}},{key:"focus",value:function(e){(null==e?void 0:e.source)&&(this.nextFocusSource=e.source),this.data.get("isAiEditor")?focusCursorToEnd(this.currentInput()):focusTextareaEnd(this.currentInput())}},{key:"focusInputLast",value:function(){focusCursorToEnd(this.currentInput())}},{key:"blur",value:function(){var e=this.currentInput();document.activeElement!==e&&this.inputChange("blur"),e.blur()}},{key:"setMode",value:function(e){var t=this;this.data.set("input.mode",e),this.disconnectObserver(),e===AI_MODE?this.nextTick((function(){t.bindAiInputObserver()})):this.data.set("prefix",{}),this.handleInput()}},{key:"fallbackToNormalModeWhenPrefixMissing",value:function(){var e;return!!this.data.get("isAiEditor")&&!(null==(e=this.currentInput())?void 0:e.querySelector(".".concat(INPUT_PREFIX_WRAPPER_CLASS)))&&(this.data.set("prefix",{}),this.$input.emit(EVENTS.PANEL_CLOSE,{detach:!0}),this.$input.setMode(!1),!0)}},{key:"currentInput",value:function(){var e=this.data.get("isAiEditor")?"ci-editor":"ci-textarea";return this.ref(e)}},{key:"inputChange",value:function(e,t){var n=(null==t?void 0:t.source)||this.nextFocusSource;this.nextFocusSource=null;var i={status:e,prefix:this.data.get("prefix"),isAiEditor:this.data.get("isAiEditor"),value:this.getValue(),source:n};this.$input.emit(EVENTS.INPUT_STATUS_CHANGE,i),this.data.set("prefix.blockOpenPanel",!1),this.resizeTextarea(e,!1),this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.INPUT_STATUS_CHANGE,data:i})}},{key:"disconnectObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null)}},{key:"bindAiInputObserver",value:function(){return __async(this,null,_regenerator().m((function e(){return _regenerator().w((function(e){for(;;)switch(e.n){case 0:this.disconnectObserver(),this.data.get("input.mode")===AI_MODE&&(this.observer=new MutationObserver(this.aiInputChangeHandler.bind(this)),this.observer.observe(this.currentInput(),{childList:!0,subtree:!0,characterData:!0}));case 1:return e.a(2)}}),e,this)})))}},{key:"aiInputChangeHandler",value:function(){return __async(this,null,_regenerator().m((function e(){var t,n,i,a,o,s,r;return _regenerator().w((function(e){for(;;)switch(e.n){case 0:if(i=this.currentInput()){e.n=1;break}return e.a(2);case 1:if(!this.fallbackToNormalModeWhenPrefixMissing()){e.n=2;break}return e.a(2);case 2:mergeEditorContents(i)&&this.resizeTextarea("focus"),a=this.getValue(),o=i.querySelector(".".concat(INPUT_FIELD_CLASS)),a?o&&handleInputFieldChange(o):null==(t=null==i?void 0:i.querySelectorAll("br"))||t.forEach((function(e){var t,n=e.parentElement;(null==(t=null==n?void 0:n.classList)?void 0:t.contains(INPUT_TEXT_NODE_CLASS))?n.innerHTML=" ":e.remove()})),o?(s=o.firstElementChild,(null==(n=null==s?void 0:s.classList)?void 0:n.contains(INPUT_TEXT_NODE_CLASS))||o.insertBefore(getSpaceTextNode(),o.firstChild)):((r=document.createElement("span")).className=INPUT_FIELD_CLASS,r.appendChild(getSpaceTextNode()),i.appendChild(r));case 3:return e.a(2)}}),e,this)})))}},{key:"setAiInputContent",value:function(e){var t,n,i,a;null==(t=this.el)||t.classList.add("ci-caret-hidden");var o=(null==(n=e.inputCustom)?void 0:n.length)?"input-custom":e.word?"text":"",s=(null==(i=e.inputCustom)?void 0:i.length)?e.inputCustom:e;if(o){var r=buildOffscreenInput(s,{type:o}),l=null==(a=this.el)?void 0:a.querySelector(".".concat(INPUT_FIELD_CLASS));if(l)(l instanceof HTMLElement||l instanceof Element)&&(l.replaceChildren(),l.appendChild(r));else{var c=this.currentInput();if(c){var d=document.createElement("span");d.className=INPUT_FIELD_CLASS,d.appendChild(r),c.appendChild(d)}}setPreFixInfo(this.el,{functionName:e.functionName,functionTab:e.functionTab}),focusNeedInput(this.currentInput().querySelector(".".concat(INPUT_FIELD_CLASS))),this.handleInput()}}},{key:"getValue",value:function(){var e=(arguments.length>0&&arguments[0]!==undefined?arguments[0]:{}).keepWhitespace,t=void 0!==e&&e,n=this.currentInput(),i=this.data.get("isAiEditor"),a=this.data.get("scene")===AI_SCENE;if(!n)return"";if(!i){if(a)return n.value;var o=n.value.replace(/\n/g," ");return t?o:o.trim()}var s=Array.from(n.childNodes).filter((function(e){return!(e instanceof HTMLElement&&[INPUT_PREFIX_WRAPPER_CLASS,AI_INPUT_FILE_CLASS,INPUT_AGENT_CLASS,AI_INPUT_IMAGE_CLASS].some((function(t){return e.classList.contains(t)})))})).map((function(e){return e.nodeType===Node.TEXT_NODE?e.textContent||"":e instanceof HTMLElement?a&&e instanceof HTMLBRElement?"\n":e.innerText:""})).join("");return t?s:s.trim()}},{key:"getPlaceholder",value:function(){var e=this.data.get("input.normalPlaceholder"),t=this.data.get("aiPlaceholder");return this.data.get("isAiEditor")?t:e}},{key:"getInputInfo",value:function(){return{value:this.getValue(),prefix:this.data.get("prefix"),isAiEditor:this.data.get("isAiEditor"),placeholder:this.getPlaceholder(),canSendPlaceholder:this.data.get("input.canSendPlaceholder"),isUserInput:this.isUserInput,isCustomInput:this.isCustomInput,isFocus:document.activeElement===this.currentInput()}}},{key:"clearValue",value:function(e){var t,n=(e||{}).keepPrefix,i=void 0!==n&&n,a=this.currentInput();if(this.data.get("isAiEditor"))if(i){var o=null==(t=this.el)?void 0:t.querySelectorAll(".".concat(INPUT_FIELD_CLASS));if(o&&o.length>0){for(var s=1;s<o.length;s++)o[s].remove();o[0].innerHTML="",o[0].appendChild(getSpaceTextNode())}else a.innerHTML=""}else a.innerHTML="";else a.value="";this.isCustomInput=!1}},{key:"getPreFixEl",value:function(){var e;return null==(e=this.el)?void 0:e.querySelector(".".concat(INPUT_PREFIX_WRAPPER_CLASS))}},{key:"handleKeydown",value:function(e){var t,n,i,a=this,o=window.getSelection();if(o){this.$input.emit(EVENTS.KEYDOWN,e);var s=this.data.get("isAiEditor"),r=this.currentInput(),l=this.getPreFixEl();if(s){if((e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()&&document.activeElement===r&&l){e.preventDefault();var c=r.querySelector("#ai-input-file-tag"),d=c?c.nextSibling:null==(t=r.firstChild)?void 0:t.nextSibling,u=r.lastChild,p=u.nodeType===Node.TEXT_NODE?(null==(n=u.nodeValue)?void 0:n.length)||0:u.childNodes.length,h=document.createRange();h.setStart(d,0),h.setEnd(u,p),o.removeAllRanges(),o.addRange(h)}if("Backspace"===e.key)if(""===this.getValue()){if(e.preventDefault(),!1!==this.data.get("input.clearAiModeOnEmptyDelete")){var f=(null==(i=this.data.get("prefix"))?void 0:i.type)||"";if(emitBeforePrefixChange(this.$input,{action:"exit",fromType:f,onContinue:function(){a.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:f,skipPrefixConfirm:!0})}}))return;this.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:f})}}else{var m=window.getSelection();if(!m||!m.anchorNode)return;handleInputFieldBackspace(e),e.defaultPrevented&&this.handleInput()}"ArrowLeft"===e.key?handleArrowKey(e,"left"):"ArrowRight"===e.key&&handleArrowKey(e,"right")}if("Enter"===e.key)if(this.isCustomInput||this.isComposing||!(this.isBreakRow||e.shiftKey||e.metaKey||e.ctrlKey)){if(!this.isComposing){if(!this.isCustomInput&&this.isBreakRow)return;e.preventDefault();var g=function(){a.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUBMIT,data:{triggerType:"enter"}});var e=a.getValue();a.$input.sendLog("click","search_kuang",{query:e,is_query_over:calculateStrIsOverWord(e)?"1":"0",pos:"enter"})};isSafari()?setTimeout((function(){g()}),50):g()}}else if(s){var _=r.scrollHeight;setTimeout((function(){r.scrollHeight<=_&&insertAtRange(document.createElement("br")),a.handleInput()}),50)}else{var v=r;e.preventDefault();var b=v.selectionStart,y=v.selectionEnd,w=v.value;v.value="".concat(w.substring(0,b),"\n").concat(w.substring(y)),v.selectionStart=v.selectionEnd=b+1,this.resizeTextarea("focus"),v.selectionStart===v.value.length&&(v.scrollTop=v.scrollHeight),this.handleInput()}if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))if(s&&""===this.getValue())e.preventDefault(),e.stopPropagation();else if("ArrowLeft"===e.key||"ArrowUp"===e.key){var S=window.getSelection();if(!S||!S.isCollapsed||!l)return;var C=S.getRangeAt(0),T=C.startContainer,k=C.startOffset,x=l.nextSibling;0===k&&(x===T||x instanceof Element&&x.contains(T)&&x.firstChild===T)&&e.preventDefault()}" "!==e.key&&"Space"!==e.code||!this.getValue()&&s&&e.preventDefault(),"Shift"!==e.key&&"Meta"!==e.key&&"Control"!==e.key||!s?this.isBreakRow=!1:this.isBreakRow=!0}}},{key:"handleCompositionstart",value:function(){this.isComposing=!0}},{key:"handleCompositionend",value:function(){var e=this;isSafari()?setTimeout((function(){e.isComposing=!1}),20):this.isComposing=!1}},{key:"resizeTextarea",value:function(e){var t,n,i,a=!(arguments.length>1&&arguments[1]!==undefined)||arguments[1],o=this.currentInput();if(o){var s=this.data.get("isAiEditor"),r=this.getValue(),l=this.getPlaceholder(),c=s?AI_MODE:"normal",d=this.measurementsCacheRef[c],u=a&&d||getSizingData(o);if(u){this.measurementsCacheRef[c]=a?u:null;var p=this.data.get("input.".concat(e))||{},h=null!=(t=null==p?void 0:p.minRows)?t:1,f=null!=(n=null==p?void 0:p.maxRows)?n:h,m=o instanceof HTMLTextAreaElement?o.placeholder:(null==(i=o.getAttribute)?void 0:i.call(o,"placeholder"))||"",g=_slicedToArray(calculateNodeHeight(u,getOriginalValue(o,Boolean(s))||m||r||l||"x",h,f,getTextIndent(this.el)),1)[0],_=this.lastInputHeight[c];if(null===_||_!==g){o.style.setProperty("height","".concat(g,"px"),"important"),this.lastInputHeight={AI:null,normal:null},this.lastInputHeight[c]=g;var v=this.$input.rootCmpt;v&&(v.shouldIgnoreScrollBlur=!0,v.scrollBlurResetTimer&&window.clearTimeout(v.scrollBlurResetTimer),v.scrollBlurResetTimer=window.setTimeout((function(){v.shouldIgnoreScrollBlur=!1,v.scrollBlurResetTimer=void 0}),120),"blur"===e&&(o.scrollTop=0))}}}}},{key:"ensureSelectionInEditorContent",value:function(){var e=window.getSelection();if(null==e?void 0:e.rangeCount){var t=this.currentInput().querySelector(".".concat(INPUT_FIELD_CLASS));if(t&&!t.contains(e.anchorNode)){var n=document.createRange();n.selectNodeContents(t),n.collapse(!1),e.removeAllRanges(),e.addRange(n)}}}},{key:"handlePaste",value:function(e){var t=this.data.get("isAiEditor"),n=e.clipboardData;if(""!==n.getData("text/plain")&&t)return e.preventDefault(),this.ensureSelectionInEditorContent(),handlePasteText(n,{value:this.getValue(),isAiEditor:this.data.get("isAiEditor"),inputEl:this.currentInput(),maxLength:this.data.get("maxLength"),$input:this.$input}),void this.handleInput({target:e.target});if(n.files&&n.files.length>0){if(!1===this.data.get("upload.enableFilePaste"))return;e.preventDefault(),this.$input.sendLog("click","copy_finish_status",{file_type:getDragFileType(n)});var i=getFilesFromEvent(this.$input.getFileType(),n),a=i.toast,o=i.uploadFile,s=i.uploadType,r=i.rejectedFiles;if(a&&(this.$input.emit(EVENTS.TOAST_SHOW,{msg:a}),null==r?void 0:r.length)){var l=r.map((function(e){return e.format})).join(","),c=r[0].uploadType;this.$input.sendLog("click","image"===c?"pic_upload":"file_upload",{format:l,upload_status:"unsupported"})}s&&o&&(isFirefox()&&this.focusInputLast(),this.$input.emit(EVENTS.UPLOAD_FILE,{uploadFile:o,uploadType:s,uploadOrigin:"dragOrPasteUpload",actionType:UploadActionType.PASTE}))}}},{key:"handleBeforeInput",value:function(e){var t,n,i,a=this.getValue(),o=window.getSelection(),s=o&&0!==o.rangeCount?o.toString().length:0,r="";"insertText"===e.inputType||"insertCompositionText"===e.inputType?r=null!=(t=e.data)?t:"":"insertFromPaste"===e.inputType&&e instanceof ClipboardEvent&&(r=null!=(i=null==(n=e.clipboardData)?void 0:n.getData("text"))?i:"");var l=a.length-s+r.length,c=this.data.get("maxLength");a.length>=c&&l>a.length&&(this.$input.emit(EVENTS.TOAST_SHOW,getMaxLengthToastMsg(c)),e.preventDefault())}},{key:"reset",value:function(){this.data.set("prefix.noOpenPanel",!1),this.data.set("prefix.commonData",{}),this.isUserInput=!1}}])}(ApiCmpt),_q.template='\n <div id="ci-area">\n <textarea\n s-if="{{!isAiEditor}}"\n s-ref="ci-textarea"\n id="chat-textarea"\n class="ci-textarea ci-scroll-style"\n data-ai-placeholder="{{aiPlaceholder}}"\n data-normal-placeholder="{{normalPlaceholder}}"\n placeholder="{{haveFile ? filePlaceholder : input.normalPlaceholder}}"\n rows="1"\n maxlength="{{maxLength}}"\n autocomplete="off"\n value="{{initValue}}"\n on-beforeinput="handleBeforeInput"\n on-blur="inputChange(\'blur\')"\n on-focus="inputChange(\'focus\')"\n on-input="handleInput"\n on-keydown="handleKeydown"\n on-compositionstart="handleCompositionstart"\n on-compositionend="handleCompositionend"\n on-paste="handlePaste"\n ></textarea>\n <div\n s-else\n class="ci-ai"\n >\n <div\n s-ref="ci-editor"\n id="ci-editor"\n class="ci-editor ci-scroll-style {{isEmptyValue ? \'ci-placeholder\' : \'\'}}"\n placeholder="{{haveFile ? filePlaceholder : aiPlaceholder}}"\n autocomplete="off"\n contenteditable="true"\n spellcheck="false"\n on-blur="inputChange(\'blur\')"\n on-focus="inputChange(\'focus\')"\n on-keydown="handleKeydown"\n on-compositionstart="handleCompositionstart"\n on-compositionend="handleCompositionend"\n on-paste="handlePaste"\n on-input="handleInput"\n on-beforeinput="handleBeforeInput"\n ></div>\n </div>\n </div>\n',_q.computed={isAiEditor:function(){return this.data.get("mode")===AI_MODE},isAiSearch:function(){return this.data.get("scene")===AI_SCENE},maxLength:function(){var e=this.data.get("isAiSearch"),t=this.data.get("isAiEditor"),n=this.data.get("prefix.type"),i=1e3;if(e){var a=this.data.get("samples")||[];i=Array.isArray(a)&&a.includes("QUERY_LEN_2W_EXP")?5e3:2e4}return t&&{ai_music_create:200}[n]||i},haveFile:function(){var e=this.data.get("fileList");return e&&e.length>0},filePlaceholder:function(){return"描述想要了解的内容"}},_q),Main$6=(_r=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t)}(san.Component),_r.trimWhitespace="all",_r.template='\n <svg class="ci-close-icon" t="1760363559360" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15640" width="200" height="200"><path d="M820.451556 203.529481l26.813629 26.832593-281.543111 281.505185 281.675852 281.656889-26.81363 26.832593-26.832592 26.813629L512.094815 565.475556 230.437926 847.17037l-26.81363-26.813629-26.813629-26.832593 281.656889-281.656889L176.924444 230.362074l53.62726-53.646222 281.524148 281.505185L793.6 176.734815l26.832593 26.813629z" fill="currentColor" p-id="15641"></path></svg>\n ',_r),Main$5=(_s=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{reference:{}}}},{key:"handleClose",value:function(){this.fire("close"),this.data.set("text","")}}])}(san.Component),_s.template='\n <div\n class="reference-container up-input-box\n data-not-show-selection-bar"\n s-if="reference.selectContent"\n >\n <div\n class="reference-container-input"\n >\n <div class="reference-row">\n <div class="reference-bar"></div>\n <img\n s-if="reference.icon"\n src="{{reference.icon}}"\n class="reference-icon"\n >\n <span class="reference-text ci-line-clamp-1">\n {{reference.selectContent}}\n </span>\n </div>\n <div\n class="reference-icon"\n on-click="handleClose"\n\n >\n <close-icon />\n </div>\n </div>\n </div>\n ',_s.components={"close-icon":Main$6},_s.computed={isUpScreen:function(){return 2!=+this.data.get("showType")}},_s),Main$4=(_t=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"attached",value:function(){var e=this.$input.getFileType();this.$input.sendLog("show","file"===e?"file_guide_word":"pic_guide_word")}},{key:"initData",value:function(){return{fileGuideWords:[]}}},{key:"showFileGuide",value:function(e){var t=e.limit;return!t||(this.data.get("fileList.length")||0)<=Number(t)}},{key:"handleSendQuery",value:function(e,t){var n=e.text,i=this.$input.getFileType(),a=this.data.get("guideDisable"),o=this.data.get("fileAllFail");if(!a&&!o){var s=this.$input.getRootData(),r=s.mode,l=s.scene,c=this.$input.getFileList(),d="file"===i?"file_guide_word":"pic_guide_word";l!==AI_SCENE?this.$input.sendLog("click","search_kuang",{pos:d}):this.$input.sendLog("click",d,{pos:t+1,button_text:n}),r===AI_MODE||l===AI_SCENE?this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUBMIT,data:{value:n,fileList:c,fileGuideSa:e.sa}}):go2AiChat(n,"file",this.$input),this.fire("send-file-query",{query:n,index:t,sa:e.sa})}}}])}(ApiCmpt),_t.template='\n <div class="ci-file-guide-wrapper">\n <d-swiper\n s-ref="swiper"\n space-between="9"\n >\n <template s-for="item, index in fileGuideWords">\n <tooltip\n s-if="showFileGuide(item)"\n content="{{tooltipContent}}"\n position="top"\n trigger="hover"\n bubble-class="{{(guideDisable || fileAllFail)\n ? \'\' : \'ci-file-guide-tooltip\'}}"\n >\n <div\n class="ci-file-guide-item\n {{(guideDisable || fileAllFail)\n ? \'ci-file-guide-disabled\' : \'\'}}"\n on-click="handleSendQuery(item, index)"\n >\n <img s-if="item.icon" class="ai-input-file-guide-icon" src="{{ item.icon }}">\n {{ item.text }}\n </div>\n </tooltip>\n </template>\n </d-swiper>\n </div>\n ',_t.components={"d-swiper":Main$l,tooltip:Main$j},_t.computed={guideDisable:function(){var e=this.data.get("fileList");return!e||!e.length||!e.every((function(e){return 2===e.status||3===e.status}))},fileAllFail:function(){return(this.data.get("fileList")||[]).every((function(e){return 3===e.status}))},tooltipContent:function(){var e=this.data.get("fileAllFail"),t=this.data.get("guideDisable");return e?"文件上传失败,换个文件试试吧":t?"请等待上传完成后发送":""}},_t),Main$3=(_u=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).lastFileNum=0,e}return _inherits(t,e),_createClass(t,[{key:"attached",value:function(){var e=this;this.watch("fileList",(function(t){var n=t.length,i=n<e.data.get("curUploadMaxNum")&&n>0;e.data.set("ubcLogFileAdd",i),n>e.lastFileNum&&e.nextTick((function(){e.ref("swiper").handleScroll("right")})),e.lastFileNum=n}));var t=this.$input.getFileType();this.data.get("showAddFile")&&this.$input.sendLog("show","file"===t?"file_add":"photo_add")}},{key:"initData",value:function(){return{fileList:[],ubcLogFileAdd:!1,deleteIcon:deleteIcon,uploadIcon:uploadIcon,loadingIcon:loadingIcon,reuploadIcon:reuploadIcon,mergeUpload:!1}}},{key:"handleFileClick",value:function(e){var t=this;e.status===UploadStatus.NETWORK_ERROR&&(this.$input.emit(EVENTS.DELETE_FILE,e),this.nextTick((function(){t.$input.emit(EVENTS.UPLOAD_FILE,{uploadFile:e})})))}},{key:"handleUploadClick",value:function(e){e.stopPropagation();var t=this.$input.getFileType(),n=this.data.get("fileList")[0].uploadType;this.$input.sendLog("click","file"===t?"file_add":"photo_add"),this.data.get("mergeUpload")?this.$input.emit(EVENTS.OPEN_MERGE_UPLOAD,{targetDom:this.el.querySelector(".ci-file-click-upload"),direction:"down",hideDisabled:!0,uploadScene:"add"}):this.$input.emit(EVENTS.UPLOAD_FILE,{uploadType:n,uploadScene:"add",targetDom:this.el.querySelector(".ci-file-click-upload")})}},{key:"formatBytes",value:function(e){if("number"!=typeof e)return"0B";for(var t=0,n=["B","KB","MB","GB"],i=e;i>=1024&&t<n.length-1;)i/=1024,t++;return"".concat(Math.round(100*i)/100).concat(n[t])}},{key:"getFileIcon",value:function(e){return 0===e.status||1===e.status?this.data.get("uploadIcon"):2===e.status?VALID_FILE_ICONS[e.fileType]||VALID_FILE_ICONS.unknown:(e.status,this.data.get("reuploadIcon"))}},{key:"getImageUrl",value:function(e){return 2===e.status?e.url:3===e.status?this.data.get("reuploadIcon"):this.data.get("uploadIcon")}},{key:"getFileDesc",value:function(e){return 0===e.status||1===e.status?"上传中 ".concat(Math.round(1e4*e.progress)/100,"%"):2===e.status?"".concat(e.fileType," ").concat(this.formatBytes(e.fileSize)):3===e.status?"点击图标重新上传":""}},{key:"handleDelete",value:function(e,t){e&&(e.stopPropagation(),e.preventDefault()),this.$input.emit(EVENTS.DELETE_FILE,t),this.sendFileLog("click","file_clear")}},{key:"sendFileLog",value:function(e,t){this.$input.sendLog(e,t)}}])}(ApiCmpt),_u.template='\n <div\n id="ci-file-tag"\n class="ci-file-container"\n >\n <swiper s-ref="swiper" space-between="9">\n <template s-for="fileItem in fileList">\n \x3c!-- 文件类型 --\x3e\n <div\n s-if="{{fileItem.uploadType === \'file\'}}"\n class="\n ci-file\n {{fileItem.status === 0 || fileItem.status === 1 ? \'ci-file-uploading\' : \'\'}}\n {{fileItem.status === 3 ? \'ci-file-failed\' : \'\'}}\n "\n on-click="handleFileClick(fileItem)"\n on-mouseenter="sendFileLog(\'show\', \'file_clear\')"\n >\n <div class="ci-file-icon">\n <img\n class="ci-file-icon-img"\n src="{{getFileIcon(fileItem)}}"\n >\n <img\n s-if="{{fileItem.status === 0 || fileItem.status === 1}}"\n class="ci-file-icon-loading"\n src="{{loadingIcon}}"\n >\n </div>\n <div class="ci-file-content">\n <div class="ci-file-name">{{fileItem.fileName}}</div>\n <div class="ci-file-desc">\n <div s-if="{{fileItem.status === 2}}" class="ci-file-desc-success">\n <div class="ci-file-desc-success-name">{{fileItem.fileType}}</div>\n <div\n class="ci-file-desc-success-size"\n >\n {{formatBytes(fileItem.fileSize)}}\n </div>\n </div>\n <div\n s-else\n class="ci-file-desc-success-desc"\n >\n {{getFileDesc(fileItem)}}\n </div>\n </div>\n </div>\n <div on-click="handleDelete($event, fileItem)" class="ci-file-delete">\n <img class="ci-file-delete-icon" src="{{deleteIcon}}" >\n </div>\n </div>\n\n \x3c!-- 图片类型 --\x3e\n <div\n class="ci-image\n {{fileItem.status === 0 || fileItem.status === 1 ? \'ci-image-uploading\' : \'\'}}\n {{fileItem.status === 3 ? \'ci-image-uploading\' : \'\'}}"\n s-elif="{{fileItem.uploadType === \'image\'}}"\n on-mouseenter="sendFileLog(\'show\', \'file_clear\')"\n >\n <img\n on-click="handleFileClick(fileItem)"\n class="ci-image-bg"\n src="{{getImageUrl(fileItem)}}"\n >\n <img\n s-if="{{fileItem.status === 0 || fileItem.status === 1}}"\n class="ci-file-icon-loading"\n src="{{loadingIcon}}"\n >\n <div on-click="handleDelete($event, fileItem)" class="ci-file-delete">\n <img class="ci-file-delete-icon" src="{{deleteIcon}}" >\n </div>\n </div>\n </template>\n <div\n s-if="{{showAddFile}}"\n class="ci-file-click-upload\n {{fileList && fileList[0] && fileList[0].uploadType === \'image\' ? \'image-click-upload\' : \'\'}}"\n on-click="handleUploadClick($event)"\n >\n <img\n class="ci-upload-img"\n src="https://psstatic.cdn.bcebos.com/basics/aichat/pc-file-add_1756446198000.svg"\n alt=""\n >\n </div>\n </swiper>\n </div>\n ',_u.components={swiper:Main$l},_u.computed={showAddFile:function(){var e,t,n,i=this.data.get("fileList")||[],a=this.data.get("upload")||{},o="image"===(null==(e=i[0])?void 0:e.uploadType)?(null==(t=a.image)?void 0:t.uploadMaxNum)||10:(null==(n=a.file)?void 0:n.uploadMaxNum)||10;return i.length<o},curUploadMaxNum:function(){var e,t,n,i=this.data.get("fileList")||[],a=this.data.get("upload")||{};return"image"===(null==(e=i[0])?void 0:e.uploadType)?(null==(t=a.image)?void 0:t.uploadMaxNum)||10:(null==(n=a.file)?void 0:n.uploadMaxNum)||10}},_u),Main$2=(_v=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{fileList:[],fileGuideWords:[],upload:{},mergeUpload:!1}}}])}(ApiCmpt),_v.template='\n <div>\n <file-container\n s-if="{{fileList && fileList.length}}"\n file-list="{{fileList}}"\n upload="{{upload}}"\n merge-upload="{{mergeUpload}}"\n on-add-file-log="handleAddFileLog"\n />\n <file-guide\n s-if="{{showFileGuide}}"\n file-guide-words="{{fileGuideWords}}"\n file-list="{{fileList}}"\n on-send-file-query="handleFileQuery"\n on-add-file-log="handleAddFileLog"\n />\n <div>\n ',_v.components={"file-guide":Main$4,"file-container":Main$3},_v.computed={showFileGuide:function(){var e=this.data.get("fileList").length,t=this.data.get("fileGuideWords").length,n=this.data.get("openPanelType")||"";return!(["ai_translate"].indexOf(n)>=0)&&e&&t}},_v),Main$1=(_w=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).requestKey=0,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{position:"bottom",agentSugList:[],textSugList:[],type:"agent",showSug:!1,newInputBox:!1,query:""}}},{key:"attached",value:function(){var e=this;this.debouncedGetSugList=debounce(this.getSugList.bind(this),300);var t=this.$input.getRootData(),n=t.initialFocus,i=t.query;i&&this.data.set("query",i),n&&i&&this.fetchSug(i,!0),this.inputStatusChangeHandler=this.inputStatusChangeHandler.bind(this),this.$input.on(EVENTS.INPUT_STATUS_CHANGE,this.inputStatusChangeHandler),this.valueChangeHandler=this.valueChangeHandler.bind(this),this.$input.on(EVENTS.VALUE_CHANGE,this.valueChangeHandler),this.hideSugHandler=this.hideSugHandler.bind(this),this.$input.on(EVENTS.HIDE_SUG,this.hideSugHandler),this.watch("showSug",(function(t){t&&e.$input.sendLog("show","sug_board")}))}},{key:"inputStatusChangeHandler",value:function(e){var t;(null==(t=e.prefix)?void 0:t.show)||("blur"===e.status?this.closeSug():"focus"===e.status&&e.value&&this.fetchSug(e.value,!0))}},{key:"valueChangeHandler",value:function(e){var t;if(!(null==(t=e.prefix)?void 0:t.show))return e.value?void this.fetchSug(e.value,!1):(this.closeSug(),void this.data.set("query",""))}},{key:"hideSugHandler",value:function(){this.closeSug()}},{key:"detached",value:function(){this.$input.off(EVENTS.INPUT_STATUS_CHANGE,this.inputStatusChangeHandler),this.$input.off(EVENTS.VALUE_CHANGE,this.valueChangeHandler),this.$input.off(EVENTS.HIDE_SUG,this.hideSugHandler)}},{key:"fetchSug",value:function(e,t){this.data.set("query",e),this.openSug(),t?this.getSugList(e,"common"):this.debouncedGetSugList(e,"common")}},{key:"clickSug",value:function(e,t){this.dispatch(DISPATCH_COMMON_EVENT,{name:FIRE_EVENTS.SUG_CLICK,data:__spreadProps(__spreadValues({},e),{value:e.word,type:this.data.get("type")})}),this.$input.sendLog("click","sug",{pos:t+1,sug_query:e.word}),this.closeSug()}},{key:"openSug",value:function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"common";this.data.set("type",e),this.data.set("showSug",!0)}},{key:"notifyShowSug",value:function(){this.data.get("showSug")&&this.$input.emit(EVENTS.AI_SUG_CHANGE,{show:!0})}},{key:"closeSug",value:function(){var e,t,n=this;null==(t=(e=this.debouncedGetSugList).cancel)||t.call(e),this.requestKey=0,this.data.set("showSug",!1),this.nextTick((function(){n.$input.emit(EVENTS.AI_SUG_CHANGE,{show:!1})})),this.data.set("textSugList",[]),this.data.set("agentSugList",[])}},{key:"getSugList",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a,o,s=this;return _regenerator().w((function(n){for(;;)switch(n.n){case 0:if(e||"common"!==t){n.n=1;break}return n.a(2,(this.closeSug(),Promise.reject()));case 1:return i=this.$input.getRootData().input,a="/aichat/api/aitabserver?ctl=sug&action=".concat(t,"&tk=").concat(getToken(i.searchframeLid,i.token,e),"&query=").concat(encodeURIComponent(e),"&lid=").concat(i.searchframeLid,"&ori_lid=").concat(i.sessionId||""),o=+new Date,n.a(2,(this.requestKey=o,timeoutFetch(a,{},2e3).then((function(e){var n,i;return s.requestKey!==o?Promise.reject():1003===e.status?(s.closeSug(),Promise.reject()):0===e.status&&e.data?("common"===t?(s.data.set("textSugList",e.data.common_sugs),(null==(n=e.data.common_sugs)?void 0:n.length)&&s.notifyShowSug()):"agent"===t&&(s.data.set("agentSugList",e.data.agent_input_sugs),(null==(i=e.data.agent_input_sugs)?void 0:i.length)&&s.notifyShowSug()),Promise.resolve()):Promise.reject()}))["catch"]((function(){return Promise.reject()}))))}}),n,this)})))}}])}(ApiCmpt),_w.template='\n <div s-if="{{sugList.length && showSug}}" class="ci-sug-wrap ci-sug-wrap-{{position}}">\n <div\n s-show="{{\n showSug\n && (type === \'agent\' && agentSugList.length\n || type === \'common\' && textSugList.length)\n }}"\n class="ci-sug-container"\n >\n <div class="ci-sug-list">\n <div s-if="{{type === \'agent\'}}" class="ci-sug-title">选择智能体</div>\n <fragment s-for="item, index in sugList">\n <div\n s-if="{{type === \'common\'}}"\n class="ci-text-sug-item"\n on-mousedown="clickSug(item, index)"\n >\n {{item.word}}\n </div>\n <div\n s-else\n class="ci-agent-sug-item"\n on-mousedown="clickSug(item, index)"\n >\n <img\n class="ci-sug-avatar"\n src="{{item.logo}}"\n size="md"\n />\n <div class="ci-sug-right">\n <div class="ci-sug-right-top">\n <div class="ci-sug-right-name">\n <div class="ci-line-clamp-1">\n {{item.source_name}}\n </div>\n </div>\n </div>\n <div class="ci-sug-right-description ci-line-clamp-1">{{item.description}}</div>\n </div>\n </div>\n </fragment>\n </div>\n </div>\n </div>\n ',_w.computed={sugList:function(){return"agent"===this.data.get("type")?this.data.get("agentSugList"):this.data.get("textSugList")}},_w),VoiceInputController=function(){return _createClass((function e(t){_classCallCheck(this,e),this.voiceRecognitionNode=null,this.voiceInputInitialValue="",this.voiceRecognizedText="",this.voiceRecordingStartTime=0,this.isRecording=!1,this.hasUsedVoiceInput=!1,this.$input=t.$input}),[{key:"getInputComponent",value:function(){return this.$input.rootCmpt.ref("input")}},{key:"onRecordingStart",value:function(){this.voiceRecognitionNode=null,this.voiceInputInitialValue=this.$input.getValue(),this.voiceRecordingStartTime=Date.now(),this.voiceRecognizedText="",this.isRecording=!0,this.hasUsedVoiceInput=!0,this.$input.focus({}),this.$input.emit("voice-input-start")}},{key:"onRecognized",value:function(e){var t,n,i,a,o;if(this.isRecording){this.voiceRecognizedText=e;var s=this.getInputComponent(),r=null==(t=null==s?void 0:s.currentInput)?void 0:t.call(s);if(r){var l=null==(i=null==(n=s.data)?void 0:n.get)?void 0:i.call(n,"isAiEditor"),c="".concat(this.voiceInputInitialValue).concat(e);if(l){var d=r.querySelector(".".concat(INPUT_FIELD_CLASS))||r;if(this.voiceRecognitionNode&&d.contains(this.voiceRecognitionNode))this.voiceRecognitionNode.innerText=e;else{var u=getTextNode({content:e});this.voiceRecognitionNode=u,d.appendChild(u)}null==(a=s.focusInputLast)||a.call(s),r.scrollTop=r.scrollHeight}else r.value=c,r.scrollTop=r.scrollHeight;null==(o=s.handleInput)||o.call(s,{source:"voice"})}}}},{key:"onRecordingStop",value:function(){this.finishVoiceInput()}},{key:"onRecordingError",value:function(e){var t=Boolean(e);this.finishVoiceInput(),t&&this.$input.emit("voice-input-error",e)}},{key:"forceStopRecording",value:function(){this.isRecording&&this.$input.emit("voice-input-stop")}},{key:"finishVoiceInput",value:function(){if(this.isRecording){var e=this.voiceRecordingStartTime>0?Date.now()-this.voiceRecordingStartTime:0;this.$input.emit(EVENTS.VOICE_INPUT_COMPLETE,{duration:e,content:this.voiceRecognizedText}),this.voiceRecognitionNode=null,this.isRecording=!1,this.voiceInputInitialValue="",this.voiceRecordingStartTime=0,this.voiceRecognizedText=""}}}])}(),DEFAULT_LONG_PRESS_MS=500,PREWARM_DELAY_MS=300,noop=function(){},SpaceVoiceController=function(){return _createClass((function e(t){var n,i,a,o,s,r,l,c=this;_classCallCheck(this,e),this.voiceActive=!1,this.longPressTimer=null,this.prewarmTimer=null,this.pressed=!1,this.cancelled=!1,this.composing=!1,this.inputVisible=!0,this.visibilityObserver=null,this.handleCompositionStart=function(){c.composing=!0},this.handleCompositionEnd=function(){c.composing=!1},this.handleBlur=function(){c.release()},this.handleKeydown=function(e){"Escape"!==e.code&&"Escape"!==e.key?e.isComposing||c.composing||c.isModalBlocked()||(c.inputVisible||c.pressed)&&(c.pressed&&(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)?c.cancelPress():c.matchKey(e)?c.isOtherInputFocused()||(e.preventDefault(),e.repeat||c.beginPress(e)):c.pressed&&c.cancelPress()):c.cancelPress()},this.handleKeyup=function(e){e.isComposing||c.composing||c.matchKey(e)&&c.release()},this.$input=t.$input,this.longPressMs=null!=(n=t.longPressMs)?n:DEFAULT_LONG_PRESS_MS,this.shortcutKey=null!=(i=t.shortcutKey)?i:"space",this.onSpaceInstantKeyDown=null!=(a=t.onSpaceInstantKeyDown)?a:noop,this.onSpaceInstantKeyUp=null!=(o=t.onSpaceInstantKeyUp)?o:function(){return c.compensateSpaceShortPress()},this.onLongSpacePress=null!=(s=t.onLongSpacePress)?s:function(){c.$input.focus({source:FOCUS_SOURCE.USER_CLICK}),c.$input.emit(EVENTS.VOICE_INPUT_TRIGGER,"space")},this.onLongSpacePressFinish=null!=(r=t.onLongSpacePressFinish)?r:function(){c.$input.emit(EVENTS.VOICE_INPUT_STOP)},this.onLongSpacePressCancel=null!=(l=t.onLongSpacePressCancel)?l:function(){c.$input.emit(EVENTS.VOICE_INPUT_STOP)}}),[{key:"init",value:function(){document.addEventListener("compositionstart",this.handleCompositionStart,!0),document.addEventListener("compositionend",this.handleCompositionEnd,!0),document.addEventListener("keydown",this.handleKeydown,!0),document.addEventListener("keyup",this.handleKeyup,!0),window.addEventListener("blur",this.handleBlur),this.observeInputVisibility()}},{key:"destroy",value:function(){this.clearLongPressTimer(),this.clearPrewarmTimer(),this.disconnectVisibilityObserver(),document.removeEventListener("compositionstart",this.handleCompositionStart,!0),document.removeEventListener("compositionend",this.handleCompositionEnd,!0),document.removeEventListener("keydown",this.handleKeydown,!0),document.removeEventListener("keyup",this.handleKeyup,!0),window.removeEventListener("blur",this.handleBlur)}},{key:"beginPress",value:function(e){var t;this.pressed=!0,this.cancelled=!1,this.voiceActive=!1,null==(t=this.onSpaceInstantKeyDown)||t.call(this,e),"option"!==this.shortcutKey?(this.schedulePrewarm(),this.startLongPressTimer()):this.triggerLongPress()}},{key:"prewarm",value:function(){prewarmRecorder()["catch"](noop)}},{key:"schedulePrewarm",value:function(){var e=this;this.clearPrewarmTimer(),this.prewarmTimer=window.setTimeout((function(){e.prewarmTimer=null,e.prewarm()}),PREWARM_DELAY_MS)}},{key:"clearPrewarmTimer",value:function(){null!==this.prewarmTimer&&(window.clearTimeout(this.prewarmTimer),this.prewarmTimer=null)}},{key:"startLongPressTimer",value:function(){var e=this;this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((function(){e.longPressTimer=null,e.pressed&&!e.cancelled&&e.triggerLongPress()}),this.longPressMs)}},{key:"triggerLongPress",value:function(){var e;this.voiceActive=!0,null==(e=this.onLongSpacePress)||e.call(this)}},{key:"cancelPress",value:function(){var e;this.pressed&&(this.cancelled=!0,this.clearLongPressTimer(),this.clearPrewarmTimer(),this.voiceActive?(null==(e=this.onLongSpacePressCancel)||e.call(this),this.voiceActive=!1):discardPrewarmRecorder(),this.resetPressState())}},{key:"release",value:function(){var e,t;this.pressed&&(this.clearLongPressTimer(),this.clearPrewarmTimer(),this.voiceActive?(this.voiceActive=!1,this.cancelled||null==(e=this.onLongSpacePressFinish)||e.call(this)):(null==(t=this.onSpaceInstantKeyUp)||t.call(this),discardPrewarmRecorder()),this.resetPressState())}},{key:"resetPressState",value:function(){this.pressed=!1,this.voiceActive=!1,this.cancelled=!1}},{key:"clearLongPressTimer",value:function(){null!==this.longPressTimer&&(window.clearTimeout(this.longPressTimer),this.longPressTimer=null)}},{key:"matchKey",value:function(e){return"space"===this.shortcutKey?"Process"!==e.key&&("Space"===e.code||" "===e.key):"option"===this.shortcutKey?this.isOptionKey(e):this.matchMatcher(e)}},{key:"isOptionKey",value:function(e){return this.isMacPlatform()?"AltRight"===e.code:"ShiftRight"===e.code||"Shift"===e.key&&1!==e.location}},{key:"matchMatcher",value:function(e){var t=this.shortcutKey;return!(void 0!==t.key&&(e.key||"").toLowerCase()!==t.key.toLowerCase()||void 0!==t.code&&(e.code||"").toLowerCase()!==t.code.toLowerCase()||void 0!==t.ctrlKey&&e.ctrlKey!==t.ctrlKey||void 0!==t.altKey&&e.altKey!==t.altKey||void 0!==t.shiftKey&&e.shiftKey!==t.shiftKey||void 0!==t.metaKey&&e.metaKey!==t.metaKey)}},{key:"isMacPlatform",value:function(){return/mac/i.test("undefined"!=typeof navigator?navigator.platform:"")}},{key:"observeInputVisibility",value:function(){var e,t,n=this;if("undefined"!=typeof IntersectionObserver){var i=null==(t=null==(e=this.$input.rootCmpt)?void 0:e.el)?void 0:t.querySelector("#ci-main");i&&(this.disconnectVisibilityObserver(),this.visibilityObserver=new IntersectionObserver((function(e){var t=e[e.length-1];n.inputVisible=!!(null==t?void 0:t.isIntersecting)})),this.visibilityObserver.observe(i))}}},{key:"disconnectVisibilityObserver",value:function(){this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null)}},{key:"isModalBlocked",value:function(){var e=this.$input.getRootData("tools.right.voice");return this.isModalOpen(null==e?void 0:e.blockSelectors)}},{key:"getInputEl",value:function(){var e,t,n,i;return null==(i=null==(n=null==(t=null==(e=this.$input.rootCmpt)?void 0:e.ref)?void 0:t.call(e,"input"))?void 0:n.currentInput)?void 0:i.call(n)}},{key:"isOtherInputFocused",value:function(){var e=document.activeElement;if(!e||e===document.body)return!1;var t=this.getInputEl();return(!t||e!==t&&!t.contains(e))&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)}},{key:"isModalOpen",value:function(e){return!(!e||!e.length)&&e.some((function(e){var t=document.querySelector(e);if(!t)return!1;var n=getComputedStyle(t);return"none"!==n.display&&"hidden"!==n.visibility}))}},{key:"compensateSpaceShortPress",value:function(){var e=this.getInputEl();if(e&&document.activeElement===e)this.$input.isAiEditor()&&!this.$input.getValue()||document.execCommand&&document.execCommand("insertText",!1," ");else{var t=this.$input.getRootData("tools.right.voice");this.getScroller(null==t?void 0:t.scrollContainer).scrollBy({top:.8*window.innerHeight,behavior:"smooth"})}}},{key:"getScroller",value:function(e){if("function"==typeof e){var t=e();if(t)return t}else if(e){var n=document.querySelector(e);if(n)return n}return window}}])}(),_DragComponent=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).overlay=null,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{}}},{key:"attached",value:function(){!1!==this.data.get("upload.enableDrag")&&this.bindWindowDrag()}},{key:"detached",value:function(){var e;this.$input.offEvent(ListenerEventType.OTHER),null==(e=this.overlay)||e.remove(),this.overlay=null}},{key:"bindWindowDrag",value:function(){var e=this,t=document.createElement("div");this.overlay=t,t.className="ci-drag-mask",t.innerHTML='\n <div class="ci-drag-mask-wrapper">\n <img\n class="ci-drag-mask-image"\n src="'.concat(DRAGCONTENT.IMG,'"\n >\n <div class="ci-drag-mask-title">\n ').concat(DRAGCONTENT.TITLE,'\n </div>\n <div class="ci-drag-mask-content">\n ').concat(DRAGCONTENT.FILETEXT,'\n </div>\n <div class="ci-drag-mask-sub-content">\n ').concat(DRAGCONTENT.IMAGETEXT,"\n </div>\n </div>\n ");var n=0;this.$input.addEvent(window,"dragenter",(function(i){var a,o=i.dataTransfer;o&&(null==(a=o.types)?void 0:a.includes("Files"))&&(i.preventDefault(),1==++n&&(document.body.contains(t)||document.body.appendChild(t),t.style.display="flex",e.$input.emit("drag-show",{event:i}),e.$input.sendLog("show","drag_status",{file_status:getInputType(e.$input)})))}),ListenerEventType.OTHER),this.$input.addEvent(window,"dragleave",(function(e){var i,a=e.dataTransfer;a&&(null==(i=a.types)?void 0:i.includes("Files"))&&(e.preventDefault(),0===(n=Math.max(0,n-1))&&(t.style.display="none"))}),ListenerEventType.OTHER),this.$input.addEvent(window,"dragover",(function(e){var t,n=e.dataTransfer;n&&(null==(t=n.types)?void 0:t.includes("Files"))&&e.preventDefault()}),ListenerEventType.OTHER),this.$input.addEvent(window,"drop",(function(i){var a,o=i.dataTransfer;if(o&&(null==(a=o.types)?void 0:a.includes("Files"))){i.preventDefault(),n=0,t.style.display="none",e.$input.emit("drag-done",{event:i,fileSuffix:getDragFileType(i.dataTransfer)}),e.$input.sendLog("show","drag_finish_status",{file_type:getDragFileType(i.dataTransfer)});var s=getFilesFromEvent(e.$input.getFileType(),i.dataTransfer),r=s.toast,l=s.uploadFile,c=s.uploadType,d=s.rejectedFiles;if(r&&(e.$input.emit(EVENTS.TOAST_SHOW,{msg:r}),null==d?void 0:d.length)){var u=d.map((function(e){return e.format})).join(","),p=d[0].uploadType;e.$input.sendLog("click","image"===p?"pic_upload":"file_upload",{format:u,upload_status:"unsupported"})}c&&l&&(isFirefox()&&e.$input.focus({}),e.$input.emit(EVENTS.UPLOAD_FILE,{uploadFile:l,uploadType:c,uploadOrigin:"dragOrPasteUpload",actionType:UploadActionType.DRAG}))}}),ListenerEventType.OTHER)}}])}(ApiCmpt);_DragComponent.template="<div></div>";var DragComponent=_DragComponent,uploadFileInsList=[],_Main=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).mockReadProgressTimer=null,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{fileList:[]}}},{key:"updateFileGuideWords",value:function(e,t){if(t){var n=this.$input.getRootData("openPanelType")||this.$input.getRootData("openPanelInfo.type")||"";this.$input.emit(EVENTS.FILE_CHANGE,{fileGuideWords:isDeepDecisionPanelType(n)?[]:handleFileGuideWords(e,t)})}}},{key:"attached",value:function(){this.handleUpload=this.handleUpload.bind(this),this.handleClearAllFiles=this.handleClearAllFiles.bind(this),this.$input.on(EVENTS.UPLOAD_FILE,this.handleUpload),this.$input.on(EVENTS.CLEAR_ALL_FILES,this.handleClearAllFiles)}},{key:"detached",value:function(){this.$input.off(EVENTS.UPLOAD_FILE,this.handleUpload),this.$input.off(EVENTS.CLEAR_ALL_FILES,this.handleClearAllFiles)}},{key:"handleClearAllFiles",value:function(){clearTimeout(this.mockReadProgressTimer),uploadFileInsList.length=0,this.$input.emit(EVENTS.FILE_CHANGE,{fileList:[]})}},{key:"handleUpload",value:function(e){var t=e.uploadFile,n=e.uploadScene,i=e.direct,a=e.uploadType;if(i)this.uploadFileDiret(e.uploadFile);else if((null==t?void 0:t.status)!==UploadStatus.NETWORK_ERROR){if(a){var o=this.check(a);if(o)return void this.$input.emit(EVENTS.TOAST_SHOW,{msg:o})}n&&this.data.get("upload.blockOriginWhenScene")?this.$input.trigger(FIRE_EVENTS.UPLOAD_FILE_SCENE,__spreadProps(__spreadValues({},e),{fileList:this.data.get("fileList")||[]})):this.uploadFile(e)}else this.reuploadFile(t)}},{key:"addFiles",value:function(e){this.$input.emit(EVENTS.FILE_CHANGE,{fileList:this.data.get("fileList").concat(e)})}},{key:"isShowToast",value:function(e){var t=e.uploadOrigin,n=e.uploadType,i=this.data.get("curUploadType"),a=!1;return"readUpload"===t?a=!(i&&i!==n):"dragOrPasteUpload"===t&&(a=!0),a}},{key:"check",value:function(e){var t,n,i=this.data.get("fileList")||[],a=this.data.get("curUploadType"),o=this.data.get("upload")||{},s=(null==(t=o.file)?void 0:t.uploadMaxNum)||uploadFileMaxNum,r=(null==(n=o.image)?void 0:n.uploadMaxNum)||uploadImageMaxNum,l="image"===e?r:s;return a&&a!==e?"暂不支持文件、图片混合上传":i.length>=l?"file"===e?"上传文件最多支持".concat(l,"个"):"上传图片最多支持".concat(l,"个"):""}},{key:"uploadFile",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a,o,s,r,l,c,d,u,p,h,f,m,g,_,v,b,y,w,S,C,T,k,x,E,I,L,A,P,D=this;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:if(d=e.uploadFile,u=e.uploadOrigin,p=e.uploadType,h=e.actionType,f=void 0===h?UploadActionType.SELECT_FILE:h,m=this.data.get("upload")||{},!(g=this.check(p))){t.n=1;break}return t.a(2,void(this.isShowToast({uploadOrigin:u,uploadType:p})&&this.$input.emit(EVENTS.TOAST_SHOW,{msg:g})));case 1:if(_=this.data.get("upload")||{},"image"!==p||!(null==(n=_.image)?void 0:n.dispatchFileData)){t.n=2;break}return t.a(2,void this.dispatchImageFileData(e));case 2:return v=+new Date,b=null,y=(null==(i=this.data.get("fileList"))?void 0:i.length)||0,w=(null==(a=m.file)?void 0:a.uploadMaxNum)||uploadFileMaxNum,S=(null==(o=m.image)?void 0:o.uploadMaxNum)||uploadImageMaxNum,C="image"===p?S:w,T=d?Promise.resolve({files:[],exceeded:!1}):UploadFile.getOriginFile(p,C-y,"image"===p&&!!(null==(s=m.image)?void 0:s.enableExtendedPicFormats)),t.n=3,this.$input.getBaidubceSdk();case 3:return k=t.v,x=this.$input.getRootData(),E=x.input||{},I=getPrivateStatus(),L={type:p,maxSize:(null==(r=m.file)?void 0:r.maxSize)||UPLOAD_FILE_MAX_SIZE_MB,maxNum:C-y,sseHost:_.sseHost,isChatSearch:x.scene===AI_SCENE,token:getToken(E.searchframeLid,E.token,""),privateChat:I,sdk:k,enableExtendedPicFormats:!!(null==(l=_.image)?void 0:l.enableExtendedPicFormats),callback:function(t){var n,i,a,o,s=t.status,r=t.fileInfo,l=t.progress,c=t.recommendWord,d=D.data.get("fileList");if(s===UploadStatus.INIT){var u=!1;if(uploadFileInsList.forEach((function(e){e.timeStamp===v&&(u=!0)})),u||uploadFileInsList.push({uploadFileIns:b,timeStamp:v}),r){var h={status:UploadStatus.UPLOADING,fileToken:r.fileToken,timeStamp:v,fileName:r.fileName,uploadType:p,uploadActionType:f,fileType:getFileType(r.fileName),fileSize:r.fileSize,progress:l,fileId:r.fileId};d.push(h)}D.$input.focus({})}else if(s===UploadStatus.STSSUCCESS)d.forEach((function(e,t){e.fileToken===(null==r?void 0:r.fileToken)&&(d[t].status=s,d[t].progress=l)})),D.updateFileGuideWords(p,c);else if(s===UploadStatus.UPLOADING)d.forEach((function(e,t){e.fileToken===(null==r?void 0:r.fileToken)&&(d[t].status=s,d[t].progress=l)})),D.data.set("isFileUploading",!0);else if(s===UploadStatus.NOT_AVAILABLE)D.$input.emit(EVENTS.TOAST_SHOW,{msg:"暂不支持此格式,换个文件试试"}),D.data.set("isFileUploading",!1),D.$input.sendLog("click","image"===p?"pic_upload":"file_upload",{format:(null==r?void 0:r.fileType)||"",upload_status:"unsupported"});else if(s===UploadStatus.BOS_SUCCESS)d.forEach((function(e,t){e.fileToken===(null==r?void 0:r.fileToken)&&(d[t].progress=l,d[t].status=s,d[t].url=null==r?void 0:r.fileUrl,d[t].fileId=null==r?void 0:r.fileId,d[t].filePath=null==r?void 0:r.filePath)})),D.data.set("isFileUploading",!1),D.$input.sendLog("click","image"===p?"pic_upload":"file_upload",{format:(null==r?void 0:r.fileType)||"",upload_status:"success"}),D.$input.sendLog("show","file_icon",{format:(null==r?void 0:r.fileType)||""});else if(s===UploadStatus.NETWORK_ERROR)d.forEach((function(e,t){e.fileToken===(null==r?void 0:r.fileToken)&&(d[t].status=s)})),D.$input.emit(EVENTS.TOAST_SHOW,{msg:"网络错误,请重试"}),D.$input.sendLog("click","image"===p?"pic_upload":"file_upload",{format:(null==r?void 0:r.fileType)||"",upload_status:"failed"});else if(s===UploadStatus.RISK_DENY)D.$input.emit(EVENTS.TOAST_SHOW,{msg:"当前文件暂不支持,换个文件试试吧"}),D.$input.sendLog("click","image"===p?"pic_upload":"file_upload",{format:(null==r?void 0:r.fileType)||"",upload_status:"unsupported"}),D.deleteFile(r);else if(s===UploadStatus.FILE_SIZE_EXCEED_LIMIT){var g="file"===p?(null==(n=m.file)?void 0:n.maxSize)||UPLOAD_FILE_MAX_SIZE_MB:(null==(i=m.image)?void 0:i.maxSize)||UPLOAD_IMAGE_MAX_SIZE_MB;D.$input.emit(EVENTS.TOAST_SHOW,{msg:"file"===p?"文件超过".concat(g,"M,请重新选择后上传"):"图片超过".concat(g,"M,请重新选择后上传")});var _=D.$input.getRootData("openPanelType")||D.$input.getRootData("openPanelInfo.type")||"";D.$input.sendLog("show","upload_file_limit",{is_deepdecision:isDeepDecisionPanelType(_)?1:0})}else if(s===UploadStatus.IMAGE_INFO_SUCCESS)d.forEach((function(e,t){e.fileToken===(null==r?void 0:r.fileToken)&&(d[t].imageWidth=null==r?void 0:r.imageWidth,d[t].imageHeight=null==r?void 0:r.imageHeight)}));else if(s===UploadStatus.FILE_SIZE_BELOW_LIMIT)D.$input.emit(EVENTS.TOAST_SHOW,{msg:"当前文件暂不支持,换个文件试试吧"});else if(s===UploadStatus.FILE_NUM_EXCEED_LIMIT){var y=(null==(a=m.file)?void 0:a.uploadMaxNum)||uploadFileMaxNum,w=(null==(o=m.image)?void 0:o.uploadMaxNum)||uploadImageMaxNum,S="image"===p?w:y;D.$input.emit(EVENTS.TOAST_SHOW,{msg:"file"===p?"上传文件最多支持".concat(S,"个"):"上传图片最多支持".concat(S,"个")})}s!==UploadStatus.RISK_DENY&&D.$input.emit(EVENTS.FILE_CHANGE,__spreadValues({fileList:JSON.parse(JSON.stringify(d))},e))}},"image"===p&&(L.maxSize=(null==(c=m.image)?void 0:c.maxSize)||UPLOAD_IMAGE_MAX_SIZE_MB),t.n=4,UploadFile.create(L);case 4:if(b=t.v,!d){t.n=5;break}b.uploadFiles(d)["catch"]((function(){})),t.n=7;break;case 5:return t.n=6,T;case 6:A=t.v,P=A.files,A.exceeded&&this.$input.emit(EVENTS.TOAST_SHOW,{msg:"file"===p?"上传文件最多支持".concat(C,"个"):"上传图片最多支持".concat(C,"个")}),P.length>0&&b.uploadFiles(P)["catch"]((function(){}));case 7:return t.a(2)}}),t,this)})))}},{key:"reuploadFile",value:function(e){uploadFileInsList.forEach((function(t){var n;t.timeStamp===e.timeStamp&&(null==(n=t.uploadFileIns)||n.reTryUpload(e.fileToken))}))}},{key:"deleteFile",value:function(e){var t=this.data.get("fileList").filter((function(t){return e.fileToken||t.fileToken?t.fileToken!==e.fileToken:t.fileId!==e.fileId}));this.$input.emit(EVENTS.FILE_CHANGE,{fileList:_toConsumableArray(t)})}},{key:"uploadFileDiret",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a,o,s,r,l,c,d,u,p,h,f,m,g,_,v,b,y,w,S,C,T,k,x=this;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:for(n=function(e){var t=(x.data.get("fileList")||[])[0];return(null==t?void 0:t.filePath)===(null==e?void 0:e.filePath)?t:{}},clearTimeout(this.mockReadProgressTimer),i={},a=0,o=Object.entries(e);a<o.length;a++)s=_slicedToArray(o[a],2),r=s[0],l=s[1],c=stringCamelCase(r),i[c]=l;return d=[__spreadProps(__spreadValues({},i),{fileSize:Number(i.fileSize),status:1,progress:0,fileType:getFileType(i.fileName),uploadType:i.fileType})],this.$input.emit(EVENTS.FILE_CHANGE,{fileList:[].concat(d)}),this.mockReadProgressTimer=setTimeout((function(){var e=n(i);1===e.status&&(x.$input.emit(EVENTS.FILE_CHANGE,{fileList:[__spreadProps(__spreadValues({},e),{progress:+(.3*Math.random()+.2).toFixed(2)})]}),x.mockReadProgressTimer=null)}),100),t.n=1,this.$input.getBaidubceSdk();case 1:return u=t.v,p=this.$input.getRootData(),h=p.input,f=h.searchframeLid,m=h.token,g=getToken(f,m),t.n=2,UploadFile.create({type:i.fileType,maxNum:1,maxSize:UPLOAD_FILE_MAX_SIZE_MB,isChatSearch:!0,token:g,sdk:u,callback:function(){}});case 2:return _=t.v,v={id:generateHighPrecision(i.filePath||""),name:i.fileName,path:i.filePath,size:Number(i.fileSize),type:i.fileType,rw:"1"},t.n=3,_.upLoadConfirm(v);case 3:if(b=t.v,y=b.id,w=b.file_url,S=b.recommend_word,this.updateFileGuideWords(i.fileType,S),C=this.data.get("fileList")||[],T=C.findIndex((function(e){return e.filePath===i.filePath})),-1!==T){t.n=4;break}return t.a(2);case 4:(k=_toConsumableArray(C))[T]=__spreadProps(__spreadValues({},i),{fileId:y,fileToken:g,status:2,url:w,uploadType:i.fileType,fileSize:Number(i.fileSize),fileType:getFileType(i.fileName)}),this.$input.emit(EVENTS.FILE_CHANGE,{fileList:k});case 5:return t.a(2)}}),t,this)})))}},{key:"dispatchImageFileData",value:function(e){return __async(this,null,_regenerator().m((function t(){var n,i,a,o,s,r,l,c,d,u;return _regenerator().w((function(t){for(;;)switch(t.n){case 0:if(a=e.uploadFile,o=e.actionType,s=void 0===o?UploadActionType.SELECT_FILE:o,!a){t.n=1;break}return t.a(2,void this.readAndDispatchFiles(a,s));case 1:return r=this.data.get("upload")||{},l=(null==(n=r.image)?void 0:n.uploadMaxNum)||uploadImageMaxNum,c=!!(null==(i=r.image)?void 0:i.enableExtendedPicFormats),t.n=2,UploadFile.getOriginFile("image",l,c);case 2:d=t.v,u=d.files,d.exceeded&&this.$input.emit(EVENTS.TOAST_SHOW,{msg:"上传图片最多支持".concat(l,"个")}),u.length>0&&this.readAndDispatchFiles(u,s);case 3:return t.a(2)}}),t,this)})))}},{key:"readAndDispatchFiles",value:function(e,t){var n,i,a=this,o=(null==(n=(this.data.get("upload")||{}).image)?void 0:n.uploadMaxNum)||uploadImageMaxNum,s=o-((null==(i=this.data.get("fileList"))?void 0:i.length)||0),r=e.slice(0,s);0!==r.length?r.forEach((function(e){var n=new FileReader;n.onload=function(){var n={file:e,actionType:t};a.$input.trigger(FIRE_EVENTS.IMAGE_FILE_SELECT,n)},n.readAsArrayBuffer(e)})):this.$input.emit(EVENTS.TOAST_SHOW,{msg:"上传图片最多支持".concat(o,"个")})}}])}(ApiCmpt);_Main.template='<drag upload="{{upload}}" />',_Main.components={drag:DragComponent},_Main.computed={loading:function(){return(this.data.get("fileList")||[]).some((function(e){return 1===e.status||0===e.status}))}};var Main=_Main,_SingleFileItem=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{fileType:"",loadingIcon:loadingIcon}}},{key:"getIcon",value:function(e){return e&&0!==e.status&&1!==e.status?2===e.status?this.data.get("fileList").length>1?folderIcon:VALID_FILE_ICONS[e.fileType]||VALID_FILE_ICONS.unknown:(e.status,reuploadIcon):uploadIcon}}])}(san.Component);_SingleFileItem.template='\n <span class="ci-input-file" data-focus-input="1">\n <span class="ci-input-file-inner" s-if="{{fileType === \'file\'}}">\n <div class="ci-input-file-icon">\n <img class="ci-input-file-icon-img" src="{{getIcon(firstFile)}}">\n <img s-if="{{haveLoadingFile}}" class="ci-input-file-icon-loading" src="{{loadingIcon}}">\n </div>\n <span class="ci-input-file-name-container">\n <span class="ci-input-file-name">{{firstFile.fileName}}</span>\n <span class="ci-input-file-num">&nbsp;{{fileNum}}个文件</span>\n </span>\n </span>\n <span\n s-if="{{fileType === \'image\'}}"\n class="ci-input-image"\n >\n <img class="ci-input-image-bg {{haveLoadingFile ? \'ci-input-file-icon-loading\' : \'\'}}" src="{{haveLoadingFile ? loadingIcon : firstFile.url}}">\n <span class="ci-input-image-num">{{fileNum}}</span>\n </span>\n </span>\n ',_SingleFileItem.computed={firstFile:function(){return this.data.get("fileList")[0]},fileNum:function(){return this.data.get("fileList").length},haveLoadingFile:function(){return this.data.get("fileList").some((function(e){return 0===e.status||1===e.status}))}};var SingleFileItem=_SingleFileItem,_BindWindowAction=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{}}},{key:"attached",value:function(){this.$input.getRootData("focusToMultiLine")&&this.bindClickOutSide(),this.$input.getRootData("scene")===AI_SCENE||this.bindScrollToBlur(),isFirefox()&&window.addEventListener("unload",this.handleUnload)}},{key:"bindClickOutSide",value:function(){this.outSideTrigger=this.outSideTrigger.bind(this),window.addEventListener("mousedown",this.outSideTrigger,!0),window.addEventListener("touchstart",this.outSideTrigger,!0)}},{key:"outSideTrigger",value:function(e){if(!this.$input.rootCmpt.el.contains(e.target)){if(1===this.$input.getRootData("input.row"))return;this.actionBlur()}}},{key:"actionBlur",value:function(){this.$input.blur()}},{key:"bindScrollToBlur",value:function(e){var t=this,n=e||window,i=function(){return e?e.scrollTop:window.scrollY},a=!1,o=i();this.handleScroll=function(){if(t.$input.rootCmpt.shouldIgnoreScrollBlur)return t.$input.rootCmpt.shouldIgnoreScrollBlur=!1,void(t.scrollBlurResetTimer&&(window.clearTimeout(t.scrollBlurResetTimer),t.scrollBlurResetTimer=void 0));i()!==o&&(a||(window.requestAnimationFrame((function(){t.$input.blur(),a=!1})),a=!0))},n.addEventListener("scroll",this.handleScroll)}},{key:"handleUnload",value:function(){}},{key:"disposed",value:function(){window.removeEventListener("mousedown",this.outSideTrigger,!0),window.removeEventListener("touchstart",this.outSideTrigger,!0),(this.$input.getRootData("scrollContainer")||window).removeEventListener("scroll",this.handleScroll),isFirefox()&&window.removeEventListener("unload",this.handleUnload)}}])}(ApiCmpt);_BindWindowAction.template='<div id="ci-bind-window-action"></div>';var BindWindowAction=_BindWindowAction,OverflowDetector=function(){return _createClass((function e(){_classCallCheck(this,e),this.textareaStyleCache=null,this.measureEl=null,this.lastCheckedText="",this.lastObscuredResult=!1,this.lastAvailableWidth=0}),[{key:"measureTextOverflow",value:function(e,t,n){if(!t)return!1;if(!this.textareaStyleCache){var i=getComputedStyle(t);this.textareaStyleCache={fontSize:i.fontSize||"inherit",fontFamily:i.fontFamily||"inherit",fontWeight:i.fontWeight||"normal",lineHeight:i.lineHeight||"normal",singleLineHeight:parseFloat(i.lineHeight)||26}}this.measureEl&&this.measureEl.isConnected||(this.measureEl=document.createElement("span"),document.body.appendChild(this.measureEl)),this.measureEl.style.cssText="\n position: fixed;\n pointer-events: none;\n visibility: hidden;\n white-space: pre-wrap;\n word-break: break-all;\n width: ".concat(n,"px;\n font-size: ").concat(this.textareaStyleCache.fontSize,";\n font-family: ").concat(this.textareaStyleCache.fontFamily,";\n font-weight: ").concat(this.textareaStyleCache.fontWeight,";\n line-height: ").concat(this.textareaStyleCache.lineHeight,";\n "),this.measureEl.textContent=e+"​";var a=this.textareaStyleCache.singleLineHeight;return this.measureEl.offsetHeight>a}},{key:"checkContentObscured",value:function(e,t){var n;if(!e)return!1;if(!t||""===e.value.trim())return!1;var i=e.value,a=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=o.right-a.right,r=a.width+s+6;if(r-=o.width,r-=5,i===this.lastCheckedText&&r===this.lastAvailableWidth)return this.lastObscuredResult;if(this.lastCheckedText=i,this.lastAvailableWidth=r,this.measureTextOverflow(i,e,r))return this.lastObscuredResult=!0,!0;var l=(null==(n=this.textareaStyleCache)?void 0:n.singleLineHeight)||26,c=e.scrollHeight>l;return this.lastObscuredResult=c,c}},{key:"resetStyleCache",value:function(){var e;this.textareaStyleCache=null,(null==(e=this.measureEl)?void 0:e.parentNode)&&this.measureEl.parentNode.removeChild(this.measureEl),this.measureEl=null}},{key:"resetResultCache",value:function(){this.lastCheckedText="",this.lastObscuredResult=!1,this.lastAvailableWidth=0}},{key:"destroy",value:function(){this.resetStyleCache(),this.resetResultCache()}}])}();function isEditableTarget(e){return!!(e&&e instanceof Element)&&!!e.closest("input, textarea, select, [contenteditable]")}function setupSlashFocus(e){var t=function(t){"/"!==t.key||t.ctrlKey||t.metaKey||t.altKey||e.el&&e.el.contains(document.activeElement)||isEditableTarget(t.target)||isEditableTarget(document.activeElement)||(t.preventDefault(),e.focus())};return window.addEventListener("keydown",t),function(){return window.removeEventListener("keydown",t)}}var _PrefixPanelItem=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{input:{}}}},{key:"handleClick",value:function(e){var t,n=this;if(e.stopPropagation(),this.$input.sendLog("click","title_hover"),!1!==this.$input.getRootData("input.clearAiModeOnEmptyDelete")){var i=this.data.get("openPanelInfo")||{},a=this.data.get("input.prefix")||{},o=(null==(t=this.$input.getInputInfo())?void 0:t.prefix)||{},s=i.type||o.type||a.type||"";if(emitBeforePrefixChange(this.$input,{action:"exit",fromType:s,onContinue:function(){n.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:s,skipPrefixConfirm:!0})}}))return;this.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:s})}}}])}(ApiCmpt);_PrefixPanelItem.template='\n <span class="ci-prefix-wrapper" on-click="handleClick">\n <span class="ci-prefix" data-function-type="{{openPanelInfo.functionType}}">\n <span class="ci-prefix-text">{{prefixText}}</span>\n <img s-if="{{input.clearAiModeOnEmptyDelete !== false}}" src="https://gips3.baidu.com/it/u=3150997865,1151751010&amp;fm=3028&amp;app=3028&amp;f=PNG&amp;fmt=auto&amp;q=100&amp;size=f36_36" width="12" height="12">\n </span>\n </span>\n ',_PrefixPanelItem.computed={prefixText:function(){var e=this.data.get("openPanelInfo"),t=this.data.get("input.prefix")||{};return"deep_decision"===((null==e?void 0:e.type)||t.type)?(null==e?void 0:e.text)||DEEP_DECISION_DISPLAY_NAME:e.text||t.name||PREFIX_NAME_MAP[t.type]}};var PrefixPanelItem=_PrefixPanelItem,panelShowSendLog=!0,noOpenPanelType=[],_ChatInput=function(e){function t(){var e;return _classCallCheck(this,t),(e=_callSuper(this,t,arguments)).__registryComponentList={},e.panelDataMap=new Map,e.shouldIgnoreScrollBlur=!1,e._savedReference=null,e._needInitialFocus=!1,e._justGainedFocus=!1,e._justGainedFocusTimer=null,e._lastInputUserClickTime=0,e}return _inherits(t,e),_createClass(t,[{key:"initData",value:function(){return{initialFocus:!1,aiScene:AI_SCENE,aiMode:AI_MODE,query:"",aiPlaceholder:"",isSubmitButtonActive:!1,panelClass:"",reference:"",scene:AI_SCENE,samples:[],mode:"",panels:{position:"bottom"},tools:{},fileList:[],hasUsedVoiceInput:!1,input:{row:2,normalPlaceholder:"",overflowToMultiline:!1,keepMultiLineWithFile:!1},submitBtnPause:!1,openPanelInfo:{},inputUploadType:"",showAiSug:!1,showFileList:!0,prefix:{show:!1}}}},{key:"checkStatus",value:function(e){if(e===FIRE_EVENTS.SUBMIT){var t=this.getInputInfo().prefix;if(this.getValue().length<5&&t.type===ChatPanel.MUSIC)return this.$input.emit(EVENTS.TOAST_SHOW,"最少输入5个字"),!1}return!0}},{key:"processQuery",value:function(e,t){var n=this.$input.getValue();e.value=e.value||n;var i=t.placeholder,a=t.canSendPlaceholder;if(!e.value&&!n){var o=i===a;e.value=o?a:"",e.isPlaceholderSubmit=o}return e}},{key:"attached",value:function(){var e,t=this,n=new Main$m;n.attach(document.createElement("div")),this._toastInstance=n,this.$input.on(EVENTS.TOAST_SHOW,(function(e){var n,i,a,o="string"==typeof e?e:e.msg,s=(null==e?void 0:e.duration)||2e3;null==(n=t._toastInstance)||n.data.set("message",o),null==(i=t._toastInstance)||i.data.set("duration",s),null==(a=t._toastInstance)||a.show()})),this.$input.on(EVENTS.FILE_CHANGE,(function(e){var n=e.fileList,i=e.fileGuideWords;n&&t.data.set("fileList",n),i&&t.data.set("fileGuideWords",i),t.data.get("input.overflowToMultiline")&&t.checkOverflowToMultiLine()})),this.$input.on(EVENTS.DELETE_FILE,(function(e){t.ref("uploader").deleteFile(e)}));var i=throttle(this.checkOverflowToMultiLine.bind(this),500);this.$input.on(EVENTS.VALUE_CHANGE,(function(e){var n,a;if(!1!==(null==(n=null==e?void 0:e.options)?void 0:n.focus)){void 0!==e.prefix&&(t.data.set("input.prefix",e.prefix),t.data.set("prefix.show",null!=(a=e.prefix.show)&&a));var o=t.getValue();i(""===o)}})),this.$input.on(EVENTS.CLEAR,(function(){t.checkOverflowToMultiLine(!0)})),this.data.get("input.overflowToMultiline")&&(this.overflowDetector=new OverflowDetector),this.watch("input.overflowToMultiline",(function(e){var n;e?t.overflowDetector=new OverflowDetector:(null==(n=t.overflowDetector)||n.destroy(),t.overflowDetector=void 0)})),this.$input.on(EVENTS.INPUT_STATUS_CHANGE,(function(e){var n,i,a,o;if(!t._isLineTransitioning){var s=e.status,r=t.data.get("input.focusToMultiLine"),l=t.data.get("input.overflowToMultiline");switch(s){case"focus":t._skipLineTransition=!0,r&&!l&&t.toggleSingleOrMultiLine(INPUT_LINE_MODE.MULTI),t._skipLineTransition=!1,r&&l&&t.checkOverflowToMultiLine(),t.data.set("initialFocus",!0);break;case"blur":var c=(t.data.get("fileList")||[]).length>0,d=!0===t.data.get("input.keepMultiLineWithFile");r&&(!c||!d)&&t.toggleSingleOrMultiLine(INPUT_LINE_MODE.SINGLE),null==(n=t.voiceController)||n.forceStopRecording(),t.data.set("initialFocus",!1)}void 0!==e.prefix&&(t.data.set("input.prefix",e.prefix),t.data.set("prefix.show",null!=(i=e.prefix.show)&&i)),e.prefix&&!e.prefix.show||("blur"===s?t.closePanel({}):"focus"!==s||e.source!==FOCUS_SOURCE.USER_CLICK||(null==(a=e.prefix)?void 0:a.blockOpenPanel)||(null==(o=e.prefix)?void 0:o.noOpenPanel)||noOpenPanelType.includes(e.prefix.type)||t.handlePanelChange({open:!0}))}})),this.$input.on(EVENTS.SHOW_PREFIX,(function(e){t.data.set("prefix.show",!0);var n=t.data.get("tools.left.modeSelect.current")===TASK_MODE_NAME||FILE_PANEL_TYPES.indexOf(e.type)>-1;if(t.data.set("showFileList",n),!n&&t.data.get("fileList").length&&t.fire(FIRE_EVENTS.FILE_CHANGE,[]),!REFERENCE_NON_EXCLUSIVE_PANEL_TYPES.includes(e.type)){var i=t.data.get("reference");i&&t._isFileReference(i)&&(t._savedReference=i,t.data.set("reference",null))}})),this.$input.on(EVENTS.CLEAR,(function(e){!t.data.get("showFileList")&&t.data.get("fileList").length&&t.fire(FIRE_EVENTS.FILE_CHANGE,t.data.get("fileList")),e.clearAll&&t.data.set("showFileList",!0)})),this.setupVoiceController(),this.setupSpaceVoice(),this.watch("input.row",(function(e,n){var i,a,o=n.oldValue;if(!t._skipLineTransition&&null!=o&&e!==o&&t.data.get("input.lineTransition")){var s=null==(i=t.el)?void 0:i.querySelector("#ci-main .ci-wrapper .ci-container"),r=null!=(a=null==s?void 0:s.offsetHeight)?a:0;if(s&&r){t.startLineTransitionLock();var l=t.data.get("openPanel");o>e&&l&&t.handlePanelChange({open:!1}),t.performLineTransition(r)}}})),this.watch("isSingleLine",(function(e){!1===e&&t.data.get("tools.left.askAi")&&t.fire(FIRE_EVENTS.SEND_LOG,{type:"show",value:"deepsearch_btn"})})),this.watch("fileList",(function(e){t.fire(FIRE_EVENTS.FILE_CHANGE,e)})),this.setupRootHeightSync(),this.$input.on(EVENTS.PANEL_OPEN,(function(e){t.data.set("openPanelInfo",e.panel)})),this.$input.on(EVENTS.PANEL_CLOSE,(function(e){var n;t.data.set("openPanelInfo",{}),(null==e?void 0:e.detach)?t.$input.detachPanel():null==(n=t.ref("panels"))||n.fire("panel-change",{open:!1})})),this.watch("openPanelInfo",(function(e){t.fire(FIRE_EVENTS.PANEL_CHANGE,e)})),this.watch("openPanelType",(function(e,n){var i=n.oldValue;!e&&i&&t._savedReference&&(t.data.set("reference",t._savedReference),t._savedReference=null)})),this.$input.on(EVENTS.AI_SUG_CHANGE,(function(e){t.data.set("showAiSug",e.show)})),this._needInitialFocus=null!=(e=this.data.get("input.needInitialFocus"))&&e,this._needInitialFocus&&this.nextTick((function(){t.focus({source:FOCUS_SOURCE.INITIAL}),t._needInitialFocus=!1}));var a=this.ref("input"),o=a.currentInput();document.activeElement===o&&this.nextTick((function(){t.nextTick((function(){document.activeElement===o&&a.inputChange("focus")}))})),this.data.get("input.focusOnSlash")&&(this._slashFocusCleanup=setupSlashFocus({el:this.el,focus:function(){return t.focus({source:FOCUS_SOURCE.USER_CLICK})}}))}},{key:"resetJustGainedFocus",value:function(){this._justGainedFocus=!1,null!==this._justGainedFocusTimer&&(clearTimeout(this._justGainedFocusTimer),this._justGainedFocusTimer=null)}},{key:"consumeJustGainedFocusIfNeeded",value:function(){return!!this._justGainedFocus&&(this.resetJustGainedFocus(),!0)}},{key:"getValue",value:function(e){if(this.el)return this.ref("input").getValue(e)}},{key:"getPlaceholder",value:function(){if(this.el)return this.ref("input").getPlaceholder()}},{key:"setValue",value:function(e){this.el&&this.ref("input").setValue(e)}},{key:"resizeTextarea",value:function(e){var t,n=!(arguments.length>1&&arguments[1]!==undefined)||arguments[1];this.el&&(null==(t=this.ref("input"))||t.resizeTextarea(e,n))}},{key:"clearValue",value:function(e){var t=e.keepPrefix,n=void 0!==t&&t;if(this.el)return this.ref("input").clearValue({keepPrefix:n})}},{key:"getInputInfo",value:function(){return this.el?this.ref("input").getInputInfo():{}}},{key:"focus",value:function(e){var t=this;if(this.el){(null==e?void 0:e.source)===FOCUS_SOURCE.INITIAL&&(this._justGainedFocus=!0,null!==this._justGainedFocusTimer&&clearTimeout(this._justGainedFocusTimer),this._justGainedFocusTimer=setTimeout((function(){t.resetJustGainedFocus()}),1e3));var n=document.activeElement;this.el.contains(n)?this.ref("input").inputChange("focus",e):this.ref("input").focus(e)}}},{key:"blur",value:function(){this.el&&this.ref("input").blur()}},{key:"setPrefix",value:function(e,t){return __async(this,null,_regenerator().m((function n(){var i,a,o,s;return _regenerator().w((function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,i=this.$input.getModeBtnName(),n.n=1,this.$input.getPanelData(e,i);case 1:a=n.v,o=a.panel,this.$input.setAiPlaceholder(e,i),this.data.set("openPanelInfo",o),this.$input.emit(EVENTS.SHOW_PREFIX,__spreadValues({name:getPanelDisplayText(o),type:o.type,blockOpenPanel:!0},t)),n.n=3;break;case 2:n.p=2,s=n.v,console.error("找不到panel数据",s);case 3:return n.a(2)}}),n,this,[[0,2]])})))}},{key:"getPanel",value:function(){return this.data.get("openPanelType")?this.data.get("openPanelInfo"):null}},{key:"closePanel",value:function(e){this.handlePanelChange(__spreadValues({open:!1},e))}},{key:"hideSug",value:function(){this.$input.emit(EVENTS.HIDE_SUG,{mode:this.data.get("mode")})}},{key:"initPanelData",value:function(e,t){t=this.$input.getModeBtnName(t);var n=new Map;e.forEach((function(e){n.set(e.type,{modeName:t,data:e})})),this.panelDataMap.set(t,n)}},{key:"clickPanelBtn",value:function(e){if(!e)return!1;var t=(this.data.get("panels.list")||[]).find((function(t){return t.button_id===e}));if(!t)return!1;var n=this.getPanelBtnList();return!!(null==n?void 0:n.handleClickPanelBtn)&&(n.handleClickPanelBtn({panel:t,area:"url"}),!0)}},{key:"getPanelBtnList",value:function(){var e;if(this.data.get("panels.capsuleInside")){var t=this.ref("tools");return null==(e=null==t?void 0:t.ref("left-tools"))?void 0:e.ref("panel-btn-list")}return this.ref("panelBtnList")}},{key:"initPanelOptions",value:function(e,t){this.data.get("panelOptions.".concat(e))||this.data.set("panelOptions.".concat(e),t)}},{key:"updatePanelShrinkStatus",value:function(e){var t=this.data.get("panels.capsuleInside")&&e<=LEFT_TOOLS_ICON_ONLY_WIDTH,n=e<=400,i=e<=450;this.data.set("tools.left.shrinkStatus",{draw:t||n,model:t||i,music:t||e<450,translate:t||e<440}),this.$input.updatePanelProps({panelWidth:e})}},{key:"uploadFile",value:function(e){this.ref("uploader").uploadFile(e)}},{key:"handleUpload",value:function(e){this.ref("uploader").uploadFile(e)}},{key:"addFiles",value:function(e){this.ref("uploader").addFiles(e)}},{key:"getFileList",value:function(){return this.data.get("showFileList")?(this.data.get("fileList")||[]).filter((function(e){return 2===e.status})):[]}},{key:"setBaidubceSdk",value:function(e){this.__baidubceSdkPromise=e}},{key:"setState",value:function(e,t){var n=this.data.get(e),i="function"==typeof t?t(n):t;this.data.set(e,i)}},{key:"getReference",value:function(){return this.data.get("reference")}},{key:"setReference",value:function(e){e&&this.data.get("openPanelType")&&this._isFileReference(e)?this._savedReference=e:this.data.set("reference",e)}},{key:"_handleReferenceClose",value:function(){this.data.set("reference",null),this._savedReference=null}},{key:"_isFileReference",value:function(e){return!!(null==e?void 0:e.fileId)}},{key:"doBindWindowAction",value:function(e,t){this.ref("bindWindowAction")[e](t)}},{key:"registryComponent",value:function(e,t,n,i){return this.__registryComponentList||(this.__registryComponentList={}),this.__registryComponentList[e]=t,n&&this.renderComponent(e,n,i)}},{key:"renderComponent",value:function(e,t,n){var i=new this.__registryComponentList[e]({data:__spreadValues({},n)}),a=document.createElement("div");return i.$input=this.$input,i.attach(a),t.appendChild(a),i}},{key:"trigger",value:function(e,t){this.fire(e,t)}},{key:"checkOverflowToMultiLine",value:function(){var e,t,n,i,a,o=arguments.length>0&&arguments[0]!==undefined&&arguments[0];if(this.data.get("input.overflowToMultiline")){var s=this.data.get("fileList");if((null==s?void 0:s.length)>0){var r=!!this.el&&(null==(t=null==(e=this.el)?void 0:e.contains)?void 0:t.call(e,document.activeElement));this.toggleSingleOrMultiLine(r?INPUT_LINE_MODE.MULTI:INPUT_LINE_MODE.SINGLE)}else if(o)null==(n=this.overflowDetector)||n.resetResultCache(),this.toggleSingleOrMultiLine(INPUT_LINE_MODE.SINGLE);else if(this.checkContentObscured())this.toggleSingleOrMultiLine(INPUT_LINE_MODE.MULTI);else{var l=this.data.get("input.row"),c=this.data.get("samples")||[],d=c.indexOf("PC_HOME_CHAT_INPUT_NEXT")>-1||c.indexOf("PC_HOME_CHAT_INPUT_NEXT_IMG2")>-1,u=null==(a=null==(i=this.ref("input"))?void 0:i.currentInput)?void 0:a.call(i),p=u&&u.value.trim().length>0;d&&l>1&&p||this.toggleSingleOrMultiLine(INPUT_LINE_MODE.SINGLE)}}}},{key:"checkContentObscured",value:function(){var e,t,n,i,a,o,s,r=null==(e=this.ref("input"))?void 0:e.currentInput();if(!r)return!1;var l=null==(t=this.el)?void 0:t.querySelector(".ci-tool"),c=null==(n=this.el)?void 0:n.querySelector("#ci-main");return(null==(i=null==c?void 0:c.classList)?void 0:i.contains("two-line-input"))&&(l=null==(a=this.el)?void 0:a.querySelector(".right-tools-wrapper")),null==(s=null==(o=this.overflowDetector)?void 0:o.checkContentObscured)?void 0:s.call(o,r,l)}},{key:"toggleSingleOrMultiLine",value:function(e){var t=this.data.get("input.focusToMultiLine"),n=this.data.get("input.overflowToMultiline");if(t||n){var i=_defineProperty(_defineProperty({},INPUT_LINE_MODE.SINGLE,1),INPUT_LINE_MODE.MULTI,2);this._skipLineTransition=!0,this.data.set("input.row",i[e]),this._skipLineTransition=!1}}},{key:"startLineTransitionLock",value:function(){this._isLineTransitioning=!0,this.el.style.pointerEvents="none"}},{key:"endLineTransitionLock",value:function(){this._isLineTransitioning=!1,this.el.style.pointerEvents=""}},{key:"performLineTransition",value:function(e){var t=this;this._lineTransitionTimer&&clearTimeout(this._lineTransitionTimer);var n=this.el.querySelector("#ci-main .ci-wrapper .ci-container");if(n){var i=(this.data.get("fileList")||[]).length>0?LINE_FILE_TRANSITION_DURATION:LINE_TRANSITION_DURATION,a=this.el.querySelector("#ci-main .ci-wrapper .ci-container .ci-tool");a.style.transition="all ".concat(i,"ms ease"),n.style.height="".concat(e,"px"),n.style.overflow="hidden",this.nextTick((function(){requestAnimationFrame((function(){n.style.height="auto",n.offsetHeight;var o=n.offsetHeight;n.style.height="".concat(e,"px"),n.offsetHeight,n.style.transition="height ".concat(i,"ms ease"),n.style.height="".concat(o,"px"),t._lineTransitionTimer=window.setTimeout((function(){n.style.height="",n.style.overflow="",n.style.transition="",a.style.transition="",t.endLineTransitionLock()}),i)}))}))}else this.endLineTransitionLock()}},{key:"setupVoiceController",value:function(){this.voiceController=new VoiceInputController({$input:this.$input})}},{key:"setupSpaceVoice",value:function(){var e=this.data.get("tools.right.voice");(null==e?void 0:e.spaceVoice)&&(this.spaceVoiceController=new SpaceVoiceController({$input:this.$input}),this.spaceVoiceController.init())}},{key:"showVoiceTip",value:function(){this.$input.emit(EVENTS.VOICE_TIP_SHOW)}},{key:"hideVoiceTip",value:function(){this.$input.emit(EVENTS.VOICE_TIP_HIDE)}},{key:"handleBottomSearch",value:function(){var e;if(null==(e=this.ref("uploader"))?void 0:e.data.get("loading"))this.$input.emit(EVENTS.TOAST_SHOW,{msg:"文件上传中"});else{var t=this.getInputInfo(),n={value:t.value||""},i=t.placeholder,a=t.canSendPlaceholder;if(!n.value){var o=i===a;n.value=o?a:"",n.isPlaceholderSubmit=o}this.$input.emit(EVENTS.VOICE_INPUT_STOP),this.$input.emit(EVENTS.HIDE_SUG),this.fire(FIRE_EVENTS.SUBMIT,n),this.$input.sendLog("click","search_kuang",{pos:"se_btn"})}}},{key:"handleWheel",value:function(e){for(var t,n=this.el,i=e.target;i&&i!==n;){var a=window.getComputedStyle(i),o="auto"===a.overflowY||"scroll"===a.overflowY,s="auto"===a.overflowX||"scroll"===a.overflowX,r=i.scrollHeight>i.clientHeight,l=i.scrollWidth>i.clientWidth;if(o&&r||s&&l){var c=e.deltaY,d=i.scrollTop,u=i.scrollHeight,p=i.clientHeight;return void((d<=0&&c<0||d+p>=u&&c>0)&&(e.preventDefault(),e.stopPropagation()))}i=i.parentElement}var h=e.deltaY;e.preventDefault(),e.stopPropagation();var f=null==(t=this.ref("input"))?void 0:t.currentInput();f&&(f.scrollTop+=h)}},{key:"setupRootHeightSync",value:function(){var e=this;this.nextTick((function(){var t=e.el.querySelector(".ci-container"),n=e.el,i=e.el.querySelector(".ci-wrapper-border");if(t&&n){var a=1.5;if(i){var o=window.getComputedStyle(i),s=parseFloat(o.borderTopWidth);a=s%1!=0&&window.devicePixelRatio<2?Math.floor(s):s}var r=2*a;"undefined"!=typeof ResizeObserver&&(e.__resizeObserver=new ResizeObserver((function(){requestAnimationFrame((function(){!function(){var n=e.data.get("input.lineTransition"),i=t.offsetHeight,a=i+(n?3:r);e.fire(FIRE_EVENTS.HEIGHT_CHANGE,{border:r,input:i,root:a}),e.data.get("bottomSearchBtn")&&e.data.set("bottomBtnTop",a+32)}()}))})),e.__resizeObserver.observe(t))}}))}},{key:"handlePanelChange",value:function(e){var t,n,i,a,o,s,r,l,c=e.open,d=e.removeHeight,u=this.data.get("isPanelTop"),p=this.data.get("initialFocus"),h=this.data.get("openPanelType");if((this.data.get("panels.list")||[]).length){if(c&&p){if(!this.currentPanelInstance&&h)return void this.$input.openPanel(h);this.data.set("panelClass","ci-panel-expand"),this.data.get("mode")===AI_MODE?(this.data.set("panelStyle","max-height:".concat(u?377:358,"px;")),null==(n=(t=this.currentPanelInstance).open)||n.call(t)):this.data.set("panelStyle","max-height:600px;")}else d?this.data.set("panelStyle",""):this.data.set("panelStyle","max-height:0;");if(this.data.set("openPanel",c),c&&panelShowSendLog&&h){panelShowSendLog=!1;var f=this.data.get("panels.list")||[],m=f.find((function(e){return e.type===h}))||f.find((function(e){return e.type==="new_".concat(h)})),g=(null==(a=null==(i=m.jump_panel)?void 0:i.data)?void 0:a[h])||(null==(s=null==(o=m.jump_panel)?void 0:o.data)?void 0:s["new_".concat(h)])||{},_=(null==g?void 0:g.list)||(null==(r=null==g?void 0:g.tools)?void 0:r.list)||(null==(l=null==g?void 0:g.fortune_direction)?void 0:l.list)||[],v=null==_?void 0:_.map((function(e,t){return{function_name:e.button_id,function_pos:t+1,function_click_type:"text",agent_id:"",agent_name:""}}));this.$input.sendLog("show","function_panel",{function_tab:"all",trigger_type:"search_box",agent_id:"",agent_name:"",valueInfo:v},!0),setTimeout((function(){panelShowSendLog=!0}),300)}}}},{key:"setMode",value:function(e){var t=e?AI_MODE:"";t!==this.data.get("mode")&&(this.data.set("mode",t),this.ref("input").setMode(t),e||(this.hideSug(),this.closePanel({removeHeight:!0})))}},{key:"getToolInfo",value:function(e,t){var n=this.ref("tools");if(!n)return null;var i=n.ref("".concat(e,"-tools"));return i?i.getToolInfo(t):null}},{key:"setToolInfo",value:function(e,t,n){var i=this.ref("tools");if(i){var a=i.ref("".concat(e,"-tools"));a&&a.setToolInfo(t,n)}}},{key:"submitBtnStatus",value:function(e){this.data.set("submitBtnStatus",e)}},{key:"_handleConClick",value:function(e){var t,n,i=this.ref("input").currentInput();if(!this.__isBluring&&"noAgain"!==(null==(t=e.target.dataset)?void 0:t.focusInput))if(e.target===e.currentTarget){if(this.consumeJustGainedFocusIfNeeded())return;if(document.activeElement===i)return;this._lastInputUserClickTime=Date.now(),this.focus({source:FOCUS_SOURCE.USER_CLICK})}else{for(var a=i.contains(e.target),o=!1,s=e.target;s&&s!==e.currentTarget;){if(null==(n=s.dataset)?void 0:n.focusInput){o=!0;break}s=s.parentElement}(a||o)&&(this.consumeJustGainedFocusIfNeeded(),this._needInitialFocus&&(this._needInitialFocus=!1),this._lastInputUserClickTime=Date.now(),this.focus({source:FOCUS_SOURCE.USER_CLICK}))}}},{key:"_handleMainMousedown",value:function(e){for(var t,n,i=e.target;i&&i!==e.currentTarget;){if(null==(t=i.dataset)?void 0:t.noFocusInput)return void e.stopPropagation();i=i.parentElement}var a=this.ref("input").currentInput(),o=a.contains(e.target),s=this.data.get("isChatSearch")||(null==(n=this.data.get("input.prefix"))?void 0:n.type);o||document.activeElement!==a||(e.preventDefault(),e.stopPropagation()),!s&&this.fire(FIRE_EVENTS.SEND_LOG,{type:"click",value:"search_kuang",ext:{query:this.getValue(),pos:"searchbox"}})}},{key:"queryOverShow",value:function(){var e,t;return null==(t=null==(e=this.ref("tools"))?void 0:e.ref("left-tools"))?void 0:t.data.get("isOverWord")}},{key:"reset",value:function(){var e,t,n=this,i=(arguments.length>0&&arguments[0]!==undefined?arguments[0]:{}).clearAll,a=void 0!==i&&i,o=this.data.get("isChatSearch"),s=null==(t=null==(e=this.getInputInfo())?void 0:e.prefix)?void 0:t.type,r=this.ref("input");r.reset(),o?(this.closePanel({}),this.setReference(""),a?(this.$input.emit(EVENTS.CLEAR,{clearAll:!0,prefixType:s}),this.nextTick((function(){return n.focus()}))):(this.$input.clearValue({keepPrefix:!0}),r.data.set("prefix.blockOpenPanel",!0),r.handleInput(),this.focus())):this.blur(),this.data.set("fileList",[]),this._savedReference=null}},{key:"disposed",value:function(){var e,t,n,i;null==(e=this.voiceController)||e.forceStopRecording(),null==(t=this.spaceVoiceController)||t.destroy(),this.__translogInstance.destroy(),this._toastInstance&&(this._toastInstance.dispose(),this._toastInstance=void 0),this.__resizeObserver&&(this.__resizeObserver.disconnect(),this.__resizeObserver=void 0),this._lineTransitionTimer&&clearTimeout(this._lineTransitionTimer),null==(n=this.overflowDetector)||n.destroy(),this._savedReference=null,null==(i=this._slashFocusCleanup)||i.call(this),this._slashFocusCleanup=void 0}}])}(ApiCmpt);_ChatInput.template='\n <div\n class="ci-root\n {{isChatSearch ? \'ci-ai-search\' : \'\'}}\n ci-position-{{panels.position}}\n {{openPanel || showAiSug ? \'ci-open-panel\' : \'ci-close-panel\'}}\n {{input.row === 1 && input.overflowToMultiline ? \'active-single-line\' : \'\'}}\n {{isHomeScene ? \'ci-scene-home\' : \'\'}}\n {{isResultScene ? \'ci-scene-result\' : \'\'}}\n {{panels.capsuleInside ? \'ci-capsule-inside\' : \'\'}}\n {{tools.left && tools.left.modeSelect ? \'ci-mode-select\' : \'\'}}\n "\n on-wheel="handleWheel"\n on-mousedown="_handleMainMousedown"\n >\n <div\n id="ci-main"\n class="\n {{input.row > 1 ? \'two-line-input\': \'one-line-input\'}}\n {{initialFocus ? \'ci-main-focus\': \'\'}}\n {{fileList.length ? \'ci-have-file\' : \'\'}}\n {{input.lineTransition ? \'ci-line-transition\' : \'\'}}\n "\n >\n <div class="ci-op-anime"></div>\n <div class="ci-wrapper-border {{isChatSearch ? \'ci-wrapper-border-ai-search\' : \'\'}}"></div>\n <div class="ci-wrapper-box-shadow"></div>\n <div class="ci-wrapper {{mode === aiMode ? \'ci-ai-wrapper\' : \'ci-normal-wrapper\'}}">\n <div\n s-if="{{isPanelTop}}"\n id="ci-panel"\n s-ref="panel"\n class="{{panelClass}} ci-panel-{{panels.position}}"\n style="{{panelStyle}}"\n ></div>\n <fragment s-if="{{isPanelTop && !openPanel}}">\n <panel-btn-list\n s-if="{{!showAiSug && !panels.capsuleInside}}"\n s-ref="panelBtnList"\n sug="{{sug}}"\n scene="{{scene}}"\n mode="{{mode}}"\n panels="{{panels}}"\n user="{{user}}"\n input="{{input}}"\n />\n <ai-sug s-if="scene === aiScene" position="top" showSug="{{showAiSug}}" />\n </fragment>\n <slot name="optimizer-loading-mask"></slot>\n <div class="ci-container" on-click="_handleConClick">\n <div id="ci-top-band">\n <file\n s-if="!isSingleLine && showFileList"\n fileList="{{fileList}}"\n file-guide-words="{{fileGuideWords}}"\n upload="{{upload}}"\n open-panel-type="{{openPanelType}}"\n merge-upload="{{tools.right && tools.right.mergeFileImageUpload}}"\n />\n <reference reference="{{reference}}" on-close="_handleReferenceClose" />\n </div>\n <div class="ci-file-input-wrapper">\n <prefix-panel-item\n s-if="isSingleLine && openPanelType"\n input="{{input}}"\n open-panel-info="{{openPanelInfo}}"\n />\n <single-file-item\n s-if="isSingleLine && showFileList && fileList.length"\n file-list="{{fileList}}"\n file-type="{{fileType}}"\n />\n <ci-input\n s-ref="input"\n scene="{{scene}}"\n input="{{input}}"\n mode="{{mode}}"\n upload="{{upload}}"\n file-list="{{fileList}}"\n panels="{{panels}}"\n samples="{{samples}}"\n />\n </div>\n <tools\n s-ref="tools"\n input="{{input}}"\n tools="{{tools}}"\n scene="{{scene}}"\n is-chat-search="{{isChatSearch}}"\n is-single-line="{{isSingleLine}}"\n file-list="{{fileList}}"\n file-type="{{fileType}}"\n open-panel-type="{{openPanelType}}"\n position="{{panels.position}}"\n submit-btn-status="{{submitBtnStatus}}"\n input-upload-type="{{inputUploadType}}"\n panel-options="{{panelOptions}}"\n upload="{{upload}}"\n hover-text="{{hoverText}}"\n panels="{{panels}}"\n sug="{{sug}}"\n mode="{{mode}}"\n user="{{user}}"\n open-panel="{{openPanel}}"\n prefix-show="{{prefix.show}}"\n />\n </div>\n <div\n s-if="{{!isPanelTop}}"\n id="ci-panel"\n s-ref="panel"\n class="{{panelClass}} ci-panel-{{panels.position}}"\n style="{{panelStyle}}"\n ></div>\n <ai-sug s-if="{{!isPanelTop && scene === aiScene}}" position="bottom" show-sug="{{showAiSug}}" />\n </div>\n </div>\n <div s-if="{{bottomSearchBtn && !bottomBtnHidden}}"\n class="ci-bottom-search-btn"\n style="top: {{bottomBtnTop}}px"\n >\n <button on-click="handleBottomSearch"><img src="https://psstatic.cdn.bcebos.com/basics/aichat/search_1777004337000.png" alt="">百度一下</button>\n </div>\n <panel-btn-list\n s-if="{{!isPanelTop && !panels.capsuleInside}}"\n s-ref="panelBtnList"\n sug="{{sug}}"\n scene="{{scene}}"\n mode="{{mode}}"\n panels="{{panels}}"\n input="{{input}}"\n user="{{user}}"\n />\n <uploader\n s-ref="uploader"\n upload="{{upload}}"\n file-list="{{fileList}}"\n file-guide-words="{{fileGuideWords}}"\n />\n <bind-window-action s-ref="bindWindowAction" />\n </div>\n ',_ChatInput.components={tools:Main$8,file:Main$2,"ci-input":Main$7,"panel-btn-list":Main$b,reference:Main$5,"ai-sug":Main$1,uploader:Main,"single-file-item":SingleFileItem,"bind-window-action":BindWindowAction,"prefix-panel-item":PrefixPanelItem},_ChatInput.__ciroot=!0,_ChatInput.computed={isChatSearch:function(){return this.data.get("scene")===AI_SCENE},isHomeScene:function(){var e=this.data.get("scene"),t=this.data.get("samples")||[];return"home"===e&&(t.indexOf("PC_HOME_CHAT_INPUT_NEXT")>-1||t.indexOf("PC_HOME_CHAT_INPUT_NEXT_IMG2")>-1)},isResultScene:function(){var e=this.data.get("scene"),t=this.data.get("samples")||[];return"home"!==e&&e!==AI_SCENE&&(t.indexOf("PC_HOME_CHAT_INPUT_NEXT")>-1||t.indexOf("PC_HOME_CHAT_INPUT_NEXT_IMG2")>-1)},isPanelTop:function(){return"top"===this.data.get("panels").position},isSingleLine:function(){return 1===this.data.get("input.row")},fileType:function(){var e=this.data.get("fileList");return e.length?e[0].uploadType:""},openPanelType:function(){var e=this.data.get("openPanelInfo"),t=this.data.get("input.prefix");return(null==e?void 0:e.type)||(null==t?void 0:t.type)},bottomBtnHidden:function(){return(this.data.get("fileList")||[]).length>0}},_ChatInput.messages={"ci-common":function(e){var t,n,i=this;if(this.el){var a=e.value;if(this.checkStatus(a.name))if("submit"!==a.name&&a.name!==FIRE_EVENTS.WENXIN_SUBMIT||!(null==(t=this.ref("uploader"))?void 0:t.data.get("loading")))if(a.name!==FIRE_EVENTS.WENXIN_SUBMIT){var o=this.data.get("isChatSearch"),s=this.getInputInfo(),r=this.processQuery(a.data||{},s);if("submit"===a.name&&!o){this.__isBluring=!0,this.$input.blur(),this.nextTick((function(){i.__isBluring=!1}));var l=this.data.get("fileList");if(l&&l.length>0||(null==(n=s.prefix)?void 0:n.type))return void go2AiChat(r.value,"file",this.$input)}[FIRE_EVENTS.SUBMIT,FIRE_EVENTS.SUG_CLICK].includes(a.name)&&(this.$input.emit(EVENTS.VOICE_INPUT_STOP),this.$input.emit(EVENTS.HIDE_SUG)),this.fire(a.name,r)}else{var c=this.getInputInfo().value||"",d=this.data.get("samples")||[],u=d.indexOf("PC_HOME_CHAT_INPUT_NEXT")>-1||d.indexOf("PC_HOME_CHAT_INPUT_NEXT_IMG2")>-1;go2AiChat(c,"wenxin",this.$input,u?{openInNewTab:!0}:void 0)}else this.$input.emit(EVENTS.TOAST_SHOW,{msg:"文件上传中"})}}};var ChatInput=_ChatInput;exports.AI_MODE=AI_MODE,exports.AI_SCENE=AI_SCENE,exports["default"]=ChatInput,exports.noOpenPanelType=noOpenPanelType,Object.defineProperties(exports,_defineProperty({__esModule:{value:!0}},Symbol.toStringTag,{value:"Module"}))},"object"==_typeof(exports)?t(exports,san):t((e="undefined"!=typeof globalThis?globalThis:e||self).ChatInput={},e.san)})(chatInput_umd,chatInput_umd.exports);var chatInput_umdExports=chatInput_umd.exports,ChatInput=headScript_pc_static_index.getDefaultExportFromCjs(chatInput_umdExports),SearchBoxController=function(){function e(){this.disableSubmit=!1,this.kwVal="",this.inputStatus="",this.options={},this.chatInputIns=null}return e.prototype.initSug=function(e){this.options=e,this.globalFuncInit(e.URL),this.initURLChange(e),this.initChatInput()},e.prototype.initChatInput=function(){var e=this;if(document.querySelector(".ci-anchor,.ci-root")&&1===window.pageState)this.initNewChatInput();else{this.initOldChatInput();var t=$("#main-wrapper");t.length&&t.on("smartInputRerender",(function(){e.initOldChatInput()}))}},e.prototype.initOldChatInput=function(){var e=this,t=$("#main-wrapper #chat-input-main #chat-textarea"),n=$("#ci-main #chat-textarea");t.data("sugInputBound")||n.data("sugInputBound")||(t.on("inputChange",(function(t,n){var i=document.getElementById("kw");e.onSugInputChange(n,i,e.options)})),n.on("inputChange",(function(t){var n=document.getElementById("kw");e.onSugInputChange({value:n.value,imt:{diffLog:function(){return[]},getLog:function(){return[]}},queryValue:n.value,dataCached:{},stopRefresh:!1},n,e.options)})),t.on("selectSug",(function(t,n,i,a){e.onSugSelect(i,a,n,e.options)})),t.data("sugInputBound",1),n.data("sugInputBound",1),t.on("focus",(function(){e.changeSubmitState()})),$("#main-wrapper").on("mousedown",(function(){e.changeSubmitState()})))},e.prototype.initNewChatInput=function(){var e=this,t=document.querySelector(".ci-anchor,.ci-root"),n=new ChatInput({el:t});if(this.chatInputIns=n,n){n.setBaidubceSdk((function(){return new Promise((function(e){require(["@baiducloud/sdk/dist/baidubce-sdk.bundle.min"],(function(t){e(t)}))}))})),n.on("submit",(function(t){var n=null==t?void 0:t.triggerType;"enter"!==n&&"click"!==n||(headScript_pc_static_index.BDSInstance.comm.submitType=n),$("#form").trigger("submit"),e.changeSubmitState()})),n.on("sug-click",(function(t){headScript_pc_static_index.BDSInstance.comm.submitType="click",$("#form").trigger("submit"),e.changeSubmitState()})),n.on("sug-select",(function(t){e.onSugSelect(t[1],t[2],t[0],e.options)}));var i=document.getElementById("kw");n.on("input-change",(function(t){e.onSugInputChange(t.sug,i,e.options)})),n.on("send-log",(function(e){var t=e.type,n=e.value,i=e.ext;headScript_pc_static_pageLog_ubcLog.sendUbcLog(18463,t,n,i)}))}},e.prototype.updateChatInputWd=function(){if(this.chatInputIns&&1===bds.comm.resultPage)try{var e=new URL(location.href).searchParams,t=e.get("wd")||e.get("word")||"";this.chatInputIns.getValue()!==t&&this.chatInputIns.setValue(t)}catch(n){console.warn(n)}},e.prototype.globalFuncInit=function(e){var t=this;window.getCursortPosition=headScript_pc_static_index.getCursorPosition,window.form_submit=function(n){return t.formSubmit(n,e)},$.limitWd=headScript_pc_static_index.truncateQuery,$.subByte=headScript_pc_static_index.subByte},e.prototype.formSubmit=function(e,t){var n=headScript_pc_static_index.BDSInstance.comm.resultPage&&this.chatInputIns&&document.querySelector("#chat-textarea"),i=n?document.querySelector("#chat-textarea"):document.getElementById("kw"),a=n?this.chatInputIns.getValue():"";if(!t.support())return!0;if(this.disableSubmit)return!1;this.disableSubmit=!0,i.blur(),updateKwTip("");var o=document.getElementById("form");if(null==o?void 0:o.getAttribute("target"))return!0;globalVariables.afterUserSubmit=!0,globalVariables.afterUserSubmitTimeout=setTimeout((function(){globalVariables.afterUserSubmit=!1}),1e3);try{var s=i.getAttribute("placeholder")||$(".kw-placeholder").text();if((n&&!a.trim()||!i.value.trim())&&!s)return location.href="/",!1;var r=new PageEnv;$(this).serializeArray().forEach((function(e){var t=e.name,n=e.value;r.setParams(t,n)})),s&&(n&&!a.trim()||!i.value.trim())?(r.setParams("wd",s),r.setParams("rsv_dq",1)):(n&&a.trim()||i.value.trim())&&r.setParams("wd",n?a:i.value),r.getParams("nojc")&&r.setParams("nojc","");var l=globalVariables.currentCacheItem;if(l){if(r.equals(l.env.getClonePageEnvInstance({wd:l.real_wd}))&&!l.force)return genSendConfirm(l,22,{URL:t})(),l.force=!0,updateKwTip(""),updateJc(l),!1;var c=l.env.getParams("rsv_spt");c&&r.setParams("rsv_spt",c)}t.submit(r,!!e)}catch(d){console.warn("formSubmit error",d.message)}return!1},e.prototype.onSugInputChange=function(e,t,n){var i=this.kwVal,a=null;updateKwTip(""),resetMouseSetting();var o=globalVariables.disablePreload,s=globalVariables.disablePredict,r=globalVariables.inputStopTimer,l=globalVariables.checktimer;if(clearTimeout(r),clearTimeout(l),!(0===window.pageState&&window.__disable_index_predict||o||s||speedRobot.isSlow())){var c=new PageEnv({pn:"",wd:e.value});if(1===headScript_pc_static_index.BDSInstance.comm.logFlagSug&&c.setParams("rsv_slog","ipt_change"),0===window.pageState&&headScript_pc_static_index.BDSInstance.comm.supportis&&t.value.trim()){swapToResult(c);var d=$("<div id='ent_sug'>请按“回车”键发起检索</div>").insertBefore(".s_form");headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){d.remove()}),{once:!0})}if(globalVariables.cancelNextInputChange)globalVariables.cancelNextInputChange=!1;else{if(window.__restart_confirm_timeout){var u=globalVariables.sendConfirmTimeout,p=globalVariables.sendConfirmTimeoutFunc,h=window.__confirm_timeout?window.__confirm_timeout:1e4;u&&p&&(clearTimeout(u),globalVariables.sendConfirmTimeout=setTimeout(p,h))}if(this.inputStatus="input",globalVariables.urlChangeTime=+new Date,a&&(clearTimeout(a),a=!1),""===e.value)return swapToEmpty(this.kwVal);var f="";if(globalVariables.hsug=e.checkStore&&e.checkStore(),!/^[a-zA-Z0-9~!@#$%^&*()_+=-]$/.test(e.value)){f=this.kwVal;var m=e.imt.getLog();m.length>0&&m[m.length-1].type.indexOf("link")>-1&&c.setParams("_sglink","1");var g=e.imt.diffLog();g&&g.length>1&&(g=g.slice(-15).join("."),c.initHeaderParams({is_params:{imes:encodeURIComponent(g)}})),!window.__disable_is2&&i.length>f.length&&i.startsWith(f)?a=setTimeout((function(){preloadKw({env:c,use_cache:!0,force:!1,pstg:5,shouldShow:headScript_pc_static_index.BDSInstance.comm.supportis},n.htmlCache),a=!1}),250):preloadKw({env:c,use_cache:!0,force:!1,pstg:5,shouldShow:headScript_pc_static_index.BDSInstance.comm.supportis},n.htmlCache)}i=f}}},e.prototype.onSugSelect=function(e,t,n,i){updateKwTip("");var a=globalVariables.inputStopTimer;globalVariables.currentCacheItem;var o=globalVariables.disablePreload,s=globalVariables.disablePredict;if(clearTimeout(a),!(0===window.pageState&&window.__disable_index_predict||o||s||speedRobot.isSlow())){var r={},l="";-1===e?(l=n.value,r={use_cache:!0,force:!1,shouldShow:headScript_pc_static_index.BDSInstance.comm.supportis,pstg:3}):(updateKwTip(""),l=t,r={use_cache:!0,no_predict:!0,force:!1,shouldShow:!n.stopRefresh&&headScript_pc_static_index.BDSInstance.comm.supportis,pstg:3});var c=new PageEnv({pn:"",wd:l});1===headScript_pc_static_index.BDSInstance.comm.logFlagSug&&c.setParams("rsv_slog","sug_select"),r.env=c,preloadKw(r,i.htmlCache)}},e.prototype.initURLChange=function(e){var t=this,n=e.URL,i=e.htmlCache;headScript_pc_static_index.BDSInstance.comm.baseQuery,n.onurlchange=function(e,n){var a;globalVariables.urlChangeTime=+new Date;var o="";o=globalVariables.hitSearchTag&&e.getParams("base_query")&&e.getParams("base_query")||e.getParams("wd");var s=document.getElementById("kw");t.updateChatInputWd(),t.kwVal=o,s.value=t.kwVal,updateKwTip("");var r=!0;n&&(null===(a=globalVariables.currentCacheItem)||void 0===a?void 0:a.env)&&globalVariables.currentCacheItem.env.equals(e)&&(r=!1),preloadKw({env:e,force:!0,use_cache:r,no_predict:!0},i)}},e.prototype.changeSubmitState=function(){this.disableSubmit=!1},e}(),searchBoxController=new SearchBoxController;function swapNewSearchBox(e,t){var n=e.find("#chat-input"),i=$("#main-wrapper");if(i.length){var a=function(){var t=e.find("#chat-input-style");t.on("load",(function(){swapElement(n,i,e),searchBoxController.initChatInput()})),t.insertBefore(i)};document.activeElement&&"chat-textarea"===document.activeElement.id?($("#chat-textarea").on("blur",a),headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){$("#chat-textarea").off("blur",a)}),{once:!0})):a()}}function triggerSwapBegin(e,t){e.pdc.mark("pt"),headScript_pc_static_index.BDSInstance.lifecycle.fireSwapBegin({cacheItem:e,env:t}),$(window).trigger("swap_begin",[e,t]);var n=speedRobot&&speedRobot.getData();n&&(setTimeout((function(){e.pdc.setParam("ispeed",speedRobot.monitor(n))}),3e3),e.pdc.setParam("upm",n.join(",")))}function base64Init(e){e.base64.restart();try{if(!e.base64_loaded){var t=JSON.parse(e.html.find("#img_list").text());e.base64.loadImg(t.right)}}catch(n){}e.base64.end()}function disposeAll(){var e,t,n;headScript_pc_static_index.executeAndLog((function(){$.each(headScript_pc_static_index.BDSInstance.comm.tips,(function(e,t){t&&t.destroy&&t.destroy()})),$("#c-tips-container").empty(),headScript_pc_static_index.BDSInstance.comm.tips=[]})),headScript_pc_static_index.executeAndLog((function(){window.app&&window.app.dispose&&window.app.dispose()})),headScript_pc_static_index.executeAndLog((function(){headScript_pc_static_index.BDSInstance.comm.resolveUnloadHandler()})),(null===(t=null===(e=headScript_pc_static_index.BDSInstance.se)||void 0===e?void 0:e.certification)||void 0===t?void 0:t.data)&&(headScript_pc_static_index.BDSInstance.se.certification.data=[]),(null===(n=headScript_pc_static_index.BDSInstance.se)||void 0===n?void 0:n.userAction)&&headScript_pc_static_index.BDSInstance.se.userAction.destroy()}function setNewContentStyle(e){var t=e.find("#content_style");t&&t.length&&t.children().removeAttr("data-for").appendTo("head")}function clearEnv(){var e=$("script").last(),t=$("head");e.nextAll().not("[data-for]").not("#passport-login-pop").remove(),t.find("*").not("[data-for]").not("meta").not("title").not("script[async]").not('link[href*="passport"]').not('link[rel*="icon"]').not('link[rel*="shortcut icon"]').remove()}function swapWd(e,t,n){var i,a=+new Date,o=headScript_pc_static_index.BDSInstance.comm.resultPage;if(!t.force){var s=globalVariables.pageStartTime;mergePreloadLog(t,{utime:+new Date-s})}if(!t||!t.loaded)return!1;"string"==typeof t.html&&(t.html=$(t.html)),headScript_pc_static_index.eventBus.cacheItem.swapBegin.emit({}),headScript_pc_static_index.executeAndLog(triggerSwapBegin.bind(this,t,e)),headScript_pc_static_index.executeAndLog(base64Init.bind(this,t));var r=[$(window).scrollLeft(),$(window).scrollTop()],l=$("#wrapper_wrapper");l.hide();var c=globalVariables.currentEnv;globalVariables.currentEnv=e,globalVariables.oldCacheItem=globalVariables.currentCacheItem,globalVariables.currentCacheItem=t,headScript_pc_static_index.BDSInstance.comm.cur_disp_query=e.getParams("wd"),disposeAll(),0===window.pageState&&swapToResult(e),headScript_pc_static_index.executeAndLog(clearEnv),headScript_pc_static_index.BDSInstance.clearReady(),l.empty();var d=t.html;if(globalVariables.defaultOptions.use_cache_repeatedly&&(d=d.clone()),$("#content_style").remove(),headScript_pc_static_index.executeAndLog(setNewContentStyle.bind(this,d)),$("#init-data-content").remove(),appendHtml(l,d.find("#".concat(INIT_DATA_CONTENT_ID))),headScript_pc_static_index.executeAndLog(bottomScript_pc_static_instantSearchNewi.mountGlobalData.bind(this,headScript_pc_static_index.BDSInstance)),"006"===headScript_pc_static_index.BDSInstance.comm.jsversion){if(headScript_pc_static_index.BDSInstance.comm.bottomColor?(l.addClass("container_through_bottom"),l.css("background","rgb("+headScript_pc_static_index.BDSInstance.comm.bottomColor+")")):(l.removeClass("container_through_bottom"),l.css("background","")),!o){var u=d.find("#cosmic-init-script");u&&u.length&&u.children().appendTo("head")}headScript_pc_static_index.executeAndLog((function(){d.find("#content_script script").each((function(e,t){$.globalEval($(t).html())}))})),headScript_pc_static_index.executeAndLog(swapTab.bind(this,d,l));var p=swapTopResult(d,l,{cacheItem:t,oldEnv:c});swapTopAd(d),headScript_pc_static_index.executeAndLog(swapTag.bind(this,d,l)),headScript_pc_static_index.executeAndLog(swapNewSearchBox.bind(this,d,l));var h=d.find("#container");t.pdc.bindImgLoad(h),appendHtml(l,h),appendElement("#pagination",d,l),appendElement("#content_bottom",d,l),appendElement("#footer",d,l),appendElement("#c-tips-container",d,l),appendElement("#content_foot_script",d,l),headScript_pc_static_index.BDSInstance.comm.seinfo&&(headScript_pc_static_index.BDSInstance.comm.templateName===headScript_pc_static_index.BDSInstance.comm.resTemplateName?headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_tpfail=0:headScript_pc_static_index.BDSInstance.comm.seinfo.rsv_tpfail=1),0!==window.pageState&&(null===(i=headScript_pc_static_index.BDSInstance.util)||void 0===i?void 0:i.setContainerWidth)&&headScript_pc_static_index.BDSInstance.util.setContainerWidth();var f=e.getParams("base_query")||e.getParams("wd");document.title="".concat(f,"_百度搜索"),l.show(),mask.removeMask(),mergePreloadLog(t,{domtime:(new Date).getTime()-a}),mergePreloadLog(t,{waittime:(new Date).getTime()-globalVariables.urlChangeTime}),t.pdc.mark("dom"),headScript_pc_static_index.executeAndLog((function(){var e=+new Date;d&&$.globalEval(d.find("#jsMerge").html()),mergePreloadLog(t,{jsmergetime:+new Date-e})})),headScript_pc_static_index.BDSInstance.lifecycle.fireSwapDomReady({cacheItem:t,env:e,resultRoot:l.get(0)}),window.__lazy_foot_js?setTimeout((function(){footJS(e,t,a)}),0):footJS(e,t,a),p?window.scrollTo(r[0],r[1]):window.scrollTo(0,0),headScript_pc_static_index.eventBus.app.scroll.emit({})}else{var m=globalVariables.currentEnv.buildSyncSearchUrl({jmp:"jsver",_vr:Math.random()});location.replace(m)}}function swapToEmpty(e){globalVariables.hideKwTip=!0;var t=globalVariables.currentCacheItem;t&&t.real_wd&&e.trim()?(updateKwTip(t.real_wd),updateJc(t)):(updateKwTip(""),updateJc())}var PDC=function(){function e(e,t){this.logParam={product_id:45,page_id:317,page_type:0},this.logData={},this.time={st:0,pt:0,net:0,dom:0,fs:0},this.imgInfos=[],this.excuList=[],this.eventList={},this.allDeferred=null,this.container=null,this.bfe_sample=null,this.FIRST_SCREEN_HEIGHT=600,this.cacheItem={},this.cacheItem=e,this.BDS=t,this.init()}return e.prototype.mark=function(e){"string"==typeof e&&(this.time[e]=Date.now?Date.now():+new Date)},e.prototype.setParam=function(e,t){"string"==typeof e&&(this.logData[e]=t)},e.prototype.getLogTime=function(){this.logData.cus_net=this.time.net>this.time.st&&this.time.net-this.time.st-this.logData.cus_srv>0?this.time.net-this.time.st-this.logData.cus_srv:1,this.logData.cus_tti2=this.time.dom>this.time.st?this.time.dom-this.time.st:1,this.logData.cus_frdom=this.time.dom-this.time.pt,this.logData.cus_fs=this.time.fs>this.time.st?this.time.fs-this.time.st:this.logData.cus_tti2,this.logData.cus_frext=this.logData.cus_fs-this.logData.cus_tti2},e.prototype.getParamString=function(e){var t="";return Object.keys(e).forEach((function(n){""!==e[n]&&(t+="&".concat(n,"=").concat(encodeURIComponent(e[n])))})),t},e.prototype.proxyAll=function(){var e=this,t=[];Object.keys(this.eventList).forEach((function(n){t.push(e.eventList[n])})),this.allDeferred=$.when.apply($,t);var n=this.allDeferred;this.allDeferred.always((function(){n===e.allDeferred&&e.sendLog()}))},e.prototype.subcribe=function(){var e=this,t=headScript_pc_static_index.__spreadArray([],headScript_pc_static_index.__read(arguments),!1);0!==t.length&&t.forEach((function(t){e.eventList[t]=$.Deferred()}))},e.prototype.setCacheItemData=function(){this.setParam("qid",this.cacheItem.qid),this.setParam("cus_q",this.cacheItem.real_wd||this.cacheItem.env.getParams("wd")),this.setParam("sid",this.BDS.comm.sid),this.setParam("cus_newindex",this.BDS.comm.newindex),this.setParam("supportis",this.BDS.comm.supportis)},e.prototype.destroy=function(){this.cacheItem={},this.container=null},e.prototype.trigger=function(e){var t=this;this.eventList[e].resolve(),"swap_end"===e&&setTimeout((function(){t.trigger("swap_end_5s")}),5e3)},e.prototype._init=function(){this.subcribe("swap_end","swap_end_5s","confirm"),this.proxyAll()},e.prototype.init=function(){this._init(),this.time.st=0,this.time.fs=0,this.time.dom=0},e.prototype.sendLog=function(){var e=Math.random(),t=/28230|28231/,n=e>.51&&e<.52,i=this.BDS.comm.bfe_sample&&e>.6&&e<.9;if(n||t.test(this.BDS.comm.sid)&&e<0&&e<.2||this.BDS.comm.intrSid||i){t.test(this.BDS.comm.sid)&&(n?this.setParam("issam",2):this.setParam("issam",1)),i&&(this.setParam("issam",3),this.setParam("bfesam",this.BDS.comm.bfe_sample)),this.getLogTime(),this.getImgInfo(this.container),this.getTplList(this.container),this.setParam("srvInfo",this.getSrvInfo()),this.setParam("sysv",navigator.appMinorVersion),this.setCacheItemData(),this.fireExcuList();var a="",o="//www.baidu.com/nocache/fesplg/s.gif?log_type=sp"+(a+=this.getParamString(this.logParam)+this.getParamString(this.logData)),s=new Image,r="_LOG_".concat(+new Date);s.onload=function(){delete window[r]},window[r]=s,s.src=o}},e.prototype.fireExcuList=function(){this.excuList.forEach((function(e){e()}))},e.prototype.bindImgLoad=function(e){this.container=e,e.find("img").one("load",(function(){var e,t=$(this).offset(),n=t.top,i=t.left,a="";if(n<this.FIRST_SCREEN_HEIGHT&&n>0){this.mark("fs");var o=this.time.fs-this.time.dom;this.imgInfos.push("".concat(n,"_").concat(i,"_").concat(o)),a=$(this).attr("data-src")||(null===(e=$(this).attr("src"))||void 0===e?void 0:e.includes("http"))?$(this).attr("data-src")||this.attr("src"):"base64",this.setParam("ic_lis",a)}}))},e.prototype.getSrvInfo=function(){var e=JSON.parse(this.BDS.comm.speedInfo),t=[],n="";return e.forEach((function(e){n="".concat(e.ModuleId,"_").concat(e.TimeCost,"_").concat(e.TimeSelf,"_").concat(e.Idc),e.SubProcess&&e.SubProcess.forEach((function(e){n+=",".concat(e.ProcessId,"_").concat(e.TimeCost,"_").concat(e.isHitCache,"_").concat(e.Idc)})),t.push(n)})),encodeURIComponent(t.join("|"))},e.prototype.getImgInfo=function(e){for(var t=0,n=e.find("img"),i=e.find("#content_left").find("img"),a=0,o=0;o<n.length;o++)(a=n.eq(o).offset().top)<this.FIRST_SCREEN_HEIGHT&&a>0&&t++;this.setParam("cus_ic",n.length),this.setParam("cus_extic",t),this.setParam("cus_extlic",0),this.setParam("cus_icl",i.length),this.setParam("cus_icr",e.find("#content_right").find("img").length),this.setParam("img_info",this.imgInfos.join(",")),this.setParam("psize",e.html().length)},e.prototype.getTplList=function(e){var t={},n=[],i=e.find("#content_left,#con-ar").children("*[tpl]"),a="";if(i.length>0)for(var o=0;o<i.length;o++)a=i.eq(o).attr("tpl"),t.hasOwnProperty(a)||(t[a]=1,n.push(a));n.length>0&&this.setParam("tplp",n.join("|"))},e.prototype.onSendlog=function(e){this.excuList.push(e)},e}(),PDCBase64=function(){function e(e,t){this.opt={},this.containerId={left:"content_left",right:"container"},this.reqT={},this._imgWatch=[],this._domLoaded={left:$.Deferred(),right:$.Deferred()},this._data={left:{},right:{}},this._loadImgTime=0,this.preXhrs=[],this.hasinline=!1,this.inlinePdcTag=!1,this.failover_times=0,this.pdc=e,this.bds=t,this.bds._base64&&(this.opt=this.bds._base64,this.opt.inline=!1,this.initPDCSendLog())}return e.prototype.restart=function(){this._domLoaded={left:$.Deferred(),right:$.Deferred()}},e.prototype.initPDCSendLog=function(){var e=this;this.pdc.onSendlog((function(){var t=[],n=Object.keys(e.reqT);n.length>0&&n.forEach((function(n){t.push("".concat(n,"_").concat(e.reqT[n]))})),e.pdc.setParam("cus_cusval",t.join("|")),e.isinline()&&(e.pdc.setParam("cus_b64il",e.ilsum),e.ilparseTime&&e.pdc.setParam("cus_b64ilpt",e.ilparseTime),e.ilrenderTime&&e.pdc.setParam("cus_b64ilrt",e.ilrenderTime))}))},e.prototype.isinline=function(){return this.inlinePdcTag},e.prototype.loadImg=function(e){var t=this;if(void 0===e&&(e=[]),this._loadImgTime++,(e=e.filter((function(e){return!t._data.right[e]&&(t._data.right[e]=!1,!0)}))).length>12){var n=Math.round(e.length/2),i=[],a=[];e.forEach((function(e,t){t<n?i.push(e):a.push(e)}))}},e.prototype.renderImg=function(e,t,n,i){var a,o;if(i=i?$(i).find("#".concat(this.containerId[t]))[0]:headScript_pc_static_index.getElement(this.containerId[t])){var s=i.getElementsByTagName("IMG");try{for(var r=headScript_pc_static_index.__values(s),l=r.next();!l.done;l=r.next()){var c=l.value,d=c.getAttribute(n);d&&(e.hasOwnProperty(d)&&e[d]?this.setSrc(c,e[d]):this.failover(c))}}catch(u){a={error:u}}finally{try{l&&!l.done&&(o=r["return"])&&o.call(r)}finally{if(a)throw a.error}}}},e.prototype.imgLoad=function(e){this.renderImg(this._data[e],e,"data-b64-id")},e.prototype.iniline=function(e,t){this.hasinline||this.renderImg(e,"right","data-b64-id",t),t&&(this.hasinline=!0),this.inlinePdcTag=!0},e.prototype.end=function(){var e=this,t=this.preXhrs.concat(this._domLoaded.left,this._domLoaded.right);this.allDeferred=$.when.apply($,t),this.allDeferred.always((function(){2===e.opt.b64Exp&&e.imgLoad("left"),e.imgLoad("right")}))},e.prototype.setSrc=function(e,t){try{e.onerror=function(){this.failover(this)},this._imgWatch.push({obj:e,loaded:!1}),e.onload=function(){var e=this;this._imgWatch.filter((function(t){return t.obj===e})).loaded=!0},e.src="data:image/jpeg;base64,"+t}catch(n){this.failover(e)}},e.prototype.failover=function(e){(e.getAttribute("data-b64-id")||e.getAttribute("data-b64il-id"))&&e.getAttribute("data-src")&&(e.src=e.getAttribute("data-src"),this.pdc.setParam("cus_b64fails",++this.failover_times))},e.prototype.setDomLoad=function(e){this._domLoaded[e].resolve()},e.prototype.destroy=function(){this._data={left:{},right:{}},this._imgWatch=[],this._domLoaded=null,this.preXhrs.forEach((function(e){e.abort()}))},e}();function extractData(e,t){var n=(t||$("body")).find("#".concat(e)),i={};if(n.length)try{var a=JSON.parse(n.html());Object.assign(i,a)}catch(o){console.error(o)}else console.warn("".concat(e," NOT FOUND"));return i}var stopPreloadTimeout=!1,stopPredictTimeout=!1;function xhrReciving(e,t,n,i){var a,o,s=this,r=i.cacheItem,l=i.htmlCache,c=i.env,d=i.options;switch(t){case 0:xhrDomFinish(e,n,{cacheItem:r,htmlCache:l,env:c,options:d}),r.pdc&&(r.pdc.setParam("cus_srv",null===(o=null===(a=headScript_pc_static_index.BDSInstance.se)||void 0===a?void 0:a.mon)||void 0===o?void 0:o.srvt),r.pdc.setParam("bsi",bottomScript_pc_static_instantSearchNewi.cookieInstance.get("__bsi")));break;case 1:try{var u=+new Date;r.b64ildata=JSON.parse(e),r.base64.ilparseTime=+new Date-u,r===globalVariables.currentCacheItem&&(r.base64.inline(r.b64ildata),r.base64.ilrenderTime=+new Date-u),headScript_pc_static_index.eventBus.cacheItem.swapBegin.on((function(){s.base64.inline(s.b64ildata,s.html.get(0))}),{when:r,once:!0})}catch(p){console.warn("xhrReciving index1 error",p.message)}break;case 2:r.base64&&(r.base64.ilsum=e)}}function xhrDomFinish(e,t,n){var i,a,o=n.cacheItem,s=n.htmlCache,r=n.env;if(n.options,t&&"302"===t.status||e&&-1===e.trim().indexOf("__result_module_head-tab/pc/static/head-tab.san"))o.force?(setiswr(11),jumpToSync(r)):s.deleteCache(o);else{mergePreloadLog(o,{ntime:+new Date-o.startTime,res:1});var l=document.createElement("div");l.innerHTML=e;var c=$(l);o.html=c;var d=parseInt(c.find("#__status").eq(0).html()),u=parseInt(c.find("#__switchtime").eq(0).html()),p=parseInt(c.find("#__redirect").eq(0).html()),h={};try{h=JSON.parse(c.find("#__sugPreInfo:eq(0)").html()||"{}")||{}}catch(E){console.warn("xhrDomFinish error",E.message)}var f=c.find("#__querySign").html(),m=extractData("async-data",c);o.real_wd=m.realWd,o.real_wd_org=m.realWdOrg,o.real_wd_nosynx=m.realWdNoSynx,o.env&&o.env.getParams("nojc")&&o.real_wd_nosynx&&(o.real_wd=o.real_wd_nosynx);var g=!1,_=(headScript_pc_static_index.getElement("chat-textarea")||headScript_pc_static_index.getElement("kw")).value;(r.getParams("wd")===normalize(_)||o.force)&&o.shouldShow&&(g=!0),o.real_wd&&(o.prw=r.getParams("wd"),r.setParams("wd",o.real_wd));var v=m.queryId,b=m.querySign||f;o.querySign=b,mergePreloadLog(o,{stat:d||0}),headScript_pc_static_index.BDSInstance.comm.isDebug&&$("#isDebugInfo").html(c.find("#__isDebugInfo").html()),v&&(o.qid=v);var y=m.chk;if(o.chk=y||0,!e)return o.force?(r.setParams("__eis",1),r.setParams("__eist",e?e.length:0),r.setParams("real_wd",o.real_wd),setiswr(13),void jumpToSync(r)):void s.deleteCache(o);if(u>0&&stopPreload(1e3*u,!o.no_predict),-11===d){var w=s.getCacheBySign(b);if(!w)return preloadKw({env:o.env.getClonePageEnvInstance({wd:o.real_wd}),force:o.force,use_cache:!1,no_predict:!0},s),void s.deleteCache(o);w.force=o.force,globalVariables.hideKwTip=!1,updateKwTip(w.real_wd),updateJc(w),s.deleteCache(o),o=w,globalVariables.currentCacheItem&&o.real_wd===globalVariables.currentCacheItem.real_wd||(g=!0)}else{if(d<0){if(1===p&&o.force)return mergePreloadLog(o,{redirect:1}),setiswr(14),void jumpToSync(r);if(swapToEmpty(_),-12===d&&h&&h.wait_time>0){var S=o.env.getClonePageEnvInstance();globalVariables.inputStopTimer=setTimeout((function(){preloadKw({env:S,force:!1,use_cache:!0,no_predict:!0,shouldShow:!1,pstg:6},s)}),h.wait_time)}return void s.deleteCache(o)}if(d>0)return void s.deleteCache(o)}var C=s.find((function(e){if(!e.loaded&&e!==o&&e.no_predict&&r.equals(e.env))return e.shouldShow&&(g=!0),e.force&&(o.force=!0,o.no_predict=!0),!0}));try{for(var T=headScript_pc_static_index.__values(C),k=T.next();!k.done;k=T.next()){var x=k.value;s.deleteCache(x)}}catch(I){i={error:I}}finally{try{k&&!k.done&&(a=T["return"])&&a.call(T)}finally{if(i)throw i.error}}if(o.backup_request_timeout&&clearTimeout(o.backup_request_timeout),o.loaded=!0,!headScript_pc_static_index.BDSInstance.comm.supportis&&!g)return!0;(g&&o!==globalVariables.currentCacheItem||o.force)&&(globalVariables.hideKwTip=!1,o.shouldShow=!1,-11===d?o.pdc.init():o.pdc.mark("net"),mergePreloadLog(o,{frcache:0}),swapWd(r,o))}}function stopPreload(e,t){t?(globalVariables.disablePredict=!0,stopPredictTimeout&&(clearTimeout(stopPredictTimeout),stopPredictTimeout=!1),stopPredictTimeout=setTimeout((function(){globalVariables.disablePredict=globalVariables.defaultDisablePredict}),e)):(globalVariables.disablePreload=!0,stopPreloadTimeout&&(clearTimeout(stopPreloadTimeout),stopPreloadTimeout=!1),stopPreloadTimeout=setTimeout((function(){globalVariables.disablePreload=globalVariables.defaultDisablePreload}),e))}function preloadKw(e,t){var n={force:!1,no_predict:!1,use_cache:!1,shouldShow:!0,pstg:-1};e&&Object.assign(n,e);var i=n.env,a=n.force,o=n.no_predict,s=n.use_cache,r=n.shouldShow,l=globalVariables.disablePreload,c=globalVariables.disablePredict,d=globalVariables.pageStartTime;if(i&&i.getParams("wd")&&i.hashCode()){if(!o){var u=headScript_pc_static_index.BDSInstance&&headScript_pc_static_index.BDSInstance.comm&&headScript_pc_static_index.BDSInstance.comm.ishome,p="";p=headScript_pc_static_index.BDSInstance&&headScript_pc_static_index.BDSInstance.comm&&headScript_pc_static_index.BDSInstance.comm.isVoice?u?"ivoice_pre":"bvoice_pre":u?"ib_pre":"tb_pre",i.setParams("rsv_dl",p)}if(!(l||c||1==+bottomScript_pc_static_instantSearchNewi.cookieInstance.get("ISSW")&&!a&&o)){var h=t.hasCache(i,{loaded:!0})||null,f=globalVariables.currentCacheItem,m=!(!(null==h?void 0:h.env)||!(null==f?void 0:f.env))&&h.env.getClonePageEnvInstance({wd:h.real_wd}).equals(f.env.getClonePageEnvInstance({wd:f.real_wd}));if(s&&h)r&&(f&&m||(h.force=n.force,h.no_predict=n.no_predict,h.pdc.init(),h.force&&(h.pdc.mark("st"),headScript_pc_static_index.BDSInstance.comm.supportis||(h.pdc.mark("net"),h.pdc.setParam("cus_hitpreload",1))),mergePreloadLog(h,{frcache:1}),swapWd(i,h)),updateKwTip(n.no_predict&&6!==n.pstg?"":h.real_wd),updateJc(h));else a&&r&&o&&($(".search-keyboard-toast").hide(),mask.addMask()),(h={env:i,cftime:0,no_predict:o,shouldShow:r,force:a,loaded:!1,startTime:+new Date,log:{ctime:+new Date-d,wd:i.getParams("wd"),ntime:0,stat:0,used:0,rtime:0,utime:a?+new Date-d:0,res:0}}).pdc=new PDC(h,headScript_pc_static_index.BDSInstance),n.pstg>0&&(h.pstg=n.pstg),h.force&&h.pdc.mark("st"),h.base64=new PDCBase64(h.pdc,headScript_pc_static_index.BDSInstance),globalVariables.preloadLogs.push(h.log),globalVariables.preload_num++,globalVariables.preload_cnt++,load(h,t,n)}}}function load(e,t,n){var i=e.env,a={},o=globalVariables.currentCacheItem;(null==o?void 0:o.env)?a.is_referer=o.env.buildSyncSearchUrl():a.is_referer=document.location.href.replace(/\#.*$/,""),Object.assign(a,i.serializeHeaderParams()),a.is_xhr="1",i.setParams("bs",headScript_pc_static_index.BDSInstance.comm.cur_query||""),headScript_pc_static_index.BDSInstance.comm.cur_disp_query&&(a.is_pbs=encodeURIComponent(headScript_pc_static_index.BDSInstance.comm.cur_disp_query));var s=e.no_predict||!headScript_pc_static_index.BDSInstance.comm.supportis?1:11,r=e.pstg;if(!(1===s&&1===r||11===s&&3===r||11===s&&6===r||1===s&&4===r)){var l=headScript_pc_static_index.parseUrlParams(location.search),c=globalVariables.sessionId,d=headScript_pc_static_index.getElement("kw"),u={ie:"utf-8",newi:headScript_pc_static_index.BDSInstance.comm.newindex?1:"",sid:l.sid?encodeURIComponent(l.sid):"",tnp:l.tnp?encodeURIComponent(l.tnp):"",mod:s,newMode:1,isbd:headScript_pc_static_index.BDSInstance.comm.supportis?1:"",isid:c,rsv_id:headScript_pc_static_index.BDSInstance.comm.indexSid,_ss:1,clist:encodeURIComponent(t.getCacheList()),hsug:getHsugList(globalVariables.hsug),f4s:e.force?1:"",csor:window.getCursortPosition(d),pstg:e.pstg||""};headScript_pc_static_index.BDSInstance.comm.SyncSample&&(u.SyncSample=headScript_pc_static_index.BDSInstance.comm.SyncSample);var p=headScript_pc_static_index.objToStr(u,"&",{encode:!1});p+="&".concat(i.buildQueryString());var h,f="/s?".concat(p);if(f+="&_cr1=".concat(headScript_pc_static_index.crc32(f)),e.no_predict||(h=t.find((function(e){return!e.loaded&&!e.no_predict}))).forEach((function(e){t.deleteCache(e)})),!(e.no_predict&&!e.force&&(h=t.find((function(e){if(e.force&&i.equals(e.env))return!0}))).length>0)){if(e.force&&e.shouldShow){var m=!1,g=+new Date;if(h=t.find((function(t){var n=i.equals(t.env);if(t.loaded||t.no_predict||!n||t===e||(t.shouldShow=!1),!t.loaded&&t.no_predict&&t.force&&n&&t!==e&&(t.shouldShow=t.shouldShow||e.shouldShow,t.startTime&&g-t.startTime<2e3&&(m=!0),window.__sam_backup_request||(m=!0)),!t.loaded&&!n)return!0;t.pdc.mark("st")})),m)return;h.forEach((function(e){t.deleteCache(e)}))}var _=$.ajax({dataType:"parts",url:f,headers:a,delimiter:"</*3*/>"});_.parts((function(a,o){xhrReciving(a,o,_,{cacheItem:e,htmlCache:t,env:i,options:n})})),_.fail((function(n,i){e.force&&e.shouldShow&&"abort"!==i&&e.env&&(setiswr(12),location.replace(e.env.buildSyncSearchUrl()+"&rsv_jmp=fail")),t.deleteCache(e)})),e.xhr=_,t.addCache(e)}}}function getHsugList(e){var t=[];return e&&(t=e.slice(0,2).map((function(e){return e.value}))),t.join("\t")}function initSwapEventListener(e){headScript_pc_static_index.BDSInstance.lifecycle.onSwapDomReady((function(e){var t=e.cacheItem,n="";!(null==t?void 0:t.real_wd)||t.no_predict&&6!==t.pstg||(n=t.real_wd),updateKwTip(n),updateJc(t)})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(t){var n=t.cacheItem;if(n)if(window.cfpromise=new $.Deferred,globalVariables.sendConfirmTimeout&&(clearTimeout(globalVariables.sendConfirmTimeout),globalVariables.sendConfirmTimeout=!1,globalVariables.sendConfirmTimeoutFunc=null),n.confirm=!1,n.force)genSendConfirm(n,20,{URL:e})();else{globalVariables.sendConfirmTimeoutFunc=genSendConfirm(n,21,{URL:e});var i=window.__confirm_timeout?window.__confirm_timeout:1e4;globalVariables.sendConfirmTimeout=setTimeout(globalVariables.sendConfirmTimeoutFunc,i)}}))}function initHeadEventListener(){$("#head").delegate(".index_tab_top>a,.index_tab_bottom>a,#u1>a,#u>a","mousedown",(function(){if($(this).attr("name"))return headScript_pc_static_index.nsClickForWWW({fm:"behs",tab:$(this).attr("name"),query:"",un:encodeURIComponent(headScript_pc_static_index.BDSInstance.comm.user||"")},headScript_pc_static_index.BDSInstance)}))}function initATagEventListener(e){$(document).delegate("a","mousedown",(function(e){"https:"===location.protocol&&headScript_pc_static_index.BDSInstance.comm.ishome&&!navigator.userAgent.includes("Chrome")&&swapATagHref(this),sendFesplg(this),ckLogMouseDown(e)})),e.support()&&$(document).on("click","a",(function(){return swapToAsyncUrl(this,e)})),$(document).delegate("a","mouseup",(function(e){ckLogMouseUp(e)})),$(document).delegate("#su,#su1","mouseup",(function(e){ckLogMouseUp(e)})),$(document).delegate("#su,#su1","mousedown",(function(e){ckLogMouseDown(e)}))}function initWrapperEventListener(e){$("#wrapper_wrapper").delegate("#page strong+a, #page a.n","mouseover",(function(){preloadKw({env:new PageEnv(headScript_pc_static_index.parseUrlParams($(this).attr("href"))),force:!1,use_cache:!0,no_predict:!0,shouldShow:!1,pstg:4},e)}))}function initBackorgEventListener(){$("#u .back_org").click((function(){var e=new Date;e.setTime(e.getTime()+110376e7),bottomScript_pc_static_instantSearchNewi.cookieInstance.set("ORIGIN",2,document.domain,"/",e),globalVariables.currentEnv?location.replace(globalVariables.currentEnv.buildSyncSearchUrl({_r:Math.random()})):location.href="/"}))}function initKwPasteEvent(e){kw.bind("paste",(function(){var t=globalVariables.disablePreload,n=globalVariables.disablePredict;if(!(window.__disable_index_predict&&0===window.pageState||t||n)){var i=this,a=this.value;globalVariables.cancelNextInputChange=!0,setTimeout((function(){i.value&&i.value!==a&&preloadKw({env:(new PageEnv).getClonePageEnvInstance({wd:i.value.trim()}),force:!1,use_cache:!0,no_predict:!0,shouldShow:headScript_pc_static_index.BDSInstance.comm.supportis,pstg:2},e)}),0)}}))}function safariATagStyle(){headScript_pc_static_index.isSafari()&&$(document).on("click",".result-op a, .result a",(function(){$(this).addClass("card-visited")}))}function linkPreload(e){var t=null;window._bdlkc>=1&&($(document).delegate(".c-container","mouseenter",(function(){var n=$(this),i=300;2===window._bdlkc&&(i=100),t=setTimeout((function(){var t=n.find(".t>a"),i=getLinkString(t,{prefix:"http://www.baidu.com",regex:/^\/*(link)\?(.*)$/},e),a=n.attr("mu")||n.find(".f13 .g").text(),o=/^(http[s]?:\/\/)?([^\/]+)(.*)/.exec(a);i&&i.match(location.protocol)&&i.includes("www.baidu.com/link")&&!i.includes("bdlkc=1")&&(o&&o[2]&&(a="http://"+o[2],n.append('<link rel="dns-prefetch" href="'+a+'" />')),$.ajax({url:i+"&bdlkc=1",type:"GET",contentType:"text/html",success:function(){t.attr("linkpreload","1")}}),t.attr("href",i+"&bdlkc=1"))}),i)})),$(document).delegate(".c-container","mouseleave",(function(){clearTimeout(t)})))}function extend$TextWidth(){!function(e){var t=null;e.fn.textWidth=function(){return t||(t=e('<div data-for="result" \n style="clear:both;display:block;visibility:hidden;position:absolute;top:0;">\n <span style="width;inherit;margin:0;font:16px/22px arial;"></span>\n </div>').appendTo("body").find("span")),t.html(headScript_pc_static_index.escapeHTML(e(this).val())),t.width()}}(jQuery)}function initPreload(e){initPreloadGlobal(),initPredictState(),globalVariables.hitSearchTag=!!headScript_pc_static_index.getElement("searchTag"),e&&Object.assign(globalVariables.defaultOptions,e);var t=new HtmlCache,n=new Url;window.changeUrl=function(e){var t=new PageEnv(headScript_pc_static_index.parseUrlParams(e));n.submit(t,!0)},initPreState(),redirectToSearch(n),setBaiduIdAndSessionId(),"_blank"===indexForm.getAttribute("target")&&(window.__disable_index_predict=!0,globalVariables.defaultDisablePreload=!0,globalVariables.disablePreload=!0),globalVariables.pageStartTime=+new Date,window.pageState=0,initPDCAsync(),headScript_pc_static_index.BDSInstance.comm.supportis&&1==+bottomScript_pc_static_instantSearchNewi.syncUpsToCookie.get("isSwitch")&&speedRobot.start(),initHeadEventListener(),$(document).delegate("a","mousedown",(function(){genSendConfirm(globalVariables.currentCacheItem,22,{URL:n})()})),safariATagStyle(),processJump(n),initATagEventListener(n),linkPreload(n),extend$TextWidth(),initSwapEventListener(n),headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(e){e.cacheItem||(headScript_pc_static_index.BDSInstance.comm.confirmQuery=headScript_pc_static_index.BDSInstance.comm.query,headScript_pc_static_index.BDSInstance.comm.confirmQid=headScript_pc_static_index.BDSInstance.comm.qid,sendSE()),globalVariables.checktimer=setTimeout((function(){0===$("#content_left,.result,.content_none").length&&setiswr(15,86400)}),1e4)})),n.init(),headScript_pc_static_index.BDSInstance.comm.resultPage&&startWithResult(),initWrapperEventListener(t),initBackorgEventListener(),initKwPasteEvent(t),searchBoxController.initSug(headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},e),{htmlCache:t,URL:n})),headScript_pc_static_index.eventBus.app.confirm.on((function(){setTimeout(ckLogClear,0)}))}function bindInitPreloadEvent(){headScript_pc_static_index.eventBus.page.interactive.on(initPreload)}var Logger=function(){function e(e){this.start=0,this.mouse=[],this.mouseTimer=null,this.mouseSpeed=500,this.key=[],this.scroll=[],this.scrollTimer=null,this.scrollSpeed=500,this.debug=!1,this.dataStore={},this.timer=null,this.cycle=null,this.MIN_SPEED=2e3,this.MAX_SPEED=1e4,this.curSpeed=5e3,this.stayTime=0,this.heartTime=[],this.heartTimer=null,this.MAX_LEN=2e3,this.storeLen=-1,this.MAX_SEND=100,this.hostEnum={SCLICK:0,NSCLICK:1,SESTAT:2},this.keyMap={new_input:2,new_disp:2,new_view:2,new_user:2,new_heart:2,flow_monitor:2},this.hostAddr=[],this.commLog={},this.isFirst=!0,this.sendNum={},this.bds=e,this.setHostAddr(),this.init()}return e.prototype.setHostAddr=function(){this.hostAddr=[this.bds.comm.ubsurl?this.bds.comm.ubsurl+"?":"",this.bds.util.domain.get("http://nsclick.baidu.com")+"/v.gif?",this.bds.util.domain.get("http://sestat.baidu.com")+"/wb.gif?"]},e.prototype.init=function(){var e=this;this.preInit(),this.bds.lifecycle.onSwapBegin((function(){null!==e.timer&&(window.clearTimeout(e.timer),e.timer=null),e.bds.comm.ishome||1!==e.bds.comm.logFlag&&1!==e.bds.comm.globalLogFlag||e.sendHeart(1)})),this.bds.lifecycle.onunload((function(){e.flushData(2)})),this.bds.lifecycle.onSwapEnd((function(){e.preInit(),e.isFirst&&(e.isFirst=!1),!e.hostAddr[0]&&e.bds.comm.ubsurl&&(e.hostAddr[0]="".concat(e.bds.comm.ubsurl,"?"))}))},e.prototype.preInit=function(){this.reset();var e=this.bds.comm.qid||"";e&&(this.setCommLog(e),this.sendNum[e]=0),1!==this.bds.comm.logFlagSug&&1!==this.bds.comm.globalLogFlag||(null!==this.heartTimer&&window.clearTimeout(this.heartTimer),this.heartTimer=null,this.stayTime=0,this.heartTime=[],this.startHeart())},e.prototype.reset=function(){var e=this;this.start=+new Date,this.mouse=[],this.key=[],this.scroll=[],this.cycle=null,this.storeLen=-1,["mouseTimer","scrollTimer","timer"].forEach((function(t){0!==e[t]&&window.clearTimeout(e[t]),e[t]=0}))},e.prototype.setCommLog=function(e,t,n){if(!this.bds||!this.bds.comm)return!1;if(!(e in this.commLog)){var i={};if(t&&n)i.log=t,i.len=n;else{var a={q:this.bds.comm.queryEnc,qid:this.bds.comm.qid,rsv_did:this.bds.comm.did,rsv_tn:this.bds.comm.tn,rsv_sid:this.bds.comm.sid};i.log="&".concat(headScript_pc_static_index.objToStr(a,"&",{encode:!1})),i.len=(i.log+"&t=".concat((new Date).getTime())).length}this.commLog[e]=i}return!0},e.prototype.startHeart=function(){var e=this,t=this.fb();this.stayTime+=t,this.heartTimer=window.setTimeout((function(){e.sendHeart(0),e.startHeart()}),t)},e.prototype.fb=function(){var e=this.heartTime.length,t=0;return t=[0,1].includes(e)?3e3:this.heartTime[e-1]+this.heartTime[e-2],this.heartTime.push(t),t},e.prototype.sendHeart=function(e){var t=0===e?this.stayTime:+new Date-this.start,n=this.bds.comm.qid;if(n&&n in this.commLog&&n in this.sendNum){var i=[{stay_time:t,send_num:this.sendNum[n]}];this.send({type:e,fm:"new_heart",data:i},this.keyMap.new_heart)}},e.prototype.send=function(e,t,n){if(!e)return!1;if(this.debug,0===t&&!this.hostAddr[0]){if(!this.bds.comm.ubsurl)return!1;this.hostAddr[0]="".concat(this.bds.comm.ubsurl,"?")}var i,a="",o="";if(headScript_pc_static_index.isObject(e)?(Object.keys(e).forEach((function(t){a=e[t],headScript_pc_static_index.isObject(a)&&(a=JSON.stringify(a)),o+="".concat(t,"=").concat(encodeURIComponent(a),"&")})),o=o.substring(0,o.length-1)):"string"==typeof e&&(o=e),!n&&this.bds.comm.qid&&(n=this.bds.comm.qid),!n||!this.commLog.qid)return!1;if(o+=this.commLog[n].log,o+="&t=".concat((new Date).getTime()),("number"!=typeof t||t<0||t>=this.hostAddr.length)&&(t=0),(i="".concat(this.hostAddr[t]).concat(o)).length>this.MAX_LEN)return!1;var s=new Image;return window["BD_PS_C"+(new Date).getTime()]=s,s.src=i,!0},e.prototype.flushData=function(e){null!==this.timer&&(clearTimeout(this.timer),this.timer=0),this.startSend(this.fetchData(e,!0),!0),this.startSend(this.fetchData(e,!0)),1!==this.bds.comm.logFlagSug&&1!==this.bds.comm.globalLogFlag||(null!==this.heartTimer&&(clearTimeout(this.heartTimer),this.heartTimer=null),this.sendHeart(e))},e.prototype.startSend=function(e,t){var n=this,i=null,a=setInterval((function(){if(e.length<=0)clearInterval(a);else{var t=e.shift();(null==t?void 0:t.qid)&&n.commLog[t.qid]&&(i=headScript_pc_static_index.objToStr({type:t.type,fm:t.key,data:t.data},"&",{encode:!1}),n.send(i,t.host,t.qid),n.sendNum[t.qid]&&n.sendNum[t.qid]++)}}),t?0:100)},e.prototype.fetchData=function(e,t){var n=this,i=this.dataStore,a=null,o=null,s=[],r=0,l=!1,c=this.bds.comm.qid||"";return c?(Object.keys(i).forEach((function(d){var u,p;l=d!==c,a=i[d];var h=Object.keys(a);try{for(var f=headScript_pc_static_index.__values(h),m=f.next();!m.done;m=f.next()){var g=m.value;n.keyMap[g]&&("number"==typeof(r=n.keyMap[g])&&n.hostAddr[r]!==undefined&&(o=a[g][0].length>0?a[g][0]:a[g][1],n.getBusinessData({readyQueue:s,qid:d,host:r,type:e,key:g,businessData:o,historyQid:l}),(!0===l||!0!==t)&&0===o.length&&a[g][1].length>0&&(o=a[g][1],n.getBusinessData({readyQueue:s,qid:d,host:r,type:e,key:g,businessData:o,historyQid:l})),!0===l&&delete n.dataStore[d]))}}catch(_){u={error:_}}finally{try{m&&!m.done&&(p=f["return"])&&p.call(f)}finally{if(u)throw u.error}}})),s):[]},e.prototype.getBusinessData=function(e){for(var t=e.readyQueue,n=e.qid,i=e.host,a=e.type,o=e.key,s=e.businessData,r=e.historyQid,l=null,c=0,d=[],u=!1,p=this.commLog[n].len,h=this.hostAddr[i].length+("type="+a+"&fm="+o+"&data=").length+p,f=h+6,m=f;0!==s.length&&c<this.MAX_LEN;)r||0!==a||c++,l=s.shift(),d.push(l),m=f+l.length+3,(f>=this.MAX_LEN||m>=this.MAX_LEN)&&(d.length>=2&&(d.pop(),u=!0),t.push({qid:n,key:o,type:a,data:"%5B"+d.join("%2C")+"%5D",host:i}),d=[],u&&(d[0]=l,u=!1),m=d.length>0?h+3+l.length+3:h+6),f=m;d.length>0&&t.push({qid:n,key:o,type:a,data:"%5B"+d.join("%2C")+"%5D",host:i})},e.prototype.getData=function(e,t,n){var i,a;if(null===this.start||0===e.length)return[{startTime:this.start,record:[]}];var o={startTime:this.start,record:[]};t===undefined?(t=0,n=e[e.length-1][0]):"number"==typeof t&&n===undefined?(t-=this.start,n=e[e.length-1][0]):"number"==typeof t&&"number"==typeof n?(t-=this.start,n-=this.start):(t=0,n=0);try{for(var s=headScript_pc_static_index.__values(e),r=s.next();!r.done;r=s.next()){var l=r.value;if(!(l[0]<t)&&(l[0]<n&&o.record.push(l),l[0]>=n))break}}catch(c){i={error:c}}finally{try{r&&!r.done&&(a=s["return"])&&a.call(s)}finally{if(i)throw i.error}}return o},e.prototype.singleInit=function(){var e=this;document.body.addEventListener("mousemove",(function(t){e.collectPoint("mouse",t)})),document.body.addEventListener("keydown",(function(t){e.key.push([+new Date-e.start,t.keyCode])})),window.addEventListener("scroll",(function(t){e.collectPoint("scroll",t)})),this.singleInit=function(){}},e.prototype.collectPoint=function(e,t){var n=this,i="".concat(e,"Time"),a=this["".concat(e,"Speed")];if(0!==this[e].length)null===this[i]&&(this[i]=setTimeout((function(){var a=s(e,t);a.length<2||n[e].push([+new Date-n.start,a[0],a[1]]),n[i]=null}),a));else{var o=s(e,t);if(o.length<2)return;this[e].push([(new Date).getTime()-this.start,o[0],o[1]])}function s(e,t){var n=[];if("mouse"===e)n[0]=t.pageX,n[1]=t.pageY;else if("scroll"===e){var i=$(window);n[0]=i.scrollLeft(),n[1]=i.scrollTop()}return n}},e.prototype.sendNow=function(e,t,n){if(e&&"string"==typeof e&&this.keyMap[e]&&t){var i="type=3&fm="+e+"&data="+encodeURIComponent(JSON.stringify([t]));n&&n.qid&&n.log&&n.len?(this.setCommLog(n.qid,n.log,n),this.send(i,this.keyMap[e],n.qid)):this.send(i,this.keyMap[e])}},e.prototype.pushData=function(e,t,n){var i=this.bds.comm.qid||"";if(!i)return!1;(null==n?void 0:n.qid)&&(null==n?void 0:n.log)&&(null==n?void 0:n.len)?(this.setCommLog(n.qid,n.log,n.len),i=n.qid):this.setCommLog(i),this.dataStore[i]||(this.dataStore[i]={});var a=this.dataStore[i];!0===(null==n?void 0:n.level)?a[e][0].push(encodeURIComponent(JSON.stringify(t))):a[e][1].push(encodeURIComponent(JSON.stringify(t)))},e.prototype.startCycle=function(){var e=this;null===this.cycle&&(this.cycle=1),this.timer=setTimeout((function(){var t=e.fetchData(0),n=t.length;-1===e.storeLen&&(e.storeLen=n),0!==e.storeLen&&n/e.storeLen>=2&&e.curSpeed>e.MIN_SPEED&&(e.curSpeed-=1e3),(0===n||e.storeLen/n>=2)&&e.curSpeed<e.MAX_SPEED&&(e.curSpeed+=1e3),e.startSend(t,0),e.startCycle()}),this.curSpeed)},e.prototype.getOutInterface=function(){var e=this;return{api:{getMouseLocus:function(t,n){return e.getData(e.mouse,t,n)},getKeyRecord:function(t,n){return e.getData(e.key,t,n)},getScrollRecord:function(t,n){return e.getData(e.scroll,t,n)},startAPI:function(){return e.singleInit()}},send:{debug:function(){e.debug=!0},send:function(t,n){return e.send(t,n)},sendNow:function(t,n,i){return e.sendNow(t,n,i)},sendPack:function(t,n,i){t&&"string"==typeof t&&e.keyMap[t]&&n&&(e.pushData(t,n,i),null===e.cycle&&e.startCycle())}},hostEnum:this.hostEnum}},e}(),loggerInstance=new Logger(headScript_pc_static_index.BDSInstance);function extendAjaxPartsFilter(){$.ajaxPrefilter("parts",(function(e,t,n){e.partsCallback=[],e.partsIndex=0,n.parts=function(t){e.partsCallback.push(t)},e.parts&&n.parts(e.parts),e.converters["* parts"]=function(e){return e}}))}function extendAjaxPartsTransport(){$.ajaxTransport("parts",(function(e){var t=function(){};return{send:function(n,i){var a=e.xhr();(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)&&Object.keys(e.xhrFields).forEach((function(t){a[t]=e.xhrFields[t]}));e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),Object.keys(n).forEach((function(e){n[e]!==undefined&&a.setRequestHeader(e,"".concat(n[e]))})),a.send(e.hasContent&&e.data||null),t=function(n,o){var s=0,r=null,l=null;if(3!==a.readyState&&4!==a.readyState||o||function(){var t=e.delimiter,n="";try{n=a.responseText}catch(l){console.warn("extends ajax error",l.message)}if(""!==n){var i=-1,o=-1,s=0,r=0;if(t)for(;;){for(;s<=e.partsIndex&&(o=-1===i?0:i+t.length,-1!==(i=n.indexOf(t,o)));s++);if(-1===i&&4!==a.readyState)return;for(r=0;r<e.partsCallback.length;r++)e.partsCallback[r].call(a,n.substring(o,-1===i?n.length:i),e.partsIndex,n);if(e.__partsIndex++,-1===i)return}else for(s=0;s<e.partsCallback.length;s++)e.partsCallback[s].call(a,n)}}(),t&&(o||4===a.readyState))if(t=undefined,a.onreadystatechange=jQuery.noop,o)4!==a.readyState&&a.abort();else{l={},s=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{r=a.statusText}catch(c){r=""}s||!e.isLocal||e.crossDomain?1223===s&&(s=204):s=l.text?200:404}l&&i(s,r,l,a.getAllResponseHeaders())},e.async?4===a.readyState?setTimeout(t):a.onreadystatechange=t:t()},abort:function(){t&&t(undefined,!0)}}}))}function extendsAjaxParts(){extendAjaxPartsFilter(),extendAjaxPartsTransport()}var DefaultQuery=function(){function e(e,t){this.defaultQuery="",this.isSupportLocalStorge=!0,this.defaultQueryHis={},this.input=null,this.defaultQuery=e.comm.dpquery,this.input=t,this.isSupportLocalStorge=headScript_pc_static_index.isSupportLocalStorage(),this.defaultQueryHis=headScript_pc_static_index.isSupportLocalStorage()?this.getDefaultQueryHis():{},this.getDefaultQueryHisCount(this.defaultQuery,this.defaultQueryHis)>9&&(this.defaultQuery="")}return e.prototype.initDefaultQuery=function(e){var t=this;if(this.defaultQuery){var n=headScript_pc_static_index.getBrowserInfo(),i=this.isSupportNAPlaceholder(n);this.createPlaceholder(this.input,i,this.defaultQuery),this.isSupportLocalStorge&&this.recordDefaultQuery(this.defaultQuery,this.defaultQueryHis),e.lifecycle.onIndexOff((function(){t.removePlaceHolder(t.input,i),e.comm.dpquery=""}),{once:!0})}},e.prototype.getDefaultQueryHis=function(){try{return JSON.parse(localStorage.getItem("index_ls_default_query"))}catch(e){return{}}},e.prototype.getDefaultQueryHisCount=function(e,t){var n=0;return(null==t?void 0:t.query)===e&&(null==t?void 0:t.count)&&(n=t.count),n},e.prototype.isSupportNAPlaceholder=function(e){if(e.ie)return!1;var t="[object OperaMini]"===Object.prototype.toString.call(window.operamini);return"placeholder"in document.createElement("input")&&!t},e.prototype.createPlaceholder=function(e,t,n){if(t)e.attr("placeholder",n);else{var i='<div class="kw-placeholder">'.concat(n,"</div>");e.before(i),$(".kw-placeholder").on("click",(function(t){e.focus(),t.target=e.get(0),e.trigger(t)})),$(document).ready((function(){var t;$(".kw-placeholder").toggleClass("placeholders-hidden",(null===(t=e.val())||void 0===t?void 0:t.length)>0)})),e.on("keydown keyup cut paste setValue input",this.checkInputValue(e))}},e.prototype.checkInputValue=function(e){var t=e.val();setTimeout((function(){var n=e.val();(n!==t||n.length>0)&&$(".kw-placeholder").toggleClass("placeholders-hidden",n.length>0)}),0)},e.prototype.recordDefaultQuery=function(e,t){var n={query:e,time:(new Date).getTime(),count:1};(null==t?void 0:t.query)&&e===t.query&&t.count&&(n.count=t.count+1),setTimeout((function(){try{localStorage.removeItem("index_ls_default_query"),localStorage.setItem("index_ls_default_query",JSON.stringify(n))}catch(e){return!1}}),0)},e.prototype.removePlaceHolder=function(e,t){t?e.removeAttr("placeholder"):$(".kw-placeholder").remove()},e}(),Event$1=function(){function e(){this.eventMap={},this.events=this.eventMap}return e.prototype.listen=function(e,t){if("function"==typeof t){var n=this.getEvent(e);this.eventMap[n.name]=this.eventMap[n.name]||[],this.eventMap[n.name].push({prod:n.prod,callback:t})}},e.prototype.unlisten=function(e,t){for(var n=this.getEvent(e),i=this.eventMap[n.name]||[],a=0;a<i.length;){var o=i[a];t===o.callback&&this.eventLike(n.prod,o.prod)?i.splice(a,1):a++}},e.prototype.dispatch=function(e,t){for(var n=this.getEvent(e),i=this.eventMap[n.name]||[],a={data:t,eventId:e},o=0,s=i.length;o<s;o++){var r=i[o];try{this.eventLike(r.prod,n.prod)&&r.callback.call(this,a)}catch(l){}}},e.prototype.eventLike=function(e,t){return new RegExp("^"+e.replace(/\./g,"\\.").replace(/\*/g,".+")+"$").test(t)},e.prototype.getEvent=function(e){var t=e.match(/(.+)\.(.+)/);return t&&t[2]?{prod:t[1],name:t[2]}:{}},e.prototype.on=function(e,t){this.listen(e,t)},e.prototype.off=function(e,t){this.unlisten(e,t)},e.prototype.trigger=function(e,t){void 0===t&&(t={}),this.dispatch(e,t)},e}();function getSearchUrl(e,t){var n={tn:headScript_pc_static_index.BDSInstance.comm.tn,wd:e};t&&(n=Object.assign(n,t));var i=headScript_pc_static_index.objToStr(n,"&",{encode:!0});return"".concat("/s","?").concat(i)}var link={getSearchUrl:getSearchUrl},classPrefix="OP_LOG_",wiseClassPrefix="WA_LOG_",LOG_CLASS={TITLE:"TITLE",LINK:"LINK",IMG:"IMG",BTN:"BTN",INPUT:"INPUT",OTHERS:"OTHERS"},WISE_LOG_CLASS={TAB:"TAB",BTN:"BTN",SF:"SF",MSC:"MSC",VD:"VD",OTHER:"OTHER"},C_LOG_CLASS=["btn"],AntiSpam=function(){function AntiSpam(){this.index=0,this.mouseoverNum=0,this.firstMouseoverPoint={flag:!0,x:0,y:0},this.mouseoverTime=0,this.contentLeft=undefined,this.contentRight=undefined,this.contentTop=undefined}return AntiSpam.prototype.isResult=function(e){return!(1!==e.nodeType||!e.className)&&(!/result-molecule/.test(e.className)&&/\bresult(\-op)?\b/.test(e.className))},AntiSpam.prototype.isFrame=function(e){return 1===e.nodeType&&e.className&&/\bc\-frame\b/.test(e.className)},AntiSpam.prototype.setClickData=function(wrapEle,data){var sData=wrapEle.getAttribute("data-click")||"{}";try{var oData=eval("("+sData+")");sData=JSON.stringify(Object.assign(oData,data)),wrapEle.setAttribute("data-click",sData)}catch(e){}},AntiSpam.prototype.bindP5ClickData=function(e,t,n){this.index=n||this.getResultStartIndex(e[0]);for(var i=0,a=e.length;i<a;i++){var o=e[i];if(this.isChunkRoot(o))this.bindP5ClickData(o.children,t,this.getResultStartIndex(o));else if(this.isResult(o))this.setClickData(o,{p5:this.index++,area:t});else if(this.isFrame(o))try{for(var s=o.children[0].children,r=0,l=s.length;r<l;r++){var c=s[r];this.isResult(c)&&this.setClickData(c,{p5:this.index++,area:t})}}catch(d){}}},AntiSpam.prototype.isChunkRoot=function(e){return 1===e.nodeType&&!!e.classList&&e.classList.contains(modules_pc_static_services_loadMore_resultsPageContext.CHUNK_ROOT_CLASS)},AntiSpam.prototype.getResultStartIndex=function(e){return modules_pc_static_services_loadMore_resultsPageContext.getPageContextFromElement(e).resultStartIndex},AntiSpam.prototype.bindChunkClickData=function(e){var t=this.getResultStartIndex(e);this.bindP5ClickData(e.children,"LEFT",t)},AntiSpam.prototype.initAntiSpamResultClickLog=function(){var e=$("#content_left").get(0),t=$("#con-ar").get(0),n=$("#con-at").get(0);e&&this.bindP5ClickData(e.children,"LEFT"),t&&this.bindP5ClickData(t.children,"RIGHT"),n&&this.bindP5ClickData(n.children,"TOP")},AntiSpam.prototype.getCheckCode=function(e,t){var n=undefined;return(n=/link\?url\=([^\&]+)/.exec(e)||/\?url\=([^\.]+)\./.exec(e))?t+(n[1]&&n[1].length?n[1].length:0):t},AntiSpam.prototype.isSeNormal=function(e){return["se_com_default","se_st_robots","se_st_com_abstract","se_com_irregular_gallery"].includes(e.attr("tpl"))},AntiSpam.prototype.fixPcTypeNode=function(e,t){for(var n=null,i="",a="";e!==t&&null===n;)(i=$(e).attr("class")||"").replace(new RegExp(".*("+wiseClassPrefix+"\\w+).*"),(function(e,t){a=t})),a&&(n=e),e=e.parentNode;var o=i.replace(a,""),s="";if(a&&i!==a){switch(a.replace(wiseClassPrefix,"")){case WISE_LOG_CLASS.TAB:case WISE_LOG_CLASS.BTN:s=LOG_CLASS.BTN;break;case WISE_LOG_CLASS.SF:s=LOG_CLASS.LINK;break;case WISE_LOG_CLASS.MSC:case WISE_LOG_CLASS.VD:s=LOG_CLASS.BTN;break;case WISE_LOG_CLASS.OTHER:default:s=LOG_CLASS.OTHERS}$(n).attr("class",o+" "+classPrefix+s)}},AntiSpam.prototype.getType=function(e,t,n){this.fixPcTypeNode(t,n);for(var i=t,a=Object.getOwnPropertyNames(LOG_CLASS).map((function(e){return LOG_CLASS[e]})),o=a.length,s=C_LOG_CLASS,r=s.length,l=e.join(" "),c=0;i!==n;){for(c=0;c<o;c++)if($(i).hasClass("OP_LOG_"+a[c]))return a[c].toLowerCase();for(c=0;c<r;c++)if($(i).hasClass("c-"+s[c]))return s[c];i=i.parentNode}return/\bh3\d*\b/.test(l)?"title":/\ba\d*\b/.test(l)?/\bimg\d*\b/.test(l)?"img":"link":/\b(input|select|button|textarea|datalist)\d*\b/.test(l)||/\blabel\d*\b/.test(l)&&t.getElementsByTagName("input").length>0?"input":""},AntiSpam.prototype.sendLog=function(e,t,n,i,a){if(null==t.getAttribute("data-nolog")){var o=this.getType(e,t,n);if(o&&("title"!==o||/\ba\d*\b/.test(e))){var s="http://nourl.ubs.baidu.com",r=n.getAttribute("mu")||s;if(r===s){var l=n.getElementsByTagName("h3");if(l&&l[0]){var c=l[0].getElementsByTagName("a");r=c&&c[0]?c[0].href:r}}var d=e.length,u=undefined,p=t,h=n.getAttribute("srcid"),f="",m=1===t.nodeType?t.tagName.toLowerCase():"";if("input"===o)if(/input|textarea/.test(m))f=t.value,t.type&&"password"===t.type.toLowerCase()&&(f="");else if(/select|datalist/.test(m)){if(t.children.length>0){var g=t.selectedIndex||0;f=t.children[g>-1?g:0].innerHTML}}else f=t.innerHTML||t.value||"";else if("img"===m&&(f=t.title),!f)for(;d>0;){if(d--,/^a\d*\b/.test(e[d])){if(u=p.href,f=p.innerHTML,null!=p.getAttribute("data-nolog"))return;break}if(p.className&&/OP_LOG_/.test(p.className)){f=p.innerHTML;break}p=p.parentNode}f=$.trim(f),u&&"#"!==u.slice(-1)&&u.startsWith("http")||(u=r);var _={rsv_xpath:e.join("-")+"("+o+")",title:f,url:u,rsv_height:n.offsetHeight,rsv_width:n.offsetWidth,rsv_tpl:n.getAttribute("tpl")},v={url:1,title:1};n.id&&n.id.match(/^\d+$/)&&(_.p1=n.id),h&&(_.rsv_srcid=h);var b=undefined,y=undefined,w=undefined;p=t;do{if(null!=p.getAttribute("data-nolog"))return;if(b=p.getAttribute("data-click")||p.getAttribute("data-click-info"))try{for(y in b=new Function("return "+b)())"fm"===y&&null===b.fm&&(w=!0),b.hasOwnProperty(y)&&("undefined"==typeof _[y]||v[y])&&(_[y]=b[y])}catch(a){}p=p.parentNode}while(p&&p!==n.parentNode);for(var S in _)null===_[S]&&delete _[S];if("title"===o?"mu"in _&&delete _.mu:_.mu||(_.mu=r),w)"fm"in _&&delete _.fm;else if("input"===o&&(_.fm="beha",_.url=s),_.fm||(_.fm=i),!_.fm)return;var C=(new Date).getTime(),T=this.mouseoverNum,k=a.screenX,x=this.firstMouseoverPoint.y,E=C-this.mouseoverTime;if(this.isSeNormal($(n))){_.ck1=T,_.ck3=k,_.ck4=a.screenY,_.ck5=this.firstMouseoverPoint.x,_.ck6=x,_.ck7=E;var I=T+k+x+E;_.ck0=this.getCheckCode(_.url,I)}var L=T+k+x+E;_.ala_anti="ck0@"+this.getCheckCode(_.url,L)+",ck1@"+T+",ck3@"+k+",ck6@"+x+",ck7@"+E;var A=modules_pc_static_services_loadMore_resultsPageContext.getPageContextFromElement(n).qid,P=window.bds.comm.sampleVariable||{},D=window.bds.comm.nodeSample||[];if("1"===P.PC_RESULT_LOAD_MORE||D.indexOf("PC_RESULT_LOAD_MORE")>-1){var N={};if(_.extra)try{N="string"==typeof _.extra?JSON.parse(_.extra):_.extra}catch(a){N={}}var M=document.querySelector('#content_left > .page-bd[current="true"]'),O=Number(null==M?void 0:M.getAttribute("rank"));N.visible_page=O||1,_.extra=JSON.stringify(N)}window.c(_,A)}}},AntiSpam.prototype.getXPath=function(e,t,n){if(n=n||[],e===(t=t||document))return n;e.parentNode!==t&&(n=this.getXPath(e.parentNode,t,n));var i=1;if(e.previousSibling){var a=e.previousSibling;do{1===a.nodeType&&a.nodeName===e.nodeName&&i++,a=a.previousSibling}while(a)}if(1===e.nodeType){var o=e.nodeName.toLowerCase()+(i>1?i:"");o&&e.getAttribute("data-module")&&(o+="("+e.getAttribute("data-module")+")"),n.push(o)}return n},AntiSpam.prototype.bindLogEvent=function(){var e=this,t=$("body"),n=this;t.on("mouseover",".result",(function(e){e=window.event||e,n.isSeNormal($(this))&&(n.mouseoverNum++,n.mouseoverTime=(new Date).getTime(),n.firstMouseoverPoint.flag&&(n.firstMouseoverPoint={flag:!1,x:e.screenX,y:e.screenY}))})),t.on("mousedown",(function(t){var n=(t=window.event||t).srcElement||t.target,i=$(n);try{for(var a=i,o=undefined;a.length&&!(a.hasClass("result")||a.hasClass("result-op")||a.hasClass("xpath-log"));)a=a.parent();if(!a.length)return;a.hasClass("result-op")?o="alop":a.hasClass("result")&&(o="as");var s=a.get(0),r=e.getXPath(n,s);e.sendLog(r,n,s,o,t)}catch(t){}}))},AntiSpam}(),antiSpam=new AntiSpam;function initOpenIme(){headScript_pc_static_index.BDSInstance.se.openIme=function(e){window.bdime?window.imeObj.set("py",!0):new Promise((function(e,t){require(['bottom-script/pc/static/ime/ime'],e,t)})).then((function(t){var n=t.imeObj;window.imeObj=n,e&&n.set("py",!0)}))}}function setFootStyle(){var e=headScript_pc_static_index.BDSInstance.comm.upn&&"msie"===headScript_pc_static_index.BDSInstance.comm.upn.browser&&6===headScript_pc_static_index.BDSInstance.comm.upn.ie,t=$("#foot");if(t.addClass("foot_fixed_bottom"),e){var n=$(window).height()+$(window).scrollTop()-t.outerHeight(!0);t.css("top",n+"px")}e&&$(window).on("resize.setFootStyle, scroll.setFootStyle",(function(){!function(){var e=$("#foot"),t=$(window).height()+$(window).scrollTop()-e.outerHeight(!0);e.css("top",t+"px")}()}))}function initSetFootStyleEvent(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){$(".content_none").length>0&&setFootStyle()}))}function registerTip(){bds.se.tip=bds.se.tip||{},bds.comm.tipZIndex=220,bds.comm.tips=[],bds.se.tip=function(e){this.init=function(){this.op={target:e.target||{},mode:e.mode||"over",title:e.title||null,content:e.content||null,uncontrolled:!!e.uncontrolled,arrow:{has:1,offset:10,r:!1,c:!1},close:e.close||0,align:e.align||"left",offset:{x:10,y:20},arrowSize:16},e.arrow&&(this.op.arrow.has=0===e.arrow.has?0:1,this.op.arrow.offset=e.arrow.offset>=0?e.arrow.offset:10,this.op.arrow.r=e.arrow.r,this.op.arrow.c=e.arrow.c,e.arrow.excursion&&(this.op.arrow.excursion=e.arrow.excursion)),e.offset&&(this.op.offset.x=e.offset.x||0===e.offset.x?e.offset.x:10,this.op.offset.y=e.offset.y||0===e.offset.y?e.offset.y:20),this.ext=e.ext||{},this.dom=$("<div>",{"class":e.wrapClass?e.wrapClass:"c-tip-con"}),this.visible=!1,this.rendered=!1,this.isAuto="auto"===this.op.align,this.bindEvent()},this.render=function(){this.op.close&&this.enableCloseIcon(),this.op.title&&this.setTitle(this.op.title),this.op.content&&this.setContent(this.op.content),this.op.arrow.has&&this.enableArrow(),$("#c-tips-container").append(this.dom)},this.bindEvent=function(){var e=this;this.delay={overIcon:null,outIcon:null,overDom:null,outDom:null},"over"===this.op.mode?($(this.op.target).on("mouseenter",(function(){window.clearTimeout(e.delay.outIcon),window.clearTimeout(e.delay.outDom),e.delay.overIcon=setTimeout((function(){e.show()}),200)})),this.dom.on("mouseenter",(function(){window.clearTimeout(e.delay.outIcon),window.clearTimeout(e.delay.outDom),e.delay.overDom=setTimeout((function(){e.show()}),200)})),$(this.op.target).on("mouseleave",(function(){window.clearTimeout(e.delay.overIcon),window.clearTimeout(e.delay.overDom),e.delay.outIcon=setTimeout((function(){e.hide()}),200)})),this.dom.on("mouseleave",(function(){window.clearTimeout(e.delay.overIcon),window.clearTimeout(e.delay.overDom),e.delay.outIcon=setTimeout((function(){e.hide()}),200)}))):"none"===this.op.mode&&this.show()},this.enableArrow=function(){var e=undefined;e=this.op.arrow.r?$("<div>",{"class":"c-tip-arrow"}).html("<em></em><ins class='c-tip-arrow-r'></ins>").appendTo(this.dom):this.op.arrow.c?$("<div>",{"class":"c-tip-arrow"}).html("<em></em><ins class='c-tip-arrow-c'></ins>").appendTo(this.dom):$("<div>",{"class":"c-tip-arrow"}).html("<em></em><ins></ins>").appendTo(this.dom),this.arrow=e},this.enableCloseIcon=function(){var e=this;var t=$("<div>",{"class":"c-tip-close"}).html("<i class='c-icon c-tips-icon-close'>&#xe610;</i>").appendTo(this.dom).click((function(){e.hide()}));this.close=t},this.setTitle=function(e){var t=undefined;t=e.nodeType?$("<h3>",{"class":"c-tip-title"}).append(e).appendTo(this.dom):$("<h3>",{"class":"c-tip-title"}).html(e).appendTo(this.dom),this.title=t},this.setContent=function(e){var t=$("<div>").html(e).appendTo(this.dom);this.content=t},this.setArrow=function(e){if(e&&e.offset>=0&&(this.op.arrow.offset=e.offset),this.op.arrow.has&&this.arrow)switch(this.op.align){case"left":this.arrow.css({left:this.op.arrow.offset+"px"});break;case"right":this.arrow.css({right:this.op.arrow.offset+16+"px"})}},this.setOffset=function(e){e&&(this.op.offset.x=e.x||0===e.x?e.x:this.op.offset.x,this.op.offset.y=e.y||0===e.y?e.y:this.op.offset.y);var t=undefined;switch(this.op.align){case"left":t=$(this.getTarget()).offset(),this.getDom().css({top:t.top+this.op.offset.y+"px",left:t.left-this.op.offset.x+"px"});break;case"right":t=$(this.getTarget()).offset(),this.getDom().css({top:t.top+this.op.offset.y+"px",left:t.left+this.op.offset.x+$(this.getTarget()).width()-this.getDom().width()+"px"})}},this.autoOffset=function(){var e=this.dom.outerWidth(),t=this.dom.outerHeight(),n=$(this.getTarget()),i=n.offset(),a=n.outerWidth(),o=n.outerHeight(),s=$(window),r=s.scrollTop(),l=s.width(),c={left:0,top:0},d={};s.height()+r-o-i.top>t?(c.top=o+i.top+this.op.arrowSize/2,this.arrow&&this.arrow.removeClass("c-tip-arrow-down")):i.top-r>t?(c.top=i.top-t-this.op.arrowSize/2,this.arrow&&this.arrow.addClass("c-tip-arrow-down")):(c.top=o+i.top+this.op.arrowSize/2,this.arrow&&this.arrow.removeClass("c-tip-arrow-down"));var u=i.left+a/2-this.op.arrow.offset-this.op.arrowSize/2;c.left=u,c.left>0&&c.left+e>l?(c.left=i.left+a/2-e+this.op.arrow.offset+this.op.arrowSize/2,d.right=this.op.arrow.offset+this.op.arrowSize,d.left="auto",c.left<0&&(c.left=u,d.left=this.op.arrow.offset,d.right="auto")):(d.left=this.op.arrow.offset,d.right="auto"),this.dom.css(c);var p=this.op.arrow.excursion&&this.op.arrow.excursion.x?this.op.arrow.excursion.x:0;d.left=this.op.arrow.offset+p,this.arrow&&this.arrow.css(d)},this.enable=function(){},this.disable=function(){},this.destroy=function(){},this.show=function(){this.visible||(this.onShow(),this.rendered||(bds.comm.tips.push(this),this.render(),this.rendered=!0),this.isAuto?this.autoOffset():(this.setOffset(),this.setArrow()),this.dom.css({"z-index":bds.comm.tipZIndex}),bds.comm.tipZIndex++,this.dom.css({display:"block"}),this.visible=!0)},this.hide=function(){this.visible&&(this.dom.css({display:"none"}),this.onHide(),this.visible=!1)},this.onShow=e.onShow||function(){},this.onHide=e.onHide||function(){},this.getTarget=function(){return this.op.target},this.getDom=function(){return this.dom},this.init()},$(document).mousedown((function(e){for(var t=(e=e||window.event).target||e.srcElement;t&&t.tagName&&t!==document.body&&"html"!==t.tagName.toLowerCase()&&(!t.className||!t.className.indexOf||-1===t.className.indexOf("c-tip-con"));)t=t.parentNode;t&&t.className&&t.className.indexOf&&-1===t.className.indexOf("c-tip-con")&&$(bds.comm.tips).each((function(){this.op.uncontrolled||this.op.close&&this.hide()}))}))}function registerHps(){var e=window.sethfPos||0,t="//www.baidu.com/",n=headScript_pc_static_index.isIEBrowser()&&!window.opera,i="百度一下,你就知道",a="";function o(e){if(e){var t=e.parentNode;t&&(t.style.marginBottom="20px",t.style.marginTop="2px")}}if(window.fa=function(e){try{window.sidebar?window.sidebar.addPanel(i,t,""):window.opera&&window.print?(e.setAttribute("rel","sidebar"),e.setAttribute("href",t),e.setAttribute("title",i),e.click()):window.external.AddFavorite(t,i)}catch(n){}},n)try{var s=/se /gi.test(navigator.userAgent),r=/AppleWebKit/gi.test(navigator.userAgent)&&/theworld/gi.test(navigator.userAgent),l=/theworld/gi.test(navigator.userAgent),c=/360se/gi.test(navigator.userAgent),d=/360chrome/gi.test(navigator.userAgent),u=/greenbrowser/gi.test(navigator.userAgent),p=/qqbrowser/gi.test(navigator.userAgent),h=/tencenttraveler/gi.test(navigator.userAgent),f=/maxthon/gi.test(navigator.userAgent),m=/krbrowser/gi.test(navigator.userAgent),g=!1;try{g=+external.twGetVersion(external.twGetSecurityID(window)).replace(/\./g,"")>1013}catch(b){}if(s||g||r||l||c||d||u||p||h||f||m){(v=e?document.getElementById("set_f"):document.getElementById("setf"))&&e&&(o(v),a="favorites")}else{var _=e?document.getElementById("set_f"):document.getElementById("setf");_&&e&&(o(_),a="home"),_.setAttribute("onClick","h(this)"),_.setAttribute("onmousedown","return ns_c({'fm':'behs','tab':'homepage','pos':0})"),_.href="/",_.target="_self",_.id="seth"}}catch(b){}else{var v=e?document.getElementById("set_f"):document.getElementById("setf");e&&(o(v),a="favorites")}a&&e&&window.ns_c({fm:"sethf_show",tab:a})}function user_c(e){var t="",n="",i=encodeURIComponent(window.document.location.href),a=window["BD_PS_C"+(new Date).getTime()]=new Image,o=bds&&bds.util&&bds.util.domain?bds.util.domain.get("http://nsclick.baidu.com"):"http://nsclick.baidu.com";for(var s in e){switch(s){case"title":n=encodeURIComponent(e[s].replace(/<[^<>]+>/g,""));break;case"url":n=encodeURIComponent(e[s]);break;default:n=e[s]}t+=s+"="+n+"&"}return a.src=o+"/v.gif?pid=201&pj=psuser&"+t+"path="+i+"&wd=&t="+(new Date).getTime(),!0}function initPassV3(){var e=bds.comm.passnew?3:2,t=bds.comm.sampleval&&-1!==bds.comm.sampleval.indexOf("login_prize_log")?{sid:"login_prize_log"}:{};bds.se.passv3=window.passport.pop.init({loginVersion:"v5",composeTemplate:1,apiOpt:{logParams:t,loginType:1,product:"mn",u:window.document.location.href,safeFlag:0,qrcode:e,staticPage:location.protocol+"//www.baidu.com/cache/user/html/v3Jump.html",sms:5},cache:!1,tangram:!0,authsite:["qzone","tsina","weixin"],authsiteCfg:{act:"implicit",display:"popup",jumpUrl:location.protocol+"//www.baidu.com/cache/user/html/xd.html",onBindSuccess:function(e,t){var n=decodeURIComponent(t.passport_uname||t.displayname);return bds.se.login.success(n),!1}},onLoginSuccess:function(e){e.returnValue=!1;var t=e.rsp.data.userName||e.rsp.data.mail||e.rsp.data.phoneNumber;bds.se.login.success(t)},onHide:function(){bds.se.login.setSubpro(""),bds.se.login.setMakeText("")}}),bds.se.passv3.setCallback&&bds.se.passv3.setCallback({onLoginSuccess:function(e){e.returnValue=!1;var t=e.rsp.data.userName||e.rsp.data.mail||e.rsp.data.phoneNumber;bds.se.login.success(t)},onHide:function(){bds.se.login.setSubpro(""),bds.se.login.setMakeText("")}})}function getLogin(){var e="",t=!1,n="";return{setUserInfo:function(e){(e||bds.comm.user)&&$("#lb").replaceWith('<a href="https://www.baidu.com/my/index" class="username">'+headScript_pc_static_index.escapeHTML(bds.comm.username)+'<i class="c-icon"></i></a>')},open:function(i){t?(bds.se.passv3.setSubpro(e),bds.se.passv3.setMakeText(n),bds.se.loginCallbackFunc=i||function(){window.document.location.reload(!0)},bds.se.passv3.show()):$.getScript(location.protocol+"//passport.baidu.com/passApi/js/uni_login_wrapper.js?cdnversion="+(new Date).getTime(),(function(){initPassV3(),t=!0,bds.se.passv3.setSubpro(e),bds.se.passv3.setMakeText(n),bds.se.loginCallbackFunc=i||function(){window.document.location.reload(!0)},bds.se.passv3.show()}))},success:function(e){if(bds.comm){bds.comm.user=e,bds.comm.username=e,window.bdUser=e,bds.se.passv3.hide(),bds.se.loginCallbackFunc.call(window,1,e);for(var t=0;t<bds.comm.loginAction.length;t++)bds.comm.loginAction[t].call(window,1,e)}},setSubpro:function(t){e=t},setMakeText:function(e){n=e}}}function registerUserInstantSearch(){window.user_c=user_c,bds.se.loginCallbackFunc=null,bds.se.login=getLogin(),window._invoke_login=function(e,t){bds.se.login.open(e,t)}}function queryHijack(){var e=null,t=[];if(top.location!==self.location){try{for(var n=top.document.getElementsByTagName("frame"),i=top.document.getElementsByTagName("iframe"),a=0;a<n.length;a++)t.push(n[a].getAttribute("src"));for(a=0;a<i.length;a++)t.push(i[a].getAttribute("src"))}catch(o){}window.ns_c({fm:"frm",top:encodeURIComponent(top.location.href),furls:encodeURIComponent(t.join("|"))}),t&&((e=document.createElement("script")).src="http://isphijack.baidu.com/index.php?cb=isp_hijack&urls="+encodeURIComponent(t.join("|"))+"&t="+ +new Date,document.body.appendChild(e))}}function registerHr(){try{if(window.console&&window.console.log){var e=new Date,t=e.getFullYear(),n=e.getMonth()+1>6?t+1:t;console.log("无畏是青春的态度,热AI是时代的脉搏。\n各位新同学正以无畏的姿态奔赴通用人工智能的星辰大海!\n作为引领AI时代浪潮的主力军,广阔舞台,待你大展身手。\n乘风破浪,勇往直前,未来百度将与你一起,创造无限可能!"),console.log("%c百度".concat(n,"校园招聘简历投递:https://talent.baidu.com/jobs/list"),"color:red")}}catch(i){}}function shareInit(){var e;"undefined"!=typeof bds&&bds.util&&bds.util.domain&&bds.util.domain.get?(e=bds.util.domain.get("s.share.baidu.com"),bds.util.domain.get("bdimg.share.baidu.com")):e="http://s.share.baidu.com";var t=[{id:"weixin",name:"微信"},{id:"tsina",name:"新浪微博"},{id:"tqf",name:"腾讯朋友"},{id:"douban",name:"豆瓣网"},{id:"qzone",name:"QQ空间"},{id:"sqq",name:"QQ好友"}],n=function(){var e=[];e.push('<div class="bds_v2_share_box">'),e.push('<p class="bds_v2_title">分享至:</p>');for(var n=0,i=t.length;n<i;n++){var a='<a href="#" onclick="return false;" data-cmd="#{id}" class="bds_v2_#{id}"><span class="bds_icon_v3 #{id}"></span><span class="bds_icon_v3_border"></span><span style="padding-left:4px;position:relative;top:-4px;">#{name}</span></a>'.replace(/#\{(.+?)\}/g,(function(e,i){return t[n][i]}));e.push(a)}return e.push("</div>"),e.join("")}(),i=function(e){(function(e){if(/msie (\d+\.\d+)/i.test(navigator.userAgent))document.createStyleSheet().cssText=e;else{var t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(e)),document.getElementsByTagName("HEAD")[0].appendChild(t)}})(".bds_icon_v3{display:inline-block;background-image:url('https://b.bdstatic.com/searchbox/icms/searchbox/img/search_pc_share_icons.png');height:18px;width:18px;background-size:108px 18px;background-repeat:no-repeat;position:relative;z-index:1;}.bds_icon_v3_border{width:16px;height:16px;border-radius:50%;border: 1px solid rgba(0,0,0,.05);z-index:10;position:absolute;top:0;left:0;}.bds_icon_v3.sqq{background-position:0px 0px;}.bds_icon_v3.weixin{background-position:-18px 0px;}.bds_icon_v3.tsina{background-position:-36px 0px;}.bds_icon_v3.qzone{background-position:-54px 0px;}.bds_icon_v3.tqf{background-position:-72px 0px;}.bds_icon_v3.douban{background-position:-90px 0px;}.bds_v2_share_box{margin-right:-20px;zoom:1;}.bds_v2_share_box:after{content:'\\20';display:block;height:0;clear:both;}.bds_v2_share_box .bds_v2_title{font-size:13px;color:#333;padding:0 0 10px;margin:0;}.bds_v2_share_box a{float: left;display: inline-block;width: 46%;margin-bottom: 10px;color: #333;font-size: 13px;height: 18px;position: relative;}.bds_v2_share_box a:hover{text-decoration:underline;}.bds_v2_share_box a:nth-child(odd){margin-left: 8%;}.bd_weixin_popup_bg{position:absolute;top:-400px;left:-400px;z-index:11000;margin:0;padding:0;width:auto;height:320px;border:0;opacity:0;filter:alpha(opacity=0)}.bd_weixin_popup{border-radius: 16px;box-shadow: 0 2px 10px 0 rgba(0,0,0,0.10);position:absolute;top:-400px;left:-400px;z-index:11001;padding:16px 16px 15px 16px;width:auto;background:#fff;font-size:13px}.bd_weixin_popup .bd_weixin_popup_head{position:relative;color:#222;text-align:left;font-size:14px;line-height:16px;margin-bottom:20px;}.bd_weixin_popup .bd_weixin_popup_head .bd_weixin_popup .bd_weixin_popup_head .bd_weixin_popup_close:hover{text-decoration:none}.bd_weixin_popup .bd_weixin_popup_foot{margin-top:20px;color:#626675;text-align:left;font-size:13px;line-height:13px;}.bds_v2_share_box a:active{color:#F73131;}"),e.boxEle.innerHTML=n},a=function(t,n){var i=e.target||t.srcElement;i&&"a"!==i.nodeName.toLowerCase()&&(i=i.parentElement);var a=i.getAttribute("data-cmd");if(a){var r={url:n.url||"",to:a,pic:n.pic||"",title:n.txt||"",desc:n.txt||"",apiType:"100",type:"text"},l="",c="";for(var d in r){var u="&"+d+"="+encodeURIComponent(r[d]);l+=u,"url"!=d&&(c+=u)}l=l.substr(1),c="http://s.share.baidu.com/?"+(c=c.substr(1));var p="//www.baidu.com/tools?url="+encodeURIComponent(n.url)+"&jump="+encodeURIComponent(c)+"&key=url";"weixin"===a?($(".c-tip-close").click(),o(n.url)):window.open(p,"bdShare","toolbar=0, scrollbars=1, status=0, resizable=1, height=400, width=600"),s(e+"/commit?"+l),n.callback&&n.callback()}},o=function(e){var t,n,i,a=function(){t.hide(),n.hide()},o=function(){var e=$(window).scrollTop(),i=t.outerWidth(),a=t.outerHeight(),o=$(window).width(),s=($(window).height()-a)/2+e,r=(o-i)/2;s=s<0?0:s,r=r<0?0:r,n.css({left:r,top:s}),t.css({left:r,top:s})},s=function(){t.find(".bd_weixin_popup_close").click(a),$("body").on("keydown",(function(e){27==e.keyCode&&a()})),$(window).resize((function(){o()}))};(function(){var e="bdshare_weixin_qrcode_dialog";if(t=$("#"+e),n=$("#"+e+"_bg"),t.length<1){var a='<iframe id="'+e+'_bg" class="bd_weixin_popup_bg"></iframe>',r=['<div id="'+e+'" class="bd_weixin_popup new-pmd">','<div class="bd_weixin_popup_head">',"<span>分享到微信朋友圈</span>",'<i href="#" onclick="return false;" class="bd_weixin_popup_close c-icon c-tips-icon-close">&#xe610;</i>',"</div>",'<div id="'+e+'_qr" class="bd_weixin_popup_main"></div>','<div class="bd_weixin_popup_foot">打开微信,点击底部的“发现”,<div style="height: 8px;"></div>使用“扫一扫”即可将网页分享至朋友圈。</div>',"</div>"].join("");n=$(a).appendTo("body"),t=$(r).appendTo("body"),s()}i=t.find("#"+e+"_qr"),t.show(),n.show(),o()})(),t.attr("data-url")!=e&&(i.html("正在加载"),function(e,n){function a(e,t){if(e.length==undefined)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var i=0;i<e.length-n;i++)this.num[i]=e[i+n]}function s(){this.buffer=new Array,this.length=0}function r(e,t){this.totalCount=e,this.dataCount=t}function l(e){this.mode=w.MODE_8BIT_BYTE,this.data=e}function c(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new Array}for(var d=0,u=1,p=2,h=3,f=4,m=5,g=6,_=7,v={glog:function(e){if(e<1)throw new Error("glog("+e+")");return v.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return v.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},b=0;b<8;b++)v.EXP_TABLE[b]=1<<b;for(b=8;b<256;b++)v.EXP_TABLE[b]=v.EXP_TABLE[b-4]^v.EXP_TABLE[b-5]^v.EXP_TABLE[b-6]^v.EXP_TABLE[b-8];for(b=0;b<255;b++)v.LOG_TABLE[v.EXP_TABLE[b]]=b;a.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),n=0;n<this.getLength();n++)for(var i=0;i<e.getLength();i++)t[n+i]^=v.gexp(v.glog(this.get(n))+v.glog(e.get(i)));return new a(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=v.glog(this.get(0))-v.glog(e.get(0)),n=new Array(this.getLength()),i=0;i<this.getLength();i++)n[i]=this.get(i);for(i=0;i<e.getLength();i++)n[i]^=v.gexp(v.glog(e.get(i))+t);return new a(n,0).mod(e)}};var y={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;y.getBCHDigit(t)-y.getBCHDigit(y.G15)>=0;)t^=y.G15<<y.getBCHDigit(t)-y.getBCHDigit(y.G15);return(e<<10|t)^y.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;y.getBCHDigit(t)-y.getBCHDigit(y.G18)>=0;)t^=y.G18<<y.getBCHDigit(t)-y.getBCHDigit(y.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return y.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case d:return(t+n)%2==0;case u:return t%2==0;case p:return n%3==0;case h:return(t+n)%3==0;case f:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case m:return t*n%2+t*n%3==0;case g:return(t*n%2+t*n%3)%2==0;case _:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new a([1],0),n=0;n<e;n++)t=t.multiply(new a([1,v.gexp(n)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case w.MODE_NUMBER:return 10;case w.MODE_ALPHA_NUM:return 9;case w.MODE_8BIT_BYTE:case w.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case w.MODE_NUMBER:return 12;case w.MODE_ALPHA_NUM:return 11;case w.MODE_8BIT_BYTE:return 16;case w.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case w.MODE_NUMBER:return 14;case w.MODE_ALPHA_NUM:return 13;case w.MODE_8BIT_BYTE:return 16;case w.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,i=0;i<t;i++)for(var a=0;a<t;a++){for(var o=0,s=e.isDark(i,a),r=-1;r<=1;r++)if(!(i+r<0||t<=i+r))for(var l=-1;l<=1;l++)a+l<0||t<=a+l||0==r&&0==l||s==e.isDark(i+r,a+l)&&o++;o>5&&(n+=3+o-5)}for(i=0;i<t-1;i++)for(a=0;a<t-1;a++){var c=0;e.isDark(i,a)&&c++,e.isDark(i+1,a)&&c++,e.isDark(i,a+1)&&c++,e.isDark(i+1,a+1)&&c++,0!=c&&4!=c||(n+=3)}for(i=0;i<t;i++)for(a=0;a<t-6;a++)e.isDark(i,a)&&!e.isDark(i,a+1)&&e.isDark(i,a+2)&&e.isDark(i,a+3)&&e.isDark(i,a+4)&&!e.isDark(i,a+5)&&e.isDark(i,a+6)&&(n+=40);for(a=0;a<t;a++)for(i=0;i<t-6;i++)e.isDark(i,a)&&!e.isDark(i+1,a)&&e.isDark(i+2,a)&&e.isDark(i+3,a)&&e.isDark(i+4,a)&&!e.isDark(i+5,a)&&e.isDark(i+6,a)&&(n+=40);var d=0;for(a=0;a<t;a++)for(i=0;i<t;i++)e.isDark(i,a)&&d++;return n+Math.abs(100*d/t/t-50)/5*10}};s.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},r.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r.getRSBlocks=function(e,t){var n=r.getRsBlockTable(e,t);if(n==undefined)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var i=n.length/3,a=new Array,o=0;o<i;o++)for(var s=n[3*o+0],l=n[3*o+1],c=n[3*o+2],d=0;d<s;d++)a.push(new r(l,c));return a},r.getRsBlockTable=function(e,t){switch(t){case S.L:return r.RS_BLOCK_TABLE[4*(e-1)+0];case S.M:return r.RS_BLOCK_TABLE[4*(e-1)+1];case S.Q:return r.RS_BLOCK_TABLE[4*(e-1)+2];case S.H:return r.RS_BLOCK_TABLE[4*(e-1)+3];default:return undefined}};var w={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8};l.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}},c.prototype={addData:function(e){var t=new l(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var e=1;for(e=1;e<40;e++){for(var t=r.getRSBlocks(e,this.errorCorrectLevel),n=new s,i=0,a=0;a<t.length;a++)i+=t[a].dataCount;for(a=0;a<this.dataList.length;a++){var o=this.dataList[a];n.put(o.mode,4),n.put(o.getLength(),y.getLengthInBits(o.mode,e)),o.write(n)}if(n.getLengthInBits()<=8*i)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=c.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+n][t+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=y.getLostPoint(this);(0==n||e>i)&&(e=i,t=n)}return t},createMovieClip:function(e,t,n){var i=e.createEmptyMovieClip(t,n);this.make();for(var a=0;a<this.modules.length;a++)for(var o=1*a,s=0;s<this.modules[a].length;s++){var r=1*s;this.modules[a][s]&&(i.beginFill(0,100),i.moveTo(r,o),i.lineTo(r+1,o),i.lineTo(r+1,o+1),i.lineTo(r,o+1),i.endFill())}return i},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=y.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var i=e[t],a=e[n];if(null==this.modules[i][a])for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)this.modules[i+o][a+s]=-2==o||2==o||-2==s||2==s||0==o&&0==s}},setupTypeNumber:function(e){for(var t=y.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var i=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;n<18;n++)i=!e&&1==(t>>n&1),this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,i=y.getBCHTypeInfo(n),a=0;a<15;a++){var o=!e&&1==(i>>a&1);a<6?this.modules[a][8]=o:a<8?this.modules[a+1][8]=o:this.modules[this.moduleCount-15+a][8]=o}for(a=0;a<15;a++)o=!e&&1==(i>>a&1),a<8?this.modules[8][this.moduleCount-a-1]=o:a<9?this.modules[8][15-a-1+1]=o:this.modules[8][15-a-1]=o;this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,i=this.moduleCount-1,a=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var r=0;r<2;r++)if(null==this.modules[i][s-r]){var l=!1;o<e.length&&(l=1==(e[o]>>>a&1)),y.getMask(t,i,s-r)&&(l=!l),this.modules[i][s-r]=l,-1==--a&&(o++,a=7)}if((i+=n)<0||this.moduleCount<=i){i-=n,n=-n;break}}}},c.PAD0=236,c.PAD1=17,c.createData=function(e,t,n){for(var i=r.getRSBlocks(e,t),a=new s,o=0;o<n.length;o++){var l=n[o];a.put(l.mode,4),a.put(l.getLength(),y.getLengthInBits(l.mode,e)),l.write(a)}var d=0;for(o=0;o<i.length;o++)d+=i[o].dataCount;if(a.getLengthInBits()>8*d)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+8*d+")");for(a.getLengthInBits()+4<=8*d&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*d||(a.put(c.PAD0,8),a.getLengthInBits()>=8*d));)a.put(c.PAD1,8);return c.createBytes(a,i)},c.createBytes=function(e,t){for(var n=0,i=0,o=0,s=new Array(t.length),r=new Array(t.length),l=0;l<t.length;l++){var c=t[l].dataCount,d=t[l].totalCount-c;i=Math.max(i,c),o=Math.max(o,d),s[l]=new Array(c);for(var u=0;u<s[l].length;u++)s[l][u]=255&e.buffer[u+n];n+=c;var p=y.getErrorCorrectPolynomial(d),h=new a(s[l],p.getLength()-1).mod(p);for(r[l]=new Array(p.getLength()-1),u=0;u<r[l].length;u++){var f=u+h.getLength()-r[l].length;r[l][u]=f>=0?h.get(f):0}}var m=0;for(u=0;u<t.length;u++)m+=t[u].totalCount;var g=new Array(m),_=0;for(u=0;u<i;u++)for(l=0;l<t.length;l++)u<s[l].length&&(g[_++]=s[l][u]);for(u=0;u<o;u++)for(l=0;l<t.length;l++)u<r[l].length&&(g[_++]=r[l][u]);return g};var S={L:1,M:0,Q:3,H:2},C=new c(-1,S.L);C.addData(e),C.make();var T=function(e){var t=Math.round(200/e.length);t=t<2?2:t,tableWidth=t*e.length;for(var n=['<table style="direction:ltr;border: 0;border-collapse: collapse;background-color:#fff;margin:0 auto;" align="center">'],i=0,a=e.length;i<a;i++){n.push("<tr>");for(var o=0,s=e[i].length;o<s;o++)n.push('<td style="width:4px;height:4px;padding:0;margin:0;border:none;background:#'+(e[i][o]?"000":"FFF")+'"></td>');n.push("</tr>")}return n.push("</table>"),n.join("")}(C.modules);$(T).appendTo(i.empty()),tableWidth,$(".bd_weixin_popup_foot").height(),$(".bd_weixin_popup_head").height(),o(),t.attr("data-url",e)}(e))},s=function(e){(new Date).getTime();var t=new Image;t.onload=t.onerror=function(){},t.src=e+"&t="+(new Date).getTime(),t=null};return{render:function(e){try{bds&&bds.util&&bds.util.sendCVLog&&bds.util.sendCVLog("87_13",2,(new Error).stack)}catch(e){}e.boxEle&&(i(e),function(e){var t=e.boxEle.firstChild;"bds_v2_share_box"!=t.className&&(t=e.boxEle),t.addEventListener?t.addEventListener("click",(function(t){a(t,e)}),!1):t.attachEvent&&t.attachEvent("onclick",(function(t){a(t,e)}))}(e))}}}function registerShare(){bds.se.share=shareInit()}window.antiSpam=antiSpam,window.isp_hijack=function(e){var t=document.getElementById("wrapper"),n=null,i=!1,a=null,o=null;bds.comm.query||(i=!0),1==+e.stat&&((n=document.createElement("div")).innerHTML='<div style="zoom:1;_margin-left:1024px;"><div style="position:relative;_float:left;_margin-left:-1024px;"><div style="width:100%;min-width:1024px;"><div style="border:2px solid #fd9162;zoom:1;overflow:hidden;padding:0 0 6px 12px;"><div style="position:relative;width:100%;*overflow:auto;padding-top:10px;"><div style="height:18px;margin-bottom:6px;"><i class="c-icon" style="width:18px;height:18px;background-position:-168px -72px;"></i><strong style="display:inline-block;margin-left:8px;font-size:14px;color:#666;">百度提示您:</strong></div><span style="display:block;color:#333;text-indent:26px;font-size:13px;">我们发现当前您可能受到异常广告弹窗的影响,通常这是受第三方恶意劫持导致。使用 <a href="http://shadu.baidu.com/landingpage/competing.html?from=10064" target="_blank" style="color:#0000D0;text-decoration:underline">防恶意广告专版杀毒软件</a>,可有效改善您的上网体验,免受恶意广告的困扰。</span><a id="isp-close-btn" style="display:inline-block;width:9px;height:9px;position:absolute;top:6px;right:6px;background:url(https://pss.bdstatic.com/r/www/cache/static/protocol/https/global/img/wsCloseBtn2_0047ae2.png) no-repeat;" href="javascript:void(0);"></a></div></div></div></div></div>',i?t.insertBefore(n,t.children[0]):(t.style.position="relative",document.getElementById("u").style.top="0px",n.style.margin="-6px 0 8px 0",document.body.insertBefore(n,t)),o=(a=document.getElementById("isp-close-btn")).parentNode.getElementsByTagName("a")[0],a.onclick=function(){i?t.removeChild(n):(document.body.removeChild(n),t.style.position="",document.getElementById("u").style.top="4px")},a.onmousedown=function(){window.ns_c({fm:"behs",tab:"tj_notice",cont:"jcbro",action:"close",area:"topbar"})},o.onmousedown=function(){window.ns_c({fm:"behs",tab:"tj_notice",cont:"jcbro",action:"click",area:"topbar"})},window.ns_c({fm:"behs",tab:"tj_notice",cont:"jcbro",action:"show",area:"topbar"}))},$(queryHijack);var feedbackSelector=".c-tools, .cosc-feedback",feedbackIconSelector=".c-icon, .cos-icon";function favoInint(e,t){if(e){var n=/^https?:\/\/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/,i=n.exec(e.url)?n.exec(e.url)[0]:"",a=JSON.stringify({title:e.title||"",url:e.url||"",source:i});$.ajax({url:"/my/setfavo",type:"post",data:a,xhrFields:{withCredentials:!0},success:function(){o(['<div class="c-tip-notice">','<h3 class="c-tip-notice-succ">已收藏至:</h3>',"<ul>",'<li class="c-tip-item-succ">','<span class="favo-icon success-icon c-gap-right-xsmall"></span>个人中心','“<a href="https://www.baidu.com/my/index" target="_blank">我的收藏</a>”',"</li>","</ul>","</div>"].join(""))},error:function(){o(['<div class="c-tip-notice">','<h3 class="c-tip-notice-fail">收藏失败,请稍后再试</h3>',"</div>"].join(""))}})}function o(n){$(bds.comm.tips).each((function(){e.uncontrolled||this.hide()})),n&&new bds.se.tip({target:$(feedbackIconSelector,document.getElementById(t))[0],offset:{x:33,y:26},arrow:{has:0},mode:"none",close:1,content:n,wrapClass:"c-tip-con c-tools-tip-con c-tools-favo-tip-con"})}}function toolFavo(e,t){void 0===e&&(e={}),bds.comm.user?favoInint(e,t):bds.se.login&&bds.se.login.open&&bds.se.login.open((function(n){1===n&&favoInint(e,t)}))}function toolShare(e,t){void 0===e&&(e={}),$.getScript(bds.comm.host.share,(function(){$(bds.comm.tips).each((function(){e.uncontrolled||this.hide()}));var n=new bds.se.tip({target:$(feedbackIconSelector,t)[0],mode:"none",offset:{x:33,y:26},arrow:{has:0},close:1,content:'<div class="c-tools-share" style="width:164px;"></div>',wrapClass:"c-tip-con c-tools-tip-con c-tools-share-tip-con"}),i=$(".c-tools-share",n.dom.get(0))[0];bds.se.share.render({boxEle:i,url:e.url,txt:e.title+" -- 分享自百度搜索"})}))}function getFeedbackData(e){return e.getAttribute("data-tools")||e.getAttribute("data-feedback")||"{}"}function renderTool(tipEle){var ops=eval("("+getFeedbackData(tipEle)+")"),toolsDom=$("<div>",{"class":"c-tip-menu"}),toolsList=$("<ul>"),toolsFavo=$("<li>"),toolsFavoLink=$("<a>").html("收藏"),toolsFavoId=tipEle.getAttribute("id");toolsFavoLink.on("mousedown",(function(){toolFavo(ops,tipEle.getAttribute("id")),window.ns_c({fm:"tools",tab:"favo"})})),toolsFavoLink.on("mouseover",(function(){$(this).css("background-color","#ebebeb")})),toolsFavoLink.on("mouseout",(function(){$(this).css("background-color","#fff")})),toolsFavoId&&(toolsFavo.append(toolsFavoLink),toolsList.append(toolsFavo));var toolsShare=$("<li>"),toolsShareLink=$("<a>").html("分享");toolsShareLink.on("mousedown",(function(){toolShare(ops,tipEle),window.ns_c({fm:"tools",tab:"share"})})),toolsShareLink.on("mouseover",(function(){$(this).css("background-color","#ebebeb")})),toolsShareLink.on("mouseout",(function(){$(this).css("background-color","#fff")})),toolsShare.append(toolsShareLink);var vLogo=$(tipEle).parent().find(".vstar"),baoFlag=$(tipEle).parent().find(".c-trust-as.baozhang-new-v2"),vLevel=0,$resultContainer=$(tipEle).closest(".c-container"),resultTitleClassT=$resultContainer.find("h3.t"),resultTitleClassC=$resultContainer.find("h3.c-title"),officalTitle=resultTitleClassT.length>0&&resultTitleClassT||resultTitleClassC.length>0&&resultTitleClassC,$officalLogo=officalTitle&&officalTitle.children().length>1&&$(officalTitle.children()[1]),officalLogoHtmlStr=$officalLogo&&$officalLogo.html(),hasGangFangTxt=officalLogoHtmlStr&&officalLogoHtmlStr.includes("官方"),isOffical=hasGangFangTxt?1:0;vLogo&&vLogo.attr("hint-data")&&(vLevel=$.parseJSON(vLogo.attr("hint-data")).hint[0].vlevel),baoFlag.length>0&&(vLevel=8);var isAd=!!$(tipEle).parents(".EC_result").length,prefix="https://ufosdk.baidu.com/ufosdk/pcsearchreport",url=isAd?prefix+"/J39X6cZle8SknAlqNFxbTA%3D%3D/303989":prefix+"/FW3v08dQN4NmqIVXy4hmiw%3D%3D/218102",toolsReport=$("<li>").html("<a target=\"_blank\" onmousedown=\"window.ns_c({'fm': 'tools','tab':'report'})\" href=\""+bds.comm.host.bfe+"?url="+encodeURIComponent(ops.url)+"&jump="+encodeURIComponent(url+"?title="+encodeURIComponent(ops.title)+"&q="+encodeURIComponent(bds.comm.query)+"&has_gw="+isOffical+"&has_v="+vLevel)+'&key=surl">举报</a>');toolsList.append(toolsReport),toolsDom.append(toolsList);var tTip=new bds.se.tip({target:$(feedbackIconSelector,tipEle)[0],mode:"none",align:"left",offset:{x:17,y:24},arrow:{has:1,offset:19},content:toolsDom,ext:{category:"tools"},wrapClass:"c-tip-con c-tools-tip-con"});tTip.onShow=function(){window.ns_c({fm:"tools",tab:"show"})}}function tools(){var e=undefined,t=undefined,n=undefined,i=undefined;$("#container").delegate(feedbackSelector,"mouseover",(function(){var n=this;window.clearTimeout(t),window.clearTimeout(i),e=setTimeout((function(){var e=1;$(bds.comm.tips).each((function(t){if(bds.comm.tips[t].getTarget()===$(feedbackIconSelector,n)[0])return e=0,bds.comm.tips[t].show(),!1})),e&&renderTool(n)}),200)})).delegate(feedbackSelector,"mouseout",(function(){var i=this;window.clearTimeout(e),window.clearTimeout(n),t=setTimeout((function(){$(bds.comm.tips).each((function(e){var t=bds.comm.tips[e];if(t.getTarget()===$(feedbackIconSelector,i)[0])return t.hide(),!1}))}),200)})),$("#c-tips-container").delegate(".c-tip-con","mouseover",(function(){var e=this;window.clearTimeout(t),window.clearTimeout(i),n=setTimeout((function(){$(bds.comm.tips).each((function(t){var n=bds.comm.tips[t];if(n.getDom().get(0)===e&&n.ext.category&&"tools"===n.ext.category)return n.show(),!1}))}),200)})).delegate(".c-tip-con","mouseout",(function(){var t=this;window.clearTimeout(e),window.clearTimeout(n),i=setTimeout((function(){$(bds.comm.tips).each((function(e){var n=bds.comm.tips[e];if(n.getDom().get(0)===t&&n.ext.category&&"tools"===n.ext.category)return n.hide(),!1}))}),200)}))}function registerTools(){bds.se.tools=tools,bds.se.tool={share:toolShare,favo:favoInint}}function logoSlide(e){var t=this,n={},i=undefined,a=undefined,o=undefined,s=[],r=0,l=null,c=undefined;this._default={target:$("#lg"),src:"",width:270,height:129,offsetLeft:0,isPad:!1,isRetina:!1,frames:103,animations:[{isAutoPlay:!0,frame_start:1,frame_end:30,delay:0,duration:100,repeats:0,process_before:function(){},event_loop:0,process_after:function(){}},{trigger_type:"click",trigger_duration:100,trigger_frame:31,trigger_fn:function(){},frame_start:32,frame_end:103,process_before:function(){},process_after:function(){},delay:0,duration:100,repeats:1,event_loop:0}]},this.timer=[],this.otherTimer=[],this.op=$.extend({},t._default,e),this.init=function(){t.op.src?(t.createDom(),bds.comm.ishome&&t.op.target.length&&t.initAnimate()):t.createPlayer()},this.createPlayer=function(){var e=t.op.target.find("map"),n=e.length?e.find("area").eq(0):"",i=t.op.play;i&&(a=$('<img class="logo_player" src="'+i.src+'" style="width:'+i.width+"px; height:"+i.height+"px; position:absolute; top:50%; left:50%; margin-left: -"+i.width/2+"px; margin-top: -"+i.height/2+"px; cursor:pointer;\" onmousedown=\"return c({'tab':'logo_button_click'})\" />").appendTo(t.op.target),n.length?(a.wrap('<a style="position:absolute;top:0;left:50%;width:'+t.op.width+"px;height:"+t.op.height+"px;margin-left:-"+t.op.width/2+'px;" href="'+n.attr("href")+'" target="'+n.attr("target")+'"></a>'),n.attr("title")&&a.attr("title",n.attr("title"))):a.wrap('<div style="position:absolute;top:0;left:50%;width:'+t.op.width+"px;height:"+t.op.height+"px;margin-left:-"+t.op.width/2+'px;"></div>'),a.on(i.trigger_type,(function(){return i.trigger_duration?t.timer.push(window.setTimeout((function(){i.trigger_fn.call(t.op)}),i.trigger_duration)):i.trigger_fn.call(t.op),!1})))},this.createDom=function(){var e='<div style="position:absolute;top:0;left:50%;background:url(#{0}) no-repeat #{1};cursor:#{2};width:#{3}px;height:#{4}px;margin-left:-#{5}px;display:none;"></div>',r=t.op.offsetLeft+"px 0",l=t.op.target.find("map"),d=l.length?l.find("area").eq(0):"",u=d?"pointer":undefined,p=t.op.animations instanceof Array?t.op.animations:[t.op.animations],h=t.op.width;s=p,c=h,e=$.format(e,t.op.src,r,u,t.op.width,t.op.height,t.op.width/2),"static"===t.op.target.css("position")&&t.op.target.css({position:"relative",width:"100%"}),t.op.target.append(e),i=o=t.op.target.find("div").eq(0),t.op.play&&(a=$('<img src="'+t.op.play.src+'" style="width:'+t.op.play.width+"px; height:"+t.op.play.height+"px; position:absolute; top:50%; left:50%; margin-left: -"+t.op.play.width/2+"px; margin-top: -"+t.op.play.height/2+"px; \" onmousedown=\"return c({'tab':'logo_button_click'})\" />").insertAfter(i),o=a),t.op.isPad&&i.css("background-size",t.op.width*t.op.frames/2+"px "+t.op.height+"px"),window.devicePixelRatio&&window.devicePixelRatio>1&&t.op.isRetina&&i.css("background-size",t.op.width*t.op.frames+"px "+t.op.height+"px"),d.length?(i.wrap('<a href="'+d.attr("href")+'" target="'+d.attr("target")+'"></a>'),d.attr("title")&&i.attr("title",d.attr("title"))):i.on("mousedown",(function(){window.c({tab:"logo_button_click"})}));for(var f=0,m=s.length;f<m;f++){r=-(s[f].frame_start-1)*h+"px 0",n[f]={"background-position":r,cursor:u}}},this.initAnimate=function(){if(!(r>=s.length)){var e=s[r],n=e.isAutoPlay,a=e.trigger_type,c=e.trigger_fn,d=e.trigger_duration,u=e.trigger_frame,p=$("#lg area");p.length&&p.attr("onmousedown")&&i.on("mousedown",(function(){return new Function(p.attr("onmousedown"))()})),(l=new Image).src=t.op.src,i.bind("first_animate",(function(){l.complete?h():l.onload=h})),n?i.trigger("first_animate"):a&&(t.enablePointer(),o.show().on(a,(function(){c&&(u&&t.toPos(u),c.call(t.op),d?t.timer.push(setTimeout((function(){i.trigger("first_animate")}),d)):i.trigger("first_animate"))})))}function h(){i.show(),t.play()}},this.enablePointer=function(){bds.comm.upn&&"msie"===bds.comm.upn.browser&&"6"===bds.comm.upn.ie?alert("pointer"):i.css("cursor","pointer")},this.disablePointer=function(){i.css("cursor","default")},this.play=function(){if(r>=s.length)t.dispose();else{var e=s[r].process_before;t.dispose(),e&&e.call(t),t.animation()}},this.toPos=function(e){var t=-(e-1)*c+"px 0";i.css("background-position",t)},this.animation=function(){var e=s[r],n=e.duration,a=e.frame_start,l=e.frame_end,d=e.delay,u=e.repeats,p=e.process_after,h=e.trigger_type,f=a-1>0?a-1:0,m=e.event_loop||0,g=0,_=undefined;if(_=m||r+1>=s.length?s[r]:s[r+1]){var v=_.trigger_type,b=_.trigger_fn,y=_.trigger_duration,w=_.trigger_frame;v&&(h&&o.off(h),r<s.length-1||m?(t.enablePointer(),o.on(v,(function(){m||r++,p&&p.call(t),b&&b.call(t),w&&t.toPos(w),y?(t.dispose(),t.timer.push(setTimeout((function(){t.play()}),y))):t.play()}))):t.disablePointer())}t.timer.push(setTimeout((function S(){i.css("background-position",-c*f+"px 0"),++f>=l?(t.dispose(),g++,0!==u&&g>=u?(f=null,g=null,p&&p.call(t),++r<s.length&&t.play(),m&&r--):(f=a-1>0?a-1:0,t.timer.push(setTimeout(S,n)))):t.timer.push(setTimeout(S,n))}),d))},this.dispose=function(e){for(var n=0,i=(e=e||t.timer).length;n<i;n++)window.clearTimeout(e[n]);e.length=0},this.disposeOther=function(e){for(var n=0,i=(e=e||t.otherTimer).length;n<i;n++)window.clearTimeout(e[n]);e.length=0},this.clear=function(){t.dispose(),t.disposeOther(),o.off("click").off("hover")},this.reset=function(e){e=e||0,i.css(n[e])},this.init()}function registerLogoSlide(){bds.se.slide=logoSlide}function registerBanner(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){var e=bds.comm.upn,t=navigator.userAgent.toLowerCase().search(/msie [6-7]/);if(window.winFilter=/NT 6.1|NT 6.2|NT 6.3/i.test(navigator.userAgent),bds.comm.topHijack)for(var n=0;n<bds.comm.topHijack.length;n++)if("hint_topHijack"===bds.comm.topHijack[n].templateName){var i=bds.comm.topHijack[n].hintData.hintText;bds.se.banner($("body")[0],i)}if(bds.comm.tng&&-1===$.inArray(bds.comm.tng,["union","union2baidu","union_cpro","union_nosearch","redbull","hao123"])&&e&&e.browser&&"msie"===e.browser&&e.ie&&("6"===e.ie||"7"===e.ie)&&t>0){i="6"===e.ie?"您的浏览器采用的IE6内核已停止维护,推荐升级到更快更安全的百度浏览器!":"您的IE浏览器版本较低,即将停止更新维护,建议升级到更快、更安全的百度浏览器。";bds.se.banner($("body")[0],i,{downUrl:"http://j.br.baidu.com/v1/t/ui/p/browser/tn/10105001/ch_dl_url",cookie:"H_PS_BBANNER",nscTab:"browser"})}}))}function init(){var e=0,t="",n=[];$(".unsafe_ico_new").each((function(i,a){n.push(a.getAttribute("data-id")),t=a.getAttribute("data-tpl");var o=$(a).attr("data-href"),s=$(a).attr("href"),r=o||s;$("h3 a",$(a).parents(".result")).attr("href",r),e++})),e>0&&window.ns_c({tab:"safetip",num_unsafe:e,prd:["bd"].join("|"),hintId:n,hintTpl:t})}function registerSafe(){bds.se.safeTip={init:init}}function registerImsgAsync(){$((function(){headScript_pc_static_index.BDSInstance.comm.user&&""!==headScript_pc_static_index.BDSInstance.comm.user&&setTimeout((function(){$.ajax({dataType:"script",cache:!0,url:(headScript_pc_static_index.BDSInstance.su&&headScript_pc_static_index.BDSInstance.su.urStatic?headScript_pc_static_index.BDSInstance.su.urStatic:"http://ss.bdimg.com")+"/static/message/js/mt_show_1.8.js",success:function(){function e(){$("#imsg")[0]&&$("#u")[0]&&$("#user")[0]&&(headScript_pc_static_index.BDSInstance.se.message&&headScript_pc_static_index.BDSInstance.se.message.init&&headScript_pc_static_index.BDSInstance.se.message.init({button:$("#imsg"),refer:$("#u")}),$("#user").on("mouseover",(function(){$("#s_mod_msg").hide()}))),$("#imsg1")[0]&&$("#u1")[0]&&$("#user1")[0]&&(headScript_pc_static_index.BDSInstance.se.message&&headScript_pc_static_index.BDSInstance.se.message.init&&headScript_pc_static_index.BDSInstance.se.message.init({button:$("#imsg1"),refer:$("#u1")}),$("#user1").on("mouseover",(function(){$("#s_mod_msg").hide()})))}function t(){headScript_pc_static_index.BDSInstance.se.message&&headScript_pc_static_index.BDSInstance.se.message.addStyle&&headScript_pc_static_index.BDSInstance.se.message.addStyle()}headScript_pc_static_index.BDSInstance.comm.loginAction.push((function(n){1===n&&(e(),t())})),headScript_pc_static_index.BDSInstance.comm.newindex?$(window).on("index_off",(function(){setTimeout((function(){e(),t()}),0)})):(e(),t()),headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd(t)}})}),0)}))}bds.comm.host={bfe:"//www.baidu.com/tools",favo:bds.util.domain&&bds.util.domain.get?bds.util.domain.get("http://i.baidu.com"):"http://i.baidu.com",share:bds.util.domain&&bds.util.domain.get?bds.util.domain.get("http://bdimg.share.baidu.com/static/api/js/custom/resultshare.js"):"http://bdimg.share.baidu.com/static/api/js/custom/resultshare.js",report:"http://jubao.baidu.com",koubei:"http://koubei.baidu.com"},headScript_pc_static_index.BDSInstance.se.banner=function(e,t,n){this.init=function(){n=n||{},this.$dom_panel=$(e),this.hintText=t,this.hintIcon=n.iconClass||"",this.downUrl=n.downUrl||"",this.hintCookie=n.cookie||"",this.showNum=this.hintCookie&&headScript_pc_static_index.getCookie(this.hintCookie)?Number(headScript_pc_static_index.getCookie(this.hintCookie)):0,this.nscTab=n.nscTab||"",this.ishome=bds.comm&&1===bds.comm.ishome?1:0,this.bannerType=n.bannerType||"",e&&t&&this.showNum<5&&!$(".baiduapp_banner")[0]&&!$(".res_top_banner")[0]&&!$(".res_top_banner_for_win")[0]&&this.show()},this.show=function(){this.render(),this.showNum+=1,headScript_pc_static_index.setCookie(this.hintCookie,this.showNum,{expires:2592e6}),this.$dom_panel.prepend(this.bannerHtml),1!==this.ishome&&this.headFloat(),this.bindEvent(),window.ns_c({fm:"behs",qid:bds.comm.qid,tab:(1===this.ishome?"tj_":"")+"baidu_"+(this.nscTab?this.nscTab:"topbanner")+"show"})},this.render=function(){var e=[];e="WIN"!==this.bannerType?e.concat(['<div class="res_top_banner">','<i class="c-icon '+(this.hintIcon?this.hintIcon:"res_top_banner_icon")+'"></i>',"<span>"+this.hintText+"</span>",this.downUrl?'<a href="'+this.downUrl+'" class="res_top_banner_download">立即体验</a>':"",'<i class="c-icon res_top_banner_close"></i>',"</div>"]):e.concat(['<div class="res_top_banner_for_win">','<i class="c-icon '+(this.hintIcon?this.hintIcon:"res_top_banner_icon")+'"></i>',"<span>"+this.hintText+"</span>",this.downUrl?'<a href="'+this.downUrl+'" class="res_top_banner_download">立即体验</a>':"",'<i class="c-icon res_top_banner_close"></i>',"</div>"]),this.bannerHtml=e.join("")},this.headFloat=function(){var e=$("#head"),t=$(window),n=$(".res_top_banner");$(window).scroll((function(){var i=n.height()||0;t.scrollTop()<=i?e.attr("style","position:absolute;"):e.attr("style","top:0px;_top:"+i+"px;")}))},this.bindEvent=function(){if("WIN"!==this.bannerType){var e=$(".res_top_banner"),t=this;$(".res_top_banner_download",e).on("mousedown",(function(){t.hintCookie&&headScript_pc_static_index.setCookie(t.hintCookie,5,{expires:2592e6}),window.ns_c({fm:"behs",qid:bds.comm.qid,tab:(1===t.ishome?"tj_":"")+"baidu_"+(t.nscTab?t.nscTab:"topbanner")+"down"})})),$(".res_top_banner_close",e).on("mousedown",(function(){e.detach(),t.hintCookie&&headScript_pc_static_index.setCookie(t.hintCookie,5,{expires:2592e6}),window.ns_c({fm:"behs",qid:bds.comm.qid,tab:(1===t.ishome?"tj_":"")+"baidu_"+(t.nscTab?t.nscTab:"topbanner")+"close"})})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){e.detach()}))}else{var n=$(".res_top_banner_for_win"),i=this;$(".res_top_banner_download",n).on("mousedown",(function(){i.hintCookie&&headScript_pc_static_index.setCookie(i.hintCookie,5,{expires:2592e6}),window.ns_c({fm:"behs",qid:bds.comm.qid,tab:(1===i.ishome?"tj_":"")+"baidu_"+(i.nscTab?i.nscTab:"topbanner")+"down"})})),$(".res_top_banner_close",n).on("mousedown",(function(){n.detach(),i.hintCookie&&headScript_pc_static_index.setCookie(i.hintCookie,5,{expires:2592e6}),window.ns_c({fm:"behs",qid:bds.comm.qid,tab:(1===i.ishome?"tj_":"")+"baidu_"+(i.nscTab?i.nscTab:"topbanner")+"close"})})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){n.detach()}))}},this.init()};var FPID_CACHE=null,FPIDTimer=0;function initFpidEventListener(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){var e=document.title,t={flashDomId:"_FP_userDataDiv",comDomId:"_FP_comDiv",IEStoreDomId:"_FP_userDataDiv"},n=headScript_pc_static_index.isIEBrowser(),i=!1,a="",o=new RegExp("Chrome/(\\d+)").exec(navigator.userAgent);if(o&&(i=!0,a=o[1]),!(i&&+a>=39)){$("body").append('<div id="_FP_userDataDiv" style="behavior:url(#default#userdata);width:0px;height:0px;position:absolute;top:-1000px;left:-1000px"></div><div id="_FP_comDiv" style="behavior:url(#default#clientCaps);width:0px;height:0px;position:absolute;top:-1000px;left:-1000px"></div>');var s=function(t){n&&window.setTimeout((function(){document.title=e}),0),FPID_CACHE=t,$("#_FP_userDataDiv").remove(),$("#_FP_comDiv").remove();var i=bds.comm.qid,a="_WWW_BR_API_"+(new Date).getTime(),o=window[a]=new Image;o.onload=function(){window[a]=null};var s=headScript_pc_static_index.getCookie("BAIDUID"),r=headScript_pc_static_index.getCookie("BIDUPSID"),l=(bds&&bds.util&&bds.util.domain?bds.util.domain.get("http://eclick.baidu.com/ps_fp.htm?"):"http://eclick.baidu.com/ps_fp.htm?")+"pid=ps&fp="+t.data.fp+"&im="+t.data.im+"&wf="+t.data.wf+"&br="+t.data.br+"&qid="+i+"&bi="+s+"&psid="+r;o.src=l};FPIDTimer=FPID_CACHE?window.setTimeout((function(){s(FPID_CACHE)}),2500):window.setTimeout((function(){var e="";e=n?"//www.baidu.com/cache/fpid/ielib_0108.js":"//www.baidu.com/cache/fpid/chromelib_0108.js",$.ajax({url:e,cache:!0,dataType:"script",success:function(){fpLib.getFp(s,t)}})}),2500)}})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){FPIDTimer&&(window.clearTimeout(FPIDTimer),$("#_FP_userDataDiv").remove(),$("#_FP_comDiv").remove())}))}var UPN=function(){function e(){this.cookieset=[]}return e.prototype.write=function(e){var t={BD_UPN:e,expires:new Date((new Date).getTime()+864e6).toGMTString()};document.cookie=headScript_pc_static_index.objToStr(t,"; ",{encode:!1})},e.prototype.set=function(e){headScript_pc_static_index.isArray(e)&&(this.cookieset=this.cookieset.concat(e))},e.prototype.run=function(){var e,t,n="";try{for(var i=headScript_pc_static_index.__values(this.cookieset),a=i.next();!a.done;a=i.next()){var o=a.value;if(o.k&&o.v){var s="".concat(o.k),r="".concat(o.v);1===s.length&&1===r.length&&(n+="".concat(s).concat(r))}}}catch(l){e={error:l}}finally{try{a&&!a.done&&(t=i["return"])&&t.call(i)}finally{if(e)throw e.error}}this.write(n)},e}();function is360Browser(){var e,t,n,i=navigator.userAgent,a=!1;if((null===(n=i.mimeType)||void 0===n?void 0:n.length)>0)try{for(var o=headScript_pc_static_index.__values(i.mimeType),s=o.next();!s.done;s=o.next()){"application/vnd.chromium.remoting-viewer"===s.value.type&&(a=!0)}}catch(r){e={error:r}}finally{try{s&&!s.done&&(t=o["return"])&&t.call(o)}finally{if(e)throw e.error}}return!a&&"track"in document.createElement("track")&&!("scoped"in document.createElement("style"))&&!("v8Locale"in window)&&/Gecko\)\s+Chrome/.test(navigator.appVersion)&&"track"in document.createElement("track")&&"scoped"in document.createElement("style")&&"v8Locale"in window}function detectBrowser(e){var t={lbbrowser:/lbbrowser/gi,maxthon:/maxthon\/[\d.]+/gi,bidubrowser:/bidubrowser/gi,baiduclient:/baiduclient/gi,metasr:/metasr/gi,qqbrowser:/qqbrowser/gi,msie:/msie [\d.]+;/gi,edge:/edge\/[\d.]+/gi,firefox:/firefox\/[\d.]+/gi,opr:/opr\/[\d.]+/gi,chrome:/chrome\/[\d.]+/gi,safari:/safari\/[\d.]+/gi};return Object.keys(t).forEach((function(n){if(e.includes(n))return t[n].exec(e)[0]})),is360Browser()?"qihu":window.document.documentMode?"msie":""}function detectIEBrowserVersion(e){var t={"MSIE 6":1,"MSIE 7":2,"MSIE 8":3,"MSIE 9":4,"MSIE 10":5};return e.search(/MSIE [2-5]/)>0?8:(Object.keys(t).forEach((function(n){if(e.includes(n))return t[n]})),"11"===window.document.documentMode?6:7)}function getBrowserInfo(e){var t={msie:1,chrome:2,firefox:3,safari:4,opr:5,lbbrowser:6,maxthon:7,bidubrowser:8,metasr:9,qqbrowser:"a",qihu:"b",baiduclient:"b",edge:"d"};return t[e]?t[e]:0}function getOSInfo(){var e="Win32"===navigator.platform||"Windows"===navigator.platform,t="Mac68K"===navigator.platform||"MacPPC"===navigator.platform||"Macintosh"===navigator.platform||"MacIntel"===navigator.platform;return t?"mac":"X11"!==navigator.platform||e||t?String(navigator.platform).includes("Linux")?"linux":e?"windows":"":"unix"}function detectOSType(e){var t={windows:1,mac:2,linux:3,unix:4};return t[e]?t[e]:0}function getOSVersion(e){return e.includes("Windows NT 5.1")||e.includes("Windows XP")?1:e.includes("Windows NT 6.0")||e.includes("Windows Vista")?2:e.includes("Windows NT 6.1")||e.includes("Windows 7")?3:e.includes("Windows NT 6.2")||e.includes("Windows 8")?4:e.includes("Windows NT 6.3")||e.includes("Windows 8.1")?5:e.includes("Windows NT 10")||e.includes("Windows 10")?7:6}function detectBrowserType(e){return e.includes("msie")||new RegExp("trident(.*)rv.(\\d+)\\.(\\d+)").test(e)?1:e.includes("firefox")?2:e.includes("chrome")?3:e.includes("safari")&&!e.includes("chrome")?4:0}function detectBrowserAndOSVersion(){var e=navigator.userAgent,t=e.toLowerCase(),n=detectBrowser(t).replace(/[0-9.\/|;|\s]/gi,""),i="msie"===n?detectIEBrowserVersion(e):0,a=getOSInfo(),o=detectOSType(a),s="windows"===a?getOSVersion(e):0,r=detectBrowserType(t);return[{k:1,v:getBrowserInfo(n)},{k:2,v:i},{k:3,v:o},{k:4,v:s},{k:5,v:r}]}function initUPN(){headScript_pc_static_index.BDSInstance.se.upn=new UPN,headScript_pc_static_index.BDSInstance.se.upn.set(detectBrowserAndOSVersion()),headScript_pc_static_index.BDSInstance.se.upn.run()}function checkContentHeight(){return $("#content_right").height()>$("#content_left").height()}function cleanEC(){var e=$(".ec_bdtg"),t=$("#ec_im_container").children("div"),n=t.length-1;for(checkContentHeight()&&e&&e.length&&e.css("display","none");checkContentHeight()&&n>=0;){var i=t[n];$(i).css("display","none"),n--}}function cleanRes(){var e=$("#content_right").find(".result-op"),t=e.length-1;if(0===t){var n=$(e[0]).parent();"con-ceiling-wrapper"===n.attr("id")&&(n=n.parent()),$("#content_right").height()+e.height()<$("#content_left").height()&&n.css({position:"static"})}else{for(var i=null,a=null,o=t;o>=0;o--){var s=e[o];null===i&&$(s).find(".FYB_RD").length>0?i=o:null===a&&$(s).find(".FYB_BD").length>0&&(a=o)}if(null!==i&&null!==a){var r=e[i];e[i]=e[a],e[a]=r}for(;checkContentHeight()&&t>0;){var l=e[t];$(l).css("display","none");var c=$.extend($(l).data("click"),{rsv_tpl:$(l).attr("tpl"),fm:"hide",qid:headScript_pc_static_index.BDSInstance.comm.qid,tab:"baidu_rightheightadjust"});headScript_pc_static_index.nsClickForWWW(c,headScript_pc_static_index.BDSInstance),t--}}}function initHeightAdjust(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){cleanEC(),cleanRes()}))}function grayAdapter(){var e=$("html"),t=$("body"),n=$(".content_none"),i=!!(n&&n.length>0),a=e.hasClass("big-event-gray"),o=headScript_pc_static_index.BDSInstance.comm.isGray;t.hasClass("big-event-gray")&&t.removeClass("big-event-gray"),!a||i||o||e.removeClass("big-event-gray"),!a&&o&&e.addClass("big-event-gray")}function contentRightPositionAdjust(){var e=document.querySelector("#content_left [tpl=ai_office]"),t=document.getElementById("content_right");if(e&&t){var n=document.getElementById("container"),i=e.getBoundingClientRect().top-n.getBoundingClientRect().top+e.offsetHeight;t.style.marginTop=i+27+"px",t.classList.remove("content-right-hidden")}}function initSwapEndEvent(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){var e;headScript_pc_static_index.BDSInstance.comm.encTn&&headScript_pc_static_index.setCookie("H_PS_645EC",headScript_pc_static_index.BDSInstance.comm.encTn,{expires:2592e3});var t=$("form").find('input[type="hidden"][name="rsv_t"]');if(t.length?t.val(headScript_pc_static_index.BDSInstance.comm.encTn):$("form").append('<input type="hidden" name="rsv_t" value="'+headScript_pc_static_index.BDSInstance.comm.encTn+'">'),headScript_pc_static_index.BDSInstance.comm.did=function(){for(var e="",t=0;t<32;t++)e+=Math.floor(16*Math.random()).toString(16);return e}(),$("#bonus_scene_head").remove(),null===(e=headScript_pc_static_index.BDSInstance.comm.sampleval)||void 0===e?void 0:e.includes("qrcode")){var n=encodeURIComponent(headScript_pc_static_index.BDSInstance.comm.query);n.length<=150&&new Promise((function(e,t){require(['bottom-script/pc/static/pc-to-wise/index'],e,t)})).then((function(e){(0,e.pcToWise)()(n)}))}new Promise((function(e,t){require(['bottom-script/pc/static/ipad-compatible/ipad-compatible'],e,t)})).then((function(e){(0,e.compatibleIpad)()()})),grayAdapter();try{localStorage.setItem("search_request_time","".concat(+new Date))}catch(i){console.error(i)}contentRightPositionAdjust()}))}function initSwapBeginEvent(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){headScript_pc_static_index.BDSInstance.se.displayTime!==undefined&&null!==headScript_pc_static_index.BDSInstance.se.displayTime&&(clearTimeout(headScript_pc_static_index.BDSInstance.se.displayTime),headScript_pc_static_index.BDSInstance.se.displayTime=null)}))}function initConfirmEvent(){headScript_pc_static_index.eventBus.app.confirm.on((function(){var e,t;1===headScript_pc_static_index.BDSInstance.comm.globalLogFlag&&1!==headScript_pc_static_index.BDSInstance.comm.logFlagNoNetwork&&1!==headScript_pc_static_index.BDSInstance.comm.logFlagNoIntegration&&(headScript_pc_static_index.BDSInstance.se.displayTime=window.setTimeout((function(){headScript_pc_static_index.BDSInstance.se.display&&headScript_pc_static_index.BDSInstance.se.display(),headScript_pc_static_index.BDSInstance.se.displayTime=null}),5e3)),(null===(e=headScript_pc_static_index.BDSInstance.se.userAction)||void 0===e?void 0:e.collect)&&(null===(t=headScript_pc_static_index.BDSInstance.se.userAction)||void 0===t||t.collect())}))}function titleSourceInteractiveOptimation(){var e=".c-container",t="c-showurl-hover",n="c-showem";$(".c-showurl").hover((function(){var i=$(this.parentNode).parents(e).find(".t").children(":first");i.addClass(t),i.find("em").addClass(n)}),(function(){var i=$(this.parentNode).parents(e).find(".t").children(":first");i.removeClass(t),i.find("em").removeClass(n)}))}function initTitleSourceInteractiveOptimation(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd(titleSourceInteractiveOptimation)}function initNuIstanctSearchEvents(){new Promise((function(e,t){require(['nu-instant-search'],e,t)})).then((function(e){return e.EslModuleExport66})).then((function(e){(0,e.initNuIstanctSearchEvents)()}))}function preConnect(){var e,t=function(e,t){var n=1*new Date,a=(e=bds.util.domain&&bds.util.domain.get?bds.util.domain.get(e):e).match(/^(http[s]?:\/\/)?([^\/]+)(.*)/);if(a[2]&&!i[a[2]]){i.push(a[2]);var o=new Image;o.src=e+"?_t="+(t||n),o.onload=o.onerror=function(){o=null}}},n=0,i=[],a=function(){try{window.pageState&&0!=window.pageState&&1!=n||($("#kw1,#kw").one("keydown",(function(){"https:"===location.protocol?(t("https://ss0.baidu.com/6ONWsjip0QIZ8tyhnq/ps_default.gif"),t("https://ss1.baidu.com/6ONWsjip0QIZ8tyhnq/ps_default.gif"),t("https://ss2.baidu.com/6ONWsjip0QIZ8tyhnq/ps_default.gif"),t("https://ss3.baidu.com/6ONWsjip0QIZ8tyhnq/ps_default.gif")):(t("http://b1.bdstatic.com/img/pc.gif",parseInt(1e3*Math.random())),t("http://ecmb.bdimg.com/public03/pc.gif"),$.each(["i7","i8","i9","t10","t11","t12"],(function(e,n){t("http://"+n+".baidu.com/ps_default.gif")})))})),1==n&&$("#kw1,#kw").one("focus",(function(){"https:"===location.protocol&&t("https://www.baidu.com/con?from=self")})))}catch(e){}},o=function(){n=1,a(),s()},s=function(){clearTimeout(e),n=0};return a(),{init:a,startTimer:function(){s(),e=setTimeout(o,55e3)}}}function runVelocity(){setTimeout((function(){var e=Math.random(),t="http://velocity.baidu.com/sp";if("https:"===location.protocol&&(t="https://sp0.baidu.com/6r1_czmhAB63otqbppnN2DJv/sp"),e<.01){var n=document.createElement("script");n.src=t,document.body.appendChild(n)}}),1e3)}function analysis(e,t){var n,i,a={top:null===(n=t.offset())||void 0===n?void 0:n.top,left:null===(i=t.offset())||void 0===i?void 0:i.left},o={width:t.width(),height:t.height()},s={},r=t.attr("data-click");if(r)try{s=JSON.parse(r)}catch(l){console.error("parse attrDataClick fail",l.message)}return{id:"".concat(e).concat(s.p5||""),pos:a,size:o,dataClick:s,dom:t}}function getSkeleton(){var e=this,t={},n={},i=$("#wrapper");return t.topResult=i.find("#con-at").find(".result-op"),t.rightResult=i.find("#con-ar").find(".result-op"),t.leftResult=i.find("#content_left").find(".result, .result-op"),t.topResult.length&&(n.topResult=[],t.topResult.each((function(){n.topResult.push(analysis("T",$(e)))}))),t.rightResult.length&&(n.rightResult=[],t.rightResult.each((function(){n.rightResult.push(analysis("R",$(e)))}))),t.leftResult.length&&(n.leftResult=[],t.leftResult.each((function(){n.leftResult.push(analysis("L",$(e)))}))),n}function skeleton(e){var t=null;return function(){return t||(t=getSkeleton(),e.lifecycle.onSwapBegin((function(){t=null}),{once:!0})),t}}function initSkeleton(){headScript_pc_static_index.BDSInstance.se.skeleton=skeleton(headScript_pc_static_index.BDSInstance)}function getOrder(){var e=[],t=headScript_pc_static_index.BDSInstance.se.skeleton().LeftResult;return t?(t.forEach((function(t){var n={dom:t.dom,id:t.id,itime:0,time:0};e.push(n)})),e):null}function initOrderPlay(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){headScript_pc_static_index.BDSInstance.se.orderplay=getOrder()}))}$((function(){var e=getLogin();$("#u,#u1").delegate(".lb","click",(function(){headScript_pc_static_pageLog_ubcLog.sendUbcLog(19057,"click","login_button");var t=$(this).attr("data-subpro");t&&e.setSubpro(t);try{e.open()}catch(n){console.warn("login open fail",n.message)}}))})),headScript_pc_static_index.BDSInstance.se.speedTester=function(){function e(){}function t(e,t,n){var i=new Image;i.onload=i.onerror=function(){this.onload=this.onerror=null},i.src=e+(t?"&t="+t+"&v="+n:"&t=-1&v=-1")+"&r="+Math.random()}return{start:function(n,i,a){var o;a=a||19558,function(t,n,i,a){n=n||e,i=i||e;var o=new Image,s=Date.now();o.onload=function(){this.onload=this.onerror=null,a=this.fileSize||a;var e=Date.now()-s;n(this,e,a/e)},o.onerror=function(){this.onload=this.onerror=null,i(this)},o.src=t}(n,(o=i,function(e,n,i){t(o,n,i)}),function(e){return function(){t(e)}}(i),a)}}}(),headScript_pc_static_index.BDSInstance.se.speedMonitor=function(e){var t=e.logPath||"",n=e.flag||"default",i=e.sleep||"1000",a=!1,o=0,s=[],r=t+"?flag="+n;function l(){var e=s.pop();e&&function(e){var t=e.url,n=e.size||-1,i=[];for(var a in i.push("id="+encodeURIComponent(e.id)),i.push("name="+encodeURIComponent(e.name)),i.push("url="+encodeURIComponent(e.url)),i.push("size="+encodeURIComponent(e.id)),e.logData)i.push(a+"="+encodeURIComponent(e.logData[a]));headScript_pc_static_index.BDSInstance.se.speedTester.start(t,r+"&"+i.join("&"),n)}(e),a&&(o=window.setTimeout(l,i))}this.start=function(){this.stop(),a=!0,l()},this.stop=function(){a=!1,window.clearInterval(o)},this.addTask=function(e){s.push(e)},this.clear=function(){s=[]}};var UserAction=function(){function e(e){this.pageElementsList=[],this.scrollTimer=null,this.scrollChange=!1,this.resizeTimer=null,this.resizeChange=!1,this.scrollTop=$(document).scrollTop(),this.scrollLeft=$(document).scrollLeft(),this.windowHeight=$(window).height(),this.windowWidth=$(window).width(),this.bds=e}return e.prototype.init=function(){var e=this,t=this.bds.se.skeleton();Object.keys(t).forEach((function(n){t[n]&&($.merge(e.pageElementsList,e.getDom(t[n])),e.bindEvent(t[n]))}))},e.prototype.getDom=function(e){var t=[];return e.forEach((function(e){var n={};n.top=e.pos.top,n.height=e.size.height,n.id=e.id,n.visible=0,t.push(n)})),t},e.prototype.sendLog=function(e,t){var n,i;1===this.bds.comm.globalLogFlag&&(null===(i=null===(n=this.bds.log)||void 0===n?void 0:n.send)||void 0===i||i.sendPack(e,t))},e.prototype.bindEvent=function(e){var t=this;e.forEach((function(e){var n=!1,i=null;e.dom.bind("mouseenter.useraction",(function(){null!==i&&clearTimeout(i),i=setTimeout((function(){t.sendLog("new_view",{type:"mouseIn",id:e.id,t:+new Date}),n=!0,i=null}),200)})).bind("mouseleave.useraction",(function(){null!==i&&(clearTimeout(i),i=null),n&&(t.sendLog("new_view",{type:"mouseOut",id:e.id,t:+new Date}),n=!1)}))}))},e.prototype.destroy=function(){$(window).unbind(".useraction"),this.pageElementsList.splice(0,this.pageElementsList.length)},e.prototype.sight=function(){var e=this;this.pageElementsList.forEach((function(t){var n,i,a=e.scrollTop<t.top+t.height&&e.scrollTop+e.windowHeight>t.top;if(1!==t.visible||a){if(0===t.visible&&a){if(e.sendLog("new_view",{type:"sight",resid:t.id,action:"in",t:+new Date}),(null===(i=e.bds.comm.orderplay)||void 0===i?void 0:i.length)&&"L"===t.id.substr(0,1)&&e.bds.comm.pageSize){s=(parseInt(t.id.substr(1),10)-1)%e.bds.comm.pageSize;(o=e.bds.comm.orderplay[s])&&!o.itime&&(o.itime=+new Date)}t.visible=1}}else{if(e.sendLog("new_view",{type:"sight",resid:t.id,action:"out",t:+new Date}),(null===(n=e.bds.comm.orderplay)||void 0===n?void 0:n.length)&&"L"===t.id.substr(0,1)&&e.bds.comm.pageSize){var o,s=(parseInt(t.id.substr(1),10)-1)%e.bds.comm.pageSize;(o=e.bds.comm.orderplay[s])&&(o.time+=+new Date-o.itime,o.itime=+new Date)}t.visible=0}}))},e.prototype.collectPoint=function(e){var t="".concat(e,"Timer"),n="".concat(e,"Change");null===this[t]&&this.startPoint(t,n,e)},e.prototype.startPoint=function(e,t,n){var i=this;this[e]=setTimeout((function(){i.sendLog("new_view",i.getData(n)),i[t]=!1,i.sight(),i[t]?i.startPoint(e,t,n):i[e]=null}),1e3)},e.prototype.getData=function(e){if("resize"===e){var t=$(window);return this.windowHeight=t.height(),this.windowWidth=t.width(),{type:"resize",t:+new Date,height:this.windowHeight,width:this.windowWidth}}if("scroll"===e){var n=$(document);return this.scrollTop=n.scrollTop(),this.scrollLeft=n.scrollLeft(),{type:"scroll",t:+new Date,offsetX:this.scrollTop,offsetY:this.scrollLeft}}return{}},e.prototype.collect=function(){var e=this;this.init(),["resizeTimer","scrollTimer"].forEach((function(t){null!==e[t]&&clearTimeout(e[t]),e[t]=null})),$(window).bind("focus.useraction",(function(){e.sendLog("new_view",{type:"focus",t:+new Date})})),$(window).bind("blur.useraction",(function(){e.sendLog("new_view",{type:"blur",t:+new Date})})),$(window).bind("resize.useraction",(function(){e.resizeChange=!0,e.collectPoint("resize")})),$(window).bind("scroll.useraction",(function(){e.scrollChange=!0,e.collectPoint("scroll")}))},e.prototype.outInterface=function(){var e=this;return{collect:function(){e.collect()},destroy:function(){e.destroy()}}},e}(),_a;function initUserAction(){headScript_pc_static_index.BDSInstance.se.userAction=new UserAction(headScript_pc_static_index.BDSInstance).outInterface()}function initUserActionEvent(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(e,t){t||1!=+headScript_pc_static_index.BDSInstance.comm.globalLogFlag||1!==headScript_pc_static_index.BDSInstance.comm.logFlagNoNetwork&&1!==headScript_pc_static_index.BDSInstance.comm.logFlagNoIntegration&&(headScript_pc_static_index.BDSInstance.se.displayTime=setTimeout((function(){headScript_pc_static_index.BDSInstance&&headScript_pc_static_index.BDSInstance.se&&headScript_pc_static_index.BDSInstance.se.display(),headScript_pc_static_index.BDSInstance.se.displayTime=null}),5e3)),!t&&headScript_pc_static_index.BDSInstance&&headScript_pc_static_index.BDSInstance.se.userAction.collect(),headScript_pc_static_index.BDSInstance.log.send.sendNow("flow_monitor",{},{qid:bds.comm.qid,log:{},len:1})}))}var translateTips=null,translateJsonp=null,translateUrl=(null===(_a=bds.util.domain)||void 0===_a?void 0:_a.get("http://sensearch.baidu.com/sensearch/selecttext"))||"",NONE_CHINESE_REG=/[^(\u4E00-\u9FA5)]+/i;function hideTranslateFloatLayer(e){var t=translateTips&&translateTips.getDom();translateTips&&0===$(e.target).closest(t).length&&(t.hide(),translateJsonp&&translateJsonp.abort())}function getSelectedInfo(){var e=null,t=null,n=null,i=null,a=null;return window.getSelection?0===(e=window.getSelection()).rangeCount?t="":(i=(n=e.getRangeAt(0)).getBoundingClientRect(),t=e.toString().trim(),a="#text"===n.commonAncestorContainer.nodeName?$(n.commonAncestorContainer.parentNode):$(n.commonAncestorContainer)):document.selection&&(i=(n=e=document.selection.createRange()).getBoundingClientRect(),t=e.text.toString().trim(),a=$(n.parentElement())),{selectedText:t,domParentRange:a,rangePos:i}}function requestTranslate(e,t){translateJsonp=$.ajax({url:translateUrl,dataType:"jsonp",jsonp:"cb",timeout:5e3,data:{q:e},success:function(n){var i,a,o,s,r,l="";if((null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.type)&&"zh"===(null===(a=null==n?void 0:n.data)||void 0===a?void 0:a.to)&&(null===(s=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.result)||void 0===s?void 0:s.length)&&(null===(r=null==n?void 0:n.data)||void 0===r?void 0:r.result)!==e)if(1===n.data.type)for(var c=n.data.result,d=0,u=Math.min(c.length,2);d<u;d++)l+=(0===d?"":"<br/>")+(c[d].pre?c[d].pre+"&nbsp;":""),l+=c[d].cont?$.subByte(c[d].cont,46*(1===u?2:1)+1):"";else if(2===n.data.type){l='<span style="color:#999">译:</span>'+n.data.result.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")}if(l){var p=headScript_pc_static_index.BDSInstance.se.tip,h=(translateTips=translateTips||new p({target:$("body"),mode:"none",content:'<div class="translateContent"></div>',align:"left",arrow:{has:1,offset:10}})).getDom();h.find(".translateContent").html('<p style="margin:0 8px">'+l+"</p>"),h.css({top:t.bottom+$(window).scrollTop()+8,left:(t.left+t.right)/2+$(window).scrollLeft()-20}).show(),headScript_pc_static_index.nsClickForWWW({rsv_trans_type:"showresult",rsv_trans_st:encodeURIComponent(e),rsv_qid:headScript_pc_static_index.BDSInstance.comm.qid||""},headScript_pc_static_index.BDSInstance)}}})}function translate(e){if(!translateTips||!$(e.target).closest(translateTips.getDom()).length)try{setTimeout((function(){var e=getSelectedInfo(),t=e.selectedText,n=e.domParentRange,i=e.rangePos;if(t&&t.length>1&&n.closest("#content_left .result .c-abstract,#content_left .result .t").length){if(translateJsonp&&translateJsonp.abort(),!NONE_CHINESE_REG.test(t))return;requestTranslate(t,i)}}),0)}catch(e){console.warn("请求翻译功能失败")}}function resetTranslate(){translateTips=null,translateJsonp&&translateJsonp.abort()}function initTranslate(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){resetTranslate()})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){var e;6!==(null===(e=headScript_pc_static_index.BDSInstance.comm.upn)||void 0===e?void 0:e.ie)&&(document.addEventListener("mousedown",hideTranslateFloatLayer),document.addEventListener("mouseup",translate))}),{once:!0})}var LS_KEY="safeIconHis",TIMES=1296e6,HIS=animationHistory(LS_KEY);function animationInit(){onPageScroll(),$(document).on("scroll.safeIcon",onPageScroll)}function onPageScroll(){HIS.clear();var e=$(".result .c-icon-baozhang-new");e.length&&e.each((function(e,t){isInVisibleArea(t)&&handleAnimation(t)}))}function getTimeString(){var e=new Date;return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()}function isInVisibleArea(e){if(!e)return!1;if(!e.getBoundingClientRect)return!0;var t=e.getBoundingClientRect();return t.top<window.innerHeight&&t.bottom>0&&t.left<window.innerWidth&&t.right>0}function shouldHandleAnimation(e){if(window.localStorage){var t=HIS.get(),n=!!$(e).attr("data-safe-icon-run");return(t.split(",").length<2||t.includes(getTimeString()))&&!n}return!0}function handleAnimation(e){if(shouldHandleAnimation(e)){$(e).attr("data-safe-icon-run",!0),$(e).attr("hint-type","anim-newBao");var t=$(e),n=$($(e).parents("div.result.c-container")),i=n.attr("data-click"),a=i?i.replace("safe","ani-safe"):"";setTimeout((function(){t.addClass("animate"),n.attr("data-click",a),t.one("animationend",(function(){t.removeClass("animate"),setTimeout((function(){t.addClass("animate"),$(e).attr("hint-type","newBao"),t.one("animationend",(function(){n.attr("data-click",i)}))}),1e3)}))}),1e3),window.ns_c_pj({qid:bds.comm.qid||""},"pj=animaBao&"),HIS.set(getTimeString()+"~"+ +new Date)}}function animationHistory(e){var t=function(){return window.localStorage&&window.localStorage.getItem(e)?window.localStorage.getItem(e):""},n=function(n){if(window.localStorage){var i=t();return""===n?(window.localStorage.setItem(e,n),!0):2!==i.split(",").length&&!i.includes(n.split("~")[0])&&(n=i?i+","+String(n):String(n),window.localStorage.setItem(e,n),!0)}return!0};return{get:t,set:n,clear:function(){var e=t();+new Date-+e.split(",")[0].split("~").pop()>=TIMES&&n("")}}}function bzinit(){try{animationInit()}catch(e){console.log(e)}}var URL_LIST=["https://gt1.baidu.com/nocache/imgdata/sp10.gif","https://gt2.baidu.com/nocache/imgdata/sp10.gif"],BEACON_URL="https://www.baidu.com/nocache/fesplg/s.gif";function checkImage(e,t,n,i){t=t+"?v="+getNow();var a=e.createElement("img"),o=getNow(),s=setTimeout((function(){i(t,n,2,getNow()-o)}),6e3);a.onload=function(){clearTimeout(s),i(t,n,null,getNow()-o)},a.onerror=function(){clearTimeout(s),i(t,n,1,getNow()-o)},a.src=t}function getNow(){return(new Date).getTime()}function report(e,t){var n="?from_pc=1&"+e.param(t),i=BEACON_URL+n;(new Image).src=i}function checkAll(e,t){var n={},i=0;function a(e,a,o,s){var r="gt"+(a+1);n[r+"_s"]=o?1:0,n[r+"_t"]=s,n[r+"_url"]=e,++i>=URL_LIST.length&&report(t,n)}for(var o=0;o<URL_LIST.length;o++){checkImage(e,URL_LIST[o],o,a)}}function start(e,t){bds&&bds.util&&bds.util.sendCVLog&&bds.util.sendCVLog("87_11",2),checkAll(e,t)}var sampleSeeds={};function checkIfHit(e,t){return!!location.search.includes("s_"+e+"=hit")||(sampleSeeds[e]||(sampleSeeds[e]=Math.random()),sampleSeeds[e]<t)}var WEBB_INSTANCE_CONFIG={13:{et_js:{sample:.1},et_comm:{sample:.1},pf_comm:{sample:.01}},187:{et_js:{sample:.1},et_comm:{sample:.1},pf_comm:{sample:.02}}},WebbInstance=function(){function e(){var e=this;(this.instanceConfig=WEBB_INSTANCE_CONFIG,this.instances=[],document.cookie.includes("webbtest=1"))&&Object.keys(this.instanceConfig).forEach((function(t){var n=e.instanceConfig[t];Object.keys(n).forEach((function(e){n[e].sample=1}))}))}return e.prototype.getLid=function(){return headScript_pc_static_index.BDSInstance.comm.lid||""},e.prototype.getInstance=function(e){if(!this.instances[e]){var t={pid:e,lid:headScript_pc_static_index.BDSInstance.comm.lid||""},n=this.instanceConfig[e];if(!n)return null;Object.keys(n).forEach((function(e){t[e]=n[e]})),this.instances[e]=new Webb(t)}return this.instances[e]},e}();function extQuery(){$(document).ready((function(){var e=undefined;$(document).on("click",".t>a,.op-se-listen-recommend",(function(t){t=window.event||t;var n=$("#wrapper_wrapper"),i=$(this).closest(".c-container"),a=i.find(".c-recommend").eq(0),o=i.find(".wnor-fanli-wrap");!t.ctrlKey&&((null==a?void 0:a.length)&&"none"===a.css("display")||(null==o?void 0:o.length)&&"none"===o.css("display"))&&(e=setTimeout((function(){n.find(".c-recommend").hide(),a.show(),n.find(".wnor-fanli-wrap").hide(),o.show()}),150))})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){clearTimeout(e)}))})),window.onunload=function(){}}function registerZoomPrompt(){headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){var e,t;(null===(e=headScript_pc_static_index.BDSInstance.comm.sampleval)||void 0===e?void 0:e.includes("ZOOM_TEST"))?new Promise((function(e,t){require(['bottom-script/pc/static/zoom-prompt/zoom-prompt'],e,t)})).then((function(e){e["default"]()})):(null===(t=headScript_pc_static_index.BDSInstance.comm.sampleval)||void 0===t?void 0:t.includes("ZOOM_COMP"))&&new Promise((function(e,t){require(['bottom-script/pc/static/zoom-prompt/get-zoom'],e,t)})).then((function(e){var t=e["default"]();t&&1!==t&&window.ns_c({fm:"behs",qid:bds.comm.qid,tab:"baidu_zoomshow"})}))}))}var SearchboxCompTpl='<div>\n <form id="form"\n name="f"\n action="/s"\n class="fm has-soutu virtual-form"\n on-mousedown="changeSubmitState"\n >\n <input type="hidden" name="ie" value="utf-8"\n on-focus="changeSubmitState">\n <input type="hidden" name="f" value="8"\n on-focus="changeSubmitState">\n <input type="hidden" name="rsv_bp" value="1"\n on-focus="changeSubmitState">\n \x3c!-- RSV_IDX控制的input --\x3e\n <input s-for="key in paramsKeys" s-if="{{urlParams[key]}}"\n type="hidden" name="{{key}}" value="{{urlParams[key]}}"\n on-focus="changeSubmitState">\n <input s-if="showSpecialInput"\n s-for="key in specialParamsKeys"\n type="hidden"\n name="{{key}}"\n value="{{urlParams[key]}}"\n on-focus="changeSubmitState"\n\n >\n <span class="bg s_ipt_wr new-pmd quickdelete-wrap"\n on-click="handleKwTip($event)">\n <span class="soutu-btn"></span>\n <script s-if="isSoutu">\n window.__disable_preload = 1;\n window.__disable_predict = 1;\n <\/script>\n <input id="kw" s-ref="kw"\n name="wd" class="s_ipt" value="{= kwVal =}"\n maxlength="{{maxWdLen}}" autocomplete="off"\n on-focus="changeSubmitState"\n >\n <i class="c-icon quickdelete c-color-gray2" title="清空">&#xe610;</i>\n <i class="quickdelete-line"></i>\n <span class="soutu-hover-tip"\n style="display: none;">按图片搜索</span>\n </span>\n <span class="bg s_btn_wr">\n <input type="submit" id="su" value="百度一下" class="bg s_btn">\n </span>\n <span class="tools">\n <span id="mHolder">\n <div id="mCon">\n <span>输入法</span>\n </div>\n <ul id="mMenu">\n <li>\n <a href="javascript:;" name="ime_hw">\n 手写</a>\n </li>\n <li>\n <a href="javascript:;" name="ime_py">\n 拼音</a>\n </li>\n <li class="ln">\n </li>\n <li>\n <a href="javascript:;" name="ime_cl">\n 关闭</a>\n </li>\n </ul>\n </span>\n </span>\n <input s-for="params in paramsConditionKeys"\n s-if="{{params && params.value}}"\n type="hidden"\n name="{{params && params.name}}"\n value="{{key === \'rsv_spt\' ? urlParams[params.name] : urlParams[params.name]}}"\n on-focus="changeSubmitState"\n\n >\n <input type="hidden" name="oq" value="{{query}}"\n on-focus="changeSubmitState">\n <input type="hidden" name="rsv_pq" value="{{queryId}}"\n on-focus="changeSubmitState">\n <input type="hidden" name="rsv_t" value="{{encTn}}"\n on-focus="changeSubmitState">\n <input type="hidden" name="rqlang" value="{{resultLang}}"\n on-focus="changeSubmitState">\n </form>\n <div s-if="chatInputSsr">{{chatInputSsr | raw}}</div>\n</div>\n',SearchboxComp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{paramsKeys:["srcqid","vit","dsp"],showSpecialInput:!1,specialParamsKeys:["tn","ch","bar"],isSoutu:!1,queryOriginal:"",paramsConditionKeys:[{}],inputStatus:"focus",kwVal:"",maxWdLen:255,supportTusou:!1,showTusouTip:!1,chatInputSsr:""}},t.prototype.attached=function(){headScript_pc_static_index.eventBus.searchbox.attached.emit()},t.template=SearchboxCompTpl,t.trimhitespace="all",t}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_search-box/pc/static/search-box/searchbox.san",(function(){/*!* export **/return SearchboxComp/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var PersonalCenterCompTpl='<div id="u">\n <a class="toindex" href="/">百度首页</a>\n <a\n s-if="isUserLogin"\n class="message-center-wrapper">\n <div\n class="message-center-container"\n >\n \x3c!-- 入口 --\x3e\n <div\n s-ref="message-center-icon"\n class="message-center-icon"\n on-mouseenter="handleMouseEnter"\n on-mouseleave="handleMouseLeave"\n >\n 通知\n <div s-if="unreadCount > 0" class="message-unread-dot"></div>\n </div>\n </div>\n </a>\n <a name="tj_settingicon" class="pf" on-click="setting">\n 设置\n <i class="c-icon c-icon-triangle-down"></i>\n </a>\n <a href="https://www.baidu.com/my/index"\n id="user"\n class="username"\n on-mouseover="userMenuShow"\n on-mouseout="userMenuHide"\n s-if="isUserLogin"\n >\n <span class="s-top-img-wrapper">\n <img src="{{imgUrl}}">\n </span>\n <span class="s-top-username">\n {{displayName}}\n </span>\n </a>\n <a href="javascript:;"\n s-else\n name="tj_login"\n class="lb {{hitPCSearchQrCodeBtn ? \'lb-has-qrcode\' : \'\'}}"\n >\n 登录\n <div s-if="hitPCSearchQrCodeBtn" class="login-guide-bubble">登录体验更多服务👆</div>\n </a>\n <div class="usermenu"\n on-click="userMenuClick"\n on-mouseover="userMenuShow"\n on-mouseout="userMenuHide"\n s-show="showUserMenu"\n >\n <div class="bdnuarrow">\n <em></em>\n <i></i>\n </div>\n <a class="first" href="https://www.baidu.com/my/index" on-mousedown="usermenuMouseDown(\'uc_center\')">\n <span class="set">个人中心</span>\n </a>\n <a href="http://passport.baidu.com" class="tj_user" on-mousedown="usermenuMouseDown(\'tjuser\')">\n <span class="set">账号设置</span>\n </a>\n <a href="javascript:;" class="set-feedback" on-mousedown="usermenuMouseDown(\'tjfeedback\')"\n on-click="feedbackClick"\n >\n <span class="set">意见反馈</span>\n </a>\n <a class="last logout" name="tj_logout" on-mousedown="usermenuMouseDown(\'logout\')"\n on-click="logoutClick"\n >\n <span class="set">退出</span>\n </a>\n </div>\n <div class="bdpfmenu"></div>\n</div>\n',CHAT_HOST="https://chat.baidu.com",PersonalCenter=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{displayName:"",imgUrl:"",hideUserMenuTimer:!0,showUserMenu:!1,timeout:200,showTTS:!0,showSkin:!1,unreadCount:0,qid:"",token:"",hitRecommendSample:!1,hitPCSearchQrCodeBtn:!1}},t.prototype.attached=function(){var e,t,n=this;if(headScript_pc_static_index.eventBus.userInfo.update.on((function(e){n.data.set("displayName",e.user),n.data.set("imgUrl",e.userPortrait),n.data.set("isUserLogin",!0)})),this.data.get("isUserLogin")&&!(null===(e=null===headScript_pc_static_index.BDSInstance||void 0===headScript_pc_static_index.BDSInstance?void 0:headScript_pc_static_index.BDSInstance.comm)||void 0===e?void 0:e.ishome)){headScript_pc_static_pageLog_ubcLog.sendUbcLog(19057,"show","notice_access");var i=function(){var e=n.data.get("qid"),t=n.data.get("token"),i=+new Date;return btoa(t+"||"+i+"|"+e)+"-"+e};this.asyncTaskService=new chatPcsearchCommon.AsyncTaskService(CHAT_HOST,i),null===(t=this.asyncTaskService)||void 0===t||t.init(),this.nextTick((function(){var e,t,a=function(e){var t,n=document.createElement("div");return n.className=e,null===(t=document.querySelector("#head"))||void 0===t||t.appendChild(n),n},o=a("message-panel-container-wrapper"),s=a("message-center-push-container"),r=a("message-center-settings-modal-container");n.messageCenter=new chatPcsearchCommon.MessageCenterCore({baseUrl:CHAT_HOST,enableRecommend:!1,showSettings:n.data.get("hitRecommendSample"),from:"result_page",enableListPolling:!0,maxLimitMessages:100,maxLimitTime:2592e6,logContainer:document.body,messageCenterIcon:n.ref("message-center-icon"),messagePanelContainer:o,pushNotificationsContainer:s,settingsModalContainer:r,onMessageClick:function(e){n.onMessageClick(e)},onNotificationClick:function(e){window.focus(),n.onMessageClick(e,!0)},onUnreadCountUpdate:function(e){n.data.set("unreadCount",e)},getToken:i}),null===(e=n.messageCenter)||void 0===e||e.startPolling(),null===(t=n.messageCenter)||void 0===t||t.on("log",(function(e){try{var t=e.type,n=e.logData,i=JSON.parse(null!=n?n:"{}"),a=i.value,o=i.ext;headScript_pc_static_pageLog_ubcLog.sendUbcLog(19057,t,a,o)}catch(s){}}))})),this.onVisibilityChange=this.visibilityChange.bind(this),document.addEventListener("visibilitychange",this.onVisibilityChange)}},t.prototype.visibilityChange=function(){var e,t,n,i;"visible"===document.visibilityState?(null===(e=this.messageCenter)||void 0===e||e.startPolling(),null===(t=this.messageCenter)||void 0===t||t.startListPolling()):(null===(n=this.messageCenter)||void 0===n||n.stopPolling(),null===(i=this.messageCenter)||void 0===i||i.stopListPolling())},t.prototype.detached=function(){var e,t;this.messageCenter&&(null===(e=this.messageCenter)||void 0===e||e.destroy()),null===(t=this.asyncTaskService)||void 0===t||t.dispose(),this.onVisibilityChange&&(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)},t.prototype.onMessageClick=function(e,t){e&&("sendPrompt"===e.notifyInfo.action?this.sendPrompt(e,t):this.jumpHistory(e))},t.prototype.sendPrompt=function(e,t){var n=e.notifyType,i=e.notifyInfo.query,a={enter_type:"".concat(t?"sysbrowser":"a","_notice_").concat(n),sa:"".concat(t?"sysbrowser":"a","_notice_").concat(n)},o=CHAT_HOST+"/search"+"?word=".concat(encodeURIComponent(i))+"&extParams="+encodeURIComponent(JSON.stringify(a));window.open(o,"_blank")},t.prototype.jumpHistory=function(e,t){var n,i,a,o,s=e.notifyType,r=e.notifyInfo,l=r.sessionId,c=r.qid,d=r.taskId,u=r.taskGroup,p={ori_lid:l,enter_type:"".concat(t?"sysbrowser":"a","_notice_").concat(s),subEnterType:"his_middle",messageCenterInfo:{query:null===(n=null==e?void 0:e.notifyInfo)||void 0===n?void 0:n.query,functionType:null===(i=null==e?void 0:e.notifyInfo)||void 0===i?void 0:i.subType,noticeType:s,noticeContent:null===(a=null==e?void 0:e.showData)||void 0===a?void 0:a.content,referenceQid:c}};this.asyncTaskService&&d&&(null===(o=this.asyncTaskService)||void 0===o||o.updateTaskReadStatus({sessionId:l,qid:c,taskId:d,taskGroup:u}));var h=CHAT_HOST+"/search?extParams="+encodeURIComponent(JSON.stringify(p));window.open(h,"_blank")},t.prototype.togglePanel=function(e){var t,n;e?null===(t=this.messageCenter)||void 0===t||t.showPanel():null===(n=this.messageCenter)||void 0===n||n.hidePanel()},t.prototype.handleMouseEnter=function(){this.togglePanel(!0)},t.prototype.handleMouseLeave=function(){this.togglePanel(!1)},t.prototype.usermenuMouseDown=function(e){window.user_c({fm:"set",tab:e}),"uc_center"===e?this.setUbcLog("head_icon_pop","tjucent"):this.setUbcLog("head_icon_pop",e)},t.prototype.setUbcLog=function(e,t){headScript_pc_static_pageLog_ubcLog.sendUbcLog(19057,"click",e,{module:t})},t.prototype.feedbackClick=function(e){$(".fb-feedback-right-dialog").length>0?e.stopPropagation():(this.nsclick("tj_feedback"),new Promise((function(e,t){require(['feedback/pc/static/feedback_suggest'],e,t)})).then((function(e){var t=e.feedbackInstance;t.init(),$(".feedback").on("click",(function(){t.destroy()}))})))},t.prototype.nsclick=function(e){var t=new RegExp("^\\s+|\\s+$"),n=$("#kw").val().replace(t,"");window.ns_c({fm:"behs",tab:e,query:encodeURIComponent(n),un:encodeURIComponent(headScript_pc_static_index.BDSInstance.comm.user||"")})},t.prototype.logoutClick=function(){$(".search-quit-dialog-wrap").show(),window.c({rsv_ct:"5",rsv_cst:"1"})},t.prototype.userMenuClick=function(e){e.stopPropagation()},t.prototype.userMenuShow=function(){var e=this.data.get("hideUserMenuTimer"),t=$(".bdpfmenu");this.data.set("showUserMenu",!0),t&&t.hide(),e&&(clearTimeout(e),this.data.set("hideUserMenuTimer",null))},t.prototype.userMenuHide=function(e){var t=this;e.stopPropagation();var n=this.data.get("hideUserMenuTimer");n&&(clearTimeout(n),this.data.set("hideUserMenuTimer",null));var i=this.data.get("timeout"),a=setTimeout((function(){t.data.set("showUserMenu",!1)}),i);this.data.set("hideUserMenuTimer",a)},t.template=PersonalCenterCompTpl,t.trimWhitespace="all",t}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_personal-center/pc/static/personal-center.san",(function(){/*!* export **/return PersonalCenter/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var templateHTML$1="<div id=\"s_tab\" class=\"{{$style['s_tab']}}\">\n <div s-ref=\"tabInner\"\n id=\"s_tab_inner\"\n class=\"s_tab_inner {{$style['s_tab_inner']}}\"\n >\n <template s-for=\"tab in showTabList\">\n <b\n s-if=\"tab.select === 1\"\n class=\"{{[\n 'cur-tab',\n 'c-color-t',\n $style['cur-tab'],\n $style['s-tab-' + tabbr]\n ]}}\"\n >\n {{ tab.text }}\n </b>\n <a\n s-else\n href=\"{{jumpLink(tab)}}\"\n sync=\"{{tab.log === 'news' ? true : ''}}\"\n wdfield=\"{{tab.key ? tab.key : ''}}\"\n class=\"{{[\n 's-tab-item',\n $style['s-tab-item'],\n tab.tabImgUrl ? $style['s-tab-item-img'] : $style['s-tab-' + tab.log],\n ]}} s-tab-{{tab.log}}\n {{isPeak && tab.log === 'csaitab' && !tab.tabImgUrl ? $style['s-tab-csaitab-peak'] : ''}}\n \"\n on-click=\"sendLog(tab.log)\"\n >\n <img s-if=\"tab.tabImgUrl\" src=\"{{isPeak ? tab.tabImgPeakUrl : tab.tabImgUrl}}\">\n <span s-else>{{tab.text}}</span>\n </a>\n </template>\n \x3c!-- 预加载,防止hover闪动 --\x3e\n <img\n s-if=\"isAiTabEntry && !isPeak\"\n src=\"https://psstatic.cdn.bcebos.com/basics/chat/logo_1721447231000.svg\"\n style=\"display: none;\"\n />\n <fragment s-if=\"pcFreshWrapper || isShowFilterTag\">\n <span\n class=\"\n s-tab-item\n {{[$style['s-tab-filter'], 's-tab-filter']}}\n {{$style['s-tab-item']}}\n {{isPeak ? [$style['s-tab-filter-peak'], 's-tab-filter-peak'] : ''}}\n \"\n on-click=\"handleFilter\"\n >搜索工具</span>\n </fragment>\n </div>\n</div>\n",style$2={s_tab:"head-tab_s_tab__WndRY",sTab:"head-tab_s_tab__WndRY","cur-tab":"head-tab_cur-tab__dv3dB",curTab:"head-tab_cur-tab__dv3dB","s-tab-item":"head-tab_s-tab-item__o9QxU",sTabItem:"head-tab_s-tab-item__o9QxU","s-tab-item-img":"head-tab_s-tab-item-img__k6HHW",sTabItemImg:"head-tab_s-tab-item-img__k6HHW",s_tab_inner:"head-tab_s_tab_inner__-IRZZ",sTabInner:"head-tab_s_tab_inner__-IRZZ",wrapper_new:"head-tab_wrapper_new__Il6Q-",wrapperNew:"head-tab_wrapper_new__Il6Q-",wrapper_s:"head-tab_wrapper_s__RvdgC",wrapperS:"head-tab_wrapper_s__RvdgC","s-tab-news":"head-tab_s-tab-news__bXC-1",sTabNews:"head-tab_s-tab-news__bXC-1","s-tab-video":"head-tab_s-tab-video__F-urO",sTabVideo:"head-tab_s-tab-video__F-urO","s-tab-pic":"head-tab_s-tab-pic__dhV33",sTabPic:"head-tab_s-tab-pic__dhV33","s-tab-zhidao":"head-tab_s-tab-zhidao__wAq4n",sTabZhidao:"head-tab_s-tab-zhidao__wAq4n","s-tab-wenku":"head-tab_s-tab-wenku__vAZ2T",sTabWenku:"head-tab_s-tab-wenku__vAZ2T","s-tab-tieba":"head-tab_s-tab-tieba__v9goo",sTabTieba:"head-tab_s-tab-tieba__v9goo","s-tab-b2b":"head-tab_s-tab-b2b__bqQ-m",sTabB2B:"head-tab_s-tab-b2b__bqQ-m","s-tab-map":"head-tab_s-tab-map__rNTnP",sTabMap:"head-tab_s-tab-map__rNTnP","s-tab-realtime_ugc":"head-tab_s-tab-realtime_ugc__hravo",sTabRealtimeUgc:"head-tab_s-tab-realtime_ugc__hravo","s-tab-note":"head-tab_s-tab-note__aqWAS",sTabNote:"head-tab_s-tab-note__aqWAS","ai-talk":"head-tab_ai-talk__TKn0p",aiTalk:"head-tab_ai-talk__TKn0p",darkmode:"head-tab_darkmode__qiaYT","s-new-tag":"head-tab_s-new-tag__zIECR",sNewTag:"head-tab_s-new-tag__zIECR","pc-fresh-wrapper":"head-tab_pc-fresh-wrapper__swwIh",pcFreshWrapper:"head-tab_pc-fresh-wrapper__swwIh",wrapper_l:"head-tab_wrapper_l__o0Pjp",wrapperL:"head-tab_wrapper_l__o0Pjp","s-tab-filter":"head-tab_s-tab-filter__0nVhu",sTabFilter:"head-tab_s-tab-filter__0nVhu","s-tab-filter-peak":"head-tab_s-tab-filter-peak__e0-vB",sTabFilterPeak:"head-tab_s-tab-filter-peak__e0-vB"},HeadTab=function(e){function t(t,n,i,a,o){var s,r=this;return(r=e.call(this,t)||this).trimWhitespace="all",r.customClass="hit-headtab",r.log=n,r.ubcLog=a,r.aiContainer={},r.event=i,r.query=o,r.aiEntryOpenFunction={},r.aiEntryCloseFunction={},r.data.set("lid",(null===(s=r.query)||void 0===s?void 0:s.get("lid"))||""),r}var n,i,a,o,s;return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{showTabList:[],backup:!1,lid:"",curPd:"",isAiTabEntry:!1,isPeak:!1,isIE:!1,isIpad:!1,passportStaticPage:"//www.baidu.com/cache/user/html/v3Jump.html",$style:style$2||{},needubs:"1"}},t.prototype.jumpLink=function(e){return this.data.get("backup")?e.orig_link:"video"===e.pd||"realtime_ugc"===e.pd?e.tabUrl:e.orig_link},t.prototype.sendLog=function(e){(this.sendTabLog("click",e),"csaitab"!==e)?"1"===this.data.get("needubs")&&this.log.send({fm:"tab",tab:e},"sclick"):this.ubcLog&&this.sendAiUbcLog("click","web_search")},t.prototype.sendAiUbcLog=function(e,t){var n,i=this.data.get("lid");null===(n=this.ubcLog)||void 0===n||n.send({type:e,value:"csaitab",ext:{lid:i,setype:t}},{ubcId:"17132",config:{page:"resultpage",queryParams:{appname:"pcsearch"}}})},t.prototype.getQueryString=function(e){return"undefined"!=typeof window&&window.location&&window.location.href&&new URL(window.location.href).searchParams.get(e)||""},t.prototype.sendTabLog=function(e,t){var n,i={type:e,value:"tab",rsv_dl:this.getQueryString("rsv_dl"),ext:{qid:window.bds.comm.qid,goal_tab:t,current_tab:"web"}};null===(n=this.ubcLog)||void 0===n||n.send(i,{ubcId:"19051",config:{page:"a",from:"search",queryParams:{appname:"pcsearch"}}})},t.prototype.createEvent=function(e){return this.data.get("isIE")?new Event(e,{bubbles:!0,cancelable:!1}):new Event(e)},t.prototype.setStorage=function(e,t){try{localStorage.setItem(e,t)}catch(n){console.error(n)}},t.prototype.getStorage=function(e){try{return localStorage.getItem(e)}catch(t){return console.error(t),null}},t.prototype.setEntryOpenBodyStyle=function(){var e=document.body,t=this.data.get("isIpad");e.classList.add("ai-switch-on"),e.classList.remove("ai-switch-off");var n={height:"100vh",overflow:"hidden"},i=t?headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},n),{position:"fixed"}):n;Object.keys(i).forEach((function(t){e.style[t]=i[t]}))},t.prototype.setEntryCloseBodyStyle=function(e){var t=document.body,n=this.data.get("isIpad");t.classList.remove("ai-switch-on"),"sync"===e&&t.classList.add("ai-switch-off");var i={height:"",overflow:""},a=n?headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},i),{position:""}):i;Object.entries(a).forEach((function(e){var n=headScript_pc_static_index.__read(e,2),i=n[0],a=n[1];t.style[i]=a}))},t.prototype.aiEntryOpen=function(e){var t=this.data.get("queryWordNoSyntax"),n=this.data.get("passportStaticPage");this.closeOtherAll(),this.setEntryOpenBodyStyle(),this.setStorage("ai-talk-switch","open");var i={pcasync:"pc",asyncRenderUrl:"",passportStaticPage:encodeURIComponent(window.location.protocol+n)},a=e.detail?headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},i),e.detail):headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},i),{from:"pc_tab",word:encodeURIComponent(t),source:"pd_ic"}),o=document.getElementById("ai-talk-container");this.aiContainer.loadAISearch(o,a)},t.prototype.aiEntryClose=function(){this.setEntryCloseBodyStyle("sync"),this.setStorage("ai-talk-switch","close"),setTimeout((function(){document.body.classList.remove("ai-switch-off")}),470)},t.prototype.aiClick=function(){var e=this,t=this.createEvent("ai-entry.open");window.dispatchEvent(t),this.nextTick((function(){e.log.send({rsv_ct:175,rsv_cst:7},"sclick")}))},t.prototype.buildStyle=function(){var e=document.createElement("style");e.dataset["for"]="result",e.classList.add("ai-container-style"),e.textContent="\n #ai-talk-container {\n position: absolute;\n transform: translateY(-100vh);\n z-index: -500;\n visibility: hidden;\n transition-property: transform, visibility;\n transition-duration: .48s;\n transition-timing-function: ease-in-out;\n width: 100%;\n height: 100vh;\n background-image: linear-gradient(96deg,\n rgba(224,244,255, .7) 0%,\n rgba(227,240,255, .7) 63%,\n rgba(235,229,255, .7) 100%);\n }\n .ai-switch-on #wrapper {\n transform: translateY(100vh);\n visibility: hidden;\n transition-property: transform, visibility;\n transition-duration: .48s;\n transition-timing-function: ease-in-out;\n }\n .ai-switch-on #ai-talk-container {\n visibility: visible;\n z-index: 500;\n transform: translateY(0);\n transition-property: transform, visibility;\n transition-duration: .48s;\n transition-timing-function: ease-in-out;\n }\n .ai-switch-off #wrapper {\n visibility: visible;\n transform: translateY(0);\n transition-property: transform, visibility;\n transition-duration: .48s;\n transition-timing-function: ease-in-out;\n }\n .ai-switch-off #ai-talk-container {\n position: absolute;\n transform: translateY(-100vh);\n z-index: -500;\n visibility: hidden;\n transition-property: transform, visibility;\n transition-duration: .48s;\n transition-timing-function: ease-in-out;\n }\n ",document.head.appendChild(e)},t.prototype.buildAiWrapper=function(){var e=document.querySelectorAll("#ai-talk-container");e.length>0&&(e.forEach((function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),document.querySelectorAll(".ai-container-style").forEach((function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})));var t=document.createElement("div");t.id="ai-talk-container",document.body.insertBefore(t,document.body.firstChild)},t.prototype.bindEvent=function(){window.addEventListener("ai-entry.open",this.aiEntryOpenFunction),window.addEventListener("ai-entry.close",this.aiEntryCloseFunction)},t.prototype.closeOtherAll=function(){var e=this.event;e.emit("aging-tools.close",null),e.emit("tts.close",null)},t.prototype.initContainer=function(){var e=new aiSearchBoxEntry.AiSearchBoxEntry;this.aiContainer=e,this.aiEntryOpenFunction=this.aiEntryOpen.bind(this),this.aiEntryCloseFunction=this.aiEntryClose.bind(this),this.buildAiWrapper(),this.buildStyle(),this.bindEvent()},t.prototype.attached=function(){var e=this,t=navigator.userAgent,n=navigator.maxTouchPoints,i=headScript_pc_static_index.isIEBrowser()||t.indexOf("trident")>-1||t.indexOf("MISE")||t.indexOf("Trident"),a=t.indexOf("ipad")>-1||t.indexOf("iPad")>-1||t.indexOf("Macintosh")>-1&&t.indexOf("Intel")>-1&&n>1;this.data.set("isIE",i),this.data.set("isIpad",a);var o=this.data.get("isAiTabEntry"),s=this.data.get("curPd");this.nextTick((function(){"ps"===s&&(e.initContainer(),e.log.send({rsv_ct:175,rsv_cst:8},"sclick")),o&&e.sendAiUbcLog("show","se")}))},t.prototype.getAiTabImageStyle=function(e){switch(e){case"AsstOne":case"AsstFour":return"width: 49px; height: 14px; margin-bottom: -2px";case"AsstThree":return"width: 35px; height: 14px; margin-bottom: -2px";default:return""}},t.prototype.handleFilter=function(){headScript_pc_static_index.eventBus.searchTool.filter.emit()},t.prototype.detached=function(){window.removeEventListener("ai-entry.open",this.aiEntryOpenFunction),window.removeEventListener("ai-entry.close",this.aiEntryCloseFunction),document.querySelectorAll("#ai-talk-container").forEach((function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),document.querySelectorAll(".ai-container-style").forEach((function(e){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)})),this.setEntryCloseBodyStyle("async")},t.template=templateHTML$1,t.computed={tabbr:function(){var e,t,n=this.data.get("showTabList");try{for(var i=headScript_pc_static_index.__values(n),a=i.next();!a.done;a=i.next()){var o=a.value;if(1===o.select)return o.log}}catch(s){e={error:s}}finally{try{a&&!a.done&&(t=i["return"])&&t.call(i)}finally{if(e)throw e.error}}return""}},t=headScript_pc_static_index.__decorate([modules_pc_static_services_injectJs.injectable,headScript_pc_static_index.__metadata("design:paramtypes",["function"==typeof(n="undefined"!=typeof wwwApi.SanOption&&wwwApi.SanOption)?n:Object,"function"==typeof(i="undefined"!=typeof wwwApi.Log&&wwwApi.Log)?i:Object,"function"==typeof(a="undefined"!=typeof wwwApi.EventEmitter&&wwwApi.EventEmitter)?a:Object,"function"==typeof(o="undefined"!=typeof wwwApi.UbcLog&&wwwApi.UbcLog)?o:Object,"function"==typeof(s="undefined"!=typeof wwwApi.Query&&wwwApi.Query)?s:Object])],t)}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_head-tab/pc/static/head-tab.san",(function(){/*!* export **/return HeadTab/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var SCROLL_TIME=468,raf="undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}),now="undefined"!=typeof window&&window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now;function scrollElement(e){this.scrollLeft=e}var ease=function(e){return.5*(1-Math.cos(Math.PI*e))},step=function(e){var t=(now()-e.startTime)/SCROLL_TIME,n=ease(t=t>1?1:t),i=e.startX+(e.x-e.startX)*n;scrollElement.call(e.scrollable,i),i!==e.x&&raf&&raf(step.bind(window,e))},smoothScroll=function(e,t){var n=e,i=e.scrollLeft,a=now();step({scrollable:n,startTime:a,startX:i,x:t})},templateHTML='<div\n id="searchTag"\n class="\n {{$style.tagContainer}}\n {{flag ? $style[\'strong-tag\'] : \'\'}}\n ">\n <div class="{{$style.tagWrapper}}">\n \x3c!-- 滑动区域 --\x3e\n <div\n s-ref="tagScroll"\n class="{{$style.tagScroll}}"\n on-click="sendLog({\'rsv_click_type\': \'search_tag_click\'})"\n on-scroll="scroll">\n <a\n s-ref="{{\'tag-\' + index}}"\n class="{{[\n \'c-color-t\',\n \'c-line-clamp1\',\n $style.tags,\n selectedIndex === index ? $style.tagSelected: \'\',\n isIpad ? $style.touch : \'\']}}"\n s-for="tag, index in tagList"\n href="{{tag.url}}"\n on-click="tagClick(tag, index)"\n >\n \x3c!-- 图文强样式 --\x3e\n <template s-if="flag">\n <div s-if="tag.img" class="c-img {{$style.tagImg}}">\n <span class="c-img-border"></span>\n <img src="{{tag.img}}">\n </div>\n <div class="{{$style.tagDetails}}">\n <div\n s-if="tag.img"\n class="{{[\'c-color-gray2\', $style.tagBaseQuery]}}">{{baseQuery}}</div>\n <div\n class="\n {{$style.tagText}}\n {{!tag.img ? $style.tagTextAll : \'\'}}\n ">{{tag.tagKey}}</div>\n </div>\n </template>\n \x3c!-- 文本样式 --\x3e\n <template s-else><span>{{tag.tagKey}}</span></template>\n </a>\n </div>\n \x3c!-- 左按钮 --\x3e\n <span s-if="showLeft" class="{{[\'search-tag-left\', $style.leftWrapper]}}">\n <span\n class="{{[\n \'c-color-text\',\n $style.left,\n isIpad ? $style.touch : \'\']}}"\n on-click="move(\'left\')">\n <i class="{{[\'c-icon\', $style.leftIcon]}}">&#xe617;</i>\n </span>\n </span>\n \x3c!-- 右按钮 --\x3e\n <span s-if="showRight" class="{{[\'search-tag-right\', $style.rightWrapper]}}">\n <span\n class="{{[\n \'c-color-text\',\n $style.right,\n isIpad ? $style.touch : \'\']}}"\n on-click="move(\'right\')">\n <i class="{{[\'c-icon\', $style.rightIcon]}}">&#xe613;</i>\n </span>\n </span>\n </div>\n</div>',style$1={"tag-wrapper":"index_tag-wrapper__88mFV",tagWrapper:"index_tag-wrapper__88mFV","tag-new-wrapper":"index_tag-new-wrapper__VWKyB",tagNewWrapper:"index_tag-new-wrapper__VWKyB",tags:"index_tags__qupUk","tag-container":"index_tag-container__XZFzi",tagContainer:"index_tag-container__XZFzi","tag-selected":"index_tag-selected__BHVBD",tagSelected:"index_tag-selected__BHVBD",left:"index_left__I09wo",right:"index_right__eHTtn",touch:"index_touch__x7j6l","left-wrapper":"index_left-wrapper__F5d5-",leftWrapper:"index_left-wrapper__F5d5-","right-wrapper":"index_right-wrapper__zECns",rightWrapper:"index_right-wrapper__zECns","tag-scroll":"index_tag-scroll__Yl96x",tagScroll:"index_tag-scroll__Yl96x","left-icon":"index_left-icon__wZJLN",leftIcon:"index_left-icon__wZJLN","right-icon":"index_right-icon__sCS1T",rightIcon:"index_right-icon__sCS1T","strong-tag":"index_strong-tag__u8DdU",strongTag:"index_strong-tag__u8DdU","tag-img":"index_tag-img__Df6Jl",tagImg:"index_tag-img__Df6Jl","tag-details":"index_tag-details__4llPv",tagDetails:"index_tag-details__4llPv","tag-base-query":"index_tag-base-query__tBW6b",tagBaseQuery:"index_tag-base-query__tBW6b","tag-text":"index_tag-text__b7D4C",tagText:"index_tag-text__b7D4C","tag-text-all":"index_tag-text-all__gkl3E",tagTextAll:"index_tag-text-all__gkl3E"},lsExpire=864e5,SearchTagComponent=function(e){function t(t,n,i){var a=e.call(this,t)||this;return a.trimwhitespace="all",a.log=n,a.ubcLog=i,a.initScrollFunction=a.initScroll.bind(a),a}var n,i,a;return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{tagList:[],selectedIndex:0,baseQuery:"",listRealWidth:0,listClientWidth:0,listScrolledWidth:0,flag:0,hasTagDom:!0,isNoSupportBrowser:!1,isIE:!1,isIpad:!1,$style:style$1||{}}},t.prototype.getElement=function(e){return this.ref(e)},t.prototype.move=function(e){if(this.data.get("hasTagDom")){var t=this.getElement("tagScroll"),n=this.data.get("isNoSupportBrowser"),i=this.data.get("clientWidth"),a=this.data.get("listRealWidth"),o=this.data.get("listScrolledWidth"),s="right"===e?a-o>i?i:a-i:o>i?i:o,r="left"===e?o-s:s+o;n?smoothScroll(t,r):t.scrollTo({left:r,behavior:"smooth"}),this.data.set("listScrolledWidth",r);var l=this.data.get("baseQuery");this.sendLog({type:e,tagBaseQuery:l})}},t.prototype.initScroll=function(){var e=this.getElement("tagScroll"),t=e.scrollWidth,n=e.clientWidth;this.data.set("listRealWidth",t),this.data.set("clientWidth",n)},t.prototype.scroll=function(){var e=this.data.get("hasTagDom"),t=this.getElement("tagScroll");if(e&&t.scrollLeft){var n=t.scrollLeft;this.data.set("listScrolledWidth",n),this.checkAndLogExposure(t)}},t.prototype.scrollToIndex=function(){var e=this.data.get("hasTagDom"),t=this.data.get("selectedIndex"),n=this.getElement("tag-".concat(t));if(e&&n){var i=this.getElement("tagScroll"),a=this.data.get("isIE"),o=this.data.get("clientWidth"),s=this.data.get("listRealWidth"),r=n.offsetLeft,l=0;l=r<o-119?0:r>s-o?s-o:r-o/2,a?i.scrollLeft=l:i&&i.scrollTo({left:l,behavior:"auto"})}},t.prototype.tagClick=function(e,t){this.sendUbcLog("click",null==e?void 0:e.tagKey,String(t+1));var n=this.data.get("baseQuery");this.sendLog({tagBaseQuery:n,tagQuery:e.word,tagKey:e.tagKey,tagIndex:t})},t.prototype.sendUbcLog=function(e,t,n){var i,a={type:e,value:"tag",ext:{qid:window.bds.comm.qid,tag_name:t,tag_pos:n,query:this.data.get("baseQuery")}};null===(i=this.ubcLog)||void 0===i||i.send(a,{ubcId:"19052",config:{page:"a",from:"search",queryParams:{appname:"pcsearch"}}})},t.prototype.sendLog=function(e,t){t?e.hasOwnProperty("rsv_clk_extra")?this.log.send(headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},e),{rsv_clk_extra:JSON.stringify(e.rsv_clk_extra)})):this.log.send(headScript_pc_static_index.__assign({},e)):this.log.send({clk_info:JSON.stringify(e)})},t.prototype.isNoSupportBrowser=function(){var e=headScript_pc_static_index.isIEBrowser();this.data.set("isIE",e);var t=e||headScript_pc_static_index.isSafari();this.data.set("isNoSupportBrowser",t)},t.prototype.getLsItem=function(e){var t=window&&window.localStorage.getItem(e);return t&&JSON.parse(t)},t.prototype.storageAvailable=function(){try{if(window&&"__localstorage_test__"===window.localStorage.getItem("__localstorage_test__"))return!0;var e="__localstorage_test__";return window&&window.localStorage.setItem(e,e),!0}catch(t){return console.warn("".concat(t.message,",您的浏览器不支持localStorage,或者localStorage已被禁用。")),!1}},t.prototype.isUseLocalStorage=function(){var e=this.data.get("baseQuery"),t=this.getLsItem("searchTag"),n=this.data.get("flag"),i=Date.now(),a=t&&t.expire||0,o=t&&t.baseQuery||"",s=t&&t.flag||0;if(!t||i-a>lsExpire||e!==o||n!==s)window&&window.localStorage.setItem("searchTag",JSON.stringify({flag:n,baseQuery:e,tags:this.data.get("tagList"),expire:Date.now()}));else{var r=t.tags||[];this.data.set("tagList",r)}for(var l=location&&location.href||"",c=l&&new URL(l),d=c&&c.searchParams.get("tag_key")||"",u=this.data.get("tagList"),p=0,h=0;h<u.length;h++){if(u[h].tagKey===d){p=h;break}}this.data.set("selectedIndex",p)},t.prototype.isElementInViewport=function(e){var t=null==e?void 0:e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},t.prototype.checkAndLogExposure=function(e){var t=this;(null==e?void 0:e.childNodes).forEach((function(e,n){"A"===e.tagName&&t.isElementInViewport(e)&&!e.isExposed&&(t.sendUbcLog("show",e.innerText,String(n)),e.isExposed=!0)}))},t.prototype.attached=function(){var e=this,t=this.data.get("flag"),n=this.data.get("isIE"),i=navigator.userAgent,a=navigator.platform,o=navigator.maxTouchPoints,s=i.includes("ipad")||i.includes("iPad")||"MacIntel"===a&&o>1;this.data.set("isIpad",s),!this.storageAvailable()||t&&n?document.getElementById("searchTag").remove():this.nextTick((function(){var t=e.getElement("tagScroll"),n=!!t;e.checkAndLogExposure(t),e.data.set("hasTagDom",n),n&&(e.isUseLocalStorage(),e.isNoSupportBrowser(),e.initScroll(),e.scrollToIndex(),window.addEventListener("resize",e.initScrollFunction))}))},t.prototype.detached=function(){this.data.get("hasTagDom")&&window.removeEventListener("resize",this.initScrollFunction)},t.template=templateHTML,t.computed={showLeft:function(){return this.data.get("listScrolledWidth")>0},showRight:function(){return this.data.get("listScrolledWidth")<this.data.get("listRealWidth")-this.data.get("clientWidth")-1}},t=headScript_pc_static_index.__decorate([modules_pc_static_services_injectJs.injectable,headScript_pc_static_index.__metadata("design:paramtypes",["function"==typeof(n="undefined"!=typeof wwwApi.SanOption&&wwwApi.SanOption)?n:Object,"function"==typeof(i="undefined"!=typeof wwwApi.Log&&wwwApi.Log)?i:Object,"function"==typeof(a="undefined"!=typeof wwwApi.UbcLog&&wwwApi.UbcLog)?a:Object])],t)}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_search-tag/pc/static/index.san",(function(){/*!* export **/return SearchTagComponent/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var templateHtml$2='<div\n data-id="{{id}}"\n data-tpl="{{templateName}}"\n class="se_common_hint">\n <div class="{{$style[\'hint-right-safeinfo\']}}">\n <i class="{{$style[\'hint-right-safeinfo-icon\']}} c-icon c-gap-right-xsmall">&#xe678;</i>\n <span class="{{$style[\'hint-right-safeinfo-text\']}} c-font-medium">\n {{hintData.hintLabel === \'百度安全提示\' ? \'百度安全提示\' : \'百度温馨提示\'}}\n </span>\n </div>\n <div class="{{$style[\'hint_right_content\']}} c-color-text ur_sf_tip">\n \x3c!--bca-disable-next-line--\x3e\n <p s-html="hintData.hintText"></p>\n </div>\n</div>\n ',styles$2={"hint-right-top":"hint-right-top_hint-right-top__CvSq-",hintRightTop:"hint-right-top_hint-right-top__CvSq-","hint-right-safeinfo":"hint-right-top_hint-right-safeinfo__3xMft",hintRightSafeinfo:"hint-right-top_hint-right-safeinfo__3xMft","hint-right-safeinfo-icon":"hint-right-top_hint-right-safeinfo-icon__gfTjc",hintRightSafeinfoIcon:"hint-right-top_hint-right-safeinfo-icon__gfTjc","hint-right-safeinfo-text":"hint-right-top_hint-right-safeinfo-text__-Gowd",hintRightSafeinfoText:"hint-right-top_hint-right-safeinfo-text__-Gowd",hint_right_content:"hint-right-top_hint_right_content__KZELs",hintRightContent:"hint-right-top_hint_right_content__KZELs"},HintRightTop=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.trimWhitespace="all",t}return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{id:0,templateName:"",hintData:{},$style:styles$2}},t.template=templateHtml$2,t}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_hint/pc/static/hint-right-top/hint-right-top.san",(function(){/*!* export **/return HintRightTop/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var templateHtml$1='<div\n data-id="{{id}}"\n data-tpl="{{templateName}}"\n class="se_common_hint"\n>\n \x3c!-- 提示标题 --\x3e\n <div class="{{$style[\'hint-title\']}} {{!disableFold ? \'c-gap-bottom-middle\' : \'\'}}" on-click="isShow(show)">\n <i\n class="c-icon c-gap-right-xsmall {{$style[\'hint-right-safe-tip\']}}">\n &#xe678;\n </i>\n <span class="{{$style[\'hint-right-t-text\']}}">\n {{isUserLogin ? \'百度保障为您搜索护航\' : \'登录百度帐号 交易更有保障\'}}\n </span>\n \x3c!-- 折叠icon --\x3e\n <span\n s-if="!disableFold"\n class="{{$style[\'hint-right-t-a\']}}\n {{show ? $style[\'hint-right-t-a-down\'] : \'\'}}">\n </span>\n </div>\n \x3c!-- 提示内容 --\x3e\n <c-hint-content\n s-if="show || disableFold"\n isUserLogin="{{isUserLogin}}"\n on-login="LoginUser"\n disableFold="{{disableFold}}"\n />\n</div>\n',styles$1={"hint-right-safe-tip":"hint-right-middle_hint-right-safe-tip__KHfcc",hintRightSafeTip:"hint-right-middle_hint-right-safe-tip__KHfcc","hint-right-t-text":"hint-right-middle_hint-right-t-text__Jmk-M",hintRightTText:"hint-right-middle_hint-right-t-text__Jmk-M","hint-right-t-a":"hint-right-middle_hint-right-t-a__F-3eD",hintRightTA:"hint-right-middle_hint-right-t-a__F-3eD","hint-right-t-a-down":"hint-right-middle_hint-right-t-a-down__saV02",hintRightTADown:"hint-right-middle_hint-right-t-a-down__saV02","hint-title":"hint-right-middle_hint-title__kjicg",hintTitle:"hint-right-middle_hint-title__kjicg","fold-container":"hint-right-middle_fold-container__wVgel",foldContainer:"hint-right-middle_fold-container__wVgel","nofold-container":"hint-right-middle_nofold-container__2erPk",nofoldContainer:"hint-right-middle_nofold-container__2erPk","p-display":"hint-right-middle_p-display__x8uxW",pDisplay:"hint-right-middle_p-display__x8uxW","securityplan-newbao":"hint-right-middle_securityplan-newbao__8bu00",securityplanNewbao:"hint-right-middle_securityplan-newbao__8bu00","lb-login-btn":"hint-right-middle_lb-login-btn__4roVW",lbLoginBtn:"hint-right-middle_lb-login-btn__4roVW"},HintContent=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{isUserLogin:!1,disableFold:!1,$style:styles$1}},t.prototype.loginUser=function(){this.fire("login",{})},t.template='\n <div\n class="hint_security_content c-color-text\n {{disableFold ? $style[\'nofold-container\'] : $style[\'fold-container\']}}">\n <p class="{{$style[\'p-display\']}}">\n <a\n href="https://passport.baidu.com/v2/?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F&sms=5&sms=5"\n s-if="isUserLogin == false"\n >\n 登录百度帐号\n </a>\n <span>\n 认准\n <i class="{{$style[\'securityplan-newbao\']}}"></i>\n 保障标,百度为您提供权益保障\n </span>\n </p>\n <p class="{{$style[\'p-display\']}}">\n <span>查看</span>\n <a\n href="http://baozhang.baidu.com/guarantee/agreement?fr=index"\n target="_blank"\n\n >\n 《保障服务协议》\n </a>\n <span>与</span>\n <a\n href="http://baozhang.baidu.com/guarantee/agreement?fr=index#exception"\n target="_blank"\n >\n 免保范围\n </a>\n </p>\n <p class="{{$style[\'p-display\']}}">\n <span>发生欺诈?</span>\n <a\n href="http://baozhang.baidu.com/guarantee/step?fr=index"\n target="_blank"\n >\n 申请保障\n </a>\n </p>\n <p class="{{$style[\'p-display\']}}">\n <a href="https://baozhang.baidu.com/guarantee/m?from=pscard#/bao" target="_blank">加入商家保障</a>\n <span>\n 获得\n <i class="{{$style[\'securityplan-newbao\']}}"></i>\n 保障标\n </span>\n </p>\n <a s-if="!isUserLogin" class="{{$style[\'lb-login-btn\']}}">\n <div\n class="c-btn"\n on-click="loginUser()"\n >\n 立即登录\n </div>\n <div\n class="c-btn c-btn-mini"\n on-click="loginUser()"\n >\n 登录\n </div>\n </a>\n </div>\n ',t}(san.Component),HintRightMiddle=function(e){function t(t,n){var i=e.call(this,t)||this;return i.trimWhitespace="all",i.login=n,i}var n,i;return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{show:!1,disableFold:!1,isUserLogin:0,id:"",templateName:"",$style:styles$1}},t.prototype.LoginUser=function(){this.login.open()},t.prototype.isShow=function(e){this.data.set("show",!e)},t.template=templateHtml$1,t.components={"c-hint-content":HintContent},t=headScript_pc_static_index.__decorate([modules_pc_static_services_injectJs.injectable,headScript_pc_static_index.__metadata("design:paramtypes",["function"==typeof(n="undefined"!=typeof wwwApi.SanOption&&wwwApi.SanOption)?n:Object,"function"==typeof(i="undefined"!=typeof wwwApi.Login&&wwwApi.Login)?i:Object])],t)}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_hint/pc/static/hint-right-middle/hint-right-middle.san",(function(){/*!* export **/return HintRightMiddle/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var templateHtml='<template>\n <div\n cellpadding="0"\n cellspacing="0"\n class="{{$style[\'sftip_com\']}}"\n >\n <div class="{{$style[\'sftip_label\']}}">\n <i s-if="hintLevel === \'blue\'" class="c-icon {{$style[\'blue\']}}" >&#xe64e;</i>\n <i s-if="hintLevel === \'red\'" class="c-icon {{$style[\'red\']}}" >&#xe656;</i>\n <i s-if="hintLevel === \'orange\'" class="c-icon {{$style[\'orange\']}}" >&#xe656;</i>\n <strong class="{{$style[\'prompt-text\']}}">{{hintLabel}}</strong>\n </div>\n \x3c!--此条数据后端返回a标签字符串--\x3e\n \x3c!--bca-disable-next-line--\x3e\n <span s-html="hintText" class="{{$style[\'content\']}}"></span>\n </div>\n</template>',styles={sftip_com:"hint-result-safe-info_sftip_com__Kcx3R",sftipCom:"hint-result-safe-info_sftip_com__Kcx3R","prompt-text":"hint-result-safe-info_prompt-text__3UfjC",promptText:"hint-result-safe-info_prompt-text__3UfjC",content:"hint-result-safe-info_content__fC32u",sftip_red:"hint-result-safe-info_sftip_red__a7oHo",sftipRed:"hint-result-safe-info_sftip_red__a7oHo",sftip_label:"hint-result-safe-info_sftip_label__REKs0",sftipLabel:"hint-result-safe-info_sftip_label__REKs0","c-icon":"hint-result-safe-info_c-icon__8yBB6",cIcon:"hint-result-safe-info_c-icon__8yBB6",red:"hint-result-safe-info_red__j-Nxp",orange:"hint-result-safe-info_orange__ZUIuC",blue:"hint-result-safe-info_blue__8y0Wz"},ResultComponent=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.trimWhitespace="all",t}return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{hintLevel:"",hintLabel:"",hintText:"",$style:styles}},t.template=templateHtml,t}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_hint/pc/static/hint-result-safe-info/hint-result-safe-info.san",(function(){/*!* export **/return ResultComponent/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var style={"rs-link":"index_rs-link__whHJU",rsLink:"index_rs-link__whHJU","pictxt-link":"index_pictxt-link__-V2eO",pictxtLink:"index_pictxt-link__-V2eO","pictxt-icon":"index_pictxt-icon__rzQmm",pictxtIcon:"index_pictxt-icon__rzQmm","pictxt-img":"index_pictxt-img__Kysbe",pictxtImg:"index_pictxt-img__Kysbe","rs-normal-width":"index_rs-normal-width__2NbAW",rsNormalWidth:"index_rs-normal-width__2NbAW","rs-table":"index_rs-table__gLTur",rsTable:"index_rs-table__gLTur","rs-label":"index_rs-label__6JJjD",rsLabel:"index_rs-label__6JJjD","rs-col":"index_rs-col__DozQo",rsCol:"index_rs-col__DozQo","rs-text":"index_rs-text__3wvVN",rsText:"index_rs-text__3wvVN","rs-text-len":"index_rs-text-len__uzAUh",rsTextLen:"index_rs-text-len__uzAUh","rs-text-len-small":"index_rs-text-len-small__paor4",rsTextLenSmall:"index_rs-text-len-small__paor4","rs-img-text-len":"index_rs-img-text-len__WY--A",rsImgTextLen:"index_rs-img-text-len__WY--A","rs-img-text-len-small":"index_rs-img-text-len-small__CN-wg",rsImgTextLenSmall:"index_rs-img-text-len-small__CN-wg","pictxt-table":"index_pictxt-table__BsG46",pictxtTable:"index_pictxt-table__BsG46","pictxt-col":"index_pictxt-col__78VF4",pictxtCol:"index_pictxt-col__78VF4",rs_l_base:"index_rs_l_base__mR8ad",rsLBase:"index_rs_l_base__mR8ad","rs_lable-hot":"index_rs_lable-hot__Q1Kj5",rsLableHot:"index_rs_lable-hot__Q1Kj5","rs_lable-new":"index_rs_lable-new__DLC6F",rsLableNew:"index_rs_lable-new__DLC6F","rs_lable-boil":"index_rs_lable-boil__NtwnQ",rsLableBoil:"index_rs_lable-boil__NtwnQ","rs_lable-boom":"index_rs_lable-boom__g1zAt",rsLableBoom:"index_rs_lable-boom__g1zAt","pc-rs-upgrade":"index_pc-rs-upgrade__W3-hn",pcRsUpgrade:"index_pc-rs-upgrade__W3-hn","rs-icon":"index_rs-icon__Nr7aG",rsIcon:"index_rs-icon__Nr7aG","rs-icon-ai":"index_rs-icon-ai__hgwfz",rsIconAi:"index_rs-icon-ai__hgwfz","rs-row":"index_rs-row__LeEPL",rsRow:"index_rs-row__LeEPL"},RSComponent=function(e){function t(t,n,i,a,o){var s=e.call(this,t)||this;return s.trimWhitespace="all",s.log=n,s.ubcLog=i,s.invokeService=a,s.sampleService=o,s.pos=11,s.flatList=[],s.pageObserver=null,s.invokeService&&s.invokeService.isIPad()&&s.sampleService.hitSample("pc_recommend_invoke")&&s.initInvokeInfo(),s}var n,i,a,o,s;return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{newList:[],labelRs:"相关搜索",picTxtStyle:!1,isSample:!1,$style:style||{}}},t.prototype.attached=function(){this.checkIsInViewport()},t.prototype.detached=function(){this.pageObserver&&this.pageObserver.disconnect()},t.prototype.checkIsInViewport=function(){var e=this,t=document.getElementById("rs_new");t&&"IntersectionObserver"in window&&(this.pageObserver=new IntersectionObserver((function(t){t.forEach((function(t){t.isIntersecting&&e.sendShowLog()}))}),{threshold:.6}),this.pageObserver.observe(t))},t.prototype.sendShowLog=function(){var e,t,n=document.getElementById("rs_new"),i=this.data.get("ubcConfig"),a=this.data.get("ubcExtParams"),o=a.qid,s=a.query,r=a.page_num,l=a.iteminfo,c=void 0===l?[]:l,d=a.pn,u={valueInfo:[{relative_pos:"0",show_ts:Date.now()+"",pn:d,srcid:"rs",area:"LEFT",page_num:r+""||"",heigth:(null==n?void 0:n.clientHeight)||0,abs_pos:"0",iteminfo:c,item_cnt:c.length}]},p=new URLSearchParams(null===(e=window.location)||void 0===e?void 0:e.search).get("rsv_dl")||"",h={type:"show",value:"cardresult",ext:headScript_pc_static_index.__assign({qid:o,query:s,card_type:"rs",rsv_dl:p},u)};null===(t=this.ubcLog)||void 0===t||t.send(h,i)},t.prototype.disableContextMenu=function(e){e.preventDefault()},t.prototype.logSend=function(e,t,n){var i=t.word,a=t.image,o=t.pos,s=t.jumpType,r=t.noAiSug,l=this.data.get("ubcExtParams").page_num,c=n&&"pictxt"===n?{rsv_click_type:"rs_pictxt_".concat(i,"_").concat(a?"1":"0")}:{rsv_click_type:"rs_".concat(i)},d={item:i,pos:o,page_tab:"a",area:"LEFT",page_num:l||"",relative_pos:0,item_type:"aiJump"===s?"ai":"common",no_ai_sug:r};if(t.flag){var u=this.data.get("wordNoSyntax");d=headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},d),{tag_c:"rs",tag_t:t.tag,tag_q:"".concat(u,"-").concat(t.word)})}var p={clk_info:JSON.stringify(d)},h=headScript_pc_static_index.__assign(headScript_pc_static_index.__assign({},c),p);this.log.send(h),this.invokeApp(e,this.flatList.indexOf(t.url))},t.prototype.imgError=function(e){(e.target||e.srcElement).style.display="none"},t.prototype.initInvokeInfo=function(){return headScript_pc_static_index.__awaiter(this,void 0,void 0,(function(){var e,t,n,i,a,o,s,r,l,c,d,u,p;return headScript_pc_static_index.__generator(this,(function(h){switch(h.label){case 0:return this.sampleService.hitSample("pc_recommend_invoke")&&this.invokeService.isIPad()?[4,this.invokeService.init()]:[3,2];case 1:h.sent(),e=this.data.get("newList"),t=location.origin,n=[];try{for(i=headScript_pc_static_index.__values(e),a=i.next();!a.done;a=i.next()){o=a.value;try{for(u=void 0,s=headScript_pc_static_index.__values(o),r=s.next();!r.done;r=s.next())l=r.value,this.flatList.push(l.url),n.push({url:"".concat(t).concat(l.url),query:l.word})}catch(f){u={error:f}}finally{try{r&&!r.done&&(p=s["return"])&&p.call(s)}finally{if(u)throw u.error}}}}catch(m){c={error:m}}finally{try{a&&!a.done&&(d=i["return"])&&d.call(i)}finally{if(c)throw c.error}}this.invokeService.getInvokeInfo(this.pos,n),h.label=2;case 2:return[2]}}))}))},t.prototype.invokeApp=function(e,t){this.sampleService.hitSample("pc_recommend_invoke")&&this.invokeService.isIPad()&&this.invokeService.hitMcp(this.pos)&&this.invokeService.canInvoke(this.pos)&&(e.stopPropagation(),e.preventDefault(),this.invokeService.execInvoke(this.pos,{},t))},t.template='\n <div\n class="new-pmd result-op {{$style.rsNormalWidth}} {{$style.pcRsUpgrade}}"\n id="rs_new"\n srcid="rs"\n tpl=""\n >\n \x3c!-- 相关搜索标题 --\x3e\n <div\n class="c-color-t c-gap-bottom {{$style.rsLabel}}"\n >\n {{ labelRs }}\n </div>\n \x3c!-- RS 基础样式 --\x3e\n <table\n s-if="!picTxtStyle"\n cellpadding="0"\n cellspacing="0"\n class="{{$style.rsTable}}">\n <tr\n s-for="item in newList"\n class="{{$style.rsRow}}"\n >\n <template s-for="child in item">\n <td class="{{$style.rsCol}}">\n <a\n title="{{child.word}}"\n class="{{$style.rsLink}} c-line-clamp1 c-color-link cos-font-medium"\n href="{{ child.url }}"\n target="{{ child.target || \'_self\' }}"\n on-click="logSend($event, child)"\n >\n <span\n class="{{child.jumpType === \'aiJump\' ? $style[\'rs-icon-ai\'] : $style[\'rs-icon\']}}"\n ></span>\n <span\n class="{{$style.rsText}}\n {{child.flag ? $style.rsTextLenSmall : $style.rsTextLen}}"\n >\n {{child.word}}\n </span>\n <span\n s-if="child.flag"\n class="c-text {{$style.rsLBase}} {{$style[child.bgColor]}}"\n >\n <span>{{child.tag}}</span>\n </span>\n </a>\n </td>\n </template>\n </tr>\n </table>\n \x3c!-- RS 图文样式 --\x3e\n <table\n s-else\n cellpadding="0"\n cellspacing="0"\n class="{{$style.rsTable}} {{$style.pictxtTable}}">\n <tr\n s-for="item in newList"\n >\n <template s-for="child in item">\n <td class="{{$style.rsCol}} {{$style.pictxtCol}}">\n <a\n title="{{child.word}}"\n class="{{$style.rsLink}} {{$style.pictxtLink}} c-line-clamp1 c-color-link"\n href="{{child.url}}"\n on-click="logSend($event, child, \'pictxt\')"\n >\n <img\n s-if="child.image"\n class="{{$style.pictxtImg}}"\n src="{{child.image}}"\n on-contextmenu="disableContextMenu($event)"\n on-error="imgError($event)"\n >\n <i\n class="c-icon {{$style.pictxtIcon}}"\n >\n &#xe608;\n </i>\n <span\n class="{{$style.rsText}}\n {{child.flag ? $style.rsImgTextLenSmall : $style.rsImgTextLen}}"\n >\n {{child.word}}\n </span>\n <span\n s-if="child.flag"\n class="c-text {{$style.rsLBase}} {{$style[child.bgColor]}}"\n >\n <span>{{child.tag}}</span>\n </span>\n </a>\n </td>\n </template>\n </tr>\n </table>\n </div>\n ',t=headScript_pc_static_index.__decorate([modules_pc_static_services_injectJs.injectable,headScript_pc_static_index.__metadata("design:paramtypes",["function"==typeof(n="undefined"!=typeof wwwApi.SanOption&&wwwApi.SanOption)?n:Object,"function"==typeof(i="undefined"!=typeof wwwApi.Log&&wwwApi.Log)?i:Object,"function"==typeof(a="undefined"!=typeof wwwApi.UbcLog&&wwwApi.UbcLog)?a:Object,"function"==typeof(o="undefined"!=typeof wwwApi.MCPInvokeService&&wwwApi.MCPInvokeService)?o:Object,"function"==typeof(s="undefined"!=typeof wwwApi.Sample&&wwwApi.Sample)?s:Object])],t)}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_rs/pc/static/index.san",(function(){/*!* export **/return RSComponent/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/;var Mask=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return headScript_pc_static_index.__extends(t,e),t.prototype.initData=function(){return{top:"112px",zIndex:300,showMask:!1,height:"100%",width:"100%",showLoadingIcon:!1}},t.prototype.attached=function(){var e=this;headScript_pc_static_index.eventBus.mask.show.on((function(t){e.data.set("showMask",!0)})),headScript_pc_static_index.eventBus.mask.hide.on((function(){e.data.set("showMask",!1)}))},t.template='\n <div id="_mask" class="{{showLoadingIcon ? \'mask-opacity-loadingIcon\' : \'mask-opacity\'}}" style="\n position: absolute; background: rgb(255, 255, 255);\n z-index: {{zIndex}}; top:{{top}}; left:0px; width:{{width}}; height: {{height}};\n " s-show="{{showMask}}" > \n </div>\n ',t}(san.Component);
/*!*__SAN_MODULE_DEFINE_START__**/define("__result_module_mask/pc/static/mask.san",(function(){/*!* export **/return Mask/*!* export **/}))/*!*__SAN_MODULE_DEFINE_END__**/,extendsAjaxParts(),window.c=clickReport,initPageModule(),qaInit({bds:bds}),window.JSON||(window.JSON=JsonPolyfill);var searchboxInput=$("#kw"),defaultQuery=new DefaultQuery(headScript_pc_static_index.BDSInstance,searchboxInput);defaultQuery.initDefaultQuery(headScript_pc_static_index.BDSInstance),$(window).on("resize",(function(){"pageState"in window&&0!==window.pageState&&(headScript_pc_static_index.BDSInstance.util.setContainerWidth(),headScript_pc_static_index.BDSInstance.event.trigger("se.window_resize"))})),headScript_pc_static_index.BDSInstance.event=new Event$1,headScript_pc_static_index.BDSInstance.se.link=link,bindInitPreloadEvent();var cardLogManager=getCardLogManager();headScript_pc_static_index.BDSInstance.lifecycle.onSwapDomReady((function(e){cardLogManager.handleDomReady()})),headScript_pc_static_index.BDSInstance.lifecycle.onIndexOff((function(){destroyCardLogManager()})),$(document).ready((function(){antiSpam.bindLogEvent()})),extQuery(),window.initResultClickLog=antiSpam.initAntiSpamResultClickLog.bind(antiSpam),initOpenIme(),registerTip(),registerHps(),registerUserInstantSearch(),$(queryHijack),registerHr(),registerShare(),registerTools(),registerLogoSlide(),registerBanner(),registerSafe(),registerImsgAsync(),initFpidEventListener(),initUPN(),initSwapEndEvent(),modules_pc_static_page_mainPage_module.registerTrust(),initHeightAdjust(),initSetFootStyleEvent(),feedbackEntry(),headScript_pc_static_index.BDSInstance.log=loggerInstance.getOutInterface(),initTitleSourceInteractiveOptimation(),initNuIstanctSearchEvents(),window.PRE_CONN=preConnect(),runVelocity(),initSkeleton(),initOrderPlay(),initUserAction(),initTranslate(),$(document).ready((function(){bzinit()})),$(document).ready((function(){checkIfHit("op_https_cert_usable",.001)&&start(document,$)})),new WebbInstance,initSwapBeginEvent(),initConfirmEvent(),initUserActionEvent(),registerZoomPrompt(),headScript_pc_static_index.BDSInstance.lifecycle.onSwapEnd((function(){headScript_pc_static_index.BDSInstance.comm.__rdNum>9e3&&setTimeout((function(){new Promise((function(e,t){require(['bottom-script/pc/static/cookie/clean'],e,t)})).then((function(e){var t=(0,e.cleanCookie)();headScript_pc_static_index.BDSInstance.se.cleanCookie=t,t.init()}))}),0)})),headScript_pc_static_index.BDSInstance.lifecycle.onSwapBegin((function(){cardLogManager.flushLogs()})),window.addEventListener("beforeunload",(function(){cardLogManager.flushLogs()})),exports.Event=Event$1,exports.JsonPolyfill=JsonPolyfill,exports.PersonalCenter=PersonalCenter,exports.WebbInstance=WebbInstance,exports.antiSpam=antiSpam,exports.bzinit=bzinit,exports.checkIfHit=checkIfHit,exports.clickReport=clickReport,exports.destroyCardLogManager=destroyCardLogManager,exports.extendsAjaxParts=extendsAjaxParts,exports.getCardLogManager=getCardLogManager,exports.initConfirmEvent=initConfirmEvent,exports.initHeightAdjust=initHeightAdjust,exports.initOpenIme=initOpenIme,exports.initOrderPlay=initOrderPlay,exports.initPageModule=initPageModule,exports.initSkeleton=initSkeleton,exports.initSwapBeginEvent=initSwapBeginEvent,exports.initSwapEndEvent=initSwapEndEvent,exports.initTitleSourceInteractiveOptimation=initTitleSourceInteractiveOptimation,exports.initUserAction=initUserAction,exports.initUserActionEvent=initUserActionEvent,exports.link=link,exports.loggerInstance=loggerInstance,exports.queryHijack=queryHijack,exports.registerImsgAsync=registerImsgAsync,exports.registerTip=registerTip,exports.registerUserInstantSearch=registerUserInstantSearch,exports.registerZoomPrompt=registerZoomPrompt,exports.runVelocity=runVelocity,exports.start=start}));
/**__BOOTSTRAP_REQUIRE__**/;require(['all_async_search'])