"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3639],{7738:(e,t,i)=>{i.d(t,{$z:()=>a,Hd:()=>o}),i(4208);var n=i(91356);i(89032);let r=(0,n.createContext)(null);function o(){return(0,n.useContext)(r)}function a(){return o()?.enabled??!1}},7811:(e,t,i)=>{function n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function r(e){return e.map(n)}function o(e){return e.map(e=>encodeURIComponent(n(e))).join("/")}function a(e="drive"){return`/${e}`}function s(e,t,i,n="drive"){let l=a(n),d=r(t);if("org"===e&&i)return 0===d.length?`${l}/org/${encodeURIComponent(i)}`:`${l}/org/${encodeURIComponent(i)}/folders/${o(d)}`;if("mount"===e&&i)return 0===d.length?`${l}/mounts/${encodeURIComponent(i)}`:`${l}/mounts/${encodeURIComponent(i)}/folders/${o(d)}`;if(0===d.length)return"shared"===e?`${l}/shared`:l;let p="shared"===e?`${l}/shared/folders`:`${l}/folders`;return`${p}/${o(d)}`}function l(e){let t=e??[];if(0===t.length)return{view:"files",pathSegments:[],page:1,fileId:null,query:"",rootId:null};let i=t[0];if("recent"===i||"starred"===i||"trash"===i)return{view:i,pathSegments:[],page:1,fileId:null,query:"",rootId:null};if("org"===i&&t[1]){let e=n(t[1]),i=t.slice(2);if("folders"===i[0]){i.shift();let t=i.indexOf("page"),n=1;return t>=0&&i[t+1]&&(n=Math.max(1,parseInt(i[t+1],10)||1),i.splice(t,2)),{view:"org",pathSegments:r(i),page:n,fileId:null,query:"",rootId:e}}return{view:"org",pathSegments:[],page:1,fileId:null,query:"",rootId:e}}if("mounts"===i&&t[1]){let e=n(t[1]),i=t.slice(2);if("folders"===i[0]){i.shift();let t=i.indexOf("page"),n=1;return t>=0&&i[t+1]&&(n=Math.max(1,parseInt(i[t+1],10)||1),i.splice(t,2)),{view:"mount",pathSegments:r(i),page:n,fileId:null,query:"",rootId:e}}return{view:"mount",pathSegments:[],page:1,fileId:null,query:"",rootId:e}}if("shared"===i){let e=t.slice(1),i=1;if("folders"===e[0]){e.shift();let t=e.indexOf("page");return t>=0&&e[t+1]&&(i=Math.max(1,parseInt(e[t+1],10)||1),e.splice(t,2)),{view:"shared",pathSegments:r(e),page:i,fileId:null,query:"",rootId:null}}return{view:"shared",pathSegments:[],page:1,fileId:null,query:"",rootId:null}}if("search"===i)return{view:"search",pathSegments:[],page:1,fileId:null,query:"",rootId:null};if("edit"===i&&t[1])return{view:"files",pathSegments:[],page:1,fileId:decodeURIComponent(t[1]),query:"",rootId:null};if("folders"===i){let e=t.slice(1),i=1,n=e.indexOf("page");return n>=0&&e[n+1]&&(i=Math.max(1,parseInt(e[n+1],10)||1),e.splice(n,2)),{view:"files",pathSegments:r(e),page:i,fileId:null,query:"",rootId:null}}return{view:"files",pathSegments:r(t),page:1,fileId:null,query:"",rootId:null}}function d(e){let t=r(e);return 0===t.length?"/":"/"+t.join("/")}function p(e){return`/drive/docs/${String(e)}/edit`}function u(e){return`/drive/draw/${String(e)}/edit`}function m(e,t){let i=new URLSearchParams;t&&!(!t.startsWith("/drive")&&!t.startsWith("/demo/drive")||t.startsWith("//")||t.includes("://"))&&i.set("returnTo",t);let n=`/drive/edit/${encodeURIComponent(e)}`,r=i.toString();return r?`${n}?${r}`:n}i.d(t,{AW:()=>u,Pc:()=>p,Se:()=>s,_V:()=>l,bV:()=>n,ec:()=>m,mc:()=>d,pc:()=>a})},22854:(e,t,i)=>{function n(e){if(!e.includes("%"))return e;try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function r(e){let t=n(e);return t.split("/").pop()??t}function o(e,t=!1){if(t)return n(e);let i=r(e),a=i.lastIndexOf(".");return a<=0?n(e):i.slice(0,a)}function a(e){let t=r(e),i=t.lastIndexOf(".");return i<=0?null:t.slice(i+1).toLowerCase()}function s(e,t=!1){if(t)return"Dossier";let i=a(e);return i?i.toUpperCase():"—"}i.d(t,{Dh:()=>o,_g:()=>n,dQ:()=>a,gC:()=>s})},54821:(e,t,i)=>{i.d(t,{h:()=>n}),i(91356),i(85742),i(49677);let n=["demo","drive"]},57927:(e,t,i)=>{i.d(t,{MA:()=>a,NT:()=>s,dz:()=>p,eU:()=>l,nk:()=>d,rb:()=>o});var n=i(7811);function r(e){return"/"===e||""===e.trim()?"":e.replace(/^\/+/,"").split("/").filter(Boolean).map(e=>encodeURIComponent((0,n.bV)(e))).join("/")}function o(e,t){let i=r(t),n=`/drive/org-folders/${encodeURIComponent(e)}/files`;return i?`${n}/${i}`:`${n}/`}function a(e,t){let i=r(t),n=`/drive/mounts/${encodeURIComponent(e)}/files`;return i?`${n}/${i}`:`${n}/`}function s(e,t){let i=r(t);return`/drive/mounts/${encodeURIComponent(e)}/files/external-url/${i}`}function l(e,t,i){return"org"===e&&t?{root:"org",root_id:t,path:i}:"mount"===e&&t?{root:"mount",root_id:t,path:i}:{path:i}}function d(e,t){return t.root&&"personal"!==t.root?{...e,root:t.root,root_id:t.root_id,path:t.path}:e}function p(e,t){let i={source:e.path,destination:t.path};return e.root&&"personal"!==e.root&&(i.source_root=e.root,e.root_id&&(i.source_root_id=e.root_id)),t.root&&"personal"!==t.root&&(i.destination_root=t.root,t.root_id&&(i.destination_root_id=t.root_id)),i}},63639:(e,t,i)=>{i.d(t,{E7:()=>$,Ec:()=>q,G7:()=>g,GQ:()=>f,H0:()=>_,Rb:()=>C,SO:()=>x,Ty:()=>b,UO:()=>c,Vb:()=>v,XQ:()=>h,c1:()=>z,dY:()=>w,eO:()=>S,go:()=>R,tA:()=>I});var n=i(98306),r=i(39927),o=i(17745),a=i(94927),s=i(94658),l=i(57927),d=i(18747);i(29994);var p=i(7738),u=i(54821),m=i(85742);function c(e,t=!0){let{ready:i,authenticated:r}=(0,d.v)(),o=(0,s.An)(e);return(0,n.I)({queryKey:["drive","filter-corpus",e],enabled:i&&r&&t,staleTime:6e4,queryFn:()=>a.uE.get(o)})}function f(e,t=1,i="",r=!0){let{ready:o,authenticated:l}=(0,d.v)(),c=(0,p.$z)(),h=(0,m.G)(e=>e.version),g=(0,s.tI)(e);return(0,n.I)({queryKey:c?[...u.h,"files",e,t,i,h]:["drive","files",e,t,i],enabled:o&&l&&r,queryFn:()=>c?m.G.getState().listFiles(e,t):a.uE.get(`${g}?page=${t}&page_size=50${i?`&q=${encodeURIComponent(i)}`:""}`),initialData:c?()=>m.G.getState().listFiles(e,t):void 0})}function h(e=1,t="",i=!0){let{ready:r,authenticated:o}=(0,d.v)(),s=(0,p.$z)(),l=(0,m.G)(e=>e.version);return(0,n.I)({queryKey:s?[...u.h,"shared",e,t,l]:["drive","shared",e,t],enabled:r&&o&&i,queryFn:()=>s?m.G.getState().listShared():a.uE.get(`/drive/shared?page=${e}&page_size=50${t?`&q=${encodeURIComponent(t)}`:""}`),initialData:s?()=>m.G.getState().listShared():void 0})}function g(e=1,t=""){let{ready:i,authenticated:r}=(0,d.v)(),o=(0,p.$z)(),s=(0,m.G)(e=>e.version);return(0,n.I)({queryKey:o?[...u.h,"trash",e,t,s]:["drive","trash",e,t],enabled:i&&r,queryFn:()=>o?m.G.getState().listTrash():a.uE.get(`/drive/trash?page=${e}&page_size=50${t?`&q=${encodeURIComponent(t)}`:""}`),initialData:o?()=>m.G.getState().listTrash():void 0})}function v(){let{ready:e,authenticated:t}=(0,d.v)(),i=(0,p.$z)(),r=(0,m.G)(e=>e.version);return(0,n.I)({queryKey:i?[...u.h,"recent",r]:["drive","recent"],enabled:e&&t,retry:1,queryFn:()=>i?m.G.getState().listRecent():a.uE.get("/drive/recent?page_size=50"),initialData:i?()=>m.G.getState().listRecent():void 0})}function _(e="/"){let{ready:t,authenticated:i}=(0,d.v)(),r=(0,p.$z)(),o=(0,m.G)(e=>e.version),s="/"===e?"":e;return(0,n.I)({queryKey:r?[...u.h,"starred",e,o]:["drive","starred",e],enabled:t&&i,queryFn:()=>r?m.G.getState().listStarred(e):a.uE.get(`/drive/starred${s}?page_size=50`),initialData:r?()=>m.G.getState().listStarred(e):void 0})}function y(e,t,i,n,r){return["drive","search",e,t,i,n,r]}function $(e,t,i,r=1,o=!0){let{ready:s,authenticated:l}=(0,d.v)(),c=(0,p.$z)(),f=(0,m.G)(e=>e.version),h=e.trim();return(0,n.I)({queryKey:c?[...u.h,"search",h,t,i,r,!1,f]:y(h,t,i,r,!1),enabled:s&&l&&o&&h.length>0,queryFn:()=>{if(c)return m.G.getState().search(h,t,i,r);let e=new URLSearchParams({q:h,scope:t,page:String(r),page_size:"50"});return"folder"===t&&"/"!==i&&e.set("path",i),a.uE.get(`/drive/search?${e.toString()}`)},initialData:c&&h.length>0?()=>m.G.getState().search(h,t,i,r):void 0})}function I(e,t,i,r=!0){let{ready:o,authenticated:s}=(0,d.v)(),l=(0,p.$z)(),c=(0,m.G)(e=>e.version),f=e.trim();return(0,n.I)({queryKey:l?[...u.h,"search",f,t,i,1,!0,c]:y(f,t,i,1,!0),enabled:o&&s&&r&&f.length>=2,staleTime:3e4,queryFn:()=>{if(l){let e=m.G.getState().search(f,t,i,1);return{...e,files:e.files.slice(0,8)}}let e=new URLSearchParams({q:f,scope:t,suggest:"1",page_size:"8"});return"folder"===t&&"/"!==i&&e.set("path",i),a.uE.get(`/drive/search?${e.toString()}`)},initialData:l&&f.length>=2?()=>{let e=m.G.getState().search(f,t,i,1);return{...e,files:e.files.slice(0,8)}}:void 0})}function x(){let{ready:e,authenticated:t}=(0,d.v)();return(0,n.I)({queryKey:["drive","quota"],enabled:e&&t,retry:1,queryFn:()=>a.uE.get("/drive/quota")})}function S(e,t,i){let{ready:r,authenticated:o}=(0,d.v)(),s=i?.root&&"personal"!==i.root?`&root=${encodeURIComponent(i.root)}&root_id=${encodeURIComponent(i.root_id??"")}`:"";return(0,n.I)({queryKey:["drive","shares",e,i?.root,i?.root_id],enabled:r&&o&&t&&!!e,queryFn:()=>a.uE.get(`/drive/shares?path=${encodeURIComponent(e)}${s}`)})}function C(e=!0){let{ready:t,authenticated:i}=(0,d.v)();return(0,n.I)({queryKey:["drive","org-folders"],enabled:t&&i&&e,staleTime:6e4,queryFn:async()=>(await a.uE.get("/drive/org-folders")).folders??[]})}function R(e,t,i=1,r=!0){let{ready:o,authenticated:s}=(0,d.v)(),p=(0,l.rb)(e,t);return(0,n.I)({queryKey:["drive","org",e,t,i],enabled:o&&s&&r&&!!e,queryFn:()=>a.uE.get(`${p}?page=${i}&page_size=50`)})}function q(e=[],t=!0){let{ready:i,authenticated:r}=(0,d.v)(),o=e.filter(Boolean).join(",");return(0,n.I)({queryKey:["drive","mounts",o],enabled:i&&r&&t,staleTime:3e4,queryFn:async()=>{let e=o?`?org_slugs=${encodeURIComponent(o)}`:"";return(await a.uE.get(`/drive/mounts${e}`)).mounts??[]}})}function w(e,t,i=1,r=!0){let{ready:o,authenticated:s}=(0,d.v)(),p=(0,l.MA)(e,t);return(0,n.I)({queryKey:["drive","mount",e,t,i],enabled:o&&s&&r&&!!e,queryFn:()=>a.uE.get(`${p}?page=${i}&page_size=50`)})}function z(e){let t=(0,r.jE)(),i=(0,p.Hd)(),n=i?.enabled??!1,s=()=>{if(n){m.G.getState().bump(),t.invalidateQueries({queryKey:u.h});return}t.invalidateQueries({queryKey:["drive"]})},d=e??{path:"/"},c="org"===d.root&&d.root_id?`/drive/org-folders/${encodeURIComponent(d.root_id)}`:"mount"===d.root&&d.root_id?`/drive/mounts/${encodeURIComponent(d.root_id)}`:"/drive",f=(0,o.n)({mutationFn:async e=>n?void m.G.getState().createFolder(e):"org"===d.root||"mount"===d.root?a.uE.post(`${c}/folders${e}`,{}):a.uE.post(`/drive/folders${e}`,{}),onSuccess:s}),h=(0,o.n)({mutationFn:async e=>{if(n){m.G.getState().deleteFile(e),i?.notify("\xc9l\xe9ment plac\xe9 dans la corbeille");return}return"org"===d.root||"mount"===d.root?a.uE.delete(`${c}/files${e}`):a.uE.delete(`/drive/files${e}`)},onSuccess:s}),g=(0,o.n)({mutationFn:async e=>n?void m.G.getState().rename(e.path,e.new_name):a.uE.post("/drive/rename",(0,l.nk)(e,{...d,path:e.path})),onSuccess:s}),v=(0,o.n)({mutationFn:e=>a.uE.post("/drive/move",(0,l.dz)(e.sourceRef??{...d,path:e.source},e.destRef??{...d,path:e.destination})),onSuccess:s}),_=(0,o.n)({mutationFn:e=>a.uE.post("/drive/copy",(0,l.dz)(e.sourceRef??{...d,path:e.source},e.destRef??{...d,path:e.destination})),onSuccess:s}),y=(0,o.n)({mutationFn:async e=>n?void m.G.getState().setFavorite(e.path,e.favorite):a.uE.post("/drive/favorite",(0,l.nk)(e,{...d,path:e.path})),onSuccess:s}),$=(0,o.n)({mutationFn:async e=>n?void m.G.getState().restoreTrash(e):a.uE.post("/drive/trash/restore",{name:e}),onSuccess:s}),I=(0,o.n)({mutationFn:async e=>n?void m.G.getState().deleteTrash(e):a.uE.post("/drive/trash/delete",{name:e}),onSuccess:s}),x=(0,o.n)({mutationFn:async()=>n?void m.G.getState().emptyTrash():a.uE.delete("/drive/trash"),onSuccess:s}),S=(0,o.n)({mutationFn:e=>a.uE.post("/drive/shares",{...(0,l.nk)({path:e.path},{...d,path:e.path}),mode:e.mode??"public",..."contact"===e.mode?{share_with:e.share_with,note:e.note,send_mail:e.send_mail??!0}:"internal"===e.mode?{share_type:3}:{share_type:e.share_type??3},...null!=e.permissions&&e.permissions>0?{permissions:e.permissions}:{role:e.role??"viewer"}}),onSuccess:(e,i)=>{t.invalidateQueries({queryKey:["drive"]}),i.path&&t.invalidateQueries({queryKey:["drive","shares",i.path]})}}),C=(0,o.n)({mutationFn:e=>a.uE.delete(`/drive/shares/${e}`),onSuccess:s});return{createFolder:f,deleteFile:h,rename:g,move:v,copy:_,favorite:y,restore:$,deleteTrash:I,emptyTrash:x,createShare:S,deleteShare:C,lookupShareRecipient:(0,o.n)({mutationFn:e=>a.uE.get(`/drive/shares/recipients/lookup?email=${encodeURIComponent(e)}`)}),createFile:(0,o.n)({mutationFn:e=>a.uE.post("/drive/files/new",e),onSuccess:s}),invalidate:s}}function b(){let e=(0,r.jE)(),t=()=>e.invalidateQueries({queryKey:["drive","mounts"]}),i=(0,o.n)({mutationFn:e=>a.uE.post("/drive/mounts",e),onSuccess:t}),n=(0,o.n)({mutationFn:e=>a.uE.delete(`/drive/mounts/${encodeURIComponent(e)}`),onSuccess:t});return{createMount:i,deleteMount:n,fetchOAuthURL:async(e,t)=>a.uE.get(`/drive/mounts/${encodeURIComponent(e)}/oauth-url?redirect_uri=${encodeURIComponent(t)}`),completeOAuth:(0,o.n)({mutationFn:({mountId:e,code:t,redirectUri:i})=>a.uE.post(`/drive/mounts/${encodeURIComponent(e)}/oauth/complete`,{code:t,redirect_uri:i}),onSuccess:t}),invalidate:t}}},85742:(e,t,i)=>{i.d(t,{G:()=>m});var n=i(46298);function r(e,t=14,i=30){let n=new Date;return n.setDate(n.getDate()-e),n.setHours(t,i,0,0),n.toISOString().replace(/\.\d{3}Z$/,"+00:00")}function o(e){let t;return{...e,etag:e.etag??`"demo-${e.path}"`,last_modified:e.last_modified??((t=new Date).setHours(14,30,0,0),t.toISOString().replace(/\.\d{3}Z$/,"+00:00")),size:e.size??0,mime_type:e.mime_type??"application/octet-stream",type:e.type??"file",is_favorite:e.is_favorite??!1,is_shared:e.is_shared??!1}}let a=[o({path:"/Produit",name:"Produit",type:"directory",mime_type:"httpd/unix-directory",file_id:101,last_modified:r(14,9,0)}),o({path:"/Produit/Comit\xe9s",name:"Comit\xe9s",type:"directory",mime_type:"httpd/unix-directory",file_id:102,last_modified:r(3,16,45)}),o({path:"/Marketing",name:"Marketing",type:"directory",mime_type:"httpd/unix-directory",file_id:103,last_modified:r(10,11,20)}),o({path:"/Marketing/Campagne lancement",name:"Campagne lancement",type:"directory",mime_type:"httpd/unix-directory",file_id:104,last_modified:r(6,10,0)}),o({path:"/RH",name:"RH",type:"directory",mime_type:"httpd/unix-directory",file_id:105,last_modified:r(12,8,30)}),o({path:"/RH/Onboarding",name:"Onboarding",type:"directory",mime_type:"httpd/unix-directory",file_id:106,last_modified:r(7,14,0)}),o({path:"/Perso",name:"Perso",type:"directory",mime_type:"httpd/unix-directory",file_id:107,last_modified:r(11,18,15)}),o({path:"/Archives",name:"Archives",type:"directory",mime_type:"httpd/unix-directory",file_id:108,last_modified:r(13,9,0)}),o({path:"/Archives/2025",name:"2025",type:"directory",mime_type:"httpd/unix-directory",file_id:109,last_modified:r(13,9,5)}),o({path:"/Partag\xe9",name:"Partag\xe9",type:"directory",mime_type:"httpd/unix-directory",file_id:110,last_modified:r(4,11,30)}),o({path:"/Produit/Comit\xe9 produit — CR 9 juin.ultidoc",name:"Comit\xe9 produit — CR 9 juin.ultidoc",size:287400,mime_type:"application/vnd.ultimail.document",file_id:111,source:"ultimail",is_favorite:!0,last_modified:r(0,10,15)}),o({path:"/Produit/Roadmap Q3.pdf",name:"Roadmap Q3.pdf",size:1842e3,mime_type:"application/pdf",file_id:112,last_modified:r(1,15,20)}),o({path:"/Produit/Specs fonctionnelles v2.4.ultidoc",name:"Specs fonctionnelles v2.4.ultidoc",size:412800,mime_type:"application/vnd.ultimail.document",file_id:113,source:"ultimail",is_shared:!0,last_modified:r(2,9,40)}),o({path:"/Produit/Comit\xe9s/Retro sprint 24 — notes.ultidoc",name:"Retro sprint 24 — notes.ultidoc",size:156200,mime_type:"application/vnd.ultimail.document",file_id:114,source:"ultimail",last_modified:r(3,17,10)}),o({path:"/Marketing/Pr\xe9sentation lancement Q3.pptx",name:"Pr\xe9sentation lancement Q3.pptx",size:564e4,mime_type:"application/vnd.openxmlformats-officedocument.presentationml.presentation",file_id:115,last_modified:r(1,11,0)}),o({path:"/Marketing/Banni\xe8re site — hero.png",name:"Banni\xe8re site — hero.png",size:218e4,mime_type:"image/png",file_id:116,last_modified:r(4,14,30)}),o({path:"/Marketing/Charte graphique 2026.pdf",name:"Charte graphique 2026.pdf",size:321e4,mime_type:"application/pdf",file_id:117,is_favorite:!0,last_modified:r(5,10,45)}),o({path:"/Marketing/Campagne lancement/Brief cr\xe9atif.docx",name:"Brief cr\xe9atif.docx",size:67500,mime_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",file_id:118,is_shared:!0,last_modified:r(6,16,20)}),o({path:"/RH/Contrat type CDI.docx",name:"Contrat type CDI.docx",size:48300,mime_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",file_id:119,last_modified:r(8,9,15)}),o({path:"/RH/Guide t\xe9l\xe9travail.pdf",name:"Guide t\xe9l\xe9travail.pdf",size:892e3,mime_type:"application/pdf",file_id:120,last_modified:r(9,13,0)}),o({path:"/RH/Onboarding/Checklist jour 1.ultidoc",name:"Checklist jour 1.ultidoc",size:94600,mime_type:"application/vnd.ultimail.document",file_id:121,source:"ultimail",last_modified:r(7,8,50)}),o({path:"/Perso/Notes r\xe9union.txt",name:"Notes r\xe9union.txt",size:4200,mime_type:"text/plain",file_id:122,last_modified:r(2,18,30)}),o({path:"/Perso/Id\xe9es side project.ultidoc",name:"Id\xe9es side project.ultidoc",size:38900,mime_type:"application/vnd.ultimail.document",file_id:123,source:"ultimail",last_modified:r(10,20,0)}),o({path:"/Perso/Photo \xe9quipe offsite.jpg",name:"Photo \xe9quipe offsite.jpg",size:345e4,mime_type:"image/jpeg",file_id:124,last_modified:r(11,19,45)}),o({path:"/Archives/CR comit\xe9 — mai.ultidoc",name:"CR comit\xe9 — mai.ultidoc",size:221e3,mime_type:"application/vnd.ultimail.document",file_id:125,source:"ultimail",last_modified:r(12,10,0)}),o({path:"/Archives/2025/Budget 2025.xlsx",name:"Budget 2025.xlsx",size:76800,mime_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",file_id:126,last_modified:r(13,9,30)}),o({path:"/Partag\xe9/Analyse concurrence.xlsx",name:"Analyse concurrence.xlsx",size:112400,mime_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",file_id:127,is_shared:!0,last_modified:r(3,11,15)}),o({path:"/Budget 2026.xlsx",name:"Budget 2026.xlsx",size:89e3,mime_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",file_id:128,is_favorite:!0,last_modified:r(0,8,0)}),o({path:"/Logo Ultimail.svg",name:"Logo Ultimail.svg",size:12400,mime_type:"image/svg+xml",file_id:129,last_modified:r(14,10,0)}),o({path:"/Architecture syst\xe8me — sch\xe9ma.svg",name:"Architecture syst\xe8me — sch\xe9ma.svg",size:18700,mime_type:"image/svg+xml",file_id:130,last_modified:r(5,15,30)}),o({path:"/Release notes v2.3.txt",name:"Release notes v2.3.txt",size:8900,mime_type:"text/plain",file_id:131,last_modified:r(1,9,30)})],s=[111,128,131,112,115,113,122,127],l=[o({path:"/Ancien brief.docx",name:"Ancien brief.docx",size:34e3,mime_type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",file_id:201,last_modified:r(5,16,0)}),o({path:"/Export contacts — test.csv",name:"Export contacts — test.csv",size:12800,mime_type:"text/csv",file_id:202,last_modified:r(8,11,45)}),o({path:"/Maquette homepage v1.pptx",name:"Maquette homepage v1.pptx",size:412e4,mime_type:"application/vnd.openxmlformats-officedocument.presentationml.presentation",file_id:203,last_modified:r(11,14,20)})],d=[o({path:"/Partag\xe9/Specs API v2.pdf",name:"Specs API v2.pdf",size:512e3,mime_type:"application/pdf",file_id:301,is_shared:!0,last_modified:r(0,14,0)}),o({path:"/Partag\xe9/Benchmark SaaS europ\xe9ens.xlsx",name:"Benchmark SaaS europ\xe9ens.xlsx",size:98600,mime_type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",file_id:302,is_shared:!0,last_modified:r(2,10,30)}),o({path:"/Partag\xe9/CR r\xe9union client — Delcourt.pdf",name:"CR r\xe9union client — Delcourt.pdf",size:245e3,mime_type:"application/pdf",file_id:303,is_shared:!0,last_modified:r(4,17,45)}),o({path:"/Partag\xe9/Wireframes flux auth.ultidoc",name:"Wireframes flux auth.ultidoc",size:178300,mime_type:"application/vnd.ultimail.document",file_id:304,source:"ultimail",is_shared:!0,last_modified:r(1,13,15)})];function p(e){return e&&"/"!==e?e.startsWith("/")?e.replace(/\/+$/,""):`/${e.replace(/\/+$/,"")}`:"/"}function u(e,t,i=50){let n=(t-1)*i;return{files:e.slice(n,n+i),pagination:{page:t,page_size:i,total:e.length}}}let m=(0,n.v)((e,t)=>({files:[...a],trash:[],version:0,reset:()=>e({files:[...a],trash:[],version:t().version+1}),bump:()=>e({version:t().version+1}),listFiles:(e,i)=>{var n;let r;return n=t().files,u((r=p(e),n.filter(e=>{let t,i;return"directory"===e.type&&"/"===r?2===e.path.split("/").length:((i=(t=e.path.replace(/\/+$/,"")).lastIndexOf("/"))<=0?"/":t.slice(0,i))===r})),i)},listRecent:()=>{let e,i;return e=new Map(t().files.map(e=>[e.file_id,e])),{files:i=s.map(t=>e.get(t)).filter(e=>!!e),pagination:{page:1,page_size:50,total:i.length}}},listStarred:e=>{var i;let n,r;return i=t().files,n=p(e),{files:r=i.filter(e=>e.is_favorite&&("/"===n||e.path.startsWith("/"===n?"":n+"/"))),pagination:{page:1,page_size:50,total:r.length}}},listTrash:()=>({files:[...l],pagination:{page:1,page_size:50,total:l.length}}),listShared:()=>({files:[...d],pagination:{page:1,page_size:50,total:d.length}}),search:(e,i,n,r)=>(function(e,t,i,n,r){let o=t.trim().toLowerCase(),a=e;if("folder"===i){let t=p(n);a=e.filter(e=>e.path===t||e.path.startsWith("/"===t?"/":t+"/"))}return u(a.filter(e=>!!o&&(e.name.toLowerCase().includes(o)||e.path.toLowerCase().includes(o))),r)})(t().files,e,i,n,r),createFolder:t=>{let i=t.startsWith("/")?t:`/${t}`,n=i.split("/").pop()??"Nouveau dossier";e(e=>({files:[...e.files,{path:i,name:n,type:"directory",mime_type:"httpd/unix-directory",size:0,last_modified:new Date().toISOString(),etag:`"demo-folder-${Date.now()}"`,is_favorite:!1,file_id:Date.now()}],version:e.version+1}))},deleteFile:t=>{e(e=>{let i=e.files.filter(e=>e.path===t||e.path.startsWith(t+"/"));return{files:e.files.filter(e=>e.path!==t&&!e.path.startsWith(t+"/")),trash:[...e.trash,...i],version:e.version+1}})},rename:(t,i)=>{e(e=>{let n=t.replace(/\/[^/]+$/,"")||"/",r="/"===n?`/${i}`:`${n}/${i}`;return{files:e.files.map(e=>{if(e.path===t)return{...e,path:r,name:i};if(e.path.startsWith(t+"/")){var n;return{...e,path:(n=e.path,n===t?r:n.startsWith(t+"/")?r+n.slice(t.length):n),name:e.path.split("/").pop()??e.name}}return e}),version:e.version+1}})},setFavorite:(t,i)=>{e(e=>({files:e.files.map(e=>e.path===t||e.path.startsWith(t+"/")?{...e,is_favorite:i}:e),version:e.version+1}))},restoreTrash:t=>{e(e=>{let i=e.trash.find(e=>e.name===t);return i?{trash:e.trash.filter(e=>e.name!==t),files:[...e.files,i],version:e.version+1}:e})},deleteTrash:t=>{e(e=>({trash:e.trash.filter(e=>e.name!==t),version:e.version+1}))},emptyTrash:()=>{e(e=>({trash:[],version:e.version+1}))}}))},94658:(e,t,i)=>{i.d(t,{An:()=>m,Cl:()=>h,JX:()=>d,WE:()=>p,Yo:()=>f,jj:()=>g,tI:()=>c});var n=i(94927),r=i(22854),o=i(7811);let a={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",avif:"image/avif",heic:"image/heic",heif:"image/heif",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",mkv:"video/x-matroska",ogv:"video/ogg",m4v:"video/mp4",pdf:"application/pdf",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",flac:"audio/flac",m4a:"audio/mp4",aac:"audio/aac",opus:"audio/opus",weba:"audio/webm",aiff:"audio/aiff",mid:"audio/midi",midi:"audio/midi",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",apng:"image/apng",jfif:"image/jpeg"},s=new Set(["application/octet-stream","binary/octet-stream","text/plain","text/xml","application/xml"]);function l(e){return e.toLowerCase().split(";")[0]?.trim()??""}function d(e,t,i){var n;let r,o,d,p=(n=e.type,r=a[i.split(".").pop()?.toLowerCase()??""],o=l(n),d=l(t),"image/svg+xml"===r||d.includes("svg")||o.includes("svg")||i.toLowerCase().endsWith(".svg")?"image/svg+xml":r&&(s.has(o)||s.has(d)||!o)?r:o&&!s.has(o)?o:d&&!s.has(d)?d:r??o??d??"application/octet-stream");return p&&e.type!==p?new Blob([e],{type:p}):e}async function p(e){return d(await n.uE.getBlob(h(u(e))),e.mime_type,e.name)}function u(e){let t=e.path.trim();t.startsWith("/")||(t=`/${t}`);let i=t.split("/").filter(Boolean).map(e=>{try{return decodeURIComponent(e)}catch{return e}});t=i.length?`/${i.join("/")}`:"/";let n=(0,r._g)(e.name);if(!n)return t.replace(/\/+/g,"/");let o=i[i.length-1]??"",a=(0,r._g)(o);if(a===n)return t.replace(/\/+/g,"/");let s=(0,r.dQ)(n);return s&&a.toLowerCase().endsWith(`.${s}`)?t.replace(/\/+/g,"/"):`${t.replace(/\/$/,"")}/${n}`.replace(/\/+/g,"/")}function m(e){if("/"===e||""===e.trim())return"/drive/filter-corpus";let t=e.replace(/^\/+/,"").split("/").filter(Boolean).map(e=>encodeURIComponent((0,o.bV)(e)));return`/drive/filter-corpus/${t.join("/")}`}function c(e){if("/"===e||""===e.trim())return"/drive/files/";let t=e.replace(/^\/+/,"").split("/").filter(Boolean).map(e=>encodeURIComponent((0,o.bV)(e)));return`/drive/files/${t.join("/")}`}async function f(e,t=400,i=300){let r=u(e);return n.uE.getBlob(function(e,t=400,i=300){let n=e.replace(/^\/+/,"").split("/").filter(Boolean).map(e=>encodeURIComponent(e));return`/drive/preview/${n.join("/")}?w=${t}&h=${i}`}(r,t,i))}function h(e){let t=e.replace(/^\/+/,"").split("/").filter(Boolean).map(e=>encodeURIComponent(e));return`/drive/download/${t.join("/")}`}async function g(e,t,i){let o=null!=i?u({path:e,name:i}):e,a=await n.uE.getBlob(h(o)),s=(0,r._g)(t??e.split("/").filter(Boolean).pop()??"download"),l=URL.createObjectURL(a);try{let e=document.createElement("a");e.href=l,e.download=s,e.rel="noopener",document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(l)}}}}]);