1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[748],{690:function(e,n,t){t.d(n,{Cm:function(){return c},DJ:function(){return d},Ix:function(){return x},Vj:function(){return a},Z$:function(){return s},kS:function(){return o},pi:function(){return u},pr:function(){return l},x4:function(){return r},xx:function(){return p}});let i=async(e,n)=>{var t,i;let r=await fetch(e,{...n,headers:{"Content-Type":"application/json",...null!==(i=null==n?void 0:n.headers)&&void 0!==i?i:{}}}),o=(null===(t=r.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?await r.json():null;if(!r.ok)throw Error((null==o?void 0:o.error)||"Erreur ".concat(r.status));return o},r=e=>i("/api/admin/login",{method:"POST",body:JSON.stringify({password:e})}),o=()=>i("/api/admin/logout",{method:"POST"}),s=()=>i("/api/admin/content"),a=e=>i("/api/admin/content",{method:"PUT",body:JSON.stringify({content:e})}),l=()=>i("/api/admin/translations"),c=e=>i("/api/admin/translations",{method:"POST",body:JSON.stringify({reply:e})}),d=()=>
1i("/api/admin/snapshots"),p=e=>i("/api/admin/snapshots",{method:"POST",body:JSON.stringify({name:e})}),u=e=>i("/api/admin/restore",{method:"POST",body:JSON.stringify(e)}),x=async e=>{let n=await fetch("/api/admin/media",{method:"POST",headers:{"Content-Type":e.type,"X-Filename":encodeURIComponent(e.name)},body:e}),t=await n.json();if(!n.ok)throw Error((null==t?void 0:t.error)||"Envoi impossible");return t.src}},4527:function(e,n,t){t.d(n,{O:function(){return x}});var i=t(5893),r=t(7533),o=t(5616),s=t(5861),a=t(3946),l=t(1233),c=t(9417),d=t(594),p=t(6907),u=t(5466);let x=e=>{let{open:n,title:t,subtitle:x,onClose:h,onSubmit:m,onDelete:j,submitLabel:g="Valider",children:f}=e;return(0,i.jsx)(r.ZP,{anchor:"right",open:n,onClose:h,PaperProps:{sx:{width:{xs:"100%",sm:460},backgroundColor:u.O9.paper}},children:(0,i.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,i.jsxs)(o.Z,{sx:{px:3,py:2.5,borderBottom:"1px solid ".concat(u.O9.line),display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:2},children:[(0,i.jsxs)(o.Z,{children:[(0,i.jsx)(s.Z,{variant:"h4",component:"h2",children:t}),x&&(0,i.jsx)(s.Z,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:x})]}),(0,i.jsx)(a.Z,{onClick:h,"aria-label":"Fermer",sx:{mt:-.5,mr:-1},children:(0,i.jsx)(d.Z,{})})]}),(0,i.jsx)(o.Z,{component:"form",onSubmit:e=>{e.preventDefault(),m()},sx:{flex:1,overflowY:"auto",px:3,py:3},children:(0,i.jsx)(l.Z,{spacing:2.5,children:f})}),(0,i.jsxs)(o.Z,{sx:{px:3,py:2,borderTop:"1px solid ".concat(u.O9.line),backgroundColor:u.O9.paperRaised,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[j?(0,i.jsx)(c.Z,{onClick:j,startIcon:(0,i.jsx)(p.Z,{}),sx:{color:u.O9.red},children:"Supprimer"}):(0,i.jsx)("span",{}),(0,i.jsxs)(l.Z,{direction:"row",spacing:1,children:[(0,i.jsx)(c.Z,{onClick:h,color:"inherit",children:"Annuler"}),(0,i.jsx)(c.Z,{onClick:m,variant:"contained",children:g})]})]})]})})}},7748:function(e,n,t){t.d(n,{C:function(){return y}});var i=t(5893),r=t(7294),o=t(1233),s=t(8456),a=t(1737),l=t(5861),c=t(5616),d=t(9417),p=t(7922),u=t(2515),x=t(7918),h=t(1899),m=t(55),j=t(3265),g=t(5466),f=t(4527),Z=t(690);let y=e=>{var n;let{open:t,onClose:y,onApplied:v}=e,[b,C]=(0,r.useState)(null),[w,S]=(0,r.useState)(""),[k,O]=(0,r.useState)(!1),[T,P]=(0,r.useState)(!1),[I,E]=(0,r.useState)(!1),[z,N]=(0,r.useState)(null),[J,F]=(0,r.useState)(null),R=(0,r.useCallback)(()=>{(0,Z.pr)().then(C).catch(e=>N(e.message))},[]);(0,r.useEffect)(()=>{t&&(N(null),F(null),S(""),C(null),R())},[t,R]);let _=async()=>{if(null==b?void 0:b.prompt){try{await navigator.clipboard.writeText(b.prompt)}catch(e){E(!0);return}P(!0),setTimeout(()=>P(!1),2500)}},A=async()=>{O(!0),N(null),F(null);try{let e=await (0,Z.Cm)(w);C(e.state),S("");let n=e.missing.length+e.incomplete.length;F("".concat(e.applied," texte").concat(e.applied>1?"s":""," traduit").concat(e.applied>1?"s":""," en 6 langues.")+(n>0?" ".concat(n," ligne").concat(n>1?"s \xe9taient incompl\xe8tes":" \xe9tait incompl\xe8te"," et rest").concat(n>1?"ent":"e"," \xe0 traduire."):"")+(e.pending>0?" Il reste ".concat(e.pending," texte").concat(e.pending>1?"s":""," \xe0 traduire."):" Tout est \xe0 jour.")),null==v||v()}catch(e){N(e instanceof Error?e.message:"Traductions inexploitables")}finally{O(!1)}},D=null!==(n=null==b?void 0:b.pending)&&void 0!==n?n:0;return(0,i.jsxs)(f.O,{open:t,title:"Traductions",subtitle:"Anglais, espagnol, italien, allemand, chinois et japonais.",onClose:y,onSubmit:y,submitLabel:"Fermer",children:[!b&&!z&&(0,i.jsx)(o.Z,{alignItems:"center",sx:{py:4},children:(0,i.jsx)(s.Z,{size:24})}),J&&(0,i.jsx)(a.Z,{severity:"success",children:J}),z&&(0,i.jsx)(a.Z,{severity:"error",children:z}),b&&0===D&&(0,i.jsx)(a.Z,{severity:"success",icon:(0,i.jsx)(m.Z,{}),children:"Tout le contenu est traduit dans les six langues."}),b&&D>0&&b.prompt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o.Z,{direction:"row",spacing:1,alignItems:"center",children:[(0,i.jsx)(j.Z,{sx:{color:g.O9.red}}),(0,i.jsxs)(l.Z,{variant:"body2",children:[(0,i.jsx)("strong",{children:D})," texte",D>1?"s":""," en attente.",D>b.texts.length&&(0,i.jsxs)(i.Fragment,{children:[" Ce premier lot en contient ",b.texts.length,"."]})]})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(l.Z,{variant:"overline",component:"p",color:"text.secondary",children:"\xc9tape 1 â
1copier la demande"}),(0,i.jsx)(l.Z,{variant:"body2",color:"text.secondary",sx:{mt:.5,mb:1.5},children:"Collez-la dans ChatGPT, Claude, Gemini ou l'assistant de votre choix."}),(0,i.jsxs)(o.Z,{direction:"row",spacing:1,children:[(0,i.jsx)(d.Z,{variant:"contained",startIcon:T?(0,i.jsx)(m.Z,{}):(0,i.jsx)(h.Z,{}),onClick:_,children:T?"Copi\xe9":"Copier la demande"}),(0,i.jsx)(d.Z,{color:"inherit",onClick:()=>E(e=>!e),children:I?"Masquer":"Voir le texte"})]}),(0,i.jsx)(p.Z,{in:I,children:(0,i.jsx)(c.Z,{component:"pre",sx:{mt:2,p:2,maxHeight:260,overflow:"auto",borderRadius:2,backgroundColor:g.O9.paperSunk,border:"1px solid ".concat(g.O9.line),fontSize:"0.75rem",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:b.prompt})})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(l.Z,{variant:"overline",component:"p",color:"text.secondary",children:"\xc9tape 2 â coller la r\xe9ponse"}),(0,i.jsx)(u.Z,{value:w,onChange:e=>S(e.target.value),placeholder:'{"1": {"en": "â¦", "es": "â¦"}, "2": {â¦}}',multiline:!0,minRows:6,maxRows:14,fullWidth:!0,size:"small",sx:{mt:1}}),(0,i.jsx)(d.Z,{variant:"contained",onClick:A,disabled:k||""===w.trim(),sx:{mt:1.5},startIcon:k?(0,i.jsx)(s.Z,{size:16,color:"inherit"}):void 0,children:"Appliquer les traductions"})]}),(0,i.jsxs)(c.Z,{children:[(0,i.jsx)(l.Z,{variant:"overline",component:"p",color:"text.secondary",children:"Textes de ce lot"}),(0,i.jsxs)(o.Z,{direction:"row",flexWrap:"wrap",gap:.5,sx:{mt:1},children:[b.texts.slice(0,12).map((e,n)=>(0,i.jsx)(x.Z,{label:e,size:"small",variant:"outlined",sx:{maxWidth:240}},n)),b.texts.length>12&&(0,i.jsx)(x.Z,{label:"+ ".concat(b.texts.length-12),size:"small"})]})]})]})]})}}}]);
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.