1/*! LICENSE: AiImportModalContainer-ef6b863e6aedd612.js.LICENSE.txt */ 2"use strict";(self.rspackChunkweb_app=self.rspackChunkweb_app||[]).push([[9795],{65230(e,t,l){l.r(t),l.d(t,{default:()=>I});var r=l(22155),n=l(10043),a=l(72508),o=l(57339),i=l(29749),u=l(52023),s=l(12380),c=l(4164),d=l(71617),m=l(67286);let f=l.p+"background.62dd29ad4e.png";var p=l(34858),v=l(78381);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,r=Array(t);l<t;l++)r[l]=e[l];return r}let b=e=>{var t;let l=e.visible,n=e.value,a=e.onClose,i=e.onConfirm,u=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(n))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var l,r,n,a,o=[],i=!0,u=!1;try{n=(t=t.call(e)).next,!1;for(;!(i=(l=n.call(t)).done)&&(o.push(l.value),2!==o.length);i=!0);}catch(e){u=!0,r=e}finally{try{if(!i&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw r}}return o}}(t)||function(e){if(e){if("string"==typeof e)return y(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y(e,2):void 0}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=u[0],d=u[1];(0,r.useEffect)(()=>{l&&d(n)},[l,n]);let m=(0,r.useCallback)(()=>{i(s),a()},[s,i,a]);return r.createElement(c.A,{visible:l,onClose:a,title:"ç¼è¾ Prompt",size:"small",footer:{okText:"ç¡®å®",cancelText:"åæ¶",onOk:m,onCancel:a}},r.createElement("div",{style:{padding:"24px 24px"}},r.createElement(o.Input,{component:"textarea",value:s,onChange:e=>d(e.target.value),placeholder:"请è¾å ¥è§£æææ¡£æ¶ä½¿ç¨çæç¤ºè¯",style:{width:"100%",resize:"vertical",minHeight:200}})))};var h=l(90989),k=l(55370),E=l(65369);let g=["visible","onCancel","onConfirm","taskUuid"];function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)({}).hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(null,arguments)}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var r,n,a,o,i=[],u=!0,s=!1;try{if(a=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;u=!1}else for(;!(u=(r=a.call(l)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){s=!0,n=e}finally{try{if(!u&&null!=l.return&&(o=l.return(),Object(o)!==o))return}finally{if(s)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var l=({}).toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?S(e,t):void 0}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,r=Array(t);l<t;l++)r[l]=e[l];return r}let w=[".pdf",".doc",".docx",".ppt",".pptx"],_=e=>{var t,l;let y,S,_=e.visible,I=e.onCancel,x=e.onConfirm,L=e.taskUuid,O=function(e,t){if(null==e)return{};var l,r,n=function(e,t){if(null==e)return{};var l={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;l[r]=e[r]}return l}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)l=a[r],-1===t.indexOf(l)&&({}).propertyIsEnumerable.call(e,l)&&(n[l]=e[l])}return n}(e,g),T=C((0,r.useState)("upload"),2),M=T[0],U=T[1],j=C((0,r.useState)(!1),2),P=j[0],D=j[1],$=C((0,r.useState)(""),2),F=$[0],N=$[1],z=C((0,r.useState)({}),2),R=z[0],G=z[1],V=C((0,r.useState)(""),2),Y=(V[0],V[1]),B=C((0,r.useState)(()=>{try{var e;return null!=(e=localStorage.getItem("ai_import_prompt"))?e:""}catch(e){return""}}),2),H=B[0],K=B[1],W=C((0,r.useState)(!1),2),q=W[0],X=W[1],J=C((0,r.useState)(.5),2),Q=J[0];J[1];let Z=(0,s.A)(),ee=(0,E.R)().trackAiAction,et=(0,u.oG)().openDoc,el=(0,n.wA)(),er="doubao-seed-1-8-251228",en=(0,h.BB)({taskUuid:L}),ea=en.fetchTaskList,eo=en.taskList,ei=en.uploadAndCreateTask,eu=en.uploadUnknownFile,es=en.isProcessing,ec=en.isUploading,ed=en.currentTask,em=en.currentTaskUuid,ef=en.reset,ep=en.viewTask,ev=(0,k.O)(),ey=(0,d.v)(d.z.ai_import_file.show);(0,r.useEffect)(()=>{ed&&N(ed.file_name)},[ed]),(0,r.useEffect)(()=>
2{if(_){var e;ea(),K(null!=(e=localStorage.getItem("ai_import_prompt"))?e:"")}},[ea,_]),(0,r.useEffect)(()=>{_||(U("upload"),D(!1),N(""),G({}),Y(""),X(!1),ef())},[_,ef]);let eb=(0,r.useCallback)(()=>{((null==ed?void 0:ed.status)===h.L$.SUCCESS||(null==ed?void 0:ed.status)===h.L$.PARSE_FAILED||(null==ed?void 0:ed.status)===h.L$.GENERATE_FAILED)&&ep(ed.uuid),null==I||I()},[ed,ev,I,ep]),eh=(0,r.useCallback)(async e=>{var t,l;let r,n=e.size>0x3200000?"åææ¡£æå¤§ 50 页æ 50M":null;if(n)return void o.Toast.error(n);if(t=e,!w.includes((r=null==(l=t.name.split(".").pop())?void 0:l.toLowerCase())?".".concat(r):"")){N(e.name);try{await eu(e),o.Toast.error("æåªæ¯æ PDFãWordãPPT æ ¼å¼çææ¡£"),ee("upload_file",{unknow:e.name})}catch(t){let e=t instanceof Error?t.message:"æä»¶ä¸ä¼ 失败ï¼è¯·éè¯";o.Toast.error(e),console.error("Upload unknown file error:",t)}return}N(e.name),ee("upload_file");try{await ei(e,Z,{preserve_tables:!0,preserve_latex:!0,prompt:"",model:er,preserve_images:!1,preserve_code_blocks:!0,enable:!!er,max_chunk_tokens:4096,enable_thinking:!1,temperature:Q})}catch(t){let e=t instanceof Error?t.message:"æä»¶ä¸ä¼ 失败ï¼è¯·éè¯";o.Toast.error(e),console.error("Upload error:",t)}},[ee,ei,eu,Z,!0,!0,H,er,!1,!0,4096,!1,Q]),ek=(0,r.useCallback)(e=>{D(e)},[]),eE=(0,r.useCallback)(()=>{et((null==ed?void 0:ed.doc_id)||"","home"),null==x||x(),ee("view_doc")},[et,ee,ed]),eg=(0,r.useCallback)(()=>{ep((null==ed?void 0:ed.uuid)||"")},[ed,ep]),eA=(0,r.useCallback)(()=>{N(""),G({}),ef()},[ef]),eC=(0,r.useCallback)(()=>{U("history")},[ee]),eS=(0,r.useCallback)(()=>{U("upload")},[]),ew=(0,r.useCallback)(e=>{et(e,"home"),null==x||x()},[x,et]),e_=(0,r.useCallback)(()=>{el(a.A.setCustomerSupportModalVisible({activeKey:"feedback",visible:!0}))},[el]);return r.createElement(c.A,A({containerStyle:{overflow:"hidden",backgroundImage:"url(".concat(f,")"),backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},contentStyle:{overflow:"hidden"},title:"upload"===M?r.createElement(m.k3,null,r.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},r.createElement("span",null,ey?"æºè½æç¼":"æºè½å¯¼å
¥"),r.createElement(m.mW,null,r.createElement("span",{className:"tag"},"æµè¯ç"),r.createElement("span",{className:"tag"},"éå
"))),r.createElement(m.HY,{onClick:eC},r.createElement(i.A,{size:16}))),r.createElement("div",{className:"desc"},"æ¬åè½ç®å为æµè¯é¶æ®µï¼æ¯äººæ¯å¤©æå¤å¯",ey?"æç¼":"导å
¥"," 10 ä¸ªææ¡£")):null},O,{visible:_,onClose:eb}),r.createElement(m.wS,null,"history"===M?r.createElement(p.KS,{historyList:eo,onBack:eS,onClose:eb,onViewDocument:ew}):r.createElement(r.Fragment,null,!ed&&!ec&&!em&&r.createElement(r.Fragment,null,r.createElement(v.A,{isDragging:P,onFileSelect:eh,onDragStateChange:ek}),r.createElement(m.XY,null,r.createElement(m.DI,null,"åææ¡£æå¤§ 50 页æ 50Mï¼æä¸æ¯æè¯»åææ¡£ä¸çå¾ç"),r.createElement(m.DI,{onClick:e_},r.createElement("p",{className:"tell-us-text"},"éè¦æ´å¤æ ¼å¼ï¼è¯·åè¯æä»¬")))),(y=(null==ed?void 0:ed.status)===h.L$.SUCCESS||(null==ed?void 0:ed.status)===h.L$.PARSE_FAILED||(null==ed?void 0:ed.status)===h.L$.GENERATE_FAILED,S=ec||em||ed&&!y,!y&&S&&r.createElement(p.GS,{fileName:F||(null==ed?void 0:ed.file_name)||"",isProcessing:es,isUploading:ec,status:null==ed?void 0:ed.status})),(null==ed?void 0:ed.status)===h.L$.SUCCESS&&(null==ed?void 0:ed.doc_id)&&r.createElement(p.YE,{fileName:F||(null==ed?void 0:ed.file_name)||"",topicCount:R.topicCount,wordCount:R.wordCount,onView:eE,viewTask:eg}),((null==ed?void 0:ed.status)===h.L$.PARSE_FAILED||(null==ed?void 0:ed.status)===h.L$.GENERATE_FAILED)&&((null==ed?void 0:ed.view)==null||L)&&r.createElement(p.$2,{fileName:F||(null==ed?void 0:ed.file_name)||"",errorMessage:(0,h.YO)(null==ed||null==(t=ed.fail_reason)?void 0:t.code,null==ed||null==(l=ed.fail_reason)?void 0:l.msg),onRetry:eA,renderAction:e=>{let t=e.onClick;return r.createElement("div",{className:"button",onClick:t},"鿰坼å
¥")}}))),r.createElement(b,{visible:q,value:H,onClose:()=>X(!1),onConfirm:e=>{K(e);try{localStorage.setItem("ai_import_prompt",e)}catch(e){}}}))},I=e=>{let t=e.modal,l=(0,n.wA)(),o=()=>{l(a.A.setAiImportModalVisible({visible:!1}))};return t.visible?r.createElement(_,{onCancel:o,onConfirm:()=>{o()},visible:t.visible,taskUuid:t.taskUuid}):null}},38821(e,t,l){l.d(t,{A:()=>r});let r=(0,l(84601).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},1766(e,t,l){l.d(t,{A:()=>r});let r=(0,l(84601).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},92621(e,t,l){l.d(t,{A:()=>r});let r=(0,l(84601).A)("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]])},29749(e,t,l){l.d(t,{A:()=>r});let r=(0,l(84601).A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},89247(e,t,l){l.d(t,{A:()=>r});let r=(0,l(84601).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},62625(e,t,l){l.d(t,{A:()=>r});let r=(0,l(84601).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
2],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}}]); 3//# sourceMappingURL=AiImportModalContainer-ef6b863e6aedd612.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.