1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[97773],{762152:(e,t,l)=>{l.d(t,{A:()=>h});var n=l(695155),r=l(212115),i=l(456461),a=l(58614),s=l(318813),o=l(621703),d=l(676305),c=l(910593),x=l(179624),m=l(483835),p=l(387377),u=l(7266);let h=e=>{let{isOpen:t,onClose:l,jobs:h,cancelJob:f,labels:g}=e,[v,b]=(0,r.useState)(!1),j=(0,u.useTranslations)("common"),y={queued:j("queue"),preparing:j("preparingDownload"),downloading:j("downloading"),zipping:j("zipping"),done:j("completed"),canceled:j("canceled"),error:j("error"),hide:j("hide"),show:j("show"),close:j("close"),...g||{}},w=(0,r.useMemo)(()=>h.filter(e=>["queued","preparing","downloading","zipping"].includes(e.status)).length,[h]),N=e=>{switch(e){case"queued":return y.queued;case"preparing":return y.preparing;case"downloading":return y.downloading;case"zipping":return y.zipping;case"done":return y.done;case"canceled":return y.canceled;case"error":return y.error}};return((0,r.useEffect)(()=>{if(!t)return;let e=null;return h.length>0&&0===w&&(e=setTimeout(()=>l(),3e3)),()=>{e&&clearTimeout(e)}},[t,w,h.length,l]),t)?(0,n.jsx)("div",{className:"fixed right-4 bottom-4 z-[1000] w-[360px]",children:(0,n.jsxs)("div",{className:"rounded-2xl shadow-xl border border-gray-200 bg-white overflow-hidden",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gray-50",children:[(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)("div",{className:"text-[15px] font-semibold text-gray-800 truncate",children:j("download")})}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(i.A,{title:v?y.show:y.hide,children:(0,n.jsx)(a.Ay,{size:"small",type:"text",className:"text-gray-500",icon:v?(0,n.jsx)(d.A,{}):(0,n.jsx)(c.A,{}),onClick:()=>b(e=>!e)})}),(0,n.jsx)(i.A,{title:y.close,children:(0,n.jsx)(a.Ay,{size:"small",type:"text",className:"text-gray-500",icon:(0,n.jsx)(x.A,{}),onClick:l})})]})]}),!v&&(0,n.jsx)("div",{className:"max-h-[60vh] overflow-auto divide-y",children:h.map(e=>{let t=["queued","preparing","downloading","zipping"].includes(e.status),l="done"===e.status,r="error"===e.status||"canceled"===e.status;return(0,n.jsxs)("div",{className:"px-4 py-3 group",children:[" ",(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"shrink-0 w-[38px] h-[38px] flex items-center justify-center",children:[t&&"queued"===e.status&&(0,n.jsx)(s.A,{}),t&&"queued"!==e.status&&(0,n.jsx)(o.A,{type:"circle",percent:Math.max(0,Math.min(100,e.progress)),width:32}),l&&(0,n.jsx)(m.A,{twoToneColor:"#52c41a",style:{fontSize:32}}),r&&(0,n.jsx)(p.A,{twoToneColor:"#f5222d",style:{fontSize:32}})]}),(0,n.jsxs)("div",{className:"grow min-w-0 min-h-[38px] flex flex-col justify-center",children:[(0,n.jsx)("div",{className:"text-[16px] font-medium text-gray-800 truncate",children:t?"".concat(N(e.status)," ").concat(e.folderName):"".concat(e.folderName)}),"error"===e.status&&e.error&&(0,n.jsx)("div",{className:"mt-0.5",children:(0,n.jsxs)("span",{className:"text-[11px] text-status-error truncate",children:["(",e.error,")"]})})]}),(0,n.jsx)("div",{className:"shrink-0 mr-2 w-[28px] opacity-0 pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto transition-opacity duration-150",children:t&&(0,n.jsx)(a.Ay,{size:"small",icon:(0,n.jsx)(x.A,{}),onClick:()=>f(e.id)})})]})]},e.id)})})]})}):null}},123454:(e,t,l)=>{l.d(t,{A:()=>o});var n=l(695155),r=l(7266),i=l(318813),a=l(453096),s=l(384836);let o=e=>{let{files:t,isLoading:l,folderId:o,setOpenDetailFile:d,onRemoveFile:c,onUpdate:x,selectedFiles:m,onToggleSelect:p}=e,u=(0,r.useTranslations)("common");return(0,n.jsx)("div",{className:"flex flex-col gap-6",children:l?(0,n.jsx)("div",{className:"grid place-items-center h-[60vh]",children:(0,n.jsx)(i.A,{})}):o?0===t.length?(0,n.jsx)(a.A,{description:u("noData",{default:"No files found."})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,148.625px)] justify-start gap-3 mobile:grid-cols-2 mobile:justify-items-center mobile:gap-x-4 mobile:gap-y-5",children:t.map(e=>(0,n.jsx)("div",{"data-file-id":e.id,className:"w-[148.625px] cursor-pointer",onClick:t=>{let l=t.target;l.closest('input[type="checkbox"]')||l.closest("button")||l.closest(".ant-checkbox")||l.closest(".ant-checkbox-wrapper")||d(e)},children:(0,n.jsx)(s.A,{userFile:e,onRemoveFile:c,onUpdate:x,isSelected:null==m?void 0:m.has(e.id),onToggleSelect:p})},e.id))})}):(0,n.jsx)(a.A,{description:u("noData",{default:"No files found."})})})}},463169:(e,t,l)=>{l.d(t,{A:()=>v});var n=l(695155),r=l(33862),i=l(30025),a=l(443833),s=l(757531),o=l(58614),d=l(7974),c=l(571362),x=l(318813),m=l(7266),p=l(548173),u=l.n(p),h=l(212115),f=l(997139),g=l(256965);let v=e=>{var t;let{userFile:l,open:p,onClose:v,files:b,isLastFile:j,handleNextFile:y}=e,w=(0,m.useTranslations)("common"),[N,k]=(0,h.useState)(!1),[A,C]=(0,h.useState)(l),F=async e=>{k(!0),(0,r.ly)(e).then(e=>{(null==e?void 0:e.status)&&(null==e?void 0:e.data)&&C(e.data)}).catch(e=>{console.error("Error fetching file details:",e),(0,s.v)("".concat("DetailFileMod
1al.tsx"," - fetchDetail Error"),e)}).finally(()=>{k(!1)})};(0,h.useEffect)(()=>{F(l.id)},[l]);let E=(e,t)=>{let l=decodeURIComponent(e).match(/\/([^\/?]+)(?:\?.*)?$/),n=l?l[1]:"",r=n.match(/\.[^/.]+$/),i=r?r[0]:"";return t?t+i:n},D=[{key:"fileName",label:w("fileName"),children:E(null==A?void 0:A.mediaLink,null==A?void 0:A.name)||"--"},{key:"fileType",label:w("fileTypeLabel"),children:(null==A?void 0:A.fileType)||"--"},{key:"url",label:w("fileUrl"),children:(null==A?void 0:A.mediaLink)?(0,n.jsx)(u(),{className:"line-clamp-2 break-all text-[#151A1F] hover:underline",href:null==A?void 0:A.mediaLink,target:"_blank",children:null==A?void 0:A.mediaLink}):"--"},{key:"ownerName",label:w("ownerName"),children:(null==A?void 0:A.ownerName)||"--"},{key:"contentTitle",label:w("contentTitle"),children:(null==A?void 0:A.contentTitle)||"--"},{key:"chapterTitle",label:w("chapterTitle"),children:(null==A?void 0:A.chapterTitle)||"--"},{key:"refUserName",label:w("refUserName"),children:(null==A?void 0:A.refUserName)||"--"},{key:"createdAt",label:w("createdAt"),children:(0,a.$Q)(A.createdAt)||"--"}],L=()=>{(0,g.O)(A.mediaLink,E(A.mediaLink,null==A?void 0:A.name),w)};return(0,n.jsx)(c.A,{centered:!0,open:p,onCancel:v,width:1008,footer:null,title:(0,n.jsx)("div",{className:"font-sans text-center text-[15px] font-extrabold leading-[21px] text-[#151A1F]",children:w("fileDetail")}),className:"detail-file-modal font-sans [&_.ant-modal-close]:!end-4 [&_.ant-modal-close]:!top-3 [&_.ant-modal-content]:!overflow-hidden [&_.ant-modal-content]:!rounded-[4px] [&_.ant-modal-content]:!p-0 [&_.ant-modal-header]:!m-0 [&_.ant-modal-header]:!border-b [&_.ant-modal-header]:!border-[#E2E8F0] [&_.ant-modal-header]:!px-6 [&_.ant-modal-header]:!py-[12px]",styles:{content:{padding:0,borderRadius:"4px",overflow:"hidden"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #e7e0d6",paddingLeft:"16px",paddingRight:"16px",margin:0}},closeIcon:(0,n.jsx)("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:20,height:20,fontSize:14,color:"#151A1F",lineHeight:1},children:"â"}),children:(0,n.jsx)("div",{className:"min-h-[560px]",children:N?(0,n.jsx)("div",{className:"flex min-h-[560px] items-center justify-center",children:(0,n.jsx)(x.A,{className:"[&>.ant-spin-dot-holder]:!text-blue-500 h-14"})}):(0,n.jsxs)("div",{className:"flex h-[calc(100vh-98px)] max-h-[830px] min-h-[560px] flex-col",children:[(0,n.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[(0,n.jsx)("div",{className:"flex min-h-[320px] lg:min-h-[360px] flex-1 items-center justify-center bg-[#FAFBFE] overflow-hidden max-h-[500px] lg:max-h-none",children:(()=>{let e;let t=!!(null==A?void 0:A.mediaLink),l=t?(0,n.jsx)(o.Ay,{size:"small",icon:(0,n.jsx)(f.A,{}),onClick:L,className:"!absolute top-2 right-2 z-20 text-status-error border-status-error"}):null,r=!1;if(t)switch(null==A?void 0:A.fileType){case i.k3.IMAGE:r=!0,e=(0,n.jsx)(d.A,{src:A.mediaLink,alt:A.name,style:{maxHeight:"100%",maxWidth:"100%",objectFit:"contain",display:"block"}});break;case i.k3.VIDEO:r=!0,e=(0,n.jsx)("video",{style:{maxHeight:"100%",maxWidth:"100%",display:"block"},src:A.mediaLink,controls:!0});break;case i.k3.AUDIO:r=!0,e=(0,n.jsx)("audio",{className:"w-full max-w-[560px]",src:A.mediaLink,controls:!0});break;default:e=(0,n.jsxs)("div",{className:"justify-center text-[16px] text-[red] font-semibold flex items-center gap-3",children:[w("unableViewFile"),(0,n.jsx)(o.Ay,{size:"small",onClick:L,icon:(0,n.jsx)(f.A,{}),className:"text-status-error border-status-error"})]})}else e=(0,n.jsx)("div",{className:"text-[16px] text-[red] font-semibold",children:w("unableViewFile")});return(0,n.jsxs)("div",{className:"relative flex h-full w-full min-h-0 items-center justify-center overflow-hidden px-6 py-8",children:[r?l:null,e]})})()}),(0,n.jsxs)("div",{className:"w-full lg:w-[342px] shrink-0 border-t lg:border-t-0 lg:border-l border-[#e7e0d6] bg-white px-[18px] py-[18px]",children:[(0,n.jsx)("div",{className:"mb-[16px] text-[14px] font-bold leading-[21px] text-[#17306f]",children:w("detailInfo")}),(0,n.jsx)("div",{children:D.map(e=>(0,n.jsxs)("div",{className:"grid grid-cols-[112px_minmax(0,1fr)] gap-2 border-t border-[#e7e0d6] py-[10px]",children:[(0,n.jsx)("div",{className:"text-[12px] font-bold leading-[16.5px] text-[#777777]",children:e.label}),(0,n.jsx)("div",{className:"min-w-0 break-words text-[12px] font-normal leading-[15px] text-[#333333]",children:e.children})]},e.key))})]})]}),(0,n.jsxs)("div",{className:"flex h-[56px] shrink-0 items-center justify-center gap-4 border-t border-[#e7e0d6] bg-white",children:[(0,n.jsx)(o.Ay,{disabled:(null===(t=b[0])||void 0===t?void 0:t.id)===(null==l?void 0:l.id),onClick:()=>y(l,!1),className:"!flex !items-center !justify-center !h-[40px] !w-[40p
1x] !rounded-full !border-[#D7E3F3] !p-0 !text-[22px] !font-bold !text-[#17306f] disabled:!text-[#94A3B8]",style:{lineHeight:1},children:(0,n.jsx)("div",{className:"pb-[2px] pr-[3px]",children:"<"})}),(0,n.jsx)(o.Ay,{disabled:j,onClick:()=>y(l,!0),className:"!flex !items-center !justify-center !h-[40px] !w-[40px] !rounded-full !border-[#D7E3F3] !p-0 !text-[22px] !font-bold !text-[#17306f] disabled:!text-[#94A3B8]",style:{lineHeight:1},children:(0,n.jsx)("div",{className:"pb-[2px] pl-[3px]",children:">"})})]})]})})})}},689006:(e,t,l)=>{l.d(t,{A:()=>x});var n=l(695155),r=l(212115),i=l(383286),a=l(571362),s=l(58614),o=l(420148),d=l(680605),c=l(7266);let x=e=>{let{open:t,onCancel:l,onOk:x,totalFiles:m}=e,p=(0,c.useTranslations)("common"),[u]=i.A.useForm();(0,r.useEffect)(()=>{t&&u.setFieldsValue({from:1,to:Math.min(10,m)})},[t,m,u]);let h=async()=>{try{let e=await u.validateFields();x(e.from,e.to),u.resetFields()}catch(e){console.error(e)}},f=()=>{u.resetFields(),l()};return(0,n.jsx)(a.A,{title:p("chooseMultiple"),open:t,onCancel:f,footer:(0,n.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,n.jsx)(s.Ay,{onClick:f,className:"text-deep-insight-blue border-deep-insight-blue hover:!text-deep-insight-blue/80 hover:!border-deep-insight-blue/80",children:p("cancel")}),(0,n.jsx)(s.Ay,{type:"primary",onClick:h,className:"!bg-status-ok !text-white border-none hover:opacity-90 transition-all",children:p("OK")})]}),width:480,destroyOnHidden:!0,children:(0,n.jsxs)("div",{className:"flex flex-col gap-3 py-4",children:[(0,n.jsx)(o.A,{message:"".concat(p("totalFiles"),": ").concat(m),type:"info",showIcon:!0}),(0,n.jsx)(i.A,{form:u,layout:"vertical",autoComplete:"off",children:(0,n.jsxs)("div",{className:"flex gap-3",children:[(0,n.jsx)(i.A.Item,{label:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"text-base",children:p("from")}),(0,n.jsx)("span",{className:"px-1 h-4 mt-[3px] flex justify-center items-center bg-status-error rounded-[3px] text-white text-[10px] pc:text-[11px] pc:w-[50px] pc:h-[15px] whitespace-nowrap",children:p("required")})]}),name:"from",className:"flex-1",required:!1,rules:[{required:!0,message:p("fromNumberRequired")},{type:"number",min:1,max:m,message:p("numberRangeError",{max:m})},e=>{let{getFieldValue:t}=e;return{validator(e,l){let n=t("to");return l&&n&&!(l<=n)?Promise.reject(Error(p("fromMustBeLessThanTo"))):Promise.resolve()}}}],children:(0,n.jsx)(d.A,{className:"w-full",min:1,max:m,placeholder:"1",onChange:()=>{u.validateFields(["to"]).catch(()=>{})}})}),(0,n.jsx)(i.A.Item,{label:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"text-base",children:p("to")}),(0,n.jsx)("span",{className:"px-1 h-4 mt-[3px] flex justify-center items-center bg-status-error rounded-[3px] text-white text-[10px] pc:text-[11px] pc:w-[50px] pc:h-[15px] whitespace-nowrap",children:p("required")})]}),name:"to",className:"flex-1",required:!1,rules:[{required:!0,message:p("toNumberRequired")},{type:"number",min:1,max:m,message:p("numberRangeError",{max:m})},e=>{let{getFieldValue:t}=e;return{validator(e,l){let n=t("from");return l&&n&&!(l>=n)?Promise.reject(Error(p("toMustBeGreaterThanFrom"))):Promise.resolve()}}}],children:(0,n.jsx)(d.A,{className:"w-full",min:1,max:m,placeholder:"10",onChange:()=>{u.validateFields(["from"]).catch(()=>{})}})})]})})]})})}},928615:(e,t,l)=>{l.d(t,{EX:()=>j,e3:()=>v,nq:()=>b});var n=l(810670),r=l.n(n),i=l(438003),a=l(33862),s=l(652369),o=l(763246),d=l(30025),c=l(384836);let x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";return(null!=e?e:t).trim().replace(/[\\/:"*?<>|]+/g,"_")},m=e=>e===d.k3.PDF?"pdf":e===d.k3.TEXT?"txt":e===d.k3.SLIDE?"pptx":e===d.k3.SHEET?"xlsx":e===d.k3.IMAGE?"png":e===d.k3.AUDIO?"mp3":e===d.k3.VIDEO?"mp4":void 0;async function*p(e){var t,l,n,r,i,s,o;let d=null!==(t=e.size)&&void 0!==t?t:20,c=1,x=0,m=Number.POSITIVE_INFINITY;for(;x<m;){let t=await (0,a.oc)({...e,page:c,size:d}),p=null!==(i=null==t?void 0:null===(l=t.data)||void 0===l?void 0:l.data)&&void 0!==i?i:[];if(m=null!==(s=null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.total)&&void 0!==s?s:x+p.length,x+=p.length,0===p.length||(yield p,p.length<d))break;c=(null!==(o=null==t?void 0:null===(r=t.data)||void 0===r?void 0:r.page)&&void 0!==o?o:c)+1}}async function u(e,t){var l,n;let r=await (0,s.aq)({type:o.D.USER_FILE,parentId:e});return(null!==(n=null==r?void 0:null===(l=r.data)||void 0===l?void 0:l.data)&&void 0!==n?n:[]).map(e=>({id:String(e.id),name:e.name||t}))}async function h(e,t,l,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6,i=new Set;async function a(t,l){if(i.has(t))return{id:t,name:l||"Folder",type:"folder",children:[]};i.add(t);let s=[],o=new Map;for await(let l of p({...n,folderId:t,size:20}))for(let t of l)t.fileType===d.k3.FOLDER?o.set(t.id,{id:t.id,name:t.name||e}):s.push({id:t.id,name:(0,c.O)(t.mediaLink)||t.name||t.id,type:"file",mediaLink:t.mediaLink,extension:m(t.fileType)});for(let l of(await u(t,e)))o.set(l.id,l);let x=Array.from(o.values()),h=0;async function f(){for(;h<x.length;){let e=x[h++],t=await a(e.id,e.name);s.push(t)}}return await Promise.all(Array.from({length:Math.min(r,Math.max(1,x.length))},()=>f())),{id:t,name:l||"Folder",type:"folder",children:s}}return await a(t,l||"Root")}function f(e){return"file"===e.type?{type:"file",id:e.id,name:e.name,mediaLink:e.mediaLink,extension:e.extension}:{type:"folder",id:e.id,name:e.name,children:(e.children||[]).map(f)}}async function g(e,t,l,n,r){let i=0,a=0,s=t.length;async function o(){for(;i<s;){let n=t[i++];try{let t=await l(n.file);e.file(n.zipPath,t),a++}catch(e){console.error("Failed to download file ".concat(n.file.name,":"),e)}finally{null==r||r(a,s)}}}await Promise.all(Array.from({length:Math.min(n,Math.max(1,s))},()=>o()))}async function v(e){let{rootName:t,entries:l,fetchBlob:n,concurrency:a=6,onProgress:s}=e,o=new(r()),d=function e(t,l,n){let r=[];for(let i of l)if("folder"===i.type){let l="".concat(n).concat(x(i.name),"/");t.folder(l),r.push(...e(t,i.children||[],l))}else{let e=x(i.name||i.id)+(i.extension?".".concat(i.extension):"");r.push({file:i,zipPath:"".concat(n).concat(e)})}return r}(o,l,"");await g(o,d,n,a,s);let c=await o.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}});(0,i.saveAs)(c,"".concat(x(t),".zip"))}async function b(e){let{untitledFolder:t,rootFolderId:l,rootFolder
1Name:n,baseParams:r,fetchBlob:i,metaConcurrency:a=6,blobConcurrency:s=6,onProgress:o}=e,d=f(await h(t,l,n,r,a));await v({rootName:n,entries:[d],fetchBlob:i,concurrency:s,onProgress:o})}async function j(e){let{untitledFolder:t,selectedFiles:l,baseParams:n,metaConcurrency:r=6}=e,i=[];for(let e of l)if(e.fileType===d.k3.FOLDER){let l=await h(t,e.id,e.name||t,n,r);i.push(f(l))}else i.push({type:"file",id:e.id,name:(0,c.O)(e.mediaLink)||e.name||e.id,mediaLink:e.mediaLink,extension:m(e.fileType)});return i}},150448:(e,t,l)=>{l.d(t,{A:()=>S});var n=l(695155),r=l(652369),i=l(464476),a=l(763246),s=l(58614),o=l(643288),d=l(212115),c=l(690646),x=l(255205),m=l(485060),p=l(571362),u=l(341657),h=l(7266),f=l(669606),g=l(33941);let v=e=>{let{isOpen:t,folder:l,onRemoveFolder:r,onCancel:i,onEditFolder:a}=e,o=(0,h.useTranslations)(),c=(0,d.useRef)(null),v=(0,d.useMemo)(()=>g.Ik({name:g.Yj().trim().min(1,o("error.zod.enterFolderName")).max(255)}),[o]),[b,j]=p.A.useModal(),{setValue:y,register:w,control:N,formState:{errors:k},handleSubmit:A,reset:C}=(0,f.mN)({resolver:(0,m.u)(v)});(0,d.useEffect)(()=>{l&&y("name",l.name)},[l]);let F=async()=>{l&&b.confirm({title:(0,n.jsx)("div",{className:"font-notoSans",children:o("common.delete")}),content:(0,n.jsx)("div",{className:"font-noto",children:o("common.confirmDelete")}),okText:(0,n.jsx)("div",{className:"font-notoSans",children:o("common.delete")}),cancelText:(0,n.jsx)("div",{className:"font-notoSans",children:o("common.cancel")}),okButtonProps:{danger:!0,style:{backgroundColor:"#C53A3A",borderColor:"#C53A3A",color:"#fff"}},onOk:()=>r(l)})},E=async e=>{if(!(null==e?void 0:e.name))return;let t={...l,name:e.name};await a(t),C()};return(0,d.useEffect)(()=>{if(t&&c.current){let e=setTimeout(()=>{var e;null===(e=c.current)||void 0===e||e.focus()},100);return()=>clearTimeout(e)}},[t]),(0,n.jsxs)(n.Fragment,{children:[j,(0,n.jsx)(p.A,{title:(0,n.jsx)("div",{className:"font-notoSans text-[700] text-[18px]",children:o("common.editFolder")}),open:t,onCancel:i,footer:(0,n.jsxs)("div",{className:"flex justify-center gap-[10px] mt-[16px] font-notoSans",children:[(0,n.jsx)(s.Ay,{onClick:i,className:"!bg-white !border-[#0B2F6B] !text-[#0B2F6B] hover:!bg-white hover:!border-[#0B2F6B] hover:!text-[#0B2F6B] hover:opacity-90 transition-all w-[103px] text-[13px]",children:o("common.cancel")}),(0,n.jsx)(s.Ay,{type:"primary",onClick:A(E),className:"!bg-status-ok !text-white border-none hover:opacity-90 transition-all w-[62px] text-[13px]",children:o("common.update")}),(0,n.jsx)(s.Ay,{onClick:F,className:"!bg-status-error !text-white border-none hover:opacity-90 transition-all w-[62px] text-[13px]",children:o("common.delete")})]}),rootClassName:"non-override-modal",children:(0,n.jsx)("div",{className:"flex flex-col gap-3 font-notoSans ",children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"folder-name",className:"text-[13px] font-[500] text-[#071A3D]",children:[o("common.folderName"),":"," "]}),(0,n.jsx)(f.xI,{...w("name"),control:N,render:e=>{var t;let{field:l}=e;return(0,n.jsx)(u.A,{...l,ref:e=>{l.ref(e),c.current=e},id:"folder-name",size:"large",className:(0,x.A)("h-[36px] mt-[4px] border border-[#0B2F6B] rounded-[6px] px-[10px] text-[#0B2F6B] text-[]",{"!border-status-error":!!(null===(t=k.name)||void 0===t?void 0:t.message)})})}})]})})})]})};var b=l(83391),j=l(891812),y=l(953803),w=l(950720);function N(e){let{folder:t,onEdit:l,type:r,count:i,filePageMobile:s}=e,o=(0,b.wA)(),d=(0,b.d4)((e=>{switch(e){case a.D.COREROID:return y.fq;case a.D.PROMPT:return y.y6;case a.D.USER_FILE:return y.El;default:return y.fq}})(r)),c=(null==d?void 0:d.id)===t.id,{setNodeRef:m,isOver:p}=(0,j.zM)({id:t.id,data:{type:"Folder",folderId:t.id}});return(0,n.jsxs)("div",{ref:m,onClick:()=>{switch(t.id&&(0,w.lN)(r,t.id),r){case a.D.COREROID:o((0,y.m)(t));break;case a.D.PROMPT:o((0,y.XO)(t));break;case a.D.USER_FILE:o((0,y.dr)(t))}},className:(0,x.A)("p-[10px] text-[#0B2F6B] flex items-center justify-between rounded-[8px] cursor-pointer\n ".concat(p?"bg-[#D4E8FF]":c?"bg-[#F2F6FF]":"bg-transparent hover:bg-[#F5F8FE]"),s&&"mobile:h-[31px] mobile:rounded-[3px] mobile:border mobile:px-[8px] mobile:py-0 mobile:shadow-[0_1px_3px_#00000026]\n ".concat(p?"mobile:bg-[#D4E8FF]":c?"mobile:border-[#17306F] mobile:bg-[#17306F] mobile:text-white":"mobile:border-[#D8D1C4] mobile:bg-white")),children:[(0,n.jsxs)("div",{className:"flex gap-[7px] items-center",children:[c?(0,n.jsx)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M4.75004 11.0834L5.93754 8.78758C6.06664 8.53119 6.26301 8.31472 6.50565 8.16133C6.74829 8.00794 7.02806 7.92339 7.31504 7.91674H15.8334M15.8334 7.91674C16.0753 7.91632 16.314 7.97132 16.5313 8.07752C16.7487 8.18372 16.9387 8.33829 17.087 8.52939C17.2353 8.72048 17.3379 8.94301 17.3868 9.17989C17.4357 9.41677 17.4297 9.66171 17.3692 9.89591L16.15 14.6459C16.0618 14.9876 15.862 15.29 15.5824 15.5051C15.3027 15.7202 14.9591 15.8358 14.6063 15.8334H3.16671C2.74678 15.8334 2.34405 15.6666 2.04712 15.3697C1.75019 15.0727 1.58337 14.67 1.58337 14.2501V3.95841C1.58337 3.53848 1.75019 3.13576 2.04712 2.83882C2.34405 2.54189 2.74678 2.37508 3.16671 2.37508H6.25421C6.51901 2.37248 6.78023 2.43634 7.01397 2.56082C7.24771 2.68529 7.44649 2.8664 7.59212 3.08758L8.23337 4.03758C8.37754 4.2565 8.57381 4.4362 8.80456 4.56055C9.03531 4.68491 9.29333 4.75003 9.55546 4.75008H14.25C14.67 4.75008 15.0727 4.91689 15.3696 5.21382C15.6666 5.51076 15.8334 5.91348 15.8334 6.33341V7.91674Z",stroke:s?"currentColor":"#0B2F6B",strokeWidth:"1.34583",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,n.jsx)("svg",{width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M15.8334 15.8333C16.2533 15.8333 16.656 15.6665 16.953 15.3696C17.2499 15.0727 17.4167 14.6699 17.4167 14.25V6.33333C17.4167 5.91341 17.2499 5.51068 16.953 5.21375C16.656 4.91681 16.2533 4.75 15.8334 4.7
15H9.57921C9.31441 4.7526 9.05318 4.68873 8.81945 4.56426C8.58571 4.43978 8.38693 4.25867 8.24129 4.0375L7.60004 3.0875C7.45587 2.86858 7.2596 2.68888 7.02885 2.56452C6.7981 2.44017 6.54008 2.37504 6.27796 2.375H3.16671C2.74678 2.375 2.34405 2.54181 2.04712 2.83875C1.75019 3.13568 1.58337 3.53841 1.58337 3.95833V14.25C1.58337 14.6699 1.75019 15.0727 2.04712 15.3696C2.34405 15.6665 2.74678 15.8333 3.16671 15.8333H15.8334Z",stroke:"#071A3D",strokeWidth:"1.34583",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("span",{className:(0,x.A)("text-[12px] font-[500] text-[#071A3D] w-[80px] truncate",s&&c&&"mobile:text-white"),children:t.name})]}),(0,n.jsxs)("div",{className:"flex gap-[7px] items-center",children:[(0,n.jsx)("span",{className:"min-w-[22px] h-[22px] leading-[18px] flex items-center justify-center rounded-full border text-[12px] border-[#D8E0EF]",children:i||0}),(0,n.jsx)("span",{className:"cursor-pointer",onClick:e=>{e.stopPropagation(),l(t)},children:(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M8.00004 8.66683C8.36823 8.66683 8.66671 8.36835 8.66671 8.00016C8.66671 7.63197 8.36823 7.3335 8.00004 7.3335C7.63185 7.3335 7.33337 7.63197 7.33337 8.00016C7.33337 8.36835 7.63185 8.66683 8.00004 8.66683Z",stroke:"#8A94A6",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M8.00004 3.99984C8.36823 3.99984 8.66671 3.70136 8.66671 3.33317C8.66671 2.96498 8.36823 2.6665 8.00004 2.6665C7.63185 2.6665 7.33337 2.96498 7.33337 3.33317C7.33337 3.70136 7.63185 3.99984 8.00004 3.99984Z",stroke:"#8A94A6",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M8.00004 13.3333C8.36823 13.3333 8.66671 13.0349 8.66671 12.6667C8.66671 12.2985 8.36823 12 8.00004 12C7.63185 12 7.33337 12.2985 7.33337 12.6667C7.33337 13.0349 7.63185 13.3333 8.00004 13.3333Z",stroke:"#8A94A6",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]})}var k=l(4055),A=l(757531),C=l(98355),F=l(820385),E=l(248027),D=l(33862),L=l(825388);let I={id:"",name:""},T="FolderList.tsx";function S(e){let{type:t,roid:l,className:m,filePageMobile:p,folderCountMap:u}=e,f=(0,h.useTranslations)(),[g,j]=(0,d.useState)(null),[S,O]=(0,d.useState)(!1),{folders:R,isLoading:B,refreshFolders:z,setParams:_}=(0,i.n)({page:1,size:9999,type:t}),M=(0,b.wA)(),P=f("common.folder").replace(/[:ï¼]\s*$/,""),q=async e=>{await (0,r.g$)(e),await (0,L.Xn)(t),W(),z()},H=()=>{O(!1)},U=async e=>{H(),await (0,r.vV)(e),await (0,L.Qb)(t,e.parentId),z()},V=e=>{j(e)},$=async e=>{let l;try{switch(t){case a.D.COREROID:l=await (0,C.Ct)({folderId:e.id,page:1,size:1});break;case a.D.PROMPT:l=await (0,E.oO)({folderId:e.id,page:1,size:1});break;case a.D.USER_FILE:l=await (0,D.oc)({folderId:e.id,page:1,size:1});break;default:(0,F.m)("error",f("error.common.errorDeleteFolder"));return}if((null==l?void 0:l.status)&&l.data.data.length>0&&t!==a.D.USER_FILE){(0,F.m)("error",f("error.common.errorDeleteFolder"));return}await (0,r.sE)(e.id),await (0,L.jM)(t,e.parentId),t&&(0,w.$6)(t)===e.id&&((0,w.lN)(t,null),Z(I)),z(),W()}catch(e){(0,A.v)("".concat(T," - handleRemoveFolder"),e),console.error(e)}},W=()=>{j(null)},X=async e=>{if(!e.destination||!R)return;let t=e.source.index,l=e.destination.index;if(t===l)return;let n=[...R].sort((e,t)=>(e.no||0)-(t.no||0)),i=n[t],a=[...n];a.splice(t,1),a.splice(l,0,i);let s=a.map((e,t)=>({...e,no:t+1}));R.splice(0,R.length,...s);let o={folders:s.map((e,t)=>({folderId:e.id,no:t+1}))};try{await (0,r.di)(o)}catch(e){console.error("Error updating folder order:",e),(0,A.v)("".concat(T," - handleDragEnd Error"),e),z()}},Z=(0,d.useCallback)(e=>{var l;let n=null!==(l=null==e?void 0:e.id)&&void 0!==l?l:null;t&&(0,w.lN)(t,n);let r=n?e:I;switch(t){case a.D.COREROID:M((0,y.m)(r));break;case a.D.PROMPT:M((0,y.XO)(r));break;case a.D.USER_FILE:M((0,y.dr)(r))}},[t,M]);return(0,d.useEffect)(()=>{_({page:1,size:9999,type:t}),z()},[t,_,z]),(0,d.useEffect)(()=>{if(!R||0===R.length)return;let e=null;if(t&&(e=(0,w.$6)(t)),e)return;let l=R[0];l&&l.id&&t&&((0,w.lN)(t,String(l.id)),Z(l))},[R,t,Z]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v,{isOpen:!!g,folder:g,onEditFolder:q,onCancel:W,onRemoveFolder:$}),(0,n.jsx)(c.A,{isOpen:S,onOk:U,onCancel:H,type:t}),(0,n.jsxs)("div",{className:(0,x.A)("pc:w-[200px] w-full h-full max-h-screen overflow-hidden flex-1 overflow-y-auto bg-[#FFFFFFB2] px-[18px] py-5 font-notoSans",p&&"mobile:h-full mobile:max-h-full mobile:bg-transparent mobile:px-[6px] mobile:py-[6px]",m),children:[l?"":(0,n.jsx)(s.Ay,{onClick:()=>{O(!0)},className:(0,x.A)("px-[21px] py-[12px] gap-[6px] shadow-[0px_8px_24px_0px_#0B2F6B0D] font-[500] text-[16px] leading-[24px] text-[#0B2F6B] h-[44px] w-full border border-[#D8E0EF] rounded-[10px]",p&&"mobile:!mb-[6px]"),icon:(0,n.jsx)("img",{src:"/icons/plus-icon.svg"}),children:P}),(0,n.jsx)("div",{className:(0,x.A)("mb-[12px] mt-[20px] text-[16px] font-[400] leading-[24px] tracking-normal text-[#071A3D]",p&&"mobile:hidden"),children:P}),B?(0,n.jsxs)("div",{className:"flex flex-col gap-[11px]",children:[(0,n.jsx)(o.A.Button,{active:!0,style:{width:"100%"},size:"large"}),(0,n.jsx)(o.A.Button,{active:!0,style:{width:"100%"},size:"large"})]}):(0,n.jsx)(k.JY,{onDragEnd:X,children:(0,n.jsx)(k.gL,{droppableId:"folders",children:e=>{let l=[...R].sort((e,t)=>
1(e.no||0)-(t.no||0));return(0,n.jsxs)("div",{...e.droppableProps,ref:e.innerRef,className:(0,x.A)("flex flex-col gap-[4px]",p&&"mobile:gap-[5px]"),children:[null==l?void 0:l.map((e,l)=>(0,n.jsx)(k.sx,{draggableId:e.id,index:l,children:l=>(0,n.jsx)("div",{ref:l.innerRef,...l.draggableProps,...l.dragHandleProps,children:(0,n.jsx)(N,{folder:e,onEdit:V,type:t,count:null==u?void 0:u[e.id],filePageMobile:p})})},e.id)),e.placeholder]})}})})]})]})}},950720:(e,t,l)=>{l.d(t,{$6:()=>a,GY:()=>s,lN:()=>i});let n="selectedFolders",r=()=>{try{let e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return{}}},i=(e,t)=>{let l=r();e&&(t?l[e]=t:delete l[e],localStorage.setItem(n,JSON.stringify(l)))},a=e=>{let t=r();return e&&t[e]?t[e]:null},s=()=>{localStorage.removeItem(n)}}}]);
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.