vskill 1.0.18 → 1.0.19
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/README.md +8 -59
- package/agents.json +1 -1
- package/dist/bin.js +0 -0
- package/dist/commands/add-lockfile.d.ts +0 -6
- package/dist/commands/add-lockfile.js +0 -10
- package/dist/commands/add-lockfile.js.map +1 -1
- package/dist/commands/add.js +1 -16
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/auth.js +31 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/discovery/github-tree.d.ts +3 -23
- package/dist/discovery/github-tree.js +24 -172
- package/dist/discovery/github-tree.js.map +1 -1
- package/dist/eval-server/active-root-store.d.ts +19 -0
- package/dist/eval-server/active-root-store.js +50 -0
- package/dist/eval-server/active-root-store.js.map +1 -0
- package/dist/eval-server/api-routes.d.ts +1 -1
- package/dist/eval-server/api-routes.js +43 -5
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/authoring-routes.d.ts +1 -1
- package/dist/eval-server/authoring-routes.js +9 -7
- package/dist/eval-server/authoring-routes.js.map +1 -1
- package/dist/eval-server/detect-engines-route.d.ts +1 -1
- package/dist/eval-server/detect-engines-route.js +3 -1
- package/dist/eval-server/detect-engines-route.js.map +1 -1
- package/dist/eval-server/eval-server.js +26 -24
- package/dist/eval-server/eval-server.js.map +1 -1
- package/dist/eval-server/git-routes.d.ts +6 -6
- package/dist/eval-server/git-routes.js +22 -11
- package/dist/eval-server/git-routes.js.map +1 -1
- package/dist/eval-server/improve-routes.d.ts +1 -1
- package/dist/eval-server/improve-routes.js +4 -1
- package/dist/eval-server/improve-routes.js.map +1 -1
- package/dist/eval-server/install-engine-routes.d.ts +1 -1
- package/dist/eval-server/install-engine-routes.js +1 -1
- package/dist/eval-server/install-engine-routes.js.map +1 -1
- package/dist/eval-server/install-skill-routes.d.ts +1 -1
- package/dist/eval-server/install-skill-routes.js +3 -1
- package/dist/eval-server/install-skill-routes.js.map +1 -1
- package/dist/eval-server/install-state-routes.d.ts +1 -1
- package/dist/eval-server/install-state-routes.js +3 -1
- package/dist/eval-server/install-state-routes.js.map +1 -1
- package/dist/eval-server/integration-routes.d.ts +1 -1
- package/dist/eval-server/integration-routes.js +6 -1
- package/dist/eval-server/integration-routes.js.map +1 -1
- package/dist/eval-server/model-compare-routes.d.ts +1 -1
- package/dist/eval-server/model-compare-routes.js +3 -1
- package/dist/eval-server/model-compare-routes.js.map +1 -1
- package/dist/eval-server/platform-proxy.d.ts +6 -1
- package/dist/eval-server/platform-proxy.js +60 -11
- package/dist/eval-server/platform-proxy.js.map +1 -1
- package/dist/eval-server/plugin-cli-routes.d.ts +1 -1
- package/dist/eval-server/plugin-cli-routes.js +10 -1
- package/dist/eval-server/plugin-cli-routes.js.map +1 -1
- package/dist/eval-server/remove-skill-routes.d.ts +1 -1
- package/dist/eval-server/remove-skill-routes.js +3 -1
- package/dist/eval-server/remove-skill-routes.js.map +1 -1
- package/dist/eval-server/skill-create-routes.d.ts +1 -1
- package/dist/eval-server/skill-create-routes.js +8 -1
- package/dist/eval-server/skill-create-routes.js.map +1 -1
- package/dist/eval-server/sweep-routes.d.ts +1 -1
- package/dist/eval-server/sweep-routes.js +5 -1
- package/dist/eval-server/sweep-routes.js.map +1 -1
- package/dist/eval-server/workspace-routes.d.ts +12 -0
- package/dist/eval-server/workspace-routes.js +57 -2
- package/dist/eval-server/workspace-routes.js.map +1 -1
- package/dist/eval-ui/assets/{AdvancedTab-D8zbE5fH.js → AdvancedTab-DOgbx7u0.js} +1 -1
- package/dist/eval-ui/assets/{CreateSkillPage-DOBhKdgr.js → CreateSkillPage-Cv93Croj.js} +5 -5
- package/dist/eval-ui/assets/{FindSkillsPalette-CyMmNPr-.js → FindSkillsPalette-BY9DAhHh.js} +2 -2
- package/dist/eval-ui/assets/{GeneralTab-DYR9NWC4.js → GeneralTab-AwK9sIkP.js} +1 -1
- package/dist/eval-ui/assets/{PrivacyTab-CXIqQokl.js → PrivacyTab-BtNrxpVV.js} +1 -1
- package/dist/eval-ui/assets/{SearchPaletteCore-Dn5gQJS_.js → SearchPaletteCore-DMVcq7UB.js} +1 -1
- package/dist/eval-ui/assets/{SkillDetailPanel-DTrRnyyJ.js → SkillDetailPanel-B_lbhK6q.js} +1 -1
- package/dist/eval-ui/assets/{UpdateDropdown-Cvr2fe0z.js → UpdateDropdown-4AbjZLpq.js} +1 -1
- package/dist/eval-ui/assets/{UpdatesTab-DwJIUDPX.js → UpdatesTab-DTmo-vVb.js} +1 -1
- package/dist/eval-ui/assets/core-DZjBCfjp.js +1 -0
- package/dist/eval-ui/assets/{event-CDYWU2X3.js → event-QtOCMXAv.js} +1 -1
- package/dist/eval-ui/assets/globals-Dpf9KmYH.css +1 -0
- package/dist/eval-ui/assets/{index-D7M0Jdss.js → index-CUEYzTVL.js} +1 -1
- package/dist/eval-ui/assets/index-DDNzcrhv.js +1 -0
- package/dist/eval-ui/assets/index-DhhmQddr.js +1 -0
- package/dist/eval-ui/assets/{lifecycle-DSleOV-l.js → lifecycle-o_IRibOa.js} +1 -1
- package/dist/eval-ui/assets/main-tpOyw9SC.js +87 -0
- package/dist/eval-ui/assets/{preferences-BKv6X7fK.js → preferences-DCdw0Kvu.js} +2 -2
- package/dist/eval-ui/assets/{useDesktopBridge-DxVWbYqK.js → useDesktopBridge-9oZFQsrw.js} +2 -2
- package/dist/eval-ui/index.html +4 -4
- package/dist/eval-ui/lifecycle.html +3 -3
- package/dist/eval-ui/preferences.html +4 -4
- package/dist/lib/github-fetch.d.ts +0 -1
- package/dist/lib/github-fetch.js +1 -11
- package/dist/lib/github-fetch.js.map +1 -1
- package/dist/lib/keychain.js +20 -3
- package/dist/lib/keychain.js.map +1 -1
- package/dist/lockfile/types.d.ts +0 -8
- package/dist/studio/routes/index.d.ts +1 -1
- package/dist/studio/routes/index.js +10 -9
- package/dist/studio/routes/index.js.map +1 -1
- package/dist/studio/routes/promote.d.ts +1 -1
- package/dist/studio/routes/promote.js +3 -1
- package/dist/studio/routes/promote.js.map +1 -1
- package/dist/studio/routes/revert.d.ts +1 -1
- package/dist/studio/routes/revert.js +3 -1
- package/dist/studio/routes/revert.js.map +1 -1
- package/dist/studio/routes/test-install.d.ts +1 -1
- package/dist/studio/routes/test-install.js +3 -1
- package/dist/studio/routes/test-install.js.map +1 -1
- package/dist/updater/source-fetcher.js +2 -2
- package/dist/updater/source-fetcher.js.map +1 -1
- package/package.json +2 -1
- package/dist/eval-ui/assets/core-DZAvsxlC.js +0 -1
- package/dist/eval-ui/assets/globals-C3oEdsJh.css +0 -1
- package/dist/eval-ui/assets/main-D2shn1dH.js +0 -87
- package/dist/sidecar/eval-ui-manifest.json +0 -1
- package/dist/sidecar/sea-config.json +0 -57
- package/dist/sidecar/sea-prep.blob +0 -0
- package/dist/sidecar/server.cjs +0 -141627
- package/dist/sidecar/vskill-version.txt +0 -1
- /package/dist/eval-ui/assets/{globals-BRZwPAPF.js → globals-hm1COkXX.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GeneralTab-
|
|
2
|
-
var Ee=Object.defineProperty;var $e=(n,e,t)=>e in n?Ee(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ie=(n,e,t)=>$e(n,typeof e!="symbol"?e+"":e,t);import{r as S,j as m,c as je}from"./globals-BRZwPAPF.js";/* empty css */import{_ as Y,u as Ie,a as Te,l as Ae}from"./useDesktopBridge-DxVWbYqK.js";function Fe(){if(console&&console.warn){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const re={};function X(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&re[e[0]]||($(e[0])&&(re[e[0]]=new Date),Fe(...e))}const ve=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},ae=(n,e,t)=>{n.loadNamespaces(e,ve(n,t))},oe=(n,e,t,s)=>{$(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,ve(n,s))},De=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=e.languages[0],i=e.options?e.options.fallbackLng:!1,r=e.languages[e.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=e.services.backendConnector.state[`${o}|${u}`];return c===-1||c===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(s,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||a(s,n)&&(!i||a(r,n)))},Ue=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(X("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,r)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,n))return!1}}):De(n,e,t)},$=n=>typeof n=="string",Ve=n=>typeof n=="object"&&n!==null,Ke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Me={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ze=n=>Me[n],He=n=>n.replace(Ke,ze);let _={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:He};const Be=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_={..._,...n}},Je=()=>_;let we;const We=n=>{we=n},Ge=()=>we,Ye={type:"3rdParty",init(n){Be(n.options.react),We(n)}},Le=S.createContext();class Qe{constructor(){ie(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}}const qe=(n,e)=>{const t=S.useRef();return S.useEffect(()=>{t.current=n},[n,e]),t.current},Ne=(n,e,t,s)=>n.getFixedT(e,t,s),Ze=(n,e,t,s)=>S.useCallback(Ne(n,e,t,s),[n,e,t,s]),Xe=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:t}=e,{i18n:s,defaultNS:i}=S.useContext(Le)||{},r=t||s||Ge();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new Qe),!r){X("You will need to pass in an i18next instance by using initReactI18next");const b=(N,v)=>$(v)?v:Ve(v)&&$(v.defaultValue)?v.defaultValue:Array.isArray(N)?N[N.length-1]:N,L=[b,{},!1];return L.t=b,L.i18n={},L.ready=!1,L}r.options.react&&r.options.react.wait!==void 0&&X("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Je(),...r.options.react,...e},{useSuspense:o,keyPrefix:u}=a;let c=n;c=$(c)?[c]:c||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(c);const d=(r.isInitialized||r.initializedStoreOnce)&&c.every(b=>Ue(b,r,a)),h=Ze(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),l=()=>h,f=()=>Ne(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),[p,x]=S.useState(l);let y=c.join();e.lng&&(y=`${e.lng}${y}`);const C=qe(y),w=S.useRef(!0);S.useEffect(()=>{const{bindI18n:b,bindI18nStore:L}=a;w.current=!0,!d&&!o&&(e.lng?oe(r,e.lng,c,()=>{w.current&&x(f)}):ae(r,c,()=>{w.current&&x(f)})),d&&C&&C!==y&&w.current&&x(f);const N=()=>{w.current&&x(f)};return b&&r&&r.on(b,N),L&&r&&r.store.on(L,N),()=>{w.current=!1,b&&r&&b.split(" ").forEach(v=>r.off(v,N)),L&&r&&L.split(" ").forEach(v=>r.store.off(v,N))}},[r,y]),S.useEffect(()=>{w.current&&d&&x(l)},[r,u,d]);const R=[p,r,d];if(R.t=p,R.i18n=r,R.ready=d,d||!d&&!o)return R;throw new Promise(b=>{e.lng?oe(r,e.lng,c,()=>b()):ae(r,c,()=>b())})};function _e(n){let{i18n:e,defaultNS:t,children:s}=n;const i=S.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return S.createElement(Le.Provider,{value:i},s)}const g=n=>typeof n=="string",U=()=>{let n,e;const t=new Promise((s,i)=>{n=s,e=i});return t.resolve=n,t.reject=e,t},le=n=>n==null?"":""+n,et=(n,e,t)=>{n.forEach(s=>{e[s]&&(t[s]=e[s])})},tt=/###/g,ue=n=>n&&n.indexOf("###")>-1?n.replace(tt,"."):n,ce=n=>!n||g(n),V=(n,e,t)=>{const s=g(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(ce(n))return{};const r=ue(s[i]);!n[r]&&t&&(n[r]=new t),Object.prototype.hasOwnProperty.call(n,r)?n=n[r]:n={},++i}return ce(n)?{}:{obj:n,k:ue(s[i])}},de=(n,e,t)=>{const{obj:s,k:i}=V(n,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=V(n,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=V(n,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},st=(n,e,t,s)=>{const{obj:i,k:r}=V(n,e,Object);i[r]=i[r]||[],i[r].push(t)},B=(n,e)=>{const{obj:t,k:s}=V(n,e);if(t)return t[s]},nt=(n,e,t)=>{const s=B(n,t);return s!==void 0?s:B(e,t)},Ce=(n,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in n?g(n[s])||n[s]instanceof String||g(e[s])||e[s]instanceof String?t&&(n[s]=e[s]):Ce(n[s],e[s],t):n[s]=e[s]);return n},j=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var it={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const rt=n=>g(n)?n.replace(/[&<>"'\/]/g,e=>it[e]):n;class at{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const ot=[" ",",","?","!",";"],lt=new at(20),ut=(n,e,t)=>{e=e||"",t=t||"";const s=ot.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(s.length===0)return!0;const i=lt.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!i.test(n);if(!r){const a=n.indexOf(t);a>0&&!i.test(n.substring(0,a))&&(r=!0)}return r},ee=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return n[e];const s=e.split(t);let i=n;for(let r=0;r<s.length;){if(!i||typeof i!="object")return;let a,o="";for(let u=r;u<s.length;++u)if(u!==r&&(o+=t),o+=s[u],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<s.length-1)continue;r+=u-r+1;break}i=a}return i},J=n=>n&&n.replace("_","-"),ct={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console&&console[n]&&console[n].apply(console,e)}};class W{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||ct,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(g(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new W(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new W(this.logger,e)}}var P=new W;class Q{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(t)||0;this.observers[s].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o.apply(o,[e,...s])})}}class fe extends Q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):g(s)&&r?o.push(...s.split(r)):o.push(s)));const u=B(this.data,o);return!u&&!t&&!s&&e.indexOf(".")>-1&&(e=o[0],t=o[1],s=o.slice(2).join(".")),u||!a||!g(s)?u:ee(this.data&&this.data[e]&&this.data[e][t],s,r)}addResource(e,t,s,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(o=e.split("."),i=t,t=o[1]),this.addNamespaces(t),de(this.data,o,i),r.silent||this.emit("added",e,t,s,i)}addResources(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in s)(g(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),i=s,s=t,t=o[1]),this.addNamespaces(t);let u=B(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Ce(u,s,r):u={...u,...s},de(this.data,o,u),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var ke={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,s,i){return n.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,t,s,i))}),e}};const he={};class G extends Q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ut(e,s,i);if(a&&!o){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:g(r)?[r]:r};const c=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(i)}return{key:e,namespaces:g(r)?[r]:r}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],t),u=o[o.length-1],c=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const b=t.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${b}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${b}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:a}const h=this.resolve(e,t);let l=h&&h.res;const f=h&&h.usedKey||a,p=h&&h.exactUsedKey||a,x=Object.prototype.toString.apply(l),y=["[object Number]","[object Function]","[object RegExp]"],C=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,R=!g(l)&&typeof l!="boolean"&&typeof l!="number";if(w&&l&&R&&y.indexOf(x)<0&&!(g(C)&&Array.isArray(l))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,l,{...t,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=b,h.usedParams=this.getUsedParamsDetails(t),h):b}if(r){const b=Array.isArray(l),L=b?[]:{},N=b?p:f;for(const v in l)if(Object.prototype.hasOwnProperty.call(l,v)){const M=`${N}${r}${v}`;L[v]=this.translate(M,{...t,joinArrays:!1,ns:o}),L[v]===M&&(L[v]=l[v])}l=L}}else if(w&&g(C)&&Array.isArray(l))l=l.join(C),l&&(l=this.extendTranslation(l,e,t,s));else{let b=!1,L=!1;const N=t.count!==void 0&&!g(t.count),v=G.hasDefaultValue(t),M=N?this.pluralResolver.getSuffix(c,t.count,t):"",Re=t.ordinal&&N?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",te=N&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),T=te&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${M}`]||t[`defaultValue${Re}`]||t.defaultValue;!this.isValidLookup(l)&&v&&(b=!0,l=T),this.isValidLookup(l)||(L=!0,l=a);const Pe=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:l,A=v&&T!==l&&this.options.updateMissing;if(L||b||A){if(this.logger.log(A?"updateKey":"missingKey",c,u,a,A?T:l),r){const O=this.resolve(a,{...t,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let F=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let O=0;O<z.length;O++)F.push(z[O]);else this.options.saveMissingTo==="all"?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);const se=(O,E,D)=>{const ne=v&&D!==l?D:Pe;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,E,ne,A,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(O,u,E,ne,A,t),this.emit("missingKey",O,u,E,l)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?F.forEach(O=>{const E=this.pluralResolver.getSuffixes(O,t);te&&t[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(D=>{se([O],a+D,t[`defaultValue${D}`]||T)})}):se(F,a,T))}l=this.extendTranslation(l,e,t,h,s),L&&l===a&&this.options.appendNamespaceToMissingKey&&(l=`${u}:${a}`),(L||b)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?l=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,b?l:void 0):l=this.options.parseMissingKeyHandler(l))}return i?(h.res=l,h.usedParams=this.getUsedParamsDetails(t),h):l}extendTranslation(e,t,s,i,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=g(e)&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const l=e.match(this.interpolator.nestingRegexp);d=l&&l.length}let h=s.replace&&!g(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,s.lng||this.language||i.usedLng,s),c){const l=e.match(this.interpolator.nestingRegexp),f=l&&l.length;d<f&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var l=arguments.length,f=new Array(l),p=0;p<l;p++)f[p]=arguments[p];return r&&r[0]===f[0]&&!s.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):a.translate(...f,t)},s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,u=g(o)?[o]:o;return e!=null&&u&&u.length&&s.applyPostProcessor!==!1&&(e=ke.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,i,r,a,o;return g(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(u,t),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const l=t.count!==void 0&&!g(t.count),f=l&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),p=t.context!==void 0&&(g(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(y=>{this.isValidLookup(s)||(o=y,!he[`${x[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(he[`${x[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(C=>{if(this.isValidLookup(s))return;a=C;const w=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,C,y,t);else{let b;l&&(b=this.pluralResolver.getSuffix(C,t.count,t));const L=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(w.push(d+b),t.ordinal&&b.indexOf(N)===0&&w.push(d+b.replace(N,this.options.pluralSeparator)),f&&w.push(d+L)),p){const v=`${d}${this.options.contextSeparator}${t.context}`;w.push(v),l&&(w.push(v+b),t.ordinal&&b.indexOf(N)===0&&w.push(v+b.replace(N,this.options.pluralSeparator)),f&&w.push(v+L))}}let R;for(;R=w.pop();)this.isValidLookup(s)||(r=R,s=this.getResource(C,y,R,t))}))})}),{res:s,usedKey:i,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!g(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const r of t)delete i[r]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}const q=n=>n.charAt(0).toUpperCase()+n.slice(1);class ge{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(g(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(i=>i.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=q(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=q(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=q(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(r=>{if(r===i)return r;if(!(r.indexOf("-")<0&&i.indexOf("-")<0)&&(r.indexOf("-")>0&&i.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===i||r.indexOf(i)===0&&i.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),g(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return g(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):g(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{i.indexOf(a)<0&&r(this.formatLanguageCode(a))}),i}}let dt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ft={1:n=>+(n>1),2:n=>+(n!=1),3:n=>0,4:n=>n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,5:n=>n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5,6:n=>n==1?0:n>=2&&n<=4?1:2,7:n=>n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,8:n=>n==1?0:n==2?1:n!=8&&n!=11?2:3,9:n=>+(n>=2),10:n=>n==1?0:n==2?1:n<7?2:n<11?3:4,11:n=>n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3,12:n=>+(n%10!=1||n%100==11),13:n=>+(n!==0),14:n=>n==1?0:n==2?1:n==3?2:3,15:n=>n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2,16:n=>n%10==1&&n%100!=11?0:n!==0?1:2,17:n=>n==1||n%10==1&&n%100!=11?0:1,18:n=>n==0?0:n==1?1:2,19:n=>n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3,20:n=>n==1?0:n==0||n%100>0&&n%100<20?1:2,21:n=>n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0,22:n=>n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3};const ht=["v1","v2","v3"],gt=["v4"],pe={zero:0,one:1,two:2,few:3,many:4,other:5},pt=()=>{const n={};return dt.forEach(e=>{e.lngs.forEach(t=>{n[t]={numbers:e.nr,plurals:ft[e.fc]}})}),n};class mt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),(!this.options.compatibilityJSON||gt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=pt(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const s=J(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:i})}catch{if(!e.match(/-|_/))return;const u=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(u,t)}return this.pluralRulesCache[r]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,s).map(i=>`${t}${i}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((i,r)=>pe[i]-pe[r]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):s.numbers.map(i=>this.getSuffix(e,i,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,s);return i?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:this.getSuffixRetroCompatible(i,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let i=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const r=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!ht.includes(this.options.compatibilityJSON)}}const me=function(n,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=nt(n,e,t);return!r&&i&&g(t)&&(r=ee(n,t,s),r===void 0&&(r=ee(e,t,s))),r},Z=n=>n.replace(/\$/g,"$$$$");class bt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:l,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:x,nestingOptionsSeparator:y,maxReplaces:C,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:rt,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=r?j(r):a||"{{",this.suffix=o?j(o):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=l?j(l):f||j("$t("),this.nestingSuffix=p?j(p):x||j(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=C||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t&&t.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let r,a,o;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const C=me(t,u,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,s,{...i,...t,interpolationkey:f}):C}const p=f.split(this.formatSeparator),x=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(me(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),y,s,{...i,...t,interpolationkey:x})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>Z(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?Z(this.escape(f)):Z(f)}].forEach(f=>{for(o=0;r=f.regex.exec(e);){const p=r[1].trim();if(a=c(p),a===void 0)if(typeof d=="function"){const y=d(e,r,i);a=g(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))a="";else if(h){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!g(a)&&!this.useRawValueToEscape&&(a=le(a));const x=f.safeValue(a);if(e=e.replace(r[0],x),h?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,r,a;const o=(u,c)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const h=u.split(new RegExp(`${d}[ ]*{`));let l=`{${h[1]}`;u=h[0],l=this.interpolate(l,a);const f=l.match(/'/g),p=l.match(/"/g);(f&&f.length%2===0&&!p||p.length%2!==0)&&(l=l.replace(/'/g,'"'));try{a=JSON.parse(l),c&&(a={...c,...a})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,x),`${u}${d}${l}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(e);){let u=[];a={...s},a=a.replace&&!g(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),u=d,c=!0}if(r=t(o.call(this,i[1].trim(),a),a),r&&i[0]===e&&!g(r))return r;g(r)||(r=le(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),c&&(r=u.reduce((d,h)=>this.format(d,h,s.lng,{...s,interpolationkey:i[1].trim()}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}const yt=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const s=n.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...u]=a.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),d=o.trim();t[d]||(t[d]=c),c==="false"&&(t[d]=!1),c==="true"&&(t[d]=!0),isNaN(c)||(t[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},I=n=>{const e={};return(t,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=n(J(s),i),e[a]=o),o(t)}};class xt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("formatter"),this.options=e,this.formats={number:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return r=>i.format(r)}),currency:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return r=>i.format(r)}),datetime:I((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return r=>i.format(r)}),relativetime:I((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return r=>i.format(r,s.range||"day")}),list:I((t,s)=>{const i=new Intl.ListFormat(t,{...s});return r=>i.format(r)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=I(t)}format(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(o=>o.indexOf(")")>-1)){const o=r.findIndex(u=>u.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,u)=>{const{formatName:c,formatOptions:d}=yt(u);if(this.formats[c]){let h=o;try{const l=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},f=l.locale||l.lng||i.locale||i.lng||s;h=this.formats[c](o,f,{...d,...i,...l})}catch(l){this.logger.warn(l)}return h}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const St=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class vt extends Q{constructor(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(e,t,s,i){const r={},a={},o={},u={};return e.forEach(c=>{let d=!0;t.forEach(h=>{const l=`${c}|${h}`;!s.reload&&this.store.hasResourceBundle(c,h)?this.state[l]=2:this.state[l]<0||(this.state[l]===1?a[l]===void 0&&(a[l]=!0):(this.state[l]=1,d=!1,a[l]===void 0&&(a[l]=!0),r[l]===void 0&&(r[l]=!0),u[h]===void 0&&(u[h]=!0)))}),d||(o[c]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(u)}}loaded(e,t,s){const i=e.split("|"),r=i[0],a=i[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(u=>{st(u.loaded,[r],a),St(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{o[c]||(o[c]={});const d=u.loaded[c];d.length&&d.forEach(h=>{o[c][h]===void 0&&(o[c][h]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.done)}read(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:r,callback:a});return}this.readingCalls++;const o=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,i+1,r*2,a)},r);return}a(c,d)},u=this.backend[s].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(d=>o(null,d)).catch(o):o(null,c)}catch(c){o(c)}return}return u(e,t,o)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();g(e)&&(e=this.languageUtils.toResolveHierarchy(e)),g(t)&&(t=[t]);const r=this.queueLoad(e,t,s,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),i=s[0],r=s[1];this.read(i,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,t,s,i,u):d=c(e,t,s,i),d&&typeof d.then=="function"?d.then(h=>o(null,h)).catch(o):o(null,d)}catch(d){o(d)}else c(e,t,s,i,o,u)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const be=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),g(n[1])&&(e.defaultValue=n[1]),g(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ye=n=>(g(n.ns)&&(n.ns=[n.ns]),g(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),g(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n),H=()=>{},wt=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class K extends Q{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=ye(e),this.services={},this.logger=P,this.modules={external:[]},wt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(g(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=be();this.options={...i,...this.options,...ye(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?P.init(r(this.modules.logger),this.options):P.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=xt);const h=new ge(this.options);this.store=new fe(this.options.resources,this.options);const l=this.services;l.logger=P,l.resourceStore=this.store,l.languageUtils=h,l.pluralResolver=new mt(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(l.formatter=r(d),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new bt(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new vt(r(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.languageDetector&&(l.languageDetector=r(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=r(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new G(this.services,this.options),this.translator.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,s||(s=H),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const u=U(),c=()=>{const d=(h,l)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(l),s(h,l)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),u}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const i=g(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&r.indexOf(c)<0&&r.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const i=U();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=H),this.services.backendConnector.reload(e,t,r=>{i.resolve(),s(r)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ke.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const i=U();this.emit("languageChanging",e);const r=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return s.t(...arguments)}),t&&t(u,function(){return s.t(...arguments)})},o=u=>{!e&&!u&&this.services.languageDetector&&(u=[]);const c=g(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,t,s){var i=this;const r=function(a,o){let u;if(typeof o!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];u=i.options.overloadTranslationOptionHandler([a,o].concat(d))}else u={...o};u.lng=u.lng||r.lng,u.lngs=u.lngs||r.lngs,u.ns=u.ns||r.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||s||r.keyPrefix);const l=i.options.keySeparator||".";let f;return u.keyPrefix&&Array.isArray(a)?f=a.map(p=>`${u.keyPrefix}${l}${p}`):f=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,i.t(f,u)};return g(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=s,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=this.services.backendConnector.state[`${o}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!i||a(r,e)))}loadNamespaces(e,t){const s=U();return this.options.ns?(g(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=U();g(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=i.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new ge(be());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new K(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},r=new K(i);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s&&(r.store=new fe(this.store.data,i),r.services.resourceStore=r.store),r.translator=new G(r.services,i),r.translator.on("*",function(o){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];r.emit(o,...c)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const k=K.createInstance();k.createInstance=K.createInstance;k.createInstance;k.dir;k.init;k.loadResources;k.reloadResources;k.use;k.changeLanguage;k.getFixedT;k.t;k.exists;k.setDefaultNamespace;k.hasLoadedNamespace;k.loadNamespaces;k.loadLanguages;const Lt={title:"Skill Studio — Preferences",brand:"Skill Studio",browserCallout:"Some preferences require the Skill Studio desktop app.",downloadLink:"Download for Mac, Windows, or Linux",downloadUrl:"https://verified-skill.com/download"},Nt={general:"General",updates:"Updates",privacy:"Privacy",advanced:"Advanced"},Ct={heading:"General",subheading:"Appearance and project defaults.",theme:{label:"Appearance",system:"System",light:"Light",dark:"Dark",help:"Match the system or pick a fixed theme."},launchAtLogin:{label:"Launch Skill Studio at login",help:"Open Skill Studio automatically when you sign in.",browserDisabled:"Available in the desktop app.",errorAdmin:"Couldn't change launch at login. Your administrator may have disabled this.",openSettings:"Open System Settings"},defaultProject:{label:"Default project folder",help:"New projects start here unless you choose another location.",notSet:"(not set)",choose:"Choose folder…"},language:{label:"Language",help:"Currently English only. More languages will arrive in a future release.",english:"English"}},kt={heading:"Updates",subheading:"Stay current with the latest Skill Studio.",currentVersion:"Current version",channel:{label:"Update channel",stable:"Stable",beta:"Beta",betaUnavailable:"No beta release yet — we'll check back later.",help:"Stable releases are recommended. Beta delivers previews of upcoming features."},autoCheck:{label:"Check for updates automatically",help:"Skill Studio will check daily and notify you when an update is ready."},checkNow:"Check for updates",checking:"Checking…",upToDate:"Skill Studio is up to date.",updateAvailable:"Update available: {{version}}",lastChecked:"Last checked",lastCheckedNever:"Never",lastCheckedAgo:"{{relative}}",errors:{network:"Couldn't reach the update server. Check your connection and try again.",signature:"Update signature invalid — refusing to install.",diskSpace:"Not enough disk space to install the update.",tryAgain:"Try again",viewLogs:"View logs"},dialog:{title:"Update available",version:"Version {{version}}",releaseNotes:"Release notes",noReleaseNotes:"Release notes not provided.",installNow:"Install now",later:"Later",skipVersion:"Skip this version",downloading:"Downloading update…",preparing:"Preparing update…",restartRequired:"Restart required to finish installing.",restartNow:"Restart now",onQuit:"Install on quit",cancel:"Cancel"},browserCallout:"Updates are managed by the desktop app. Run npm i -g vskill@latest to update the CLI.",about:{heading:"About",build:"Build",commit:"Commit",links:{openSource:"Open source licenses",website:"Visit verified-skill.com",acknowledgements:"Acknowledgements"}}},Ot={heading:"Privacy",subheading:"Decide what Skill Studio shares with us.",telemetry:{label:"Send anonymous usage telemetry",help:"Helps us improve Skill Studio. Disabled by default. No personal data is collected."},crash:{label:"Send anonymized crash reports",help:"Sends a small report when Skill Studio crashes so we can fix it."},openLogs:{label:"Open logs folder",help:"Inspect log files to audit what Skill Studio records on your machine.",browserHidden:"Logs are stored on the desktop app only."},disclosure:"Skill Studio v1 does not currently emit telemetry. These switches reserve your preference for when telemetry ships."},Rt={heading:"Advanced",subheading:"Diagnostics and reset.",logLevel:{label:"Log level",help:"Higher levels emit more diagnostic detail. Defaults to Info.",error:"Error",warn:"Warning",info:"Info",debug:"Debug",trace:"Trace"},settingsPath:{label:"Settings file",help:"Where your preferences live on disk.",reveal:"Reveal in Finder",copy:"Copy path",copied:"Copied",browserValue:"Stored in this browser's local storage"},factoryReset:{label:"Factory reset",help:"Reset all preferences to their defaults. Recent projects and your keychain are preserved.",button:"Reset all preferences…",confirmTitle:"Reset all preferences?",confirmBody:"This will return every Skill Studio preference to its default value. Recent projects and API keys stored in your system keychain are not affected.",confirm:"Reset",cancel:"Cancel",done:"Preferences reset to defaults."}},Pt={save:"Save",cancel:"Cancel",close:"Close",loading:"Loading…",browserMode:"Browser mode",desktopOnly:"Desktop only"},Et={app:Lt,tabs:Nt,general:Ct,updates:kt,privacy:Ot,advanced:Rt,common:Pt},Oe=k.createInstance();Oe.use(Ye).init({lng:"en",fallbackLng:"en",ns:["preferences"],defaultNS:"preferences",resources:{en:{preferences:Et}},interpolation:{escapeValue:!1},returnNull:!1});function zt({checked:n,onChange:e,disabled:t,ariaLabel:s,id:i}){return m.jsx("button",{id:i,type:"button",role:"switch","aria-checked":n,"aria-label":s,"aria-disabled":t||void 0,className:"pref-toggle",onClick:()=>!t&&e(!n),disabled:t})}function Ht({options:n,value:e,onChange:t,disabled:s,ariaLabel:i}){return m.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,className:"pref-segmented",children:n.map(r=>m.jsx("button",{type:"button",role:"radio","aria-checked":e===r.value,disabled:s,onClick:()=>!s&&t(r.value),children:r.label},r.value))})}function Bt({label:n,help:e,control:t,stacked:s}){return m.jsxs("div",{className:`pref-row${s?" pref-row--stacked":""}`,children:[m.jsxs("div",{className:"pref-row__label",children:[m.jsx("span",{className:"pref-row__label-text",children:n}),e?m.jsx("span",{className:"pref-row__help",children:e}):null]}),m.jsx("div",{children:t})]})}function Jt({title:n,children:e,style:t}){return m.jsxs("section",{className:"pref-section",style:t,children:[n?m.jsx("h2",{className:"pref-section__title",children:n}):null,e]})}function Wt({variant:n="info",children:e}){return m.jsx("div",{role:"note",className:`pref-callout${n==="info"?" pref-callout--info":""}`,children:e})}function Gt({open:n,onDismiss:e,ariaLabel:t,children:s}){const i=S.useRef(null);return S.useEffect(()=>{var a;if(!n)return;const r=o=>{o.key==="Escape"&&e&&e()};return document.addEventListener("keydown",r),(a=i.current)==null||a.focus(),()=>document.removeEventListener("keydown",r)},[n,e]),n?m.jsx("div",{className:"pref-dialog-overlay",onClick:r=>{r.target===r.currentTarget&&e&&e()},children:m.jsx("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"pref-dialog",children:s})}):null}function $t({toasts:n,onDismiss:e}){return S.useEffect(()=>{if(n.length===0)return;const t=n.map(s=>window.setTimeout(()=>e(s.id),s.variant==="error"?8e3:4e3));return()=>t.forEach(s=>window.clearTimeout(s))},[n,e]),m.jsx("div",{className:"pref-toast-stack",role:"status","aria-live":"polite",children:n.map(t=>m.jsxs("div",{className:`pref-toast${t.variant==="error"?" pref-toast--error":""}`,children:[m.jsx("span",{children:t.message}),t.actions&&t.actions.length>0?m.jsx("div",{className:"pref-toast__actions",children:t.actions.map(s=>m.jsx("button",{type:"button",className:"pref-button",onClick:()=>{s.onClick(),e(t.id)},children:s.label},s.label))}):null]},t.id))})}const jt=S.lazy(()=>Y(()=>import("./GeneralTab-DYR9NWC4.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.GeneralTab}))),It=S.lazy(()=>Y(()=>import("./UpdatesTab-DwJIUDPX.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>({default:n.UpdatesTab}))),Tt=S.lazy(()=>Y(()=>import("./PrivacyTab-CXIqQokl.js"),__vite__mapDeps([6,1,2,3,4])).then(n=>({default:n.PrivacyTab}))),At=S.lazy(()=>Y(()=>import("./AdvancedTab-D8zbE5fH.js"),__vite__mapDeps([7,1,2,3,4])).then(n=>({default:n.AdvancedTab}))),xe=[{key:"general",iconChar:"⚙",shortcut:"1"},{key:"updates",iconChar:"↻",shortcut:"2"},{key:"privacy",iconChar:"⚓",shortcut:"3"},{key:"advanced",iconChar:"⁂",shortcut:"4"}];function Se(){const n=typeof window<"u"&&window.location.hash.slice(1)||"general";return n==="general"||n==="updates"||n==="privacy"||n==="advanced"?n:"general"}function Ft(){const{t:n}=Xe("preferences"),e=Ie(),{snapshot:t,refresh:s}=Te(e),[i,r]=S.useState(()=>Se()),[a,o]=S.useState(0),[u,c]=S.useState([]),d=S.useCallback(l=>{c(f=>[...f,{...l,id:`t-${Date.now()}-${Math.random()}`}])},[]),h=S.useCallback(l=>{c(f=>f.filter(p=>p.id!==l))},[]);return S.useEffect(()=>{const l=()=>r(Se());return window.addEventListener("hashchange",l),()=>window.removeEventListener("hashchange",l)},[]),S.useEffect(()=>{if(!e.available)return;let l=null;return Ae("preferences-trigger-check",()=>{r("updates"),o(f=>f+1)}).then(f=>{l=f}),()=>{l==null||l()}},[e.available]),S.useEffect(()=>{window.location.hash.slice(1)!==i&&window.history.replaceState(null,"",`#${i}`)},[i]),S.useEffect(()=>{const l=f=>{if(!(f.metaKey||f.ctrlKey))return;const x=parseInt(f.key,10);if(Number.isNaN(x))return;const y=xe[x-1];y&&(f.preventDefault(),r(y.key))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),S.useEffect(()=>{if(!t)return;const l=t.general.theme;if(l==="system"){const f=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{document.documentElement.dataset.theme=f.matches?"dark":"light",document.documentElement.dataset.themeMode="auto"};return p(),f.addEventListener("change",p),()=>f.removeEventListener("change",p)}document.documentElement.dataset.theme=l,document.documentElement.dataset.themeMode=l},[t]),m.jsxs("div",{className:"preferences-window",children:[m.jsxs("nav",{className:"preferences-sidebar","aria-label":n("app.title"),children:[m.jsx("div",{className:"preferences-sidebar__brand",children:n("app.brand")}),xe.map(l=>m.jsxs("button",{type:"button",className:"preferences-nav-item","aria-current":i===l.key?"page":void 0,onClick:()=>r(l.key),children:[m.jsx("span",{"aria-hidden":"true",className:"preferences-nav-item__icon",children:l.iconChar}),m.jsx("span",{children:n(`tabs.${l.key}`)}),m.jsxs("span",{className:"preferences-nav-item__shortcut","aria-hidden":"true",children:[/^Mac/i.test(navigator.platform)?"⌘":"Ctrl+",l.shortcut]})]},l.key))]}),m.jsx("main",{className:"preferences-content","data-active-tab":i,children:m.jsxs(S.Suspense,{fallback:m.jsx("div",{className:"pref-status-row",children:n("common.loading")}),children:[i==="general"?m.jsx(jt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="updates"?m.jsx(It,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d,triggerCheckNonce:a}):null,i==="privacy"?m.jsx(Tt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="advanced"?m.jsx(At,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null]})}),m.jsx($t,{toasts:u,onDismiss:h})]})}je.createRoot(document.getElementById("root")).render(m.jsx(S.StrictMode,{children:m.jsx(_e,{i18n:Oe,children:m.jsx(Ft,{})})}));export{Wt as C,Gt as D,Bt as F,Jt as S,zt as T,Ht as a,Xe as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GeneralTab-AwK9sIkP.js","assets/globals-hm1COkXX.js","assets/globals-Dpf9KmYH.css","assets/useDesktopBridge-9oZFQsrw.js","assets/fonts-i7Lkz2zN.css","assets/UpdatesTab-DTmo-vVb.js","assets/PrivacyTab-BtNrxpVV.js","assets/AdvancedTab-DOgbx7u0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Ee=Object.defineProperty;var $e=(n,e,t)=>e in n?Ee(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ie=(n,e,t)=>$e(n,typeof e!="symbol"?e+"":e,t);import{r as S,j as m,c as je}from"./globals-hm1COkXX.js";/* empty css */import{_ as Y,u as Ie,a as Te,l as Ae}from"./useDesktopBridge-9oZFQsrw.js";function Fe(){if(console&&console.warn){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&(e[0]=`react-i18next:: ${e[0]}`),console.warn(...e)}}const re={};function X(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];$(e[0])&&re[e[0]]||($(e[0])&&(re[e[0]]=new Date),Fe(...e))}const ve=(n,e)=>()=>{if(n.isInitialized)e();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),e()};n.on("initialized",t)}},ae=(n,e,t)=>{n.loadNamespaces(e,ve(n,t))},oe=(n,e,t,s)=>{$(t)&&(t=[t]),t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(e,ve(n,s))},De=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=e.languages[0],i=e.options?e.options.fallbackLng:!1,r=e.languages[e.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=e.services.backendConnector.state[`${o}|${u}`];return c===-1||c===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(s,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||a(s,n)&&(!i||a(r,n)))},Ue=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(X("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(n,{lng:t.lng,precheck:(i,r)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!r(i.isLanguageChangingTo,n))return!1}}):De(n,e,t)},$=n=>typeof n=="string",Ve=n=>typeof n=="object"&&n!==null,Ke=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Me={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ze=n=>Me[n],He=n=>n.replace(Ke,ze);let _={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:He};const Be=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_={..._,...n}},Je=()=>_;let we;const We=n=>{we=n},Ge=()=>we,Ye={type:"3rdParty",init(n){Be(n.options.react),We(n)}},Le=S.createContext();class Qe{constructor(){ie(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}}const qe=(n,e)=>{const t=S.useRef();return S.useEffect(()=>{t.current=n},[n,e]),t.current},Ne=(n,e,t,s)=>n.getFixedT(e,t,s),Ze=(n,e,t,s)=>S.useCallback(Ne(n,e,t,s),[n,e,t,s]),Xe=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:t}=e,{i18n:s,defaultNS:i}=S.useContext(Le)||{},r=t||s||Ge();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new Qe),!r){X("You will need to pass in an i18next instance by using initReactI18next");const b=(N,v)=>$(v)?v:Ve(v)&&$(v.defaultValue)?v.defaultValue:Array.isArray(N)?N[N.length-1]:N,L=[b,{},!1];return L.t=b,L.i18n={},L.ready=!1,L}r.options.react&&r.options.react.wait!==void 0&&X("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...Je(),...r.options.react,...e},{useSuspense:o,keyPrefix:u}=a;let c=n;c=$(c)?[c]:c||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(c);const d=(r.isInitialized||r.initializedStoreOnce)&&c.every(b=>Ue(b,r,a)),h=Ze(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),l=()=>h,f=()=>Ne(r,e.lng||null,a.nsMode==="fallback"?c:c[0],u),[p,x]=S.useState(l);let y=c.join();e.lng&&(y=`${e.lng}${y}`);const C=qe(y),w=S.useRef(!0);S.useEffect(()=>{const{bindI18n:b,bindI18nStore:L}=a;w.current=!0,!d&&!o&&(e.lng?oe(r,e.lng,c,()=>{w.current&&x(f)}):ae(r,c,()=>{w.current&&x(f)})),d&&C&&C!==y&&w.current&&x(f);const N=()=>{w.current&&x(f)};return b&&r&&r.on(b,N),L&&r&&r.store.on(L,N),()=>{w.current=!1,b&&r&&b.split(" ").forEach(v=>r.off(v,N)),L&&r&&L.split(" ").forEach(v=>r.store.off(v,N))}},[r,y]),S.useEffect(()=>{w.current&&d&&x(l)},[r,u,d]);const R=[p,r,d];if(R.t=p,R.i18n=r,R.ready=d,d||!d&&!o)return R;throw new Promise(b=>{e.lng?oe(r,e.lng,c,()=>b()):ae(r,c,()=>b())})};function _e(n){let{i18n:e,defaultNS:t,children:s}=n;const i=S.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return S.createElement(Le.Provider,{value:i},s)}const g=n=>typeof n=="string",U=()=>{let n,e;const t=new Promise((s,i)=>{n=s,e=i});return t.resolve=n,t.reject=e,t},le=n=>n==null?"":""+n,et=(n,e,t)=>{n.forEach(s=>{e[s]&&(t[s]=e[s])})},tt=/###/g,ue=n=>n&&n.indexOf("###")>-1?n.replace(tt,"."):n,ce=n=>!n||g(n),V=(n,e,t)=>{const s=g(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(ce(n))return{};const r=ue(s[i]);!n[r]&&t&&(n[r]=new t),Object.prototype.hasOwnProperty.call(n,r)?n=n[r]:n={},++i}return ce(n)?{}:{obj:n,k:ue(s[i])}},de=(n,e,t)=>{const{obj:s,k:i}=V(n,e,Object);if(s!==void 0||e.length===1){s[i]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=V(n,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=V(n,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},st=(n,e,t,s)=>{const{obj:i,k:r}=V(n,e,Object);i[r]=i[r]||[],i[r].push(t)},B=(n,e)=>{const{obj:t,k:s}=V(n,e);if(t)return t[s]},nt=(n,e,t)=>{const s=B(n,t);return s!==void 0?s:B(e,t)},Ce=(n,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in n?g(n[s])||n[s]instanceof String||g(e[s])||e[s]instanceof String?t&&(n[s]=e[s]):Ce(n[s],e[s],t):n[s]=e[s]);return n},j=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var it={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const rt=n=>g(n)?n.replace(/[&<>"'\/]/g,e=>it[e]):n;class at{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const ot=[" ",",","?","!",";"],lt=new at(20),ut=(n,e,t)=>{e=e||"",t=t||"";const s=ot.filter(a=>e.indexOf(a)<0&&t.indexOf(a)<0);if(s.length===0)return!0;const i=lt.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!i.test(n);if(!r){const a=n.indexOf(t);a>0&&!i.test(n.substring(0,a))&&(r=!0)}return r},ee=function(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!n)return;if(n[e])return n[e];const s=e.split(t);let i=n;for(let r=0;r<s.length;){if(!i||typeof i!="object")return;let a,o="";for(let u=r;u<s.length;++u)if(u!==r&&(o+=t),o+=s[u],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<s.length-1)continue;r+=u-r+1;break}i=a}return i},J=n=>n&&n.replace("_","-"),ct={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console&&console[n]&&console[n].apply(console,e)}};class W{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||ct,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,i){return i&&!this.debug?null:(g(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new W(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new W(this.logger,e)}}var P=new W;class Q{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(t)||0;this.observers[s].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o(...s)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,u]=a;for(let c=0;c<u;c++)o.apply(o,[e,...s])})}}class fe extends Q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):g(s)&&r?o.push(...s.split(r)):o.push(s)));const u=B(this.data,o);return!u&&!t&&!s&&e.indexOf(".")>-1&&(e=o[0],t=o[1],s=o.slice(2).join(".")),u||!a||!g(s)?u:ee(this.data&&this.data[e]&&this.data[e][t],s,r)}addResource(e,t,s,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.indexOf(".")>-1&&(o=e.split("."),i=t,t=o[1]),this.addNamespaces(t),de(this.data,o,i),r.silent||this.emit("added",e,t,s,i)}addResources(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in s)(g(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});i.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),i=s,s=t,t=o[1]),this.addNamespaces(t);let u=B(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?Ce(u,s,r):u={...u,...s},de(this.data,o,u),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var ke={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,s,i){return n.forEach(r=>{this.processors[r]&&(e=this.processors[r].process(e,t,s,i))}),e}};const he={};class G extends Q{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=P.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const s=this.resolve(e,t);return s&&s.res!==void 0}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.indexOf(s)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!ut(e,s,i);if(a&&!o){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:g(r)?[r]:r};const c=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(c[0])>-1)&&(r=c.shift()),e=c.join(i)}return{key:e,namespaces:g(r)?[r]:r}}translate(e,t,s){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],t),u=o[o.length-1],c=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const b=t.nsSeparator||this.options.nsSeparator;return i?{res:`${u}${b}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${b}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:a}const h=this.resolve(e,t);let l=h&&h.res;const f=h&&h.usedKey||a,p=h&&h.exactUsedKey||a,x=Object.prototype.toString.apply(l),y=["[object Number]","[object Function]","[object RegExp]"],C=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject,R=!g(l)&&typeof l!="boolean"&&typeof l!="number";if(w&&l&&R&&y.indexOf(x)<0&&!(g(C)&&Array.isArray(l))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,l,{...t,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=b,h.usedParams=this.getUsedParamsDetails(t),h):b}if(r){const b=Array.isArray(l),L=b?[]:{},N=b?p:f;for(const v in l)if(Object.prototype.hasOwnProperty.call(l,v)){const M=`${N}${r}${v}`;L[v]=this.translate(M,{...t,joinArrays:!1,ns:o}),L[v]===M&&(L[v]=l[v])}l=L}}else if(w&&g(C)&&Array.isArray(l))l=l.join(C),l&&(l=this.extendTranslation(l,e,t,s));else{let b=!1,L=!1;const N=t.count!==void 0&&!g(t.count),v=G.hasDefaultValue(t),M=N?this.pluralResolver.getSuffix(c,t.count,t):"",Re=t.ordinal&&N?this.pluralResolver.getSuffix(c,t.count,{ordinal:!1}):"",te=N&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),T=te&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${M}`]||t[`defaultValue${Re}`]||t.defaultValue;!this.isValidLookup(l)&&v&&(b=!0,l=T),this.isValidLookup(l)||(L=!0,l=a);const Pe=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:l,A=v&&T!==l&&this.options.updateMissing;if(L||b||A){if(this.logger.log(A?"updateKey":"missingKey",c,u,a,A?T:l),r){const O=this.resolve(a,{...t,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let F=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let O=0;O<z.length;O++)F.push(z[O]);else this.options.saveMissingTo==="all"?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);const se=(O,E,D)=>{const ne=v&&D!==l?D:Pe;this.options.missingKeyHandler?this.options.missingKeyHandler(O,u,E,ne,A,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(O,u,E,ne,A,t),this.emit("missingKey",O,u,E,l)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?F.forEach(O=>{const E=this.pluralResolver.getSuffixes(O,t);te&&t[`defaultValue${this.options.pluralSeparator}zero`]&&E.indexOf(`${this.options.pluralSeparator}zero`)<0&&E.push(`${this.options.pluralSeparator}zero`),E.forEach(D=>{se([O],a+D,t[`defaultValue${D}`]||T)})}):se(F,a,T))}l=this.extendTranslation(l,e,t,h,s),L&&l===a&&this.options.appendNamespaceToMissingKey&&(l=`${u}:${a}`),(L||b)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?l=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${a}`:a,b?l:void 0):l=this.options.parseMissingKeyHandler(l))}return i?(h.res=l,h.usedParams=this.getUsedParamsDetails(t),h):l}extendTranslation(e,t,s,i,r){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const c=g(e)&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const l=e.match(this.interpolator.nestingRegexp);d=l&&l.length}let h=s.replace&&!g(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,s.lng||this.language||i.usedLng,s),c){const l=e.match(this.interpolator.nestingRegexp),f=l&&l.length;d<f&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var l=arguments.length,f=new Array(l),p=0;p<l;p++)f[p]=arguments[p];return r&&r[0]===f[0]&&!s.context?(a.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${t[0]}`),null):a.translate(...f,t)},s)),s.interpolation&&this.interpolator.reset()}const o=s.postProcess||this.options.postProcess,u=g(o)?[o]:o;return e!=null&&u&&u.length&&s.applyPostProcessor!==!1&&(e=ke.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,i,r,a,o;return g(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(s))return;const c=this.extractFromKey(u,t),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const l=t.count!==void 0&&!g(t.count),f=l&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),p=t.context!==void 0&&(g(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);h.forEach(y=>{this.isValidLookup(s)||(o=y,!he[`${x[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(he[`${x[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(C=>{if(this.isValidLookup(s))return;a=C;const w=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,C,y,t);else{let b;l&&(b=this.pluralResolver.getSuffix(C,t.count,t));const L=`${this.options.pluralSeparator}zero`,N=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(w.push(d+b),t.ordinal&&b.indexOf(N)===0&&w.push(d+b.replace(N,this.options.pluralSeparator)),f&&w.push(d+L)),p){const v=`${d}${this.options.contextSeparator}${t.context}`;w.push(v),l&&(w.push(v+b),t.ordinal&&b.indexOf(N)===0&&w.push(v+b.replace(N,this.options.pluralSeparator)),f&&w.push(v+L))}}let R;for(;R=w.pop();)this.isValidLookup(s)||(r=R,s=this.getResource(C,y,R,t))}))})}),{res:s,usedKey:i,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,s,i):this.resourceStore.getResource(e,t,s,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!g(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const r of t)delete i[r]}return i}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t===s.substring(0,t.length)&&e[s]!==void 0)return!0;return!1}}const q=n=>n.charAt(0).toUpperCase()+n.slice(1);class ge{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=P.create("languageUtils")}getScriptPartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=J(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(g(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let i=Intl.getCanonicalLocales(e)[0];if(i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i)return i}catch{}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let s=e.split("-");return this.options.lowerCaseLng?s=s.map(i=>i.toLowerCase()):s.length===2?(s[0]=s[0].toLowerCase(),s[1]=s[1].toUpperCase(),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=q(s[1].toLowerCase()))):s.length===3&&(s[0]=s[0].toLowerCase(),s[1].length===2&&(s[1]=s[1].toUpperCase()),s[0]!=="sgn"&&s[2].length===2&&(s[2]=s[2].toUpperCase()),t.indexOf(s[1].toLowerCase())>-1&&(s[1]=q(s[1].toLowerCase())),t.indexOf(s[2].toLowerCase())>-1&&(s[2]=q(s[2].toLowerCase()))),s.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const i=this.getLanguagePartFromCode(s);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(r=>{if(r===i)return r;if(!(r.indexOf("-")<0&&i.indexOf("-")<0)&&(r.indexOf("-")>0&&i.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===i||r.indexOf(i)===0&&i.length>1))return r})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),g(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],r=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return g(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):g(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{i.indexOf(a)<0&&r(this.formatLanguageCode(a))}),i}}let dt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ft={1:n=>+(n>1),2:n=>+(n!=1),3:n=>0,4:n=>n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,5:n=>n==0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5,6:n=>n==1?0:n>=2&&n<=4?1:2,7:n=>n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2,8:n=>n==1?0:n==2?1:n!=8&&n!=11?2:3,9:n=>+(n>=2),10:n=>n==1?0:n==2?1:n<7?2:n<11?3:4,11:n=>n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3,12:n=>+(n%10!=1||n%100==11),13:n=>+(n!==0),14:n=>n==1?0:n==2?1:n==3?2:3,15:n=>n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2,16:n=>n%10==1&&n%100!=11?0:n!==0?1:2,17:n=>n==1||n%10==1&&n%100!=11?0:1,18:n=>n==0?0:n==1?1:2,19:n=>n==1?0:n==0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3,20:n=>n==1?0:n==0||n%100>0&&n%100<20?1:2,21:n=>n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0,22:n=>n==1?0:n==2?1:(n<0||n>10)&&n%10==0?2:3};const ht=["v1","v2","v3"],gt=["v4"],pe={zero:0,one:1,two:2,few:3,many:4,other:5},pt=()=>{const n={};return dt.forEach(e=>{e.lngs.forEach(t=>{n[t]={numbers:e.nr,plurals:ft[e.fc]}})}),n};class mt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=P.create("pluralResolver"),(!this.options.compatibilityJSON||gt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=pt(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const s=J(e==="dev"?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:i})}catch{if(!e.match(/-|_/))return;const u=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(u,t)}return this.pluralRulesCache[r]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return this.shouldUseIntlApi()?s&&s.resolvedOptions().pluralCategories.length>1:s&&s.numbers.length>1}getPluralFormsOfKey(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,s).map(i=>`${t}${i}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=this.getRule(e,t);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort((i,r)=>pe[i]-pe[r]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):s.numbers.map(i=>this.getSuffix(e,i,t)):[]}getSuffix(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,s);return i?this.shouldUseIntlApi()?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:this.getSuffixRetroCompatible(i,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const s=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let i=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const r=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?r():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}shouldUseIntlApi(){return!ht.includes(this.options.compatibilityJSON)}}const me=function(n,e,t){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=nt(n,e,t);return!r&&i&&g(t)&&(r=ee(n,t,s),r===void 0&&(r=ee(e,t,s))),r},Z=n=>n.replace(/\$/g,"$$$$");class bt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:i,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:u,formatSeparator:c,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:l,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:x,nestingOptionsSeparator:y,maxReplaces:C,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:rt,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=r?j(r):a||"{{",this.suffix=o?j(o):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=l?j(l):f||j("$t("),this.nestingSuffix=p?j(p):x||j(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=C||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t&&t.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,s,i){let r,a,o;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=f=>{if(f.indexOf(this.formatSeparator)<0){const C=me(t,u,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,s,{...i,...t,interpolationkey:f}):C}const p=f.split(this.formatSeparator),x=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(me(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),y,s,{...i,...t,interpolationkey:x})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>Z(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?Z(this.escape(f)):Z(f)}].forEach(f=>{for(o=0;r=f.regex.exec(e);){const p=r[1].trim();if(a=c(p),a===void 0)if(typeof d=="function"){const y=d(e,r,i);a=g(y)?y:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))a="";else if(h){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!g(a)&&!this.useRawValueToEscape&&(a=le(a));const x=f.safeValue(a);if(e=e.replace(r[0],x),h?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,r,a;const o=(u,c)=>{const d=this.nestingOptionsSeparator;if(u.indexOf(d)<0)return u;const h=u.split(new RegExp(`${d}[ ]*{`));let l=`{${h[1]}`;u=h[0],l=this.interpolate(l,a);const f=l.match(/'/g),p=l.match(/"/g);(f&&f.length%2===0&&!p||p.length%2!==0)&&(l=l.replace(/'/g,'"'));try{a=JSON.parse(l),c&&(a={...c,...a})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,x),`${u}${d}${l}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(e);){let u=[];a={...s},a=a.replace&&!g(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),u=d,c=!0}if(r=t(o.call(this,i[1].trim(),a),a),r&&i[0]===e&&!g(r))return r;g(r)||(r=le(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),c&&(r=u.reduce((d,h)=>this.format(d,h,s.lng,{...s,interpolationkey:i[1].trim()}),r.trim())),e=e.replace(i[0],r),this.regexp.lastIndex=0}return e}}const yt=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const s=n.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...u]=a.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),d=o.trim();t[d]||(t[d]=c),c==="false"&&(t[d]=!1),c==="true"&&(t[d]=!0),isNaN(c)||(t[d]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},I=n=>{const e={};return(t,s,i)=>{let r=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(r={...r,[i.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=n(J(s),i),e[a]=o),o(t)}};class xt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=P.create("formatter"),this.options=e,this.formats={number:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s});return r=>i.format(r)}),currency:I((t,s)=>{const i=new Intl.NumberFormat(t,{...s,style:"currency"});return r=>i.format(r)}),datetime:I((t,s)=>{const i=new Intl.DateTimeFormat(t,{...s});return r=>i.format(r)}),relativetime:I((t,s)=>{const i=new Intl.RelativeTimeFormat(t,{...s});return r=>i.format(r,s.range||"day")}),list:I((t,s)=>{const i=new Intl.ListFormat(t,{...s});return r=>i.format(r)})},this.init(e)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=I(t)}format(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&r[0].indexOf(")")<0&&r.find(o=>o.indexOf(")")>-1)){const o=r.findIndex(u=>u.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,u)=>{const{formatName:c,formatOptions:d}=yt(u);if(this.formats[c]){let h=o;try{const l=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},f=l.locale||l.lng||i.locale||i.lng||s;h=this.formats[c](o,f,{...d,...i,...l})}catch(l){this.logger.warn(l)}return h}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const St=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class vt extends Q{constructor(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=P.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(s,i.backend,i)}queueLoad(e,t,s,i){const r={},a={},o={},u={};return e.forEach(c=>{let d=!0;t.forEach(h=>{const l=`${c}|${h}`;!s.reload&&this.store.hasResourceBundle(c,h)?this.state[l]=2:this.state[l]<0||(this.state[l]===1?a[l]===void 0&&(a[l]=!0):(this.state[l]=1,d=!1,a[l]===void 0&&(a[l]=!0),r[l]===void 0&&(r[l]=!0),u[h]===void 0&&(u[h]=!0)))}),d||(o[c]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(u)}}loaded(e,t,s){const i=e.split("|"),r=i[0],a=i[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(u=>{st(u.loaded,[r],a),St(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{o[c]||(o[c]={});const d=u.loaded[c];d.length&&d.forEach(h=>{o[c][h]===void 0&&(o[c][h]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.done)}read(e,t,s){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:i,wait:r,callback:a});return}this.readingCalls++;const o=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,s,i+1,r*2,a)},r);return}a(c,d)},u=this.backend[s].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(d=>o(null,d)).catch(o):o(null,c)}catch(c){o(c)}return}return u(e,t,o)}prepareLoading(e,t){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();g(e)&&(e=this.languageUtils.toResolveHierarchy(e)),g(t)&&(t=[t]);const r=this.queueLoad(e,t,s,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const s=e.split("|"),i=s[0],r=s[1];this.read(i,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,i,r){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){const u={...a,isUpdate:r},c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(e,t,s,i,u):d=c(e,t,s,i),d&&typeof d.then=="function"?d.then(h=>o(null,h)).catch(o):o(null,d)}catch(d){o(d)}else c(e,t,s,i,o,u)}!e||!e[0]||this.store.addResource(e[0],t,s,i)}}}const be=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),g(n[1])&&(e.defaultValue=n[1]),g(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),ye=n=>(g(n.ns)&&(n.ns=[n.ns]),g(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),g(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n),H=()=>{},wt=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class K extends Q{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=ye(e),this.services={},this.logger=P,this.modules={external:[]},wt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(s=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(g(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=be();this.options={...i,...this.options,...ye(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?P.init(r(this.modules.logger),this.options):P.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=xt);const h=new ge(this.options);this.store=new fe(this.options.resources,this.options);const l=this.services;l.logger=P,l.resourceStore=this.store,l.languageUtils=h,l.pluralResolver=new mt(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(l.formatter=r(d),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new bt(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new vt(r(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.languageDetector&&(l.languageDetector=r(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=r(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new G(this.services,this.options),this.translator.on("*",function(f){for(var p=arguments.length,x=new Array(p>1?p-1:0),y=1;y<p;y++)x[y-1]=arguments[y];e.emit(f,...x)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,s||(s=H),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return e.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return e.store[d](...arguments),e}});const u=U(),c=()=>{const d=(h,l)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),u.resolve(l),s(h,l)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),u}loadResources(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const i=g(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&r.indexOf(c)<0&&r.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const i=U();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=H),this.services.backendConnector.reload(e,t,r=>{i.resolve(),s(r)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ke.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}changeLanguage(e,t){var s=this;this.isLanguageChangingTo=e;const i=U();this.emit("languageChanging",e);const r=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},a=(u,c)=>{c?(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return s.t(...arguments)}),t&&t(u,function(){return s.t(...arguments)})},o=u=>{!e&&!u&&this.services.languageDetector&&(u=[]);const c=g(u)?u:this.services.languageUtils.getBestMatchFromCodes(u);c&&(this.language||r(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,t,s){var i=this;const r=function(a,o){let u;if(typeof o!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];u=i.options.overloadTranslationOptionHandler([a,o].concat(d))}else u={...o};u.lng=u.lng||r.lng,u.lngs=u.lngs||r.lngs,u.ns=u.ns||r.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||s||r.keyPrefix);const l=i.options.keySeparator||".";let f;return u.keyPrefix&&Array.isArray(a)?f=a.map(p=>`${u.keyPrefix}${l}${p}`):f=u.keyPrefix?`${u.keyPrefix}${l}${a}`:a,i.t(f,u)};return g(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=s,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,u)=>{const c=this.services.backendConnector.state[`${o}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!i||a(r,e)))}loadNamespaces(e,t){const s=U();return this.options.ns?(g(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),t&&t(i)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=U();g(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=i.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new ge(be());return t.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new K(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:H;const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},r=new K(i);return(e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s&&(r.store=new fe(this.store.data,i),r.services.resourceStore=r.store),r.translator=new G(r.services,i),r.translator.on("*",function(o){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];r.emit(o,...c)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const k=K.createInstance();k.createInstance=K.createInstance;k.createInstance;k.dir;k.init;k.loadResources;k.reloadResources;k.use;k.changeLanguage;k.getFixedT;k.t;k.exists;k.setDefaultNamespace;k.hasLoadedNamespace;k.loadNamespaces;k.loadLanguages;const Lt={title:"Skill Studio — Preferences",brand:"Skill Studio",browserCallout:"Some preferences require the Skill Studio desktop app.",downloadLink:"Download for Mac, Windows, or Linux",downloadUrl:"https://verified-skill.com/download"},Nt={general:"General",updates:"Updates",privacy:"Privacy",advanced:"Advanced"},Ct={heading:"General",subheading:"Appearance and project defaults.",theme:{label:"Appearance",system:"System",light:"Light",dark:"Dark",help:"Match the system or pick a fixed theme."},launchAtLogin:{label:"Launch Skill Studio at login",help:"Open Skill Studio automatically when you sign in.",browserDisabled:"Available in the desktop app.",errorAdmin:"Couldn't change launch at login. Your administrator may have disabled this.",openSettings:"Open System Settings"},defaultProject:{label:"Default project folder",help:"New projects start here unless you choose another location.",notSet:"(not set)",choose:"Choose folder…"},language:{label:"Language",help:"Currently English only. More languages will arrive in a future release.",english:"English"}},kt={heading:"Updates",subheading:"Stay current with the latest Skill Studio.",currentVersion:"Current version",channel:{label:"Update channel",stable:"Stable",beta:"Beta",betaUnavailable:"No beta release yet — we'll check back later.",help:"Stable releases are recommended. Beta delivers previews of upcoming features."},autoCheck:{label:"Check for updates automatically",help:"Skill Studio will check daily and notify you when an update is ready."},checkNow:"Check for updates",checking:"Checking…",upToDate:"Skill Studio is up to date.",updateAvailable:"Update available: {{version}}",lastChecked:"Last checked",lastCheckedNever:"Never",lastCheckedAgo:"{{relative}}",errors:{network:"Couldn't reach the update server. Check your connection and try again.",signature:"Update signature invalid — refusing to install.",diskSpace:"Not enough disk space to install the update.",tryAgain:"Try again",viewLogs:"View logs"},dialog:{title:"Update available",version:"Version {{version}}",releaseNotes:"Release notes",noReleaseNotes:"Release notes not provided.",installNow:"Install now",later:"Later",skipVersion:"Skip this version",downloading:"Downloading update…",preparing:"Preparing update…",restartRequired:"Restart required to finish installing.",restartNow:"Restart now",onQuit:"Install on quit",cancel:"Cancel"},browserCallout:"Updates are managed by the desktop app. Run npm i -g vskill@latest to update the CLI.",about:{heading:"About",build:"Build",commit:"Commit",links:{openSource:"Open source licenses",website:"Visit verified-skill.com",acknowledgements:"Acknowledgements"}}},Ot={heading:"Privacy",subheading:"Decide what Skill Studio shares with us.",telemetry:{label:"Send anonymous usage telemetry",help:"Helps us improve Skill Studio. Disabled by default. No personal data is collected."},crash:{label:"Send anonymized crash reports",help:"Sends a small report when Skill Studio crashes so we can fix it."},openLogs:{label:"Open logs folder",help:"Inspect log files to audit what Skill Studio records on your machine.",browserHidden:"Logs are stored on the desktop app only."},disclosure:"Skill Studio v1 does not currently emit telemetry. These switches reserve your preference for when telemetry ships."},Rt={heading:"Advanced",subheading:"Diagnostics and reset.",logLevel:{label:"Log level",help:"Higher levels emit more diagnostic detail. Defaults to Info.",error:"Error",warn:"Warning",info:"Info",debug:"Debug",trace:"Trace"},settingsPath:{label:"Settings file",help:"Where your preferences live on disk.",reveal:"Reveal in Finder",copy:"Copy path",copied:"Copied",browserValue:"Stored in this browser's local storage"},factoryReset:{label:"Factory reset",help:"Reset all preferences to their defaults. Recent projects and your keychain are preserved.",button:"Reset all preferences…",confirmTitle:"Reset all preferences?",confirmBody:"This will return every Skill Studio preference to its default value. Recent projects and API keys stored in your system keychain are not affected.",confirm:"Reset",cancel:"Cancel",done:"Preferences reset to defaults."}},Pt={save:"Save",cancel:"Cancel",close:"Close",loading:"Loading…",browserMode:"Browser mode",desktopOnly:"Desktop only"},Et={app:Lt,tabs:Nt,general:Ct,updates:kt,privacy:Ot,advanced:Rt,common:Pt},Oe=k.createInstance();Oe.use(Ye).init({lng:"en",fallbackLng:"en",ns:["preferences"],defaultNS:"preferences",resources:{en:{preferences:Et}},interpolation:{escapeValue:!1},returnNull:!1});function zt({checked:n,onChange:e,disabled:t,ariaLabel:s,id:i}){return m.jsx("button",{id:i,type:"button",role:"switch","aria-checked":n,"aria-label":s,"aria-disabled":t||void 0,className:"pref-toggle",onClick:()=>!t&&e(!n),disabled:t})}function Ht({options:n,value:e,onChange:t,disabled:s,ariaLabel:i}){return m.jsx("div",{role:"radiogroup","aria-label":i,"aria-disabled":s||void 0,className:"pref-segmented",children:n.map(r=>m.jsx("button",{type:"button",role:"radio","aria-checked":e===r.value,disabled:s,onClick:()=>!s&&t(r.value),children:r.label},r.value))})}function Bt({label:n,help:e,control:t,stacked:s}){return m.jsxs("div",{className:`pref-row${s?" pref-row--stacked":""}`,children:[m.jsxs("div",{className:"pref-row__label",children:[m.jsx("span",{className:"pref-row__label-text",children:n}),e?m.jsx("span",{className:"pref-row__help",children:e}):null]}),m.jsx("div",{children:t})]})}function Jt({title:n,children:e,style:t}){return m.jsxs("section",{className:"pref-section",style:t,children:[n?m.jsx("h2",{className:"pref-section__title",children:n}):null,e]})}function Wt({variant:n="info",children:e}){return m.jsx("div",{role:"note",className:`pref-callout${n==="info"?" pref-callout--info":""}`,children:e})}function Gt({open:n,onDismiss:e,ariaLabel:t,children:s}){const i=S.useRef(null);return S.useEffect(()=>{var a;if(!n)return;const r=o=>{o.key==="Escape"&&e&&e()};return document.addEventListener("keydown",r),(a=i.current)==null||a.focus(),()=>document.removeEventListener("keydown",r)},[n,e]),n?m.jsx("div",{className:"pref-dialog-overlay",onClick:r=>{r.target===r.currentTarget&&e&&e()},children:m.jsx("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,className:"pref-dialog",children:s})}):null}function $t({toasts:n,onDismiss:e}){return S.useEffect(()=>{if(n.length===0)return;const t=n.map(s=>window.setTimeout(()=>e(s.id),s.variant==="error"?8e3:4e3));return()=>t.forEach(s=>window.clearTimeout(s))},[n,e]),m.jsx("div",{className:"pref-toast-stack",role:"status","aria-live":"polite",children:n.map(t=>m.jsxs("div",{className:`pref-toast${t.variant==="error"?" pref-toast--error":""}`,children:[m.jsx("span",{children:t.message}),t.actions&&t.actions.length>0?m.jsx("div",{className:"pref-toast__actions",children:t.actions.map(s=>m.jsx("button",{type:"button",className:"pref-button",onClick:()=>{s.onClick(),e(t.id)},children:s.label},s.label))}):null]},t.id))})}const jt=S.lazy(()=>Y(()=>import("./GeneralTab-AwK9sIkP.js"),__vite__mapDeps([0,1,2,3,4])).then(n=>({default:n.GeneralTab}))),It=S.lazy(()=>Y(()=>import("./UpdatesTab-DTmo-vVb.js"),__vite__mapDeps([5,1,2,3,4])).then(n=>({default:n.UpdatesTab}))),Tt=S.lazy(()=>Y(()=>import("./PrivacyTab-BtNrxpVV.js"),__vite__mapDeps([6,1,2,3,4])).then(n=>({default:n.PrivacyTab}))),At=S.lazy(()=>Y(()=>import("./AdvancedTab-DOgbx7u0.js"),__vite__mapDeps([7,1,2,3,4])).then(n=>({default:n.AdvancedTab}))),xe=[{key:"general",iconChar:"⚙",shortcut:"1"},{key:"updates",iconChar:"↻",shortcut:"2"},{key:"privacy",iconChar:"⚓",shortcut:"3"},{key:"advanced",iconChar:"⁂",shortcut:"4"}];function Se(){const n=typeof window<"u"&&window.location.hash.slice(1)||"general";return n==="general"||n==="updates"||n==="privacy"||n==="advanced"?n:"general"}function Ft(){const{t:n}=Xe("preferences"),e=Ie(),{snapshot:t,refresh:s}=Te(e),[i,r]=S.useState(()=>Se()),[a,o]=S.useState(0),[u,c]=S.useState([]),d=S.useCallback(l=>{c(f=>[...f,{...l,id:`t-${Date.now()}-${Math.random()}`}])},[]),h=S.useCallback(l=>{c(f=>f.filter(p=>p.id!==l))},[]);return S.useEffect(()=>{const l=()=>r(Se());return window.addEventListener("hashchange",l),()=>window.removeEventListener("hashchange",l)},[]),S.useEffect(()=>{if(!e.available)return;let l=null;return Ae("preferences-trigger-check",()=>{r("updates"),o(f=>f+1)}).then(f=>{l=f}),()=>{l==null||l()}},[e.available]),S.useEffect(()=>{window.location.hash.slice(1)!==i&&window.history.replaceState(null,"",`#${i}`)},[i]),S.useEffect(()=>{const l=f=>{if(!(f.metaKey||f.ctrlKey))return;const x=parseInt(f.key,10);if(Number.isNaN(x))return;const y=xe[x-1];y&&(f.preventDefault(),r(y.key))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]),S.useEffect(()=>{if(!t)return;const l=t.general.theme;if(l==="system"){const f=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{document.documentElement.dataset.theme=f.matches?"dark":"light",document.documentElement.dataset.themeMode="auto"};return p(),f.addEventListener("change",p),()=>f.removeEventListener("change",p)}document.documentElement.dataset.theme=l,document.documentElement.dataset.themeMode=l},[t]),m.jsxs("div",{className:"preferences-window",children:[m.jsxs("nav",{className:"preferences-sidebar","aria-label":n("app.title"),children:[m.jsx("div",{className:"preferences-sidebar__brand",children:n("app.brand")}),xe.map(l=>m.jsxs("button",{type:"button",className:"preferences-nav-item","aria-current":i===l.key?"page":void 0,onClick:()=>r(l.key),children:[m.jsx("span",{"aria-hidden":"true",className:"preferences-nav-item__icon",children:l.iconChar}),m.jsx("span",{children:n(`tabs.${l.key}`)}),m.jsxs("span",{className:"preferences-nav-item__shortcut","aria-hidden":"true",children:[/^Mac/i.test(navigator.platform)?"⌘":"Ctrl+",l.shortcut]})]},l.key))]}),m.jsx("main",{className:"preferences-content","data-active-tab":i,children:m.jsxs(S.Suspense,{fallback:m.jsx("div",{className:"pref-status-row",children:n("common.loading")}),children:[i==="general"?m.jsx(jt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="updates"?m.jsx(It,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d,triggerCheckNonce:a}):null,i==="privacy"?m.jsx(Tt,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null,i==="advanced"?m.jsx(At,{bridge:e,snapshot:t,onSnapshotChanged:s,pushToast:d}):null]})}),m.jsx($t,{toasts:u,onDismiss:h})]})}je.createRoot(document.getElementById("root")).render(m.jsx(S.StrictMode,{children:m.jsx(_e,{i18n:Oe,children:m.jsx(Ft,{})})}));export{Wt as C,Gt as D,Bt as F,Jt as S,zt as T,Ht as a,Xe as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as v}from"./globals-BRZwPAPF.js";const V="modulepreload",B=function(e){return"/"+e},U={},C=function(a,t,c){let s=Promise.resolve();if(t&&t.length>0){let o=function(d){return Promise.all(d.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=o(t.map(d=>{if(d=B(d),d in U)return;U[d]=!0;const g=d.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${y}`))return;const w=document.createElement("link");if(w.rel=g?"stylesheet":V,g||(w.as="script"),w.crossOrigin="",w.href=d,l&&w.setAttribute("nonce",l),document.head.appendChild(w),g)return new Promise((k,S)=>{w.addEventListener("load",k),w.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(o){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o}return s.then(o=>{for(const i of o||[])i.status==="rejected"&&f(i.reason);return a().catch(f)})};class _ extends Error{constructor(a){super(`${a} is not available in browser mode — install the Skill Studio desktop app.`),this.name="BrowserModeError"}}function $(){return typeof window>"u"?"browser":"__TAURI_INTERNALS__"in window?"desktop":"browser"}const h={version:1,general:{theme:"system",language:"auto",defaultProjectFolder:null,launchAtLogin:!1},updates:{channel:"stable",autoCheck:!0,lastCheckedAt:null,lastKnownVersion:null,skippedVersion:null,snoozedUntil:null},privacy:{telemetryEnabled:!1,crashReportingEnabled:!1},advanced:{logLevel:"info"},studio:{lifecycleDefault:"ask"}},A="vskill:preferences:browser-shadow";function R(e){const a=(e==null?void 0:e.general)??{},t=(e==null?void 0:e.updates)??{},c=(e==null?void 0:e.privacy)??{},s=(e==null?void 0:e.advanced)??{},f=(e==null?void 0:e.studio)??{};return{version:(e==null?void 0:e.version)??h.version,general:{theme:a.theme??h.general.theme,language:a.language??h.general.language,defaultProjectFolder:a.defaultProjectFolder??a.default_project_folder??null,launchAtLogin:a.launchAtLogin??a.launch_at_login??h.general.launchAtLogin},updates:{channel:t.channel??h.updates.channel,autoCheck:t.autoCheck??t.auto_check??h.updates.autoCheck,lastCheckedAt:t.lastCheckedAt??t.last_checked_at??null,lastKnownVersion:t.lastKnownVersion??t.last_known_version??null,skippedVersion:t.skippedVersion??t.skipped_version??null,snoozedUntil:t.snoozedUntil??t.snoozed_until??null},privacy:{telemetryEnabled:c.telemetryEnabled??c.telemetry_enabled??h.privacy.telemetryEnabled,crashReportingEnabled:c.crashReportingEnabled??c.crash_reporting_enabled??h.privacy.crashReportingEnabled},advanced:{logLevel:s.logLevel??s.log_level??h.advanced.logLevel},studio:{lifecycleDefault:f.lifecycleDefault??f.lifecycle_default??h.studio.lifecycleDefault}}}function z(e,a){return{available:e.available===!0,currentVersion:e.currentVersion??a,latestVersion:e.latestVersion??e.version??void 0,releaseNotes:e.releaseNotes??e.notes??void 0,releaseDate:e.releaseDate??e.pub_date??void 0}}function b(e){if(!e||typeof e.login!="string"||e.login.trim()==="")return null;const a=e.login.trim(),t=e.avatar_url??e.avatarUrl??`https://github.com/${encodeURIComponent(a)}.png?size=40`;return{login:a,avatar_url:t,email:e.email??null,cached_at:e.cached_at??null}}async function G(e){var c,s,f;if(typeof window>"u")return;const a=window,t=(c=a.__TAURI_INTERNALS__)==null?void 0:c.invoke;if(t)try{await t("open_external_url",{url:e});return}catch(o){console.warn("open_external_url command failed; falling back to shell open:",o)}try{const o=await fetch("/api/desktop/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(o.ok)return;console.warn(`sidecar open-url failed: HTTP ${o.status}`)}catch(o){console.warn("sidecar open-url failed; falling back to shell open:",o)}try{const o=(f=(s=a.__TAURI__)==null?void 0:s.shell)==null?void 0:f.open;if(typeof o=="function"){await o(e);return}const{open:i}=await C(async()=>{const{open:l}=await import("./index-D7M0Jdss.js");return{open:l}},__vite__mapDeps([0,1]));await i(e);return}catch(o){console.warn("tauri shell open failed; falling back to window.open:",o)}window.open(e,"_blank","noopener,noreferrer")}async function H(e,a){if(typeof window>"u"||!("__TAURI_INTERNALS__"in window))return null;try{return await(await C(()=>import("./event-CDYWU2X3.js"),__vite__mapDeps([2,1]))).listen(e,a)}catch{return null}}function T(){try{const e=localStorage.getItem(A);return e?R(JSON.parse(e)):structuredClone(h)}catch{return structuredClone(h)}}function K(e){try{localStorage.setItem(A,JSON.stringify(e))}catch{}}function M(e,a,t){const c=a.split(".");let s=e;for(let f=0;f<c.length-1;f++){const o=c[f];(typeof s[o]!="object"||s[o]===null)&&(s[o]={}),s=s[o]}s[c[c.length-1]]=t}async function u(e,a){var s;const c=(s=window.__TAURI_INTERNALS__)==null?void 0:s.invoke;if(!c)throw new _(e);return c(e,a)}function te(){const[e]=v.useState(()=>$());return v.useMemo(()=>{const t=e==="desktop",c=async()=>{if(!t)return T();const n=await u("get_settings");return R(n)},s=async(n,r)=>{if(!t){const p=T();M(p,n,r),K(p),window.dispatchEvent(new CustomEvent("preferences-shadow-updated",{detail:{path:n,value:r}}));return}await u("set_setting",{key:n,value:r})},f=async()=>{if(!t){try{localStorage.removeItem(A)}catch{}window.dispatchEvent(new CustomEvent("preferences-shadow-reset"));return}await u("reset_settings")},o=async()=>{if(!t)throw new _("checkForUpdates");const[n,r]=await Promise.all([u("check_for_updates"),y().catch(()=>({version:"unknown",build:"n/a",commit:"n/a",target:"unknown",arch:"unknown"}))]);return z(n,r.version)},i=async n=>{if(!t)throw new _("downloadAndInstallUpdate");const r=n?await H("updater://progress",p=>{const m=p.payload??{},D=m.downloadedBytes??m.bytes??m.chunkBytes??0,N=m.totalBytes??m.total??null;n(D,N)}):null;try{await u("download_and_install_update")}finally{await(r==null?void 0:r())}},l=async()=>{if(!t)throw new _("cancelUpdate");await u("cancel_update")},d=async()=>{if(!t)throw new _("restartApp");await u("restart_app")},g=async n=>{if(!t){n&&(window.location.hash=`#${n}`);return}await u("open_preferences",{tab:n??null})},y=async()=>t?u("get_app_metadata"):{version:"browser",build:"n/a",commit:"n/a",target:navigator.platform||"browser",arch:"n/a"},w=async n=>{if(!t)throw new _("setAutostart");await u("set_autostart",{enabled:n})},k=async()=>{if(!t)throw new _("pickFolder");const n=await u("pick_default_project_folder");return(n==null?void 0:n.path)??null},S=async()=>{if(!t)throw new _("openLogsFolder");await u("open_logs_folder")},I=async()=>{if(!t)throw new _("revealSettingsFile");await u("reveal_settings_file")},L=async n=>{try{await navigator.clipboard.writeText(n)}catch{}},P=async()=>{const n=await fetch("/api/oauth/github/start",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!n.ok){const p=await n.text().catch(()=>"");throw new Error(`OAuth start failed: HTTP ${n.status}: ${p.slice(0,200)}`)}const r=await n.json();return{userCode:r.state,verificationUri:r.authUrl,interval:2,expiresIn:Math.max(60,Math.floor((r.expiresAt-Date.now())/1e3))}},F=async()=>{const n=window.__vskillOauthState;if(!n)return{status:"error",message:"no OAuth flow in progress"};try{const r=await fetch(`/api/oauth/github/status?state=${encodeURIComponent(n)}`);if(!r.ok)return{status:"error",message:`HTTP ${r.status}`};const p=await r.json(),m=b(p.user);return p.status==="ready"&&m?{status:"granted",user:m}:p.status==="pending"?{status:"pending"}:p.status==="expired"?{status:"expired"}:p.status==="error"?{status:"error",message:p.error??"unknown"}:{status:"pending"}}catch(r){return{status:"error",message:r instanceof Error?r.message:String(r)}}},O=async()=>{try{const n=await fetch("/api/auth/me");if(!n.ok)return null;const r=await n.json();return r.signedIn?b(r.user):null}catch{return null}},x=async()=>{await fetch("/api/auth/sign-out",{method:"POST"})},j=async()=>{if(!t)throw new _("pickProjectFolder");return await u("pick_default_project_folder")??null},q=async n=>t?u("get_repo_info",{folder:n}):{name:null,branch:null,is_private:null,sync_state:{kind:"no_remote"}},E={cache:null,localSkillCount:0,isFresh:!1,daysRemaining:0};return{mode:e,available:t,getSettings:c,setSetting:s,resetSettings:f,checkForUpdates:o,downloadAndInstallUpdate:i,cancelUpdate:l,restartApp:d,openPreferences:g,getAppMetadata:y,setAutostart:w,pickFolder:k,openLogsFolder:S,revealSettingsFile:I,copyToClipboard:L,startGithubDeviceFlow:P,pollGithubDeviceFlow:F,getSignedInUser:O,signOut:x,pickProjectFolder:j,getRepoInfo:q,quotaGet:async n=>t?await u("quota_get",{projectRoots:n}):{...E},quotaForceSync:async(n,r)=>t?await u("quota_force_sync",{projectRoots:n,fresh:r}):{...E},quotaCanCreateSkill:async n=>t?u("quota_can_create_skill",{projectRoots:n}):{blocked:!1,reason:"browser-mode",snapshot:{...E}},quotaReportCount:async n=>{if(t)try{await u("quota_report_count",{skillCount:n})}catch(r){console.warn("quotaReportCount failed:",r)}},openExternalUrl:async n=>{if(!t){typeof window<"u"&&window.open(n,"_blank","noopener,noreferrer");return}await G(n)},refreshUserIdentity:async()=>{if(!t)return null;const n=await u("refresh_user_identity");return b(n)}}},[e])}function ne(e){const[a,t]=v.useState(null),[c,s]=v.useState(null),[f,o]=v.useState(!0),i=v.useCallback(async()=>{o(!0),s(null);try{const l=await e.getSettings();t(l)}catch(l){s(l instanceof Error?l.message:String(l))}finally{o(!1)}},[e]);return v.useEffect(()=>{let l=!1;return(async()=>{try{const d=await e.getSettings();l||(t(d),o(!1))}catch(d){l||(s(d instanceof Error?d.message:String(d)),o(!1))}})(),()=>{l=!0}},[e]),v.useEffect(()=>{const l=()=>i();return window.addEventListener("preferences-shadow-updated",l),window.addEventListener("preferences-shadow-reset",l),()=>{window.removeEventListener("preferences-shadow-updated",l),window.removeEventListener("preferences-shadow-reset",l)}},[i]),{snapshot:a,error:c,loading:f,refresh:i}}export{C as _,ne as a,H as l,z as n,te as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CUEYzTVL.js","assets/core-DZjBCfjp.js","assets/event-QtOCMXAv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as v}from"./globals-hm1COkXX.js";const V="modulepreload",B=function(e){return"/"+e},U={},C=function(a,t,c){let s=Promise.resolve();if(t&&t.length>0){let o=function(d){return Promise.all(d.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=o(t.map(d=>{if(d=B(d),d in U)return;U[d]=!0;const g=d.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${y}`))return;const w=document.createElement("link");if(w.rel=g?"stylesheet":V,g||(w.as="script"),w.crossOrigin="",w.href=d,l&&w.setAttribute("nonce",l),document.head.appendChild(w),g)return new Promise((k,S)=>{w.addEventListener("load",k),w.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(o){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o}return s.then(o=>{for(const i of o||[])i.status==="rejected"&&f(i.reason);return a().catch(f)})};class _ extends Error{constructor(a){super(`${a} is not available in browser mode — install the Skill Studio desktop app.`),this.name="BrowserModeError"}}function $(){return typeof window>"u"?"browser":"__TAURI_INTERNALS__"in window?"desktop":"browser"}const h={version:1,general:{theme:"system",language:"auto",defaultProjectFolder:null,launchAtLogin:!1},updates:{channel:"stable",autoCheck:!0,lastCheckedAt:null,lastKnownVersion:null,skippedVersion:null,snoozedUntil:null},privacy:{telemetryEnabled:!1,crashReportingEnabled:!1},advanced:{logLevel:"info"},studio:{lifecycleDefault:"ask"}},A="vskill:preferences:browser-shadow";function R(e){const a=(e==null?void 0:e.general)??{},t=(e==null?void 0:e.updates)??{},c=(e==null?void 0:e.privacy)??{},s=(e==null?void 0:e.advanced)??{},f=(e==null?void 0:e.studio)??{};return{version:(e==null?void 0:e.version)??h.version,general:{theme:a.theme??h.general.theme,language:a.language??h.general.language,defaultProjectFolder:a.defaultProjectFolder??a.default_project_folder??null,launchAtLogin:a.launchAtLogin??a.launch_at_login??h.general.launchAtLogin},updates:{channel:t.channel??h.updates.channel,autoCheck:t.autoCheck??t.auto_check??h.updates.autoCheck,lastCheckedAt:t.lastCheckedAt??t.last_checked_at??null,lastKnownVersion:t.lastKnownVersion??t.last_known_version??null,skippedVersion:t.skippedVersion??t.skipped_version??null,snoozedUntil:t.snoozedUntil??t.snoozed_until??null},privacy:{telemetryEnabled:c.telemetryEnabled??c.telemetry_enabled??h.privacy.telemetryEnabled,crashReportingEnabled:c.crashReportingEnabled??c.crash_reporting_enabled??h.privacy.crashReportingEnabled},advanced:{logLevel:s.logLevel??s.log_level??h.advanced.logLevel},studio:{lifecycleDefault:f.lifecycleDefault??f.lifecycle_default??h.studio.lifecycleDefault}}}function z(e,a){return{available:e.available===!0,currentVersion:e.currentVersion??a,latestVersion:e.latestVersion??e.version??void 0,releaseNotes:e.releaseNotes??e.notes??void 0,releaseDate:e.releaseDate??e.pub_date??void 0}}function b(e){if(!e||typeof e.login!="string"||e.login.trim()==="")return null;const a=e.login.trim(),t=e.avatar_url??e.avatarUrl??`https://github.com/${encodeURIComponent(a)}.png?size=40`;return{login:a,avatar_url:t,email:e.email??null,cached_at:e.cached_at??null}}async function G(e){var c,s,f;if(typeof window>"u")return;const a=window,t=(c=a.__TAURI_INTERNALS__)==null?void 0:c.invoke;if(t)try{await t("open_external_url",{url:e});return}catch(o){console.warn("open_external_url command failed; falling back to shell open:",o)}try{const o=await fetch("/api/desktop/open-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(o.ok)return;console.warn(`sidecar open-url failed: HTTP ${o.status}`)}catch(o){console.warn("sidecar open-url failed; falling back to shell open:",o)}try{const o=(f=(s=a.__TAURI__)==null?void 0:s.shell)==null?void 0:f.open;if(typeof o=="function"){await o(e);return}const{open:i}=await C(async()=>{const{open:l}=await import("./index-CUEYzTVL.js");return{open:l}},__vite__mapDeps([0,1]));await i(e);return}catch(o){console.warn("tauri shell open failed; falling back to window.open:",o)}window.open(e,"_blank","noopener,noreferrer")}async function H(e,a){if(typeof window>"u"||!("__TAURI_INTERNALS__"in window))return null;try{return await(await C(()=>import("./event-QtOCMXAv.js"),__vite__mapDeps([2,1]))).listen(e,a)}catch{return null}}function T(){try{const e=localStorage.getItem(A);return e?R(JSON.parse(e)):structuredClone(h)}catch{return structuredClone(h)}}function K(e){try{localStorage.setItem(A,JSON.stringify(e))}catch{}}function M(e,a,t){const c=a.split(".");let s=e;for(let f=0;f<c.length-1;f++){const o=c[f];(typeof s[o]!="object"||s[o]===null)&&(s[o]={}),s=s[o]}s[c[c.length-1]]=t}async function u(e,a){var s;const c=(s=window.__TAURI_INTERNALS__)==null?void 0:s.invoke;if(!c)throw new _(e);return c(e,a)}function te(){const[e]=v.useState(()=>$());return v.useMemo(()=>{const t=e==="desktop",c=async()=>{if(!t)return T();const n=await u("get_settings");return R(n)},s=async(n,r)=>{if(!t){const p=T();M(p,n,r),K(p),window.dispatchEvent(new CustomEvent("preferences-shadow-updated",{detail:{path:n,value:r}}));return}await u("set_setting",{key:n,value:r})},f=async()=>{if(!t){try{localStorage.removeItem(A)}catch{}window.dispatchEvent(new CustomEvent("preferences-shadow-reset"));return}await u("reset_settings")},o=async()=>{if(!t)throw new _("checkForUpdates");const[n,r]=await Promise.all([u("check_for_updates"),y().catch(()=>({version:"unknown",build:"n/a",commit:"n/a",target:"unknown",arch:"unknown"}))]);return z(n,r.version)},i=async n=>{if(!t)throw new _("downloadAndInstallUpdate");const r=n?await H("updater://progress",p=>{const m=p.payload??{},D=m.downloadedBytes??m.bytes??m.chunkBytes??0,N=m.totalBytes??m.total??null;n(D,N)}):null;try{await u("download_and_install_update")}finally{await(r==null?void 0:r())}},l=async()=>{if(!t)throw new _("cancelUpdate");await u("cancel_update")},d=async()=>{if(!t)throw new _("restartApp");await u("restart_app")},g=async n=>{if(!t){n&&(window.location.hash=`#${n}`);return}await u("open_preferences",{tab:n??null})},y=async()=>t?u("get_app_metadata"):{version:"browser",build:"n/a",commit:"n/a",target:navigator.platform||"browser",arch:"n/a"},w=async n=>{if(!t)throw new _("setAutostart");await u("set_autostart",{enabled:n})},k=async()=>{if(!t)throw new _("pickFolder");const n=await u("pick_default_project_folder");return(n==null?void 0:n.path)??null},S=async()=>{if(!t)throw new _("openLogsFolder");await u("open_logs_folder")},I=async()=>{if(!t)throw new _("revealSettingsFile");await u("reveal_settings_file")},L=async n=>{try{await navigator.clipboard.writeText(n)}catch{}},P=async()=>{const n=await fetch("/api/oauth/github/start",{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"});if(!n.ok){const p=await n.text().catch(()=>"");throw new Error(`OAuth start failed: HTTP ${n.status}: ${p.slice(0,200)}`)}const r=await n.json();return{userCode:r.state,verificationUri:r.authUrl,interval:2,expiresIn:Math.max(60,Math.floor((r.expiresAt-Date.now())/1e3))}},F=async()=>{const n=window.__vskillOauthState;if(!n)return{status:"error",message:"no OAuth flow in progress"};try{const r=await fetch(`/api/oauth/github/status?state=${encodeURIComponent(n)}`);if(!r.ok)return{status:"error",message:`HTTP ${r.status}`};const p=await r.json(),m=b(p.user);return p.status==="ready"&&m?{status:"granted",user:m}:p.status==="pending"?{status:"pending"}:p.status==="expired"?{status:"expired"}:p.status==="error"?{status:"error",message:p.error??"unknown"}:{status:"pending"}}catch(r){return{status:"error",message:r instanceof Error?r.message:String(r)}}},O=async()=>{try{const n=await fetch("/api/auth/me");if(!n.ok)return null;const r=await n.json();return r.signedIn?b(r.user):null}catch{return null}},x=async()=>{await fetch("/api/auth/sign-out",{method:"POST"})},j=async()=>{if(!t)throw new _("pickProjectFolder");return await u("pick_default_project_folder")??null},q=async n=>t?u("get_repo_info",{folder:n}):{name:null,branch:null,is_private:null,sync_state:{kind:"no_remote"}},E={cache:null,localSkillCount:0,isFresh:!1,daysRemaining:0};return{mode:e,available:t,getSettings:c,setSetting:s,resetSettings:f,checkForUpdates:o,downloadAndInstallUpdate:i,cancelUpdate:l,restartApp:d,openPreferences:g,getAppMetadata:y,setAutostart:w,pickFolder:k,openLogsFolder:S,revealSettingsFile:I,copyToClipboard:L,startGithubDeviceFlow:P,pollGithubDeviceFlow:F,getSignedInUser:O,signOut:x,pickProjectFolder:j,getRepoInfo:q,quotaGet:async n=>t?await u("quota_get",{projectRoots:n}):{...E},quotaForceSync:async(n,r)=>t?await u("quota_force_sync",{projectRoots:n,fresh:r}):{...E},quotaCanCreateSkill:async n=>t?u("quota_can_create_skill",{projectRoots:n}):{blocked:!1,reason:"browser-mode",snapshot:{...E}},quotaReportCount:async n=>{if(t)try{await u("quota_report_count",{skillCount:n})}catch(r){console.warn("quotaReportCount failed:",r)}},openExternalUrl:async n=>{if(!t){typeof window<"u"&&window.open(n,"_blank","noopener,noreferrer");return}await G(n)},refreshUserIdentity:async()=>{if(!t)return null;const n=await u("refresh_user_identity");return b(n)}}},[e])}function ne(e){const[a,t]=v.useState(null),[c,s]=v.useState(null),[f,o]=v.useState(!0),i=v.useCallback(async()=>{o(!0),s(null);try{const l=await e.getSettings();t(l)}catch(l){s(l instanceof Error?l.message:String(l))}finally{o(!1)}},[e]);return v.useEffect(()=>{let l=!1;return(async()=>{try{const d=await e.getSettings();l||(t(d),o(!1))}catch(d){l||(s(d instanceof Error?d.message:String(d)),o(!1))}})(),()=>{l=!0}},[e]),v.useEffect(()=>{const l=()=>i();return window.addEventListener("preferences-shadow-updated",l),window.addEventListener("preferences-shadow-reset",l),()=>{window.removeEventListener("preferences-shadow-updated",l),window.removeEventListener("preferences-shadow-reset",l)}},[i]),{snapshot:a,error:c,loading:f,refresh:i}}export{C as _,ne as a,H as l,z as n,G as o,te as u};
|
package/dist/eval-ui/index.html
CHANGED
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
}
|
|
48
48
|
})();
|
|
49
49
|
</script>
|
|
50
|
-
<script type="module" crossorigin src="/assets/main-
|
|
51
|
-
<link rel="modulepreload" crossorigin href="/assets/globals-
|
|
52
|
-
<link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-
|
|
53
|
-
<link rel="stylesheet" crossorigin href="/assets/globals-
|
|
50
|
+
<script type="module" crossorigin src="/assets/main-tpOyw9SC.js"></script>
|
|
51
|
+
<link rel="modulepreload" crossorigin href="/assets/globals-hm1COkXX.js">
|
|
52
|
+
<link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-9oZFQsrw.js">
|
|
53
|
+
<link rel="stylesheet" crossorigin href="/assets/globals-Dpf9KmYH.css">
|
|
54
54
|
<link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
|
|
55
55
|
</head>
|
|
56
56
|
<body>
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
}
|
|
22
22
|
})();
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/assets/lifecycle-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/globals-
|
|
26
|
-
<link rel="stylesheet" crossorigin href="/assets/globals-
|
|
24
|
+
<script type="module" crossorigin src="/assets/lifecycle-o_IRibOa.js"></script>
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/globals-hm1COkXX.js">
|
|
26
|
+
<link rel="stylesheet" crossorigin href="/assets/globals-Dpf9KmYH.css">
|
|
27
27
|
<link rel="stylesheet" crossorigin href="/assets/lifecycle-d1Sm9Hts.css">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
|
|
29
29
|
</head>
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
}
|
|
22
22
|
})();
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/assets/preferences-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/globals-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-
|
|
27
|
-
<link rel="stylesheet" crossorigin href="/assets/globals-
|
|
24
|
+
<script type="module" crossorigin src="/assets/preferences-DCdw0Kvu.js"></script>
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/globals-hm1COkXX.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/useDesktopBridge-9oZFQsrw.js">
|
|
27
|
+
<link rel="stylesheet" crossorigin href="/assets/globals-Dpf9KmYH.css">
|
|
28
28
|
<link rel="stylesheet" crossorigin href="/assets/preferences-BHZXB5dL.css">
|
|
29
29
|
<link rel="stylesheet" crossorigin href="/assets/fonts-i7Lkz2zN.css">
|
|
30
30
|
</head>
|
|
@@ -16,7 +16,6 @@ export interface GitHubFetchOptions {
|
|
|
16
16
|
allowedHosts?: Set<string>;
|
|
17
17
|
}
|
|
18
18
|
export type GitHubFetch = (url: string, init?: RequestInit) => Promise<Response>;
|
|
19
|
-
export declare function resolveGitHubEnvToken(env?: NodeJS.ProcessEnv): string | null;
|
|
20
19
|
export declare function createGitHubFetch(opts?: GitHubFetchOptions): GitHubFetch;
|
|
21
20
|
export declare function githubFetch(url: string, init?: RequestInit): Promise<Response>;
|
|
22
21
|
/** Test-only reset hook. */
|
package/dist/lib/github-fetch.js
CHANGED
|
@@ -36,16 +36,6 @@ export class GitHubFetchError extends Error {
|
|
|
36
36
|
function defaultSleep(ms) {
|
|
37
37
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
38
38
|
}
|
|
39
|
-
export function resolveGitHubEnvToken(env = process.env) {
|
|
40
|
-
return (env.VSKILL_TEST_GITHUB_PAT ||
|
|
41
|
-
env.VSKILL_TEST_PRIVATE_GITHUB_PAT ||
|
|
42
|
-
env.GITHUB_TOKEN ||
|
|
43
|
-
env.GH_TOKEN ||
|
|
44
|
-
null);
|
|
45
|
-
}
|
|
46
|
-
function resolveDefaultGitHubToken() {
|
|
47
|
-
return getDefaultKeychain().getGitHubToken() || resolveGitHubEnvToken();
|
|
48
|
-
}
|
|
49
39
|
function isAllowedHost(url, allowed) {
|
|
50
40
|
try {
|
|
51
41
|
const u = new URL(url);
|
|
@@ -87,7 +77,7 @@ function mergeHeaders(base, init) {
|
|
|
87
77
|
return out;
|
|
88
78
|
}
|
|
89
79
|
export function createGitHubFetch(opts = {}) {
|
|
90
|
-
const tokenProvider = opts.tokenProvider ??
|
|
80
|
+
const tokenProvider = opts.tokenProvider ?? (() => getDefaultKeychain().getGitHubToken());
|
|
91
81
|
// Defer to globalThis.fetch on every call so test suites that replace
|
|
92
82
|
// `globalThis.fetch = vi.fn(...)` continue to intercept requests.
|
|
93
83
|
const fetchImpl = opts.fetchImpl ?? ((url, init) => globalThis.fetch(url, init));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-fetch.js","sourceRoot":"","sources":["../../src/lib/github-fetch.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,6BAA6B;AAC7B,EAAE;AACF,oBAAoB;AACpB,+EAA+E;AAC/E,kEAAkE;AAClE,6EAA6E;AAC7E,+BAA+B;AAC/B,gFAAgF;AAChF,kEAAkE;AAClE,2EAA2E;AAC3E,4EAA4E;AAC5E,mEAAmE;AACnE,EAAE;AACF,+EAA+E;AAC/E,mDAAmD;AACnD,8EAA8E;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,gBAAgB;IAChB,2BAA2B;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,YAAY,MAAc,EAAE,IAAY,EAAE,OAAe;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAiBD,SAAS,YAAY,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"github-fetch.js","sourceRoot":"","sources":["../../src/lib/github-fetch.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,6BAA6B;AAC7B,EAAE;AACF,oBAAoB;AACpB,+EAA+E;AAC/E,kEAAkE;AAClE,6EAA6E;AAC7E,+BAA+B;AAC/B,gFAAgF;AAChF,kEAAkE;AAClE,2EAA2E;AAC3E,4EAA4E;AAC5E,mEAAmE;AACnE,EAAE;AACF,+EAA+E;AAC/E,mDAAmD;AACnD,8EAA8E;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,gBAAgB;IAChB,2BAA2B;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,YAAY,MAAc,EAAE,IAAY,EAAE,OAAe;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAiBD,SAAS,YAAY,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,aAAa,CAAC,GAAW,EAAE,OAAoB;IACtD,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC1C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CACnB,IAA4B,EAC5B,IAA6B;IAE7B,MAAM,GAAG,GAA2B,EAAE,GAAG,IAAI,EAAE,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,OAAO;QAAE,OAAO,GAAG,CAAC;IAC/B,IAAI,IAAI,CAAC,OAAO,YAAY,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5B,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAiC,CAAC,EAAE,CAAC;YAC5E,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAA2B,EAAE;IAC7D,MAAM,aAAa,GACjB,IAAI,CAAC,aAAa,IAAI,CAAC,GAAG,EAAE,CAAC,kBAAkB,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;IACtE,sEAAsE;IACtE,kEAAkE;IAClE,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,GAAsB,EAAE,IAAkB,EAAE,EAAE,CACjF,UAAsC,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,IAAI,aAAa,CAAC;IAEnD,OAAO,KAAK,UAAU,WAAW,CAC/B,GAAW,EACX,OAAoB,EAAE;QAEtB,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CACb,8GAA8G,CAC/G,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb,sDAAsD,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC5G,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;QAC9B,MAAM,WAAW,GAA2B;YAC1C,YAAY,EAAE,UAAU,OAAO,EAAE;SAClC,CAAC;QACF,IAAI,KAAK;YAAE,WAAW,CAAC,aAAa,GAAG,UAAU,KAAK,EAAE,CAAC;QACzD,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAEhD,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,IAAI,YAAY,GAAoB,IAAI,CAAC;QACzC,OAAO,OAAO,IAAI,WAAW,EAAE,CAAC;YAC9B,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YACvD,YAAY,GAAG,GAAG,CAAC;YAEnB,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC;gBAClE,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;gBACrD,MAAM,UAAU,GAAG,aAAa;oBAC9B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;oBACvE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,uBAAuB,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC;gBACnD,OAAO,EAAE,CAAC;gBACV,IAAI,OAAO,GAAG,WAAW;oBAAE,MAAM;gBACjC,MAAM,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;gBAC/B,SAAS;YACX,CAAC;YAED,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACvB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,gBAAgB,CACxB,GAAG,EACH,IAAI,EACJ,KAAK;oBACH,CAAC,CAAC,uGAAuG;oBACzG,CAAC,CAAC,iGAAiG,CACtG,CAAC;YACJ,CAAC;YAED,OAAO,GAAG,CAAC;QACb,CAAC;QACD,4DAA4D;QAC5D,OAAO,YAAwB,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,GAAW;IAC3B,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,WAAW,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,IAAI,aAAa,GAAuB,IAAI,CAAC;AAC7C,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,IAAkB;IACzD,IAAI,CAAC,aAAa;QAAE,aAAa,GAAG,iBAAiB,EAAE,CAAC;IACxD,OAAO,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,4BAA4B;AAC5B,MAAM,UAAU,gCAAgC;IAC9C,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC"}
|
package/dist/lib/keychain.js
CHANGED
|
@@ -282,10 +282,27 @@ export function createKeychain(opts = {}) {
|
|
|
282
282
|
if (!token || typeof token !== "string") {
|
|
283
283
|
throw new Error("setVskillToken: token must be a non-empty string");
|
|
284
284
|
}
|
|
285
|
+
// 0855 — DUAL-WRITE: unlike the GitHub token, the vsk_ token must ALSO
|
|
286
|
+
// land in the keys.env fallback even when the keyring write succeeds.
|
|
287
|
+
// Rationale: a headless / CLI-spawned `vskill studio` process often
|
|
288
|
+
// cannot read the macOS login Keychain (no GUI session), so the
|
|
289
|
+
// eval-server proxy — which injects vsk_ for /api/v1/submissions —
|
|
290
|
+
// would otherwise get null and return 401. The 0600 file is readable
|
|
291
|
+
// from any spawned process, so it's the reliable cross-process channel.
|
|
292
|
+
// We attempt the keyring (best-effort, for tools that CAN read it) and
|
|
293
|
+
// unconditionally also write the fallback. Reads stay keyring-first via
|
|
294
|
+
// getVskillToken, so the keyring copy still wins when both are present.
|
|
285
295
|
const r = tryKeyring((kr) => kr.setPassword(VSKILL_TOKEN_SERVICE, VSKILL_TOKEN_KEY, token));
|
|
286
|
-
if (r.ok)
|
|
287
|
-
|
|
288
|
-
|
|
296
|
+
if (!r.ok) {
|
|
297
|
+
// Keyring genuinely unavailable — surface the one-time fallback warning.
|
|
298
|
+
ensureFallbackWarned();
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
// Keyring worked, but we still mirror to the file for headless readers.
|
|
302
|
+
// Mark the fallback as in-use WITHOUT emitting the "keychain
|
|
303
|
+
// unavailable" warning, which would be misleading here.
|
|
304
|
+
fallbackInUse = true;
|
|
305
|
+
}
|
|
289
306
|
const map = readFallback();
|
|
290
307
|
map.set(VSKILL_TOKEN_KEY, token);
|
|
291
308
|
writeFallback(map);
|