"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2268],{1317:(e,t,r)=>{r.d(t,{G:()=>d});var n=r(91356),o=r(89032),a=r(63639),i=r(85512),s=r(37122),l=r(93510);function d({folderPath:e,disabled:t,hasChildFolders:r,onExpandRequest:c}){let[u,m]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),g=(0,n.useRef)(0),b=(0,n.useRef)(null),h=(0,a.c1)(),x=(0,l.J)(e=>e.clearSelection),v=(0,l.J)(e=>e.draggingItems),w=(0,l.J)(e=>e.setDraggingItems),y=(0,n.useCallback)(()=>{null!==b.current&&(window.clearTimeout(b.current),b.current=null)},[]),k=(0,n.useCallback)(e=>(0,i.Jz)(e.dataTransfer)??v,[v]),_=(0,n.useCallback)(r=>!(t||!r||0===r.length||(0,s.IV)(r,e)||(0,s.Jd)(r,e)),[t,e]),C=(0,n.useCallback)(e=>{t||_(v)&&(e.preventDefault(),e.dataTransfer.dropEffect="move",f(!0),r&&c&&null===b.current&&(b.current=window.setTimeout(()=>{b.current=null,c()},700)))},[t,v,_,r,c]),j=(0,n.useCallback)(e=>{t||(g.current+=1,1===g.current&&(m(!0),f(_(v))))},[t,v,_]),P=(0,n.useCallback)(()=>{g.current=Math.max(0,g.current-1),0===g.current&&(m(!1),f(!1),y())},[y]),S=(0,n.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),g.current=0,m(!1),f(!1),y(),t)return;let n=k(r);!n||((0,s.IV)(n,e)?o.oR.error("Impossible de d\xe9placer un dossier dans lui-m\xeame"):(0,s.Jd)(n,e)||(async()=>{try{await (0,s.$z)(n,e,e=>h.move.mutateAsync(e)),o.oR.success(n.length>1?"\xc9l\xe9ments d\xe9plac\xe9s":"\xc9l\xe9ment d\xe9plac\xe9"),x()}catch{o.oR.error("Impossible de d\xe9placer")}finally{w(null)}})())},[y,x,t,e,h.move,k,w]);return{isOver:u,canDrop:p,dropProps:t?{}:{onDragOver:C,onDragEnter:j,onDragLeave:P,onDrop:S}}}},12197:(e,t,r)=>{r.d(t,{a:()=>o});var n=r(91356);function o(){let[e,t]=n.useState(void 0);return n.useEffect(()=>{let e=window.matchMedia("(max-width: 767px)"),r=()=>{t(window.innerWidth<768)};return e.addEventListener("change",r),t(window.innerWidth<768),()=>e.removeEventListener("change",r)},[]),!!e}},34389:(e,t,r)=>{r.d(t,{N2:()=>s,v5:()=>l});var n=r(4208),o=r(91356);let a="drive",i=(0,o.createContext)(a);function s({routeRoot:e=a,children:t}){return(0,n.jsx)(i.Provider,{value:e,children:t})}function l(){return(0,o.useContext)(i)}},37570:(e,t,r)=>{r.d(t,{mn:()=>o,xM:()=>i,LZ:()=>s});var n=r(91356);let o=639,a=`(max-width: ${o}px)`;function i(){return window.matchMedia(a).matches}function s(){return function(e){let[t,r]=(0,n.useState)(!1);return(0,n.useLayoutEffect)(()=>{let t=window.matchMedia(e),n=0,o=()=>{cancelAnimationFrame(n),n=requestAnimationFrame(()=>{let e=t.matches;r(t=>t===e?t:e)})};return o(),t.addEventListener("change",o),()=>{t.removeEventListener("change",o),cancelAnimationFrame(n)}},[e]),t}(a)}},39134:(e,t,r)=>{r.d(t,{yy:()=>R,sV:()=>S,Hg:()=>$});var n=r(4208),o=r(91356),a=r(89032),i=r(37841),s=r(5251),l=r(63429),d=r(63639),c=r(22854),u=r(41733),m=r(74036),p=r(12197),f=r(82923),g=r(19912);let b={"text-amber-500":"#f59e0b","text-amber-600":"#d97706","text-blue-500":"#3b82f6","text-blue-600":"#2563eb","text-green-600":"#16a34a","text-red-500":"#ef4444","text-red-600":"#dc2626","text-rose-500":"#f43f5e","text-[#5f6368]":"#5f6368"},h=null;function x(){h?.remove(),h=null}var v=r(85512),w=r(68365),y=r(93510),k=r(1317),_=r(26715),C=r(65225),j=r(44410),P=r(58113);let S=(0,P.cn)(j.hz,"z-50 min-w-[12rem] p-1"),R="ring-2 ring-[#1a73e8] ring-inset bg-[#e8f0fe] dark:bg-primary/20";function $({file:e,allItems:t,isTrash:r,allowShare:j=!0,writable:D=!0,hideFavorite:A=!1,disableDnd:N=!1,mutations:T,onDownloadRequest:L,onOpen:z,children:E,className:I,variant:F="default",registerRef:J,onItemClick:U,onContextMenuActiveChange:M}){let K=(0,p.a)(),O="grid"===F,q=(0,f.qP)(),Q=!K&&!r&&!N,W="directory"===e.type,{dragProps:G}=function({file:e,allItems:t,disabled:r}){let n=(0,y.J)(e=>e.selectedPaths),a=(0,y.J)(e=>e.setDraggingItems),i=(0,o.useCallback)(o=>{if(r||(0,w.cP)(o.target))return void o.preventDefault();let i=(0,v.t2)(e,n,t),s=i.map(e=>t.find(t=>t.path===e.path)).filter(e=>!!e);(0,v.R7)(o.dataTransfer,i),function(e,t,r){let n,o,a,i;if(x(),0===t.length)return;let s=(n=t[0],o=1===t.length?(0,c._g)(n.name):`${t.length} \xe9l\xe9ment${t.length>1?"s":""}`,(a=document.createElement("div")).style.cssText="width:200px;height:48px;box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:0 12px;border-radius:12px;border:1px solid rgba(232,234,237,0.8);background:#f8f9fa;box-shadow:0 2px 8px rgba(60,64,67,0.28);font-family:system-ui,sans-serif;font-size:14px;font-weight:500;color:#3c4043;pointer-events:none",!function(e,t,r){let n=document.createElement("span");n.setAttribute("data-drive-type-icon",""),n.style.cssText="display:inline-flex;width:20px;height:20px;flex-shrink:0;align-items:center;justify-content:center;";let o=r?.closest("[data-drive-card]")??r??null,a=o?.querySelector("[data-drive-type-icon] svg");if(a){let e=a.cloneNode(!0);e.setAttribute("width","20"),e.setAttribute("height","20"),e.style.width="20px",e.style.height="20px",n.appendChild(e)}else{let e,{icon:r,color:o}="folder"===(e=(0,g._X)(t))?(0,g.Lm)(t):(0,g.Hi)(e),a=document.createElement("img");a.src=function(e,t){let[r,n]=e.split(":");return`https://api.iconify.design/${r}/${n}.svg?width=24&height=24&color=${encodeURIComponent(t)}`}(r,b[o]??"#5f6368"),a.width=20,a.height=20,a.alt="",a.draggable=!1,a.style.display="block",n.appendChild(a)}e.appendChild(n)}(a,n,r),(i=document.createElement("span")).textContent=o,i.style.cssText="min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;",a.appendChild(i),a);s.style.position="fixed",s.style.left="-9999px",s.style.top="0",s.style.zIndex="99999",document.body.appendChild(s),h=s,e.setDragImage(s,100,24)}(o.dataTransfer,s.length>0?s:[e],o.currentTarget),a(i)},[t,r,e,n,a]),s=(0,o.useCallback)(()=>{x(),a(null)},[a]);return r?{dragProps:{}}:{dragProps:{draggable:!0,onDragStart:i,onDragEnd:s}}}({file:e,allItems:t,disabled:!Q}),{dropProps:H,canDrop:V,isOver:B}=(0,k.G)({folderPath:e.path,disabled:!Q||!W}),[Y,X]=(0,o.useState)(!1),[Z,ee]=(0,o.useState)(!1),[et,er]=(0,o.useState)(!1),[en,eo]=(0,o.useState)(null),ea=(0,y.J)(e=>e.selectedPaths),ei=(0,y.J)(e=>e.selectionMode),es=(0,y.J)(e=>e.toggleSelect),el=(0,y.J)(e=>e.enterSelectionMode),ed=(0,y.J)(e=>e.setSharePath),ec=(0,d.c1)(),eu=T??ec,em=(0,o.useCallback)(()=>{(0,w.ij)(),window.setTimeout(()=>ee(!0),0)},[]),ep=(0,o.useMemo)(()=>[e],[e]),ef=(0,o.useCallback)(()=>X(!0),[]),eg=(0,m.H)(ef,{disabled:!K}),eb=(0,o.useRef)(null),eh=(0,o.useRef)(!1),ex=(0,o.useCallback)(e=>{eb.current={x:e.clientX,y:e.clientY},eh.current=!1,eg.onPointerDown(e)},[eg]),ev=(0,o.useCallback)(e=>{let t=eb.current;if(!t)return;let r=e.clientX-t.x,n=e.clientY-t.y;r*r+n*n>100&&(eh.current=!0)},[]),ew=(0,o.useCallback)(()=>{eb.current=null,eg.onPointerUp()},[eg]),ey=(0,o.useCallback)(e=>{eg.onClickCapture(e),eh.current&&(e.preventDefault(),e.stopPropagation(),eh.current=!1)},[eg]),ek=async e=>{let t=ep[0];if(!t)return;let r=(0,u.m)(t,e);if((0,c._g)(t.name)!==r)try{await eu.rename.mutateAsync({path:t.path,new_name:r}),a.oR.success("Renomm\xe9")}catch{throw a.oR.error("Impossible de renommer"),Error("rename failed")}},e_=e=>(0,w.cP)(e)||(0,w.jL)(),eC=K?{onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),ef()},onPointerDown:ex,onPointerMove:ev,onPointerUp:ew,onPointerLeave:ew,onPointerCancel:ew,onClickCapture:ey}:{},ej=(0,o.useCallback)(e=>{if(e){er(!0),M?.(!0);return}er(!1),M?.(!1),(0,w.ij)()},[M]),eP=(0,o.useCallback)(()=>{ej(!1)},[ej]),eS=(0,f.Ph)(e.path,J,q),eR=ea.has(e.path),e$=(0,n.jsx)("div",{ref:eS,"data-drive-card":!0,"data-path":e.path,className:(0,P.cn)(I,!O&&K&&eg.ackClassName,W&&B&&V&&R,eR&&"bg-mail-active"),onClick:K?t=>{if(e_(t.target)){t.preventDefault(),t.stopPropagation();return}(t.preventDefault(),t.stopPropagation(),ei)?es(e.path,!ea.has(e.path)):z()}:U?t=>{if(e_(t.target)){t.preventDefault(),t.stopPropagation();return}U?.(e,t)}:t=>{if(e_(t.target)){t.preventDefault(),t.stopPropagation();return}(t.ctrlKey||t.metaKey)&&(t.preventDefault(),t.stopPropagation(),es(e.path,!ea.has(e.path)))},onDoubleClick:K?void 0:U?e=>{if(e_(e.target)){e.preventDefault(),e.stopPropagation();return}e.preventDefault(),e.stopPropagation(),z()}:void 0,...G,...H,...!O&&K?{...eC,onPointerDown:t=>{"mouse"===t.pointerType&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),es(e.path,!ea.has(e.path))),K&&ex(t)}}:K?eC:{},children:E}),eD=1===ep.length?ep[0]:null,eA=e=>{X(!1),window.setTimeout(()=>eo(e),0)},eN={targets:ep,isTrash:r,allowShare:j,writable:D,hideFavorite:A,onOpen:z,setSharePath:ed,mutations:eu,onRenameRequest:em,onMoveRequest:r||N?void 0:()=>eA("move"),onCopyRequest:r||N?void 0:()=>eA("copy"),onDownloadRequest:L,onEnterSelectionMode:r?void 0:()=>{el(e.path)}},eT=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.a,{open:Z,onOpenChange:ee,title:"Renommer",defaultValue:eD?(0,c._g)(eD.name):"",confirmLabel:"Renommer",onConfirm:ek}),(0,n.jsx)(l.m,{open:null!==en,onOpenChange:e=>{e||eo(null)},mode:en??"move",sources:ep}),(0,n.jsx)(s.cj,{open:Y,onOpenChange:X,children:(0,n.jsxs)(s.h,{side:"bottom",hideClose:!0,className:"gap-0 overflow-hidden rounded-t-2xl border-border px-0 pb-[max(1rem,env(safe-area-inset-bottom))] pt-2",children:[(0,n.jsx)(s.qp,{className:"sr-only",children:ep.length>1?`${ep.length} \xe9l\xe9ments`:(0,c._g)(e.name)}),(0,n.jsx)(s.Qs,{className:"sr-only",children:ep.length>1?`Actions pour ${ep.length} \xe9l\xe9ments s\xe9lectionn\xe9s.`:`Actions pour ${(0,c._g)(e.name)}.`}),(0,n.jsx)("p",{className:"truncate px-4 pb-2 text-sm font-medium text-muted-foreground",children:ep.length>1?`${ep.length} \xe9l\xe9ments s\xe9lectionn\xe9s`:(0,c._g)(e.name)}),(0,n.jsx)("div",{className:"flex flex-col border-t border-border",children:(0,n.jsx)(C.Lp,{variant:"sheet",...eN,onClose:()=>X(!1),onRenameRequest:()=>{X(!1),em()}})})]})})]});if(K)return(0,n.jsxs)(n.Fragment,{children:[e$,eT]});let eL=(0,n.jsxs)(i.tz,{open:et,onOpenChange:ej,children:[(0,n.jsx)(i.Rc,{asChild:!0,children:e$}),(0,n.jsx)(i.Ip,{"data-drive-menu-surface":!0,className:(0,P.cn)(S,"w-52"),onCloseAutoFocus:e=>e.preventDefault(),children:(0,n.jsx)(C.Lp,{variant:"context",...eN,onClose:eP})})]});return(0,n.jsxs)(n.Fragment,{children:[eL,eT]})}},42491:(e,t,r)=>{r.d(t,{m:()=>i});var n=r(71092);function o(e,t=400,r=300){return`https://picsum.photos/seed/${encodeURIComponent(e.file_id?`ultimail-drive-${e.file_id}`:`ultimail-drive-${e.path}`)}/${t}/${r}`}let a={"/Perso/Notes r\xe9union.txt":`# Notes r\xe9union — 9 juin - Roadmap Q3 valid\xe9e en comit\xe9 - Beta agenda : livraison cible vendredi - Design system : tokens couleur \xe0 figer - Prochaine d\xe9mo interne jeudi 11h`,"/Release notes v2.3.txt":`# Ultimail v2.3 ## Nouveaut\xe9s - UltiCal : visio UltiMeet int\xe9gr\xe9e aux \xe9v\xe9nements - UltiDrive : favoris et corbeille unifi\xe9s - Contacts : fusion et labels personnalis\xe9s ## Corrections - Sync calendrier CalDAV sur \xe9v\xe9nements r\xe9currents - Aper\xe7u PDF plus rapide sur gros fichiers`};function i(e,t){var r,i;let s=t?.width??1200,l=t?.height??900;if((0,n.dJ)(e)){let t;return{type:"svg",markup:(t=(r=e.name).replace(/\.svg$/i,""),/logo/i.test(r)?` U ${t} `:` ${t} `)}}let d=(0,n.tF)(e);if("text"===d)return{type:"text",content:a[e.path]??(i=e.name,`# ${i.replace(/\.[^.]+$/,"")} Contenu de d\xe9monstration — fichier fictif pour la landing page Ultimail.`)};if("image"===d||"pdf"===d)return{type:"url",url:o(e,s,l),display:"image"};let c=(e.mime_type??"").toLowerCase();return c.includes("officedocument")||c.includes("spreadsheet")||c.includes("presentation")||c.includes("msword")?{type:"url",url:o(e,s,l),display:"image"}:null}},44410:(e,t,r)=>{r.d(t,{$i:()=>m,$p:()=>z,AO:()=>c,Az:()=>b,Bh:()=>L,Cc:()=>v,DO:()=>V,E1:()=>k,E7:()=>E,Fr:()=>F,G7:()=>q,HU:()=>Z,I8:()=>D,IK:()=>M,KZ:()=>u,LQ:()=>$,Mz:()=>P,PG:()=>S,Q5:()=>Y,QU:()=>_,R5:()=>ee,RA:()=>p,Sh:()=>s,TN:()=>H,Un:()=>l,Ww:()=>G,Yh:()=>W,Yj:()=>g,a9:()=>f,c7:()=>x,d9:()=>er,gS:()=>i,h6:()=>C,hf:()=>N,hn:()=>O,hz:()=>o,i1:()=>j,il:()=>w,j7:()=>K,l9:()=>d,lK:()=>T,lQ:()=>U,l_:()=>h,nr:()=>a,pK:()=>J,sF:()=>X,th:()=>A,tv:()=>eo,uU:()=>y,wC:()=>et,wJ:()=>R,wf:()=>B,wo:()=>en,yv:()=>Q});var n=r(58113);let o=(0,n.cn)("min-w-[220px] rounded-lg border border-border bg-popover p-0 py-1 text-popover-foreground shadow-lg","[&_[data-slot=dropdown-menu-item]]:gap-3 [&_[data-slot=dropdown-menu-item]]:rounded-none","[&_[data-slot=dropdown-menu-item]]:px-3 [&_[data-slot=dropdown-menu-item]]:py-2 [&_[data-slot=dropdown-menu-item]]:text-sm","[&_[data-slot=dropdown-menu-item]]:focus:bg-accent [&_[data-slot=dropdown-menu-item]]:focus:text-accent-foreground","[&_[data-slot=dropdown-menu-sub-trigger]]:gap-3 [&_[data-slot=dropdown-menu-sub-trigger]]:rounded-none","[&_[data-slot=dropdown-menu-sub-trigger]]:px-3 [&_[data-slot=dropdown-menu-sub-trigger]]:py-2","[&_[data-slot=dropdown-menu-sub-trigger]]:text-sm","[&_[data-slot=dropdown-menu-sub-trigger]]:focus:bg-accent","[&_[data-slot=dropdown-menu-sub-trigger]]:data-[state=open]:bg-accent","[&_[data-slot=dropdown-menu-sub-content]]:min-w-[200px]","[&_[data-slot=dropdown-menu-sub-content]]:rounded-lg","[&_[data-slot=dropdown-menu-sub-content]]:border [&_[data-slot=dropdown-menu-sub-content]]:border-border","[&_[data-slot=dropdown-menu-sub-content]]:bg-popover","[&_[data-slot=dropdown-menu-sub-content]]:p-0 [&_[data-slot=dropdown-menu-sub-content]]:py-1","[&_[data-slot=dropdown-menu-sub-content]]:shadow-lg","[&_[data-slot=dropdown-menu-separator]]:mx-0 [&_[data-slot=dropdown-menu-separator]]:my-1","[&_[data-slot=dropdown-menu-separator]]:bg-border","[&_[data-slot=context-menu-item]]:focus:bg-accent [&_[data-slot=context-menu-item]]:focus:text-accent-foreground","[&_[data-slot=context-menu-sub-trigger]]:focus:bg-accent","[&_[data-slot=context-menu-sub-content]]:border-border [&_[data-slot=context-menu-sub-content]]:bg-popover"),a=(0,n.cn)(o,"min-w-[280px]"),i=(0,n.cn)("min-w-[240px] border-border bg-popover p-0 py-1.5 text-popover-foreground shadow-md","[&_[data-slot=dropdown-menu-label]]:text-muted-foreground","[&_[data-slot=dropdown-menu-item]]:text-popover-foreground","[&_[data-slot=dropdown-menu-item]]:focus:bg-accent [&_[data-slot=dropdown-menu-item]]:focus:text-accent-foreground","[&_[data-slot=dropdown-menu-sub-trigger]]:text-popover-foreground","[&_[data-slot=dropdown-menu-sub-trigger]]:focus:bg-accent","[&_[data-slot=dropdown-menu-sub-trigger]]:data-[state=open]:bg-accent","[&_[data-slot=context-menu-label]]:text-muted-foreground","[&_[data-slot=context-menu-item]]:text-popover-foreground","[&_[data-slot=context-menu-item]]:focus:bg-accent [&_[data-slot=context-menu-item]]:focus:text-accent-foreground","[&_[data-slot=context-menu-sub-trigger]]:text-popover-foreground","[&_[data-slot=context-menu-sub-trigger]]:focus:bg-accent","[&_[data-slot=context-menu-sub-trigger]]:data-[state=open]:bg-accent"),s=(0,n.cn)("mx-1 flex cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm text-popover-foreground","focus:bg-accent focus:text-accent-foreground"),l=(0,n.cn)("mx-1 cursor-pointer rounded-sm px-2 py-2 text-popover-foreground","focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent"),d=(0,n.cn)("mx-1 cursor-pointer px-3 py-2 text-sm text-popover-foreground focus:bg-accent focus:text-accent-foreground"),c="my-1.5 bg-border",u="border-border bg-mail-surface ring-offset-background hover:ring-muted-foreground focus-visible:ring-ring",m=(0,n.cn)("min-w-[180px] border-border bg-popover p-2 text-popover-foreground shadow-md"),p="text-muted-foreground hover:bg-accent hover:text-accent-foreground";(0,n.cn)("border border-border bg-mail-surface-elevated text-foreground shadow-xl"),(0,n.cn)("h-9 w-9 shrink-0 text-muted-foreground hover:bg-accent hover:text-accent-foreground");let f="dark:!text-white",g="min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-y-contain [scrollbar-gutter:stable] outline-none max-sm:pb-16 [scrollbar-color:color-mix(in_srgb,var(--muted-foreground)_55%,transparent)_transparent] [scrollbar-width:auto] [&::-webkit-scrollbar]:w-2.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/45",b="bg-gradient-to-b from-transparent via-mail-surface/90 to-mail-surface pt-3",h=(0,n.cn)("inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-full border border-border","bg-mail-surface px-6 py-2.5 text-sm font-medium text-foreground shadow-sm","transition-shadow hover:bg-accent hover:shadow-md"),x=(0,n.cn)("mx-6 mb-4 rounded-xl border border-border bg-mail-invitation px-4 py-3 shadow-sm"),v="hover:bg-accent/60",w=(0,n.cn)("flex h-10 shrink-0 cursor-pointer items-center rounded-t-lg bg-muted px-3","dark:bg-[#2d2e30]"),y=(0,n.cn)("border-border bg-popover p-3 text-popover-foreground shadow-lg"),k="bg-accent text-accent-foreground",_=(0,n.cn)("flex h-7 w-7 items-center justify-center rounded text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground disabled:opacity-40"),C="bg-accent text-foreground",j="mx-0.5 h-5 w-px bg-border",P=(0,n.cn)("flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground"),S="bg-accent text-foreground",R=(0,n.cn)("inline-flex h-9 items-center bg-primary text-primary-foreground","hover:bg-primary/90 hover:shadow-md transition-all"),$="ml-3 border-b border-border",D="bg-primary/10",A="hover:bg-accent",N=(0,n.cn)("inline-flex items-center gap-1 rounded-full bg-muted py-0.5 pl-0.5 pr-2 text-sm text-foreground","hover:bg-accent transition-colors"),T=(0,n.cn)("absolute inset-0 z-50 flex items-center justify-center rounded-lg border-2 border-dashed border-primary","bg-primary/5");(0,n.cn)("pointer-events-auto size-9 shrink-0 rounded-full border border-border","bg-mail-surface/80 text-muted-foreground shadow-md backdrop-blur","hover:bg-accent hover:text-accent-foreground");let L="border border-border bg-popover text-popover-foreground shadow-md",z="",E=(0,n.cn)("relative box-border w-full max-w-full overflow-hidden rounded-xl border border-border","bg-mail-surface text-foreground shadow-md ring-1 ring-primary/15"),I=(0,n.cn)("size-4 min-h-4 min-w-4 shrink-0 border-[1.5px] border-mail-row-checkbox-border bg-transparent shadow-none","dark:bg-transparent focus-visible:ring-mail-row-checkbox-border/30","data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground"),F=(0,n.cn)(I,"rounded-full"),J=(0,n.cn)(I,"rounded-[2.5px]"),U="divide-y divide-mail-list-divider";(0,n.cn)("relative flex min-w-0 flex-1 items-center rounded-full border border-border","bg-mail-surface-elevated shadow-sm transition-shadow focus-within:shadow-md");let M="border-mail-border",K=(0,n.cn)("border-mail-list-chip-border bg-mail-list-chip-muted text-mail-list-chip-text"),O=(0,n.cn)("rounded-md border border-solid !border-mail-border bg-mail-surface-muted text-foreground shadow-none","focus-visible:!border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","dark:!border-mail-border dark:!bg-mail-surface-muted"),q=(0,n.cn)("size-4 border-[1.5px] border-mail-row-checkbox-border bg-mail-surface-muted shadow-none","dark:bg-mail-surface-muted","data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground","data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground"),Q=(0,n.cn)("bg-mail-surface-elevated/80 backdrop-blur-xl backdrop-saturate-150","supports-[backdrop-filter]:bg-mail-surface-elevated/65"),W=(0,n.cn)("absolute left-0 right-0 top-full z-50 mt-1 overflow-hidden rounded-lg border text-foreground shadow-lg",M,Q),G=(0,n.cn)("absolute left-0 top-full z-50 mt-1 max-h-[80vh] overflow-y-auto rounded-lg border",M,"bg-mail-surface-elevated text-foreground shadow-lg","data-mail-search-advanced","sm:min-w-[34rem] sm:max-w-[min(42rem,calc(100vw-5rem))]","md:min-w-[38rem]","lg:right-0 lg:min-w-0 lg:max-w-none"),H=(0,n.cn)("z-[101] flex h-[100dvh] max-h-[100dvh] w-full flex-col gap-0 rounded-none border-0","bg-mail-surface text-foreground p-0 shadow-xl","duration-300 ease-out","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom","pb-[env(safe-area-inset-bottom)]","data-mail-mobile-search"),V=(0,n.cn)("max-sm:bg-app-canvas/80 max-sm:backdrop-blur-xl max-sm:backdrop-saturate-150 max-sm:supports-[backdrop-filter]:bg-app-canvas/65","sm:bg-transparent"),B="mail-sidebar-blur-surface",Y="mail-sidebar-overlay-panel",X=(0,n.cn)("flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground","outline-none hover:bg-accent/80 focus-visible:ring-2 focus-visible:ring-ring/50");function Z(e){return(0,n.cn)("transition-colors",e.isSelected?"bg-mail-nav-selected text-mail-nav-selected font-medium":e.isOver?"bg-mail-nav-drop text-foreground":e.rowHoverHeld?"bg-mail-nav-hover text-foreground":e.hasUnread?"text-foreground hover:bg-mail-nav-hover":"text-muted-foreground hover:bg-mail-nav-hover",e.extra)}let ee="flex min-h-0 min-w-0 flex-1 flex-col px-1 pb-1 max-sm:px-0 max-sm:pb-0",et="flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl bg-mail-surface shadow-sm max-sm:rounded-none max-sm:shadow-none",er=(0,n.cn)("flex h-auto w-fit max-w-full flex-wrap gap-1.5","[&_[data-slot=tabs-trigger]]:flex-none"),en=(0,n.cn)("mail-settings-card rounded-lg border border-mail-border bg-mail-surface shadow-sm","dark:bg-mail-surface-elevated dark:shadow-[0_1px_4px_rgba(0,0,0,0.35)]"),eo=(0,n.cn)("mail-settings-masonry-section border-border px-0 py-5","lg:rounded-xl lg:border lg:border-mail-border lg:bg-mail-surface lg:px-5 lg:py-5 lg:shadow-sm","dark:lg:bg-mail-surface-elevated dark:lg:shadow-[0_1px_4px_rgba(0,0,0,0.35)]")},59357:(e,t,r)=>{r.d(t,{CE:()=>g,FJ:()=>u,M3:()=>d,Mx:()=>n,QW:()=>c,Rf:()=>f,Sz:()=>l,bQ:()=>p,db:()=>s,jW:()=>a,r0:()=>o,sb:()=>m,vu:()=>i});let n="px-1 max-sm:px-0",o="px-4",a="pt-3",i="pb-4",s="shrink-0 h-6 max-sm:h-[calc(5.5rem+env(safe-area-inset-bottom))]",l="text-muted-foreground hover:bg-mail-nav-hover hover:text-foreground",d="group flex min-w-0 items-center rounded-lg text-sm",c="flex h-7 w-6 shrink-0 items-center justify-center",u="flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-2",m="flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full text-muted-foreground hover:bg-mail-nav-hover",p="bg-mail-nav-hover",f="relative flex h-12 w-full min-w-0 shrink-0 items-center rounded-full border border-border bg-mail-surface-elevated shadow-sm transition-shadow focus-within:shadow-md",g="flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl bg-mail-surface shadow-sm max-sm:rounded-none max-sm:shadow-none"},65225:(e,t,r)=>{r.d(t,{L0:()=>C,Lp:()=>P});var n=r(4208),o=r(89032),a=r(81613),i=r(14948),s=r(40230),l=r(18584),d=r(61760),c=r(71809),u=r(99833),m=r(38716),p=r(78606),f=r(5312),g=r(84834),b=r(37841),h=r(51551),x=r(68365),v=r(58113),w=r(90992),y=r(36041);let k="gap-3 py-2 text-[#3c4043] focus:text-[#3c4043] dark:text-[#e8eaed] dark:focus:text-[#e8eaed] [&_svg]:text-[#3c4043] dark:[&_svg]:text-[#e8eaed]",_="gap-3 py-2 text-destructive focus:text-destructive [&_svg]:text-destructive";function C(e){return"file"===e.type||"directory"===e.type}function j({children:e}){return(0,n.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:e})}function P({variant:e,targets:t,isTrash:r,allowShare:S=!0,writable:R=!0,hideOpen:$=!1,hideFavorite:D=!1,onOpen:A,onClose:N,setSharePath:T,mutations:L,onRenameRequest:z,onMoveRequest:E,onCopyRequest:I,onDownloadRequest:F,onQuickLinkRequest:J,onEnterSelectionMode:U}){let M=1===t.length?t[0]:null,K=t.length>1,O=M?(0,y.M0)(M):null,q=async(e,t,r)=>{N?.();try{await e(),o.oR.success(t)}catch{o.oR.error(r)}},Q=(e,t,r,n)=>{((0,x.ij)(),N?.(),t&&r&&n)?q(t,r,n):e()},W=t.every(e=>e.is_favorite)?"Retirer des favoris":"Ajouter aux favoris",G=async()=>{for(let e of t)await L.favorite.mutateAsync({path:e.path,favorite:!e.is_favorite})},H=async()=>{for(let e of t)await L.deleteFile.mutateAsync(e.path)},V=async()=>{for(let e of t)await L.restore.mutateAsync((0,w.n)(e))},B=async()=>{for(let e of t)await L.deleteTrash.mutateAsync((0,w.n)(e))},Y=[{key:"open",label:O?.label??"Ouvrir",icon:O?(0,n.jsx)(g.In,{icon:O.icon,className:"h-4 w-4","aria-hidden":!0}):(0,n.jsx)(a.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!$&&!K&&!!M,onSelect:()=>Q(()=>window.setTimeout(()=>A(),0))},{key:"select",label:"S\xe9lectionner",icon:(0,n.jsx)(i.A,{className:"h-4 w-4","aria-hidden":!0}),visible:"sheet"===e&&!!(!r&&M&&U),onSelect:()=>Q(()=>{window.setTimeout(()=>U?.(),0)})},{key:"share",label:"Partager",icon:(0,n.jsx)(s.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!(!r&&S&&!K&&M&&C(M)),onSelect:()=>Q(()=>T(M.path,M.type))},{key:"copy",label:K?`Copier vers (${t.length})`:"Copier vers",icon:(0,n.jsx)(l.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!(R&&!r&&I),onSelect:()=>Q(()=>{window.setTimeout(()=>I?.(),0)})},{key:"move",label:K?`D\xe9placer vers (${t.length})`:"D\xe9placer vers",icon:(0,n.jsx)(d.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!(R&&!r&&E),onSelect:()=>Q(()=>{window.setTimeout(()=>E?.(),0)})},{key:"download",label:"T\xe9l\xe9charger",icon:(0,n.jsx)(c.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!(!r&&F),onSelect:()=>Q(()=>{window.setTimeout(()=>F?.(),0)})},{key:"quick-link",label:"Obtenir le lien",icon:(0,n.jsx)(s.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!(!r&&J&&M),onSelect:()=>Q(()=>{window.setTimeout(()=>J?.(),0)})},{key:"favorite",label:W,icon:(0,n.jsx)(u.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!r&&!D,onSelect:()=>Q(()=>{},G,"Retirer des favoris"===W?"Retir\xe9 des favoris":"Ajout\xe9 aux favoris","Impossible de modifier les favoris")},{key:"restore",label:`Restaurer${K?` (${t.length})`:""}`,icon:(0,n.jsx)(m.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!r,onSelect:()=>Q(()=>{},V,"\xc9l\xe9ment(s) restaur\xe9(s)","Impossible de restaurer")},{key:"delete-trash",label:`Supprimer d\xe9finitivement${K?` (${t.length})`:""}`,icon:(0,n.jsx)(p.A,{className:"h-4 w-4","aria-hidden":!0}),destructive:!0,visible:!!(r&&R),onSelect:()=>Q(()=>{},B,"\xc9l\xe9ment(s) supprim\xe9(s) d\xe9finitivement","Impossible de supprimer d\xe9finitivement")},{key:"rename",label:"Renommer",icon:(0,n.jsx)(f.A,{className:"h-4 w-4","aria-hidden":!0}),visible:!!(R&&!r&&M&&!K),onSelect:()=>Q(()=>{window.setTimeout(()=>z(),0)})},{key:"delete",label:`Supprimer${K?` (${t.length})`:""}`,icon:(0,n.jsx)(p.A,{className:"h-4 w-4","aria-hidden":!0}),destructive:!0,visible:R&&!r,onSelect:()=>Q(()=>{},H,"Supprim\xe9","Impossible de supprimer")}];return"sheet"===e?(0,n.jsx)(n.Fragment,{children:Y.filter(e=>e.visible).map(e=>(0,n.jsxs)("button",{type:"button",className:(0,v.cn)("flex w-full items-center gap-3 px-4 py-3 text-left text-sm text-[#3c4043] transition-colors hover:bg-accent active:bg-accent/80 dark:text-[#e8eaed] [&_svg]:text-[#3c4043] dark:[&_svg]:text-[#e8eaed]",e.destructive&&"text-destructive hover:bg-destructive/10 active:bg-destructive/15 [&_svg]:text-destructive"),onPointerDown:e=>(0,x.Kk)(e),onClick:()=>{(0,x.ij)(),e.onSelect()},children:[(0,n.jsx)(j,{children:e.icon}),e.label]},e.key))}):"context"===e?(0,n.jsx)(n.Fragment,{children:Y.filter(e=>e.visible).map(e=>{let t;return(0,n.jsxs)(b.kt,{variant:e.destructive?"destructive":"default",className:(0,v.cn)(e.destructive?_:k),onPointerDown:e=>(0,x.Kk)(e),onSelect:(t=e.onSelect,()=>{(0,x.ij)(),N?.(),window.setTimeout(t,0)}),children:[(0,n.jsx)(j,{children:e.icon}),e.label]},e.key)})}):(0,n.jsx)(n.Fragment,{children:Y.filter(e=>e.visible).map(e=>(0,n.jsxs)(h._2,{variant:e.destructive?"destructive":"default",className:(0,v.cn)(e.destructive?_:k),onPointerDown:e=>(0,x.Kk)(e),onSelect:()=>e.onSelect(),children:[(0,n.jsx)(j,{children:e.icon}),e.label]},e.key))})}},68365:(e,t,r)=>{r.d(t,{Kk:()=>l,cP:()=>o,ij:()=>i,jL:()=>a,wI:()=>s});var n=r(93510);function o(e){return e instanceof Element&&null!=e.closest('[data-drive-menu-btn],[data-drive-menu-surface],[data-slot="dropdown-menu-content"],[data-slot="dropdown-menu-item"],[data-slot="context-menu-content"],[data-slot="context-menu-item"]')}function a(){return Date.now(){r.d(t,{H:()=>o});var n=r(91356);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null),a=(0,n.useRef)(!1),i=t?.delay??500,s=t?.disabled??!1,l=t?.ack??!0,[d,c]=(0,n.useState)(!1),u=(0,n.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),c(!1)},[]),m=(0,n.useCallback)(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),p=(0,n.useCallback)(()=>{l&&(u(),c(!0),o.current=setTimeout(()=>{c(!1),o.current=null},280))},[u,l]);return{onPointerDown:(0,n.useCallback)(t=>{s||("mouse"!==t.pointerType||0===t.button)&&(a.current=!1,m(),r.current=setTimeout(()=>{a.current=!0,p(),e()},i))},[m,i,s,e,p]),onPointerUp:m,onPointerLeave:m,onPointerCancel:m,onClickCapture:(0,n.useCallback)(e=>{a.current&&(e.preventDefault(),e.stopPropagation(),a.current=!1)},[]),ackActive:d,ackClassName:d?"long-press-ack":void 0}}},76414:(e,t,r)=>{r.d(t,{rN:()=>g,V8:()=>h});var n=r(91356),o=r(19984),a=r(39927),i=r(89032),s=r(63639),l=r(86227),d=r(29994);async function c(e,t,r){let n=l.nc.getState().accessToken,o=e.startsWith("/")?e:`/${e}`,a=`${(0,d.hY)()}/drive/files${o}`,i=await fetch(a,{method:"POST",headers:{Authorization:n?`Bearer ${n}`:"","Content-Type":t.type||"application/octet-stream"},body:t});if(!i.ok)throw Error((await i.json().catch(()=>({}))).message??i.statusText);r?.(100)}var u=r(41733),m=r(94927),p=r(7811);let f={document:{ext:".docx",typeLabel:"Document",menuLabel:"Document"},spreadsheet:{ext:".xlsx",typeLabel:"Tableur",menuLabel:"Tableur"},presentation:{ext:".pptx",typeLabel:"Pr\xe9sentation",menuLabel:"Pr\xe9sentation"},drawing:{ext:".excalidraw",typeLabel:"Dessin",menuLabel:"Dessin"},folder:{ext:"",typeLabel:"Dossier",menuLabel:"Dossier"}},g="gap-3 rounded-md py-2.5 pr-3 pl-3 text-[15px] focus:bg-accent/80 [&_svg]:size-5";async function b(e,t,r){let n="/"===t?"":t,o=new Set,a=async e=>{if(!o.has(e)){try{await r.mutateAsync(e)}catch{}o.add(e)}};for(let t of Array.from(e)){let e=t.webkitRelativePath;if(!e)continue;let r=e.split("/"),o=r.pop();if(!o)continue;let i=n;for(let e of r)i=`${i}/${e}`,await a(i);await c(`${i}/${o}`,t)}}function h(e){let t=(0,o.useRouter)(),r=(0,a.jE)(),{createFolder:l,createFile:d}=(0,s.c1)(),g="/"===e?"":e,h=(0,s.GQ)(e),x=(0,n.useMemo)(()=>(h.data?.files??[]).map(e=>e.name),[h.data?.files]),[v,w]=(0,n.useState)(null),y=()=>r.invalidateQueries({queryKey:["drive"]}),k=v?f[v]:null,_=k&&v?(0,u.y)(x,k.typeLabel,k.ext):"",C=async r=>{if(!v||!k)return;let n=r.trim().replace(/\//g,"");if(!n)return;if("folder"===v){try{await l.mutateAsync(`${g}/${n}`),i.oR.success("Dossier cr\xe9\xe9"),await y()}catch{throw i.oR.error("Impossible de cr\xe9er le dossier"),Error("folder create failed")}return}let o=n.endsWith(k.ext)?n:n+k.ext;try{let r=await d.mutateAsync({parent_path:e,name:o,kind:v});if(i.oR.success("Fichier cr\xe9\xe9"),"drawing"===v){let e=r.file_id;if(e||(e=(await m.uE.get(`/drive/files/info${r.path.startsWith("/")?r.path:`/${r.path}`}`)).file_id),e)t.push((0,p.AW)(e));else throw Error("file id missing");return}let n=window.location.pathname+window.location.search;t.push((0,p.ec)(r.path,n))}catch(t){let e=t instanceof m.UQ||t instanceof Error?t.message:null;throw i.oR.error(e?`Impossible de cr\xe9er le fichier : ${e}`:"Impossible de cr\xe9er le fichier"),Error("file create failed")}};return{pendingKind:v,pendingMeta:k,defaultName:_,confirmNew:C,uploadFiles:async e=>{if(e?.length){for(let t of Array.from(e))try{await c(`${g}/${t.name}`,t)}catch{i.oR.error(`\xc9chec : ${t.name}`)}await y(),i.oR.success("Import termin\xe9")}},importFolder:async t=>{if(t?.length)try{await b(t,e,l),await y(),i.oR.success("Dossier import\xe9")}catch{i.oR.error("Impossible d'importer le dossier")}},pickKind:e=>w(e),closeNameDialog:()=>w(null)}}},82923:(e,t,r)=>{r.d(t,{Ph:()=>l,lv:()=>i,qP:()=>s});var n=r(4208),o=r(91356);let a=(0,o.createContext)(null);function i({registerCardRef:e,children:t}){return(0,n.jsx)(a.Provider,{value:e,children:t})}function s(){return(0,o.useContext)(a)}function l(e,t,r){return n=>{t?.(n),r?.(e,n)}}},85512:(e,t,r)=>{r.d(t,{Jz:()=>a,R7:()=>o,t2:()=>i});let n="application/x-ultimail-drive-items";function o(e,t){e.setData(n,JSON.stringify(t)),e.setData("text/plain",t.map(e=>e.path).join("\n")),e.effectAllowed="move"}function a(e){let t=e.getData(n);if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e)||0===e.length)return null;return e.filter(e=>e&&"string"==typeof e.path&&"string"==typeof e.name&&("file"===e.type||"directory"===e.type))}catch{return null}}function i(e,t,r){if(t.has(e.path)&&t.size>1){let e=r.filter(e=>t.has(e.path));if(e.length>0)return e}return[e]}},90992:(e,t,r)=>{r.d(t,{n:()=>n});function n(e){return e.path.replace(/^\/+/,"")}}}]);