InvokeAI/invokeai/frontend/web/dist/assets/ThemeLocaleProvider-2a8c2f39.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

316 lines
73 KiB
JavaScript
Raw Normal View History

2023-03-11 02:54:59 +00:00
import{j as y,cM as Ie,r as _,cN as bt,q as Vr,cO as o,cP as b,cQ as v,cR as S,cS as Lr,cT as ut,cU as vt,cV as ft,cW as mt,n as ht,cX as gt,E as pt}from"./index-c5a5b67c.js";import{d as yt,i as St,T as xt,j as $t,s as kt,g as _t}from"./scrollbar-af26543e.js";var Or=`
:root {
--chakra-vh: 100vh;
}
@supports (height: -webkit-fill-available) {
:root {
--chakra-vh: -webkit-fill-available;
}
}
@supports (height: -moz-fill-available) {
:root {
--chakra-vh: -moz-fill-available;
}
}
@supports (height: 100dvh) {
:root {
--chakra-vh: 100dvh;
}
}
`,wt=()=>y.jsx(Ie,{styles:Or}),Ct=()=>y.jsx(Ie,{styles:`
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
font-family: system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
touch-action: manipulation;
}
body {
position: relative;
min-height: 100%;
font-feature-settings: 'kern';
}
*,
*::before,
*::after {
border-width: 0;
border-style: solid;
box-sizing: border-box;
}
main {
display: block;
}
hr {
border-top-width: 1px;
box-sizing: content-box;
height: 0;
overflow: visible;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
font-size: 1em;
}
a {
background-color: transparent;
color: inherit;
text-decoration: inherit;
}
abbr[title] {
border-bottom: none;
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
b,
strong {
font-weight: bold;
}
small {
font-size: 80%;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
img {
border-style: none;
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
font-size: 100%;
line-height: 1.15;
margin: 0;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
fieldset {
padding: 0.35em 0.75em 0.625em;
}
legend {
box-sizing: border-box;
color: inherit;
display: table;
max-width: 100%;
padding: 0;
white-space: normal;
}
progress {
vertical-align: baseline;
}
textarea {
overflow: auto;
}
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
padding: 0;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none !important;
}
input[type="number"] {
-moz-appearance: textfield;
}
[type="search"] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none !important;
}
::-webkit-file-upload-button {
-webkit-appearance: button;
font: inherit;
}
details {
display: block;
}
summary {
display: list-item;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
body,
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
margin: 0;
}
button {
background: transparent;
padding: 0;
}
fieldset {
margin: 0;
padding: 0;
}
ol,
ul {
margin: 0;
padding: 0;
}
textarea {
resize: vertical;
}
button,
[role="button"] {
cursor: pointer;
}
button::-moz-focus-inner {
border: 0 !important;
}
table {
border-collapse: collapse;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
button,
input,
optgroup,
select,
textarea {
padding: 0;
line-height: inherit;
color: inherit;
}
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block;
}
img,
video {
max-width: 100%;
height: auto;
}
[data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) {
outline: none;
box-shadow: none;
}
select::-ms-expand {
display: none;
}
${Or}
`}),pe={light:"chakra-ui-light",dark:"chakra-ui-dark"};function zt(e={}){const{preventTransition:r=!0}=e,t={setDataset:a=>{const n=r?t.preventTransition():void 0;document.documentElement.dataset.theme=a,document.documentElement.style.colorScheme=a,n==null||n()},setClassName(a){document.body.classList.add(a?pe.dark:pe.light),document.body.classList.remove(a?pe.light:pe.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(a){var n;return((n=t.query().matches)!=null?n:a==="dark")?"dark":"light"},addListener(a){const n=t.query(),i=l=>{a(l.matches?"dark":"light")};return typeof n.addListener=="function"?n.addListener(i):n.addEventListener("change",i),()=>{typeof n.removeListener=="function"?n.removeListener(i):n.removeEventListener("change",i)}},preventTransition(){const a=document.createElement("style");return a.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(a)})})}}};return t}var At="chakra-ui-color-mode";function Pt(e){return{ssr:!1,type:"localStorage",get(r){if(!(globalThis!=null&&globalThis.document))return r;let t;try{t=localStorage.getItem(e)||r}catch{}return t||r},set(r){try{localStorage.setItem(e,r)}catch{}}}}var Tt=Pt(At),lr=()=>{};function sr(e,r){return e.type==="cookie"&&e.ssr?e.get(r):r}function qr(e){const{value:r,children:t,options:{useSystemColorMode:a,initialColorMode:n,disableTransitionOnChange:i}={},colorModeManager:l=Tt}=e,d=n==="dark"?"dark":"light",[c,$]=_.useState(()=>sr(l,d)),[h,g]=_.useState(()=>sr(l)),{getSystemTheme:k,setClassName:F,setDataset:me,addListener:nr}=_.useMemo(()=>zt({preventTransition:i}),[i]),he=n==="system"&&!c?h:c,I=_.useCallback(re=>{const ge=re==="system"?k():re;$(ge),F(ge==="dark"),me(ge),l.set(ge)},[l,k,F,me]);yt(()=>{n==="system"&&g(k())},[]),_.useEffect(()=>{const re=l.get();if(re){I(re);return}if(n==="system"){I("system");return}I(d)},[l,d,n,I]);const ir=_.useCallback(()=>{I(he==="dark"?"light":"dark")},[he,I]);_.useEffect(()=>{if(a)return nr(I)},[a,nr,I]);const ct=_.useMemo(()=>({colorMode:r??he,toggleColorMode:r?lr:ir,setColorMode:r?lr:I,forced:r!==void 0}),[he,ir,I,r]);return y.jsx(bt.Provider,{value:ct,children:t})}qr.displayName="ColorModeProvider";var Ft=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function It(e){return Vr(e)?Ft.every(r=>Object.prototype.hasOwnProperty.call(e,r)):!1}var Bt={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Mt=Bt,Et={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Dt=Et,jt={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700
45deg,
${r} 25%,
transparent 25%,
transparent 50%,
${r} 50%,
${r} 75%,
transparent 75%,
transparent
)`,backgroundSize:`${e} ${e}`}}var Uo=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function Yo(e){const r=Uo();return!e||Oo(e)?r:e.string&&e.colors?Ko(e.string,e.colors):e.string&&!e.colors?Xo(e.string):e.colors&&!e.string?Qo(e.colors):r}function Xo(e){let r=0;if(e.length===0)return r.toString();for(let a=0;a<e.length;a+=1)r=e.charCodeAt(a)+((r<<5)-r),r=r&r;let t="#";for(let a=0;a<3;a+=1){const n=r>>a*8&255;t+=`00${n.toString(16)}`.substr(-2)}return t}function Ko(e,r){let t=0;if(e.length===0)return r[0];for(let a=0;a<e.length;a+=1)t=e.charCodeAt(a)+((t<<5)-t),t=t&t;return t=(t%r.length+r.length)%r.length,r[t]}function Qo(e){return e[Math.floor(Math.random()*e.length)]}function s(e,r){return t=>t.colorMode==="dark"?r:e}function er(e){const{orientation:r,vertical:t,horizontal:a}=e;return r?r==="vertical"?t:a:{}}function Yr(e){return Vr(e)&&e.reference?e.reference:String(e)}var Be=(e,...r)=>r.map(Yr).join(` ${e} `).replace(/calc/g,""),ur=(...e)=>`calc(${Be("+",...e)})`,vr=(...e)=>`calc(${Be("-",...e)})`,Xe=(...e)=>`calc(${Be("*",...e)})`,fr=(...e)=>`calc(${Be("/",...e)})`,mr=e=>{const r=Yr(e);return r!=null&&!Number.isNaN(parseFloat(r))?String(r).startsWith("-")?String(r).slice(1):`-${r}`:Xe(r,-1)},D=Object.assign(e=>({add:(...r)=>D(ur(e,...r)),subtract:(...r)=>D(vr(e,...r)),multiply:(...r)=>D(Xe(e,...r)),divide:(...r)=>D(fr(e,...r)),negate:()=>D(mr(e)),toString:()=>e.toString()}),{add:ur,subtract:vr,multiply:Xe,divide:fr,negate:mr});function Zo(e){return!Number.isInteger(parseFloat(e.toString()))}function Jo(e,r="-"){return e.replace(/\s+/g,r)}function Xr(e){const r=Jo(e.toString());return r.includes("\\.")?e:Zo(e)?r.replace(".","\\."):e}function ea(e,r=""){return[r,Xr(e)].filter(Boolean).join("-")}function ra(e,r){return`var(${Xr(e)}${r?`, ${r}`:""})`}function ta(e,r=""){return`--${ea(e,r)}`}function x(e,r){const t=ta(e,r==null?void 0:r.prefix);return{variable:t,reference:ra(t,oa(r==null?void 0:r.fallback))}}function oa(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:aa,definePartsStyle:we}=b(_o.keys),le=x("switch-track-width"),N=x("switch-track-height"),De=x("switch-track-diff"),na=D.subtract(le,N),Ke=x("switch-thumb-x"),te=x("switch-bg"),ia=o(e=>{const{colorScheme:r}=e;return{borderRadius:"full",p:"0.5",width:[le.reference],height:[N.reference],transitionProperty:"common",transitionDuration:"fast",[te.variable]:"colors.gray.300",_dark:{[te.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[te.variable]:`colors.${r}.500`,_dark:{[te.variable]:`colors.${r}.200`}},bg:te.reference}}),la=o({bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[N.reference],height:[N.reference],_checked:{transform:`translateX(${Ke.reference})`}}),sa=we(e=>({container:{[De.variable]:na,[Ke.variable]:De.reference,_rtl:{[Ke.variable]:D(De).negate().toString()}},track:ia(e),thumb:la})),da={sm:we({container:{[le.variable]:"1.375rem",[N.variable]:"sizes.3"}}),md:we({container:{[le.variable]:"1.875rem",[N.variable]:"sizes.4"}}),lg:we({container:{[le.variable]:"2.875rem",[N.variable]:"sizes.6"}})},ca=aa({baseStyle:sa,sizes:da,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:ba,definePartsStyle:X}=b(wo.keys),ua=X({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Pe=o({"&[data-is-numeric=true]":{textAlign:"end"}}),va=X(e=>{const{colorScheme:r}=e;return{th:{color:s("gray.600","gray.400")(e),borderBottom:"1px",borderColor:s(`${r}.100`,`${r}.700`)(e),...Pe},td:{borderBottom:"1px",borderColor:s(`${r}.100`,`${r}.700`)(e),...Pe},caption:{color:s("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),fa=X(e=>{const{colorScheme:r}=e;return{th:{color:s("gray.600","gray.400")(e
to right,
transparent 0%,
${w(t,l)} 50%,
transparent 100%
)`;return{...!a&&n&&i,...a?{bgImage:d}:{bgColor:l}}}),cn=o({lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"}),bn=o(e=>({bg:s("gray.100","whiteAlpha.300")(e)})),un=o(e=>({transitionProperty:"common",transitionDuration:"slow",...dn(e)})),vn=ne(e=>({label:cn,filledTrack:un(e),track:bn(e)})),fn={xs:ne({track:{h:"1"}}),sm:ne({track:{h:"2"}}),md:ne({track:{h:"3"}}),lg:ne({track:{h:"4"}})},mn=sn({sizes:fn,baseStyle:vn,defaultProps:{size:"md",colorScheme:"blue"}}),hn=e=>typeof e=="function";function C(e,...r){return hn(e)?e(...r):e}var{definePartsStyle:Ce,defineMultiStyleConfig:gn}=b(lo.keys),de=v("checkbox-size"),pn=o(e=>{const{colorScheme:r}=e;return{w:de.reference,h:de.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:s(`${r}.500`,`${r}.200`)(e),borderColor:s(`${r}.500`,`${r}.200`)(e),color:s("white","gray.900")(e),_hover:{bg:s(`${r}.600`,`${r}.300`)(e),borderColor:s(`${r}.600`,`${r}.300`)(e)},_disabled:{borderColor:s("gray.200","transparent")(e),bg:s("gray.200","whiteAlpha.300")(e),color:s("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:s(`${r}.500`,`${r}.200`)(e),borderColor:s(`${r}.500`,`${r}.200`)(e),color:s("white","gray.900")(e)},_disabled:{bg:s("gray.100","whiteAlpha.100")(e),borderColor:s("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:s("red.500","red.300")(e)}}}),yn=o({_disabled:{cursor:"not-allowed"}}),Sn=o({userSelect:"none",_disabled:{opacity:.4}}),xn=o({transitionProperty:"transform",transitionDuration:"normal"}),$n=Ce(e=>({icon:xn,container:yn,control:C(pn,e),label:Sn})),kn={sm:Ce({control:{[de.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:Ce({control:{[de.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:Ce({control:{[de.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Te=gn({baseStyle:$n,sizes:kn,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:_n,definePartsStyle:ze}=b(So.keys),wn=o(e=>{var r;const t=(r=C(Te.baseStyle,e))==null?void 0:r.control;return{...t,borderRadius:"full",_checked:{...t==null?void 0:t._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}}),Cn=ze(e=>{var r,t,a,n;return{label:(t=(r=Te).baseStyle)==null?void 0:t.call(r,e).label,container:(n=(a=Te).baseStyle)==null?void 0:n.call(a,e).container,control:wn(e)}}),zn={md:ze({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:ze({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:ze({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},An=_n({baseStyle:Cn,sizes:zn,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Pn,definePartsStyle:Tn}=b(xo.keys),xe=v("select-bg"),zr,Fn=o({...(zr=u.baseStyle)==null?void 0:zr.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:xe.reference,[xe.variable]:"colors.white",_dark:{[xe.variable]:"colors.gray.700"},"> option, > optgroup":{bg:xe.reference}}),In=o({width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}}),Bn=Tn({field:Fn,icon:In}),$e=o({paddingInlineEnd:"8"}),Ar,Pr,Tr,Fr,Ir,Br,Mr,Er,Mn={lg:{...(Ar=u.sizes)==null?void 0:Ar.lg,field:{...(Pr=u.sizes)==null?void 0:Pr.lg.field,...$e}},md:{...(Tr=u.sizes)==null?void 0:Tr.md,field:{...(Fr=u.sizes)==null?void 0:Fr.md.field,...$e}},sm:{...(Ir=u.sizes)==null?void 0:Ir.sm,field:{...(Br=u.sizes)==null?void 0:Br.sm.field,...$e}},xs:{...(Mr=u.sizes)==null?void 0:Mr.xs,field:{...(Er=u.sizes)==null?void 0:Er.xs.field,...$e},icon:{insetEnd:"1"}}},En=Pn({baseStyle:Bn,sizes:Mn,variants:u.variants,defaultProps:u.defaultProps}),Re=v("skeleton-start-color"),We=v("skeleton-end-color"),Dn=o({[Re.variable]:"colors.gray.100",[We.variable]:"colors.gray.400",_dark:{[Re.variable]:"colors.gray.800",[We.variable]:"colors.gray.600"},background:Re.reference,borderColor:We.reference,opacity:.7,borderRadius:"sm"}),jn=S({baseStyle:Dn}),He=v("skip-link-bg"),Rn=o({borderRadius:"md",