找回密码
 立即注册
搜索
热搜: 丝袜 魅魔 黑丝
查看: 14|回复: 0

26231030_机场安检的拷问冤狱

[复制链接]

13万

主题

343

回帖

22万

积分

管理员

站长

UID
1
积分
224394
余额
13 R
Moe币
84875
在线时间
279 小时
注册时间
2025-12-28
最后登录
2026-11-3
发表于 2026-9-3 23:00:59 | 显示全部楼层 |阅读模式
(self.webpackChunkkwebwppai_generateppt=self.webpackChunkkwebwppai_generateppt||[]).push([[4273],{38667:function(e,t,n){e.exports=function(e,t){n.e(8720).then(n.bind(n,81323)).then((function(t){e&&e(t)})).catch((function(e){console.error(e),t&&t(e)}))}},80440:function(e,t,n){e.exports=function(e,t){n.e(8720).then(n.bind(n,72408)).then((function(t){e&&e(t)})).catch((function(e){console.error(e),t&&t(e)}))}},10989:function(e,t,n){e.exports=function(e,t){n.e(8720).then(n.bind(n,7693)).then((function(t){e&&e(t)})).catch((function(e){console.error(e),t&&t(e)}))}},34134:function(e,t,n){"use strict";if(3057==n.j)var i=n(15825);if(3057==n.j)var r=n(62198);var o=n(44801);if(3057==n.j)var a=n(26625);if(3057==n.j)var s=n(38778);t.A=3057==n.j?function(e,t){void 0===t&&(t=s.Go.GenerateNote);var n=(0,i.A)(t),l=(0,o.useCallback)((function(t){(t.detail||"")!==n.current&&e()}),[e,n]);(0,r.A)(a.f7.COPILOT_PANEL_VISIBLE_CHANGE,l,{target:window})}:null},32928:function(e,t,n){"use strict";if(n.d(t,{i:function(){return r}}),3057==n.j)var i=n(35380);var r=function(e){return function(t){t({type:i.A.SET_TEXT2IMAGE_INFO,data:e})}}},47807:function(e,t,n){"use strict";n.r(t);var i=n(44801),r=3057==n.j?(0,i.lazy)((function(){return Promise.all([n.e(8096),n.e(3050)]).then(n.bind(n,42800))})):null;t.default=3057==n.j?i.memo((function(){return i.createElement(i.Suspense,{fallback:i.createElement(i.Fragment,null)},i.createElement(r,null))})):null},77560:function(e,t,n){"use strict";n.d(t,{A:function(){return X}});var i,r,o,a=n(3460),s=n(73762),l=n(48048),c=n(9911),u=new(function(){function e(){var e=this;this.sendQuestion=function(e,t){var n={bubble_id:(0,l.u)(7),function_code:"wpp_ai_generate_img_intention",ai_func_key:"wpp_ai_generate_img"};return e=(0,a.Cl)((0,a.Cl)({},e),n),console.error("sendQuestion",e),s.A.sendQuestion(e,t),e},this.stopQuestion=function(t){e.copilot.stopQuestion(t)},this.triggerBubble=function(t,n){var i;null===(i=e.copilot)||void 0===i||i.triggerBubble(t,n)},this.dispatchBubbleId=function(t){var n;null===(n=e.copilot)||void 0===n||n.dispatchBubbleId(t)},this.registerReplyQuestionCb=function(e){s.A.registerReplyQuestionCb(c._K.Text2Img,e)}}return Object.defineProperty(e.prototype,"copilot",{get:function(){return s.A.getCopilot()},enumerable:!1,configurable:!0}),e}()),p=n(26484),d=n(32928),g=n(77009),h=n(69248),f=n(95066),m=n(93026);!function(e){e.updateShapeInfo="updateShapeInfo",e.updatePrompt="updatePrompt",e.requestGeneratePic="requestGeneratePic",e.sendPicData="sendPicData",e.insertPicture="insertPicture",e.sendErrorMsg="sendErrorMsg",e.requestPromptOptimize="requestPromptOptimize",e.requestShapeInfo="requestShapeInfo"}(i||(i={})),function(e){e[e.warn=1]="warn",e[e.error=2]="error",e[e.fail=3]="fail",e[e.success=4]="success"}(r||(r={})),function(e){e[e.slide=0]="slide",e[e.shape=1]="shape"}(o||(o={}));var v,w=n(36435),y=n(65888),b=n(30160),_=n(59207),A=n(8134),E=n(64213),k=n(76806),P=n(51741),x=n.n(P),T=k.Ue?"wpsmac_":"wpspc_",C=p.cq,S=new(function(){function e(){var e=this;this.openAiReport=function(t){if(t.view_id===e.curViewId){var n=e.handleGetDocumentInfo(),i=n.cloud_file_id,r=n.integrity_check_value;try{var o=e.getSource(),a=e.getTriggerSource(),s=e.getSessionId();console.log("openAiReport send params: ",o,a,s,e.reportContent);var l={scene:T+o,report_content:e.reportContent,open_position:a,biz_type:"kwppcopilot",comp:e.getSource(),ai_type:C,ai_theme:"text2image",integrity_check_value:r,cloud_file_id:i,session_id:s,function_code:"wpp_ai_generate_img_intention"};console.log("pluginParams",l),x().openAiReport(l)}catch(e){console.error(e)}}},this.reportContent="",this.curViewId=this.getCurViewId()}return e.prototype.setReporterContent=function(e){this.reportContent=JSON.stringify(e),console.log("setReporterContent",this.reportContent)},e.prototype.addAIReportListener=function(){this.removeAIReportListener(),x().addAIReportListener(this.openAiReport)},e.prototype.getCurViewId=function(){var e,t,n;return(null===(n=null===(t=null===(e=window.Extention)||void 0===e?void 0:e.Webview.getID())||void 0===t?void 0:t.result)||void 0===n?void 0:n.ID)||""},e.prototype.removeAIReportListener=function(){x().removeAIReportListener(this.openAiReport)},e.prototype.getSource=function(){var e,t,n,i,r;if(this.source)return this.source;var o=null===(r=null===(i=null===(n=null===(t=null===(e=window.Extention)||void 0===e?void 0:e.Base)||void 0===t?void 0:t.WpsOffice)||void 0===n?void 0:n.getAppName())||void 0===i?void 0:i.result)||void 0===r?void 0:r.appname;return this.source=o,this.source},e.prototype.getTriggerSource=function(){var e,t,n;return(null===(n=null===(t=null===(e=window.Extention)||void 0===e?void 0:e.TaskPanelCopilot.getTriggerSource())||void 0===t?void 0:t.result)||void 0===n?void 0:n.trigger_source)||""},e.prototype.getSessionId=function(){var e,t;return(null===(t=null===(e=y.session.getChatSessionId())||void 0===e?void 0:e.result)||void 0===t?void 0:t.chat_sess_id)||""},e.prototype.handleGetDocumentInfo=function(){var e,t=null===(e=window.Extention)||void 0===e?void 0:e.TaskPanelCopilot.getActiveDocumentInfo();return(null==t?void 0:t.code)?t.result:{cloud_file_id:"",integrity_check_value:""}},e}()),I=n(82349),N=n.n(I),R="aigc_img_generate",D="aigc_img_generate",O="aigc",H=new(function(){function e(){var e=this;this.offset=0,this.sizeMap={},this.getSessionList=function(t){return void 0===t&&(t=!1),(0,a.sH)(e,void 0,void 0,(function(){var e,n;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return e={headers:{},params:{count:20,offset:this.offset,filters:[{carrier:R,component:"wpp",entry:D}],scenes:[{symbol:O,type:2}]}},console.log("getSessionList params",e),[4,this.promiseWithTimeout(N().getSessionListV5(e),15e3)];case 1:return(n=i.sent().data)&&!t&&(this.offset+=30),[2,null==n?void 0:n.items.map((function(e){return e.session_id}))]}}))}))},this.getMessageList=function(t){return(0,a.sH)(e,void 0,void 0,(function(){var e,n;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return 0===t.length?[2,[]]:(e={headers:{},params:{count:1e3,offset:0,filters:[{carrier:R,component:"wpp",entry:D}],scenes:[{symbol:O,type:2}],session_ids:t}},console.log("getMessageList params",e),[4,this.promiseWithTimeout(N().getMessageListV5(e),15e3)]);case 1:return[2,null==(n=i.sent().data)?void 0:n.items]}}))}))},this.getHistory=function(){return(0,a.sH)(e,void 0,void 0,(function(){var e,t,n,i,r,o;return(0,a.YH)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this.getSessionList()];case 1:return e=s.sent(),[4,this.getMessageList(e)];case 2:return t=s.sent(),[4,this.handleMessages(t)];case 3:return n=s.sent(),console.log("getHistory",n),0!==n.length&&(i=(0,a.fX)([],g.A.getState().t2i.historyImageResults,!0),r=(0,a.fX)((0,a.fX)([],i,!0),n,!0),g.A.dispatch((0,d.i)({historyImageResults:r}))),[2,n];case 4:throw o=s.sent(),this.offset=Math.max(this.offset-20,0),new Error(o);case 5:return[2]}}))}))},this.handleMessages=function(t){return(0,a.sH)(e,void 0,void 0,(function(){var e,n,i,r,o,s,l,c,u,p,d;return(0,a.YH)(this,(function(g){switch(g.label){case 0:if(0===t.length)return[2,[]];e=[],n=null,i=function(i){var o,g,h,f,m,v,w,y,b,A,E,k,P,x,T,C;return(0,a.YH)(this,(function(a){switch(a.label){case 0:return(o=t[i]).history_id!==(null==n?void 0:n.parent_history_id)?[3,2]:(g=null===(s=o.history.attr)||void 0===s?void 0:s.metadata.label_ids,h=null==g?void 0:g[0],f=null==g?void 0:g[1],m=null===(l=o.history.attr)||void 0===l?void 0:l.metadata.msg_id,v=o.history.refs,w=null===(c=v.find((function(e){return e.res_id===m})))||void 0===c?void 0:c.content.text_content,y=null===(u=v.find((function(e){return e.res_id===h})))||void 0===u?void 0:u.content.text_content,b=null===(p=v.find((function(e){return e.res_id===f})))||void 0===p?void 0:p.content.text_content,A=n.history.refs.map((function(e){var t,n,i;return{originUrl:null===(t=e.content)||void 0===t?void 0:t.image_uri,is_optimize:!!(null===(n=e.ext)||void 0===n?void 0:n.is_optimize),genFrom:null===(i=e.ext)||void 0===i?void 0:i.generate_from}})),A=A.filter((function(e){var t;return null===(t=e.originUrl)||void 0===t?void 0:t.startsWith("http")})),E=(null===(d=o.history.attr)||void 0===d?void 0:d.metadata.img_num_id)||4-A.length,[4,r.handleUrls(A)]);case 1:return k=a.sent(),P=k.urls,x=k.width,T=k.height,C={prompt:w,style:y,urls:P,width:x,height:T,bubble_id:o.history_id,isGen:!1,failCount:E,isSuitRatio:b===_.A.RatioSelect.suitRatio},e.push(C),[3,3];case 2:n=o,a.label=3;case 3:return[2]}}))},r=this,o=0,g.label=1;case 1:return o<t.length?[5,i(o)]:[3,4];case 2:g.sent(),g.label=3;case 3:return o++,[3,1];case 4:return[2,e]}}))}))},this.handleUrls=function(t){return(0,a.sH)(e,void 0,void 0,(function(){var e,n,i,r,o,s,l,c,u;return(0,a.YH)(this,(function(a){switch(a.label){case 0:n=0,i=e=t,a.label=1;case 1:return n<i.length?(r=i[n],o=r.originUrl,[4,(0,E.W)(o)]):[3,4];case 2:s=a.sent(),r.url=s,a.label=3;case 3:return n++,[3,1];case 4:return[4,this.getSize(e[0].url)];case 5:return l=a.sent(),c=l.width,u=l.height,[2,{urls:e,width:c,height:u}]}}))}))},this.isShowHistory=function(){return(0,a.sH)(e,void 0,void 0,(function(){var e;return(0,a.YH)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.getSessionList(!0)];case 1:return[2,{show:t.sent().length>0,isSuccess:!0}];case 2:return e=t.sent(),console.error("check showHistory Fail:",e),[2,{show:!1,isSuccess:!1}];case 3:return[2]}}))}))}}return e.prototype.reset=function(){this.offset=0,g.A.dispatch((0,d.i)({historyImageResults:[]}))},e.prototype.getSize=function(e){var t=this;return new Promise((function(n,i){if(t.sizeMap[e])n(t.sizeMap[e]);else{var r=new Image;r.src=e,r.onload=function(){var i={width:r.naturalWidth,height:r.naturalHeight};t.sizeMap[e]=i,n(i)},r.onerror=function(e){i(e)}}}))},e.prototype.promiseWithTimeout=function(e,t){var n=new Promise((function(e,n){var i=setTimeout((function(){clearTimeout(i),n("Promise timed out in ".concat(t," ms."))}),t)}));return Promise.race([e,n])},e}()),G=n(42727),F=n(22418),B=n(66411),L=n(26549),V=n(2657),W=n(25121);!function(e){e.picture="picture",e.background="background"}(v||(v={}));var U=function(){function e(){var e,t=this;this.entryMsg=((e={})[v.picture]={input:"",style:"",ratio:""},e[v.background]={input:"",style:"",ratio:""},e),this.currentGenCount=0,this.genBubbleIdMap=new Set,this.cSource="",this.openPanelByEntry=!1,this.needReload=!1,this.init=function(){return(0,a.sH)(t,void 0,void 0,(function(){return(0,a.YH)(this,(function(e){switch(e.label){case 0:return this.addTaskPanelChangeListener(),[4,y.session.createSession()];case 1:return e.sent(),this.registerReplyQuestionCb(),this.setPanelTitle(),this.addCopilotEventNotify(),this.aiReporterHandler.addAIReportListener(),this.getPicShapeInfo(),this.getCsource(),this.addTaskPanelCopilotVisibleChangedListener(),this.addLogoutListener(),this.addLoginListener(),(0,f.A)(m.D.ON_SESSION_INIT),[2]}}))}))},this.handleTaskPanelChange=function(e){e.detail.aiFuncKey===c._K.Text2Img?t.aiReporterHandler.addAIReportListener():t.aiReporterHandler.removeAIReportListener()},this.handleTaskPanelVisibleChange=function(e){var n,i,r;console.log("handleTaskPanelVisibleChange",e);var o=e.view_id,a=e.visible;(null===(r=null===(i=null===(n=window.Extention)||void 0===n?void 0:n.Webview.getID())||void 0===i?void 0:i.result)||void 0===r?void 0:r.ID)===o&&a?(t.openPanelByEntry||(t.entry="taskpane"),t.handleCollection(),t.handleHistoryOnTaskPanelChange()):t.openPanelByEntry=!1},this.handleCopilotCallBack=function(e){console.log("copilotCallBack",e);var n=(null==e?void 0:e.result)||{},i=n.method;if(p._A[i])switch(i){case p._A.updateShapeInfo:t.updateShapeInfo(n);break;case p._A.updatePrompt:t.updatePrompt(n);break;case p._A.sendPicData:t.handlePicData(n);break;case p._A.sendErrorMsg:t.handleError(n);break;case p._A.updateImgRecord:t.restoreImgCache(n);break;case p._A.updateCSource:t.handleUpdateCSource(n);break;case p._A.requestPresetData:n.preset_data&&(0,f.A)(m.D.UPDATE_T2I_INPUT_VAL,{value:n.preset_data})}},this.restoreImgCache=function(e){return(0,a.sH)(t,void 0,void 0,(function(){var t,n,i,r,o,s,c,u=this;return(0,a.YH)(this,(function(p){switch(p.label){case 0:if(console.log("restoreImgCache",e),t=e.params,n=t.json,!(i=JSON.parse(n))||0===i.length)return[2];r=window.performance.now(),i.reverse(),o=function(e){var t,n,r,o,s,c,p;return(0,a.YH)(this,(function(h){switch(h.label){case 0:return t=i[e],n=t.width,r=t.height,o=t.style,s=t.prompt,c=t.urls,[4,Promise.all(c.map((function(e){return(0,a.sH)(u,void 0,void 0,(function(){return(0,a.YH)(this,(function(t){switch(t.label){case 0:return[4,(0,E.W)(e)];case 1:return[2,t.sent()]}}))}))}))).then((function(e){c=e})).catch((function(e){console.error("An error occurred:",e)}))];case 1:return h.sent(),(p=(0,a.fX)([],g.A.getState().t2i.imageResults,!0)).push({width:n,height:r,style:o,prompt:s,urls:c,bubble_id:(0,l.u)(7),isGen:!1}),g.A.dispatch((0,d.i)({imageResults:p})),[2]}}))},s=0,p.label=1;case 1:return s<i.length?[5,o(s)]:[3,4];case 2:p.sent(),p.label=3;case 3:return s++,[3,1];case 4:return c=window.performance.now(),console.log("restoreImgCache spend time: ",c-r),[2]}}))}))},this.handlePicData=function(e){return(0,a.sH)(t,void 0,void 0,(function(){var t,n,i,r,o,s,l,c,u,p,h,f,m,v,w,y,b,A,k,P,x,T,C,S,I,N,R,D,O;return(0,a.YH)(this,(function(H){switch(H.label){case 0:if(console.log("sendPicData",e),t=e.params,n=e.bubble_id,i=t.style,r=t.prompt,o=t.urls,s=t.width,l=t.height,c=t.requestCount,u=t.ratioType,p=t.generateFrom,h=o,f=JSON.parse(o),m=JSON.parse(p),v=(0,a.fX)([],g.A.getState().t2i.imageResults,!0),0===(null==f?void 0:f.length))return[2];y=(w=function(e){return Math.min(Math.max(e,512),2048)})(l),b=w(s),A=0,H.label=1;case 1:return A<f.length?(k=f[A],P=null===(O=Object.keys(k))||void 0===O?void 0:O[0],x=k[P],[4,(0,E.W)(P)]):[3,4];case 2:T=H.sent(),k.is_optimize=x,k.url=T,k.originUrl=P,k.genFrom=(null==m?void 0:m[A])||"",H.label=3;case 3:return A++,[3,1];case 4:return C=f.map((function(e){return e.originUrl})),S=c-f.length,v.forEach((function(e){n===e.bubble_id&&(e=Object.assign(e,{bubble_id:n,style:i,prompt:r,urls:f,isGen:!1,width:b,height:y,failCount:S,originUrls:h,isSuitRatio:u===_.A.RatioSelect.suitRatio}),console.error("handlePicData",e))})),g.A.dispatch((0,d.i)({imageResults:v,isGen:!1})),this.genBubbleIdMap.delete(n),this.currentGenCount--,I={id:n,type:"image",content:{input:r,output:JSON.stringify(h)}},this.aiReporterHandler.setReporterContent(I),N={track_id:G.getCommonData().track_id,action_id:G.getCommonData().action_id,request_source:F.pS.request,function_code:F.Tj},R=C.filter((function(e){return e.includes("image_gallery")})).length,D=C.length-R,G.finishRequest(void 0,(0,a.Cl)((0,a.Cl)({},N),{scene:"finish",total_duration:Date.now()-this.startGenTime,intention_code:F.zY,content_detail:JSON.stringify({style:i,size:{width:s,height:l},is_suit_ratio:u===_.A.RatioSelect.suitRatio,picture_id:C,picture_count:C.length,gallery_picture_count:R,ai_picture_count:D})})),G.funcShow({pageName:F.KG.generate_finish,extParams:(0,a.Cl)((0,a.Cl)({},N),{content_detail:JSON.stringify({picture_count:C.length,gallery_picture_count:R,ai_picture_count:D})})}),[2]}}))}))},this.updateShapeInfo=(0,A.s)((function(e){console.log("updateShapeInfo",e);var n=e.params||{},i=n.slideWidth,r=n.slideHeight,o=n.width,a=void 0===o?-1:o,s=n.height,l=void 0===s?-1:s,c=n.replaceType,u=void 0===c?"":c;i=Math.round(i/=10),r=Math.round(r/=10),(0,f.A)(m.D.UPDATE_START_BTN_STATUS);var h=g.A.getState().t2i.curRatio,v=-1!==a,w=p.v6.includes(t.entry),y=i/r,b=h;t.hasInitDefaultRatio?b!==_.A.RatioSelect.suitRatio||v?v&&(b=_.A.RatioSelect.suitRatio):b=w?t.getBackGroundRatio(y):_.A.RatioSelect.ratio1_1:(b=v?_.A.RatioSelect.suitRatio:w?t.getBackGroundRatio(y):_.A.RatioSelect.ratio1_1,t.hasInitDefaultRatio=!0);var A="fill"===u;g.A.dispatch((0,d.i)({isSelectPic:v,selectPicHeight:l,selectPicWidth:a,slideHeight:r,slideWidth:i,curRatio:b,isFill:A}))}),30),this.getBackGroundRatio=function(e){var t=_.A.RatioSelect.ratio16_9;return e<1?t=_.A.RatioSelect.ratio9_16:1===e&&(t=_.A.RatioSelect.ratio1_1),t},this.clientEventNotifyHandler=function(e){console.log("clientEventNotifyHandler",e);var n=(null==e?void 0:e.result)||{},i=n.ai_func_key,r=n.entry,o=n.plugin_name,a=n.RunningParams;(i||o)&&(t.openPanelByEntry=!0,t.handleDiffEntry(r),y.taskpanelWebview.setTaskpanelStatus({taskpanel_visible:!0}),t.getPicShapeInfo(),t.handleCollection(),t.handleHistoryOnTaskPanelChange(),t.handleTaskVisibleGetPresetData(a))},this.entry=(0,b.$Z)("entry"),this.aiReporterHandler=S,this.aiHistoryHandler=H,this.init(),this.clientEventNotifyHandler=this.clientEventNotifyHandler.bind(this),this.handleTaskPanelVisibleChange=this.handleTaskPanelVisibleChange.bind(this)}return e.prototype.setStartGenTime=function(e){this.startGenTime=e},e.prototype.getEntry=function(){return this.entry},e.prototype.getCurrentGenCount=function(){return this.currentGenCount},e.prototype.addCurrentGenCount=function(){this.currentGenCount++},e.prototype.deleteCurrentGenCount=function(){this.currentGenCount=Math.max(0,this.currentGenCount--)},e.prototype.getGenBubbleIdMap=function(){return this.genBubbleIdMap},e.prototype.addGenBubbleIdMapItem=function(e){this.genBubbleIdMap.add(e)},e.prototype.addLogoutListener=function(){y.user.addLogoutListener(this.handleLogout)},e.prototype.addLoginListener=function(){y.user.addLoginListener(this.handleLogin)},e.prototype.handleLogout=function(){var e,t;this.needReload=!0,console.log("handleLogout"),u.copilot&&(y.session.closeSession(),null===(t=(e=u.copilot).destroyCopilot)||void 0===t||t.call(e),console.log("handleLogout destroy copilot"))},e.prototype.handleLogin=function(){this.needReload&&window.location.reload()},e.prototype.addTaskPanelCopilotVisibleChangedListener=function(){this.removeTaskPanelCopilotVisibleChangedListener(),window.Extention.TaskPanelCopilot.addTaskPanelCopilotVisibleChangedListener(this.handleTaskPanelVisibleChange)},e.prototype.removeTaskPanelCopilotVisibleChangedListener=function(){window.Extention.TaskPanelCopilot.removeTaskPanelCopilotVisibleChangedListener(this.handleTaskPanelVisibleChange)},e.prototype.addTaskPanelChangeListener=function(){window.addEventListener(W.f.TASKPANEL_CHANGE,this.handleTaskPanelChange)},e.prototype.handleTaskVisibleGetPresetData=function(e){var t=(e||{}).preset_data;t&&(0,f.A)(m.D.UPDATE_T2I_INPUT_VAL,{value:t})},e.prototype.handleCollection=function(){(0,F.lP)(this.entry),G.open(this.entry)},e.prototype.handleHistoryOnTaskPanelChange=function(){(0,f.A)(m.D.ON_TASKPANEL_VISIBLE_CHANGE);var e=g.A.getState().t2i,t=e.imageResults,n=e.historyImageResults;if(!e.isGen&&t.length>0){var i=(0,a.fX)([],t,!0),r=(0,a.fX)([],n,!0),o=(0,a.fX)((0,a.fX)([],i,!0),r,!0);g.A.dispatch((0,d.i)({imageResults:[],historyImageResults:o}))}},e.prototype.getHistory=function(){return this.aiHistoryHandler.getHistory()},e.prototype.registerReplyQuestionCb=function(){u.registerReplyQuestionCb(this.handleCopilotCallBack)},e.prototype.addCopilotEventNotify=function(){try{V.A.on(L.eh.copilotEventNotify,this.clientEventNotifyHandler)}catch(e){console.error("addCopilotEventNotify",e)}},e.prototype.setPanelTitle=function(){y.taskpanelWebview.setTaskPanelTitleBar({text:_.A.WebView.title,product_name:_.A.WebView.title})},e.prototype.handleUpdateCSource=function(e){console.log("handleUpdateCSource",e);var t=e.params.cSource;this.cSource=t},e.prototype.updatePrompt=function(e){var t=e.params,n=t.Prompt,i=t.intput;(0,f.A)(m.D.UPDATE_T2I_PROMPT,{value:n,genPrompt:i}),console.log("updatePrompt",e)},e.prototype.handleError=function(e){var t=e.bubble_id;switch(e.params.method){case p._A.updateShapeInfo:break;case p._A.requestPromptOptimize:g.A.dispatch((0,d.i)({optInstrucionState:h.w.NotBegin}));break;case p._A.requestGeneratePic:this.handlePicError(t);case p._A.sendErrorMsg:}console.log("handleError",e)},e.prototype.handlePicError=function(e){var t=(0,a.fX)([],g.A.getState().t2i.imageResults,!0);t=t.filter((function(t){return t.bubble_id!==e})),g.A.dispatch((0,d.i)({imageResults:t,isGen:!1})),(0,f.A)(m.D.UPDATE_START_BTN_STATUS),this.genBubbleIdMap.delete(e),this.currentGenCount--},e.prototype.handleDiffEntry=function(e){var t=g.A.getState().t2i,n=t.slideWidth,i=t.slideHeight,r=t.isSelectPic,o=t.inputVal,a=t.curRatio,s=t.curStyle,l=p.v6.includes(e),c=p.v6.includes(this.entry)?v.background:v.picture,u=p.v6.includes(e)?v.background:v.picture;if(c!==u){var d=this.getEntryInfo(u,l,n,i,r),h=d.input,f=d.ratio,m=d.style;this.updateCurrentEntryInfo(h,f,m)}this.updateLastEntryInfo(c,o,a,s),this.entry=e},e.prototype.getEntryInfo=function(e,t,n,i,r){var o=this.entryMsg[e],a=o.input,s=o.ratio,l=o.style,c=""!==s;c||(s=_.A.RatioSelect.ratio16_9,l=p.rB);var u=n/i;return t?s!==_.A.RatioSelect.suitRatio||r?c||(s=r?_.A.RatioSelect.suitRatio:this.getBackGroundRatio(u)):s=this.getBackGroundRatio(u):s!==_.A.RatioSelect.suitRatio||r||(s=_.A.RatioSelect.ratio16_9),{input:a,ratio:s,style:l}},e.prototype.updateCurrentEntryInfo=function(e,t,n){(0,f.A)(m.D.UPDATE_T2I_PROMPT,{value:e,genPrompt:"",forceUpdate:!0}),g.A.dispatch((0,d.i)({curRatio:t,curStyle:n}))},e.prototype.updateLastEntryInfo=function(e,t,n,i){this.entryMsg[e]={input:t,ratio:n,style:i}},e.prototype.getPicShapeInfo=function(){var e=this.entry;p.v6.includes(e)&&(e="toolbar");var t={method:p._A.requestShapeInfo,params:{entry:e}};u.sendQuestion(t,this.handleCopilotCallBack)},e.prototype.getCsource=function(){var e={method:p._A.requestCSource,params:{entry:this.entry,intentionCode:F.zY,productName:B.p2}};u.sendQuestion(e,this.handleCopilotCallBack)},e.prototype.isShowHistory=function(){return this.aiHistoryHandler.isShowHistory()},e.prototype.getCsourceValue=function(){return this.cSource||p.z8},e}(),j=new U,z=w.e2.config.ParallelTimes||3,M=w.e2.config.ExceedTime||"",q=w.e2.config.NoParallel||"",Y=w.e2.config.singleGenPicCount||2,K=1e3*w.e2.config.t2iTimeOutLimit||3e4,Q=new(function(){function e(){var e=this;this.clearGenDefaultTimerMap={},this.scrollTimer=null,this.copilotCallBack=function(t){return e.copilotEventHandler.handleCopilotCallBack(t)},this.requestGeneratePic=function(t){return(0,a.sH)(e,void 0,void 0,(function(){var e,n,i,o,s,l,c,h,v,w,y,b,_,A,E,k,P;return(0,a.YH)(this,(function(x){switch(x.label){case 0:return e=g.A.getState().t2i,n=e.curRatio,i=e.imageResults,(null===(P=i[0])||void 0===P?void 0:P.isGen)?[2]:(g.A.dispatch((0,d.i)({isGen:!0})),[4,this.checkAIAccess()]);case 1:return x.sent()?this.copilotEventHandler.getCurrentGenCount()+1>z?(o=z>1?M:q,this.sendErrorMsg({msg:o,msgType:r.warn}),(0,f.A)(m.D.UPDATE_START_BTN_STATUS),[2]):(this.copilotEventHandler.addCurrentGenCount(),s=t.prompt,l=t.style,c=t.width,h=t.height,v=t.recommendedStyle,w={method:p._A.requestGeneratePic,params:{prompt:s,style:l,width:c,height:h,number:Y,recommendedStyle:v,entry:this.entry,ratioType:n,actionId:(0,G.getCommonData)().action_id,trackId:(0,G.getCommonData)().track_id}},this.copilotEventHandler.setStartGenTime(Date.now()),y=u.sendQuestion(w,this.copilotCallBack),b=y.bubble_id,this.copilotEventHandler.addGenBubbleIdMapItem(b),this.clearDefaultItem(b),_=(0,a.fX)([],i,!0),A={bubble_id:b,style:"",isGen:!0,urls:Array(Y).fill(""),prompt:"",width:c,height:h},E=(0,a.fX)([],g.A.getState().t2i.historyImageResults,!0),k=(0,a.fX)((0,a.fX)([],_,!0),E,!0),g.A.dispatch((0,d.i)({imageResults:[A],historyImageResults:k})),clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout((function(){var e="gen-item-".concat(b),t=document.getElementsByClassName(e),n=t[t.length-1];null==n||n.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}),100),[2]):((0,f.A)(m.D.UPDATE_START_BTN_STATUS),g.A.dispatch((0,d.i)({isGen:!1})),[2])}}))}))},this.requestPromptOptimize=function(t){return(0,a.sH)(e,void 0,void 0,(function(){var e,n;return(0,a.YH)(this,(function(i){switch(i.label){case 0:return g.A.dispatch((0,d.i)({optInstrucionState:h.w.Generating})),[4,this.checkAIAccess()];case 1:return i.sent()?(e=t.prompt,(0,F.f)(),n={method:p._A.requestPromptOptimize,params:{entry:this.entry,prompt:e,actionId:(0,G.getCommonData)().action_id,trackId:(0,G.getCommonData)().track_id}},u.sendQuestion(n,this.copilotCallBack),[2]):(g.A.dispatch((0,d.i)({optInstrucionState:h.w.NotBegin})),[2])}}))}))},this.downPicture=function(t){var n=t.data,i={method:p._A.downPicture,params:{entry:e.entry,data:n}};u.sendQuestion(i,e.copilotCallBack)},this.copyPicture=function(t){var n=t.data,i={method:p._A.copyPicture,params:{entry:e.entry,data:n}};u.sendQuestion(i,e.copilotCallBack)},this.checkAIAccess=function(){return new Promise((function(t){var n=(0,G.getCommonData)(),i={track_id:n.track_id,event_id:n.event_id},r=function(e){var n;console.log("[ai text2img] checkAIAccess callback",e),o();var i=!!(null===(n=null==e?void 0:e.result)||void 0===n?void 0:n.can_continue);t(i)},o=function(){window.Extention.CopilotEntry.removeCheckAIAccessListener(r)};window.Extention.CopilotEntry.addCheckAIAccessListener(r);var a=e.copilotEventHandler.getCsourceValue(),s={entryId:"",comp:"wpp",ai_app:"",ai_type:p.cq,intention_code:F.zY,open_position:e.getEntry(),product_name:B.p2,csource:a,report_info:i},l=window.Extention.CopilotEntry.checkAIAccess(s);console.log("[ai text2img] start checkAIAccess",s,l),l.code||(o(),t(!1))}))},window.__PCService=this,this.copilotEventHandler=j}return Object.defineProperty(e.prototype,"entry",{get:function(){return this.copilotEventHandler.getEntry()},enumerable:!1,configurable:!0}),e.prototype.clearDefaultItem=function(e){var t=this;this.clearGenDefaultTimerMap[e]=setTimeout((function(){if(t.copilotEventHandler.getGenBubbleIdMap().has(e)){var n=(0,a.fX)([],g.A.getState().t2i.imageResults,!0);n=n.filter((function(t){return t.bubble_id!==e})),g.A.dispatch((0,d.i)({imageResults:n,isGen:!1})),(0,f.A)(m.D.UPDATE_START_BTN_STATUS),window.Toast.info(_.A.CopilotHandler.genErrorTip,null,3,{top:15})}t.copilotEventHandler.deleteCurrentGenCount(),delete t.clearGenDefaultTimerMap[e]}),K)},e.prototype.requestPresetData=function(){var e={method:p._A.requestPresetData,params:{entry:this.entry}};u.sendQuestion(e,this.copilotCallBack)},e.prototype.insertPicture=function(e){var t=e.data,n=e.type,i={method:p._A.insertPicture,params:{entry:this.entry,data:t,type:n}};u.sendQuestion(i,this.copilotCallBack)},e.prototype.sendErrorMsg=function(e){var t=e.msg,n=e.msgType,i={method:p._A.showErrorMsg,params:{entry:this.entry,msg:t,msgType:n}};u.sendQuestion(i,this.copilotCallBack)},e.prototype.getEntry=function(){return this.copilotEventHandler.getEntry()},e.prototype.getHistory=function(){return this.copilotEventHandler.getHistory()},e.prototype.isShowHistory=function(){return this.copilotEventHandler.isShowHistory()},e}()),X=new(function(){function e(){this.service=Q}return e.prototype.requestGeneratePic=function(e){this.service.requestGeneratePic(e)},e.prototype.requestPromptOptimize=function(e){this.service.requestPromptOptimize(e)},e.prototype.insertPicture=function(e){this.service.insertPicture(e)},e.prototype.sendErrorMsg=function(e){this.service.sendErrorMsg(e)},e.prototype.getEntry=function(){return this.service.getEntry()},e.prototype.getHistory=function(){return this.service.getHistory()},e.prototype.copyPicture=function(e){return this.service.copyPicture(e)},e.prototype.downPicture=function(e){return this.service.downPicture(e)},e.prototype.isShowHistory=function(){return this.service.isShowHistory()},e.prototype.requestPresetData=function(){return this.service.requestPresetData()},e}())},26484:function(e,t,n){"use strict";n.d(t,{Eb:function(){return d},Wy:function(){return u},_A:function(){return r},cq:function(){return s},rB:function(){return p},up:function(){return a},v6:function(){return g},z8:function(){return l}});var i,r,o=n(36435);!function(e){e.updateShapeInfo="updateShapeInfo",e.updatePrompt="updatePrompt",e.requestGeneratePic="requestGeneratePic",e.sendPicData="sendPicData",e.insertPicture="insertPicture",e.sendErrorMsg="sendErrorMsg",e.requestPromptOptimize="requestPromptOptimize",e.requestShapeInfo="requestShapeInfo",e.showErrorMsg="showErrorMsg",e.getImgRecord="getImgRecord",e.updateImgRecord="updateImgRecord",e.downPicture="downPicture",e.copyPicture="copyPicture",e.requestCSource="requestCSource",e.updateCSource="updateCSource",e.requestPresetData="requestPresetData"}(r||(r={}));var a={ON_UPDATE_WPP_T2I_PREVIEW_POS:"ON_UPDATE_WPP_T2I_PREVIEW_POS",ON_UPDATE_WPP_T2I_PREVIEW_SIZE:"ON_UPDATE_WPP_T2I_PREVIEW_SIZE",ON_UPDATE_WPP_T2I_PREVIEW_PIC_INFO:"ON_UPDATE_WPP_T2I_PREVIEW_PIC_INFO",ON_WPP_T2IPREVIEW_HOVER:"ON_WPP_T2IPREVIEW_HOVER",ON_T2I_REUSE_PROMPT:"ON_T2I_REUSE_PROMPT",ON_OPTIONS_PANEL_VISIBLE_CHANGE:"ON_OPTIONS_PANEL_VISIBLE_CHANGE"},s="generate_picture",l="pc-wpp-aipublic",c=o.e2.config.styleRecommand||[],u={};c.forEach((function(e){u[e.style]=e.back_style}));var p=null===(i=c[0])||void 0===i?void 0:i.style,d=c.slice(1);d=d.map((function(e){var t={};return t[e.style]=e.back_style,t}));var g=3057==n.j?["select_picture_background","tab_design_background","select_left_background"]:null},52805:function(e,t,n){"use strict";var i=n(26484),r=n(30160),o=n(95066),a=n(93026),s=n(76806),l="WPP_T2I_PREVIEW_WEBVIEW",c="T2IPreview",u=function(){function e(){var e=this;this.handlePreviewWebViewHover=function(e){console.error("handlePreviewWebViewHover",e);var t=e.isHover;(0,o.A)(i.up.ON_WPP_T2IPREVIEW_HOVER,{isHover:t})},this.handleReusePrompt=function(e){console.log("handleReusePrompt",e);var t=e.prompt;(0,o.A)(i.up.ON_T2I_REUSE_PROMPT,{prompt:t})},this.onDestroy=function(){var t;null===(t=e.dialog)||void 0===t||t.removeDestroyListener(e.onDestroy.bind(e)),e.dialog=void 0},window.PreviewHost=this,this.init()}return e.prototype.init=function(){(0,r.$Z)("entry")===c||s.Ue||(this.createWebView(),this.addEventListener())},e.prototype.addEventListener=function(){var e,t,n,r,l;null===(e=window.Extention)||void 0===e||e.Common.Event.addEventListener(i.up.ON_T2I_REUSE_PROMPT,this.handleReusePrompt),null===(t=window.Extention)||void 0===t||t.Common.Event.addEventListener(i.up.ON_WPP_T2IPREVIEW_HOVER,this.handlePreviewWebViewHover),s.Ue&&(null===(l=null===(r=null===(n=window.Extention)||void 0===n?void 0:n.Webview)||void 0===r?void 0:r.addWindowActivateStateListener)||void 0===l||l.call(r,(function(){(0,o.A)(a.D.ON_PREVIEW_FOCUS_CHANGED)})))},e.prototype.dispatchEvent=function(e,t,n){var i;void 0===n&&(n=!1),null===(i=window.Extention)||void 0===i||i.Common.Event.dispatchEvent(e,n,t)},e.prototype.createWebView=function(){var e,t=this.getWebView(l);if(t)return this.dialog=t,void this.dialog.hide();var n={winFlag:s.Ue?"UnfocusedDialog":"DialogType",mode:!1,bChildWindow:!0,hasFocus:!1,hasShadow:!1,allowResize:!1,enforceTop:!0,accessControlAllowAllOrigin:!0,useCookie:!0,isShow:!1,hasRoundedShadow:!0,componentName:"kwebnps",enableFillet:!0,enableFilletDelay:!0};this.dialog=window.Extention.Webview.create({url:this.getUrlPath(),id:l,attrs:n,geo:{x:500,y:500,w:400,h:400},nativeState:{needFailedClose:!0}}),null===(e=this.dialog)||void 0===e||e.addDestroyListener(this.onDestroy.bind(this))},e.prototype.getWebView=function(e){var t=window.Extention.Webview.get({id:e});return!1!==(null==t?void 0:t.code)&&!(null==t?void 0:t.errormsg)&&t?t:null},e.prototype.getUrlPath=function(){var e=document.location.toString();return-1!==(e=decodeURI(e)).indexOf("?")&&(e=e.substring(0,e.lastIndexOf("?"))),"".concat(e,"?entry=").concat(c)},e.prototype.updatePreviewInfo=function(e){if(!s.Ue){var t=e.left,n=e.top,r=e.width,o=e.height,a=e.style,l=e.prompt,c=e.url,u=e.imgHeight,p=e.imgWidth,d=e.is_optimize,g=e.isFromGallery,h=e.genFrom,f=e.originUrl;this.hidePreview(),this.dispatchEvent(i.up.ON_UPDATE_WPP_T2I_PREVIEW_POS,{left:t,top:n}),this.dispatchEvent(i.up.ON_UPDATE_WPP_T2I_PREVIEW_SIZE,{width:r,height:o}),this.dispatchEvent(i.up.ON_UPDATE_WPP_T2I_PREVIEW_PIC_INFO,{style:a,prompt:l,url:c,imgHeight:u,imgWidth:p,is_optimize:d,isFromGallery:g,genFrom:h,originUrl:f})}},e.prototype.showPreview=function(){var e;null===(e=this.dialog)||void 0===e||e.show()},e.prototype.hidePreview=function(){var e;null===(e=this.dialog)||void 0===e||e.hide()},e.prototype.takePreviewFocus=function(){var e;null===(e=this.dialog)||void 0===e||e.takeFocus()},e.prototype.takeSelfFocus=function(){var e;null===(e=window.Extention)||void 0===e||e.Webview.takeFocus()},e}();t.A=new u},93026:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var i={UPDATE_T2I_PROMPT:"UPDATE_T2I_PROMPT",UPDATE_START_BTN_STATUS:"UPDATE_START_BTN_STATUS",ON_WARPPER_SCROLL:"ON_WARPPER_SCROLL",ON_BODY_HIDE:"ON_BODY_HIDE",ON_TASKPANEL_VISIBLE_CHANGE:"ON_TASKPANEL_VISIBLE_CHANGE",ON_WEBVIEW_ACTIVE_CHANGE:"ON_WEBV
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|M男之家

GMT+8, 2026-11-5 04:34 , Processed in 0.037443 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表