(function(){function xa(){var I,N,O;this.setIndex=function(D){I=D};this.getIndex=function(){return I};this.setQuestions=function(D){N=D};this.getQuestions=function(){return N};this.setEnd=function(D){O=D};this.isEnd=function(){return O};this.fromJsonObject=function(D){I=D.index;N=D.questions;O=D.end}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee={});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing=
{});"undefined"==typeof com.kingdee.bos.qing.ai&&(com.kingdee.bos.qing.ai={});"undefined"==typeof com.kingdee.bos.qing.ai.analysis&&(com.kingdee.bos.qing.ai.analysis={});"undefined"==typeof com.kingdee.bos.qing.ai.analysis.model&&(com.kingdee.bos.qing.ai.analysis.model={});NS=com.kingdee.bos.qing.ai.analysis.model;NS.ChartTypeModel=function(){var I,N,O;this.setIconName=function(D){I=D};this.getIconName=function(){return I};this.setViewType=function(D){N=D};this.getViewType=function(){return N};this.setChartName=
function(D){O=D};this.getChartName=function(){return O}};NS.RecommendedQuestion=xa;NS.ThemeRecommendedQuestion=function(){xa.call(this);var I=this.fromJsonObject,N,O;this.setQuestionTypes=function(D){N=D};this.getQuestionTypes=function(){return N};this.setTaskId=function(D){O=D};this.getTaskId=function(){return O};this.fromJsonObject=function(D){N=D.questionTypes;O=D.taskId;I(D)}};NS.QuestionType=new function(){function I(D,S){this.name=function(){return D};this.getIconName=function(){return S};this.getTitleName=
function(){switch(D){case "COMPARATIVE_ANALYSIS":return O.get("comparativeAnalysis","\u6bd4\u8f83\u5206\u6790");case "PROPORTION_ANALYSIS":return O.get("proportionAnalysis","\u5360\u6bd4\u5206\u6790");case "TREND_ANALYSIS":return O.get("trendAnalysis","\u8d8b\u52bf\u5206\u6790");case "INDEX_ANALYSIS":return O.get("indexAnalysis","\u6307\u6807\u5206\u6790")}}}var N=this,O=com.kingdee.bos.qing.framework.common.MultilanguageManager.createPackageAccessor(NS);this.COMPARATIVE=new I("COMPARATIVE_ANALYSIS",
"comparative_max");this.PROPORTION=new I("PROPORTION_ANALYSIS","proportion_max");this.TREND=new I("TREND_ANALYSIS","trend_max");this.INDEX=new I("INDEX_ANALYSIS","index_max");this.getByName=function(D){switch(D){case "COMPARATIVE_ANALYSIS":return N.COMPARATIVE;case "PROPORTION_ANALYSIS":return N.PROPORTION;case "TREND_ANALYSIS":return N.TREND;case "INDEX_ANALYSIS":return N.INDEX}}};NS.ReportItemModel=function(){var I,N,O,D;this.setTitle=function(S){I=S};this.getTitle=function(){return I};this.setInsight=
function(S){N=S};this.getInsight=function(){return N};this.setViewType=function(S){O=S};this.getViewType=function(){return O};this.setExecutingModelWrapper=function(S){D=S};this.getExecutingModelWrapper=function(){return D};this.toJsonObject=function(){var S={};S.title=I;S.insight=N;S.viewType=O;S.executingModelWrapper=D;return S}};NS.ReportModel=function(){var I,N,O;this.setThemeName=function(D){I=D};this.getThemeName=function(){return I};this.setDescriptionStyle=function(D){N=D};this.getDescriptionStyle=
function(){return N};this.setReportItemModels=function(D){O=D};this.getReportItemModels=function(){return O};this.toJsonObject=function(){var D={};D.themeName=I;D.descriptionStyle=N;for(var S=[],qa=0;qa<O.length;qa++){var Ba=O[qa].toJsonObject();S.push(Ba)}D.reportItemModels=S;return D}};NS.DescriptionStyle=new function(){this.SIMPLE="SIMPLE";this.DETAILED="DETAILED";this.NOTHING="NOTHING"}})();(function(){function xa(a,d,e,h){ya.call(this,a,d,e,h);var n=this.protectedMethod;this.getThumbnailURL=function(l,c,b){l={publishTargetType:2,modelWrapper:JSON.stringify(l),width:c,height:b,tag:G.getTag()};n.remote("exportSquareImg",l)}}function I(a,d,e,h){ya.call(this,a,d,e,h);var n=this.protectedMethod;this.loadAIAnalysisSchema=function(l,c){l={tag:l,viewInfos:JSON.stringify(c)};n.remote("loadAIAnalysisSchema",l)};this.loadThemeRecommendedQuestions=function(l,c){n.remote("loadThemeRecommendedQuestions",
{tag:l,themeId:c})};this.asyncLoadThemeRecommendedQuestion=function(l,c){n.remote("asyncLoadThemeRecommendedQuestion",{themeId:l,index:c})};this.loadRecommendedQuestions=function(l,c){l={chartInfo:JSON.stringify(l),tag:c};n.remote("loadRecommendedQuestions",l)};this.touchAsyncLoadRecommendedQuestions=function(l,c,b){l={chartInfo:JSON.stringify(l),tag:c,questions:JSON.stringify(b)};n.remote("touchAsyncLoadRecommendedQuestions",l)};this.asyncLoadRecommendedQuestions=function(l,c){n.remote("asyncLoadRecommendedQuestions",
{taskId:l,index:c})};this.loadAIAnalysisView=function(l,c){n.remote("loadAIAnalysisView",{themeId:l,questionText:c})};this.translateChartType=function(l,c,b){n.remote("translateChartType",{viewType:l,view:c,tag:b})};this.loadUserAvatar=function(){n.remote("loadUserAvatar",{})};this.generateReport=function(l,c,b,k){l={reportModel:JSON.stringify(l),tag:c,themeName:b,uuid:k};n.remote("generateReport",l)};this.setLanguageModel=function(l){n.remote("setLanguageModel",{languageModel:l})};this.loadQingGPTLicense=
function(){n.remote("loadQingGPTLicense",{})}}function N(a,d,e,h){ya.call(this,a,d,e,h);var n=this.protectedMethod;n.setShowBlocking(!1);this.schemaManage_saveSchema=function(l,c,b){l={model:JSON.stringify(l.toJsonObject()),bizTag:c,editPublishSchema:b};n.remote("schemaManage_updateSchema",l)};this.schemaManage_loadAttrs=function(l,c){n.remote("schemaManage_loadAttrs",{bizTag:l,source:c})}}function O(){var a,d,e;this.getJqUi=function(){a||h();return a};this.setEnabled=function(c,b){!c&&d.setText("");
d.setEnabled(c);b?d.setPlaceholder(b):d.setPlaceholder(B.get("inputQuestionTips","\u8bd5\u7740\u95ee\u6211\u95ee\u9898\uff0c\u6211\u5c06\u6839\u636e\u60a8\u7684\u95ee\u9898\uff0c\u81ea\u52a8\u4e3a\u60a8\u751f\u6210\u56fe\u8868"));c=d.getJqUi();c.removeClass("sa-ctrl-common-singlelineborder");c.removeClass("sa-ctrl-common-singlelineborder_disabled")};this.setTextField=function(c,b){X.checkPrivacyUserAgree()&&(d.setText(c),b&&l(d),d.requestFocus())};this.setListener=function(c){e=c};var h=function(){a=
$("<div>");a.css("text-align","center");var c=$("<div>");c.addClass("ai-analysis-question-center-container");c.appendTo(a);d=new La;d.setPlaceholder(B.get("inputQuestionTips","\u8bd5\u7740\u95ee\u6211\u95ee\u9898\uff0c\u6211\u5c06\u6839\u636e\u60a8\u7684\u95ee\u9898\uff0c\u81ea\u52a8\u4e3a\u60a8\u751f\u6210\u56fe\u8868"));d.addAcceptableListener(function(M,J){J&&l(M)});var b=$("<div>");b.addClass("ai-analysis-question-container");H.layoutCtrlWithLRTB(b,48,0,null,0,0,null);b.appendTo(c);var k=d.getJqUi(),
x=k.children("input");H.layoutCtrlWithLRTB(k,12,36,null,0,0,null);k.css("border-radius","4px");k.removeClass("sa-ctrl-common-singlelineborder");k.appendTo(b);k.on("mouseenter",function(){b.addClass("ai-analysis-question-container-hover")});k.on("mouseleave",function(){x.is(":focus")||b.removeClass("ai-analysis-question-container-hover")});x.focus(function(M){b.addClass("ai-analysis-question-container-hover")});x.blur(function(M){b.removeClass("ai-analysis-question-container-hover")});x.bind("input propertychange",
function(){var M=d.getText();M&&0<M.length?Q.background(E,"send_btn_hover"):Q.background(E,"send_btn")});var E=$("<div>");E.data("model","send_btn");Q.background(E,"send_btn");n(E);E.css({width:"40px",height:"40px"});k=da.shrink(E,.5,40,40);k.css("cursor","pointer");k.css({position:"absolute",right:"10px",top:"10px"});k.appendTo(b);E.on("click",function(){l(d)});k=aa.createAvatar(aa.Type.QuestionAvatar);H.layoutCtrlWithLRTB(k,0,null,80,0,null,80);da.shrink(k,.5,80,80).appendTo(c)},n=function(c){c.on("mouseover",
function(){var b=d.getText();b&&0<b.length?(c.css("cursor","pointer"),b=c.data("model"),Q.background(c,b+"_hover")):c.css("cursor","default")});c.on("mouseout",function(){var b=d.getText();b&&0!=b.length||(b=c.data("model"),Q.background(c,b))})},l=function(c){X.checkQingGPTLicense(function(){var b=c.getText();b&&(c.setText(""),e(b))})}}function D(a){function d(y){KTDefaultCellRender.call(this,y);var r=this;this.paintCellUI=function(g,m){var p=r.getCurrentRowIdx();m=$("<div>");m.addClass("ai-analysis-selection-chart-row");
var t=r.getCurrentRow().getUserObject(),C=new Ca;C.setChecked(!1);K[p]=t;P[p]=C;C.setUserObject(p);C.addCheckedListener(function(ha,ka){ka&&(U(ca),ka=ha.getUserObject(),la(ka));ha.isChecked()?q.increase():q.decrease()});C=C.getJqUi();C.addClass("ai-analysis-selection-checkbox");C.appendTo(m);C=$("<div>");C.addClass("ai-analysis-selection-chart-view-type");var R=t.getViewType(),Y=ma.getIconNameByViewType(R);Q.background(C,Y?"no_border_"+Y:"no_border_"+R);C.appendTo(m);var ca=$("<div>");ca.text(t.getTitle());
ca.attr("title",t.getTitle());ca.on("click",function(){U(ca);la(p)});ca.addClass("ai-analysis-selection-chart-title");ca.appendTo(m);m.on("mouseover mouseout",function(ha){"mouseover"===ha.type?ca.addClass("ai-analysis-selection-chart-title-hover"):"mouseout"===ha.type&&ca.removeClass("ai-analysis-selection-chart-title-hover")});m.appendTo(g)}}Ma.call(this);var e=this,h=this.protectedMethod,n,l,c,b,k,x,E,M,J,q=new function(){var y=0,r=0,g;this.setTotal=function(p){y=p};this.setCallBack=function(p){g=
p};var m=function(){g&&g(r,y)};this.increase=function(){r<y&&r++;m()};this.decrease=function(){0<r&&r--;m()};this.selectAll=function(){r=y;m()};this.clearAll=function(){r=0;m()};this.getCurrentCount=function(){return r}},L,P={},F={},K={};(function(){(M=a)&&M.setDescriptionStyle(ra.SIMPLE);h.setTitle(B.get("generateReport","\u751f\u6210\u62a5\u544a"));e.setSize(960,540);h.setSelectable(!0);h.setContentPaneCreator(function(){if(!n){n=$("<div>");n.addClass("ai-analysis-export-report-main");var y=n,r=
$("<div>");r.addClass("ai-analysis-selection-part");r.appendTo(y);y=$("<div>");r.append(y);y.addClass("ai-analysis-selection-part-style");Z(y);y=$("<div>");r.append(y);y.addClass("ai-analysis-selection-part-charts");ba(y);r=n;y=$("<div>");y.addClass("ai-analysis-preview-part");var g=$("<div>");g.text(B.get("previewChart","\u56fe\u8868\u9884\u89c8"));g.addClass("ai-analysis-preview-part-headline");c=$("<img>");c.addClass("ai-analysis-preview-chart");c.attr("src",sa.getIconUrl("lightapp/common","icon_chart_building.png"));
b=$("<div>");b.text(B.get("loadingImg","\u6b63\u5728\u521b\u5efa\u7f29\u7565\u56fe..."));H.layoutCtrlWithLRTB(b,250,null,null,370,0,null);b.css("fontSize","14px");c.hide();b.hide();y.append(g);y.append(c);y.append(b);y.appendTo(r)}return n});h.setClosingChecker2(function(y){y=[];for(var r in P)P[r].isChecked()&&y.push(K[r]);if(0<y.length)return r=new Da,r.setThemeName(a.getThemeName()),r.setDescriptionStyle(a.getDescriptionStyle()),r.setReportItemModels(y),E&&E(r),!0;h.getMessageCurtain().showPrompt("\u8bf7\u5148\u8fdb\u884c\u56fe\u8868\u751f\u6210\uff0c\u518d\u751f\u6210\u62a5\u544a\u3002");
return!1},function(y){h.destroy();return!0});h.setClosingAction(function(y){h.destroy();return!0})})();this.setConfirmGenerateCallBack=function(y){E=y};var Z=function(y){var r=$("<div>");r.text(B.get("descriptionHeadline","\u9009\u62e9\u62a5\u544a\u4e2d\u6587\u5b57\u8bf4\u660e\u98ce\u683c"));r.addClass("ai-analysis-selection-part-style-headline");var g=$("<div>");g.text(B.get("descriptionStyleTip","\u9009\u62e9\u201c\u7b80\u8981/\u8be6\u7ec6\u201d\uff0cGPT\u5c06\u6839\u636e\u7b80\u8981/\u8be6\u7ec6\u7ea7\u522b\u7684\u6d1e\u5bdf\u5185\u5bb9\u751f\u6210\u6587\u5b57\u8bf4\u660e\u3002\u9009\u62e9\u201c\u65e0\u201d\uff0c\u62a5\u544a\u4e2d\u4e0d\u5c55\u793a\u56fe\u8868\u5bf9\u5e94\u7684\u6587\u5b57\u8bf4\u660e\u3002"));
var m=new Ea;m.setIconType(Ea.ICON_TYPE_QUESTION);m.setTipsSize(300,70);m.setTipsHtml(g);g=m.getJqUi();g.addClass("ai-analysis-selection-part-style-tip");m=$("<div>");H.layoutCtrlWithLRTB(m,0,0,null,30,0,30);var p=new Na,t=new za;p.addElement(t);t.setChecked(!0);t.setText(B.get("brief","\u7b80\u8981"));var C=t.getJqUi();C.addClass("ai-analysis-selection-part-radioButton");C.appendTo(m);t.addCheckedListener(function(){M.setDescriptionStyle(ra.SIMPLE)});t=new za;p.addElement(t);t.setText(B.get("detailed",
"\u8be6\u7ec6"));C=t.getJqUi();C.addClass("ai-analysis-selection-part-radioButton");C.appendTo(m);t.addCheckedListener(function(){M.setDescriptionStyle(ra.DETAILED)});t=new za;p.addElement(t);t.setText(B.get("nothing","\u65e0"));p=t.getJqUi();p.addClass("ai-analysis-selection-part-radioButton");p.appendTo(m);t.addCheckedListener(function(){M.setDescriptionStyle(ra.NOTHING)});r.appendTo(y);g.appendTo(y);m.appendTo(y)},ba=function(y){var r=$("<div>");r.addClass("ai-analysis-selection-chart-headline");
r.text(B.get("selectChartHeadline","\u9009\u62e9\u56fe\u8868\uff0c\u53f3\u4fa7\u67e5\u770b\u9884\u89c8\u6837\u5f0f"));r.appendTo(y);r=$("<div>");H.layoutCtrlWithLRTB(r,0,null,278,30,null,30);L=new Ca;L.setChecked(!1);L.addCheckedListener(function(t,C){if(C){t=t.isChecked();for(var R in P)P[R].setChecked(t);t?q.selectAll():q.clearAll()}});var g=L.getJqUi();g.addClass("ai-analysis-selection-all-checkbox");var m=$("<div>");m.text(B.get("selectAll","\u5168\u90e8"));m.addClass("ai-analysis-selection-chart-all");
x=$("<div>");x.addClass("ai-analysis-selection-total");T(x);x.hide();g.appendTo(r);m.appendTo(r);x.appendTo(r);r.appendTo(y);J=new KTable;J.setColumnFitVisibleWidth(!1);J.addColumn().setWidth(275);r=new d(J);r.setOutsideVisible(!1);J.setCellRender(r);J.setSyncUIWhenModelChanged(!1);r=$(J.getUI());H.layoutCtrlWithLRTB(r,0,0,null,60,0,null);r.children().css("overflowX","hidden");r.appendTo(y);y=M.getReportItemModels();r=y.length;q.setTotal(r);q.setCallBack(function(t,C){0==t?(x.hide(),k.text(0)):(t==
C?L.setChecked(!0):L.setChecked(!1),x.show(),k.text(t))});for(g=0;g<r;g++){m=y[g];var p=Fa.createRow(J,!1);p.setHeight(23);p.setUserObject(m)}Fa.refresh(J)},T=function(y){var r=$("<div>");r.text(B.get("alreadySelectedLeft","\uff08\u5df2\u9009\u62e9"));r.addClass("ai-analysis-selection-total-item-text");k=$("<div>");k.text(0);k.addClass("ai-analysis-selection-total-item-text");var g=$("<div>");g.text(B.get("alreadySelectedRight","\u9879\uff09"));g.addClass("ai-analysis-selection-total-item-text");
r.appendTo(y);k.appendTo(y);g.appendTo(y)},U=function(y){l&&l.removeClass("ai-analysis-selection-chart-selected");y.addClass("ai-analysis-selection-chart-selected");l=y},fa=function(y){var r=new Image;r.onload=function(){var g=document.createElement("canvas");g.width=r.width;g.height=r.height;g.getContext("2d").drawImage(r,0,0,r.width,r.height);_sBase64Img=g.toDataURL("image/png")};r.src=y},la=function(y){var r=F[y];if(r)c.off("load"),c.on("load",function(){fa(r)}),c.attr("src",r);else{c.show();c.attr("src",
sa.getIconUrl("lightapp/common","icon_chart_building.png"));b.show();var g=new xa(G.getLappRemoteImpl(),function(p){c.off("load");c.on("load",function(){fa(t)});var t=ta.getLoadImgUrl(p,"export");c.attr("src",t);b.hide();F[y]=t});g.setShowBlocking(!1);var m=K[y].getExecutingModelWrapper();g.getThumbnailURL(m,570,370)}}}function S(){var a,d=new Oa,e,h;this.setThemeName=function(b){};this.setGenerateReportListener=function(b){h=b};this.getJqUi=function(){if(!a){var b=a=$("<div>"),k=d.getJqUi();e=d.createButton(k,
!1,n,B.get("generateReport","\u751f\u6210\u62a5\u544a"));e.setEnabled(!1);d.createButton(k,!1,l,B.get("exit","\u9000\u51fa"));k.appendTo(b)}return a};this.setReportBtnEnable=function(b){e.setEnabled(b)};this.isReportBtnEnable=function(){return e.isEnabled()};var n=function(){X.checkPrivacyUserAgree()&&X.checkQingGPTLicense(function(){h()})},l=function(){c(function(){Pa.closeCurrentTab()})},c=function(b){if(e.isEnabled()){var k=com.kingdee.bos.qing.ui.component.MessageDialog,x=k.createFeedbackDialog();
x.setMsgImageType(k.MSG_CONFIRM);x.setButtonText(k.RETURN_OK,B.get("sureExit","\u76f4\u63a5\u9000\u51fa"));x.setButtonText(k.RETURN_CANCEL,B.get("sureReturn","\u8fd4\u56de\u5bf9\u8bdd"));x.setMessage(B.get("confirmExit","\u662f\u5426\u76f4\u63a5\u9000\u51fa\uff1f\u9000\u51fa\u540e\u5df2\u751f\u6210\u7684\u56fe\u8868\u4e0d\u4f1a\u88ab\u81ea\u52a8\u4fdd\u5b58\uff0c\u5efa\u8bae\u60a8\u4fdd\u5b58\u9700\u8981\u7684\u56fe\u8868\u540e\u518d\u9000\u51fa\u3002"));x.showDialog();x.setClosingChecker(function(E){E==
k.RETURN_OK&&b();return!0});x.setClosedAction(function(E){})}else b()}}function qa(){var a,d,e,h=0,n,l;this.setCustomPortrait=function(b){d=b};this.setTitle=function(b){e=b};this.setContents=function(b){n=b;a&&c()};this.setFinalCallBack=function(b){l=b};this.getJqUi=function(){if(!a){a=$("<div>");a.addClass("ai-analysis-recommend-card");var b=$("<div>");b.append(d);b.addClass("ai-analysis-recommend-card-portrait");b.appendTo(a);b=$("<div>");b.text(e);b.addClass("ai-analysis-recommend-card-title");
b.appendTo(a);c()}return a};var c=function(){for(var b=h;b<n.length;b++){var k=new Ba;k.setContent(n[b]);k.setFinalCallBack(l);k=k.getJqUi();k.addClass("ai-analysis-recommend-card-frame");k.appendTo(a)}h=n.length}}function Ba(){var a,d,e,h="",n;this.setFinalCallBack=function(c){n=c};this.setContent=function(c){h=c;e&&(e.text(h),e.attr("title",h))};this.getContent=function(){return h?h:null};this.getJqUi=function(){a||l();return a};var l=function(){a=$("<div>");a.addClass("ai-analysis-recommend-frame");
a.on("mouseover mouseout",function(b){"mouseover"===b.type?(Q.background(d,"message_btn_click"),a.css("border","1px solid #2A71F5"),e.css("color","#2A71F5")):"mouseout"===b.type&&(Q.background(d,"message_btn"),a.css("border","1px solid white"),e.css("color","#737373"))});a.on("click",function(){n(h)});d=$("<div>");d.css({width:"40px",height:"40px"});Q.background(d,"message_btn");var c=da.shrink(d,.4,40,40);c.addClass("ai-analysis-recommend-frame-icon");e=$("<div>");e.addClass("ai-analysis-recommend-frame-content");
e.text(h);e.attr("title",h);c.appendTo(a);e.appendTo(a)}}function $a(){var a,d,e,h,n=[],l,c;this.getJqUi=function(){d||(d=$("<div>"),d.addClass("ai-analysis-conversation-container"),e=$("<div>"),e.appendTo(d),e.addClass("ai-analysis-conversation-center-container"),a=new V,a.init());return d};this.setQuestionTextCallback=function(b){h=b};this.setFunGetThemeRecommendedQuestions=function(b){l=b};this.setToolBar=function(b){c=b};this.generateAnswerContent=function(b){var k=a.getConversationDialog(V.DialogType.Text);
k.setDialogPosition(V.DialogPosition.Right);k.setQuestionText(b);k.setQuestionTextCallback(h);k.getJqUi().appendTo(e);k=a.getConversationDialog(V.DialogType.Chart);k.setDialogPosition(V.DialogPosition.Left);k.setQuestionText(b);k.setQuestionTextCallback(h);k.setScrollToBottom(function(){Qa.scrollToBottom(d)});var x=c.isReportBtnEnable();k.setBeforeGenerateCallback(function(){c.setReportBtnEnable(!1)});k.setAfterFinishGenerateCallback(function(E){E&&(x=E);c.setReportBtnEnable(x)});k.setFunGetThemeRecommendedQuestions(l);
k.getJqUi().appendTo(e);n.push(k);Qa.scrollToBottom(e)};this.getReportModel=function(){for(var b=[],k=0;k<n.length;k++){var x=n[k].getReportItemModel();x&&b.push(x)}k=new Da;k.setReportItemModels(b);return k}}function V(){var a={};this.init=function(){a[V.DialogType.Text]=ab;a[V.DialogType.Chart]=bb};this.getConversationDialog=function(d){return new a[d]}}function Ra(){var a=this,d,e,h,n,l,c,b=V.DialogPosition.Left;this.getJqUi=function(){e||(e=$("<div>"),e.addClass("ai-analysis-conversation-dialog"),
a.protectedGenerateAnswerContent(e));return e};this.setDialogPosition=function(x){b=x};this.setQuestionText=function(x){d=x};this.setQuestionTextCallback=function(x){n=x};this.setScrollToBottom=function(x){l=x};this.setFunGetThemeRecommendedQuestions=function(x){c=x};this.getReportItemModel=function(){return null};this.protectedGenerateAnswerContent=function(x){throw Error("override me");};var k=function(x){b==V.DialogPosition.Left?(x.css("float","left"),x.css("left","0px")):(x.css("float","right"),
x.css("right","0px"))};this.protectedMethod={getQuestionText:function(){return d},showDialogPosition:k,createTextBox:function(x,E,M){var J=$("<div>");J.addClass("ai-analysis-conversation-textbox");J.appendTo(x);k(J);b==V.DialogPosition.Left&&J.css("border-radius","2px 8px 8px 8px");h=$("<div>");h.text(E);h.addClass("ai-analysis-conversation-text");x=$("<div>");h.appendTo(x);M&&M.appendTo(x);x.appendTo(J)},getQuestionTextCallback:function(){return n},scrollToBottom:function(){l()},getThemeRecommendedQuestions:function(){return c()}}}
function ab(){Ra.call(this);var a=this.protectedMethod;this.protectedGenerateAnswerContent=function(d){var e=aa.createAvatar(aa.Type.UserAvatar);H.layoutCtrlWithLRTB(e,0,null,36,9,null,36);e.appendTo(d);e.hide();e=$("<div>");var h=$("<img>");h.css({width:"16px",height:"16px"});h.attr("src","ai-analysis/skin/ierp/res/edit.png");h.appendTo(e);e.addClass("ai-analysis-message-text-pen");e.on("click",function(){a.getQuestionTextCallback()(a.getQuestionText())});a.createTextBox(d,a.getQuestionText(),e)}}
function bb(){Ra.call(this);var a=this.protectedMethod,d,e,h,n,l,c,b,k,x,E,M,J,q,L,P,F,K,Z,ba,T,U,fa;this.setBeforeGenerateCallback=function(f){x=f};this.setAfterFinishGenerateCallback=function(f){E=f};this.getReportItemModel=function(){if(L&&fa){var f=na.toJson(L);var u=f.pages;for(var v=u.length,z=0;z<v;z++)if(u[z].current){var w=u[z];break}w||(w=u[0]);u=w;w={};w.meta=f.meta;w.model=u.model;w.preferences=u.preferences;f=new Sa;f.setTitle(q);f.setExecutingModelWrapper(w);f.setViewType(P.viewType);
return f}return null};this.protectedGenerateAnswerContent=function(f){var u=aa.createAvatar(aa.Type.AIAvatar);H.layoutCtrlWithLRTB(u,0,null,36,8,null,36);u.appendTo(f);u.hide();cb();d=$("<div>");d.appendTo(f);var v=$("<div>");v.appendTo(f);x&&x();la(v,B.get("generateChartTips","\u6b63\u5728\u751f\u6210\u56fe\u8868\uff0c\u8bf7\u7a0d\u5019..."));a.scrollToBottom();f=new I(G.getAIAnalysisRemoteImpl(),function(z){v.remove();r(z);a.scrollToBottom()},function(z,w,A){if(5100002==z){z=B.get("generateChartError1",
"\u5bf9\u4e0d\u8d77\uff0c\u6211\u65e0\u6cd5\u7406\u89e3\u60a8\u7684\u95ee\u9898\uff0c\u8bf7\u63d0\u4f9b\u66f4\u5177\u4f53\u7684\u4fe1\u606f\uff0c\u6216\u8005\u60a8\u4e5f\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u65b9\u5f0f\u63d0\u95ee\uff1a");var W=a.getThemeRecommendedQuestions()}else 5100004==z?(z=B.get("generateChartError2","\u62b1\u6b49\uff0c\u670d\u52a1\u8c03\u7528\u5931\u8d25\uff0c\u8bf7\u8054\u7cfb\u76f8\u5173\u4eba\u5458\u5904\u7406\uff0c\u6216\u7a0d\u540e\u91cd\u8bd5\u3002"),-1!=w.indexOf("\u8d85\u51fa\u6a21\u578b\u9650\u5236")&&
(z=B.get("generateChartError4","\u60a8\u9009\u62e9\u7684\u4e1a\u52a1\u4e3b\u9898\u7684\u5b57\u6bb5\u8fc7\u591a\uff0c\u8d85\u8fc7\u5f53\u524d\u6a21\u578b\u9650\u5236\u3002\u8bf7\u7ed3\u5408\u5b9e\u9645\u9700\u6c42\uff0c\u7b80\u5316\u6570\u636e\u8868\u540e\u91cd\u65b0\u8fdb\u5165\u3002"))):z=B.get("generateChartError3","\u670d\u52a1\u8c03\u7528\u5f02\u5e38\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5\u3002");v.children().remove();y(v,z,W);E&&E(!1);return!0});f.setShowBlocking(!1);f.loadAIAnalysisView(G.getThemeId(),
a.getQuestionText())};var la=function(f,u){var v=$("<div>");v.addClass("ai-analysis-conversation-answer");v.appendTo(f);a.showDialogPosition(v);f=$("<div>");f.text(u);f.addClass("ai-analysis-conversation-text");f.appendTo(v)},y=function(f,u,v){var z=$("<div>");z.addClass("ai-analysis-conversation-error-answer");z.appendTo(f);a.showDialogPosition(z);f=$("<div>");f.text(u);f.addClass("ai-analysis-conversation-text");f.appendTo(z);if(v)for(z.css({width:"1092px",height:"66px"}),u=$("<div>"),H.layoutCtrlWithLRTB(u,
20,40,null,32,null,30),u.css("font-size","12px"),u.appendTo(z),z=0;z<v.length;z++){f=v[z];var w=$("<div>");w.addClass("ai-analysis-question-pane-item");w.text(f);w.data("model",f);w.on("click",function(A){A=$(A.target);a.getQuestionTextCallback()(A.data("model"),!0)});w.appendTo(u)}},r=function(f){d.addClass("ai-analysis-chart-conversation");a.showDialogPosition(d);J=new Ga;J.getJqUi().appendTo(d);var u=new Ha,v=u.getJqUi();v.css("font-size","14px");v.css("margin","16px 16px");v.appendTo(d);e=$("<div>");
e.appendTo(d);e.addClass("ai-analysis-chart-conversation-border");e.css("margin","16px 16px");e.css("position","relative");e.css("height","416px");h=$("<div>");H.layoutCtrlWithLRTB(h,16,0,null,0,0,null);h.appendTo(e);var z=m(h);z.hide();var w=new Ha;l=w.getJqUi();H.layoutCtrlWithLRTB(l,10,null,700,16,null,20);l.css("font-size","16px");l.css("font-weight","600");l.appendTo(h);n=$("<div>");n.appendTo(h);H.layoutCtrlWithLRTB(n,10,10,null,46,10,null);ia.Integration.getChartCreator()(f,n,function(A,W,
ja,Aa,Ia,ua){q=A;L=W;P=ja;F=Aa;K=Ia;Z=ua;w.setText(A);u.setText(B.get("chartDesc","\u201c#1\u201d\u7684\u6570\u636e\u6597\u65b9\u5df2\u751f\u6210\u3002").replace("#1",A));t();A=new db;A.setChartInfo(P);A.setScrollToBottom(a.scrollToBottom);A.setListener(a.getQuestionTextCallback());A.setQuestionText(a.getQuestionText());A.getJqUi().appendTo(d);z.show();E&&E(!0)},function(A,W){fa=A;ba=W;R()},function(A,W,ja){A=$("<div>");H.layoutCtrlWithLRTB(A,493,null,100,90,null,80);Q.background(A,"msg-warning");
A.appendTo(n);A=$("<div>");H.layoutCtrlWithLRTB(A,393,null,381,190,null,30);A.text(B.get("loadSchemaError","\u7f3a\u5c11\u751f\u6210\u56fe\u8868\u6240\u9700\u8981\u7684\u5b57\u6bb5\uff0c\u5efa\u8bae\u60a8\u66f4\u6362\u4e00\u4e0b\u63d0\u95ee\u65b9\u5f0f\u3002"));A.appendTo(n);E&&E(!1)})},g=function(f){$(document.body).on("mousedown",function(u){H.isDescendent(u.target,f[0])||H.isDescendent(u.target,f[0])||f.hide()})},m=function(f){var u=$("<div>");u.addClass("ai-analysis-operation");f.append(u);var v=
$("<div>"),z=$("<div>");u.append(v);u.append(z);v.addClass("ai-analysis-operation-left");z.addClass("ai-analysis-operation-right");var w=$("<div>");w.attr("title",B.get("insight","\u6d1e\u5bdf"));w.data("model","insight_btn");Q.background(w,"insight_btn");p(w);w.addClass("ai-analysis-operation-button");w.on("click",function(){C();oa.interestInBehavior("ai-analysis-chart-operation","\u67e5\u770b\u6d1e\u5bdf")});var A=$("<div>");A.attr("title",B.get("summaryInfo","\u56fe\u8868\u4fe1\u606f"));A.data("model",
"summary_info_btn");Q.background(A,"summary_info_btn");p(A);A.addClass("ai-analysis-operation-button");A.on("click",function(){t();oa.interestInBehavior("ai-analysis-chart-operation","\u67e5\u770b\u56fe\u8868\u4fe1\u606f")});w=da.shrink(w,.4,40,40);w.addClass("ai-analysis-operation-wrap-button");A=da.shrink(A,.4,40,40);A.addClass("ai-analysis-operation-wrap-button");v.append(w);v.append(A);A=$("<div>");A.attr("title",B.get("translateChart","\u5207\u6362\u56fe\u8868"));A.data("model","exchange_chart_btn");
Q.background(A,"exchange_chart_btn");p(A);A.addClass("ai-analysis-operation-button");A.on("click",function(){X.checkPrivacyUserAgree()&&X.checkQingGPTLicense(function(){var W=$("<div>");H.layoutCtrlWithLRTB(W,null,12,174,40,0,84);W.addClass("ai-analysis-chart-conversation-chartpane");W.appendTo(f);g(W);var ja=4,Aa=4;var Ia=Math.max(36,174);for(var ua=0;ua<T.length;ua++){ja+28+4>Ia&&(ja=4,Aa+=27);var Ta=T[ua],ea=$("<div>");ea.data("model",Ta.getViewType());ea.addClass("sa-charttypecard-button");ea.css("left",
ja);ea.css("top",Aa);ea.css("width",28);ea.css("height",21);Q.background(ea,Ta.getIconName());ea.on("click",ca);ea.appendTo(W);ja+=34}oa.interestInBehavior("ai-analysis-chart-operation","\u5207\u6362\u56fe\u8868\u7c7b\u578b")})});w=$("<div>");w.attr("title",B.get("edit","\u7f16\u8f91"));w.data("model","edit_btn");Q.background(w,"edit_btn");p(w);w.addClass("ai-analysis-operation-button");w.on("click",function(){X.checkPrivacyUserAgree()&&X.checkQingGPTLicense(function(){ha();oa.interestInBehavior("ai-analysis-chart-operation",
"\u7f16\u8f91\u56fe\u8868")})});v=$("<div>");v.attr("title",B.get("save","\u4fdd\u5b58"));v.data("model","save_btn");Q.background(v,"save_btn");p(v);v.addClass("ai-analysis-operation-button");v.on("click",function(){eb();oa.interestInBehavior("ai-analysis-chart-operation","\u4fdd\u5b58\u56fe\u8868")});A=da.shrink(A,.4,40,40);A.addClass("ai-analysis-operation-wrap-button");w=da.shrink(w,.4,40,40);w.addClass("ai-analysis-operation-wrap-button");v=da.shrink(v,.4,40,40);v.addClass("ai-analysis-operation-wrap-button");
z.append(A);z.append(w);z.append(v);return u},p=function(f){f.on("mouseover",function(){var u=f.data("model");Q.background(f,u+"_hover")});f.on("mouseout",function(){var u=f.data("model");Q.background(f,u)})},t=function(){var f=function(){c.remove();c=null;var v=h.width()+240;h.css("width",v+"px");b&&(v=b.getJqUi(),H.layoutCtrlWithLRTB(v,null,0,360,0,0,null));K()};if(!c){var u=h.width()-240;0>=u&&(u=882);h.css("width",u+"px");c=new Ua}else if(c.hasCustomContent()){f();return}c.setTitle("\u56fe\u8868\u4fe1\u606f");
f=Z(f).createJqUi();c.setCustomContent(f);f=c.getJqUi();H.layoutCtrlWithLRTB(f,null,0,240,0,0,null);f.addClass("ai-analysis-chart-conversation-border-left");f.appendTo(e);b&&(f=b.getJqUi(),H.layoutCtrlWithLRTB(f,null,240,360,0,0,null));K()},C=function(){k=function(){b.remove();b=null;var v=h.width()+360;h.css("width",v+"px");l.css("width","700px");K()};if(!b){var f=h.width()-360;h.css("width",f+"px");b=new Ua;l.css("width","310px")}else if(b.hasCustomContent()){k();return}b.setTitle("\u6d1e\u5bdf\u4fe1\u606f");
f=Y();b.setCustomContent(f);f=b.getJqUi();var u=0;c&&(u=240);H.layoutCtrlWithLRTB(f,null,u,360,0,0,null);f.addClass("ai-analysis-chart-conversation-border-left");f.appendTo(e);K()},R=function(){M=ba(function(){k()});M.createJqUi()},Y=function(){var f=M.createJqUi();pa.fixInsightUi(f,a.getQuestionText());return f},ca=function(f){f=$(f.target).data("model");var u=new I(G.getAIAnalysisRemoteImpl(),function(v){ka(v)},function(v,z,w){J.showPrompt("\u7ef4\u5ea6\u548c\u5ea6\u91cf\u4e0e\u6240\u9009\u56fe\u8868\u7c7b\u578b\u4e0d\u5339\u914d\uff0c\u4e0d\u80fd\u5207\u6362\u6210\u8be5\u7c7b\u578b\u3002");
return!0});u.setBlockingJqUi(d);u.translateChartType(f,F,G.getTag())},ha=function(){var f=na.toJson(L);G.getOpenDesigner()(q,f,function(u){ka(u)})},ka=function(f){L=na.fromJson(f);P.viewType=f.pages[0].model.chart.chartType;G.getRefreshChart()(f,n,function(u,v,z,w){fa=u;K=v;Z=z;ba=w;c&&(c.cleanCustomContent(),t());b&&(b.cleanCustomContent(),C());R()})},cb=function(){T=[];for(var f=0;f<ma.getLength();f++){var u=ma.getViewType(f),v=ma.getChartName(f),z=ma.getIconName(f),w=new Va;w.setViewType(u);w.setChartName(v);
w.setIconName(z);T.push(w)}},eb=function(){if(U){var f=new Ja;f.setSchemaContent(na.toJson(L));f.setSchemaAttr(U);Wa(f,null)}else fb(function(){var u=G.getSchemaList(),v=new Xa;v.setSize(null,100);v.setScheamList(u);var z=new Ya(d);z.setSize(312,156);z.setTitle(B.get("saveScheme","\u4fdd\u5b58\u65b9\u6848"));z.setClosingListener(function(w){if(w){var A=v.getDefault(),W=v.getInputValue().trim();gb(W,v)&&(w=new va,w.setSchemaName(W),w.setSchemaType(va.SCHEMATYPE_USERDEFINED),w.setIsDefault(A),w.setSource(1),
w.setSeq(u.length),A=new Ja,A.setSchemaContent(na.toJson(L)),A.setSchemaAttr(w),Wa(A,function(){z.destroy()}))}});z.showDialog(v.getJqUi())})},gb=function(f,u){if(null==f||""==f||0==f.length)return u.showMessage(B.get("schemeNameCanNotNull","\u8bf7\u8f93\u5165\u65b9\u6848\u540d\u79f0"),"#FCAD05"),!1;if(50<f.length)return u.showMessage(B.get("schemeNameCanNotExceedLimit","\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc750\u4e2a\u5b57\u7b26"),"#FCAD05"),!1;for(var v=G.getSchemaList(),z=0;z<v.length;z++){var w=
va.SCHEMATYPE_USERDEFINED;if(v[z].getSchemaType()==w&&v[z].getSchemaName()==f)return u.showMessage(B.get("schemeNameCanNotRepeat","\u65b9\u6848\u540d\u79f0\u5df2\u5b58\u5728"),"#FCAD05"),!1}return!0},Wa=function(f,u){var v=G.getSchemaList();(new N(G.getSchemaRemoteImpl(),function(z){U=f.getSchemaAttr();U.setFId(z);v.push(U);J.showSuccess(B.get("saveSuccess","\u65b9\u6848\u4fdd\u5b58\u6210\u529f\uff0c\u53ef\u5728\u5f53\u524d\u4e1a\u52a1\u4e3b\u9898\u7684\u6570\u636e\u6597\u65b9\u4e2d\u67e5\u770b\u8be5\u5206\u6790\u65b9\u6848\u3002"),
3E3);u&&u()},function(z,w){return!1})).schemaManage_saveSchema(f,G.getThemeId(),!1)},fb=function(f){G.isLoadSchemaList()?f():((new N(G.getSchemaRemoteImpl(),function(u){for(var v=[],z=0;z<u.length;z++){var w=new va;w.fromJsonObject(u[z]);v.push(w)}G.setSchemaList(v);f()},function(u){return!1})).schemaManage_loadAttrs(G.getThemeId(),1),G.setLoadSchemaList(!0))}}function db(){var a,d,e=[],h,n,l,c,b=0;this.getJqUi=function(){if(!a){a=$("<div>");a.css("position","relative");a.css("margin","-8px 16px 16px 16px");
a.css("overflow","hidden");d=$("<div>");d.addClass("ai-analysis-question-pane-item");d.css("width","48px");var q=$("<img>");q.css("width","27px");q.css("height","9px");q.attr("src",sa.getIconUrl("ai-analysis","loading.gif"));q.appendTo(d);d.appendTo(a);h();pa.isAsync()?x():k(a,0)}return a};this.setScrollToBottom=function(q){h=q};this.setListener=function(q){n=q};this.setChartInfo=function(q){l=q};this.setQuestionText=function(q){c=q};var k=function(q,L){var P=new I(G.getAIAnalysisRemoteImpl(),function(F){e=
e.concat(F);pa.fixRecommendedQuestions(c,e);M(e,L,q)},function(F,K,Z){return!1});P.setShowBlocking(!1);P.loadRecommendedQuestions(l,G.getTag())},x=function(){var q=new I(G.getAIAnalysisRemoteImpl(),function(L){E(L,0)},function(L,P,F){return!1});q.setShowBlocking(!1);q.touchAsyncLoadRecommendedQuestions(l,G.getTag(),e)},E=function(q,L){var P=new I(G.getAIAnalysisRemoteImpl(),function(F){var K=new Za;K.fromJsonObject(F);if((F=K.getQuestions())&&0<F.length)e=e.concat(F),pa.fixRecommendedQuestions(c,
e),J(e,q,K.getIndex());else if(4!=e.length||8!=e.length)K=$("<div>"),K.addClass("ai-analysis-question-pane-item"),K.css("color","#666"),K.css("border","1px solid #FFF"),K.css("padding-left","24px"),K.text("\u63a8\u8350\u95ee\u9898\u52a0\u8f7d\u5931\u8d25"),K.insertBefore(d),F=$("<div>"),F.addClass("ai-analysis-circle"),F.appendTo(K),d.hide()},function(F,K,Z){return!1});P.setShowBlocking(!1);P.asyncLoadRecommendedQuestions(q,L)},M=function(q,L,P){var F,K=function(){X.checkPrivacyUserAgree()&&X.checkQingGPTLicense(function(){F&&
F.remove();d.show();k(P,L)})},Z=setInterval(function(){var ba=q[L++],T=$("<div>");T.addClass("ai-analysis-question-pane-item");T.text(ba);T.data("model",ba);T.on("click",function(U){U=$(U.target);n(U.data("model"),!0)});T.insertBefore(d);L>=q.length&&(4==q.length&&(F=$("<div>"),F.addClass("ai-analysis-question-pane-item"),F.text(B.get("more","\u66f4\u591a")),F.on("click",K),F.appendTo(P)),4!=q.length&&8!=q.length||d.hide(),clearInterval(Z))},200)},J=function(q,L,P){var F,K=function(){X.checkPrivacyUserAgree()&&
X.checkQingGPTLicense(function(){F&&F.remove();d.show();x()})},Z=setInterval(function(){var ba=q[b++],T=$("<div>");T.addClass("ai-analysis-question-pane-item");T.text(ba);T.data("model",ba);T.on("click",function(U){U=$(U.target);n(U.data("model"),!0)});T.insertBefore(d);b>=q.length&&(4==q.length&&(F=$("<div>"),F.addClass("ai-analysis-question-pane-item"),F.text("\u66f4\u591a"),F.on("click",K),F.insertBefore(d)),clearInterval(Z),4==q.length||8==q.length?d.hide():E(L,P))},200)}}function Ua(){var a,
d;this.setTitle=function(e){};this.setCloseCallBack=function(e){};this.setCustomContent=function(e){d=e;a&&(H.layoutCtrlWithLRTB(d,0,4,null,8,0,null),d.appendTo(a))};this.hasCustomContent=function(){return d?!0:!1};this.cleanCustomContent=function(){d&&d.remove();d=null};this.remove=function(){a&&a.remove()};this.getJqUi=function(){a||(a=$("<div>"),d&&(H.layoutCtrlWithLRTB(d,0,4,null,8,0,null),d.appendTo(a)));return a}}"undefined"==typeof com&&(com={});"undefined"==typeof com.kingdee&&(com.kingdee=
{});"undefined"==typeof com.kingdee.bos&&(com.kingdee.bos={});"undefined"==typeof com.kingdee.bos.qing&&(com.kingdee.bos.qing={});"undefined"==typeof com.kingdee.bos.qing.ai&&(com.kingdee.bos.qing.ai={});"undefined"==typeof com.kingdee.bos.qing.ai.analysis&&(com.kingdee.bos.qing.ai.analysis={});var ia=com.kingdee.bos.qing.ai.analysis;ia.AIAnalysisFacade=I;ia.AIAnalysisMain=function(){var a,d,e,h,n,l,c,b,k,x,E={},M=[wa.COMPARATIVE,wa.PROPORTION,wa.TREND,wa.INDEX],J=[],q="\u4e3b\u9898\u667a\u80fd\u5206\u6790";
this.getJqUi=function(){if(!a){a=$("<div>");a.css("background-color","#E2E7EF");a.css("overflowX","hidden");H.layoutCtrlWithLRTB(a,0,0,null,0,0,null);d=new Ga;d.getJqUi().appendTo(a);var g=a;e=new S;e.setThemeName(q);e.setGenerateReportListener(fa);e.getJqUi().appendTo(g);g=$("<div>");g.addClass("ai-analysis-main");H.layoutCtrlWithLRTB(g,10,10,null,55,10,null);g.appendTo(a);n=$("<div>");H.layoutCtrlWithLRTB(n,0,0,null,0,100,null);var m=n;c=$("<div>");c.addClass("ai-analysis-top-introduction");L(c);
var p=$("<div>");Q.background(p,"big_ai_portrait");p.css({width:"200px",height:"200px"});p=da.shrink(p,.5,200,200);p.addClass("ai-analysis-top-introduction-portrait");var t=$("<div>");t.text(B.get("subtitleIntroduction","\u901a\u8fc7\u81ea\u7136\u8bed\u8a00\u5bf9\u8bdd\uff0c\u5373\u53ef\u8f7b\u677e\u83b7\u5f97\u53ef\u89c6\u5316\u5206\u6790"));t.addClass("ai-analysis-top-introduction-subtitle");p.appendTo(c);t.appendTo(c);c.appendTo(m);P(n);n.css("overflowY","auto");n.appendTo(g);ba(g);h.hide()}return a};
this.setThemeName=function(g){q=g};this.resize=function(){for(var g=0;g<J.length;g++)K(J[g],g);L(c)};var L=function(g){var m=n.css("height");m=Z(m,"px");if(755<=m){m=36;var p=80}else 500>=m?(m=0,p=30):(p=m-500,m=36*p/255,p=50*p/255+30);g.css("marginTop",m+"px");g.css("marginBottom",p+"px")},P=function(g){var m=$("<div>");m.addClass("ai-analysis-home-page-recommend-cards");(new I(G.getAIAnalysisRemoteImpl(),function(p){if(p){x={};for(var t=0,C=0;C<M.length;C++){var R=M[C],Y=p[R.name()];Y&&(pa.fixHomePageRecommendedQuestions(R,
Y),x[R.name()]=Y,F(m,R,Y,t++))}}},function(p,t,C){return 5100004===p&&(0<t.indexOf("336007")||0<t.indexOf("336103"))?(p=com.kingdee.bos.qing.ui.component.MessageDialog,t=p.createFeedbackDialog(),t.setMsgImageType(p.MSG_CONFIRM),t.setOptionType(p.OPTION_OK),t.setButtonText(p.RETURN_OK,B.get("close","\u5173\u95ed")),t.setMessage(B.get("gptPromptLengthExceed","\u975e\u5e38\u62b1\u6b49\uff0c\u60a8\u60f3\u8981\u5206\u6790\u7684\u5185\u5bb9\u8d85\u51fa\u5927\u6a21\u578b\u8f93\u5165token\u6700\u5927\u5b57\u6570\u9650\u5236\uff0c\u65e0\u6cd5\u4e3a\u60a8\u751f\u6210\u63a8\u8350\u95ee\u9898\uff0c\u8bf7\u5728\u6570\u636e\u51c6\u5907\u4e2d\u9002\u5f53\u51cf\u5c11\u5b57\u6bb5\u540e\u91cd\u8bd5")),
t.showDialog(),!0):!1})).loadThemeRecommendedQuestions(G.getTag(),G.getThemeId());m.appendTo(g)},F=function(g,m,p,t){var C=E[m.name()];if(C)C.setContents(p);else{C=new qa;var R=$("<div>");Q.background(R,m.getIconName());R.css({width:"80px",height:"80px"});R=da.shrink(R,.6,80,80);C.setCustomPortrait(R);C.setTitle(m.getTitleName());C.setContents(p);C.setFinalCallBack(function(Y){b&&b.setTextField(Y,!0)});p=C.getJqUi();p.css("position","absolute");p.css("float","left");p.css("margin-left","-155px");
K(p,t);p.appendTo(g);E[m.name()]=C;J[t]=p}},K=function(g,m){var p=n.css("width");p=Z(p,"px");g.css("left",(1850<=p?23*(m-1)+50:1220>=p?30*(m-1)+50:(m-1)*(43-p/90)+50)+"%")},Z=function(g,m){g&&1<g.length&&(g=g.replace(m,""));return g},ba=function(g){k=new $a;k.setToolBar(e);h=k.getJqUi();H.layoutCtrlWithLRTB(h,0,0,null,0,100,null);h.appendTo(g);b=new O;b.setListener(function(p){n.hide();h.show();e.setReportBtnEnable(!0);k.generateAnswerContent(p)});var m=b.getJqUi();H.layoutCtrlWithLRTB(m,0,0,null,
null,50,40);m.appendTo(g);m=$("<div>");m.addClass("ai-analysis-bottom-desc");H.layoutCtrlWithLRTB(m,"50%",0,null,null,12,20);m.appendTo(g);g=$("<span>");g.text(B.get("answerTips","AI\u751f\u6210\u7684\u5185\u5bb9\u4ec5\u4f9b\u53c2\u8003\uff0c\u8bf7\u7ed3\u5408\u60a8\u7684\u7ecf\u9a8c\u4f7f\u7528"));g.appendTo(m);g=$("<span>");g.addClass("ai-analysis-bottom-desc-split");g.appendTo(m);g=$("<span>");g.text(B.get("privacy","\u9690\u79c1"));g.css({color:"#5582f3",cursor:"pointer"});g.appendTo(m);g.on("click",
T);k.setQuestionTextCallback(b.setTextField);k.setFunGetThemeRecommendedQuestions(function(){var p=[],t;for(t in x){var C=x[t];p.push(C[Math.floor(Math.random()*C.length)])}return p});U()},T=function(){X.setPrivacyListener(function(g){g?b.setEnabled(!0):b.setEnabled(!1,B.get("privacyAgreementTips","\u540c\u610f\u9690\u79c1\u653f\u7b56\u540e\u65b9\u53ef\u4f7f\u7528"))});X.openPrivacyAgreement()},U=function(){var g=new I(G.getAIAnalysisRemoteImpl(),function(m){G.setUserAvatar(m)},function(m,p,t){return!0});
g.setShowBlocking(!1);g.loadUserAvatar()},fa=function(){var g=k.getReportModel();g=new D(g);g.setConfirmGenerateCallBack(function(m){var p=m.toJsonObject();m=m.getReportItemModels().length;var t=la(m),C=Ka.createUUID();ta.subscribeChannel("generateReport "+C,r);m=new I(G.getAIAnalysisRemoteImpl(),function(R){y(C);t.remove();var Y=Ka.formatDate("yyyyMMdd_HHmmss");ta.downloadFile("\u57fa\u4e8e"+q+"\u7684\u62a5\u544a_"+Y+".docx",R)},function(R,Y,ca){y(C);t.remove();return!1});m.setShowBlocking(!1);m.generateReport(p,
G.getTag(),q,C)});g.showDialog()},la=function(g){var m=$("<div>");m.addClass("ai-analysis-report-modallayer");H.layoutCtrl(m,0,0,"100%","100%");m.appendTo($(document.body));var p=$("<div>");p.addClass("ai-analysis-report-block");H.layoutCtrl(p,"50%","50%",380,230);p.appendTo(m);var t=$("<img>");t.attr("src",sa.getIconUrl("ai-analysis","loading.gif"));t.addClass("ai-analysis-report-gif");t.appendTo(p);t=$("<div>");t.addClass("ai-analysis-report-text");t.text(B.get("generateReportTip1","\u751f\u6210\u62a5\u544a\u4e2d..."));
t.appendTo(p);l=$("<div>");l.addClass("ai-analysis-report-dynamic-text");l.text(B.get("generateReportTip2","\u5171\u9700\u5904\u7406 #1 \u5f20\u56fe\u8868\uff0c\u6b63\u5728\u5904\u7406\u7b2c 1 \u5f20\u3002").replace("#1",g));l.appendTo(p);return m},y=function(g){ta.unsubscribeChannel("generateReport "+g,r)},r=function(g){l.text(g)}};var B,ta,Pa,ya,oa,H,Ka,La,Ha,Ga,Oa,va,Ja,Ya,Xa,na,sa,Q,da,wa,Sa,Da,Va,Za,ra,Na,za,Ma,Ea,Fa,Ca;(function(){var a=com.kingdee.bos.qing.framework.common;ya=a.AbstractFacade;
B=a.MultilanguageManager.createPackageAccessor(ia);ta=a.RemoteFramework;Pa=a.TabbedUiUtil;a=com.kingdee.bos.qing.behavior;oa=a.BehaviorManager;a=com.kingdee.bos.qing.common;H=a.DomUtil;Ka=a.Util;a=com.kingdee.bos.qing.ui.component;La=a.TextField;Ha=a.Label;Ga=a.MessageCurtain;Oa=a.Toolbar;Ma=a.AbstractModalDialog;Na=a.RadioButtonGroup;za=a.RadioButton;Ea=a.HelpIcon;Ca=a.CheckBox;a=com.kingdee.bos.qing.common.ui;Fa=a.TableUtil;a=com.kingdee.bos.qing.schemamanage.model;va=a.SchemaAttrModel;Ja=a.SchemaModel;
a=com.kingdee.bos.qing.schemamanage.ui;Ya=a.SaveOrEditSchemaDialog;Xa=a.SchemaNameInputPane;a=com.kingdee.bos.qing;na=a.ModelHelper;sa=a.CodeLoader;a=com.kingdee.bos.qing.ai.analysis;Q=a.MyIcons;da=a.IconTool;a=com.kingdee.bos.qing.ai.analysis.model;Va=a.ChartTypeModel;Za=a.RecommendedQuestion;wa=a.QuestionType;Sa=a.ReportItemModel;Da=a.ReportModel;ra=a.DescriptionStyle})();var G=new function(){var a,d,e,h,n,l,c,b,k,x,E,M,J;this.setTag=function(q){a=q};this.getTag=function(){return a};this.setThemeId=
function(q){d=q};this.getThemeId=function(){return d};this.setThemeName=function(q){e=q};this.getThemeName=function(){return e};this.setSchemaList=function(q){h=q};this.getSchemaList=function(){return h};this.setLoadSchemaList=function(q){n=q};this.isLoadSchemaList=function(){return n};this.setUserAvatar=function(q){l=q};this.getUserAvatar=function(){return l};this.setChartCreator=function(q){c=q};this.getChartCreator=function(){return c};this.setRefreshChart=function(q){b=q};this.getRefreshChart=
function(){return b};this.setOpenDesigner=function(q){k=q};this.getOpenDesigner=function(){return k};this.setDataModelEntrance=function(q){x=q};this.getDataModelEntrance=function(){return x};this.setAIAnalysisRemoteImpl=function(q){E=q};this.getAIAnalysisRemoteImpl=function(){return E};this.setSchemaRemoteImpl=function(q){M=q};this.getSchemaRemoteImpl=function(){return M};this.setLappRemoteImpl=function(q){J=q};this.getLappRemoteImpl=function(){return J}},ma=new function(){var a="Kpi Pie Ring Rose Column SeriesColumn StackedColumn PercentStackedColumn Bar SeriesBar StackedBar PercentStackedBar Line SeriesLine Grid".split(" "),
d="\u6307\u6807\u56fe \u997c\u56fe \u73af\u5f62\u56fe \u73ab\u7470\u56fe \u67f1\u72b6\u56fe \u591a\u7cfb\u5217\u67f1\u72b6\u56fe \u5806\u79ef\u67f1\u72b6\u56fe \u767e\u5206\u6bd4\u5806\u79ef\u67f1\u72b6\u56fe \u6761\u5f62\u56fe \u591a\u7cfb\u5217\u6761\u5f62\u56fe \u5806\u79ef\u6761\u5f62\u56fe \u767e\u5206\u6bd4\u5806\u79ef\u6761\u5f62\u56fe \u6298\u7ebf\u56fe \u591a\u7cfb\u5217\u6298\u7ebf\u56fe \u5217\u8868".split(" "),e="Kpi Pie Ring Rose Bar Msbar Stackbar Percentbar Horizontalbar Horizontalmsbar Horizontalstackbar Horizontalpercentbar Line Mline Grid".split(" ");
this.getLength=function(){return a.length};this.getViewType=function(h){return a[h]};this.getChartName=function(h){return d[h]};this.getIconName=function(h){return e[h]};this.getIconNameByViewType=function(h){for(var n=0;n<a.length;n++)if(h==a[n])return e[n]}};ia.ViewTypeHelper=ma;ia.Integration=G;var pa=new function(){var a=!0;this.isAsync=function(){return a};this.setAsync=function(d){a=d};this.fixHomePageRecommendedQuestions=function(d,e){};this.fixRecommendedQuestions=function(d,e){};this.fixInsightText=
function(d,e){return d};this.fixInsightUi=function(d,e){};this.setLanguageModel=function(d){var e=new I(G.getAIAnalysisRemoteImpl(),function(h){},function(h,n,l){return!0});e.setShowBlocking(!1);e.setLanguageModel(d)}};ia.CustomSetting=pa;var X=new function(){var a=this,d=!0,e;this.setPrivacyListener=function(h){e=h};this.checkPrivacyUserAgree=function(){if(d)return!0;var h=com.kingdee.bos.qing.ui.component.MessageDialog,n=h.createFeedbackDialog();n.setMsgImageType(h.MSG_CONFIRM);n.setOptionType(h.OPTION_OK);
n.setButtonText(h.RETURN_OK,B.get("userAgreementDetail","\u9690\u79c1\u653f\u7b56\u8be6\u60c5"));n.setMessage(B.get("userAgreementTips","\u4e3a\u4e86\u7ed9\u60a8\u63d0\u4f9b\u66f4\u597d\u7684\u670d\u52a1\uff0c\u8bf7\u5148\u9605\u8bfb\u5e76\u540c\u610f\u9690\u79c1\u653f\u7b56\u3002"));n.setExtendPainter(function(l,c){var b=$("<div>");b.text(c);H.layoutCtrlWithLRTB(b,6,6,null,8,null,60);b.css("text-align","center");b.appendTo(l)});n.showDialog();n.setClosingChecker(function(l){l==h.RETURN_OK&&a.openPrivacyAgreement();
return!0});return!1};this.openPrivacyAgreement=function(){com.kingdee.bos.qing.integration.GaiPrivacyAgreementActionHandler.setCallback(function(h){d=h.content.userAgree;e&&e(d)});com.kingdee.bos.qing.integration.GaiPrivacyAgreementActionHandler.openGaiPrivacyAgreement({tenantAgreement:!1,userAgreement:!0})};this.checkQingGPTLicense=function(h,n){var l=new I(G.getAIAnalysisRemoteImpl(),function(c){var b=c.hasQingGPTLicense;c=c.qingGPTLicenseCode;if(n||b)h&&h(b);else{b=com.kingdee.bos.qing.ui.component.MessageDialog;
c=3010009===c?B.get("illegalGPTLicenseDialogTips","\u5f53\u524d\u7cfb\u7edf\u6ca1\u6709\u3010AI\u6570\u636e\u5206\u6790\u52a9\u624b\u3011\u6a21\u5757\u7684\u4f7f\u7528\u8bb8\u53ef\uff0c\u65e0\u6cd5\u4f7f\u7528\u667a\u80fd\u6570\u636e\u5206\u6790\u529f\u80fd\uff0c\u8bf7\u4e0e\u7cfb\u7edf\u7ba1\u7406\u5458\u8054\u7cfb\u3002"):B.get("noGPTLicenseDialogTips","\u60a8\u6240\u4f7f\u7528\u7684\u8d26\u6237\u6ca1\u6709\u88ab\u5206\u914d\u3010AI\u6570\u636e\u5206\u6790\u52a9\u624b\u3011\u6a21\u5757\u7684\u4f7f\u7528\u8bb8\u53ef\uff0c\u65e0\u6cd5\u4f7f\u7528\u667a\u80fd\u6570\u636e\u5206\u6790\u529f\u80fd\uff0c\u8bf7\u4e0e\u7cfb\u7edf\u7ba1\u7406\u5458\u8054\u7cfb\u3002");
var k=b.createFeedbackDialog();k.setMsgImageType(b.MSG_CONFIRM);k.setOptionType(b.OPTION_OK);k.setButtonText(b.RETURN_OK,B.get("close","\u5173\u95ed"));k.setMessage(c);k.showDialog()}},function(c,b,k){h&&h(!1);return!1});l.setShowBlocking(!1);l.loadQingGPTLicense()}};V.DialogType={};V.DialogType.Text="Text";V.DialogType.Chart="Chart";V.DialogPosition={};V.DialogPosition.Left="Left";V.DialogPosition.Right="Right";var Qa=new function(){this.blinkBorder=function(a){if(a){var d={border:"1px solid rgba(0,88,255,.5)"};
a.css(d);a.animate(d,1E3,function(){a.css("border","")})}};this.scrollToBottom=function(a){a&&a.animate({scrollTop:a.prop("scrollHeight")},250,"linear",function(){})}},aa=new function(){this.createAvatar=function(a){var d=$("<div>");if(a==aa.Type.QuestionAvatar)Q.background(d,"question_avatar");else if(a==aa.Type.AIAvatar)Q.background(d,"ai_avatar");else if(a==aa.Type.UserAvatar){a=G.getUserAvatar();var e=$("<img>");e.attr("src",a);e.addClass("ai-analysis-avatar-img");e.appendTo(d)}return d}};aa.Type=
{};aa.Type.QuestionAvatar="QuestionAvatar";aa.Type.AIAvatar="AIAvatar";aa.Type.UserAvatar="UserAvatar"})();
//qingVersionTag: 20250415