1import{b as ks,d as Pt,a as Nt,v as Vt,k as ns,j as Et,c as Js,e as js,t as Ys,s as Ks,u as Bt}from"./ui-1491e31a.js";import{b as Xs,g as en,_ as As,a as tn}from"./LangSelector-0c521a27.js";import{i as Yt,l as sn,d as Kt,_ as Fs}from"./icon_copy-765b6ca4.js";import{o,e as i,f as e,aY as Dt,aP as gt,m as se,Z as Ie,aW as Ts,y as c,p as Ae,T as f,Y as oe,a8 as ie,a1 as _t,U as Re,ar as nt,aT as Tt,aU as St,P as os,q as A,a2 as $,r as xt,J as nn,a3 as J,a9 as fe,aV as as,aR as ls,aQ as wt,O as Ft,v as Lt,G as Ht,R as on,V as ct,Q as st,a7 as ft,aS as Xt,$ as Ss,a0 as es,b3 as an,am as xs,ay as vs,a$ as ln}from"./vendor-4a1bf3a7.js";import{a as $s,r as et,s as cn,_ as rn,b as un,I as dn,c as hn,d as fn,e as pn}from"./icon_language-da134a62.js";import{_ as Ze,bG as _n,c as He,aj as ms,X as bs,v as Rt,s as Pe,a0 as is,a6 as Is,D as Ps,u as Mt,bH as vn,bI as mn,n as tt,W as gn,au as Cn,av as bt,p as yn,Y as Es,bJ as wn,bK as kn,bL as An,aw as Fn,Z as Tn,a5 as Sn,bM as xn,bN as $n,P as bn,G as In,F as Pn,j as En,m as Dn,t as Ds,q as Ln,bO as Hn,bP as Rn,bQ as Mn,bR as Bn,bS as Ls,bT as Nn,bU as Vn,aO as Zn,f as gs,aP as On,bV as Un,bW as zn,bX as Qn,a9 as Wn,i as Gn,x as qn,b as Jn}from"./index-6bbd9216.js";import{i as jn,e as Yn,_ as Kn}from"./FileUploadComponent-6729e46e.js";import{_ as Hs,d as Xn,u as eo,a as to,b as Rs,T as so}from"./usePDFV2-7efe2864.js";import{L as cs}from"./loading-new-bbec564a.js";import{e as no}from"./network-f6a8eebc.js";import{x as oo,g as pt,s as ao,q as At,k as Cs,e as Ut,y as zt,l as lo}from"./utils-60681157.js";import{_ as io}from"./ToolsEdit-396f8023.js";import"./pdf-9bb28b9a.js";import"./dom-f7cab880.js";import"./oss-c0d776a2.js";import"./ShapeRectangleWASM-5e6730a4.js";import"./RenderTextWASM-efa05946.js";import"./editor-10ca5069.js";const co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},ro=e("g",{"clip-path":"url(#a)"},[e("path",{stroke:"#000","stroke-linecap":"round","stroke-linejoin":"round",d:"M18.887 10.25C18.097 7.23 15.313 5 12 5c-3.314 0-6.098 2.23-6.887 5.25m13.774 0-2.443-.875m2.443.875L20 8.062M5.113 13.75C5.903 16.77 8.686 19 12 19c3.313 0 6.098-2.23 6.887-5.25m-13.774 0L4 15.938m1.113-2.188 2.443.875"})],-1),uo=e("defs",null,[e("clipPath",{id:"a"},[e("path",{fill:"#fff",d:"M0 0h24v24H0z"})])],-1),ho=[ro,uo];function fo(a,p){return o(),i("svg",co,ho)}const ts={render:fo},po={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},_o=e("g",{stroke:"#7F7F83","stroke-width":"2"},[e("path",{d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v7.5H8"})],-1),vo=[_o];function mo(a,p){return o(),i("svg",po,vo)}const go={render:mo},Co={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},yo=Dt('<path stroke="#000" d="m14.002 7.5-4 2.5"></path><circle cx="7.5" cy="11.5" r="3" stroke="#000"></circle><circle cx="17" cy="17" r="3.5" stroke="#000"></circle><circle cx="16" cy="6" r="2.5" stroke="#000"></circle><path stroke="#000" d="m10 13.5 4 2.5"></path>',5),wo=[yo];function ko(a,p){return o(),i("svg",Co,wo)}const Ao={render:ko},Fo={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},To=e("path",{fill:"#7F7F83","fill-rule":"evenodd",d:"M5.5 9.5v-4h4v4h-4ZM3.5 5A1.5 1.5 0 0 1 5 3.5h5A1.5 1.5 0 0 1 11.5 5v5a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 10V5Zm2 13.5v-4h4v4h-4Zm-2-4.5A1.5 1.5 0 0 1 5 12.5h5a1.5 1.5 0 0 1 1.5 1.5v5a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 19v-5Zm11-8.5v4h4v-4h-4Zm-.5-2A1.5 1.5 0 0 0 12.5 5v5a1.5 1.5 0 0 0 1.5 1.5h5a1.5 1.5 0 0 0 1.5-1.5V5A1.5 1.5 0 0 0 19 3.5h-5Zm.5 15v-4h4v4h-4Zm-2-4.5a1.5 1.5 0 0 1 1.5-1.5h5a1.5 1.5 0 0 1 1.5 1.5v5a1.5 1.5 0 0 1-1.5 1.5h-5a1.5 1.5 0 0 1-1.5-1.5v-5Z","clip-rule":"evenodd"},null,-1),So=[To];function xo(a,p){return o(),i("svg",Fo,So)}const $o={render:xo},bo={__name:"ChatMbMenu",emits:["menu:click"],setup(a,{emit:p}){const{t:C}=gt(),B=se(()=>[{icon:go,name:C("CHATPDF.leftMenu.toolTips.chatHistory")},{icon:$o,name:"PDF Preview"},{icon:Yt,name:C("CHATPDF.chat.toolTips.exportChat")},{icon:ts,name:C("CHATPDF.chat.toolTips.resetChat")},{icon:Ao,name:"Share Chat"}]),u=p,b=S=>{u("menu:click",S)};return(S,L)=>{const x=Xs;return o(),Ie(x,{list:B.value,"onMenu:click":b},null,8,["list"])}}},Io="data:image/png;
1base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVHSURBVHgB5ZtBbBtVEIb/eU7TAEqc9IJzCN1y5EIiTiAkHCkHDkhFQnDFPcA1qShNJA5JODUBiYQjPZAcOYDaGzd8AA5IqEFqOaKNQI17SpqgJk26O33zHCd2srZ37bcbb/xJzq7sZ8czb96beTNjQszkpnYdXDjIs6LXAXaUfjAwCJBTO5JdArZ8kEvMf+nrmlLeWunWkIsYIcRA7sZOnjO4SvDfPy1oZFz9KMKj1dLX/UVYxpoCBqc2B/t6eyaZeIrMDMeCCx/zyHhFW5bRtgISErwGvYS2FGiF6dlyu4poSwEvT/8/CfhzSQkegLGI0lcDK2iRlhSQm9l0wJnv9W0enYEL8sZbsQaFiMisM2fuoXOEFxzS32n45uMpRCSSBQxP73zD4Mj/JFGY5kqL/fNhh4dWQG56W0y+gHSwUloYuBZmYCgF6Jm/p2d+FCmCwGsbC9mxZuOa7gEy82kTXmDQ6KHVNqShAnI3d2aRHrMPoiD7VqMBdZeA7PY6lF1Cggz0Ed58NYNXLpG5r/DvJuPxLmN7j839f5s+oqDPFtc3FrOBsgQqQPy8uLokAhwR9JO3e/GWFlweYZn49gkePPRCjZVDFpM3FhQn9AS+gzO/JCG8zPbyhy9gZCh6PJbtCz/WnD7Lgdv4yddO7QG5z7cL+uIgZj6buIifPn2xJeFbJB8UKNUowIS4CrOIGTH5GxO9SByiWTm8VT9VowDiHn24iXf2R4YUvnzvIs4CWQp9varGCo4UILPvgwuImTOZ+SqIaLLaCo4twMvk4974ZPY/euMCzpKTVnCsgATWfhQ3FydiBZV74wYlhycJS8TMu6/1hB4rQc/tX/fx89/PcP9htMCnGWIFesnndVxQLH+jDH+MBBi5FN7lffDdE+uCV8OsdMIWxcoSyCMBZA8Iw+3fDmIVXiDQVbkq4/sTCHyE6vi+ET/8eYAEcIa/2L2sfD/TcUfdsDF+u/D+wbhSKTzr24IVjyomKVl1LVKqIwfdy2VFxGdV1DhztCcYFL/koHtxIhdGzhukM6cMC0iQ88f0S0iC3//xTKRog1RagJwTbCEKcJEy7tsLlFzFTFtIGQ827JwTdMFH+gzYRcqQ2oAl1iUUXkfKsHVWIMaaYp/WkCJsmb9gOtGk4QgpQkpktpA2PHVYLnKREux5AHZFdpMS07X0u7qcPIk2kJlpFpz8qCtBYWj0OfY2QCrKX6MAJv+Orp21pQAJTiRCs4Gtz2kIeatyMZGgZEel9w5dgzH/otwdhcK6hr6MboHoqInqSAF7+/5SN1gBGRmPPd+RAraWhra6wQp0/XO1ulGi5jR4/q2AXaLatp8aBYgV6JJJ6CbD1KHX/sk2mVP5gEflZqIizh2y859uqg5OiJB37TwtBTn2gvzxoNcCFWDM5BwtBcWYr9dJXjclJktBh8jp9wrE8/V6BIWGOcGNheyUtoRVpBUSl5edazSkaVK0tJgtMHOqcgaCNEtr4QvNxoXKCuvlMJYqS9AzH6ZTXAidFhdLkPWEDkfv+MthZr5CpLqArCe9HK53oosUVydN0Y9k34pA5MKI8Q7kjUlggc6hqEPcsUa7fT3Ct21VcehTr+Rmtgt6b5i18OvQljB5fe3jWxG8QlulMRNa6ghL4gUTbSVEObLj+adP/SvtCC9Ya9UuN1tl8o0sYuNWP8IwPLMT+LxZ54TlvT1/yRzcLBDPj6dnNvPwlfYaeKdaGa0pgF296d7Va/xOJY1lk5b2gGYcflF5lJuwfYwqKGnGkn4kB+WeZOfE21yUvYsWmNe1wBJ8WfuRdD2eA54hH2yM/0VbAAAAAElFTkSuQmCC",Po="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAbISURBVHgB5ZvNbxNHFMDfjO2A+HAcLnCww6JyaSo1QWql0EvNBS6tQGoDvbSJBZz5ujfJH9BCzhVyjNRL2wPcKJf4UD4kDhipTU9VF+JK9II3DpAQe/d13iQ2dry2d2fHjp3+pMgbe+2d9zlv3s4y6DBGetUoQSnJQ2wUAA1ENBhADIAZ9WeiiQAWY8xEG58yYLkS2LkXqSETOgiDDhBPryRZCE4DOmcaBfWNKUaZRZtl8qn9WdCMNgXE0oVYNBy+hA5eBmnhjmCCA7PCM7K6PCOwArok+FYsYGy+ZJfngioikAKGM68uITgz0D3BtyI9YikVnQdFlBRwKF0wIqFQGhCS0BuYJcc+oeINHHxCVo/w0JMeEp4waEzD6eXLPr/nzwOGb61cF9OY74t0E8bZzPOv9896Pt/riYlbRXL5KegHGMwvfRNNeTvVA/HMyhMGOAZ9BALm8pODx9qd1zYHkOX7TXhCVJJj0mvb0FIBwvLTfeP2boixJ0TeanVK0xDYnONvwA6AOXjleWrQVRZXBch5nqa67StwdGOJOuGYW53gGgJC+AXYOcITMVm4udCggES6OCVeDNhpiMLNrVCqC4FN1yfrG7AzsVYc+4iVGrIqb9R5wEAofAl2rvBELMp5nRdUPaAXEt/IEIeJ9yJwajgC8X0bQ1t86cDDF2W4+WcJ8q+dhu8cPxQSn9vggzovqHpABEJJUBCeBqCDK6O74O7ne+H8yEBVeGLkAJfvPfhCfPb+QN11fzq5B74UCvNJnRdUr5TIFP8Gn+4fHWDw+1f74PrTdfH3FlSZ/ni3EM6bII+EtUkpdO38KwfO3luVrz6xliajQ3QgPYB6eKAQ+8cPblj/yuiAtKAK5PJehSfGheVJ+OI6woXsKhTfIsT3+l7Vx+LpQpIO5DdZCCdBAbJEBVLC9Ee75eD8oKq4n/8qwdUPd8nQqA0Zz3B+Rr7IfzQ1N86PRODuZ3s8W4TiWGnwdC2RD04Oh2H28Vt49K+vJCgRi6XT9Mop+4Pi1Jd/hQ3vxfdxaZXvPtndVhGU9VWhELh2f016giLGkR9XD3OR/ZWXur8ulZt+NnE0UlXEBwfcBfUbLrVQ0g0gvGR9vXQiLBoHY0yxOUxWoEFMtJiKSBH0R5ma5ut7+bI8/kPM724e5P3aEBjGcSzM6JaV+jjkFHj8YLhtLFNoTBzlUhkVSIGqLPmf+hpgDhgckRmgyLiYBhNC8LP33ihZM0gI6AA5HA6Ldpdy6UuxTUUMWXLDmt0TaLGgwQOAxcIQYPFDcUyQJbtpTcohQcKnBkN9HhLQ/BskkanyUGHeb0YgBRBX769Ct3n0oocUQF4QZCGkQqv6wy+kABMCQlMhVWXdCAeqOzTFP2FyBGaBBhYLNlxceAM3FzVUKC0gZetCFIFWmDE0xVHgOz/fipWgruZIM8j6eQ0FUAVRCD3jaOMz0MC1B2s6XbMB+m2d1ifEaHMUAjnQAFlm5nHnkiElWp3WJ2gnmlgN2lnQxC/CRS8srGpPhuT61BTVTQjsnCzfVPqB7aAVIi18qEIMsu6navOcWGvoDy80lyYHj8iRoYN3QDOyZfXbmuzZqULCX6S+XydyC7IsvWyaxrkNGolGmOz1UUNkXHFmoALrnFxl6o37Coh2hl5r2+IFULwpQgIn9jO5PD6ViCgLXWH28VpHYv4dG+5PR+HqWw7OMc6mvf4ELYV/SO5Rbmq6QVafEcIvvuyM1as4rLqJqjp6I12I2TxEydCXF1SS3fhBdauT4N/n1Lq7Clghxz5mbu4VqDNfPL0848cL6r4rWl50o+SUaFWTMlr1B/KvUazoyiLJ2SJZljtaQG1FlL9z+cnBxltjhKoXuEEKiO+tb5RQfVAsYVcFrgfNkOOcMGt2ijSYiTYRIGfXYSfiQGrrvmJXP43fKi6w3toKq4F3mb8W1xItbNu0y1LLMrk3QItc3+0TVwVQjDAHPe+37XUcB2bNJjvJmxbptK+OagPoc0Tbf/afJnsENz5vQyKzPC9OU7p9vv1gRsT9VKszPJVxw5nlJ6Jv8P/cLE08lz+EGegbMONFeMLzQp1cCfsgMVKl187ta/HVqcinBmdo4zH05BSJliPGVlvmekFpKSdKZsPmfEHDQ5FaQIRsGO2UqfDQVKC1rNxXzHF6+xRBVoeW01w7Ai/m
1yRvKwC8zDmKqZF3aZYoWOjAXBueGWbPvVwVt3QwZFrTbtKMeoU/wCh16eLqQZJxPicNPgytDPlV+R9Szt/OpoSxopuO7GjY8A8YQ+BhjbFRMUwZjTR6fR7DEzQoTGT5Dx8lFALJmhx+f/w/KE+yUHlEyNAAAAABJRU5ErkJggg==",Eo="https://static.hipdf.com/icon-instagram-92fab2de.png";const rs=a=>(Tt("data-v-1a5f97be"),a=a(),St(),a),Do={class:"link-box mt-8"},Lo=rs(()=>e("h2",{class:"section-title font-semibold"},"Share Link",-1)),Ho={class:"link w-full mt-4 flex flex-wrap"},Ro={class:"share-media-box mt-8"},Mo=rs(()=>e("h2",{class:"section-title font-semibold"},"Share on Media",-1)),Bo={class:"media-box mt-4"},No={class:"flex"},Vo=["title","onClick"],Zo=["src","alt"],Oo=rs(()=>e("div",{class:"tips mt-8"},"Every visitor will start a new conversation, chat history is not shared.",-1)),Uo={__name:"ChatPDFShareDialog",props:{isShow:Boolean,conversationInfo:Object,fileName:String},emits:["close"],setup(a,{emit:p}){const C=a,B=p,b=`/${Ts().params.lang}`||"",S=`${window.location.origin}${b}/app/chat-pdf`,L=c(""),x=c(!1),Z=()=>{if(window.$sensorsApi.track("chatpdf_share",{type:"link"}),!L.value){He("The sharing link is empty.");return}bs(L.value),He("Link copied to clipboard",ms.success)},d=(m,w="")=>{let P="";const E="toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=600, height=450,top=100,left=0";switch(window.$sensorsApi.track("chatpdf_share",{type:m}),m){case"facebook":P=`http://www.facebook.com/sharer.php?u=${L.value}&title=${w}`;break;case"twitter":P=`https://twitter.com/intent/tweet?url=${L.value}&text=${w}`;break;case"instagram":P="https://www.instagram.com";break}window.open(P,"_blank",E)},_=m=>{const w=`Chat with ${C.fileName} on HiPDF: `;if(!L.value){He("The sharing link is empty.");return}d(m,w)},ae=[{icon:Io,title:"share to facebook",type:"facebook"},{icon:Po,title:"share to twitter",type:"twitter"},{icon:Eo,title:"share to instagram",type:"instagram"}],v=()=>{B("close")};return Ae(()=>C.isShow,m=>{if(m){if(x.value=!0,!C.conversationInfo.file_id){x.value=!1;return}_n({file_id:C.conversationInfo.file_id,conversation_id:C.conversationInfo.conversation_id,share_days:7}).then(w=>{L.value=`${S}?share_id=${w.share_id}`}).catch(w=>{He("Network error",ms.error)}).finally(()=>{x.value=!1})}else L.value=""}),(m,w)=>{const P=ks,E=Pt,k=Nt,Se=Vt;return o(),i("div",null,[f(k,{class:"p-4 pl-6","model-value":a.isShow,title:"Share this Chat","align-center":"",onClose:v},{default:oe(()=>[e("div",Do,[Lo,e("div",Ho,[ie(f(P,{class:"h-10 rounded","model-value":L.value,placeholder:"Please select your file session",readonly:""},null,8,["model-value"]),[[Se,x.value]]),f(E,{onClick:Z},{default:oe(()=>[_t("Copy")]),_:1})])]),e("div",Ro,[Mo,e("div",Bo,[e("ul",No,[(o(),i(Re,null,nt(ae,le=>e("li",{class:"media-item",key:le.type},[e("span",{class:"cursor-pointer",title:le.title,onClick:N=>_(le.type)},[e("img",{class:"w-8",src:le.icon,alt:le.type},null,8,Zo)],8,Vo)])),64))])])]),Oo]),_:1},8,["model-value"])])}}},zo=Ze(Uo,[["__scopeId","data-v-1a5f97be"]]);const Ms=a=>(Tt("data-v-2e527833"),a=a(),St(),a),Qo={key:0,class:"task-inner p-4"},Wo={class:"top-title mb-4 font-bold"},Go={class:"task-list"},qo=["onClick"],Jo=Ms(()=>e("div",{class:"left"},[e("span",{class:"dot"})],-1)),jo={class:"right"},Yo={class:"title"},Ko={class:"describe"},Xo={key:1,class:"task-inner"},ea={class:"top-title mb-4 font-bold"},ta={class:"task-list"},sa=["onClick"],na=Ms(()=>e("div",{class:"left"},[e("span",{class:"dot"})],-1)),oa={class:"right"},aa={class:"title"},la={class:"describe"},ia={__name:"HiChatTask",props:{show:{type:Boolean,default:!1}},emits:["handleItemClick","close"],setup(a,{emit:p}){const C=a,{show:B}=os(C),{t:u}=gt(),{IS_PC:b}=Rt(),S=[{title:u("CHATPDF.prompt.subTitle.convertPDFToWord"),describe:u("CHATPDF.prompt.description.helpConvertPDFToWord"),pageID:"pdfToWord",taskSate:{converting:"File converting..."}},{title:u("CHATPDF.prompt.subTitle.convertPDFToExcel"),describe:u("CHATPDF.prompt.description.helpConvertPDFToExcel"),pageID:"pdfToExcel",taskSate:{converting:"File converting..."}},{title:u("CHATPDF.prompt.subTitle.convertPDFToJPG"),pageID:"pdfToJpg",taskSate:{convert
1ing:"File converting..."},describe:u("CHATPDF.prompt.description.helpConvertPDFToJPG")},{title:u("CHATPDF.prompt.subTitle.convertPDFToPPT"),pageID:"PDFToPPT",taskSate:{converting:"File converting..."},describe:u("CHATPDF.prompt.description.helpConvertPDFToPPT")}],L=p,x=d=>{L("change",d)},Z=()=>{L("close")};return(d,_)=>{const ae=ns;return A(b)?(o(),i("div",Qo,[e("div",Wo,$(d.$t("CHATPDF.prompt.title")),1),e("ul",Go,[(o(),i(Re,null,nt(S,(v,m)=>e("li",{class:"task-item flex",onClick:w=>x(v),key:m},[Jo,e("div",jo,[e("div",Yo,$(v.title),1),e("div",Ko,$(v.describe),1)])],8,qo)),64))])])):(o(),i("div",Xo,[f(ae,{"model-value":A(B),"with-header":!1,direction:"btt","before-close":Z},{default:oe(()=>[f(A(jn),{class:"close",onClick:Z}),e("div",ea,$(d.$t("CHATPDF.prompt.title")),1),e("ul",ta,[(o(),i(Re,null,nt(S,(v,m)=>e("li",{class:"task-item flex",onClick:w=>x(v),key:m},[na,e("div",oa,[e("div",aa,$(v.title),1),e("div",la,$(v.describe),1)])],8,sa)),64))])]),_:1},8,["model-value"])]))}}},ca=Ze(ia,[["__scopeId","data-v-2e527833"]]);const ra={key:0,class:"text-center"},ua={class:"end"},da={__name:"ScrollListBase",props:{page:{type:Number,default:1},isEmpty:{type:Boolean,default:!1},isEnd:{type:Boolean,default:!1},isLoading:{type:Boolean,default:!1},isLoadingSummary:{type:Boolean,default:!1}},emits:["scroll:end"],setup(a,{expose:p,emit:C}){const B=a,u=C,b=c(null);return p({scrollToTop:()=>{b.value.scrollTop=0},scrollToBottom:()=>{const{scrollHeight:x}=b.value;b.value.scrollTop=x}}),xt(()=>{b.value.addEventListener("scroll",function(x){const{scrollHeight:Z,clientHeight:d,scrollTop:_}=this;B.isLoadingSummary||_+d>=Z&&u("scroll:end")})}),(x,Z)=>{const d=Hs;return o(),i("div",{class:"wrapper",ref_key:"wrapper",ref:b},[nn(x.$slots,"default",{},void 0,!0),a.isLoading?(o(),i("div",ra,[f(d)])):J("",!0),ie(e("div",ua,"the end",512),[[fe,a.isEnd&&a.page>2&&!a.isLoading&&!a.isEmpty]])],512)}}},us=Ze(da,[["__scopeId","data-v-7c662e13"]]);const ha={key:0,class:"error"},fa={key:1,class:"error"},pa={class:"strong"},_a={key:2,class:"error"},va={key:3,class:"error"},ma={__name:"HiChatError",props:{error:{default:"",type:String}},emits:["retry"],setup(a,{emit:p}){const C=p,B=()=>{C("retry")};return(u,b)=>(o(),i(Re,null,[a.error==="ERR_TIMEOUT"?(o(),i("div",ha,$(u.$t("CHATPDF.chat.error.serviceBuzy")),1)):J("",!0),a.error==="ERR_LIMIT500"?(o(),i("div",fa,[e("span",pa,$(u.$t("CHATPDF.chat.description.tokensPerMonth",{tokensCount:2e7})),1),_t($(u.$t("CHATPDF.chat.description.haveExceedLimit")),1)])):J("",!0),a.error==="ERR_NETWORK"?(o(),i("div",_a,[e("div",null,$(u.$t("CHATPDF.chat.error.networkError")),1),e("div",{class:"refresh",onClick:b[0]||(b[0]=S=>B())},[f(A($s))])])):J("",!0),a.error==="ERR_SOMETHING"?(o(),i("div",va,[e("div",null,$(u.$t("CHATPDF.chat.error.someError")),1)])):J("",!0)],64))}},ga=Ze(ma,[["__scopeId","data-v-b694f944"]]),Ca={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},ya=e("g",{fill:"#7F7F83"},[e("path",{d:"M8 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM13.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM19.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"})],-1),wa=[ya];function ka(a,p){return o(),i("svg",Ca,wa)}const Aa={render:ka},Fa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJQSURBVHgB7ZeNccIwDIVfex2ADfAGtBOQDRiBERghIzAC3YAR6AZ0A9gANmijxjornGMnIEHo5bvzhR/Fka1nSQFGRv4Nm2rs8KQsq/HjxwpPhqvGAWEBp2pM8ADoobST62rsvSPSqR3ijm28DUuIPm9xR8ipEk2HYyPm1BphgVPU0eB5StyBFZqO7/xvBZq7PfHOye9bBOeX4j95HrYwkhNNukHT8aLjvQ61xOg+0v4sYjNDOBd0nUIZ1irt3gL9kAtP3bsQdmsowrq9dmekfNrSppmM5MS3hrVEfBHyd9WdJ1iXWhlCOku6dzAsaHME6WjCktwhbJD6zhMbo8lJ37ISH2CUOjn1FdCHo2s1/x9csKz6FDoPJtJheIcGxWsP27O/5iLAmo5pmTINRTKVYSg9L2EAH7R5xk4WKdnAOTFH2wL4LOxhAKe7VA3gvM4RYHuZaVKt8gqhtVaHd+eE9MO5KMnMIhuzlATZroARbRJwiFdQuahc77SCTaFsIKMgneH2Nyav0tvPEvM6hDS9hDG3dqOXOBi3EJeQhuULSd/3AQlFlHfeJPO0cdnTl1fMITtRs1fHPk7k6oPE4bbFqyLb4a5w9B7uPEGhT9WHGKx7jSSgQh+HHBQbwzfo8I26etL1nLHlw/qJAeEQUmuXQedFRT4v0MV1tDtCCS0JMSSfWcbmiIEia0JuqKVPLQlREfvyn3MHufDXD287CN4RakFKQtzNmvb818IVmd+o5ELmF/8PogLH6HIOBus841BHQNaFA+oI5DLUyMjIyJPxC1enBckhRHTWAAAAAElFTkSuQmCC",Ta={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Sa=Dt('<path stroke="#7F7F83" stroke-linecap="round" stroke-width="1.5" d="M3 12h18"></path><path fill="#7F7F83" d="M11.25 21a.75.75 0 0 0 1.5 0h-1.5Zm1.5 0V3h-1.5v18h1.5Z"></path><path fill="#7F7F83" d="M11.067 21.626a.75.75 0 1 0 .827-1.252l-.827 1.252Zm.827-1.252c-5.783-3.821-5.422-12.853.517-16.747l-.822-1.254c-6.737 4.417-7.306 14.77-.522 19.253l.827-1.252Z"></path><path fill="#7F7F83" d="M12.933 21.626a.75.75 0 1 1-.827-1.252l.827 1.252Zm-.827-1.252c5.783-3.821 5.422-12.853-.517-16.747l.822-1.254c6.737 4.417 7.306 14.77.522 19.253l-.827-1.252Z"></path><path stroke="#7F7F83" stroke-width="1.5" d="M21.25 12a9.25 9.25 0 1 1-18.5 0 9.25 9.25 0 0 1 18.5 0Z"></path>',5),xa=[Sa];function $a(a,p){return o(),i("svg",Ta,xa)}const ba={render:$a},Ia={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Pa=e("circle",{cx:"12",cy:"12",r:"9.25",stroke:"#121212","stroke-width":"1.5"}
1,null,-1),Ea=e("rect",{width:"8",height:"8",x:"8",y:"8",fill:"#121212",rx:"1"},null,-1),Da=[Pa,Ea];function La(a,p){return o(),i("svg",Ia,Da)}const Ha={render:La};function Ra(){function a(p){const C=en().find(u=>u.value===p),{label:B}=C;return B}return{getLangTextByLanCode:a}}const Ma=se(()=>Pe.getters.currentPageFeatures),It=se(()=>Pe.getters.currentPageInfo);se(()=>Pe.getters.fileEncryptList);se(()=>Pe.getters.OSSUploadFinished);const Qt=se(()=>Pe.getters.currentPDFInfo),Ba={extractPage:()=>{},rotatePDF:()=>{},splitPDF:()=>{},protectPDF:()=>{},detect:()=>{},summary:()=>{},crop:()=>{},applyContent:()=>{},unlockPDF:()=>{},imageConvert:()=>{},handleV2OCR:()=>{},redactPDF:()=>{}},{checkAiPages:Na,checkAiFileSize:Va}=Is(),Bs=window.$bus,Za=window.$sensorsApi;let Wt=null;function Oa(){return!(Pe.getters.filePassedList[0]&&!Va(Pe.getters.filePassedList[0],()=>{})||!Na(()=>{Pe.commit("RESET_FILE_INFO"),Bs.emit("close:download"),window.$sensorsApi.track("Upload_file",{result:"expagefail",FileFormat:"pdf",FileSize:Qt.value?.fileSize?as(Qt.value?.fileSize,{base:2,standard:"jedec"}):"",OpenFileSize:is(Qt.value?.fileSize)})}))}async function Ua(a,p,C){const{isNeedLogin:B}=It.value;if(B&&!Pe.getters.isLogin){if(await Pe.dispatch("loginCallback").catch(S=>{throw new Error("login failed:"+S)}),Pe.getters.isAiChatPage){Bs.emit("close:download");return}Pe.commit("SET_AI_STATUS","analyses")}if(!Oa())return;Za.track("Features_Features",{type:Ma.value});let u=0;const b=60*1e3;Wt=setInterval(()=>{Ga(a,p,C),clearInterval(Wt),u+=300,u>=b&&clearInterval(Wt)},300)}const za=se(()=>It.value.pageID==="AIDetector"),Qa=({fn:a,params:p})=>{Pe.dispatch("ADD_CONVERT_TASK_TO_QUEUE",{fn:a,params:p})},Wa=se(()=>It.value.convertType&&It.value.convertType==="ADD_CONVERT_TASK_TO_QUEUE");async function Ga(a,p,C){if(Wa.value){if(Pe.getters.convertParams)Qa({fn:Ba[It.value.convertFn],params:Pe.getters.convertParams}),za.value&&Pe.getters.convertParams.type==="text"&&Pe.commit("SET_AI_STATUS","analyses");else throw Error("convert: must set convert params in file store before convert!");return}switch(It.value.pageID){default:return Pe.dispatch("handleConvertChat",{file_id:a,chatTaskId:p,pageInfo:C})}}const qa=a=>{const p=document.createElement("a");p.href=a,p.setAttribute("target","_self"),p.click()};function Ja(){return{startProcess:Ua,downloadUrl:qa}}class Ns{capacity;cache;constructor(p){this.capacity=p,this.cache=new Map}get(p){if(this.cache?.has(p)){const C=this.cache.get(p);return this.cache.delete(p),this.cache.set(p,C),C}return null}set(p,C){this.cache?.has(p)&&this.cache.delete(p),this.cache?.set(p,C),this.cache?.size>this.capacity&&this.cache.delete(this.cache.keys().next().value)}}const ja={class:"chat-wrapper relative"},Ya={key:0,class:"header"},Ka={class:"left text-ellipsis"},Xa={class:"title"},el={class:"right"},tl={class:"header-ctrl lang hidden lg:block w-[10rem]"},sl={class:"header-ctrl hidden lg:block"},nl={class:"header-ctrl hidden lg:block"},ol={class:"article-wrapper new"},al={class:"article lg:p24 relative",id:"article"},ll={class:"chat-row row-left"},il={key:0,class:"summary summary-stream mt-6 lg:mt-[24px]"},cl=["innerHTML"],rl={key:1},ul={key:0,class:"error"},dl={key:1,class:"error"},hl={class:"strong"},fl={key:2,class:"error"},pl=["onClick"],_l={key:3,class:"error"},vl={class:"whitespace-pre-wrap"},ml={key:2,class:"chat-small chat-answer"},gl={key:0,class:"failed error text-[#FC5555]"},Cl={key:1},yl={class:"chat-progress"},wl={key:3,class:"chat-small chat-answer"},kl={key:2,class:"task-box"},Al={class:"ask-box"},Fl=["src"],Gt="hi-chat-wrapper",qt=24,Tl={__name:"HiChatV2",emits:["open:menu","update:loading"],setup(a,{expose:p,emit:C}){const{useAIFeature:B}=bn(),u=new Ns(10),{downloadUrl:b}=Ja(),{CUR_CHAT_FILE_INFO:S,CUR_HIS_LIST_COUNT:L,convertProgressV2:x,IS_PC:Z,currentPDFFile:d}=Rt(),{UPDATE_CUR_CHAT_FILE_INFO:_}=Ps(),{getFileById:ae}=Xn(),{t:v}=gt(),m=()=>{k.value=!1},w=()=>{N(Se)},P=c(""),E=se(()=>Q.value.filter(t=>t.type==="task"&&t.task.taskSate.converting!=="taskError"&&t.task.progress>=0&&t.task.progress<100).length>0),k=c(!1);let Se={};const le=async t=>
1{pt(t,"describe");const n=pt(t,"pageID"),{file_id:h}=ce;t.file_id=h,t.progress=0;const F=Ce(t,_e.value);k.value=!1;const M=yn.find(V=>V.pageID===n);Se={file_id:h,chatTaskId:F,pageInfo:M},N(Se),await ct(),We()},N=async({file_id:t,chatTaskId:n,pageInfo:h})=>{const F=rt(n);F.error="",await ee.dispatch("handleConvertChat",{file_id:t,chatTaskId:n,pageInfo:h}).then(M=>{const{multipleId:V}=M,he=`${In}document/download-doc-bulk?multi_id=${V}`;b(he),He(v("CHATPDF.prompt.success.downloadSuccess"),"success")}).catch(M=>{Te(M,F)})},me=()=>{k.value=!1},rt=t=>At(Q.value,{id:t,type:"task"});Ae(()=>x.value,t=>{t.forEach(n=>{const{chatTaskId:h}=n,F=oo(Q.value,{id:h,type:"task"}),M=Q.value[F];pt(M,"type")&&ao(Q.value[F],"task.progress",n.progress)})},{deep:!0});function Ce(t,n){const{describe:h,taskSate:F}=t,M=new Date().getTime(),V=l("answer",M),{converting:U}=F,he={type:"question",isLoading:"true",state:et.normal,text:h,id:l("question",M),lang:n};Q.value.push(he),ht.value=he;const ne={type:"task",isLoading:"true",state:et.normal,text:U,task:t,id:V,error:"",lang:_e.value};return Q.value.push(ne),G.value=ne,V}const K=()=>{ps.value.length&&(k.value=!k.value)},{checkLogin:xe}=Es(),{getLangTextByLanCode:Ee}=Ra(),{$bus:I}=Mt(),{getMore:vt}=Yn(),mt=ls(),ee=wt(),$e=se(()=>De.value||z.value||re.value||L.value===0||E.value||!ve.value),Fe=C,Le=c(!1),Me=t=>{Le.value=t},ot=t=>{Fe("open:menu",t)},Ge=()=>{window.$sensorsApi.track("chatpdf_stop",{});const{conversation_id:t}=ce;wn({conversation_id:t}).then(n=>{re.value&&(_s(),I.emit("error:reload",t)),ee.commit("UPDATE_ANALYSES_STATE",!1),re.value=!1}).catch(n=>{})},g=()=>{Q.value.length=0,r.value=new j},O=()=>{s.value=new j};se(()=>ee.getters.summary);const z=se(()=>Q.value.filter(t=>t.state==="thinking").length>0),De=se(()=>Q.value.filter(t=>t.state===et.thinking).length>=1),re=c(!1),Be=c(!1),Ne=se(()=>ee.getters.fileList[0]),Q=c([]),Oe=(t=!1)=>{ee.commit("SET_LOADING_STATUS",t)},ce=Ft({conversation_id:"",file_id:""}),Ue=new cs({pageSize:40,total:100}),at=({conversation_id:t,file_id:n,isForceReload:h},F=!1)=>{F?(g(),O(),Ue.reset(),re.value=!0):Be.value=!0,Oe(!0);const{pageInfo:M}=Ue;kn({conversation_id:t,page_size:M.page_size,page:M.page}).then(async V=>{const{list:U,total:he,page:ne}=V;Ue.updatePageInfo({total:he,page:ne+1});const ke=U.find(W=>W.ctype==="summarize"),we=V.list.filter(W=>W.ctype==="chatpdf");if(we.length?it(we,n):u.set(n,{...u.get(n),chatpdf:[]}),ke&&ce.conversation_id!==t||h||d.value?.uid){const{answer:W}=ke;de.value=!0,F&&(s.value=new j),s.value.append(W),u.set(n,{...u.get(n),summarize:s.value})}F&&(ce.conversation_id=t,ce.file_id=n),await ct(),Z.value&&bt(Gt,qt)}).catch(V=>{}).finally(()=>{Oe(!1),re.value=!1,Be.value=!1})},lt=(t,n)=>{const{answer:h,question:F,record_id:M,upvote_type:V,feedback_text:U,feedback_reasons:he}=t,ne=new Date().getTime(),ke={type:"question",isLoading:"true",state:et.normal,text:F,id:l("question",ne),lang:_e.value};Q.value.push(ke),ht.value=ke;let we="none";V===1?we="like":V===2&&(we="dislike");const W={type:"answer",isLoading:"true",state:et.normal,text:h,textConvert:h,id:l("answer",ne),error:"",lang:_e.value,record_id:M,ratingState:we,...U||he?{feedback:{text:U||"",reasons:he||[]}}:{}};Q.value.push(W),G.value=W,u.set(n,{...u.get(n),chatpdf:Cs(Q.value)})},it=(t,n)=>{for(let h=0;h<t.length;h++){const F=t[h];lt(F,n)}};Lt(()=>{I.off("oss:uploadFailed"),I.off("clear:all"),I.off("get:his-detail",at),I.off("get:share-detail"),I.off("
1clear:chat-list",g),I.off("export:chat",ze),I.off("share:chat"),I.off("open:more"),ee.commit("CLEAR_CUR_PDF_INFO"),u.cache=null}),Ht(()=>{I.on("oss:uploadFailed",()=>{I.emit("his:error-reload")}),I.on("clear:chat-all",()=>{g(),O()}),I.on("clear:chat-list",g),I.on("export:chat",ze),I.on("get:his-detail",({conversation_id:n,file_id:h,isForceReload:F})=>{at({conversation_id:n,file_id:h,isForceReload:F},!0)}),I.on("get:share-detail",({summary:n})=>{g(),O(),s.value=new j,s.value.append(n)}),I.on("share:chat",()=>{Me(!0)});const{share_id:t}=mt.currentRoute.value.query;t&&vn({share_id:t}).then(n=>{const{download_url:h,summary:F,file_id:M,file_name:V}=n;ce.file_id=M,F&&s.value.append(F);let U=h;const he=/(http):\/\/([\w.]+\/?)\S*/ig;h.match(he)&&(U=h.replace("http","https")),te(U,t,{file_id:M,fileName:V,summary:F})}).catch(n=>{})});let H=null;const te=(t,n,{file_id:h,fileName:F,summary:M})=>{H=new AbortController;const V={signal:H.signal};setTimeout(()=>H.abort(),1e3*90),fetch(t,V).then(U=>U.blob()).then(U=>{const he=new Blob([U],{type:"application/pdf"});ee.commit("SET_CUR_PDF_INFO",{fileSize:he.size}),ee.commit("SET_CUR_PDF_AI_FILE",{data:he,type:"new",fileId:h}),I.emit("add:item-share",{file_id:h,isShare:!0,title:F,data:he,summary:M}),mn({share_id:n}).then(ne=>{const{conversation_id:ke}=ne;I.emit("update:new-file"({conversation_id:ke,file_id:h}))}).catch(ne=>{const{code:ke}=ne;tt(ke)}).finally(()=>{})}).catch(()=>{He(v("CHATPDF.chat.error.timeout"),"error")}).finally(()=>{X.value&&Ot()})},ue=()=>{if(Be.value||Ue.isEnd||re.value)return;const{conversation_id:t,file_id:n}=ce;at({conversation_id:t,file_id:n})},ge=c(!1),ye=c(null);xt(()=>{je=window.$sensorsApi,I.on("open:more",()=>{ge.value=!0}),document.addEventListener("click",t=>{ye.value&&!ye.value.contains(t.target)&&(ge.value=!1)})});const Ye=()=>{const t=document.querySelector(".stream-box");return t?t.innerText.replace(` 2`,"\r"):""},ut=()=>{let t="";const n=Q.value.filter(h=>h.type!=="task");for(let h=0;h<n.length;h++){const F=Q.value[h],M=(F.type==="question"?"Q: ":"A: ")+F.text+`\r 3`+(F.type==="answer"?"\r":"");t+=M}return t},ze=()=>{ge.value=!1;const t=Ye(),n=ut();!t&&!n||gn(t+n,400,Xe.value?.title)},Ke=()=>{ge.value=!1,g(),O(),je.track("chatpdf_resetchat",{})},dt=t=>{P.value=t.value,je.track("chatpdf_language",{type:t.label})},Xe=se(()=>S.value),pe=se(()=>pt(ee.getters.fileList,"[0].ossInfo.file_id")),ve=c(""),ht=c("");function Ct(t){const{id:n}=t,h=l("question",n.slice(1)),F=At(Q.value,{id:h}),{text:M}=F;t.state=et.thinking,t.error="",setTimeout(()=>{$t({question:M,conversation_id:ce.conversation_id,answerItem:t})},1500)}function l(t,n){return(t==="question"?"q":"a")+n}function y(t,n=""){return R(t,n)}function R(t,n){const h=new Date().getTime(),F={type:"question",isLoading:"true",state:et.normal,text:t,id:l("question",h),lang:n};Q.value.push(F),ht.value=F;const M={type:"answer",isLoading:"true",state:et.normal,text:"",textConvert:"",id:l("answer",h),error:"",lang:_e.value,ratingState:"none"};return Q.value.push(M),G.value=M,h}const G=c(""),de=c(!1);on(()=>{de.value&&Ot(ce.conversation_id)});const _e=se(()=>ee.getters.AI_LANG),Qe=/[\s\n]/g,qe=()=>{if(!ve.value||ve.value===` 4`||document.activeElement.id!=="textArea01")return;const t=document.querySelector("#textArea01");t.setRangeText(`\r 5`),t.setRangeText(""),t.focus(),ve.value=t.value;const n=ve.value.replaceAll(Qe,"");if(t.selectionStart>=n.length){const h=t.value.length;t.setSelectionRange(h,h)}};function Je(){if(ve.value.replaceAll(Qe,"")&&!De.value){const n=l("answer",y(ve.value,_e.value)),h=At(Q.value,F=>{if(F.id===n&&F.type==="answer")return!0});$t({question:ve.value,conversationId:ce.conversation_id,answerItem:h})}ve.value=""}const yt=c(null);function We(){yt.value.scrollToBottom()}let je=null;function j(){this._strings=new Array}j.prototype.append=function(t){this._strings.push(t)},j.prototype.toString=function(){return this._strings.join("")};const X=se(()=>s.value.toString()),s=c(new j),r=c(new j),T=()=>{re.value=!1,Q.value.filter(n=>n.state==="thinking").forEach(n=>{n.state="normal"})};function D(t,n,h,F,M="",V=!1){let U=!0;ee.commit("UPDATE_ANALYSES_STATE",!0);const he=localStorage.getItem("hipdf-token");let ne=new no.exports.EventSourcePolyfill(`${Tn}${t}?conversation_id=${n}&policy_name=${ee.getters.isControlGroup?"control":"experiment"}`,{withCredentials:!0,heartbeatTimeout:3*60*1e3,Lang:"zh-cn",headers:{Token:he,authorization:"Basic Njg4M2VmNDc5ZjZjOTFiMWUxM2ZjYmVkNDhmYjk0ZGM6Y2QyZWI0ZDM1MTNjM2QwNDgzYTMxZGEwYzBkNDhiOGU="}});ne.addEventListener("message",function(ke){h(ke.data),U&&V&&Ve(M,n),U&&je.track("chatpdf_ask",{chatpdf_ask_result:"success"}),U=!1},!1),ne.addEventListener("output_type",function(ke){}
5,!1),ne.addEventListener("error",function(ke){ne.close(),T(),ee.commit("UPDATE_ANALYSES_STATE",!1);const{code:we}=JSON.parse(ke.data||"{}");if(we!==11014){if(we&&we!==200&&je.track("chatpdf _ask",{chatpdf_ask_result:Sn(we)}),!we){zs(),We(),F&&F(n,M,V);return}window.clearTimeout(be),tt(we),I.emit("error:reload",n)}},!1),ne.addEventListener("close",function(ke){re.value=!1,ne.close()},!1)}const q=t=>{s.value.append(t)},Y=t=>{Ot(t)};let be=null;const Ve=(t,n)=>{be=setTimeout(()=>{const h=ae(t);h&&(h.streamSumState="finished",h.conversationId=n,_({title:h.name,file_id:t}))},1500)},Te=(t,n)=>{if(t.code==="ERR_NETWORK"){n.error="ERR_NETWORK",n.state=et.surprise;return}else t.code==="ECONNABORTED"?(n.error="ERR_TIMEOUT",n.state=et.cry):t==="TaskError"?(n.error="ERR_SOMETHING",n.state=et.cry,n.task.taskSate.converting="taskError"):(n.error="ERR_SOMETHING",n.state=et.cry)},$t=async({question:t,conversationId:n,answerItem:h})=>{if(!await vt())return;const F=Ee(hs.value);h.state="thinking",An({type:"chatpdf",message:t,file_id:ce.file_id,conversation_id:n,with_language:F}).then(M=>{const{conversation_id:V}=M;V&&(ce.conversation_id=V,r.value=new j,D("/v2/stream/result",n||V,U=>{r.value.append(U);const he=r.value.toString();h.text=he,h.textConvert=he},()=>{h.state="normal",u.set(ce.file_id,{...u.get(ce.file_id),chatpdf:Cs(Q.value)}),h.question=t,xn({conversation_id:n||V}).then(U=>{h.record_id=U.record_id})}),I.emit("move:hist-item-top",n),We(),Z.value&&bt(Gt,qt))}).catch(M=>{h.state="cry",Te(M,h);const{code:V,status:U}=M;tt(V||U,!1)})},kt=()=>{re.value=!1,I.emit("clear:canvas")},Ot=t=>{de.value=!1,Zs(t)},Zs=t=>{let n="";const h=document.querySelector(".question");h&&h.addEventListener("click",function(F){if(F.target.tagName==="LI"||F.target.tagName==="A"){if(z.value)return;const M=F.target.innerText,V=l("answer",y(M,_e.value));n=At(Q.value,U=>{if(U.id===V&&U.type==="answer")return!0}),xe(()=>{$t({question:M,conversationId:t||ce.conversation_id,answerItem:n}),We()})}})},hs=se(()=>ee.getters.AI_LANG),Os=t=>{const n=ee.getters.fileList[0];if(!n)return;const{fsm:h}=n;h&&h.goto(t)},Us=(t,n)=>{const h=Ee(hs.value),F={file_id:t,type:"html-hipdf",with_language:h};n&&(F.conversation_id=n);const M=Xt();$n(F).then(V=>{const{conversation_id:U}=V;ce.conversation_id=U,ce.file_id=t||pe.value,re.value=!0,I.emit("update:new-file",ce),D("/v2/stream/result",U,q,Y,t,!0)}).catch(V=>{const{code:U,status:he}=V;if(Os("convertError"),U*1===11003){const ne=Ne.value,we=Xt().diff(M,"second");window.$sensorsApi.track("Upload_file",{result:"excharacterfail",FileFormat:"pdf",FileSize:as(ne?.size,{base:2,standard:"jedec"})||"",FileTime:`${we}s`,OpenFileSize:is(ne?.size)})}I.emit("error:reload",n),I.emit("set:loading",!1),tt(U||he,!1),kt()})},fs=t=>{re.value=!0,ee.commit("SET_AI_STATUS","analyses"),g(),O(),Us(t)},zs=async()=>{if(!ee.getters.isControlGroup&&!await B()){I.emit("error:reload",null),I.emit("set:loading",!1),tt(11003,!1),kt();return}},Qs=se(()=>ee.getters.currentPDFInfo),ps=se(()=>ee.getters.CUR_HIS_LIST),_s=()=>{I.emit("set:loading",!1)};Ae(()=>[ee.getters.fileList,Qs.value,ee.getters.OSSUploadFinished],t=>{const n=t[0][0],h=t[1].numPages,F=t[2];if(!n)return;const{ossInfo:M}=n,{isCheckOCR:V}=n,U=pt(n,"fsm.state"),he=V?"ocrChecking":"ossSuccessful";if(!F)return;const{file_id:ne}=M,ke=ps.value.find(we=>we.file_id===ne);h>0&&!ke&&ne&&U===he&&(V?Cn({file_ids:[ne]}).then(we=>{pt(we,"[0].scanned")===1?(tt("NEED_OCR"),_s(),n.fsm.ocrFile(),I.emit("clear:canvas"),I.emit("error:reload")):(n.fsm.ocrPassed(),fs(ne))}):fs(ne)),Z.value&&bt(Gt,qt)},{deep:!0,immediate:!0}),Ae(()=>[re.value],t=>{const h=t[0];Fe("update:loading",h)}),Ae(ve,async t=>{await ct(),t?document.querySelector(".hi-chat-wrapper").style.paddingBottom=Z.value?"296px":"276px":document.querySelector(".hi-chat-wrapper").style.paddingBottom=Z.value?"104px":"84px"},{immediate:!0});const Ws=async t=>{const{item:n,rating:h,feedback:F}=t,M={Type:h==="dislike"?"Bad":"Great",UserRequestMessage:n.question,Message:n.text,Mode:"ChatwithPDF",file_id:ce.file_id,reply_language:P.value!==""?P.value:"en"};h==="dislike"&&F&&(M.bad_type=F.reasons,M.bad_cause=F.text),je?.track("AIChat_AIRate",M);try{const V=At(Q.value,{id:n.id});V&&(V.ratingState=h,F&&(V.feedback=F));const U={record_id:n.record_id,upvote_type:h==="like"?1:h==="dislike"?2:0,feedback_text:F?.text||"",feedback_reasons:F?.reasons||[]};await Fn(U)}catch(V){console.error("è¯åæäº¤å¤±è´¥:",V);const U=At(Q.value,{id:n.id});U&&(U.ratingState="none",delete U.feedback),He(v("CHATPDF.chat.error.rateFailed"),"error")}},Gs=t=>{window.$sensorsApi&&window.$sensorsApi.track("AIChat_AIRate",{Type:"Copy",UserRequestMessage:t.question,Message:t.text,Mode:"ChatwithPDF",file_id:ce.f
5ile_id,reply_language:P.value!==""?P.value:"en"})};return p({handleCancel:Ge}),(t,n)=>{const h=As,F=Et,M=tn,V=rn,U=ga,he=us,ne=ca,ke=un,we=zo;return o(),i(Re,null,[e("div",ja,[e("div",{class:"chat-box",onClick:m},[A(Z)?(o(),i("div",Ya,[e("div",Ka,[e("span",Xa,$(A(v)("CHATPDF.chat.title")),1)]),e("div",el,[e("span",tl,[f(h,{onChange:dt})]),e("span",sl,[f(F,{class:"box-item",effect:"dark",content:t.$t("CHATPDF.chat.toolTips.exportChat"),placement:"bottom"},{default:oe(()=>[f(A(Yt),{onClick:ze})]),_:1},8,["content"])]),e("span",nl,[f(F,{class:"box-item",effect:"dark",content:t.$t("CHATPDF.chat.toolTips.resetChat"),placement:"bottom"},{default:oe(()=>[f(A(ts),{onClick:n[0]||(n[0]=W=>Ke())})]),_:1},8,["content"])]),e("span",{class:"header-ctrl block lg:hidden mr-[16px] text-ellipsis",onClick:n[1]||(n[1]=W=>ot("lang"))},[f(A(ba))]),e("span",{class:"header-ctrl block lg:hidden",onClick:n[2]||(n[2]=W=>ot("ctrl"))},[f(A(Aa))])])])):J("",!0),!A(Z)&&ge.value?(o(),i("div",{key:1,class:"more",ref_key:"moreRef",ref:ye},[e("div",{class:"more-item",onClick:ze},[f(A(Yt)),_t(" "+$(t.$t("CHATPDF.chat.toolTips.exportChat")),1)]),e("div",{class:"more-item",onClick:Ke},[f(A(ts)),_t(" "+$(t.$t("CHATPDF.chat.toolTips.resetChat")),1)])],512)):J("",!0),e("div",ol,[e("article",al,[f(he,{class:"hi-chat-wrapper",page:A(Ue).page,isEnd:A(Ue).isEnd,ref_key:"scrollBase",ref:yt,isLoadingSummary:re.value,isLoading:Be.value,"onScroll:end":ue,isEmpty:!(X.value&&Q.value.length)},{default:oe(()=>[e("div",ll,[X.value!==""?(o(),i("div",il,[re.value?(o(),Ie(M,{key:0})):J("",!0),e("div",{innerHTML:X.value},null,8,cl)])):J("",!0)]),(o(!0),i(Re,null,nt(Q.value,(W,qs)=>(o(),i("div",{class:st(["chat-row",W.type==="answer"||W.type==="task"?"row-left":"row-right"]),key:qs},[W.type!=="task"?(o(),i("div",{key:0,class:st(["chat-small",W.type==="answer"?"chat-answer":"chat-question"])},[W.state==="thinking"?(o(),Ie(M,{key:0})):J("",!0),W.type==="answer"?(o(),i("div",rl,[W.error==="ERR_TIMEOUT"?(o(),i("div",ul,$(t.$t("CHATPDF.chat.error.serviceBuzy")),1)):J("",!0),W.error==="ERR_LIMIT500"?(o(),i("div",dl,[e("span",hl,$(t.$t("CHATPDF.chat.description.tokensPerMonth",{tokensCount:2e7})),1),_t($(t.$t("CHATPDF.chat.description.haveExceedLimit")),1)])):J("",!0),W.error==="ERR_NETWORK"?(o(),i("div",fl,[e("div",null,$(t.$t("CHATPDF.chat.error.networkError")),1),e("div",{class:"refresh",onClick:ru=>Ct(W)},[f(A($s))],8,pl)])):J("",!0),W.error==="ERR_SOMETHING"?(o(),i("div",_l,[e("div",null,$(t.$t("CHATPDF.chat.error.someError")),1)])):J("",!0)])):J("",!0),e("span",vl,$(W.text),1)],2)):J("",!0),W.type==="answer"&&!W.error?(o(),Ie(V,{key:1,answerText:W.textConvert||W.text,answerItem:W,ratingState:W.ratingState||"none",showActions:!0,onRate:Ws,onCopy:Gs},null,8,["answerText","answerItem","ratingState"])):J("",!0),W.type==="task"&&W.task.progress<100?(o(),i("div",ml,[W.error?(o(),i("span",gl,$(t.$t("CHATPDF.chat.error.fileFailed")),1)):(o(),i("span",Cl,[e("span",null,$(W.text),1),_t(),e("span",yl,$(W.task.progress)+"%",1)])),f(U,{error:W.error,onRetry:w},null,8,["error"])])):J("",!0),W.type==="task"&&W.task.progress===100?(o(),i("div",wl,[e("span",null,[e("span",null,$(t.$t("CHATPDF.prompt.success.fileConvertSuccess")),1)])])):J("",!0)],2))),128))]),_:1},8,["page","isEnd","isLoadingSummary","isLoading","isEmpty"])])]),k.value&&A(Z)?(o(),i("div",kl,[f(ne,{onChange:le})])):J("",!0),f(ne,{show:!A(Z)&&k.value,onChange:le,onClose:me},null,8,["show"]),e("div",Al,[e("span",{class:"tip absolute",onClick:n[3]||(n[3]=ft(W=>K(),["stop"]))},[e("img",{src:A(Fa),width:"24",alt:"prompt"},null,8,Fl)]),f(ke,{modelValue:ve.value,"onUpdate:modelValue":n[4]||(n[4]=W=>ve.value=W),paddingLeft:45,"onEvent:CtrlEnter":qe,"onEvent:Enter":Je},null,8,["modelValue"]),!re.value&&!z.value?(o(),i("span",{key:0,class:st(["send",{disable:$e.value}]),onClick:Je},[f(A(cn))],2)):(o(),i("span",{key:1,class:"stop",onClick:Ge},[f(A(Ha))]))])])]),f(we,{isShow:Le.value,conversationInfo:ce,fileName:Xe.value.title,onClose:n[5]||(n[5]=W=>Me(!1))},null,8,["isShow","conversationInfo","fileName"])],64)}}},Sl=Ze(Tl,[["__scopeId","data-v-b7443bb9"]]);const xl={class:"ai-tools"},$l=["onClick"],bl={__name:"ToolsAIChat",props:{isShowTool:{default:!1},toolsLoc:{default:[100,100]},type:{default:"chat-pdf"}},setup(a){const p=wt(),{$bus:C}=Mt(),B=[{com:dn,text:"Copy",type:["ai-read","chat-pdf"]},{com:hn,text:"Highlight",type:["chat-pdf"]}],u=se(()=>p.getters.CUR_SELECT_TEXT),b=Z=>{S.value=Z;const d=B[Z].text;if(d.toLowerCase()==="copy"){const _=u.value;bs(_)}else C.emit("select:fn",d);S.value=-1},S=c(-1),L=a,x=c(!1);return Ae(()=>L.isShowTool,Z=>{x.value=Z},{immediate:!0}),(Z,d)=>{const _=Et;return x.value?(o(),i("div",{key:0,class:"ai-tool-wrapper",style:es({left:`${a.toolsLoc[0]}px`,top:`${a.toolsLoc[1]}px`})},[e("ul",xl,[(o(),i(Re,null,nt(B,(ae,v)=>e("li",{class:st(["item",{active:S.value===v}]),key:v,onClick:m=>b(v)},[f(_,{class:"item",effect:"dark",content:ae.text,placement:"bottom"},{default:oe(()=>[(o(),Ie(Ss(ae.com)))]),_:2},1032,["content"])],10,$l)),64))])],4)):J("",!0)}}},Il=Ze(bl,[["__scopeId","data-v-61572840"]]);const Pl={class:"tool-box"},El={class:"tools-bottom"},Dl=["id"],Ll=["href"],Hl=["width","height"],Rl=e("canvas",null,null,-1),Ml=[Rl],Bl=e("div",{class:"textLayer"},null,-1),Nl={__name:"PDFViewerPublicAIChat",props:{layout:{}},emits:["update:loading"],setup(a,{expose:p,emit:C}){const B=new Ns(10),{IS_PC:u}=Rt(),{getRenderPDF:b,loadPage:S,createEmptyPage:L,initPDFPageViewport:x}=eo(),Z=a,{getCurJumpIndex:d}=to(),_=c(null),ae=c(null),v=wt(),m=c(null),{$bus:w,$sensorsApi:P}=Mt(),E=c(!1),k=c(!1),Se=c(!1),le=c(Pn.Simple),N=c([]),me=c(null),rt=Ft({width:800,height:800}),Ce=Ft({width:800,height:800}),K=c(!1),xe=c(!1);let Ee=null;const I=c(1),vt=C;Ht(async()=>{await sn(En),mt()});const mt=()=>{w.on("error:reload",ee),w.on("set:loading",s=>{K.value=s}),w.on("click-side-bar",Ye),w.on("his:get-download",Be),w.on("oss:uploadFailed",()=>{K.value=!1}),w.on("tools-view",at),w.on("RESET:FILE_INFO",$e),w.on("clear:canvas",$e),w.on("get:cloud-disk-file",Fe),w.on("render:reset",Oe)};Lt(()=>{w.off("oss:uploadFailed"),w.off("error:reload",ee),w.off("set:loading"),w.off("his:get-download",Be),w.off("click-side-bar",Ye),w.off("tools-view",at),w.off("RESET:FILE_INFO",$e),w.off("clear:canvas",$e),w.off("get:cloud-disk-file",Fe),w.off("render:reset",Oe),B.cache=null,m.value.removeEventListener("scroll",ze),window.removeEventListener("resize",ot)});const ee=()=>{K.value=!1,De.value=!1},$e=function(){N.value.length=0,K.value=!1,v.commit("SET_PDF_LIST",[]),je(0)},Fe=s=>{K.value=!1};let Le=c(1);const Me=()=>{window.addEventListener("resize",ot)},ot=()=>{g(Le.value)};let Ge=null;const g=Ut(s=>{O(s),l(pe.instance,I.value,!0,!0),clearTimeout(Ge),Ge=setTimeout(()=>{it(I.value,!0)},0)},150),O=s=>{if(!u.value)return;const{leftWrapper:r,rightWrapper:T,minLeftWidth:D}=Z.layout,q=document.getElementsByClassName("need-toggle")[0].classList,Y=d
5ocument.getElementsByClassName("left-plus")[0].getBoundingClientRect().width;q.contains("hidden")?T.style.width=(document.body.clientWidth-Y)/2+"px":(r.style.width=D/s+"px",T.style.width=(document.body.clientWidth-Y-D/s)/2+"px")},z=function(s){v.commit("SET_LOADING_STATUS",s)},De=c(!1),re=(s,r="history",T="")=>{De.value=!0,Ln(s).then(D=>{const q=new Blob([D],{type:"application/pdf"});v.state.pdf.curPDFInfo.fileSize=q.size,v.commit("SET_CUR_PDF_AI_FILE",{data:q,type:r,fileId:T}),B.set(T,{...B.get(T),data:q,type:r,fileId:T})}).catch(()=>{const D="File download failed";K.value=!1,$e(),He(D,"error")}).finally(()=>{De.value=!1})},Be=s=>{const r=B.get(s);_.value.resetScale(),r?(v.state.pdf.curPDFInfo.fileSize=r.data.size,v.commit("SET_CUR_PDF_AI_FILE",{data:r.data,type:r.type,fid:r.fileId})):(z(!0),K.value=!0,Dn({file_id:s}).then(T=>{let{download_url:D}=T;D||(D=T),re(D,"history",s)}).catch(T=>{const{code:D}=T;tt(D),K.value=!1}).finally(()=>{z(!1)}))},Ne=c([0,0]),Q=c(!1);xt(()=>{Xe(),ut(),Me(),ae.value,Le.value=window.devicePixelRatio,Le.value!==1&&O(Le.value),document.body.click=function(){w.emit("sideView:canvas",()=>{K.value=!1})}});const Oe=s=>{s===1&&_.value.resetScale(),te(s)};let ce=null,Ue=null;function at(s){const{ctrl:r,value:T,page:D}=s;if(["min","plus"].includes(r)&&(xe.value=!0,window.clearTimeout(Ee),Ee=setTimeout(()=>{xe.value=!1},300)),T){clearTimeout(ce),ce=window.setTimeout(()=>{lt=!0,te(T)},200);return}const q=d(s,I.value,N.value.length);r&&(lt=!0),r==="jump"&&(I.value=D*1),["next","preview"].includes(r)?I.value=q*1:["first","last"].includes(r)&&(I.value=D),clearTimeout(Ue),Ue=setTimeout(()=>{it(q>0?q:0)},50),l(pe.instance,q)}let lt=!1;const it=(s,r=!1)=>{let T=document.querySelector(`#num${s>0?s-1:0}`);T||j(s);const D=pt(T,"offsetTop");document.querySelector(".pdf-list").scrollTop=D,!r&&H()},H=Ut(()=>{lt=!1},270),te=s=>{const r=y(pe.instance,I.value,s);Promise.all(r).then(()=>{it(I.value)})};function ue(){E.value=!1}const ge=se(()=>N.value.length>0);function ye(){ge.value&&(E.value=!0)}function Ye(s){I.value=s.index+1,xe.value=!0,window.clearTimeout(Ee),Ee=setTimeout(()=>{xe.value=!1},500)}function ut(){const s=m.value;s&&s.addEventListener("scroll",ze)}const ze=Ut(s=>{if(lt||xe.value)return;const{scrollTop:r,clientHeight:T,scrollHeight:D}=s.target,q=dt(r,T,D);l(pe.instance||null,q),I.value=q},50),Ke=se(()=>v.getters.CUR_TOOL_SCALE);function dt(s,r,T){let D=1;const q=N.value;let Y=0;const be=s;for(let Ve=0;Ve<q.length;Ve++){const{height:Te}=q[Ve].viewport||{height:800};if(!Te)return;const $t=Te/r;let kt=$t<.4?Te:Te*(1-$t);if(kt=Math.max(kt,0),Y-kt<be&&be<Y+Te+15-kt)return D=Ve+1,be+r>=T&&(D=N.value.length),D;Y+=Te+15}return D}function Xe(){const s=m.value.getBoundingClientRect(),r=Ds(s,{width:1,height:1.4142},50);rt.value={width:Math.trunc(r.width),height:Math.trunc(r.height)},Ce.value=rt,v.commit("SET_CANVAS_RECT",Ce)}let pe={instance:null,count:0};const ve=c(null),ht=s=>{for(let r=0;r<s;r++){let T=L(r);N.value.push(T)}},Ct=s=>{const r=s-1,{height:T,width:D}=ae.value.getBoundingClientRect(),q=[r],Y=N.value[r]||{viewPort:{with:D-30,height:T}};if(!Y)return;const{height:be}=Y.viewport||{height:800};let Ve=Math.ceil(T/be)+1;Ve=Math.min(Ve,2),Ve=Math.max(3,Ve);for(let Te=r-Ve;Te<r;Te++)Te>=0&&q.push(Te);for(let Te=r+1;Te<r+Ve;Te++)Te<pe.count&&q.push(Te);return q},l=(s,r,T=!1,D=!1)=>{const q=Ct(r);for(let Y=0;Y<q.length;Y++)qe(s,q[Y],Ke.value,T,D);K.value=!1,ct(()=>{R(q)})},y=(s,r,T)=>{const D=Ct(r),q=[];for(let Y=0;Y<D.length;Y++){const be=Je(s,D[Y],T);q.push(be)}return ct(()=>{R(D)}),q},R=s=>{for(let r=0;r<N.value.length;r++)if(!s.includes(r)){const{pdfPage:T}=N.value[r];T&&(N.value[r].pdfPage=null,N.value[r].canvas=null),N.value[r].isInit=!1,N.value[r].renderStatus="init",de(r)}};function G(s){for(;s.firstChild;)s.removeChild(s.firstChild)}const de=s=>{const r=document.querySelector(`#num${s}`);if(!r)return;const T=r?.querySelector(".textLayer")||null;T&&G(T)},_e=c(!1),Qe=s=>{N.value.map((r,T)=>{x({renderPDF:pe.instance,pageNum:T,PDFList:N.value,scale:Ke.value,wrapperRect:s}).then(({viewport:D,finalScale:q,canvas:Y})=>{_e.value=!0,N.value[T].viewport=D,N.value[T].canvas=Y,N.value[T].finalScale=q})})},qe=async(s,r,T=1,D=!1,q=!1)=>
5{if(!s||N.value[r]?.isInit&&!D)return;const Y=ae.value.getBoundingClientRect();try{const be={renderPDF:s,pageNum:r,scale:T,PDFList:N.value,wrapperRect:Y,isScale:q};await S(be,{isNeedTextLayer:!0,isScale:q})}catch{}finally{K.value=!1}ct(()=>{!_e.value&&Qe(Y)})},Je=async(s,r,T=1,D=!0)=>{if(!s)return;const q=ae.value.getBoundingClientRect();try{const Y={renderPDF:s,pageNum:r,scale:T,PDFList:N.value,wrapperRect:q,isScale:D};return S(Y,{isNeedTextLayer:!0,isScale:D})}catch{}finally{K.value=!1}};function yt(s,r){pe.instance=s,pe.count=s.numPages,je(s.numPages,r),We("rendered"),P.track("OpenPDF_OpenPDF",{FilePages:s.numPages})}const We=s=>{const r=v.getters.fileList[0];r&&(r.renderState=s)},je=(s,r)=>{v.state.pdf.curPDFInfo.numPages=s,v.commit("SET_CUR_PDF_INFO",{numPages:s,fileId:r})},j=s=>{Ct(s).forEach(T=>{At(N.value,{id:T})||N.value.push(L(T))})};function X(){N.value.filter(r=>r.pdfPage).forEach(r=>{xs(r.pdfPage).cleanup()}),I.value=1,m.value.scrollTop=0,N.value=[]}return Ae(()=>v.getters.currentPDFAiFile,async s=>{if(s){const{type:r,data:T,fileId:D}=s;if(!T)return;await ct();const q=ae.value.getBoundingClientRect();await b(T,q).then(Y=>{yt(Y,D),ve.value=Y}).catch(Y=>{We("failed"),K.value=!1,v.commit("RESET_FILE_INFO"),je(0)}),(r==="history"||r==="new")&&(X(),ht(pe.count),_e.value=!1,l(pe.instance,1))}},{deep:!0,immediate:!0}),Ae(()=>v.getters.fileList[0],async s=>{if(!s){K.value=!1;return}const{ossInfo:r,streamSumState:T,isCheckOCR:D}=s,q=pt(s,"fsm.state");if(!(D&&!["ocrCheckPassed","converting","convertSuccessful"].includes(q))&&r&&T==="finished"&&(ve.value=await b(s.raw,r.file_id),pe.instance)){X(),ht(pe.count||0);const{instance:Y}=pe;Y&&(await ct(),_e.value=!1,l(Y,1))}},{deep:!0,immediate:!0}),Ae(()=>I,s=>{v.commit("SET_CUR_PAGE",s.value)},{deep:!0}),Ae(()=>v.getters.isUploadingState,s=>{s&&(K.value=!0)}),Ae(()=>[K.value,De.value],s=>{const r=s[0],T=s[0];vt("update:loading",r&&T)}),p({PDFList:N}),(s,r)=>{const T=Il,D=Rs,q=io,Y=so;return o(),i("div",{class:"pdf-view-core",ref_key:"pdfOuterRef",ref:ae,"element-loading-background":"rgba(255, 255, 255, 0.1)"},[e("div",null,[f(T,{isShowTool:Q.value,toolsLoc:Ne.value},null,8,["isShowTool","toolsLoc"])]),e("div",Pl,[k.value?(o(),Ie(D,{key:0,type:le.value,isPreview:!0},null,8,["type"])):J("",!0),(o(),Ie(an,null,{default:oe(()=>[Se.value?(o(),Ie(q,{key:0,PDFList:N.value,canvasRect:Ce,curPage:I.value},null,8,["PDFList","canvasRect","curPage"])):J("",!0)]),_:1}))]),e("div",{class:"pdf-list",ref_key:"PDFListRef",ref:m,onMouseenter:ft(ye,["stop"]),onMouseleave:ft(ue,["stop"])},[ie(e("div",El,[f(Y,{ref_key:"bottomTools",ref:_,count:A(pe).count,curPage:I.value,PDFList:N.value,canvasRect:Ce},null,8,["count","curPage","PDFList","canvasRect"])],512),[[fe,E.value]]),e("div",{class:"list-center",ref_key:"listCenter",ref:me},[(o(!0),i(Re,null,nt(N.value,(be,Ve)=>(o(),i("div",{class:"page page-render",key:Ve,id:`num${be.id}`},[e("a",{href:`#numSide${be.id}`,style:{cursor:"initial"}},null,8,Ll),e("div",{class:"canvasWrapper",width:be.viewport.width,height:be.viewport.height},Ml,8,Hl),Bl],8,Dl))),128))],512)],544)],512)}}},Vl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJZSURBVHgB7ZmLUQIxEIZ/bUA6MFYAHdx1oB1gB5ZACdgBLdjBYQVgBdCBdKDZYXeSO4OS7B4HI9/MTmYgr30kl2yAK1f+Nzewo/Iy8VJzOWIhdl62LGsvSy/vOANogjMvn16+MmXjZeHlHgNAE58nJkS/PXtxCNaX+uSVJ66z6bQ9qSIvaFucBq+Rz4TbxgaYomdiqzewsZpDW5E5eoBCoOEByPovsCf27ArtEFSzQnDzGP3hENZHAyMkbKjj3JDZsOTgEJRQh9MUIWxK4l3iOpcxQjgVh6tDsERpJ6UKgMcU4xWtB9kZFihHowAhG0d2KLlocM1WqVXARX1kecHC+oBegXgus5xGEvsT6LBQoEJYC1kNcre/FBYKEGLQqvvHbaJyzeUbzgeZy4+ISCkglZY4Hz64rI+pLMcGbfwDdiHkkBHW8gW0OExZKTBCxkK2GvQkfd3iwkkpsOPS9DyuJE4OtPhNgTv8Tfdu2xUrHJfb7h8pBdZc1rBhCz33h/pKKbDk8pht9AH73NJv8gA9NZfrYypbHiWskFCtj20g34IKw0ORcNCgh7bRVy6fMTxyG1wiA/nyaS80WhwU85BsRIPhWEBxsSIvqDMDCuRSX5LO+dEJKdJnQquLQzDeFEo0ia0SHAwTW0KD0ygxRpj8CoaMEC46p0juNujpMBmn12lnsPCGQ/CwadgcghZVfAolRUoWeIX2u0Bfnk3iOoPL+iDrPWKvUPeJibw1RfqJaY6B7h8Oe0X+uhekhCw+g3Lils+sNcJTq0P7oW/HIk+sHzivtM2VKxfLN4LS9HBzrPK6AAAAAElFTkSuQmCC",Zl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Ol=Dt('<rect width="15" height="1" x="5" y="4" fill="#000" rx=".5"></rect><rect width="8" height="1" x="11" y="9" fill="#000" rx=".5"></rect><rect width="8" height="1" x="11" y="14" fill="#000" rx=".5"></rect><rect width="15" height="1" x="5" y="19" fill="#000" rx=".5"></rect><path stroke="#000" stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.5 4 12l3.5 3.5"></path>',5),Ul=[Ol];function zl(a,p){return o(),i("svg",Zl,Ul)}const Ql={render:zl};const Wl={class:"flex flex-col pt-3 px-3 justify-between h-full"},Gl=["onClick"],ql=["src","alt"],Jl={__name:"ChatLeftMenu",emits:["change","toggleMenu"],setup(a,{emit:p}){const C=p,{t:B}=gt(),u=c(0),b=se(()=>[{title:B("CHATPDF.leftMenu.menuItem.chatHistory"),name:"history",url:Vl,tip:B("CHATPDF.leftMenu.toolTips.chatHistory")}]),S=L=>{u.value=L,C("change",b.value[u.value])};return(L,x)=>{const Z=Et;return o(),i("div",Wl,[e("div",null,[(o(!0),i(Re,null,nt(b.value,(d,_)=>(o(),i("div",{class:st(["menu-item w-[32px] h-[32px] mb-6 flex items-center justify-center",{active:_===u.value}]),key:_,onClick:ae=>S(_)},[f(Z,{class:"box-item",effect:"dark",content:d.tip,placement:"right"},{default:oe(()=>[e("img",{class:"w-[20px]",src:d.url,alt:d.tip}
5,null,8,ql)]),_:2},1032,["content"])],10,Gl))),128))]),e("div",{class:"menu-item mb-6 his-menu-new",onClick:x[0]||(x[0]=d=>C("toggleMenu",!1))},[f(A(Ql))])])}}},jl=Ze(Jl,[["__scopeId","data-v-c9d2b42b"]]),Yl={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Kl=e("path",{stroke:"#121212","stroke-linecap":"square","stroke-linejoin":"round",d:"M17 10.2v8.05c0 .23-.042.457-.124.67a1.765 1.765 0 0 1-.352.567c-.15.163-.33.292-.527.38a1.526 1.526 0 0 1-.622.133h-9.75c-.431 0-.844-.184-1.149-.513A1.82 1.82 0 0 1 4 18.25V7.75c0-.464.171-.91.476-1.237A1.568 1.568 0 0 1 5.625 6h6.804"},null,-1),Xl=e("path",{fill:"#121212",d:"M20.807 3.25a.766.766 0 0 0-1.106-.027l-.59.587a.381.381 0 0 0 0 .539l.54.539a.381.381 0 0 0 .54 0l.575-.572a.775.775 0 0 0 .04-1.066ZM17.95 5.11l-7.5 7.485a.375.375 0 0 0-.096.163l-.347 1.033a.162.162 0 0 0 .202.202l1.032-.347a.374.374 0 0 0 .164-.096l7.487-7.5a.374.374 0 0 0 0-.525l-.414-.416a.374.374 0 0 0-.528 0Z"},null,-1),ei=[Kl,Xl];function ti(a,p){return o(),i("svg",Yl,ei)}const si={render:ti},ni={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},oi=e("path",{fill:"#FC5555","fill-rule":"evenodd",d:"M9.767 3a2 2 0 0 0-2 2v1H4a.5.5 0 0 0 0 1h2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7h2a.5.5 0 0 0 0-1h-3.767V5a2 2 0 0 0-2-2H9.767Zm5.466 3V5a1 1 0 0 0-1-1H9.767a1 1 0 0 0-1 1v1h6.466ZM17 7H7v11a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V7Zm-7 2.5a.5.5 0 0 1 1 0v6a.5.5 0 0 1-1 0v-6Zm3.5-.5a.5.5 0 0 0-.5.5v6a.5.5 0 0 0 1 0v-6a.5.5 0 0 0-.5-.5Z","clip-rule":"evenodd"},null,-1),ai=[oi];function li(a,p){return o(),i("svg",ni,ai)}const ii={render:li};const ci={class:"ctrl-item-text"},ri={class:"ctrl-item-text"},ui={__name:"ChatHistoryCtrl",props:{show:{default:!1,type:Boolean}},emits:["ctrl","hide"],setup(a,{emit:p}){const{t:C}=gt(),B=a,u=p,b=L=>{u("ctrl",L),u("hide")},S=c(null);return xt(()=>{document.addEventListener("click",L=>{S.value?.contains(L.target)||u("hide")})}),(L,x)=>ie((o(),i("div",{class:"ctrl-box",ref_key:"ctrlRef",ref:S},[e("div",{class:"ctrl-item",onClick:x[0]||(x[0]=Z=>b("rename"))},[f(A(si)),e("div",ci,$(A(C)("CHATPDF.leftMenu.button.rename")),1)]),e("div",{class:"ctrl-item",onClick:x[1]||(x[1]=Z=>b("del"))},[f(A(ii)),e("div",ri,$(A(C)("CHATPDF.leftMenu.button.delete")),1)])],512)),[[fe,B.show]])}},di=Ze(ui,[["__scopeId","data-v-3d53e1e5"]]),hi={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},fi=e("rect",{width:"16",height:"2",x:"4",y:"11",fill:"#121212",rx:"1"},null,-1),pi=e("rect",{width:"16",height:"2",x:"13",y:"4",fill:"#121212",rx:"1",transform:"rotate(90 13 4)"},null,-1),_i=[fi,pi];function vi(a,p){return o(),i("svg",hi,_i)}const ys={render:vi},mi={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},gi=e("path",{fill:"#000",d:"M7.5 12.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM13.5 12.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0ZM19.5 12.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"},null,-1),Ci=[gi];function yi(a,p){return o(),i("svg",mi,Ci)}const ss={render:yi};const wi={class:"his-header"},ki={class:"new-chat-text"},Ai={class:"his-body"},Fi={class:"his-list"},Ti={class:"his-list-inner"},Si=["onClick","onMouseenter"],xi={key:0,class:"his overflow-hidden"},$i={class:"input"},bi={class:"his time"},Ii={key:1,class:"his-ctrl"},Pi=["onClick"],Ei={class:"his-header"},Di={class:"new-chat-text"},Li={class:"his-list"},Hi={class:"his-list-inner"},Ri=["onClick"],Mi={key:0,class:"his overflow-hidden"},Bi={class:"input"},Ni={class:"his time"},Vi={key:1,class:"his-ctrl"},Zi=["onClick"],Oi={class:"inner-box"},Ui={class:"top"},zi={class:"title"},Qi={class:"desc"},Wi={class:"dialog-footer"},Jt="his-wrapper",jt=16,Gi={__name:"ChatHistory",props:{show:{type:Boolean,default:!1}},emits:["close"],setup(a,{emit:p}){const C=a,{show:B}=os(C),u=p,b=()=>{u("close")},{checkLogin:S}=Es(),{checkAiPages:L}=Is(),x=c(null),Z=()=>{Me.isEnd||re()},d=c([]),_=c(-1),ae=c(-1),v=c(-1),m=c(-1),w=c(-1),P=c(!1),E=wt(),{$bus:k}=Mt(),{t:Se}=gt(),le=se(()=>E.getters.IS_LOADING),N=l=>{m.value=l,ae.value=l,v.value=l},me=()=>{m.value=-1,v.value=-1},rt=l=>{ae.value=l},Ce=()=>{m.value===-1&&(ae.value=-1)},K=()=>{!Fe.value&&me()},{SET_CUR_CHAT_FILE_ID:xe,UPDATE_CUR_CHAT_FILE_INFO:Ee,UPDATE_HIS_LIST:I}=Ps(),{IS_ANALYSES:vt,getFinalToken:mt,isLogin:ee,lastRouterName:$e,IS_PC:Fe,currentPDFFile:Le}=Rt();let Me=null;Ht(()=>{Me=new cs({pageSize:20,total:100}),ot(),re(!0)});const ot=()=>{k.on("error:reload",Be),k.on("his:error-reload",g),k.on("move:hist-item-top",l=>{const y=d.value.findIndex(R=>R.conversation_id===l);pe(y,d.value),_.value=0}),k.on("isLoading",at),k.on("update:new-file",Ne),k.on("add:item-share",z)};Lt(()=>{k.off("isLoading",at),k.off("error:reload",Be),k.off("his:error-reload",g),k.off("update:new-file",Ne),k.off("add:item-share",z)});const Ge=()=>{E.commit("RESET_FILE_INFO")},g=()=>{Ge(),O(!0)},O=(l=!1)=>{Q(d.value[_.value],l)},z=l=>{const{file_id:y}=l,R=d.value.findIndex(G=>G.file_id===y);if(R>-1){const{conversation_id:G}=d.value[R];dt(G,R,d.value),Q(d.value[0])}else lt(l),d.value.length&&ht(l)},De=c(!1),re=(l=!1)=>{De.value=!0,Hn({page:Me.page,page_size:Me.page_size}).then(async y=>{const{conversation_list:R,total:G}=y;if(Me.pageIncrease(),Me.updatePageInfo({total:G}),l&&d.value.length>0){const{file_id:de}=d.value[0],_e=R.findIndex(Qe=>Qe.file_id===de);_e>-1&&(d.value.length=0,pe(_e,R))}if(d.value=d.value.concat(R||[]),d.value.length){_.value=0;const{isShare:de}=d.value[0];l&&!de&&$e.value!=="popular"&&!Le.value?.uid&&Q(d.value[_.value])}await ct(),Fe.value&&bt(Jt,jt)}).catch(y=>{console.log("err get his failed:",y)}).finally(()=>{De.value=!1})};xt(()=>{window.addEventListener("resize",()=>{Oe(),Fe.value&&bt(Jt,jt)}),Oe()});const Be=l=>{l&&zt(d.value,y=>y.conversation_id===l),Ge(),Q(d.value[_.value],!0)},Ne=l=>{const{file_id:y,conversation_id:R}=l,G=d.value.find(de=>de.file_id===y);G&&(G.conversation_id=R)},Q=(l,y=!1)=>
5{if(!l)return;const{conversation_id:R,file_id:G}=l;Ee(l),k.emit("get:his-detail",{conversation_id:R,file_id:G,isForceReload:y}),G&&k.emit("his:get-download",G)},Oe=function(){const l=document.querySelector(".his-list");l&&(l.style.height=window.innerHeight-72-56+"px")},ce=l=>{const y=d.value[l];y.isEditName=!1;const{title:R,conversation_id:G}=y;Mn({title:R,conversation_id:G}).then(de=>{}).catch({})},Ue=l=>Xt.unix(l).format("YYYY/MM/DD"),at=l=>{l?ye():ze()},lt=({title:l,file_id:y,conversation_id:R,isShare:G=!1,data:de=null,summary:_e=""})=>{d.value.find(Qe=>Qe.file_id===y)||(d.value.unshift({title:l,file_id:y,isShare:G,conversation_id:R,last_time:new Date().getTime()/1e3,index:0,data:de,summary:_e}),Oe(),_.value=0,x.value.scrollToTop(),ve(d.value))},it=c(null),H=c("newChat"),te=se(()=>Se("CHATPDF.leftMenu.button."+H.value)),ue=Ft({isLoading:!1,isAnalyzing:!1}),ge=()=>{window.$sensorsApi.track("chatpdf_newchat",{}),S(()=>{it.value.$el.querySelector("input").click()}),!Fe.value&&me()},ye=function(){H.value="loading",ue.isLoading=!0};function Ye(){ue.isLoading=!0,H.value="analyzing"}const ut=function(){H.value="newChat",ue.isLoading=!1},ze=function(){H.value="newChat",ue.isLoading=!1},Ke=()=>{const l=w.value,{conversation_id:y}=d.value[l];y?Bn({conversation_id:y}).then(()=>{zt(d.value,R=>R.conversation_id===y),d.value.length||(k.emit("clear:chat-all"),k.emit("clear:canvas"),E.commit("REST_CUR_FILE_INFO"),E.commit("RESET_CUR_PDF_AI_FILE"),E.commit("RESET_FILE_INFO")),P.value=!1,l===_.value&&Q(d.value[_.value]),l<_.value&&(_.value-=1),_.value>d.value.length-1&&(_.value=Math.min(_.value,d.value.length-1),Q(d.value[_.value]))}).catch(R=>{}):(zt(d.value,R=>R.conversation_id===y),d.value.length||(k.emit("clear:chat-all"),k.emit("clear:canvas"),E.commit("REST_CUR_FILE_INFO"),E.commit("RESET_CUR_PDF_AI_FILE"),E.commit("RESET_FILE_INFO")),P.value=!1)},dt=(l,y,R)=>{Rn({conversation_id:l}).then(()=>{pe(y,R),_.value=0}).catch(G=>{const{code:de}=G;tt(de,E.getters.isVip)})},Xe=(l,y)=>{const R=d.value,{conversation_id:G}=R[y];l==="del"?(w.value=y,P.value=!0):l==="up"?dt(G,y,R):l==="rename"&&(R[y].isEditName=!0)},pe=(l,y)=>{y.forEach((R,G)=>{if(G===l){const de=y.splice(G,1)[0];y.unshift(de)}}),ve(y)},ve=l=>{l.forEach((y,R)=>{y.index=R})},ht=l=>{const{isShare:y}=l;if(y){const{data:R,file_id:G}=l;E.commit("SET_CUR_PDF_AI_FILE",{data:R,type:"history",fileId:G})}},Ct=(l,y)=>{const R=d.value[l],{file_id:G,isEditName:de,isShare:_e}=R;if(de){const qe=document.querySelector(".edit-name");if(qe){const Je=qe.querySelector("input");Je&&Je.focus()}}if(de||l===_.value)return;Ee(R),xe(G),ht(R),G&&k.emit("his:get-download",G);const{conversation_id:Qe}=R;if(l!==_.value&&!le.value)if(!_e)k.emit("get:his-detail",{conversation_id:Qe,file_id:G});else{const{summary:qe}=R;k.emit("get:share-detail",{summary:qe,file_id:G})}y.target.classList.value.indexOf("svg-keep")>-1||(_.value=l)};return Ae(()=>mt.value,l=>{l&&setTimeout(()=>{re(!0)},200)}),Ae(()=>vt.value,l=>{l?Ye():ut()}),Ae(()=>E.getters.fileList[0],(l,y)=>{if(!l)return;const{uid:R}=l,{uid:G}=y||{uid:""};R!==G&&E.commit("SET_PDF_TOTAL_PAGES",0);const{ossInfo:de,streamSumState:_e}=l,Qe=L(()=>{k.emit("set:loading",!1),ut(),E.commit("RESET_FILE_INFO"),k.emit("his:error-reload"),window.$sensorsApi.track("Upload_file",{result:"expagefail",FileFormat:"pdf",FileSize:as(l.size,{base:2,standard:"jedec"})||"",OpenFileSize:is(l.size)})});if(de&&_e==="finished"&&Qe){const{name:qe,ossInfo:Je,conversationId:yt}=l,{file_id:We}=Je||{file_id:""};if(d.value.find(X=>X.file_id===We))return;const j=d.value.find(X=>!X.file_id||X.file_id==="");j?j.file_id=We:(lt({title:qe,file_id:We,conversation_id:yt}),_.value=0)}},{deep:!0}),Ae(()=>d.value,async l=>{I(l),await ct(),Fe.value&&bt(Jt,jt)},{deep:!0}),(l,y)=>{const R=Rs,G=ks,de=Js,_e=js,Qe=Et,qe=di,Je=us,yt=ns,We=Pt,je=Nt;return o(),i(Re,null,[ie(e("div",null,[e("div",wi,[f(R,{ref_key:"uploadRef",ref:it,type:"hidden",accept:"application/pdf"},null,512),e("div",{class:"new-chat",onClick:ge},[e("div",ki,$(te.value),1),ie(f(A(ys),null,null,512),[[fe,!(ue.isLoading||ue.isAnalyzing)]])])]),e("div",Ai,[e("div",Fi,[f(Je,{class:"his-wrapper",ref_key:"scrollBase",ref:x,isLoading:De.value,"onScroll:end":Z},{default:oe(()=>[e("ul",Ti,[(o(!0),i(Re,null,nt(d.value,(j,X)=>(o(),i("li",{class:st(["his-item his",{active:_.value===X||v.value===X,edit:j.isEditName}]),key:X,onClick:s=>Ct(X,s),onMouseenter:s=>rt(X),onMouseleave:Ce},[A(Fe)?(o(),i("div",xi,[ie(e("p",$i,[f(_e,{onSubmit:y[1]||(y[1]=ft(()=>{},["prevent"]))},{default:oe(()=>[f(de,{prop:"name",ref_for:!0,ref:"contentForm",onClick:y[0]||(y[0]=ft(()=>{},["prevent","stop"]))},{default:oe(()=>[f(G,{class:st({"edit-name":j.isEditName}),modelValue:j.title,"onUpdate:modelValue":s=>j.title=s,type:"text",onBlur:s=>ce(X)},null,8,["class","modelValue","onUpdate:modelValue","onBlur"])]),_:2},1536)]),_:2},1024)],512),[[fe,j.isEditName]]),ie(e("p",{class:"his title"},$(j.title),513),[[fe,!j.isEditName]]),e("p",bi,$(Ue(j.last_time)),1)])):J("",!0),A(ee)?(o(),i("div",Ii,[f(Qe,{effect:"dark",content:A(Se)("CHATPDF.leftMenu.toolTips.more"),placement:"top","hide-after":0},{default:oe(()=>[ie(e("div",{class:"ctrl-list",onClick:ft(s=>N(X),["prevent","stop"])},[f(A(ss),{class:"his-ctrl-icon"})],8,Pi),[[fe,!j.isEditName&&(_.value===X||ae.value===X||v.value===X)]])]),_:2},1032,["content"]),f(qe,{onCtrl:s=>Xe(s,X),show:m.value===X,onHide:me},null,8,["onCtrl","show"])])):J("",!0)],42,Si))),128))])]),_:1},8,["isLoading"])])])],512),[[fe,A(Fe)]]),ie(e("div",null,[f(yt,{"model-value":A(B),"with-header":!1,direction:"ltr","before-close":b},{default:oe(()=>[e("div",Ei,[f(R,{ref_key:"uploadRef",ref:it,type:"hidden",accept:"application/pdf"},null,512),e("div",{class:"new-chat",onClick:ge},[e("div",Di,$(te.value),1),ie(f(A(ys),null,null,512),[[fe,!(ue.isLoading||ue.isAnalyzing)]])])]),e("div",{class:"his-body",onClick:K},[e("div",Li,[f(Je,{class:"his-wrapper",ref_key:"scrollBase",ref:x,isLoading:De.value,"onScroll:end":Z},{default:oe(()=>[e("ul",Hi,[(o(!0),i(Re,null,nt(d.value,(j,X)=>(o(),i("li",{class:st(["his-item his",{active:_.value===X||v.value===X,edit:j.isEditName}]),key:X,onClick:s=>Ct(X,s)},[A(Fe)?J("",!0):(o(),i("div",Mi,[ie(e("p",Bi,[f(_e,{onSubmit:y[3]||(y[3]=ft(()=>{},["prevent"]))},{default:oe(()=>[f(de,{prop:"name",ref_for:!0,ref:"contentForm",onClick:y[2]||(y[2]=ft(()=>{},["prevent","stop"]))},{default:oe(()=>[f(G,{class:st({"edit-name":j.isEditName}),modelValue:j.title,"onUpdate:modelValue":s=>j.title=s,type:"text",onBlur:s=>ce(X)},null,8,["class","modelValue","onUpdate:modelValue","onBlur"])]),_:2},1536)]),_:2},1024)],512),[[fe,j.isEditName]]),ie(e("p",{class:"his title"},$(j.title),513),[[fe,!j.isEditName]]),e("p",Ni,$(Ue(j.last_time)),1)])),A(ee)?(o(),i("div",Vi,[ie(e("div",{class:"ctrl-list",onClick:ft(s=>N(X),["prevent","stop"])},[f(A(ss),{class:"his-ctrl-icon"})],8,Zi),[[fe,!j.isEditName&&_.value===X]]),f(qe,{onCtrl:s=>Xe(s,X),show:m.value===X,onHide:me},null,8,["onCtrl","show"])])):J("",!0)],10,Ri))),128))])]),_:1},8,["isLoading"])])])]),_:1},8,["model-value"])],512),[[fe,!A(Fe)]]),e("div",null,[f(je,{class:"dialog-del",modelValue:P.value,"onUpdate:modelValue":y[6]||(y[6]=j=>P.value=j),right:"","z-index":2e4},{default:oe(()=>[e("div",Oi,[e("div",Ui,[e("p",zi,$(l.$t("CHATPDF.deleteChatDialog.deleteChat")),1),e("p",Qi,$(l.$t("CHATPDF.deleteChatDialog.deleteChatHistory")),1)]),e("div",Wi,[f(We,{plain:"",type:"danger",onClick:y[4]||(y[4]=j=>P.value=!1)},{default:oe(()=>[_t($(l.$t("CHATPDF.deleteChatDialog.button.cancel")),1)]),_:1}),f(We,{type:"danger",onClick:y[5]||(y[5]=j=>Ke(l.idx))},{default:oe(()=>[_t($(l.$t("CHATPDF.deleteChatDialog.button.delete")),1)]),_:1})])])]),_:1},8,["modelValue"])])],64)}}},ws=Ze(Gi,[["__scopeId","data-v-8c2e42d1"]]);const Vs=a=>(Tt("data-v-a4bc6217"),a=a(),St(),a),qi={class:"ctrl-box"},Ji=Vs(()=>e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M17 10.2V18.25C17 18.4798 16.958 18.7074 16.8763 18.9197C16.7946 19.132 16.6749 19.3249 16.524 19.4874C16.3732 19.6499 16.194 19.7788 15.9969 19.8668C15.7997 19.9547 15.5884 20 15.375 20H5.625C5.19402 20 4.7807 19.8156 4.47595 19.4874C4.1712 19.1592 4 18.7141 4 18.25V7.75C4 7.28587 4.1712 6.84075 4.47595 6.51256C4.7807 6.18437 5.19402 6 5.625 6H12.4289",stroke:"#7F7F83","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M20.8066 3.25009C20.737 3.17361 20.6526 3.11204 20.5586 3.06909C20.4645 3.02614 20.3627 3.00272 20.2593 3.00022C20.156 2.99773 20.0532 3.01622 19.9571 3.05458C19.8611 3.09295 19.7739 3.15038 19.7007 3.22342L19.1115 3.8098C19.0401 3.88125 19 3.97814 19 4.07917C19 4.18019
519.0401 4.27708 19.1115 4.34854L19.6516 4.88776C19.687 4.92333 19.7291 4.95156 19.7754 4.97082C19.8218 4.99008 19.8715 5 19.9217 5C19.9718 5 20.0215 4.99008 20.0679 4.97082C20.1142 4.95156 20.1563 4.92333 20.1917 4.88776L20.7661 4.31615C21.0566 4.02606 21.0838 3.55352 20.8066 3.25009Z",fill:"#7F7F83"}),e("path",{d:"M17.9503 5.10913L10.4496 12.595C10.4042 12.6403 10.3711 12.6965 10.3536 12.7583L10.0067 13.7914C9.99839 13.8194 9.9978 13.8492 10.005 13.8775C10.0122 13.9059 10.0269 13.9318 10.0476 13.9524C10.0683 13.9731 10.0941 13.9878 10.1225 13.995C10.1508 14.0022 10.1806 14.0016 10.2086 13.9933L11.2412 13.6464C11.3029 13.629 11.3592 13.5959 11.4045 13.5505L18.8919 6.05048C18.9611 5.98048 19 5.88598 19 5.78752C19 5.68905 18.9611 5.59455 18.8919 5.52455L18.4784 5.10913C18.4083 5.03925 18.3134 5 18.2144 5C18.1154 5 18.0204 5.03925 17.9503 5.10913Z",fill:"#7F7F83"})],-1)),ji=[Ji],Yi=Vs(()=>e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10 3C8.89543 3 8 3.89543 8 5V6H6.5H4.5C4.22386 6 4 6.22386 4 6.5C4 6.77614 4.22386 7 4.5 7H6V18.5C6 19.8807 7.11929 21 8.5 21H15.5C16.8807 21 18 19.8807 18 18.5V7H19.5C19.7761 7 20 6.77614 20 6.5C20 6.22386 19.7761 6 19.5 6H16V5C16 3.89543 15.1046 3 14 3H10ZM15 6V5C15 4.44772 14.5523 4 14 4H10C9.44772 4 9 4.44772 9 5V6H15ZM7 7V18.5C7 19.3284 7.67157 20 8.5 20H15.5C16.3284 20 17 19.3284 17 18.5V7L15.5 7H8.5H7ZM11 10C11 9.72386 10.7761 9.5 10.5 9.5C10.2239 9.5 10 9.72386 10 10V16.5C10 16.7761 10.2239 17 10.5 17C10.7761 17 11 16.7761 11 16.5V10ZM13.5 17C13.7761 17 14 16.7761 14 16.5V10C14 9.72386 13.7761 9.5 13.5 9.5C13.2239 9.5 13 9.72386 13 10V16.5C13 16.7761 13.2239 17 13.5 17Z",fill:"#FC5555"})],-1)),Ki=[Yi],Xi={__name:"ChatHistoryCtrlV2",props:{func:{type:Array,default:()=>["edit","del"]}},emits:["ctrl"],setup(a,{emit:p}){const C=p,B=u=>{C("ctrl",u)};return(u,b)=>(o(),i("div",qi,[a.func.includes("edit")?(o(),i("div",{key:0,class:"svg-icon his",onClick:b[0]||(b[0]=S=>B("rename"))},ji)):J("",!0),a.func.includes("del")?(o(),i("div",{key:1,class:"svg-icon svg-keep",onClick:b[1]||(b[1]=S=>B("del"))},Ki)):J("",!0)]))}},ec=Ze(Xi,[["__scopeId","data-v-a4bc6217"]]),tc={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},sc=e("path",{fill:"#000","fill-rule":"evenodd",d:"M6 3.5A2.5 2.5 0 0 0 3.5 6v13A2.5 2.5 0 0 0 6 21.5h8.5a.5.5 0 0 0 .354-.146l5.5-5.5a.5.5 0 0 0 .146-.354V6A2.5 2.5 0 0 0 18 3.5H6Zm13.5 3V6A1.5 1.5 0 0 0 18 4.5H6A1.5 1.5 0 0 0 4.5 6v.5h15Zm0 1h-15V19A1.5 1.5 0 0 0 6 20.5h8v-4a1.5 1.5 0 0 1 1.5-1.5h4V7.5Zm-4 8.5h3.293L15 19.793V16.5a.5.5 0 0 1 .5-.5Z","clip-rule":"evenodd"},null,-1),nc=e("path",{fill:"#000",d:"M7 10.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5ZM7 13.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Z"},null,-1),oc=[sc,nc];function ac(a,p){return o(),i("svg",tc,oc)}const lc={render:ac},ic={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",fill:"none"},cc=Dt('<path fill="url(#a)" stroke="url(#b)" d="M0 .709h9.072v2.597H0z" transform="scale(.99754 1.00245) rotate(45 -2.427 17.118)"></path><path fill="url(#c)" stroke="#E6A500" d="m4.423 17.176 2.123-2.033 2.84 2.821-1.449 1.23a.497.497 0 0 1-.524.075l-2.848-1.272a.502.502 0 0 1-.142-.821Z"></path><path stroke="#000" stroke-linecap="round" d="M12.896 4.5 9.183 8.231a4.016 4.016 0 0 0-1.092 2.05l-.085.43a4.02 4.02 0 0 1-.763 1.676l-.658.849c-.308.399-.273.967.082 1.324l3.322 3.338a.994.994 0 0 0 1.318.083l.845-.66a3.98 3.98 0 0 1 1.667-.768l.43-.086a3.984 3.984 0 0 0 2.038-1.096L20 11.639"></path><defs><linearGradient id="a" x1="5.036" x2="5.036" y1="0" y2="3.597" gradientUnits="userSpaceOnUse"><stop stop-color="#FFC224"></stop><stop offset="1" stop-color="#FFC700"></stop></linearGradient><linearGradient id="b" x1="5.036" x2="5.036" y1="0" y2="3.597" gradientUnits="userSpaceOnUse"><stop stop-color="#FFC224"></stop><stop offset="1" stop-color="#FFC700"></stop></linearGradient><linearGradient id="c" x1="8.307" x2="4.801" y1="16.166" y2="19.656" gradientUnits="userSpaceOnUse"><stop stop-color="#FFC224"></stop><stop offset="1" stop-color="#FFC700"></stop></linearGradient></defs>',4),rc=[cc];function uc(a,p){return o(),i("svg",ic,rc)}const dc={render:uc},hc={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",fill:"none"},fc=e("path",{stroke:"#4D64FD","stroke-linecap":"round",d:"M2 19.5h20"},null,-1),pc=e("path",{fill:"#000",d:"M3.841 16.449c.508 0 .766-.205.932-.715l.85-2.278H9.95l.841 2.278c.167.51.432.715.932.715.53 0 .872-.307.872-.788 0-.176-.03-.322-.099-.519L9.14 6.412c-.235-.613-.66-.912-1.35-.912-.658 0-1.09.3-1.31.905l-3.38 8.774c-.069.19-.099.343-.099.496 0 .482.318.774.841.774Zm2.213-4.343L7.767 7.36h.046l1.712 4.745h-3.47Zm10.694 4.387c1.145 0 2.228-.591 2.698-1.526h.03v.825c.008.438.319.708.759.708.454 0 .765-.277.765-.766v-4.818c0-1.613-1.273-2.657-3.282-2.657-1.538 0-2.766.606-3.198 1.57a1.178 1.178 0 0 0-.129.503c0 .372.28.62.682.62.28 0 .493-.102.644-.328.448-.796 1.039-1.153 1.948-1.153 1.1 0 1.766.591 1.766 1.554v.6l-2.364.13c-1.994.103-3.093.964-3.093 2.365 0 1.417 1.145 2.373 2.774 2.373Zm.425-1.168c-.955 0-1.607-.504-1.607-1.263 0-.73.606-1.212 1.713-1.277l2.152-.139v.737c0 1.095-1 1.942-2.258 1.942Z"},null,-1),_c=[fc,pc];function vc(a,p){return o(),i("svg",hc,_c)}const mc={render:vc};const gc={class:"chat-pdf-note-item gap-4 py-4 px-6 flex self-stretch"},Cc={class:"note-type-icon"},yc={class:"note-wrapper w-full flex flex-col items-start gap-2"},wc={class:"top-info w-full flex items-center gap-2"},kc={class:"author font-bold"},Ac={class:"date font-normal"},Fc={class:"note-content font-normal"},Tc={__name:"ChatPDFNoteItem",props:{note:Object,index:Number},emits:["del:chat-PDF-note-item"],setup(a,{emit:p}){const C=a,B=p,{note:u}=os(C),b=c(!1),S=L=>{L==="del"&&(b.value=!0,Ls({id:C.note.id}).then(x=>{B("del:chat-PDF-note-item",{note:u.value,index:C.index})}).finally(()=>{b.value=!1}))};return(L,x)=>{const Z=ec,d=Vt;return ie((o(),i("li",gc,[e("div",Cc,[A(u).type==="comment"?(o(),Ie(A(lc),{key:0})):A(u).type==="highlight"?(o(),Ie(A(dc),{key:1})):A(u).type==="underline"?(o(),Ie(A(mc),{key:2})):J("",!0)]),e("div",yc,[e("div",wc,[e("div",kc,$(A(u).author),1),e("div",Ac,$(A(u).date),1),f(Z,{func:["del"],
5class:"ml-auto",onCtrl:x[0]||(x[0]=_=>S(_))})]),e("div",Fc,$(A(u).node_content),1)])])),[[d,b.value]])}}},Sc=Ze(Tc,[["__scopeId","data-v-7580e751"]]),xc={xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",fill:"none"},$c=Dt('<mask id="b" fill="#fff"><path d="M19.81 75.116a5.714 5.714 0 0 1-5.715-5.714V12.26a5.714 5.714 0 0 1 5.714-5.714h27.143v15c0 3.87 2.559 6.428 5.715 6.428H68.38v41.43a5.714 5.714 0 0 1-5.715 5.713H19.81Z"></path></mask><path fill="url(#a)" d="m46.952 6.545 1.768-1.768a2.5 2.5 0 0 0-1.768-.732v2.5Zm21.429 21.428h2.5a2.5 2.5 0 0 0-.732-1.767l-1.768 1.768Zm-5.715 47.143v2.5-2.5Zm5.715-5.714h-2.5 2.5ZM46.952 21.545h2.5-2.5Zm5.715 6.428v2.5-2.5ZM14.094 12.26h-2.5 2.5Zm5.714-5.714v2.5-2.5Zm0 68.571v-2.5 2.5ZM46.952 4.045h-5.089v5h5.09v-5Zm-8.482 0H28.292v5H38.47v-5Zm-13.571 0h-5.09v5h5.09v-5Zm-5.09 0a8.214 8.214 0 0 0-8.214 8.214h5a3.214 3.214 0 0 1 3.214-3.214v-5Zm-8.214 8.214v4.286h5v-4.286h-5Zm0 7.143v8.572h5v-8.572h-5Zm0 11.429v8.571h5v-8.571h-5Zm0 11.428v8.572h5v-8.572h-5Zm0 11.429v8.571h5v-8.571h-5Zm0 11.428v4.286h5v-4.286h-5Zm0 4.286a8.214 8.214 0 0 0 8.214 8.214v-5a3.214 3.214 0 0 1-3.214-3.214h-5Zm8.214 8.214h4.018v-5H19.81v5Zm6.697 0h8.035v-5h-8.035v5Zm10.714 0h8.036v-5H37.22v5Zm10.714 0h8.036v-5h-8.036v5Zm10.715 0h4.017v-5H58.65v5Zm4.017 0a8.214 8.214 0 0 0 8.215-8.214h-5a3.214 3.214 0 0 1-3.215 3.214v5Zm8.215-8.214v-5.178h-5v5.178h5Zm0-8.63V50.413h-5v10.357h5Zm0-13.81V36.604h-5v10.358h5Zm0-13.81v-5.178h-5v5.178h5ZM44.452 6.545v5.625h5V6.545h-5Zm0 9.375v5.625h5V15.92h-5Zm0 5.625c0 1.709.39 3.297 1.126 4.66l4.399-2.377c-.31-.575-.525-1.335-.525-2.283h-5Zm3.332 7.274a7.934 7.934 0 0 0 4.883 1.655v-5a2.936 2.936 0 0 1-1.824-.61l-3.06 3.955Zm4.883 1.655h5.892v-5h-5.892v5Zm9.821 0h5.893v-5h-5.893v5ZM45.185 8.313l2.678 2.678 3.536-3.535-2.679-2.679-3.535 3.536Zm4.464 4.464 5.357 5.357L58.54 14.6 53.184 9.24l-3.535 3.536Zm7.143 7.143 5.357 5.357 3.535-3.536-5.357-5.357-3.535 3.536Zm7.142 7.143 2.679 2.678 3.536-3.535-2.679-2.679-3.535 3.536ZM46.953 6.545l3.536-3.536a5 5 0 0 0-3.536-1.464v5Zm21.429 21.428h5a5 5 0 0 0-1.465-3.535l-3.535 3.536Zm-5.715 47.143v5-5Zm5.715-5.714h-5 5ZM46.952 21.545h5-5Zm5.715 6.428v5-5ZM14.094 12.26h-5 5Zm5.714-5.714v5-5Zm0 68.571v-5 5ZM46.952 1.545h-5.089v10h5.09v-10Zm-8.482 0H28.292v10H38.47v-10Zm-13.571 0h-5.09v10h5.09v-10Zm-5.09 0c-5.917 0-10.714 4.797-10.714 10.714h10c0-.394.32-.714.714-.714v-10ZM9.095 12.259v4.286h10v-4.286h-10Zm0 7.143v8.572h10v-8.572h-10Zm0 11.429v8.571h10v-8.571h-10Zm0 11.428v8.572h10v-8.572h-10Zm0 11.429v8.571h10v-8.571h-10Zm0 11.428v4.286h10v-4.286h-10Zm0 4.286c0 5.917 4.797 10.714 10.714 10.714v-10a.714.714 0 0 1-.714-.714h-10ZM19.81 80.116h4.018v-10H19.81v10Zm6.697 0h8.035v-10h-8.035v10Zm10.714 0h8.036v-10H37.22v10Zm10.714 0h8.036v-10h-8.036v10Zm10.715 0h4.017v-10H58.65v10Zm4.017 0c5.918 0 10.715-4.797 10.715-10.714h-10c0 .394-.32.714-.715.714v10Zm10.715-10.714v-5.178h-10v5.178h10Zm0-8.63V50.413h-10v10.357h10Zm0-13.81V36.604h-10v10.358h10Zm0-13.81v-5.178h-10v5.178h10ZM41.952 6.545v5.625h10V6.545h-10Zm0 9.375v5.625h10V15.92h-10Zm0 5.625c0 2.09.477 4.09 1.426 5.848l8.798-4.754c-.098-.18-.224-.527-.224-1.094h-10Zm4.302 9.252a10.434 10.434 0 0 0 6.413 2.177v-10a.562.562 0 0 1-.184-.027.376.376 0 0 1-.111-.06l-6.118 7.91Zm6.413 2.177h5.892v-10h-5.892v10Zm9.821 0h5.893v-10h-5.893v10ZM43.417 10.08l2.678 2.678 7.071-7.071-2.678-2.679-7.071 7.072Zm4.464 4.464 5.357 5.357 7.071-7.071-5.357-5.357-7.071 7.07Zm7.143 7.143 5.357 5.357 7.071-7.071-5.357-5.357-7.071 7.07Zm7.143 7.143 2.678 2.678 7.071-7.071-2.678-2.679-7.071 7.072Z" mask="url(#b)"></path><rect width="5.714" height="11.429" x="26" y="38" fill="#C7D8FF" rx="2.857" style="fill:color(display-p3 .7808 .8472 1);fill-opacity:1;"></rect><rect width="5.714" height="11.429" x="41" y="38" fill="#C7D8FF" rx="2.857" style="fill:color(display-p3 .7808 .8472 1);fill-opacity:1;"></rect><path stroke="#BCCFF7" stroke-linecap="round" stroke-width="3" d="M40 64c4.021-6.182 7.318-8.835 15-12" style="stroke:color(display-p3 .7373 .8118 .9686);stroke-opacity:1;"></path><g filter="url(#c)"><path fill="#D8E5FF" d="m17.415 3.981 2.655 10.99a.3.3 0 0 1-.44.33l-9.82-5.6c-6.528-5.254 4.51-13.442 7.605-5.72Z" style="fill:color(display-p3 .8475 .8966 1);fill-opacity:1;"></path></g>
5<g filter="url(#d)"><path fill="#D8E5FF" d="m10.792 16.922 7.138 1.191a.3.3 0 0 1 .132.535l-5.761 4.38c-4.885 2.61-7.007-6.223-1.51-6.106Z" style="fill:color(display-p3 .8475 .8966 1);fill-opacity:1;"></path></g><path stroke="#E7EEFF" stroke-dasharray="9 3" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="m46 9 20 19.5" style="stroke:color(display-p3 .9059 .9333 1);stroke-opacity:1;"></path><defs><filter id="c" width="12.799" height="15.024" x="7.28" y=".317" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"></feColorMatrix><feOffset dx="-.5" dy="-.5"></feOffset><feGaussianBlur stdDeviation="3"></feGaussianBlur><feComposite in2="hardAlpha" k2="-1" k3="1" operator="arithmetic"></feComposite><feColorMatrix values="0 0 0 0 0.417083 0 0 0 0 0.570792 0 0 0 0 0.9625 0 0 0 0.44 0"></feColorMatrix><feBlend in2="shape" result="effect1_innerShadow_24872_33000"></feBlend></filter><filter id="d" width="11.144" height="7.09" x="7.037" y="16.42" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"></feColorMatrix><feOffset dx="-.5" dy="-.5"></feOffset><feGaussianBlur stdDeviation="3"></feGaussianBlur><feComposite in2="hardAlpha" k2="-1" k3="1" operator="arithmetic"></feComposite><feColorMatrix values="0 0 0 0 0.417083 0 0 0 0 0.570792 0 0 0 0 0.9625 0 0 0 0.44 0"></feColorMatrix><feBlend in2="shape" result="effect1_innerShadow_24872_33000"></feBlend></filter><linearGradient id="a" x1="40" x2="41.238" y1="40.999" y2="75.116" gradientUnits="userSpaceOnUse"><stop stop-color="#E6EDFF" style="stop-color:color(display-p3 .902 .9294 1);stop-opacity:1;"></stop><stop offset="1" stop-color="#E0E8FF" style="stop-color:color(display-p3 .8767 .9112 1);stop-opacity:1;"></stop></linearGradient></defs>',9),bc=[$c];function Ic(a,p){return o(),i("svg",xc,bc)}const Pc={render:Ic};const Ec=a=>(Tt("data-v-d027383d"),a=a(),St(),a),Dc={key:0,class:"h-100 flex items-center justify-center"},Lc={class:"no-files-wrapper"},Hc=Ec(()=>e("div",{class:"description font-normal text-base leading-[20px]"},"No notes",-1)),Rc={key:1,class:"chat-pdf-notes-list"},Mc={__name:"ChatPDFNotesList",setup(a){const p=wt(),{$bus:C}=Mt(),B=c(""),u=c([]),b=c(),S=c(!1);let L=c(0),x=null;Ht(()=>{C.on("add:chat-pdf-note",d),x=new cs({pageSize:20}),_(x)}),Lt(()=>{C.off("add:chat-pdf-note",d)});const Z=()=>{u.value=[],x.reset(),_(x)},d=m=>{++L.value,Nn(m).then(w=>{He("Note added successfully","success"),u.value.push(m)}).catch(w=>{const{code:P,status:E}=w;tt(P||E,!1)}).finally(()=>{--L.value})},_=({page:m,page_size:w})=>{B.value&&(S.value=!0,Vn({conversation_id:B.value,page:m,page_size:w}).then(P=>{u.value=u.value.concat(P.list),x.updatePageInfo({page:m,total:P.total})}).catch(P=>{const{code:E,status:k}=P;tt(E||k,!1)}).finally(()=>{S.value=!1}))},ae=({note:m,index:w})=>{Ls({id:m.id}).then(P=>{He("note deleted successfully","success"),u.value.splice(w,1)}).catch(P=>{const{code:E,status:k}=P;tt(E||k,!1)})},v=()=>{x.isEnd||_({page:x.page+1,page_size:x.page_size})};return Ae(()=>p.state.aiChatV2.fileInfo.conversation_id,m=>{m.value=m,Z()},{immediate:!0}),(m,w)=>{const P=Sc,E=us,k=Vt;return ie((o(),Ie(E,{ref:"scrollBase",isLoading:S.value,"onScroll:end":v},{default:oe(()=>[u.value.length===0?(o(),i("div",Dc,[e("div",Lc,[f(A(Pc),{class:"no-files-svg"}),Hc])])):(o(),i("ul",Rc,[(o(!0),i(Re,null,nt(u.value,(Se,le)=>(o(),Ie(P,{key:le,class:st([le===b.value?"selected":""]),note:Se,index:le,"onDel:chatPDFNoteItem":ae,onClick:N=>b.value=le},null,8,["class","note","index","onClick"]))),128))]))]),_:1},8,["isLoading"])),[[k,A(L)!==0]])}}},Bc=Ze(Mc,[["__scopeId","data-v-d027383d"]]),Nc="https://static.hipdf.com/no_cloud_data-87da0289.png";const Zt=a=>(Tt("data-v-c7f6fa8a"),a=a(),St(),a),Vc={class:"chat-link-dialog"},Zc={class:"h-[288px]"},Oc={key:0,class:"flex"},Uc=["title"],zc=Zt(()=>e("span",{class:"mx-1"},">",-1)),Qc=["onClick"],Wc={class:"h-[calc(100%-52px)]"},Gc={class:"table-document-name",title:""},qc={key:0,style:{width:"24px",height:"24px"},class:"icon-folder table-icon"},Jc={key:1,class:"icon-file table-icon"},jc={class:"table-file-name"},Yc={class:"h-full flex items-center justify-center"},Kc=Zt(()=>e("img",{class:"custom-loading",width:"24",height:"24",src:Fs,alt:""}
5,null,-1)),Xc=[Kc],er={key:0,class:"text-center p-2"},tr=Zt(()=>e("img",{class:"custom-loading",width:"24",height:"24",src:Fs,alt:""},null,-1)),sr=[tr],nr={key:1,class:"end-text text-center h-8 leading-8"},or=Zt(()=>e("img",{src:Nc,alt:""},null,-1)),ar={class:"mt-6 mb-14 text-left text-base text-[#121212]"},lr={class:"dialog-footer"},ir={__name:"ChatLinkDialog",props:{showDialog:{default:!0,type:Boolean},type:{default:"move",type:String},selectIds:{default:null,type:Object},directoryPath:{default:"/",type:String}},emits:["close","moveSuccess"],setup(a,{emit:p}){const{t:C}=gt(),B=ls(),u=Ts(),b=c(!1),S=c([]),L=c(!0),x=c(null),Z=c(!1),d=c([]),_=Ft({page:1,path:"/",page_size:20,is_get_total:!0,is_star:!0}),ae=p,v=a,m=c(!1),w=c(null),P=c(!1),E=c("243px"),k=c("/"),Se=wt(),le=c(!1),N=c(null),me=c([]);Ae(()=>v.showDialog,g=>{b.value=g,rt(),ct(()=>{if(x.value){x.value.setCurrentRow();const O=x.value.$refs.bodyWrapper.getElementsByClassName("el-scrollbar__wrap")[0];O.addEventListener("scroll",()=>{O.scrollHeight-O.scrollTop-O.clientHeight<=0&&!m.value?ee():(P.value=!1,$e())})}})},{immediate:!0,deep:!0}),xt(()=>{});function rt(){d.value=[],_.page=1,_.path="/",_.page_size=20,_.is_get_total=!0,_.is_star=!0,S.value=[],me.value=[],le.value=!1,P.value=!1,w.value=null,L.value=!0,m.value=!1,Z.value=!1,E.value="243px",k.value="/",K()}function Ce(g,O){return d.value.includes(g.row)?{"background-color":"#EDEFFF"}:null}function K(){le.value=!1,_.page===1&&(L.value=!0),Zn(_).then(g=>{L.value=!1;const O=g.file_list?xe(g.file_list,_.path):[],z=g.directory_list?I(g.directory_list,k.value):[];S.value=S.value.concat(z.concat(O)),w.value=g.file_total,S.value.length||(le.value=!0),m.value=!1,$e()}).catch(g=>{S.value.length||(le.value=!0),L.value=!1,m.value=!1})}function xe(g,O){return g.forEach(z=>{z.parentPath=O||"",z.isPdf=z.file_name?Ee(z.file_name):!1,z.listType="fileType",z.img_path=Kt,z.last_time=gs(z.last_time,"yyyy-MM-dd hh:mm:ss"),z.file_size=On(z.file_size),v.tableType==="starred"&&(z.star_status=1)}),g}function Ee(g){return g.substring(g.lastIndexOf(".")).toLowerCase()===".pdf"}function I(g,O){return g.forEach(z=>{z.parentPath=O||"",z.file_name=z.name,z.file_size="-",z.file_id=z.did,z.listType="directoryType",z.last_time=gs(z.last_time,"yyyy-MM-dd hh:mm:ss")}),g}function vt(){ae("close")}function mt(){if(S.value.length){let g={source_file_id:Se.state.aiChatV2.fileInfo.file_id,reference_file_id:d.value[0].file_id};if(g.source_file_id===g.reference_file_id){He(C("CHATPDF.documentInterlinking.error.linkSameFile"));return}Un(g).then(O=>{He(C("CHATPDF.documentInterlinking.success.fileLinkSuccess"),"success"),ae("close",{chain_id:O.id,file_id:d.value[0].file_id,file_name:d.value[0].file_name,img_path:d.value[0].img_path})}).catch(O=>{O.msg?He(O.msg):He(C("CHATPDF.documentInterlinking.error.fileLinkFailed"))})}else B.push({name:"documentCloud",query:{type:"document",path:k.value},params:u.params})}function ee(){w.value<=_.page*_.page_size?(m.value=!1,P.value=!0,$e(32)):(_.page=_.page+1,m.value=!0,P.value=!1,$e(30),setTimeout(()=>{K()},10))}function $e(g=0){if(E.value=252-g+"px",g===32){const O=x.value.$refs.bodyWrapper.getElementsByClassName("el-scrollbar__wrap")[0];O.scrollHeight-O.clientHeight,setTimeout(()=>{O.scrollTo(0,O.scrollHeight)},100)}}function Fe(g){g&&g.listType==="directoryType"||g&&(d.value=[g])}const Le=g=>{let O=xs(g);O&&O.listType==="fileType"||(S.value=[],d.value=[],g&&g.path&&(k.value=g.path+g.name,me.value=k.value.split("/"),me.value.shift(),_.page=1,_.path=g.path+g.name,setTimeout(()=>{let z=N.value.scrollWidth;N.value.scrollTo(z,0)},100),K()))};function Me(g){const O=me.value.length-g-1;me.value.splice(g+1,O),k.value="/"+me.value.join("/"),k.value!==_.path&&Ge(k.value)}function ot(){me.value=[],k.value!=="/"&&(k.value="/",Ge(k.value))}function Ge(g){_.page=1,_.path=g,_.page_size=20,S.value=[],K()}return(g,O)=>{const z=Ys,De=Ks,re=Pt,Be=Nt;return o(),i("div",Vc,[f(Be,{modelValue:b.value,"onUpdate:modelValue":O[0]||(O[0]=Ne=>b.value=Ne),class:"document-folder",title:g.$t("CHATPDF.documentInterlinking.linkTo"),width:"530px",onClose:vt,"close-on-click-modal":!1},{footer:oe(()=>[e("span",lr,[f(re,{type:"primary",onClick:mt,loading:Z.value,disabled:!d.value.length&&S.value.length},{default:oe(()=>[_t($(S.value.length?g.$t("CHATPDF.documentInterlinking.button.confirm"):g.$t("CHATPDF.documentInterlinking.button.upload")),1)]),_:1},8,["loading","disabled"])])]),default:oe(()=>[e("div",Zc,[e("div",{ref_key:"scrollRef",ref:N,class:"text-sm leading-5 mb-4 flex overflow-x-auto mr-5 select-none"},[e("span",{class:st([me.value.length?"text-[#3C3C43] opacity-60":"text-[#121212]","cursor-pointer shrink-0"]),onClick:ot},$(g.$t("CHATPDF.documentInterlinking.document")),3),me.value.length?(o(),i("ul",Oc,[(o(!0),i(Re,null,nt(me.value,(Ne,Q)=>(o(),i("li",{class:st(["shrink-0",Q!==me.value.length-1?"text-[#3C3C43] opacity-60":"text-[#121212]"]),key:Q,title:Ne},[zc,e("span",{class:"cursor-pointer",onClick:Oe=>Me(Q),onselectstart:"return false;"},$(Ne),9,Qc)],10,Uc))),128))])):J("",!0)],512),ie(e("div",Wc,[ie(f(De,{ref_key:"cloudTableRef",ref:x,data:S.value,style:{width:"100%"},"highlight-current-row":"",onCurrentChange:Fe,"empty-text":" ","max-height":E.value,"row-style":Ce,onRowDblclick:Le},{default:oe(()=>[f(z,{prop:"file_name",label:g.$t("CHATPDF.documentInterlinking.name"),"show-overflow-tooltip":""},{default:oe(Ne=>[e("div",Gc,[Ne.row.listType==="directoryType"?(o(),i("span",qc)):(o(),i("span",Jc)),e("span",jc,$(Ne.row.file_name),1)])]),_:1},8,["label"]),f(z,{prop:"last_time",label:g.$t("CHATPDF.documentInterlinking.lastModified"),width:"180"},null,8,["label"]),f(z,{prop:"file_size",label:g.$t("CHATPDF.documentInterlinking.size"),width:"100"},null,8,["label"])]),_:1},8,["data","max-height"]),[[fe,!L.value]]),ie(e("div",Yc,Xc,512),[[fe,L.value]]),m.value?(o(),i("p",er,sr)):J("",!0),P.value?(o(),i("p",nr,"-End-")):J("",!0)],512),[[fe,!le.value]]),ie(e("div",null,[or,e("p",ar,$(g.$t("CHATPDF.documentInterlinking.description.addFileLink")),1)],512),[[fe,le.value]])])]),_:1},8,["modelValue","title"])])}}},cr=Ze(ir,[["__scopeId","data-v-c7f6fa8a"]]),rr={xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",fill:"none"},ur=e("rect",{width:"16",height:"2",x:"4.5",y:"11",fill:"#4D64FD",rx:"1"},null,-1),dr=e("rect",{width:"16",height:"2",x:"13.5",y:"4",fill:"#4D64FD",rx:"1",transform:"rotate(90 13.5 4)"},null,-1),hr=[ur,dr];function fr(a,p){return o(),i("svg",rr,hr)}const pr={render:fr};const _r=a=>(Tt("data-v-a65093fe"),a=a(),St(),a),vr={class:"chat-link py-6 h-full"},mr={class:"px-6"},gr={key:0,class:"text-left h-full"},Cr={class:"text-sm text-[#3C3C43] py-2 px-6"},yr={class:"text-[#121212]"},wr={class:"opacity-60"},kr={class:"overflow-auto h-[calc(100%-139px)]"},Ar=["onClick"],Fr=["src"],Tr=["title"],Sr=["onClick"],xr={key:1,class:"h-full flex flex-col justify-center items-center"},$r=_r(()=>e("span",{class:"icon-link-noFile"},null,-1)),br={class:"mt-4 mb-25"},Ir={__name:"ChatLink",setup(a){const{languageMap:p}=qn,C=wt(),{t:B}=gt(),u=c([]),b=c(!1),S=c(!1);Ae(()=>C.state.aiChatV2.fileInfo.file_id,v=>{v?(S.value=!1,L()):(S.value=!0,u.value=[])},{immediate:!0,deep:!0});function L(){let v={file_id:C.state.aiChatV2.fileInfo.file_id,page:1,page_num:999};zn(v).then(m=>{u.value=m.list?m.list:[]}).catch(m=>{console.log(m)})}function x(v){let m=v.srcElement;m.src=Kt,m.onerror=null}function Z(v){Qn({ids:[v]}).then(()=>{He(B("CHATPDF.documentInterlinking.success.unlinkSuccess"),"success");let w=null;u.value.forEach((P,E)=>{P.chain_id===v&&(w=E)}),u.value.splice(w,1)}).catch(w=>{He(w.msg)})}function d(v){b.value=!1,v&&u.value.unshift(v)}const _=ls();function ae(v){Wn({file_id:v.file_id}).then(()=>{const m=p(Gn.global.locale.value),w=m==="en"?"":`/${m}`,P=_.resolve({path:`${w}/preview`,query:{file_id:v.file_id,file_name:v.file_name}});window.open(P.href,"_blank")}
5).catch(m=>{const{code:w}=m;let P="";w===2405&&(P=B("CHATPDF.documentInterlinking.error.theFileNotFound")),tt(w,!1,P)})}return(v,m)=>{const w=Pt,P=Et,E=cr;return o(),i(Re,null,[e("div",vr,[e("div",mr,[f(w,{onClick:m[0]||(m[0]=k=>b.value=!0),disabled:S.value},{default:oe(()=>[f(A(pr),{class:"mr-[8px]"}),_t($(v.$t("CHATPDF.leftMenu.button.addNewLink")),1)]),_:1},8,["disabled"])]),u.value.length?(o(),i("div",gr,[e("h6",Cr,[e("span",yr,$(u.value.length),1),e("span",wr,$(v.$t("CHATPDF.leftMenu.description.fileLink")),1)]),e("ul",kr,[(o(!0),i(Re,null,nt(u.value,(k,Se)=>(o(),i("li",{class:"link-list-item flex items-center py-2 px-6 cursor-pointer hover:bg-[#F4F6FF]",key:Se},[e("div",{class:"flex items-center w-[calc(100%-24px)]",onClick:le=>ae(k)},[e("img",{class:"file-thumbnail w-8 h-8 rounded mr-[10px]",src:k.img_path||A(Kt),alt:"",onError:m[1]||(m[1]=le=>x(le))},null,40,Fr),e("span",{class:"w-full truncate leading-8",title:k.file_name},$(k.file_name),9,Tr)],8,Ar),f(P,{"popper-class":"unlink-tooltip",effect:"dark",content:v.$t("CHATPDF.leftMenu.toolTips.unLink"),placement:"top"},{default:oe(()=>[e("span",{class:"icon-unlink shrink-0",onClick:le=>Z(k.chain_id)},null,8,Sr)]),_:2},1032,["content"])]))),128))])])):(o(),i("div",xr,[$r,e("p",br,$(v.$t("CHATPDF.leftMenu.description.noFileLink")),1)]))]),f(E,{showDialog:b.value,onClose:m[2]||(m[2]=k=>d(k))},null,8,["showDialog"])],64)}}},Pr=Ze(Ir,[["__scopeId","data-v-a65093fe"]]),Er={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},Dr=e("path",{stroke:"#000",d:"M21.5 12a9.5 9.5 0 1 1-19 0 9.5 9.5 0 0 1 19 0Z"},null,-1),Lr=e("path",{stroke:"#000","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v7.5H8"},null,-1),Hr=[Dr,Lr];function Rr(a,p){return o(),i("svg",Er,Hr)}const Mr={render:Rr};const ds=a=>(Tt("data-v-0f3d0096"),a=a(),St(),a),Br={class:"ai-upload flex flex-col h-full pt-5 px-10 md:pt-10 pb-20 md:px-32 bg-white-244 rounded-xl"},Nr={class:"relative"},Vr={class:"flex items-center justify-center text-[#000] text-[34px] font-bold"},Zr=ds(()=>e("img",{width:"48",height:"48",src:"https://images.hipdf.com/images2023/icons/chat-pdf.svg",alt:"convert from jpg"},null,-1)),Or={class:"title ml-3"},Ur={class:"desc mt-3 text-sm text-[#433C3C] opacity-60"},zr={class:"upload relative w-full max-w-[1440px] p-3 bg-[#FFF] rounded-3xl mt-10 h-full mx-auto"},Qr={class:"preview-container"},Wr={class:"tool-container w-100",ref:"toolContainerLeft"},Gr={class:"need-toggle h-100"},qr=ds(()=>e("div",{class:"split-left"},null,-1)),Jr=ds(()=>e("div",{class:"split-right split hidden lg:block"},null,-1)),jr={key:0,class:"right-fn-box"},Yr={class:"chatpdf-mobile"},Kr={class:"header"},Xr={class:"header-left"},eu={class:"header-center"},tu={class:"header-right"},su={class:"loading-cover"},nu={class:"cover-inner flex align-center justify-center content-center text-center"},ou={class:"mt-2"},au={class:"text-[#121212]"},lu={class:"px-10 py-[11px]"},iu=400,cu={__name:"ChatPDFV2",setup(a){const{t:p}=gt(),{IS_PC:C}=Rt(),B=c(null),u=se(()=>E.getters.fileList.filter(H=>H.fsm.state==="ossUploading").length>0),b=se(()=>S.value||L.value||u.value),S=c(!1),L=c(!1),x=H=>{S.value=H},Z=vs(ws),d=vs(Bc),_=c(null),ae={history:Z,link:Pr,note:d},v=Ft({com:Z,title:p("CHATPDF.leftMenu.menuItem.chatHistory")}),m=H=>{const te=pt(H,"name"),ue=pt(H,"title");v.com=ae[te],v.title=ue},w=H=>{L.value=H},P=()=>{S.value&&B.value.handleCancel()},E=wt(),k=c(!1),Se=c(!1),le=c("btt"),N=c(!1);xt(()=>{Fe()});const me=se(()=>/macintosh|mac os x/i.test(navigator.userAgent)),rt=c(null),Ce=c(null),K=c(null),xe=c(null),Ee=me.value?560:280;let I=720;const vt=Ft({leftWrapper:Ce,rightWrapper:K,minLeftWidth:Ee,curRightWidth:I}),mt=H=>{const{name:te}=H;Le.value=te,N.value=!1,te===p("CHATPDF.chat.toolTips.resetChat")?$bus.emit("clear:chat-list"):te===p("CHATPDF.chat.toolTips.exportChat")?$bus.emit("export:chat"):te==="Share Chat"?$bus.emit("share:chat"):te==="PDF Preview"&&(xe.value.style.zIndex=1e3)};let ee=!1,$e=[0,0];const Fe=()=>{let H=Ce;document.onmousedown=function(ue){const{x:ge,y:ye}=ue;$e=[ge,ye],ue.target.classList.value.indexOf("split")>-1&&(H=ue.target.className.indexOf("split-left")>-1?Ce:K,ee=!0)};let te=null;document.onmousemove=function(ue){if(ee){clearTimeout(te);const{x:ge}=ue,ye=H.value.className.indexOf("right-container")>-1,Ye=ye?document.body.clientWidth-ge:ge,ut=ye?iu:Ee,ze=xe.value.getBoundingClientRect(),Ke=ze.width;if(ye&&(I=K.value.getBoundingClientRect().width),Ye<ut||Ke<Ee&&ge<$e[0]&&ye||Ke<Ee&&ge>$e[0]&&!ye)return;H.value.style.width=Ye+"px",Ce.value.style.userSelect="none",K.value.style.userSelect="none",xe.value.style.userSelect="none";const dt=_.value.PDFList;_.value.PDFList.length&&(te=setTimeout(()=>{const{viewport:Xe}=dt[0],{width:pe}=Xe;Ds(ze,Xe,50,50).width.toFixed(2)*1/pe.toFixed(2)*1*1!==1&&$bus.emit("render:reset",1)},500))}},document.onmouseup=function(ue){ee=!1,!(!Ce.value||!K.value||!xe.value)&&(Ce.value.style.userSelect="auto",K.value.style.userSelect="auto",xe.value.style.userSelect="auto")}},Le=c("ctrl"),Me=H=>{Le.value=H,N.value=!0},ot=()=>{N.value=!1},Ge=(H=!1)=>{const te=document.querySelector(".his-menu-new"),{width:ue}=Ce.value.getBoundingClientRect(),ge=document.querySelectorAll(".need-toggle");ue>56&&!H?(Bt({targets:Ce.value,width:0,easing:"easeInOutExpo",duration:200}),Bt({targets:K.value,width:(document.body.clientWidth-57)/2,easing:"easeInOutExpo",duration:300}),ge.forEach(ye=>{ye.classList.add("hidden")}),te.classList.add("expand")):(Bt({targets:Ce.value,width:280,easing:"easeInOutExpo",duration:200}),Bt({targets:K.value,width:(document.body.clientWidth-57-280)/2,easing:"easeInOutExpo",duration:300}),ge.forEach(ye=>{ye.classList.remove("hidden"),te.classList.remove("expand")}))},g=se(()=>E.state.page.isShowWorkspace);Ht(()=>{O();const H=lo.get("AI_READ_CUR_FN");if(H){const{name:te}=H;$bus.emit("select:fn",te)}$bus.on("file:upload-fail",z),window.addEventListener("resize",De),$sensorsApi.track("Features_Features",{type:"chatPDF"})}),Lt(()=>{$bus.off("file:upload-fail",z),window.removeEventListener("resize",De)});const O=()=>{const H={featureName:"chatPDF"};E.commit("SET_CURRENT_PAGE_INFO",Object.assign(Jn,H))},z=()=>{E.commit("RESET_FILE_INFO")},De=()=>{const H=document.querySelector("#headerComponent")?.getBoundingClientRect().height,te=document.querySelector(".home");te.style.height=`calc(100vh - ${H}px)`};Ae(()=>g.value,H=>{k.value=H}),Ae(()=>E.getters.fileList,H=>{if(H.length){const{name:te,size:ue}=H[0];E.commit("SET_CUR_PDF_INFO",{file_name:te,file_size:ue})}});const re=se(()=>!(E.state.aiChatV2.hisList.length||E.getters.fileList.length)),Be=c(document.documentElement.clientHeight-60||document.body.clientHeight-60);c([{label:"Chat",value:"chat"},{label:"File",value:"file"}][0].value);const Q=c(!1),Oe=c(!1),ce=()=>{Q.value=!0},Ue=()=>{Q.value=!1},at=()=>{Oe.value=!0},lt=()=>{Oe.value=!1},it=()=>{$bus.emit("open:more")};return(H,te)=>{const ue=Kn,ge=jl,ye=Nl,Ye=Sl,ut=fn,ze=bo,Ke=ns,dt=Pt,Xe=Nt,pe=Vt;return o(),i("div",{class:"home",style:es({height:A(C)?"calc(100vh - 74px)":`${Be.value}px`})},[ie(e("div",Br,[e("div",Nr,[e("h1",Vr,[Zr,e("span",Or,$(H.$t("CHATPDF.title")),1)]),e("p",Ur,$(H.$t("CHATPDF.description")),1)]),e("div",zr,[f(ue,{isAutoUpload:!0,toPage:"chat"})])],512),[[fe,re.value]]),ie(e("div",Qr,[e("div",{class:"left-plus",ref_key:"leftMenu",ref:rt},[f(ge,{onChange:m,onToggleMenu:Ge})],512),A(C)?(o(),i("div",{key:0,class:"left-container flex",ref_key:"leftWrapper",ref:Ce},[e("div",Wr,[e("div",Gr,[(o(),Ie(ln,null,[(o(),Ie(Ss(v.com)))],1024))])],512),qr],512)):J("",!0),ie((o(),i("div",{class:"center-container w-full relative h-full",ref_key:"centerWrapper",ref:xe},[f(ye,{ref_key:"pdfViewer",ref:_,"onUpdate:loading":w,layout:vt},null,8,["layout"])])),[[pe,Se.value,void 0,{lock:!0}]]),e("div",{class:"right-container",ref_key:"rightWrapper",ref:K},[Jr,A(C)?(o(),i("div",jr,[f(Ye,{ref_key:"hiChatV2",ref:B,"onOpen:menu":Me,"onUpdate:loading":x},null,512)])):J("",!0)],512)],512),[[fe,!re.value&&A(C)]]),ie(e("div",Yr,[e("div",Kr,[e("div",Xr,[f(A(Mr),{onClick:at})]),e("div",eu,$(A(p)("CHATPDF.chat.title")),1),e("div",tu,[f(A(pn),{onClick:ce}),f(A(ss),{onClick:ft(it,["prevent","stop"])})])]),A(C)?J("",!0):(o(),i("div",{key:0,class:"chat",style:es({height:`${Be.value-48}px`})},[f(Ye,{ref_key:"hiChatV2",ref:B,"onUpdate:loading":x},null,512)],4)),f(ut,{show:Q.value,onClose:Ue},null,8,["show"]),A(C)?J("",!0):(o(),Ie(ws,{key:1,show:Oe.value,onClose:lt},null,8,["show"]))],512),[[fe,!re.value&&!A(C)]]),f(Ke,{modelValue:N.value,"onUpdate:modelValue":te[0]||(te[0]=ve=>N.value=ve),direction:le.value,"before-close":ot},{default:oe(()=>[Le.value==="ctrl"?(o(),Ie(ze,{key:0,"onMenu:click":mt})):J("",!0),Le.value==="lang"?(o(),Ie(As,{key:1,platform:"mobile"})):J("",!0)]),_:1},8,["modelValue","direction"]),ie(e("div",su,[f(Xe,{modelValue:b.value,"onUpdate:modelValue":te[1]||(te[1]=ve=>b.value=ve),"align-center":"","show-close":!1,"close-on-click-modal":!1},{default:oe(()=>[e("div",nu,[e("div",null,[e("div",null,[f(Hs)]),e("div",ou,[ie(e("span",au,[ie(e("span",null,$(H.$t("VIEW.chatPDFV2.Uploading")),513),[[fe,u.value]]),ie(e("span",null,$(H.$t("VIEW.chatPDFV2.Analyzing")),513),[[fe,S.value]]),ie(e("span",null,$(H.$t("VIEW.chatPDFV2.Loading")),513),[[fe,!S.value&&!u.value]])],512),[[fe,!0]])]),ie(e("div",null,[f(dt,{class:"mt-6",plain:"",onClick:P},{default:oe(()=>[e("div",lu,$(H.$t("VIEW.chatPDFV2.Cancel")),1)]),_:1})],512),[[fe,S.value]])])])]),_:1},8,["modelValue"])],512),[[fe,b.value]])],4)}}},$u=Ze(cu,[["__scopeId","data-v-0f3d0096"]]);export{$u as default};
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.