1 line
40 KiB
JavaScript
1 line
40 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9007],{141:(e,t,s)=>{s.r(t),s.d(t,{MailDomainsSection:()=>M});var a=s(4208),n=s(91356),i=s(35019),r=s(18584),o=s(89032),l=s(61554),d=s(13746),c=s(12154),u=s(89342),m=s(4023),p=s(25729),x=s(58564),h=s(71809),j=s(19984),v=s(51355),g=s(19096),f=s(66987),y=s(4559);let b={mail:"Mail",contacts:"Contacts",calendar:s(28292).tg,drive:"Drive"},N={oauth:"OAuth utilisateur",google_dwd:"Google DWD (service account)",microsoft_app:"Microsoft app-only (client credentials)"};function _(e){switch(e){case"completed":case"active":case"cutover":case"claimed":case"invited":return"default";case"running":case"pending":return"secondary";case"failed":return"destructive";default:return"outline"}}function w({domains:e}){let t=(0,j.useSearchParams)(),s=(0,y.Kh)(),i=(0,y.h2)(),r=(0,y.ug)(),o=(0,y.HQ)(),c=(0,y.eS)(),[m,h]=(0,n.useState)(""),[b,A]=(0,n.useState)("google"),[q,M]=(0,n.useState)("oauth"),[I,K]=(0,n.useState)(""),[z,F]=(0,n.useState)(""),[P,T]=(0,n.useState)(""),[D,R]=(0,n.useState)(""),[V,L]=(0,n.useState)(""),[Q,U]=(0,n.useState)(null),[X,O]=(0,n.useState)(""),[B,G]=(0,n.useState)("common"),[J,W]=(0,n.useState)(null),[H,Z]=(0,n.useState)(null),[Y,ee]=(0,n.useState)(null),[et,es]=(0,n.useState)(null),[ea,en]=(0,n.useState)(null),ei=s.data?.projects??[],er=X||ei[0]?.id||"",eo=ei.find(e=>e.id===er),el=(0,y.Ve)(er),ed=(0,y.jS)(er),ec=(0,y._K)(er),eu=(0,y.hF)(er,!!er),em=(0,y.dc)(er,!!er),ep=(0,y.n5)(er),ex=(0,y.yJ)(er),eh=(0,y.P2)(er),ej=(0,y.Es)(er),ev=(0,y.$B)(er),eg=(0,y.oP)(er,!!(er&&eo?.source_provider==="google")),ef=(0,y.EE)(er),ey=(0,y.MB)(er);(0,n.useEffect)(()=>{let e=t.get("microsoft_admin_consent");if("success"===e){let e=t.get("tenant"),a=t.get("project_id");W(e?`Consentement admin Microsoft enregistr\xe9 (tenant ${e}${a?`, projet ${a.slice(0,8)}…`:""}).`:"Consentement admin Microsoft enregistr\xe9."),s.refetch()}else"error"===e&&(W("\xc9chec du consentement admin Microsoft — v\xe9rifiez le tenant et r\xe9essayez."),s.refetch())},[t,s]),(0,n.useEffect)(()=>{Z(null),ee(null),es(null),en(null)},[er]),(0,n.useEffect)(()=>{eo?.cutover_dns&&es(e=>"cutover"===e||"live"===e?e:"persisted")},[eo?.cutover_dns,er]);let eb=H??eo?.cutover_dns??ej.data?.dns??null,eN=(em.data?.jobs??[]).filter(e=>"failed"===e.status).length;return(0,a.jsxs)(x.f,{title:"Projets de migration",description:"Import Google Workspace / Microsoft 365, invitations, suivi des jobs et bascule MX.",children:[J&&(0,a.jsx)("p",{className:`mb-4 rounded-md px-3 py-2 text-sm ${J.startsWith("\xc9chec")?"bg-destructive/10 text-destructive":"bg-green-500/10 text-green-700"}`,children:J}),(0,a.jsxs)(p.wB,{children:[(0,a.jsx)(p.u8,{label:"Nom du projet",htmlFor:"project-name",children:(0,a.jsx)(d.p,{id:"project-name",className:"h-9",value:m,onChange:e=>h(e.target.value),placeholder:"Migration ACME 2026"})}),(0,a.jsx)(p.u8,{label:"Source",children:(0,a.jsxs)(u.l6,{value:b,onValueChange:e=>{A(e),"google"!==e&&"google_dwd"===q&&M("oauth"),"microsoft"!==e&&"microsoft_app"===q&&M("oauth")},children:[(0,a.jsx)(u.bq,{className:"h-9",children:(0,a.jsx)(u.yv,{children:(0,a.jsx)(f.c,{brand:b,children:"google"===b?"Google Workspace":"Microsoft 365"})})}),(0,a.jsxs)(u.gC,{children:[(0,a.jsx)(u.eb,{value:"google",children:(0,a.jsx)(f.c,{brand:"google",children:"Google Workspace"})}),(0,a.jsx)(u.eb,{value:"microsoft",children:(0,a.jsx)(f.c,{brand:"microsoft",children:"Microsoft 365"})})]})]})}),(0,a.jsx)(p.u8,{label:"Mode d'authentification",children:(0,a.jsxs)(u.l6,{value:q,onValueChange:M,children:[(0,a.jsx)(u.bq,{className:"h-9",children:(0,a.jsx)(u.yv,{children:(0,a.jsx)(f.c,{brand:"oauth"===q?"oauth":q,children:N[q]??q})})}),(0,a.jsxs)(u.gC,{children:[(0,a.jsx)(u.eb,{value:"oauth",children:(0,a.jsx)(f.c,{brand:"oauth",children:"OAuth utilisateur"})}),(0,a.jsx)(u.eb,{value:"google_dwd",disabled:"google"!==b,children:(0,a.jsx)(f.c,{brand:"google",children:"Google DWD (service account)"})}),(0,a.jsx)(u.eb,{value:"microsoft_app",disabled:"microsoft"!==b,children:(0,a.jsx)(f.c,{brand:"microsoft",children:"Microsoft app-only (client credentials)"})})]})]})}),(0,a.jsx)(p.u8,{label:"Domaine mail (optionnel)",children:(0,a.jsxs)(u.l6,{value:I||"__none__",onValueChange:e=>K("__none__"===e?"":e),children:[(0,a.jsx)(u.bq,{className:"h-9",children:(0,a.jsx)(u.yv,{placeholder:"Aucun"})}),(0,a.jsxs)(u.gC,{children:[(0,a.jsx)(u.eb,{value:"__none__",children:"Aucun"}),e.map(e=>(0,a.jsx)(u.eb,{value:e.id,children:e.name},e.id))]})]})})]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(l.$,{disabled:!m||i.isPending,onClick:()=>{i.mutateAsync({name:m,source_provider:b,domain_id:I||void 0,auth_mode:q}).then(e=>{h(""),O(e.id)})},children:"Cr\xe9er le projet"})}),(0,a.jsx)("ul",{className:"mt-6 space-y-3",children:ei.map(e=>(0,a.jsx)(S,{project:e,selected:e.id===er,onSelect:()=>O(e.id),onActivate:()=>{O(e.id),r.mutateAsync(e.id)},onCutover:()=>{ee(null),o.mutateAsync(e.id).then(e=>{Z(e.dns),es("cutover")},e=>{if(Z(null),e instanceof ApiRequestError&&"migration_cutover_mx_not_ready"===e.code){let t=e.details;t?.dns&&(Z(t.dns),es("cutover")),ee(e.message)}else ee(e instanceof Error?e.message:"Cutover failed")})}},e.id))}),eo?.source_provider==="microsoft"&&(0,a.jsxs)("div",{className:"mt-6 space-y-3 rounded-lg border border-mail-border p-4",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Consentement admin Microsoft"}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Requis pour les migrations Microsoft 365","microsoft_app"===eo.auth_mode?" en mode app-only (permissions application : Mail.Read, Calendars.Read, Contacts.Read, Files.Read.All).":" en mode organisation (permissions applicatives)."]}),eo.microsoft_admin_consent_at?(0,a.jsxs)("p",{className:"text-sm text-green-700",children:["Consentement accord\xe9",eo.microsoft_tenant_id?` — tenant ${eo.microsoft_tenant_id}`:"",eo.microsoft_admin_consent_at?` (${new Date(eo.microsoft_admin_consent_at).toLocaleString()})`:""]}):eo.microsoft_admin_consent_error?(0,a.jsx)("p",{className:"text-sm text-destructive",children:eo.microsoft_admin_consent_error}):(0,a.jsx)("p",{className:"text-sm text-amber-700",children:"Consentement non enregistr\xe9 pour ce projet."}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-[1fr_auto]",children:[(0,a.jsx)(d.p,{value:B,onChange:e=>G(e.target.value),placeholder:"common ou tenant ID"}),(0,a.jsx)(l.$,{variant:"outline",disabled:c.isPending||!er,onClick:()=>{c.mutateAsync({tenant:B,projectId:er}).then(e=>{window.location.href=e.url})},children:"Consentement admin MS"})]})]}),er&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"mt-6 space-y-3 rounded-lg border border-mail-border p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Pr\xe9-v\xe9rification DNS (cutover)"}),(0,a.jsx)(l.$,{size:"sm",variant:"outline",disabled:ej.isFetching,onClick:()=>{ej.refetch().then(e=>{e.data?.dns&&es("live")})},children:ej.isFetching?"V\xe9rification…":"V\xe9rifier DNS"})]}),Y&&(0,a.jsx)("p",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:Y}),eb&&(0,a.jsxs)(a.Fragment,{children:["persisted"===et&&eo?.cutover_at&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Rapport enregistr\xe9 au cutover (",new Date(eo.cutover_at).toLocaleString(),")."]}),"live"===et&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"V\xe9rification DNS live (non enregistr\xe9e — lancez la bascule MX pour persister)."}),(0,a.jsx)(C,{report:eb})]}),!eb&&eo?.domain_id&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Aucun rapport DNS enregistr\xe9 — v\xe9rifiez live ou lancez la bascule MX."})]}),eo?.source_provider==="google"&&(0,a.jsx)(E,{project:eo,drives:eg.data?.shared_drives??[],loading:eg.isLoading,onModeChange:e=>void ev.mutateAsync(e),modePending:ev.isPending,onApprove:e=>void ef.mutateAsync(e),onReject:e=>void ey.mutateAsync(e),actionPending:ef.isPending||ey.isPending}),(0,a.jsxs)("div",{className:"mt-8 space-y-4 rounded-lg border border-mail-border p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Jobs de migration"}),(0,a.jsxs)(l.$,{size:"sm",variant:"outline",disabled:0===eN||eh.isPending,onClick:()=>void eh.mutateAsync(),children:["Relancer les \xe9checs (",eN,")"]})]}),(0,a.jsx)(k,{jobs:em.data?.jobs??[],loading:em.isLoading,auditJobId:ea,onAudit:e=>en(t=>t===e?null:e),onRetry:e=>void ep.mutateAsync(e),onResetCursor:e=>void ex.mutateAsync(e),retryPending:ep.isPending,resetPending:ex.isPending}),ea&&(0,a.jsx)($,{projectId:er,jobId:ea,jobs:em.data?.jobs??[]})]}),(0,a.jsxs)("div",{className:"mt-8 space-y-4 rounded-lg border border-mail-border p-4",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Invitations utilisateurs"}),(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-[1fr_auto]",children:[(0,a.jsx)(d.p,{value:z,onChange:e=>F(e.target.value),placeholder:"alice@entreprise.com"}),(0,a.jsx)(l.$,{disabled:!z,onClick:()=>{let e=P.split(/[\n,;]+/).map(e=>e.trim()).filter(Boolean);el.mutateAsync({email:z,alternate_emails:e.length>0?e:void 0}).then(e=>{F(""),T(""),e.token&&window.prompt("Lien de claim (copier)",`${window.location.origin}/onboard/claim?token=${e.token}`)})},children:"Inviter"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.J,{htmlFor:"alternate-emails",children:"Emails alternatifs (SSO / alias, s\xe9par\xe9s par virgule ou ligne)"}),(0,a.jsx)("textarea",{id:"alternate-emails",className:"min-h-16 w-full rounded-md border bg-background px-3 py-2 text-sm",value:P,onChange:e=>T(e.target.value),placeholder:"alice.smith@tenant.onmicrosoft.com"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Adresses OIDC accept\xe9es en plus de l'email d'invitation (UPN Microsoft, alias Gmail, etc.)."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.J,{htmlFor:"csv-emails",children:"Import rapide (email seul, une ligne)"}),(0,a.jsx)("textarea",{id:"csv-emails",className:"min-h-24 w-full rounded-md border bg-background px-3 py-2 text-sm",value:D,onChange:e=>R(e.target.value),placeholder:"alice@entreprise.com\nbob@entreprise.com"}),(0,a.jsx)(l.$,{variant:"outline",disabled:!D.trim(),onClick:()=>{let e=D.split(/\r?\n/).map(e=>e.trim()).filter(Boolean);ed.mutateAsync(e).then(()=>R(""))},children:"Importer les emails"})]}),(0,a.jsxs)("div",{className:"space-y-3 rounded-md border border-dashed p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-sm font-medium",children:"Pr\xe9-provision roster (CSV)"}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Colonnes : ",(0,a.jsx)("code",{children:"email"})," (requis), ",(0,a.jsx)("code",{children:"display_name"}),","," ",(0,a.jsx)("code",{children:"alternate_emails"})," (s\xe9par\xe9s par ;). En-t\xeate optionnel."]})]}),(0,a.jsx)("textarea",{id:"roster-csv",className:"min-h-32 w-full rounded-md border bg-background px-3 py-2 font-mono text-xs",value:V,onChange:e=>L(e.target.value),placeholder:"email,display_name,alternate_emails\nalice@entreprise.com,Alice Dupont,alice.perso@gmail.com\nbob@entreprise.com,Bob Martin,"}),(0,a.jsx)(l.$,{disabled:!V.trim()||ec.isPending,onClick:()=>{ec.mutateAsync(V).then(e=>{L("");let t=e.errors?.length??0;U(`${e.created} cr\xe9\xe9(s), ${e.skipped_duplicates} doublon(s) ignor\xe9(s)`+(t>0?`, ${t} erreur(s)`:""))}).catch(e=>{U(e instanceof ApiRequestError?e.message:"Import roster \xe9chou\xe9")})},children:ec.isPending?"Import…":"Importer le roster"}),Q&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:Q}),(eu.data?.roster?.length??0)>0&&(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b text-muted-foreground",children:[(0,a.jsx)("th",{className:"py-1 pr-2 font-medium",children:"Email"}),(0,a.jsx)("th",{className:"py-1 pr-2 font-medium",children:"Nom"}),(0,a.jsx)("th",{className:"py-1 pr-2 font-medium",children:"Statut"})]})}),(0,a.jsx)("tbody",{children:eu.data?.roster.map(e=>(0,a.jsxs)("tr",{className:"border-b border-border/50",children:[(0,a.jsx)("td",{className:"py-1 pr-2",children:e.email}),(0,a.jsx)("td",{className:"py-1 pr-2",children:e.display_name||"—"}),(0,a.jsx)("td",{className:"py-1 pr-2",children:(0,a.jsx)(v.E,{variant:_(e.status),children:e.status})})]},e.id))})]})})]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["DNS : TXT ",(0,a.jsx)("code",{children:"_ultisuite-verify.domaine"}),", MX vers Stalwart, SPF/DKIM/DMARC via Stalwart webadmin."]})]})]})]})}function E({project:e,drives:t,loading:s,onModeChange:n,modePending:i,onApprove:r,onReject:o,actionPending:d}){let c=e.shared_drive_mode??"auto",m=t.filter(e=>"pending"===e.status);return(0,a.jsxs)("div",{className:"mt-8 space-y-4 rounded-lg border border-mail-border p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium",children:"Shared Drives Google"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Import automatique ou approbation manuelle avant migration. Les fichiers partag\xe9s ne sont import\xe9s qu'une fois par projet (d\xe9duplication)."})]}),(0,a.jsxs)(u.l6,{value:c,disabled:i,onValueChange:e=>n(e),children:[(0,a.jsx)(u.bq,{className:"w-[220px]",children:(0,a.jsx)(u.yv,{})}),(0,a.jsxs)(u.gC,{children:[(0,a.jsx)(u.eb,{value:"auto",children:"Import auto"}),(0,a.jsx)(u.eb,{value:"manual",children:"Approbation manuelle"})]})]})]}),s&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Chargement des shared drives…"}),!s&&0===t.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Aucun shared drive d\xe9couvert — lancez un job Drive utilisateur pour d\xe9tecter les drives accessibles."}),"manual"===c&&m.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm font-medium",children:["En attente d'approbation (",m.length,")"]}),(0,a.jsx)("ul",{className:"space-y-2",children:m.map(e=>(0,a.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-medium",children:e.name||e.drive_id}),(0,a.jsx)("code",{className:"ml-2 text-xs text-muted-foreground",children:e.drive_id})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$,{size:"sm",disabled:d,onClick:()=>r(e.drive_id),children:"Approuver"}),(0,a.jsx)(l.$,{size:"sm",variant:"outline",disabled:d,onClick:()=>o(e.drive_id),children:"Rejeter"})]})]},e.id))})]}),!s&&t.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-sm font-medium",children:["Tous les shared drives (",t.length,")"]}),(0,a.jsx)("ul",{className:"max-h-40 space-y-1 overflow-y-auto text-xs",children:t.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)(v.E,{variant:"approved"===e.status?"default":"rejected"===e.status?"destructive":"secondary",children:e.status}),(0,a.jsx)("span",{children:e.name||e.drive_id})]},e.id))})]})]})}function C({report:e}){return(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[e.domain&&(0,a.jsxs)("p",{children:["Domaine : ",(0,a.jsx)("span",{className:"font-medium",children:e.domain})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(v.E,{variant:e.txt_verified?"default":"destructive",children:["TXT ",e.txt_verified?"OK":"KO"]}),(0,a.jsxs)(v.E,{variant:e.mx_verified?"default":"destructive",children:["MX ",e.mx_verified?"OK":"KO"]})]}),e.txt_expected&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Attendu TXT : ",(0,a.jsx)("code",{children:e.txt_expected})]}),e.expected_mx&&e.expected_mx.length>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["MX attendus : ",e.expected_mx.join(", ")]}),e.mx_records&&e.mx_records.length>0&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["MX live : ",e.mx_records.join(", ")]}),e.warnings?.map(e=>(0,a.jsx)("p",{className:"text-amber-700",children:e},e)),e.errors?.map(e=>(0,a.jsx)("p",{className:"text-destructive",children:e},e))]})}function S({project:e,selected:t,onSelect:s,onActivate:n,onCutover:i}){return(0,a.jsx)("li",{className:`rounded-lg border p-4 ${t?"border-primary/50 bg-muted/30":""}`,onClick:s,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&s()},children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:e.name}),(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap gap-2",children:[(0,a.jsx)(v.E,{variant:"outline",children:e.source_provider}),(0,a.jsx)(v.E,{variant:_(e.status),children:e.status}),(0,a.jsx)(v.E,{variant:"outline",children:N[e.auth_mode]??e.auth_mode}),"microsoft"===e.source_provider&&(0,a.jsx)(v.E,{variant:e.microsoft_admin_consent_at?"default":e.microsoft_admin_consent_error?"destructive":"outline",children:e.microsoft_admin_consent_at?"MS consent OK":e.microsoft_admin_consent_error?"MS consent KO":"MS consent ?"}),e.cutover_at&&(0,a.jsxs)(v.E,{variant:"outline",children:["cutover ",new Date(e.cutover_at).toLocaleDateString()]}),e.cutover_dns&&(0,a.jsxs)(v.E,{variant:e.cutover_dns.mx_verified&&e.cutover_dns.txt_verified?"default":"destructive",children:["DNS"," ",e.cutover_dns.mx_verified&&e.cutover_dns.txt_verified?"OK":"KO"]}),e.delta_mode&&(0,a.jsx)(v.E,{variant:"secondary",children:"delta"})]})]}),(0,a.jsxs)("div",{className:"flex gap-2",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)(l.$,{size:"sm",variant:"outline",onClick:n,children:"Activer"}),(0,a.jsx)(l.$,{size:"sm",variant:"secondary",onClick:i,children:"Bascule MX"})]})]})})}function k({jobs:e,loading:t,auditJobId:s,onAudit:n,onRetry:i,onResetCursor:r,retryPending:o,resetPending:d}){return t?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Chargement des jobs…"}):0===e.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Aucun job — invitez des utilisateurs et demandez-leur de claim + OAuth."}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b text-left text-muted-foreground",children:[(0,a.jsx)("th",{className:"py-2 pr-3 font-medium",children:"Utilisateur"}),(0,a.jsx)("th",{className:"py-2 pr-3 font-medium",children:"Service"}),(0,a.jsx)("th",{className:"py-2 pr-3 font-medium",children:"Statut"}),(0,a.jsx)("th",{className:"py-2 pr-3 font-medium",children:"Import\xe9s"}),(0,a.jsx)("th",{className:"py-2 font-medium",children:"Actions"})]})}),(0,a.jsx)("tbody",{children:e.map(e=>(0,a.jsxs)("tr",{className:"border-b last:border-0",children:[(0,a.jsx)("td",{className:"py-2 pr-3",children:e.user_email||e.user_id.slice(0,8)}),(0,a.jsx)("td",{className:"py-2 pr-3",children:b[e.service]??e.service}),(0,a.jsxs)("td",{className:"py-2 pr-3",children:[(0,a.jsx)(v.E,{variant:_(e.status),children:e.status}),e.stats_json?.rate_limited===!0&&(0,a.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:"(429)"})]}),(0,a.jsx)("td",{className:"py-2 pr-3",children:function(e){let t=e.stats_json?.imported;if("number"!=typeof t)return"—";let s=e.stats_json?.estimated_total;return"number"==typeof s&&s>0?`${Math.round(t)} / ~${Math.round(s)}`:String(Math.round(t))}(e)}),(0,a.jsxs)("td",{className:"py-2",children:[(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(l.$,{size:"sm",variant:s===e.id?"secondary":"outline",onClick:()=>n(e.id),children:"Audit"}),"failed"===e.status&&(0,a.jsx)(l.$,{size:"sm",variant:"outline",disabled:o,onClick:()=>i(e.id),children:"Relancer"}),"running"!==e.status&&(0,a.jsx)(l.$,{size:"sm",variant:"ghost",disabled:d,onClick:()=>r(e.id),children:"R\xe9initialiser"})]}),e.error&&(0,a.jsx)("p",{className:"mt-1 max-w-xs truncate text-xs text-destructive",title:e.error,children:e.error})]})]},e.id))})]})})}function $({projectId:e,jobId:t,jobs:s}){let i=s.find(e=>e.id===t),r=(0,y.w2)(e,t),o=(0,y.My)(e,t,"failed"),d=(0,y.My)(e,t,"skipped"),[c,u]=(0,n.useState)(!1),m=r.data,p=o.data?.items??[],x=d.data?.items??[];return(0,a.jsxs)("div",{className:"mt-4 space-y-3 rounded-lg border border-dashed p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h4",{className:"font-medium",children:["Audit import — ",i?.user_email??t.slice(0,8)]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:[b[i?.service??""]??i?.service," \xb7 statut job ",i?.status??"—"]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(l.$,{variant:"outline",size:"sm",disabled:!m||0===m.total,onClick:()=>void(0,y.x6)(e,t,"csv"),children:[(0,a.jsx)(h.A,{className:"mr-2 size-4"}),"Export CSV"]}),(0,a.jsxs)(l.$,{variant:"outline",size:"sm",disabled:!m||0===m.total,onClick:()=>void(0,y.x6)(e,t,"ndjson"),children:[(0,a.jsx)(h.A,{className:"mr-2 size-4"}),"Export NDJSON"]}),r.isLoading&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Chargement…"})]})]}),m&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(v.E,{variant:"default",children:[m.imported," import\xe9s"]}),(0,a.jsxs)(v.E,{variant:m.failed>0?"destructive":"outline",children:[m.failed," \xe9checs"]}),(0,a.jsxs)(v.E,{variant:m.skipped>0?"secondary":"outline",children:[m.skipped," ignor\xe9s"]}),(0,a.jsxs)(v.E,{variant:"outline",children:[m.total," total"]})]}),m&&0===m.total&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Aucun \xe9l\xe9ment enregistr\xe9 — le job n'a pas encore trait\xe9 d'items ou la migration date d'avant l'audit."}),p.length>0&&(0,a.jsx)(A,{title:"\xc9checs",items:p,variant:"destructive"}),m&&m.skipped>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(l.$,{size:"sm",variant:"ghost",onClick:()=>u(e=>!e),children:[c?"Masquer":"Afficher"," les ignor\xe9s (",m.skipped,")"]}),c&&x.length>0&&(0,a.jsx)(A,{title:"Ignor\xe9s",items:x,variant:"secondary"})]}),m&&0===m.failed&&0===m.skipped&&m.total>0&&(0,a.jsx)("p",{className:"text-sm text-green-700",children:"Tous les \xe9l\xe9ments suivis ont \xe9t\xe9 import\xe9s avec succ\xe8s."})]})}function A({title:e,items:t,variant:s}){return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e}),(0,a.jsx)("ul",{className:"max-h-48 space-y-1 overflow-y-auto text-xs",children:t.map(e=>(0,a.jsxs)("li",{className:"rounded border px-2 py-1.5",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(v.E,{variant:s,children:e.status}),(0,a.jsx)("code",{className:"truncate",children:e.source_id}),e.rel_path&&(0,a.jsx)("span",{className:"truncate text-muted-foreground",children:e.rel_path})]}),e.reason&&(0,a.jsx)("p",{className:"mt-1 text-destructive",title:e.reason,children:e.reason})]},e.source_id))})]})}var q=s(37820);function M(){let e=(0,y.G6)(),t=(0,y.FZ)(),[s,i]=(0,n.useState)(""),r=(0,q.U)(e=>e.mailing),o=(0,q.U)(e=>e.setMailing),h=e.data?.domains??[];return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsx)(x.f,{title:"Mail",description:"Domaines h\xe9berg\xe9s Stalwart, relais SMTP des notifications suite et migration.",policySection:"mailing",children:(0,a.jsxs)(m.I,{columns:2,children:[(0,a.jsxs)(p.KT,{title:"Domaines h\xe9berg\xe9s",description:"V\xe9rification DNS, DKIM et provisioning des bo\xeetes @domaine.",children:[(0,a.jsxs)("div",{className:"grid gap-4 md:grid-cols-[1fr_auto] md:items-end",children:[(0,a.jsx)(p.u8,{label:"Nouveau domaine",htmlFor:"new-domain",children:(0,a.jsx)(d.p,{id:"new-domain",className:"h-9",value:s,onChange:e=>i(e.target.value),placeholder:"entreprise.com"})}),(0,a.jsx)(l.$,{disabled:!s||t.isPending,onClick:()=>{t.mutateAsync({name:s}).then(()=>i(""))},children:"Ajouter"})]}),(0,a.jsx)("ul",{className:"space-y-3",children:h.map(e=>(0,a.jsx)(K,{domain:e},e.id))})]}),(0,a.jsx)(p.KT,{title:"Notifications suite (SMTP)",description:"Partages de fichiers, mentions, invitations — distinct des comptes mail utilisateur.",action:(0,a.jsx)(c.d,{checked:r.enabled,onCheckedChange:e=>o({enabled:e})}),children:(0,a.jsxs)(p.wB,{columns:2,children:[(0,a.jsx)(p.u8,{label:"H\xf4te SMTP",children:(0,a.jsx)(d.p,{className:"h-9",value:r.smtp_host,onChange:e=>o({smtp_host:e.target.value}),placeholder:"smtp.example.com"})}),(0,a.jsx)(p.u8,{label:"Port",children:(0,a.jsx)(d.p,{className:"h-9",type:"number",value:r.smtp_port,onChange:e=>o({smtp_port:Number(e.target.value)||587})})}),(0,a.jsx)(p.u8,{label:"Utilisateur",children:(0,a.jsx)(d.p,{className:"h-9",value:r.smtp_user,onChange:e=>o({smtp_user:e.target.value})})}),(0,a.jsx)(p.u8,{label:"Mot de passe",children:(0,a.jsx)(d.p,{className:"h-9",type:"password",value:r.smtp_password,onChange:e=>o({smtp_password:e.target.value})})}),(0,a.jsx)(p.u8,{label:"Chiffrement",children:(0,a.jsxs)(u.l6,{value:r.tls_mode,onValueChange:e=>o({tls_mode:e}),children:[(0,a.jsx)(u.bq,{className:"h-9 w-full min-w-0",children:(0,a.jsx)(u.yv,{})}),(0,a.jsxs)(u.gC,{children:[(0,a.jsx)(u.eb,{value:"starttls",children:"STARTTLS"}),(0,a.jsx)(u.eb,{value:"ssl",children:"SSL/TLS"}),(0,a.jsx)(u.eb,{value:"none",children:"Aucun"})]})]})}),(0,a.jsx)(p.u8,{label:"Adresse d'exp\xe9dition",children:(0,a.jsx)(d.p,{className:"h-9",type:"email",value:r.from_email,onChange:e=>o({from_email:e.target.value})})}),(0,a.jsx)(p.u8,{label:"Nom affich\xe9",children:(0,a.jsx)(d.p,{className:"h-9",value:r.from_name,onChange:e=>o({from_name:e.target.value})})}),(0,a.jsx)(p.u8,{label:"Reply-To (optionnel)",className:"sm:col-span-2",children:(0,a.jsx)(d.p,{className:"h-9",type:"email",value:r.reply_to??"",onChange:e=>o({reply_to:e.target.value})})})]})})]})}),(0,a.jsx)(w,{domains:h})]})}function I({label:e,copied:t,onCopy:s}){return(0,a.jsx)(l.$,{type:"button",size:"icon",variant:"ghost",className:"h-6 w-6 shrink-0","aria-label":e,title:e,onClick:s,children:t?(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(r.A,{className:"h-3.5 w-3.5 opacity-60"})})}function K({domain:e}){let t=(0,y.U4)(e.id),s=(0,y.xV)(e.id),[i,r]=(0,n.useState)(null),d=`_ultisuite-verify.${e.name}`,c=(0,n.useCallback)(async(e,t,s)=>{try{await navigator.clipboard.writeText(e),r(t),o.oR.success(s),window.setTimeout(()=>r(null),2e3)}catch{o.oR.error("Impossible de copier")}},[]);return(0,a.jsx)("li",{className:"rounded-lg border border-mail-border bg-mail-surface-muted/40 p-4",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"font-medium",children:[e.name,e.is_platform_domain?" (plateforme)":""]}),(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Statut : ",e.status]}),e.verification_token&&(0,a.jsxs)("div",{className:"mt-2 space-y-1 text-xs text-muted-foreground",children:[(0,a.jsx)("p",{children:"Enregistrement TXT :"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,a.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:d}),(0,a.jsx)(I,{label:"Copier le nom TXT",copied:"name"===i,onCopy:()=>void c(d,"name","Nom TXT copi\xe9")}),(0,a.jsx)("span",{className:"px-0.5",children:"="}),(0,a.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:e.verification_token}),(0,a.jsx)(I,{label:"Copier la valeur TXT",copied:"value"===i,onCopy:()=>void c(e.verification_token,"value","Valeur TXT copi\xe9e")})]})]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>void t.mutateAsync(),children:"V\xe9rifier TXT"}),(0,a.jsx)(l.$,{size:"sm",variant:"secondary",onClick:()=>void s.mutateAsync(),children:"V\xe9rifier MX"})]})]})})}},3964:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(43200).A)("container",[["path",{d:"M22 7.7c0-.6-.4-1.2-.8-1.5l-6.3-3.9a1.72 1.72 0 0 0-1.7 0l-10.3 6c-.5.2-.9.8-.9 1.4v6.6c0 .5.4 1.2.8 1.5l6.3 3.9a1.72 1.72 0 0 0 1.7 0l10.3-6c.5-.3.9-1 .9-1.5Z",key:"1t2lqe"}],["path",{d:"M10 21.9V14L2.1 9.1",key:"o7czzq"}],["path",{d:"m10 14 11.9-6.9",key:"zm5e20"}],["path",{d:"M14 19.8v-8.1",key:"159ecu"}],["path",{d:"M18 17.5V9.4",key:"11uown"}]])},4559:(e,t,s)=>{s.d(t,{$B:()=>w,Dk:()=>z,EE:()=>C,Es:()=>h,FZ:()=>l,G6:()=>o,HQ:()=>x,Kh:()=>u,MB:()=>S,My:()=>N,P2:()=>A,U4:()=>d,Ve:()=>j,_K:()=>f,bl:()=>M,cE:()=>P,dc:()=>y,eS:()=>q,h2:()=>m,hF:()=>g,hs:()=>F,iF:()=>T,iX:()=>I,jS:()=>v,n5:()=>k,oP:()=>E,u:()=>K,ug:()=>p,w2:()=>b,x6:()=>_,xV:()=>c,yJ:()=>$});var a=s(98306),n=s(39927),i=s(17745),r=s(94927);function o(){return(0,a.I)({queryKey:["admin","mail","domains"],queryFn:()=>r.uE.get("/admin/mail/domains")})}function l(){let e=(0,n.jE)();return(0,i.n)({mutationFn:e=>r.uE.post("/admin/mail/domains",e),onSuccess:()=>{e.invalidateQueries({queryKey:["admin","mail","domains"]})}})}function d(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:()=>r.uE.post(`/admin/mail/domains/${e}/verify-txt`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","mail","domains"]})}})}function c(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:()=>r.uE.post(`/admin/mail/domains/${e}/verify-mx`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","mail","domains"]})}})}function u(){return(0,a.I)({queryKey:["admin","migration","projects"],queryFn:()=>r.uE.get("/admin/migration/projects")})}function m(){let e=(0,n.jE)();return(0,i.n)({mutationFn:e=>r.uE.post("/admin/migration/projects",e),onSuccess:()=>{e.invalidateQueries({queryKey:["admin","migration","projects"]})}})}function p(){let e=(0,n.jE)();return(0,i.n)({mutationFn:e=>r.uE.post(`/admin/migration/projects/${e}/activate`),onSuccess:()=>{e.invalidateQueries({queryKey:["admin","migration","projects"]})}})}function x(){let e=(0,n.jE)();return(0,i.n)({mutationFn:e=>r.uE.post(`/admin/migration/projects/${e}/cutover`),onSuccess:()=>{e.invalidateQueries({queryKey:["admin","migration","projects"]})}})}function h(e){return(0,a.I)({queryKey:["admin","migration","projects",e,"cutover-dns"],enabled:!!e,queryFn:()=>r.uE.get(`/admin/migration/projects/${e}/cutover-dns`)})}function j(e){return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/invites`,t)})}function v(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/invites/import`,{emails:t}),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects"]})},meta:{requiresProjectId:e}})}function g(e,t=!0){return(0,a.I)({queryKey:["admin","migration","projects",e,"roster"],enabled:!!e&&t,queryFn:()=>r.uE.get(`/admin/migration/projects/${e}/roster`)})}function f(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/roster`,{csv:t}),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects",e,"roster"]})},meta:{requiresProjectId:e}})}function y(e,t=!0){return(0,a.I)({queryKey:["admin","migration","projects",e,"jobs"],enabled:!!e&&t,queryFn:()=>r.uE.get(`/admin/migration/projects/${e}/jobs`),refetchInterval:1e4})}function b(e,t){return(0,a.I)({queryKey:["admin","migration","projects",e,"jobs",t,"audit","summary"],enabled:!!(e&&t),queryFn:()=>r.uE.get(`/admin/migration/projects/${e}/jobs/${t}/audit/summary`),refetchInterval:1e4})}function N(e,t,s="failed"){let n="all"===s?"":s;return(0,a.I)({queryKey:["admin","migration","projects",e,"jobs",t,"audit",s],enabled:!!(e&&t),queryFn:()=>{let s=new URLSearchParams({page_size:"50"});return n&&s.set("status",n),r.uE.get(`/admin/migration/projects/${e}/jobs/${t}/audit?${s.toString()}`)},refetchInterval:1e4})}async function _(e,t,s){let a=await r.uE.getBlob(`/admin/migration/projects/${e}/jobs/${t}/audit/export?format=${s}`),n=URL.createObjectURL(a),i=document.createElement("a");i.href=n,i.download=`migration-job-audit-${t.slice(0,8)}.${"csv"===s?"csv":"ndjson"}`,i.click(),URL.revokeObjectURL(n)}function w(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.patch(`/admin/migration/projects/${e}/shared-drive-mode`,{shared_drive_mode:t}),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects"]}),t.invalidateQueries({queryKey:["admin","migration","projects",e,"shared-drives"]})}})}function E(e,t=!0){return(0,a.I)({queryKey:["admin","migration","projects",e,"shared-drives"],enabled:!!e&&t,queryFn:()=>r.uE.get(`/admin/migration/projects/${e}/shared-drives`),refetchInterval:15e3})}function C(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/shared-drives/${encodeURIComponent(t)}/approve`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects",e,"shared-drives"]})}})}function S(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/shared-drives/${encodeURIComponent(t)}/reject`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects",e,"shared-drives"]})}})}function k(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/jobs/${t}/retry`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects",e,"jobs"]})}})}function $(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:t=>r.uE.post(`/admin/migration/projects/${e}/jobs/${t}/reset-cursor`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects",e,"jobs"]})}})}function A(e){let t=(0,n.jE)();return(0,i.n)({mutationFn:()=>r.uE.post(`/admin/migration/projects/${e}/jobs/retry-failed`),onSuccess:()=>{t.invalidateQueries({queryKey:["admin","migration","projects",e,"jobs"]})}})}function q(){return(0,i.n)({mutationFn:e=>{let t=new URLSearchParams;e.tenant?.trim()&&t.set("tenant",e.tenant.trim()),e.projectId&&t.set("project_id",e.projectId);let s=t.toString();return r.uE.get(`/admin/migration/microsoft/admin-consent-url${s?`?${s}`:""}`)}})}function M(e){return(0,a.I)({queryKey:["migration","invite",e],enabled:!!e,queryFn:()=>r.uE.get(`/migration/invite?token=${encodeURIComponent(e??"")}`)})}function I(){return(0,a.I)({queryKey:["migration","status"],queryFn:()=>r.uE.get("/migration/status")})}function K(){let e=(0,n.jE)();return(0,i.n)({mutationFn:e=>r.uE.post("/migration/claim",e),onSuccess:()=>{e.invalidateQueries({queryKey:["migration"]})}})}function z(){return(0,i.n)({mutationFn:e=>r.uE.post("/migration/oauth/start",e)})}function F(e,t){return(0,a.I)({queryKey:["mail","address-check",e,t],enabled:e.length>0&&t.length>0,queryFn:()=>r.uE.get(`/mail/addresses/check?local=${encodeURIComponent(e)}&domain=${encodeURIComponent(t)}`)})}function P(){return(0,a.I)({queryKey:["mail","hosted","status"],queryFn:()=>r.uE.get("/mail/hosted/status")})}function T(){let e=(0,n.jE)();return(0,i.n)({mutationFn:e=>r.uE.post("/mail/hosted/setup",e),onSuccess:()=>{e.invalidateQueries({queryKey:["mail","hosted","status"]}),e.invalidateQueries({queryKey:["accounts"]}),e.invalidateQueries({queryKey:["identities"]})}})}},18584:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(43200).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},26159:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(43200).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},66987:(e,t,s)=>{s.d(t,{c:()=>o});var a=s(4208),n=s(84834),i=s(47391),r=s(58113);function o({brand:e,icon:t,children:s,className:l,iconClassName:d,suffix:c}){let u=t??(e?(0,i.r)(e):void 0);return(0,a.jsxs)("span",{className:(0,r.cn)("inline-flex min-w-0 items-center gap-2",l),children:[u?(0,a.jsx)(n.In,{icon:u,className:(0,r.cn)("size-4 shrink-0",d),"aria-hidden":!0}):null,(0,a.jsxs)("span",{className:"truncate",children:[s,c]})]})}},71809:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(43200).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},77510:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(43200).A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},89342:(e,t,s)=>{s.d(t,{TR:()=>x,bq:()=>m,eb:()=>h,gC:()=>p,l6:()=>d,mi:()=>j,s3:()=>c,yv:()=>u});var a=s(4208);s(91356);var n=s(29477),i=s(9519),r=s(35019),o=s(30758),l=s(58113);function d({...e}){return(0,a.jsx)(n.bL,{"data-slot":"select",...e})}function c({...e}){return(0,a.jsx)(n.YJ,{"data-slot":"select-group",...e})}function u({...e}){return(0,a.jsx)(n.WT,{"data-slot":"select-value",...e})}function m({className:e,size:t="default",variant:s="default",children:r,...o}){return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,"data-variant":s,className:(0,l.cn)("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit cursor-pointer items-center justify-between gap-2 rounded-md bg-transparent text-sm whitespace-nowrap transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","default"===s&&"border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 border px-3 py-2 shadow-xs focus-visible:ring-[3px]","ghost"===s&&"border-0 shadow-none hover:bg-transparent focus-visible:ring-0 dark:bg-transparent dark:hover:bg-transparent dark:data-[state=open]:bg-transparent",e),...o,children:[r,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(i.A,{className:"size-4 opacity-50"})})]})}function p({className:e,children:t,position:s="popper",...i}){return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content",className:(0,l.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===s&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,...i,children:[(0,a.jsx)(v,{}),(0,a.jsx)(n.LM,{className:(0,l.cn)("p-1","popper"===s&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,a.jsx)(g,{})]})})}function x({className:e,...t}){return(0,a.jsx)(n.JU,{"data-slot":"select-label",className:(0,l.cn)("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function h({className:e,children:t,...s}){return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...s,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(r.A,{className:"size-4"})})}),(0,a.jsx)(n.p4,{children:t})]})}function j({className:e,...t}){return(0,a.jsx)(n.wv,{"data-slot":"select-separator",className:(0,l.cn)("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function v({className:e,...t}){return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-pointer items-center justify-center py-1",e),...t,children:(0,a.jsx)(o.A,{className:"size-4"})})}function g({className:e,...t}){return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-pointer items-center justify-center py-1",e),...t,children:(0,a.jsx)(i.A,{className:"size-4"})})}}}]); |