@hkonda/loco-translate 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-BPSVqlkD.js +67 -0
- package/dist/assets/{index-DplHMcYp.css → index-CHWggD94.css} +1 -1
- package/dist/index.html +2 -2
- package/dist/loco-dashboard-translations.json +1926 -0
- package/dist-server/routes/translations.d.ts.map +1 -1
- package/dist-server/routes/translations.js +7 -6
- package/dist-server/routes/translations.js.map +1 -1
- package/package.json +1 -1
- package/public/loco.js +77 -6
- package/public/loco.min.js +2 -2
- package/versions.json +1 -1
- package/dist/assets/index-Dnjf5Md_.js +0 -67
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var Rf=Object.defineProperty;var jf=(e,t,n)=>t in e?Rf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Rn=(e,t,n)=>jf(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function je(){}function Ni(e,t){for(const n in t)e[n]=t[n];return e}function Ac(e){return e()}function co(){return Object.create(null)}function lt(e){e.forEach(Ac)}function Ol(e){return typeof e=="function"}function $t(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let gi;function Pi(e,t){return e===t?!0:(gi||(gi=document.createElement("a")),gi.href=t,e===gi.href)}function Of(e){return Object.keys(e).length===0}function Sc(e,...t){if(e==null){for(const r of t)r(void 0);return je}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function ti(e,t,n){e.$$.on_destroy.push(Sc(t,n))}function yr(e,t,n){return e.set(n),t}function u(e,t){e.appendChild(t)}function F(e,t,n){e.insertBefore(t,n||null)}function D(e){e.parentNode&&e.parentNode.removeChild(e)}function ft(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function b(e){return document.createElement(e)}function pe(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function B(e){return document.createTextNode(e)}function E(){return B(" ")}function xt(){return B("")}function $(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Bt(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function Rr(e){return function(t){t.target===this&&e.call(this,t)}}function s(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Tc(e){return e===""?null:+e}function Uf(e){return Array.from(e.childNodes)}function ee(e,t){t=""+t,e.data!==t&&(e.data=t)}function De(e,t){e.value=t??""}function mt(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function vt(e,t,n){for(let r=0;r<e.options.length;r+=1){const i=e.options[r];if(i.__value===t){i.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function rn(e){const t=e.querySelector(":checked");return t&&t.__value}function fo(e,t,n){e.classList.toggle(t,!!n)}function Hf(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class Mc{constructor(t=!1){Rn(this,"is_svg",!1);Rn(this,"e");Rn(this,"n");Rn(this,"t");Rn(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=pe(n.nodeName):this.e=b(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)F(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(D)}}function zi(e,t){return new e(t)}let ni;function ei(e){ni=e}function $i(){if(!ni)throw new Error("Function called outside component initialization");return ni}function jr(e){$i().$$.on_mount.push(e)}function Zf(e){$i().$$.after_update.push(e)}function Ec(e){$i().$$.on_destroy.push(e)}function Ul(){const e=$i();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const l=Hf(t,n,{cancelable:r});return i.slice().forEach(o=>{o.call(e,l)}),!l.defaultPrevented}return!0}}function Ir(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}const xr=[],Jn=[];let Tr=[];const ho=[],Ic=Promise.resolve();let Al=!1;function Lc(){Al||(Al=!0,Ic.then(Nc))}function Lr(){return Lc(),Ic}function Dt(e){Tr.push(e)}const ul=new Set;let vr=0;function Nc(){if(vr!==0)return;const e=ni;do{try{for(;vr<xr.length;){const t=xr[vr];vr++,ei(t),Wf(t.$$)}}catch(t){throw xr.length=0,vr=0,t}for(ei(null),xr.length=0,vr=0;Jn.length;)Jn.pop()();for(let t=0;t<Tr.length;t+=1){const n=Tr[t];ul.has(n)||(ul.add(n),n())}Tr.length=0}while(xr.length);for(;ho.length;)ho.pop()();Al=!1,ul.clear(),ei(e)}function Wf(e){if(e.fragment!==null){e.update(),lt(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Dt)}}function Yf(e){const t=[],n=[];Tr.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),Tr=t}const Si=new Set;let qn;function Jt(){qn={r:0,c:[],p:qn}}function qt(){qn.r||lt(qn.c),qn=qn.p}function st(e,t){e&&e.i&&(Si.delete(e),e.i(t))}function ct(e,t,n,r){if(e&&e.o){if(Si.has(e))return;Si.add(e),qn.c.push(()=>{Si.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function Be(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Hl(e,t){e.d(1),t.delete(e.key)}function Pc(e,t){ct(e,1,1,()=>{t.delete(e.key)})}function si(e,t,n,r,i,l,o,a,c,f,d,h){let p=e.length,g=l.length,m=p;const _={};for(;m--;)_[e[m].key]=m;const v=[],y=new Map,w=new Map,C=[];for(m=g;m--;){const L=h(i,l,m),I=n(L);let P=o.get(I);P?C.push(()=>P.p(L,t)):(P=f(I,L),P.c()),y.set(I,v[m]=P),I in _&&w.set(I,Math.abs(m-_[I]))}const x=new Set,A=new Set;function M(L){st(L,1),L.m(a,d),o.set(L.key,L),d=L.first,g--}for(;p&&g;){const L=v[g-1],I=e[p-1],P=L.key,z=I.key;L===I?(d=L.first,p--,g--):y.has(z)?!o.has(P)||x.has(P)?M(L):A.has(z)?p--:w.get(P)>w.get(z)?(A.add(P),M(L)):(x.add(z),p--):(c(I,o),p--)}for(;p--;){const L=e[p];y.has(L.key)||c(L,o)}for(;g;)M(v[g-1]);return lt(C),v}function Di(e,t){const n={},r={},i={$$scope:1};let l=e.length;for(;l--;){const o=e[l],a=t[l];if(a){for(const c in o)c in a||(r[c]=1);for(const c in a)i[c]||(n[c]=a[c],i[c]=1);e[l]=a}else for(const c in o)i[c]=1}for(const o in r)o in n||(n[o]=void 0);return n}function Fi(e){return typeof e=="object"&&e!==null?e:{}}function ln(e){e&&e.c()}function Kt(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),Dt(()=>{const l=e.$$.on_mount.map(Ac).filter(Ol);e.$$.on_destroy?e.$$.on_destroy.push(...l):lt(l),e.$$.on_mount=[]}),i.forEach(Dt)}function Qt(e,t){const n=e.$$;n.fragment!==null&&(Yf(n.after_update),lt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Gf(e,t){e.$$.dirty[0]===-1&&(xr.push(e),Lc(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function sn(e,t,n,r,i,l,o=null,a=[-1]){const c=ni;ei(e);const f=e.$$={fragment:null,ctx:[],props:l,update:je,not_equal:i,bound:co(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:co(),dirty:a,skip_bound:!1,root:t.target||c.$$.root};o&&o(f.root);let d=!1;if(f.ctx=n?n(e,t.props||{},(h,p,...g)=>{const m=g.length?g[0]:p;return f.ctx&&i(f.ctx[h],f.ctx[h]=m)&&(!f.skip_bound&&f.bound[h]&&f.bound[h](m),d&&Gf(e,h)),p}):[],f.update(),d=!0,lt(f.before_update),f.fragment=r?r(f.ctx):!1,t.target){if(t.hydrate){const h=Uf(t.target);f.fragment&&f.fragment.l(h),h.forEach(D)}else f.fragment&&f.fragment.c();t.intro&&st(e.$$.fragment),Kt(e,t.target,t.anchor),Nc()}ei(c)}class an{constructor(){Rn(this,"$$");Rn(this,"$$set")}$destroy(){Qt(this,1),this.$destroy=je}$on(t,n){if(!Ol(n))return je;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Of(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Vf="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Vf);let Sl=null;function zc(e){Sl=e}function We(e,t={}){const n={...t.headers||{}};return Sl&&(n["X-API-Key"]=Sl),fetch(e,{...t,headers:n})}const wr=[];function Dc(e,t){return{subscribe:Zl(e,t).subscribe}}function Zl(e,t=je){let n;const r=new Set;function i(a){if($t(e,a)&&(e=a,n)){const c=!wr.length;for(const f of r)f[1](),wr.push(f,e);if(c){for(let f=0;f<wr.length;f+=2)wr[f][0](wr[f+1]);wr.length=0}}}function l(a){i(a(e))}function o(a,c=je){const f=[a,c];return r.add(f),r.size===1&&(n=t(i,l)||je),a(e),()=>{r.delete(f),r.size===0&&n&&(n(),n=null)}}return{set:i,update:l,subscribe:o}}function Fc(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=t.length<2;return Dc(n,(o,a)=>{let c=!1;const f=[];let d=0,h=je;const p=()=>{if(d)return;h();const m=t(r?f[0]:f,o,a);l?o(m):h=Ol(m)?m:je},g=i.map((m,_)=>Sc(m,v=>{f[_]=v,d&=~(1<<_),c&&p()},()=>{d|=1<<_}));return c=!0,p(),function(){lt(g),h(),c=!1}})}const dn=Zl(null);function Xf(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,l,o=[],a="",c=e.split("/");for(c[0]||c.shift();i=c.shift();)n=i[0],n==="*"?(o.push("wild"),a+="/(.*)"):n===":"?(r=i.indexOf("?",1),l=i.indexOf(".",1),o.push(i.substring(1,~r?r:~l?l:i.length)),a+=~r&&!~l?"(?:/([^/]+?))?":"/([^/]+?)",~l&&(a+=(~r?"?":"")+"\\"+i.substring(l))):a+="/"+i;return{keys:o,pattern:new RegExp("^"+a+"/?$","i")}}function Jf(e){let t,n,r;const i=[e[2]];var l=e[0];function o(a,c){let f={};for(let d=0;d<i.length;d+=1)f=Ni(f,i[d]);return c!==void 0&&c&4&&(f=Ni(f,Di(i,[Fi(a[2])]))),{props:f}}return l&&(t=zi(l,o(e)),t.$on("routeEvent",e[7])),{c(){t&&ln(t.$$.fragment),n=xt()},m(a,c){t&&Kt(t,a,c),F(a,n,c),r=!0},p(a,c){if(c&1&&l!==(l=a[0])){if(t){Jt();const f=t;ct(f.$$.fragment,1,0,()=>{Qt(f,1)}),qt()}l?(t=zi(l,o(a,c)),t.$on("routeEvent",a[7]),ln(t.$$.fragment),st(t.$$.fragment,1),Kt(t,n.parentNode,n)):t=null}else if(l){const f=c&4?Di(i,[Fi(a[2])]):{};t.$set(f)}},i(a){r||(t&&st(t.$$.fragment,a),r=!0)},o(a){t&&ct(t.$$.fragment,a),r=!1},d(a){a&&D(n),t&&Qt(t,a)}}}function qf(e){let t,n,r;const i=[{params:e[1]},e[2]];var l=e[0];function o(a,c){let f={};for(let d=0;d<i.length;d+=1)f=Ni(f,i[d]);return c!==void 0&&c&6&&(f=Ni(f,Di(i,[c&2&&{params:a[1]},c&4&&Fi(a[2])]))),{props:f}}return l&&(t=zi(l,o(e)),t.$on("routeEvent",e[6])),{c(){t&&ln(t.$$.fragment),n=xt()},m(a,c){t&&Kt(t,a,c),F(a,n,c),r=!0},p(a,c){if(c&1&&l!==(l=a[0])){if(t){Jt();const f=t;ct(f.$$.fragment,1,0,()=>{Qt(f,1)}),qt()}l?(t=zi(l,o(a,c)),t.$on("routeEvent",a[6]),ln(t.$$.fragment),st(t.$$.fragment,1),Kt(t,n.parentNode,n)):t=null}else if(l){const f=c&6?Di(i,[c&2&&{params:a[1]},c&4&&Fi(a[2])]):{};t.$set(f)}},i(a){r||(t&&st(t.$$.fragment,a),r=!0)},o(a){t&&ct(t.$$.fragment,a),r=!1},d(a){a&&D(n),t&&Qt(t,a)}}}function Kf(e){let t,n,r,i;const l=[qf,Jf],o=[];function a(c,f){return c[1]?0:1}return t=a(e),n=o[t]=l[t](e),{c(){n.c(),r=xt()},m(c,f){o[t].m(c,f),F(c,r,f),i=!0},p(c,[f]){let d=t;t=a(c),t===d?o[t].p(c,f):(Jt(),ct(o[d],1,1,()=>{o[d]=null}),qt(),n=o[t],n?n.p(c,f):(n=o[t]=l[t](c),n.c()),st(n,1),n.m(r.parentNode,r))},i(c){i||(st(n),i=!0)},o(c){ct(n),i=!1},d(c){c&&D(r),o[t].d(c)}}}function po(){const e=window.location.href.indexOf("#/");let t=e>-1?window.location.href.substr(e+1):"/";const n=t.indexOf("?");let r="";return n>-1&&(r=t.substr(n+1),t=t.substr(0,n)),{location:t,querystring:r}}const Wl=Dc(null,function(t){t(po());const n=()=>{t(po())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}),Qf=Fc(Wl,e=>e.location);Fc(Wl,e=>e.querystring);const go=Zl(void 0);async function Cr(e){if(!e||e.length<1||e.charAt(0)!="/"&&e.indexOf("#/")!==0)throw Error("Invalid parameter location");await Lr(),history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=(e.charAt(0)=="#"?"":"#")+e}function $f(e){e?window.scrollTo(e.__svelte_spa_router_scrollX,e.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function ed(e,t,n){let{routes:r={}}=t,{prefix:i=""}=t,{restoreScrollState:l=!1}=t;class o{constructor(A,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!A||typeof A=="string"&&(A.length<1||A.charAt(0)!="/"&&A.charAt(0)!="*")||typeof A=="object"&&!(A instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:L,keys:I}=Xf(A);this.path=A,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=L,this._keys=I}match(A){if(i){if(typeof i=="string")if(A.startsWith(i))A=A.substr(i.length)||"/";else return null;else if(i instanceof RegExp){const P=A.match(i);if(P&&P[0])A=A.substr(P[0].length)||"/";else return null}}const M=this._pattern.exec(A);if(M===null)return null;if(this._keys===!1)return M;const L={};let I=0;for(;I<this._keys.length;){try{L[this._keys[I]]=decodeURIComponent(M[I+1]||"")||null}catch{L[this._keys[I]]=null}I++}return L}async checkConditions(A){for(let M=0;M<this.conditions.length;M++)if(!await this.conditions[M](A))return!1;return!0}}const a=[];r instanceof Map?r.forEach((x,A)=>{a.push(new o(A,x))}):Object.keys(r).forEach(x=>{a.push(new o(x,r[x]))});let c=null,f=null,d={};const h=Ul();async function p(x,A){await Lr(),h(x,A)}let g=null,m=null;l&&(m=x=>{x.state&&(x.state.__svelte_spa_router_scrollY||x.state.__svelte_spa_router_scrollX)?g=x.state:g=null},window.addEventListener("popstate",m),Zf(()=>{$f(g)}));let _=null,v=null;const y=Wl.subscribe(async x=>{_=x;let A=0;for(;A<a.length;){const M=a[A].match(x.location);if(!M){A++;continue}const L={route:a[A].path,location:x.location,querystring:x.querystring,userData:a[A].userData,params:M&&typeof M=="object"&&Object.keys(M).length?M:null};if(!await a[A].checkConditions(L)){n(0,c=null),v=null,p("conditionsFailed",L);return}p("routeLoading",Object.assign({},L));const I=a[A].component;if(v!=I){I.loading?(n(0,c=I.loading),v=I,n(1,f=I.loadingParams),n(2,d={}),p("routeLoaded",Object.assign({},L,{component:c,name:c.name,params:f}))):(n(0,c=null),v=null);const P=await I();if(x!=_)return;n(0,c=P&&P.default||P),v=I}M&&typeof M=="object"&&Object.keys(M).length?n(1,f=M):n(1,f=null),n(2,d=a[A].props),p("routeLoaded",Object.assign({},L,{component:c,name:c.name,params:f})).then(()=>{go.set(f)});return}n(0,c=null),v=null,go.set(void 0)});Ec(()=>{y(),m&&window.removeEventListener("popstate",m)});function w(x){Ir.call(this,e,x)}function C(x){Ir.call(this,e,x)}return e.$$set=x=>{"routes"in x&&n(3,r=x.routes),"prefix"in x&&n(4,i=x.prefix),"restoreScrollState"in x&&n(5,l=x.restoreScrollState)},e.$$.update=()=>{e.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[c,f,d,r,i,l,w,C]}class td extends an{constructor(t){super(),sn(this,t,ed,Kf,$t,{routes:3,prefix:4,restoreScrollState:5})}}function mo(e,t,n){const r=e.slice();return r[5]=t[n],r}function _o(e){let t,n,r=e[5].icon+"",i,l,o,a,c,f;function d(){return e[3](e[5])}return{c(){t=b("button"),n=b("span"),i=E(),l=b("span"),l.textContent=`${e[5].label}`,o=E(),s(t,"class",a="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(e[0]===e[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))},m(h,p){F(h,t,p),u(t,n),n.innerHTML=r,u(t,i),u(t,l),u(t,o),c||(f=$(t,"click",d),c=!0)},p(h,p){e=h,p&1&&a!==(a="w-full text-left px-4 py-2.5 flex items-center gap-3 text-sm transition-colors "+(e[0]===e[5].id?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&s(t,"class",a)},d(h){h&&D(t),c=!1,f()}}}function nd(e){let t,n,r,i,l,o,a=Be(e[1]),c=[];for(let f=0;f<a.length;f+=1)c[f]=_o(mo(e,a,f));return{c(){t=b("aside"),n=b("div"),n.innerHTML=`<a href="/" class="text-lg font-bold flex items-center gap-2 text-white no-underline hover:opacity-80 transition-opacity"><svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" width="28" height="28"><defs><clipPath id="sb-clip"><circle cx="100" cy="100" r="90"></circle></clipPath></defs><circle cx="100" cy="100" r="90" fill="#1a1f2e"></circle><g clip-path="url(#sb-clip)"><g transform="translate(100,108) scale(0.72) translate(-334,-198)"><ellipse cx="310" cy="318" rx="10" ry="38" fill="#2ECC88" transform="rotate(-18 310 318)"></ellipse><ellipse cx="326" cy="326" rx="9" ry="42" fill="#34D99A" transform="rotate(-6 326 326)"></ellipse><ellipse cx="342" cy="328" rx="9" ry="42" fill="#7BC74A" transform="rotate(6 342 328)"></ellipse><ellipse cx="357" cy="320" rx="9" ry="36" fill="#F07040" transform="rotate(18 357 320)"></ellipse><ellipse cx="334" cy="240" rx="62" ry="80" fill="#2ECC88"></ellipse><ellipse cx="334" cy="252" rx="36" ry="52" fill="#D4F4B0"></ellipse><path d="M275 220 Q228 190 232 265 Q248 295 280 285 Q268 255 275 220Z" fill="#3A8FE0"></path><path d="M277 225 Q238 208 240 262 Q252 285 278 277 Q268 252 277 225Z" fill="#6BB3FF" opacity="0.7"></path><path d="M393 220 Q440 190 436 265 Q420 295 388 285 Q400 255 393 220Z" fill="#3A8FE0"></path><path d="M391 225 Q430 208 428 262 Q416 285 390 277 Q400 252 391 225Z" fill="#6BB3FF" opacity="0.7"></path><ellipse cx="334" cy="172" rx="38" ry="30" fill="#2ECC88"></ellipse><circle cx="334" cy="148" r="52" fill="#2ECC88"></circle><ellipse cx="334" cy="118" rx="30" ry="18" fill="#FFB833"></ellipse><circle cx="312" cy="138" r="14" fill="white"></circle><circle cx="315" cy="140" r="9" fill="#2C2C2A"></circle><circle cx="315" cy="140" r="4" fill="#04342C"></circle><circle cx="319" cy="136" r="3.5" fill="white"></circle><circle cx="356" cy="138" r="14" fill="white"></circle><circle cx="353" cy="140" r="9" fill="#2C2C2A"></circle><circle cx="353" cy="140" r="4" fill="#04342C"></circle><circle cx="357" cy="136" r="3.5" fill="white"></circle><path d="M326 155 Q334 144 342 155 Q342 170 334 173 Q326 170 326 155Z" fill="#E8A020"></path><path d="M328 165 Q334 158 340 165 Q340 174 334 176 Q328 174 328 165Z" fill="#A06010"></path><ellipse cx="302" cy="152" rx="12" ry="8" fill="#F07040" opacity="0.8"></ellipse><ellipse cx="366" cy="152" rx="12" ry="8" fill="#F07040" opacity="0.8"></ellipse><path d="M320 100 Q316 68 308 52" stroke="#FFB833" stroke-width="6" fill="none" stroke-linecap="round"></path><path d="M334 97 Q334 64 334 46" stroke="#7BC74A" stroke-width="6" fill="none" stroke-linecap="round"></path><path d="M348 100 Q352 68 360 52" stroke="#F07040" stroke-width="6" fill="none" stroke-linecap="round"></path><circle cx="308" cy="50" r="8" fill="#FFB833"></circle><circle cx="334" cy="44" r="8" fill="#7BC74A"></circle><circle cx="360" cy="50" r="8" fill="#F07040"></circle><rect x="260" y="330" width="168" height="10" rx="5" fill="#8B5E20"></rect><path d="M310 330 L300 350 M310 330 L315 352 M310 330 L325 348" stroke="#A07030" stroke-width="4" fill="none" stroke-linecap="round"></path><path d="M360 330 L350 350 M360 330 L365 352 M360 330 L375 348" stroke="#A07030" stroke-width="4" fill="none" stroke-linecap="round"></path></g></g></svg>
|
|
2
|
+
Loco</a> <p class="text-xs text-gray-400 mt-1">Translation Manager</p>`,r=E(),i=b("nav");for(let f=0;f<c.length;f+=1)c[f].c();l=E(),o=b("div"),o.textContent="Loco v1.0",s(n,"class","p-4 border-b border-gray-700"),s(i,"class","flex-1 py-4"),s(o,"class","p-4 border-t border-gray-700 text-xs text-gray-500"),s(t,"class","w-56 bg-gray-900 text-white flex flex-col min-h-screen shrink-0")},m(f,d){F(f,t,d),u(t,n),u(t,r),u(t,i);for(let h=0;h<c.length;h+=1)c[h]&&c[h].m(i,null);u(t,l),u(t,o)},p(f,[d]){if(d&7){a=Be(f[1]);let h;for(h=0;h<a.length;h+=1){const p=mo(f,a,h);c[h]?c[h].p(p,d):(c[h]=_o(p),c[h].c(),c[h].m(i,null))}for(;h<c.length;h+=1)c[h].d(1);c.length=a.length}},i:je,o:je,d(f){f&&D(t),ft(c,f)}}}function rd(e,t,n){let{currentView:r="translations"}=t;const i=Ul(),l=[{id:"translations",label:"Translation Manager",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#93c5fd" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"/></svg>'},{id:"ai-translate",label:"AI Translate",icon:'<svg viewBox="0 0 24 24" width="18" height="18" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/><path d="M5 16L6 18L8 19L6 20L5 22L4 20L2 19L4 18Z" fill="#2ECC88"/></svg>'},{id:"labels",label:"Labels",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#f59e0b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg>'},{id:"analytics",label:"Analytics",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#34d399" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"/><line x1="12" y1="20" x2="12" y2="4"/><line x1="6" y1="20" x2="6" y2="14"/><line x1="2" y1="20" x2="22" y2="20"/></svg>'},{id:"settings",label:"Settings",icon:'<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>'}];function o(c){i("navigate",c)}const a=c=>o(c.id);return e.$$set=c=>{"currentView"in c&&n(0,r=c.currentView)},[r,l,o,a]}class id extends an{constructor(t){super(),sn(this,t,rd,nd,$t,{currentView:0})}}function bo(e,t,n){const r=e.slice();return r[32]=t[n],r}function yo(e){let t,n,r,i,l,o,a,c,f,d=Be(e[0]),h=[];for(let _=0;_<d.length;_+=1)h[_]=wo(bo(e,d,_));function p(_,v){return _[5]?ad:_[4]?sd:_[3]?od:ld}let g=p(e),m=g(e);return{c(){t=b("div"),n=E(),r=b("div"),i=b("div"),i.innerHTML='<p class="text-xs text-gray-400 px-2 py-1 font-medium uppercase tracking-wide">Projects</p>',l=E(),o=b("div");for(let _=0;_<h.length;_+=1)h[_].c();a=E(),m.c(),s(t,"class","fixed inset-0 z-40"),s(i,"class","p-2 border-b border-gray-700"),s(o,"class","max-h-48 overflow-y-auto"),s(r,"class","absolute right-0 top-full mt-1 z-50 bg-gray-900 border border-gray-700 rounded-xl shadow-2xl w-64 overflow-hidden")},m(_,v){F(_,t,v),F(_,n,v),F(_,r,v),u(r,i),u(r,l),u(r,o);for(let y=0;y<h.length;y+=1)h[y]&&h[y].m(o,null);u(r,a),m.m(r,null),c||(f=$(t,"click",e[13]),c=!0)},p(_,v){if(v[0]&18619){d=Be(_[0]);let y;for(y=0;y<d.length;y+=1){const w=bo(_,d,y);h[y]?h[y].p(w,v):(h[y]=wo(w),h[y].c(),h[y].m(o,null))}for(;y<h.length;y+=1)h[y].d(1);h.length=d.length}g===(g=p(_))&&m?m.p(_,v):(m.d(1),m=g(_),m&&(m.c(),m.m(r,null)))},d(_){_&&(D(t),D(n),D(r)),ft(h,_),m.d(),c=!1,f()}}}function vo(e){let t,n;return{c(){t=pe("svg"),n=pe("path"),s(n,"d","M20 6L9 17l-5-5"),s(t,"viewBox","0 0 24 24"),s(t,"width","14"),s(t,"height","14"),s(t,"fill","none"),s(t,"stroke","currentColor"),s(t,"stroke-width","2.5")},m(r,i){F(r,t,i),u(t,n)},d(r){r&&D(t)}}}function wo(e){var C;let t,n,r,i=e[32].name+"",l,o,a,c,f,d,h,p,g,m,_=e[32].id===((C=e[1])==null?void 0:C.id)&&vo();function v(){return e[19](e[32])}function y(){return e[20](e[32])}function w(){return e[21](e[32])}return{c(){var x;t=b("div"),n=b("button"),r=b("span"),l=B(i),o=E(),_&&_.c(),c=E(),f=b("button"),f.innerHTML='<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',d=E(),h=b("button"),h.innerHTML='<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6"></path></svg>',p=E(),s(r,"class","flex-1 truncate"),s(n,"class",a="flex-1 text-left px-2 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 "+(e[32].id===((x=e[1])==null?void 0:x.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white")),s(f,"class","ml-1 p-1.5 text-gray-600 hover:text-indigo-400 opacity-0 group-hover:opacity-100 transition-all rounded"),s(f,"title","Rename project"),s(h,"class","ml-0.5 p-1.5 text-gray-600 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all rounded"),s(h,"title","Delete project"),s(t,"class","flex items-center group px-2 py-0.5")},m(x,A){F(x,t,A),u(t,n),u(n,r),u(r,l),u(n,o),_&&_.m(n,null),u(t,c),u(t,f),u(t,d),u(t,h),u(t,p),g||(m=[$(n,"click",v),$(f,"click",Bt(y)),$(h,"click",Bt(w))],g=!0)},p(x,A){var M,L;e=x,A[0]&1&&i!==(i=e[32].name+"")&&ee(l,i),e[32].id===((M=e[1])==null?void 0:M.id)?_||(_=vo(),_.c(),_.m(n,null)):_&&(_.d(1),_=null),A[0]&3&&a!==(a="flex-1 text-left px-2 py-2 rounded-lg text-sm transition-colors flex items-center gap-2 "+(e[32].id===((L=e[1])==null?void 0:L.id)?"bg-indigo-600 text-white":"text-gray-300 hover:bg-gray-800 hover:text-white"))&&s(n,"class",a)},d(x){x&&D(t),_&&_.d(),g=!1,lt(m)}}}function ld(e){let t,n,r,i;return{c(){t=b("div"),n=b("button"),n.innerHTML=`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
|
3
|
+
New project`,s(n,"class","w-full flex items-center gap-2 px-2 py-2 text-sm text-gray-400 hover:text-white hover:bg-gray-800 rounded-lg transition-colors"),s(t,"class","border-t border-gray-700 p-2")},m(l,o){F(l,t,o),u(t,n),r||(i=$(n,"click",e[30]),r=!0)},p:je,d(l){l&&D(t),r=!1,i()}}}function od(e){let t,n,r,i,l,o,a,c,f=e[8]?"Creating…":"Create",d,h,p,g,m,_,v=e[11]&&ko(e);return{c(){t=b("div"),n=b("p"),n.textContent="New project",r=E(),v&&v.c(),i=E(),l=b("input"),o=E(),a=b("div"),c=b("button"),d=B(f),p=E(),g=b("button"),g.textContent="Cancel",s(n,"class","text-xs text-gray-400 mb-2 font-medium"),s(l,"type","text"),s(l,"placeholder","Project name"),s(l,"class","w-full bg-gray-800 border border-gray-600 text-white text-sm px-2.5 py-1.5 rounded-lg mb-2 focus:outline-none focus:border-indigo-500"),c.disabled=h=e[8]||!e[6].trim(),s(c,"class","flex-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),s(g,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),s(a,"class","flex gap-2"),s(t,"class","border-t border-gray-700 p-3")},m(y,w){F(y,t,w),u(t,n),u(t,r),v&&v.m(t,null),u(t,i),u(t,l),De(l,e[6]),u(t,o),u(t,a),u(a,c),u(c,d),u(a,p),u(a,g),m||(_=[$(l,"input",e[27]),$(l,"keydown",e[28]),$(c,"click",e[15]),$(g,"click",e[29])],m=!0)},p(y,w){y[11]?v?v.p(y,w):(v=ko(y),v.c(),v.m(t,i)):v&&(v.d(1),v=null),w[0]&64&&l.value!==y[6]&&De(l,y[6]),w[0]&256&&f!==(f=y[8]?"Creating…":"Create")&&ee(d,f),w[0]&320&&h!==(h=y[8]||!y[6].trim())&&(c.disabled=h)},d(y){y&&D(t),v&&v.d(),m=!1,lt(_)}}}function sd(e){let t,n,r,i,l=e[4].name+"",o,a,c,f,d,h,p=e[9]?"Deleting…":"Delete",g,m,_,v,y,w=e[11]&&xo(e);return{c(){t=b("div"),n=b("p"),r=B("Delete "),i=b("strong"),o=B(l),a=B("? This will remove all its data."),c=E(),w&&w.c(),f=E(),d=b("div"),h=b("button"),g=B(p),m=E(),_=b("button"),_.textContent="Cancel",s(n,"class","text-xs text-red-300 mb-2"),h.disabled=e[9],s(h,"class","flex-1 bg-red-600 hover:bg-red-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),s(_,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),s(d,"class","flex gap-2"),s(t,"class","border-t border-gray-700 p-3 bg-red-950/30")},m(C,x){F(C,t,x),u(t,n),u(n,r),u(n,i),u(i,o),u(n,a),u(t,c),w&&w.m(t,null),u(t,f),u(t,d),u(d,h),u(h,g),u(d,m),u(d,_),v||(y=[$(h,"click",e[25]),$(_,"click",e[26])],v=!0)},p(C,x){x[0]&16&&l!==(l=C[4].name+"")&&ee(o,l),C[11]?w?w.p(C,x):(w=xo(C),w.c(),w.m(t,f)):w&&(w.d(1),w=null),x[0]&512&&p!==(p=C[9]?"Deleting…":"Delete")&&ee(g,p),x[0]&512&&(h.disabled=C[9])},d(C){C&&D(t),w&&w.d(),v=!1,lt(y)}}}function ad(e){let t,n,r,i,l=e[5].name+"",o,a,c,f,d,h,p,g=e[10]?"Saving…":"Save",m,_,v,y,w,C,x=e[11]&&Co(e);return{c(){t=b("div"),n=b("p"),r=B("Rename "),i=b("strong"),o=B(l),a=E(),x&&x.c(),c=E(),f=b("input"),d=E(),h=b("div"),p=b("button"),m=B(g),v=E(),y=b("button"),y.textContent="Cancel",s(i,"class","text-white"),s(n,"class","text-xs text-gray-400 mb-2 font-medium"),s(f,"type","text"),s(f,"placeholder","New name"),s(f,"class","w-full bg-gray-800 border border-gray-600 text-white text-sm px-2.5 py-1.5 rounded-lg mb-2 focus:outline-none focus:border-indigo-500"),p.disabled=_=e[10]||!e[7].trim(),s(p,"class","flex-1 bg-indigo-600 hover:bg-indigo-700 text-white text-xs py-1.5 rounded-lg transition-colors disabled:opacity-50"),s(y,"class","flex-1 bg-gray-700 hover:bg-gray-600 text-gray-200 text-xs py-1.5 rounded-lg transition-colors"),s(h,"class","flex gap-2"),s(t,"class","border-t border-gray-700 p-3")},m(A,M){F(A,t,M),u(t,n),u(n,r),u(n,i),u(i,o),u(t,a),x&&x.m(t,null),u(t,c),u(t,f),De(f,e[7]),u(t,d),u(t,h),u(h,p),u(p,m),u(h,v),u(h,y),w||(C=[$(f,"input",e[22]),$(f,"keydown",e[23]),$(p,"click",e[16]),$(y,"click",e[24])],w=!0)},p(A,M){M[0]&32&&l!==(l=A[5].name+"")&&ee(o,l),A[11]?x?x.p(A,M):(x=Co(A),x.c(),x.m(t,c)):x&&(x.d(1),x=null),M[0]&128&&f.value!==A[7]&&De(f,A[7]),M[0]&1024&&g!==(g=A[10]?"Saving…":"Save")&&ee(m,g),M[0]&1152&&_!==(_=A[10]||!A[7].trim())&&(p.disabled=_)},d(A){A&&D(t),x&&x.d(),w=!1,lt(C)}}}function ko(e){let t,n;return{c(){t=b("p"),n=B(e[11]),s(t,"class","text-xs text-red-400 mb-1")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i[0]&2048&&ee(n,r[11])},d(r){r&&D(t)}}}function xo(e){let t,n;return{c(){t=b("p"),n=B(e[11]),s(t,"class","text-xs text-red-400 mb-1")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i[0]&2048&&ee(n,r[11])},d(r){r&&D(t)}}}function Co(e){let t,n;return{c(){t=b("p"),n=B(e[11]),s(t,"class","text-xs text-red-400 mb-1")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i[0]&2048&&ee(n,r[11])},d(r){r&&D(t)}}}function ud(e){var v;let t,n,r,i,l,o,a=(((v=e[1])==null?void 0:v.name)??"Select project")+"",c,f,d,h,p,g,m,_=e[2]&&yo(e);return{c(){t=b("div"),n=b("button"),r=pe("svg"),i=pe("path"),l=E(),o=b("span"),c=B(a),f=E(),d=pe("svg"),h=pe("path"),p=E(),_&&_.c(),s(i,"d","M3 7h18M3 12h18M3 17h18"),s(r,"viewBox","0 0 24 24"),s(r,"width","14"),s(r,"height","14"),s(r,"fill","none"),s(r,"stroke","currentColor"),s(r,"stroke-width","2"),s(r,"stroke-linecap","round"),s(r,"stroke-linejoin","round"),s(o,"class","max-w-[120px] truncate"),s(h,"d","M6 9l6 6 6-6"),s(d,"viewBox","0 0 24 24"),s(d,"width","12"),s(d,"height","12"),s(d,"fill","none"),s(d,"stroke","currentColor"),s(d,"stroke-width","2"),s(d,"stroke-linecap","round"),s(d,"stroke-linejoin","round"),s(d,"class","opacity-60"),s(n,"class","flex items-center gap-2 bg-gray-800 hover:bg-gray-700 text-white text-sm px-3 py-1.5 rounded-lg transition-colors border border-gray-600"),s(n,"title","Switch project"),s(t,"class","relative")},m(y,w){F(y,t,w),u(t,n),u(n,r),u(r,i),u(n,l),u(n,o),u(o,c),u(n,f),u(n,d),u(d,h),u(t,p),_&&_.m(t,null),g||(m=[$(window,"keydown",e[18]),$(n,"click",e[12])],g=!0)},p(y,w){var C;w[0]&2&&a!==(a=(((C=y[1])==null?void 0:C.name)??"Select project")+"")&&ee(c,a),y[2]?_?_.p(y,w):(_=yo(y),_.c(),_.m(t,null)):_&&(_.d(1),_=null)},i:je,o:je,d(y){y&&D(t),_&&_.d(),g=!1,lt(m)}}}function cd(e,t,n){let{projects:r=[]}=t,{currentProject:i=null}=t,l=!1,o=!1,a=null,c=null,f="",d="",h=!1,p=!1,g=!1,m="";const _=Ul();function v(){n(2,l=!l),l||(n(3,o=!1),n(4,a=null),n(5,c=null),n(11,m=""))}function y(){n(2,l=!1),n(3,o=!1),n(4,a=null),n(5,c=null),n(11,m="")}function w(Z){if(Z.id===(i==null?void 0:i.id)){y();return}_("switch",Z),y()}async function C(){if(f.trim()){n(8,h=!0),n(11,m="");try{const Z=await fetch("../api/projects",{method:"POST",headers:{"Content-Type":"application/json","X-API-Key":i==null?void 0:i.api_key},body:JSON.stringify({name:f.trim()})});if(!Z.ok){const O=await Z.json();throw new Error(O.message||"Failed")}const ne=await Z.json();n(6,f=""),n(3,o=!1),_("created",ne)}catch(Z){n(11,m=Z.message)}finally{n(8,h=!1)}}}async function x(){if(!(!d.trim()||!c)){n(10,g=!0),n(11,m="");try{const Z=await fetch("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json","X-API-Key":c.api_key},body:JSON.stringify({name:d.trim()})});if(!Z.ok){const O=await Z.json();throw new Error(O.message||"Failed")}const ne=await Z.json();_("renamed",ne),n(5,c=null)}catch(Z){n(11,m=Z.message)}finally{n(10,g=!1)}}}async function A(Z){n(9,p=!0),n(11,m="");try{const ne=await fetch(`../api/projects/${Z.id}`,{method:"DELETE",headers:{"X-API-Key":i==null?void 0:i.api_key}});if(!ne.ok){const O=await ne.json();throw new Error(O.message||"Failed")}n(4,a=null),_("deleted",Z)}catch(ne){n(11,m=ne.message)}finally{n(9,p=!1)}}function M(Z){Z.key==="Escape"&&y()}const L=Z=>w(Z),I=Z=>{n(5,c=Z),n(7,d=Z.name),n(4,a=null),n(3,o=!1),n(11,m="")},P=Z=>{n(4,a=Z),n(5,c=null),n(3,o=!1),n(11,m="")};function z(){d=this.value,n(7,d)}const R=Z=>Z.key==="Enter"&&x(),T=()=>{n(5,c=null),n(11,m="")},N=()=>A(a),k=()=>{n(4,a=null),n(11,m="")};function j(){f=this.value,n(6,f)}const J=Z=>Z.key==="Enter"&&C(),W=()=>{n(3,o=!1),n(11,m="")},G=()=>{n(3,o=!0),n(4,a=null),n(11,m="")};return e.$$set=Z=>{"projects"in Z&&n(0,r=Z.projects),"currentProject"in Z&&n(1,i=Z.currentProject)},[r,i,l,o,a,c,f,d,h,p,g,m,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k,j,J,W,G]}class fd extends an{constructor(t){super(),sn(this,t,cd,ud,$t,{projects:0,currentProject:1},null,[-1,-1])}}function Ao(e,t,n){const r=e.slice();return r[22]=t[n],r}function So(e){let t,n,r,i=e[3]===1?"":"s",l;return{c(){t=b("span"),n=B(e[3]),r=B(" slot"),l=B(i),s(t,"class","pve-badge svelte-19itaxc")},m(o,a){F(o,t,a),u(t,n),u(t,r),u(t,l)},p(o,a){a&8&&ee(n,o[3]),a&8&&i!==(i=o[3]===1?"":"s")&&ee(l,i)},d(o){o&&D(t)}}}function dd(e){let t,n,r=e[22].originalText+"",i,l,o,a,c,f,d,h,p;function g(){return e[13](e[22])}return{c(){t=b("span"),n=b("span"),i=B(r),l=E(),o=b("button"),a=B("×"),f=E(),s(n,"class","pve-chip-label svelte-19itaxc"),s(o,"class","pve-chip-remove svelte-19itaxc"),s(o,"type","button"),s(o,"title",c="Remove "+e[22].kind+" slot — restores original text"),s(t,"class",d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")},m(m,_){F(m,t,_),u(t,n),u(n,i),u(t,l),u(t,o),u(o,a),u(t,f),h||(p=$(o,"click",g),h=!0)},p(m,_){e=m,_&1&&r!==(r=e[22].originalText+"")&&ee(i,r),_&1&&c!==(c="Remove "+e[22].kind+" slot — restores original text")&&s(o,"title",c),_&1&&d!==(d="pve-chip pve-chip--"+e[22].kind+" svelte-19itaxc")&&s(t,"class",d)},d(m){m&&D(t),h=!1,p()}}}function hd(e){let t,n=e[22].text+"",r,i,l;function o(){return e[12](e[22])}return{c(){var a;t=b("span"),r=B(n),s(t,"class","pve-text-seg svelte-19itaxc"),fo(t,"pve-text-seg--active",((a=e[1])==null?void 0:a.segId)===e[22].id)},m(a,c){F(a,t,c),u(t,r),i||(l=$(t,"mouseup",o),i=!0)},p(a,c){var f;e=a,c&1&&n!==(n=e[22].text+"")&&ee(r,n),c&3&&fo(t,"pve-text-seg--active",((f=e[1])==null?void 0:f.segId)===e[22].id)},d(a){a&&D(t),i=!1,l()}}}function To(e,t){let n,r;function i(a,c){return a[22].kind==="plain"?hd:dd}let l=i(t),o=l(t);return{key:e,first:null,c(){n=xt(),o.c(),r=xt(),this.first=n},m(a,c){F(a,n,c),o.m(a,c),F(a,r,c)},p(a,c){t=a,l===(l=i(t))&&o?o.p(t,c):(o.d(1),o=l(t),o&&(o.c(),o.m(r.parentNode,r)))},d(a){a&&(D(n),D(r)),o.d(a)}}}function Mo(e){let t,n,r,i,l=e[1].selectedText+"",o,a,c,f,d,h,p,g,m,_,v,y,w,C;return{c(){t=b("div"),n=b("span"),r=B("Selected: "),i=b("code"),o=B(l),a=E(),c=b("div"),f=b("button"),f.textContent="Text",d=E(),h=b("button"),h.textContent="Number",p=E(),g=b("button"),g.textContent="Decimal",m=E(),_=b("button"),_.textContent="Date",v=E(),y=b("button"),y.textContent="Cancel",s(i,"class","pve-sel-code svelte-19itaxc"),s(n,"class","pve-sel-preview svelte-19itaxc"),s(f,"type","button"),s(f,"class","pve-btn pve-btn-text svelte-19itaxc"),s(h,"type","button"),s(h,"class","pve-btn pve-btn-number svelte-19itaxc"),s(g,"type","button"),s(g,"class","pve-btn pve-btn-decimal svelte-19itaxc"),s(_,"type","button"),s(_,"class","pve-btn pve-btn-date svelte-19itaxc"),s(y,"type","button"),s(y,"class","pve-btn pve-btn-ghost svelte-19itaxc"),s(c,"class","pve-action-bar-btns svelte-19itaxc"),s(t,"class","pve-action-bar svelte-19itaxc")},m(x,A){F(x,t,A),u(t,n),u(n,r),u(n,i),u(i,o),u(t,a),u(t,c),u(c,f),u(c,d),u(c,h),u(c,p),u(c,g),u(c,m),u(c,_),u(c,v),u(c,y),w||(C=[$(f,"click",e[14]),$(h,"click",e[15]),$(g,"click",e[16]),$(_,"click",e[17]),$(y,"click",e[7])],w=!0)},p(x,A){A&2&&l!==(l=x[1].selectedText+"")&&ee(o,l)},d(x){x&&D(t),w=!1,lt(C)}}}function pd(e){let t,n,r,i,l,o,a=[],c=new Map,f,d,h,p,g,m,_,v,y,w,C,x,A=e[3]>0&&So(e),M=Be(e[0]);const L=P=>P[22].id;for(let P=0;P<M.length;P+=1){let z=Ao(e,M,P),R=L(z);c.set(R,a[P]=To(R,z))}let I=e[1]&&Mo(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase Slot Editor",i=E(),A&&A.c(),l=E(),o=b("div");for(let P=0;P<a.length;P+=1)a[P].c();f=E(),I&&I.c(),d=E(),h=b("div"),p=b("span"),p.textContent="Resulting key",g=E(),m=b("code"),_=B(e[2]),v=E(),y=b("div"),w=b("button"),w.textContent="Save",s(r,"class","pve-title svelte-19itaxc"),s(n,"class","pve-header svelte-19itaxc"),s(o,"class","pve-canvas svelte-19itaxc"),s(p,"class","pve-preview-label svelte-19itaxc"),s(m,"class","pve-preview-code svelte-19itaxc"),s(h,"class","pve-preview svelte-19itaxc"),s(w,"type","button"),s(w,"class","pve-btn pve-btn-primary svelte-19itaxc"),s(y,"class","pve-footer svelte-19itaxc"),s(t,"class","pve svelte-19itaxc")},m(P,z){F(P,t,z),u(t,n),u(n,r),u(n,i),A&&A.m(n,null),u(t,l),u(t,o);for(let R=0;R<a.length;R+=1)a[R]&&a[R].m(o,null);u(t,f),I&&I.m(t,null),u(t,d),u(t,h),u(h,p),u(h,g),u(h,m),u(m,_),u(t,v),u(t,y),u(y,w),C||(x=$(w,"click",e[8]),C=!0)},p(P,[z]){P[3]>0?A?A.p(P,z):(A=So(P),A.c(),A.m(n,null)):A&&(A.d(1),A=null),z&83&&(M=Be(P[0]),a=si(a,z,L,1,P,M,c,o,Hl,To,null,Ao)),P[1]?I?I.p(P,z):(I=Mo(P),I.c(),I.m(t,d)):I&&(I.d(1),I=null),z&4&&ee(_,P[2])},i:je,o:je,d(P){P&&D(t),A&&A.d();for(let z=0;z<a.length;z+=1)a[z].d();I&&I.d(),C=!1,x()}}}const gd=/(\{\{(?:text|number|decimal|date):\d+\}\})/g,md=/^\{\{(text|number|decimal|date):(\d+)\}\}$/;function Eo(e){return e.map(t=>t.text).join("")}function Io(e){const t={text:0,number:0,decimal:0,date:0};return e.map(n=>{if(n.kind==="plain")return n;const r=t[n.kind]++;return{...n,slotIndex:r,text:`{{${n.kind}:${r}}}`}})}function _d(e,t,n){let r,i,l=0;function o(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"id-"+Date.now().toString(36)+"-"+ ++l}let{phraseKey:a=""}=t,{varSlots:c=[]}=t,{onSave:f=()=>{}}=t;function d(I){const P={};for(const R of c){const T=R.type||"text";P[`${T}:${R.index}`]=R.originalText}return I.split(gd).filter(R=>R!=="").map(R=>{const T=R.match(md);if(T){const N=T[1],k=parseInt(T[2],10);return{kind:N,id:o(),slotIndex:k,originalText:P[`${N}:${k}`]??R,text:R}}return{kind:"plain",id:o(),text:R}})}let h=d(a),p=null;function g(I){if(I.kind!=="plain")return;const P=window.getSelection(),z=P?P.toString():"";if(!z){n(1,p=null);return}const R=I.text.indexOf(z);if(R===-1){n(1,p=null);return}n(1,p={segId:I.id,start:R,end:R+z.length,selectedText:z})}function m(I){if(!p)return;const{segId:P,start:z,end:R,selectedText:T}=p,N=h.findIndex(J=>J.id===P);if(N===-1){n(1,p=null);return}const k=h[N],j=[];z>0&&j.push({kind:"plain",id:o(),text:k.text.slice(0,z)}),j.push({kind:I,id:o(),slotIndex:0,originalText:T,text:`{{${I}:0}}`}),R<k.text.length&&j.push({kind:"plain",id:o(),text:k.text.slice(R)}),n(0,h=Io([...h.slice(0,N),...j,...h.slice(N+1)])),n(1,p=null)}function _(I){const P=h.map(z=>z.id===I&&z.kind!=="plain"?{kind:"plain",id:o(),text:z.originalText}:z);n(0,h=Io(P))}function v(){var I;n(1,p=null),(I=window.getSelection())==null||I.removeAllRanges()}function y(){const I=Eo(h),P=h.filter(z=>z.kind!=="plain").map(z=>({type:z.kind,index:z.slotIndex,originalText:z.originalText}));f(I,P)}const w=I=>g(I),C=I=>_(I.id),x=()=>m("text"),A=()=>m("number"),M=()=>m("decimal"),L=()=>m("date");return e.$$set=I=>{"phraseKey"in I&&n(9,a=I.phraseKey),"varSlots"in I&&n(10,c=I.varSlots),"onSave"in I&&n(11,f=I.onSave)},e.$$.update=()=>{e.$$.dirty&1&&n(3,r=h.filter(I=>I.kind!=="plain").length),e.$$.dirty&1&&n(2,i=Eo(h))},[h,p,i,r,g,m,_,v,y,a,c,f,w,C,x,A,M,L]}class bd extends an{constructor(t){super(),sn(this,t,_d,pd,$t,{phraseKey:9,varSlots:10,onSave:11})}}function Lo(e,t,n){const r=e.slice();return r[16]=t[n],r[17]=t,r[18]=n,r}function No(e){let t,n;return{c(){t=b("span"),n=B(e[1]),s(t,"class","ml-2 inline-block rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-600")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i&2&&ee(n,r[1])},d(r){r&&D(t)}}}function Po(e){let t,n,r=e[16].label+"",i,l,o,a,c,f,d;function h(){e[12].call(o,e[16])}return{c(){t=b("div"),n=b("label"),i=B(r),l=E(),o=b("input"),a=E(),c=b("p"),c.textContent=`${e[16].hint}`,s(n,"class","block text-xs font-medium text-gray-700"),s(n,"for",`aria-${e[16].name}`),s(o,"id",`aria-${e[16].name}`),s(o,"type","text"),s(o,"placeholder",e[16].placeholder),s(o,"class","mt-1 w-full rounded border border-gray-300 px-2 py-1.5 text-sm focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500"),s(c,"class","mt-0.5 text-[11px] text-gray-400")},m(p,g){F(p,t,g),u(t,n),u(n,i),u(t,l),u(t,o),De(o,e[2][e[16].name]),u(t,a),u(t,c),f||(d=$(o,"input",h),f=!0)},p(p,g){e=p,g&68&&o.value!==e[2][e[16].name]&&De(o,e[2][e[16].name])},d(p){p&&D(t),f=!1,d()}}}function zo(e){let t,n;return{c(){t=b("div"),n=B(e[5]),s(t,"class","rounded border border-amber-200 bg-amber-50 px-3 py-2 text-[11px] text-amber-800")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i&32&&ee(n,r[5])},d(r){r&&D(t)}}}function Do(e){let t,n;return{c(){t=b("div"),n=B(e[4]),s(t,"class","rounded border border-red-200 bg-red-50 px-3 py-2 text-[11px] text-red-800")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i&16&&ee(n,r[4])},d(r){r&&D(t)}}}function yd(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I=e[1]&&No(e),P=Be(e[6]),z=[];for(let N=0;N<P.length;N+=1)z[N]=Po(Lo(e,P,N));let R=e[5]&&zo(e),T=e[4]&&Do(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Phrase:",i=E(),l=b("span"),o=B(e[0]),a=E(),I&&I.c(),c=E(),f=b("div");for(let N=0;N<z.length;N+=1)z[N].c();d=E(),h=b("label"),p=b("input"),g=E(),m=b("span"),m.innerHTML='<span class="font-medium">aria-hidden="true"</span> — hide from assistive tech (decorative)',_=E(),R&&R.c(),v=E(),T&&T.c(),y=E(),w=b("div"),C=b("button"),C.textContent="Clear all",x=E(),A=b("button"),A.textContent="Save ARIA",s(r,"class","font-medium text-gray-700"),s(l,"class","font-mono break-all"),s(n,"class","text-xs text-gray-500"),s(p,"type","checkbox"),s(p,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(h,"class","flex items-center gap-2 text-sm text-gray-700"),s(f,"class","space-y-3"),s(C,"type","button"),s(C,"class","text-xs text-gray-400 hover:text-red-500"),s(A,"type","button"),s(A,"class","rounded bg-indigo-600 px-4 py-1.5 text-sm font-medium text-white hover:bg-indigo-700"),s(w,"class","flex items-center justify-between pt-1"),s(t,"class","space-y-4")},m(N,k){F(N,t,k),u(t,n),u(n,r),u(n,i),u(n,l),u(l,o),u(n,a),I&&I.m(n,null),u(t,c),u(t,f);for(let j=0;j<z.length;j+=1)z[j]&&z[j].m(f,null);u(f,d),u(f,h),u(h,p),p.checked=e[3],u(h,g),u(h,m),u(t,_),R&&R.m(t,null),u(t,v),T&&T.m(t,null),u(t,y),u(t,w),u(w,C),u(w,x),u(w,A),M||(L=[$(p,"change",e[13]),$(C,"click",e[8]),$(A,"click",e[7])],M=!0)},p(N,[k]){if(k&1&&ee(o,N[0]),N[1]?I?I.p(N,k):(I=No(N),I.c(),I.m(n,null)):I&&(I.d(1),I=null),k&68){P=Be(N[6]);let j;for(j=0;j<P.length;j+=1){const J=Lo(N,P,j);z[j]?z[j].p(J,k):(z[j]=Po(J),z[j].c(),z[j].m(f,d))}for(;j<z.length;j+=1)z[j].d(1);z.length=P.length}k&8&&(p.checked=N[3]),N[5]?R?R.p(N,k):(R=zo(N),R.c(),R.m(t,v)):R&&(R.d(1),R=null),N[4]?T?T.p(N,k):(T=Do(N),T.c(),T.m(t,y)):T&&(T.d(1),T=null)},i:je,o:je,d(N){N&&D(t),I&&I.d(),ft(z,N),R&&R.d(),T&&T.d(),M=!1,lt(L)}}}function vd(e,t,n){let r,i,l,{phraseKey:o=""}=t,{context:a=""}=t,{attributes:c={}}=t,{onSave:f=()=>{}}=t;const d=[{name:"aria-label",label:"aria-label",hint:"Accessible name read by screen readers",type:"text",placeholder:"e.g. Close dialog"},{name:"aria-labelledby",label:"aria-labelledby",hint:"ID(s) of element(s) that label this one",type:"text",placeholder:"e.g. heading-id"},{name:"aria-describedby",label:"aria-describedby",hint:"ID(s) of element(s) describing this one",type:"text",placeholder:"e.g. help-text-id"},{name:"role",label:"role",hint:"ARIA role",type:"text",placeholder:"e.g. button, navigation, alert"},{name:"alt",label:"alt",hint:"Alternative text (for images)",type:"text",placeholder:"e.g. Company logo"},{name:"title",label:"title",hint:"Tooltip / advisory text (lowest name priority)",type:"text",placeholder:"e.g. More info"}];function h(){const C={};for(const x of d)C[x.name]=c&&typeof c[x.name]=="string"?c[x.name]:"";return C}let p=h(),g=!!(c&&c["aria-hidden"]==="true");function m(){const C={};for(const x of d){const A=(p[x.name]||"").trim();A&&(C[x.name]=A)}return g&&(C["aria-hidden"]="true"),C}function _(){f(m())}function v(){const C={};for(const x of d)C[x.name]="";n(2,p=C),n(3,g=!1)}function y(C){p[C.name]=this.value,n(2,p)}function w(){g=this.checked,n(3,g)}return e.$$set=C=>{"phraseKey"in C&&n(0,o=C.phraseKey),"context"in C&&n(1,a=C.context),"attributes"in C&&n(9,c=C.attributes),"onSave"in C&&n(10,f=C.onSave)},e.$$.update=()=>{e.$$.dirty&4&&n(11,r=[p["aria-labelledby"]?"aria-labelledby":null,p["aria-label"]?"aria-label":null,p.alt?"alt":null,p.title?"title":null].filter(Boolean)),e.$$.dirty&2048&&n(5,i=r.length>1?`Multiple name sources set — screen readers will use "${r[0]}" and ignore the rest.`:""),e.$$.dirty&2056&&n(4,l=g&&r.length>0?'aria-hidden="true" removes this element from the accessibility tree, so the name above will not be announced.':"")},[o,a,p,g,l,i,d,_,v,c,f,r,y,w]}class wd extends an{constructor(t){super(),sn(this,t,vd,yd,$t,{phraseKey:0,context:1,attributes:9,onSave:10})}}function Fo(e,t,n){const r=e.slice();return r[34]=t[n],r[35]=t,r[36]=n,r}function Bo(e,t,n){const r=e.slice();return r[37]=t[n],r}function Ro(e,t,n){const r=e.slice();return r[37]=t[n],r}function jo(e){let t,n,r,i,l;return{c(){t=b("div"),n=b("button"),r=B("AI Translate"),s(n,"class","px-2.5 py-1 text-[11px] rounded border border-indigo-200 text-indigo-700 bg-white hover:bg-indigo-50 disabled:opacity-50 disabled:cursor-not-allowed"),s(n,"title","Open AI translate options"),n.disabled=e[3],s(t,"class","px-3 py-2 border-b border-gray-100 bg-white flex items-center justify-end")},m(o,a){F(o,t,a),u(t,n),u(n,r),i||(l=$(n,"click",Bt(e[24])),i=!0)},p(o,a){a[0]&8&&(n.disabled=o[3])},d(o){o&&D(t),i=!1,l()}}}function Oo(e){let t,n,r,i,l,o=e[0].key+"",a,c,f,d;function h(m,_){return m[1]?xd:kd}let p=h(e),g=p(e);return{c(){t=b("div"),n=b("div"),r=b("span"),r.textContent="Master",i=E(),l=b("span"),a=B(o),f=E(),d=b("div"),g.c(),s(r,"class","shrink-0 text-[10px] font-semibold text-indigo-400 uppercase tracking-wider"),s(l,"class","text-sm text-indigo-800 truncate min-w-0"),s(l,"title",c=e[0].key),s(n,"class","min-w-0 flex items-center gap-2"),s(d,"class","min-w-0"),s(t,"class","bg-indigo-50/60 border-b border-indigo-100 px-3 py-2 grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-3 items-center")},m(m,_){F(m,t,_),u(t,n),u(n,r),u(n,i),u(n,l),u(l,a),u(t,f),u(t,d),g.m(d,null)},p(m,_){_[0]&1&&o!==(o=m[0].key+"")&&ee(a,o),_[0]&1&&c!==(c=m[0].key)&&s(l,"title",c),p===(p=h(m))&&g?g.p(m,_):(g.d(1),g=p(m),g&&(g.c(),g.m(d,null)))},d(m){m&&D(t),g.d()}}}function kd(e){let t,n=(e[0].master_value||"(not translated)")+"",r,i,l;return{c(){t=b("div"),r=B(n),s(t,"class",i="text-sm "+(e[0].master_value?"text-indigo-900 font-medium":"text-gray-300")+" truncate"),s(t,"title",l=e[0].master_value||"(not translated)")},m(o,a){F(o,t,a),u(t,r)},p(o,a){a[0]&1&&n!==(n=(o[0].master_value||"(not translated)")+"")&&ee(r,n),a[0]&1&&i!==(i="text-sm "+(o[0].master_value?"text-indigo-900 font-medium":"text-gray-300")+" truncate")&&s(t,"class",i),a[0]&1&&l!==(l=o[0].master_value||"(not translated)")&&s(t,"title",l)},d(o){o&&D(t)}}}function xd(e){let t,n,r,i;return{c(){t=b("input"),s(t,"class","w-full px-2 py-1.5 border border-indigo-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 bg-white"),t.value=n=e[0].master_value||"",s(t,"placeholder","Fallback translation (no context)…")},m(l,o){F(l,t,o),r||(i=[$(t,"input",e[25]),$(t,"change",e[15])],r=!0)},p(l,o){o[0]&1&&n!==(n=l[0].master_value||"")&&t.value!==n&&(t.value=n)},d(l){l&&D(t),r=!1,lt(i)}}}function Uo(e){let t,n,r,i,l,o;function a(){return e[26](e[34])}return{c(){t=b("button"),n=B("ARIA"),s(t,"class",r="px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors "+(e[6](e[34])?"text-amber-700 bg-amber-100 hover:bg-amber-200":"text-gray-300 bg-gray-100 hover:bg-gray-200 hover:text-gray-500")),s(t,"title",i=e[6](e[34])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")},m(c,f){F(c,t,f),u(t,n),l||(o=$(t,"click",Bt(a)),l=!0)},p(c,f){e=c,f[0]&65&&r!==(r="px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors "+(e[6](e[34])?"text-amber-700 bg-amber-100 hover:bg-amber-200":"text-gray-300 bg-gray-100 hover:bg-gray-200 hover:text-gray-500"))&&s(t,"class",r),f[0]&65&&i!==(i=e[6](e[34])?"Edit ARIA accessibility attributes":"Add ARIA accessibility attributes")&&s(t,"title",i)},d(c){c&&D(t),l=!1,o()}}}function Ho(e){let t,n=Be(e[34].labels),r=[];for(let i=0;i<n.length;i+=1)r[i]=Zo(Ro(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","flex flex-wrap gap-1 mt-0.5")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&1){n=Be(i[34].labels);let o;for(o=0;o<n.length;o+=1){const a=Ro(i,n,o);r[o]?r[o].p(a,l):(r[o]=Zo(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function Zo(e){let t,n=e[37].name+"",r;return{c(){t=b("span"),r=B(n),s(t,"class","inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium text-white"),mt(t,"background-color",e[37].color)},m(i,l){F(i,t,l),u(t,r)},p(i,l){l[0]&1&&n!==(n=i[37].name+"")&&ee(r,n),l[0]&1&&mt(t,"background-color",i[37].color)},d(i){i&&D(t)}}}function Cd(e){let t,n=(e[34].value||"(not translated)")+"",r,i,l;return{c(){t=b("div"),r=B(n),s(t,"class",i="text-sm "+(e[34].value?"text-green-700 font-medium":"text-gray-300")+" truncate"),s(t,"title",l=e[34].value||"(not translated)")},m(o,a){F(o,t,a),u(t,r)},p(o,a){a[0]&1&&n!==(n=(o[34].value||"(not translated)")+"")&&ee(r,n),a[0]&1&&i!==(i="text-sm "+(o[34].value?"text-green-700 font-medium":"text-gray-300")+" truncate")&&s(t,"class",i),a[0]&1&&l!==(l=o[34].value||"(not translated)")&&s(t,"title",l)},d(o){o&&D(t)}}}function Ad(e){let t,n,r,i,l;function o(...c){return e[27](e[34],e[35],e[36],...c)}function a(){return e[28](e[34])}return{c(){t=b("input"),s(t,"class",n="w-full px-2 py-1.5 border border-gray-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 "+(e[34].value?"":"bg-amber-50")),t.value=r=e[34].value||"",s(t,"placeholder","Enter translation…")},m(c,f){F(c,t,f),i||(l=[$(t,"input",o),$(t,"change",a),$(t,"click",Bt(e[23]))],i=!0)},p(c,f){e=c,f[0]&1&&n!==(n="w-full px-2 py-1.5 border border-gray-200 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500 "+(e[34].value?"":"bg-amber-50"))&&s(t,"class",n),f[0]&1&&r!==(r=e[34].value||"")&&t.value!==r&&(t.value=r)},d(c){c&&D(t),i=!1,lt(l)}}}function Wo(e){let t,n,r;function i(){return e[29](e[34])}return{c(){t=b("button"),t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5" viewBox="0 0 20 20" fill="currentColor"><path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path></svg>',s(t,"class","p-1 text-gray-300 hover:text-indigo-500 transition-colors rounded"),s(t,"title","Edit vars")},m(l,o){F(l,t,o),n||(r=$(t,"click",Bt(i)),n=!0)},p(l,o){e=l},d(l){l&&D(t),n=!1,r()}}}function Yo(e){let t,n,r;function i(){return e[30](e[34])}return{c(){t=b("button"),t.textContent="Details",s(t,"class","px-2.5 py-1 border border-gray-200 rounded text-xs text-gray-600 hover:bg-gray-100 hover:border-gray-300 transition-colors")},m(l,o){F(l,t,o),n||(r=$(t,"click",Bt(i)),n=!0)},p(l,o){e=l},d(l){l&&D(t),n=!1,r()}}}function Go(e){let t,n,r,i,l;function o(){return e[31](e[34])}let a=e[14]===e[34].key_id&&Vo(e);return{c(){t=b("div"),n=b("button"),n.textContent="+ Label",r=E(),a&&a.c(),s(n,"class","px-2 py-1 text-[10px] border border-dashed border-gray-300 rounded text-gray-400 hover:text-indigo-500 hover:border-indigo-300 transition-colors"),s(t,"class","relative")},m(c,f){F(c,t,f),u(t,n),u(t,r),a&&a.m(t,null),i||(l=$(n,"click",Bt(o)),i=!0)},p(c,f){e=c,e[14]===e[34].key_id?a?a.p(e,f):(a=Vo(e),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(c){c&&D(t),a&&a.d(),i=!1,l()}}}function Vo(e){let t,n,r,i,l,o,a=Be(e[13]),c=[];for(let d=0;d<a.length;d+=1)c[d]=Jo(Bo(e,a,d));let f=e[13].length===0&&qo();return{c(){t=b("div"),n=E(),r=b("div");for(let d=0;d<c.length;d+=1)c[d].c();i=E(),f&&f.c(),s(t,"class","fixed inset-0 z-40"),s(t,"role","presentation"),s(r,"class","absolute right-0 bottom-full mb-1 w-44 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-48 overflow-y-auto")},m(d,h){F(d,t,h),F(d,n,h),F(d,r,h);for(let p=0;p<c.length;p+=1)c[p]&&c[p].m(r,null);u(r,i),f&&f.m(r,null),l||(o=$(t,"click",e[32]),l=!0)},p(d,h){if(h[0]&270337){a=Be(d[13]);let p;for(p=0;p<a.length;p+=1){const g=Bo(d,a,p);c[p]?c[p].p(g,h):(c[p]=Jo(g),c[p].c(),c[p].m(r,i))}for(;p<c.length;p+=1)c[p].d(1);c.length=a.length}d[13].length===0?f||(f=qo(),f.c(),f.m(r,null)):f&&(f.d(1),f=null)},d(d){d&&(D(t),D(n),D(r)),ft(c,d),f&&f.d(),l=!1,o()}}}function Xo(e){let t,n;return{c(){t=pe("svg"),n=pe("path"),s(n,"fill-rule","evenodd"),s(n,"d","M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"),s(n,"clip-rule","evenodd"),s(t,"class","w-3.5 h-3.5 text-indigo-600"),s(t,"viewBox","0 0 20 20"),s(t,"fill","currentColor")},m(r,i){F(r,t,i),u(t,n)},d(r){r&&D(t)}}}function Jo(e){let t,n,r,i,l=e[37].name+"",o,a,c=e[34].labels&&e[34].labels.some(h),f,d;function h(...m){return e[22](e[37],...m)}let p=c&&Xo();function g(){return e[33](e[34],e[37])}return{c(){t=b("button"),n=b("span"),r=E(),i=b("span"),o=B(l),a=E(),p&&p.c(),s(n,"class","w-3 h-3 rounded-full shrink-0"),mt(n,"background-color",e[37].color),s(i,"class","flex-1"),s(t,"class","w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 flex items-center gap-2")},m(m,_){F(m,t,_),u(t,n),u(t,r),u(t,i),u(i,o),u(t,a),p&&p.m(t,null),f||(d=$(t,"click",g),f=!0)},p(m,_){e=m,_[0]&8192&&mt(n,"background-color",e[37].color),_[0]&8192&&l!==(l=e[37].name+"")&&ee(o,l),_[0]&8193&&(c=e[34].labels&&e[34].labels.some(h)),c?p||(p=Xo(),p.c(),p.m(t,null)):p&&(p.d(1),p=null)},d(m){m&&D(t),p&&p.d(),f=!1,d()}}}function qo(e){let t;return{c(){t=b("p"),t.textContent="No labels yet. Create one in Labels page.",s(t,"class","px-3 py-2 text-xs text-gray-400")},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function Ko(e,t){let n,r,i,l,o,a=(t[34].context||"Word (no context)")+"",c,f,d,h,p,g,m,_,v,y,w,C=t[5]&&Uo(t),x=t[34].labels&&t[34].labels.length>0&&Ho(t);function A(R,T){return R[1]?Ad:Cd}let M=A(t),L=M(t),I=t[8]&&Wo(t),P=t[10]&&Yo(t),z=t[12]&&Go(t);return{key:e,first:null,c(){n=b("div"),r=b("div"),C&&C.c(),i=E(),l=b("div"),o=b("div"),c=B(a),d=E(),x&&x.c(),h=E(),p=b("div"),L.c(),g=E(),m=b("div"),I&&I.c(),_=E(),P&&P.c(),v=E(),z&&z.c(),y=E(),s(o,"class","text-sm text-gray-700 truncate"),s(o,"title",f=t[34].context||"Word (no context)"),s(l,"class","min-w-0"),s(p,"class","min-w-0"),s(m,"class","flex items-center gap-1.5 shrink-0"),s(n,"class",w=(t[36]>0?"border-t border-gray-100":"")+" px-3 py-2 grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 items-center hover:bg-gray-50/60 transition-colors"),this.first=n},m(R,T){F(R,n,T),u(n,r),C&&C.m(r,null),u(n,i),u(n,l),u(l,o),u(o,c),u(l,d),x&&x.m(l,null),u(n,h),u(n,p),L.m(p,null),u(n,g),u(n,m),I&&I.m(m,null),u(m,_),P&&P.m(m,null),u(m,v),z&&z.m(m,null),u(n,y)},p(R,T){t=R,t[5]?C?C.p(t,T):(C=Uo(t),C.c(),C.m(r,null)):C&&(C.d(1),C=null),T[0]&1&&a!==(a=(t[34].context||"Word (no context)")+"")&&ee(c,a),T[0]&1&&f!==(f=t[34].context||"Word (no context)")&&s(o,"title",f),t[34].labels&&t[34].labels.length>0?x?x.p(t,T):(x=Ho(t),x.c(),x.m(l,null)):x&&(x.d(1),x=null),M===(M=A(t))&&L?L.p(t,T):(L.d(1),L=M(t),L&&(L.c(),L.m(p,null))),t[8]?I?I.p(t,T):(I=Wo(t),I.c(),I.m(m,_)):I&&(I.d(1),I=null),t[10]?P?P.p(t,T):(P=Yo(t),P.c(),P.m(m,v)):P&&(P.d(1),P=null),t[12]?z?z.p(t,T):(z=Go(t),z.c(),z.m(m,null)):z&&(z.d(1),z=null),T[0]&1&&w!==(w=(t[36]>0?"border-t border-gray-100":"")+" px-3 py-2 grid grid-cols-[auto_minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 items-center hover:bg-gray-50/60 transition-colors")&&s(n,"class",w)},d(R){R&&D(n),C&&C.d(),x&&x.d(),L.d(),I&&I.d(),P&&P.d(),z&&z.d()}}}function Sd(e){let t,n,r=e[0].contexts&&e[0].contexts.some(Qo),i,l=[],o=new Map,a=e[2]&&jo(e),c=r&&Oo(e),f=Be(e[0].contexts);const d=h=>h[34].key_id;for(let h=0;h<f.length;h+=1){let p=Fo(e,f,h),g=d(p);o.set(g,l[h]=Ko(g,p))}return{c(){t=b("div"),a&&a.c(),n=E(),c&&c.c(),i=E();for(let h=0;h<l.length;h+=1)l[h].c();s(t,"class","rounded-lg border border-gray-200 bg-white overflow-hidden")},m(h,p){F(h,t,p),a&&a.m(t,null),u(t,n),c&&c.m(t,null),u(t,i);for(let g=0;g<l.length;g+=1)l[g]&&l[g].m(t,null)},p(h,p){h[2]?a?a.p(h,p):(a=jo(h),a.c(),a.m(t,n)):a&&(a.d(1),a=null),p[0]&1&&(r=h[0].contexts&&h[0].contexts.some(Qo)),r?c?c.p(h,p):(c=Oo(h),c.c(),c.m(t,i)):c&&(c.d(1),c=null),p[0]&491491&&(f=Be(h[0].contexts),l=si(l,p,d,1,h,f,o,t,Hl,Ko,null,Fo))},i:je,o:je,d(h){h&&D(t),a&&a.d(),c&&c.d();for(let p=0;p<l.length;p+=1)l[p].d()}}}const Qo=e=>!!e.context;function Td(e,t,n){let{group:r}=t,{editable:i=!1}=t,{showAiAction:l=!1}=t,{aiBusy:o=!1}=t,{onAiAction:a=null}=t,{showAria:c=!1}=t,{rowHasAria:f=()=>!1}=t,{onAriaAction:d=null}=t,{showVarEdit:h=!1}=t,{onVarEdit:p=null}=t,{showDetails:g=!1}=t,{onDetails:m=null}=t,{showLabels:_=!1}=t,{allLabels:v=[]}=t,{onToggleLabel:y=null}=t,{onSaveMasterValue:w=null}=t,{onSaveValue:C=null}=t,x=null;function A(){w&&w(r)}function M(O){C&&C(O,r)}function L(O){n(14,x=x===O?null:O)}function I(O,Y){y&&(y(O.key_id,Y,O.labels||[]),n(14,x=null))}const P=(O,Y)=>Y.id===O.id;function z(O){Ir.call(this,e,O)}const R=()=>a&&a(r),T=O=>n(0,r.master_value=O.target.value,r),N=O=>d&&d(O),k=(O,Y,re,K)=>n(0,Y[re].value=K.target.value,r),j=O=>M(O),J=O=>p&&p(O),W=O=>m&&m(O),G=O=>L(O.key_id),Z=()=>n(14,x=null),ne=(O,Y)=>I(O,Y.id);return e.$$set=O=>{"group"in O&&n(0,r=O.group),"editable"in O&&n(1,i=O.editable),"showAiAction"in O&&n(2,l=O.showAiAction),"aiBusy"in O&&n(3,o=O.aiBusy),"onAiAction"in O&&n(4,a=O.onAiAction),"showAria"in O&&n(5,c=O.showAria),"rowHasAria"in O&&n(6,f=O.rowHasAria),"onAriaAction"in O&&n(7,d=O.onAriaAction),"showVarEdit"in O&&n(8,h=O.showVarEdit),"onVarEdit"in O&&n(9,p=O.onVarEdit),"showDetails"in O&&n(10,g=O.showDetails),"onDetails"in O&&n(11,m=O.onDetails),"showLabels"in O&&n(12,_=O.showLabels),"allLabels"in O&&n(13,v=O.allLabels),"onToggleLabel"in O&&n(19,y=O.onToggleLabel),"onSaveMasterValue"in O&&n(20,w=O.onSaveMasterValue),"onSaveValue"in O&&n(21,C=O.onSaveValue)},[r,i,l,o,a,c,f,d,h,p,g,m,_,v,x,A,M,L,I,y,w,C,P,z,R,T,N,k,j,J,W,G,Z,ne]}class Bc extends an{constructor(t){super(),sn(this,t,Td,Sd,$t,{group:0,editable:1,showAiAction:2,aiBusy:3,onAiAction:4,showAria:5,rowHasAria:6,onAriaAction:7,showVarEdit:8,onVarEdit:9,showDetails:10,onDetails:11,showLabels:12,allLabels:13,onToggleLabel:19,onSaveMasterValue:20,onSaveValue:21},null,[-1,-1])}}function $o(e,t,n){const r=e.slice();return r[9]=t[n],r}function es(e,t,n){const r=e.slice();return r[9]=t[n],r}function ts(e){let t,n=Be(e[3]),r=[];for(let i=0;i<n.length;i+=1)r[i]=os(es(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","mb-4 space-y-3")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l&25){n=Be(i[3]);let o;for(o=0;o<n.length;o+=1){const a=es(i,n,o);r[o]?r[o].p(a,l):(r[o]=os(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function ns(e){let t,n,r;function i(){return e[6](e[9])}return{c(){t=b("button"),t.textContent="Cancel",s(t,"class","px-3 py-1 text-xs text-red-600 border border-red-300 rounded hover:bg-red-50")},m(l,o){F(l,t,o),n||(r=$(t,"click",i),n=!0)},p(l,o){e=l},d(l){l&&D(t),n=!1,r()}}}function rs(e){let t,n=(e[9].currentItem.source||`#${e[9].currentItem.index}`)+"",r;return{c(){t=B("Processing: "),r=B(n)},m(i,l){F(i,t,l),F(i,r,l)},p(i,l){l&8&&n!==(n=(i[9].currentItem.source||`#${i[9].currentItem.index}`)+"")&&ee(r,n)},d(i){i&&(D(t),D(r))}}}function Md(e){let t;return{c(){t=B("—")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Ed(e){let t,n=fs(e[9].estimatedTimeRemaining)+"",r;return{c(){t=B("ETA: "),r=B(n)},m(i,l){F(i,t,l),F(i,r,l)},p(i,l){l&8&&n!==(n=fs(i[9].estimatedTimeRemaining)+"")&&ee(r,n)},d(i){i&&(D(t),D(r))}}}function is(e){let t,n=e[9].processingRate.toFixed(1)+"",r,i;return{c(){t=B("("),r=B(n),i=B("/s)")},m(l,o){F(l,t,o),F(l,r,o),F(l,i,o)},p(l,o){o&8&&n!==(n=l[9].processingRate.toFixed(1)+"")&&ee(r,n)},d(l){l&&(D(t),D(r),D(i))}}}function ls(e){let t,n=e[9].failed+"",r,i;return{c(){t=b("p"),r=B(n),i=B(" failed"),s(t,"class","text-xs text-yellow-700 mt-1")},m(l,o){F(l,t,o),u(t,r),u(t,i)},p(l,o){o&8&&n!==(n=l[9].failed+"")&&ee(r,n)},d(l){l&&D(t)}}}function os(e){let t,n,r,i,l=e[4](e[9].status)+"",o,a,c=(e[9].promptName||"Translation Job")+"",f,d,h=e[9].langCode+"",p,g,m,_,v,y,w,C,x,A=e[9].completed+e[9].failed+"",M,L,I=e[9].total+"",P,z,R,T,N,k,j,J,W,G=e[0]&&ns(e),Z=e[9].currentItem&&rs(e);function ne(X,fe){return X[9].estimatedTimeRemaining?Ed:Md}let O=ne(e),Y=O(e),re=e[9].processingRate&&is(e),K=e[9].failed>0&&ls(e);return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("span"),o=E(),a=b("span"),f=B(c),d=B(" — "),p=B(h),g=E(),G&&G.c(),m=E(),_=b("div"),v=b("div"),w=E(),C=b("div"),x=b("span"),M=B(A),L=B(" / "),P=B(I),z=B(" items"),R=E(),T=b("span"),Z&&Z.c(),N=E(),k=b("span"),Y.c(),j=E(),re&&re.c(),J=E(),K&&K.c(),W=E(),s(i,"class","inline-flex items-center"),s(a,"class","text-sm font-medium text-blue-800"),s(r,"class","flex items-center gap-2"),s(n,"class","flex items-center justify-between mb-2"),s(v,"class",y="h-full rounded-full transition-all duration-300 "+(e[9].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500")),mt(v,"width",(e[9].total>0?(e[9].completed+e[9].failed)/e[9].total*100:0)+"%"),s(_,"class","w-full bg-blue-100 rounded-full h-3 overflow-hidden"),s(C,"class","flex items-center justify-between mt-2 text-xs text-blue-700"),s(t,"class","p-4 bg-blue-50 border border-blue-200 rounded-lg")},m(X,fe){F(X,t,fe),u(t,n),u(n,r),u(r,i),i.innerHTML=l,u(r,o),u(r,a),u(a,f),u(a,d),u(a,p),u(n,g),G&&G.m(n,null),u(t,m),u(t,_),u(_,v),u(t,w),u(t,C),u(C,x),u(x,M),u(x,L),u(x,P),u(x,z),u(C,R),u(C,T),Z&&Z.m(T,null),u(C,N),u(C,k),Y.m(k,null),u(k,j),re&&re.m(k,null),u(t,J),K&&K.m(t,null),u(t,W)},p(X,fe){fe&8&&l!==(l=X[4](X[9].status)+"")&&(i.innerHTML=l),fe&8&&c!==(c=(X[9].promptName||"Translation Job")+"")&&ee(f,c),fe&8&&h!==(h=X[9].langCode+"")&&ee(p,h),X[0]?G?G.p(X,fe):(G=ns(X),G.c(),G.m(n,null)):G&&(G.d(1),G=null),fe&8&&y!==(y="h-full rounded-full transition-all duration-300 "+(X[9].failed>0?"bg-gradient-to-r from-blue-500 to-yellow-500":"bg-blue-500"))&&s(v,"class",y),fe&8&&mt(v,"width",(X[9].total>0?(X[9].completed+X[9].failed)/X[9].total*100:0)+"%"),fe&8&&A!==(A=X[9].completed+X[9].failed+"")&&ee(M,A),fe&8&&I!==(I=X[9].total+"")&&ee(P,I),X[9].currentItem?Z?Z.p(X,fe):(Z=rs(X),Z.c(),Z.m(T,null)):Z&&(Z.d(1),Z=null),O===(O=ne(X))&&Y?Y.p(X,fe):(Y.d(1),Y=O(X),Y&&(Y.c(),Y.m(k,j))),X[9].processingRate?re?re.p(X,fe):(re=is(X),re.c(),re.m(k,null)):re&&(re.d(1),re=null),X[9].failed>0?K?K.p(X,fe):(K=ls(X),K.c(),K.m(t,W)):K&&(K.d(1),K=null)},d(X){X&&D(t),G&&G.d(),Z&&Z.d(),Y.d(),re&&re.d(),K&&K.d()}}}function ss(e){let t,n=Be(e[2]),r=[];for(let i=0;i<n.length;i+=1)r[i]=us($o(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","mb-4 space-y-2")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l&22){n=Be(i[2]);let o;for(o=0;o<n.length;o+=1){const a=$o(i,n,o);r[o]?r[o].p(a,l):(r[o]=us(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function as(e){let t,n,r;function i(){return e[7](e[9])}return{c(){t=b("button"),t.textContent="×",s(t,"class","w-6 h-6 flex items-center justify-center text-gray-400 hover:text-gray-700 hover:bg-gray-200 rounded text-base"),s(t,"title","Dismiss")},m(l,o){F(l,t,o),n||(r=$(t,"click",Bt(i)),n=!0)},p(l,o){e=l},d(l){l&&D(t),n=!1,r()}}}function us(e){let t,n,r,i=e[4](e[9].status)+"",l,o,a=e[9].status+"",c,f,d,h,p=(e[9].promptName||"Job")+"",g,m,_=e[9].langCode+"",v,y,w,C,x=e[9].completed+"",A,M,L=e[9].total+"",I,P,z,R,T=e[1]&&as(e);return{c(){t=b("div"),n=b("div"),r=b("span"),l=E(),o=b("span"),c=B(a),d=E(),h=b("span"),g=B(p),m=B(" — "),v=B(_),y=E(),w=b("div"),C=b("span"),A=B(x),M=B("/"),I=B(L),P=B(" translated"),z=E(),T&&T.c(),R=E(),s(r,"class","inline-flex items-center"),s(o,"class",f="font-medium "+cs(e[9].status)),s(h,"class","text-gray-500"),s(n,"class","flex items-center gap-2"),s(C,"class","text-gray-400"),s(w,"class","flex items-center gap-3"),s(t,"class","p-3 bg-gray-50 border border-gray-200 rounded-lg flex items-center justify-between text-sm")},m(N,k){F(N,t,k),u(t,n),u(n,r),r.innerHTML=i,u(n,l),u(n,o),u(o,c),u(n,d),u(n,h),u(h,g),u(h,m),u(h,v),u(t,y),u(t,w),u(w,C),u(C,A),u(C,M),u(C,I),u(C,P),u(w,z),T&&T.m(w,null),u(t,R)},p(N,k){k&4&&i!==(i=N[4](N[9].status)+"")&&(r.innerHTML=i),k&4&&a!==(a=N[9].status+"")&&ee(c,a),k&4&&f!==(f="font-medium "+cs(N[9].status))&&s(o,"class",f),k&4&&p!==(p=(N[9].promptName||"Job")+"")&&ee(g,p),k&4&&_!==(_=N[9].langCode+"")&&ee(v,_),k&4&&x!==(x=N[9].completed+"")&&ee(A,x),k&4&&L!==(L=N[9].total+"")&&ee(I,L),N[1]?T?T.p(N,k):(T=as(N),T.c(),T.m(w,null)):T&&(T.d(1),T=null)},d(N){N&&D(t),T&&T.d()}}}function Id(e){let t,n,r=e[3].length>0&&ts(e),i=e[2].length>0&&ss(e);return{c(){r&&r.c(),t=E(),i&&i.c(),n=xt()},m(l,o){r&&r.m(l,o),F(l,t,o),i&&i.m(l,o),F(l,n,o)},p(l,[o]){l[3].length>0?r?r.p(l,o):(r=ts(l),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),l[2].length>0?i?i.p(l,o):(i=ss(l),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},i:je,o:je,d(l){l&&(D(t),D(n)),r&&r.d(l),i&&i.d(l)}}}function cs(e){switch(e){case"running":return"text-blue-600";case"completed":return"text-green-600";case"failed":return"text-red-600";case"cancelled":case"cancelling":return"text-yellow-600";default:return"text-gray-500"}}function fs(e){return!e||e<0?"—":e<60?`${Math.ceil(e)}s`:`${Math.floor(e/60)}m ${Math.ceil(e%60)}s`}function Ld(e,t,n){let r,i,{jobs:l=[]}=t,{onCancel:o=null}=t,{onDismiss:a=null}=t;const c={pending:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',running:'<svg class="animate-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A8FE0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',completed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#2ECC88" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',failed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cancelled:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',cancelling:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'};function f(p){return c[p]??'<span class="text-gray-400">—</span>'}const d=p=>o(p.id),h=p=>a(p.id);return e.$$set=p=>{"jobs"in p&&n(5,l=p.jobs),"onCancel"in p&&n(0,o=p.onCancel),"onDismiss"in p&&n(1,a=p.onDismiss)},e.$$.update=()=>{e.$$.dirty&32&&n(3,r=l.filter(p=>p.status==="running"||p.status==="pending")),e.$$.dirty&32&&n(2,i=l.filter(p=>p.status==="completed"||p.status==="failed"||p.status==="cancelled").slice(0,1))},[o,a,i,r,f,l,d,h]}class Rc extends an{constructor(t){super(),sn(this,t,Ld,Id,$t,{jobs:5,onCancel:0,onDismiss:1})}}var mi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _i(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var jc={exports:{}};/*!
|
|
4
|
+
|
|
5
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
6
|
+
<http://stuartk.com/jszip>
|
|
7
|
+
|
|
8
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
9
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
10
|
+
|
|
11
|
+
JSZip uses the library pako released under the MIT license :
|
|
12
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
13
|
+
*/(function(e,t){(function(n){e.exports=n()})(function(){return function n(r,i,l){function o(f,d){if(!i[f]){if(!r[f]){var h=typeof _i=="function"&&_i;if(!d&&h)return h(f,!0);if(a)return a(f,!0);var p=new Error("Cannot find module '"+f+"'");throw p.code="MODULE_NOT_FOUND",p}var g=i[f]={exports:{}};r[f][0].call(g.exports,function(m){var _=r[f][1][m];return o(_||m)},g,g.exports,n,r,i,l)}return i[f].exports}for(var a=typeof _i=="function"&&_i,c=0;c<l.length;c++)o(l[c]);return o}({1:[function(n,r,i){var l=n("./utils"),o=n("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(c){for(var f,d,h,p,g,m,_,v=[],y=0,w=c.length,C=w,x=l.getTypeOf(c)!=="string";y<c.length;)C=w-y,h=x?(f=c[y++],d=y<w?c[y++]:0,y<w?c[y++]:0):(f=c.charCodeAt(y++),d=y<w?c.charCodeAt(y++):0,y<w?c.charCodeAt(y++):0),p=f>>2,g=(3&f)<<4|d>>4,m=1<C?(15&d)<<2|h>>6:64,_=2<C?63&h:64,v.push(a.charAt(p)+a.charAt(g)+a.charAt(m)+a.charAt(_));return v.join("")},i.decode=function(c){var f,d,h,p,g,m,_=0,v=0,y="data:";if(c.substr(0,y.length)===y)throw new Error("Invalid base64 input, it looks like a data url.");var w,C=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===a.charAt(64)&&C--,c.charAt(c.length-2)===a.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(w=o.uint8array?new Uint8Array(0|C):new Array(0|C);_<c.length;)f=a.indexOf(c.charAt(_++))<<2|(p=a.indexOf(c.charAt(_++)))>>4,d=(15&p)<<4|(g=a.indexOf(c.charAt(_++)))>>2,h=(3&g)<<6|(m=a.indexOf(c.charAt(_++))),w[v++]=f,g!==64&&(w[v++]=d),m!==64&&(w[v++]=h);return w}},{"./support":30,"./utils":32}],2:[function(n,r,i){var l=n("./external"),o=n("./stream/DataWorker"),a=n("./stream/Crc32Probe"),c=n("./stream/DataLengthProbe");function f(d,h,p,g,m){this.compressedSize=d,this.uncompressedSize=h,this.crc32=p,this.compression=g,this.compressedContent=m}f.prototype={getContentWorker:function(){var d=new o(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),h=this;return d.on("end",function(){if(this.streamInfo.data_length!==h.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new o(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},f.createWorkerFrom=function(d,h,p){return d.pipe(new a).pipe(new c("uncompressedSize")).pipe(h.compressWorker(p)).pipe(new c("compressedSize")).withStreamInfo("compression",h)},r.exports=f},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var l=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new l("STORE compression")},uncompressWorker:function(){return new l("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var l=n("./utils"),o=function(){for(var a,c=[],f=0;f<256;f++){a=f;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;c[f]=a}return c}();r.exports=function(a,c){return a!==void 0&&a.length?l.getTypeOf(a)!=="string"?function(f,d,h,p){var g=o,m=p+h;f^=-1;for(var _=p;_<m;_++)f=f>>>8^g[255&(f^d[_])];return-1^f}(0|c,a,a.length,0):function(f,d,h,p){var g=o,m=p+h;f^=-1;for(var _=p;_<m;_++)f=f>>>8^g[255&(f^d.charCodeAt(_))];return-1^f}(0|c,a,a.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var l=null;l=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:l}},{lie:37}],7:[function(n,r,i){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=n("pako"),a=n("./utils"),c=n("./stream/GenericWorker"),f=l?"uint8array":"array";function d(h,p){c.call(this,"FlateWorker/"+h),this._pako=null,this._pakoAction=h,this._pakoOptions=p,this.meta={}}i.magic="\b\0",a.inherits(d,c),d.prototype.processChunk=function(h){this.meta=h.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(f,h.data),!1)},d.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var h=this;this._pako.onData=function(p){h.push({data:p,meta:h.meta})}},i.compressWorker=function(h){return new d("Deflate",h)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function l(g,m){var _,v="";for(_=0;_<m;_++)v+=String.fromCharCode(255&g),g>>>=8;return v}function o(g,m,_,v,y,w){var C,x,A=g.file,M=g.compression,L=w!==f.utf8encode,I=a.transformTo("string",w(A.name)),P=a.transformTo("string",f.utf8encode(A.name)),z=A.comment,R=a.transformTo("string",w(z)),T=a.transformTo("string",f.utf8encode(z)),N=P.length!==A.name.length,k=T.length!==z.length,j="",J="",W="",G=A.dir,Z=A.date,ne={crc32:0,compressedSize:0,uncompressedSize:0};m&&!_||(ne.crc32=g.crc32,ne.compressedSize=g.compressedSize,ne.uncompressedSize=g.uncompressedSize);var O=0;m&&(O|=8),L||!N&&!k||(O|=2048);var Y=0,re=0;G&&(Y|=16),y==="UNIX"?(re=798,Y|=function(X,fe){var ye=X;return X||(ye=fe?16893:33204),(65535&ye)<<16}(A.unixPermissions,G)):(re=20,Y|=function(X){return 63&(X||0)}(A.dosPermissions)),C=Z.getUTCHours(),C<<=6,C|=Z.getUTCMinutes(),C<<=5,C|=Z.getUTCSeconds()/2,x=Z.getUTCFullYear()-1980,x<<=4,x|=Z.getUTCMonth()+1,x<<=5,x|=Z.getUTCDate(),N&&(J=l(1,1)+l(d(I),4)+P,j+="up"+l(J.length,2)+J),k&&(W=l(1,1)+l(d(R),4)+T,j+="uc"+l(W.length,2)+W);var K="";return K+=`
|
|
14
|
+
\0`,K+=l(O,2),K+=M.magic,K+=l(C,2),K+=l(x,2),K+=l(ne.crc32,4),K+=l(ne.compressedSize,4),K+=l(ne.uncompressedSize,4),K+=l(I.length,2),K+=l(j.length,2),{fileRecord:h.LOCAL_FILE_HEADER+K+I+j,dirRecord:h.CENTRAL_FILE_HEADER+l(re,2)+K+l(R.length,2)+"\0\0\0\0"+l(Y,4)+l(v,4)+I+j+R}}var a=n("../utils"),c=n("../stream/GenericWorker"),f=n("../utf8"),d=n("../crc32"),h=n("../signature");function p(g,m,_,v){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=m,this.zipPlatform=_,this.encodeFileName=v,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,c),p.prototype.push=function(g){var m=g.meta.percent||0,_=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,c.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:_?(m+100*(_-v-1))/_:100}}))},p.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var m=this.streamFiles&&!g.file.dir;if(m){var _=o(g,m,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:_.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(g){this.accumulate=!1;var m=this.streamFiles&&!g.file.dir,_=o(g,m,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(_.dirRecord),m)this.push({data:function(v){return h.DATA_DESCRIPTOR+l(v.crc32,4)+l(v.compressedSize,4)+l(v.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:_.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var g=this.bytesWritten,m=0;m<this.dirRecords.length;m++)this.push({data:this.dirRecords[m],meta:{percent:100}});var _=this.bytesWritten-g,v=function(y,w,C,x,A){var M=a.transformTo("string",A(x));return h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+l(y,2)+l(y,2)+l(w,4)+l(C,4)+l(M.length,2)+M}(this.dirRecords.length,_,g,this.zipComment,this.encodeFileName);this.push({data:v,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(g){this._sources.push(g);var m=this;return g.on("data",function(_){m.processChunk(_)}),g.on("end",function(){m.closedSource(m.previous.streamInfo),m._sources.length?m.prepareNextSource():m.end()}),g.on("error",function(_){m.error(_)}),this},p.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(g){var m=this._sources;if(!c.prototype.error.call(this,g))return!1;for(var _=0;_<m.length;_++)try{m[_].error(g)}catch{}return!0},p.prototype.lock=function(){c.prototype.lock.call(this);for(var g=this._sources,m=0;m<g.length;m++)g[m].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var l=n("../compressions"),o=n("./ZipFileWorker");i.generateWorker=function(a,c,f){var d=new o(c.streamFiles,f,c.platform,c.encodeFileName),h=0;try{a.forEach(function(p,g){h++;var m=function(w,C){var x=w||C,A=l[x];if(!A)throw new Error(x+" is not a valid compression method !");return A}(g.options.compression,c.compression),_=g.options.compressionOptions||c.compressionOptions||{},v=g.dir,y=g.date;g._compressWorker(m,_).withStreamInfo("file",{name:p,dir:v,date:y,comment:g.comment||"",unixPermissions:g.unixPermissions,dosPermissions:g.dosPermissions}).pipe(d)}),d.entriesCount=h}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function l(){if(!(this instanceof l))return new l;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var o=new l;for(var a in this)typeof this[a]!="function"&&(o[a]=this[a]);return o}}(l.prototype=n("./object")).loadAsync=n("./load"),l.support=n("./support"),l.defaults=n("./defaults"),l.version="3.10.1",l.loadAsync=function(o,a){return new l().loadAsync(o,a)},l.external=n("./external"),r.exports=l},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var l=n("./utils"),o=n("./external"),a=n("./utf8"),c=n("./zipEntries"),f=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function h(p){return new o.Promise(function(g,m){var _=p.decompressed.getContentWorker().pipe(new f);_.on("error",function(v){m(v)}).on("end",function(){_.streamInfo.crc32!==p.decompressed.crc32?m(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}r.exports=function(p,g){var m=this;return g=l.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(p)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):l.prepareContent("the loaded zip file",p,!0,g.optimizedBinaryString,g.base64).then(function(_){var v=new c(g);return v.load(_),v}).then(function(_){var v=[o.Promise.resolve(_)],y=_.files;if(g.checkCRC32)for(var w=0;w<y.length;w++)v.push(h(y[w]));return o.Promise.all(v)}).then(function(_){for(var v=_.shift(),y=v.files,w=0;w<y.length;w++){var C=y[w],x=C.fileNameStr,A=l.resolve(C.fileNameStr);m.file(A,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:g.createFolders}),C.dir||(m.file(A).unsafeOriginalName=x)}return v.zipComment.length&&(m.comment=v.zipComment),m})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var l=n("../utils"),o=n("../stream/GenericWorker");function a(c,f){o.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(f)}l.inherits(a,o),a.prototype._bindStream=function(c){var f=this;(this._stream=c).pause(),c.on("data",function(d){f.push({data:d,meta:{percent:0}})}).on("error",function(d){f.isPaused?this.generatedError=d:f.error(d)}).on("end",function(){f.isPaused?f._upstreamEnded=!0:f.end()})},a.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var l=n("readable-stream").Readable;function o(a,c,f){l.call(this,c),this._helper=a;var d=this;a.on("data",function(h,p){d.push(h)||d._helper.pause(),f&&f(p)}).on("error",function(h){d.emit("error",h)}).on("end",function(){d.push(null)})}n("../utils").inherits(o,l),o.prototype._read=function(){this._helper.resume()},r.exports=o},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(l,o){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(l,o);if(typeof l=="number")throw new Error('The "data" argument must not be a number');return new Buffer(l,o)},allocBuffer:function(l){if(Buffer.alloc)return Buffer.alloc(l);var o=new Buffer(l);return o.fill(0),o},isBuffer:function(l){return Buffer.isBuffer(l)},isStream:function(l){return l&&typeof l.on=="function"&&typeof l.pause=="function"&&typeof l.resume=="function"}}},{}],15:[function(n,r,i){function l(A,M,L){var I,P=a.getTypeOf(M),z=a.extend(L||{},d);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(A=y(A)),z.createFolders&&(I=v(A))&&w.call(this,I,!0);var R=P==="string"&&z.binary===!1&&z.base64===!1;L&&L.binary!==void 0||(z.binary=!R),(M instanceof h&&M.uncompressedSize===0||z.dir||!M||M.length===0)&&(z.base64=!1,z.binary=!0,M="",z.compression="STORE",P="string");var T=null;T=M instanceof h||M instanceof c?M:m.isNode&&m.isStream(M)?new _(A,M):a.prepareContent(A,M,z.binary,z.optimizedBinaryString,z.base64);var N=new p(A,T,z);this.files[A]=N}var o=n("./utf8"),a=n("./utils"),c=n("./stream/GenericWorker"),f=n("./stream/StreamHelper"),d=n("./defaults"),h=n("./compressedObject"),p=n("./zipObject"),g=n("./generate"),m=n("./nodejsUtils"),_=n("./nodejs/NodejsStreamInputAdapter"),v=function(A){A.slice(-1)==="/"&&(A=A.substring(0,A.length-1));var M=A.lastIndexOf("/");return 0<M?A.substring(0,M):""},y=function(A){return A.slice(-1)!=="/"&&(A+="/"),A},w=function(A,M){return M=M!==void 0?M:d.createFolders,A=y(A),this.files[A]||l.call(this,A,null,{dir:!0,createFolders:M}),this.files[A]};function C(A){return Object.prototype.toString.call(A)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(A){var M,L,I;for(M in this.files)I=this.files[M],(L=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&A(L,I)},filter:function(A){var M=[];return this.forEach(function(L,I){A(L,I)&&M.push(I)}),M},file:function(A,M,L){if(arguments.length!==1)return A=this.root+A,l.call(this,A,M,L),this;if(C(A)){var I=A;return this.filter(function(z,R){return!R.dir&&I.test(z)})}var P=this.files[this.root+A];return P&&!P.dir?P:null},folder:function(A){if(!A)return this;if(C(A))return this.filter(function(P,z){return z.dir&&A.test(P)});var M=this.root+A,L=w.call(this,M),I=this.clone();return I.root=L.name,I},remove:function(A){A=this.root+A;var M=this.files[A];if(M||(A.slice(-1)!=="/"&&(A+="/"),M=this.files[A]),M&&!M.dir)delete this.files[A];else for(var L=this.filter(function(P,z){return z.name.slice(0,A.length)===A}),I=0;I<L.length;I++)delete this.files[L[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(A){var M,L={};try{if((L=a.extend(A||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");a.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var I=L.comment||this.comment||"";M=g.generateWorker(this,L,I)}catch(P){(M=new c("error")).error(P)}return new f(M,L.type||"string",L.mimeType)},generateAsync:function(A,M){return this.generateInternalStream(A).accumulate(M)},generateNodeStream:function(A,M){return(A=A||{}).type||(A.type="nodebuffer"),this.generateInternalStream(A).toNodejsStream(M)}};r.exports=x},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var l=n("./DataReader");function o(a){l.call(this,a);for(var c=0;c<this.data.length;c++)a[c]=255&a[c]}n("../utils").inherits(o,l),o.prototype.byteAt=function(a){return this.data[this.zero+a]},o.prototype.lastIndexOfSignature=function(a){for(var c=a.charCodeAt(0),f=a.charCodeAt(1),d=a.charCodeAt(2),h=a.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===c&&this.data[p+1]===f&&this.data[p+2]===d&&this.data[p+3]===h)return p-this.zero;return-1},o.prototype.readAndCheckSignature=function(a){var c=a.charCodeAt(0),f=a.charCodeAt(1),d=a.charCodeAt(2),h=a.charCodeAt(3),p=this.readData(4);return c===p[0]&&f===p[1]&&d===p[2]&&h===p[3]},o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var l=n("../utils");function o(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}o.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var c,f=0;for(this.checkOffset(a),c=this.index+a-1;c>=this.index;c--)f=(f<<8)+this.byteAt(c);return this.index+=a,f},readString:function(a){return l.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=o},{"../utils":32}],19:[function(n,r,i){var l=n("./Uint8ArrayReader");function o(a){l.call(this,a)}n("../utils").inherits(o,l),o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var l=n("./DataReader");function o(a){l.call(this,a)}n("../utils").inherits(o,l),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var c=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var l=n("./ArrayReader");function o(a){l.call(this,a)}n("../utils").inherits(o,l),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,c},r.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var l=n("../utils"),o=n("../support"),a=n("./ArrayReader"),c=n("./StringReader"),f=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(h){var p=l.getTypeOf(h);return l.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new f(h):o.uint8array?new d(l.transformTo("uint8array",h)):new a(l.transformTo("array",h)):new c(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var l=n("./GenericWorker"),o=n("../utils");function a(c){l.call(this,"ConvertWorker to "+c),this.destType=c}o.inherits(a,l),a.prototype.processChunk=function(c){this.push({data:o.transformTo(this.destType,c.data),meta:c.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var l=n("./GenericWorker"),o=n("../crc32");function a(){l.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(a,l),a.prototype.processChunk=function(c){this.streamInfo.crc32=o(c.data,this.streamInfo.crc32||0),this.push(c)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var l=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}l.inherits(a,o),a.prototype.processChunk=function(c){if(c){var f=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=f+c.data.length}o.prototype.processChunk.call(this,c)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var l=n("../utils"),o=n("./GenericWorker");function a(c){o.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(d){f.dataIsReady=!0,f.data=d,f.max=d&&d.length||0,f.type=l.getTypeOf(d),f.isPaused||f._tickAndRepeat()},function(d){f.error(d)})}l.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,l.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(l.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,f=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,f);break;case"uint8array":c=this.data.subarray(this.index,f);break;case"array":case"nodebuffer":c=this.data.slice(this.index,f)}return this.index=f,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function l(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}l.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var c=0;c<this._listeners[o].length;c++)this._listeners[o][c].call(this,a)},pipe:function(o){return o.registerPrevious(this)},registerPrevious:function(o){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=o.streamInfo,this.mergeStreamInfo(),this.previous=o;var a=this;return o.on("data",function(c){a.processChunk(c)}),o.on("end",function(){a.end()}),o.on("error",function(c){a.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var o=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),o=!0),this.previous&&this.previous.resume(),!o},flush:function(){},processChunk:function(o){this.push(o)},withStreamInfo:function(o,a){return this.extraStreamInfo[o]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var o in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,o)&&(this.streamInfo[o]=this.extraStreamInfo[o])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var o="Worker "+this.name;return this.previous?this.previous+" -> "+o:o}},r.exports=l},{}],29:[function(n,r,i){var l=n("../utils"),o=n("./ConvertWorker"),a=n("./GenericWorker"),c=n("../base64"),f=n("../support"),d=n("../external"),h=null;if(f.nodestream)try{h=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(m,_){return new d.Promise(function(v,y){var w=[],C=m._internalType,x=m._outputType,A=m._mimeType;m.on("data",function(M,L){w.push(M),_&&_(L)}).on("error",function(M){w=[],y(M)}).on("end",function(){try{var M=function(L,I,P){switch(L){case"blob":return l.newBlob(l.transformTo("arraybuffer",I),P);case"base64":return c.encode(I);default:return l.transformTo(L,I)}}(x,function(L,I){var P,z=0,R=null,T=0;for(P=0;P<I.length;P++)T+=I[P].length;switch(L){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(R=new Uint8Array(T),P=0;P<I.length;P++)R.set(I[P],z),z+=I[P].length;return R;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+L+"'")}}(C,w),A);v(M)}catch(L){y(L)}w=[]}).resume()})}function g(m,_,v){var y=_;switch(_){case"blob":case"arraybuffer":y="uint8array";break;case"base64":y="string"}try{this._internalType=y,this._outputType=_,this._mimeType=v,l.checkSupport(y),this._worker=m.pipe(new o(y)),m.lock()}catch(w){this._worker=new a("error"),this._worker.error(w)}}g.prototype={accumulate:function(m){return p(this,m)},on:function(m,_){var v=this;return m==="data"?this._worker.on(m,function(y){_.call(v,y.data,y.meta)}):this._worker.on(m,function(){l.delay(_,arguments,v)}),this},resume:function(){return l.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(m){if(l.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new h(this,{objectMode:this._outputType!=="nodebuffer"},m)}},r.exports=g},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var l=new ArrayBuffer(0);try{i.blob=new Blob([l],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(l),i.blob=o.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var l=n("./utils"),o=n("./support"),a=n("./nodejsUtils"),c=n("./stream/GenericWorker"),f=new Array(256),d=0;d<256;d++)f[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;f[254]=f[254]=1;function h(){c.call(this,"utf-8 decode"),this.leftOver=null}function p(){c.call(this,"utf-8 encode")}i.utf8encode=function(g){return o.nodebuffer?a.newBufferFrom(g,"utf-8"):function(m){var _,v,y,w,C,x=m.length,A=0;for(w=0;w<x;w++)(64512&(v=m.charCodeAt(w)))==55296&&w+1<x&&(64512&(y=m.charCodeAt(w+1)))==56320&&(v=65536+(v-55296<<10)+(y-56320),w++),A+=v<128?1:v<2048?2:v<65536?3:4;for(_=o.uint8array?new Uint8Array(A):new Array(A),w=C=0;C<A;w++)(64512&(v=m.charCodeAt(w)))==55296&&w+1<x&&(64512&(y=m.charCodeAt(w+1)))==56320&&(v=65536+(v-55296<<10)+(y-56320),w++),v<128?_[C++]=v:(v<2048?_[C++]=192|v>>>6:(v<65536?_[C++]=224|v>>>12:(_[C++]=240|v>>>18,_[C++]=128|v>>>12&63),_[C++]=128|v>>>6&63),_[C++]=128|63&v);return _}(g)},i.utf8decode=function(g){return o.nodebuffer?l.transformTo("nodebuffer",g).toString("utf-8"):function(m){var _,v,y,w,C=m.length,x=new Array(2*C);for(_=v=0;_<C;)if((y=m[_++])<128)x[v++]=y;else if(4<(w=f[y]))x[v++]=65533,_+=w-1;else{for(y&=w===2?31:w===3?15:7;1<w&&_<C;)y=y<<6|63&m[_++],w--;1<w?x[v++]=65533:y<65536?x[v++]=y:(y-=65536,x[v++]=55296|y>>10&1023,x[v++]=56320|1023&y)}return x.length!==v&&(x.subarray?x=x.subarray(0,v):x.length=v),l.applyFromCharCode(x)}(g=l.transformTo(o.uint8array?"uint8array":"array",g))},l.inherits(h,c),h.prototype.processChunk=function(g){var m=l.transformTo(o.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var _=m;(m=new Uint8Array(_.length+this.leftOver.length)).set(this.leftOver,0),m.set(_,this.leftOver.length)}else m=this.leftOver.concat(m);this.leftOver=null}var v=function(w,C){var x;for((C=C||w.length)>w.length&&(C=w.length),x=C-1;0<=x&&(192&w[x])==128;)x--;return x<0||x===0?C:x+f[w[x]]>C?x:C}(m),y=m;v!==m.length&&(o.uint8array?(y=m.subarray(0,v),this.leftOver=m.subarray(v,m.length)):(y=m.slice(0,v),this.leftOver=m.slice(v,m.length))),this.push({data:i.utf8decode(y),meta:g.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=h,l.inherits(p,c),p.prototype.processChunk=function(g){this.push({data:i.utf8encode(g.data),meta:g.meta})},i.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var l=n("./support"),o=n("./base64"),a=n("./nodejsUtils"),c=n("./external");function f(_){return _}function d(_,v){for(var y=0;y<_.length;++y)v[y]=255&_.charCodeAt(y);return v}n("setimmediate"),i.newBlob=function(_,v){i.checkSupport("blob");try{return new Blob([_],{type:v})}catch{try{var y=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return y.append(_),y.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};var h={stringifyByChunk:function(_,v,y){var w=[],C=0,x=_.length;if(x<=y)return String.fromCharCode.apply(null,_);for(;C<x;)v==="array"||v==="nodebuffer"?w.push(String.fromCharCode.apply(null,_.slice(C,Math.min(C+y,x)))):w.push(String.fromCharCode.apply(null,_.subarray(C,Math.min(C+y,x)))),C+=y;return w.join("")},stringifyByChar:function(_){for(var v="",y=0;y<_.length;y++)v+=String.fromCharCode(_[y]);return v},applyCanBeUsed:{uint8array:function(){try{return l.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return l.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function p(_){var v=65536,y=i.getTypeOf(_),w=!0;if(y==="uint8array"?w=h.applyCanBeUsed.uint8array:y==="nodebuffer"&&(w=h.applyCanBeUsed.nodebuffer),w)for(;1<v;)try{return h.stringifyByChunk(_,y,v)}catch{v=Math.floor(v/2)}return h.stringifyByChar(_)}function g(_,v){for(var y=0;y<_.length;y++)v[y]=_[y];return v}i.applyFromCharCode=p;var m={};m.string={string:f,array:function(_){return d(_,new Array(_.length))},arraybuffer:function(_){return m.string.uint8array(_).buffer},uint8array:function(_){return d(_,new Uint8Array(_.length))},nodebuffer:function(_){return d(_,a.allocBuffer(_.length))}},m.array={string:p,array:f,arraybuffer:function(_){return new Uint8Array(_).buffer},uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return a.newBufferFrom(_)}},m.arraybuffer={string:function(_){return p(new Uint8Array(_))},array:function(_){return g(new Uint8Array(_),new Array(_.byteLength))},arraybuffer:f,uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return a.newBufferFrom(new Uint8Array(_))}},m.uint8array={string:p,array:function(_){return g(_,new Array(_.length))},arraybuffer:function(_){return _.buffer},uint8array:f,nodebuffer:function(_){return a.newBufferFrom(_)}},m.nodebuffer={string:p,array:function(_){return g(_,new Array(_.length))},arraybuffer:function(_){return m.nodebuffer.uint8array(_).buffer},uint8array:function(_){return g(_,new Uint8Array(_.length))},nodebuffer:f},i.transformTo=function(_,v){if(v=v||"",!_)return v;i.checkSupport(_);var y=i.getTypeOf(v);return m[y][_](v)},i.resolve=function(_){for(var v=_.split("/"),y=[],w=0;w<v.length;w++){var C=v[w];C==="."||C===""&&w!==0&&w!==v.length-1||(C===".."?y.pop():y.push(C))}return y.join("/")},i.getTypeOf=function(_){return typeof _=="string"?"string":Object.prototype.toString.call(_)==="[object Array]"?"array":l.nodebuffer&&a.isBuffer(_)?"nodebuffer":l.uint8array&&_ instanceof Uint8Array?"uint8array":l.arraybuffer&&_ instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(_){if(!l[_.toLowerCase()])throw new Error(_+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(_){var v,y,w="";for(y=0;y<(_||"").length;y++)w+="\\x"+((v=_.charCodeAt(y))<16?"0":"")+v.toString(16).toUpperCase();return w},i.delay=function(_,v,y){setImmediate(function(){_.apply(y||null,v||[])})},i.inherits=function(_,v){function y(){}y.prototype=v.prototype,_.prototype=new y},i.extend=function(){var _,v,y={};for(_=0;_<arguments.length;_++)for(v in arguments[_])Object.prototype.hasOwnProperty.call(arguments[_],v)&&y[v]===void 0&&(y[v]=arguments[_][v]);return y},i.prepareContent=function(_,v,y,w,C){return c.Promise.resolve(v).then(function(x){return l.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new c.Promise(function(A,M){var L=new FileReader;L.onload=function(I){A(I.target.result)},L.onerror=function(I){M(I.target.error)},L.readAsArrayBuffer(x)}):x}).then(function(x){var A=i.getTypeOf(x);return A?(A==="arraybuffer"?x=i.transformTo("uint8array",x):A==="string"&&(C?x=o.decode(x):y&&w!==!0&&(x=function(M){return d(M,l.uint8array?new Uint8Array(M.length):new Array(M.length))}(x))),x):c.Promise.reject(new Error("Can't read the data of '"+_+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var l=n("./reader/readerFor"),o=n("./utils"),a=n("./signature"),c=n("./zipEntry"),f=n("./support");function d(h){this.files=[],this.loadOptions=h}d.prototype={checkSignature:function(h){if(!this.reader.readAndCheckSignature(h)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(p)+", expected "+o.pretty(h)+")")}},isSignature:function(h,p){var g=this.reader.index;this.reader.setIndex(h);var m=this.reader.readString(4)===p;return this.reader.setIndex(g),m},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var h=this.reader.readData(this.zipCommentLength),p=f.uint8array?"uint8array":"array",g=o.transformTo(p,h);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var h,p,g,m=this.zip64EndOfCentralSize-44;0<m;)h=this.reader.readInt(2),p=this.reader.readInt(4),g=this.reader.readData(p),this.zip64ExtensibleData[h]={id:h,length:p,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var h,p;for(h=0;h<this.files.length;h++)p=this.files[h],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var h;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(h=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(h);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var h=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(h<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(h);var p=h;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(h=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(h),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var g=this.centralDirOffset+this.centralDirSize;this.zip64&&(g+=20,g+=12+this.zip64EndOfCentralSize);var m=p-g;if(0<m)this.isSignature(p,a.CENTRAL_FILE_HEADER)||(this.reader.zero=m);else if(m<0)throw new Error("Corrupted zip: missing "+Math.abs(m)+" bytes.")},prepareReader:function(h){this.reader=l(h)},load:function(h){this.prepareReader(h),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var l=n("./reader/readerFor"),o=n("./utils"),a=n("./compressedObject"),c=n("./crc32"),f=n("./utf8"),d=n("./compressions"),h=n("./support");function p(g,m){this.options=g,this.loadOptions=m}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(g){var m,_;if(g.skip(22),this.fileNameLength=g.readInt(2),_=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(_),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((m=function(v){for(var y in d)if(Object.prototype.hasOwnProperty.call(d,y)&&d[y].magic===v)return d[y];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,m,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var m=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(m),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=l(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var m,_,v,y=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4<y;)m=g.readInt(2),_=g.readInt(2),v=g.readData(_),this.extraFields[m]={id:m,length:_,value:v};g.setIndex(y)},handleUTF8:function(){var g=h.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=f.utf8decode(this.fileName),this.fileCommentStr=f.utf8decode(this.fileComment);else{var m=this.findExtraFieldUnicodePath();if(m!==null)this.fileNameStr=m;else{var _=o.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(_)}var v=this.findExtraFieldUnicodeComment();if(v!==null)this.fileCommentStr=v;else{var y=o.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(y)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var m=l(g.value);return m.readInt(1)!==1||c(this.fileName)!==m.readInt(4)?null:f.utf8decode(m.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var m=l(g.value);return m.readInt(1)!==1||c(this.fileComment)!==m.readInt(4)?null:f.utf8decode(m.readData(g.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function l(m,_,v){this.name=m,this.dir=v.dir,this.date=v.date,this.comment=v.comment,this.unixPermissions=v.unixPermissions,this.dosPermissions=v.dosPermissions,this._data=_,this._dataBinary=v.binary,this.options={compression:v.compression,compressionOptions:v.compressionOptions}}var o=n("./stream/StreamHelper"),a=n("./stream/DataWorker"),c=n("./utf8"),f=n("./compressedObject"),d=n("./stream/GenericWorker");l.prototype={internalStream:function(m){var _=null,v="string";try{if(!m)throw new Error("No output type specified.");var y=(v=m.toLowerCase())==="string"||v==="text";v!=="binarystring"&&v!=="text"||(v="string"),_=this._decompressWorker();var w=!this._dataBinary;w&&!y&&(_=_.pipe(new c.Utf8EncodeWorker)),!w&&y&&(_=_.pipe(new c.Utf8DecodeWorker))}catch(C){(_=new d("error")).error(C)}return new o(_,v,"")},async:function(m,_){return this.internalStream(m).accumulate(_)},nodeStream:function(m,_){return this.internalStream(m||"nodebuffer").toNodejsStream(_)},_compressWorker:function(m,_){if(this._data instanceof f&&this._data.compression.magic===m.magic)return this._data.getCompressedWorker();var v=this._decompressWorker();return this._dataBinary||(v=v.pipe(new c.Utf8EncodeWorker)),f.createWorkerFrom(v,m,_)},_decompressWorker:function(){return this._data instanceof f?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<h.length;g++)l.prototype[h[g]]=p;r.exports=l},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(l){var o,a,c=l.MutationObserver||l.WebKitMutationObserver;if(c){var f=0,d=new c(m),h=l.document.createTextNode("");d.observe(h,{characterData:!0}),o=function(){h.data=f=++f%2}}else if(l.setImmediate||l.MessageChannel===void 0)o="document"in l&&"onreadystatechange"in l.document.createElement("script")?function(){var _=l.document.createElement("script");_.onreadystatechange=function(){m(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},l.document.documentElement.appendChild(_)}:function(){setTimeout(m,0)};else{var p=new l.MessageChannel;p.port1.onmessage=m,o=function(){p.port2.postMessage(0)}}var g=[];function m(){var _,v;a=!0;for(var y=g.length;y;){for(v=g,g=[],_=-1;++_<y;)v[_]();y=g.length}a=!1}r.exports=function(_){g.push(_)!==1||a||o()}}).call(this,typeof mi<"u"?mi:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var l=n("immediate");function o(){}var a={},c=["REJECTED"],f=["FULFILLED"],d=["PENDING"];function h(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,y!==o&&_(this,y)}function p(y,w,C){this.promise=y,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function g(y,w,C){l(function(){var x;try{x=w(C)}catch(A){return a.reject(y,A)}x===y?a.reject(y,new TypeError("Cannot resolve promise with itself")):a.resolve(y,x)})}function m(y){var w=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof w=="function")return function(){w.apply(y,arguments)}}function _(y,w){var C=!1;function x(L){C||(C=!0,a.reject(y,L))}function A(L){C||(C=!0,a.resolve(y,L))}var M=v(function(){w(A,x)});M.status==="error"&&x(M.value)}function v(y,w){var C={};try{C.value=y(w),C.status="success"}catch(x){C.status="error",C.value=x}return C}(r.exports=h).prototype.finally=function(y){if(typeof y!="function")return this;var w=this.constructor;return this.then(function(C){return w.resolve(y()).then(function(){return C})},function(C){return w.resolve(y()).then(function(){throw C})})},h.prototype.catch=function(y){return this.then(null,y)},h.prototype.then=function(y,w){if(typeof y!="function"&&this.state===f||typeof w!="function"&&this.state===c)return this;var C=new this.constructor(o);return this.state!==d?g(C,this.state===f?y:w,this.outcome):this.queue.push(new p(C,y,w)),C},p.prototype.callFulfilled=function(y){a.resolve(this.promise,y)},p.prototype.otherCallFulfilled=function(y){g(this.promise,this.onFulfilled,y)},p.prototype.callRejected=function(y){a.reject(this.promise,y)},p.prototype.otherCallRejected=function(y){g(this.promise,this.onRejected,y)},a.resolve=function(y,w){var C=v(m,w);if(C.status==="error")return a.reject(y,C.value);var x=C.value;if(x)_(y,x);else{y.state=f,y.outcome=w;for(var A=-1,M=y.queue.length;++A<M;)y.queue[A].callFulfilled(w)}return y},a.reject=function(y,w){y.state=c,y.outcome=w;for(var C=-1,x=y.queue.length;++C<x;)y.queue[C].callRejected(w);return y},h.resolve=function(y){return y instanceof this?y:a.resolve(new this(o),y)},h.reject=function(y){var w=new this(o);return a.reject(w,y)},h.all=function(y){var w=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=y.length,x=!1;if(!C)return this.resolve([]);for(var A=new Array(C),M=0,L=-1,I=new this(o);++L<C;)P(y[L],L);return I;function P(z,R){w.resolve(z).then(function(T){A[R]=T,++M!==C||x||(x=!0,a.resolve(I,A))},function(T){x||(x=!0,a.reject(I,T))})}},h.race=function(y){var w=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=y.length,x=!1;if(!C)return this.resolve([]);for(var A=-1,M=new this(o);++A<C;)L=y[A],w.resolve(L).then(function(I){x||(x=!0,a.resolve(M,I))},function(I){x||(x=!0,a.reject(M,I))});var L;return M}},{immediate:36}],38:[function(n,r,i){var l={};(0,n("./lib/utils/common").assign)(l,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=l},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var l=n("./zlib/deflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/messages"),f=n("./zlib/zstream"),d=Object.prototype.toString,h=0,p=-1,g=0,m=8;function _(y){if(!(this instanceof _))return new _(y);this.options=o.assign({level:p,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},y||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var C=l.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(C!==h)throw new Error(c[C]);if(w.header&&l.deflateSetHeader(this.strm,w.header),w.dictionary){var x;if(x=typeof w.dictionary=="string"?a.string2buf(w.dictionary):d.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(C=l.deflateSetDictionary(this.strm,x))!==h)throw new Error(c[C]);this._dict_set=!0}}function v(y,w){var C=new _(w);if(C.push(y,!0),C.err)throw C.msg||c[C.err];return C.result}_.prototype.push=function(y,w){var C,x,A=this.strm,M=this.options.chunkSize;if(this.ended)return!1;x=w===~~w?w:w===!0?4:0,typeof y=="string"?A.input=a.string2buf(y):d.call(y)==="[object ArrayBuffer]"?A.input=new Uint8Array(y):A.input=y,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new o.Buf8(M),A.next_out=0,A.avail_out=M),(C=l.deflate(A,x))!==1&&C!==h)return this.onEnd(C),!(this.ended=!0);A.avail_out!==0&&(A.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(o.shrinkBuf(A.output,A.next_out))):this.onData(o.shrinkBuf(A.output,A.next_out)))}while((0<A.avail_in||A.avail_out===0)&&C!==1);return x===4?(C=l.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===h):x!==2||(this.onEnd(h),!(A.avail_out=0))},_.prototype.onData=function(y){this.chunks.push(y)},_.prototype.onEnd=function(y){y===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=y,this.msg=this.strm.msg},i.Deflate=_,i.deflate=v,i.deflateRaw=function(y,w){return(w=w||{}).raw=!0,v(y,w)},i.gzip=function(y,w){return(w=w||{}).gzip=!0,v(y,w)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var l=n("./zlib/inflate"),o=n("./utils/common"),a=n("./utils/strings"),c=n("./zlib/constants"),f=n("./zlib/messages"),d=n("./zlib/zstream"),h=n("./zlib/gzheader"),p=Object.prototype.toString;function g(_){if(!(this instanceof g))return new g(_);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},_||{});var v=this.options;v.raw&&0<=v.windowBits&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),!(0<=v.windowBits&&v.windowBits<16)||_&&_.windowBits||(v.windowBits+=32),15<v.windowBits&&v.windowBits<48&&!(15&v.windowBits)&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var y=l.inflateInit2(this.strm,v.windowBits);if(y!==c.Z_OK)throw new Error(f[y]);this.header=new h,l.inflateGetHeader(this.strm,this.header)}function m(_,v){var y=new g(v);if(y.push(_,!0),y.err)throw y.msg||f[y.err];return y.result}g.prototype.push=function(_,v){var y,w,C,x,A,M,L=this.strm,I=this.options.chunkSize,P=this.options.dictionary,z=!1;if(this.ended)return!1;w=v===~~v?v:v===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof _=="string"?L.input=a.binstring2buf(_):p.call(_)==="[object ArrayBuffer]"?L.input=new Uint8Array(_):L.input=_,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new o.Buf8(I),L.next_out=0,L.avail_out=I),(y=l.inflate(L,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&P&&(M=typeof P=="string"?a.string2buf(P):p.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,y=l.inflateSetDictionary(this.strm,M)),y===c.Z_BUF_ERROR&&z===!0&&(y=c.Z_OK,z=!1),y!==c.Z_STREAM_END&&y!==c.Z_OK)return this.onEnd(y),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&y!==c.Z_STREAM_END&&(L.avail_in!==0||w!==c.Z_FINISH&&w!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=a.utf8border(L.output,L.next_out),x=L.next_out-C,A=a.buf2string(L.output,C),L.next_out=x,L.avail_out=I-x,x&&o.arraySet(L.output,L.output,C,x,0),this.onData(A)):this.onData(o.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(z=!0)}while((0<L.avail_in||L.avail_out===0)&&y!==c.Z_STREAM_END);return y===c.Z_STREAM_END&&(w=c.Z_FINISH),w===c.Z_FINISH?(y=l.inflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===c.Z_OK):w!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(L.avail_out=0))},g.prototype.onData=function(_){this.chunks.push(_)},g.prototype.onEnd=function(_){_===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},i.Inflate=g,i.inflate=m,i.inflateRaw=function(_,v){return(v=v||{}).raw=!0,m(_,v)},i.ungzip=m},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var l=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(c){for(var f=Array.prototype.slice.call(arguments,1);f.length;){var d=f.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var h in d)d.hasOwnProperty(h)&&(c[h]=d[h])}}return c},i.shrinkBuf=function(c,f){return c.length===f?c:c.subarray?c.subarray(0,f):(c.length=f,c)};var o={arraySet:function(c,f,d,h,p){if(f.subarray&&c.subarray)c.set(f.subarray(d,d+h),p);else for(var g=0;g<h;g++)c[p+g]=f[d+g]},flattenChunks:function(c){var f,d,h,p,g,m;for(f=h=0,d=c.length;f<d;f++)h+=c[f].length;for(m=new Uint8Array(h),f=p=0,d=c.length;f<d;f++)g=c[f],m.set(g,p),p+=g.length;return m}},a={arraySet:function(c,f,d,h,p){for(var g=0;g<h;g++)c[p+g]=f[d+g]},flattenChunks:function(c){return[].concat.apply([],c)}};i.setTyped=function(c){c?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,o)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(l)},{}],42:[function(n,r,i){var l=n("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var c=new l.Buf8(256),f=0;f<256;f++)c[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;function d(h,p){if(p<65537&&(h.subarray&&a||!h.subarray&&o))return String.fromCharCode.apply(null,l.shrinkBuf(h,p));for(var g="",m=0;m<p;m++)g+=String.fromCharCode(h[m]);return g}c[254]=c[254]=1,i.string2buf=function(h){var p,g,m,_,v,y=h.length,w=0;for(_=0;_<y;_++)(64512&(g=h.charCodeAt(_)))==55296&&_+1<y&&(64512&(m=h.charCodeAt(_+1)))==56320&&(g=65536+(g-55296<<10)+(m-56320),_++),w+=g<128?1:g<2048?2:g<65536?3:4;for(p=new l.Buf8(w),_=v=0;v<w;_++)(64512&(g=h.charCodeAt(_)))==55296&&_+1<y&&(64512&(m=h.charCodeAt(_+1)))==56320&&(g=65536+(g-55296<<10)+(m-56320),_++),g<128?p[v++]=g:(g<2048?p[v++]=192|g>>>6:(g<65536?p[v++]=224|g>>>12:(p[v++]=240|g>>>18,p[v++]=128|g>>>12&63),p[v++]=128|g>>>6&63),p[v++]=128|63&g);return p},i.buf2binstring=function(h){return d(h,h.length)},i.binstring2buf=function(h){for(var p=new l.Buf8(h.length),g=0,m=p.length;g<m;g++)p[g]=h.charCodeAt(g);return p},i.buf2string=function(h,p){var g,m,_,v,y=p||h.length,w=new Array(2*y);for(g=m=0;g<y;)if((_=h[g++])<128)w[m++]=_;else if(4<(v=c[_]))w[m++]=65533,g+=v-1;else{for(_&=v===2?31:v===3?15:7;1<v&&g<y;)_=_<<6|63&h[g++],v--;1<v?w[m++]=65533:_<65536?w[m++]=_:(_-=65536,w[m++]=55296|_>>10&1023,w[m++]=56320|1023&_)}return d(w,m)},i.utf8border=function(h,p){var g;for((p=p||h.length)>h.length&&(p=h.length),g=p-1;0<=g&&(192&h[g])==128;)g--;return g<0||g===0?p:g+c[h[g]]>p?g:p}},{"./common":41}],43:[function(n,r,i){r.exports=function(l,o,a,c){for(var f=65535&l|0,d=l>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3<a?2e3:a;d=d+(f=f+o[c++]|0)|0,--h;);f%=65521,d%=65521}return f|d<<16|0}},{}],44:[function(n,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,r,i){var l=function(){for(var o,a=[],c=0;c<256;c++){o=c;for(var f=0;f<8;f++)o=1&o?3988292384^o>>>1:o>>>1;a[c]=o}return a}();r.exports=function(o,a,c,f){var d=l,h=f+c;o^=-1;for(var p=f;p<h;p++)o=o>>>8^d[255&(o^a[p])];return-1^o}},{}],46:[function(n,r,i){var l,o=n("../utils/common"),a=n("./trees"),c=n("./adler32"),f=n("./crc32"),d=n("./messages"),h=0,p=4,g=0,m=-2,_=-1,v=4,y=2,w=8,C=9,x=286,A=30,M=19,L=2*x+1,I=15,P=3,z=258,R=z+P+1,T=42,N=113,k=1,j=2,J=3,W=4;function G(S,ie){return S.msg=d[ie],ie}function Z(S){return(S<<1)-(4<S?9:0)}function ne(S){for(var ie=S.length;0<=--ie;)S[ie]=0}function O(S){var ie=S.state,q=ie.pending;q>S.avail_out&&(q=S.avail_out),q!==0&&(o.arraySet(S.output,ie.pending_buf,ie.pending_out,q,S.next_out),S.next_out+=q,ie.pending_out+=q,S.total_out+=q,S.avail_out-=q,ie.pending-=q,ie.pending===0&&(ie.pending_out=0))}function Y(S,ie){a._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,ie),S.block_start=S.strstart,O(S.strm)}function re(S,ie){S.pending_buf[S.pending++]=ie}function K(S,ie){S.pending_buf[S.pending++]=ie>>>8&255,S.pending_buf[S.pending++]=255&ie}function X(S,ie){var q,H,U=S.max_chain_length,V=S.strstart,ae=S.prev_length,ce=S.nice_match,Q=S.strstart>S.w_size-R?S.strstart-(S.w_size-R):0,de=S.window,ge=S.w_mask,he=S.prev,xe=S.strstart+z,Re=de[V+ae-1],we=de[V+ae];S.prev_length>=S.good_match&&(U>>=2),ce>S.lookahead&&(ce=S.lookahead);do if(de[(q=ie)+ae]===we&&de[q+ae-1]===Re&&de[q]===de[V]&&de[++q]===de[V+1]){V+=2,q++;do;while(de[++V]===de[++q]&&de[++V]===de[++q]&&de[++V]===de[++q]&&de[++V]===de[++q]&&de[++V]===de[++q]&&de[++V]===de[++q]&&de[++V]===de[++q]&&de[++V]===de[++q]&&V<xe);if(H=z-(xe-V),V=xe-z,ae<H){if(S.match_start=ie,ce<=(ae=H))break;Re=de[V+ae-1],we=de[V+ae]}}while((ie=he[ie&ge])>Q&&--U!=0);return ae<=S.lookahead?ae:S.lookahead}function fe(S){var ie,q,H,U,V,ae,ce,Q,de,ge,he=S.w_size;do{if(U=S.window_size-S.lookahead-S.strstart,S.strstart>=he+(he-R)){for(o.arraySet(S.window,S.window,he,he,0),S.match_start-=he,S.strstart-=he,S.block_start-=he,ie=q=S.hash_size;H=S.head[--ie],S.head[ie]=he<=H?H-he:0,--q;);for(ie=q=he;H=S.prev[--ie],S.prev[ie]=he<=H?H-he:0,--q;);U+=he}if(S.strm.avail_in===0)break;if(ae=S.strm,ce=S.window,Q=S.strstart+S.lookahead,de=U,ge=void 0,ge=ae.avail_in,de<ge&&(ge=de),q=ge===0?0:(ae.avail_in-=ge,o.arraySet(ce,ae.input,ae.next_in,ge,Q),ae.state.wrap===1?ae.adler=c(ae.adler,ce,ge,Q):ae.state.wrap===2&&(ae.adler=f(ae.adler,ce,ge,Q)),ae.next_in+=ge,ae.total_in+=ge,ge),S.lookahead+=q,S.lookahead+S.insert>=P)for(V=S.strstart-S.insert,S.ins_h=S.window[V],S.ins_h=(S.ins_h<<S.hash_shift^S.window[V+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[V+P-1])&S.hash_mask,S.prev[V&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=V,V++,S.insert--,!(S.lookahead+S.insert<P)););}while(S.lookahead<R&&S.strm.avail_in!==0)}function ye(S,ie){for(var q,H;;){if(S.lookahead<R){if(fe(S),S.lookahead<R&&ie===h)return k;if(S.lookahead===0)break}if(q=0,S.lookahead>=P&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),q!==0&&S.strstart-q<=S.w_size-R&&(S.match_length=X(S,q)),S.match_length>=P)if(H=a._tr_tally(S,S.strstart-S.match_start,S.match_length-P),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=P){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else H=a._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(H&&(Y(S,!1),S.strm.avail_out===0))return k}return S.insert=S.strstart<P-1?S.strstart:P-1,ie===p?(Y(S,!0),S.strm.avail_out===0?J:W):S.last_lit&&(Y(S,!1),S.strm.avail_out===0)?k:j}function Ie(S,ie){for(var q,H,U;;){if(S.lookahead<R){if(fe(S),S.lookahead<R&&ie===h)return k;if(S.lookahead===0)break}if(q=0,S.lookahead>=P&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=P-1,q!==0&&S.prev_length<S.max_lazy_match&&S.strstart-q<=S.w_size-R&&(S.match_length=X(S,q),S.match_length<=5&&(S.strategy===1||S.match_length===P&&4096<S.strstart-S.match_start)&&(S.match_length=P-1)),S.prev_length>=P&&S.match_length<=S.prev_length){for(U=S.strstart+S.lookahead-P,H=a._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-P),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=U&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+P-1])&S.hash_mask,q=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=P-1,S.strstart++,H&&(Y(S,!1),S.strm.avail_out===0))return k}else if(S.match_available){if((H=a._tr_tally(S,0,S.window[S.strstart-1]))&&Y(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return k}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(H=a._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<P-1?S.strstart:P-1,ie===p?(Y(S,!0),S.strm.avail_out===0?J:W):S.last_lit&&(Y(S,!1),S.strm.avail_out===0)?k:j}function le(S,ie,q,H,U){this.good_length=S,this.max_lazy=ie,this.nice_length=q,this.max_chain=H,this.func=U}function ve(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=w,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new o.Buf16(2*L),this.dyn_dtree=new o.Buf16(2*(2*A+1)),this.bl_tree=new o.Buf16(2*(2*M+1)),ne(this.dyn_ltree),ne(this.dyn_dtree),ne(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new o.Buf16(I+1),this.heap=new o.Buf16(2*x+1),ne(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new o.Buf16(2*x+1),ne(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function se(S){var ie;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=y,(ie=S.state).pending=0,ie.pending_out=0,ie.wrap<0&&(ie.wrap=-ie.wrap),ie.status=ie.wrap?T:N,S.adler=ie.wrap===2?0:1,ie.last_flush=h,a._tr_init(ie),g):G(S,m)}function te(S){var ie=se(S);return ie===g&&function(q){q.window_size=2*q.w_size,ne(q.head),q.max_lazy_match=l[q.level].max_lazy,q.good_match=l[q.level].good_length,q.nice_match=l[q.level].nice_length,q.max_chain_length=l[q.level].max_chain,q.strstart=0,q.block_start=0,q.lookahead=0,q.insert=0,q.match_length=q.prev_length=P-1,q.match_available=0,q.ins_h=0}(S.state),ie}function Se(S,ie,q,H,U,V){if(!S)return m;var ae=1;if(ie===_&&(ie=6),H<0?(ae=0,H=-H):15<H&&(ae=2,H-=16),U<1||C<U||q!==w||H<8||15<H||ie<0||9<ie||V<0||v<V)return G(S,m);H===8&&(H=9);var ce=new ve;return(S.state=ce).strm=S,ce.wrap=ae,ce.gzhead=null,ce.w_bits=H,ce.w_size=1<<ce.w_bits,ce.w_mask=ce.w_size-1,ce.hash_bits=U+7,ce.hash_size=1<<ce.hash_bits,ce.hash_mask=ce.hash_size-1,ce.hash_shift=~~((ce.hash_bits+P-1)/P),ce.window=new o.Buf8(2*ce.w_size),ce.head=new o.Buf16(ce.hash_size),ce.prev=new o.Buf16(ce.w_size),ce.lit_bufsize=1<<U+6,ce.pending_buf_size=4*ce.lit_bufsize,ce.pending_buf=new o.Buf8(ce.pending_buf_size),ce.d_buf=1*ce.lit_bufsize,ce.l_buf=3*ce.lit_bufsize,ce.level=ie,ce.strategy=V,ce.method=q,te(S)}l=[new le(0,0,0,0,function(S,ie){var q=65535;for(q>S.pending_buf_size-5&&(q=S.pending_buf_size-5);;){if(S.lookahead<=1){if(fe(S),S.lookahead===0&&ie===h)return k;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var H=S.block_start+q;if((S.strstart===0||S.strstart>=H)&&(S.lookahead=S.strstart-H,S.strstart=H,Y(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-R&&(Y(S,!1),S.strm.avail_out===0))return k}return S.insert=0,ie===p?(Y(S,!0),S.strm.avail_out===0?J:W):(S.strstart>S.block_start&&(Y(S,!1),S.strm.avail_out),k)}),new le(4,4,8,4,ye),new le(4,5,16,8,ye),new le(4,6,32,32,ye),new le(4,4,16,16,Ie),new le(8,16,32,32,Ie),new le(8,16,128,128,Ie),new le(8,32,128,256,Ie),new le(32,128,258,1024,Ie),new le(32,258,258,4096,Ie)],i.deflateInit=function(S,ie){return Se(S,ie,w,15,8,0)},i.deflateInit2=Se,i.deflateReset=te,i.deflateResetKeep=se,i.deflateSetHeader=function(S,ie){return S&&S.state?S.state.wrap!==2?m:(S.state.gzhead=ie,g):m},i.deflate=function(S,ie){var q,H,U,V;if(!S||!S.state||5<ie||ie<0)return S?G(S,m):m;if(H=S.state,!S.output||!S.input&&S.avail_in!==0||H.status===666&&ie!==p)return G(S,S.avail_out===0?-5:m);if(H.strm=S,q=H.last_flush,H.last_flush=ie,H.status===T)if(H.wrap===2)S.adler=0,re(H,31),re(H,139),re(H,8),H.gzhead?(re(H,(H.gzhead.text?1:0)+(H.gzhead.hcrc?2:0)+(H.gzhead.extra?4:0)+(H.gzhead.name?8:0)+(H.gzhead.comment?16:0)),re(H,255&H.gzhead.time),re(H,H.gzhead.time>>8&255),re(H,H.gzhead.time>>16&255),re(H,H.gzhead.time>>24&255),re(H,H.level===9?2:2<=H.strategy||H.level<2?4:0),re(H,255&H.gzhead.os),H.gzhead.extra&&H.gzhead.extra.length&&(re(H,255&H.gzhead.extra.length),re(H,H.gzhead.extra.length>>8&255)),H.gzhead.hcrc&&(S.adler=f(S.adler,H.pending_buf,H.pending,0)),H.gzindex=0,H.status=69):(re(H,0),re(H,0),re(H,0),re(H,0),re(H,0),re(H,H.level===9?2:2<=H.strategy||H.level<2?4:0),re(H,3),H.status=N);else{var ae=w+(H.w_bits-8<<4)<<8;ae|=(2<=H.strategy||H.level<2?0:H.level<6?1:H.level===6?2:3)<<6,H.strstart!==0&&(ae|=32),ae+=31-ae%31,H.status=N,K(H,ae),H.strstart!==0&&(K(H,S.adler>>>16),K(H,65535&S.adler)),S.adler=1}if(H.status===69)if(H.gzhead.extra){for(U=H.pending;H.gzindex<(65535&H.gzhead.extra.length)&&(H.pending!==H.pending_buf_size||(H.gzhead.hcrc&&H.pending>U&&(S.adler=f(S.adler,H.pending_buf,H.pending-U,U)),O(S),U=H.pending,H.pending!==H.pending_buf_size));)re(H,255&H.gzhead.extra[H.gzindex]),H.gzindex++;H.gzhead.hcrc&&H.pending>U&&(S.adler=f(S.adler,H.pending_buf,H.pending-U,U)),H.gzindex===H.gzhead.extra.length&&(H.gzindex=0,H.status=73)}else H.status=73;if(H.status===73)if(H.gzhead.name){U=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>U&&(S.adler=f(S.adler,H.pending_buf,H.pending-U,U)),O(S),U=H.pending,H.pending===H.pending_buf_size)){V=1;break}V=H.gzindex<H.gzhead.name.length?255&H.gzhead.name.charCodeAt(H.gzindex++):0,re(H,V)}while(V!==0);H.gzhead.hcrc&&H.pending>U&&(S.adler=f(S.adler,H.pending_buf,H.pending-U,U)),V===0&&(H.gzindex=0,H.status=91)}else H.status=91;if(H.status===91)if(H.gzhead.comment){U=H.pending;do{if(H.pending===H.pending_buf_size&&(H.gzhead.hcrc&&H.pending>U&&(S.adler=f(S.adler,H.pending_buf,H.pending-U,U)),O(S),U=H.pending,H.pending===H.pending_buf_size)){V=1;break}V=H.gzindex<H.gzhead.comment.length?255&H.gzhead.comment.charCodeAt(H.gzindex++):0,re(H,V)}while(V!==0);H.gzhead.hcrc&&H.pending>U&&(S.adler=f(S.adler,H.pending_buf,H.pending-U,U)),V===0&&(H.status=103)}else H.status=103;if(H.status===103&&(H.gzhead.hcrc?(H.pending+2>H.pending_buf_size&&O(S),H.pending+2<=H.pending_buf_size&&(re(H,255&S.adler),re(H,S.adler>>8&255),S.adler=0,H.status=N)):H.status=N),H.pending!==0){if(O(S),S.avail_out===0)return H.last_flush=-1,g}else if(S.avail_in===0&&Z(ie)<=Z(q)&&ie!==p)return G(S,-5);if(H.status===666&&S.avail_in!==0)return G(S,-5);if(S.avail_in!==0||H.lookahead!==0||ie!==h&&H.status!==666){var ce=H.strategy===2?function(Q,de){for(var ge;;){if(Q.lookahead===0&&(fe(Q),Q.lookahead===0)){if(de===h)return k;break}if(Q.match_length=0,ge=a._tr_tally(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++,ge&&(Y(Q,!1),Q.strm.avail_out===0))return k}return Q.insert=0,de===p?(Y(Q,!0),Q.strm.avail_out===0?J:W):Q.last_lit&&(Y(Q,!1),Q.strm.avail_out===0)?k:j}(H,ie):H.strategy===3?function(Q,de){for(var ge,he,xe,Re,we=Q.window;;){if(Q.lookahead<=z){if(fe(Q),Q.lookahead<=z&&de===h)return k;if(Q.lookahead===0)break}if(Q.match_length=0,Q.lookahead>=P&&0<Q.strstart&&(he=we[xe=Q.strstart-1])===we[++xe]&&he===we[++xe]&&he===we[++xe]){Re=Q.strstart+z;do;while(he===we[++xe]&&he===we[++xe]&&he===we[++xe]&&he===we[++xe]&&he===we[++xe]&&he===we[++xe]&&he===we[++xe]&&he===we[++xe]&&xe<Re);Q.match_length=z-(Re-xe),Q.match_length>Q.lookahead&&(Q.match_length=Q.lookahead)}if(Q.match_length>=P?(ge=a._tr_tally(Q,1,Q.match_length-P),Q.lookahead-=Q.match_length,Q.strstart+=Q.match_length,Q.match_length=0):(ge=a._tr_tally(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++),ge&&(Y(Q,!1),Q.strm.avail_out===0))return k}return Q.insert=0,de===p?(Y(Q,!0),Q.strm.avail_out===0?J:W):Q.last_lit&&(Y(Q,!1),Q.strm.avail_out===0)?k:j}(H,ie):l[H.level].func(H,ie);if(ce!==J&&ce!==W||(H.status=666),ce===k||ce===J)return S.avail_out===0&&(H.last_flush=-1),g;if(ce===j&&(ie===1?a._tr_align(H):ie!==5&&(a._tr_stored_block(H,0,0,!1),ie===3&&(ne(H.head),H.lookahead===0&&(H.strstart=0,H.block_start=0,H.insert=0))),O(S),S.avail_out===0))return H.last_flush=-1,g}return ie!==p?g:H.wrap<=0?1:(H.wrap===2?(re(H,255&S.adler),re(H,S.adler>>8&255),re(H,S.adler>>16&255),re(H,S.adler>>24&255),re(H,255&S.total_in),re(H,S.total_in>>8&255),re(H,S.total_in>>16&255),re(H,S.total_in>>24&255)):(K(H,S.adler>>>16),K(H,65535&S.adler)),O(S),0<H.wrap&&(H.wrap=-H.wrap),H.pending!==0?g:1)},i.deflateEnd=function(S){var ie;return S&&S.state?(ie=S.state.status)!==T&&ie!==69&&ie!==73&&ie!==91&&ie!==103&&ie!==N&&ie!==666?G(S,m):(S.state=null,ie===N?G(S,-3):g):m},i.deflateSetDictionary=function(S,ie){var q,H,U,V,ae,ce,Q,de,ge=ie.length;if(!S||!S.state||(V=(q=S.state).wrap)===2||V===1&&q.status!==T||q.lookahead)return m;for(V===1&&(S.adler=c(S.adler,ie,ge,0)),q.wrap=0,ge>=q.w_size&&(V===0&&(ne(q.head),q.strstart=0,q.block_start=0,q.insert=0),de=new o.Buf8(q.w_size),o.arraySet(de,ie,ge-q.w_size,q.w_size,0),ie=de,ge=q.w_size),ae=S.avail_in,ce=S.next_in,Q=S.input,S.avail_in=ge,S.next_in=0,S.input=ie,fe(q);q.lookahead>=P;){for(H=q.strstart,U=q.lookahead-(P-1);q.ins_h=(q.ins_h<<q.hash_shift^q.window[H+P-1])&q.hash_mask,q.prev[H&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=H,H++,--U;);q.strstart=H,q.lookahead=P-1,fe(q)}return q.strstart+=q.lookahead,q.block_start=q.strstart,q.insert=q.lookahead,q.lookahead=0,q.match_length=q.prev_length=P-1,q.match_available=0,S.next_in=ce,S.input=Q,S.avail_in=ae,q.wrap=V,g},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,r,i){r.exports=function(l,o){var a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k,j;a=l.state,c=l.next_in,k=l.input,f=c+(l.avail_in-5),d=l.next_out,j=l.output,h=d-(o-l.avail_out),p=d+(l.avail_out-257),g=a.dmax,m=a.wsize,_=a.whave,v=a.wnext,y=a.window,w=a.hold,C=a.bits,x=a.lencode,A=a.distcode,M=(1<<a.lenbits)-1,L=(1<<a.distbits)-1;e:do{C<15&&(w+=k[c++]<<C,C+=8,w+=k[c++]<<C,C+=8),I=x[w&M];t:for(;;){if(w>>>=P=I>>>24,C-=P,(P=I>>>16&255)===0)j[d++]=65535&I;else{if(!(16&P)){if(!(64&P)){I=x[(65535&I)+(w&(1<<P)-1)];continue t}if(32&P){a.mode=12;break e}l.msg="invalid literal/length code",a.mode=30;break e}z=65535&I,(P&=15)&&(C<P&&(w+=k[c++]<<C,C+=8),z+=w&(1<<P)-1,w>>>=P,C-=P),C<15&&(w+=k[c++]<<C,C+=8,w+=k[c++]<<C,C+=8),I=A[w&L];n:for(;;){if(w>>>=P=I>>>24,C-=P,!(16&(P=I>>>16&255))){if(!(64&P)){I=A[(65535&I)+(w&(1<<P)-1)];continue n}l.msg="invalid distance code",a.mode=30;break e}if(R=65535&I,C<(P&=15)&&(w+=k[c++]<<C,(C+=8)<P&&(w+=k[c++]<<C,C+=8)),g<(R+=w&(1<<P)-1)){l.msg="invalid distance too far back",a.mode=30;break e}if(w>>>=P,C-=P,(P=d-h)<R){if(_<(P=R-P)&&a.sane){l.msg="invalid distance too far back",a.mode=30;break e}if(N=y,(T=0)===v){if(T+=m-P,P<z){for(z-=P;j[d++]=y[T++],--P;);T=d-R,N=j}}else if(v<P){if(T+=m+v-P,(P-=v)<z){for(z-=P;j[d++]=y[T++],--P;);if(T=0,v<z){for(z-=P=v;j[d++]=y[T++],--P;);T=d-R,N=j}}}else if(T+=v-P,P<z){for(z-=P;j[d++]=y[T++],--P;);T=d-R,N=j}for(;2<z;)j[d++]=N[T++],j[d++]=N[T++],j[d++]=N[T++],z-=3;z&&(j[d++]=N[T++],1<z&&(j[d++]=N[T++]))}else{for(T=d-R;j[d++]=j[T++],j[d++]=j[T++],j[d++]=j[T++],2<(z-=3););z&&(j[d++]=j[T++],1<z&&(j[d++]=j[T++]))}break}}break}}while(c<f&&d<p);c-=z=C>>3,w&=(1<<(C-=z<<3))-1,l.next_in=c,l.next_out=d,l.avail_in=c<f?f-c+5:5-(c-f),l.avail_out=d<p?p-d+257:257-(d-p),a.hold=w,a.bits=C}},{}],49:[function(n,r,i){var l=n("../utils/common"),o=n("./adler32"),a=n("./crc32"),c=n("./inffast"),f=n("./inftrees"),d=1,h=2,p=0,g=-2,m=1,_=852,v=592;function y(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function w(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new l.Buf16(320),this.work=new l.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(T){var N;return T&&T.state?(N=T.state,T.total_in=T.total_out=N.total=0,T.msg="",N.wrap&&(T.adler=1&N.wrap),N.mode=m,N.last=0,N.havedict=0,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new l.Buf32(_),N.distcode=N.distdyn=new l.Buf32(v),N.sane=1,N.back=-1,p):g}function x(T){var N;return T&&T.state?((N=T.state).wsize=0,N.whave=0,N.wnext=0,C(T)):g}function A(T,N){var k,j;return T&&T.state?(j=T.state,N<0?(k=0,N=-N):(k=1+(N>>4),N<48&&(N&=15)),N&&(N<8||15<N)?g:(j.window!==null&&j.wbits!==N&&(j.window=null),j.wrap=k,j.wbits=N,x(T))):g}function M(T,N){var k,j;return T?(j=new w,(T.state=j).window=null,(k=A(T,N))!==p&&(T.state=null),k):g}var L,I,P=!0;function z(T){if(P){var N;for(L=new l.Buf32(512),I=new l.Buf32(32),N=0;N<144;)T.lens[N++]=8;for(;N<256;)T.lens[N++]=9;for(;N<280;)T.lens[N++]=7;for(;N<288;)T.lens[N++]=8;for(f(d,T.lens,0,288,L,0,T.work,{bits:9}),N=0;N<32;)T.lens[N++]=5;f(h,T.lens,0,32,I,0,T.work,{bits:5}),P=!1}T.lencode=L,T.lenbits=9,T.distcode=I,T.distbits=5}function R(T,N,k,j){var J,W=T.state;return W.window===null&&(W.wsize=1<<W.wbits,W.wnext=0,W.whave=0,W.window=new l.Buf8(W.wsize)),j>=W.wsize?(l.arraySet(W.window,N,k-W.wsize,W.wsize,0),W.wnext=0,W.whave=W.wsize):(j<(J=W.wsize-W.wnext)&&(J=j),l.arraySet(W.window,N,k-j,J,W.wnext),(j-=J)?(l.arraySet(W.window,N,k-j,j,0),W.wnext=j,W.whave=W.wsize):(W.wnext+=J,W.wnext===W.wsize&&(W.wnext=0),W.whave<W.wsize&&(W.whave+=J))),0}i.inflateReset=x,i.inflateReset2=A,i.inflateResetKeep=C,i.inflateInit=function(T){return M(T,15)},i.inflateInit2=M,i.inflate=function(T,N){var k,j,J,W,G,Z,ne,O,Y,re,K,X,fe,ye,Ie,le,ve,se,te,Se,S,ie,q,H,U=0,V=new l.Buf8(4),ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return g;(k=T.state).mode===12&&(k.mode=13),G=T.next_out,J=T.output,ne=T.avail_out,W=T.next_in,j=T.input,Z=T.avail_in,O=k.hold,Y=k.bits,re=Z,K=ne,ie=p;e:for(;;)switch(k.mode){case m:if(k.wrap===0){k.mode=13;break}for(;Y<16;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(2&k.wrap&&O===35615){V[k.check=0]=255&O,V[1]=O>>>8&255,k.check=a(k.check,V,2,0),Y=O=0,k.mode=2;break}if(k.flags=0,k.head&&(k.head.done=!1),!(1&k.wrap)||(((255&O)<<8)+(O>>8))%31){T.msg="incorrect header check",k.mode=30;break}if((15&O)!=8){T.msg="unknown compression method",k.mode=30;break}if(Y-=4,S=8+(15&(O>>>=4)),k.wbits===0)k.wbits=S;else if(S>k.wbits){T.msg="invalid window size",k.mode=30;break}k.dmax=1<<S,T.adler=k.check=1,k.mode=512&O?10:12,Y=O=0;break;case 2:for(;Y<16;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(k.flags=O,(255&k.flags)!=8){T.msg="unknown compression method",k.mode=30;break}if(57344&k.flags){T.msg="unknown header flags set",k.mode=30;break}k.head&&(k.head.text=O>>8&1),512&k.flags&&(V[0]=255&O,V[1]=O>>>8&255,k.check=a(k.check,V,2,0)),Y=O=0,k.mode=3;case 3:for(;Y<32;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}k.head&&(k.head.time=O),512&k.flags&&(V[0]=255&O,V[1]=O>>>8&255,V[2]=O>>>16&255,V[3]=O>>>24&255,k.check=a(k.check,V,4,0)),Y=O=0,k.mode=4;case 4:for(;Y<16;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}k.head&&(k.head.xflags=255&O,k.head.os=O>>8),512&k.flags&&(V[0]=255&O,V[1]=O>>>8&255,k.check=a(k.check,V,2,0)),Y=O=0,k.mode=5;case 5:if(1024&k.flags){for(;Y<16;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}k.length=O,k.head&&(k.head.extra_len=O),512&k.flags&&(V[0]=255&O,V[1]=O>>>8&255,k.check=a(k.check,V,2,0)),Y=O=0}else k.head&&(k.head.extra=null);k.mode=6;case 6:if(1024&k.flags&&(Z<(X=k.length)&&(X=Z),X&&(k.head&&(S=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Array(k.head.extra_len)),l.arraySet(k.head.extra,j,W,X,S)),512&k.flags&&(k.check=a(k.check,j,X,W)),Z-=X,W+=X,k.length-=X),k.length))break e;k.length=0,k.mode=7;case 7:if(2048&k.flags){if(Z===0)break e;for(X=0;S=j[W+X++],k.head&&S&&k.length<65536&&(k.head.name+=String.fromCharCode(S)),S&&X<Z;);if(512&k.flags&&(k.check=a(k.check,j,X,W)),Z-=X,W+=X,S)break e}else k.head&&(k.head.name=null);k.length=0,k.mode=8;case 8:if(4096&k.flags){if(Z===0)break e;for(X=0;S=j[W+X++],k.head&&S&&k.length<65536&&(k.head.comment+=String.fromCharCode(S)),S&&X<Z;);if(512&k.flags&&(k.check=a(k.check,j,X,W)),Z-=X,W+=X,S)break e}else k.head&&(k.head.comment=null);k.mode=9;case 9:if(512&k.flags){for(;Y<16;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(O!==(65535&k.check)){T.msg="header crc mismatch",k.mode=30;break}Y=O=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),T.adler=k.check=0,k.mode=12;break;case 10:for(;Y<32;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}T.adler=k.check=y(O),Y=O=0,k.mode=11;case 11:if(k.havedict===0)return T.next_out=G,T.avail_out=ne,T.next_in=W,T.avail_in=Z,k.hold=O,k.bits=Y,2;T.adler=k.check=1,k.mode=12;case 12:if(N===5||N===6)break e;case 13:if(k.last){O>>>=7&Y,Y-=7&Y,k.mode=27;break}for(;Y<3;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}switch(k.last=1&O,Y-=1,3&(O>>>=1)){case 0:k.mode=14;break;case 1:if(z(k),k.mode=20,N!==6)break;O>>>=2,Y-=2;break e;case 2:k.mode=17;break;case 3:T.msg="invalid block type",k.mode=30}O>>>=2,Y-=2;break;case 14:for(O>>>=7&Y,Y-=7&Y;Y<32;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if((65535&O)!=(O>>>16^65535)){T.msg="invalid stored block lengths",k.mode=30;break}if(k.length=65535&O,Y=O=0,k.mode=15,N===6)break e;case 15:k.mode=16;case 16:if(X=k.length){if(Z<X&&(X=Z),ne<X&&(X=ne),X===0)break e;l.arraySet(J,j,W,X,G),Z-=X,W+=X,ne-=X,G+=X,k.length-=X;break}k.mode=12;break;case 17:for(;Y<14;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(k.nlen=257+(31&O),O>>>=5,Y-=5,k.ndist=1+(31&O),O>>>=5,Y-=5,k.ncode=4+(15&O),O>>>=4,Y-=4,286<k.nlen||30<k.ndist){T.msg="too many length or distance symbols",k.mode=30;break}k.have=0,k.mode=18;case 18:for(;k.have<k.ncode;){for(;Y<3;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}k.lens[ae[k.have++]]=7&O,O>>>=3,Y-=3}for(;k.have<19;)k.lens[ae[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,q={bits:k.lenbits},ie=f(0,k.lens,0,19,k.lencode,0,k.work,q),k.lenbits=q.bits,ie){T.msg="invalid code lengths set",k.mode=30;break}k.have=0,k.mode=19;case 19:for(;k.have<k.nlen+k.ndist;){for(;le=(U=k.lencode[O&(1<<k.lenbits)-1])>>>16&255,ve=65535&U,!((Ie=U>>>24)<=Y);){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(ve<16)O>>>=Ie,Y-=Ie,k.lens[k.have++]=ve;else{if(ve===16){for(H=Ie+2;Y<H;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(O>>>=Ie,Y-=Ie,k.have===0){T.msg="invalid bit length repeat",k.mode=30;break}S=k.lens[k.have-1],X=3+(3&O),O>>>=2,Y-=2}else if(ve===17){for(H=Ie+3;Y<H;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}Y-=Ie,S=0,X=3+(7&(O>>>=Ie)),O>>>=3,Y-=3}else{for(H=Ie+7;Y<H;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}Y-=Ie,S=0,X=11+(127&(O>>>=Ie)),O>>>=7,Y-=7}if(k.have+X>k.nlen+k.ndist){T.msg="invalid bit length repeat",k.mode=30;break}for(;X--;)k.lens[k.have++]=S}}if(k.mode===30)break;if(k.lens[256]===0){T.msg="invalid code -- missing end-of-block",k.mode=30;break}if(k.lenbits=9,q={bits:k.lenbits},ie=f(d,k.lens,0,k.nlen,k.lencode,0,k.work,q),k.lenbits=q.bits,ie){T.msg="invalid literal/lengths set",k.mode=30;break}if(k.distbits=6,k.distcode=k.distdyn,q={bits:k.distbits},ie=f(h,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,q),k.distbits=q.bits,ie){T.msg="invalid distances set",k.mode=30;break}if(k.mode=20,N===6)break e;case 20:k.mode=21;case 21:if(6<=Z&&258<=ne){T.next_out=G,T.avail_out=ne,T.next_in=W,T.avail_in=Z,k.hold=O,k.bits=Y,c(T,K),G=T.next_out,J=T.output,ne=T.avail_out,W=T.next_in,j=T.input,Z=T.avail_in,O=k.hold,Y=k.bits,k.mode===12&&(k.back=-1);break}for(k.back=0;le=(U=k.lencode[O&(1<<k.lenbits)-1])>>>16&255,ve=65535&U,!((Ie=U>>>24)<=Y);){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(le&&!(240&le)){for(se=Ie,te=le,Se=ve;le=(U=k.lencode[Se+((O&(1<<se+te)-1)>>se)])>>>16&255,ve=65535&U,!(se+(Ie=U>>>24)<=Y);){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}O>>>=se,Y-=se,k.back+=se}if(O>>>=Ie,Y-=Ie,k.back+=Ie,k.length=ve,le===0){k.mode=26;break}if(32&le){k.back=-1,k.mode=12;break}if(64&le){T.msg="invalid literal/length code",k.mode=30;break}k.extra=15&le,k.mode=22;case 22:if(k.extra){for(H=k.extra;Y<H;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}k.length+=O&(1<<k.extra)-1,O>>>=k.extra,Y-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=23;case 23:for(;le=(U=k.distcode[O&(1<<k.distbits)-1])>>>16&255,ve=65535&U,!((Ie=U>>>24)<=Y);){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(!(240&le)){for(se=Ie,te=le,Se=ve;le=(U=k.distcode[Se+((O&(1<<se+te)-1)>>se)])>>>16&255,ve=65535&U,!(se+(Ie=U>>>24)<=Y);){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}O>>>=se,Y-=se,k.back+=se}if(O>>>=Ie,Y-=Ie,k.back+=Ie,64&le){T.msg="invalid distance code",k.mode=30;break}k.offset=ve,k.extra=15&le,k.mode=24;case 24:if(k.extra){for(H=k.extra;Y<H;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}k.offset+=O&(1<<k.extra)-1,O>>>=k.extra,Y-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){T.msg="invalid distance too far back",k.mode=30;break}k.mode=25;case 25:if(ne===0)break e;if(X=K-ne,k.offset>X){if((X=k.offset-X)>k.whave&&k.sane){T.msg="invalid distance too far back",k.mode=30;break}fe=X>k.wnext?(X-=k.wnext,k.wsize-X):k.wnext-X,X>k.length&&(X=k.length),ye=k.window}else ye=J,fe=G-k.offset,X=k.length;for(ne<X&&(X=ne),ne-=X,k.length-=X;J[G++]=ye[fe++],--X;);k.length===0&&(k.mode=21);break;case 26:if(ne===0)break e;J[G++]=k.length,ne--,k.mode=21;break;case 27:if(k.wrap){for(;Y<32;){if(Z===0)break e;Z--,O|=j[W++]<<Y,Y+=8}if(K-=ne,T.total_out+=K,k.total+=K,K&&(T.adler=k.check=k.flags?a(k.check,J,K,G-K):o(k.check,J,K,G-K)),K=ne,(k.flags?O:y(O))!==k.check){T.msg="incorrect data check",k.mode=30;break}Y=O=0}k.mode=28;case 28:if(k.wrap&&k.flags){for(;Y<32;){if(Z===0)break e;Z--,O+=j[W++]<<Y,Y+=8}if(O!==(4294967295&k.total)){T.msg="incorrect length check",k.mode=30;break}Y=O=0}k.mode=29;case 29:ie=1;break e;case 30:ie=-3;break e;case 31:return-4;case 32:default:return g}return T.next_out=G,T.avail_out=ne,T.next_in=W,T.avail_in=Z,k.hold=O,k.bits=Y,(k.wsize||K!==T.avail_out&&k.mode<30&&(k.mode<27||N!==4))&&R(T,T.output,T.next_out,K-T.avail_out)?(k.mode=31,-4):(re-=T.avail_in,K-=T.avail_out,T.total_in+=re,T.total_out+=K,k.total+=K,k.wrap&&K&&(T.adler=k.check=k.flags?a(k.check,J,K,T.next_out-K):o(k.check,J,K,T.next_out-K)),T.data_type=k.bits+(k.last?64:0)+(k.mode===12?128:0)+(k.mode===20||k.mode===15?256:0),(re==0&&K===0||N===4)&&ie===p&&(ie=-5),ie)},i.inflateEnd=function(T){if(!T||!T.state)return g;var N=T.state;return N.window&&(N.window=null),T.state=null,p},i.inflateGetHeader=function(T,N){var k;return T&&T.state&&2&(k=T.state).wrap?((k.head=N).done=!1,p):g},i.inflateSetDictionary=function(T,N){var k,j=N.length;return T&&T.state?(k=T.state).wrap!==0&&k.mode!==11?g:k.mode===11&&o(1,N,j,0)!==k.check?-3:R(T,N,j,j)?(k.mode=31,-4):(k.havedict=1,p):g},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var l=n("../utils/common"),o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,h,p,g,m,_,v,y){var w,C,x,A,M,L,I,P,z,R=y.bits,T=0,N=0,k=0,j=0,J=0,W=0,G=0,Z=0,ne=0,O=0,Y=null,re=0,K=new l.Buf16(16),X=new l.Buf16(16),fe=null,ye=0;for(T=0;T<=15;T++)K[T]=0;for(N=0;N<g;N++)K[h[p+N]]++;for(J=R,j=15;1<=j&&K[j]===0;j--);if(j<J&&(J=j),j===0)return m[_++]=20971520,m[_++]=20971520,y.bits=1,0;for(k=1;k<j&&K[k]===0;k++);for(J<k&&(J=k),T=Z=1;T<=15;T++)if(Z<<=1,(Z-=K[T])<0)return-1;if(0<Z&&(d===0||j!==1))return-1;for(X[1]=0,T=1;T<15;T++)X[T+1]=X[T]+K[T];for(N=0;N<g;N++)h[p+N]!==0&&(v[X[h[p+N]]++]=N);if(L=d===0?(Y=fe=v,19):d===1?(Y=o,re-=257,fe=a,ye-=257,256):(Y=c,fe=f,-1),T=k,M=_,G=N=O=0,x=-1,A=(ne=1<<(W=J))-1,d===1&&852<ne||d===2&&592<ne)return 1;for(;;){for(I=T-G,z=v[N]<L?(P=0,v[N]):v[N]>L?(P=fe[ye+v[N]],Y[re+v[N]]):(P=96,0),w=1<<T-G,k=C=1<<W;m[M+(O>>G)+(C-=w)]=I<<24|P<<16|z|0,C!==0;);for(w=1<<T-1;O&w;)w>>=1;if(w!==0?(O&=w-1,O+=w):O=0,N++,--K[T]==0){if(T===j)break;T=h[p+v[N]]}if(J<T&&(O&A)!==x){for(G===0&&(G=J),M+=k,Z=1<<(W=T-G);W+G<j&&!((Z-=K[W+G])<=0);)W++,Z<<=1;if(ne+=1<<W,d===1&&852<ne||d===2&&592<ne)return 1;m[x=O&A]=J<<24|W<<16|M-_|0}}return O!==0&&(m[M+O]=T-G<<24|64<<16|0),y.bits=J,0}},{"../utils/common":41}],51:[function(n,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,r,i){var l=n("../utils/common"),o=0,a=1;function c(U){for(var V=U.length;0<=--V;)U[V]=0}var f=0,d=29,h=256,p=h+1+d,g=30,m=19,_=2*p+1,v=15,y=16,w=7,C=256,x=16,A=17,M=18,L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=new Array(2*(p+2));c(R);var T=new Array(2*g);c(T);var N=new Array(512);c(N);var k=new Array(256);c(k);var j=new Array(d);c(j);var J,W,G,Z=new Array(g);function ne(U,V,ae,ce,Q){this.static_tree=U,this.extra_bits=V,this.extra_base=ae,this.elems=ce,this.max_length=Q,this.has_stree=U&&U.length}function O(U,V){this.dyn_tree=U,this.max_code=0,this.stat_desc=V}function Y(U){return U<256?N[U]:N[256+(U>>>7)]}function re(U,V){U.pending_buf[U.pending++]=255&V,U.pending_buf[U.pending++]=V>>>8&255}function K(U,V,ae){U.bi_valid>y-ae?(U.bi_buf|=V<<U.bi_valid&65535,re(U,U.bi_buf),U.bi_buf=V>>y-U.bi_valid,U.bi_valid+=ae-y):(U.bi_buf|=V<<U.bi_valid&65535,U.bi_valid+=ae)}function X(U,V,ae){K(U,ae[2*V],ae[2*V+1])}function fe(U,V){for(var ae=0;ae|=1&U,U>>>=1,ae<<=1,0<--V;);return ae>>>1}function ye(U,V,ae){var ce,Q,de=new Array(v+1),ge=0;for(ce=1;ce<=v;ce++)de[ce]=ge=ge+ae[ce-1]<<1;for(Q=0;Q<=V;Q++){var he=U[2*Q+1];he!==0&&(U[2*Q]=fe(de[he]++,he))}}function Ie(U){var V;for(V=0;V<p;V++)U.dyn_ltree[2*V]=0;for(V=0;V<g;V++)U.dyn_dtree[2*V]=0;for(V=0;V<m;V++)U.bl_tree[2*V]=0;U.dyn_ltree[2*C]=1,U.opt_len=U.static_len=0,U.last_lit=U.matches=0}function le(U){8<U.bi_valid?re(U,U.bi_buf):0<U.bi_valid&&(U.pending_buf[U.pending++]=U.bi_buf),U.bi_buf=0,U.bi_valid=0}function ve(U,V,ae,ce){var Q=2*V,de=2*ae;return U[Q]<U[de]||U[Q]===U[de]&&ce[V]<=ce[ae]}function se(U,V,ae){for(var ce=U.heap[ae],Q=ae<<1;Q<=U.heap_len&&(Q<U.heap_len&&ve(V,U.heap[Q+1],U.heap[Q],U.depth)&&Q++,!ve(V,ce,U.heap[Q],U.depth));)U.heap[ae]=U.heap[Q],ae=Q,Q<<=1;U.heap[ae]=ce}function te(U,V,ae){var ce,Q,de,ge,he=0;if(U.last_lit!==0)for(;ce=U.pending_buf[U.d_buf+2*he]<<8|U.pending_buf[U.d_buf+2*he+1],Q=U.pending_buf[U.l_buf+he],he++,ce===0?X(U,Q,V):(X(U,(de=k[Q])+h+1,V),(ge=L[de])!==0&&K(U,Q-=j[de],ge),X(U,de=Y(--ce),ae),(ge=I[de])!==0&&K(U,ce-=Z[de],ge)),he<U.last_lit;);X(U,C,V)}function Se(U,V){var ae,ce,Q,de=V.dyn_tree,ge=V.stat_desc.static_tree,he=V.stat_desc.has_stree,xe=V.stat_desc.elems,Re=-1;for(U.heap_len=0,U.heap_max=_,ae=0;ae<xe;ae++)de[2*ae]!==0?(U.heap[++U.heap_len]=Re=ae,U.depth[ae]=0):de[2*ae+1]=0;for(;U.heap_len<2;)de[2*(Q=U.heap[++U.heap_len]=Re<2?++Re:0)]=1,U.depth[Q]=0,U.opt_len--,he&&(U.static_len-=ge[2*Q+1]);for(V.max_code=Re,ae=U.heap_len>>1;1<=ae;ae--)se(U,de,ae);for(Q=xe;ae=U.heap[1],U.heap[1]=U.heap[U.heap_len--],se(U,de,1),ce=U.heap[1],U.heap[--U.heap_max]=ae,U.heap[--U.heap_max]=ce,de[2*Q]=de[2*ae]+de[2*ce],U.depth[Q]=(U.depth[ae]>=U.depth[ce]?U.depth[ae]:U.depth[ce])+1,de[2*ae+1]=de[2*ce+1]=Q,U.heap[1]=Q++,se(U,de,1),2<=U.heap_len;);U.heap[--U.heap_max]=U.heap[1],function(we,Me){var ze,Ee,Ge,oe,Fe,me,Ae=Me.dyn_tree,Ue=Me.max_code,Ce=Me.stat_desc.static_tree,Te=Me.stat_desc.has_stree,et=Me.stat_desc.extra_bits,Xe=Me.stat_desc.extra_base,Le=Me.stat_desc.max_length,Ye=0;for(oe=0;oe<=v;oe++)we.bl_count[oe]=0;for(Ae[2*we.heap[we.heap_max]+1]=0,ze=we.heap_max+1;ze<_;ze++)Le<(oe=Ae[2*Ae[2*(Ee=we.heap[ze])+1]+1]+1)&&(oe=Le,Ye++),Ae[2*Ee+1]=oe,Ue<Ee||(we.bl_count[oe]++,Fe=0,Xe<=Ee&&(Fe=et[Ee-Xe]),me=Ae[2*Ee],we.opt_len+=me*(oe+Fe),Te&&(we.static_len+=me*(Ce[2*Ee+1]+Fe)));if(Ye!==0){do{for(oe=Le-1;we.bl_count[oe]===0;)oe--;we.bl_count[oe]--,we.bl_count[oe+1]+=2,we.bl_count[Le]--,Ye-=2}while(0<Ye);for(oe=Le;oe!==0;oe--)for(Ee=we.bl_count[oe];Ee!==0;)Ue<(Ge=we.heap[--ze])||(Ae[2*Ge+1]!==oe&&(we.opt_len+=(oe-Ae[2*Ge+1])*Ae[2*Ge],Ae[2*Ge+1]=oe),Ee--)}}(U,V),ye(de,Re,U.bl_count)}function S(U,V,ae){var ce,Q,de=-1,ge=V[1],he=0,xe=7,Re=4;for(ge===0&&(xe=138,Re=3),V[2*(ae+1)+1]=65535,ce=0;ce<=ae;ce++)Q=ge,ge=V[2*(ce+1)+1],++he<xe&&Q===ge||(he<Re?U.bl_tree[2*Q]+=he:Q!==0?(Q!==de&&U.bl_tree[2*Q]++,U.bl_tree[2*x]++):he<=10?U.bl_tree[2*A]++:U.bl_tree[2*M]++,de=Q,Re=(he=0)===ge?(xe=138,3):Q===ge?(xe=6,3):(xe=7,4))}function ie(U,V,ae){var ce,Q,de=-1,ge=V[1],he=0,xe=7,Re=4;for(ge===0&&(xe=138,Re=3),ce=0;ce<=ae;ce++)if(Q=ge,ge=V[2*(ce+1)+1],!(++he<xe&&Q===ge)){if(he<Re)for(;X(U,Q,U.bl_tree),--he!=0;);else Q!==0?(Q!==de&&(X(U,Q,U.bl_tree),he--),X(U,x,U.bl_tree),K(U,he-3,2)):he<=10?(X(U,A,U.bl_tree),K(U,he-3,3)):(X(U,M,U.bl_tree),K(U,he-11,7));de=Q,Re=(he=0)===ge?(xe=138,3):Q===ge?(xe=6,3):(xe=7,4)}}c(Z);var q=!1;function H(U,V,ae,ce){K(U,(f<<1)+(ce?1:0),3),function(Q,de,ge,he){le(Q),re(Q,ge),re(Q,~ge),l.arraySet(Q.pending_buf,Q.window,de,ge,Q.pending),Q.pending+=ge}(U,V,ae)}i._tr_init=function(U){q||(function(){var V,ae,ce,Q,de,ge=new Array(v+1);for(Q=ce=0;Q<d-1;Q++)for(j[Q]=ce,V=0;V<1<<L[Q];V++)k[ce++]=Q;for(k[ce-1]=Q,Q=de=0;Q<16;Q++)for(Z[Q]=de,V=0;V<1<<I[Q];V++)N[de++]=Q;for(de>>=7;Q<g;Q++)for(Z[Q]=de<<7,V=0;V<1<<I[Q]-7;V++)N[256+de++]=Q;for(ae=0;ae<=v;ae++)ge[ae]=0;for(V=0;V<=143;)R[2*V+1]=8,V++,ge[8]++;for(;V<=255;)R[2*V+1]=9,V++,ge[9]++;for(;V<=279;)R[2*V+1]=7,V++,ge[7]++;for(;V<=287;)R[2*V+1]=8,V++,ge[8]++;for(ye(R,p+1,ge),V=0;V<g;V++)T[2*V+1]=5,T[2*V]=fe(V,5);J=new ne(R,L,h+1,p,v),W=new ne(T,I,0,g,v),G=new ne(new Array(0),P,0,m,w)}(),q=!0),U.l_desc=new O(U.dyn_ltree,J),U.d_desc=new O(U.dyn_dtree,W),U.bl_desc=new O(U.bl_tree,G),U.bi_buf=0,U.bi_valid=0,Ie(U)},i._tr_stored_block=H,i._tr_flush_block=function(U,V,ae,ce){var Q,de,ge=0;0<U.level?(U.strm.data_type===2&&(U.strm.data_type=function(he){var xe,Re=4093624447;for(xe=0;xe<=31;xe++,Re>>>=1)if(1&Re&&he.dyn_ltree[2*xe]!==0)return o;if(he.dyn_ltree[18]!==0||he.dyn_ltree[20]!==0||he.dyn_ltree[26]!==0)return a;for(xe=32;xe<h;xe++)if(he.dyn_ltree[2*xe]!==0)return a;return o}(U)),Se(U,U.l_desc),Se(U,U.d_desc),ge=function(he){var xe;for(S(he,he.dyn_ltree,he.l_desc.max_code),S(he,he.dyn_dtree,he.d_desc.max_code),Se(he,he.bl_desc),xe=m-1;3<=xe&&he.bl_tree[2*z[xe]+1]===0;xe--);return he.opt_len+=3*(xe+1)+5+5+4,xe}(U),Q=U.opt_len+3+7>>>3,(de=U.static_len+3+7>>>3)<=Q&&(Q=de)):Q=de=ae+5,ae+4<=Q&&V!==-1?H(U,V,ae,ce):U.strategy===4||de===Q?(K(U,2+(ce?1:0),3),te(U,R,T)):(K(U,4+(ce?1:0),3),function(he,xe,Re,we){var Me;for(K(he,xe-257,5),K(he,Re-1,5),K(he,we-4,4),Me=0;Me<we;Me++)K(he,he.bl_tree[2*z[Me]+1],3);ie(he,he.dyn_ltree,xe-1),ie(he,he.dyn_dtree,Re-1)}(U,U.l_desc.max_code+1,U.d_desc.max_code+1,ge+1),te(U,U.dyn_ltree,U.dyn_dtree)),Ie(U),ce&&le(U)},i._tr_tally=function(U,V,ae){return U.pending_buf[U.d_buf+2*U.last_lit]=V>>>8&255,U.pending_buf[U.d_buf+2*U.last_lit+1]=255&V,U.pending_buf[U.l_buf+U.last_lit]=255&ae,U.last_lit++,V===0?U.dyn_ltree[2*ae]++:(U.matches++,V--,U.dyn_ltree[2*(k[ae]+h+1)]++,U.dyn_dtree[2*Y(V)]++),U.last_lit===U.lit_bufsize-1},i._tr_align=function(U){K(U,2,3),X(U,C,R),function(V){V.bi_valid===16?(re(V,V.bi_buf),V.bi_buf=0,V.bi_valid=0):8<=V.bi_valid&&(V.pending_buf[V.pending++]=255&V.bi_buf,V.bi_buf>>=8,V.bi_valid-=8)}(U)}},{"../utils/common":41}],53:[function(n,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,r,i){(function(l){(function(o,a){if(!o.setImmediate){var c,f,d,h,p=1,g={},m=!1,_=o.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(o);v=v&&v.setTimeout?v:o,c={}.toString.call(o.process)==="[object process]"?function(x){process.nextTick(function(){w(x)})}:function(){if(o.postMessage&&!o.importScripts){var x=!0,A=o.onmessage;return o.onmessage=function(){x=!1},o.postMessage("","*"),o.onmessage=A,x}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",C,!1):o.attachEvent("onmessage",C),function(x){o.postMessage(h+x,"*")}):o.MessageChannel?((d=new MessageChannel).port1.onmessage=function(x){w(x.data)},function(x){d.port2.postMessage(x)}):_&&"onreadystatechange"in _.createElement("script")?(f=_.documentElement,function(x){var A=_.createElement("script");A.onreadystatechange=function(){w(x),A.onreadystatechange=null,f.removeChild(A),A=null},f.appendChild(A)}):function(x){setTimeout(w,0,x)},v.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var A=new Array(arguments.length-1),M=0;M<A.length;M++)A[M]=arguments[M+1];var L={callback:x,args:A};return g[p]=L,c(p),p++},v.clearImmediate=y}function y(x){delete g[x]}function w(x){if(m)setTimeout(w,0,x);else{var A=g[x];if(A){m=!0;try{(function(M){var L=M.callback,I=M.args;switch(I.length){case 0:L();break;case 1:L(I[0]);break;case 2:L(I[0],I[1]);break;case 3:L(I[0],I[1],I[2]);break;default:L.apply(a,I)}})(A)}finally{y(x),m=!1}}}}function C(x){x.source===o&&typeof x.data=="string"&&x.data.indexOf(h)===0&&w(+x.data.slice(h.length))}})(typeof self>"u"?l===void 0?this:l:self)}).call(this,typeof mi<"u"?mi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jc);var Pd=jc.exports;const zd=Nd(Pd);function ds(e,t,n){const r=e.slice();return r[152]=t[n],r}function hs(e,t,n){const r=e.slice();return r[155]=t[n],r}function ps(e,t,n){const r=e.slice();return r[158]=t[n],r}function gs(e,t,n){const r=e.slice();return r[158]=t[n],r}function ms(e,t,n){const r=e.slice();return r[163]=t[n],r}function _s(e,t,n){const r=e.slice();return r[158]=t[n],r}function bs(e,t,n){const r=e.slice();return r[168]=t[n],r}function ys(e,t,n){const r=e.slice();return r[171]=t[n],r}function vs(e){let t,n,r,i,l,o,a;return{c(){t=b("div"),n=b("div"),r=pe("svg"),i=pe("polyline"),l=E(),o=b("p"),a=B(e[19]),s(i,"points","20 6 9 17 4 12"),s(r,"class","w-5 h-5 text-green-600 flex-shrink-0"),s(r,"viewBox","0 0 24 24"),s(r,"fill","none"),s(r,"stroke","currentColor"),s(r,"stroke-width","2"),s(r,"stroke-linecap","round"),s(r,"stroke-linejoin","round"),s(o,"class","text-sm font-medium text-green-800"),s(n,"class","bg-green-50 border border-green-200 rounded-lg shadow-lg px-4 py-3 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300"),s(t,"class","fixed bottom-4 right-4 z-50 max-w-sm"),s(t,"data-notranslate","")},m(c,f){F(c,t,f),u(t,n),u(n,r),u(r,i),u(n,l),u(n,o),u(o,a)},p(c,f){f[0]&524288&&ee(a,c[19])},d(c){c&&D(t)}}}function ws(e){let t,n,r=e[79][e[171]].icon+"",i,l=e[79][e[171]].label+"",o,a,c,f=(e[9][e[171]]||0)+"",d,h,p,g,m,_;function v(){return e[83](e[171])}return{c(){t=b("button"),n=b("span"),i=E(),o=B(l),a=E(),c=b("span"),d=B(f),p=E(),s(n,"class","inline-flex"),s(c,"class",h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[171]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600")),s(t,"class",g="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(e[0]===e[171]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(y,w){F(y,t,w),u(t,n),n.innerHTML=r,u(t,i),u(t,o),u(t,a),u(t,c),u(c,d),u(t,p),m||(_=$(t,"click",v),m=!0)},p(y,w){e=y,w[0]&512&&f!==(f=(e[9][e[171]]||0)+"")&&ee(d,f),w[0]&1&&h!==(h="ml-1 px-1.5 py-0.5 rounded-full text-xs "+(e[0]===e[171]?"bg-indigo-100 text-indigo-700":"bg-gray-100 text-gray-600"))&&s(c,"class",h),w[0]&1&&g!==(g="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px flex items-center gap-1.5 "+(e[0]===e[171]?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&s(t,"class",g)},d(y){y&&D(t),m=!1,_()}}}function ks(e){let t,n,r,i=e[34]?'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>':'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>',l,o=e[34]?"Exporting…":"Export JSON ▾",a,c,f,d,h,p,g,m=e[37]&&xs(e),_=e[36]&&Cs(e);return{c(){t=b("div"),n=b("button"),r=new Mc(!1),l=E(),a=B(o),c=E(),m&&m.c(),f=E(),_&&_.c(),d=E(),h=b("button"),h.textContent="Import",r.a=l,s(n,"class","px-3 py-1.5 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1.5"),n.disabled=e[34],s(t,"class","relative"),s(h,"class","px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(v,y){F(v,t,y),u(t,n),r.m(i,n),u(n,l),u(n,a),u(t,c),m&&m.m(t,null),F(v,f,y),_&&_.m(v,y),F(v,d,y),F(v,h,y),p||(g=[$(n,"click",e[84]),$(h,"click",e[86])],p=!0)},p(v,y){y[1]&8&&i!==(i=v[34]?'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="animate-spin" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>':'<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>')&&r.p(i),y[1]&8&&o!==(o=v[34]?"Exporting…":"Export JSON ▾")&&ee(a,o),y[1]&8&&(n.disabled=v[34]),v[37]?m?m.p(v,y):(m=xs(v),m.c(),m.m(t,null)):m&&(m.d(1),m=null),v[36]?_?_.p(v,y):(_=Cs(v),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},d(v){v&&(D(t),D(f),D(d),D(h)),m&&m.d(),_&&_.d(v),p=!1,lt(g)}}}function xs(e){let t,n,r,i,l,o,a,c;return{c(){t=b("div"),n=E(),r=b("div"),i=b("button"),i.textContent="All languages (single file)",l=E(),o=b("button"),o.textContent="One file per language",s(t,"class","fixed inset-0 z-40"),s(t,"role","presentation"),s(i,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-t-md"),s(o,"class","w-full text-left px-4 py-2.5 text-sm hover:bg-gray-50 rounded-b-md border-t border-gray-100"),s(r,"class","absolute right-0 mt-1 w-56 bg-white border border-gray-200 rounded-md shadow-lg z-50")},m(f,d){F(f,t,d),F(f,n,d),F(f,r,d),u(r,i),u(r,l),u(r,o),a||(c=[$(t,"click",e[85]),$(i,"click",e[53]),$(o,"click",e[54])],a=!0)},p:je,d(f){f&&(D(t),D(n),D(r)),a=!1,lt(c)}}}function Cs(e){let t,n,r;return{c(){t=b("span"),n=B(e[36]),s(t,"class",r="text-xs "+(e[36].includes("!")?"text-green-600":"text-red-600"))},m(i,l){F(i,t,l),u(t,n)},p(i,l){l[1]&32&&ee(n,i[36]),l[1]&32&&r!==(r="text-xs "+(i[36].includes("!")?"text-green-600":"text-red-600"))&&s(t,"class",r)},d(i){i&&D(t)}}}function As(e){let t,n,r;return{c(){t=b("button"),t.textContent="+ Add",s(t,"class","px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50")},m(i,l){F(i,t,l),n||(r=$(t,"click",e[87]),n=!0)},p:je,d(i){i&&D(t),n=!1,r()}}}function Ss(e){let t,n,r,i=(e[35]||"Exporting translations...")+"",l,o,a,c,f,d,h,p,g;return{c(){t=b("div"),n=b("div"),r=b("span"),l=B(i),o=E(),a=b("span"),c=B(e[48]),f=B("%"),d=E(),h=b("div"),p=b("div"),s(n,"class","flex items-center justify-between text-xs font-medium text-gray-600"),s(p,"class","h-full bg-indigo-600 transition-all duration-200"),s(p,"style",g=`width: ${e[48]}%`),s(h,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),s(t,"class","mb-4 rounded-lg border border-indigo-200 bg-white px-3 py-3")},m(m,_){F(m,t,_),u(t,n),u(n,r),u(r,l),u(n,o),u(n,a),u(a,c),u(a,f),u(t,d),u(t,h),u(h,p)},p(m,_){_[1]&16&&i!==(i=(m[35]||"Exporting translations...")+"")&&ee(l,i),_[1]&131072&&ee(c,m[48]),_[1]&131072&&g!==(g=`width: ${m[48]}%`)&&s(p,"style",g)},d(m){m&&D(t)}}}function Ts(e){let t,n=(e[168].name||e[168].code||e[168])+"",r,i;return{c(){t=b("option"),r=B(n),t.__value=i=e[168].code||e[168],De(t,t.__value)},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&128&&n!==(n=(l[168].name||l[168].code||l[168])+"")&&ee(r,n),o[0]&128&&i!==(i=l[168].code||l[168])&&(t.__value=i,De(t,t.__value))},d(l){l&&D(t)}}}function Ms(e){let t,n=e[158].name+"",r,i;return{c(){t=b("option"),r=B(n),t.__value=i=e[158].id,De(t,t.__value)},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&32768&&n!==(n=l[158].name+"")&&ee(r,n),o[0]&32768&&i!==(i=l[158].id)&&(t.__value=i,De(t,t.__value))},d(l){l&&D(t)}}}function Es(e){let t,n,r,i,l,o,a,c,f,d,h,p;return{c(){t=b("div"),n=b("input"),r=E(),i=b("input"),l=E(),o=b("input"),a=E(),c=b("button"),f=B("Save"),s(n,"placeholder","Key (original text)"),s(n,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(i,"placeholder","Context (optional)"),s(i,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(o,"placeholder","Translated value (optional)"),s(o,"class","flex-[2] px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(c,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),c.disabled=d=!e[27].trim(),s(t,"class","flex gap-2 mb-4"),s(t,"data-notranslate","")},m(g,m){F(g,t,m),u(t,n),De(n,e[27]),u(t,r),u(t,i),De(i,e[28]),u(t,l),u(t,o),De(o,e[29]),u(t,a),u(t,c),u(c,f),h||(p=[$(n,"input",e[96]),$(i,"input",e[97]),$(o,"input",e[98]),$(c,"click",e[77])],h=!0)},p(g,m){m[0]&134217728&&n.value!==g[27]&&De(n,g[27]),m[0]&268435456&&i.value!==g[28]&&De(i,g[28]),m[0]&536870912&&o.value!==g[29]&&De(o,g[29]),m[0]&134217728&&d!==(d=!g[27].trim())&&(c.disabled=d)},d(g){g&&D(t),h=!1,lt(p)}}}function Is(e){let t,n,r,i,l,o;return{c(){t=b("div"),n=b("textarea"),r=E(),i=b("button"),i.textContent="Import",s(n,"rows","4"),s(n,"placeholder",'{"Hello": "你好", "Goodbye": "再见"}'),s(n,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),s(i,"class","mt-2 px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),s(t,"class","mb-4"),s(t,"data-notranslate","")},m(a,c){F(a,t,c),u(t,n),De(n,e[30]),u(t,r),u(t,i),l||(o=[$(n,"input",e[99]),$(i,"click",e[78])],l=!0)},p(a,c){c[0]&1073741824&&De(n,a[30])},d(a){a&&D(t),l=!1,lt(o)}}}function Ls(e){let t,n,r,i,l,o,a;function c(v,y){return v[22]?Fd:Dd}let f=c(e),d=f(e),h=Be(e[79][e[0]].actions),p=[];for(let v=0;v<h.length;v+=1)p[v]=Ns(ms(e,h,v));let g=e[15].length>0&&Ps(e),m=e[0]==="trash"&&Rs(e),_=(e[22]||e[24]>0)&&js(e);return{c(){t=b("div"),n=b("span"),d.c(),r=E();for(let v=0;v<p.length;v+=1)p[v].c();i=E(),g&&g.c(),l=E(),m&&m.c(),o=E(),_&&_.c(),a=xt(),s(n,"class","text-sm text-indigo-700 font-medium"),s(t,"class","flex items-center gap-3 mb-3 p-3 bg-indigo-50 rounded-lg border border-indigo-200"),s(t,"data-notranslate","")},m(v,y){F(v,t,y),u(t,n),d.m(n,null),u(t,r);for(let w=0;w<p.length;w+=1)p[w]&&p[w].m(t,null);u(t,i),g&&g.m(t,null),u(t,l),m&&m.m(t,null),F(v,o,y),_&&_.m(v,y),F(v,a,y)},p(v,y){if(f===(f=c(v))&&d?d.p(v,y):(d.d(1),d=f(v),d&&(d.c(),d.m(n,null))),y[0]&4194305|y[2]&132096){h=Be(v[79][v[0]].actions);let w;for(w=0;w<h.length;w+=1){const C=ms(v,h,w);p[w]?p[w].p(C,y):(p[w]=Ns(C),p[w].c(),p[w].m(t,i))}for(;w<p.length;w+=1)p[w].d(1);p.length=h.length}v[15].length>0?g?g.p(v,y):(g=Ps(v),g.c(),g.m(t,l)):g&&(g.d(1),g=null),v[0]==="trash"?m?m.p(v,y):(m=Rs(v),m.c(),m.m(t,null)):m&&(m.d(1),m=null),v[22]||v[24]>0?_?_.p(v,y):(_=js(v),_.c(),_.m(a.parentNode,a)):_&&(_.d(1),_=null)},d(v){v&&(D(t),D(o),D(a)),d.d(),ft(p,v),g&&g.d(),m&&m.d(),_&&_.d(v)}}}function Dd(e){let t=e[14].size+"",n,r;return{c(){n=B(t),r=B(" selected")},m(i,l){F(i,n,l),F(i,r,l)},p(i,l){l[0]&16384&&t!==(t=i[14].size+"")&&ee(n,t)},d(i){i&&(D(n),D(r))}}}function Fd(e){let t,n,r,i,l;return{c(){t=B(e[23]),n=E(),r=B(e[4]),i=B(" / "),l=B(e[5])},m(o,a){F(o,t,a),F(o,n,a),F(o,r,a),F(o,i,a),F(o,l,a)},p(o,a){a[0]&8388608&&ee(t,o[23]),a[0]&16&&ee(r,o[4]),a[0]&32&&ee(l,o[5])},d(o){o&&(D(t),D(n),D(r),D(i),D(l))}}}function Ns(e){let t,n=e[163].label+"",r,i,l,o,a;function c(){return e[100](e[163])}return{c(){t=b("button"),r=B(n),i=E(),s(t,"class",l="px-3 py-1.5 text-white text-sm rounded-md "+e[163].color+" disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[22]},m(f,d){F(f,t,d),u(t,r),u(t,i),o||(a=$(t,"click",c),o=!0)},p(f,d){e=f,d[0]&1&&n!==(n=e[163].label+"")&&ee(r,n),d[0]&1&&l!==(l="px-3 py-1.5 text-white text-sm rounded-md "+e[163].color+" disabled:opacity-50 disabled:cursor-not-allowed")&&s(t,"class",l),d[0]&4194304&&(t.disabled=e[22])},d(f){f&&D(t),o=!1,a()}}}function Ps(e){let t,n,r,i,l,o,a=e[16]&&zs(e);return{c(){t=b("div"),n=b("button"),r=B("Label ▾"),i=E(),a&&a.c(),s(n,"class","px-3 py-1.5 bg-amber-500 text-white text-sm rounded-md hover:bg-amber-600 disabled:opacity-50"),n.disabled=e[22],s(t,"class","relative")},m(c,f){F(c,t,f),u(t,n),u(n,r),u(t,i),a&&a.m(t,null),l||(o=$(n,"click",e[101]),l=!0)},p(c,f){f[0]&4194304&&(n.disabled=c[22]),c[16]?a?a.p(c,f):(a=zs(c),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(c){c&&D(t),a&&a.d(),l=!1,o()}}}function zs(e){let t,n,r,i,l,o,a,c,f=Be(e[15]),d=[];for(let p=0;p<f.length;p+=1)d[p]=Ds(gs(e,f,p));let h=e[13]&&Fs(e);return{c(){t=b("div"),n=E(),r=b("div"),i=b("div"),i.textContent="Assign Label",l=E();for(let p=0;p<d.length;p+=1)d[p].c();o=E(),h&&h.c(),s(t,"class","fixed inset-0 z-40"),s(t,"role","presentation"),s(i,"class","px-3 py-2 text-xs text-gray-400 font-semibold uppercase border-b border-gray-100"),s(r,"class","absolute left-0 mt-1 w-52 bg-white border border-gray-200 rounded-md shadow-lg z-50 max-h-60 overflow-y-auto")},m(p,g){F(p,t,g),F(p,n,g),F(p,r,g),u(r,i),u(r,l);for(let m=0;m<d.length;m+=1)d[m]&&d[m].m(r,null);u(r,o),h&&h.m(r,null),a||(c=$(t,"click",e[102]),a=!0)},p(p,g){if(g[0]&32768|g[1]&536870912){f=Be(p[15]);let m;for(m=0;m<f.length;m+=1){const _=gs(p,f,m);d[m]?d[m].p(_,g):(d[m]=Ds(_),d[m].c(),d[m].m(r,o))}for(;m<d.length;m+=1)d[m].d(1);d.length=f.length}p[13]?h?h.p(p,g):(h=Fs(p),h.c(),h.m(r,null)):h&&(h.d(1),h=null)},d(p){p&&(D(t),D(n),D(r)),ft(d,p),h&&h.d(),a=!1,c()}}}function Ds(e){let t,n,r,i=e[158].name+"",l,o,a;function c(){return e[103](e[158])}return{c(){t=b("button"),n=b("span"),r=E(),l=B(i),s(n,"class","w-3 h-3 rounded-full shrink-0"),mt(n,"background-color",e[158].color),s(t,"class","w-full text-left px-3 py-2 text-sm hover:bg-gray-50 flex items-center gap-2")},m(f,d){F(f,t,d),u(t,n),u(t,r),u(t,l),o||(a=$(t,"click",c),o=!0)},p(f,d){e=f,d[0]&32768&&mt(n,"background-color",e[158].color),d[0]&32768&&i!==(i=e[158].name+"")&&ee(l,i)},d(f){f&&D(t),o=!1,a()}}}function Fs(e){let t,n,r,i=Be(e[15]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Bs(ps(e,i,o));return{c(){t=b("div"),n=b("div"),n.textContent="Remove Label",r=E();for(let o=0;o<l.length;o+=1)l[o].c();s(n,"class","px-3 py-2 text-xs text-gray-400 font-semibold uppercase"),s(t,"class","border-t border-gray-100")},m(o,a){F(o,t,a),u(t,n),u(t,r);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(t,null)},p(o,a){if(a[0]&32768|a[1]&1073741824){i=Be(o[15]);let c;for(c=0;c<i.length;c+=1){const f=ps(o,i,c);l[c]?l[c].p(f,a):(l[c]=Bs(f),l[c].c(),l[c].m(t,null))}for(;c<l.length;c+=1)l[c].d(1);l.length=i.length}},d(o){o&&D(t),ft(l,o)}}}function Bs(e){let t,n,r,i=e[158].name+"",l,o,a,c;function f(){return e[104](e[158])}return{c(){t=b("button"),n=b("span"),r=B(`
|
|
15
|
+
Remove "`),l=B(i),o=B(`"
|
|
16
|
+
`),s(n,"class","w-3 h-3 rounded-full shrink-0"),mt(n,"background-color",e[158].color),s(t,"class","w-full text-left px-3 py-2 text-sm hover:bg-red-50 text-red-600 flex items-center gap-2")},m(d,h){F(d,t,h),u(t,n),u(t,r),u(t,l),u(t,o),a||(c=$(t,"click",f),a=!0)},p(d,h){e=d,h[0]&32768&&mt(n,"background-color",e[158].color),h[0]&32768&&i!==(i=e[158].name+"")&&ee(l,i)},d(d){d&&D(t),a=!1,c()}}}function Rs(e){let t,n=e[22]&&e[23]==="Deleting"?"Deleting…":"Delete Permanently",r,i,l;return{c(){t=b("button"),r=B(n),s(t,"class","px-3 py-1.5 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"),t.disabled=e[22]},m(o,a){F(o,t,a),u(t,r),i||(l=$(t,"click",e[73]),i=!0)},p(o,a){a[0]&12582912&&n!==(n=o[22]&&o[23]==="Deleting"?"Deleting…":"Delete Permanently")&&ee(r,n),a[0]&4194304&&(t.disabled=o[22])},d(o){o&&D(t),i=!1,l()}}}function js(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y;function w(A,M){if(A[22])return Rd;if(A[24]>0)return Bd}let C=w(e),x=C&&C(e);return{c(){t=b("div"),n=b("div"),r=b("span"),x&&x.c(),i=E(),l=b("span"),o=B(e[49]),a=B("%"),c=E(),f=b("div"),d=b("div"),p=E(),g=b("div"),m=B(e[4]),_=B(" of "),v=B(e[5]),y=B(" processed"),s(n,"class","flex items-center justify-between text-xs font-medium text-gray-600"),s(d,"class","h-full bg-indigo-600 transition-all duration-200"),s(d,"style",h=`width: ${e[49]}%`),s(f,"class","mt-2 h-2 overflow-hidden rounded-full bg-indigo-100"),s(g,"class","mt-2 text-xs text-gray-500"),s(t,"class","mb-4 rounded-lg border border-indigo-200 bg-white px-3 py-3"),s(t,"data-notranslate","")},m(A,M){F(A,t,M),u(t,n),u(n,r),x&&x.m(r,null),u(n,i),u(n,l),u(l,o),u(l,a),u(t,c),u(t,f),u(f,d),u(t,p),u(t,g),u(g,m),u(g,_),u(g,v),u(g,y)},p(A,M){C===(C=w(A))&&x?x.p(A,M):(x&&x.d(1),x=C&&C(A),x&&(x.c(),x.m(r,null))),M[1]&262144&&ee(o,A[49]),M[1]&262144&&h!==(h=`width: ${A[49]}%`)&&s(d,"style",h),M[0]&16&&ee(m,A[4]),M[0]&32&&ee(v,A[5])},d(A){A&&D(t),x&&x.d()}}}function Bd(e){let t,n,r;return{c(){t=B("Finished with "),n=B(e[24]),r=B(" failure(s)")},m(i,l){F(i,t,l),F(i,n,l),F(i,r,l)},p(i,l){l[0]&16777216&&ee(n,i[24])},d(i){i&&(D(t),D(n),D(r))}}}function Rd(e){let t,n;return{c(){t=B(e[23]),n=B(" selected items...")},m(r,i){F(r,t,i),F(r,n,i)},p(r,i){i[0]&8388608&&ee(t,r[23])},d(r){r&&(D(t),D(n))}}}function Os(e){let t,n,r;return n=new Rc({props:{jobs:e[44],onCancel:e[69],onDismiss:e[70]}}),{c(){t=b("div"),ln(n.$$.fragment),s(t,"data-notranslate","")},m(i,l){F(i,t,l),Kt(n,t,null),r=!0},p(i,l){const o={};l[1]&8192&&(o.jobs=i[44]),n.$set(o)},i(i){r||(st(n.$$.fragment,i),r=!0)},o(i){ct(n.$$.fragment,i),r=!1},d(i){i&&D(t),Qt(n)}}}function jd(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w=[],C=new Map,x,A,M,L,I,P,z,R,T,N=Be(e[1]);const k=J=>J[155].key;for(let J=0;J<N.length;J+=1){let W=hs(e,N,J),G=k(W);C.set(G,w[J]=Hs(G,W))}let j=e[50]>1&&Zs(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),i=b("tr"),l=b("th"),o=b("input"),a=E(),c=b("th"),c.textContent="Key",f=E(),d=b("th"),d.textContent="DomContext",h=E(),p=b("th"),g=B("Translation ("),m=B(e[8]),_=B(")"),v=E(),y=b("tbody");for(let J=0;J<w.length;J+=1)w[J].c();x=E(),A=b("div"),M=b("p"),L=B(e[3]),I=B(" key(s)"),P=E(),j&&j.c(),s(o,"type","checkbox"),o.checked=e[17],s(o,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(l,"class","w-10 px-3 py-2.5"),s(c,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),s(d,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),s(p,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),s(i,"class","bg-gray-50 border-b border-gray-200"),s(n,"class","w-full"),s(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),s(t,"data-notranslate",""),s(M,"class","text-xs text-gray-400"),s(A,"class","flex items-center justify-between mt-3"),s(A,"data-notranslate","")},m(J,W){F(J,t,W),u(t,n),u(n,r),u(r,i),u(i,l),u(l,o),u(i,a),u(i,c),u(i,f),u(i,d),u(i,h),u(i,p),u(p,g),u(p,m),u(p,_),u(n,v),u(n,y);for(let G=0;G<w.length;G+=1)w[G]&&w[G].m(y,null);F(J,x,W),F(J,A,W),u(A,M),u(M,L),u(M,I),u(A,P),j&&j.m(A,null),z=!0,R||(T=$(o,"change",e[63]),R=!0)},p(J,W){(!z||W[0]&131072)&&(o.checked=J[17]),(!z||W[0]&256)&&ee(m,J[8]),W[0]&49155|W[1]&270582273|W[2]&24636&&(N=Be(J[1]),Jt(),w=si(w,W,k,1,J,N,C,y,Pc,Hs,null,hs),qt()),(!z||W[0]&8)&&ee(L,J[3]),J[50]>1?j?j.p(J,W):(j=Zs(J),j.c(),j.m(A,null)):j&&(j.d(1),j=null)},i(J){if(!z){for(let W=0;W<N.length;W+=1)st(w[W]);z=!0}},o(J){for(let W=0;W<w.length;W+=1)ct(w[W]);z=!1},d(J){J&&(D(t),D(x),D(A));for(let W=0;W<w.length;W+=1)w[W].d();j&&j.d(),R=!1,T()}}}function Od(e){let t;function n(l,o){return l[10]?Yd:l[0]==="pending"?Wd:l[0]==="approved"?Zd:Hd}let r=n(e),i=r(e);return{c(){t=b("div"),i.c(),s(t,"class","text-center py-12 text-gray-400")},m(l,o){F(l,t,o),i.m(t,null)},p(l,o){r===(r=n(l))&&i?i.p(l,o):(i.d(1),i=r(l),i&&(i.c(),i.m(t,null)))},i:je,o:je,d(l){l&&D(t),i.d()}}}function Ud(e){let t;return{c(){t=b("div"),t.innerHTML='<svg width="40" height="40" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes tspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#tr{animation:tspin 1.2s linear infinite;transform-origin:40px 40px}</style></defs><g id="tr"><circle cx="40" cy="40" r="34" fill="none" stroke="#e5e7eb" stroke-width="4"></circle><path d="M40 6 A34 34 0 0 1 74 40" fill="none" stroke="#2ECC88" stroke-width="4" stroke-linecap="round"></path><path d="M74 40 A34 34 0 0 1 56 70" fill="none" stroke="#3A8FE0" stroke-width="4" stroke-linecap="round"></path><path d="M56 70 A34 34 0 0 1 24 70" fill="none" stroke="#FFB833" stroke-width="4" stroke-linecap="round"></path></g></svg>',s(t,"class","flex justify-center py-8")},m(n,r){F(n,t,r)},p:je,i:je,o:je,d(n){n&&D(t)}}}function Us(e){let t,n,r,i,l;return r=new Bc({props:{group:e[155],editable:e[0]==="approved"||e[0]==="pending",showAiAction:!0,aiBusy:e[40],onAiAction:e[67],showAria:!0,rowHasAria:e[52],onAriaAction:e[107],showVarEdit:!0,onVarEdit:e[108],showDetails:!0,onDetails:e[65],showLabels:!0,allLabels:e[15],onToggleLabel:e[59],onSaveMasterValue:e[76],onSaveValue:e[109]}}),{c(){t=b("tr"),n=b("td"),ln(r.$$.fragment),i=E(),s(n,"colspan","4"),s(n,"class","px-4 py-3"),s(t,"class","bg-gray-50 border-b border-gray-200")},m(o,a){F(o,t,a),u(t,n),Kt(r,n,null),u(t,i),l=!0},p(o,a){const c={};a[0]&2&&(c.group=o[155]),a[0]&1&&(c.editable=o[0]==="approved"||o[0]==="pending"),a[1]&512&&(c.aiBusy=o[40]),a[1]&32768&&(c.onAriaAction=o[107]),a[1]&16384&&(c.onVarEdit=o[108]),a[0]&32768&&(c.allLabels=o[15]),r.$set(c)},i(o){l||(st(r.$$.fragment,o),l=!0)},o(o){ct(r.$$.fragment,o),l=!1},d(o){o&&D(t),Qt(r)}}}function Hs(e,t){let n,r,i,l,o,a,c,f,d,h,p,g,m,_=t[155].key+"",v,y,w,C=t[155].total+"",x,A,M,L,I,P=t[155].total+"",z,R,T=t[155].total===1?"context":"contexts",N,k,j,J,W,G=t[155].translatedCount+"",Z,ne,O=t[155].total+"",Y,re,K,X,fe,ye,Ie,le;function ve(){return t[105](t[155])}function se(){return t[106](t[155])}let te=t[31]===t[155].key&&Us(t);return{key:e,first:null,c(){n=b("tr"),r=b("td"),i=b("input"),a=E(),c=b("td"),f=b("div"),d=pe("svg"),h=pe("path"),g=E(),m=b("span"),v=B(_),y=E(),w=b("span"),x=B(C),L=E(),I=b("td"),z=B(P),R=E(),N=B(T),k=B(" — click to expand"),j=E(),J=b("td"),W=b("span"),Z=B(G),ne=B("/"),Y=B(O),re=B(" translated"),X=E(),te&&te.c(),fe=xt(),s(i,"type","checkbox"),i.checked=l=yi(t[155],t[14])==="all",i.indeterminate=o=yi(t[155],t[14])==="some",s(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(r,"class","px-3 py-2"),s(h,"fill-rule","evenodd"),s(h,"d","M7.293 4.293a1 1 0 011.414 0l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414-1.414L11.586 10 7.293 5.707a1 1 0 010-1.414z"),s(h,"clip-rule","evenodd"),s(d,"class",p="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[31]===t[155].key?"rotate-90":"")),s(d,"viewBox","0 0 20 20"),s(d,"fill","currentColor"),s(m,"class","truncate flex-1 min-w-0"),s(w,"class","shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100"),s(w,"title",A=t[155].total+" context(s)"),s(f,"class","flex items-center gap-2 min-w-0"),s(c,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[320px]"),s(c,"title",M=t[155].key),s(I,"class","px-3 py-2 text-sm text-gray-500 whitespace-nowrap"),s(W,"class","font-semibold"),s(J,"class","px-3 py-2 text-sm text-gray-700 whitespace-nowrap"),s(n,"class",K="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[31]===t[155].key?"bg-indigo-50":"")),this.first=n},m(Se,S){F(Se,n,S),u(n,r),u(r,i),u(n,a),u(n,c),u(c,f),u(f,d),u(d,h),u(f,g),u(f,m),u(m,v),u(f,y),u(f,w),u(w,x),u(n,L),u(n,I),u(I,z),u(I,R),u(I,N),u(I,k),u(n,j),u(n,J),u(J,W),u(W,Z),u(W,ne),u(W,Y),u(J,re),F(Se,X,S),te&&te.m(Se,S),F(Se,fe,S),ye=!0,Ie||(le=[$(i,"change",ve),$(r,"click",Bt(t[82])),$(n,"click",se)],Ie=!0)},p(Se,S){t=Se,(!ye||S[0]&16386&&l!==(l=yi(t[155],t[14])==="all"))&&(i.checked=l),(!ye||S[0]&16386&&o!==(o=yi(t[155],t[14])==="some"))&&(i.indeterminate=o),(!ye||S[0]&2|S[1]&1&&p!==(p="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[31]===t[155].key?"rotate-90":"")))&&s(d,"class",p),(!ye||S[0]&2)&&_!==(_=t[155].key+"")&&ee(v,_),(!ye||S[0]&2)&&C!==(C=t[155].total+"")&&ee(x,C),(!ye||S[0]&2&&A!==(A=t[155].total+" context(s)"))&&s(w,"title",A),(!ye||S[0]&2&&M!==(M=t[155].key))&&s(c,"title",M),(!ye||S[0]&2)&&P!==(P=t[155].total+"")&&ee(z,P),(!ye||S[0]&2)&&T!==(T=t[155].total===1?"context":"contexts")&&ee(N,T),(!ye||S[0]&2)&&G!==(G=t[155].translatedCount+"")&&ee(Z,G),(!ye||S[0]&2)&&O!==(O=t[155].total+"")&&ee(Y,O),(!ye||S[0]&2|S[1]&1&&K!==(K="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[31]===t[155].key?"bg-indigo-50":"")))&&s(n,"class",K),t[31]===t[155].key?te?(te.p(t,S),S[0]&2|S[1]&1&&st(te,1)):(te=Us(t),te.c(),st(te,1),te.m(fe.parentNode,fe)):te&&(Jt(),ct(te,1,1,()=>{te=null}),qt())},i(Se){ye||(st(te),ye=!0)},o(Se){ct(te),ye=!1},d(Se){Se&&(D(n),D(X),D(fe)),te&&te.d(Se),Ie=!1,lt(le)}}}function Zs(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N;return{c(){t=b("div"),n=b("button"),r=B("«"),l=E(),o=b("button"),a=B("‹"),f=E(),d=b("span"),h=B("Page "),p=B(e[21]),g=B(" of "),m=B(e[50]),_=E(),v=b("button"),y=B("›"),C=E(),x=b("button"),A=B("»"),L=E(),I=b("select"),P=b("option"),P.textContent="25 / page",z=b("option"),z.textContent="50 / page",R=b("option"),R.textContent="100 / page",s(n,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),n.disabled=i=e[21]<=1,s(o,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),o.disabled=c=e[21]<=1,s(d,"class","px-3 py-1 text-xs text-gray-600"),s(v,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),v.disabled=w=e[21]>=e[50],s(x,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),x.disabled=M=e[21]>=e[50],P.__value=25,De(P,P.__value),z.__value=50,De(z,z.__value),R.__value=100,De(R,R.__value),s(I,"class","ml-2 px-2 py-1 text-xs border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[2]===void 0&&Dt(()=>e[114].call(I)),s(t,"class","flex items-center gap-1")},m(k,j){F(k,t,j),u(t,n),u(n,r),u(t,l),u(t,o),u(o,a),u(t,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(t,_),u(t,v),u(v,y),u(t,C),u(t,x),u(x,A),u(t,L),u(t,I),u(I,P),u(I,z),u(I,R),vt(I,e[2],!0),T||(N=[$(n,"click",e[110]),$(o,"click",e[111]),$(v,"click",e[112]),$(x,"click",e[113]),$(I,"change",e[114]),$(I,"change",e[115])],T=!0)},p(k,j){j[0]&2097152&&i!==(i=k[21]<=1)&&(n.disabled=i),j[0]&2097152&&c!==(c=k[21]<=1)&&(o.disabled=c),j[0]&2097152&&ee(p,k[21]),j[1]&524288&&ee(m,k[50]),j[0]&2097152|j[1]&524288&&w!==(w=k[21]>=k[50])&&(v.disabled=w),j[0]&2097152|j[1]&524288&&M!==(M=k[21]>=k[50])&&(x.disabled=M),j[0]&4&&vt(I,k[2])},d(k){k&&D(t),T=!1,lt(N)}}}function Hd(e){let t;return{c(){t=b("p"),t.textContent="Trash is empty."},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Zd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No approved phrases yet.",n=E(),r=b("p"),r.textContent="Move phrases from Pending to start serving translations.",s(r,"class","text-sm mt-1")},m(i,l){F(i,t,l),F(i,n,l),F(i,r,l)},p:je,d(i){i&&(D(t),D(n),D(r))}}}function Wd(e){let t,n,r;return{c(){t=b("p"),t.textContent="No pending phrases.",n=E(),r=b("p"),r.textContent="Add the CDN script to a page to auto-discover text.",s(r,"class","text-sm mt-1")},m(i,l){F(i,t,l),F(i,n,l),F(i,r,l)},p:je,d(i){i&&(D(t),D(n),D(r))}}}function Yd(e){let t,n,r,i;return{c(){t=b("p"),n=B('No results for "'),r=B(e[10]),i=B('"')},m(l,o){F(l,t,o),u(t,n),u(t,r),u(t,i)},p(l,o){o[0]&1024&&ee(r,l[10])},d(l){l&&D(t)}}}function Ws(e){let t,n,r,i,l,o,a,c,f,d,h,p,g=e[42].key+"",m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k,j=e[40]?"Starting...":"Start Translation",J,W,G,Z,ne=e[38].length===0&&Ys(),O=Be(e[38]),Y=[];for(let re=0;re<O.length;re+=1)Y[re]=Gs(ds(e,O,re));return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h3"),i.textContent="AI Translate Group",l=E(),o=b("button"),o.textContent="×",a=E(),c=b("div"),f=b("div"),d=b("p"),d.textContent="Key",h=E(),p=b("p"),m=B(g),_=E(),v=b("div"),y=b("label"),y.textContent="Prompt",w=E(),C=b("select"),ne&&ne.c(),x=xt();for(let re=0;re<Y.length;re+=1)Y[re].c();A=E(),M=b("label"),L=b("input"),I=B(`
|
|
17
|
+
Translate all contexts + master (unchecked = master only)`),P=E(),z=b("div"),R=b("button"),T=B("Cancel"),N=E(),k=b("button"),J=B(j),s(i,"class","text-sm font-semibold text-gray-800"),s(o,"class","text-gray-400 hover:text-gray-700 text-lg leading-none"),s(r,"class","px-5 py-4 border-b border-gray-100 flex items-center justify-between"),s(d,"class","text-xs text-gray-500 mb-1"),s(p,"class","text-sm text-gray-800 font-mono break-words"),s(y,"for","tm-ai-group-prompt"),s(y,"class","block text-xs text-gray-500 font-medium mb-1"),s(C,"id","tm-ai-group-prompt"),s(C,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[39]===void 0&&Dt(()=>e[116].call(C)),s(L,"type","checkbox"),s(L,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(M,"class","flex items-center gap-2 text-sm text-gray-700 cursor-pointer"),s(c,"class","px-5 py-4 space-y-3"),s(R,"class","px-3 py-1.5 text-sm border border-gray-300 rounded-md hover:bg-gray-50"),R.disabled=e[40],s(k,"class","px-3 py-1.5 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"),k.disabled=W=!e[39]||e[40],s(z,"class","px-5 py-4 border-t border-gray-100 flex justify-end gap-2"),s(n,"class","w-full max-w-md rounded-xl bg-white shadow-2xl border border-gray-200"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),mt(t,"background","rgba(0,0,0,0.45)"),s(t,"data-notranslate","")},m(re,K){F(re,t,K),u(t,n),u(n,r),u(r,i),u(r,l),u(r,o),u(n,a),u(n,c),u(c,f),u(f,d),u(f,h),u(f,p),u(p,m),u(c,_),u(c,v),u(v,y),u(v,w),u(v,C),ne&&ne.m(C,null),u(C,x);for(let X=0;X<Y.length;X+=1)Y[X]&&Y[X].m(C,null);vt(C,e[39],!0),u(c,A),u(c,M),u(M,L),L.checked=e[43],u(M,I),u(n,P),u(n,z),u(z,R),u(R,T),u(z,N),u(z,k),u(k,J),G||(Z=[$(o,"click",e[68]),$(C,"change",e[116]),$(L,"change",e[117]),$(R,"click",e[68]),$(k,"click",e[71]),$(t,"click",Rr(e[68]))],G=!0)},p(re,K){if(K[1]&2048&&g!==(g=re[42].key+"")&&ee(m,g),re[38].length===0?ne||(ne=Ys(),ne.c(),ne.m(C,x)):ne&&(ne.d(1),ne=null),K[1]&128){O=Be(re[38]);let X;for(X=0;X<O.length;X+=1){const fe=ds(re,O,X);Y[X]?Y[X].p(fe,K):(Y[X]=Gs(fe),Y[X].c(),Y[X].m(C,null))}for(;X<Y.length;X+=1)Y[X].d(1);Y.length=O.length}K[1]&384&&vt(C,re[39]),K[1]&4096&&(L.checked=re[43]),K[1]&512&&(R.disabled=re[40]),K[1]&512&&j!==(j=re[40]?"Starting...":"Start Translation")&&ee(J,j),K[1]&896&&W!==(W=!re[39]||re[40])&&(k.disabled=W)},d(re){re&&D(t),ne&&ne.d(),ft(Y,re),G=!1,lt(Z)}}}function Ys(e){let t;return{c(){t=b("option"),t.textContent="No prompts available",t.__value="",De(t,t.__value)},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function Gs(e){let t,n=e[152].name+"",r,i,l=e[152].version+"",o,a,c;return{c(){t=b("option"),r=B(n),i=B(" (v"),o=B(l),a=B(")"),t.__value=c=e[152].id,De(t,t.__value)},m(f,d){F(f,t,d),u(t,r),u(t,i),u(t,o),u(t,a)},p(f,d){d[1]&128&&n!==(n=f[152].name+"")&&ee(r,n),d[1]&128&&l!==(l=f[152].version+"")&&ee(o,l),d[1]&128&&c!==(c=f[152].id)&&(t.__value=c,De(t,t.__value))},d(f){f&&D(t)}}}function Vs(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m=e[32].key+"",_,v,y,w,C,x,A=(e[32].context||"Word (no context)")+"",M,L,I,P,z,R,T,N=e[52](e[32])?"ARIA":"TEXT",k,j,J,W,G,Z,ne,O,Y,re,K,X,fe=(e[32].status||"pending")+"",ye,Ie,le,ve,se,te,Se=(e[32].created_at||"—")+"",S,ie,q,H,U,V,ae,ce;function Q(we,Me){return we[32].url?Vd:Gd}let de=Q(e),ge=de(e);function he(we,Me){return we[32].url&&we[33][we[32].url]?qd:we[32].url&&we[33][we[32].url]===null?Jd:Xd}let xe=he(e),Re=xe(e);return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h2"),i.textContent="Phrase Details",l=E(),o=b("button"),o.textContent="×",a=E(),c=b("div"),f=b("div"),d=b("div"),h=b("p"),h.textContent="Key",p=E(),g=b("p"),_=B(m),v=E(),y=b("div"),w=b("p"),w.textContent="Dom Context",C=E(),x=b("p"),M=B(A),L=E(),I=b("div"),P=b("p"),P.textContent="Type",z=E(),R=b("div"),T=b("span"),k=B(N),J=E(),W=b("div"),G=b("p"),G.textContent="Source URL",Z=E(),ge.c(),ne=E(),O=b("div"),Y=b("p"),Y.textContent="Status",re=E(),K=b("div"),X=b("span"),ye=B(fe),Ie=E(),le=b("div"),ve=b("p"),ve.textContent="Discovered",se=E(),te=b("p"),S=B(Se),ie=E(),q=b("div"),H=b("p"),H.textContent="Screenshot",U=E(),V=b("div"),Re.c(),s(i,"class","text-sm font-semibold text-gray-800"),s(o,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),s(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100 sticky top-0 bg-white"),s(h,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(g,"class","mt-1 text-base text-gray-900 break-words"),s(w,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(x,"class","mt-1 text-base text-gray-900 break-words"),s(P,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(T,"class",j="inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold "+(e[52](e[32])?"text-amber-700 bg-amber-100":"text-gray-600 bg-gray-100")),s(R,"class","mt-1"),s(G,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(Y,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(X,"class","inline-flex items-center px-2 py-0.5 rounded-full text-xs font-semibold bg-amber-100 text-amber-800"),s(K,"class","mt-1"),s(ve,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(te,"class","mt-1 text-sm text-gray-700"),s(f,"class","space-y-4"),s(H,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide mb-2"),s(V,"class","w-full h-[160px] rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center overflow-hidden"),s(q,"class","md:pt-1"),s(c,"class","px-6 py-5 grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_280px] gap-6 text-sm"),s(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-y-auto"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),mt(t,"background","rgba(0,0,0,0.45)"),s(t,"data-notranslate","")},m(we,Me){F(we,t,Me),u(t,n),u(n,r),u(r,i),u(r,l),u(r,o),u(n,a),u(n,c),u(c,f),u(f,d),u(d,h),u(d,p),u(d,g),u(g,_),u(f,v),u(f,y),u(y,w),u(y,C),u(y,x),u(x,M),u(f,L),u(f,I),u(I,P),u(I,z),u(I,R),u(R,T),u(T,k),u(f,J),u(f,W),u(W,G),u(W,Z),ge.m(W,null),u(f,ne),u(f,O),u(O,Y),u(O,re),u(O,K),u(K,X),u(X,ye),u(f,Ie),u(f,le),u(le,ve),u(le,se),u(le,te),u(te,S),u(c,ie),u(c,q),u(q,H),u(q,U),u(q,V),Re.m(V,null),ae||(ce=[$(o,"click",e[118]),$(t,"click",Rr(e[119]))],ae=!0)},p(we,Me){Me[1]&2&&m!==(m=we[32].key+"")&&ee(_,m),Me[1]&2&&A!==(A=(we[32].context||"Word (no context)")+"")&&ee(M,A),Me[1]&2&&N!==(N=we[52](we[32])?"ARIA":"TEXT")&&ee(k,N),Me[1]&2&&j!==(j="inline-flex items-center px-2 py-0.5 rounded-md text-xs font-semibold "+(we[52](we[32])?"text-amber-700 bg-amber-100":"text-gray-600 bg-gray-100"))&&s(T,"class",j),de===(de=Q(we))&&ge?ge.p(we,Me):(ge.d(1),ge=de(we),ge&&(ge.c(),ge.m(W,null))),Me[1]&2&&fe!==(fe=(we[32].status||"pending")+"")&&ee(ye,fe),Me[1]&2&&Se!==(Se=(we[32].created_at||"—")+"")&&ee(S,Se),xe===(xe=he(we))&&Re?Re.p(we,Me):(Re.d(1),Re=xe(we),Re&&(Re.c(),Re.m(V,null)))},d(we){we&&D(t),ge.d(),Re.d(),ae=!1,lt(ce)}}}function Gd(e){let t;return{c(){t=b("p"),t.textContent="—",s(t,"class","mt-1 text-sm text-gray-400")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Vd(e){let t,n=e[32].url+"",r,i;return{c(){t=b("a"),r=B(n),s(t,"href",i=e[32].url),s(t,"target","_blank"),s(t,"rel","noopener noreferrer"),s(t,"class","mt-1 inline-block text-sm text-blue-700 underline break-all")},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[1]&2&&n!==(n=l[32].url+"")&&ee(r,n),o[1]&2&&i!==(i=l[32].url)&&s(t,"href",i)},d(l){l&&D(t)}}}function Xd(e){let t;return{c(){t=b("span"),t.textContent="Page screenshot",s(t,"class","text-sm text-gray-400")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Jd(e){let t;return{c(){t=b("span"),t.textContent="Loading screenshot...",s(t,"class","text-sm text-gray-400")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function qd(e){let t,n;return{c(){t=b("img"),Pi(t.src,n="data:image/jpeg;base64,"+e[33][e[32].url])||s(t,"src",n),s(t,"alt","Page screenshot"),s(t,"class","max-w-full max-h-full w-auto h-auto object-contain")},m(r,i){F(r,t,i)},p(r,i){i[1]&6&&!Pi(t.src,n="data:image/jpeg;base64,"+r[33][r[32].url])&&s(t,"src",n)},d(r){r&&D(t)}}}function Xs(e){let t,n,r,i,l,o,a,c,f,d,h,p;return f=new bd({props:{phraseKey:e[45].key,varSlots:e[121](),onSave:e[74]}}),{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h2"),i.textContent="Edit Phrase Slots",l=E(),o=b("button"),o.textContent="×",a=E(),c=b("div"),ln(f.$$.fragment),s(i,"class","text-sm font-semibold text-gray-800"),s(o,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),s(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100"),s(c,"class","px-6 py-5"),s(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),mt(t,"background","rgba(0,0,0,0.45)"),s(t,"data-notranslate","")},m(g,m){F(g,t,m),u(t,n),u(n,r),u(r,i),u(r,l),u(r,o),u(n,a),u(n,c),Kt(f,c,null),d=!0,h||(p=[$(o,"click",e[120]),$(t,"click",Rr(e[122]))],h=!0)},p(g,m){const _={};m[1]&16384&&(_.phraseKey=g[45].key),m[1]&16384&&(_.varSlots=g[121]()),f.$set(_)},i(g){d||(st(f.$$.fragment,g),d=!0)},o(g){ct(f.$$.fragment,g),d=!1},d(g){g&&D(t),Qt(f),h=!1,lt(p)}}}function Js(e){let t,n,r,i,l,o,a,c,f,d,h,p;return f=new wd({props:{phraseKey:e[46].key,context:e[46].context||"",attributes:e[47][e[46].key+"\0"+(e[46].context||"")]||{},onSave:e[56]}}),{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h2"),i.textContent="Accessibility (ARIA)",l=E(),o=b("button"),o.textContent="×",a=E(),c=b("div"),ln(f.$$.fragment),s(i,"class","text-sm font-semibold text-gray-800"),s(o,"class","text-gray-400 hover:text-gray-700 text-xl leading-none"),s(r,"class","flex items-center justify-between px-6 pt-5 pb-3 border-b border-gray-100 sticky top-0 bg-white"),s(c,"class","px-6 py-5"),s(n,"class","bg-white rounded-xl shadow-2xl w-full max-w-xl max-h-[90vh] overflow-y-auto"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),mt(t,"background","rgba(0,0,0,0.45)"),s(t,"data-notranslate","")},m(g,m){F(g,t,m),u(t,n),u(n,r),u(r,i),u(r,l),u(r,o),u(n,a),u(n,c),Kt(f,c,null),d=!0,h||(p=[$(o,"click",e[123]),$(t,"click",Rr(e[124]))],h=!0)},p(g,m){const _={};m[1]&32768&&(_.phraseKey=g[46].key),m[1]&32768&&(_.context=g[46].context||""),m[1]&98304&&(_.attributes=g[47][g[46].key+"\0"+(g[46].context||"")]||{}),f.$set(_)},i(g){d||(st(f.$$.fragment,g),d=!0)},o(g){ct(f.$$.fragment,g),d=!1},d(g){g&&D(t),Qt(f),h=!1,lt(p)}}}function Kd(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k,j,J,W,G,Z,ne,O,Y,re,K,X,fe,ye,Ie,le,ve,se,te=e[20]&&vs(e),Se=Be(["pending","approved","trash"]),S=[];for(let oe=0;oe<3;oe+=1)S[oe]=ws(ys(e,Se,oe));let ie=e[0]==="approved"&&ks(e),q=(e[0]==="pending"||e[0]==="approved")&&As(e),H=(e[34]||e[6]>0)&&Ss(e),U=Be(e[7]),V=[];for(let oe=0;oe<U.length;oe+=1)V[oe]=Ts(bs(e,U,oe));let ae=Be(e[15]),ce=[];for(let oe=0;oe<ae.length;oe+=1)ce[oe]=Ms(_s(e,ae,oe));let Q=e[25]&&Es(e),de=e[26]&&Is(e),ge=(e[14].size>0||e[22])&&Ls(e),he=e[44].length>0&&Os(e);const xe=[Ud,Od,jd],Re=[];function we(oe,Fe){return oe[18]?0:oe[1].length===0?1:2}Y=we(e),re=Re[Y]=xe[Y](e);let Me=e[41]&&e[42]&&Ws(e),ze=e[32]&&Vs(e),Ee=e[45]&&Xs(e),Ge=e[46]&&Js(e);return{c(){t=b("div"),te&&te.c(),n=E(),r=b("div"),i=b("div");for(let oe=0;oe<3;oe+=1)S[oe].c();l=E(),o=b("div"),ie&&ie.c(),a=E(),q&&q.c(),c=E(),H&&H.c(),f=E(),d=b("div"),h=b("select");for(let oe=0;oe<V.length;oe+=1)V[oe].c();p=E(),g=b("div"),m=b("select"),_=b("option"),_.textContent="All fields",v=b("option"),v.textContent="Key",y=b("option"),y.textContent="Context",w=b("option"),w.textContent="Translation",C=E(),x=b("div"),A=b("input"),L=E(),I=b("span"),I.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',P=E(),z=b("select"),R=b("option"),R.textContent="All",T=b("option"),T.textContent="Translated",N=b("option"),N.textContent="Not Translated",k=E(),j=b("select"),J=b("option"),J.textContent="All Labels";for(let oe=0;oe<ce.length;oe+=1)ce[oe].c();W=E(),Q&&Q.c(),G=E(),de&&de.c(),Z=E(),ge&&ge.c(),ne=E(),he&&he.c(),O=E(),re.c(),K=E(),Me&&Me.c(),X=E(),ze&&ze.c(),fe=E(),Ee&&Ee.c(),ye=E(),Ge&&Ge.c(),Ie=xt(),s(i,"class","flex items-center gap-1"),s(o,"class","flex items-center gap-2 -mb-px pb-2"),s(o,"data-notranslate",""),s(r,"class","flex items-center justify-between mb-4 border-b border-gray-200"),s(h,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[8]===void 0&&Dt(()=>e[88].call(h)),_.__value="all",De(_,_.__value),v.__value="key",De(v,v.__value),y.__value="context",De(y,y.__value),w.__value="translation",De(w,w.__value),s(m,"class","px-2 py-2 border border-r-0 border-gray-300 rounded-l-md text-xs text-gray-500 bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 min-w-[90px]"),e[11]===void 0&&Dt(()=>e[89].call(m)),s(A,"type","text"),s(A,"placeholder",M=e[11]==="key"?"Search by key…":e[11]==="context"?"Search by context…":e[11]==="translation"?"Search by translated value…":"Search keys, context, translations…"),s(A,"class","w-full pl-8 pr-3 py-2 border border-gray-300 rounded-r-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(I,"class","absolute left-2.5 top-2.5 text-gray-400"),s(x,"class","flex-1 relative"),s(g,"class","flex-1 flex gap-0"),R.__value="all",De(R,R.__value),T.__value="yes",De(T,T.__value),N.__value="no",De(N,N.__value),s(z,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[12]===void 0&&Dt(()=>e[92].call(z)),J.__value="",De(J,J.__value),s(j,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[13]===void 0&&Dt(()=>e[94].call(j)),s(d,"class","flex flex-wrap items-center gap-3 mb-4"),s(d,"data-notranslate","")},m(oe,Fe){F(oe,t,Fe),te&&te.m(t,null),u(t,n),u(t,r),u(r,i);for(let me=0;me<3;me+=1)S[me]&&S[me].m(i,null);u(r,l),u(r,o),ie&&ie.m(o,null),u(o,a),q&&q.m(o,null),u(t,c),H&&H.m(t,null),u(t,f),u(t,d),u(d,h);for(let me=0;me<V.length;me+=1)V[me]&&V[me].m(h,null);vt(h,e[8],!0),u(d,p),u(d,g),u(g,m),u(m,_),u(m,v),u(m,y),u(m,w),vt(m,e[11],!0),u(g,C),u(g,x),u(x,A),De(A,e[10]),u(x,L),u(x,I),u(d,P),u(d,z),u(z,R),u(z,T),u(z,N),vt(z,e[12],!0),u(d,k),u(d,j),u(j,J);for(let me=0;me<ce.length;me+=1)ce[me]&&ce[me].m(j,null);vt(j,e[13],!0),u(t,W),Q&&Q.m(t,null),u(t,G),de&&de.m(t,null),u(t,Z),ge&&ge.m(t,null),u(t,ne),he&&he.m(t,null),u(t,O),Re[Y].m(t,null),F(oe,K,Fe),Me&&Me.m(oe,Fe),F(oe,X,Fe),ze&&ze.m(oe,Fe),F(oe,fe,Fe),Ee&&Ee.m(oe,Fe),F(oe,ye,Fe),Ge&&Ge.m(oe,Fe),F(oe,Ie,Fe),le=!0,ve||(se=[$(h,"change",e[88]),$(h,"change",e[58]),$(m,"change",e[89]),$(m,"change",e[90]),$(A,"input",e[91]),$(A,"input",e[62]),$(z,"change",e[92]),$(z,"change",e[93]),$(j,"change",e[94]),$(j,"change",e[95])],ve=!0)},p(oe,Fe){if(oe[20]?te?te.p(oe,Fe):(te=vs(oe),te.c(),te.m(t,n)):te&&(te.d(1),te=null),Fe[0]&513|Fe[1]&67108864|Fe[2]&131072){Se=Be(["pending","approved","trash"]);let Ae;for(Ae=0;Ae<3;Ae+=1){const Ue=ys(oe,Se,Ae);S[Ae]?S[Ae].p(Ue,Fe):(S[Ae]=ws(Ue),S[Ae].c(),S[Ae].m(i,null))}for(;Ae<3;Ae+=1)S[Ae].d(1)}if(oe[0]==="approved"?ie?ie.p(oe,Fe):(ie=ks(oe),ie.c(),ie.m(o,a)):ie&&(ie.d(1),ie=null),oe[0]==="pending"||oe[0]==="approved"?q?q.p(oe,Fe):(q=As(oe),q.c(),q.m(o,null)):q&&(q.d(1),q=null),oe[34]||oe[6]>0?H?H.p(oe,Fe):(H=Ss(oe),H.c(),H.m(t,f)):H&&(H.d(1),H=null),Fe[0]&128){U=Be(oe[7]);let Ae;for(Ae=0;Ae<U.length;Ae+=1){const Ue=bs(oe,U,Ae);V[Ae]?V[Ae].p(Ue,Fe):(V[Ae]=Ts(Ue),V[Ae].c(),V[Ae].m(h,null))}for(;Ae<V.length;Ae+=1)V[Ae].d(1);V.length=U.length}if(Fe[0]&384&&vt(h,oe[8]),Fe[0]&2048&&vt(m,oe[11]),(!le||Fe[0]&2048&&M!==(M=oe[11]==="key"?"Search by key…":oe[11]==="context"?"Search by context…":oe[11]==="translation"?"Search by translated value…":"Search keys, context, translations…"))&&s(A,"placeholder",M),Fe[0]&1024&&A.value!==oe[10]&&De(A,oe[10]),Fe[0]&4096&&vt(z,oe[12]),Fe[0]&32768){ae=Be(oe[15]);let Ae;for(Ae=0;Ae<ae.length;Ae+=1){const Ue=_s(oe,ae,Ae);ce[Ae]?ce[Ae].p(Ue,Fe):(ce[Ae]=Ms(Ue),ce[Ae].c(),ce[Ae].m(j,null))}for(;Ae<ce.length;Ae+=1)ce[Ae].d(1);ce.length=ae.length}Fe[0]&40960&&vt(j,oe[13]),oe[25]?Q?Q.p(oe,Fe):(Q=Es(oe),Q.c(),Q.m(t,G)):Q&&(Q.d(1),Q=null),oe[26]?de?de.p(oe,Fe):(de=Is(oe),de.c(),de.m(t,Z)):de&&(de.d(1),de=null),oe[14].size>0||oe[22]?ge?ge.p(oe,Fe):(ge=Ls(oe),ge.c(),ge.m(t,ne)):ge&&(ge.d(1),ge=null),oe[44].length>0?he?(he.p(oe,Fe),Fe[1]&8192&&st(he,1)):(he=Os(oe),he.c(),st(he,1),he.m(t,O)):he&&(Jt(),ct(he,1,1,()=>{he=null}),qt());let me=Y;Y=we(oe),Y===me?Re[Y].p(oe,Fe):(Jt(),ct(Re[me],1,1,()=>{Re[me]=null}),qt(),re=Re[Y],re?re.p(oe,Fe):(re=Re[Y]=xe[Y](oe),re.c()),st(re,1),re.m(t,null)),oe[41]&&oe[42]?Me?Me.p(oe,Fe):(Me=Ws(oe),Me.c(),Me.m(X.parentNode,X)):Me&&(Me.d(1),Me=null),oe[32]?ze?ze.p(oe,Fe):(ze=Vs(oe),ze.c(),ze.m(fe.parentNode,fe)):ze&&(ze.d(1),ze=null),oe[45]?Ee?(Ee.p(oe,Fe),Fe[1]&16384&&st(Ee,1)):(Ee=Xs(oe),Ee.c(),st(Ee,1),Ee.m(ye.parentNode,ye)):Ee&&(Jt(),ct(Ee,1,1,()=>{Ee=null}),qt()),oe[46]?Ge?(Ge.p(oe,Fe),Fe[1]&32768&&st(Ge,1)):(Ge=Js(oe),Ge.c(),st(Ge,1),Ge.m(Ie.parentNode,Ie)):Ge&&(Jt(),ct(Ge,1,1,()=>{Ge=null}),qt())},i(oe){le||(st(he),st(re),st(Ee),st(Ge),le=!0)},o(oe){ct(he),ct(re),ct(Ee),ct(Ge),le=!1},d(oe){oe&&(D(t),D(K),D(X),D(fe),D(ye),D(Ie)),te&&te.d(),ft(S,oe),ie&&ie.d(),q&&q.d(),H&&H.d(),ft(V,oe),ft(ce,oe),Q&&Q.d(),de&&de.d(),ge&&ge.d(),he&&he.d(),Re[Y].d(),Me&&Me.d(oe),ze&&ze.d(oe),Ee&&Ee.d(oe),Ge&&Ge.d(oe),ve=!1,lt(se)}}}const bi=50;function Qd(e){return e.key+"\0"+(e.context||"")}function qs(e,t){const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function yi(e,t){const n=e.contexts.map(i=>i.key_id),r=n.filter(i=>t.has(i)).length;return r===0?"none":r===n.length?"all":"some"}function $d(e,t){const n=e.contexts||[];if(t==="word")return e.master_key_id?[e.master_key_id]:n.length===0?[]:[n[0].key_id];const r=new Set(n.map(i=>i.key_id));return e.master_key_id&&r.add(e.master_key_id),[...r]}function e0(e,t,n){let r,i,l,o,a;ti(e,dn,ue=>n(132,a=ue));let{params:c={}}=t;const f=["pending","approved","trash"],d=[25,50,100];let p=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"hi",name:"Hindi"},{code:"te",name:"Telugu"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}];function g(ue){const Ne=new URLSearchParams(ue||"");return{page:Math.max(1,parseInt(Ne.get("page"),10)||1),pageSize:d.includes(parseInt(Ne.get("pageSize"),10))?parseInt(Ne.get("pageSize"),10):50,lang:Ne.get("lang")||null,search:Ne.get("search")||"",filter:["all","yes","no"].includes(Ne.get("filter"))?Ne.get("filter"):"all",label:Ne.get("label")||""}}let m="zh-Hans",_=f.includes(c.tab)?c.tab:"pending",v=[],y={pending:0,approved:0,trash:0},w="",C="all",x="all",A="",M=new Set,L=!1,I=[],P=!1,z=!1,R=!1,T=0,N=0,k="",j=!1,J;function W(ue){n(19,k=ue),n(20,j=!0),J&&clearTimeout(J),J=setTimeout(()=>{n(20,j=!1)},3500)}let G=1,Z=50,ne=0;function O(){const ue=new URLSearchParams;G>1&&ue.set("page",G),Z!==50&&ue.set("pageSize",Z),m&&ue.set("lang",m),w.trim()&&ue.set("search",w.trim()),x!=="all"&&ue.set("filter",x),A&&ue.set("label",A);const Ne=ue.toString(),Ke=`/translations/${f.includes(c.tab)?c.tab:_}${Ne?"?"+Ne:""}`;window.location.replace("#"+Ke)}let Y=!1,re="",K=0,X=0,fe=0,ye=!1,Ie=!1,le="",ve="",se="",te="",Se=null,S=null,ie={},q=!1,H=0,U="",V="",ae=!1,ce=[],Q="",de=!1,ge=!1,he=null,xe=!1,Re=[],we=null,Me=null,ze=null,Ee={};function Ge(ue){const Ne=Ee[Qd(ue)];return Ne&&Object.keys(Ne).length>0}function oe(){n(6,H=0),n(35,U="")}async function Fe(){n(34,q=!0),n(6,H=10),n(35,U="Preparing export..."),n(36,V=""),n(37,ae=!1);try{n(6,H=25),n(35,U="Fetching translations...");const ue=await We("../api/export");if(!ue.ok)throw new Error("Export failed");const Ne=await ue.json();if(Ne.error)throw new Error(Ne.error);n(6,H=70),n(35,U="Building JSON file...");const nt=new Blob([JSON.stringify(Ne,null,2)],{type:"application/json"});n(6,H=90),n(35,U="Starting download..."),qs(nt,"loco-translations.json"),n(6,H=100),n(35,U="Download complete"),n(36,V="Downloaded!"),setTimeout(()=>n(36,V=""),2e3)}catch(ue){n(36,V=ue.message||"Export failed"),setTimeout(()=>n(36,V=""),3e3)}finally{setTimeout(()=>{n(34,q=!1),oe()},400)}}async function me(){n(34,q=!0),n(6,H=10),n(35,U="Preparing export..."),n(36,V=""),n(37,ae=!1);try{n(6,H=20),n(35,U="Fetching translations...");const ue=await We("../api/export");if(!ue.ok)throw new Error("Export failed");const Ne=await ue.json();if(Ne.error)throw new Error(Ne.error);const nt=Ne.languages||[];if(nt.length===0)throw new Error("No translations to export");const Ke=new zd;for(let tn=0;tn<nt.length;tn++){const Zt=nt[tn],Pt={languages:[Zt],languageNames:Ne.languageNames,translations:{[Zt]:Ne.translations[Zt]},timestamp:Ne.timestamp};Ke.file(`${Zt}.json`,JSON.stringify(Pt,null,2)),n(6,H=Math.max(H,Math.min(70,30+Math.round((tn+1)/nt.length*40)))),n(35,U=`Packaging ${tn+1}/${nt.length} languages...`)}n(35,U="Compressing ZIP...");const ht=await Ke.generateAsync({type:"blob"},tn=>{const Zt=Math.min(98,70+Math.round((tn.percent||0)*.28));Zt>H&&n(6,H=Zt)});n(6,H=100),n(35,U="Download complete"),qs(ht,"loco-translations.zip"),n(36,V=`Downloaded ZIP with ${nt.length} language(s)!`),setTimeout(()=>n(36,V=""),2e3)}catch(ue){n(36,V=ue.message||"Export failed"),setTimeout(()=>n(36,V=""),3e3)}finally{setTimeout(()=>{n(34,q=!1),oe()},400)}}async function Ae(ue){if(!ue||ie[ue]!==void 0)return;n(33,ie[ue]=null,ie);const nt=await(await We(`../api/screenshots?url=${encodeURIComponent(ue)}`)).json();n(33,ie[ue]=nt.screenshot||!1,ie),n(33,ie)}jr(()=>{const ue=window.location.hash||"",Ne=ue.indexOf("?"),nt=Ne>=0?ue.slice(Ne+1):"",Ke=g(nt);n(21,G=Ke.page),n(2,Z=Ke.pageSize),n(10,w=Ke.search),n(12,x=Ke.filter),n(13,A=Ke.label);try{const ht=JSON.parse(a.settings||"{}");ht.languages&&ht.languages.length&&n(7,p=ht.languages)}catch{}return Ke.lang?n(8,m=Ke.lang):p.length&&n(8,m=p[0].code||p[0]),n(81,L=!0),O(),Ce(),qe(),Ue(),()=>{J&&clearTimeout(J),it()}});async function Ue(){try{const ue=await We("../api/prompts");if(!ue.ok)return;const Ne=await ue.json();n(38,ce=Ne||[]),n(39,Q=ce.length?ce[0].id:"")}catch{n(38,ce=[]),n(39,Q="")}}async function Ce(){n(18,R=!0),await Promise.all([Te(),et(),Xe()]),n(18,R=!1)}async function Te(){const ue=++T,Ne=new URLSearchParams({lang:m,status:_,group:"key",page:G,limit:Z});Ne.set("coverage","master"),w.trim()&&(Ne.set("search",w.trim()),C!=="all"&&Ne.set("search_field",C)),x!=="all"&&Ne.set("translated",x),A&&Ne.set("label",A);const Ke=await(await We(`../api/translations/all?${Ne}`)).json();ue===T&&(n(1,v=Ke.groups||[]),n(3,ne=Ke.total),n(14,M=new Set),n(17,z=!1),n(31,Se=null))}async function et(){const ue=++N,nt=await(await We("../api/translations/counts")).json();ue===N&&n(9,y=nt)}async function Xe(){try{const ue=await We("../api/aria/all");if(!ue.ok)return;const Ne=await ue.json(),nt={};for(const Ke of Ne)nt[Ke.key+"\0"+(Ke.context||"")]=Ke.attributes||{};n(47,Ee=nt)}catch(ue){console.warn("[loco] Failed to load ARIA rules:",ue)}}async function Le(ue){const Ne=ze;if(Ne){n(46,ze=null);try{const nt=await We("../api/aria",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:Ne.key,context:Ne.context||"",attributes:ue})});if(!nt.ok)throw new Error(`Save failed (HTTP ${nt.status})`);const Ke=Ne.key+"\0"+(Ne.context||"");if(ue&&Object.keys(ue).length>0)n(47,Ee={...Ee,[Ke]:ue});else{const ht={...Ee};delete ht[Ke],n(47,Ee=ht)}W("ARIA rules saved")}catch(nt){console.warn("[loco] Failed to save ARIA rule:",nt),W("Failed to save ARIA rules")}}}function Ye(ue){Cr(`/translations/${ue}`)}function ke(){n(21,G=1),O(),Ce()}async function qe(){const ue=await We("../api/labels");ue.ok&&n(15,I=await ue.json())}async function tt(ue,Ne,nt){nt.some(ht=>ht.id===Ne)?await We(`../api/labels/${Ne}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[ue]})}):await We(`../api/labels/${Ne}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[ue]})}),await Te()}async function yt(ue){M.size!==0&&(await We(`../api/labels/${ue}/assign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...M]})}),n(16,P=!1),await Te(),await qe())}async function Rt(ue){M.size!==0&&(await We(`../api/labels/${ue}/unassign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({textnodeIds:[...M]})}),n(16,P=!1),await Te(),await qe())}let Mt;function en(){clearTimeout(Mt),Mt=setTimeout(()=>{n(21,G=1),O(),Te()},300)}function jt(){z?(n(14,M=new Set),n(17,z=!1)):(n(14,M=new Set(r.map(ue=>ue.key_id))),n(17,z=!0))}function Ot(ue){const Ne=ue.contexts.map(Ke=>Ke.key_id);Ne.every(Ke=>M.has(Ke))?Ne.forEach(Ke=>M.delete(Ke)):Ne.forEach(Ke=>M.add(Ke)),n(14,M=new Set(M)),n(17,z=M.size===r.length&&r.length>0)}async function be(ue){n(32,S=ue),ue!=null&&ue.url&&await Ae(ue.url)}function He(ue){const Ne=Se===ue.key;n(31,Se=Ne?null:ue.key)}function Je(ue){de||(n(42,he=ue),n(43,xe=!1),n(41,ge=!0))}function at(){n(41,ge=!1),n(42,he=null),n(43,xe=!1)}async function wt(ue,Ne,nt=Q){if(de)return;if(!nt&&(await Ue(),!Q))return W("No prompt template found. Create one in AI Translate first."),!1;const Ke=$d(ue,Ne);if(Ke.length===0)return W("No phrases available to translate in this group."),!1;n(40,de=!0);try{const ht=await We("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:Ke,lang:m,prompt_id:nt,include_screenshots:!1,mode:Ne})}),tn=await ht.json().catch(()=>({}));if(!ht.ok||tn.error)throw new Error(tn.error||`Failed to queue AI job (HTTP ${ht.status})`);return bt(),ut(),!0}catch(ht){return W(ht.message||"Failed to queue AI translation job."),!1}finally{n(40,de=!1)}}async function _t(){try{const Ne=await(await We("../api/ai-jobs")).json();n(44,Re=Ne.jobs||[])}catch{}}async function ut(){await Promise.allSettled([Te(),_t()])}function bt(){we||(we=setInterval(async()=>{await _t(),Re.some(Ne=>Ne.status==="running"||Ne.status==="pending")||(it(),await Ce())},2e3))}function it(){we&&(clearInterval(we),we=null)}async function Ze(ue){await We(`../api/ai-jobs/${encodeURIComponent(ue)}`,{method:"DELETE"}),await _t()}function Oe(ue){n(44,Re=Re.filter(Ne=>Ne.id!==ue))}async function Qe(){if(!he)return;if(!Q){W("Select a prompt template first.");return}await wt(he,xe?"context":"word",Q)&&(at(),W("Translation job queued — watch progress below!"))}const St={pending:"Moving to Pending",approved:"Approving",trash:"Trashing"};async function ot(ue){if(M.size===0||Y)return;const Ne=[...M];n(22,Y=!0),n(23,re=St[ue]||"Moving"),n(4,K=0),n(5,X=Ne.length),n(24,fe=0),await Lr();try{for(let nt=0;nt<Ne.length;nt+=bi){const Ke=Ne.slice(nt,nt+bi);try{(await We("../api/textnodes/status",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:Ke,status:ue})})).ok||n(24,fe+=Ke.length)}catch{n(24,fe+=Ke.length)}n(4,K=Math.min(nt+Ke.length,Ne.length))}await Ce(),W(fe===0?`${Ne.length} item(s) ${re.toLowerCase()} successfully`:`${fe} of ${Ne.length} item(s) failed`)}finally{n(22,Y=!1),fe===0&&(n(4,K=0),n(5,X=0))}}async function In(){if(M.size===0||Y||!confirm(`Permanently delete ${M.size} item(s)? This cannot be undone.`))return;const ue=[...M];n(22,Y=!0),n(23,re="Deleting"),n(4,K=0),n(5,X=ue.length),n(24,fe=0),await Lr();try{for(let Ne=0;Ne<ue.length;Ne+=bi){const nt=ue.slice(Ne,Ne+bi);try{(await We("../api/textnodes/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:nt})})).ok||n(24,fe+=nt.length)}catch{n(24,fe+=nt.length)}n(4,K=Math.min(Ne+nt.length,ue.length))}await Ce(),W(fe===0?`${ue.length} item(s) deleted permanently`:`${fe} of ${ue.length} item(s) failed to delete`)}finally{n(22,Y=!1),fe===0&&(n(4,K=0),n(5,X=0))}}async function Ln(ue,Ne){const nt=Me;if(nt){n(45,Me=null);try{const Ke=await We(`../api/phrases/${nt.key_id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:ue,varSlots:Ne})});if(!Ke.ok){const ht=await Ke.json().catch(()=>({}));throw new Error(ht.error||`Save failed (HTTP ${Ke.status})`)}await Promise.all([Te(),et()]),W("Phrase updated")}catch(Ke){console.warn("[loco] Failed to save var edits:",Ke),W("Failed to update phrase")}}}async function Nn(ue){try{await We("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:ue.key,context:ue.context||"",value:ue.value||""}]})}),W("Translation saved")}catch(Ne){console.error("Failed to save translation:",Ne),W("Failed to save translation")}}async function sr(ue){const Ne=ue.master_value||"";try{await We("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:ue.key,context:"",status:"approved"})}),await We("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:ue.key,context:"",value:Ne}]})}),W("Master translation saved")}catch(nt){console.error("Failed to save master translation:",nt),W("Failed to save master translation")}}async function Et(){if(le.trim())try{await We("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:le.trim(),context:ve.trim(),status:_})}),se.trim()&&await We("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:[{key:le.trim(),context:ve.trim(),value:se.trim()}]})}),n(27,le=""),n(28,ve=""),n(29,se=""),n(25,ye=!1),W("Translation added"),await Ce()}catch(ue){console.error("Failed to add translation:",ue),W("Failed to add translation")}}async function bn(){let ue;try{ue=JSON.parse(te)}catch{W("Invalid JSON");return}try{await We("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:m,translations:ue})}),n(30,te=""),n(26,Ie=!1),W(`Imported ${ue.length||Object.keys(ue).length} translation(s)`),await Ce()}catch(Ne){console.error("Failed to import translations:",Ne),W("Failed to import translations")}}const Pn={pending:{label:"Pending",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#d97706" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',actions:[{label:"Approve Selected",status:"approved",color:"bg-green-600 hover:bg-green-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},approved:{label:"Approved",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#16a34a" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',actions:[{label:"Move to Pending",status:"pending",color:"bg-yellow-600 hover:bg-yellow-700"},{label:"Trash Selected",status:"trash",color:"bg-red-600 hover:bg-red-700"}]},trash:{label:"Trash",icon:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="#dc2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>',actions:[{label:"Restore to Pending",status:"pending",color:"bg-blue-600 hover:bg-blue-700"},{label:"Move to Approved",status:"approved",color:"bg-green-600 hover:bg-green-700"}]}};function ar(ue){Ir.call(this,e,ue)}const un=ue=>Ye(ue),ur=()=>n(37,ae=!ae),zn=()=>n(37,ae=!1),cr=()=>{n(26,Ie=!Ie),n(25,ye=!1)},Hn=()=>{n(25,ye=!ye),n(26,Ie=!1)};function fr(){m=rn(this),n(8,m),n(7,p)}function Ct(){C=rn(this),n(11,C),n(81,L),n(80,c),n(0,_)}const Dn=()=>{w.trim()&&(n(21,G=1),O(),Te())};function dr(){w=this.value,n(10,w),n(81,L),n(80,c),n(0,_)}function Fn(){x=rn(this),n(12,x),n(81,L),n(80,c),n(0,_)}const hr=()=>{n(21,G=1),O(),Te()};function _e(){A=rn(this),n(13,A),n(15,I)}const Ve=()=>{n(21,G=1),O(),Te()};function $e(){le=this.value,n(27,le)}function Nt(){ve=this.value,n(28,ve)}function kt(){se=this.value,n(29,se)}function Ut(){te=this.value,n(30,te)}const Zn=ue=>ot(ue.status),Ht=()=>n(16,P=!P),cn=()=>n(16,P=!1),pr=ue=>yt(ue.id),Ur=ue=>Rt(ue.id),ci=ue=>Ot(ue),yn=ue=>He(ue),xn=ue=>{n(46,ze=ue)},gr=ue=>{n(45,Me=ue)},fi=ue=>Nn(ue),mr=()=>{n(21,G=1),O(),Te()},_r=()=>{n(21,G--,G),O(),Te()},Hr=()=>{n(21,G++,G),O(),Te()},di=()=>{n(21,G=i),O(),Te()};function Zr(){Z=rn(this),n(2,Z)}const Wn=()=>{n(21,G=1),O(),Te()};function Yn(){Q=rn(this),n(39,Q),n(38,ce)}function Gn(){xe=this.checked,n(43,xe)}const Wr=()=>n(32,S=null),hi=()=>n(32,S=null),pi=()=>n(45,Me=null),br=()=>{try{return JSON.parse(Me.var_slots||"[]")}catch{return[]}},fn=()=>n(45,Me=null),Bn=()=>n(46,ze=null),It=()=>n(46,ze=null);return e.$$set=ue=>{"params"in ue&&n(80,c=ue.params)},e.$$.update=()=>{if(e.$$.dirty[0]&1|e.$$.dirty[2]&786432&&L){const ue=f.includes(c.tab)?c.tab:"pending";ue!==_&&(n(0,_=ue),n(10,w=""),n(11,C="all"),n(12,x="all"),n(21,G=1),O(),Ce())}e.$$.dirty[0]&2&&(r=v.flatMap(ue=>ue.contexts||[])),e.$$.dirty[0]&12&&n(50,i=Math.max(1,Math.ceil(ne/Z))),e.$$.dirty[0]&48&&n(49,l=X>0?Math.round(K/X*100):0),e.$$.dirty[0]&64&&n(48,o=Math.max(0,Math.min(100,Math.round(H||0))))},[_,v,Z,ne,K,X,H,p,m,y,w,C,x,A,M,I,P,z,R,k,j,G,Y,re,fe,ye,Ie,le,ve,se,te,Se,S,ie,q,U,V,ae,ce,Q,de,ge,he,xe,Re,Me,ze,Ee,o,l,i,O,Ge,Fe,me,Te,Le,Ye,ke,tt,yt,Rt,en,jt,Ot,be,He,Je,at,Ze,Oe,Qe,ot,In,Ln,Nn,sr,Et,bn,Pn,c,L,ar,un,ur,zn,cr,Hn,fr,Ct,Dn,dr,Fn,hr,_e,Ve,$e,Nt,kt,Ut,Zn,Ht,cn,pr,Ur,ci,yn,xn,gr,fi,mr,_r,Hr,di,Zr,Wn,Yn,Gn,Wr,hi,pi,br,fn,Bn,It]}class Ks extends an{constructor(t){super(),sn(this,t,e0,Kd,$t,{params:80},null,[-1,-1,-1,-1,-1,-1])}}const t0="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHRpdGxlPkFJIFRyYW5zbGF0aW5nPC90aXRsZT4KICA8ZGVmcz4KICAgIDxzdHlsZT4KICAgICAgQGtleWZyYW1lcyB0ZXh0RmFkZSB7IDAlLDIwJXtvcGFjaXR5OjF9IDQwJSw2MCV7b3BhY2l0eTowfSA4MCUsMTAwJXtvcGFjaXR5OjF9IH0KICAgICAgQGtleWZyYW1lcyB0ZXh0QXBwZWFyIHsgMCUsNDAle29wYWNpdHk6MH0gNjAlLDEwMCV7b3BhY2l0eToxfSB9CiAgICAgIEBrZXlmcmFtZXMgc3BhcmtTcGluIHsgMCV7dHJhbnNmb3JtOnJvdGF0ZSgwZGVnKX0gMTAwJXt0cmFuc2Zvcm06cm90YXRlKDM2MGRlZyl9IH0KICAgICAgQGtleWZyYW1lcyBzcGFya1B1bHNlIHsgMCUsMTAwJXtvcGFjaXR5OjAuMztyOjJ9IDUwJXtvcGFjaXR5OjE7cjozLjV9IH0KICAgICAgI3NyYy10ZXh0IHsgYW5pbWF0aW9uOiB0ZXh0RmFkZSAzcyBlYXNlLWluLW91dCBpbmZpbml0ZTsgfQogICAgICAjdGd0LXRleHQgeyBhbmltYXRpb246IHRleHRBcHBlYXIgM3MgZWFzZS1pbi1vdXQgaW5maW5pdGU7IH0KICAgICAgI3NwYXJrLXJpbmcgeyBhbmltYXRpb246IHNwYXJrU3BpbiAzcyBsaW5lYXIgaW5maW5pdGU7IHRyYW5zZm9ybS1vcmlnaW46IDYwcHggNjBweDsgfQogICAgICAuc3AgeyBhbmltYXRpb246IHNwYXJrUHVsc2UgMS41cyBlYXNlLWluLW91dCBpbmZpbml0ZTsgfQogICAgICAuc3AyIHsgYW5pbWF0aW9uOiBzcGFya1B1bHNlIDEuNXMgZWFzZS1pbi1vdXQgMC4zcyBpbmZpbml0ZTsgfQogICAgICAuc3AzIHsgYW5pbWF0aW9uOiBzcGFya1B1bHNlIDEuNXMgZWFzZS1pbi1vdXQgMC42cyBpbmZpbml0ZTsgfQogICAgICAuc3A0IHsgYW5pbWF0aW9uOiBzcGFya1B1bHNlIDEuNXMgZWFzZS1pbi1vdXQgMC45cyBpbmZpbml0ZTsgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CgogIDwhLS0gYmFja2dyb3VuZCBjaXJjbGUgLS0+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNTAiIGZpbGw9IiMxYTFmMmUiLz4KCiAgPCEtLSByb3RhdGluZyBzcGFya2xlIHJpbmcgLS0+CiAgPGcgaWQ9InNwYXJrLXJpbmciPgogICAgPGNpcmNsZSBjbGFzcz0ic3AiIGN4PSI2MCIgY3k9IjE0IiByPSIyLjUiIGZpbGw9IiNGRkI4MzMiLz4KICAgIDxjaXJjbGUgY2xhc3M9InNwMiIgY3g9IjEwNiIgY3k9IjYwIiByPSIyLjUiIGZpbGw9IiMyRUNDODgiLz4KICAgIDxjaXJjbGUgY2xhc3M9InNwMyIgY3g9IjYwIiBjeT0iMTA2IiByPSIyLjUiIGZpbGw9IiMzQThGRTAiLz4KICAgIDxjaXJjbGUgY2xhc3M9InNwNCIgY3g9IjE0IiBjeT0iNjAiIHI9IjIuNSIgZmlsbD0iI0YwNzA0MCIvPgogIDwvZz4KCiAgPCEtLSBzb3VyY2UgdGV4dCBmYWRpbmcgb3V0IC0tPgogIDxnIGlkPSJzcmMtdGV4dCI+CiAgICA8dGV4dCB4PSI2MCIgeT0iNTUiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZvbnQtZmFtaWx5PSJzeXN0ZW0tdWksc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iI0U2RjFGQiI+SGVsbG88L3RleHQ+CiAgPC9nPgoKICA8IS0tIHRhcmdldCB0ZXh0IGZhZGluZyBpbiAtLT4KICA8ZyBpZD0idGd0LXRleHQiPgogICAgPHRleHQgeD0iNjAiIHk9Ijc1IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LWZhbWlseT0ic3lzdGVtLXVpLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iMTQiIGZvbnQtd2VpZ2h0PSI2MDAiIGZpbGw9IiMyRUNDODgiPkJvbmpvdXI8L3RleHQ+CiAgPC9nPgo8L3N2Zz4K",n0="data:image/svg+xml,%3csvg%20width='120'%20height='120'%20viewBox='0%200%20120%20120'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eScanning%20page%3c/title%3e%3cdefs%3e%3cstyle%3e%20@keyframes%20scanLine%20{%200%25%20{%20transform:%20translateY(-30px);%20opacity:%200;%20}%2010%25%20{%20opacity:%201;%20}%2090%25%20{%20opacity:%201;%20}%20100%25%20{%20transform:%20translateY(30px);%20opacity:%200;%20}%20}%20@keyframes%20textHighlight%20{%200%25,30%25%20{%20fill:%20%23555;%20}%2050%25%20{%20fill:%20%232ECC88;%20}%2070%25,100%25%20{%20fill:%20%23555;%20}%20}%20@keyframes%20docPulse%20{%200%25,100%25%20{%20transform:%20scale(1);%20}%2050%25%20{%20transform:%20scale(1.02);%20}%20}%20%23scan-line%20{%20animation:%20scanLine%202s%20ease-in-out%20infinite;%20}%20%23doc%20{%20animation:%20docPulse%202s%20ease-in-out%20infinite;%20transform-origin:%2060px%2060px;%20}%20.txt1%20{%20animation:%20textHighlight%202s%20ease-in-out%20infinite;%20}%20.txt2%20{%20animation:%20textHighlight%202s%20ease-in-out%200.3s%20infinite;%20}%20.txt3%20{%20animation:%20textHighlight%202s%20ease-in-out%200.6s%20infinite;%20}%20.txt4%20{%20animation:%20textHighlight%202s%20ease-in-out%200.9s%20infinite;%20}%20%3c/style%3e%3c/defs%3e%3c!--%20page%20document%20--%3e%3cg%20id='doc'%3e%3crect%20x='30'%20y='20'%20width='60'%20height='80'%20rx='4'%20fill='%23f8f8f8'%20stroke='%23ddd'%20stroke-width='1.5'/%3e%3c!--%20text%20lines%20--%3e%3crect%20class='txt1'%20x='38'%20y='32'%20width='44'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20class='txt2'%20x='38'%20y='42'%20width='36'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20class='txt3'%20x='38'%20y='52'%20width='40'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20class='txt4'%20x='38'%20y='62'%20width='30'%20height='4'%20rx='2'%20fill='%23555'/%3e%3crect%20x='38'%20y='72'%20width='38'%20height='4'%20rx='2'%20fill='%23ddd'/%3e%3crect%20x='38'%20y='82'%20width='28'%20height='4'%20rx='2'%20fill='%23ddd'/%3e%3c/g%3e%3c!--%20scanning%20beam%20--%3e%3crect%20id='scan-line'%20x='28'%20y='58'%20width='64'%20height='3'%20rx='1.5'%20fill='%232ECC88'%20opacity='0.7'/%3e%3c/svg%3e";function Qs(e,t,n){const r=e.slice();return r[130]=t[n],r}function $s(e,t,n){const r=e.slice();return r[122]=t[n],r}function ea(e,t,n){const r=e.slice();return r[119]=t[n],r}function ta(e,t,n){const r=e.slice();return r[122]=t[n],r}function na(e,t,n){const r=e.slice();return r[125]=t[n],r}function ra(e,t,n){const r=e.slice();return r[133]=t[n],r}function ia(e){let t,n,r=e[133].icon+"",i,l=e[133].label+"",o,a,c,f,d;function h(){return e[66](e[133])}return{c(){t=b("button"),n=b("span"),i=E(),o=B(l),a=E(),s(n,"class","inline-flex items-center"),s(t,"class",c="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[22]===e[133].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))},m(p,g){F(p,t,g),u(t,n),n.innerHTML=r,u(t,i),u(t,o),u(t,a),f||(d=$(t,"click",h),f=!0)},p(p,g){e=p,g[0]&4194304&&c!==(c="px-4 py-2.5 text-sm font-medium transition-colors border-b-2 -mb-px "+(e[22]===e[133].id?"border-indigo-600 text-indigo-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"))&&s(t,"class",c)},d(p){p&&D(t),f=!1,d()}}}function r0(e){let t,n,r=e[14].length+"",i,l,o,a,c,f,d,h;function p(_,v){return _[14].length===0?a0:s0}let g=p(e),m=g(e);return{c(){t=b("div"),n=b("p"),i=B(r),l=B(" job(s) in history"),o=E(),a=b("button"),a.textContent="Refresh",c=E(),m.c(),f=xt(),s(n,"class","text-sm text-gray-500"),s(a,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),s(t,"class","flex items-center justify-between mb-4")},m(_,v){F(_,t,v),u(t,n),u(n,i),u(n,l),u(t,o),u(t,a),F(_,c,v),m.m(_,v),F(_,f,v),d||(h=$(a,"click",e[37]),d=!0)},p(_,v){v[0]&16384&&r!==(r=_[14].length+"")&&ee(i,r),g===(g=p(_))&&m?m.p(_,v):(m.d(1),m=g(_),m&&(m.c(),m.m(f.parentNode,f)))},i:je,o:je,d(_){_&&(D(t),D(c),D(f)),m.d(_),d=!1,h()}}}function i0(e){let t,n,r=e[5].length+"",i,l,o,a,c,f,d,h,p,g=e[8]&&oa(e);function m(y,w){return y[5].length===0&&!y[8]?d0:f0}let _=m(e),v=_(e);return{c(){t=b("div"),n=b("p"),i=B(r),l=B(" prompt template(s)"),o=E(),a=b("button"),a.textContent="+ New Prompt",c=E(),g&&g.c(),f=E(),v.c(),d=xt(),s(n,"class","text-sm text-gray-500"),s(a,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700"),s(t,"class","flex items-center justify-between mb-4")},m(y,w){F(y,t,w),u(t,n),u(n,i),u(n,l),u(t,o),u(t,a),F(y,c,w),g&&g.m(y,w),F(y,f,w),v.m(y,w),F(y,d,w),h||(p=$(a,"click",e[39]),h=!0)},p(y,w){w[0]&32&&r!==(r=y[5].length+"")&&ee(i,r),y[8]?g?g.p(y,w):(g=oa(y),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null),_===(_=m(y))&&v?v.p(y,w):(v.d(1),v=_(y),v&&(v.c(),v.m(d.parentNode,d)))},i:je,o:je,d(y){y&&(D(t),D(c),D(f),D(d)),g&&g.d(y),v.d(y),h=!1,p()}}}function l0(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k=e[34]>0?`Translate (${e[34]} selected)`:"Translate",j,J,W,G,Z,ne,O,Y,re,K,X,fe,ye,Ie,le,ve,se,te,Se,S,ie,q,H,U,V,ae,ce;t=new Rc({props:{jobs:e[13],onCancel:e[61],onDismiss:e[62]}});let Q=Be(e[15]),de=[];for(let me=0;me<Q.length;me+=1)de[me]=ca(na(e,Q,me));let ge=e[5].length===0&&fa(),he=Be(e[5]),xe=[];for(let me=0;me<he.length;me+=1)xe[me]=da(ta(e,he,me));function Re(me,Ae){return me[19]?p0:h0}let we=Re(e),Me=we(e),ze=e[29]&&ha(e),Ee=e[27]&&ma(e);const Ge=[x0,k0,w0],oe=[];function Fe(me,Ae){return me[24]?0:me[1].length===0?1:2}return q=Fe(e),H=oe[q]=Ge[q](e),{c(){ln(t.$$.fragment),n=E(),r=b("div"),i=b("div"),l=b("label"),l.textContent="Language",o=E(),a=b("select");for(let me=0;me<de.length;me+=1)de[me].c();c=E(),f=b("div"),d=b("label"),d.textContent="Prompt Template",h=E(),p=b("select"),ge&&ge.c(),g=xt();for(let me=0;me<xe.length;me+=1)xe[me].c();m=E(),_=b("div"),v=b("div"),v.textContent=" ",y=E(),w=b("label"),C=b("input"),x=B(`
|
|
18
|
+
Include screenshots`),A=E(),M=b("div"),L=E(),I=b("div"),P=b("div"),P.textContent=" ",z=E(),R=b("div"),T=b("button"),Me.c(),N=E(),j=B(k),W=E(),ze&&ze.c(),G=E(),Ee&&Ee.c(),Z=E(),ne=b("div"),O=b("div"),Y=b("input"),re=E(),K=b("span"),K.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',X=E(),fe=b("select"),ye=b("option"),ye.textContent="All",Ie=b("option"),Ie.textContent="Translated",le=b("option"),le.textContent="Not Translated",ve=E(),se=b("span"),te=b("span"),Se=B(e[4]),S=b("span"),S.textContent="approved keys",ie=E(),H.c(),U=xt(),s(l,"for","ai-translate-language"),s(l,"class","text-xs text-gray-500 font-medium"),s(a,"id","ai-translate-language"),s(a,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[0]===void 0&&Dt(()=>e[67].call(a)),s(i,"class","flex flex-col gap-1"),s(d,"for","ai-translate-prompt"),s(d,"class","text-xs text-gray-500 font-medium"),s(p,"id","ai-translate-prompt"),s(p,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[6]===void 0&&Dt(()=>e[69].call(p)),s(f,"class","flex flex-col gap-1"),s(v,"class","text-xs text-gray-500 font-medium"),s(v,"aria-hidden","true"),s(C,"type","checkbox"),s(C,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(w,"class","flex items-center gap-2 text-sm text-gray-600 cursor-pointer"),s(_,"class","flex flex-col gap-1 justify-end"),s(M,"class","flex-1"),s(P,"class","text-xs text-gray-500 font-medium"),s(P,"aria-hidden","true"),s(T,"class","px-4 py-2 bg-green-600 text-white text-sm rounded-md hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"),T.disabled=J=e[28]||e[19],s(R,"class","flex items-center gap-2"),s(I,"class","flex flex-col gap-1 justify-end"),s(r,"class","flex flex-wrap items-center gap-3 mb-4 p-4 bg-white border border-gray-200 rounded-lg"),s(Y,"type","text"),s(Y,"placeholder","Search approved keys…"),s(Y,"class","w-full pl-8 pr-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(K,"class","absolute left-2.5 top-2.5 text-gray-400 flex items-center"),s(O,"class","flex-1 relative"),ye.__value="all",De(ye,ye.__value),Ie.__value="translated",De(Ie,Ie.__value),le.__value="untranslated",De(le,le.__value),fe.disabled=e[24],s(fe,"class","px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[21]===void 0&&Dt(()=>e[76].call(fe)),s(te,"data-notranslate",""),s(S,"class","ml-1"),s(se,"class","text-xs text-gray-400"),s(ne,"class","flex items-center gap-3 mb-3")},m(me,Ae){Kt(t,me,Ae),F(me,n,Ae),F(me,r,Ae),u(r,i),u(i,l),u(i,o),u(i,a);for(let Ue=0;Ue<de.length;Ue+=1)de[Ue]&&de[Ue].m(a,null);vt(a,e[0],!0),u(r,c),u(r,f),u(f,d),u(f,h),u(f,p),ge&&ge.m(p,null),u(p,g);for(let Ue=0;Ue<xe.length;Ue+=1)xe[Ue]&&xe[Ue].m(p,null);vt(p,e[6],!0),u(r,m),u(r,_),u(_,v),u(_,y),u(_,w),u(w,C),C.checked=e[18],u(w,x),u(r,A),u(r,M),u(r,L),u(r,I),u(I,P),u(I,z),u(I,R),u(R,T),Me.m(T,null),u(T,N),u(T,j),F(me,W,Ae),ze&&ze.m(me,Ae),F(me,G,Ae),Ee&&Ee.m(me,Ae),F(me,Z,Ae),F(me,ne,Ae),u(ne,O),u(O,Y),De(Y,e[20]),u(O,re),u(O,K),u(ne,X),u(ne,fe),u(fe,ye),u(fe,Ie),u(fe,le),vt(fe,e[21],!0),u(ne,ve),u(ne,se),u(se,te),u(te,Se),u(se,S),F(me,ie,Ae),oe[q].m(me,Ae),F(me,U,Ae),V=!0,ae||(ce=[$(a,"change",e[67]),$(a,"change",e[68]),$(p,"change",e[69]),$(C,"change",e[70]),$(T,"click",e[71]),$(Y,"input",e[75]),$(Y,"input",e[46]),$(fe,"change",e[76]),$(fe,"change",e[77])],ae=!0)},p(me,Ae){const Ue={};if(Ae[0]&8192&&(Ue.jobs=me[13]),t.$set(Ue),Ae[0]&32768){Q=Be(me[15]);let Te;for(Te=0;Te<Q.length;Te+=1){const et=na(me,Q,Te);de[Te]?de[Te].p(et,Ae):(de[Te]=ca(et),de[Te].c(),de[Te].m(a,null))}for(;Te<de.length;Te+=1)de[Te].d(1);de.length=Q.length}if(Ae[0]&32769&&vt(a,me[0]),me[5].length===0?ge||(ge=fa(),ge.c(),ge.m(p,g)):ge&&(ge.d(1),ge=null),Ae[0]&32){he=Be(me[5]);let Te;for(Te=0;Te<he.length;Te+=1){const et=ta(me,he,Te);xe[Te]?xe[Te].p(et,Ae):(xe[Te]=da(et),xe[Te].c(),xe[Te].m(p,null))}for(;Te<xe.length;Te+=1)xe[Te].d(1);xe.length=he.length}Ae[0]&96&&vt(p,me[6]),Ae[0]&262144&&(C.checked=me[18]),we!==(we=Re(me))&&(Me.d(1),Me=we(me),Me&&(Me.c(),Me.m(T,N))),(!V||Ae[1]&8)&&k!==(k=me[34]>0?`Translate (${me[34]} selected)`:"Translate")&&ee(j,k),(!V||Ae[0]&268959744&&J!==(J=me[28]||me[19]))&&(T.disabled=J),me[29]?ze?ze.p(me,Ae):(ze=ha(me),ze.c(),ze.m(G.parentNode,G)):ze&&(ze.d(1),ze=null),me[27]?Ee?Ee.p(me,Ae):(Ee=ma(me),Ee.c(),Ee.m(Z.parentNode,Z)):Ee&&(Ee.d(1),Ee=null),Ae[0]&1048576&&Y.value!==me[20]&&De(Y,me[20]),(!V||Ae[0]&16777216)&&(fe.disabled=me[24]),Ae[0]&2097152&&vt(fe,me[21]),(!V||Ae[0]&16)&&ee(Se,me[4]);let Ce=q;q=Fe(me),q===Ce?oe[q].p(me,Ae):(Jt(),ct(oe[Ce],1,1,()=>{oe[Ce]=null}),qt(),H=oe[q],H?H.p(me,Ae):(H=oe[q]=Ge[q](me),H.c()),st(H,1),H.m(U.parentNode,U))},i(me){V||(st(t.$$.fragment,me),st(H),V=!0)},o(me){ct(t.$$.fragment,me),ct(H),V=!1},d(me){me&&(D(n),D(r),D(W),D(G),D(Z),D(ne),D(ie),D(U)),Qt(t,me),ft(de,me),ge&&ge.d(),ft(xe,me),Me.d(),ze&&ze.d(me),Ee&&Ee.d(me),oe[q].d(me),ae=!1,lt(ce)}}}function o0(e){let t;return{c(){t=b("div"),t.innerHTML=`<img src="${t0}" alt="Loading" class="w-16 h-16"/> <span>Loading...</span>`,s(t,"class","flex flex-col items-center justify-center gap-2 py-10 text-sm text-gray-500")},m(n,r){F(n,t,r)},p:je,i:je,o:je,d(n){n&&D(t)}}}function s0(e){let t,n,r,i,l,o=Be(e[14]),a=[];for(let c=0;c<o.length;c+=1)a[c]=la(Qs(e,o,c));return{c(){t=b("div"),n=b("table"),r=b("thead"),r.innerHTML='<tr class="bg-gray-50 border-b border-gray-200"><th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Status</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Job ID</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Prompt</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Language</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Progress</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Started</th> <th class="text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide">Finished</th></tr>',i=E(),l=b("tbody");for(let c=0;c<a.length;c+=1)a[c].c();s(n,"class","w-full"),s(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden")},m(c,f){F(c,t,f),u(t,n),u(n,r),u(n,i),u(n,l);for(let d=0;d<a.length;d+=1)a[d]&&a[d].m(l,null)},p(c,f){if(f[0]&16384|f[2]&2){o=Be(c[14]);let d;for(d=0;d<o.length;d+=1){const h=Qs(c,o,d);a[d]?a[d].p(h,f):(a[d]=la(h),a[d].c(),a[d].m(l,null))}for(;d<a.length;d+=1)a[d].d(1);a.length=o.length}},d(c){c&&D(t),ft(a,c)}}}function a0(e){let t;return{c(){t=b("div"),t.innerHTML="<p>No translation jobs yet.</p>",s(t,"class","text-center py-12 text-gray-400")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function la(e){let t,n,r,i,l=e[63](e[130].status)+"",o,a=e[130].status+"",c,f,d,h,p=e[130].job_id+"",g,m,_,v=(e[130].prompt_name||"—")+"",y,w,C,x=e[130].lang+"",A,M,L,I=e[130].completed+"",P,z,R=e[130].total+"",T,N,k=e[130].failed+"",j,J,W,G,Z=jn(e[130].created_at)+"",ne,O,Y,re=jn(e[130].finished_at)+"",K,X;return{c(){t=b("tr"),n=b("td"),r=b("span"),i=new Mc(!1),o=E(),c=B(a),d=E(),h=b("td"),g=B(p),m=E(),_=b("td"),y=B(v),w=E(),C=b("td"),A=B(x),M=E(),L=b("td"),P=B(I),z=B("/"),T=B(R),N=B(" ("),j=B(k),J=B(" failed)"),W=E(),G=b("td"),ne=B(Z),O=E(),Y=b("td"),K=B(re),X=E(),i.a=o,s(r,"class",f=ka(e[130].status)+" text-sm font-medium inline-flex items-center gap-1"),s(n,"class","px-3 py-2"),s(h,"class","px-3 py-2 text-xs font-mono text-gray-500"),s(_,"class","px-3 py-2 text-sm text-gray-700"),s(C,"class","px-3 py-2 text-sm text-gray-600"),s(L,"class","px-3 py-2 text-sm text-gray-600"),s(G,"class","px-3 py-2 text-xs text-gray-400"),s(Y,"class","px-3 py-2 text-xs text-gray-400"),s(t,"class","border-b border-gray-100 hover:bg-gray-50")},m(fe,ye){F(fe,t,ye),u(t,n),u(n,r),i.m(l,r),u(r,o),u(r,c),u(t,d),u(t,h),u(h,g),u(t,m),u(t,_),u(_,y),u(t,w),u(t,C),u(C,A),u(t,M),u(t,L),u(L,P),u(L,z),u(L,T),u(L,N),u(L,j),u(L,J),u(t,W),u(t,G),u(G,ne),u(t,O),u(t,Y),u(Y,K),u(t,X)},p(fe,ye){ye[0]&16384&&l!==(l=fe[63](fe[130].status)+"")&&i.p(l),ye[0]&16384&&a!==(a=fe[130].status+"")&&ee(c,a),ye[0]&16384&&f!==(f=ka(fe[130].status)+" text-sm font-medium inline-flex items-center gap-1")&&s(r,"class",f),ye[0]&16384&&p!==(p=fe[130].job_id+"")&&ee(g,p),ye[0]&16384&&v!==(v=(fe[130].prompt_name||"—")+"")&&ee(y,v),ye[0]&16384&&x!==(x=fe[130].lang+"")&&ee(A,x),ye[0]&16384&&I!==(I=fe[130].completed+"")&&ee(P,I),ye[0]&16384&&R!==(R=fe[130].total+"")&&ee(T,R),ye[0]&16384&&k!==(k=fe[130].failed+"")&&ee(j,k),ye[0]&16384&&Z!==(Z=jn(fe[130].created_at)+"")&&ee(ne,Z),ye[0]&16384&&re!==(re=jn(fe[130].finished_at)+"")&&ee(K,re)},d(fe){fe&&D(t)}}}function oa(e){let t,n,r=e[7]?`Edit: ${e[7].name}`:"New Prompt Template",i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k;function j(G,Z){return G[9]?c0:u0}let J=j(e),W=J(e);return{c(){t=b("div"),n=b("h3"),i=B(r),l=E(),o=b("div"),a=b("div"),c=b("label"),c.textContent="Name",f=E(),d=b("input"),h=E(),p=b("div"),g=b("label"),m=B("Prompt "),_=b("span"),_.textContent="(use {{TARGET_LANGUAGE}}, {{CONTEXT}}, {{TEXT}} placeholders)",v=E(),y=b("textarea"),w=E(),C=b("div"),x=b("label"),x.textContent="System Message",A=E(),M=b("textarea"),L=E(),I=b("div"),P=b("button"),W.c(),z=E(),R=b("button"),T=B("Cancel"),s(n,"class","text-sm font-semibold text-gray-700 mb-3"),s(c,"for","prompt-name"),s(c,"class","block text-xs text-gray-500 font-medium mb-1"),s(d,"id","prompt-name"),s(d,"placeholder","e.g. Medical Translation, Marketing Copy…"),s(d,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(_,"class","text-gray-400"),s(g,"for","prompt-template"),s(g,"class","block text-xs text-gray-500 font-medium mb-1"),s(y,"id","prompt-template"),s(y,"rows","8"),s(y,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),s(x,"for","prompt-system-message"),s(x,"class","block text-xs text-gray-500 font-medium mb-1"),s(M,"id","prompt-system-message"),s(M,"rows","2"),s(M,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 resize-y"),s(P,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-60 disabled:cursor-not-allowed inline-flex items-center gap-2"),P.disabled=e[9],s(R,"class","px-4 py-2 border border-gray-300 text-sm rounded-md hover:bg-gray-50"),R.disabled=e[9],s(I,"class","flex gap-2"),s(o,"class","space-y-3"),s(t,"class","mb-6 p-5 bg-white border border-indigo-200 rounded-lg shadow-sm")},m(G,Z){F(G,t,Z),u(t,n),u(n,i),u(t,l),u(t,o),u(o,a),u(a,c),u(a,f),u(a,d),De(d,e[10]),u(o,h),u(o,p),u(p,g),u(g,m),u(g,_),u(p,v),u(p,y),De(y,e[11]),u(o,w),u(o,C),u(C,x),u(C,A),u(C,M),De(M,e[12]),u(o,L),u(o,I),u(I,P),W.m(P,null),u(I,z),u(I,R),u(R,T),N||(k=[$(d,"input",e[88]),$(y,"input",e[89]),$(M,"input",e[90]),$(P,"click",e[41]),$(R,"click",e[91])],N=!0)},p(G,Z){Z[0]&128&&r!==(r=G[7]?`Edit: ${G[7].name}`:"New Prompt Template")&&ee(i,r),Z[0]&1024&&d.value!==G[10]&&De(d,G[10]),Z[0]&2048&&De(y,G[11]),Z[0]&4096&&De(M,G[12]),J===(J=j(G))&&W?W.p(G,Z):(W.d(1),W=J(G),W&&(W.c(),W.m(P,null))),Z[0]&512&&(P.disabled=G[9]),Z[0]&512&&(R.disabled=G[9])},d(G){G&&D(t),W.d(),N=!1,lt(k)}}}function u0(e){let t=e[7]?"Update":"Create",n;return{c(){n=B(t)},m(r,i){F(r,n,i)},p(r,i){i[0]&128&&t!==(t=r[7]?"Update":"Create")&&ee(n,t)},d(r){r&&D(n)}}}function c0(e){let t,n,r,i=e[7]?"Updating...":"Creating...",l;return{c(){t=pe("svg"),n=pe("path"),r=E(),l=B(i),s(n,"d","M21 12a9 9 0 1 1-6.219-8.56"),s(t,"class","animate-spin"),s(t,"width","14"),s(t,"height","14"),s(t,"viewBox","0 0 24 24"),s(t,"fill","none"),s(t,"stroke","currentColor"),s(t,"stroke-width","2"),s(t,"stroke-linecap","round"),s(t,"stroke-linejoin","round")},m(o,a){F(o,t,a),u(t,n),F(o,r,a),F(o,l,a)},p(o,a){a[0]&128&&i!==(i=o[7]?"Updating...":"Creating...")&&ee(l,i)},d(o){o&&(D(t),D(r),D(l))}}}function f0(e){let t,n=Be(e[5]),r=[];for(let i=0;i<n.length;i+=1)r[i]=ua($s(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","space-y-3")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&32|l[1]&2560){n=Be(i[5]);let o;for(o=0;o<n.length;o+=1){const a=$s(i,n,o);r[o]?r[o].p(a,l):(r[o]=ua(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function d0(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No prompt templates yet.</p> <p class="text-sm mt-1">Create one to start generating AI translations.</p>',s(t,"class","text-center py-12 text-gray-400")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function sa(e){let t,n=jn(e[122].updated_at)+"",r;return{c(){t=B("· Updated "),r=B(n)},m(i,l){F(i,t,l),F(i,r,l)},p(i,l){l[0]&32&&n!==(n=jn(i[122].updated_at)+"")&&ee(r,n)},d(i){i&&(D(t),D(r))}}}function aa(e){let t,n,r,i=e[122].system_message.substring(0,150)+"",l,o=e[122].system_message.length>150?"…":"",a;return{c(){t=b("p"),n=b("b"),n.textContent="System:",r=E(),l=B(i),a=B(o),s(t,"class","mt-1 text-xs text-gray-400")},m(c,f){F(c,t,f),u(t,n),u(t,r),u(t,l),u(t,a)},p(c,f){f[0]&32&&i!==(i=c[122].system_message.substring(0,150)+"")&&ee(l,i),f[0]&32&&o!==(o=c[122].system_message.length>150?"…":"")&&ee(a,o)},d(c){c&&D(t)}}}function ua(e){let t,n,r,i,l,o=e[122].name+"",a,c,f,d,h=e[122].version+"",p,g,m,_,v=jn(e[122].created_at)+"",y,w,C,x,A=e[122].prompt.substring(0,300)+"",M,L=e[122].prompt.length>300?"…":"",I,P,z,R,T,N,k,j,J,W,G=e[122].updated_at&&e[122].updated_at!==e[122].created_at&&sa(e),Z=e[122].system_message&&aa(e);function ne(){return e[92](e[122])}function O(){return e[93](e[122])}return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("div"),l=b("h4"),a=B(o),c=E(),f=b("span"),d=B("v"),p=B(h),g=E(),m=b("p"),_=B("Created "),y=B(v),w=E(),G&&G.c(),C=E(),x=b("pre"),M=B(A),I=B(L),P=E(),Z&&Z.c(),z=E(),R=b("div"),T=b("button"),T.textContent="Edit",N=E(),k=b("button"),k.textContent="Delete",j=E(),s(l,"class","font-medium text-gray-800"),s(f,"class","px-2 py-0.5 bg-gray-100 text-gray-500 text-xs rounded-full"),s(i,"class","flex items-center gap-2"),s(m,"class","text-xs text-gray-400 mt-1"),s(x,"class","mt-2 text-xs text-gray-500 bg-gray-50 p-2 rounded max-h-24 overflow-auto whitespace-pre-wrap"),s(r,"class","flex-1"),s(T,"class","px-3 py-1.5 text-xs border border-gray-300 rounded hover:bg-gray-50"),s(k,"class","px-3 py-1.5 text-xs text-red-600 border border-red-200 rounded hover:bg-red-50"),s(R,"class","flex items-center gap-2 ml-4 shrink-0"),s(n,"class","flex items-start justify-between"),s(t,"class","p-4 bg-white border border-gray-200 rounded-lg hover:border-indigo-200 transition-colors")},m(Y,re){F(Y,t,re),u(t,n),u(n,r),u(r,i),u(i,l),u(l,a),u(i,c),u(i,f),u(f,d),u(f,p),u(r,g),u(r,m),u(m,_),u(m,y),u(m,w),G&&G.m(m,null),u(r,C),u(r,x),u(x,M),u(x,I),u(r,P),Z&&Z.m(r,null),u(n,z),u(n,R),u(R,T),u(R,N),u(R,k),u(t,j),J||(W=[$(T,"click",ne),$(k,"click",O)],J=!0)},p(Y,re){e=Y,re[0]&32&&o!==(o=e[122].name+"")&&ee(a,o),re[0]&32&&h!==(h=e[122].version+"")&&ee(p,h),re[0]&32&&v!==(v=jn(e[122].created_at)+"")&&ee(y,v),e[122].updated_at&&e[122].updated_at!==e[122].created_at?G?G.p(e,re):(G=sa(e),G.c(),G.m(m,null)):G&&(G.d(1),G=null),re[0]&32&&A!==(A=e[122].prompt.substring(0,300)+"")&&ee(M,A),re[0]&32&&L!==(L=e[122].prompt.length>300?"…":"")&&ee(I,L),e[122].system_message?Z?Z.p(e,re):(Z=aa(e),Z.c(),Z.m(r,null)):Z&&(Z.d(1),Z=null)},d(Y){Y&&D(t),G&&G.d(),Z&&Z.d(),J=!1,lt(W)}}}function ca(e){let t,n=(e[125].name||e[125].code||e[125])+"",r,i;return{c(){t=b("option"),r=B(n),t.__value=i=e[125].code||e[125],De(t,t.__value)},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&32768&&n!==(n=(l[125].name||l[125].code||l[125])+"")&&ee(r,n),o[0]&32768&&i!==(i=l[125].code||l[125])&&(t.__value=i,De(t,t.__value))},d(l){l&&D(t)}}}function fa(e){let t;return{c(){t=b("option"),t.textContent="— No prompts. Create one first. —",t.__value="",De(t,t.__value)},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function da(e){let t,n=e[122].name+"",r,i,l=e[122].version+"",o,a,c;return{c(){t=b("option"),r=B(n),i=B(" (v"),o=B(l),a=B(")"),t.__value=c=e[122].id,De(t,t.__value)},m(f,d){F(f,t,d),u(t,r),u(t,i),u(t,o),u(t,a)},p(f,d){d[0]&32&&n!==(n=f[122].name+"")&&ee(r,n),d[0]&32&&l!==(l=f[122].version+"")&&ee(o,l),d[0]&32&&c!==(c=f[122].id)&&(t.__value=c,De(t,t.__value))},d(f){f&&D(t)}}}function h0(e){let t,n,r,i;return{c(){t=pe("svg"),n=pe("circle"),r=pe("line"),i=pe("path"),s(n,"cx","12"),s(n,"cy","12"),s(n,"r","10"),s(r,"x1","2"),s(r,"y1","12"),s(r,"x2","22"),s(r,"y2","12"),s(i,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z"),s(t,"width","14"),s(t,"height","14"),s(t,"viewBox","0 0 24 24"),s(t,"fill","none"),s(t,"stroke","currentColor"),s(t,"stroke-width","2"),s(t,"stroke-linecap","round"),s(t,"stroke-linejoin","round")},m(l,o){F(l,t,o),u(t,n),u(t,r),u(t,i)},d(l){l&&D(t)}}}function p0(e){let t,n;return{c(){t=pe("svg"),n=pe("path"),s(n,"d","M21 12a9 9 0 1 1-6.219-8.56"),s(t,"class","animate-spin"),s(t,"width","14"),s(t,"height","14"),s(t,"viewBox","0 0 24 24"),s(t,"fill","none"),s(t,"stroke","currentColor"),s(t,"stroke-width","2"),s(t,"stroke-linecap","round")},m(r,i){F(r,t,i),u(t,n)},d(r){r&&D(t)}}}function ha(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R=e[19]||e[28]?"Starting...":"Start Translation",T,N,k,j,J=e[30]!=="group"&&pa(e);function W(K,X){return K[31]?m0:g0}let G=W(e),Z=G(e);function ne(K,X){return K[33]?v0:(C==null&&(C=!!(K[53]()==="context"&&K[55]())),C?y0:(x==null&&(x=K[54]()!=null),x?b0:_0))}let O=ne(e),Y=O(e),re=e[32]&&ga(e);return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("h3"),i.textContent=`${e[58]()}`,l=E(),o=b("button"),o.textContent="×",a=E(),c=b("div"),J&&J.c(),f=E(),d=b("p"),d.textContent=`${e[59]()}`,h=E(),p=b("label"),g=b("input"),m=B(`
|
|
19
|
+
Include contexts`),_=E(),v=b("p"),Z.c(),y=E(),w=b("p"),Y.c(),A=E(),re&&re.c(),M=E(),L=b("div"),I=b("button"),I.textContent="Cancel",P=E(),z=b("button"),T=B(R),s(i,"class","text-sm font-semibold text-gray-800"),s(o,"class","text-gray-400 hover:text-gray-700 text-lg leading-none"),s(r,"class","px-5 py-4 border-b border-gray-100 flex items-center justify-between"),s(d,"class","text-sm text-gray-700 break-words"),s(g,"type","checkbox"),s(g,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(p,"class","flex items-center gap-2 text-sm text-gray-700 cursor-pointer"),s(v,"class","text-xs text-gray-500"),s(w,"class","text-sm text-gray-700 font-medium"),s(c,"class","px-5 py-4 space-y-3"),s(I,"class","px-3 py-1.5 text-sm border border-gray-300 rounded-md hover:bg-gray-50"),s(z,"class","px-3 py-1.5 text-sm bg-indigo-600 text-white rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed"),z.disabled=N=e[19]||e[28]||e[54]()==null||e[54]()===0,s(L,"class","px-5 py-4 border-t border-gray-100 flex justify-end gap-2"),s(n,"class","w-full max-w-md rounded-xl bg-white shadow-2xl border border-gray-200"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center p-4"),mt(t,"background","rgba(0,0,0,0.45)")},m(K,X){F(K,t,X),u(t,n),u(n,r),u(r,i),u(r,l),u(r,o),u(n,a),u(n,c),J&&J.m(c,null),u(c,f),u(c,d),u(c,h),u(c,p),u(p,g),g.checked=e[31],u(p,m),u(c,_),u(c,v),Z.m(v,null),u(c,y),u(c,w),Y.m(w,null),u(c,A),re&&re.m(c,null),u(n,M),u(n,L),u(L,I),u(L,P),u(L,z),u(z,T),k||(j=[$(o,"click",e[51]),$(g,"change",e[74]),$(g,"change",e[57]),$(I,"click",e[51]),$(z,"click",e[60]),$(t,"click",Rr(e[51]))],k=!0)},p(K,X){K[30]!=="group"?J?J.p(K,X):(J=pa(K),J.c(),J.m(c,f)):J&&(J.d(1),J=null),X[1]&1&&(g.checked=K[31]),G!==(G=W(K))&&(Z.d(1),Z=G(K),Z&&(Z.c(),Z.m(v,null))),O===(O=ne(K))&&Y?Y.p(K,X):(Y.d(1),Y=O(K),Y&&(Y.c(),Y.m(w,null))),K[32]?re?re.p(K,X):(re=ga(K),re.c(),re.m(c,null)):re&&(re.d(1),re=null),X[0]&268959744&&R!==(R=K[19]||K[28]?"Starting...":"Start Translation")&&ee(T,R),X[0]&268959744&&N!==(N=K[19]||K[28]||K[54]()==null||K[54]()===0)&&(z.disabled=N)},d(K){K&&D(t),J&&J.d(),Z.d(),Y.d(),re&&re.d(),k=!1,lt(j)}}}function pa(e){let t,n,r,i,l,o,a,c,f,d,h,p,g;return{c(){t=b("div"),n=b("button"),r=B("All Untranslated"),l=E(),o=b("button"),a=B("Selected ("),c=B(e[34]),f=B(")"),s(n,"type","button"),s(n,"class",i="px-2.5 py-1 text-xs rounded-md "+(e[30]==="all"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900")),s(o,"type","button"),s(o,"class",d="px-2.5 py-1 text-xs rounded-md "+(e[30]==="selected"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900")+" disabled:opacity-50 disabled:cursor-not-allowed"),o.disabled=h=e[34]===0,s(t,"class","inline-flex rounded-md border border-gray-200 bg-gray-50 p-1")},m(m,_){F(m,t,_),u(t,n),u(n,r),u(t,l),u(t,o),u(o,a),u(o,c),u(o,f),p||(g=[$(n,"click",e[72]),$(o,"click",e[73])],p=!0)},p(m,_){_[0]&1073741824&&i!==(i="px-2.5 py-1 text-xs rounded-md "+(m[30]==="all"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900"))&&s(n,"class",i),_[1]&8&&ee(c,m[34]),_[0]&1073741824&&d!==(d="px-2.5 py-1 text-xs rounded-md "+(m[30]==="selected"?"bg-white border border-gray-200 text-gray-900":"text-gray-600 hover:text-gray-900")+" disabled:opacity-50 disabled:cursor-not-allowed")&&s(o,"class",d),_[1]&8&&h!==(h=m[34]===0)&&(o.disabled=h)},d(m){m&&D(t),p=!1,lt(g)}}}function g0(e){let t;return{c(){t=B("Will translate master only (one approved key fallback each).")},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function m0(e){let t;return{c(){t=B("Will translate master + context pairs.")},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function _0(e){let t;return{c(){t=B("Loading count...")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function b0(e){let t=e[54]()+"",n,r,i=e[56]()+"",l,o;return{c(){n=B(t),r=E(),l=B(i),o=B(" to queue")},m(a,c){F(a,n,c),F(a,r,c),F(a,l,c),F(a,o,c)},p:je,d(a){a&&(D(n),D(r),D(l),D(o))}}}function y0(e){let t=e[55]().master+"",n,r,i=e[55]().context+"",l,o,a=e[55]().total+"",c,f;return{c(){n=B(t),r=B(" master + "),l=B(i),o=B(" context = "),c=B(a),f=B(" total to queue")},m(d,h){F(d,n,h),F(d,r,h),F(d,l,h),F(d,o,h),F(d,c,h),F(d,f,h)},p:je,d(d){d&&(D(n),D(r),D(l),D(o),D(c),D(f))}}}function v0(e){let t;return{c(){t=B("Loading count...")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function ga(e){let t,n;return{c(){t=b("p"),n=B(e[32]),s(t,"class","text-sm text-red-600")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i[1]&2&&ee(n,r[32])},d(r){r&&D(t)}}}function ma(e){let t,n,r,i,l,o,a;return{c(){t=b("div"),n=b("div"),r=pe("svg"),i=pe("polyline"),l=E(),o=b("p"),a=B(e[26]),s(i,"points","20 6 9 17 4 12"),s(r,"class","w-5 h-5 text-green-600 flex-shrink-0"),s(r,"viewBox","0 0 24 24"),s(r,"fill","none"),s(r,"stroke","currentColor"),s(r,"stroke-width","2"),s(r,"stroke-linecap","round"),s(r,"stroke-linejoin","round"),s(o,"class","text-sm font-medium text-green-800"),s(n,"class","bg-green-50 border border-green-200 rounded-lg shadow-lg px-4 py-3 flex items-center gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300"),s(t,"class","fixed bottom-4 right-4 z-50 max-w-sm")},m(c,f){F(c,t,f),u(t,n),u(n,r),u(r,i),u(n,l),u(n,o),u(o,a)},p(c,f){f[0]&67108864&&ee(a,c[26])},d(c){c&&D(t)}}}function w0(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w=[],C=new Map,x,A,M,L,I,P,z,R,T,N,k=Be(e[1]);const j=W=>W[119].key;for(let W=0;W<k.length;W+=1){let G=ea(e,k,W),Z=j(G);C.set(Z,w[W]=ba(Z,G))}let J=e[35]>1&&ya(e);return{c(){t=b("div"),n=b("table"),r=b("thead"),i=b("tr"),l=b("th"),o=b("input"),a=E(),c=b("th"),c.textContent="Key",f=E(),d=b("th"),d.textContent="Contexts",h=E(),p=b("th"),g=B("Translation ("),m=B(e[0]),_=B(")"),v=E(),y=b("tbody");for(let W=0;W<w.length;W+=1)w[W].c();x=E(),A=b("div"),M=b("p"),L=b("span"),I=B(e[4]),P=b("span"),P.textContent="key(s)",z=E(),J&&J.c(),s(o,"type","checkbox"),o.checked=e[16],s(o,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(l,"class","w-10 px-3 py-2.5"),s(c,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),s(d,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),s(p,"class","text-left px-3 py-2.5 text-xs font-semibold text-gray-500 uppercase tracking-wide"),s(i,"class","bg-gray-50 border-b border-gray-200"),s(n,"class","w-full"),s(t,"class","bg-white rounded-lg border border-gray-200 overflow-hidden"),s(t,"data-notranslate",""),s(L,"data-notranslate",""),s(P,"class","ml-1"),s(M,"class","text-xs text-gray-400"),s(A,"class","flex items-center justify-between mt-3")},m(W,G){F(W,t,G),u(t,n),u(n,r),u(r,i),u(i,l),u(l,o),u(i,a),u(i,c),u(i,f),u(i,d),u(i,h),u(i,p),u(p,g),u(p,m),u(p,_),u(n,v),u(n,y);for(let Z=0;Z<w.length;Z+=1)w[Z]&&w[Z].m(y,null);F(W,x,G),F(W,A,G),u(A,M),u(M,L),u(L,I),u(M,P),u(A,z),J&&J.m(A,null),R=!0,T||(N=$(o,"change",e[44]),T=!0)},p(W,G){(!R||G[0]&65536)&&(o.checked=W[16]),(!R||G[0]&1)&&ee(m,W[0]),G[0]&269090886|G[1]&741376&&(k=Be(W[1]),Jt(),w=si(w,G,j,1,W,k,C,y,Pc,ba,null,ea),qt()),(!R||G[0]&16)&&ee(I,W[4]),W[35]>1?J?J.p(W,G):(J=ya(W),J.c(),J.m(A,null)):J&&(J.d(1),J=null)},i(W){if(!R){for(let G=0;G<k.length;G+=1)st(w[G]);R=!0}},o(W){for(let G=0;G<w.length;G+=1)ct(w[G]);R=!1},d(W){W&&(D(t),D(x),D(A));for(let G=0;G<w.length;G+=1)w[G].d();J&&J.d(),T=!1,N()}}}function k0(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No approved items to generate translations for.</p> <p class="text-sm mt-1">Move items from Pending to Approved in the Translation Manager first.</p>',s(t,"class","text-center py-12 text-gray-400")},m(n,r){F(n,t,r)},p:je,i:je,o:je,d(n){n&&D(t)}}}function x0(e){let t;return{c(){t=b("div"),t.innerHTML=`<div class="flex flex-col items-center justify-center gap-2 text-sm text-gray-500"><img src="${n0}" alt="Loading approved keys" class="w-16 h-16"/> <span>Loading approved keys...</span></div>`,s(t,"class","bg-white rounded-lg border border-gray-200 py-12")},m(n,r){F(n,t,r)},p:je,i:je,o:je,d(n){n&&D(t)}}}function _a(e){let t,n,r,i,l;return r=new Bc({props:{group:e[119],editable:!0,showAiAction:!0,aiBusy:!e[6]||e[19]||e[28],onAiAction:e[81],onSaveMasterValue:e[48],onSaveValue:e[47]}}),{c(){t=b("tr"),n=b("td"),ln(r.$$.fragment),i=E(),s(n,"colspan","4"),s(n,"class","px-4 py-3"),s(t,"class","bg-gray-50 border-b border-gray-200")},m(o,a){F(o,t,a),u(t,n),Kt(r,n,null),u(t,i),l=!0},p(o,a){const c={};a[0]&2&&(c.group=o[119]),a[0]&268959808&&(c.aiBusy=!o[6]||o[19]||o[28]),r.$set(c)},i(o){l||(st(r.$$.fragment,o),l=!0)},o(o){ct(r.$$.fragment,o),l=!1},d(o){o&&D(t),Qt(r)}}}function ba(e,t){let n,r,i,l,o,a,c,f,d,h,p,g,m=t[119].key+"",_,v,y,w=t[119].total+"",C,x,A,M,L,I=t[119].total+"",P,z,R=t[119].total===1?"context":"contexts",T,N,k,j,J=t[119].translatedCount+"",W,G,Z=(t[119].translationTotal??t[119].total)+"",ne,O,Y,re,K,X,fe,ye;function Ie(...te){return t[78](t[119],...te)}function le(...te){return t[79](t[119],...te)}function ve(){return t[80](t[119])}let se=t[17]===t[119].key&&_a(t);return{key:e,first:null,c(){var te;n=b("tr"),r=b("td"),i=b("input"),o=E(),a=b("td"),c=b("div"),f=pe("svg"),d=pe("path"),p=E(),g=b("span"),_=B(m),v=E(),y=b("span"),C=B(w),M=E(),L=b("td"),P=B(I),z=E(),T=B(R),N=E(),k=b("td"),j=b("span"),W=B(J),G=B("/"),ne=B(Z),O=B(" translated"),re=E(),se&&se.c(),K=xt(),s(i,"type","checkbox"),i.checked=l=!!((te=t[119])!=null&&te.key)&&t[2].includes(t[119].key),s(i,"class","rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"),s(r,"class","px-3 py-2"),s(d,"fill-rule","evenodd"),s(d,"d","M7.293 4.293a1 1 0 011.414 0l5 5a1 1 0 010 1.414l-5 5a1 1 0 01-1.414-1.414L11.586 10 7.293 5.707a1 1 0 010-1.414z"),s(d,"clip-rule","evenodd"),s(f,"class",h="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[17]===t[119].key?"rotate-90":"")),s(f,"viewBox","0 0 20 20"),s(f,"fill","currentColor"),s(g,"class","truncate flex-1 min-w-0"),s(y,"class","shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded-full bg-indigo-50 text-indigo-600 border border-indigo-100"),s(y,"title",x=t[119].total+" context(s)"),s(c,"class","flex items-center gap-2 min-w-0"),s(a,"class","px-3 py-2 font-mono text-sm text-gray-700 max-w-[320px]"),s(a,"title",A=t[119].key),s(L,"class","px-3 py-2 text-sm text-gray-500 whitespace-nowrap"),s(j,"class","font-semibold"),s(k,"class","px-3 py-2 text-sm text-gray-700 whitespace-nowrap"),s(n,"class",Y="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[17]===t[119].key?"bg-indigo-50":"")),this.first=n},m(te,Se){F(te,n,Se),u(n,r),u(r,i),u(n,o),u(n,a),u(a,c),u(c,f),u(f,d),u(c,p),u(c,g),u(g,_),u(c,v),u(c,y),u(y,C),u(n,M),u(n,L),u(L,P),u(L,z),u(L,T),u(n,N),u(n,k),u(k,j),u(j,W),u(j,G),u(j,ne),u(k,O),F(te,re,Se),se&&se.m(te,Se),F(te,K,Se),X=!0,fe||(ye=[$(i,"click",Bt(Ie)),$(i,"change",Bt(le)),$(r,"click",Bt(t[65])),$(n,"click",ve)],fe=!0)},p(te,Se){var S;t=te,(!X||Se[0]&6&&l!==(l=!!((S=t[119])!=null&&S.key)&&t[2].includes(t[119].key)))&&(i.checked=l),(!X||Se[0]&131074&&h!==(h="shrink-0 w-3 h-3 text-gray-400 transition-transform "+(t[17]===t[119].key?"rotate-90":"")))&&s(f,"class",h),(!X||Se[0]&2)&&m!==(m=t[119].key+"")&&ee(_,m),(!X||Se[0]&2)&&w!==(w=t[119].total+"")&&ee(C,w),(!X||Se[0]&2&&x!==(x=t[119].total+" context(s)"))&&s(y,"title",x),(!X||Se[0]&2&&A!==(A=t[119].key))&&s(a,"title",A),(!X||Se[0]&2)&&I!==(I=t[119].total+"")&&ee(P,I),(!X||Se[0]&2)&&R!==(R=t[119].total===1?"context":"contexts")&&ee(T,R),(!X||Se[0]&2)&&J!==(J=t[119].translatedCount+"")&&ee(W,J),(!X||Se[0]&2)&&Z!==(Z=(t[119].translationTotal??t[119].total)+"")&&ee(ne,Z),(!X||Se[0]&131074&&Y!==(Y="border-b border-gray-100 hover:bg-gray-50 transition-colors cursor-pointer "+(t[17]===t[119].key?"bg-indigo-50":"")))&&s(n,"class",Y),t[17]===t[119].key?se?(se.p(t,Se),Se[0]&131074&&st(se,1)):(se=_a(t),se.c(),st(se,1),se.m(K.parentNode,K)):se&&(Jt(),ct(se,1,1,()=>{se=null}),qt())},i(te){X||(st(se),X=!0)},o(te){ct(se),X=!1},d(te){te&&(D(n),D(re),D(K)),se&&se.d(te),fe=!1,lt(ye)}}}function ya(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N;return{c(){t=b("div"),n=b("button"),r=B("«"),l=E(),o=b("button"),a=B("‹"),f=E(),d=b("span"),h=B("Page "),p=B(e[25]),g=B(" of "),m=B(e[35]),_=E(),v=b("button"),y=B("›"),C=E(),x=b("button"),A=B("»"),L=E(),I=b("select"),P=b("option"),P.textContent="25 / page",z=b("option"),z.textContent="50 / page",R=b("option"),R.textContent="100 / page",s(n,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),n.disabled=i=e[25]<=1,s(o,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),o.disabled=c=e[25]<=1,s(d,"class","px-3 py-1 text-xs text-gray-600"),s(v,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),v.disabled=w=e[25]>=e[35],s(x,"class","px-2.5 py-1 text-xs border border-gray-300 rounded-md disabled:opacity-40 hover:bg-gray-50"),x.disabled=M=e[25]>=e[35],P.__value=25,De(P,P.__value),z.__value=50,De(z,z.__value),R.__value=100,De(R,R.__value),s(I,"class","ml-2 px-2 py-1 text-xs border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"),e[3]===void 0&&Dt(()=>e[86].call(I)),s(t,"class","flex items-center gap-1")},m(k,j){F(k,t,j),u(t,n),u(n,r),u(t,l),u(t,o),u(o,a),u(t,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(t,_),u(t,v),u(v,y),u(t,C),u(t,x),u(x,A),u(t,L),u(t,I),u(I,P),u(I,z),u(I,R),vt(I,e[3],!0),T||(N=[$(n,"click",e[82]),$(o,"click",e[83]),$(v,"click",e[84]),$(x,"click",e[85]),$(I,"change",e[86]),$(I,"change",e[87])],T=!0)},p(k,j){j[0]&33554432&&i!==(i=k[25]<=1)&&(n.disabled=i),j[0]&33554432&&c!==(c=k[25]<=1)&&(o.disabled=c),j[0]&33554432&&ee(p,k[25]),j[1]&16&&ee(m,k[35]),j[0]&33554432|j[1]&16&&w!==(w=k[25]>=k[35])&&(v.disabled=w),j[0]&33554432|j[1]&16&&M!==(M=k[25]>=k[35])&&(x.disabled=M),j[0]&8&&vt(I,k[3])},d(k){k&&D(t),T=!1,lt(N)}}}function C0(e){let t,n,r,i,l,o,a,c,f=Be([{id:"generate",label:"Generate Translations",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/></svg>'},{id:"prompts",label:"Prompt Templates",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>'},{id:"log",label:"Job Log",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>'}]),d=[];for(let m=0;m<3;m+=1)d[m]=ia(ra(e,f,m));const h=[o0,l0,i0,r0],p=[];function g(m,_){return m[23]?0:m[22]==="generate"?1:m[22]==="prompts"?2:m[22]==="log"?3:-1}return~(i=g(e))&&(l=p[i]=h[i](e)),{c(){t=b("div"),n=b("div");for(let m=0;m<3;m+=1)d[m].c();r=E(),l&&l.c(),s(n,"class","flex items-center gap-1 mb-4 border-b border-gray-200")},m(m,_){F(m,t,_),u(t,n);for(let v=0;v<3;v+=1)d[v]&&d[v].m(n,null);u(t,r),~i&&p[i].m(t,null),o=!0,a||(c=$(window,"keydown",e[52]),a=!0)},p(m,_){if(_[0]&4194304|_[1]&128){f=Be([{id:"generate",label:"Generate Translations",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z" fill="#FFB833"/><path d="M19 14L20 16.5L22.5 17.5L20 18.5L19 21L18 18.5L15.5 17.5L18 16.5Z" fill="#F07040"/></svg>'},{id:"prompts",label:"Prompt Templates",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>'},{id:"log",label:"Job Log",icon:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>'}]);let y;for(y=0;y<3;y+=1){const w=ra(m,f,y);d[y]?d[y].p(w,_):(d[y]=ia(w),d[y].c(),d[y].m(n,null))}for(;y<3;y+=1)d[y].d(1)}let v=i;i=g(m),i===v?~i&&p[i].p(m,_):(l&&(Jt(),ct(p[v],1,1,()=>{p[v]=null}),qt()),~i?(l=p[i],l?l.p(m,_):(l=p[i]=h[i](m),l.c()),st(l,1),l.m(t,null)):l=null)},i(m){o||(st(l),o=!0)},o(m){ct(l),o=!1},d(m){m&&D(t),ft(d,m),~i&&p[i].d(),a=!1,c()}}}const A0="You are a professional translator. Provide only the translation without any explanations or additional text.";function va(e){return e==null||e===""?null:String(e)}function wa(e,t){const n=(e==null?void 0:e.contexts)||[];return t==="word"?n.length>0?[n[0]]:[]:n}function cl(e,t){var r;if(!e)return[];if(t==="word"){if(e.master_key_id)return[e.master_key_id];const i=(r=wa(e,t)[0])==null?void 0:r.key_id;return i?[i]:[]}const n=new Set(wa(e,t).map(i=>i.key_id));return e.master_key_id&&n.add(e.master_key_id),[...n]}function jn(e){return e?new Date(e).toLocaleString():"—"}function ka(e){switch(e){case"running":return"text-blue-600";case"completed":return"text-green-600";case"failed":return"text-red-600";case"cancelled":case"cancelling":return"text-yellow-600";default:return"text-gray-500"}}function S0(e,t,n){let r,i,l,o;ti(e,dn,_e=>n(101,o=_e));let a=[],c="",f=null,d=!1,h=!1,p="",g="",m="",_=[],v=[],y=null,w="zh-Hans",C=[],x=[],A=[],M=!1,L=null,I=!1,P=!1,z="",R,T="all",N="generate",k=!1,j=!1,J=1,W=50,G=0,Z="",ne=!1,O;const Y=`Translate the following text to {{TARGET_LANGUAGE}}.
|
|
20
|
+
|
|
21
|
+
Instructions:
|
|
22
|
+
- Ensure translations sound natural and contextually appropriate.
|
|
23
|
+
- Preserve formatting, punctuation, and any placeholder tokens.
|
|
24
|
+
- If a direct translation doesn't exist, use a descriptive equivalent.
|
|
25
|
+
- The context below is a breadcrumb trail: relevance decreases from right to left. Prioritize the rightmost (nearest) context elements for disambiguation.
|
|
26
|
+
- Return ONLY the translation, no explanations.
|
|
27
|
+
|
|
28
|
+
Context: "{{CONTEXT}}"
|
|
29
|
+
Text to translate: "{{TEXT}}"`;jr(async()=>{var _e;try{const Ve=JSON.parse(o.settings||"{}");(_e=Ve.languages)!=null&&_e.length&&n(15,C=Ve.languages)}catch{}C.length||n(15,C=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}]),C.length&&n(0,w=C[0].code||C[0]),await Promise.all([X(),fe(),ye(),Ie()]),re()}),Ec(()=>{K(),O&&clearTimeout(O)});function re(){y=setInterval(async()=>{await ye(),_.some(_e=>_e.status==="running"||_e.status==="pending")&&await fe({showSpinner:!1})},2e3)}function K(){y&&clearInterval(y)}async function X(){const _e=await We("../api/prompts");n(5,a=await _e.json()),a.length&&!c&&n(6,c=a[0].id)}async function fe(_e={}){const{showSpinner:Ve=!0}=_e;Ve&&n(24,j=!0);const $e=new URLSearchParams({lang:w,status:"approved",page:J,limit:W});$e.set("group","key"),$e.set("coverage","master"),z.trim()&&$e.set("search",z.trim()),T==="translated"?$e.set("translated","yes"):T==="untranslated"&&$e.set("translated","no");try{const kt=await(await We(`../api/translations/all?${$e}`)).json();n(1,x=(kt.groups||[]).map(Ht=>({...Ht,master_key_id:va(Ht.master_key_id),contexts:(Ht.contexts||[]).map(cn=>({...cn,key_id:va(cn.key_id)}))}))),n(4,G=kt.total);const Ut=new Set(x.map(Ht=>Ht.key).filter(Boolean));n(2,A=A.filter(Ht=>Ut.has(Ht))),x.some(Ht=>Ht.key===L)||n(17,L=null)}finally{Ve&&n(24,j=!1)}}async function ye(){const Ve=await(await We("../api/ai-jobs")).json();n(13,_=Ve.jobs||[])}async function Ie(){const _e=await We("../api/ai-jobs/log");n(14,v=await _e.json())}async function le(_e){if(!(!_e||_e===N||k)){n(23,k=!0),n(22,N=_e);try{_e==="generate"?await Promise.all([ye(),Ue(),fe()]):_e==="prompts"?await X():_e==="log"&&await Ie()}finally{n(23,k=!1)}}}function ve(){n(7,f=null),n(10,p=""),n(11,g=Y),n(12,m=A0),n(8,d=!0)}function se(_e){n(7,f=_e),n(10,p=_e.name),n(11,g=_e.prompt),n(12,m=_e.system_message),n(8,d=!0)}async function te(){if(!(!p.trim()||!g.trim())){n(9,h=!0);try{await We("../api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:(f==null?void 0:f.id)||null,name:p.trim(),prompt:g,system_message:m})}),n(8,d=!1),n(7,f=null),await X()}finally{n(9,h=!1)}}}async function Se(_e){confirm("Delete this prompt template?")&&(await We(`../api/prompts/${encodeURIComponent(_e)}`,{method:"DELETE"}),c===_e&&n(6,c=""),await X())}function S(){return x.map(_e=>_e.key).filter(Boolean)}function ie(_e){const Ve=r;if(_e==="context"){const $e=new Set;for(const Nt of Ve){for(const kt of Nt.contexts||[])kt.key_id&&$e.add(kt.key_id);Nt.master_key_id&&$e.add(Nt.master_key_id)}return[...$e]}return Ve.map($e=>cl($e,"word")[0]).filter(Boolean)}function q(_e,Ve){if(_e!=null&&_e.key){if(!Ve){n(2,A=A.filter($e=>$e!==_e.key));return}A.includes(_e.key)||n(2,A=[...A,_e.key])}}function H(_e){n(17,L=L===_e.key?null:_e.key)}function U(_e){const Ve=S();if(!_e){n(2,A=[]);return}n(2,A=[...Ve])}function V(_e){var Ve;U(!!((Ve=_e==null?void 0:_e.target)!=null&&Ve.checked))}function ae(_e,Ve){var $e;q(_e,!!(($e=Ve==null?void 0:Ve.target)!=null&&$e.checked))}function ce(){clearTimeout(R),R=setTimeout(()=>{n(25,J=1),fe()},300)}function Q(_e){const Ve=_e.contexts||[],$e=Ve.filter(Ut=>Ut.value!=null&&Ut.value!=="").length,kt=_e.master_value!=null&&_e.master_value!==""?1:0;_e.translatedCount=kt+$e,_e.translationTotal=(_e.master_key_id!=null?1:0)+Ve.length,n(1,x=[...x])}async function de(_e,Ve){await We("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:w,translations:[{key:_e.key,context:_e.context||"",value:_e.value||""}]})}),Q(Ve)}async function ge(_e){const Ve=_e.master_value||"";await We("../api/textnodes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:_e.key,context:"",status:"approved"})}),await We("../api/translations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lang:w,translations:[{key:_e.key,context:"",value:Ve}]})}),Q(_e)}let he=!1,xe=null,Re=null,we=!1,Me="selected",ze=null,Ee=!0,Ge="",oe=null,Fe=!1;async function me(_e){const $e=await(await We(`../api/translations/coverage-counts?lang=${encodeURIComponent(w)}&status=approved`)).json();return _e==="context"?$e.untranslatedRowsDirect||0:$e.untranslatedKeysMaster||0}async function Ae(){if(Me==="all"){n(33,Fe=!0);try{oe=await me(ke())}catch{oe=null}finally{n(33,Fe=!1)}}}async function Ue(){try{const[_e,Ve]=await Promise.all([me("word"),me("context")]);xe=_e,Re=Ve}catch{xe=null,Re=null}}async function Ce(_e){n(28,he=!0);try{const $e=await(await We(`../api/textnodes/untranslated-ids?lang=${encodeURIComponent(w)}&mode=${_e}`)).json();if(!$e.ids||$e.ids.length===0)return{ok:!1,error:"No items to queue."};const kt=await(await We("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:$e.ids,lang:w,prompt_id:c,include_screenshots:I,mode:_e})})).json();return kt.error?{ok:!1,error:kt.error}:{ok:!0}}finally{n(28,he=!1)}}function Te(_e){n(30,Me=_e),n(32,Ge=""),oe=null,_e==="all"&&Ae()}function et(_e="auto",Ve=null){const $e=_e==="auto"?A.length>0?"selected":"all":_e;n(30,Me=$e),ze=Ve,n(31,Ee=!0),oe=null,n(32,Ge=""),n(29,we=!0),$e==="all"&&Ae()}function Xe(){Le()}function Le(){n(29,we=!1),n(32,Ge=""),ze=null}function Ye(_e){we&&_e.key==="Escape"&&(_e.preventDefault(),Le())}function ke(){return Ee?"context":"word"}function qe(){const _e=ke();return Me==="all"?oe??(_e==="context"?Re:xe):Me==="group"?ze?cl(ze,_e).length:0:ie(_e).length}function tt(){if(ke()==="word"){const Ve=qe()||0;return{master:Ve,context:0,total:Ve}}if(Me==="group"&&ze){const Ve=(ze.contexts||[]).length,$e=ze.master_key_id?1:0;return{master:$e,context:Ve,total:$e+Ve}}if(Me==="selected"){const Ve=r,$e=Ve.reduce((kt,Ut)=>kt+(Ut.contexts||[]).length,0),Nt=Ve.filter(kt=>kt.master_key_id).length;return{master:Nt,context:$e,total:Nt+$e}}return null}function yt(){return ke()==="context"?"master + context pairs":"approved keys"}function Rt(){Me==="all"&&Ae()}function Mt(){return Me==="group"?"AI Translate Group":"AI Translate"}function en(){return Me==="group"&&ze?ze.key:Me==="selected"?`${i} selected key(s).`:"Queue translations for all untranslated approved items in current mode."}async function jt(){await Promise.allSettled([ye(),Ie(),Ue(),fe({showSpinner:!1})])}async function Ot(){if(!c){n(32,Ge="Select a prompt template first.");return}const _e=ke();if(!qe()){n(32,Ge="No items to queue.");return}n(19,P=!0),n(32,Ge="");try{let $e;if(Me==="all")$e=await Ce(_e);else{const Nt=Me==="group"?cl(ze,_e):ie(_e),kt=await We("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:Nt,lang:w,prompt_id:c,include_screenshots:I,mode:_e})}),Ut=await kt.json();!kt.ok||Ut.error?$e={ok:!1,error:Ut.error||`Failed to queue job (HTTP ${kt.status})`}:(Me==="selected"&&n(2,A=[]),n(17,L=null),$e={ok:!0})}if($e!=null&&$e.ok){Le(),n(26,Z="Translation job queued successfully!"),n(27,ne=!0),O&&clearTimeout(O),O=setTimeout(()=>{n(27,ne=!1)},3500),jt();return}$e!=null&&$e.error&&n(32,Ge=$e.error)}finally{n(19,P=!1)}}async function be(_e){await We(`../api/ai-jobs/${encodeURIComponent(_e)}`,{method:"DELETE"}),await ye()}function He(_e){n(13,_=_.filter(Ve=>Ve.id!==_e))}const Je={pending:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',running:'<svg class="animate-spin" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#3A8FE0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56"/></svg>',completed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#2ECC88" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>',failed:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',cancelled:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>',cancelling:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>'};function at(_e){return Je[_e]??'<span class="text-gray-400">—</span>'}function wt(_e){Ir.call(this,e,_e)}const _t=_e=>le(_e.id);function ut(){w=rn(this),n(0,w),n(15,C)}const bt=()=>{n(25,J=1),fe()};function it(){c=rn(this),n(6,c),n(5,a)}function Ze(){I=this.checked,n(18,I)}const Oe=()=>et("auto"),Qe=()=>Te("all"),St=()=>Te("selected");function ot(){Ee=this.checked,n(31,Ee)}function In(){z=this.value,n(20,z)}function Ln(){T=rn(this),n(21,T)}const Nn=()=>{n(25,J=1),fe()},sr=(_e,Ve)=>ae(_e,Ve),Et=(_e,Ve)=>ae(_e,Ve),bn=_e=>H(_e),Pn=_e=>et("group",_e),ar=()=>{n(25,J=1),fe()},un=()=>{n(25,J--,J),fe()},ur=()=>{n(25,J++,J),fe()},zn=()=>{n(25,J=l),fe()};function cr(){W=rn(this),n(3,W)}const Hn=()=>{n(25,J=1),fe()};function fr(){p=this.value,n(10,p)}function Ct(){g=this.value,n(11,g)}function Dn(){m=this.value,n(12,m)}const dr=()=>{n(8,d=!1),n(7,f=null)},Fn=_e=>se(_e),hr=_e=>Se(_e.id);return e.$$.update=()=>{if(e.$$.dirty[0]&6&&n(64,r=x.filter(_e=>A.includes(_e.key))),e.$$.dirty[2]&4&&n(34,i=r.length),e.$$.dirty[0]&24&&n(35,l=Math.max(1,Math.ceil(G/W))),e.$$.dirty[0]&1&&w&&Ue(),e.$$.dirty[0]&4){const _e=S();n(16,M=_e.length>0&&_e.every(Ve=>A.includes(Ve)))}},[w,x,A,W,G,a,c,f,d,h,p,g,m,_,v,C,M,L,I,P,z,T,N,k,j,J,Z,ne,he,we,Me,Ee,Ge,Fe,i,l,fe,Ie,le,ve,se,te,Se,H,V,ae,ce,de,ge,Te,et,Xe,Ye,ke,qe,tt,yt,Rt,Mt,en,Ot,be,He,at,r,wt,_t,ut,bt,it,Ze,Oe,Qe,St,ot,In,Ln,Nn,sr,Et,bn,Pn,ar,un,ur,zn,cr,Hn,fr,Ct,Dn,dr,Fn,hr]}class T0 extends an{constructor(t){super(),sn(this,t,S0,C0,$t,{},null,[-1,-1,-1,-1,-1])}}function xa(e,t,n){const r=e.slice();return r[71]=t[n],r[72]=t,r[73]=n,r}function Ca(e,t,n){const r=e.slice();return r[74]=t[n],r}function Aa(e,t,n){const r=e.slice();return r[74]=t[n],r}function Sa(e,t,n){const r=e.slice();return r[79]=t[n],r}function Ta(e,t,n){const r=e.slice();return r[82]=t[n],r}function M0(e){let t,n,r;return{c(){t=b("input"),s(t,"id","bluehive-api-key"),s(t,"type","password"),s(t,"class","w-full px-3 py-2 pr-10 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),s(t,"placeholder","sk_...")},m(i,l){F(i,t,l),De(t,e[4]),n||(r=$(t,"input",e[50]),n=!0)},p(i,l){l[0]&16&&t.value!==i[4]&&De(t,i[4])},d(i){i&&D(t),n=!1,r()}}}function E0(e){let t,n,r;return{c(){t=b("input"),s(t,"id","bluehive-api-key"),s(t,"type","text"),s(t,"class","w-full px-3 py-2 pr-10 border border-gray-300 rounded-md text-sm font-mono focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),s(t,"placeholder","sk_...")},m(i,l){F(i,t,l),De(t,e[4]),n||(r=$(t,"input",e[49]),n=!0)},p(i,l){l[0]&16&&t.value!==i[4]&&De(t,i[4])},d(i){i&&D(t),n=!1,r()}}}function Ma(e){let t,n,r,i=e[82].name+"",l,o,a,c,f=e[82].code+"",d,h,p,g,m,_,v;function y(){return e[53](e[82])}return{c(){t=b("div"),n=b("div"),r=b("span"),l=B(i),o=E(),a=b("span"),c=B("("),d=B(f),h=B(")"),p=E(),g=b("button"),g.textContent="✕",m=E(),s(r,"class","text-gray-700"),s(a,"class","text-gray-400 text-xs"),s(n,"class","flex items-center gap-2"),s(g,"class","text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50"),s(g,"title","Remove language"),s(t,"class","flex items-center justify-between px-3 py-2 rounded-md hover:bg-gray-50 text-sm")},m(w,C){F(w,t,C),u(t,n),u(n,r),u(r,l),u(n,o),u(n,a),u(a,c),u(a,d),u(a,h),u(t,p),u(t,g),u(t,m),_||(v=$(g,"click",y),_=!0)},p(w,C){e=w,C[0]&128&&i!==(i=e[82].name+"")&&ee(l,i),C[0]&128&&f!==(f=e[82].code+"")&&ee(d,f)},d(w){w&&D(t),_=!1,v()}}}function Ea(e){let t;return{c(){t=b("p"),t.textContent="No languages configured. Add one below.",s(t,"class","text-sm text-gray-400 mb-3")},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function I0(e){let t,n,r,i,l;return{c(){t=pe("svg"),n=pe("path"),r=pe("polyline"),i=pe("polyline"),l=B(`
|
|
30
|
+
Create Backup`),s(n,"d","M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"),s(r,"points","17 21 17 13 7 13 7 21"),s(i,"points","7 3 7 8 15 8"),s(t,"width","14"),s(t,"height","14"),s(t,"viewBox","0 0 24 24"),s(t,"fill","none"),s(t,"stroke","currentColor"),s(t,"stroke-width","2"),s(t,"stroke-linecap","round"),s(t,"stroke-linejoin","round")},m(o,a){F(o,t,a),u(t,n),u(t,r),u(t,i),F(o,l,a)},d(o){o&&(D(t),D(l))}}}function L0(e){let t,n,r;return{c(){t=pe("svg"),n=pe("path"),r=B(`
|
|
31
|
+
Creating…`),s(n,"d","M12 2v4m0 12v4m-7.07-3.93l2.83-2.83m8.48-8.48l2.83-2.83M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83"),s(t,"class","animate-spin"),s(t,"width","14"),s(t,"height","14"),s(t,"viewBox","0 0 24 24"),s(t,"fill","none"),s(t,"stroke","currentColor"),s(t,"stroke-width","2")},m(i,l){F(i,t,l),u(t,n),F(i,r,l)},d(i){i&&(D(t),D(r))}}}function Ia(e){let t,n,r;return{c(){t=b("button"),t.textContent="Load existing backups",s(t,"class","text-xs text-indigo-600 hover:text-indigo-800 hover:underline")},m(i,l){F(i,t,l),n||(r=$(t,"click",e[43]),n=!0)},p:je,d(i){i&&D(t),n=!1,r()}}}function N0(e){let t,n=Be(e[18]),r=[];for(let i=0;i<n.length;i+=1)r[i]=La(Sa(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","border border-gray-200 rounded-md divide-y divide-gray-100 max-h-64 overflow-y-auto")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&2359296|l[1]&16384){n=Be(i[18]);let o;for(o=0;o<n.length;o+=1){const a=Sa(i,n,o);r[o]?r[o].p(a,l):(r[o]=La(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function P0(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#6366f1" stroke-width="2"><circle cx="12" cy="12" r="10" opacity="0.25"></circle><path d="M12 2a10 10 0 019.5 7" stroke-linecap="round"></path></svg>',s(t,"class","flex justify-center py-4")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function La(e){let t,n,r,i=e[79].filename+"",l,o,a,c=Ha(e[79].created)+"",f,d,h=Ua(e[79].size)+"",p,g,m,_,v,y,w,C,x,A,M;function L(){return e[56](e[79])}return{c(){t=b("div"),n=b("div"),r=b("div"),l=B(i),o=E(),a=b("div"),f=B(c),d=B(" · "),p=B(h),g=E(),m=b("div"),_=b("button"),v=pe("svg"),y=pe("polyline"),w=pe("path"),x=E(),s(r,"class","text-gray-700 font-mono text-xs truncate"),s(a,"class","text-gray-400 text-xs mt-0.5"),s(n,"class","flex-1 min-w-0"),s(y,"points","3 6 5 6 21 6"),s(w,"d","M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"),s(v,"width","14"),s(v,"height","14"),s(v,"viewBox","0 0 24 24"),s(v,"fill","none"),s(v,"stroke","currentColor"),s(v,"stroke-width","2"),s(v,"stroke-linecap","round"),s(v,"stroke-linejoin","round"),s(_,"class","px-2 py-1 text-xs rounded border border-gray-200 text-gray-400 hover:text-red-500 hover:border-red-300 hover:bg-red-50 disabled:opacity-50"),_.disabled=C=e[21]===e[79].filename,s(_,"title","Delete this backup"),s(m,"class","flex items-center gap-1.5 ml-3 shrink-0"),s(t,"class","flex items-center justify-between px-3 py-2.5 hover:bg-gray-50 text-sm")},m(I,P){F(I,t,P),u(t,n),u(n,r),u(r,l),u(n,o),u(n,a),u(a,f),u(a,d),u(a,p),u(t,g),u(t,m),u(m,_),u(_,v),u(v,y),u(v,w),u(t,x),A||(M=$(_,"click",L),A=!0)},p(I,P){e=I,P[0]&262144&&i!==(i=e[79].filename+"")&&ee(l,i),P[0]&262144&&c!==(c=Ha(e[79].created)+"")&&ee(f,c),P[0]&262144&&h!==(h=Ua(e[79].size)+"")&&ee(p,h),P[0]&2359296&&C!==(C=e[21]===e[79].filename)&&(_.disabled=C)},d(I){I&&D(t),A=!1,M()}}}function Na(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C=e[13]>0&&Pa(e),x=Be(e[27]),A=[];for(let M=0;M<x.length;M+=1)A[M]=Ba(xa(e,x,M));return{c(){t=b("div"),n=b("div"),r=b("h4"),r.textContent="Context Depth",i=E(),l=b("p"),l.textContent=`How many ancestor levels to walk when building the context breadcrumb.
|
|
32
|
+
Unlimited walks to the document root; a limit keeps context focused on nearby elements.`,o=E(),a=b("div"),c=b("button"),f=B("∞ Unlimited"),h=E(),p=b("button"),g=B("Limit depth"),_=E(),C&&C.c(),v=E();for(let M=0;M<A.length;M+=1)A[M].c();s(r,"class","text-sm font-medium text-gray-700 mb-1"),s(l,"class","text-xs text-gray-400 mb-3"),s(c,"class",d="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(e[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),s(p,"class",m="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(e[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50")),s(a,"class","flex items-center gap-2 mb-2"),s(t,"class","mt-4 space-y-6 border-t border-gray-100 pt-4")},m(M,L){F(M,t,L),u(t,n),u(n,r),u(n,i),u(n,l),u(n,o),u(n,a),u(a,c),u(c,f),u(a,h),u(a,p),u(p,g),u(n,_),C&&C.m(n,null),u(t,v);for(let I=0;I<A.length;I+=1)A[I]&&A[I].m(t,null);y||(w=[$(c,"click",e[58]),$(p,"click",e[59])],y=!0)},p(M,L){if(L[0]&8192&&d!==(d="px-3 py-1.5 rounded-l-md text-xs font-medium border transition-colors "+(M[13]===0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&s(c,"class",d),L[0]&8192&&m!==(m="px-3 py-1.5 rounded-r-md text-xs font-medium border border-l-0 transition-colors "+(M[13]>0?"bg-indigo-600 text-white border-indigo-600":"bg-white text-gray-600 border-gray-300 hover:bg-gray-50"))&&s(p,"class",m),M[13]>0?C?C.p(M,L):(C=Pa(M),C.c(),C.m(n,null)):C&&(C.d(1),C=null),L[0]&201332736|L[1]&240){x=Be(M[27]);let I;for(I=0;I<x.length;I+=1){const P=xa(M,x,I);A[I]?A[I].p(P,L):(A[I]=Ba(P),A[I].c(),A[I].m(t,null))}for(;I<A.length;I+=1)A[I].d(1);A.length=x.length}},d(M){M&&D(t),C&&C.d(),ft(A,M),y=!1,lt(w)}}}function Pa(e){let t,n,r,i,l,o,a,c,f,d,h,p;return{c(){t=b("div"),n=b("button"),r=B("−"),l=E(),o=b("input"),a=E(),c=b("button"),c.textContent="+",f=E(),d=b("span"),d.textContent="ancestor levels",s(n,"class","w-7 h-7 flex items-center justify-center rounded bg-white border border-gray-300 text-gray-600 hover:bg-gray-100 font-bold text-sm disabled:opacity-30"),n.disabled=i=e[13]<=1,s(o,"type","number"),s(o,"min","1"),s(o,"max","99"),s(o,"class","w-14 text-center text-sm font-mono border border-gray-300 rounded-md py-1 bg-white focus:outline-none focus:ring-2 focus:ring-indigo-300"),s(c,"class","w-7 h-7 flex items-center justify-center rounded bg-white border border-gray-300 text-gray-600 hover:bg-gray-100 font-bold text-sm"),s(d,"class","text-xs text-gray-500 ml-2"),s(t,"class","flex items-center gap-2 mt-2 p-3 bg-gray-50 rounded-lg border border-gray-200")},m(g,m){F(g,t,m),u(t,n),u(n,r),u(t,l),u(t,o),De(o,e[13]),u(t,a),u(t,c),u(t,f),u(t,d),h||(p=[$(n,"click",e[60]),$(o,"input",e[61]),$(o,"change",e[34]),$(c,"click",e[62])],h=!0)},p(g,m){m[0]&8192&&i!==(i=g[13]<=1)&&(n.disabled=i),m[0]&8192&&Tc(o.value)!==g[13]&&De(o,g[13])},d(g){g&&D(t),h=!1,lt(p)}}}function za(e){let t,n=e[74]+"",r,i,l;function o(){return e[63](e[71],e[74])}return{c(){t=b("button"),r=B(n),s(t,"class","px-2 py-1 rounded border text-xs transition-colors "+(e[38](e[71].key,e[74])?"bg-indigo-50 border-indigo-300 text-indigo-700":"bg-gray-100 border-gray-200 text-gray-400 line-through")),s(t,"title",e[38](e[71].key,e[74])?"Click to disable":"Click to enable")},m(a,c){F(a,t,c),u(t,r),i||(l=$(t,"click",o),i=!0)},p(a,c){e=a},d(a){a&&D(t),i=!1,l()}}}function Da(e){let t,n=Be(e[11][e[71].key].custom),r=[];for(let i=0;i<n.length;i+=1)r[i]=Fa(Ca(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","flex flex-wrap gap-1.5 mb-2")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&134219776|l[1]&64){n=Be(i[11][i[71].key].custom);let o;for(o=0;o<n.length;o+=1){const a=Ca(i,n,o);r[o]?r[o].p(a,l):(r[o]=Fa(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function Fa(e){let t,n=e[74]+"",r,i,l,o,a,c;function f(){return e[64](e[71],e[74])}return{c(){t=b("span"),r=B(n),i=E(),l=b("button"),l.textContent="✕",o=E(),s(l,"class","hover:text-red-500"),s(t,"class","inline-flex items-center gap-1 px-2 py-1 rounded border border-green-300 bg-green-50 text-green-700 text-xs")},m(d,h){F(d,t,h),u(t,r),u(t,i),u(t,l),u(t,o),a||(c=$(l,"click",f),a=!0)},p(d,h){e=d,h[0]&2048&&n!==(n=e[74]+"")&&ee(r,n)},d(d){d&&D(t),a=!1,c()}}}function Ba(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w=Be(e[26][e[71].key]),C=[];for(let I=0;I<w.length;I+=1)C[I]=za(Aa(e,w,I));let x=e[11][e[71].key].custom.length>0&&Da(e);function A(){e[65].call(d,e[71])}function M(...I){return e[66](e[71],...I)}function L(){return e[67](e[71])}return{c(){var I;t=b("div"),n=b("h4"),n.textContent=`${e[71].title}`,r=E(),i=b("p"),i.textContent=`${e[71].desc}`,l=E(),o=b("div");for(let P=0;P<C.length;P+=1)C[P].c();a=E(),x&&x.c(),c=E(),f=b("div"),d=b("input"),h=E(),p=b("button"),g=B("Add"),_=E(),s(n,"class","text-sm font-medium text-gray-700 mb-1"),s(i,"class","text-xs text-gray-400 mb-2"),s(o,"class","flex flex-wrap gap-1.5 mb-2"),s(d,"class","flex-1 px-2 py-1.5 border border-gray-300 rounded-md text-xs focus:outline-none focus:ring-1 focus:ring-indigo-500"),s(d,"placeholder",e[71].placeholder),s(p,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50"),p.disabled=m=!((I=e[12][e[71].key])!=null&&I.trim()),s(f,"class","flex gap-2")},m(I,P){F(I,t,P),u(t,n),u(t,r),u(t,i),u(t,l),u(t,o);for(let z=0;z<C.length;z+=1)C[z]&&C[z].m(o,null);u(t,a),x&&x.m(t,null),u(t,c),u(t,f),u(f,d),De(d,e[12][e[71].key]),u(f,h),u(f,p),u(p,g),u(t,_),v||(y=[$(d,"input",A),$(d,"keydown",M),$(p,"click",L)],v=!0)},p(I,P){var z;if(e=I,P[0]&201326592|P[1]&144){w=Be(e[26][e[71].key]);let R;for(R=0;R<w.length;R+=1){const T=Aa(e,w,R);C[R]?C[R].p(T,P):(C[R]=za(T),C[R].c(),C[R].m(o,null))}for(;R<C.length;R+=1)C[R].d(1);C.length=w.length}e[11][e[71].key].custom.length>0?x?x.p(e,P):(x=Da(e),x.c(),x.m(t,c)):x&&(x.d(1),x=null),P[0]&134221824&&d.value!==e[12][e[71].key]&&De(d,e[12][e[71].key]),P[0]&4096&&m!==(m=!((z=e[12][e[71].key])!=null&&z.trim()))&&(p.disabled=m)},d(I){I&&D(t),ft(C,I),x&&x.d(),v=!1,lt(y)}}}function Ra(e){let t,n;function r(o,a){if(o[24]==="clearing")return D0;if(o[24]==="success")return z0}let i=r(e),l=i&&i(e);return{c(){t=b("div"),n=b("div"),l&&l.c(),s(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),s(t,"data-testid","clear-modal"),s(t,"data-notranslate","")},m(o,a){F(o,t,a),u(t,n),l&&l.m(n,null)},p(o,a){i!==(i=r(o))&&(l&&l.d(1),l=i&&i(o),l&&(l.c(),l.m(n,null)))},d(o){o&&D(t),l&&l.d()}}}function z0(e){let t,n,r,i,l,o,a,c,f,d,h,p;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=B(`#loco-clear-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
|
|
33
|
+
#loco-clear-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
|
|
34
|
+
.loco-clear-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
|
|
35
|
+
.loco-clear-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
|
|
36
|
+
.loco-clear-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
|
|
37
|
+
.loco-clear-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
|
|
38
|
+
`),l=pe("circle"),o=pe("path"),a=pe("circle"),c=pe("circle"),f=pe("circle"),d=pe("circle"),h=E(),p=b("p"),p.textContent="Pending cleared!",s(l,"id","loco-clear-ok-circle"),s(l,"cx","40"),s(l,"cy","40"),s(l,"r","30"),s(l,"fill","#2ECC88"),s(o,"id","loco-clear-checkmark"),s(o,"d","M25 40 L35 50 L55 30"),s(o,"fill","none"),s(o,"stroke","white"),s(o,"stroke-width","5"),s(o,"stroke-linecap","round"),s(o,"stroke-linejoin","round"),s(a,"class","loco-clear-spark1"),s(a,"cx","12"),s(a,"cy","15"),s(a,"r","3"),s(a,"fill","#FFB833"),s(c,"class","loco-clear-spark2"),s(c,"cx","68"),s(c,"cy","18"),s(c,"r","2.5"),s(c,"fill","#3A8FE0"),s(f,"class","loco-clear-spark3"),s(f,"cx","65"),s(f,"cy","65"),s(f,"r","2"),s(f,"fill","#F07040"),s(d,"class","loco-clear-spark4"),s(d,"cx","15"),s(d,"cy","62"),s(d,"r","2.5"),s(d,"fill","#7BC74A"),s(t,"width","80"),s(t,"height","80"),s(t,"viewBox","0 0 80 80"),s(t,"xmlns","http://www.w3.org/2000/svg"),s(p,"class","text-sm font-medium text-gray-700")},m(g,m){F(g,t,m),u(t,n),u(n,r),u(r,i),u(t,l),u(t,o),u(t,a),u(t,c),u(t,f),u(t,d),F(g,h,m),F(g,p,m)},d(g){g&&(D(t),D(h),D(p))}}}function D0(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=B(`#loco-clear-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
|
|
39
|
+
#loco-clear-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
|
|
40
|
+
`),l=pe("g"),o=pe("circle"),a=pe("path"),c=pe("path"),f=pe("path"),d=pe("g"),h=pe("circle"),p=pe("circle"),g=pe("circle"),m=pe("circle"),_=pe("circle"),v=pe("circle"),y=pe("path"),w=pe("line"),C=pe("line"),x=pe("line"),A=pe("circle"),M=pe("circle"),L=pe("circle"),I=E(),P=b("p"),P.textContent="Clearing pending…",s(o,"cx","40"),s(o,"cy","40"),s(o,"r","34"),s(o,"fill","none"),s(o,"stroke","#2a3040"),s(o,"stroke-width","4"),s(a,"d","M40 6 A34 34 0 0 1 74 40"),s(a,"fill","none"),s(a,"stroke","#2ECC88"),s(a,"stroke-width","4"),s(a,"stroke-linecap","round"),s(c,"d","M74 40 A34 34 0 0 1 56 70"),s(c,"fill","none"),s(c,"stroke","#3A8FE0"),s(c,"stroke-width","4"),s(c,"stroke-linecap","round"),s(f,"d","M56 70 A34 34 0 0 1 24 70"),s(f,"fill","none"),s(f,"stroke","#FFB833"),s(f,"stroke-width","4"),s(f,"stroke-linecap","round"),s(l,"id","loco-clear-ring"),s(h,"cx","40"),s(h,"cy","40"),s(h,"r","16"),s(h,"fill","#1a1f2e"),s(p,"cx","40"),s(p,"cy","38"),s(p,"r","10"),s(p,"fill","#2ECC88"),s(g,"cx","37"),s(g,"cy","37"),s(g,"r","2.5"),s(g,"fill","white"),s(m,"cx","37.5"),s(m,"cy","37.5"),s(m,"r","1.5"),s(m,"fill","#2C2C2A"),s(_,"cx","43"),s(_,"cy","37"),s(_,"r","2.5"),s(_,"fill","white"),s(v,"cx","42.5"),s(v,"cy","37.5"),s(v,"r","1.5"),s(v,"fill","#2C2C2A"),s(y,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),s(y,"fill","#E8A020"),s(w,"x1","38"),s(w,"y1","30"),s(w,"x2","36"),s(w,"y2","26"),s(w,"stroke","#FFB833"),s(w,"stroke-width","1.5"),s(w,"stroke-linecap","round"),s(C,"x1","40"),s(C,"y1","29"),s(C,"x2","40"),s(C,"y2","24"),s(C,"stroke","#7BC74A"),s(C,"stroke-width","1.5"),s(C,"stroke-linecap","round"),s(x,"x1","42"),s(x,"y1","30"),s(x,"x2","44"),s(x,"y2","26"),s(x,"stroke","#F07040"),s(x,"stroke-width","1.5"),s(x,"stroke-linecap","round"),s(A,"cx","36"),s(A,"cy","25.5"),s(A,"r","1.5"),s(A,"fill","#FFB833"),s(M,"cx","40"),s(M,"cy","23.5"),s(M,"r","1.5"),s(M,"fill","#7BC74A"),s(L,"cx","44"),s(L,"cy","25.5"),s(L,"r","1.5"),s(L,"fill","#F07040"),s(d,"id","loco-clear-parrot"),s(t,"width","80"),s(t,"height","80"),s(t,"viewBox","0 0 80 80"),s(t,"xmlns","http://www.w3.org/2000/svg"),s(P,"class","text-sm font-medium text-gray-700")},m(z,R){F(z,t,R),u(t,n),u(n,r),u(r,i),u(t,l),u(l,o),u(l,a),u(l,c),u(l,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(d,_),u(d,v),u(d,y),u(d,w),u(d,C),u(d,x),u(d,A),u(d,M),u(d,L),F(z,I,R),F(z,P,R)},d(z){z&&(D(t),D(I),D(P))}}}function ja(e){let t,n;function r(o,a){if(o[23]==="resetting")return B0;if(o[23]==="success")return F0}let i=r(e),l=i&&i(e);return{c(){t=b("div"),n=b("div"),l&&l.c(),s(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),s(t,"data-testid","reset-modal"),s(t,"data-notranslate","")},m(o,a){F(o,t,a),u(t,n),l&&l.m(n,null)},p(o,a){i!==(i=r(o))&&(l&&l.d(1),l=i&&i(o),l&&(l.c(),l.m(n,null)))},d(o){o&&D(t),l&&l.d()}}}function F0(e){let t,n,r,i,l,o,a,c,f,d,h,p;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=B(`#loco-reset-ok-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
|
|
41
|
+
#loco-reset-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
|
|
42
|
+
.loco-reset-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
|
|
43
|
+
.loco-reset-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
|
|
44
|
+
.loco-reset-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
|
|
45
|
+
.loco-reset-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
|
|
46
|
+
`),l=pe("circle"),o=pe("path"),a=pe("circle"),c=pe("circle"),f=pe("circle"),d=pe("circle"),h=E(),p=b("p"),p.textContent="Database reset!",s(l,"id","loco-reset-ok-circle"),s(l,"cx","40"),s(l,"cy","40"),s(l,"r","30"),s(l,"fill","#2ECC88"),s(o,"id","loco-reset-checkmark"),s(o,"d","M25 40 L35 50 L55 30"),s(o,"fill","none"),s(o,"stroke","white"),s(o,"stroke-width","5"),s(o,"stroke-linecap","round"),s(o,"stroke-linejoin","round"),s(a,"class","loco-reset-spark1"),s(a,"cx","12"),s(a,"cy","15"),s(a,"r","3"),s(a,"fill","#FFB833"),s(c,"class","loco-reset-spark2"),s(c,"cx","68"),s(c,"cy","18"),s(c,"r","2.5"),s(c,"fill","#3A8FE0"),s(f,"class","loco-reset-spark3"),s(f,"cx","65"),s(f,"cy","65"),s(f,"r","2"),s(f,"fill","#F07040"),s(d,"class","loco-reset-spark4"),s(d,"cx","15"),s(d,"cy","62"),s(d,"r","2.5"),s(d,"fill","#7BC74A"),s(t,"width","80"),s(t,"height","80"),s(t,"viewBox","0 0 80 80"),s(t,"xmlns","http://www.w3.org/2000/svg"),s(p,"class","text-sm font-medium text-gray-700")},m(g,m){F(g,t,m),u(t,n),u(n,r),u(r,i),u(t,l),u(t,o),u(t,a),u(t,c),u(t,f),u(t,d),F(g,h,m),F(g,p,m)},d(g){g&&(D(t),D(h),D(p))}}}function B0(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=B(`#loco-reset-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
|
|
47
|
+
#loco-reset-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
|
|
48
|
+
`),l=pe("g"),o=pe("circle"),a=pe("path"),c=pe("path"),f=pe("path"),d=pe("g"),h=pe("circle"),p=pe("circle"),g=pe("circle"),m=pe("circle"),_=pe("circle"),v=pe("circle"),y=pe("path"),w=pe("line"),C=pe("line"),x=pe("line"),A=pe("circle"),M=pe("circle"),L=pe("circle"),I=E(),P=b("p"),P.textContent="Resetting database…",s(o,"cx","40"),s(o,"cy","40"),s(o,"r","34"),s(o,"fill","none"),s(o,"stroke","#2a3040"),s(o,"stroke-width","4"),s(a,"d","M40 6 A34 34 0 0 1 74 40"),s(a,"fill","none"),s(a,"stroke","#ef4444"),s(a,"stroke-width","4"),s(a,"stroke-linecap","round"),s(c,"d","M74 40 A34 34 0 0 1 56 70"),s(c,"fill","none"),s(c,"stroke","#f97316"),s(c,"stroke-width","4"),s(c,"stroke-linecap","round"),s(f,"d","M56 70 A34 34 0 0 1 24 70"),s(f,"fill","none"),s(f,"stroke","#eab308"),s(f,"stroke-width","4"),s(f,"stroke-linecap","round"),s(l,"id","loco-reset-ring"),s(h,"cx","40"),s(h,"cy","40"),s(h,"r","16"),s(h,"fill","#1a1f2e"),s(p,"cx","40"),s(p,"cy","38"),s(p,"r","10"),s(p,"fill","#2ECC88"),s(g,"cx","37"),s(g,"cy","37"),s(g,"r","2.5"),s(g,"fill","white"),s(m,"cx","37.5"),s(m,"cy","37.5"),s(m,"r","1.5"),s(m,"fill","#2C2C2A"),s(_,"cx","43"),s(_,"cy","37"),s(_,"r","2.5"),s(_,"fill","white"),s(v,"cx","42.5"),s(v,"cy","37.5"),s(v,"r","1.5"),s(v,"fill","#2C2C2A"),s(y,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),s(y,"fill","#E8A020"),s(w,"x1","38"),s(w,"y1","30"),s(w,"x2","36"),s(w,"y2","26"),s(w,"stroke","#FFB833"),s(w,"stroke-width","1.5"),s(w,"stroke-linecap","round"),s(C,"x1","40"),s(C,"y1","29"),s(C,"x2","40"),s(C,"y2","24"),s(C,"stroke","#7BC74A"),s(C,"stroke-width","1.5"),s(C,"stroke-linecap","round"),s(x,"x1","42"),s(x,"y1","30"),s(x,"x2","44"),s(x,"y2","26"),s(x,"stroke","#F07040"),s(x,"stroke-width","1.5"),s(x,"stroke-linecap","round"),s(A,"cx","36"),s(A,"cy","25.5"),s(A,"r","1.5"),s(A,"fill","#FFB833"),s(M,"cx","40"),s(M,"cy","23.5"),s(M,"r","1.5"),s(M,"fill","#7BC74A"),s(L,"cx","44"),s(L,"cy","25.5"),s(L,"r","1.5"),s(L,"fill","#F07040"),s(d,"id","loco-reset-parrot"),s(t,"width","80"),s(t,"height","80"),s(t,"viewBox","0 0 80 80"),s(t,"xmlns","http://www.w3.org/2000/svg"),s(P,"class","text-sm font-medium text-gray-700")},m(z,R){F(z,t,R),u(t,n),u(n,r),u(r,i),u(t,l),u(l,o),u(l,a),u(l,c),u(l,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(d,_),u(d,v),u(d,y),u(d,w),u(d,C),u(d,x),u(d,A),u(d,M),u(d,L),F(z,I,R),F(z,P,R)},d(z){z&&(D(t),D(I),D(P))}}}function Oa(e){let t,n;function r(o,a){if(o[22]==="backing-up")return j0;if(o[22]==="success")return R0}let i=r(e),l=i&&i(e);return{c(){t=b("div"),n=b("div"),l&&l.c(),s(n,"class","bg-white rounded-2xl shadow-2xl px-10 py-8 flex flex-col items-center gap-4 min-w-[220px]"),s(t,"class","fixed inset-0 z-50 flex items-center justify-center bg-black/40"),s(t,"data-testid","backup-modal"),s(t,"data-notranslate","")},m(o,a){F(o,t,a),u(t,n),l&&l.m(n,null)},p(o,a){i!==(i=r(o))&&(l&&l.d(1),l=i&&i(o),l&&(l.c(),l.m(n,null)))},d(o){o&&D(t),l&&l.d()}}}function R0(e){let t,n,r,i,l,o,a,c,f,d,h,p;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=B(`@keyframes loco-circle-grow { 0% { transform: scale(0); opacity: 0; } 50% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
|
|
49
|
+
@keyframes loco-check-draw { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 0; } }
|
|
50
|
+
@keyframes loco-sparkle { 0%, 100% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1); } }
|
|
51
|
+
#loco-success-circle { animation: loco-circle-grow 0.5s cubic-bezier(.34,1.56,.64,1) both; transform-origin: 40px 40px; }
|
|
52
|
+
#loco-checkmark { stroke-dasharray: 30; animation: loco-check-draw 0.4s ease 0.4s both; }
|
|
53
|
+
.loco-spark1 { animation: loco-sparkle 0.6s ease 0.7s both; transform-origin: center; }
|
|
54
|
+
.loco-spark2 { animation: loco-sparkle 0.6s ease 0.85s both; transform-origin: center; }
|
|
55
|
+
.loco-spark3 { animation: loco-sparkle 0.6s ease 1.0s both; transform-origin: center; }
|
|
56
|
+
.loco-spark4 { animation: loco-sparkle 0.6s ease 0.75s both; transform-origin: center; }
|
|
57
|
+
`),l=pe("circle"),o=pe("path"),a=pe("circle"),c=pe("circle"),f=pe("circle"),d=pe("circle"),h=E(),p=b("p"),p.textContent="Backup created!",s(l,"id","loco-success-circle"),s(l,"cx","40"),s(l,"cy","40"),s(l,"r","30"),s(l,"fill","#2ECC88"),s(o,"id","loco-checkmark"),s(o,"d","M25 40 L35 50 L55 30"),s(o,"fill","none"),s(o,"stroke","white"),s(o,"stroke-width","5"),s(o,"stroke-linecap","round"),s(o,"stroke-linejoin","round"),s(a,"class","loco-spark1"),s(a,"cx","12"),s(a,"cy","15"),s(a,"r","3"),s(a,"fill","#FFB833"),s(c,"class","loco-spark2"),s(c,"cx","68"),s(c,"cy","18"),s(c,"r","2.5"),s(c,"fill","#3A8FE0"),s(f,"class","loco-spark3"),s(f,"cx","65"),s(f,"cy","65"),s(f,"r","2"),s(f,"fill","#F07040"),s(d,"class","loco-spark4"),s(d,"cx","15"),s(d,"cy","62"),s(d,"r","2.5"),s(d,"fill","#7BC74A"),s(t,"width","80"),s(t,"height","80"),s(t,"viewBox","0 0 80 80"),s(t,"xmlns","http://www.w3.org/2000/svg"),s(p,"class","text-sm font-medium text-gray-700")},m(g,m){F(g,t,m),u(t,n),u(n,r),u(r,i),u(t,l),u(t,o),u(t,a),u(t,c),u(t,f),u(t,d),F(g,h,m),F(g,p,m)},d(g){g&&(D(t),D(h),D(p))}}}function j0(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M,L,I,P;return{c(){t=pe("svg"),n=pe("defs"),r=pe("style"),i=B(`@keyframes loco-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
58
|
+
@keyframes loco-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(0.92); } }
|
|
59
|
+
#loco-spinner-ring { animation: loco-spin 1.2s linear infinite; transform-origin: 40px 40px; }
|
|
60
|
+
#loco-center-parrot { animation: loco-pulse 2s ease-in-out infinite; transform-origin: 40px 40px; }
|
|
61
|
+
`),l=pe("g"),o=pe("circle"),a=pe("path"),c=pe("path"),f=pe("path"),d=pe("g"),h=pe("circle"),p=pe("circle"),g=pe("circle"),m=pe("circle"),_=pe("circle"),v=pe("circle"),y=pe("path"),w=pe("line"),C=pe("line"),x=pe("line"),A=pe("circle"),M=pe("circle"),L=pe("circle"),I=E(),P=b("p"),P.textContent="Creating backup…",s(o,"cx","40"),s(o,"cy","40"),s(o,"r","34"),s(o,"fill","none"),s(o,"stroke","#2a3040"),s(o,"stroke-width","4"),s(a,"d","M40 6 A34 34 0 0 1 74 40"),s(a,"fill","none"),s(a,"stroke","#2ECC88"),s(a,"stroke-width","4"),s(a,"stroke-linecap","round"),s(c,"d","M74 40 A34 34 0 0 1 56 70"),s(c,"fill","none"),s(c,"stroke","#3A8FE0"),s(c,"stroke-width","4"),s(c,"stroke-linecap","round"),s(f,"d","M56 70 A34 34 0 0 1 24 70"),s(f,"fill","none"),s(f,"stroke","#FFB833"),s(f,"stroke-width","4"),s(f,"stroke-linecap","round"),s(l,"id","loco-spinner-ring"),s(h,"cx","40"),s(h,"cy","40"),s(h,"r","16"),s(h,"fill","#1a1f2e"),s(p,"cx","40"),s(p,"cy","38"),s(p,"r","10"),s(p,"fill","#2ECC88"),s(g,"cx","37"),s(g,"cy","37"),s(g,"r","2.5"),s(g,"fill","white"),s(m,"cx","37.5"),s(m,"cy","37.5"),s(m,"r","1.5"),s(m,"fill","#2C2C2A"),s(_,"cx","43"),s(_,"cy","37"),s(_,"r","2.5"),s(_,"fill","white"),s(v,"cx","42.5"),s(v,"cy","37.5"),s(v,"r","1.5"),s(v,"fill","#2C2C2A"),s(y,"d","M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z"),s(y,"fill","#E8A020"),s(w,"x1","38"),s(w,"y1","30"),s(w,"x2","36"),s(w,"y2","26"),s(w,"stroke","#FFB833"),s(w,"stroke-width","1.5"),s(w,"stroke-linecap","round"),s(C,"x1","40"),s(C,"y1","29"),s(C,"x2","40"),s(C,"y2","24"),s(C,"stroke","#7BC74A"),s(C,"stroke-width","1.5"),s(C,"stroke-linecap","round"),s(x,"x1","42"),s(x,"y1","30"),s(x,"x2","44"),s(x,"y2","26"),s(x,"stroke","#F07040"),s(x,"stroke-width","1.5"),s(x,"stroke-linecap","round"),s(A,"cx","36"),s(A,"cy","25.5"),s(A,"r","1.5"),s(A,"fill","#FFB833"),s(M,"cx","40"),s(M,"cy","23.5"),s(M,"r","1.5"),s(M,"fill","#7BC74A"),s(L,"cx","44"),s(L,"cy","25.5"),s(L,"r","1.5"),s(L,"fill","#F07040"),s(d,"id","loco-center-parrot"),s(t,"width","80"),s(t,"height","80"),s(t,"viewBox","0 0 80 80"),s(t,"xmlns","http://www.w3.org/2000/svg"),s(P,"class","text-sm font-medium text-gray-700")},m(z,R){F(z,t,R),u(t,n),u(n,r),u(r,i),u(t,l),u(l,o),u(l,a),u(l,c),u(l,f),u(t,d),u(d,h),u(d,p),u(d,g),u(d,m),u(d,_),u(d,v),u(d,y),u(d,w),u(d,C),u(d,x),u(d,A),u(d,M),u(d,L),F(z,I,R),F(z,P,R)},d(z){z&&(D(t),D(I),D(P))}}}function O0(e){let t,n,r,i,l,o,a,c,f,d,h=e[2]?"Saving…":"Save",p,g,m,_,v,y,w,C,x=e[25].api_key+"",A,M,L,I=e[1]==="key"?"Copied":"Copy",P,z,R,T=e[3]?"Regenerating…":"Regenerate API Key",N,k,j,J,W,G,Z,ne,O,Y,re,K=e[6]?"🙈":"👁️",X,fe,ye,Ie=e[5]?"Saving…":"Save",le,ve,se,te,Se,S,ie,q,H=e[1]==="snippet"?"Copied":"Copy Snippet",U,V,ae,ce,Q,de,ge,he,xe,Re,we,Me,ze,Ee,Ge,oe,Fe,me,Ae,Ue,Ce,Te,et,Xe,Le,Ye,ke,qe,tt,yt,Rt,Mt,en,jt,Ot,be=e[14]?"Enabled":"Disabled",He,Je,at,wt,_t,ut,bt,it,Ze,Oe,Qe,St,ot,In,Ln=e[15]?"Enabled":"Disabled",Nn,sr,Et,bn,Pn,ar,un,ur,zn,cr,Hn,fr,Ct,Dn,dr,Fn,hr,_e,Ve=e[16]?"Clearing…":"Clear All Pending",$e,Nt,kt,Ut,Zn,Ht,cn,pr=e[17]?"Resetting…":"Reset Entire Database",Ur,ci,yn,xn,gr,fi,mr,_r=e[10]?"▲":"▼",Hr,di,Zr,Wn,Yn,Gn,Wr,hi;function pi(Pe,rt){return Pe[6]?E0:M0}let br=pi(e),fn=br(e),Bn=Be(e[7]),It=[];for(let Pe=0;Pe<Bn.length;Pe+=1)It[Pe]=Ma(Ta(e,Bn,Pe));let ue=e[7].length===0&&Ea();function Ne(Pe,rt){return Pe[20]?L0:I0}let nt=Ne(e),Ke=nt(e),ht=!e[18].length&&!e[19]&&Ia(e);function tn(Pe,rt){if(Pe[19])return P0;if(Pe[18].length>0)return N0}let Zt=tn(e),Pt=Zt&&Zt(e),Wt=e[10]&&Na(e),Yt=e[24]&&Ra(e),Gt=e[23]&&ja(e),Vt=e[22]&&Oa(e);return{c(){t=b("div"),n=b("h2"),n.textContent="Settings",r=E(),i=b("div"),l=b("label"),l.textContent="Project Name",o=E(),a=b("div"),c=b("input"),f=E(),d=b("button"),p=B(h),m=E(),_=b("div"),v=b("div"),v.textContent="API Key",y=E(),w=b("div"),C=b("code"),A=B(x),M=E(),L=b("button"),P=B(I),z=E(),R=b("button"),N=B(T),k=E(),j=b("div"),J=b("label"),J.textContent="BlueHive API Key",W=E(),G=b("p"),G.innerHTML='Required for AI-powered translations. Get your key from <a href="https://app.ozwell.ai" target="_blank" class="text-indigo-600 hover:underline">app.ozwell.ai</a>',Z=E(),ne=b("div"),O=b("div"),fn.c(),Y=E(),re=b("button"),X=B(K),fe=E(),ye=b("button"),le=B(Ie),ve=E(),se=b("div"),te=b("div"),te.textContent="CDN Script Snippet",Se=E(),S=b("pre"),S.textContent=`${e[28]()}`,ie=E(),q=b("button"),U=B(H),V=E(),ae=b("div"),ce=b("div"),ce.textContent="Target Languages",Q=E(),de=b("div");for(let Pe=0;Pe<It.length;Pe+=1)It[Pe].c();ge=E(),ue&&ue.c(),he=E(),xe=b("div"),Re=b("div"),we=b("label"),we.textContent="Language Code",Me=E(),ze=b("input"),Ee=E(),Ge=b("div"),oe=b("label"),oe.textContent="Language Name",Fe=E(),me=b("input"),Ae=E(),Ue=b("button"),Ce=B("Add"),et=E(),Xe=b("div"),Le=b("div"),Le.textContent="DOM Context",Ye=E(),ke=b("p"),ke.textContent="When enabled, the Loco client builds context breadcrumbs (headings, labels, sections) for each phrase. This helps distinguish identical text in different parts of the page. Disable to simplify phrase collection and improve performance on large pages.",qe=E(),tt=b("label"),yt=b("button"),Rt=b("span"),jt=E(),Ot=b("span"),He=B(be),Je=E(),at=b("div"),wt=b("div"),wt.textContent="Page Screenshots",_t=E(),ut=b("p"),ut.textContent="When enabled, the Loco client will capture a page screenshot and send it to the dashboard for context during translation.",bt=E(),it=b("label"),Ze=b("button"),Oe=b("span"),ot=E(),In=b("span"),Nn=B(Ln),sr=E(),Et=b("div"),bn=b("div"),Pn=b("div"),Pn.textContent="Backups",ar=E(),un=b("button"),Ke.c(),ur=E(),zn=b("p"),zn.innerHTML='Create point-in-time snapshots of your database. To restore, stop the server and replace <code class="bg-gray-100 px-1 rounded">server/data/loco.db</code> with a backup file.',cr=E(),ht&&ht.c(),Hn=E(),Pt&&Pt.c(),fr=E(),Ct=b("div"),Dn=b("div"),Dn.textContent="Danger Zone",dr=E(),Fn=b("p"),Fn.textContent="Delete all pending text nodes from the database. Approved and trashed items are not affected.",hr=E(),_e=b("button"),$e=B(Ve),Nt=E(),kt=b("hr"),Ut=E(),Zn=b("p"),Zn.textContent="Delete ALL text nodes, translations, and screenshots. The project and its settings will be kept.",Ht=E(),cn=b("button"),Ur=B(pr),ci=E(),yn=b("div"),xn=b("button"),gr=b("span"),gr.textContent="Crawler Configuration",fi=E(),mr=b("span"),Hr=B(_r),di=E(),Wt&&Wt.c(),Zr=E(),Yt&&Yt.c(),Wn=E(),Gt&&Gt.c(),Yn=E(),Vt&&Vt.c(),Gn=xt(),s(n,"class","text-xl font-semibold text-gray-800 mb-6"),s(l,"for","project-name"),s(l,"class","block text-sm font-medium text-gray-600 mb-2"),s(c,"id","project-name"),s(c,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"),s(c,"placeholder","Project name"),s(d,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),d.disabled=g=e[2]||e[0]===e[25].name,s(a,"class","flex gap-2"),s(i,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(v,"class","block text-sm font-medium text-gray-600 mb-2"),s(C,"data-notranslate",""),s(C,"class","flex-1 px-3 py-2 bg-gray-50 border border-gray-200 rounded-md text-sm font-mono text-gray-700 select-all"),s(L,"class","px-3 py-2 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),s(w,"class","flex gap-2 items-center"),s(R,"class","mt-3 px-3 py-1.5 border border-red-300 text-red-600 text-xs rounded-md hover:bg-red-50 disabled:opacity-50"),R.disabled=e[3],s(_,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(J,"for","bluehive-api-key"),s(J,"class","block text-sm font-medium text-gray-600 mb-2"),s(G,"class","text-xs text-gray-400 mb-2"),s(re,"class","absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 text-xs"),s(re,"type","button"),s(O,"class","relative flex-1"),s(ye,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),ye.disabled=e[5],s(ne,"class","flex gap-2"),s(j,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(te,"class","block text-sm font-medium text-gray-600 mb-2"),s(S,"data-notranslate",""),s(S,"class","px-3 py-2 bg-gray-50 border border-gray-200 rounded-md text-xs font-mono text-gray-700 overflow-x-auto whitespace-pre-wrap"),s(q,"class","mt-2 px-3 py-1.5 border border-gray-300 rounded-md text-sm hover:bg-gray-50"),s(se,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(ce,"class","block text-sm font-medium text-gray-600 mb-3"),s(de,"class","space-y-1 mb-4"),s(de,"data-notranslate",""),s(we,"for","new-language-code"),s(we,"class","block text-xs text-gray-500 mb-1"),s(ze,"id","new-language-code"),s(ze,"placeholder","e.g. zh-Hans"),s(ze,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(Re,"class","flex-1"),s(oe,"for","new-language-name"),s(oe,"class","block text-xs text-gray-500 mb-1"),s(me,"id","new-language-name"),s(me,"placeholder","e.g. Chinese (Simplified)"),s(me,"class","w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(Ge,"class","flex-1"),s(Ue,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),Ue.disabled=Te=!e[8].trim()||!e[9].trim(),s(xe,"class","flex gap-2 items-end"),s(ae,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(Le,"class","block text-sm font-medium text-gray-700 mb-2"),s(ke,"class","text-xs text-gray-500 mb-3"),s(Rt,"class",Mt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[14]?"translate-x-6":"translate-x-1")),s(yt,"class",en="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[14]?"bg-indigo-600":"bg-gray-300")),s(yt,"role","switch"),s(yt,"aria-checked",e[14]),s(Ot,"class","text-sm text-gray-700"),s(tt,"class","flex items-center gap-3 cursor-pointer"),s(Xe,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(wt,"class","block text-sm font-medium text-gray-700 mb-2"),s(ut,"class","text-xs text-gray-500 mb-3"),s(Oe,"class",Qe="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(e[15]?"translate-x-6":"translate-x-1")),s(Ze,"class",St="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(e[15]?"bg-indigo-600":"bg-gray-300")),s(Ze,"role","switch"),s(Ze,"aria-checked",e[15]),s(In,"class","text-sm text-gray-700"),s(it,"class","flex items-center gap-3 cursor-pointer"),s(at,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(Pn,"class","text-sm font-medium text-gray-700"),s(un,"class","px-3 py-1.5 bg-indigo-600 text-white text-xs rounded-md hover:bg-indigo-700 disabled:opacity-50 flex items-center gap-1.5"),un.disabled=e[20],s(bn,"class","flex items-center justify-between mb-3"),s(zn,"class","text-xs text-gray-400 mb-3"),s(Et,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(Et,"data-notranslate",""),s(Dn,"class","block text-sm font-medium text-red-600 mb-2"),s(Fn,"class","text-xs text-gray-500 mb-3"),s(_e,"class","px-4 py-2 bg-red-600 text-white text-sm rounded-md hover:bg-red-700 disabled:opacity-50"),_e.disabled=e[16],s(kt,"class","my-4 border-red-100"),s(Zn,"class","text-xs text-gray-500 mb-3"),s(cn,"class","px-4 py-2 bg-red-700 text-white text-sm rounded-md hover:bg-red-800 disabled:opacity-50"),cn.disabled=e[17],s(Ct,"class","bg-white rounded-lg border border-red-200 p-5 mb-4"),s(Ct,"data-notranslate",""),s(gr,"class","text-sm font-medium text-gray-600"),s(mr,"class","text-gray-400 text-xs"),s(xn,"class","flex items-center justify-between w-full text-left"),s(yn,"class","bg-white rounded-lg border border-gray-200 p-5 mb-4"),s(yn,"data-notranslate",""),s(t,"class","max-w-2xl")},m(Pe,rt){F(Pe,t,rt),u(t,n),u(t,r),u(t,i),u(i,l),u(i,o),u(i,a),u(a,c),De(c,e[0]),u(a,f),u(a,d),u(d,p),u(t,m),u(t,_),u(_,v),u(_,y),u(_,w),u(w,C),u(C,A),u(w,M),u(w,L),u(L,P),u(_,z),u(_,R),u(R,N),u(t,k),u(t,j),u(j,J),u(j,W),u(j,G),u(j,Z),u(j,ne),u(ne,O),fn.m(O,null),u(O,Y),u(O,re),u(re,X),u(ne,fe),u(ne,ye),u(ye,le),u(t,ve),u(t,se),u(se,te),u(se,Se),u(se,S),u(se,ie),u(se,q),u(q,U),u(t,V),u(t,ae),u(ae,ce),u(ae,Q),u(ae,de);for(let Lt=0;Lt<It.length;Lt+=1)It[Lt]&&It[Lt].m(de,null);u(ae,ge),ue&&ue.m(ae,null),u(ae,he),u(ae,xe),u(xe,Re),u(Re,we),u(Re,Me),u(Re,ze),De(ze,e[8]),u(xe,Ee),u(xe,Ge),u(Ge,oe),u(Ge,Fe),u(Ge,me),De(me,e[9]),u(xe,Ae),u(xe,Ue),u(Ue,Ce),u(t,et),u(t,Xe),u(Xe,Le),u(Xe,Ye),u(Xe,ke),u(Xe,qe),u(Xe,tt),u(tt,yt),u(yt,Rt),u(tt,jt),u(tt,Ot),u(Ot,He),u(t,Je),u(t,at),u(at,wt),u(at,_t),u(at,ut),u(at,bt),u(at,it),u(it,Ze),u(Ze,Oe),u(it,ot),u(it,In),u(In,Nn),u(t,sr),u(t,Et),u(Et,bn),u(bn,Pn),u(bn,ar),u(bn,un),Ke.m(un,null),u(Et,ur),u(Et,zn),u(Et,cr),ht&&ht.m(Et,null),u(Et,Hn),Pt&&Pt.m(Et,null),u(t,fr),u(t,Ct),u(Ct,Dn),u(Ct,dr),u(Ct,Fn),u(Ct,hr),u(Ct,_e),u(_e,$e),u(Ct,Nt),u(Ct,kt),u(Ct,Ut),u(Ct,Zn),u(Ct,Ht),u(Ct,cn),u(cn,Ur),u(t,ci),u(t,yn),u(yn,xn),u(xn,gr),u(xn,fi),u(xn,mr),u(mr,Hr),u(yn,di),Wt&&Wt.m(yn,null),F(Pe,Zr,rt),Yt&&Yt.m(Pe,rt),F(Pe,Wn,rt),Gt&&Gt.m(Pe,rt),F(Pe,Yn,rt),Vt&&Vt.m(Pe,rt),F(Pe,Gn,rt),Wr||(hi=[$(c,"input",e[47]),$(d,"click",e[30]),$(L,"click",e[48]),$(R,"click",e[31]),$(re,"click",e[51]),$(ye,"click",e[29]),$(q,"click",e[52]),$(ze,"input",e[54]),$(me,"input",e[55]),$(Ue,"click",e[32]),$(yt,"click",e[40]),$(Ze,"click",e[39]),$(un,"click",e[44]),$(_e,"click",e[41]),$(cn,"click",e[42]),$(xn,"click",e[57])],Wr=!0)},p(Pe,rt){if(rt[0]&1&&c.value!==Pe[0]&&De(c,Pe[0]),rt[0]&4&&h!==(h=Pe[2]?"Saving…":"Save")&&ee(p,h),rt[0]&33554437&&g!==(g=Pe[2]||Pe[0]===Pe[25].name)&&(d.disabled=g),rt[0]&33554432&&x!==(x=Pe[25].api_key+"")&&ee(A,x),rt[0]&2&&I!==(I=Pe[1]==="key"?"Copied":"Copy")&&ee(P,I),rt[0]&8&&T!==(T=Pe[3]?"Regenerating…":"Regenerate API Key")&&ee(N,T),rt[0]&8&&(R.disabled=Pe[3]),br===(br=pi(Pe))&&fn?fn.p(Pe,rt):(fn.d(1),fn=br(Pe),fn&&(fn.c(),fn.m(O,Y))),rt[0]&64&&K!==(K=Pe[6]?"🙈":"👁️")&&ee(X,K),rt[0]&32&&Ie!==(Ie=Pe[5]?"Saving…":"Save")&&ee(le,Ie),rt[0]&32&&(ye.disabled=Pe[5]),rt[0]&2&&H!==(H=Pe[1]==="snippet"?"Copied":"Copy Snippet")&&ee(U,H),rt[0]&128|rt[1]&4){Bn=Be(Pe[7]);let Lt;for(Lt=0;Lt<Bn.length;Lt+=1){const uo=Ta(Pe,Bn,Lt);It[Lt]?It[Lt].p(uo,rt):(It[Lt]=Ma(uo),It[Lt].c(),It[Lt].m(de,null))}for(;Lt<It.length;Lt+=1)It[Lt].d(1);It.length=Bn.length}Pe[7].length===0?ue||(ue=Ea(),ue.c(),ue.m(ae,he)):ue&&(ue.d(1),ue=null),rt[0]&256&&ze.value!==Pe[8]&&De(ze,Pe[8]),rt[0]&512&&me.value!==Pe[9]&&De(me,Pe[9]),rt[0]&768&&Te!==(Te=!Pe[8].trim()||!Pe[9].trim())&&(Ue.disabled=Te),rt[0]&16384&&Mt!==(Mt="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Pe[14]?"translate-x-6":"translate-x-1"))&&s(Rt,"class",Mt),rt[0]&16384&&en!==(en="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Pe[14]?"bg-indigo-600":"bg-gray-300"))&&s(yt,"class",en),rt[0]&16384&&s(yt,"aria-checked",Pe[14]),rt[0]&16384&&be!==(be=Pe[14]?"Enabled":"Disabled")&&ee(He,be),rt[0]&32768&&Qe!==(Qe="inline-block h-4 w-4 transform rounded-full bg-white transition-transform "+(Pe[15]?"translate-x-6":"translate-x-1"))&&s(Oe,"class",Qe),rt[0]&32768&&St!==(St="relative inline-flex h-6 w-11 items-center rounded-full transition-colors "+(Pe[15]?"bg-indigo-600":"bg-gray-300"))&&s(Ze,"class",St),rt[0]&32768&&s(Ze,"aria-checked",Pe[15]),rt[0]&32768&&Ln!==(Ln=Pe[15]?"Enabled":"Disabled")&&ee(Nn,Ln),nt!==(nt=Ne(Pe))&&(Ke.d(1),Ke=nt(Pe),Ke&&(Ke.c(),Ke.m(un,null))),rt[0]&1048576&&(un.disabled=Pe[20]),!Pe[18].length&&!Pe[19]?ht?ht.p(Pe,rt):(ht=Ia(Pe),ht.c(),ht.m(Et,Hn)):ht&&(ht.d(1),ht=null),Zt===(Zt=tn(Pe))&&Pt?Pt.p(Pe,rt):(Pt&&Pt.d(1),Pt=Zt&&Zt(Pe),Pt&&(Pt.c(),Pt.m(Et,null))),rt[0]&65536&&Ve!==(Ve=Pe[16]?"Clearing…":"Clear All Pending")&&ee($e,Ve),rt[0]&65536&&(_e.disabled=Pe[16]),rt[0]&131072&&pr!==(pr=Pe[17]?"Resetting…":"Reset Entire Database")&&ee(Ur,pr),rt[0]&131072&&(cn.disabled=Pe[17]),rt[0]&1024&&_r!==(_r=Pe[10]?"▲":"▼")&&ee(Hr,_r),Pe[10]?Wt?Wt.p(Pe,rt):(Wt=Na(Pe),Wt.c(),Wt.m(yn,null)):Wt&&(Wt.d(1),Wt=null),Pe[24]?Yt?Yt.p(Pe,rt):(Yt=Ra(Pe),Yt.c(),Yt.m(Wn.parentNode,Wn)):Yt&&(Yt.d(1),Yt=null),Pe[23]?Gt?Gt.p(Pe,rt):(Gt=ja(Pe),Gt.c(),Gt.m(Yn.parentNode,Yn)):Gt&&(Gt.d(1),Gt=null),Pe[22]?Vt?Vt.p(Pe,rt):(Vt=Oa(Pe),Vt.c(),Vt.m(Gn.parentNode,Gn)):Vt&&(Vt.d(1),Vt=null)},i:je,o:je,d(Pe){Pe&&(D(t),D(Zr),D(Wn),D(Yn),D(Gn)),fn.d(),ft(It,Pe),ue&&ue.d(),Ke.d(),ht&&ht.d(),Pt&&Pt.d(),Wt&&Wt.d(),Yt&&Yt.d(Pe),Gt&&Gt.d(Pe),Vt&&Vt.d(Pe),Wr=!1,lt(hi)}}}function Ua(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}function Ha(e){return new Date(e).toLocaleString()}function U0(e,t,n){let r;ti(e,dn,Ce=>n(25,r=Ce));const i=[{code:"zh-Hans",name:"Chinese (Simplified)"},{code:"zh-Hant",name:"Chinese (Traditional)"},{code:"es",name:"Spanish"},{code:"hi",name:"Hindi"},{code:"te",name:"Telugu"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"pt",name:"Portuguese"}],l={blockedTags:["SCRIPT","STYLE","NOSCRIPT","IFRAME","CODE","SVG","AUDIO","VIDEO","LINK"],inlineTags:["VAR","STRONG","EM","B","I","SPAN","A","ABBR","MARK","SMALL","SUB","SUP","U","S","TIME"],domContextSelectors:["h1","h2","h3","h4","h5","h6","label","legend","caption","figcaption","nav","header","footer","main","section","article","form",".portlet-header",".admin-card",".wc_win_title",".miewin_title_bar",".ui-dialog-title",".ui-dialog-titlebar",".wc_tab_title"]},o=[{key:"blockedTags",title:"Blocked Tags",desc:"HTML tags to skip during text extraction.",placeholder:"e.g. CANVAS"},{key:"inlineTags",title:"Inline Tags",desc:"Tags treated as inline content in mixed-content extraction.",placeholder:"e.g. CITE"},{key:"domContextSelectors",title:"DOM Context Selectors",desc:"CSS selectors used to build context breadcrumbs for each phrase.",placeholder:"e.g. .my-header"}];let a="",c="",f=!1,d=!1,h={},p="",g=!1,m=!1,_=[],v="",y="",w=!1,C={blockedTags:{disabled:[],custom:[]},inlineTags:{disabled:[],custom:[]},domContextSelectors:{disabled:[],custom:[]}},x={blockedTags:"",inlineTags:"",domContextSelectors:""},A=0,M=!0,L=!0,I=!1,P=!1,z=[],R=!1,T=!1,N=null,k=!1,j=!1,J=!1;jr(()=>{n(0,a=r.name||"");try{h=JSON.parse(r.settings||"{}")}catch{h={}}n(7,_=h.languages||i.map(Ce=>({...Ce}))),n(4,p=h.bluehiveApiKey||""),n(11,C={blockedTags:{disabled:[],custom:[],...h.blockedTags||{}},inlineTags:{disabled:[],custom:[],...h.inlineTags||{}},domContextSelectors:{disabled:[],custom:[],...h.domContextSelectors||{}}}),n(13,A=typeof h.contextDepth=="number"?h.contextDepth:0),n(14,M=h.domContextEnabled!==!1),n(15,L=h.screenshotsEnabled!==!1)});function W(){const Ce=window.location.pathname.replace(/\/dashboard\/?$/,""),Te=window.location.origin+Ce;return`<script src="${Te}/cdn/loco.js"><\/script>
|
|
62
|
+
<script>Loco.init({ apiUrl: '${Te}', apiKey: '${r.api_key}' });<\/script>`}async function G(){n(5,g=!0),h.bluehiveApiKey=p.trim();const Ce=await We("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});yr(dn,r=await Ce.json(),r),n(5,g=!1)}async function Z(){n(2,f=!0);const Ce=await We("../api/project",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})});yr(dn,r=await Ce.json(),r),n(2,f=!1)}async function ne(){if(!confirm("Are you sure? This will invalidate the current API key. All pages using the old key will stop receiving translations."))return;n(3,d=!0);const Ce=await We("../api/project/regenerate-key",{method:"POST"});yr(dn,r=await Ce.json(),r),r&&r.api_key&&zc(r.api_key),n(3,d=!1)}async function O(){h.languages=_;const Ce=await We("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});yr(dn,r=await Ce.json(),r)}function Y(){const Ce=v.trim(),Te=y.trim();!Ce||!Te||_.some(et=>et.code===Ce)||(n(7,_=[..._,{code:Ce,name:Te}]),n(8,v=""),n(9,y=""),O())}function re(Ce){n(7,_=_.filter(Te=>Te.code!==Ce)),O()}async function K(){h.blockedTags=C.blockedTags,h.inlineTags=C.inlineTags,h.domContextSelectors=C.domContextSelectors,h.contextDepth=A;const Ce=await We("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});yr(dn,r=await Ce.json(),r)}function X(Ce,Te){const et=C[Ce].disabled,Xe=et.indexOf(Te);Xe>=0?et.splice(Xe,1):et.push(Te),n(11,C),K()}function fe(Ce){const Te=x[Ce].trim();!Te||C[Ce].custom.includes(Te)||(n(11,C[Ce].custom=[...C[Ce].custom,Te],C),n(12,x[Ce]="",x),n(12,x),K())}function ye(Ce,Te){n(11,C[Ce].custom=C[Ce].custom.filter(et=>et!==Te),C),n(11,C),K()}function Ie(Ce,Te){return!C[Ce].disabled.includes(Te)}async function le(){n(15,L=!L),h.screenshotsEnabled=L,await We("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})})}async function ve(){n(14,M=!M),h.domContextEnabled=M;const Ce=await We("../api/project/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:h})});yr(dn,r=await Ce.json(),r)}async function se(){if(confirm("Delete ALL pending text nodes? This cannot be undone.")){n(16,I=!0),n(24,J="clearing");try{await We("../api/textnodes/clear-pending",{method:"POST"}),n(24,J="success"),await new Promise(Ce=>setTimeout(Ce,1500))}catch{}n(24,J=!1),n(16,I=!1)}}async function te(){if(confirm("This will permanently delete ALL text nodes, translations, and screenshots. This cannot be undone. Are you sure?")){n(17,P=!0),n(23,j="resetting");try{await We("../api/project/reset-database",{method:"POST"}),n(23,j="success"),await new Promise(Ce=>setTimeout(Ce,1500))}catch{}n(23,j=!1),n(17,P=!1)}}async function Se(){n(19,R=!0);try{const Ce=await We("../api/backups");n(18,z=await Ce.json())}catch{n(18,z=[])}n(19,R=!1)}async function S(){n(20,T=!0),n(22,k="backing-up");try{await We("../api/backups",{method:"POST"}),await Se(),n(22,k="success"),await new Promise(Ce=>setTimeout(Ce,1500))}catch{}n(22,k=!1),n(20,T=!1)}async function ie(Ce){if(confirm(`Delete backup "${Ce}"? This cannot be undone.`)){n(21,N=Ce);try{await We(`../api/backups/${encodeURIComponent(Ce)}`,{method:"DELETE"}),await Se()}catch{}n(21,N=null)}}async function q(Ce,Te){await navigator.clipboard.writeText(Ce),n(1,c=Te),setTimeout(()=>{n(1,c="")},2e3)}function H(){a=this.value,n(0,a)}const U=()=>q(r.api_key,"key");function V(){p=this.value,n(4,p)}function ae(){p=this.value,n(4,p)}const ce=()=>n(6,m=!m),Q=()=>q(W(),"snippet"),de=Ce=>re(Ce.code);function ge(){v=this.value,n(8,v)}function he(){y=this.value,n(9,y)}const xe=Ce=>ie(Ce.filename),Re=()=>n(10,w=!w),we=()=>{n(13,A=0),K()},Me=()=>{A===0&&(n(13,A=5),K())},ze=()=>{n(13,A=Math.max(1,A-1)),K()};function Ee(){A=Tc(this.value),n(13,A)}const Ge=()=>{n(13,A=A+1),K()},oe=(Ce,Te)=>X(Ce.key,Te),Fe=(Ce,Te)=>ye(Ce.key,Te);function me(Ce){x[Ce.key]=this.value,n(12,x)}return[a,c,f,d,p,g,m,_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k,j,J,r,l,o,W,G,Z,ne,Y,re,K,X,fe,ye,Ie,le,ve,se,te,Se,S,ie,q,H,U,V,ae,ce,Q,de,ge,he,xe,Re,we,Me,ze,Ee,Ge,oe,Fe,me,(Ce,Te)=>{Te.key==="Enter"&&fe(Ce.key)},Ce=>fe(Ce.key)]}class H0 extends an{constructor(t){super(),sn(this,t,U0,O0,$t,{},null,[-1,-1,-1])}}function Ti(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Z0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Yl(e){let t,n,r;e.length!==2?(t=Ti,n=(a,c)=>Ti(e(a),c),r=(a,c)=>e(a)-c):(t=e===Ti||e===Z0?e:W0,n=e,r=e);function i(a,c,f=0,d=a.length){if(f<d){if(t(c,c)!==0)return d;do{const h=f+d>>>1;n(a[h],c)<0?f=h+1:d=h}while(f<d)}return f}function l(a,c,f=0,d=a.length){if(f<d){if(t(c,c)!==0)return d;do{const h=f+d>>>1;n(a[h],c)<=0?f=h+1:d=h}while(f<d)}return f}function o(a,c,f=0,d=a.length){const h=i(a,c,f,d-1);return h>f&&r(a[h-1],c)>-r(a[h],c)?h-1:h}return{left:i,center:o,right:l}}function W0(){return 0}function Y0(e){return e===null?NaN:+e}const G0=Yl(Ti),V0=G0.right;Yl(Y0).center;function X0(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let l of e)(l=t(l,++i,e))!=null&&(n===void 0?l>=l&&(n=r=l):(n>l&&(n=l),r<l&&(r=l)))}return[n,r]}class Za extends Map{constructor(t,n=K0){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(Wa(this,t))}has(t){return super.has(Wa(this,t))}set(t,n){return super.set(J0(this,t),n)}delete(t){return super.delete(q0(this,t))}}function Wa({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function J0({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function q0({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function K0(e){return e!==null&&typeof e=="object"?e.valueOf():e}const Q0=Math.sqrt(50),$0=Math.sqrt(10),eh=Math.sqrt(2);function Bi(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),l=r/Math.pow(10,i),o=l>=Q0?10:l>=$0?5:l>=eh?2:1;let a,c,f;return i<0?(f=Math.pow(10,-i)/o,a=Math.round(e*f),c=Math.round(t*f),a/f<e&&++a,c/f>t&&--c,f=-f):(f=Math.pow(10,i)*o,a=Math.round(e/f),c=Math.round(t/f),a*f<e&&++a,c*f>t&&--c),c<a&&.5<=n&&n<2?Bi(e,t,n*2):[a,c,f]}function th(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,l,o]=r?Bi(t,e,n):Bi(e,t,n);if(!(l>=i))return[];const a=l-i+1,c=new Array(a);if(r)if(o<0)for(let f=0;f<a;++f)c[f]=(l-f)/-o;else for(let f=0;f<a;++f)c[f]=(l-f)*o;else if(o<0)for(let f=0;f<a;++f)c[f]=(i+f)/-o;else for(let f=0;f<a;++f)c[f]=(i+f)*o;return c}function Tl(e,t,n){return t=+t,e=+e,n=+n,Bi(e,t,n)[2]}function Ml(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Tl(t,e,n):Tl(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function vi(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function nh(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,l=new Array(i);++r<i;)l[r]=e+r*n;return l}function rh(e){return e}var fl=1,dl=2,El=3,Jr=4,Ya=1e-6;function ih(e){return"translate("+e+",0)"}function lh(e){return"translate(0,"+e+")"}function oh(e){return t=>+e(t)}function sh(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function ah(){return!this.__axis}function Oc(e,t){var n=[],r=null,i=null,l=6,o=6,a=3,c=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=e===fl||e===Jr?-1:1,d=e===Jr||e===dl?"x":"y",h=e===fl||e===El?ih:lh;function p(g){var m=r??(t.ticks?t.ticks.apply(t,n):t.domain()),_=i??(t.tickFormat?t.tickFormat.apply(t,n):rh),v=Math.max(l,0)+a,y=t.range(),w=+y[0]+c,C=+y[y.length-1]+c,x=(t.bandwidth?sh:oh)(t.copy(),c),A=g.selection?g.selection():g,M=A.selectAll(".domain").data([null]),L=A.selectAll(".tick").data(m,t).order(),I=L.exit(),P=L.enter().append("g").attr("class","tick"),z=L.select("line"),R=L.select("text");M=M.merge(M.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),L=L.merge(P),z=z.merge(P.append("line").attr("stroke","currentColor").attr(d+"2",f*l)),R=R.merge(P.append("text").attr("fill","currentColor").attr(d,f*v).attr("dy",e===fl?"0em":e===El?"0.71em":"0.32em")),g!==A&&(M=M.transition(g),L=L.transition(g),z=z.transition(g),R=R.transition(g),I=I.transition(g).attr("opacity",Ya).attr("transform",function(T){return isFinite(T=x(T))?h(T+c):this.getAttribute("transform")}),P.attr("opacity",Ya).attr("transform",function(T){var N=this.parentNode.__axis;return h((N&&isFinite(N=N(T))?N:x(T))+c)})),I.remove(),M.attr("d",e===Jr||e===dl?o?"M"+f*o+","+w+"H"+c+"V"+C+"H"+f*o:"M"+c+","+w+"V"+C:o?"M"+w+","+f*o+"V"+c+"H"+C+"V"+f*o:"M"+w+","+c+"H"+C),L.attr("opacity",1).attr("transform",function(T){return h(x(T)+c)}),z.attr(d+"2",f*l),R.attr(d,f*v).text(_),A.filter(ah).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===dl?"start":e===Jr?"end":"middle"),A.each(function(){this.__axis=x})}return p.scale=function(g){return arguments.length?(t=g,p):t},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(g){return arguments.length?(n=g==null?[]:Array.from(g),p):n.slice()},p.tickValues=function(g){return arguments.length?(r=g==null?null:Array.from(g),p):r&&r.slice()},p.tickFormat=function(g){return arguments.length?(i=g,p):i},p.tickSize=function(g){return arguments.length?(l=o=+g,p):l},p.tickSizeInner=function(g){return arguments.length?(l=+g,p):l},p.tickSizeOuter=function(g){return arguments.length?(o=+g,p):o},p.tickPadding=function(g){return arguments.length?(a=+g,p):a},p.offset=function(g){return arguments.length?(c=+g,p):c},p}function Ga(e){return Oc(El,e)}function Va(e){return Oc(Jr,e)}var uh={value:()=>{}};function Uc(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Mi(n)}function Mi(e){this._=e}function ch(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Mi.prototype=Uc.prototype={constructor:Mi,on:function(e,t){var n=this._,r=ch(e+"",n),i,l=-1,o=r.length;if(arguments.length<2){for(;++l<o;)if((i=(e=r[l]).type)&&(i=fh(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(i=(e=r[l]).type)n[i]=Xa(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Xa(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Mi(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,l;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],r=0,i=l.length;r<i;++r)l[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,l=r.length;i<l;++i)r[i].value.apply(t,n)}};function fh(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Xa(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=uh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Il="http://www.w3.org/1999/xhtml";const Ja={svg:"http://www.w3.org/2000/svg",xhtml:Il,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function el(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Ja.hasOwnProperty(t)?{space:Ja[t],local:e}:e}function dh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Il&&t.documentElement.namespaceURI===Il?t.createElement(e):t.createElementNS(n,e)}}function hh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hc(e){var t=el(e);return(t.local?hh:dh)(t)}function ph(){}function Gl(e){return e==null?ph:function(){return this.querySelector(e)}}function gh(e){typeof e!="function"&&(e=Gl(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,a=r[i]=new Array(o),c,f,d=0;d<o;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),a[d]=f);return new on(r,this._parents)}function mh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _h(){return[]}function Zc(e){return e==null?_h:function(){return this.querySelectorAll(e)}}function bh(e){return function(){return mh(e.apply(this,arguments))}}function yh(e){typeof e=="function"?e=bh(e):e=Zc(e);for(var t=this._groups,n=t.length,r=[],i=[],l=0;l<n;++l)for(var o=t[l],a=o.length,c,f=0;f<a;++f)(c=o[f])&&(r.push(e.call(c,c.__data__,f,o)),i.push(c));return new on(r,i)}function Wc(e){return function(){return this.matches(e)}}function Yc(e){return function(t){return t.matches(e)}}var vh=Array.prototype.find;function wh(e){return function(){return vh.call(this.children,e)}}function kh(){return this.firstElementChild}function xh(e){return this.select(e==null?kh:wh(typeof e=="function"?e:Yc(e)))}var Ch=Array.prototype.filter;function Ah(){return Array.from(this.children)}function Sh(e){return function(){return Ch.call(this.children,e)}}function Th(e){return this.selectAll(e==null?Ah:Sh(typeof e=="function"?e:Yc(e)))}function Mh(e){typeof e!="function"&&(e=Wc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,a=r[i]=[],c,f=0;f<o;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&a.push(c);return new on(r,this._parents)}function Gc(e){return new Array(e.length)}function Eh(){return new on(this._enter||this._groups.map(Gc),this._parents)}function Ri(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ri.prototype={constructor:Ri,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Ih(e){return function(){return e}}function Lh(e,t,n,r,i,l){for(var o=0,a,c=t.length,f=l.length;o<f;++o)(a=t[o])?(a.__data__=l[o],r[o]=a):n[o]=new Ri(e,l[o]);for(;o<c;++o)(a=t[o])&&(i[o]=a)}function Nh(e,t,n,r,i,l,o){var a,c,f=new Map,d=t.length,h=l.length,p=new Array(d),g;for(a=0;a<d;++a)(c=t[a])&&(p[a]=g=o.call(c,c.__data__,a,t)+"",f.has(g)?i[a]=c:f.set(g,c));for(a=0;a<h;++a)g=o.call(e,l[a],a,l)+"",(c=f.get(g))?(r[a]=c,c.__data__=l[a],f.delete(g)):n[a]=new Ri(e,l[a]);for(a=0;a<d;++a)(c=t[a])&&f.get(p[a])===c&&(i[a]=c)}function Ph(e){return e.__data__}function zh(e,t){if(!arguments.length)return Array.from(this,Ph);var n=t?Nh:Lh,r=this._parents,i=this._groups;typeof e!="function"&&(e=Ih(e));for(var l=i.length,o=new Array(l),a=new Array(l),c=new Array(l),f=0;f<l;++f){var d=r[f],h=i[f],p=h.length,g=Dh(e.call(d,d&&d.__data__,f,r)),m=g.length,_=a[f]=new Array(m),v=o[f]=new Array(m),y=c[f]=new Array(p);n(d,h,_,v,y,g,t);for(var w=0,C=0,x,A;w<m;++w)if(x=_[w]){for(w>=C&&(C=w+1);!(A=v[C])&&++C<m;);x._next=A||null}}return o=new on(o,r),o._enter=a,o._exit=c,o}function Dh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fh(){return new on(this._exit||this._groups.map(Gc),this._parents)}function Bh(e,t,n){var r=this.enter(),i=this,l=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?l.remove():n(l),r&&i?r.merge(i).order():i}function Rh(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,l=r.length,o=Math.min(i,l),a=new Array(i),c=0;c<o;++c)for(var f=n[c],d=r[c],h=f.length,p=a[c]=new Array(h),g,m=0;m<h;++m)(g=f[m]||d[m])&&(p[m]=g);for(;c<i;++c)a[c]=n[c];return new on(a,this._parents)}function jh(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,l=r[i],o;--i>=0;)(o=r[i])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function Oh(e){e||(e=Uh);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var n=this._groups,r=n.length,i=new Array(r),l=0;l<r;++l){for(var o=n[l],a=o.length,c=i[l]=new Array(a),f,d=0;d<a;++d)(f=o[d])&&(c[d]=f);c.sort(t)}return new on(i,this._parents).order()}function Uh(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Hh(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Zh(){return Array.from(this)}function Wh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,l=r.length;i<l;++i){var o=r[i];if(o)return o}return null}function Yh(){let e=0;for(const t of this)++e;return e}function Gh(){return!this.node()}function Vh(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],l=0,o=i.length,a;l<o;++l)(a=i[l])&&e.call(a,a.__data__,l,i);return this}function Xh(e){return function(){this.removeAttribute(e)}}function Jh(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qh(e,t){return function(){this.setAttribute(e,t)}}function Kh(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Qh(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $h(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ep(e,t){var n=el(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Jh:Xh:typeof t=="function"?n.local?$h:Qh:n.local?Kh:qh)(n,t))}function Vc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function tp(e){return function(){this.style.removeProperty(e)}}function np(e,t,n){return function(){this.style.setProperty(e,t,n)}}function rp(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ip(e,t,n){return arguments.length>1?this.each((t==null?tp:typeof t=="function"?rp:np)(e,t,n??"")):Nr(this.node(),e)}function Nr(e,t){return e.style.getPropertyValue(t)||Vc(e).getComputedStyle(e,null).getPropertyValue(t)}function lp(e){return function(){delete this[e]}}function op(e,t){return function(){this[e]=t}}function sp(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ap(e,t){return arguments.length>1?this.each((t==null?lp:typeof t=="function"?sp:op)(e,t)):this.node()[e]}function Xc(e){return e.trim().split(/^|\s+/)}function Vl(e){return e.classList||new Jc(e)}function Jc(e){this._node=e,this._names=Xc(e.getAttribute("class")||"")}Jc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function qc(e,t){for(var n=Vl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Kc(e,t){for(var n=Vl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function up(e){return function(){qc(this,e)}}function cp(e){return function(){Kc(this,e)}}function fp(e,t){return function(){(t.apply(this,arguments)?qc:Kc)(this,e)}}function dp(e,t){var n=Xc(e+"");if(arguments.length<2){for(var r=Vl(this.node()),i=-1,l=n.length;++i<l;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?fp:t?up:cp)(n,t))}function hp(){this.textContent=""}function pp(e){return function(){this.textContent=e}}function gp(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function mp(e){return arguments.length?this.each(e==null?hp:(typeof e=="function"?gp:pp)(e)):this.node().textContent}function _p(){this.innerHTML=""}function bp(e){return function(){this.innerHTML=e}}function yp(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function vp(e){return arguments.length?this.each(e==null?_p:(typeof e=="function"?yp:bp)(e)):this.node().innerHTML}function wp(){this.nextSibling&&this.parentNode.appendChild(this)}function kp(){return this.each(wp)}function xp(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cp(){return this.each(xp)}function Ap(e){var t=typeof e=="function"?e:Hc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Sp(){return null}function Tp(e,t){var n=typeof e=="function"?e:Hc(e),r=t==null?Sp:typeof t=="function"?t:Gl(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Mp(){var e=this.parentNode;e&&e.removeChild(this)}function Ep(){return this.each(Mp)}function Ip(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Lp(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Np(e){return this.select(e?Lp:Ip)}function Pp(e){return arguments.length?this.property("__data__",e):this.node().__data__}function zp(e){return function(t){e.call(this,t,this.__data__)}}function Dp(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Fp(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,l;n<i;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++r]=l;++r?t.length=r:delete this.__on}}}function Bp(e,t,n){return function(){var r=this.__on,i,l=zp(t);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=l,i.options=n),i.value=t;return}}this.addEventListener(e.type,l,n),i={type:e.type,name:e.name,value:t,listener:l,options:n},r?r.push(i):this.__on=[i]}}function Rp(e,t,n){var r=Dp(e+""),i,l=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,f=a.length,d;c<f;++c)for(i=0,d=a[c];i<l;++i)if((o=r[i]).type===d.type&&o.name===d.name)return d.value}return}for(a=t?Bp:Fp,i=0;i<l;++i)this.each(a(r[i],t,n));return this}function Qc(e,t,n){var r=Vc(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function jp(e,t){return function(){return Qc(this,e,t)}}function Op(e,t){return function(){return Qc(this,e,t.apply(this,arguments))}}function Up(e,t){return this.each((typeof t=="function"?Op:jp)(e,t))}function*Hp(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,l=r.length,o;i<l;++i)(o=r[i])&&(yield o)}var $c=[null];function on(e,t){this._groups=e,this._parents=t}function ai(){return new on([[document.documentElement]],$c)}function Zp(){return this}on.prototype=ai.prototype={constructor:on,select:gh,selectAll:yh,selectChild:xh,selectChildren:Th,filter:Mh,data:zh,enter:Eh,exit:Fh,join:Bh,merge:Rh,selection:Zp,order:jh,sort:Oh,call:Hh,nodes:Zh,node:Wh,size:Yh,empty:Gh,each:Vh,attr:ep,style:ip,property:ap,classed:dp,text:mp,html:vp,raise:kp,lower:Cp,append:Ap,insert:Tp,remove:Ep,clone:Np,datum:Pp,on:Rp,dispatch:Up,[Symbol.iterator]:Hp};function nn(e){return typeof e=="string"?new on([[document.querySelector(e)]],[document.documentElement]):new on([[e]],$c)}function tl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Xl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Or(){}var tr=.7,Pr=1/tr,Mr="\\s*([+-]?\\d+)\\s*",ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wp=/^#([0-9a-f]{3,8})$/,Yp=new RegExp(`^rgb\\(${Mr},${Mr},${Mr}\\)$`),Gp=new RegExp(`^rgb\\(${wn},${wn},${wn}\\)$`),Vp=new RegExp(`^rgba\\(${Mr},${Mr},${Mr},${ri}\\)$`),Xp=new RegExp(`^rgba\\(${wn},${wn},${wn},${ri}\\)$`),Jp=new RegExp(`^hsl\\(${ri},${wn},${wn}\\)$`),qp=new RegExp(`^hsla\\(${ri},${wn},${wn},${ri}\\)$`),qa={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};tl(Or,nr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ka,formatHex:Ka,formatHex8:Kp,formatHsl:Qp,formatRgb:Qa,toString:Qa});function Ka(){return this.rgb().formatHex()}function Kp(){return this.rgb().formatHex8()}function Qp(){return tf(this).formatHsl()}function Qa(){return this.rgb().formatRgb()}function nr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wp.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$a(t):n===3?new Ft(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?wi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?wi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Yp.exec(e))?new Ft(t[1],t[2],t[3],1):(t=Gp.exec(e))?new Ft(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Vp.exec(e))?wi(t[1],t[2],t[3],t[4]):(t=Xp.exec(e))?wi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Jp.exec(e))?nu(t[1],t[2]/100,t[3]/100,1):(t=qp.exec(e))?nu(t[1],t[2]/100,t[3]/100,t[4]):qa.hasOwnProperty(e)?$a(qa[e]):e==="transparent"?new Ft(NaN,NaN,NaN,0):null}function $a(e){return new Ft(e>>16&255,e>>8&255,e&255,1)}function wi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ft(e,t,n,r)}function ef(e){return e instanceof Or||(e=nr(e)),e?(e=e.rgb(),new Ft(e.r,e.g,e.b,e.opacity)):new Ft}function Ll(e,t,n,r){return arguments.length===1?ef(e):new Ft(e,t,n,r??1)}function Ft(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}tl(Ft,Ll,Xl(Or,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ft($n(this.r),$n(this.g),$n(this.b),ji(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eu,formatHex:eu,formatHex8:$p,formatRgb:tu,toString:tu}));function eu(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}`}function $p(){return`#${Kn(this.r)}${Kn(this.g)}${Kn(this.b)}${Kn((isNaN(this.opacity)?1:this.opacity)*255)}`}function tu(){const e=ji(this.opacity);return`${e===1?"rgb(":"rgba("}${$n(this.r)}, ${$n(this.g)}, ${$n(this.b)}${e===1?")":`, ${e})`}`}function ji(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $n(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kn(e){return e=$n(e),(e<16?"0":"")+e.toString(16)}function nu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mn(e,t,n,r)}function tf(e){if(e instanceof mn)return new mn(e.h,e.s,e.l,e.opacity);if(e instanceof Or||(e=nr(e)),!e)return new mn;if(e instanceof mn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),l=Math.max(t,n,r),o=NaN,a=l-i,c=(l+i)/2;return a?(t===l?o=(n-r)/a+(n<r)*6:n===l?o=(r-t)/a+2:o=(t-n)/a+4,a/=c<.5?l+i:2-l-i,o*=60):a=c>0&&c<1?0:o,new mn(o,a,c,e.opacity)}function e1(e,t,n,r){return arguments.length===1?tf(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tl(mn,e1,Xl(Or,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new mn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new mn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ft(hl(e>=240?e-240:e+120,i,r),hl(e,i,r),hl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new mn(ru(this.h),ki(this.s),ki(this.l),ji(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ji(this.opacity);return`${e===1?"hsl(":"hsla("}${ru(this.h)}, ${ki(this.s)*100}%, ${ki(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ru(e){return e=(e||0)%360,e<0?e+360:e}function ki(e){return Math.max(0,Math.min(1,e||0))}function hl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const t1=Math.PI/180,n1=180/Math.PI;var nf=-.14861,Jl=1.78277,ql=-.29227,nl=-.90649,ii=1.97294,iu=ii*nl,lu=ii*Jl,ou=Jl*ql-nl*nf;function r1(e){if(e instanceof er)return new er(e.h,e.s,e.l,e.opacity);e instanceof Ft||(e=ef(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(ou*r+iu*t-lu*n)/(ou+iu-lu),l=r-i,o=(ii*(n-i)-ql*l)/nl,a=Math.sqrt(o*o+l*l)/(ii*i*(1-i)),c=a?Math.atan2(o,l)*n1-120:NaN;return new er(c<0?c+360:c,a,i,e.opacity)}function Un(e,t,n,r){return arguments.length===1?r1(e):new er(e,t,n,r??1)}function er(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tl(er,Un,Xl(Or,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new er(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tr:Math.pow(tr,e),new er(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*t1,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ft(255*(t+n*(nf*r+Jl*i)),255*(t+n*(ql*r+nl*i)),255*(t+n*(ii*r)),this.opacity)}}));const rl=e=>()=>e;function rf(e,t){return function(n){return e+n*t}}function i1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function l1(e,t){var n=t-e;return n?rf(e,n>180||n<-180?n-360*Math.round(n/360):n):rl(isNaN(e)?t:e)}function o1(e){return(e=+e)==1?Er:function(t,n){return n-t?i1(t,n,e):rl(isNaN(t)?n:t)}}function Er(e,t){var n=t-e;return n?rf(e,n):rl(isNaN(e)?t:e)}const Oi=function e(t){var n=o1(t);function r(i,l){var o=n((i=Ll(i)).r,(l=Ll(l)).r),a=n(i.g,l.g),c=n(i.b,l.b),f=Er(i.opacity,l.opacity);return function(d){return i.r=o(d),i.g=a(d),i.b=c(d),i.opacity=f(d),i+""}}return r.gamma=e,r}(1);function s1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(l){for(i=0;i<n;++i)r[i]=e[i]*(1-l)+t[i]*l;return r}}function a1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function u1(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),l=new Array(n),o;for(o=0;o<r;++o)i[o]=il(e[o],t[o]);for(;o<n;++o)l[o]=t[o];return function(a){for(o=0;o<r;++o)l[o]=i[o](a);return l}}function c1(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function gn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function f1(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=il(e[i],t[i]):r[i]=t[i];return function(l){for(i in n)r[i]=n[i](l);return r}}var Nl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pl=new RegExp(Nl.source,"g");function d1(e){return function(){return e}}function h1(e){return function(t){return e(t)+""}}function lf(e,t){var n=Nl.lastIndex=pl.lastIndex=0,r,i,l,o=-1,a=[],c=[];for(e=e+"",t=t+"";(r=Nl.exec(e))&&(i=pl.exec(t));)(l=i.index)>n&&(l=t.slice(n,l),a[o]?a[o]+=l:a[++o]=l),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,c.push({i:o,x:gn(r,i)})),n=pl.lastIndex;return n<t.length&&(l=t.slice(n),a[o]?a[o]+=l:a[++o]=l),a.length<2?c[0]?h1(c[0].x):d1(t):(t=c.length,function(f){for(var d=0,h;d<t;++d)a[(h=c[d]).i]=h.x(f);return a.join("")})}function il(e,t){var n=typeof t,r;return t==null||n==="boolean"?rl(t):(n==="number"?gn:n==="string"?(r=nr(t))?(t=r,Oi):lf:t instanceof nr?Oi:t instanceof Date?c1:a1(t)?s1:Array.isArray(t)?u1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?f1:gn)(e,t)}function of(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var su=180/Math.PI,Pl={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function sf(e,t,n,r,i,l){var o,a,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:l,rotate:Math.atan2(t,e)*su,skewX:Math.atan(c)*su,scaleX:o,scaleY:a}}var xi;function p1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Pl:sf(t.a,t.b,t.c,t.d,t.e,t.f)}function g1(e){return e==null||(xi||(xi=document.createElementNS("http://www.w3.org/2000/svg","g")),xi.setAttribute("transform",e),!(e=xi.transform.baseVal.consolidate()))?Pl:(e=e.matrix,sf(e.a,e.b,e.c,e.d,e.e,e.f))}function af(e,t,n,r){function i(f){return f.length?f.pop()+" ":""}function l(f,d,h,p,g,m){if(f!==h||d!==p){var _=g.push("translate(",null,t,null,n);m.push({i:_-4,x:gn(f,h)},{i:_-2,x:gn(d,p)})}else(h||p)&&g.push("translate("+h+t+p+n)}function o(f,d,h,p){f!==d?(f-d>180?d+=360:d-f>180&&(f+=360),p.push({i:h.push(i(h)+"rotate(",null,r)-2,x:gn(f,d)})):d&&h.push(i(h)+"rotate("+d+r)}function a(f,d,h,p){f!==d?p.push({i:h.push(i(h)+"skewX(",null,r)-2,x:gn(f,d)}):d&&h.push(i(h)+"skewX("+d+r)}function c(f,d,h,p,g,m){if(f!==h||d!==p){var _=g.push(i(g)+"scale(",null,",",null,")");m.push({i:_-4,x:gn(f,h)},{i:_-2,x:gn(d,p)})}else(h!==1||p!==1)&&g.push(i(g)+"scale("+h+","+p+")")}return function(f,d){var h=[],p=[];return f=e(f),d=e(d),l(f.translateX,f.translateY,d.translateX,d.translateY,h,p),o(f.rotate,d.rotate,h,p),a(f.skewX,d.skewX,h,p),c(f.scaleX,f.scaleY,d.scaleX,d.scaleY,h,p),f=d=null,function(g){for(var m=-1,_=p.length,v;++m<_;)h[(v=p[m]).i]=v.x(g);return h.join("")}}}var m1=af(p1,"px, ","px)","deg)"),_1=af(g1,", ",")",")");function uf(e){return function t(n){n=+n;function r(i,l){var o=e((i=Un(i)).h,(l=Un(l)).h),a=Er(i.s,l.s),c=Er(i.l,l.l),f=Er(i.opacity,l.opacity);return function(d){return i.h=o(d),i.s=a(d),i.l=c(Math.pow(d,n)),i.opacity=f(d),i+""}}return r.gamma=t,r}(1)}uf(l1);var cf=uf(Er),zr=0,qr=0,Yr=0,ff=1e3,Ui,Kr,Hi=0,rr=0,ll=0,li=typeof performance=="object"&&performance.now?performance:Date,df=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Kl(){return rr||(df(b1),rr=li.now()+ll)}function b1(){rr=0}function Zi(){this._call=this._time=this._next=null}Zi.prototype=hf.prototype={constructor:Zi,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Kl():+n)+(t==null?0:+t),!this._next&&Kr!==this&&(Kr?Kr._next=this:Ui=this,Kr=this),this._call=e,this._time=n,zl()},stop:function(){this._call&&(this._call=null,this._time=1/0,zl())}};function hf(e,t,n){var r=new Zi;return r.restart(e,t,n),r}function y1(){Kl(),++zr;for(var e=Ui,t;e;)(t=rr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--zr}function au(){rr=(Hi=li.now())+ll,zr=qr=0;try{y1()}finally{zr=0,w1(),rr=0}}function v1(){var e=li.now(),t=e-Hi;t>ff&&(ll-=t,Hi=e)}function w1(){for(var e,t=Ui,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ui=n);Kr=e,zl(r)}function zl(e){if(!zr){qr&&(qr=clearTimeout(qr));var t=e-rr;t>24?(e<1/0&&(qr=setTimeout(au,e-li.now()-ll)),Yr&&(Yr=clearInterval(Yr))):(Yr||(Hi=li.now(),Yr=setInterval(v1,ff)),zr=1,df(au))}}function uu(e,t,n){var r=new Zi;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var k1=Uc("start","end","cancel","interrupt"),x1=[],pf=0,cu=1,Dl=2,Ei=3,fu=4,Fl=5,Ii=6;function ol(e,t,n,r,i,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;C1(e,n,{name:t,index:r,group:i,on:k1,tween:x1,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:pf})}function Ql(e,t){var n=_n(e,t);if(n.state>pf)throw new Error("too late; already scheduled");return n}function kn(e,t){var n=_n(e,t);if(n.state>Ei)throw new Error("too late; already running");return n}function _n(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function C1(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=hf(l,0,n.time);function l(f){n.state=cu,n.timer.restart(o,n.delay,n.time),n.delay<=f&&o(f-n.delay)}function o(f){var d,h,p,g;if(n.state!==cu)return c();for(d in r)if(g=r[d],g.name===n.name){if(g.state===Ei)return uu(o);g.state===fu?(g.state=Ii,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Ii,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(uu(function(){n.state===Ei&&(n.state=fu,n.timer.restart(a,n.delay,n.time),a(f))}),n.state=Dl,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Dl){for(n.state=Ei,i=new Array(p=n.tween.length),d=0,h=-1;d<p;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}function a(f){for(var d=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(c),n.state=Fl,1),h=-1,p=i.length;++h<p;)i[h].call(e,d);n.state===Fl&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Ii,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function A1(e,t){var n=e.__transition,r,i,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){l=!1;continue}i=r.state>Dl&&r.state<Fl,r.state=Ii,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}l&&delete e.__transition}}function S1(e){return this.each(function(){A1(this,e)})}function T1(e,t){var n,r;return function(){var i=kn(this,e),l=i.tween;if(l!==n){r=n=l;for(var o=0,a=r.length;o<a;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function M1(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var l=kn(this,e),o=l.tween;if(o!==r){i=(r=o).slice();for(var a={name:t,value:n},c=0,f=i.length;c<f;++c)if(i[c].name===t){i[c]=a;break}c===f&&i.push(a)}l.tween=i}}function E1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=_n(this.node(),n).tween,i=0,l=r.length,o;i<l;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?T1:M1)(n,e,t))}function $l(e,t,n){var r=e._id;return e.each(function(){var i=kn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return _n(i,r).value[t]}}function gf(e,t){var n;return(typeof t=="number"?gn:t instanceof nr?Oi:(n=nr(t))?(t=n,Oi):lf)(e,t)}function I1(e){return function(){this.removeAttribute(e)}}function L1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function N1(e,t,n){var r,i=n+"",l;return function(){var o=this.getAttribute(e);return o===i?null:o===r?l:l=t(r=o,n)}}function P1(e,t,n){var r,i=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?l:l=t(r=o,n)}}function z1(e,t,n){var r,i,l;return function(){var o,a=n(this),c;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=a+"",o===c?null:o===r&&c===i?l:(i=c,l=t(r=o,a)))}}function D1(e,t,n){var r,i,l;return function(){var o,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=a+"",o===c?null:o===r&&c===i?l:(i=c,l=t(r=o,a)))}}function F1(e,t){var n=el(e),r=n==="transform"?_1:gf;return this.attrTween(e,typeof t=="function"?(n.local?D1:z1)(n,r,$l(this,"attr."+e,t)):t==null?(n.local?L1:I1)(n):(n.local?P1:N1)(n,r,t))}function B1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function R1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function j1(e,t){var n,r;function i(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&R1(e,l)),n}return i._value=t,i}function O1(e,t){var n,r;function i(){var l=t.apply(this,arguments);return l!==r&&(n=(r=l)&&B1(e,l)),n}return i._value=t,i}function U1(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=el(e);return this.tween(n,(r.local?j1:O1)(r,t))}function H1(e,t){return function(){Ql(this,e).delay=+t.apply(this,arguments)}}function Z1(e,t){return t=+t,function(){Ql(this,e).delay=t}}function W1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?H1:Z1)(t,e)):_n(this.node(),t).delay}function Y1(e,t){return function(){kn(this,e).duration=+t.apply(this,arguments)}}function G1(e,t){return t=+t,function(){kn(this,e).duration=t}}function V1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Y1:G1)(t,e)):_n(this.node(),t).duration}function X1(e,t){if(typeof t!="function")throw new Error;return function(){kn(this,e).ease=t}}function J1(e){var t=this._id;return arguments.length?this.each(X1(t,e)):_n(this.node(),t).ease}function q1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;kn(this,e).ease=n}}function K1(e){if(typeof e!="function")throw new Error;return this.each(q1(this._id,e))}function Q1(e){typeof e!="function"&&(e=Wc(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var l=t[i],o=l.length,a=r[i]=[],c,f=0;f<o;++f)(c=l[f])&&e.call(c,c.__data__,f,l)&&a.push(c);return new Tn(r,this._parents,this._name,this._id)}function $1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,l=Math.min(r,i),o=new Array(r),a=0;a<l;++a)for(var c=t[a],f=n[a],d=c.length,h=o[a]=new Array(d),p,g=0;g<d;++g)(p=c[g]||f[g])&&(h[g]=p);for(;a<r;++a)o[a]=t[a];return new Tn(o,this._parents,this._name,this._id)}function eg(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function tg(e,t,n){var r,i,l=eg(t)?Ql:kn;return function(){var o=l(this,e),a=o.on;a!==r&&(i=(r=a).copy()).on(t,n),o.on=i}}function ng(e,t){var n=this._id;return arguments.length<2?_n(this.node(),n).on.on(e):this.each(tg(n,e,t))}function rg(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ig(){return this.on("end.remove",rg(this._id))}function lg(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Gl(e));for(var r=this._groups,i=r.length,l=new Array(i),o=0;o<i;++o)for(var a=r[o],c=a.length,f=l[o]=new Array(c),d,h,p=0;p<c;++p)(d=a[p])&&(h=e.call(d,d.__data__,p,a))&&("__data__"in d&&(h.__data__=d.__data__),f[p]=h,ol(f[p],t,n,p,f,_n(d,n)));return new Tn(l,this._parents,t,n)}function og(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Zc(e));for(var r=this._groups,i=r.length,l=[],o=[],a=0;a<i;++a)for(var c=r[a],f=c.length,d,h=0;h<f;++h)if(d=c[h]){for(var p=e.call(d,d.__data__,h,c),g,m=_n(d,n),_=0,v=p.length;_<v;++_)(g=p[_])&&ol(g,t,n,_,p,m);l.push(p),o.push(d)}return new Tn(l,o,t,n)}var sg=ai.prototype.constructor;function ag(){return new sg(this._groups,this._parents)}function ug(e,t){var n,r,i;return function(){var l=Nr(this,e),o=(this.style.removeProperty(e),Nr(this,e));return l===o?null:l===n&&o===r?i:i=t(n=l,r=o)}}function mf(e){return function(){this.style.removeProperty(e)}}function cg(e,t,n){var r,i=n+"",l;return function(){var o=Nr(this,e);return o===i?null:o===r?l:l=t(r=o,n)}}function fg(e,t,n){var r,i,l;return function(){var o=Nr(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Nr(this,e))),o===c?null:o===r&&c===i?l:(i=c,l=t(r=o,a))}}function dg(e,t){var n,r,i,l="style."+t,o="end."+l,a;return function(){var c=kn(this,e),f=c.on,d=c.value[l]==null?a||(a=mf(t)):void 0;(f!==n||i!==d)&&(r=(n=f).copy()).on(o,i=d),c.on=r}}function hg(e,t,n){var r=(e+="")=="transform"?m1:gf;return t==null?this.styleTween(e,ug(e,r)).on("end.style."+e,mf(e)):typeof t=="function"?this.styleTween(e,fg(e,r,$l(this,"style."+e,t))).each(dg(this._id,e)):this.styleTween(e,cg(e,r,t),n).on("end.style."+e,null)}function pg(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function gg(e,t,n){var r,i;function l(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&pg(e,o,n)),r}return l._value=t,l}function mg(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,gg(e,t,n??""))}function _g(e){return function(){this.textContent=e}}function bg(e){return function(){var t=e(this);this.textContent=t??""}}function yg(e){return this.tween("text",typeof e=="function"?bg($l(this,"text",e)):_g(e==null?"":e+""))}function vg(e){return function(t){this.textContent=e.call(this,t)}}function wg(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&vg(i)),t}return r._value=e,r}function kg(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,wg(e))}function xg(){for(var e=this._name,t=this._id,n=_f(),r=this._groups,i=r.length,l=0;l<i;++l)for(var o=r[l],a=o.length,c,f=0;f<a;++f)if(c=o[f]){var d=_n(c,t);ol(c,e,n,f,o,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Tn(r,this._parents,e,n)}function Cg(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(l,o){var a={value:o},c={value:function(){--i===0&&l()}};n.each(function(){var f=kn(this,r),d=f.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),f.on=t}),i===0&&l()})}var Ag=0;function Tn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _f(){return++Ag}var Cn=ai.prototype;Tn.prototype={constructor:Tn,select:lg,selectAll:og,selectChild:Cn.selectChild,selectChildren:Cn.selectChildren,filter:Q1,merge:$1,selection:ag,transition:xg,call:Cn.call,nodes:Cn.nodes,node:Cn.node,size:Cn.size,empty:Cn.empty,each:Cn.each,on:ng,attr:F1,attrTween:U1,style:hg,styleTween:mg,text:yg,textTween:kg,remove:ig,tween:E1,delay:W1,duration:V1,ease:J1,easeVarying:K1,end:Cg,[Symbol.iterator]:Cn[Symbol.iterator]};function Sg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Tg={time:null,delay:0,duration:250,ease:Sg};function Mg(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Eg(e){var t,n;e instanceof Tn?(t=e._id,e=e._name):(t=_f(),(n=Tg).time=Kl(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,l=0;l<i;++l)for(var o=r[l],a=o.length,c,f=0;f<a;++f)(c=o[f])&&ol(c,e,t,f,o,n||Mg(c,t));return new Tn(r,this._parents,e,t)}ai.prototype.interrupt=S1;ai.prototype.transition=Eg;const Bl=Math.PI,Rl=2*Bl,Xn=1e-6,Ig=Rl-Xn;function bf(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Lg(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return bf;const n=10**t;return function(r){this._+=r[0];for(let i=1,l=r.length;i<l;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Ng{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?bf:Lg(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,l,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+l},${this._y1=+o}`}arcTo(t,n,r,i,l){if(t=+t,n=+n,r=+r,i=+i,l=+l,l<0)throw new Error(`negative radius: ${l}`);let o=this._x1,a=this._y1,c=r-t,f=i-n,d=o-t,h=a-n,p=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>Xn)if(!(Math.abs(h*c-f*d)>Xn)||!l)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,m=i-a,_=c*c+f*f,v=g*g+m*m,y=Math.sqrt(_),w=Math.sqrt(p),C=l*Math.tan((Bl-Math.acos((_+p-v)/(2*y*w)))/2),x=C/w,A=C/y;Math.abs(x-1)>Xn&&this._append`L${t+x*d},${n+x*h}`,this._append`A${l},${l},0,0,${+(h*g>d*m)},${this._x1=t+A*c},${this._y1=n+A*f}`}}arc(t,n,r,i,l,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(i),c=r*Math.sin(i),f=t+a,d=n+c,h=1^o,p=o?i-l:l-i;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>Xn||Math.abs(this._y1-d)>Xn)&&this._append`L${f},${d}`,r&&(p<0&&(p=p%Rl+Rl),p>Ig?this._append`A${r},${r},0,1,${h},${t-a},${n-c}A${r},${r},0,1,${h},${this._x1=f},${this._y1=d}`:p>Xn&&this._append`A${r},${r},0,${+(p>=Bl)},${h},${this._x1=t+r*Math.cos(l)},${this._y1=n+r*Math.sin(l)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Pg(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Wi(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Dr(e){return e=Wi(Math.abs(e)),e?e[1]:NaN}function zg(e,t){return function(n,r){for(var i=n.length,l=[],o=0,a=e[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),l.push(n.substring(i-=a,i+a)),!((c+=a+1)>r));)a=e[o=(o+1)%e.length];return l.reverse().join(t)}}function Dg(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Fg=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Yi(e){if(!(t=Fg.exec(e)))throw new Error("invalid format: "+e);var t;return new eo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Yi.prototype=eo.prototype;function eo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}eo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Bg(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Gi;function Rg(e,t){var n=Wi(e,t);if(!n)return Gi=void 0,e.toPrecision(t);var r=n[0],i=n[1],l=i-(Gi=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return l===o?r:l>o?r+new Array(l-o+1).join("0"):l>0?r.slice(0,l)+"."+r.slice(l):"0."+new Array(1-l).join("0")+Wi(e,Math.max(0,t+l-1))[0]}function du(e,t){var n=Wi(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const hu={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Pg,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>du(e*100,t),r:du,s:Rg,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function pu(e){return e}var gu=Array.prototype.map,mu=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function jg(e){var t=e.grouping===void 0||e.thousands===void 0?pu:zg(gu.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",l=e.numerals===void 0?pu:Dg(gu.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(h,p){h=Yi(h);var g=h.fill,m=h.align,_=h.sign,v=h.symbol,y=h.zero,w=h.width,C=h.comma,x=h.precision,A=h.trim,M=h.type;M==="n"?(C=!0,M="g"):hu[M]||(x===void 0&&(x=12),A=!0,M="g"),(y||g==="0"&&m==="=")&&(y=!0,g="0",m="=");var L=(p&&p.prefix!==void 0?p.prefix:"")+(v==="$"?n:v==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),I=(v==="$"?r:/[%p]/.test(M)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),P=hu[M],z=/[defgprs%]/.test(M);x=x===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(T){var N=L,k=I,j,J,W;if(M==="c")k=P(T)+k,T="";else{T=+T;var G=T<0||1/T<0;if(T=isNaN(T)?c:P(Math.abs(T),x),A&&(T=Bg(T)),G&&+T==0&&_!=="+"&&(G=!1),N=(G?_==="("?_:a:_==="-"||_==="("?"":_)+N,k=(M==="s"&&!isNaN(T)&&Gi!==void 0?mu[8+Gi/3]:"")+k+(G&&_==="("?")":""),z){for(j=-1,J=T.length;++j<J;)if(W=T.charCodeAt(j),48>W||W>57){k=(W===46?i+T.slice(j+1):T.slice(j))+k,T=T.slice(0,j);break}}}C&&!y&&(T=t(T,1/0));var Z=N.length+T.length+k.length,ne=Z<w?new Array(w-Z+1).join(g):"";switch(C&&y&&(T=t(ne+T,ne.length?w-k.length:1/0),ne=""),m){case"<":T=N+T+k+ne;break;case"=":T=N+ne+T+k;break;case"^":T=ne.slice(0,Z=ne.length>>1)+N+T+k+ne.slice(Z);break;default:T=ne+N+T+k;break}return l(T)}return R.toString=function(){return h+""},R}function d(h,p){var g=Math.max(-8,Math.min(8,Math.floor(Dr(p)/3)))*3,m=Math.pow(10,-g),_=f((h=Yi(h),h.type="f",h),{suffix:mu[8+g/3]});return function(v){return _(m*v)}}return{format:f,formatPrefix:d}}var Ci,Vi,yf;Og({thousands:",",grouping:[3],currency:["$",""]});function Og(e){return Ci=jg(e),Vi=Ci.format,yf=Ci.formatPrefix,Ci}function Ug(e){return Math.max(0,-Dr(Math.abs(e)))}function Hg(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dr(t)/3)))*3-Dr(Math.abs(e)))}function Zg(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Dr(t)-Dr(e))+1}function sl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Wg(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const _u=Symbol("implicit");function vf(){var e=new Za,t=[],n=[],r=_u;function i(l){let o=e.get(l);if(o===void 0){if(r!==_u)return r;e.set(l,o=t.push(l)-1)}return n[o%n.length]}return i.domain=function(l){if(!arguments.length)return t.slice();t=[],e=new Za;for(const o of l)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(l){return arguments.length?(n=Array.from(l),i):n.slice()},i.unknown=function(l){return arguments.length?(r=l,i):r},i.copy=function(){return vf(t,n).unknown(r)},sl.apply(i,arguments),i}function wf(){var e=vf().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,l,o,a=!1,c=0,f=0,d=.5;delete e.unknown;function h(){var p=t().length,g=i<r,m=g?i:r,_=g?r:i;l=(_-m)/Math.max(1,p-c+f*2),a&&(l=Math.floor(l)),m+=(_-m-l*(p-c))*d,o=l*(1-c),a&&(m=Math.round(m),o=Math.round(o));var v=nh(p).map(function(y){return m+l*y});return n(g?v.reverse():v)}return e.domain=function(p){return arguments.length?(t(p),h()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,a=!0,h()},e.bandwidth=function(){return o},e.step=function(){return l},e.round=function(p){return arguments.length?(a=!!p,h()):a},e.padding=function(p){return arguments.length?(c=Math.min(1,f=+p),h()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),h()):c},e.paddingOuter=function(p){return arguments.length?(f=+p,h()):f},e.align=function(p){return arguments.length?(d=Math.max(0,Math.min(1,p)),h()):d},e.copy=function(){return wf(t(),[r,i]).round(a).paddingInner(c).paddingOuter(f).align(d)},sl.apply(h(),arguments)}function Yg(e){return function(){return e}}function Gg(e){return+e}var bu=[0,1];function On(e){return e}function jl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Yg(isNaN(t)?NaN:.5)}function Vg(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Xg(e,t,n){var r=e[0],i=e[1],l=t[0],o=t[1];return i<r?(r=jl(i,r),l=n(o,l)):(r=jl(r,i),l=n(l,o)),function(a){return l(r(a))}}function Jg(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),l=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=jl(e[o],e[o+1]),l[o]=n(t[o],t[o+1]);return function(a){var c=V0(e,a,1,r)-1;return l[c](i[c](a))}}function kf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function qg(){var e=bu,t=bu,n=il,r,i,l,o=On,a,c,f;function d(){var p=Math.min(e.length,t.length);return o!==On&&(o=Vg(e[0],e[p-1])),a=p>2?Jg:Xg,c=f=null,h}function h(p){return p==null||isNaN(p=+p)?l:(c||(c=a(e.map(r),t,n)))(r(o(p)))}return h.invert=function(p){return o(i((f||(f=a(t,e.map(r),gn)))(p)))},h.domain=function(p){return arguments.length?(e=Array.from(p,Gg),d()):e.slice()},h.range=function(p){return arguments.length?(t=Array.from(p),d()):t.slice()},h.rangeRound=function(p){return t=Array.from(p),n=of,d()},h.clamp=function(p){return arguments.length?(o=p?!0:On,d()):o!==On},h.interpolate=function(p){return arguments.length?(n=p,d()):n},h.unknown=function(p){return arguments.length?(l=p,h):l},function(p,g){return r=p,i=g,d()}}function xf(){return qg()(On,On)}function Kg(e,t,n,r){var i=Ml(e,t,n),l;switch(r=Yi(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(l=Hg(i,o))&&(r.precision=l),yf(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(l=Zg(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=l-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(l=Ug(i))&&(r.precision=l-(r.type==="%")*2);break}}return Vi(r)}function Cf(e){var t=e.domain;return e.ticks=function(n){var r=t();return th(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Kg(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,l=r.length-1,o=r[i],a=r[l],c,f,d=10;for(a<o&&(f=o,o=a,a=f,f=i,i=l,l=f);d-- >0;){if(f=Tl(o,a,n),f===c)return r[i]=o,r[l]=a,t(r);if(f>0)o=Math.floor(o/f)*f,a=Math.ceil(a/f)*f;else if(f<0)o=Math.ceil(o*f)/f,a=Math.floor(a*f)/f;else break;c=f}return e},e}function Qr(){var e=xf();return e.copy=function(){return kf(e,Qr())},sl.apply(e,arguments),Cf(e)}function Qg(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],l=e[r],o;return l<i&&(o=n,n=r,r=o,o=i,i=l,l=o),e[n]=t.floor(i),e[r]=t.ceil(l),e}const gl=new Date,ml=new Date;function At(e,t,n,r){function i(l){return e(l=arguments.length===0?new Date:new Date(+l)),l}return i.floor=l=>(e(l=new Date(+l)),l),i.ceil=l=>(e(l=new Date(l-1)),t(l,1),e(l),l),i.round=l=>{const o=i(l),a=i.ceil(l);return l-o<a-l?o:a},i.offset=(l,o)=>(t(l=new Date(+l),o==null?1:Math.floor(o)),l),i.range=(l,o,a)=>{const c=[];if(l=i.ceil(l),a=a==null?1:Math.floor(a),!(l<o)||!(a>0))return c;let f;do c.push(f=new Date(+l)),t(l,a),e(l);while(f<l&&l<o);return c},i.filter=l=>At(o=>{if(o>=o)for(;e(o),!l(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!l(o););else for(;--a>=0;)for(;t(o,1),!l(o););}),n&&(i.count=(l,o)=>(gl.setTime(+l),ml.setTime(+o),e(gl),e(ml),Math.floor(n(gl,ml))),i.every=l=>(l=Math.floor(l),!isFinite(l)||!(l>0)?null:l>1?i.filter(r?o=>r(o)%l===0:o=>i.count(0,o)%l===0):i)),i}const Xi=At(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?At(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Xi);Xi.range;const An=1e3,pn=An*60,Sn=pn*60,Mn=Sn*24,to=Mn*7,yu=Mn*30,_l=Mn*365,Ar=At(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*An)},(e,t)=>(t-e)/An,e=>e.getUTCSeconds());Ar.range;const no=At(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*An)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getMinutes());no.range;const $g=At(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getUTCMinutes());$g.range;const ro=At(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*An-e.getMinutes()*pn)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getHours());ro.range;const em=At(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Sn)},(e,t)=>(t-e)/Sn,e=>e.getUTCHours());em.range;const ui=At(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pn)/Mn,e=>e.getDate()-1);ui.range;const io=At(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mn,e=>e.getUTCDate()-1);io.range;const tm=At(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Mn,e=>Math.floor(e/Mn));tm.range;function lr(e){return At(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*pn)/to)}const al=lr(0),Ji=lr(1),nm=lr(2),rm=lr(3),Fr=lr(4),im=lr(5),lm=lr(6);al.range;Ji.range;nm.range;rm.range;Fr.range;im.range;lm.range;function or(e){return At(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/to)}const Af=or(0),qi=or(1),om=or(2),sm=or(3),Br=or(4),am=or(5),um=or(6);Af.range;qi.range;om.range;sm.range;Br.range;am.range;um.range;const lo=At(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());lo.range;const cm=At(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());cm.range;const En=At(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());En.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:At(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});En.range;const ir=At(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ir.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:At(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ir.range;function fm(e,t,n,r,i,l){const o=[[Ar,1,An],[Ar,5,5*An],[Ar,15,15*An],[Ar,30,30*An],[l,1,pn],[l,5,5*pn],[l,15,15*pn],[l,30,30*pn],[i,1,Sn],[i,3,3*Sn],[i,6,6*Sn],[i,12,12*Sn],[r,1,Mn],[r,2,2*Mn],[n,1,to],[t,1,yu],[t,3,3*yu],[e,1,_l]];function a(f,d,h){const p=d<f;p&&([f,d]=[d,f]);const g=h&&typeof h.range=="function"?h:c(f,d,h),m=g?g.range(f,+d+1):[];return p?m.reverse():m}function c(f,d,h){const p=Math.abs(d-f)/h,g=Yl(([,,v])=>v).right(o,p);if(g===o.length)return e.every(Ml(f/_l,d/_l,h));if(g===0)return Xi.every(Math.max(Ml(f,d,h),1));const[m,_]=o[p/o[g-1][2]<o[g][2]/p?g-1:g];return m.every(_)}return[a,c]}const[dm,hm]=fm(En,lo,al,ui,ro,no);function bl(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yl(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Gr(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function pm(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,l=e.days,o=e.shortDays,a=e.months,c=e.shortMonths,f=Vr(i),d=Xr(i),h=Vr(l),p=Xr(l),g=Vr(o),m=Xr(o),_=Vr(a),v=Xr(a),y=Vr(c),w=Xr(c),C={a:W,A:G,b:Z,B:ne,c:null,d:Au,e:Au,f:Bm,g:Vm,G:Jm,H:zm,I:Dm,j:Fm,L:Sf,m:Rm,M:jm,p:O,q:Y,Q:Mu,s:Eu,S:Om,u:Um,U:Hm,V:Zm,w:Wm,W:Ym,x:null,X:null,y:Gm,Y:Xm,Z:qm,"%":Tu},x={a:re,A:K,b:X,B:fe,c:null,d:Su,e:Su,f:e2,g:c2,G:d2,H:Km,I:Qm,j:$m,L:Mf,m:t2,M:n2,p:ye,q:Ie,Q:Mu,s:Eu,S:r2,u:i2,U:l2,V:o2,w:s2,W:a2,x:null,X:null,y:u2,Y:f2,Z:h2,"%":Tu},A={a:z,A:R,b:T,B:N,c:k,d:xu,e:xu,f:Im,g:ku,G:wu,H:Cu,I:Cu,j:Sm,L:Em,m:Am,M:Tm,p:P,q:Cm,Q:Nm,s:Pm,S:Mm,u:ym,U:vm,V:wm,w:bm,W:km,x:j,X:J,y:ku,Y:wu,Z:xm,"%":Lm};C.x=M(n,C),C.X=M(r,C),C.c=M(t,C),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x);function M(le,ve){return function(se){var te=[],Se=-1,S=0,ie=le.length,q,H,U;for(se instanceof Date||(se=new Date(+se));++Se<ie;)le.charCodeAt(Se)===37&&(te.push(le.slice(S,Se)),(H=vu[q=le.charAt(++Se)])!=null?q=le.charAt(++Se):H=q==="e"?" ":"0",(U=ve[q])&&(q=U(se,H)),te.push(q),S=Se+1);return te.push(le.slice(S,Se)),te.join("")}}function L(le,ve){return function(se){var te=Gr(1900,void 0,1),Se=I(te,le,se+="",0),S,ie;if(Se!=se.length)return null;if("Q"in te)return new Date(te.Q);if("s"in te)return new Date(te.s*1e3+("L"in te?te.L:0));if(ve&&!("Z"in te)&&(te.Z=0),"p"in te&&(te.H=te.H%12+te.p*12),te.m===void 0&&(te.m="q"in te?te.q:0),"V"in te){if(te.V<1||te.V>53)return null;"w"in te||(te.w=1),"Z"in te?(S=yl(Gr(te.y,0,1)),ie=S.getUTCDay(),S=ie>4||ie===0?qi.ceil(S):qi(S),S=io.offset(S,(te.V-1)*7),te.y=S.getUTCFullYear(),te.m=S.getUTCMonth(),te.d=S.getUTCDate()+(te.w+6)%7):(S=bl(Gr(te.y,0,1)),ie=S.getDay(),S=ie>4||ie===0?Ji.ceil(S):Ji(S),S=ui.offset(S,(te.V-1)*7),te.y=S.getFullYear(),te.m=S.getMonth(),te.d=S.getDate()+(te.w+6)%7)}else("W"in te||"U"in te)&&("w"in te||(te.w="u"in te?te.u%7:"W"in te?1:0),ie="Z"in te?yl(Gr(te.y,0,1)).getUTCDay():bl(Gr(te.y,0,1)).getDay(),te.m=0,te.d="W"in te?(te.w+6)%7+te.W*7-(ie+5)%7:te.w+te.U*7-(ie+6)%7);return"Z"in te?(te.H+=te.Z/100|0,te.M+=te.Z%100,yl(te)):bl(te)}}function I(le,ve,se,te){for(var Se=0,S=ve.length,ie=se.length,q,H;Se<S;){if(te>=ie)return-1;if(q=ve.charCodeAt(Se++),q===37){if(q=ve.charAt(Se++),H=A[q in vu?ve.charAt(Se++):q],!H||(te=H(le,se,te))<0)return-1}else if(q!=se.charCodeAt(te++))return-1}return te}function P(le,ve,se){var te=f.exec(ve.slice(se));return te?(le.p=d.get(te[0].toLowerCase()),se+te[0].length):-1}function z(le,ve,se){var te=g.exec(ve.slice(se));return te?(le.w=m.get(te[0].toLowerCase()),se+te[0].length):-1}function R(le,ve,se){var te=h.exec(ve.slice(se));return te?(le.w=p.get(te[0].toLowerCase()),se+te[0].length):-1}function T(le,ve,se){var te=y.exec(ve.slice(se));return te?(le.m=w.get(te[0].toLowerCase()),se+te[0].length):-1}function N(le,ve,se){var te=_.exec(ve.slice(se));return te?(le.m=v.get(te[0].toLowerCase()),se+te[0].length):-1}function k(le,ve,se){return I(le,t,ve,se)}function j(le,ve,se){return I(le,n,ve,se)}function J(le,ve,se){return I(le,r,ve,se)}function W(le){return o[le.getDay()]}function G(le){return l[le.getDay()]}function Z(le){return c[le.getMonth()]}function ne(le){return a[le.getMonth()]}function O(le){return i[+(le.getHours()>=12)]}function Y(le){return 1+~~(le.getMonth()/3)}function re(le){return o[le.getUTCDay()]}function K(le){return l[le.getUTCDay()]}function X(le){return c[le.getUTCMonth()]}function fe(le){return a[le.getUTCMonth()]}function ye(le){return i[+(le.getUTCHours()>=12)]}function Ie(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var ve=M(le+="",C);return ve.toString=function(){return le},ve},parse:function(le){var ve=L(le+="",!1);return ve.toString=function(){return le},ve},utcFormat:function(le){var ve=M(le+="",x);return ve.toString=function(){return le},ve},utcParse:function(le){var ve=L(le+="",!0);return ve.toString=function(){return le},ve}}}var vu={"-":"",_:" ",0:"0"},Tt=/^\s*\d+/,gm=/^%/,mm=/[\\^$*+?|[\]().{}]/g;function gt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",l=i.length;return r+(l<n?new Array(n-l+1).join(t)+i:i)}function _m(e){return e.replace(mm,"\\$&")}function Vr(e){return new RegExp("^(?:"+e.map(_m).join("|")+")","i")}function Xr(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function bm(e,t,n){var r=Tt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ym(e,t,n){var r=Tt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function wm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function km(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wu(e,t,n){var r=Tt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function ku(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xm(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Cm(e,t,n){var r=Tt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Am(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function xu(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Sm(e,t,n){var r=Tt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Cu(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Tm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Mm(e,t,n){var r=Tt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Em(e,t,n){var r=Tt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Im(e,t,n){var r=Tt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Lm(e,t,n){var r=gm.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Nm(e,t,n){var r=Tt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pm(e,t,n){var r=Tt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Au(e,t){return gt(e.getDate(),t,2)}function zm(e,t){return gt(e.getHours(),t,2)}function Dm(e,t){return gt(e.getHours()%12||12,t,2)}function Fm(e,t){return gt(1+ui.count(En(e),e),t,3)}function Sf(e,t){return gt(e.getMilliseconds(),t,3)}function Bm(e,t){return Sf(e,t)+"000"}function Rm(e,t){return gt(e.getMonth()+1,t,2)}function jm(e,t){return gt(e.getMinutes(),t,2)}function Om(e,t){return gt(e.getSeconds(),t,2)}function Um(e){var t=e.getDay();return t===0?7:t}function Hm(e,t){return gt(al.count(En(e)-1,e),t,2)}function Tf(e){var t=e.getDay();return t>=4||t===0?Fr(e):Fr.ceil(e)}function Zm(e,t){return e=Tf(e),gt(Fr.count(En(e),e)+(En(e).getDay()===4),t,2)}function Wm(e){return e.getDay()}function Ym(e,t){return gt(Ji.count(En(e)-1,e),t,2)}function Gm(e,t){return gt(e.getFullYear()%100,t,2)}function Vm(e,t){return e=Tf(e),gt(e.getFullYear()%100,t,2)}function Xm(e,t){return gt(e.getFullYear()%1e4,t,4)}function Jm(e,t){var n=e.getDay();return e=n>=4||n===0?Fr(e):Fr.ceil(e),gt(e.getFullYear()%1e4,t,4)}function qm(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gt(t/60|0,"0",2)+gt(t%60,"0",2)}function Su(e,t){return gt(e.getUTCDate(),t,2)}function Km(e,t){return gt(e.getUTCHours(),t,2)}function Qm(e,t){return gt(e.getUTCHours()%12||12,t,2)}function $m(e,t){return gt(1+io.count(ir(e),e),t,3)}function Mf(e,t){return gt(e.getUTCMilliseconds(),t,3)}function e2(e,t){return Mf(e,t)+"000"}function t2(e,t){return gt(e.getUTCMonth()+1,t,2)}function n2(e,t){return gt(e.getUTCMinutes(),t,2)}function r2(e,t){return gt(e.getUTCSeconds(),t,2)}function i2(e){var t=e.getUTCDay();return t===0?7:t}function l2(e,t){return gt(Af.count(ir(e)-1,e),t,2)}function Ef(e){var t=e.getUTCDay();return t>=4||t===0?Br(e):Br.ceil(e)}function o2(e,t){return e=Ef(e),gt(Br.count(ir(e),e)+(ir(e).getUTCDay()===4),t,2)}function s2(e){return e.getUTCDay()}function a2(e,t){return gt(qi.count(ir(e)-1,e),t,2)}function u2(e,t){return gt(e.getUTCFullYear()%100,t,2)}function c2(e,t){return e=Ef(e),gt(e.getUTCFullYear()%100,t,2)}function f2(e,t){return gt(e.getUTCFullYear()%1e4,t,4)}function d2(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Br(e):Br.ceil(e),gt(e.getUTCFullYear()%1e4,t,4)}function h2(){return"+0000"}function Tu(){return"%"}function Mu(e){return+e}function Eu(e){return Math.floor(+e/1e3)}var kr,oo,If;p2({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function p2(e){return kr=pm(e),oo=kr.format,If=kr.parse,kr.utcFormat,kr.utcParse,kr}function g2(e){return new Date(e)}function m2(e){return e instanceof Date?+e:+new Date(+e)}function Lf(e,t,n,r,i,l,o,a,c,f){var d=xf(),h=d.invert,p=d.domain,g=f(".%L"),m=f(":%S"),_=f("%I:%M"),v=f("%I %p"),y=f("%a %d"),w=f("%b %d"),C=f("%B"),x=f("%Y");function A(M){return(c(M)<M?g:a(M)<M?m:o(M)<M?_:l(M)<M?v:r(M)<M?i(M)<M?y:w:n(M)<M?C:x)(M)}return d.invert=function(M){return new Date(h(M))},d.domain=function(M){return arguments.length?p(Array.from(M,m2)):p().map(g2)},d.ticks=function(M){var L=p();return e(L[0],L[L.length-1],M??10)},d.tickFormat=function(M,L){return L==null?A:f(L)},d.nice=function(M){var L=p();return(!M||typeof M.range!="function")&&(M=t(L[0],L[L.length-1],M??10)),M?p(Qg(L,M)):d},d.copy=function(){return kf(d,Lf(e,t,n,r,i,l,o,a,c,f))},d}function _2(){return sl.apply(Lf(dm,hm,En,lo,al,ui,ro,no,Ar,oo).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function b2(){var e=0,t=1,n,r,i,l,o=On,a=!1,c;function f(h){return h==null||isNaN(h=+h)?c:o(i===0?.5:(h=(l(h)-n)*i,a?Math.max(0,Math.min(1,h)):h))}f.domain=function(h){return arguments.length?([e,t]=h,n=l(e=+e),r=l(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(h){return arguments.length?(a=!!h,f):a},f.interpolator=function(h){return arguments.length?(o=h,f):o};function d(h){return function(p){var g,m;return arguments.length?([g,m]=p,o=h(g,m),f):[o(0),o(1)]}}return f.range=d(il),f.rangeRound=d(of),f.unknown=function(h){return arguments.length?(c=h,f):c},function(h){return l=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),f}}function y2(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Nf(){var e=Cf(b2()(On));return e.copy=function(){return y2(e,Nf())},Wg.apply(e,arguments)}cf(Un(-100,.75,.35),Un(80,1.5,.8));var v2=cf(Un(260,.75,.35),Un(80,1.5,.8));Un();function pt(e){return function(){return e}}const Iu=Math.abs,zt=Math.atan2,Vn=Math.cos,w2=Math.max,vl=Math.min,vn=Math.sin,Sr=Math.sqrt,Xt=1e-12,oi=Math.PI,Ki=oi/2,Li=2*oi;function k2(e){return e>1?0:e<-1?oi:Math.acos(e)}function Lu(e){return e>=1?Ki:e<=-1?-Ki:Math.asin(e)}function so(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Ng(t)}function x2(e){return e.innerRadius}function C2(e){return e.outerRadius}function A2(e){return e.startAngle}function S2(e){return e.endAngle}function T2(e){return e&&e.padAngle}function M2(e,t,n,r,i,l,o,a){var c=n-e,f=r-t,d=o-i,h=a-l,p=h*c-d*f;if(!(p*p<Xt))return p=(d*(t-l)-h*(e-i))/p,[e+p*c,t+p*f]}function Ai(e,t,n,r,i,l,o){var a=e-n,c=t-r,f=(o?l:-l)/Sr(a*a+c*c),d=f*c,h=-f*a,p=e+d,g=t+h,m=n+d,_=r+h,v=(p+m)/2,y=(g+_)/2,w=m-p,C=_-g,x=w*w+C*C,A=i-l,M=p*_-m*g,L=(C<0?-1:1)*Sr(w2(0,A*A*x-M*M)),I=(M*C-w*L)/x,P=(-M*w-C*L)/x,z=(M*C+w*L)/x,R=(-M*w+C*L)/x,T=I-v,N=P-y,k=z-v,j=R-y;return T*T+N*N>k*k+j*j&&(I=z,P=R),{cx:I,cy:P,x01:-d,y01:-h,x11:I*(i/A-1),y11:P*(i/A-1)}}function Nu(){var e=x2,t=C2,n=pt(0),r=null,i=A2,l=S2,o=T2,a=null,c=so(f);function f(){var d,h,p=+e.apply(this,arguments),g=+t.apply(this,arguments),m=i.apply(this,arguments)-Ki,_=l.apply(this,arguments)-Ki,v=Iu(_-m),y=_>m;if(a||(a=d=c()),g<p&&(h=g,g=p,p=h),!(g>Xt))a.moveTo(0,0);else if(v>Li-Xt)a.moveTo(g*Vn(m),g*vn(m)),a.arc(0,0,g,m,_,!y),p>Xt&&(a.moveTo(p*Vn(_),p*vn(_)),a.arc(0,0,p,_,m,y));else{var w=m,C=_,x=m,A=_,M=v,L=v,I=o.apply(this,arguments)/2,P=I>Xt&&(r?+r.apply(this,arguments):Sr(p*p+g*g)),z=vl(Iu(g-p)/2,+n.apply(this,arguments)),R=z,T=z,N,k;if(P>Xt){var j=Lu(P/p*vn(I)),J=Lu(P/g*vn(I));(M-=j*2)>Xt?(j*=y?1:-1,x+=j,A-=j):(M=0,x=A=(m+_)/2),(L-=J*2)>Xt?(J*=y?1:-1,w+=J,C-=J):(L=0,w=C=(m+_)/2)}var W=g*Vn(w),G=g*vn(w),Z=p*Vn(A),ne=p*vn(A);if(z>Xt){var O=g*Vn(C),Y=g*vn(C),re=p*Vn(x),K=p*vn(x),X;if(v<oi)if(X=M2(W,G,re,K,O,Y,Z,ne)){var fe=W-X[0],ye=G-X[1],Ie=O-X[0],le=Y-X[1],ve=1/vn(k2((fe*Ie+ye*le)/(Sr(fe*fe+ye*ye)*Sr(Ie*Ie+le*le)))/2),se=Sr(X[0]*X[0]+X[1]*X[1]);R=vl(z,(p-se)/(ve-1)),T=vl(z,(g-se)/(ve+1))}else R=T=0}L>Xt?T>Xt?(N=Ai(re,K,W,G,g,T,y),k=Ai(O,Y,Z,ne,g,T,y),a.moveTo(N.cx+N.x01,N.cy+N.y01),T<z?a.arc(N.cx,N.cy,T,zt(N.y01,N.x01),zt(k.y01,k.x01),!y):(a.arc(N.cx,N.cy,T,zt(N.y01,N.x01),zt(N.y11,N.x11),!y),a.arc(0,0,g,zt(N.cy+N.y11,N.cx+N.x11),zt(k.cy+k.y11,k.cx+k.x11),!y),a.arc(k.cx,k.cy,T,zt(k.y11,k.x11),zt(k.y01,k.x01),!y))):(a.moveTo(W,G),a.arc(0,0,g,w,C,!y)):a.moveTo(W,G),!(p>Xt)||!(M>Xt)?a.lineTo(Z,ne):R>Xt?(N=Ai(Z,ne,O,Y,p,-R,y),k=Ai(W,G,re,K,p,-R,y),a.lineTo(N.cx+N.x01,N.cy+N.y01),R<z?a.arc(N.cx,N.cy,R,zt(N.y01,N.x01),zt(k.y01,k.x01),!y):(a.arc(N.cx,N.cy,R,zt(N.y01,N.x01),zt(N.y11,N.x11),!y),a.arc(0,0,p,zt(N.cy+N.y11,N.cx+N.x11),zt(k.cy+k.y11,k.cx+k.x11),y),a.arc(k.cx,k.cy,R,zt(k.y11,k.x11),zt(k.y01,k.x01),!y))):a.arc(0,0,p,A,x,y)}if(a.closePath(),d)return a=null,d+""||null}return f.centroid=function(){var d=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +l.apply(this,arguments))/2-oi/2;return[Vn(h)*d,vn(h)*d]},f.innerRadius=function(d){return arguments.length?(e=typeof d=="function"?d:pt(+d),f):e},f.outerRadius=function(d){return arguments.length?(t=typeof d=="function"?d:pt(+d),f):t},f.cornerRadius=function(d){return arguments.length?(n=typeof d=="function"?d:pt(+d),f):n},f.padRadius=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:pt(+d),f):r},f.startAngle=function(d){return arguments.length?(i=typeof d=="function"?d:pt(+d),f):i},f.endAngle=function(d){return arguments.length?(l=typeof d=="function"?d:pt(+d),f):l},f.padAngle=function(d){return arguments.length?(o=typeof d=="function"?d:pt(+d),f):o},f.context=function(d){return arguments.length?(a=d??null,f):a},f}function ao(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Pf(e){this._context=e}Pf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function zf(e){return new Pf(e)}function Df(e){return e[0]}function Ff(e){return e[1]}function Bf(e,t){var n=pt(!0),r=null,i=zf,l=null,o=so(a);e=typeof e=="function"?e:e===void 0?Df:pt(e),t=typeof t=="function"?t:t===void 0?Ff:pt(t);function a(c){var f,d=(c=ao(c)).length,h,p=!1,g;for(r==null&&(l=i(g=o())),f=0;f<=d;++f)!(f<d&&n(h=c[f],f,c))===p&&((p=!p)?l.lineStart():l.lineEnd()),p&&l.point(+e(h,f,c),+t(h,f,c));if(g)return l=null,g+""||null}return a.x=function(c){return arguments.length?(e=typeof c=="function"?c:pt(+c),a):e},a.y=function(c){return arguments.length?(t=typeof c=="function"?c:pt(+c),a):t},a.defined=function(c){return arguments.length?(n=typeof c=="function"?c:pt(!!c),a):n},a.curve=function(c){return arguments.length?(i=c,r!=null&&(l=i(r)),a):i},a.context=function(c){return arguments.length?(c==null?r=l=null:l=i(r=c),a):r},a}function E2(e,t,n){var r=null,i=pt(!0),l=null,o=zf,a=null,c=so(f);e=typeof e=="function"?e:e===void 0?Df:pt(+e),t=typeof t=="function"?t:pt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Ff:pt(+n);function f(h){var p,g,m,_=(h=ao(h)).length,v,y=!1,w,C=new Array(_),x=new Array(_);for(l==null&&(a=o(w=c())),p=0;p<=_;++p){if(!(p<_&&i(v=h[p],p,h))===y)if(y=!y)g=p,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),m=p-1;m>=g;--m)a.point(C[m],x[m]);a.lineEnd(),a.areaEnd()}y&&(C[p]=+e(v,p,h),x[p]=+t(v,p,h),a.point(r?+r(v,p,h):C[p],n?+n(v,p,h):x[p]))}if(w)return a=null,w+""||null}function d(){return Bf().defined(i).curve(o).context(l)}return f.x=function(h){return arguments.length?(e=typeof h=="function"?h:pt(+h),r=null,f):e},f.x0=function(h){return arguments.length?(e=typeof h=="function"?h:pt(+h),f):e},f.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:pt(+h),f):r},f.y=function(h){return arguments.length?(t=typeof h=="function"?h:pt(+h),n=null,f):t},f.y0=function(h){return arguments.length?(t=typeof h=="function"?h:pt(+h),f):t},f.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:pt(+h),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(h){return arguments.length?(i=typeof h=="function"?h:pt(!!h),f):i},f.curve=function(h){return arguments.length?(o=h,l!=null&&(a=o(l)),f):o},f.context=function(h){return arguments.length?(h==null?l=a=null:a=o(l=h),f):l},f}function I2(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function L2(e){return e}function N2(){var e=L2,t=I2,n=null,r=pt(0),i=pt(Li),l=pt(0);function o(a){var c,f=(a=ao(a)).length,d,h,p=0,g=new Array(f),m=new Array(f),_=+r.apply(this,arguments),v=Math.min(Li,Math.max(-Li,i.apply(this,arguments)-_)),y,w=Math.min(Math.abs(v)/f,l.apply(this,arguments)),C=w*(v<0?-1:1),x;for(c=0;c<f;++c)(x=m[g[c]=c]=+e(a[c],c,a))>0&&(p+=x);for(t!=null?g.sort(function(A,M){return t(m[A],m[M])}):n!=null&&g.sort(function(A,M){return n(a[A],a[M])}),c=0,h=p?(v-f*C)/p:0;c<f;++c,_=y)d=g[c],x=m[d],y=_+(x>0?x*h:0)+C,m[d]={data:a[d],index:c,value:x,startAngle:_,endAngle:y,padAngle:w};return m}return o.value=function(a){return arguments.length?(e=typeof a=="function"?a:pt(+a),o):e},o.sortValues=function(a){return arguments.length?(t=a,n=null,o):t},o.sort=function(a){return arguments.length?(n=a,t=null,o):n},o.startAngle=function(a){return arguments.length?(r=typeof a=="function"?a:pt(+a),o):r},o.endAngle=function(a){return arguments.length?(i=typeof a=="function"?a:pt(+a),o):i},o.padAngle=function(a){return arguments.length?(l=typeof a=="function"?a:pt(+a),o):l},o}function Pu(e){return e<0?-1:1}function zu(e,t,n){var r=e._x1-e._x0,i=t-e._x1,l=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),a=(l*i+o*r)/(r+i);return(Pu(l)+Pu(o))*Math.min(Math.abs(l),Math.abs(o),.5*Math.abs(a))||0}function Du(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function wl(e,t,n){var r=e._x0,i=e._y0,l=e._x1,o=e._y1,a=(l-r)/3;e._context.bezierCurveTo(r+a,i+a*t,l-a,o-a*n,l,o)}function Qi(e){this._context=e}Qi.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wl(this,this._t0,Du(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,wl(this,Du(this,n=zu(this,e,t)),n);break;default:wl(this,this._t0,n=zu(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};Object.create(Qi.prototype).point=function(e,t){Qi.prototype.point.call(this,t,e)};function Fu(e){return new Qi(e)}function $r(e,t,n){this.k=e,this.x=t,this.y=n}$r.prototype={constructor:$r,scale:function(e){return e===1?this:new $r(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $r(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};$r.prototype;function Bu(e,t,n){const r=e.slice();return r[88]=t[n],r}function kl(e){const t=e.slice(),n=new Set(t[24].translations.map(i=>i.lang));t[86]=n;const r=t[5].filter(function(...l){return e[74](t[86],...l)});return t[87]=r,t}function Ru(e,t,n){const r=e.slice();return r[91]=t[n],r}function ju(e,t,n){const r=e.slice();return r[88]=t[n],r}function Ou(e,t,n){const r=e.slice();return r[114]=t[n],r[116]=n,r}function Uu(e,t,n){const r=e.slice();r[99]=t[n];const i=i_(r[99].url);r[100]=i;const l=r[99].phraseCount>0?Math.round(r[99].approved/r[99].phraseCount*100):0;return r[101]=l,r}function Hu(e,t,n){const r=e.slice();return r[104]=t[n],r}function Zu(e,t,n){const r=e.slice();return r[88]=t[n],r}function Wu(e,t,n){const r=e.slice();return r[109]=t[n],r}function Yu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Gu(e,t,n){const r=e.slice();return r[96]=t[n],r}function Vu(e,t,n){const r=e.slice();return r[117]=t[n][0],r[118]=t[n][1],r}function Xu(e){let t,n=dt(e[4].totalPhrases)+"",r,i,l=dt(e[4].uniqueUrls)+"",o,a,c=dt(e[4].languageCount)+"",f,d;return{c(){t=b("span"),r=B(n),i=B(" phrases · "),o=B(l),a=B(" pages · "),f=B(c),d=B(" languages"),s(t,"class","text-xs text-gray-500 bg-gray-800 px-3 py-1.5 rounded-lg border border-gray-700")},m(h,p){F(h,t,p),u(t,r),u(t,i),u(t,o),u(t,a),u(t,f),u(t,d)},p(h,p){p[0]&16&&n!==(n=dt(h[4].totalPhrases)+"")&&ee(r,n),p[0]&16&&l!==(l=dt(h[4].uniqueUrls)+"")&&ee(o,l),p[0]&16&&c!==(c=dt(h[4].languageCount)+"")&&ee(f,c)},d(h){h&&D(t)}}}function P2(e){let t,n,r,i=Be([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]),l=[];for(let f=0;f<3;f+=1)l[f]=Ju(Vu(e,i,f));function o(f,d){if(f[27]==="overview")return B2;if(f[27]==="pages")return F2;if(f[27]==="languages")return D2}let a=o(e),c=a&&a(e);return{c(){t=b("div");for(let f=0;f<3;f+=1)l[f].c();n=E(),c&&c.c(),r=xt(),s(t,"class","flex gap-1 bg-gray-800 border border-gray-700 rounded-lg p-1 w-fit")},m(f,d){F(f,t,d);for(let h=0;h<3;h+=1)l[h]&&l[h].m(t,null);F(f,n,d),c&&c.m(f,d),F(f,r,d)},p(f,d){if(d[0]&134217728|d[1]&32768){i=Be([["overview","Overview"],["pages","Pages & URLs"],["languages","Languages"]]);let h;for(h=0;h<3;h+=1){const p=Vu(f,i,h);l[h]?l[h].p(p,d):(l[h]=Ju(p),l[h].c(),l[h].m(t,null))}for(;h<3;h+=1)l[h].d(1)}a===(a=o(f))&&c?c.p(f,d):(c&&c.d(1),c=a&&a(f),c&&(c.c(),c.m(r.parentNode,r)))},d(f){f&&(D(t),D(n),D(r)),ft(l,f),c&&c.d(f)}}}function z2(e){let t;return{c(){t=b("div"),t.innerHTML=`<svg class="animate-spin w-5 h-5 mr-2" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4" stroke-dasharray="60 20"></circle></svg>
|
|
63
|
+
Loading analytics…`,s(t,"class","flex items-center justify-center py-24 text-gray-500")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Ju(e){let t,n,r,i,l;function o(){return e[48](e[117])}return{c(){t=b("button"),n=B(e[118]),s(t,"class",r="px-4 py-1.5 rounded-md text-xs font-medium transition-colors "+(e[27]===e[117]?"bg-indigo-600 text-white":"text-gray-400 hover:text-white"))},m(a,c){F(a,t,c),u(t,n),i||(l=$(t,"click",o),i=!0)},p(a,c){e=a,c[0]&134217728&&r!==(r="px-4 py-1.5 rounded-md text-xs font-medium transition-colors "+(e[27]===e[117]?"bg-indigo-600 text-white":"text-gray-400 hover:text-white"))&&s(t,"class",r)},d(a){a&&D(t),i=!1,l()}}}function D2(e){let t,n,r,i,l,o,a,c,f,d,h,p=Be(e[5]),g=[];for(let m=0;m<p.length;m+=1)g[m]=qu(Ou(e,p,m));return{c(){t=b("div"),n=b("div"),r=b("h3"),r.textContent="Translations per Language",i=E(),l=b("div"),o=E(),a=b("div"),c=b("table"),f=b("thead"),f.innerHTML='<tr class="text-gray-400 uppercase text-[10px]"><th class="text-left px-4 py-2.5">Language</th> <th class="text-right px-4 py-2.5 w-28">Translated</th> <th class="text-left px-4 py-2.5">Coverage</th></tr>',d=E(),h=b("tbody");for(let m=0;m<g.length;m+=1)g[m].c();s(r,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),s(l,"class","w-full"),mt(l,"min-height","200px"),s(n,"class","bg-gray-800 border border-gray-700 rounded-xl p-4 lg:col-span-2"),s(t,"class","grid grid-cols-1 lg:grid-cols-2 gap-4"),s(f,"class","border-b border-gray-700"),s(c,"class","w-full text-xs"),s(a,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden")},m(m,_){F(m,t,_),u(t,n),u(n,r),u(n,i),u(n,l),e[70](l),F(m,o,_),F(m,a,_),u(a,c),u(c,f),u(c,d),u(c,h);for(let v=0;v<g.length;v+=1)g[v]&&g[v].m(h,null)},p(m,_){if(_[0]&32){p=Be(m[5]);let v;for(v=0;v<p.length;v+=1){const y=Ou(m,p,v);g[v]?g[v].p(y,_):(g[v]=qu(y),g[v].c(),g[v].m(h,null))}for(;v<g.length;v+=1)g[v].d(1);g.length=p.length}},d(m){m&&(D(t),D(o),D(a)),e[70](null),ft(g,m)}}}function F2(e){let t,n,r,i,l,o,a,c,f,d,h,p,g=dt(e[9])+"",m,_,v,y,w,C,x=Be(e[6]),A=[];for(let R=0;R<x.length;R+=1)A[R]=Ku(Yu(e,x,R));let M=Be(e[7].filter(bc)),L=[];for(let R=0;R<M.length;R+=1)L[R]=Qu(Wu(e,M,R));function I(R,T){return R[11]?O2:R[8].length===0?j2:R2}let P=I(e),z=P(e);return{c(){t=b("div"),n=b("div"),r=pe("svg"),i=pe("path"),l=E(),o=b("input"),a=E(),c=b("div");for(let R=0;R<A.length;R+=1)A[R].c();f=E(),d=b("div");for(let R=0;R<L.length;R+=1)L[R].c();h=E(),p=b("span"),m=B(g),_=B(" pages"),v=E(),z.c(),y=xt(),s(i,"fill-rule","evenodd"),s(i,"d","M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"),s(i,"clip-rule","evenodd"),s(r,"class","absolute left-2.5 top-2 w-4 h-4 text-gray-500"),s(r,"viewBox","0 0 20 20"),s(r,"fill","currentColor"),s(o,"class","bg-gray-800 border border-gray-700 rounded-lg pl-8 pr-3 py-1.5 text-sm text-gray-200 placeholder-gray-500 focus:outline-none focus:border-indigo-500 w-56"),s(o,"placeholder","Search URLs…"),s(n,"class","relative"),s(c,"class","flex gap-1.5 flex-wrap"),s(d,"class","flex gap-1.5 flex-wrap"),s(p,"class","text-xs text-gray-500 ml-auto"),s(t,"class","flex flex-wrap items-center gap-2")},m(R,T){F(R,t,T),u(t,n),u(n,r),u(r,i),u(n,l),u(n,o),De(o,e[12]),u(t,a),u(t,c);for(let N=0;N<A.length;N+=1)A[N]&&A[N].m(c,null);u(t,f),u(t,d);for(let N=0;N<L.length;N+=1)L[N]&&L[N].m(d,null);u(t,h),u(t,p),u(p,m),u(p,_),F(R,v,T),z.m(R,T),F(R,y,T),w||(C=[$(o,"input",e[54]),$(o,"input",e[41])],w=!0)},p(R,T){if(T[0]&4096&&o.value!==R[12]&&De(o,R[12]),T[0]&16448|T[1]&2048){x=Be(R[6]);let N;for(N=0;N<x.length;N+=1){const k=Yu(R,x,N);A[N]?A[N].p(k,T):(A[N]=Ku(k),A[N].c(),A[N].m(c,null))}for(;N<A.length;N+=1)A[N].d(1);A.length=x.length}if(T[0]&32896|T[1]&4096){M=Be(R[7].filter(bc));let N;for(N=0;N<M.length;N+=1){const k=Wu(R,M,N);L[N]?L[N].p(k,T):(L[N]=Qu(k),L[N].c(),L[N].m(d,null))}for(;N<L.length;N+=1)L[N].d(1);L.length=M.length}T[0]&512&&g!==(g=dt(R[9])+"")&&ee(m,g),P===(P=I(R))&&z?z.p(R,T):(z.d(1),z=P(R),z&&(z.c(),z.m(y.parentNode,y)))},d(R){R&&(D(t),D(v),D(y)),ft(A,R),ft(L,R),z.d(R),w=!1,lt(C)}}}function B2(e){let t,n,r,i,l,o=hn(e[4].totalPhrases)+"",a,c,f,d=dt(e[4].phrasesWithSlots)+"",h,p,g,m,_,v,y,w=hn(e[4].approvedPhrases)+"",C,x,A,M=(e[4].totalPhrases?Math.round(e[4].approvedPhrases/e[4].totalPhrases*100):0)+"",L,I,P,z,R,T,N,k=e[4].languageCount+"",j,J,W,G=hn(e[4].totalTranslations)+"",Z,ne,O,Y,re,K,X,fe=dt(e[4].uniqueUrls)+"",ye,Ie,le,ve,se,te,Se,S,ie,q,H,U,V,ae,ce,Q,de,ge,he=dt(e[4].pendingPhrases)+"",xe,Re,we,Me,ze,Ee,Ge,oe,Fe=dt(e[4].approvedPhrases)+"",me,Ae,Ue,Ce,Te,et,Xe,Le,Ye,ke,qe,tt,yt,Rt,Mt,en,jt,Ot,be,He,Je,at,wt,_t,ut=e[4].trashPhrases>0&&ac(e),bt=Be(e[6]),it=[];for(let Ze=0;Ze<bt.length;Ze+=1)it[Ze]=uc(Gu(e,bt,Ze));return{c(){t=b("div"),n=b("div"),r=b("p"),r.textContent="Total Phrases",i=E(),l=b("p"),a=B(o),c=E(),f=b("p"),h=B(d),p=B(" with var-slots"),g=E(),m=b("div"),_=b("p"),_.textContent="Approved",v=E(),y=b("p"),C=B(w),x=E(),A=b("p"),L=B(M),I=B("% coverage"),P=E(),z=b("div"),R=b("p"),R.textContent="Languages",T=E(),N=b("p"),j=B(k),J=E(),W=b("p"),Z=B(G),ne=B(" total translations"),O=E(),Y=b("div"),re=b("p"),re.textContent="Pages Crawled",K=E(),X=b("p"),ye=B(fe),Ie=E(),le=b("p"),le.textContent="unique URLs",ve=E(),se=b("div"),te=b("div"),Se=b("h3"),Se.textContent="Phrase Status",S=E(),ie=b("div"),q=b("div"),H=E(),U=b("div"),V=b("div"),ae=b("span"),ce=E(),Q=b("span"),Q.textContent="Pending",de=E(),ge=b("span"),xe=B(he),Re=E(),we=b("div"),Me=b("span"),ze=E(),Ee=b("span"),Ee.textContent="Approved",Ge=E(),oe=b("span"),me=B(Fe),Ae=E(),ut&&ut.c(),Ue=E(),Ce=b("div"),Te=b("h3"),Te.textContent="Discovery Activity (phrases per day)",et=E(),Xe=b("div"),Le=E(),Ye=b("div"),ke=b("div"),qe=b("h3"),qe.textContent="Phrases by Page Section",tt=E(),yt=b("p"),yt.innerHTML="Grouped by <code>f=</code> URL parameter. Click a bar to filter pages.",Rt=E(),Mt=b("div"),en=E(),jt=b("div");for(let Ze=0;Ze<it.length;Ze+=1)it[Ze].c();Ot=E(),be=b("div"),He=b("h3"),He.textContent="Phrases by WebChart Instance",Je=E(),at=b("p"),at.innerHTML=`<span class="text-emerald-400">■</span> approved
|
|
64
|
+
<span class="text-blue-400 opacity-40">■</span> total — click to filter pages`,wt=E(),_t=b("div"),s(r,"class","text-xs text-gray-400 uppercase tracking-wide"),s(l,"class","text-3xl font-bold text-white mt-1"),s(f,"class","text-xs text-gray-500 mt-1"),s(n,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(_,"class","text-xs text-gray-400 uppercase tracking-wide"),s(y,"class","text-3xl font-bold text-emerald-400 mt-1"),s(A,"class","text-xs text-gray-500 mt-1"),s(m,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(R,"class","text-xs text-gray-400 uppercase tracking-wide"),s(N,"class","text-3xl font-bold text-indigo-400 mt-1"),s(W,"class","text-xs text-gray-500 mt-1"),s(z,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(re,"class","text-xs text-gray-400 uppercase tracking-wide"),s(X,"class","text-3xl font-bold text-blue-400 mt-1"),s(le,"class","text-xs text-gray-500 mt-1"),s(Y,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(t,"class","grid grid-cols-2 lg:grid-cols-4 gap-3"),s(Se,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),s(q,"class","relative"),mt(q,"width","160px"),mt(q,"height","160px"),mt(q,"flex-shrink","0"),s(ae,"class","w-2.5 h-2.5 rounded-full bg-yellow-400 shrink-0"),s(Q,"class","text-gray-400"),s(ge,"class","ml-auto font-mono text-gray-200"),s(V,"class","flex items-center gap-2 text-xs"),s(Me,"class","w-2.5 h-2.5 rounded-full bg-emerald-500 shrink-0"),s(Ee,"class","text-gray-400"),s(oe,"class","ml-auto font-mono text-gray-200"),s(we,"class","flex items-center gap-2 text-xs"),s(U,"class","space-y-2"),s(ie,"class","flex items-center gap-6"),s(te,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(Te,"class","text-xs font-semibold text-gray-400 uppercase mb-3"),s(Xe,"class","w-full"),mt(Xe,"min-height","130px"),s(Ce,"class","lg:col-span-2 bg-gray-800 border border-gray-700 rounded-xl p-4"),s(se,"class","grid grid-cols-1 lg:grid-cols-3 gap-4"),s(qe,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),s(yt,"class","text-xs text-gray-500 mb-3"),s(Mt,"class","w-full"),mt(Mt,"min-height","180px"),s(jt,"class","flex flex-wrap gap-2 mt-3"),s(ke,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(He,"class","text-xs font-semibold text-gray-400 uppercase mb-1"),s(at,"class","text-xs text-gray-500 mb-3"),s(_t,"class","w-full"),mt(_t,"min-height","160px"),s(be,"class","bg-gray-800 border border-gray-700 rounded-xl p-4"),s(Ye,"class","grid grid-cols-1 lg:grid-cols-2 gap-4")},m(Ze,Oe){F(Ze,t,Oe),u(t,n),u(n,r),u(n,i),u(n,l),u(l,a),u(n,c),u(n,f),u(f,h),u(f,p),u(t,g),u(t,m),u(m,_),u(m,v),u(m,y),u(y,C),u(m,x),u(m,A),u(A,L),u(A,I),u(t,P),u(t,z),u(z,R),u(z,T),u(z,N),u(N,j),u(z,J),u(z,W),u(W,Z),u(W,ne),u(t,O),u(t,Y),u(Y,re),u(Y,K),u(Y,X),u(X,ye),u(Y,Ie),u(Y,le),F(Ze,ve,Oe),F(Ze,se,Oe),u(se,te),u(te,Se),u(te,S),u(te,ie),u(ie,q),e[49](q),u(ie,H),u(ie,U),u(U,V),u(V,ae),u(V,ce),u(V,Q),u(V,de),u(V,ge),u(ge,xe),u(U,Re),u(U,we),u(we,Me),u(we,ze),u(we,Ee),u(we,Ge),u(we,oe),u(oe,me),u(U,Ae),ut&&ut.m(U,null),u(se,Ue),u(se,Ce),u(Ce,Te),u(Ce,et),u(Ce,Xe),e[50](Xe),F(Ze,Le,Oe),F(Ze,Ye,Oe),u(Ye,ke),u(ke,qe),u(ke,tt),u(ke,yt),u(ke,Rt),u(ke,Mt),e[51](Mt),u(ke,en),u(ke,jt);for(let Qe=0;Qe<it.length;Qe+=1)it[Qe]&&it[Qe].m(jt,null);u(Ye,Ot),u(Ye,be),u(be,He),u(be,Je),u(be,at),u(be,wt),u(be,_t),e[53](_t)},p(Ze,Oe){if(Oe[0]&16&&o!==(o=hn(Ze[4].totalPhrases)+"")&&ee(a,o),Oe[0]&16&&d!==(d=dt(Ze[4].phrasesWithSlots)+"")&&ee(h,d),Oe[0]&16&&w!==(w=hn(Ze[4].approvedPhrases)+"")&&ee(C,w),Oe[0]&16&&M!==(M=(Ze[4].totalPhrases?Math.round(Ze[4].approvedPhrases/Ze[4].totalPhrases*100):0)+"")&&ee(L,M),Oe[0]&16&&k!==(k=Ze[4].languageCount+"")&&ee(j,k),Oe[0]&16&&G!==(G=hn(Ze[4].totalTranslations)+"")&&ee(Z,G),Oe[0]&16&&fe!==(fe=dt(Ze[4].uniqueUrls)+"")&&ee(ye,fe),Oe[0]&16&&he!==(he=dt(Ze[4].pendingPhrases)+"")&&ee(xe,he),Oe[0]&16&&Fe!==(Fe=dt(Ze[4].approvedPhrases)+"")&&ee(me,Fe),Ze[4].trashPhrases>0?ut?ut.p(Ze,Oe):(ut=ac(Ze),ut.c(),ut.m(U,null)):ut&&(ut.d(1),ut=null),Oe[0]&16448|Oe[1]&2048){bt=Be(Ze[6]);let Qe;for(Qe=0;Qe<bt.length;Qe+=1){const St=Gu(Ze,bt,Qe);it[Qe]?it[Qe].p(St,Oe):(it[Qe]=uc(St),it[Qe].c(),it[Qe].m(jt,null))}for(;Qe<it.length;Qe+=1)it[Qe].d(1);it.length=bt.length}},d(Ze){Ze&&(D(t),D(ve),D(se),D(Le),D(Ye)),e[49](null),ut&&ut.d(),e[50](null),e[51](null),ft(it,Ze),e[53](null)}}}function qu(e){let t,n,r=e[114].lang+"",i,l,o,a=dt(e[114].translated)+"",c,f,d,h,p,g,m,_,v=e[114].coverage+"",y,w,C;return{c(){t=b("tr"),n=b("td"),i=B(r),l=E(),o=b("td"),c=B(a),f=E(),d=b("td"),h=b("div"),p=b("div"),g=b("div"),m=E(),_=b("span"),y=B(v),w=B("%"),C=E(),s(n,"class","px-4 py-2.5 font-mono text-indigo-300"),s(o,"class","px-4 py-2.5 text-right font-mono text-gray-200"),s(g,"class","h-1.5 rounded-full transition-all"),mt(g,"width",e[114].coverage+"%"),mt(g,"background",e[114].coverage>80?"#10b981":e[114].coverage>40?"#6366f1":"#f59e0b"),s(p,"class","flex-1 bg-gray-700 rounded-full h-1.5 max-w-xs"),s(_,"class","text-gray-400 w-10 text-right"),s(h,"class","flex items-center gap-2"),s(d,"class","px-4 py-2.5"),s(t,"class","border-b border-gray-700/40")},m(x,A){F(x,t,A),u(t,n),u(n,i),u(t,l),u(t,o),u(o,c),u(t,f),u(t,d),u(d,h),u(h,p),u(p,g),u(h,m),u(h,_),u(_,y),u(_,w),u(t,C)},p(x,A){A[0]&32&&r!==(r=x[114].lang+"")&&ee(i,r),A[0]&32&&a!==(a=dt(x[114].translated)+"")&&ee(c,a),A[0]&32&&mt(g,"width",x[114].coverage+"%"),A[0]&32&&mt(g,"background",x[114].coverage>80?"#10b981":x[114].coverage>40?"#6366f1":"#f59e0b"),A[0]&32&&v!==(v=x[114].coverage+"")&&ee(y,v)},d(x){x&&D(t)}}}function Ku(e){let t,n=e[96].section+"",r,i,l,o;function a(){return e[55](e[96])}return{c(){t=b("button"),r=B(n),s(t,"class",i="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))},m(c,f){F(c,t,f),u(t,r),l||(o=$(t,"click",a),l=!0)},p(c,f){e=c,f[0]&64&&n!==(n=e[96].section+"")&&ee(r,n),f[0]&16448&&i!==(i="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))&&s(t,"class",i)},d(c){c&&D(t),l=!1,o()}}}function Qu(e){let t,n=e[109].instance+"",r,i,l,o;function a(){return e[56](e[109])}return{c(){t=b("button"),r=B(n),s(t,"class",i="text-xs px-2 py-1 rounded-full border transition-colors font-mono "+(e[15]===e[109].instance?"bg-blue-700 border-blue-500 text-white":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"))},m(c,f){F(c,t,f),u(t,r),l||(o=$(t,"click",a),l=!0)},p(c,f){e=c,f[0]&128&&n!==(n=e[109].instance+"")&&ee(r,n),f[0]&32896&&i!==(i="text-xs px-2 py-1 rounded-full border transition-colors font-mono "+(e[15]===e[109].instance?"bg-blue-700 border-blue-500 text-white":"border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"))&&s(t,"class",i)},d(c){c&&D(t),l=!1,o()}}}function R2(e){let t,n,r,i,l,o,a,c,f,d=e[13]+1+"",h,p,g=Math.min(e[13]+Qn,e[9])+"",m,_,v=dt(e[9])+"",y,w,C,x,A,M,L,I,P,z,R,T,N=Be(e[8]),k=[];for(let j=0;j<N.length;j+=1)k[j]=sc(Uu(e,N,j));return{c(){t=b("div"),n=b("table"),r=b("thead"),r.innerHTML='<tr class="text-gray-400 uppercase text-[10px]"><th class="text-left px-4 py-2.5">Page</th> <th class="text-right px-3 py-2.5 w-24">Phrases</th> <th class="text-right px-3 py-2.5 w-24">Approved</th> <th class="text-right px-3 py-2.5 w-20">Coverage</th> <th class="px-3 py-2.5 w-10"></th></tr>',i=E(),l=b("tbody");for(let j=0;j<k.length;j+=1)k[j].c();o=E(),a=b("div"),c=b("span"),f=B("Showing "),h=B(d),p=B("–"),m=B(g),_=B(" of "),y=B(v),w=E(),C=b("div"),x=b("button"),A=B("← Prev"),L=E(),I=b("button"),P=B("Next →"),s(r,"class","border-b border-gray-700 bg-gray-850"),s(n,"class","w-full text-xs"),s(t,"class","bg-gray-800 border border-gray-700 rounded-xl overflow-hidden"),s(x,"class","px-3 py-1 rounded bg-gray-800 border border-gray-700 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300"),x.disabled=M=e[13]===0,s(I,"class","px-3 py-1 rounded bg-gray-800 border border-gray-700 hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed text-gray-300"),I.disabled=z=e[13]+Qn>=e[9],s(C,"class","flex gap-2"),s(a,"class","flex items-center justify-between text-xs text-gray-500")},m(j,J){F(j,t,J),u(t,n),u(n,r),u(n,i),u(n,l);for(let W=0;W<k.length;W+=1)k[W]&&k[W].m(l,null);F(j,o,J),F(j,a,J),u(a,c),u(c,f),u(c,h),u(c,p),u(c,m),u(c,_),u(c,y),u(a,w),u(a,C),u(C,x),u(x,A),u(C,L),u(C,I),u(I,P),R||(T=[$(x,"click",e[44]),$(I,"click",e[45])],R=!0)},p(j,J){if(J[0]&33489199|J[1]&1012){N=Be(j[8]);let W;for(W=0;W<N.length;W+=1){const G=Uu(j,N,W);k[W]?k[W].p(G,J):(k[W]=sc(G),k[W].c(),k[W].m(l,null))}for(;W<k.length;W+=1)k[W].d(1);k.length=N.length}J[0]&8192&&d!==(d=j[13]+1+"")&&ee(h,d),J[0]&8704&&g!==(g=Math.min(j[13]+Qn,j[9])+"")&&ee(m,g),J[0]&512&&v!==(v=dt(j[9])+"")&&ee(y,v),J[0]&8192&&M!==(M=j[13]===0)&&(x.disabled=M),J[0]&8704&&z!==(z=j[13]+Qn>=j[9])&&(I.disabled=z)},d(j){j&&(D(t),D(o),D(a)),ft(k,j),R=!1,lt(T)}}}function j2(e){let t;return{c(){t=b("div"),t.textContent="No pages match your filter",s(t,"class","text-center py-10 text-gray-500 text-xs")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function O2(e){let t;return{c(){t=b("div"),t.textContent="Loading…",s(t,"class","text-center py-10 text-gray-500 text-xs")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function $u(e){let t,n,r;function i(a,c){if(a[17])return H2;if(a[0])return U2}let l=i(e),o=l&&l(e);return{c(){t=b("tr"),n=b("td"),o&&o.c(),r=E(),s(n,"colspan","5"),s(n,"class","px-4 pb-4 pt-3 border-b border-indigo-900"),s(t,"class","bg-gray-900/80")},m(a,c){F(a,t,c),u(t,n),o&&o.m(n,null),u(t,r)},p(a,c){l===(l=i(a))&&o?o.p(a,c):(o&&o.d(1),o=l&&l(a),o&&(o.c(),o.m(n,null)))},d(a){a&&D(t),o&&o.d()}}}function U2(e){let t,n,r,i=dt(e[0].totalPhrases)+"",l,o,a,c,f=dt(e[0].approved)+"",d,h,p,g,m=dt(e[0].pending)+"",_,v,y,w,C,x,A,M,L,I,P,z,R,T,N,k,j,J=e[21]?"Queued…":`Translate all pending (${dt(e[0].pending)})`,W,G,Z,ne,O,Y,re,K,X,fe,ye,Ie,le,ve,se,te,Se,S,ie,q,H,U,V,ae,ce,Q=e[33].length+"",de,ge,he=e[0].topPhrases.length+"",xe,Re,we=e[0].topPhrases.length===200?"(200 max)":"",Me,ze,Ee,Ge,oe,Fe,me,Ae=Be(e[5]),Ue=[];for(let ke=0;ke<Ae.length;ke+=1)Ue[ke]=ec(Zu(e,Ae,ke));let Ce=e[20].size>0&&tc(e),Te=e[22]&&nc(e),et=Be(e[33]),Xe=[];for(let ke=0;ke<et.length;ke+=1)Xe[ke]=lc(Hu(e,et,ke));let Le=null;et.length||(Le=rc());let Ye=e[0].topPhrases.length===200&&oc();return{c(){t=b("div"),n=b("div"),r=b("span"),l=B(i),o=B(" total"),a=E(),c=b("span"),d=B(f),h=B(" approved"),p=E(),g=b("span"),_=B(m),v=B(" pending"),y=E(),w=b("a"),C=pe("svg"),x=pe("path"),A=B(`
|
|
65
|
+
Open Page`),M=E(),L=b("div"),I=pe("svg"),P=pe("path"),z=E(),R=b("span"),R.textContent="Translate to",T=E(),N=b("select");for(let ke=0;ke<Ue.length;ke+=1)Ue[ke].c();k=E(),j=b("button"),W=B(J),Z=E(),Ce&&Ce.c(),ne=E(),Te&&Te.c(),O=E(),Y=b("div"),re=b("div"),K=b("input"),fe=E(),ye=b("button"),Ie=B(".*"),ve=E(),se=b("select"),te=b("option"),te.textContent="All",Se=b("option"),Se.textContent="Pending",S=b("option"),S.textContent="Approved",ie=E(),q=b("label"),H=b("input"),V=B(`
|
|
66
|
+
All`),ae=E(),ce=b("span"),de=B(Q),ge=B("/"),xe=B(he),Re=E(),Me=B(we),ze=E(),Ee=b("div");for(let ke=0;ke<Xe.length;ke+=1)Xe[ke].c();Le&&Le.c(),Ge=E(),Ye&&Ye.c(),oe=xt(),s(r,"class","bg-gray-800 rounded px-2 py-1 text-[10px] font-mono text-gray-400"),s(c,"class","bg-emerald-900/50 rounded px-2 py-1 text-[10px] font-mono text-emerald-400"),s(g,"class","bg-yellow-900/50 rounded px-2 py-1 text-[10px] font-mono text-yellow-400"),s(n,"class","flex gap-2 shrink-0"),s(x,"d","M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-3M9 2h5m0 0v5m0-5L7 9"),s(x,"stroke-linecap","round"),s(x,"stroke-linejoin","round"),s(C,"viewBox","0 0 16 16"),s(C,"fill","none"),s(C,"class","w-3 h-3"),s(C,"stroke","currentColor"),s(C,"stroke-width","2"),s(w,"href",e[16]),s(w,"target","_blank"),s(w,"rel","noopener noreferrer"),s(w,"class","ml-auto flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-medium shrink-0 transition-colors"),s(t,"class","flex items-center gap-3 mb-3"),s(P,"d","M12 2L13.5 7.5L19 9L13.5 10.5L12 16L10.5 10.5L5 9L10.5 7.5Z"),s(P,"fill","#FFB833"),s(I,"viewBox","0 0 24 24"),s(I,"width","14"),s(I,"height","14"),s(I,"xmlns","http://www.w3.org/2000/svg"),s(I,"class","shrink-0"),s(R,"class","text-xs text-gray-400 shrink-0"),s(N,"class","bg-gray-700 border border-gray-600 rounded px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-indigo-500"),e[18]===void 0&&Dt(()=>e[58].call(N)),s(j,"class","px-3 py-1 text-xs rounded-lg bg-yellow-600 hover:bg-yellow-500 text-white font-medium transition-colors disabled:opacity-40"),j.disabled=G=e[21]||e[0].pending===0,s(L,"class","flex items-center gap-2 mb-3 p-2.5 bg-gray-800 rounded-lg border border-gray-700"),s(K,"class",X="w-full bg-gray-800 border rounded px-2.5 py-1.5 pr-16 text-xs text-gray-200 placeholder-gray-500 focus:outline-none "+(e[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500")),s(K,"placeholder","Search phrases… (supports regex)"),s(ye,"class",le="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(e[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600")),s(ye,"title","Toggle regex mode"),s(re,"class","flex-1 flex items-center relative"),te.__value="",De(te,te.__value),Se.__value="pending",De(Se,Se.__value),S.__value="approved",De(S,S.__value),s(se,"class","bg-gray-800 border border-gray-700 rounded px-2 py-1.5 text-xs text-gray-400 focus:outline-none"),e[3]===void 0&&Dt(()=>e[64].call(se)),s(H,"type","checkbox"),H.checked=U=e[20].size>0&&e[33].length>0&&e[33].every(e[66]),s(H,"class","accent-indigo-500"),s(q,"class","flex items-center gap-1.5 text-xs text-gray-400 cursor-pointer select-none shrink-0"),s(ce,"class","text-[10px] text-gray-600 shrink-0 whitespace-nowrap"),s(Y,"class","flex items-center gap-2 mb-2"),s(Ee,"class","max-h-72 overflow-y-auto space-y-0.5 pr-1")},m(ke,qe){F(ke,t,qe),u(t,n),u(n,r),u(r,l),u(r,o),u(n,a),u(n,c),u(c,d),u(c,h),u(n,p),u(n,g),u(g,_),u(g,v),u(t,y),u(t,w),u(w,C),u(C,x),u(w,A),F(ke,M,qe),F(ke,L,qe),u(L,I),u(I,P),u(L,z),u(L,R),u(L,T),u(L,N);for(let tt=0;tt<Ue.length;tt+=1)Ue[tt]&&Ue[tt].m(N,null);vt(N,e[18],!0),u(L,k),u(L,j),u(j,W),u(L,Z),Ce&&Ce.m(L,null),u(L,ne),Te&&Te.m(L,null),F(ke,O,qe),F(ke,Y,qe),u(Y,re),u(re,K),De(K,e[1]),u(re,fe),u(re,ye),u(ye,Ie),u(Y,ve),u(Y,se),u(se,te),u(se,Se),u(se,S),vt(se,e[3],!0),u(Y,ie),u(Y,q),u(q,H),u(q,V),u(Y,ae),u(Y,ce),u(ce,de),u(ce,ge),u(ce,xe),u(ce,Re),u(ce,Me),F(ke,ze,qe),F(ke,Ee,qe);for(let tt=0;tt<Xe.length;tt+=1)Xe[tt]&&Xe[tt].m(Ee,null);Le&&Le.m(Ee,null),F(ke,Ge,qe),Ye&&Ye.m(ke,qe),F(ke,oe,qe),Fe||(me=[$(N,"change",e[58]),$(j,"click",e[59]),$(K,"input",e[61]),$(K,"input",e[62]),$(ye,"click",e[63]),$(se,"change",e[64]),$(se,"change",e[65]),$(H,"change",e[38])],Fe=!0)},p(ke,qe){if(qe[0]&1&&i!==(i=dt(ke[0].totalPhrases)+"")&&ee(l,i),qe[0]&1&&f!==(f=dt(ke[0].approved)+"")&&ee(d,f),qe[0]&1&&m!==(m=dt(ke[0].pending)+"")&&ee(_,m),qe[0]&65536&&s(w,"href",ke[16]),qe[0]&32){Ae=Be(ke[5]);let tt;for(tt=0;tt<Ae.length;tt+=1){const yt=Zu(ke,Ae,tt);Ue[tt]?Ue[tt].p(yt,qe):(Ue[tt]=ec(yt),Ue[tt].c(),Ue[tt].m(N,null))}for(;tt<Ue.length;tt+=1)Ue[tt].d(1);Ue.length=Ae.length}if(qe[0]&262176&&vt(N,ke[18]),qe[0]&2097153&&J!==(J=ke[21]?"Queued…":`Translate all pending (${dt(ke[0].pending)})`)&&ee(W,J),qe[0]&2097153&&G!==(G=ke[21]||ke[0].pending===0)&&(j.disabled=G),ke[20].size>0?Ce?Ce.p(ke,qe):(Ce=tc(ke),Ce.c(),Ce.m(L,ne)):Ce&&(Ce.d(1),Ce=null),ke[22]?Te?Te.p(ke,qe):(Te=nc(ke),Te.c(),Te.m(L,null)):Te&&(Te.d(1),Te=null),qe[0]&524288&&X!==(X="w-full bg-gray-800 border rounded px-2.5 py-1.5 pr-16 text-xs text-gray-200 placeholder-gray-500 focus:outline-none "+(ke[19]?"border-red-500 focus:border-red-500":"border-gray-700 focus:border-indigo-500"))&&s(K,"class",X),qe[0]&2&&K.value!==ke[1]&&De(K,ke[1]),qe[0]&4&&le!==(le="absolute right-1.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold transition-colors "+(ke[2]?"bg-indigo-600 text-white":"bg-gray-700 text-gray-400 hover:bg-gray-600"))&&s(ye,"class",le),qe[0]&8&&vt(se,ke[3]),qe[0]&1048576|qe[1]&4&&U!==(U=ke[20].size>0&&ke[33].length>0&&ke[33].every(ke[66]))&&(H.checked=U),qe[1]&4&&Q!==(Q=ke[33].length+"")&&ee(de,Q),qe[0]&1&&he!==(he=ke[0].topPhrases.length+"")&&ee(xe,he),qe[0]&1&&we!==(we=ke[0].topPhrases.length===200?"(200 max)":"")&&ee(Me,we),qe[0]&1310720|qe[1]&836){et=Be(ke[33]);let tt;for(tt=0;tt<et.length;tt+=1){const yt=Hu(ke,et,tt);Xe[tt]?Xe[tt].p(yt,qe):(Xe[tt]=lc(yt),Xe[tt].c(),Xe[tt].m(Ee,null))}for(;tt<Xe.length;tt+=1)Xe[tt].d(1);Xe.length=et.length,!et.length&&Le?Le.p(ke,qe):et.length?Le&&(Le.d(1),Le=null):(Le=rc(),Le.c(),Le.m(Ee,null))}ke[0].topPhrases.length===200?Ye||(Ye=oc(),Ye.c(),Ye.m(oe.parentNode,oe)):Ye&&(Ye.d(1),Ye=null)},d(ke){ke&&(D(t),D(M),D(L),D(O),D(Y),D(ze),D(Ee),D(Ge),D(oe)),ft(Ue,ke),Ce&&Ce.d(),Te&&Te.d(),ft(Xe,ke),Le&&Le.d(),Ye&&Ye.d(ke),Fe=!1,lt(me)}}}function H2(e){let t;return{c(){t=b("p"),t.textContent="Loading…",s(t,"class","text-gray-500 text-xs py-6 text-center")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function ec(e){let t,n=e[88].lang+"",r,i;return{c(){t=b("option"),r=B(n),t.__value=i=e[88].lang,De(t,t.__value)},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&32&&n!==(n=l[88].lang+"")&&ee(r,n),o[0]&32&&i!==(i=l[88].lang)&&(t.__value=i,De(t,t.__value))},d(l){l&&D(t)}}}function tc(e){let t,n,r=e[20].size+"",i,l,o,a;return{c(){t=b("button"),n=B("Translate selected ("),i=B(r),l=B(")"),s(t,"class","px-3 py-1 text-xs rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white font-medium transition-colors")},m(c,f){F(c,t,f),u(t,n),u(t,i),u(t,l),o||(a=$(t,"click",e[60]),o=!0)},p(c,f){f[0]&1048576&&r!==(r=c[20].size+"")&&ee(i,r)},d(c){c&&D(t),o=!1,a()}}}function nc(e){let t,n=e[22].text+"",r,i;return{c(){t=b("span"),r=B(n),s(t,"class",i="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400")+" ml-1")},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&4194304&&n!==(n=l[22].text+"")&&ee(r,n),o[0]&4194304&&i!==(i="text-xs "+(l[22].ok?"text-emerald-400":"text-red-400")+" ml-1")&&s(t,"class",i)},d(l){l&&D(t)}}}function rc(e){let t;return{c(){t=b("p"),t.textContent="No phrases match",s(t,"class","text-gray-500 text-xs text-center py-6")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function ic(e){let t,n=e[104].context+"",r;return{c(){t=b("div"),r=B(n),s(t,"class","text-gray-500 text-[10px] mt-0.5 break-words whitespace-normal leading-snug")},m(i,l){F(i,t,l),u(t,r)},p(i,l){l[1]&4&&n!==(n=i[104].context+"")&&ee(r,n)},d(i){i&&D(t)}}}function lc(e){let t,n,r,i,l,o=e[104].status[0].toUpperCase()+"",a,c,f,d,h,p=e[104].key+"",g,m,_,v,y,w,C,x,A,M,L;function I(){return e[67](e[104])}function P(){return e[68](e[104])}let z=e[104].context&&ic(e);function R(){return e[69](e[104])}return{c(){t=b("div"),n=b("input"),i=E(),l=b("span"),a=B(o),f=E(),d=b("div"),h=b("button"),g=B(p),m=E(),z&&z.c(),_=E(),v=b("button"),y=pe("svg"),w=pe("path"),x=E(),s(n,"type","checkbox"),n.checked=r=e[20].has(e[104].id),s(n,"class","mt-0.5 accent-indigo-500 shrink-0 cursor-pointer"),s(l,"class",c="shrink-0 px-1 rounded text-[9px] font-medium mt-0.5 "+(e[104].status==="approved"?"bg-emerald-900 text-emerald-300":e[104].status==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300")),s(h,"class","font-mono text-gray-300 text-[11px] text-left hover:text-indigo-300 w-full break-words whitespace-normal leading-snug"),s(d,"class","flex-1 min-w-0"),s(w,"d","M8 1l1.5 4.5H14l-3.7 2.7 1.4 4.3L8 9.8l-3.7 2.7 1.4-4.3L2 5.5h4.5z"),s(y,"viewBox","0 0 16 16"),s(y,"fill","currentColor"),s(y,"class","w-3 h-3"),s(v,"class","shrink-0 p-0.5 rounded text-gray-600 hover:text-yellow-400 opacity-0 group-hover:opacity-100 transition-all"),s(v,"title",C="Queue AI translation → "+e[18]),s(t,"class",A="flex items-start gap-1.5 px-2 py-1.5 rounded group "+(e[20].has(e[104].id)?"bg-indigo-950/50":"hover:bg-gray-800/60"))},m(T,N){F(T,t,N),u(t,n),u(t,i),u(t,l),u(l,a),u(t,f),u(t,d),u(d,h),u(h,g),u(d,m),z&&z.m(d,null),u(t,_),u(t,v),u(v,y),u(y,w),u(t,x),M||(L=[$(n,"change",I),$(h,"click",P),$(v,"click",Bt(R))],M=!0)},p(T,N){e=T,N[0]&1048576|N[1]&4&&r!==(r=e[20].has(e[104].id))&&(n.checked=r),N[1]&4&&o!==(o=e[104].status[0].toUpperCase()+"")&&ee(a,o),N[1]&4&&c!==(c="shrink-0 px-1 rounded text-[9px] font-medium mt-0.5 "+(e[104].status==="approved"?"bg-emerald-900 text-emerald-300":e[104].status==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&s(l,"class",c),N[1]&4&&p!==(p=e[104].key+"")&&ee(g,p),e[104].context?z?z.p(e,N):(z=ic(e),z.c(),z.m(d,null)):z&&(z.d(1),z=null),N[0]&262176&&C!==(C="Queue AI translation → "+e[18])&&s(v,"title",C),N[0]&1048576|N[1]&4&&A!==(A="flex items-start gap-1.5 px-2 py-1.5 rounded group "+(e[20].has(e[104].id)?"bg-indigo-950/50":"hover:bg-gray-800/60"))&&s(t,"class",A)},d(T){T&&D(t),z&&z.d(),M=!1,lt(L)}}}function oc(e){let t;return{c(){t=b("p"),t.textContent="Showing first 200 — refine with search or status filter",s(t,"class","text-[10px] text-gray-600 mt-1 text-center")},m(n,r){F(n,t,r)},d(n){n&&D(t)}}}function sc(e){let t,n,r,i,l=e[100].label+"",o,a,c,f,d,h=_c(e[99].url)+"",p,g,m,_=mc(e[99].url)+"",v,y,w,C,x=dt(e[99].phraseCount)+"",A,M,L,I=dt(e[99].approved)+"",P,z,R,T,N=e[101]+"",k,j,J,W,G,Z,ne,O,Y,re,K,X,fe,ye;function Ie(){return e[57](e[99])}let le=e[16]===e[99].url&&$u(e);return{c(){t=b("tr"),n=b("td"),r=b("div"),i=b("span"),o=B(l),c=E(),f=b("div"),d=b("div"),p=B(h),g=E(),m=b("div"),v=B(_),w=E(),C=b("td"),A=B(x),M=E(),L=b("td"),P=B(I),z=E(),R=b("td"),T=b("span"),k=B(N),j=B("%"),W=E(),G=b("td"),Z=b("a"),ne=pe("svg"),O=pe("path"),K=E(),le&&le.c(),X=xt(),s(i,"class",a="text-[10px] font-medium "+e[100].color+" shrink-0"),s(d,"class","text-gray-500 text-[10px] truncate"),s(m,"class","font-mono text-gray-300 truncate max-w-sm"),s(m,"title",y=e[99].url),s(f,"class","min-w-0"),s(r,"class","flex items-center gap-2 min-w-0"),s(n,"class","px-4 py-2.5"),s(C,"class","px-3 py-2.5 text-right font-mono text-gray-200"),s(L,"class","px-3 py-2.5 text-right font-mono text-emerald-400"),s(T,"class",J="px-1.5 py-0.5 rounded-full text-[10px] font-medium "+(e[101]===100?"bg-emerald-900/60 text-emerald-300":e[101]>0?"bg-indigo-900/60 text-indigo-300":"bg-gray-700 text-gray-500")),s(R,"class","px-3 py-2.5 text-right"),s(O,"d","M6 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-3M9 2h5m0 0v5m0-5L7 9"),s(O,"stroke-linecap","round"),s(O,"stroke-linejoin","round"),s(ne,"viewBox","0 0 16 16"),s(ne,"fill","none"),s(ne,"class","w-3.5 h-3.5"),s(ne,"stroke","currentColor"),s(ne,"stroke-width","1.5"),s(Z,"href",Y=e[99].url),s(Z,"target","_blank"),s(Z,"rel","noopener noreferrer"),s(Z,"title","Open page"),s(Z,"class","flex items-center justify-center w-6 h-6 rounded text-gray-500 hover:text-indigo-400 hover:bg-gray-600 transition-colors"),s(G,"class","px-3 py-2.5"),s(t,"class",re="border-b border-gray-700/40 hover:bg-gray-700/60 cursor-pointer transition-colors "+(e[16]===e[99].url?"bg-indigo-950 border-indigo-800":""))},m(ve,se){F(ve,t,se),u(t,n),u(n,r),u(r,i),u(i,o),u(r,c),u(r,f),u(f,d),u(d,p),u(f,g),u(f,m),u(m,v),u(t,w),u(t,C),u(C,A),u(t,M),u(t,L),u(L,P),u(t,z),u(t,R),u(R,T),u(T,k),u(T,j),u(t,W),u(t,G),u(G,Z),u(Z,ne),u(ne,O),F(ve,K,se),le&&le.m(ve,se),F(ve,X,se),fe||(ye=[$(Z,"click",Bt(e[47])),$(t,"click",Ie)],fe=!0)},p(ve,se){e=ve,se[0]&256&&l!==(l=e[100].label+"")&&ee(o,l),se[0]&256&&a!==(a="text-[10px] font-medium "+e[100].color+" shrink-0")&&s(i,"class",a),se[0]&256&&h!==(h=_c(e[99].url)+"")&&ee(p,h),se[0]&256&&_!==(_=mc(e[99].url)+"")&&ee(v,_),se[0]&256&&y!==(y=e[99].url)&&s(m,"title",y),se[0]&256&&x!==(x=dt(e[99].phraseCount)+"")&&ee(A,x),se[0]&256&&I!==(I=dt(e[99].approved)+"")&&ee(P,I),se[0]&256&&N!==(N=e[101]+"")&&ee(k,N),se[0]&256&&J!==(J="px-1.5 py-0.5 rounded-full text-[10px] font-medium "+(e[101]===100?"bg-emerald-900/60 text-emerald-300":e[101]>0?"bg-indigo-900/60 text-indigo-300":"bg-gray-700 text-gray-500"))&&s(T,"class",J),se[0]&256&&Y!==(Y=e[99].url)&&s(Z,"href",Y),se[0]&65792&&re!==(re="border-b border-gray-700/40 hover:bg-gray-700/60 cursor-pointer transition-colors "+(e[16]===e[99].url?"bg-indigo-950 border-indigo-800":""))&&s(t,"class",re),e[16]===e[99].url?le?le.p(e,se):(le=$u(e),le.c(),le.m(X.parentNode,X)):le&&(le.d(1),le=null)},d(ve){ve&&(D(t),D(K),D(X)),le&&le.d(ve),fe=!1,lt(ye)}}}function ac(e){let t,n,r,i,l,o,a=dt(e[4].trashPhrases)+"",c;return{c(){t=b("div"),n=b("span"),r=E(),i=b("span"),i.textContent="Trash",l=E(),o=b("span"),c=B(a),s(n,"class","w-2.5 h-2.5 rounded-full bg-red-500 shrink-0"),s(i,"class","text-gray-400"),s(o,"class","ml-auto font-mono text-gray-200"),s(t,"class","flex items-center gap-2 text-xs")},m(f,d){F(f,t,d),u(t,n),u(t,r),u(t,i),u(t,l),u(t,o),u(o,c)},p(f,d){d[0]&16&&a!==(a=dt(f[4].trashPhrases)+"")&&ee(c,a)},d(f){f&&D(t)}}}function uc(e){let t,n=e[96].section+"",r,i,l=hn(e[96].phrases)+"",o,a,c,f,d;function h(){return e[52](e[96])}return{c(){t=b("button"),r=B(n),i=B(" · "),o=B(l),a=E(),s(t,"class",c="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))},m(p,g){F(p,t,g),u(t,r),u(t,i),u(t,o),u(t,a),f||(d=$(t,"click",h),f=!0)},p(p,g){e=p,g[0]&64&&n!==(n=e[96].section+"")&&ee(r,n),g[0]&64&&l!==(l=hn(e[96].phrases)+"")&&ee(o,l),g[0]&16448&&c!==(c="text-xs px-2 py-1 rounded-full border transition-colors "+(e[14]===e[96].section?"bg-indigo-600 border-indigo-500 text-white":"border-gray-600 text-gray-400 hover:border-gray-400 hover:text-gray-200"))&&s(t,"class",c)},d(p){p&&D(t),f=!1,d()}}}function cc(e){var C;let t,n,r,i,l,o=(((C=e[24])==null?void 0:C.status)??e[23].status).toUpperCase()+"",a,c,f,d,h,p,g,m,_;function v(x,A){if(x[25])return W2;if(x[24])return Z2}let y=v(e),w=y&&y(e);return{c(){var x,A;t=b("div"),n=b("div"),r=b("div"),i=b("div"),l=b("span"),a=B(o),f=E(),d=b("h3"),d.textContent="Phrase Detail",h=E(),p=b("button"),p.innerHTML='<svg viewBox="0 0 20 20" fill="currentColor" class="w-4 h-4"><path d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"></path></svg>',g=E(),w&&w.c(),s(l,"class",c="px-2 py-0.5 rounded text-[10px] font-semibold "+((((x=e[24])==null?void 0:x.status)??e[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((A=e[24])==null?void 0:A.status)??e[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300")),s(d,"class","text-sm font-semibold text-white"),s(i,"class","flex items-center gap-2"),s(p,"class","text-gray-500 hover:text-white transition-colors p-1 rounded hover:bg-gray-700"),s(p,"aria-label","Close"),s(r,"class","flex items-center justify-between px-5 py-3.5 border-b border-gray-700 shrink-0"),s(n,"class","bg-gray-900 border border-gray-700 rounded-xl shadow-2xl w-full max-w-3xl max-h-[90vh] flex flex-col overflow-hidden"),s(t,"class","fixed inset-0 bg-black/75 z-50 flex items-center justify-center p-4"),s(t,"role","dialog"),s(t,"aria-modal","true")},m(x,A){F(x,t,A),u(t,n),u(n,r),u(r,i),u(i,l),u(l,a),u(i,f),u(i,d),u(r,h),u(r,p),u(n,g),w&&w.m(n,null),m||(_=[$(p,"click",e[71]),$(t,"click",Rr(e[75]))],m=!0)},p(x,A){var M,L,I;A[0]&25165824&&o!==(o=(((M=x[24])==null?void 0:M.status)??x[23].status).toUpperCase()+"")&&ee(a,o),A[0]&25165824&&c!==(c="px-2 py-0.5 rounded text-[10px] font-semibold "+((((L=x[24])==null?void 0:L.status)??x[23].status)==="approved"?"bg-emerald-900 text-emerald-300":(((I=x[24])==null?void 0:I.status)??x[23].status)==="trash"?"bg-red-900 text-red-300":"bg-yellow-900 text-yellow-300"))&&s(l,"class",c),y===(y=v(x))&&w?w.p(x,A):(w&&w.d(1),w=y&&y(x),w&&(w.c(),w.m(n,null)))},d(x){x&&D(t),w&&w.d(),m=!1,lt(_)}}}function Z2(e){let t,n,r,i,l,o,a=e[24].key+"",c,f,d,h,p,g=(e[24].context||"—")+"",m,_,v,y,w,C=e[24].status+"",x,A,M,L,I,P=(e[24].created_at||"—")+"",z,R,T,N,k,j,J,W,G,Z,ne,O=e[21]?"Queuing…":`★ AI Translate → ${e[18]}`,Y,re,K,X,fe,ye,Ie,le,ve,se,te,Se,S,ie=e[24].translations.length+"",q,H,U=e[24].translations.length!==1?"s":"",V,ae,ce,Q,de,ge,he;function xe(Le,Ye){return Le[24].url?G2:Y2}let Re=xe(e),we=Re(e),Me=Be(e[5]),ze=[];for(let Le=0;Le<Me.length;Le+=1)ze[Le]=fc(ju(e,Me,Le));let Ee=e[22]&&dc(e);function Ge(Le,Ye){return Le[24].url?X2:V2}let oe=Ge(e),Fe=oe(e);function me(Le,Ye){return Le[24].translations.length<Le[5].length?e_:$2}let Ae=me(e),Ue=Ae(e);function Ce(Le,Ye){return Le[24].translations.length===0?n_:t_}let Te=Ce(e),et=Te(e),Xe=e[5].length>e[24].translations.length&&pc(kl(e));return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("span"),i.textContent="Key",l=E(),o=b("span"),c=B(a),f=E(),d=b("span"),d.textContent="DomContext",h=E(),p=b("span"),m=B(g),_=E(),v=b("span"),v.textContent="Status",y=E(),w=b("span"),x=B(C),A=E(),M=b("span"),M.textContent="Discovered",L=E(),I=b("span"),z=B(P),R=E(),T=b("span"),T.textContent="Source URL",N=E(),we.c(),k=E(),j=b("span"),j.textContent="Translate",J=E(),W=b("div"),G=b("select");for(let Le=0;Le<ze.length;Le+=1)ze[Le].c();Z=E(),ne=b("button"),Y=B(O),re=E(),Ee&&Ee.c(),K=E(),X=b("div"),fe=b("p"),fe.textContent="Page Screenshot",ye=E(),Fe.c(),Ie=E(),le=b("div"),ve=b("div"),se=b("h4"),te=B(`Translations
|
|
67
|
+
`),Se=b("span"),S=B("("),q=B(ie),H=B(" language"),V=B(U),ae=B(")"),ce=E(),Ue.c(),Q=E(),et.c(),de=E(),Xe&&Xe.c(),s(i,"class","text-gray-400 font-medium pt-0.5"),s(o,"class","font-mono text-white break-all leading-relaxed"),s(d,"class","text-gray-400 font-medium pt-0.5"),s(p,"class","text-gray-300 break-all"),s(v,"class","text-gray-400 font-medium pt-0.5"),s(w,"class","text-gray-300"),s(M,"class","text-gray-400 font-medium pt-0.5"),s(I,"class","text-gray-300"),s(T,"class","text-gray-400 font-medium pt-0.5"),s(j,"class","text-gray-400 font-medium pt-0.5"),s(G,"class","bg-gray-800 border border-gray-600 rounded px-2 py-1 text-xs text-gray-200 focus:outline-none focus:border-indigo-500"),e[18]===void 0&&Dt(()=>e[72].call(G)),s(ne,"class","px-3 py-1 text-xs rounded-lg bg-yellow-600 hover:bg-yellow-500 text-white font-medium transition-colors disabled:opacity-40"),ne.disabled=e[21],s(W,"class","flex items-center gap-2 flex-wrap"),s(r,"class","flex-1 p-5 grid grid-cols-[100px_1fr] gap-x-4 gap-y-3 text-sm content-start"),s(fe,"class","text-xs text-gray-400 font-medium"),s(X,"class","w-72 shrink-0 p-4 flex flex-col gap-2"),s(n,"class","flex gap-0 divide-x divide-gray-700"),s(Se,"class","ml-1 text-gray-600 font-normal normal-case"),s(se,"class","text-xs font-semibold text-gray-400 uppercase tracking-wide"),s(ve,"class","flex items-center justify-between mb-3"),s(le,"class","border-t border-gray-700 px-5 py-4"),s(t,"class","overflow-y-auto flex-1")},m(Le,Ye){F(Le,t,Ye),u(t,n),u(n,r),u(r,i),u(r,l),u(r,o),u(o,c),u(r,f),u(r,d),u(r,h),u(r,p),u(p,m),u(r,_),u(r,v),u(r,y),u(r,w),u(w,x),u(r,A),u(r,M),u(r,L),u(r,I),u(I,z),u(r,R),u(r,T),u(r,N),we.m(r,null),u(r,k),u(r,j),u(r,J),u(r,W),u(W,G);for(let ke=0;ke<ze.length;ke+=1)ze[ke]&&ze[ke].m(G,null);vt(G,e[18],!0),u(W,Z),u(W,ne),u(ne,Y),u(W,re),Ee&&Ee.m(W,null),u(n,K),u(n,X),u(X,fe),u(X,ye),Fe.m(X,null),u(t,Ie),u(t,le),u(le,ve),u(ve,se),u(se,te),u(se,Se),u(Se,S),u(Se,q),u(Se,H),u(Se,V),u(Se,ae),u(ve,ce),Ue.m(ve,null),u(le,Q),et.m(le,null),u(le,de),Xe&&Xe.m(le,null),ge||(he=[$(G,"change",e[72]),$(ne,"click",e[73])],ge=!0)},p(Le,Ye){if(Ye[0]&16777216&&a!==(a=Le[24].key+"")&&ee(c,a),Ye[0]&16777216&&g!==(g=(Le[24].context||"—")+"")&&ee(m,g),Ye[0]&16777216&&C!==(C=Le[24].status+"")&&ee(x,C),Ye[0]&16777216&&P!==(P=(Le[24].created_at||"—")+"")&&ee(z,P),Re===(Re=xe(Le))&&we?we.p(Le,Ye):(we.d(1),we=Re(Le),we&&(we.c(),we.m(r,k))),Ye[0]&32){Me=Be(Le[5]);let ke;for(ke=0;ke<Me.length;ke+=1){const qe=ju(Le,Me,ke);ze[ke]?ze[ke].p(qe,Ye):(ze[ke]=fc(qe),ze[ke].c(),ze[ke].m(G,null))}for(;ke<ze.length;ke+=1)ze[ke].d(1);ze.length=Me.length}Ye[0]&262176&&vt(G,Le[18]),Ye[0]&2359296&&O!==(O=Le[21]?"Queuing…":`★ AI Translate → ${Le[18]}`)&&ee(Y,O),Ye[0]&2097152&&(ne.disabled=Le[21]),Le[22]?Ee?Ee.p(Le,Ye):(Ee=dc(Le),Ee.c(),Ee.m(W,null)):Ee&&(Ee.d(1),Ee=null),oe===(oe=Ge(Le))&&Fe?Fe.p(Le,Ye):(Fe.d(1),Fe=oe(Le),Fe&&(Fe.c(),Fe.m(X,null))),Ye[0]&16777216&&ie!==(ie=Le[24].translations.length+"")&&ee(q,ie),Ye[0]&16777216&&U!==(U=Le[24].translations.length!==1?"s":"")&&ee(V,U),Ae===(Ae=me(Le))&&Ue?Ue.p(Le,Ye):(Ue.d(1),Ue=Ae(Le),Ue&&(Ue.c(),Ue.m(ve,null))),Te===(Te=Ce(Le))&&et?et.p(Le,Ye):(et.d(1),et=Te(Le),et&&(et.c(),et.m(le,de))),Le[5].length>Le[24].translations.length?Xe?Xe.p(kl(Le),Ye):(Xe=pc(kl(Le)),Xe.c(),Xe.m(le,null)):Xe&&(Xe.d(1),Xe=null)},d(Le){Le&&D(t),we.d(),ft(ze,Le),Ee&&Ee.d(),Fe.d(),Ue.d(),et.d(),Xe&&Xe.d(),ge=!1,lt(he)}}}function W2(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin w-6 h-6 text-indigo-500" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" opacity=".25"></circle><path d="M22 12A10 10 0 0 0 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>',s(t,"class","flex items-center justify-center py-16")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Y2(e){let t;return{c(){t=b("span"),t.textContent="—",s(t,"class","text-gray-500")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function G2(e){let t,n=e[24].url+"",r,i;return{c(){t=b("a"),r=B(n),s(t,"href",i=e[24].url),s(t,"target","_blank"),s(t,"rel","noopener noreferrer"),s(t,"class","text-indigo-400 hover:text-indigo-300 hover:underline break-all text-xs")},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&16777216&&n!==(n=l[24].url+"")&&ee(r,n),o[0]&16777216&&i!==(i=l[24].url)&&s(t,"href",i)},d(l){l&&D(t)}}}function fc(e){let t,n=e[88].lang+"",r,i;return{c(){t=b("option"),r=B(n),t.__value=i=e[88].lang,De(t,t.__value)},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&32&&n!==(n=l[88].lang+"")&&ee(r,n),o[0]&32&&i!==(i=l[88].lang)&&(t.__value=i,De(t,t.__value))},d(l){l&&D(t)}}}function dc(e){let t,n=e[22].text+"",r,i;return{c(){t=b("span"),r=B(n),s(t,"class",i="text-xs "+(e[22].ok?"text-emerald-400":"text-red-400"))},m(l,o){F(l,t,o),u(t,r)},p(l,o){o[0]&4194304&&n!==(n=l[22].text+"")&&ee(r,n),o[0]&4194304&&i!==(i="text-xs "+(l[22].ok?"text-emerald-400":"text-red-400"))&&s(t,"class",i)},d(l){l&&D(t)}}}function V2(e){let t;return{c(){t=b("div"),t.textContent="No URL",s(t,"class","flex-1 rounded border border-gray-700 bg-gray-800 flex items-center justify-center text-xs text-gray-500"),mt(t,"min-height","140px")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function X2(e){let t;function n(l,o){return l[26][l[24].url]===void 0?Q2:l[26][l[24].url]===null?K2:l[26][l[24].url]===!1?q2:J2}let r=n(e),i=r(e);return{c(){i.c(),t=xt()},m(l,o){i.m(l,o),F(l,t,o)},p(l,o){r===(r=n(l))&&i?i.p(l,o):(i.d(1),i=r(l),i&&(i.c(),i.m(t.parentNode,t)))},d(l){l&&D(t),i.d(l)}}}function J2(e){let t,n,r,i;return{c(){t=b("a"),n=b("img"),Pi(n.src,r="data:image/jpeg;base64,"+e[26][e[24].url])||s(n,"src",r),s(n,"alt","Page screenshot"),s(n,"class","rounded border border-gray-700 shadow-sm w-full hover:opacity-90 transition-opacity"),s(t,"href",i=e[24].url),s(t,"target","_blank"),s(t,"rel","noopener noreferrer")},m(l,o){F(l,t,o),u(t,n)},p(l,o){o[0]&83886080&&!Pi(n.src,r="data:image/jpeg;base64,"+l[26][l[24].url])&&s(n,"src",r),o[0]&16777216&&i!==(i=l[24].url)&&s(t,"href",i)},d(l){l&&D(t)}}}function q2(e){let t;return{c(){t=b("div"),t.textContent="No screenshot yet",s(t,"class","flex-1 rounded border border-gray-700 bg-gray-800 flex items-center justify-center text-xs text-gray-500"),mt(t,"min-height","140px")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function K2(e){let t;return{c(){t=b("div"),t.innerHTML='<svg class="animate-spin w-5 h-5 text-indigo-500" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" opacity=".25"></circle><path d="M22 12A10 10 0 0 0 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg>',s(t,"class","flex-1 flex items-center justify-center")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function Q2(e){let t=e[34](e[24].url)+"",n,r,i;return{c(){n=B(t),r=E(),i=b("div"),i.textContent="Loading…",s(i,"class","flex-1 flex items-center justify-center text-gray-600 text-xs")},m(l,o){F(l,n,o),F(l,r,o),F(l,i,o)},p(l,o){o[0]&16777216&&t!==(t=l[34](l[24].url)+"")&&ee(n,t)},d(l){l&&(D(n),D(r),D(i))}}}function $2(e){let t;return{c(){t=b("span"),t.textContent="All languages covered",s(t,"class","text-[10px] text-emerald-500")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function e_(e){let t,n=e[5].length-e[24].translations.length+"",r,i,l=e[5].length-e[24].translations.length!==1?"s":"",o,a;return{c(){t=b("span"),r=B(n),i=B(" language"),o=B(l),a=B(" missing"),s(t,"class","text-[10px] text-yellow-500")},m(c,f){F(c,t,f),u(t,r),u(t,i),u(t,o),u(t,a)},p(c,f){f[0]&16777248&&n!==(n=c[5].length-c[24].translations.length+"")&&ee(r,n),f[0]&16777248&&l!==(l=c[5].length-c[24].translations.length!==1?"s":"")&&ee(o,l)},d(c){c&&D(t)}}}function t_(e){let t,n=Be(e[24].translations),r=[];for(let i=0;i<n.length;i+=1)r[i]=hc(Ru(e,n,i));return{c(){t=b("div");for(let i=0;i<r.length;i+=1)r[i].c();s(t,"class","grid grid-cols-1 sm:grid-cols-2 gap-2")},m(i,l){F(i,t,l);for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(t,null)},p(i,l){if(l[0]&16777216){n=Be(i[24].translations);let o;for(o=0;o<n.length;o+=1){const a=Ru(i,n,o);r[o]?r[o].p(a,l):(r[o]=hc(a),r[o].c(),r[o].m(t,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d(i){i&&D(t),ft(r,i)}}}function n_(e){let t;return{c(){t=b("p"),t.textContent="No translations yet for this phrase.",s(t,"class","text-gray-500 text-sm text-center py-6")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function hc(e){let t,n,r=e[91].lang+"",i,l,o,a=e[91].value+"",c,f;return{c(){t=b("div"),n=b("span"),i=B(r),l=E(),o=b("span"),c=B(a),f=E(),s(n,"class","font-mono text-indigo-400 text-xs w-10 shrink-0 pt-0.5"),s(o,"class","text-gray-200 text-sm leading-relaxed break-words min-w-0"),s(t,"class","bg-gray-800 rounded-lg px-3 py-2.5 flex items-start gap-3")},m(d,h){F(d,t,h),u(t,n),u(n,i),u(t,l),u(t,o),u(o,c),u(t,f)},p(d,h){h[0]&16777216&&r!==(r=d[91].lang+"")&&ee(i,r),h[0]&16777216&&a!==(a=d[91].value+"")&&ee(c,a)},d(d){d&&D(t)}}}function pc(e){let t,n,r,i=Be(e[87]),l=[];for(let o=0;o<i.length;o+=1)l[o]=gc(Bu(e,i,o));return{c(){t=b("div"),n=b("span"),n.textContent="Missing:",r=E();for(let o=0;o<l.length;o+=1)l[o].c();s(n,"class","text-[10px] text-gray-500"),s(t,"class","mt-3 flex items-center gap-2 flex-wrap")},m(o,a){F(o,t,a),u(t,n),u(t,r);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(t,null)},p(o,a){if(a[0]&16777248){i=Be(o[87]);let c;for(c=0;c<i.length;c+=1){const f=Bu(o,i,c);l[c]?l[c].p(f,a):(l[c]=gc(f),l[c].c(),l[c].m(t,null))}for(;c<l.length;c+=1)l[c].d(1);l.length=i.length}},d(o){o&&D(t),ft(l,o)}}}function gc(e){let t,n=e[88].lang+"",r;return{c(){t=b("span"),r=B(n),s(t,"class","font-mono text-[10px] px-1.5 py-0.5 rounded bg-gray-800 text-gray-400 border border-gray-700")},m(i,l){F(i,t,l),u(t,r)},p(i,l){l[0]&16777248&&n!==(n=i[88].lang+"")&&ee(r,n)},d(i){i&&D(t)}}}function r_(e){let t,n,r,i,l,o,a,c,f=e[4]&&Xu(e);function d(m,_){return m[10]?z2:P2}let h=d(e),p=h(e),g=e[23]&&cc(e);return{c(){t=b("div"),n=b("div"),r=b("div"),i=b("div"),i.innerHTML='<h2 class="text-xl font-bold text-white">Analytics</h2> <p class="text-gray-500 text-xs mt-0.5">Translation database overview</p>',l=E(),f&&f.c(),o=E(),p.c(),a=E(),g&&g.c(),c=xt(),s(r,"class","flex items-center justify-between"),s(n,"class","space-y-5 text-gray-200 text-sm p-6"),s(t,"class","-m-6 min-h-screen bg-gray-900")},m(m,_){F(m,t,_),u(t,n),u(n,r),u(r,i),u(r,l),f&&f.m(r,null),u(n,o),p.m(n,null),F(m,a,_),g&&g.m(m,_),F(m,c,_)},p(m,_){m[4]?f?f.p(m,_):(f=Xu(m),f.c(),f.m(r,null)):f&&(f.d(1),f=null),h===(h=d(m))&&p?p.p(m,_):(p.d(1),p=h(m),p&&(p.c(),p.m(n,null))),m[23]?g?g.p(m,_):(g=cc(m),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null)},i:je,o:je,d(m){m&&(D(t),D(a),D(c)),f&&f.d(),p.d(),g&&g.d(m)}}}const Qn=50;function dt(e){return e!=null?e.toLocaleString():"—"}function hn(e){return e==null?"—":e>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":String(e)}function mc(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean).pop()||t.pathname,r=t.searchParams,i=[n];return r.get("f")&&i.push(`f=${r.get("f")}`),r.get("s")&&i.push(`s=${r.get("s")}`),r.get("module")&&i.push(`mod=${r.get("module")}`),r.get("func")&&i.push(`func=${r.get("func")}`),i.join(" · ")}catch{return e.length>70?e.slice(0,67)+"…":e}}function _c(e){try{return new URL(e).hostname}catch{return""}}function i_(e){return e.includes("f=chart")?{label:"Chart",color:"text-indigo-400"}:e.includes("f=admin")?{label:"Admin",color:"text-yellow-400"}:e.includes("f=layout")?{label:"Layout",color:"text-emerald-400"}:e.includes("func=")?{label:"Func",color:"text-blue-400"}:{label:"Other",color:"text-purple-400"}}const bc=e=>e.phrases>=100;function l_(e,t,n){let r,i=null,l=[],o=[],a=[],c=[],f=[],d=0,h=!0,p=!1,g="",m=0,_="",v="",y=null,w=null,C=!1,x="",A="",M=!1,L=!1,I="pending",P=new Set,z=!1,R=null,T=null,N=null,k=!1,j={};function J(be){return!be||j[be]!==void 0||(n(26,j[be]=null,j),We(`../api/screenshots?url=${encodeURIComponent(be)}`).then(He=>He.json()).then(He=>{n(26,j[be]=He.screenshot||!1,j),n(26,j)}).catch(()=>{n(26,j[be]=!1,j),n(26,j)})),""}let W="overview",G,Z,ne,O,Y;async function re(){n(10,h=!0);const[be,He,Je,at,wt]=await Promise.all([We("../api/analytics"),We("../api/analytics/languages"),We("../api/analytics/sections"),We("../api/analytics/instances"),We("../api/analytics/activity")]);n(4,[i,l,o,a,c]=await Promise.all([be.json(),He.json(),Je.json(),at.json(),wt.json()]),i,n(5,l),n(6,o),n(7,a)),n(10,h=!1),await Lr(),se()}async function K(){n(11,p=!0);const be=new URLSearchParams({limit:Qn,offset:m});g&&be.set("search",g),_&&be.set("search",_==="chart"?"f=chart":_==="admin"?"f=admin":_==="layout"?"f=layout":_==="func"?"func=":g||""),v&&be.set("search",v);const Je=await(await We(`../api/analytics/urls?${be}`)).json();n(8,f=Je.rows),n(9,d=Je.total),n(11,p=!1)}async function X(be){n(16,y=be),n(0,w=null),n(17,C=!0),n(1,A=""),n(3,I="pending"),n(2,M=!1),n(19,L=!1),n(20,P=new Set),n(22,R=null),n(23,T=null),n(24,N=null);const He=await We(`../api/analytics/url-detail?url=${encodeURIComponent(be)}`);n(0,w=await He.json()),n(17,C=!1),!x&&l.length>0&&n(18,x=l[0].lang)}function fe(){n(16,y=null),n(0,w=null)}function ye(be){const He=new Set(P);He.has(be)?He.delete(be):He.add(be),n(20,P=He)}function Ie(be){const He=new Set(P);be.target.checked?r.forEach(Je=>He.add(Je.id)):r.forEach(Je=>He.delete(Je.id)),n(20,P=He)}async function le(be,He){if(!(!x||!be||be.length===0)){n(21,z=!0),n(22,R=null);try{const Je=await We("../api/ai-jobs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key_ids:be,lang:x})});if(Je.ok)n(22,R={ok:!0,text:`${He} queued for ${x}`}),n(20,P=new Set);else{const at=await Je.json().catch(()=>({}));n(22,R={ok:!1,text:at.message||`Error ${Je.status}`})}}catch(Je){n(22,R={ok:!1,text:Je.message})}finally{n(21,z=!1)}}}async function ve(be){if((T==null?void 0:T.id)===be.id){n(23,T=null),n(24,N=null);return}n(23,T=be),n(24,N=null),n(25,k=!0);try{const He=await We(`../api/analytics/phrase-detail?id=${be.id}`);n(24,N=await He.json())}finally{n(25,k=!1)}}function se(){te(),Se(),S(),ie(),q()}function te(){if(!Z||!i)return;nn(Z).selectAll("*").remove();const be=[{label:"Pending",value:i.pendingPhrases,color:"#F59E0B"},{label:"Approved",value:i.approvedPhrases,color:"#10B981"},{label:"Trash",value:i.trashPhrases,color:"#EF4444"}].filter(Oe=>Oe.value>0),He=160,Je=He/2,at=Je*.6,_t=nn(Z).append("svg").attr("width",He).attr("height",He).append("g").attr("transform",`translate(${Je},${Je})`),ut=N2().value(Oe=>Oe.value).sort(null),bt=Nu().innerRadius(at).outerRadius(Je-3),it=Nu().innerRadius(at).outerRadius(Je),Ze=nn(Z).append("div").attr("class","chart-tip").style("display","none");_t.selectAll("path").data(ut(be)).join("path").attr("d",bt).attr("fill",Oe=>Oe.data.color).attr("stroke","#111827").attr("stroke-width",2).style("cursor","pointer").on("mouseover",function(Oe,Qe){nn(this).transition().duration(120).attr("d",it),Ze.style("display","block").html(`<b>${Qe.data.label}</b>: ${dt(Qe.data.value)}`)}).on("mousemove",Oe=>Ze.style("left",Oe.offsetX+10+"px").style("top",Oe.offsetY-8+"px")).on("mouseout",function(){nn(this).transition().duration(120).attr("d",bt),Ze.style("display","none")}),_t.append("text").attr("text-anchor","middle").attr("dy","-0.25em").attr("fill","#f9fafb").attr("font-size",16).attr("font-weight","bold").text(hn(i.totalPhrases)),_t.append("text").attr("text-anchor","middle").attr("dy","1.1em").attr("fill","#6b7280").attr("font-size",10).text("phrases")}function Se(){if(!G||!l.length)return;nn(G).selectAll("*").remove();const be={top:8,right:60,bottom:8,left:68},He=26,Je=4,at=G.clientWidth||400,wt=l.length*(He+Je)+be.top+be.bottom,_t=at-be.left-be.right,bt=nn(G).append("svg").attr("width",at).attr("height",wt).append("g").attr("transform",`translate(${be.left},${be.top})`),it=vi(l,Qe=>Qe.translated)||1,Ze=Qr().domain([0,it]).range([0,_t]),Oe=Nf(v2).domain([0,l.length-1]);l.forEach((Qe,St)=>{const ot=St*(He+Je);bt.append("text").attr("x",-6).attr("y",ot+He/2+1).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#a5b4fc").attr("font-size",11).attr("font-family","monospace").text(Qe.lang),bt.append("rect").attr("x",0).attr("y",ot).attr("width",_t).attr("height",He).attr("fill","#1f2937").attr("rx",4),bt.append("rect").attr("x",0).attr("y",ot).attr("width",Ze(Qe.translated)).attr("height",He).attr("fill",Oe(St)).attr("rx",4),bt.append("text").attr("x",_t+6).attr("y",ot+He/2+1).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",10).text(`${hn(Qe.translated)} (${Qe.coverage}%)`)})}function S(){if(!ne||!c.length)return;nn(ne).selectAll("*").remove();const be={top:10,right:16,bottom:28,left:48},He=ne.clientWidth||500,Je=130,at=He-be.left-be.right,wt=Je-be.top-be.bottom,_t=If("%Y-%m-%d"),ut=c.map(ot=>({day:_t(ot.day),count:ot.count})),it=nn(ne).append("svg").attr("width",He).attr("height",Je).append("g").attr("transform",`translate(${be.left},${be.top})`),Ze=_2().domain(X0(ut,ot=>ot.day)).range([0,at]),Oe=Qr().domain([0,vi(ut,ot=>ot.count)]).nice().range([wt,0]),Qe=E2().x(ot=>Ze(ot.day)).y0(wt).y1(ot=>Oe(ot.count)).curve(Fu);it.append("path").datum(ut).attr("fill","#6366f133").attr("d",Qe);const St=Bf().x(ot=>Ze(ot.day)).y(ot=>Oe(ot.count)).curve(Fu);it.append("path").datum(ut).attr("fill","none").attr("stroke","#6366f1").attr("stroke-width",2).attr("d",St),it.selectAll("circle").data(ut).join("circle").attr("cx",ot=>Ze(ot.day)).attr("cy",ot=>Oe(ot.count)).attr("r",3).attr("fill","#818cf8").attr("stroke","#1f2937").attr("stroke-width",1.5),it.append("g").attr("transform",`translate(0,${wt})`).call(Ga(Ze).ticks(6).tickFormat(oo("%b %d"))).call(ot=>ot.select(".domain").attr("stroke","#374151")).call(ot=>ot.selectAll("text").attr("fill","#6b7280").attr("font-size",10)),it.append("g").call(Va(Oe).ticks(4).tickFormat(Vi(",d"))).call(ot=>ot.select(".domain").attr("stroke","#374151")).call(ot=>ot.selectAll("text").attr("fill","#6b7280").attr("font-size",10))}function ie(){if(!O||!o.length)return;nn(O).selectAll("*").remove();const be={chart:"#6366f1",admin:"#f59e0b",layout:"#10b981",func:"#3b82f6",other:"#8b5cf6"},He={top:10,right:16,bottom:32,left:48},Je=O.clientWidth||400,at=180,wt=Je-He.left-He.right,_t=at-He.top-He.bottom,bt=nn(O).append("svg").attr("width",Je).attr("height",at).append("g").attr("transform",`translate(${He.left},${He.top})`),it=wf().domain(o.map(Oe=>Oe.section)).range([0,wt]).padding(.3),Ze=Qr().domain([0,vi(o,Oe=>Oe.phrases)]).nice().range([_t,0]);bt.append("g").call(Va(Ze).ticks(4).tickFormat(Vi(",d"))).call(Oe=>Oe.select(".domain").attr("stroke","#374151")).call(Oe=>Oe.selectAll("text").attr("fill","#9ca3af").attr("font-size",10)),bt.selectAll(".bar").data(o).join("rect").attr("x",Oe=>it(Oe.section)).attr("y",Oe=>Ze(Oe.phrases)).attr("width",it.bandwidth()).attr("height",Oe=>_t-Ze(Oe.phrases)).attr("fill",Oe=>be[Oe.section]||"#6b7280").attr("rx",3).style("cursor","pointer").on("click",(Oe,Qe)=>{n(14,_=_===Qe.section?"":Qe.section),n(13,m=0),n(27,W="pages"),K()}),bt.selectAll(".bar-label").data(o).join("text").attr("x",Oe=>it(Oe.section)+it.bandwidth()/2).attr("y",Oe=>Ze(Oe.phrases)-4).attr("text-anchor","middle").attr("fill","#d1d5db").attr("font-size",9).text(Oe=>hn(Oe.phrases)),bt.append("g").attr("transform",`translate(0,${_t})`).call(Ga(it)).call(Oe=>Oe.select(".domain").attr("stroke","#374151")).call(Oe=>Oe.selectAll("text").attr("fill","#9ca3af").attr("font-size",11))}function q(){if(!Y||!a.length)return;nn(Y).selectAll("*").remove();const be=a.filter(Qe=>Qe.phrases>=100);if(!be.length)return;const He={top:8,right:56,bottom:8,left:76},Je=22,at=4,wt=Y.clientWidth||400,_t=be.length*(Je+at)+He.top+He.bottom,ut=wt-He.left-He.right,it=nn(Y).append("svg").attr("width",wt).attr("height",_t).append("g").attr("transform",`translate(${He.left},${He.top})`),Ze=vi(be,Qe=>Qe.phrases)||1,Oe=Qr().domain([0,Ze]).range([0,ut]);be.forEach((Qe,St)=>{const ot=St*(Je+at);it.append("text").attr("x",-6).attr("y",ot+Je/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","#93c5fd").attr("font-size",10).attr("font-family","monospace").text(Qe.instance),it.append("rect").attr("x",0).attr("y",ot).attr("width",ut).attr("height",Je).attr("fill","#1f2937").attr("rx",3),it.append("rect").attr("x",0).attr("y",ot).attr("width",Oe(Qe.phrases)).attr("height",Je).attr("fill","#3b82f655").attr("rx",3),it.append("rect").attr("x",0).attr("y",ot).attr("width",Oe(Qe.approved)).attr("height",Je).attr("fill","#10b981").attr("rx",3).style("cursor","pointer").on("click",()=>{n(15,v=v===Qe.instance?"":Qe.instance),n(12,g=v),n(13,m=0),n(27,W="pages"),K()}),it.append("text").attr("x",ut+6).attr("y",ot+Je/2).attr("dominant-baseline","middle").attr("fill","#9ca3af").attr("font-size",9).text(`${hn(Qe.phrases)} phrases`)})}let H;function U(){n(14,_=""),n(15,v=""),clearTimeout(H),H=setTimeout(()=>{n(13,m=0),K()},300)}function V(be){n(14,_=_===be?"":be),n(12,g=""),n(15,v=""),n(13,m=0),K()}function ae(be){n(15,v=v===be?"":be),n(12,g=v),n(14,_=""),n(13,m=0),K()}function ce(){n(13,m=Math.max(0,m-Qn)),K()}function Q(){n(13,m+=Qn),K()}function de(be){n(27,W=be),be==="pages"&&f.length===0&&K(),be==="overview"&&Lr().then(se)}jr(()=>{const be=new ResizeObserver(()=>{h||se()});return re().then(()=>{[G,ne,O,Y].filter(Boolean).forEach(He=>be.observe(He))}),()=>be.disconnect()});function ge(be){Ir.call(this,e,be)}const he=be=>de(be);function xe(be){Jn[be?"unshift":"push"](()=>{Z=be,n(29,Z)})}function Re(be){Jn[be?"unshift":"push"](()=>{ne=be,n(30,ne)})}function we(be){Jn[be?"unshift":"push"](()=>{O=be,n(31,O)})}const Me=be=>V(be.section);function ze(be){Jn[be?"unshift":"push"](()=>{Y=be,n(32,Y)})}function Ee(){g=this.value,n(12,g)}const Ge=be=>V(be.section),oe=be=>ae(be.instance),Fe=be=>y===be.url?fe():X(be.url);function me(){x=rn(this),n(18,x),n(5,l)}const Ae=()=>le(w.pendingKeyIds,"All pending"),Ue=()=>le([...P],"Selected");function Ce(){A=this.value,n(1,A)}const Te=()=>{n(23,T=null),n(24,N=null)},et=()=>{n(2,M=!M),n(23,T=null),n(24,N=null)};function Xe(){I=rn(this),n(3,I)}const Le=()=>{n(23,T=null),n(24,N=null)},Ye=be=>P.has(be.id),ke=be=>ye(be.id),qe=be=>ve(be),tt=be=>le([be.id],`"${be.key}"`);function yt(be){Jn[be?"unshift":"push"](()=>{G=be,n(28,G)})}const Rt=()=>{n(23,T=null),n(24,N=null)};function Mt(){x=rn(this),n(18,x),n(5,l)}const en=()=>le([N.id],`"${N.key}"`),jt=(be,He)=>!be.has(He.lang),Ot=()=>{n(23,T=null),n(24,N=null)};return e.$$.update=()=>{e.$$.dirty[0]&15&&n(33,r=(()=>{const be=(w==null?void 0:w.topPhrases)||[];if(!A)return be.filter(Je=>!I||Je.status===I);if(M){let Je;try{Je=new RegExp(A,"i"),n(19,L=!1)}catch{return n(19,L=!0),[]}return be.filter(at=>(!I||at.status===I)&&(Je.test(at.key)||Je.test(at.context||"")))}const He=A.toLowerCase();return be.filter(Je=>(!I||Je.status===I)&&(Je.key.toLowerCase().includes(He)||(Je.context||"").toLowerCase().includes(He)))})())},n(19,L=!1),[w,A,M,I,i,l,o,a,f,d,h,p,g,m,_,v,y,C,x,L,P,z,R,T,N,k,j,W,G,Z,ne,O,Y,r,J,X,fe,ye,Ie,le,ve,U,V,ae,ce,Q,de,ge,he,xe,Re,we,Me,ze,Ee,Ge,oe,Fe,me,Ae,Ue,Ce,Te,et,Xe,Le,Ye,ke,qe,tt,yt,Rt,Mt,en,jt,Ot]}class o_ extends an{constructor(t){super(),sn(this,t,l_,r_,$t,{},null,[-1,-1,-1,-1])}}function yc(e,t,n){const r=e.slice();return r[23]=t[n],r}function vc(e,t,n){const r=e.slice();return r[26]=t[n],r}function wc(e){let t,n,r,i;function l(){return e[16](e[26])}return{c(){t=b("button"),s(t,"class",n="w-6 h-6 rounded-full border-2 transition-transform hover:scale-110 "+(e[2]===e[26]?"border-gray-800 scale-110":"border-transparent")),mt(t,"background-color",e[26]),s(t,"title",e[26])},m(o,a){F(o,t,a),r||(i=$(t,"click",l),r=!0)},p(o,a){e=o,a&4&&n!==(n="w-6 h-6 rounded-full border-2 transition-transform hover:scale-110 "+(e[2]===e[26]?"border-gray-800 scale-110":"border-transparent"))&&s(t,"class",n)},d(o){o&&D(t),r=!1,i()}}}function kc(e){let t,n;return{c(){t=b("p"),n=B(e[6]),s(t,"class","text-sm text-red-600 mb-4")},m(r,i){F(r,t,i),u(t,n)},p(r,i){i&64&&ee(n,r[6])},d(r){r&&D(t)}}}function s_(e){let t,n=[],r=new Map,i=Be(e[0]);const l=o=>o[23].id;for(let o=0;o<i.length;o+=1){let a=yc(e,i,o),c=l(a);r.set(c,n[o]=xc(c,a))}return{c(){t=b("div");for(let o=0;o<n.length;o+=1)n[o].c();s(t,"class","space-y-2")},m(o,a){F(o,t,a);for(let c=0;c<n.length;c+=1)n[c]&&n[c].m(t,null)},p(o,a){a&7737&&(i=Be(o[0]),n=si(n,a,l,1,o,i,r,t,Hl,xc,null,yc))},d(o){o&&D(t);for(let a=0;a<n.length;a+=1)n[a].d()}}}function a_(e){let t;return{c(){t=b("div"),t.innerHTML='<p>No labels created yet.</p> <p class="text-sm mt-1">Create your first label above to start organizing phrases.</p>',s(t,"class","text-center py-8 text-gray-400")},m(n,r){F(n,t,r)},p:je,d(n){n&&D(t)}}}function u_(e){let t,n,r,i=e[23].name+"",l,o,a,c=e[23].count+"",f,d,h=e[23].count!==1?"s":"",p,g,m,_,v,y,w;function C(){return e[20](e[23])}function x(){return e[21](e[23])}return{c(){t=b("span"),n=E(),r=b("span"),l=B(i),o=E(),a=b("span"),f=B(c),d=B(" phrase"),p=B(h),g=E(),m=b("button"),m.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"></path></svg>',_=E(),v=b("button"),v.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>',s(t,"class","inline-block w-4 h-4 rounded-full shrink-0"),mt(t,"background-color",e[23].color),s(r,"class","flex-1 text-sm font-medium text-gray-700"),s(a,"class","text-xs text-gray-400"),s(m,"class","p-1 text-gray-400 hover:text-indigo-600 transition-colors"),s(m,"title","Edit"),s(v,"class","p-1 text-gray-400 hover:text-red-600 transition-colors"),s(v,"title","Delete")},m(A,M){F(A,t,M),F(A,n,M),F(A,r,M),u(r,l),F(A,o,M),F(A,a,M),u(a,f),u(a,d),u(a,p),F(A,g,M),F(A,m,M),F(A,_,M),F(A,v,M),y||(w=[$(m,"click",C),$(v,"click",x)],y=!0)},p(A,M){e=A,M&1&&mt(t,"background-color",e[23].color),M&1&&i!==(i=e[23].name+"")&&ee(l,i),M&1&&c!==(c=e[23].count+"")&&ee(f,c),M&1&&h!==(h=e[23].count!==1?"s":"")&&ee(p,h)},d(A){A&&(D(t),D(n),D(r),D(o),D(a),D(g),D(m),D(_),D(v)),y=!1,lt(w)}}}function c_(e){let t,n,r,i,l,o,a,c,f;return{c(){t=b("input"),n=E(),r=b("input"),i=E(),l=b("button"),l.textContent="Save",o=E(),a=b("button"),a.textContent="Cancel",s(t,"type","color"),s(t,"class","w-7 h-7 rounded border border-gray-300 cursor-pointer"),s(r,"type","text"),s(r,"maxlength","50"),s(r,"class","flex-1 px-2 py-1 border border-gray-300 rounded text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(l,"class","px-3 py-1 bg-indigo-600 text-white text-xs rounded hover:bg-indigo-700"),s(a,"class","px-3 py-1 border border-gray-300 text-xs rounded hover:bg-gray-100")},m(d,h){F(d,t,h),De(t,e[5]),F(d,n,h),F(d,r,h),De(r,e[4]),F(d,i,h),F(d,l,h),F(d,o,h),F(d,a,h),c||(f=[$(t,"input",e[17]),$(r,"input",e[18]),$(r,"keydown",e[19]),$(l,"click",e[10]),$(a,"click",e[11])],c=!0)},p(d,h){h&32&&De(t,d[5]),h&16&&r.value!==d[4]&&De(r,d[4])},d(d){d&&(D(t),D(n),D(r),D(i),D(l),D(o),D(a)),c=!1,lt(f)}}}function xc(e,t){let n,r;function i(a,c){return a[3]===a[23].id?c_:u_}let l=i(t),o=l(t);return{key:e,first:null,c(){n=b("div"),o.c(),r=E(),s(n,"class","flex items-center gap-3 p-3 rounded-lg border border-gray-200 hover:bg-gray-50 transition-colors"),this.first=n},m(a,c){F(a,n,c),o.m(n,null),u(n,r)},p(a,c){t=a,l===(l=i(t))&&o?o.p(t,c):(o.d(1),o=l(t),o&&(o.c(),o.m(n,r)))},d(a){a&&D(n),o.d()}}}function f_(e){let t,n,r,i,l,o,a,c,f,d,h,p,g,m,_,v,y,w,C,x,A,M=Be(e[7]),L=[];for(let T=0;T<M.length;T+=1)L[T]=wc(vc(e,M,T));let I=e[6]&&kc(e);function P(T,N){return T[0].length===0?a_:s_}let z=P(e),R=z(e);return{c(){t=b("section"),n=b("h2"),n.textContent="Labels",r=E(),i=b("p"),i.textContent="Create labels to organize and categorize your phrases. Labels work like GitHub labels — assign them to phrases and filter by them.",l=E(),o=b("div"),a=b("div"),c=b("input"),f=E(),d=b("div"),h=b("input"),p=E(),g=b("button"),m=B("Create"),v=E(),y=b("div");for(let T=0;T<L.length;T+=1)L[T].c();w=E(),I&&I.c(),C=E(),R.c(),s(n,"class","text-lg font-semibold text-gray-800 mb-4"),s(i,"class","text-sm text-gray-500 mb-6"),s(c,"type","text"),s(c,"placeholder","Label name"),s(c,"maxlength","50"),s(c,"class","flex-1 px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500"),s(h,"type","color"),s(h,"class","w-9 h-9 rounded-md border border-gray-300 cursor-pointer"),s(h,"title","Pick color"),s(d,"class","relative"),s(a,"class","flex items-center gap-2 flex-1"),s(g,"class","px-4 py-2 bg-indigo-600 text-white text-sm rounded-md hover:bg-indigo-700 disabled:opacity-50"),g.disabled=_=!e[1].trim(),s(o,"class","flex items-center gap-3 mb-6 p-4 bg-gray-50 rounded-lg border border-gray-200"),s(y,"class","flex flex-wrap gap-1.5 mb-6"),s(t,"class","max-w-2xl")},m(T,N){F(T,t,N),u(t,n),u(t,r),u(t,i),u(t,l),u(t,o),u(o,a),u(a,c),De(c,e[1]),u(a,f),u(a,d),u(d,h),De(h,e[2]),u(o,p),u(o,g),u(g,m),u(t,v),u(t,y);for(let k=0;k<L.length;k+=1)L[k]&&L[k].m(y,null);u(t,w),I&&I.m(t,null),u(t,C),R.m(t,null),x||(A=[$(c,"input",e[13]),$(c,"keydown",e[14]),$(h,"input",e[15]),$(g,"click",e[8])],x=!0)},p(T,[N]){if(N&2&&c.value!==T[1]&&De(c,T[1]),N&4&&De(h,T[2]),N&2&&_!==(_=!T[1].trim())&&(g.disabled=_),N&132){M=Be(T[7]);let k;for(k=0;k<M.length;k+=1){const j=vc(T,M,k);L[k]?L[k].p(j,N):(L[k]=wc(j),L[k].c(),L[k].m(y,null))}for(;k<L.length;k+=1)L[k].d(1);L.length=M.length}T[6]?I?I.p(T,N):(I=kc(T),I.c(),I.m(t,C)):I&&(I.d(1),I=null),z===(z=P(T))&&R?R.p(T,N):(R.d(1),R=z(T),R&&(R.c(),R.m(t,null)))},i:je,o:je,d(T){T&&D(t),ft(L,T),I&&I.d(),R.d(),x=!1,lt(A)}}}function d_(e,t,n){let r=[],i="",l="#6366f1",o=null,a="",c="",f="";const d=["#ef4444","#f97316","#f59e0b","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#64748b"];jr(h);async function h(){const z=await We("../api/labels");z.ok&&n(0,r=await z.json())}async function p(){if(!i.trim())return;n(6,f="");const z=await We("../api/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i.trim(),color:l})});if(z.ok)n(1,i=""),n(2,l="#6366f1"),await h();else{const R=await z.json().catch(()=>({}));n(6,f=R.error||"Failed to create label")}}function g(z){n(3,o=z.id),n(4,a=z.name),n(5,c=z.color)}async function m(){if(!a.trim())return;(await We(`../api/labels/${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a.trim(),color:c})})).ok&&(n(3,o=null),await h())}function _(){n(3,o=null)}async function v(z){confirm("Delete this label? It will be removed from all phrases.")&&(await We(`../api/labels/${z}`,{method:"DELETE"}),await h())}function y(){i=this.value,n(1,i)}const w=z=>z.key==="Enter"&&p();function C(){l=this.value,n(2,l)}const x=z=>n(2,l=z);function A(){c=this.value,n(5,c)}function M(){a=this.value,n(4,a)}return[r,i,l,o,a,c,f,d,p,g,m,_,v,y,w,C,x,A,M,z=>{z.key==="Enter"&&m(),z.key==="Escape"&&_()},z=>g(z),z=>v(z.id)]}class h_ extends an{constructor(t){super(),sn(this,t,d_,f_,$t,{})}}function Cc(e){if(!e)throw Error("Parameter args is required");if(!e.component==!e.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(e.component&&(e.asyncComponent=()=>Promise.resolve(e.component)),typeof e.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(e.conditions){Array.isArray(e.conditions)||(e.conditions=[e.conditions]);for(let n=0;n<e.conditions.length;n++)if(!e.conditions[n]||typeof e.conditions[n]!="function")throw Error("Invalid parameter conditions["+n+"]")}return e.loadingComponent&&(e.asyncComponent.loading=e.loadingComponent,e.asyncComponent.loadingParams=e.loadingParams||void 0),{component:e.asyncComponent,userData:e.userData,conditions:e.conditions&&e.conditions.length?e.conditions:void 0,props:e.props&&Object.keys(e.props).length?e.props:{},_sveltesparouter:!0}}const p_="1.1.15",xl={version:p_};function g_(e){let t,n;return t=new td({props:{routes:e[5]}}),t.$on("conditionsFailed",e[7]),t.$on("routeLoaded",e[8]),{c(){ln(t.$$.fragment)},m(r,i){Kt(t,r,i),n=!0},p:je,i(r){n||(st(t.$$.fragment,r),n=!0)},o(r){ct(t.$$.fragment,r),n=!1},d(r){Qt(t,r)}}}function m_(e){let t;return{c(){t=b("div"),t.innerHTML='<div class="flex flex-col items-center gap-3"><svg width="60" height="60" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><style>@keyframes lspin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes lpulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:0.7;transform:scale(0.92)}}#lr{animation:lspin 1.2s linear infinite;transform-origin:40px 40px}#lp{animation:lpulse 2s ease-in-out infinite;transform-origin:40px 40px}</style></defs><g id="lr"><circle cx="40" cy="40" r="34" fill="none" stroke="#2a3040" stroke-width="4"></circle><path d="M40 6 A34 34 0 0 1 74 40" fill="none" stroke="#2ECC88" stroke-width="4" stroke-linecap="round"></path><path d="M74 40 A34 34 0 0 1 56 70" fill="none" stroke="#3A8FE0" stroke-width="4" stroke-linecap="round"></path><path d="M56 70 A34 34 0 0 1 24 70" fill="none" stroke="#FFB833" stroke-width="4" stroke-linecap="round"></path></g><g id="lp"><circle cx="40" cy="40" r="16" fill="#1a1f2e"></circle><circle cx="40" cy="38" r="10" fill="#2ECC88"></circle><circle cx="37" cy="37" r="2.5" fill="white"></circle><circle cx="37.5" cy="37.5" r="1.5" fill="#2C2C2A"></circle><circle cx="43" cy="37" r="2.5" fill="white"></circle><circle cx="42.5" cy="37.5" r="1.5" fill="#2C2C2A"></circle><path d="M38 41 Q40 39 42 41 Q42 44 40 45 Q38 44 38 41Z" fill="#E8A020"></path><line x1="38" y1="30" x2="36" y2="26" stroke="#FFB833" stroke-width="1.5" stroke-linecap="round"></line><line x1="40" y1="29" x2="40" y2="24" stroke="#7BC74A" stroke-width="1.5" stroke-linecap="round"></line><line x1="42" y1="30" x2="44" y2="26" stroke="#F07040" stroke-width="1.5" stroke-linecap="round"></line><circle cx="36" cy="25.5" r="1.5" fill="#FFB833"></circle><circle cx="40" cy="23.5" r="1.5" fill="#7BC74A"></circle><circle cx="44" cy="25.5" r="1.5" fill="#F07040"></circle></g></svg> <p class="text-gray-400 text-sm">Loading…</p></div>',s(t,"class","flex items-center justify-center h-full")},m(n,r){F(n,t,r)},p:je,i:je,o:je,d(n){n&&D(t)}}}function __(e){let t,n,r,i,l,o,a,c,f,d,h,p,g;n=new id({props:{currentView:e[4]}}),n.$on("navigate",e[6]),a=new fd({props:{projects:e[2],currentProject:e[1]}}),a.$on("switch",e[9]),a.$on("created",e[10]),a.$on("deleted",e[11]),a.$on("renamed",e[12]);const m=[m_,g_],_=[];function v(y,w){return y[0]?1:0}return d=v(e),h=_[d]=m[d](e),{c(){t=b("div"),ln(n.$$.fragment),r=E(),i=b("div"),l=b("header"),o=b("div"),ln(a.$$.fragment),c=E(),f=b("main"),h.c(),s(o,"data-notranslate",""),s(l,"class","bg-white border-b border-gray-200 px-6 py-2 flex items-center justify-end gap-3 shrink-0"),s(f,"class",p="flex-1 p-6 overflow-auto transition-opacity duration-100 "+(e[3]?"opacity-0":"opacity-100")),s(i,"class","flex-1 flex flex-col overflow-hidden"),s(t,"class","flex min-h-screen bg-gray-100")},m(y,w){F(y,t,w),Kt(n,t,null),u(t,r),u(t,i),u(i,l),u(l,o),Kt(a,o,null),u(i,c),u(i,f),_[d].m(f,null),g=!0},p(y,[w]){const C={};w&16&&(C.currentView=y[4]),n.$set(C);const x={};w&4&&(x.projects=y[2]),w&2&&(x.currentProject=y[1]),a.$set(x);let A=d;d=v(y),d===A?_[d].p(y,w):(Jt(),ct(_[A],1,1,()=>{_[A]=null}),qt(),h=_[d],h?h.p(y,w):(h=_[d]=m[d](y),h.c()),st(h,1),h.m(f,null)),(!g||w&8&&p!==(p="flex-1 p-6 overflow-auto transition-opacity duration-100 "+(y[3]?"opacity-0":"opacity-100")))&&s(f,"class",p)},i(y){g||(st(n.$$.fragment,y),st(a.$$.fragment,y),st(h),g=!0)},o(y){ct(n.$$.fragment,y),ct(a.$$.fragment,y),ct(h),g=!1},d(y){y&&D(t),Qt(n),Qt(a),_[d].d()}}}function Cl(){const e=window.location.pathname||"",t=e.indexOf("/dashboard"),n=t>=0?e.slice(0,t):"";return window.location.origin+n}function b_(e,t,n){let r,i,l,o;ti(e,dn,G=>n(1,l=G)),ti(e,Qf,G=>n(15,o=G));let a=!1,c=[],f=null,d=null,h=!1,p=!1,g="__unset__",m=0,_="",v="",y="";const w=xl==null?void 0:xl.version,C={"/translations/:tab":Cc({component:Ks,conditions:[G=>{var Z;return["pending","approved","trash"].includes((Z=G.params)==null?void 0:Z.tab)}]}),"/ai-translate":T0,"/analytics":o_,"/labels":h_,"/settings":H0,"*":Cc({component:Ks})};function x(G){const Z=G.detail;if(Z==="translations"){if(o.startsWith("/translations/"))return;Cr("/translations/pending")}else Cr(`/${Z}`)}function A(){Cr("/translations/pending")}function M(G){G.detail.route==="*"&&Cr("/translations/pending")}function L(){return`${Cl()}/cdn/loco-dashboard-translations.json?v=${encodeURIComponent(w)}`}async function I(G){const Z=L();try{if((await fetch(Z,{cache:"no-store"})).ok)return{config:{file:Z},mode:`file:${Z}`}}catch{}return{config:{apiUrl:Cl(),apiKey:G},mode:`api:${(l==null?void 0:l.id)||""}:${G}`}}function P(){return window.Loco?Promise.resolve(window.Loco):f||(f=new Promise((G,Z)=>{const ne=document.querySelector('script[data-loco-dashboard="1"]');if(ne){ne.addEventListener("load",()=>G(window.Loco),{once:!0}),ne.addEventListener("error",Z,{once:!0});return}const O=document.createElement("script");O.src=`${Cl()}/cdn/loco.min.js?v=${encodeURIComponent(w)}`,O.async=!0,O.dataset.locoDashboard="1",O.onload=()=>G(window.Loco),O.onerror=Z,document.head.appendChild(O)}),f)}async function z(){const G=l==null?void 0:l.api_key;if(G){if(window.Loco&&_===G){T();return}return d||(d=(async()=>{try{h=!1,g="__unset__";const[Z,{config:ne,mode:O}]=await Promise.all([P(),I(G)]);if(!Z||!Z.init||v===O&&window.Loco)return;await Promise.resolve(Z.init(ne)),_=G,v=O,h=!0,Z.widget&&Z.widget({position:"bottom-right"}),T()}catch(Z){h=!1,console.warn("[loco] Failed to initialize dashboard translation:",Z)}finally{d=null}})(),d)}}async function R(){if(!(!window.Loco||!h))try{const G=localStorage.getItem("loco-lang"),Z=G&&G.trim()?G:null;if(!Z){g!==null&&window.Loco.restore&&(window.Loco.restore(),g=null);return}if(g===Z)return;window.Loco.apply&&(await window.Loco.apply(Z),g=Z)}catch(G){console.warn("[loco] Route sync failed:",G)}}function T(){if(!h)return;const G=++m,Z=localStorage.getItem("loco-lang"),ne=!!(Z&&Z.trim());n(3,p=ne),requestAnimationFrame(()=>{requestAnimationFrame(()=>{G===m&&R().finally(()=>{G===m&&n(3,p=!1)})})})}jr(async()=>{(!window.location.hash||window.location.hash==="#"||window.location.hash==="#/")&&Cr("/translations/pending"),P();const G=await fetch("../api/projects");n(2,c=await G.json());const Z=localStorage.getItem("loco_project_id");let ne=c.find(O=>String(O.id)===Z)||c[0];if(!ne){n(0,a=!0);return}await N(ne),n(0,a=!0),await z()});async function N(G){zc(G.api_key),localStorage.setItem("loco_project_id",String(G.id)),dn.set(G)}async function k(G){n(0,a=!1),await N(G.detail),n(0,a=!0)}async function j(G){n(2,c=[...c,G.detail]),n(0,a=!1),await N(G.detail),n(0,a=!0)}async function J(G){const Z=G.detail;n(2,c=c.filter(ne=>ne.id!==Z.id)),(l==null?void 0:l.id)===Z.id&&(n(0,a=!1),await N(c[0]),n(0,a=!0))}async function W(G){const Z=G.detail;n(2,c=c.map(ne=>ne.id===Z.id?{...ne,name:Z.name}:ne)),(l==null?void 0:l.id)===Z.id&&dn.update(ne=>({...ne,name:Z.name}))}return e.$$.update=()=>{e.$$.dirty&32768&&n(14,r=(o||"").split("/")[1]||"translations"),e.$$.dirty&16384&&n(4,i=r==="ai-translate"?"ai-translate":r==="settings"?"settings":r==="analytics"?"analytics":r==="labels"?"labels":"translations"),e.$$.dirty&3&&a&&l!=null&&l.api_key&&z(),e.$$.dirty&40961&&a&&window.Loco&&o!==y&&(n(13,y=o),T())},[a,l,c,p,i,C,x,A,M,k,j,J,W,y,r,o]}class y_ extends an{constructor(t){super(),sn(this,t,b_,__,$t,{})}}new y_({target:document.getElementById("app")});
|