vendor: 9,185 bytes, lines 1-6
1import{j as s}from"./ui-B-jAfBIu.js";import{r as y}from"./vendor-DFDkvaNg.js";import{c as Ee,ap as L,aq as Ye,ar as R,B as S,D as Pe,C as We,ac as _e,ad as qe,ae as Le,L as ae,S as Fe,i as He,j as Ke,k as Be,m as $,an as Qe,T as Ge,v as ze,w as ie,x as ce,a3 as oe,a4 as Re,E as $e,W as ue,as as Q,a6 as M,s as de}from"./index-BCsAUAr3.js";import{C as A,a as I,b as X,c as V}from"./card-FDTNR4GW.js";import{S as Ae}from"./scroll-area-DxU0jOrS.js";import{B as le}from"./badge-Dm4sUQsj.js";import{T as Ie}from"./textarea-CdCdWFQp.js";import{S as Xe}from"./switch-Se3HGWrP.js";import{T as Ve,a as Je,b as he,c as E,d as Ue,e as Y}from"./table-BpKDLz-I.js";import{u as Ze,b as et}from"./query-BNFXhbss.js";import{R as J}from"./refresh-cw-B58ovFyF.js";import{C as tt}from"./circle-alert-D0uUIXsZ.js";import{C as me}from"./copy-C8r9vImC.js";import{t as p,b as z,c as D,g as fe,f as rt,h as je,e as nt,d as st}from"./de-DT4o61yC.js";import{C as at}from"./clock-tUlmfkpA.js";import{C as it}from"./circle-x-CJtgQjbv.js";import{C as ct}from"./circle-check-D03ZvCsy.js";import"./supabase-DM3UDwCf.js";/** 2 * @license lucide-react v0.546.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ot=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],U=Ee("history",ot);function F(r,e){var m,u,b,w;const t=z(),n=(e==null?void 0:e.weekStartsOn)??((u=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:u.weekStartsOn)??t.weekStartsOn??((w=(b=t.locale)==null?void 0:b.options)==null?void 0:w.weekStartsOn)??0,a=p(r),i=a.getDay(),l=(i<n?7:0)+i-n;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function G(r){return F(r,{weekStartsOn:1})}function pe(r){const e=p(r),t=e.getFullYear(),n=D(r,0);n.setFullYear(t+1,0,4),n.setHours(0,0,0,0);const a=G(n),i=D(r,0);i.setFullYear(t,0,4),i.setHours(0,0,0,0);const l=G(i);return e.getTime()>=a.getTime()?t+1:e.getTime()>=l.getTime()?t:t-1}function ge(r){const e=p(r);return e.setHours(0,0,0,0),e}function ut(r,e){const t=ge(r),n=ge(e),a=+t-fe(t),i=+n-fe(n);return Math.round((a-i)/rt)}function dt(r){const e=pe(r),t=D(r,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),G(t)}function lt(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function ht(r){if(!lt(r)&&typeof r!="number")return!1;const e=p(r);return!isNaN(Number(e))}function mt(r){const e=p(r),t=D(r,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function ft(r){const e=p(r);return ut(e,mt(e))+1}function gt(r){const e=p(r),t=+G(e)-+dt(e);return Math.round(t/je)+1}function Ne(r,e){var w,T,O,j;const t=p(r),n=t.getFullYear(),a=z(),i=(e==null?void 0:e.firstWeekContainsDate)??((T=(w=e==null?void 0:e.locale)==null?void 0:w.options)==null?void 0:T.firstWeekContainsDate)??a.firstWeekContainsDate??((j=(O=a.locale)==null?void 0:O.options)==null?void 0:j.firstWeekContainsDate)??1,l=D(r,0);l.setFullYear(n+1,0,i),l.setHours(0,0,0,0);const m=F(l,e),u=D(r,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const b=F(u,e);return t.getTime()>=m.getTime()?n+1:t.getTime()>=b.getTime()?n:n-1}function xt(r,e){var m,u,b,w;const t=z(),n=(e==null?void 0:e.firstWeekContainsDate)??((u=(m=e==null?void 0:e.locale)==null?void 0:m.options)==null?void 0:u.firstWeekContainsDate)??t.firstWeekContainsDate??((w=(b=t.locale)==null?void 0:b.options)==null?void 0:w.firstWeekContainsDate)??1,a=Ne(r,e),i=D(r,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),F(i,e)}function wt(r,e){const t=p(r),n=+F(t,e)-+xt(t,e);return Math.round(n/je)+1}function o(r,e){const t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}const N={y(r,e){const t=r.getFullYear(),n=t>0?t:1-t;return o(e==="yy"?n%100:n,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):o(t+1,2)},d(r,e){return o(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return o(r.getHours()%12||12,e.length)},H(r,e){return o(r.getHours(),e.length)},m(r,e){return o(r.getMinutes(),e.length)},s(r,e){return o(r.getSeconds(),e.length)},S(r,e){const t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return o(a,e.length)}},P={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xe={G:function(r,e,t){const n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return N.y(r,e)},Y:function(r,e,t,n){const a=Ne(r,n),i=a>0?a:1-a;if(e==="YY"){const l=i%100;return o(l,2)}return e==="Yo"?t.ordinalNumber(i,{unit:"year"}):o(i,e.length)},R:function(r,e){const t=pe(r);return o(t,e.length)},u:function(r,e){const t=r.getFullYear();return o(t,e.length)},Q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return o(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return o(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){const n=r.getMonth();switch(e){case"M":case"MM":return N.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){const n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return o(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){const a=wt(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):o(a,e.length)},I:function(r,e,t){const n=gt(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):o(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):N.d(r,e)},D:function(r,e,t){const n=ft(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):o(n,e.length)},E:function(r,e,t){const n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){const a=r.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return o(i,2);case"eo":return t.ordinalNumber(i,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){const a=r.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return o(i,e.length);case"co":return t.ordinalNumber(i,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){const n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return o(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){const a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){const n=r.getHours();let a;switch(n===12?a=P.noon:n===0?a=P.midnight:a=n/12>
vendor: 4,666 bytes, line 6
6=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){const n=r.getHours();let a;switch(n>=17?a=P.evening:n>=12?a=P.afternoon:n>=4?a=P.morning:a=P.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return N.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):N.H(r,e)},K:function(r,e,t){const n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):o(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):o(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):N.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):N.s(r,e)},S:function(r,e){return N.S(r,e)},X:function(r,e,t){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return ye(n);case"XXXX":case"XX":return C(n);case"XXXXX":case"XXX":default:return C(n,":")}},x:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"x":return ye(n);case"xxxx":case"xx":return C(n);case"xxxxx":case"xxx":default:return C(n,":")}},O:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+we(n,":");case"OOOO":default:return"GMT"+C(n,":")}},z:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+we(n,":");case"zzzz":default:return"GMT"+C(n,":")}},t:function(r,e,t){const n=Math.trunc(r.getTime()/1e3);return o(n,e.length)},T:function(r,e,t){const n=r.getTime();return o(n,e.length)}};function we(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),i=n%60;return i===0?t+String(a):t+String(a)+e+o(i,2)}function ye(r,e){return r%60===0?(r>0?"-":"+")+o(Math.abs(r)/60,2):C(r,e)}function C(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=o(Math.trunc(n/60),2),i=o(n%60,2);return t+a+e+i}const be=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Te=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},yt=(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return be(r,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",be(n,e)).replace("{{time}}",Te(a,e))},bt={p:Te,P:yt},jt=/^D+$/,pt=/^Y+$/,Nt=["D","DD","YY","YYYY"];function Tt(r){return jt.test(r)}function Ot(r){return pt.test(r)}function vt(r,e,t){const n=kt(r,e,t);if(console.warn(n),Nt.includes(r))throw new RangeError(n)}function kt(r,e,t){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const St=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Dt=/^'([^]*?)'?$/,Mt=/''/g,Et=/[a-zA-Z]/;function Yt(r,e,t){var w,T,O,j,W,K,_,B;const n=z(),a=(t==null?void 0:t.locale)??n.locale??nt,i=(t==null?void 0:t.firstWeekContainsDate)??((T=(w=t==null?void 0:t.locale)==null?void 0:w.options)==null?void 0:T.firstWeekContainsDate)??n.firstWeekContainsDate??((j=(O=n.locale)==null?void 0:O.options)==null?void 0:j.firstWeekContainsDate)??1,l=(t==null?void 0:t.weekStartsOn)??((K=(W=t==null?void 0:t.locale)==null?void 0:W.options)==null?void 0:K.weekStartsOn)??n.weekStartsOn??((B=(_=n.locale)==null?void 0:_.options)==null?void 0:B.weekStartsOn)??0,m=p(r);if(!ht(m))throw new RangeError("Invalid time value");let u=e.match(Ct).map(h=>{const f=h[0];if(f==="p"||f==="P"){const v=bt[f];return v(h,a.formatLong)}return h}).join("").match(St).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const f=h[0];if(f==="'")return{isToken:!1,value:Pt(h)};if(xe[f])return{isToken:!0,value:h};
6if(f.match(Et))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(m,u));const b={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const f=h.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&Ot(f)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&Tt(f))&&vt(f,e,String(r));const v=xe[f[0]];return v(m,f,a.localize,b)}).join("")}function Pt(r){const e=r.match(Dt);return e?e[1].replace(Mt,"'"):r}function H(r,e=""){const t=new Map;for(const n in r){const a=e?`${e}.${n}`:n,i=r[n];typeof i=="object"&&i!==null&&!Array.isArray(i)?H(i,a).forEach((m,u)=>t.set(u,m)):t.set(a,i)}return t}function Wt(r,e){const t=H(r),n=H(e),a=new Map;return t.forEach((i,l)=>{!n.has(l)&&typeof i=="string"&&a.set(l,i)}),a}function _t(r){const e=new Map;return r.forEach((t,n)=>{const a=n.split(".")[0];e.has(a)||e.set(a,new Map),e.get(a).set(n,t)}),e}function er(){const[r,e]=y.useState(!1),[t,n]=y.useState({}),[a,i]=y.useState(new Set),[l,m]=y.useState(null),[u,b]=y.useState(""),[w,T]=y.useState("sync"),[O,j]=y.useState(!1),[W,K]=y.useState("homepage"),[_,B]=y.useState(!0),h=Ze(),f=y.useMemo(()=>Object.keys(L).sort(),[]),{data:v=[],isLoading:Oe}=et({queryKey:["translation-sync-logs"],queryFn:async()=>{const{data:c,error:d}=await de.from("translation_sync_logs").select("*").order("started_at",{ascending:!1}).limit(50);if(d)throw d;return c},refetchInterval:r?2e3:!1}),k=y.useMemo(()=>Wt(L,Q),[]),Z=y.useMemo(()=>_t(k),[k]),ve=H(L),ke=H(Q),ee=ve.size,te=ke.size,Se=Math.round(te/ee*100),Ce=c=>{const d=new Set(a);d.has(c)?d.delete(c):d.add(c),i(d)},re=async c=>{const d=!!(c!=null&&c.overwriteExisting),g=(c==null?void 0:c.namespace)??"homepage";if(k.size===0&&!d){M.info("Keine fehlenden Keys â bei Textänderungen bitte 'Erneut übersetzen' nutzen.");return}let q=Q;if(d){const x=structuredClone(Q);if(g==="__all__")q={};else{if(!(g in L)){M.error(`Unbekannter Bereich: ${g}`);return}delete x[g],q=x}}e(!0);try{const{data:x,error:se}=await de.functions.invoke("sync-translations",{body:{sourceTranslations:L,targetTranslations:q,sourceLanguage:"de",targetLanguage:"en",triggerType:"manual"}});if(se)throw se;if(x.success)n(x.translations||{}),x.updatedTarget&&b(JSON.stringify(x.updatedTarget,null,2)),j(!1),h.invalidateQueries({queryKey:["translation-sync-logs"]}),M.success(d?`Ãbersetzungen aktualisiert (${x.translatedCount})`:`Translated ${x.translatedCount} keys successfully!`);else throw new Error(x.error||"Translation failed")}catch(x){console.error("Translation sync error:",x),h.invalidateQueries({queryKey:["translation-sync-logs"]}),M.error(x instanceof Error?x.message:"Failed to sync translations")}finally{e(!1)}},ne=async(c,d)=>{try{await navigator.clipboard.writeText(c),d&&(m(d),setTimeout(()=>m(null),2e3)),M.success("Copied to clipboard!")}catch{M.error("Failed to copy")}},De=c=>{switch(c){case"completed":return s.jsx(ct,{className:"h-4 w-4 text-green-500"});case"failed":return s.jsx(it,{className:"h-4 w-4 text-destructive"});case"running":return s.jsx(ue,{className:"h-4 w-4 text-primary animate-spin"});default:return s.jsx(at,{className:"h-4 w-4 text-muted-foreground"})}},Me=c=>{switch(c){case"manual":return"Manuell";case"scheduled":return"Geplant";case"deploy":return"Deploy";default:return c}};return s.jsx(Ye,{children:s.jsxs("div",{className:"space-y-6 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[s.jsx(R,{className:"h-6 w-6"}),"Ãbersetzungen"]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:k.size>0?`${k.size} fehlende Ãbersetzungen`:'Keine fehlenden Keys (Ãnderungen: âErneut übersetzen")'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(S,{variant:"outline",onClick:()=>j(!0),disabled:r,children:"Erneut übersetzen"}),s.jsxs(S,{onClick:()=>re(),disabled:r,children:[s.jsx(J,{className:`h-4 w-4 mr-2 ${r?"animate-spin":""}`}),r?"Ãbersetze...":"Synchronisieren"]})]})]}),s.jsx(Pe,{open:O,onOpenChange:j,children:s.jsxs(We,{children:[s.jsxs(_e,{children:[s.jsx(qe,{children:"Geänderte Texte aktualisieren"}),s.jsx(Le,{children:'Wenn du deutsche Texte geändert hast, werden sie nicht als âfehlend" erkannt. Hier kannst du einen Bereich erneut übersetzen.'})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ae,{children:"Bereich"}),s.jsxs(Fe,{value:W,onValueChange:K,children:[s.jsx(He,{children:s.jsx(Ke,{placeholder:"Bereich wählen"})}),s.jsxs(Be,{children:[s.jsx($,{value:"homepage",children:"homepage"}),s.jsx($,{value:"__all__",children:"Alle Bereiche"}),f.filter(c=>c!=="homepage").map(c=>s.jsx($,{value:c,children:c},c))]})]})]}),s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3",children:[s.jsx(ae,{htmlFor:"overwriteExisting",children:"Bestehende Ãbersetzungen überschreiben"}
6),s.jsx(Xe,{id:"overwriteExisting",checked:_,onCheckedChange:B})]})]}),s.jsxs(Qe,{children:[s.jsx(S,{variant:"outline",onClick:()=>j(!1),disabled:r,children:"Abbrechen"}),s.jsxs(S,{onClick:()=>re({overwriteExisting:_,namespace:W}),disabled:r,children:[s.jsx(J,{className:`h-4 w-4 mr-2 ${r?"animate-spin":""}`}),r?"Ãbersetze...":"Starten"]})]})]})}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.jsxs("span",{children:["Abdeckung: ",s.jsxs("strong",{className:"text-foreground",children:[Se,"%"]})]}),s.jsx("span",{children:"â¢"}),s.jsxs("span",{children:["DE: ",ee]}),s.jsx("span",{children:"â¢"}),s.jsxs("span",{children:["EN: ",te]}),k.size>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"â¢"}),s.jsxs("span",{className:"text-amber-500 flex items-center gap-1",children:[s.jsx(tt,{className:"h-3 w-3"}),k.size," fehlen"]})]})]}),s.jsxs(Ge,{value:w,onValueChange:T,children:[s.jsxs(ze,{children:[s.jsxs(ie,{value:"sync",className:"flex items-center gap-2",children:[s.jsx(R,{className:"h-4 w-4"}),"Sync"]}),s.jsxs(ie,{value:"logs",className:"flex items-center gap-2",children:[s.jsx(U,{className:"h-4 w-4"}),"Logs",v.some(c=>c.status==="running")&&s.jsx("span",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"})]})]}),s.jsx(ce,{value:"sync",className:"mt-4",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(A,{children:[s.jsx(I,{className:"pb-3",children:s.jsx(X,{className:"text-base",children:"Fehlende Keys"})}),s.jsx(V,{children:s.jsx(Ae,{className:"h-[500px]",children:Z.size===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground",children:[s.jsx(oe,{className:"h-8 w-8 mb-2 text-green-500"}),s.jsx("p",{children:"Alles übersetzt!"})]}):s.jsx("div",{className:"space-y-2",children:Array.from(Z.entries()).map(([c,d])=>s.jsxs("div",{className:"border rounded-lg",children:[s.jsx("button",{onClick:()=>Ce(c),className:"w-full flex items-center justify-between p-3 hover:bg-accent/50 transition-colors",children:s.jsxs("div",{className:"flex items-center gap-2",children:[a.has(c)?s.jsx(Re,{className:"h-4 w-4"}):s.jsx($e,{className:"h-4 w-4"}),s.jsx("span",{className:"font-medium",children:c}),s.jsx(le,{variant:"secondary",children:d.size})]})}),a.has(c)&&s.jsx("div",{className:"border-t p-2 space-y-1",children:Array.from(d.entries()).map(([g,q])=>s.jsx("div",{className:"p-2 rounded bg-muted/50 text-sm",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("code",{className:"text-xs text-muted-foreground break-all",children:g}),s.jsx("p",{className:"mt-1 text-foreground truncate",children:q}),t[g]&&s.jsxs("p",{className:"mt-1 text-green-600 dark:text-green-400 truncate",children:["â ",t[g]]})]}),t[g]&&s.jsx(S,{variant:"ghost",size:"sm",onClick:()=>ne(t[g],g),children:l===g?s.jsx(oe,{className:"h-3 w-3 text-green-500"}):s.jsx(me,{className:"h-3 w-3"})})]})},g))})]},c))})})})]}),s.jsxs(A,{children:[s.jsx(I,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(X,{className:"text-base",children:"en.json Output"}),u&&s.jsxs(S,{variant:"outline",size:"sm",onClick:()=>ne(u),children:[s.jsx(me,{className:"h-4 w-4 mr-2"}),"Kopieren"]})]})}),s.jsx(V,{children:u?s.jsx(Ie,{value:u,readOnly:!0,className:"h-[500px] font-mono text-xs"}):s.jsx("div",{className:"h-[500px] border rounded-md flex items-center justify-center text-muted-foreground",children:s.jsxs("div",{className:"text-center",children:[s.jsx(R,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:'Klicke "Synchronisieren"'})]})})})]})]})}),s.jsx(ce,{value:"logs",className:"mt-4",children:s.jsxs(A,{children:[s.jsx(I,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(X,{className:"text-base flex items-center gap-2",children:[s.jsx(U,{className:"h-4 w-4"}),"Sync-Verlauf"]}),s.jsx(S,{variant:"ghost",size:"sm",onClick:()=>h.invalidateQueries({queryKey:["translation-sync-logs"]}),children:s.jsx(J,{className:"h-4 w-4"})})]})}),s.jsx(V,{children:Oe?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ue,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):v.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground",children:[s.jsx(U,{className:"h-8 w-8 mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"Noch keine Sync-Läufe"})]}):s.jsxs(Ve,{children:[s.jsx(Je,{children:s.jsxs(he,{children:[s.jsx(E,{className:"w-[50px]",children:"Status"}),s.jsx(E,{children:"Trigger"}),s.jsx(E,{children:"Keys"}),s.jsx(E,{children:"Gestartet"}),s.jsx(E,{children:"Dauer"}),s.jsx(E,{children:"Details"})]})}),s.jsx(Ue,{children:v.map(c=>{var g;const d=c.completed_at?Math.round((new Date(c.completed_at).getTime()-new Date(c.started_at).getTime())/1e3):null;return s.jsxs(he,{children:[s.jsx(Y,{children:De(c.status)}),s.jsx(Y,{children:s.jsx(le,{variant:"outline",children:Me(c.trigger_type)})}),s.jsx(Y,{children:c.keys_translated>0?s.jsx("span",{className:"font-medium text-green-600",children:c.keys_translated}):s.jsx("span",{className:"text-muted-foreground",children:"-"})}),s.jsx(Y,{className:"text-sm text-muted-foreground",children:Yt(new Date(c.started_at),"dd.MM.yy HH:mm",{locale:st})}),s.jsx(Y,{className:"text-sm text-muted-foreground",children:d!==null?`${d}s`:"-"}),s.jsx(Y,{className:"max-w-[200px]",children:c.error_message?s.jsx("span",{className:"text-xs text-destructive truncate block",children:c.error_message}):(g=c.metadata)!=null&&g.progress?s.jsx("span",{className:"text-xs text-muted-foreground",children:c.metadata.progress}):null})]},c.id)})})]})})]})})]})]})})}export{er as default};
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.