1import{j as e,n as J,m as q,r as B,v as z,N as Y}from"./vendor-react-RByCY-Mz.js";import{L as G,D as Q,C as K,E as V,F as X,G as W,H as Z,B as g,u as F,S as w,J as y}from"./index-WCS9x8Dk.js";import{R as ee,a as te}from"./RiskEntryList-Bw7Qff-R.js";import{B as L}from"./badge-Dbo8BGdG.js";import{b as A,p as se,d as I,q as ie}from"./data-B9Q7NJXF.js";import{u as N}from"./useLocalized-CGegYE7b.js";import{u as f}from"./vendor-i18n-Brn8V5gU.js";import{u as T}from"./useFavorites-BrHChG14.js";import{aX as ne,aY as ae}from"./vendor-icons-Dq_HR579.js";import{C as P,a as re,c as O}from"./card-zNIZm2xa.js";import oe from"./NotFoundPage-CHu1ErXC.js";import"./vendor-query-CnDe4iID.js";import"./vendor-supabase-DyFNpjS2.js";import"./vendor-charts-D79u5_yG.js";import"./vendor-ui-CUSbNqge.js";import"./vendor-motion-CpVQFZS7.js";import"./vendor-markdown-BWDJH5DM.js";function le({subdomain:t,domain:i,favoriteSlot:a}){const r=N(),{t:n}=f("referentiel");return e.jsx("header",{className:"bg-muted/30 -mx-4 px-4 py-8 mb-8 border-b",children:e.jsx("div",{className:"max-w-3xl mx-auto",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(G,{to:A(i.slug),className:"inline-block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-forest rounded",children:e.jsx(L,{variant:"secondary",className:"mb-3 hover:bg-secondary/80",children:n("hero.domainBadge",{id:i.id,name:r(i.name)})})}),e.jsxs("h1",{className:"text-3xl md:text-4xl font-bold leading-tight",children:[e.jsx("span",{className:"font-mono text-2xl text-muted-foreground mr-3",children:t.id}),r(t.name)]}),e.jsx("p",{className:"mt-4 text-lg text-muted-foreground leading-relaxed",children:r(t.description)})]}),a&&e.jsx("div",{className:"shrink-0",children:a})]})})})}const ce="referentiel.pendingFavorite";function S({open:t,onOpenChange:i,subdomainId:a}){const r=J(),n=q(),{t:s}=f("referentiel");function l(o){sessionStorage.setItem(ce,JSON.stringify({subdomainId:a,timestamp:Date.now()}));const d=encodeURIComponent(n.pathname+n.search);r(`${o}?redirect=${d}&pendingFavorite=${encodeURIComponent(a)}`),i(!1)}return e.jsx(Q,{open:t,onOpenChange:i,children:e.jsxs(K,{children:[e.jsxs(V,{children:[e.jsx(X,{children:s("signInDialog.title")}),e.jsx(W,{children:s("signInDialog.description")})]}),e.jsxs(Z,{className:"flex-col gap-2 sm:flex-row sm:gap-2",children:[e.jsx(g,{variant:"ghost",onClick:()=>i(!1),children:s("signInDialog.later")}),e.jsx(g,{variant:"outline",onClick:()=>l("/inscription"),children:s("signInDialog.createAccount")}),e.jsx(g,{onClick:()=>l("/connexion"),children:s("signInDialog.signIn")})]})]})})}function de({subdomainId:t,size:i="default",className:a=""}){const{user:r}=F(),{isFavorite:n,toggle:s,isToggling:l}=T(),[o,d]=B.useState(!1),{t:x}=f("referentiel"),m=n(t),h=m?ne:ae;function u(){if(!r){d(!0);return}s(t)}return i==="icon"?e.jsxs(e.Fragment,{children:[e.jsx(g,{type:"button",variant:"ghost",size:"icon","aria-label":x(m?"favoriteBtn.remove":"favoriteBtn.add"),"aria-pressed":m,disabled:l,onClick:u,className:a,children:e.jsx(h,{className:`h-5 w-5 ${m?"text-brand-forest":""}`,"aria-hidden":"true"})}),e.jsx(S,{open:o,onOpenChange:d,subdomainId:t})]}):e.jsxs(e.Fragment,{children:[e.jsxs(g,{type:"button",variant:m?"default":"outline","aria-label":x(m?"favoriteBtn.remove":"favoriteBtn.add"),"aria-pressed":m,disabled:l,onClick:u,className:a,children:[e.jsx(h,{className:"h-4 w-4 mr-2","aria-hidden":"true"}),x(m?"favoriteBtn.active":"favoriteBtn.inactive")]}),e.jsx(S,{open:o,onOpenChange:d,subdomainId:t})]})}function me({example:t}){return e.jsxs(P,{children:[e.jsx(re,{className:"pb-3",children:e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[e.jsx(L,{variant:"secondary",children:t.sector}),t.organizationType&&e.jsx("span",{className:"text-xs text-muted-foreground",children:t.organizationType})]})}),e.jsx(O,{children:e.jsx("p",{className:"text-sm leading-relaxed",children:t.scenario})})]})}const ue={Direct:{className:"bg-emerald-100 text-emerald-900 border-emerald-300",label:"Direct"},"Direct (futur)":{className:"bg-amber-100 text-amber-900 border-amber-300",label:"Direct (futur)"},"Direct (finance)":{className:"bg-emerald-100 text-emerald-900 border-emerald-300",label:"Direct (finance)"},"Direct (santé)":{className:"bg-emerald-100 text-emerald-900 border-emerald-300",label:"Direct (santé)"},"Direct (hors QC)":{className:"bg-emerald-100 text-emerald-900 border-emerald-300",label:"Direct (hors QC)"},"Si exposition UE":{className:"bg-blue-100 text-blue-900 border-blue-300",label:"Si exposition UE"},Recommandation:{className:"bg-slate-100 text-slate-900 border-slate-300",label:"Recommandation"},Indirect:{className:"bg-slate-100 text-slate-700 border-slate-300",label:"Indirect"}},xe=["Québec","Canada","International","UE","Ãtats-Unis"];function fe({mappings:t,groupByJurisdiction:i=!0}){const{t:a}=f("referentiel");if(t.length===0)return e.jsx("p",{className:"text-sm text-muted-foreground",children:a("legalList.empty")});if(!i)return e.jsx("div",{className:"space-y-3",children:t.map(n=>e.jsx(E,{mapping:n},n.id))});const r=new Map;for(const n of t){const s=r.get(n.framework.jurisdiction)??[];s.push(n),r.set(n.framework.jurisdiction,s)}return e.jsx("div",{className:"space-y-6",children:xe.filter(n=>r.has(n)).map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-muted-foreground mb-3",children:n}),e.jsx("div",{className:"space-y-3",children:r.get(n).map(s=>e.jsx(E,{mapping:s},s.id))})]},n))})}function E({mapping:t}){const i=N(),{t:a}=f("referentiel"),r=ue[t.applicability];return e.jsx(P,{children:e.jsx(O,{className:"pt-4 pb-4",children:e.jsx("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[t.framework.url?e.jsx("a",{href:t.framework.url,target:"_blank",rel:"noopener noreferrer",className:"font-semibold hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-forest roun
1ded",children:i(t.framework.name)}):e.jsx("span",{className:"font-semibold",children:i(t.framework.name)}),e.jsx(L,{variant:"outline",className:r.className,"aria-label":a("legalList.applicabilityAria",{label:r.label}),children:r.label})]}),e.jsx("p",{className:"text-sm mt-1",children:t.referencesText}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",children:i(t.framework.description)})]})})})})}function pe({mitigations:t}){const i=N(),{t:a}=f("referentiel");if(t.length===0)return e.jsx("p",{className:"text-sm text-muted-foreground",children:a("mitigationList.empty")});const r=t.filter(s=>s.parentCode===null),n=t.filter(s=>s.parentCode!==null);return e.jsx("ul",{className:"space-y-3",children:[...r,...n].sort((s,l)=>s.code.localeCompare(l.code,void 0,{numeric:!0})).map(s=>e.jsxs("li",{className:s.parentCode?"pl-6 border-l-2 border-brand-forest/30":"",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"font-mono text-sm text-muted-foreground shrink-0",children:s.code}),e.jsx("span",{className:"font-semibold",children:i(s.name)})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2",children:i(s.description)})]},s.code))})}const U="referentiel.pendingFavorite",ge=300*1e3;function he(){try{const t=sessionStorage.getItem(U);if(!t)return null;const i=JSON.parse(t);return Date.now()-i.timestamp>ge?(D(),null):i}catch{return null}}
1function D(){try{sessionStorage.removeItem(U)}catch{}}function Te(){const{slug:t}=z(),{user:i}=F(),{toggle:a,isFavorite:r}=T(),n=N(),{t:s}=f("referentiel"),l=t?se(t):null;if(B.useEffect(()=>{if(!i||!l)return;const c=he();if(c){if(c.subdomainId!==l.subdomain.id){D();return}r(c.subdomainId)||a(c.subdomainId),D()}},[i,l,a,r]),!t)return e.jsx(Y,{to:I(),replace:!0});if(!l)return e.jsxs(e.Fragment,{children:[e.jsx(w,{title:s("subdomain.notFound"),noindex:!0}),e.jsx(oe,{})]});const{subdomain:o,domain:d,legalMappings:x,sectorExamples:m,mitigations:h}=l,u=ie(o.id),M=be(m),p=n(o.name),$=n(o.description),C=n(d.name),b=`https://gouvernance.ai${I()}`,j=`${b}/sous-domaines/${o.slug}`,_={"@context":"https://schema.org","@type":"DefinedTerm","@id":`${j}#term`,identifier:o.id,name:`${o.id} ${p}`,description:$,inDefinedTermSet:{"@type":"DefinedTermSet",name:"Référentiel AIRI â gouvernance.ai",url:b},url:j},R=u.length>0?{"@context":"https://schema.org","@type":"ItemList",name:`Risques documentés â ${o.id} ${p}`,description:`Liste exhaustive des ${u.length} risques d'IA documentés pour le sous-domaine ${o.id} (${p}), dérivés du MIT AI Risk Repository et adaptés au contexte québécois.`,numberOfItems:u.length,itemListOrder:"https://schema.org/ItemListOrderAscending",itemListElement:u.map((c,v)=>({"@type":"ListItem",position:v+1,item:{"@type":"Thing","@id":`${j}#risk-${c.id}`,identifier:c.id,name:n(c.title),description:n(c.description),url:`${j}#${c.id}`}}))}:null,H={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Accueil",item:"https://gouvernance.ai/"},{"@type":"ListItem",position:2,name:"Référentiel AIRI",item:b},{"@type":"ListItem",position:3,name:`Domaine ${d.id} â ${C}`,item:`${b}/domaines/${d.slug}`},{"@type":"ListItem",position:4,name:`${o.id} ${p}`}]};return e.jsxs(e.Fragment,{children:[e.jsx(w,{title:`${o.id} ${p} · ${u.length} ${s("subdomain.metaTitleSuffix")}`,description:$.slice(0,155),type:"article",articleSection:C}),e.jsx(y,{data:_}),e.jsx(y,{data:H}),R&&e.jsx(y,{data:R}),e.jsxs("main",{className:"max-w-5xl mx-auto px-4 py-8 md:py-12",children:[e.jsx(ee,{items:[{label:s("subdomain.breadcrumbRoot"),href:I()},{label:s("subdomain.breadcrumbDomain",{id:d.id}),href:A(d.slug)},{label:o.id}]}),e.jsx(le,{subdomain:o,domain:d,favoriteSlot:e.jsx(de,{subdomainId:o.id})}),e.jsxs("article",{className:"max-w-3xl mx-auto space-y-12",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:s("subdomain.sectionLegal")}),e.jsx(fe,{mappings:x})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:s("subdomain.sectionExamples")}),m.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subdomain.emptyExamples")}):Object.entries(M).map(([c,v])=>e.jsxs("div",{className:"mb-6 last:mb-0",children:[e.jsx("h3",{className:"text-lg font-semibold mb-3",children:c}),e.jsx("div",{className:"space-y-3",children:v.map(k=>e.jsx(me,{example:k},k.id))})]},c))]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-4",children:s("subdomain.sectionMitigations")}),e.jsx(pe,{mitigations:h})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold mb-2",children:s("subdomain.sectionRisks",{count:u.length})}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s("subdomain.risksOrigin")}),e.jsx(te,{entries:u})]}),e.jsxs("section",{className:"rounded-lg bg-muted/50 p-6 text-center",children:[e.jsx("h3",{className:"font-semibold mb-2",children:s("subdomain.evalHeading")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("subdomain.evalComing")})]})]})]})]})}function be(t){const i={};for(const a of t)i[a.sector]||(i[a.sector]=[]),i[a.sector].push(a);return i}export{Te as ReferentielSubdomainPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.