"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ci(){}function j1(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var xo=function(e){Ko(n,e);var t=D1(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(nt(this,n),r=t.call(this),qo&&Jt.call(Wt(r)),r.options=pf(i),r.services={},r.logger=ut,r.modules={external:[]},j1(Wt(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),oi(r,Wt(r));setTimeout(function(){r.init(i,o)},0)}return r}return rt(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=L1();this.options=ot(ot(ot({},a),this.options),pf(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ot(ot({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?ut.init(l(this.modules.logger),this.options):ut.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=C1);var c=new y1(this.options);this.store=new g1(this.options.resources,this.options);var f=this.services;f.logger=ut,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new x1(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new _1(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new I1(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(v){for(var p=arguments.length,g=new Array(p>1?p-1:0),S=1;S1?p-1:0),S=1;S
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");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(v){i[v]=function(){var p;return(p=i.store)[v].apply(p,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(v){i[v]=function(){var p;return(p=i.store)[v].apply(p,arguments),i}});var y=gr(),w=function(){var p=function(S,P){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),y.resolve(P),s(S,P)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return p(null,i.t.bind(i));i.changeLanguage(i.options.lng,p)};return this.options.resources||!this.options.initImmediate?w():setTimeout(w,0),y}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(h){if(!!h){var m=o.services.languageUtils.toResolveHierarchy(h);m.forEach(function(y){u.indexOf(y)<0&&u.push(y)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(d)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=gr();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Ci),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&dh.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=gr();this.emit("languageChanging",i);var l=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},u=function(d,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(d,function(){return s.t.apply(s,arguments)})},c=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var h=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(m){u(m,h)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function u(c,f){var d;if(qt(f)!=="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),y=2;y1&&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;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(h,m){var y=o.services.backendConnector.state["".concat(h,"|").concat(m)];return y===-1||y===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=gr();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=gr();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["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"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci,a=ot(ot(ot({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=ot({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new af(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),h=1;h0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new xo(e,t)});var ke=xo.createInstance();ke.createInstance=xo.createInstance;ke.createInstance;ke.init;ke.loadResources;ke.reloadResources;ke.use;ke.changeLanguage;ke.getFixedT;ke.t;ke.exists;ke.setDefaultNamespace;ke.hasLoadedNamespace;ke.loadNamespaces;ke.loadLanguages;const T1="Stable Diffusion UI",M1="",b1={home:"Home",history:"History",community:"Community",settings:"Settings"},A1={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},U1={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",upscale:"Upscale the image to 4x resolution using:",corrected:"Show only the corrected/upscaled image"},z1={txt:"Image Modifiers (art styles, tags etc)"},$1={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},B1={fave:"Favorites Only",search:"Search"},Q1={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},V1=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
+ */var Vo=E.exports,hy=Ml.exports;function py(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gy=typeof Object.is=="function"?Object.is:py,vy=hy.useSyncExternalStore,my=Vo.useRef,yy=Vo.useEffect,Sy=Vo.useMemo,wy=Vo.useDebugValue;np.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=my(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Sy(function(){function l(v){if(!u){if(u=!0,c=v,v=r(v),i!==void 0&&s.hasValue){var m=s.value;if(i(m,v))return f=m}return f=v}if(m=f,gy(c,v))return m;var S=r(v);return i!==void 0&&i(m,S)?m:(c=v,f=S)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,i]);var a=vy(e,o[0],o[1]);return yy(function(){s.hasValue=!0,s.value=a},[a]),wy(a),a};(function(e){e.exports=np})(tp);const ky=gf(tp.exports),{useSyncExternalStoreWithSelector:Oy}=ky;function xy(e,t=e.getState,n){const r=Oy(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return E.exports.useDebugValue(r),r}const bc=e=>{const t=typeof e=="function"?dy(e):e,n=(r,i)=>xy(t,r,i);return Object.assign(n,t),n},_y=e=>e?bc(e):bc;var Yl=_y;const Py=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=t;let l;try{l=(o!=null?o:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const u=l.connect(a);let c=!0;i.setState=(v,m,S)=>{const w=n(v,m);return c&&u.send(S===void 0?{type:s||"anonymous"}:typeof S=="string"?{type:S}:S,r()),w};const f=(...v)=>{const m=c;c=!1,n(...v),c=m},d=e(i.setState,r,i);if(u.init(d),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let v=!1;const m=i.dispatch;i.dispatch=(...S)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&S[0].type==="__setState"&&!v&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),v=!0),m(...S)}}return u.subscribe(v=>{var m;switch(v.type){case"ACTION":if(typeof v.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ns(v.payload,S=>{if(S.type==="__setState"){f(S.state);return}!i.dispatchFromDevtools||typeof i.dispatch=="function"&&i.dispatch(S)});case"DISPATCH":switch(v.payload.type){case"RESET":return f(d),u.init(i.getState());case"COMMIT":return u.init(i.getState());case"ROLLBACK":return Ns(v.state,S=>{f(S),u.init(i.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ns(v.state,S=>{f(S)});case"IMPORT_STATE":{const{nextLiftedState:S}=v.payload,w=(m=S.computedStates.slice(-1)[0])==null?void 0:m.state;if(!w)return;f(w),u.send(null,S);return}case"PAUSE_RECORDING":return c=!c}return}}),d},Cy=Py,Ns=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)},ko=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ko(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ko(r)(n)}}}},Ey=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:w=>w,version:0,merge:(w,g)=>({...g,...w}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...w)},r,i);const c=ko(o.serialize),f=()=>{const w=o.partialize({...r()});let g;const h=c({state:w,version:o.version}).then(p=>u.setItem(o.name,p)).catch(p=>{g=p});if(g)throw g;return h},d=i.setState;i.setState=(w,g)=>{d(w,g),f()};const v=e((...w)=>{n(...w),f()},r,i);let m;const S=()=>{var w;if(!u)return;s=!1,a.forEach(h=>h(r()));const g=((w=o.onRehydrateStorage)==null?void 0:w.call(o,r()))||void 0;return ko(u.getItem.bind(u))(o.name).then(h=>{if(h)return o.deserialize(h)}).then(h=>{if(h)if(typeof h.version=="number"&&h.version!==o.version){if(o.migrate)return o.migrate(h.state,h.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return h.state}).then(h=>{var p;return m=o.merge(h,(p=r())!=null?p:v),n(m,!0),f()}).then(()=>{g==null||g(m,void 0),s=!0,l.forEach(h=>h(m))}).catch(h=>{g==null||g(void 0,h)})};return i.persist={setOptions:w=>{o={...o,...w},w.getStorage&&(u=w.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>S(),hasHydrated:()=>s,onHydrate:w=>(a.add(w),()=>{a.delete(w)}),onFinishHydration:w=>(l.add(w),()=>{l.delete(w)})},S(),m||v},Ry=Ey;function Xr(){return Math.floor(Math.random()*1e4)}const j=Yl(Cy((e,t)=>({parallelCount:1,requestOptions:{prompt:"a photograph of an astronaut riding a horse",seed:Xr(),num_outputs:1,num_inference_steps:50,guidance_scale:7.5,width:512,height:512,prompt_strength:.8,turbo:!0,use_cpu:!1,use_full_precision:!0,save_to_disk_path:"null",use_face_correction:"GFPGANv1.3",use_upscale:"RealESRGAN_x4plus",show_only_filtered_image:!0},tags:[],uiOptions:{isUseRandomSeed:!0,isUseAutoSave:!1,isSoundEnabled:!1},allModifiers:[[[]]],isInpainting:!1,setParallelCount:n=>e(ie(r=>{r.parallelCount=n})),setRequestOptions:(n,r)=>{e(ie(i=>{i.requestOptions[n]=r}))},getValueForRequestKey:n=>t().requestOptions[n],setAllModifiers:n=>{e(ie(r=>{r.allModifiers=n}))},toggleTag:n=>{e(ie(r=>{const i=r.tags.indexOf(n);i>-1?r.tags.splice(i,1):r.tags.push(n)}))},hasTag:n=>t().tags.indexOf(n)>-1,selectedTags:()=>t().tags,builtRequest:()=>{const n=t(),r=n.requestOptions,i=n.tags,o=`${r.prompt} ${i.join(",")}`,s={...r,prompt:o};return n.uiOptions.isUseAutoSave||(s.save_to_disk_path=null),s.init_image===void 0&&(s.prompt_strength=void 0),s.use_upscale===""&&(s.use_upscale=null),s.use_upscale===null&&s.use_face_correction===null&&(s.show_only_filtered_image=!1),s},toggleUseFaceCorrection:()=>{e(ie(n=>{const r=typeof n.getValueForRequestKey("use_face_correction")=="string"?null:"GFPGANv1.3";n.requestOptions.use_face_correction=r}))},isUsingFaceCorrection:()=>typeof t().getValueForRequestKey("use_face_correction")=="string",isUsingUpscaling:()=>t().getValueForRequestKey("use_upscale")!=="",toggleUseRandomSeed:()=>{e(ie(n=>{n.uiOptions.isUseRandomSeed=!n.uiOptions.isUseRandomSeed,n.requestOptions.seed=n.uiOptions.isUseRandomSeed?Xr():n.requestOptions.seed,localStorage.setItem("ui:isUseRandomSeed",n.uiOptions.isUseRandomSeed)}))},isRandomSeed:()=>t().uiOptions.isUseRandomSeed,toggleUseAutoSave:()=>{e(ie(n=>{n.uiOptions.isUseAutoSave=!n.uiOptions.isUseAutoSave,localStorage.setItem("ui:isUseAutoSave",n.uiOptions.isUseAutoSave)}))},isUseAutoSave:()=>t().uiOptions.isUseAutoSave,toggleSoundEnabled:()=>{e(ie(n=>{n.uiOptions.isSoundEnabled=!n.uiOptions.isSoundEnabled}))},isSoundEnabled:()=>t().uiOptions.isSoundEnabled,toggleInpainting:()=>{e(ie(n=>{n.isInpainting=!n.isInpainting}))}})));var Ac="_1jo75h1",Uc="_1jo75h0",Ny="_1jo75h2";const zc="Stable Diffusion is starting...",Iy="Stable Diffusion is ready to use!",$c="Stable Diffusion is not running!";function Ly({className:e}){const[t,n]=E.exports.useState(zc),[r,i]=E.exports.useState(Uc),{status:o,data:s}=vn(["health"],oy,{refetchInterval:iy});return E.exports.useEffect(()=>{o==="loading"?(n(zc),i(Uc)):o==="error"?(n($c),i(Ac)):o==="success"&&(s[0]==="OK"?(n(Iy),i(Ny)):(n($c),i(Ac)))},[o,s]),k(Sn,{children:k("p",{className:[r,e].join(" "),children:t})})}function qt(e){return qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(e)}function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bc(e,t){for(var n=0;n",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},Fy=function(t){return jy[t]},Ty=function(t){return t.replace(Dy,Fy)};function Qc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Ua=Vc(Vc({},Ua),e)}function Ay(){return Ua}var Uy=function(){function e(){nt(this,e),this.usedNamespaces={}}return rt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function zy(e){rp=e}function $y(){return rp}var By={type:"3rdParty",init:function(t){by(t.options.react),zy(t)}};function Qy(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(r,e)&&(!i||s(o,e)))}function Hy(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return za("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,e))return!1}}):Vy(e,t,n)}function ip(e){if(Array.isArray(e))return e}function Ky(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function qc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=E.exports.useContext(My)||{},i=r.i18n,o=r.defaultNS,s=n||i||$y();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new Uy),!s){za("You will need to pass in an i18next instance by using initReactI18next");var a=function(R){return Array.isArray(R)?R[R.length-1]:R},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&za("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=Is(Is(Is({},Ay()),s.options.react),t),c=u.useSuspense,f=u.keyPrefix,d=e||o||s.options&&s.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(d);var v=(s.isInitialized||s.initializedStoreOnce)&&d.every(function(O){return Hy(O,s,u)});function m(){return s.getFixedT(null,u.nsMode==="fallback"?d:d[0],f)}var S=E.exports.useState(m),w=qy(S,2),g=w[0],h=w[1],p=d.join(),y=Wy(p),_=E.exports.useRef(!0);E.exports.useEffect(function(){var O=u.bindI18n,R=u.bindI18nStore;_.current=!0,!v&&!c&&Kc(s,d,function(){_.current&&h(m)}),v&&y&&y!==p&&_.current&&h(m);function D(){_.current&&h(m)}return O&&s&&s.on(O,D),R&&s&&s.store.on(R,D),function(){_.current=!1,O&&s&&O.split(" ").forEach(function(b){return s.off(b,D)}),R&&s&&R.split(" ").forEach(function(b){return s.store.off(b,D)})}},[s,p]);var P=E.exports.useRef(!0);E.exports.useEffect(function(){_.current&&!P.current&&h(m),P.current=!1},[s,f]);var x=[g,s,v];if(x.t=g,x.i18n=s,x.ready=v,v||!v&&!c)return x;throw new Promise(function(O){Kc(s,d,function(){O()})})}var Gy="_1v2cc580";function Yy(){const{t:e}=ap(),{status:t,data:n}=vn([Aa],ep),[r,i]=E.exports.useState("2.1.0"),[o,s]=E.exports.useState("");return E.exports.useEffect(()=>{if(t==="success"){const{update_branch:a}=n;i("v2.1"),s(a==="main"?"(stable)":"(beta)")}},[t,n,i,i]),N("div",{className:Gy,children:[N("h1",{children:[e("title")," ",r," ",o," "]}),k(Ly,{className:"status-display"})]})}const Ke=Yl(Ry((e,t)=>({isOpenAdvancedSettings:!1,isOpenAdvImprovementSettings:!1,isOpenAdvPropertySettings:!1,isOpenAdvWorkflowSettings:!1,isOpenAdvGPUSettings:!1,isOpenImageModifier:!1,imageMofidiersMap:{},toggleAdvancedSettings:()=>{e(ie(n=>{n.isOpenAdvancedSettings=!n.isOpenAdvancedSettings}))},toggleAdvImprovementSettings:()=>{e(ie(n=>{n.isOpenAdvImprovementSettings=!n.isOpenAdvImprovementSettings}))},toggleAdvPropertySettings:()=>{e(ie(n=>{n.isOpenAdvPropertySettings=!n.isOpenAdvPropertySettings}))},toggleAdvWorkflowSettings:()=>{e(ie(n=>{n.isOpenAdvWorkflowSettings=!n.isOpenAdvWorkflowSettings}))},toggleAdvGPUSettings:()=>{e(ie(n=>{n.isOpenAdvGPUSettings=!n.isOpenAdvGPUSettings}))},toggleImageModifier:()=>{e(ie(n=>{n.isOpenImageModifier=!n.isOpenImageModifier}))}}),{name:"createUI"}));var lp="_1961rof0",me="_1961rof1";var gr="_11d5x3d1",Jy="_11d5x3d0",Ho="_11d5x3d2";function Xy(){const e=j(c=>c.isUsingFaceCorrection()),t=j(c=>c.isUsingUpscaling()),n=j(c=>c.getValueForRequestKey("use_upscale")),r=j(c=>c.getValueForRequestKey("show_only_filtered_image")),i=j(c=>c.toggleUseFaceCorrection),o=j(c=>c.setRequestOptions),s=Ke(c=>c.isOpenAdvImprovementSettings),a=Ke(c=>c.toggleAdvImprovementSettings),[l,u]=E.exports.useState(!1);return E.exports.useEffect(()=>{u(!(e||n))},[e,t,u]),N("div",{children:[k("button",{type:"button",className:Ho,onClick:a,children:k("h4",{children:"Improvement Settings"})}),s&&N(Sn,{children:[k("div",{className:me,children:N("label",{children:[k("input",{type:"checkbox",checked:e,onChange:c=>i()}),"Fix incorrect faces and eyes (uses GFPGAN)"]})}),k("div",{className:me,children:N("label",{children:["Upscale the image to 4x resolution using",N("select",{id:"upscale_model",name:"upscale_model",value:n,onChange:c=>{o("use_upscale",c.target.value)},children:[k("option",{value:"",children:"No Uscaling"}),k("option",{value:"RealESRGAN_x4plus",children:"RealESRGAN_x4plus"}),k("option",{value:"RealESRGAN_x4plus_anime_6B",children:"RealESRGAN_x4plus_anime_6B"})]})]})}),k("div",{className:me,children:N("label",{children:[k("input",{disabled:l,type:"checkbox",checked:r,onChange:c=>o("show_only_filtered_image",c.target.checked)}),"Show only filtered image"]})})]})]})}const Gc=[{value:128,label:"128 (*)"},{value:192,label:"192"},{value:256,label:"256 (*)"},{value:320,label:"320"},{value:384,label:"384"},{value:448,label:"448"},{value:512,label:"512 (*)"},{value:576,label:"576"},{value:640,label:"640"},{value:704,label:"704"},{value:768,label:"768 (*)"},{value:832,label:"832"},{value:896,label:"896"},{value:960,label:"960"},{value:1024,label:"1024 (*)"}];function Zy(){const e=j(d=>d.setRequestOptions),t=j(d=>d.toggleUseRandomSeed),n=j(d=>d.isRandomSeed()),r=j(d=>d.getValueForRequestKey("seed")),i=j(d=>d.getValueForRequestKey("num_inference_steps")),o=j(d=>d.getValueForRequestKey("guidance_scale")),s=j(d=>d.getValueForRequestKey("init_image")),a=j(d=>d.getValueForRequestKey("prompt_strength")),l=j(d=>d.getValueForRequestKey("width")),u=j(d=>d.getValueForRequestKey("height")),c=Ke(d=>d.isOpenAdvPropertySettings),f=Ke(d=>d.toggleAdvPropertySettings);return N("div",{children:[k("button",{type:"button",className:Ho,onClick:f,children:k("h4",{children:"Property Settings"})}),c&&N(Sn,{children:[N("div",{className:me,children:[N("label",{children:["Seed:",k("input",{size:10,value:r,onChange:d=>e("seed",d.target.value),disabled:n,placeholder:"random"})]}),N("label",{children:[k("input",{type:"checkbox",checked:n,onChange:d=>t()})," ","Random Image"]})]}),k("div",{className:me,children:N("label",{children:["Number of inference steps:"," ",k("input",{value:i,onChange:d=>{e("num_inference_steps",d.target.value)},size:4})]})}),N("div",{className:me,children:[N("label",{children:["Guidance Scale:",k("input",{value:o,onChange:d=>e("guidance_scale",d.target.value),type:"range",min:"0",max:"20",step:".1"})]}),k("span",{children:o})]}),s&&N("div",{className:me,children:[N("label",{children:["Prompt Strength:"," ",k("input",{value:a,onChange:d=>e("prompt_strength",d.target.value),type:"range",min:"0",max:"1",step:".05"})]}),k("span",{children:a})]}),N("div",{className:me,children:[N("label",{children:["Width:",k("select",{value:l,onChange:d=>e("width",d.target.value),children:Gc.map(d=>k("option",{value:d.value,children:d.label},"width-option_"+d.value))})]}),N("label",{children:["Height:",k("select",{value:u,onChange:d=>e("height",d.target.value),children:Gc.map(d=>k("option",{value:d.value,children:d.label},"height-option_"+d.value))})]})]})]})]})}function e0(){const e=j(f=>f.getValueForRequestKey("num_outputs")),t=j(f=>f.parallelCount),n=j(f=>f.isUseAutoSave()),r=j(f=>f.getValueForRequestKey("save_to_disk_path")),i=j(f=>f.isSoundEnabled()),o=j(f=>f.setRequestOptions),s=j(f=>f.setParallelCount),a=j(f=>f.toggleUseAutoSave),l=j(f=>f.toggleSoundEnabled),u=Ke(f=>f.isOpenAdvWorkflowSettings),c=Ke(f=>f.toggleAdvWorkflowSettings);return N("div",{children:[k("button",{type:"button",className:Ho,onClick:c,children:k("h4",{children:"Workflow Settings"})}),u&&N(Sn,{children:[k("div",{className:me,children:N("label",{children:["Number of images to make:"," ",k("input",{type:"number",value:e,onChange:f=>o("num_outputs",parseInt(f.target.value,10)),size:4})]})}),k("div",{className:me,children:N("label",{children:["Generate in parallel:",k("input",{type:"number",value:t,onChange:f=>s(parseInt(f.target.value,10)),size:4})]})}),N("div",{className:me,children:[N("label",{children:[k("input",{checked:n,onChange:f=>a(),type:"checkbox"}),"Automatically save to"," "]}),N("label",{children:[k("input",{value:r,onChange:f=>o("save_to_disk_path",f.target.value),size:40,disabled:!n}),k("span",{className:"visually-hidden",children:"Path on disk where images will be saved"})]})]}),k("div",{className:me,children:N("label",{children:[k("input",{checked:i,onChange:f=>l(),type:"checkbox"}),"Play sound on task completion"]})})]})]})}function t0(){const e=j(s=>s.getValueForRequestKey("turbo")),t=j(s=>s.getValueForRequestKey("use_cpu")),n=j(s=>s.getValueForRequestKey("use_full_precision")),r=j(s=>s.setRequestOptions),i=Ke(s=>s.isOpenAdvGPUSettings),o=Ke(s=>s.toggleAdvGPUSettings);return N("div",{children:[k("button",{type:"button",className:Ho,onClick:o,children:k("h4",{children:"GPU Settings"})}),i&&N(Sn,{children:[k("div",{className:me,children:N("label",{children:[k("input",{checked:e,onChange:s=>r("turbo",s.target.checked),type:"checkbox"}),"Turbo mode (generates images faster, but uses an additional 1 GB of GPU memory)"]})}),k("div",{className:me,children:N("label",{children:[k("input",{type:"checkbox",checked:t,onChange:s=>r("use_cpu",s.target.checked)}),"Use CPU instead of GPU (warning: this will be *very* slow)"]})}),k("div",{className:me,children:N("label",{children:[k("input",{checked:n,onChange:s=>r("use_full_precision",s.target.checked),type:"checkbox"}),"Use full precision (for GPU-only. warning: this will consume more VRAM)"]})})]})]})}function n0(){const[e,t]=E.exports.useState(!1),[n,r]=E.exports.useState("beta"),{status:i,data:o}=vn([Aa],ep),s=zl(),{status:a,data:l}=vn([ly],async()=>await uy(n),{enabled:e});return E.exports.useEffect(()=>{if(i==="success"){const{update_branch:u}=o;r(u==="main"?"beta":"main")}},[i,o]),E.exports.useEffect(()=>{a==="success"&&(l[0]==="OK"&&s.invalidateQueries([Aa]),t(!1))},[a,l,t]),N("label",{children:[k("input",{disabled:!0,type:"checkbox",checked:n==="main",onChange:u=>{t(!0)}}),"Enable Beta Mode"]})}function r0(){return N("ul",{className:Jy,children:[k("li",{className:gr,children:k(Xy,{})}),k("li",{className:gr,children:k(Zy,{})}),k("li",{className:gr,children:k(e0,{})}),k("li",{className:gr,children:k(t0,{})}),k("li",{className:gr,children:k(n0,{})})]})}function i0(){const e=Ke(n=>n.isOpenAdvancedSettings),t=Ke(n=>n.toggleAdvancedSettings);return N("div",{className:lp,children:[k("button",{type:"button",onClick:t,className:"panel-box-toggle-btn",children:k("h3",{children:"Advanced Settings"})}),e&&k(r0,{})]})}var o0="g3uahc1",s0="g3uahc0",a0="g3uahc2",l0="g3uahc3";function up({name:e}){const t=j(i=>i.hasTag(e))?"selected":"",n=j(i=>i.toggleTag),r=()=>{n(e)};return k("div",{className:"modifierTag "+t,onClick:r,children:k("p",{children:e})})}function u0({tags:e}){return k("ul",{className:l0,children:e.map(t=>k("li",{children:k(up,{name:t})},t))})}function c0({title:e,tags:t}){const[n,r]=E.exports.useState(!1);return N("div",{className:o0,children:[k("button",{type:"button",className:a0,onClick:()=>{r(!n)},children:k("h4",{children:e})}),n&&k(u0,{tags:t})]})}function f0(){const e=j(i=>i.allModifiers),t=Ke(i=>i.isOpenImageModifier),n=Ke(i=>i.toggleImageModifier);return N("div",{className:lp,children:[k("button",{type:"button",onClick:()=>{n()},className:"panel-box-toggle-btn",children:k("h3",{children:"Image Modifiers (art styles, tags, ect)"})}),t&&k("ul",{className:s0,children:e.map((i,o)=>k("li",{children:k(c0,{title:i[0],tags:i[1]})},i[0]))})]})}var d0="fma0ug0";function h0({imageData:e,brushSize:t,brushShape:n,brushColor:r,isErasing:i}){const o=E.exports.useRef(null),s=E.exports.useRef(null),[a,l]=E.exports.useState(!1),[u,c]=E.exports.useState(512),[f,d]=E.exports.useState(512);E.exports.useEffect(()=>{const h=new Image;h.onload=()=>{c(h.width),d(h.height)},h.src=e},[e]),E.exports.useEffect(()=>{if(o.current!=null){const h=o.current.getContext("2d"),p=h.getImageData(0,0,u,f),y=p.data;for(let _=0;_0&&(y[_]=parseInt(r,16),y[_+1]=parseInt(r,16),y[_+2]=parseInt(r,16));h.putImageData(p,0,0)}},[r]);const v=h=>{l(!0)},m=h=>{l(!1);const p=o.current;p!=null&&p.toDataURL()},S=(h,p,y,_,P)=>{const x=o.current;if(x!=null){const O=x.getContext("2d");if(i){const R=y/2;O.clearRect(h-R,p-R,y,y)}else O.beginPath(),O.lineWidth=y,O.lineCap=_,O.strokeStyle=P,O.moveTo(h,p),O.lineTo(h,p),O.stroke()}},w=(h,p,y,_,P)=>{const x=s.current;if(x!=null){const O=x.getContext("2d");if(O.beginPath(),O.clearRect(0,0,x.width,x.height),i){const R=y/2;O.lineWidth=2,O.lineCap="butt",O.strokeStyle=P,O.moveTo(h-R,p-R),O.lineTo(h+R,p-R),O.lineTo(h+R,p+R),O.lineTo(h-R,p+R),O.lineTo(h-R,p-R),O.stroke()}else O.lineWidth=y,O.lineCap=_,O.strokeStyle=P,O.moveTo(h,p),O.lineTo(h,p),O.stroke()}};return N("div",{className:d0,children:[k("img",{src:e}),k("canvas",{ref:o,width:u,height:f}),k("canvas",{ref:s,width:u,height:f,onMouseDown:v,onMouseUp:m,onMouseMove:h=>{const{nativeEvent:{offsetX:p,offsetY:y}}=h;w(p,y,t,n,r),a&&S(p,y,t,n,r)}})]})}var Yc="_2yyo4x2",p0="_2yyo4x1",g0="_2yyo4x0";function v0(){const e=E.exports.useRef(null),[t,n]=E.exports.useState("20"),[r,i]=E.exports.useState("round"),[o,s]=E.exports.useState("#fff"),[a,l]=E.exports.useState(!1),u=j(S=>S.getValueForRequestKey("init_image"));return N("div",{className:g0,children:[k(h0,{imageData:u,brushSize:t,brushShape:r,brushColor:o,isErasing:a}),N("div",{className:p0,children:[N("div",{className:Yc,children:[k("button",{onClick:()=>{l(!1)},children:"Mask"}),k("button",{onClick:()=>{l(!0)},children:"Erase"}),k("button",{disabled:!0,onClick:()=>{console.log("fill mask!!",e)},children:"Fill"}),k("button",{disabled:!0,onClick:()=>{console.log("clear all")},children:"Clear"}),N("label",{children:["Brush Size",k("input",{type:"range",min:"1",max:"100",value:t,onChange:S=>{n(S.target.value)}})]})]}),N("div",{className:Yc,children:[k("button",{onClick:()=>{i("round")},children:"Cirle Brush"}),k("button",{onClick:()=>{i("square")},children:"Square Brush"}),k("button",{onClick:()=>{s("#000")},children:"Dark Brush"}),k("button",{onClick:()=>{s("#fff")},children:"Light Brush"})]})]})]})}var m0="cjcdm20",y0="cjcdm21";var S0="_1how28i0",w0="_1how28i1";var k0="_1rn4m8a4",O0="_1rn4m8a2",x0="_1rn4m8a3",_0="_1rn4m8a0",P0="_1rn4m8a1",C0="_1rn4m8a5";function E0(e){const t=E.exports.useRef(null),n=j(u=>u.getValueForRequestKey("init_image")),r=j(u=>u.isInpainting),i=j(u=>u.setRequestOptions),o=()=>{var u;(u=t.current)==null||u.click()},s=u=>{const c=u.target.files[0];if(c){const f=new FileReader;f.onload=d=>{d.target!=null&&i("init_image",d.target.result)},f.readAsDataURL(c)}},a=j(u=>u.toggleInpainting);return N("div",{className:_0,children:[N("div",{children:[N("label",{className:P0,children:[k("b",{children:"Initial Image:"})," (optional)"]}),k("input",{ref:t,className:O0,name:"init_image",type:"file",onChange:s}),k("button",{className:x0,onClick:o,children:"Select File"})]}),k("div",{className:k0,children:n&&N(Sn,{children:[N("div",{children:[k("img",{src:n,width:"100",height:"100"}),k("button",{className:C0,onClick:()=>{i("init_image",void 0),r&&a()},children:"X"})]}),N("label",{children:[k("input",{type:"checkbox",onChange:u=>{a()},checked:r}),"Use for Inpainting"]})]})})]})}function R0(){const e=j(t=>t.selectedTags());return N("div",{className:"selected-tags",children:[k("p",{children:"Active Tags"}),k("ul",{children:e.map(t=>k("li",{children:k(up,{name:t})},t))})]})}const bn=Yl((e,t)=>({images:new Array,completedImageIds:new Array,addNewImage:(n,r,i=!1)=>{e(ie(o=>{let{seed:s}=r;i&&(s=Xr()),o.images.push({id:n,options:{...r,seed:s}})}))},hasQueuedImages:()=>t().images.length>0,firstInQueue:()=>t().images[0]||[],removeFirstInQueue:()=>{e(ie(n=>{const r=n.images.shift();n.completedImageIds.push(r.id)}))},clearCachedIds:()=>{e(ie(n=>{n.completedImageIds=[]}))}}));let _i;const N0=new Uint8Array(16);function I0(){if(!_i&&(_i=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_i))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _i(N0)}const ae=[];for(let e=0;e<256;++e)ae.push((e+256).toString(16).slice(1));function L0(e,t=0){return(ae[e[t+0]]+ae[e[t+1]]+ae[e[t+2]]+ae[e[t+3]]+"-"+ae[e[t+4]]+ae[e[t+5]]+"-"+ae[e[t+6]]+ae[e[t+7]]+"-"+ae[e[t+8]]+ae[e[t+9]]+"-"+ae[e[t+10]]+ae[e[t+11]]+ae[e[t+12]]+ae[e[t+13]]+ae[e[t+14]]+ae[e[t+15]]).toLowerCase()}const D0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Jc={randomUUID:D0};function j0(e,t,n){if(Jc.randomUUID&&!t&&!e)return Jc.randomUUID();e=e||{};const r=e.random||(e.rng||I0)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return L0(r)}var F0="_1hnlbmt0";function T0(){const{t:e}=ap(),t=j(l=>l.parallelCount),n=j(l=>l.builtRequest),r=bn(l=>l.addNewImage),i=bn(l=>l.hasQueuedImages()),o=j(l=>l.isRandomSeed()),s=j(l=>l.setRequestOptions);return k("button",{className:F0,onClick:()=>{const l=n();let u=[],{num_outputs:c}=l;if(t>c)u.push(c);else for(;c>=1;)c-=t,c<=0?u.push(t):u.push(Math.abs(c));u.forEach((f,d)=>{let v=l.seed;d!==0&&(v=Xr()),r(j0(),{...l,num_outputs:f,seed:v})}),o&&s("seed",Xr())},disabled:i,children:e("home.make-img-btn")})}function M0(){const e=j(r=>r.getValueForRequestKey("prompt")),t=j(r=>r.setRequestOptions);return N("div",{className:S0,children:[N("div",{className:w0,children:[k("p",{children:"Prompt "}),k("textarea",{value:e,onChange:r=>{t("prompt",r.target.value)}})]}),k(E0,{}),k(R0,{}),k(T0,{})]})}function b0(){const e=j(t=>t.isInpainting);return N(Sn,{children:[N("div",{className:m0,children:[k(M0,{}),k(i0,{}),k(f0,{})]}),e&&k("div",{className:y0,children:k(v0,{})})]})}const A0=`${tn}/ding.mp3`,U0=xf.forwardRef((e,t)=>k("audio",{ref:t,style:{display:"none"},children:k("source",{src:A0,type:"audio/mp3"})}));var z0="_1yvg52n0",$0="_1yvg52n1";function B0({imageData:e,metadata:t,className:n}){return k("div",{className:[z0,n].join(" "),children:k("img",{className:$0,src:e,alt:t.prompt})})}function Q0({isLoading:e,image:t}){const{info:n,data:r}=t!=null?t:{},i=j(l=>l.setRequestOptions),o=()=>{const{prompt:l,seed:u,num_inference_steps:c,guidance_scale:f,use_face_correction:d,use_upscale:v,width:m,height:S}=n;let w=l.replace(/[^a-zA-Z0-9]/g,"_");w=w.substring(0,100);let g=`${w}_Seed-${u}_Steps-${c}_Guidance-${f}`;return d&&(g+=`_FaceCorrection-${d}`),v&&(g+=`_Upscale-${v}`),g+=`_${m}x${S}`,g+=".png",g},s=()=>{const l=document.createElement("a");l.download=o(),l.href=r,l.click()},a=()=>{i("init_image",r)};return k("div",{className:"current-display",children:e?k("h4",{className:"loading",children:"Loading..."}):t!=null&&N("div",{children:[N("p",{children:[" ",n==null?void 0:n.prompt]}),k(B0,{imageData:r,metadata:n}),N("div",{children:[k("button",{onClick:s,children:"Save"}),k("button",{onClick:a,children:"Use as Input"})]})]})||k("h4",{className:"no-image",children:"Try Making a new image!"})})}var V0="fsj92y3",H0="fsj92y1",K0="fsj92y0",q0="fsj92y2";function W0({images:e,setCurrentDisplay:t,removeImages:n}){const r=i=>{const o=e[i];t(o)};return N("div",{className:K0,children:[e!=null&&e.length>0&&k("button",{className:V0,onClick:()=>{n()},children:"REMOVE"}),k("ul",{className:H0,children:e!=null&&e.map((i,o)=>i===void 0?(console.warn(`image ${o} is undefined`),null):k("li",{children:k("button",{className:q0,onClick:()=>{r(o)},children:k("img",{src:i.data,alt:i.info.prompt})})},i.id))})]})}var G0="_688lcr1",Y0="_688lcr0",J0="_688lcr2";const X0="_batch";function Z0(){const e=E.exports.useRef(null),t=j(p=>p.isSoundEnabled()),{id:n,options:r}=bn(p=>p.firstInQueue()),i=bn(p=>p.removeFirstInQueue),[o,s]=E.exports.useState(null),[a,l]=E.exports.useState(!1),[u,c]=E.exports.useState(!0),{status:f,data:d}=vn([Rs,n],async()=>await cy(r),{enabled:a});E.exports.useEffect(()=>{l(n!==void 0)},[n]),E.exports.useEffect(()=>{c(!!(a&&f==="loading"))},[a,f]),E.exports.useEffect(()=>{var p;f==="success"&&d.status==="succeeded"&&(t&&((p=e.current)==null||p.play()),i())},[f,d,i,e,t]);const v=zl(),[m,S]=E.exports.useState([]),w=bn(p=>p.completedImageIds),g=bn(p=>p.clearCachedIds);return E.exports.useEffect(()=>{const p=w.map(y=>v.getQueryData([Rs,y]));if(p.length>0){const y=p.map((_,P)=>{if(_!==void 0)return _.output.map((x,O)=>({id:`${w[O]}${X0}-${x.seed}-${x.index}`,data:x.data,info:{..._.request,seed:x.seed}}))}).flat().reverse().filter(_=>_!==void 0);S(y),s(y[0]||null)}else S([]),s(null)},[S,s,v,w]),N("div",{className:Y0,children:[k(U0,{ref:e}),k("div",{className:G0,children:k(Q0,{isLoading:u,image:o})}),k("div",{className:J0,children:k(W0,{removeImages:()=>{w.forEach(p=>{v.removeQueries([Rs,p])}),g()},images:m,setCurrentDisplay:s})})]})}var e1="_97t2g71",t1="_97t2g70";function n1(){return N("div",{className:t1,children:[N("p",{children:["If you found this project useful and want to help keep it alive, please"," ",k("a",{href:"https://ko-fi.com/cmdr2_stablediffusion_ui",target:"_blank",rel:"noreferrer",children:k("img",{src:`${tn}/kofi.png`,className:e1})})," ","to help cover the cost of development and maintenance! Thank you for your support!"]}),N("p",{children:["Please feel free to join the"," ",k("a",{href:"https://discord.com/invite/u9yhsFmEkB",target:"_blank",rel:"noreferrer",children:"discord community"})," ","or"," ",k("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/issues",target:"_blank",rel:"noreferrer",children:"file an issue"})," ","if you have any problems or suggestions in using this interface."]}),N("div",{id:"footer-legal",children:[N("p",{children:[k("b",{children:"Disclaimer:"})," The authors of this project are not responsible for any content generated using this interface."]}),N("p",{children:["This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, ",k("br",{}),"spread misinformation and target vulnerable groups. For the full list of restrictions please read"," ",k("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/blob/main/LICENSE",target:"_blank",rel:"noreferrer",children:"the license"}),"."]}),k("p",{children:"By using this software, you consent to the terms and conditions of the license."})]})]})}function r1({className:e}){const t=j(a=>a.setRequestOptions),{status:n,data:r}=vn(["SaveDir"],ay),{status:i,data:o}=vn(["modifications"],sy),s=j(a=>a.setAllModifiers);return E.exports.useEffect(()=>{n==="success"&&t("save_to_disk_path",r)},[t,n,r]),E.exports.useEffect(()=>{i==="success"?s(o):i==="error"&&s(fy)},[t,i,o]),N("div",{className:[Zm,e].join(" "),children:[k("header",{className:ry,children:k(Yy,{})}),k("nav",{className:ey,children:k(b0,{})}),k("main",{className:ty,children:k(Z0,{})}),k("footer",{className:ny,children:k(n1,{})})]})}function i1({className:e}){return k("div",{children:k("h1",{children:"Settings"})})}var o1="_4vfmtj1z";function Wt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $a(e,t){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$a(e,t)}function Ko(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$a(e,t)}function oi(e,t){if(t&&(qt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wt(e)}function ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ht(e)}function s1(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a1(e){return ip(e)||s1(e)||op(e)||sp()}function Xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};nt(this,e),this.init(t,n)}return rt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||l1,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function tf(e,t,n){var r=Jl(e,t,Object),i=r.obj,o=r.k;i[o]=n}function f1(e,t,n,r){var i=Jl(e,t,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Oo(e,t){var n=Jl(e,t),r=n.obj,i=n.k;if(!!r)return r[i]}function nf(e,t,n){var r=Oo(e,n);return r!==void 0?r:Oo(t,n)}function cp(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):cp(e[r],t[r],n):e[r]=t[r]);return e}function _n(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var d1={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function h1(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return d1[t]}):e}var qo=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,p1=[" ",",","?","!",";"];function g1(e,t,n){t=t||"",n=n||"";var r=p1.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(e);if(!o){var s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}function rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var u=r.slice(o+s).join(n);return u?fp(l,u,n):void 0}i=i[r[o]]}return i}}var y1=function(e){Ko(n,e);var t=v1(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return nt(this,n),i=t.call(this),qo&&Jt.call(Wt(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return rt(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[i,o];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(c=i.split("."));var f=Oo(this.data,c);return f||!u||typeof s!="string"?f:fp(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[i,o];s&&(c=c.concat(u?s.split(u):s)),i.indexOf(".")>-1&&(c=i.split("."),a=o,o=c[1]),this.addNamespaces(o),tf(this.data,c,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[i,o];i.indexOf(".")>-1&&(c=i.split("."),a=s,s=o,o=c[1]),this.addNamespaces(o);var f=Oo(this.data,c)||{};a?cp(f,s,l):f=Pi(Pi({},f),s),tf(this.data,c,f),u.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Pi(Pi({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Jt),dp={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function of(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sf={},af=function(e){Ko(n,e);var t=S1(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return nt(this,n),i=t.call(this),qo&&Jt.call(Wt(i)),c1(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Wt(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ut.create("translator"),i}return rt(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=s&&i.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!g1(i,s,a);if(u&&!c){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var d=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(d[0])>-1)&&(l=d.shift()),i=d.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(qt(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=this.extractFromKey(i[i.length-1],o),f=c.key,d=c.namespaces,v=d[d.length-1],m=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(S){var w=o.nsSeparator||this.options.nsSeparator;return l?(g.res="".concat(v).concat(w).concat(f),g):"".concat(v).concat(w).concat(f)}return l?(g.res=f,g):f}var g=this.resolve(i,o),h=g&&g.res,p=g&&g.usedKey||f,y=g&&g.exactUsedKey||f,_=Object.prototype.toString.apply(h),P=["[object Number]","[object Function]","[object RegExp]"],x=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,R=typeof h!="string"&&typeof h!="boolean"&&typeof h!="number";if(O&&h&&R&&P.indexOf(_)<0&&!(typeof x=="string"&&_==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,ge(ge({},o),{},{ns:d})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(g.res=D,g):D}if(u){var b=_==="[object Array]",ne=b?[]:{},Re=b?y:p;for(var Oe in h)if(Object.prototype.hasOwnProperty.call(h,Oe)){var sr="".concat(Re).concat(u).concat(Oe);ne[Oe]=this.translate(sr,ge(ge({},o),{joinArrays:!1,ns:d})),ne[Oe]===sr&&(ne[Oe]=h[Oe])}h=ne}}else if(O&&typeof x=="string"&&_==="[object Array]")h=h.join(x),h&&(h=this.extendTranslation(h,i,o,s));else{var Nt=!1,gt=!1,I=o.count!==void 0&&typeof o.count!="string",F=n.hasDefaultValue(o),T=I?this.pluralResolver.getSuffix(m,o.count,o):"",$=o["defaultValue".concat(T)]||o.defaultValue;!this.isValidLookup(h)&&F&&(Nt=!0,h=$),this.isValidLookup(h)||(gt=!0,h=f);var J=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,wn=J&>?void 0:h,Ne=F&&$!==h&&this.options.updateMissing;if(gt||Nt||Ne){if(this.logger.log(Ne?"updateKey":"missingKey",m,v,f,Ne?$:h),u){var kn=this.resolve(f,ge(ge({},o),{},{keySeparator:!1}));kn&&kn.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.")}var Ie=[],vt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&vt&&vt[0])for(var Wo=0;Wo1&&arguments[1]!==void 0?arguments[1]:{},a,l,u,c,f;return typeof i=="string"&&(i=[i]),i.forEach(function(d){if(!o.isValidLookup(a)){var v=o.extractFromKey(d,s),m=v.key;l=m;var S=v.namespaces;o.options.fallbackNS&&(S=S.concat(o.options.fallbackNS));var w=s.count!==void 0&&typeof s.count!="string",g=w&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),h=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",p=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);S.forEach(function(y){o.isValidLookup(a)||(f=y,!sf["".concat(p[0],"-").concat(y)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(sf["".concat(p[0],"-").concat(y)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(p.join(", "),`" won't get resolved as namespace "`).concat(f,'" 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!!!")),p.forEach(function(_){if(!o.isValidLookup(a)){c=_;var P=[m];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(P,m,_,y,s);else{var x;w&&(x=o.pluralResolver.getSuffix(_,s.count,s));var O="".concat(o.options.pluralSeparator,"zero");if(w&&(P.push(m+x),g&&P.push(m+O)),h){var R="".concat(m).concat(o.options.contextSeparator).concat(s.context);P.push(R),w&&(P.push(R+x),g&&P.push(R+O))}}for(var D;D=P.pop();)o.isValidLookup(a)||(u=D,a=o.getResource(_,y,D,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(Jt);function Ls(e){return e.charAt(0).toUpperCase()+e.slice(1)}var k1=function(){function e(t){nt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ut.create("languageUtils")}return rt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=Ls(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=Ls(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=Ls(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(u){!u||(i.isSupportedCode(u)?s.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),e}(),O1=[{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}],x1={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},_1=["v1","v2","v3"],lf={zero:0,one:1,two:2,few:3,many:4,other:5};function P1(){var e={};return O1.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:x1[t.fc]}})}),e}var C1=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};nt(this,e),this.languageUtils=t,this.options=n,this.logger=ut.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(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=P1()}return rt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return lf[s]-lf[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!_1.includes(this.options.compatibilityJSON)}}]),e}();function uf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function We(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};nt(this,e),this.logger=ut.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return rt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:h1,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?_n(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?_n(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?_n(r.nestingPrefix):r.nestingPrefixEscaped||_n("$t("),this.nestingSuffix=r.nestingSuffix?_n(r.nestingSuffix):r.nestingSuffixEscaped||_n(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(w){return w.replace(/\$/g,"$$$$")}var d=function(g){if(g.indexOf(s.formatSeparator)<0){var h=nf(r,c,g);return s.alwaysFormat?s.format(h,void 0,i,We(We(We({},o),r),{},{interpolationkey:g})):h}var p=g.split(s.formatSeparator),y=p.shift().trim(),_=p.join(s.formatSeparator).trim();return s.format(nf(r,c,y),_,i,We(We(We({},o),r),{},{interpolationkey:y}))};this.resetRegExp();var v=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,m=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,S=[{regex:this.regexpUnescape,safeValue:function(g){return f(g)}},{regex:this.regexp,safeValue:function(g){return s.escapeValue?f(s.escape(g)):f(g)}}];return S.forEach(function(w){for(u=0;a=w.regex.exec(n);){var g=a[1].trim();if(l=d(g),l===void 0)if(typeof v=="function"){var h=v(n,a,o);l=typeof h=="string"?h:""}else if(o&&o.hasOwnProperty(g))l="";else if(m){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=ef(l));var p=w.safeValue(l);if(n=n.replace(a[0],p),m?(w.regex.lastIndex+=l.length,w.regex.lastIndex-=a[0].length):w.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=We({},o);l.applyPostProcessor=!1,delete l.defaultValue;function u(v,m){var S=this.nestingOptionsSeparator;if(v.indexOf(S)<0)return v;var w=v.split(new RegExp("".concat(S,"[ ]*{"))),g="{".concat(w[1]);v=w[0],g=this.interpolate(g,l);var h=g.match(/'/g),p=g.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),m&&(l=We(We({},m),l))}catch(y){return this.logger.warn("failed parsing options string in nesting for key ".concat(v),y),"".concat(v).concat(S).concat(g)}return delete l.defaultValue,v}for(;s=this.nestingRegexp.exec(n);){var c=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var d=s[1].split(this.formatSeparator).map(function(v){return v.trim()});s[1]=d.shift(),c=d,f=!0}if(a=r(u.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=ef(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=c.reduce(function(v,m){return i.format(v,m,o.lng,We(We({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function cf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=a1(a),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}var N1=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nt(this,e),this.logger=ut.create("formatter"),this.options=t,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,Lt(Lt({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,Lt({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,Lt({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,Lt({},o)).format(r)}},this.init(t)}return rt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(u,c){var f=R1(c),d=f.formatName,v=f.formatOptions;if(s.formats[d]){var m=u;try{var S=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},w=S.locale||S.lng||o.locale||o.lng||i;m=s.formats[d](u,w,Lt(Lt(Lt({},v),o),S))}catch(g){s.logger.warn(g)}return m}else s.logger.warn("there was no format function for ".concat(d));return u},n);return l}}]),e}();function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function df(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D1(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var j1=function(e){Ko(n,e);var t=I1(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return nt(this,n),s=t.call(this),qo&&Jt.call(Wt(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=ut.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return rt(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,u={},c={},f={},d={};return i.forEach(function(v){var m=!0;o.forEach(function(S){var w="".concat(v,"|").concat(S);!s.reload&&l.store.hasResourceBundle(v,S)?l.state[w]=2:l.state[w]<0||(l.state[w]===1?c[w]===void 0&&(c[w]=!0):(l.state[w]=1,m=!1,c[w]===void 0&&(c[w]=!0),u[w]===void 0&&(u[w]=!0),d[S]===void 0&&(d[S]=!0)))}),m||(f[v]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(d)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],u=a[1];o&&this.emit("failedLoading",l,u,o),s&&this.store.addResourceBundle(l,u,s),this.state[i]=o?-1:2;var c={};this.queue.forEach(function(f){f1(f.loaded,[l],u),D1(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(d){c[d]||(c[d]={});var v=f.loaded[d];v.length&&v.forEach(function(m){c[d][m]===void 0&&(c[d][m]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!i.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:u,callback:c});return}return this.readingCalls++,this.backend[s](i,o,function(f,d){if(a.readingCalls--,a.waitingReads.length>0){var v=a.waitingReads.shift();a.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(f&&d&&l2&&arguments[2]!==void 0?arguments[2]:{},l=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."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&o.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(l),f),o.loaded(i,c,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(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!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,df(df({},u),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(Jt);function F1(){return{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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(qt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),qt(t[2])==="object"||qt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function hf(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function pf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ci(){}function b1(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var xo=function(e){Ko(n,e);var t=T1(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(nt(this,n),r=t.call(this),qo&&Jt.call(Wt(r)),r.options=hf(i),r.services={},r.logger=ut,r.modules={external:[]},b1(Wt(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),oi(r,Wt(r));setTimeout(function(){r.init(i,o)},0)}return r}return rt(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=F1();this.options=ot(ot(ot({},a),this.options),hf(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ot(ot({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?ut.init(l(this.modules.logger),this.options):ut.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=N1);var c=new k1(this.options);this.store=new y1(this.options.resources,this.options);var f=this.services;f.logger=ut,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new C1(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new E1(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new j1(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var h=arguments.length,p=new Array(h>1?h-1:0),y=1;y1?h-1:0),y=1;y0&&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");var v=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];v.forEach(function(g){i[g]=function(){var h;return(h=i.store)[g].apply(h,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(g){i[g]=function(){var h;return(h=i.store)[g].apply(h,arguments),i}});var S=vr(),w=function(){var h=function(y,_){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(_),s(y,_)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return h(null,i.t.bind(i));i.changeLanguage(i.options.lng,h)};return this.options.resources||!this.options.initImmediate?w():setTimeout(w,0),S}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(v){if(!!v){var m=o.services.languageUtils.toResolveHierarchy(v);m.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(d){return c(d)})}this.options.preload&&this.options.preload.forEach(function(d){return c(d)}),this.services.backendConnector.load(u,this.options.ns,function(d){!d&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(d)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=vr();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Ci),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&dp.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=vr();this.emit("languageChanging",i);var l=function(d){s.language=d,s.languages=s.services.languageUtils.toResolveHierarchy(d),s.resolvedLanguage=void 0,s.setResolvedLanguage(d)},u=function(d,v){v?(l(v),s.translator.changeLanguage(v),s.isLanguageChangingTo=void 0,s.emit("languageChanged",v),s.logger.log("languageChanged",v)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(d,function(){return s.t.apply(s,arguments)})},c=function(d){!i&&!d&&s.services.languageDetector&&(d=[]);var v=typeof d=="string"?d:s.services.languageUtils.getBestMatchFromCodes(d);v&&(s.language||l(v),s.translator.language||s.translator.changeLanguage(v),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(v)),s.loadResources(v,function(m){u(m,v)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function u(c,f){var d;if(qt(f)!=="object"){for(var v=arguments.length,m=new Array(v>2?v-2:0),S=2;S1&&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;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(v,m){var S=o.services.backendConnector.state["".concat(v,"|").concat(m)];return S===-1||S===2};if(s.precheck){var f=s.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=vr();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=vr();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["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"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ci,a=ot(ot(ot({},this.options),o),{isClone:!0}),l=new n(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=ot({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new af(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,d=new Array(f>1?f-1:0),v=1;v0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new xo(e,t)});var ke=xo.createInstance();ke.createInstance=xo.createInstance;ke.createInstance;ke.init;ke.loadResources;ke.reloadResources;ke.use;ke.changeLanguage;ke.getFixedT;ke.t;ke.exists;ke.setDefaultNamespace;ke.hasLoadedNamespace;ke.loadNamespaces;ke.loadLanguages;const A1="Stable Diffusion UI",U1="",z1={home:"Home",history:"History",community:"Community",settings:"Settings"},$1={"status-starting":"Stable Diffusion is starting...","status-ready":"Stable Diffusion is ready to use!","status-error":"Stable Diffusion is not running!","editor-title":"Prompt","initial-img-txt":"Initial Image: (optional)","initial-img-btn":"Browse...","initial-img-text2":"No file selected.","make-img-btn":"Make Image","make-img-btn-stop":"Stop"},B1={"base-img":"Use base image:",seed:"Seed:","amount-of-img":"Amount of images to make:","how-many":"How many at once:",width:"Width:",height:"Height:",steps:"Number of inference steps:","guide-scale":"Guidance Scale:","live-preview":"Show a live preview of the image (disable this for faster image generation)","fix-face":"Fix incorrect faces and eyes (uses GFPGAN)",upscale:"Upscale the image to 4x resolution using:",corrected:"Show only the corrected/upscaled image"},Q1={txt:"Image Modifiers (art styles, tags etc)"},V1={"use-btn":"Use Image","use-btn2":"Use Image and Tags"},H1={fave:"Favorites Only",search:"Search"},K1={ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cps:"Cross profile sharing","cps-disc":"Profiles will see suggestions from each other.",acb:"Allow cloud backup","acb-disc":"A button will show up for images on hover","acb-place":"Choose your","acc-api":"Api key","acb-api-place":"Your API key",save:"SAVE"},q1=`If you found this project useful and want to help keep it alive, please to help cover the cost of development and maintenance! Thank you for your support!
Please feel free to join the discord community or file an issue if you have any problems or suggestions in using this interface.
@@ -91,7 +91,7 @@ This license of this software forbids you from sharing any content that violates
spread misinformation and target vulnerable groups. For the full list of restrictions please read the license.
By using this software, you consent to the terms and conditions of the license.
-`,H1={title:T1,description:M1,navbar:b1,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:A1,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:U1,tags:z1,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
+`,W1={title:A1,description:U1,navbar:z1,"land-cre":{cp:"Create Profile","cp-place":"Profile name",pp:"Profile Picture","pp-disc":"",ast:"Automatically save to","ast-disc":"File path to auto save your creations",place:"File path",cre:"Create"},"land-pre":{user:"Username",add:"Add Profile"},home:$1,"in-paint":{txt:"In-Painting (select the area which the AI will paint into)",clear:"Clear"},settings:B1,tags:Q1,"preview-prompt":{part1:'Type a prompt and press the "Make Image" button.',part2:`You can set an "Initial Image" if you want to guide the AI.
`,part3:`You can also add modifiers like "Realistic", "Pencil Sketch", "ArtStation" etc by browsing through the "Image Modifiers" section and selecting the desired modifiers.
-`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:$1,history:B1,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
-Please restart the program after changing this.`,save:"SAVE"},storage:Q1,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:V1},K1={en:{translation:H1}};ke.use(By).init({lng:"en",interpolation:{escapeValue:!1},resources:K1});const q1=new bm;function W1(){const e=n1;return k(Am,{location:q1,routes:[{path:"/",element:k(e1,{className:e})},{path:"/settings",element:k(t1,{className:e})}]})}const G1=new om({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0,cacheTime:1/0}}});Om();Ls.createRoot(document.getElementById("root")).render(k(xf.StrictMode,{children:N(lm,{client:G1,children:[k(W1,{}),k(gm,{initialIsOpen:!0})]})}));
+`,part4:'Click "Advanced Settings" for additional settings like seed, image size, number of images to generate etc.',part5:"Enjoy! :)"},"current-task":"Current task","recent-create":"Recently Created",popup:V1,history:H1,"advanced-settings":{sound:"Play sound on task completion","sound-disc":"Will play a sound so user can hear when image is done.",turbo:"Turbo mode","turbo-disc":"Generates images faster, but uses an additional 1 GB of GPU memory",cpu:"Use CPU instead of GPU","cpu-disc":"Warning: this will be *very* slow",beta:"Beta Features","beta-disc":`Get the latest features immediately (but could be less stable).
+Please restart the program after changing this.`,save:"SAVE"},storage:K1,import:{"imp-btn":"IMPORT","exp-btn":"EXPORT",disc:"It is a good idea to leave the exported file as it is. Otherwise it may not import correctly","disc:2":"When importing, only profiles that are not already present on the will be added."},about:q1},G1={en:{translation:W1}};ke.use(By).init({lng:"en",interpolation:{escapeValue:!1},resources:G1});const Y1=new bm;function J1(){const e=o1;return k(Am,{location:Y1,routes:[{path:"/",element:k(r1,{className:e})},{path:"/settings",element:k(i1,{className:e})}]})}const X1=new om({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0,cacheTime:1/0}}});Om();Ds.createRoot(document.getElementById("root")).render(k(xf.StrictMode,{children:N(lm,{client:X1,children:[k(J1,{}),k(gm,{initialIsOpen:!0})]})}));