var j5=Object.defineProperty;var Pw=e=>{throw TypeError(e)};var B5=(e,t,n)=>t in e?j5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var lc=(e,t,n)=>B5(e,typeof t!="symbol"?t+"":t,n),Dv=(e,t,n)=>t.has(e)||Pw("Cannot "+n);var P=(e,t,n)=>(Dv(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?Pw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Q=(e,t,n,r)=>(Dv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ce=(e,t,n)=>(Dv(e,t,"access private method"),n);var Bf=(e,t,n,r)=>({set _(o){Q(e,t,o,n)},get _(){return P(e,t,r)}});function z5(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var zf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u2={exports:{}},Fm={},c2={exports:{}},Ae={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lf=Symbol.for("react.element"),H5=Symbol.for("react.portal"),W5=Symbol.for("react.fragment"),V5=Symbol.for("react.strict_mode"),K5=Symbol.for("react.profiler"),G5=Symbol.for("react.provider"),q5=Symbol.for("react.context"),Q5=Symbol.for("react.forward_ref"),Y5=Symbol.for("react.suspense"),X5=Symbol.for("react.memo"),J5=Symbol.for("react.lazy"),kw=Symbol.iterator;function Z5(e){return e===null||typeof e!="object"?null:(e=kw&&e[kw]||e["@@iterator"],typeof e=="function"?e:null)}var d2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f2=Object.assign,p2={};function Mu(e,t,n){this.props=e,this.context=t,this.refs=p2,this.updater=n||d2}Mu.prototype.isReactComponent={};Mu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Mu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function h2(){}h2.prototype=Mu.prototype;function i1(e,t,n){this.props=e,this.context=t,this.refs=p2,this.updater=n||d2}var a1=i1.prototype=new h2;a1.constructor=i1;f2(a1,Mu.prototype);a1.isPureReactComponent=!0;var Nw=Array.isArray,m2=Object.prototype.hasOwnProperty,s1={current:null},g2={key:!0,ref:!0,__self:!0,__source:!0};function v2(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)m2.call(t,r)&&!g2.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,ae=M[K];if(0>>1;Ko(ce,z))Leo(Oe,ce)?(M[K]=Oe,M[Le]=z,K=Le):(M[K]=ce,M[ne]=z,K=ne);else if(Leo(Oe,z))M[K]=Oe,M[Le]=z,K=Le;else break e}}return D}function o(M,D){var z=M.sortIndex-D.sortIndex;return z!==0?z:M.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,h=!1,m=!1,E=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(M){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=M)r(u),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(u)}}function S(M){if(m=!1,v(M),!h)if(n(l)!==null)h=!0,$(x);else{var D=n(u);D!==null&&j(S,D.startTime-M)}}function x(M,D){h=!1,m&&(m=!1,g(A),A=-1),p=!0;var z=f;try{for(v(D),d=n(l);d!==null&&(!(d.expirationTime>D)||M&&!_());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var ae=K(d.expirationTime<=D);D=e.unstable_now(),typeof ae=="function"?d.callback=ae:d===n(l)&&r(l),v(D)}else r(l);d=n(l)}if(d!==null)var Ie=!0;else{var ne=n(u);ne!==null&&j(S,ne.startTime-D),Ie=!1}return Ie}finally{d=null,f=z,p=!1}}var I=!1,T=null,A=-1,R=5,w=-1;function _(){return!(e.unstable_now()-wM||125K?(M.sortIndex=z,t(u,M),n(l)===null&&M===n(u)&&(m?(g(A),A=-1):m=!0,j(S,z-K))):(M.sortIndex=ae,t(l,M),h||p||(h=!0,$(x))),M},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(M){var D=f;return function(){var z=f;f=D;try{return M.apply(this,arguments)}finally{f=z}}}})(w2);E2.exports=w2;var cM=E2.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var dM=b,cr=cM;function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uy=Object.prototype.hasOwnProperty,fM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Dw={},Mw={};function pM(e){return Uy.call(Mw,e)?!0:Uy.call(Dw,e)?!1:fM.test(e)?Mw[e]=!0:(Dw[e]=!0,!1)}function hM(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mM(e,t,n,r){if(t===null||typeof t>"u"||hM(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function On(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var pn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){pn[e]=new On(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];pn[t]=new On(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){pn[e]=new On(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){pn[e]=new On(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){pn[e]=new On(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){pn[e]=new On(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){pn[e]=new On(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){pn[e]=new On(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){pn[e]=new On(e,5,!1,e.toLowerCase(),null,!1,!1)});var u1=/[\-:]([a-z])/g;function c1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(u1,c1);pn[t]=new On(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(u1,c1);pn[t]=new On(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(u1,c1);pn[t]=new On(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){pn[e]=new On(e,1,!1,e.toLowerCase(),null,!1,!1)});pn.xlinkHref=new On("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){pn[e]=new On(e,1,!1,e.toLowerCase(),null,!0,!0)});function d1(e,t,n,r){var o=pn.hasOwnProperty(t)?pn[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` `+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Lv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Mc(e):""}function gM(e){switch(e.tag){case 5:return Mc(e.type);case 16:return Mc("Lazy");case 13:return Mc("Suspense");case 19:return Mc("SuspenseList");case 0:case 2:case 15:return e=Uv(e.type,!1),e;case 11:return e=Uv(e.type.render,!1),e;case 1:return e=Uv(e.type,!0),e;default:return""}}function zy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case El:return"Fragment";case bl:return"Portal";case $y:return"Profiler";case f1:return"StrictMode";case jy:return"Suspense";case By:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case I2:return(e.displayName||"Context")+".Consumer";case x2:return(e._context.displayName||"Context")+".Provider";case p1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case h1:return t=e.displayName||null,t!==null?t:zy(e.type)||"Memo";case oa:t=e._payload,e=e._init;try{return zy(e(t))}catch{}}return null}function vM(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zy(t);case 8:return t===f1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function A2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yM(e){var t=A2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vf(e){e._valueTracker||(e._valueTracker=yM(e))}function _2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=A2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ph(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Hy(e,t){var n=t.checked;return xt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Lw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function R2(e,t){t=t.checked,t!=null&&d1(e,"checked",t,!1)}function Wy(e,t){R2(e,t);var n=Fa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Vy(e,t.type,n):t.hasOwnProperty("defaultValue")&&Vy(e,t.type,Fa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Uw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Vy(e,t,n){(t!=="number"||Ph(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fc=Array.isArray;function Fl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Kf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bd(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},SM=["Webkit","ms","Moz","O"];Object.keys(Jc).forEach(function(e){SM.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jc[t]=Jc[e]})});function O2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jc.hasOwnProperty(e)&&Jc[e]?(""+t).trim():t+"px"}function D2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=O2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var bM=xt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qy(e,t){if(t){if(bM[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function Qy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yy=null;function m1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xy=null,Ll=null,Ul=null;function Bw(e){if(e=df(e)){if(typeof Xy!="function")throw Error(V(280));var t=e.stateNode;t&&(t=Bm(t),Xy(e.stateNode,e.type,t))}}function M2(e){Ll?Ul?Ul.push(e):Ul=[e]:Ll=e}function F2(){if(Ll){var e=Ll,t=Ul;if(Ul=Ll=null,Bw(e),t)for(e=0;e>>=0,e===0?32:31-(kM(e)/NM|0)|0}var Gf=64,qf=4194304;function Lc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=Lc(s):(i&=a,i!==0&&(r=Lc(i)))}else a=n&~o,a!==0?r=Lc(a):i!==0&&(r=Lc(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function uf(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vo(t),e[t]=n}function FM(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ed),Yw=" ",Xw=!1;function n_(e,t){switch(e){case"keyup":return c3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wl=!1;function f3(e,t){switch(e){case"compositionend":return r_(t);case"keypress":return t.which!==32?null:(Xw=!0,Yw);case"textInput":return e=t.data,e===Yw&&Xw?null:e;default:return null}}function p3(e,t){if(wl)return e==="compositionend"||!C1&&n_(e,t)?(e=e_(),Yp=b1=ba=null,wl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=tC(n)}}function s_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?s_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function l_(){for(var e=window,t=Ph();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ph(e.document)}return t}function x1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function w3(e){var t=l_(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&s_(n.ownerDocument.documentElement,n)){if(r!==null&&x1(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=nC(n,i);var a=nC(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Cl=null,r0=null,nd=null,o0=!1;function rC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;o0||Cl==null||Cl!==Ph(r)||(r=Cl,"selectionStart"in r&&x1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),nd&&Td(nd,r)||(nd=r,r=Lh(r0,"onSelect"),0Tl||(e.current=c0[Tl],c0[Tl]=null,Tl--)}function lt(e,t){Tl++,c0[Tl]=e.current,e.current=t}var La={},En=Ga(La),Wn=Ga(!1),Ps=La;function lu(e,t){var n=e.type.contextTypes;if(!n)return La;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Vn(e){return e=e.childContextTypes,e!=null}function $h(){ft(Wn),ft(En)}function cC(e,t,n){if(En.current!==La)throw Error(V(168));lt(En,t),lt(Wn,n)}function v_(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(V(108,vM(e)||"Unknown",o));return xt({},n,r)}function jh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||La,Ps=En.current,lt(En,e),lt(Wn,Wn.current),!0}function dC(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=v_(e,t,Ps),r.__reactInternalMemoizedMergedChildContext=e,ft(Wn),ft(En),lt(En,e)):ft(Wn),lt(Wn,n)}var pi=null,zm=!1,Jv=!1;function y_(e){pi===null?pi=[e]:pi.push(e)}function D3(e){zm=!0,y_(e)}function qa(){if(!Jv&&pi!==null){Jv=!0;var e=0,t=Ze;try{var n=pi;for(Ze=1;e>=a,o-=a,Ei=1<<32-vo(t)+o|n<A?(R=T,T=null):R=T.sibling;var w=f(g,T,v[A],S);if(w===null){T===null&&(T=R);break}e&&T&&w.alternate===null&&t(g,T),y=i(w,y,A),I===null?x=w:I.sibling=w,I=w,T=R}if(A===v.length)return n(g,T),gt&&ts(g,A),x;if(T===null){for(;AA?(R=T,T=null):R=T.sibling;var _=f(g,T,w.value,S);if(_===null){T===null&&(T=R);break}e&&T&&_.alternate===null&&t(g,T),y=i(_,y,A),I===null?x=_:I.sibling=_,I=_,T=R}if(w.done)return n(g,T),gt&&ts(g,A),x;if(T===null){for(;!w.done;A++,w=v.next())w=d(g,w.value,S),w!==null&&(y=i(w,y,A),I===null?x=w:I.sibling=w,I=w);return gt&&ts(g,A),x}for(T=r(g,T);!w.done;A++,w=v.next())w=p(T,g,A,w.value,S),w!==null&&(e&&w.alternate!==null&&T.delete(w.key===null?A:w.key),y=i(w,y,A),I===null?x=w:I.sibling=w,I=w);return e&&T.forEach(function(k){return t(g,k)}),gt&&ts(g,A),x}function E(g,y,v,S){if(typeof v=="object"&&v!==null&&v.type===El&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Wf:e:{for(var x=v.key,I=y;I!==null;){if(I.key===x){if(x=v.type,x===El){if(I.tag===7){n(g,I.sibling),y=o(I,v.props.children),y.return=g,g=y;break e}}else if(I.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===oa&&hC(x)===I.type){n(g,I.sibling),y=o(I,v.props),y.ref=hc(g,I,v),y.return=g,g=y;break e}n(g,I);break}else t(g,I);I=I.sibling}v.type===El?(y=xs(v.props.children,g.mode,S,v.key),y.return=g,g=y):(S=oh(v.type,v.key,v.props,null,g.mode,S),S.ref=hc(g,y,v),S.return=g,g=S)}return a(g);case bl:e:{for(I=v.key;y!==null;){if(y.key===I)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(g,y.sibling),y=o(y,v.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=ay(v,g.mode,S),y.return=g,g=y}return a(g);case oa:return I=v._init,E(g,y,I(v._payload),S)}if(Fc(v))return h(g,y,v,S);if(uc(v))return m(g,y,v,S);tp(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,y!==null&&y.tag===6?(n(g,y.sibling),y=o(y,v),y.return=g,g=y):(n(g,y),y=iy(v,g.mode,S),y.return=g,g=y),a(g)):n(g,y)}return E}var cu=w_(!0),C_=w_(!1),Hh=Ga(null),Wh=null,Rl=null,_1=null;function R1(){_1=Rl=Wh=null}function P1(e){var t=Hh.current;ft(Hh),e._currentValue=t}function p0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function jl(e,t){Wh=e,_1=Rl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(zn=!0),e.firstContext=null)}function Br(e){var t=e._currentValue;if(_1!==e)if(e={context:e,memoizedValue:t,next:null},Rl===null){if(Wh===null)throw Error(V(308));Rl=e,Wh.dependencies={lanes:0,firstContext:e}}else Rl=Rl.next=e;return t}var ss=null;function k1(e){ss===null?ss=[e]:ss.push(e)}function x_(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,k1(t)):(n.next=o.next,o.next=n),t.interleaved=n,Oi(e,r)}function Oi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ia=!1;function N1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function I_(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ai(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Me&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Oi(e,n)}return o=r.interleaved,o===null?(t.next=t,k1(r)):(t.next=o.next,o.next=t),r.interleaved=t,Oi(e,n)}function Jp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,v1(e,n)}}function mC(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Vh(e,t,n,r){var o=e.updateQueue;ia=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;a=0,c=u=l=null,s=i;do{var f=s.lane,p=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,m=s;switch(f=t,p=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(p,d,f):h,f==null)break e;d=xt({},d,f);break e;case 2:ia=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,a|=f;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;f=s,s=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Os|=a,e.lanes=a,e.memoizedState=d}}function gC(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ey.transition;ey.transition={};try{e(!1),t()}finally{Ze=n,ey.transition=r}}function z_(){return zr().memoizedState}function U3(e,t,n){var r=Na(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},H_(e))W_(t,n);else if(n=x_(e,t,n,r),n!==null){var o=_n();yo(n,e,r,o),V_(n,t,r)}}function $3(e,t,n){var r=Na(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(H_(e))W_(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Eo(s,a)){var l=t.interleaved;l===null?(o.next=o,k1(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=x_(e,t,o,r),n!==null&&(o=_n(),yo(n,e,r,o),V_(n,t,r))}}function H_(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function W_(e,t){rd=Gh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function V_(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,v1(e,n)}}var qh={readContext:Br,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useInsertionEffect:gn,useLayoutEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useMutableSource:gn,useSyncExternalStore:gn,useId:gn,unstable_isNewReconciler:!1},j3={readContext:Br,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:Br,useEffect:yC,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,eh(4194308,4,L_.bind(null,t,e),n)},useLayoutEffect:function(e,t){return eh(4194308,4,e,t)},useInsertionEffect:function(e,t){return eh(4,2,e,t)},useMemo:function(e,t){var n=Mo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mo();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=U3.bind(null,Ct,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:vC,useDebugValue:j1,useDeferredValue:function(e){return Mo().memoizedState=e},useTransition:function(){var e=vC(!1),t=e[0];return e=L3.bind(null,e[1]),Mo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ct,o=Mo();if(gt){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),on===null)throw Error(V(349));Ns&30||R_(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,yC(k_.bind(null,r,i,e),[e]),r.flags|=2048,Dd(9,P_.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Mo(),t=on.identifierPrefix;if(gt){var n=wi,r=Ei;n=(r&~(1<<32-vo(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Nd++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Bo]=t,e[Rd]=r,tR(e,t,!1,!1),t.stateNode=e;e:{switch(a=Qy(n,r),n){case"dialog":ut("cancel",e),ut("close",e),o=r;break;case"iframe":case"object":case"embed":ut("load",e),o=r;break;case"video":case"audio":for(o=0;opu&&(t.flags|=128,r=!0,mc(i,!1),t.lanes=4194304)}else{if(!r)if(e=Kh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mc(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!gt)return vn(t),null}else 2*Ft()-i.renderingStartTime>pu&&n!==1073741824&&(t.flags|=128,r=!0,mc(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ft(),t.sibling=null,n=Et.current,lt(Et,r?n&1|2:n&1),t):(vn(t),null);case 22:case 23:return K1(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nr&1073741824&&(vn(t),t.subtreeFlags&6&&(t.flags|=8192)):vn(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function q3(e,t){switch(T1(t),t.tag){case 1:return Vn(t.type)&&$h(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return du(),ft(Wn),ft(En),M1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return D1(t),null;case 13:if(ft(Et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));uu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(Et),null;case 4:return du(),null;case 10:return P1(t.type._context),null;case 22:case 23:return K1(),null;case 24:return null;default:return null}}var rp=!1,Sn=!1,Q3=typeof WeakSet=="function"?WeakSet:Set,X=null;function Pl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){kt(e,t,r)}else n.current=null}function w0(e,t,n){try{n()}catch(r){kt(e,t,r)}}var RC=!1;function Y3(e,t){if(i0=Mh,e=l_(),x1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(s=a+o),d!==i||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(s=a),f===i&&++c===r&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(a0={focusedElem:e,selectionRange:n},Mh=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,E=h.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:so(t.type,m),E);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(S){kt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return h=RC,RC=!1,h}function od(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&w0(t,n,i)}o=o.next}while(o!==r)}}function Vm(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function C0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function oR(e){var t=e.alternate;t!==null&&(e.alternate=null,oR(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bo],delete t[Rd],delete t[u0],delete t[N3],delete t[O3])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function iR(e){return e.tag===5||e.tag===3||e.tag===4}function PC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||iR(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function x0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Uh));else if(r!==4&&(e=e.child,e!==null))for(x0(e,t,n),e=e.sibling;e!==null;)x0(e,t,n),e=e.sibling}function I0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(I0(e,t,n),e=e.sibling;e!==null;)I0(e,t,n),e=e.sibling}var ln=null,po=!1;function ea(e,t,n){for(n=n.child;n!==null;)aR(e,t,n),n=n.sibling}function aR(e,t,n){if(Wo&&typeof Wo.onCommitFiberUnmount=="function")try{Wo.onCommitFiberUnmount(Lm,n)}catch{}switch(n.tag){case 5:Sn||Pl(n,t);case 6:var r=ln,o=po;ln=null,ea(e,t,n),ln=r,po=o,ln!==null&&(po?(e=ln,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ln.removeChild(n.stateNode));break;case 18:ln!==null&&(po?(e=ln,n=n.stateNode,e.nodeType===8?Xv(e.parentNode,n):e.nodeType===1&&Xv(e,n),xd(e)):Xv(ln,n.stateNode));break;case 4:r=ln,o=po,ln=n.stateNode.containerInfo,po=!0,ea(e,t,n),ln=r,po=o;break;case 0:case 11:case 14:case 15:if(!Sn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&w0(n,t,a),o=o.next}while(o!==r)}ea(e,t,n);break;case 1:if(!Sn&&(Pl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){kt(n,t,s)}ea(e,t,n);break;case 21:ea(e,t,n);break;case 22:n.mode&1?(Sn=(r=Sn)||n.memoizedState!==null,ea(e,t,n),Sn=r):ea(e,t,n);break;default:ea(e,t,n)}}function kC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Q3),t.forEach(function(r){var o=iF.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function no(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Ft()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*J3(r/1960))-r,10e?16:e,Ea===null)var r=!1;else{if(e=Ea,Ea=null,Xh=0,Me&6)throw Error(V(331));var o=Me;for(Me|=4,X=e.current;X!==null;){var i=X,a=i.child;if(X.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lFt()-W1?Cs(e,0):H1|=n),Kn(e,t)}function hR(e,t){t===0&&(e.mode&1?(t=qf,qf<<=1,!(qf&130023424)&&(qf=4194304)):t=1);var n=_n();e=Oi(e,t),e!==null&&(uf(e,t,n),Kn(e,n))}function oF(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hR(e,n)}function iF(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(t),hR(e,n)}var mR;mR=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wn.current)zn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return zn=!1,K3(e,t,n);zn=!!(e.flags&131072)}else zn=!1,gt&&t.flags&1048576&&S_(t,zh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;th(e,t),e=t.pendingProps;var o=lu(t,En.current);jl(t,n),o=L1(null,t,r,e,o,n);var i=U1();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Vn(r)?(i=!0,jh(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,N1(t),o.updater=Wm,t.stateNode=o,o._reactInternals=t,m0(t,r,e,n),t=y0(null,t,r,!0,i,n)):(t.tag=0,gt&&i&&I1(t),Tn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(th(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=sF(r),e=so(r,e),o){case 0:t=v0(null,t,r,e,n);break e;case 1:t=TC(null,t,r,e,n);break e;case 11:t=xC(null,t,r,e,n);break e;case 14:t=IC(null,t,r,so(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:so(r,o),v0(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:so(r,o),TC(e,t,r,o,n);case 3:e:{if(J_(t),e===null)throw Error(V(387));r=t.pendingProps,i=t.memoizedState,o=i.element,I_(e,t),Vh(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=fu(Error(V(423)),t),t=AC(e,t,r,n,o);break e}else if(r!==o){o=fu(Error(V(424)),t),t=AC(e,t,r,n,o);break e}else for(ar=Ra(t.stateNode.containerInfo.firstChild),lr=t,gt=!0,mo=null,n=C_(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(uu(),r===o){t=Di(e,t,n);break e}Tn(e,t,r,n)}t=t.child}return t;case 5:return T_(t),e===null&&f0(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,s0(r,o)?a=null:i!==null&&s0(r,i)&&(t.flags|=32),X_(e,t),Tn(e,t,a,n),t.child;case 6:return e===null&&f0(t),null;case 13:return Z_(e,t,n);case 4:return O1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=cu(t,null,r,n):Tn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:so(r,o),xC(e,t,r,o,n);case 7:return Tn(e,t,t.pendingProps,n),t.child;case 8:return Tn(e,t,t.pendingProps.children,n),t.child;case 12:return Tn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,lt(Hh,r._currentValue),r._currentValue=a,i!==null)if(Eo(i.value,a)){if(i.children===o.children&&!Wn.current){t=Di(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Ai(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),p0(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(V(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),p0(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Tn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,jl(t,n),o=Br(o),r=r(o),t.flags|=1,Tn(e,t,r,n),t.child;case 14:return r=t.type,o=so(r,t.pendingProps),o=so(r.type,o),IC(e,t,r,o,n);case 15:return Q_(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:so(r,o),th(e,t),t.tag=1,Vn(r)?(e=!0,jh(t)):e=!1,jl(t,n),K_(t,r,o),m0(t,r,o,n),y0(null,t,r,!0,e,n);case 19:return eR(e,t,n);case 22:return Y_(e,t,n)}throw Error(V(156,t.tag))};function gR(e,t){return H2(e,t)}function aF(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(e,t,n,r){return new aF(e,t,n,r)}function q1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sF(e){if(typeof e=="function")return q1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===p1)return 11;if(e===h1)return 14}return 2}function Oa(e,t){var n=e.alternate;return n===null?(n=Lr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function oh(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")q1(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case El:return xs(n.children,o,i,t);case f1:a=8,o|=8;break;case $y:return e=Lr(12,n,t,o|2),e.elementType=$y,e.lanes=i,e;case jy:return e=Lr(13,n,t,o),e.elementType=jy,e.lanes=i,e;case By:return e=Lr(19,n,t,o),e.elementType=By,e.lanes=i,e;case T2:return Gm(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x2:a=10;break e;case I2:a=9;break e;case p1:a=11;break e;case h1:a=14;break e;case oa:a=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=Lr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function xs(e,t,n,r){return e=Lr(7,e,r,t),e.lanes=n,e}function Gm(e,t,n,r){return e=Lr(22,e,r,t),e.elementType=T2,e.lanes=n,e.stateNode={isHidden:!1},e}function iy(e,t,n){return e=Lr(6,e,null,t),e.lanes=n,e}function ay(e,t,n){return t=Lr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lF(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jv(0),this.expirationTimes=jv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jv(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Q1(e,t,n,r,o,i,a,s,l){return e=new lF(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Lr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},N1(i),e}function uF(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bR)}catch(e){console.error(e)}}bR(),b2.exports=yr;var Z1=b2.exports;const ap=sf(Z1);var $C=Z1;Ly.createRoot=$C.createRoot,Ly.hydrateRoot=$C.hydrateRoot;var Uu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hF={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},da,o1,JA,mF=(JA=class{constructor(){ie(this,da,hF);ie(this,o1,!1)}setTimeoutProvider(e){Q(this,da,e)}setTimeout(e,t){return P(this,da).setTimeout(e,t)}clearTimeout(e){P(this,da).clearTimeout(e)}setInterval(e,t){return P(this,da).setInterval(e,t)}clearInterval(e){P(this,da).clearInterval(e)}},da=new WeakMap,o1=new WeakMap,JA),us=new mF;function gF(e){setTimeout(e,0)}var Ms=typeof window>"u"||"Deno"in globalThis;function An(){}function vF(e,t){return typeof e=="function"?e(t):e}function P0(e){return typeof e=="number"&&e>=0&&e!==1/0}function ER(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Da(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function jC(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==eb(a,t.options))return!1}else if(!Fd(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function BC(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Fs(t.options.mutationKey)!==Fs(i))return!1}else if(!Fd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function eb(e,t){return((t==null?void 0:t.queryKeyHashFn)||Fs)(e)}function Fs(e){return JSON.stringify(e,(t,n)=>k0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Fd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Fd(e[n],t[n])):!1}var yF=Object.prototype.hasOwnProperty;function wR(e,t){if(e===t)return e;const n=zC(e)&&zC(t);if(!n&&!(k0(e)&&k0(t)))return t;const o=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,s=n?new Array(a):{};let l=0;for(let u=0;u{us.setTimeout(t,e)})}function N0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?wR(e,t):t}function bF(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function EF(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var tb=Symbol();function CR(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===tb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xR(e,t){return typeof e=="function"?e(...t):!!e}var hs,fa,Ql,ZA,wF=(ZA=class extends Uu{constructor(){super();ie(this,hs);ie(this,fa);ie(this,Ql);Q(this,Ql,t=>{if(!Ms&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){P(this,fa)||this.setEventListener(P(this,Ql))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,fa))==null||t.call(this),Q(this,fa,void 0))}setEventListener(t){var n;Q(this,Ql,t),(n=P(this,fa))==null||n.call(this),Q(this,fa,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){P(this,hs)!==t&&(Q(this,hs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof P(this,hs)=="boolean"?P(this,hs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hs=new WeakMap,fa=new WeakMap,Ql=new WeakMap,ZA),nb=new wF;function O0(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var CF=gF;function xF(){let e=[],t=0,n=s=>{s()},r=s=>{s()},o=CF;const i=s=>{t?e.push(s):o(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&o(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{o=s}}}var Yt=xF(),Yl,pa,Xl,e2,IF=(e2=class extends Uu{constructor(){super();ie(this,Yl,!0);ie(this,pa);ie(this,Xl);Q(this,Xl,t=>{if(!Ms&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){P(this,pa)||this.setEventListener(P(this,Xl))}onUnsubscribe(){var t;this.hasListeners()||((t=P(this,pa))==null||t.call(this),Q(this,pa,void 0))}setEventListener(t){var n;Q(this,Xl,t),(n=P(this,pa))==null||n.call(this),Q(this,pa,t(this.setOnline.bind(this)))}setOnline(t){P(this,Yl)!==t&&(Q(this,Yl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return P(this,Yl)}},Yl=new WeakMap,pa=new WeakMap,Xl=new WeakMap,e2),tm=new IF;function TF(e){return Math.min(1e3*2**e,3e4)}function IR(e){return(e??"online")==="online"?tm.isOnline():!0}var D0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function TR(e){let t=!1,n=0,r;const o=O0(),i=()=>o.status!=="pending",a=m=>{var E;if(!i()){const g=new D0(m);f(g),(E=e.onCancel)==null||E.call(e,g)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>nb.isFocused()&&(e.networkMode==="always"||tm.isOnline())&&e.canRun(),c=()=>IR(e.networkMode)&&e.canRun(),d=m=>{i()||(r==null||r(),o.resolve(m))},f=m=>{i()||(r==null||r(),o.reject(m))},p=()=>new Promise(m=>{var E;r=g=>{(i()||u())&&m(g)},(E=e.onPause)==null||E.call(e)}).then(()=>{var m;r=void 0,i()||(m=e.onContinue)==null||m.call(e)}),h=()=>{if(i())return;let m;const E=n===0?e.initialPromise:void 0;try{m=E??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(d).catch(g=>{var I;if(i())return;const y=e.retry??(Ms?0:3),v=e.retryDelay??TF,S=typeof v=="function"?v(n,g):v,x=y===!0||typeof y=="number"&&nu()?void 0:p()).then(()=>{t?f(g):h()})})};return{promise:o,status:()=>o.status,cancel:a,continue:()=>(r==null||r(),o),cancelRetry:s,continueRetry:l,canStart:c,start:()=>(c()?h():p().then(h),o)}}var ms,t2,AR=(t2=class{constructor(){ie(this,ms)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),P0(this.gcTime)&&Q(this,ms,us.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ms?1/0:5*60*1e3))}clearGcTimeout(){P(this,ms)&&(us.clearTimeout(P(this,ms)),Q(this,ms,void 0))}},ms=new WeakMap,t2),gs,Jl,_r,vs,tn,tf,ys,co,ai,n2,AF=(n2=class extends AR{constructor(t){super();ie(this,co);ie(this,gs);ie(this,Jl);ie(this,_r);ie(this,vs);ie(this,tn);ie(this,tf);ie(this,ys);Q(this,ys,!1),Q(this,tf,t.defaultOptions),this.setOptions(t.options),this.observers=[],Q(this,vs,t.client),Q(this,_r,P(this,vs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Q(this,gs,VC(this.options)),this.state=t.state??P(this,gs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=P(this,tn))==null?void 0:t.promise}setOptions(t){if(this.options={...P(this,tf),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=VC(this.options);n.data!==void 0&&(this.setState(WC(n.data,n.dataUpdatedAt)),Q(this,gs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&P(this,_r).remove(this)}setData(t,n){const r=N0(this.state.data,t,this.options);return Ce(this,co,ai).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ce(this,co,ai).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=P(this,tn))==null?void 0:r.promise;return(o=P(this,tn))==null||o.cancel(t),n?n.then(An).catch(An):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(P(this,gs))}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Da(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ER(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,tn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=P(this,tn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),P(this,_r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(P(this,tn)&&(P(this,ys)?P(this,tn).cancel({revert:!0}):P(this,tn).cancelRetry()),this.scheduleGc()),P(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ce(this,co,ai).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,c,d,f,p,h,m,E,g,y,v;if(this.state.fetchStatus!=="idle"&&((l=P(this,tn))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(P(this,tn))return P(this,tn).continueRetry(),P(this,tn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(x=>x.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Q(this,ys,!0),r.signal)})},i=()=>{const S=CR(this.options,n),I=(()=>{const T={client:P(this,vs),queryKey:this.queryKey,meta:this.meta};return o(T),T})();return Q(this,ys,!1),this.options.persister?this.options.persister(S,I,this):S(I)},s=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:P(this,vs),state:this.state,fetchFn:i};return o(S),S})();(u=this.options.behavior)==null||u.onFetch(s,this),Q(this,Jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Ce(this,co,ai).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta}),Q(this,tn,TR({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof D0&&S.revert&&this.setState({...P(this,Jl),fetchStatus:"idle"}),r.abort()},onFail:(S,x)=>{Ce(this,co,ai).call(this,{type:"failed",failureCount:S,error:x})},onPause:()=>{Ce(this,co,ai).call(this,{type:"pause"})},onContinue:()=>{Ce(this,co,ai).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await P(this,tn).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(f=P(this,_r).config).onSuccess)==null||p.call(f,S,this),(m=(h=P(this,_r).config).onSettled)==null||m.call(h,S,this.state.error,this),S}catch(S){if(S instanceof D0){if(S.silent)return P(this,tn).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw Ce(this,co,ai).call(this,{type:"error",error:S}),(g=(E=P(this,_r).config).onError)==null||g.call(E,S,this),(v=(y=P(this,_r).config).onSettled)==null||v.call(y,this.state.data,S,this),S}finally{this.scheduleGc()}}},gs=new WeakMap,Jl=new WeakMap,_r=new WeakMap,vs=new WeakMap,tn=new WeakMap,tf=new WeakMap,ys=new WeakMap,co=new WeakSet,ai=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,..._R(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...WC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Q(this,Jl,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),P(this,_r).notify({query:this,type:"updated",action:t})})},n2);function _R(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:IR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function WC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var $n,Pe,nf,xn,Ss,Zl,mi,ha,rf,eu,tu,bs,Es,ma,nu,qe,$c,M0,F0,L0,U0,$0,j0,B0,RR,r2,_F=(r2=class extends Uu{constructor(t,n){super();ie(this,qe);ie(this,$n);ie(this,Pe);ie(this,nf);ie(this,xn);ie(this,Ss);ie(this,Zl);ie(this,mi);ie(this,ha);ie(this,rf);ie(this,eu);ie(this,tu);ie(this,bs);ie(this,Es);ie(this,ma);ie(this,nu,new Set);this.options=n,Q(this,$n,t),Q(this,ha,null),Q(this,mi,O0()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(P(this,Pe).addObserver(this),KC(P(this,Pe),this.options)?Ce(this,qe,$c).call(this):this.updateResult(),Ce(this,qe,U0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z0(P(this,Pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z0(P(this,Pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ce(this,qe,$0).call(this),Ce(this,qe,j0).call(this),P(this,Pe).removeObserver(this)}setOptions(t){const n=this.options,r=P(this,Pe);if(this.options=P(this,$n).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,P(this,Pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ce(this,qe,B0).call(this),P(this,Pe).setOptions(this.options),n._defaulted&&!em(this.options,n)&&P(this,$n).getQueryCache().notify({type:"observerOptionsUpdated",query:P(this,Pe),observer:this});const o=this.hasListeners();o&&GC(P(this,Pe),r,this.options,n)&&Ce(this,qe,$c).call(this),this.updateResult(),o&&(P(this,Pe)!==r||kr(this.options.enabled,P(this,Pe))!==kr(n.enabled,P(this,Pe))||Da(this.options.staleTime,P(this,Pe))!==Da(n.staleTime,P(this,Pe)))&&Ce(this,qe,M0).call(this);const i=Ce(this,qe,F0).call(this);o&&(P(this,Pe)!==r||kr(this.options.enabled,P(this,Pe))!==kr(n.enabled,P(this,Pe))||i!==P(this,ma))&&Ce(this,qe,L0).call(this,i)}getOptimisticResult(t){const n=P(this,$n).getQueryCache().build(P(this,$n),t),r=this.createResult(n,t);return PF(this,r)&&(Q(this,xn,r),Q(this,Zl,this.options),Q(this,Ss,P(this,Pe).state)),r}getCurrentResult(){return P(this,xn)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&P(this,mi).status==="pending"&&P(this,mi).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){P(this,nu).add(t)}getCurrentQuery(){return P(this,Pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=P(this,$n).defaultQueryOptions(t),r=P(this,$n).getQueryCache().build(P(this,$n),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ce(this,qe,$c).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),P(this,xn)))}createResult(t,n){var R;const r=P(this,Pe),o=this.options,i=P(this,xn),a=P(this,Ss),s=P(this,Zl),u=t!==r?t.state:P(this,nf),{state:c}=t;let d={...c},f=!1,p;if(n._optimisticResults){const w=this.hasListeners(),_=!w&&KC(t,n),k=w&&GC(t,r,n,o);(_||k)&&(d={...d,..._R(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:m,status:E}=d;p=d.data;let g=!1;if(n.placeholderData!==void 0&&p===void 0&&E==="pending"){let w;i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData)?(w=i.data,g=!0):w=typeof n.placeholderData=="function"?n.placeholderData((R=P(this,tu))==null?void 0:R.state.data,P(this,tu)):n.placeholderData,w!==void 0&&(E="success",p=N0(i==null?void 0:i.data,w,n),f=!0)}if(n.select&&p!==void 0&&!g)if(i&&p===(a==null?void 0:a.data)&&n.select===P(this,rf))p=P(this,eu);else try{Q(this,rf,n.select),p=n.select(p),p=N0(i==null?void 0:i.data,p,n),Q(this,eu,p),Q(this,ha,null)}catch(w){Q(this,ha,w)}P(this,ha)&&(h=P(this,ha),p=P(this,eu),m=Date.now(),E="error");const y=d.fetchStatus==="fetching",v=E==="pending",S=E==="error",x=v&&y,I=p!==void 0,A={status:E,fetchStatus:d.fetchStatus,isPending:v,isSuccess:E==="success",isError:S,isInitialLoading:x,isLoading:x,data:p,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:S&&!I,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&I,isStale:rb(t,n),refetch:this.refetch,promise:P(this,mi),isEnabled:kr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const w=N=>{A.status==="error"?N.reject(A.error):A.data!==void 0&&N.resolve(A.data)},_=()=>{const N=Q(this,mi,A.promise=O0());w(N)},k=P(this,mi);switch(k.status){case"pending":t.queryHash===r.queryHash&&w(k);break;case"fulfilled":(A.status==="error"||A.data!==k.value)&&_();break;case"rejected":(A.status!=="error"||A.error!==k.reason)&&_();break}}return A}updateResult(){const t=P(this,xn),n=this.createResult(P(this,Pe),this.options);if(Q(this,Ss,P(this,Pe).state),Q(this,Zl,this.options),P(this,Ss).data!==void 0&&Q(this,tu,P(this,Pe)),em(n,t))return;Q(this,xn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!P(this,nu).size)return!0;const a=new Set(i??P(this,nu));return this.options.throwOnError&&a.add("error"),Object.keys(P(this,xn)).some(s=>{const l=s;return P(this,xn)[l]!==t[l]&&a.has(l)})};Ce(this,qe,RR).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ce(this,qe,U0).call(this)}},$n=new WeakMap,Pe=new WeakMap,nf=new WeakMap,xn=new WeakMap,Ss=new WeakMap,Zl=new WeakMap,mi=new WeakMap,ha=new WeakMap,rf=new WeakMap,eu=new WeakMap,tu=new WeakMap,bs=new WeakMap,Es=new WeakMap,ma=new WeakMap,nu=new WeakMap,qe=new WeakSet,$c=function(t){Ce(this,qe,B0).call(this);let n=P(this,Pe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(An)),n},M0=function(){Ce(this,qe,$0).call(this);const t=Da(this.options.staleTime,P(this,Pe));if(Ms||P(this,xn).isStale||!P0(t))return;const r=ER(P(this,xn).dataUpdatedAt,t)+1;Q(this,bs,us.setTimeout(()=>{P(this,xn).isStale||this.updateResult()},r))},F0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(P(this,Pe)):this.options.refetchInterval)??!1},L0=function(t){Ce(this,qe,j0).call(this),Q(this,ma,t),!(Ms||kr(this.options.enabled,P(this,Pe))===!1||!P0(P(this,ma))||P(this,ma)===0)&&Q(this,Es,us.setInterval(()=>{(this.options.refetchIntervalInBackground||nb.isFocused())&&Ce(this,qe,$c).call(this)},P(this,ma)))},U0=function(){Ce(this,qe,M0).call(this),Ce(this,qe,L0).call(this,Ce(this,qe,F0).call(this))},$0=function(){P(this,bs)&&(us.clearTimeout(P(this,bs)),Q(this,bs,void 0))},j0=function(){P(this,Es)&&(us.clearInterval(P(this,Es)),Q(this,Es,void 0))},B0=function(){const t=P(this,$n).getQueryCache().build(P(this,$n),this.options);if(t===P(this,Pe))return;const n=P(this,Pe);Q(this,Pe,t),Q(this,nf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},RR=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(P(this,xn))}),P(this,$n).getQueryCache().notify({query:P(this,Pe),type:"observerResultsUpdated"})})},r2);function RF(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function KC(e,t){return RF(e,t)||e.state.data!==void 0&&z0(e,t,t.refetchOnMount)}function z0(e,t,n){if(kr(t.enabled,e)!==!1&&Da(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&rb(e,t)}return!1}function GC(e,t,n,r){return(e!==t||kr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&rb(e,n)}function rb(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Da(t.staleTime,e))}function PF(e,t){return!em(e.getCurrentResult(),t)}function qC(e){return{onFetch:(t,n)=>{var c,d,f,p,h;const r=t.options,o=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],a=((h=t.state.data)==null?void 0:h.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const E=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=CR(t.options,t.fetchOptions),y=async(v,S,x)=>{if(m)return Promise.reject();if(S==null&&v.pages.length)return Promise.resolve(v);const T=(()=>{const _={client:t.client,queryKey:t.queryKey,pageParam:S,direction:x?"backward":"forward",meta:t.options.meta};return E(_),_})(),A=await g(T),{maxPages:R}=t.options,w=x?EF:bF;return{pages:w(v.pages,A,R),pageParams:w(v.pageParams,S,R)}};if(o&&i.length){const v=o==="backward",S=v?kF:QC,x={pages:i,pageParams:a},I=S(r,x);s=await y(x,I,v)}else{const v=e??i.length;do{const S=l===0?a[0]??r.initialPageParam:QC(r,s);if(l>0&&S==null)break;s=await y(s,S),l++}while(l{var m,E;return(E=(m=t.options).persister)==null?void 0:E.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function QC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function kF(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var of,Fo,In,ws,Lo,ta,o2,NF=(o2=class extends AR{constructor(t){super();ie(this,Lo);ie(this,of);ie(this,Fo);ie(this,In);ie(this,ws);Q(this,of,t.client),this.mutationId=t.mutationId,Q(this,In,t.mutationCache),Q(this,Fo,[]),this.state=t.state||PR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){P(this,Fo).includes(t)||(P(this,Fo).push(t),this.clearGcTimeout(),P(this,In).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Q(this,Fo,P(this,Fo).filter(n=>n!==t)),this.scheduleGc(),P(this,In).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){P(this,Fo).length||(this.state.status==="pending"?this.scheduleGc():P(this,In).remove(this))}continue(){var t;return((t=P(this,ws))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,s,l,u,c,d,f,p,h,m,E,g,y,v,S,x,I,T,A,R;const n=()=>{Ce(this,Lo,ta).call(this,{type:"continue"})},r={client:P(this,of),meta:this.options.meta,mutationKey:this.options.mutationKey};Q(this,ws,TR({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(w,_)=>{Ce(this,Lo,ta).call(this,{type:"failed",failureCount:w,error:_})},onPause:()=>{Ce(this,Lo,ta).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>P(this,In).canRun(this)}));const o=this.state.status==="pending",i=!P(this,ws).canStart();try{if(o)n();else{Ce(this,Lo,ta).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(a=P(this,In).config).onMutate)==null?void 0:s.call(a,t,this,r));const _=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));_!==this.state.context&&Ce(this,Lo,ta).call(this,{type:"pending",context:_,variables:t,isPaused:i})}const w=await P(this,ws).start();return await((d=(c=P(this,In).config).onSuccess)==null?void 0:d.call(c,w,t,this.state.context,this,r)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,w,t,this.state.context,r)),await((m=(h=P(this,In).config).onSettled)==null?void 0:m.call(h,w,null,this.state.variables,this.state.context,this,r)),await((g=(E=this.options).onSettled)==null?void 0:g.call(E,w,null,t,this.state.context,r)),Ce(this,Lo,ta).call(this,{type:"success",data:w}),w}catch(w){try{throw await((v=(y=P(this,In).config).onError)==null?void 0:v.call(y,w,t,this.state.context,this,r)),await((x=(S=this.options).onError)==null?void 0:x.call(S,w,t,this.state.context,r)),await((T=(I=P(this,In).config).onSettled)==null?void 0:T.call(I,void 0,w,this.state.variables,this.state.context,this,r)),await((R=(A=this.options).onSettled)==null?void 0:R.call(A,void 0,w,t,this.state.context,r)),w}finally{Ce(this,Lo,ta).call(this,{type:"error",error:w})}}finally{P(this,In).runNext(this)}}},of=new WeakMap,Fo=new WeakMap,In=new WeakMap,ws=new WeakMap,Lo=new WeakSet,ta=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Yt.batch(()=>{P(this,Fo).forEach(r=>{r.onMutationUpdate(t)}),P(this,In).notify({mutation:this,type:"updated",action:t})})},o2);function PR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gi,fo,af,i2,OF=(i2=class extends Uu{constructor(t={}){super();ie(this,gi);ie(this,fo);ie(this,af);this.config=t,Q(this,gi,new Set),Q(this,fo,new Map),Q(this,af,0)}build(t,n,r){const o=new NF({client:t,mutationCache:this,mutationId:++Bf(this,af)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){P(this,gi).add(t);const n=sp(t);if(typeof n=="string"){const r=P(this,fo).get(n);r?r.push(t):P(this,fo).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(P(this,gi).delete(t)){const n=sp(t);if(typeof n=="string"){const r=P(this,fo).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&P(this,fo).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=sp(t);if(typeof n=="string"){const r=P(this,fo).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=sp(t);if(typeof n=="string"){const o=(r=P(this,fo).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{P(this,gi).forEach(t=>{this.notify({type:"removed",mutation:t})}),P(this,gi).clear(),P(this,fo).clear()})}getAll(){return Array.from(P(this,gi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>BC(n,r))}findAll(t={}){return this.getAll().filter(n=>BC(t,n))}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Yt.batch(()=>Promise.all(t.map(n=>n.continue().catch(An))))}},gi=new WeakMap,fo=new WeakMap,af=new WeakMap,i2);function sp(e){var t;return(t=e.options.scope)==null?void 0:t.id}var vi,ga,jn,yi,Pi,ih,H0,a2,DF=(a2=class extends Uu{constructor(n,r){super();ie(this,Pi);ie(this,vi);ie(this,ga);ie(this,jn);ie(this,yi);Q(this,vi,n),this.setOptions(r),this.bindMethods(),Ce(this,Pi,ih).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=P(this,vi).defaultMutationOptions(n),em(this.options,r)||P(this,vi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:P(this,jn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Fs(r.mutationKey)!==Fs(this.options.mutationKey)?this.reset():((o=P(this,jn))==null?void 0:o.state.status)==="pending"&&P(this,jn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=P(this,jn))==null||n.removeObserver(this)}onMutationUpdate(n){Ce(this,Pi,ih).call(this),Ce(this,Pi,H0).call(this,n)}getCurrentResult(){return P(this,ga)}reset(){var n;(n=P(this,jn))==null||n.removeObserver(this),Q(this,jn,void 0),Ce(this,Pi,ih).call(this),Ce(this,Pi,H0).call(this)}mutate(n,r){var o;return Q(this,yi,r),(o=P(this,jn))==null||o.removeObserver(this),Q(this,jn,P(this,vi).getMutationCache().build(P(this,vi),this.options)),P(this,jn).addObserver(this),P(this,jn).execute(n)}},vi=new WeakMap,ga=new WeakMap,jn=new WeakMap,yi=new WeakMap,Pi=new WeakSet,ih=function(){var r;const n=((r=P(this,jn))==null?void 0:r.state)??PR();Q(this,ga,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},H0=function(n){Yt.batch(()=>{var r,o,i,a,s,l,u,c;if(P(this,yi)&&this.hasListeners()){const d=P(this,ga).variables,f=P(this,ga).context,p={client:P(this,vi),meta:this.options.meta,mutationKey:this.options.mutationKey};(n==null?void 0:n.type)==="success"?((o=(r=P(this,yi)).onSuccess)==null||o.call(r,n.data,d,f,p),(a=(i=P(this,yi)).onSettled)==null||a.call(i,n.data,null,d,f,p)):(n==null?void 0:n.type)==="error"&&((l=(s=P(this,yi)).onError)==null||l.call(s,n.error,d,f,p),(c=(u=P(this,yi)).onSettled)==null||c.call(u,void 0,n.error,d,f,p))}this.listeners.forEach(d=>{d(P(this,ga))})})},a2),Uo,s2,MF=(s2=class extends Uu{constructor(t={}){super();ie(this,Uo);this.config=t,Q(this,Uo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??eb(o,n);let a=this.get(i);return a||(a=new AF({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){P(this,Uo).has(t.queryHash)||(P(this,Uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=P(this,Uo).get(t.queryHash);n&&(t.destroy(),n===t&&P(this,Uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return P(this,Uo).get(t)}getAll(){return[...P(this,Uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>jC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>jC(t,r)):n}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Uo=new WeakMap,s2),_t,va,ya,ru,ou,Sa,iu,au,l2,FF=(l2=class{constructor(e={}){ie(this,_t);ie(this,va);ie(this,ya);ie(this,ru);ie(this,ou);ie(this,Sa);ie(this,iu);ie(this,au);Q(this,_t,e.queryCache||new MF),Q(this,va,e.mutationCache||new OF),Q(this,ya,e.defaultOptions||{}),Q(this,ru,new Map),Q(this,ou,new Map),Q(this,Sa,0)}mount(){Bf(this,Sa)._++,P(this,Sa)===1&&(Q(this,iu,nb.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,_t).onFocus())})),Q(this,au,tm.subscribe(async e=>{e&&(await this.resumePausedMutations(),P(this,_t).onOnline())})))}unmount(){var e,t;Bf(this,Sa)._--,P(this,Sa)===0&&((e=P(this,iu))==null||e.call(this),Q(this,iu,void 0),(t=P(this,au))==null||t.call(this),Q(this,au,void 0))}isFetching(e){return P(this,_t).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return P(this,va).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,_t).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=P(this,_t).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Da(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return P(this,_t).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=P(this,_t).get(r.queryHash),i=o==null?void 0:o.state.data,a=vF(t,i);if(a!==void 0)return P(this,_t).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Yt.batch(()=>P(this,_t).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=P(this,_t).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=P(this,_t);Yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=P(this,_t);return Yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Yt.batch(()=>P(this,_t).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(An).catch(An)}invalidateQueries(e,t={}){return Yt.batch(()=>(P(this,_t).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Yt.batch(()=>P(this,_t).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(An)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(An)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=P(this,_t).build(this,t);return n.isStaleByTime(Da(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(An).catch(An)}fetchInfiniteQuery(e){return e.behavior=qC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(An).catch(An)}ensureInfiniteQueryData(e){return e.behavior=qC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tm.isOnline()?P(this,va).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,_t)}getMutationCache(){return P(this,va)}getDefaultOptions(){return P(this,ya)}setDefaultOptions(e){Q(this,ya,e)}setQueryDefaults(e,t){P(this,ru).set(Fs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...P(this,ru).values()],n={};return t.forEach(r=>{Fd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){P(this,ou).set(Fs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...P(this,ou).values()],n={};return t.forEach(r=>{Fd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...P(this,ya).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=eb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===tb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...P(this,ya).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){P(this,_t).clear(),P(this,va).clear()}},_t=new WeakMap,va=new WeakMap,ya=new WeakMap,ru=new WeakMap,ou=new WeakMap,Sa=new WeakMap,iu=new WeakMap,au=new WeakMap,l2),kR=b.createContext(void 0),Jn=e=>{const t=b.useContext(kR);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},LF=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),C.jsx(kR.Provider,{value:e,children:t})),NR=b.createContext(!1),UF=()=>b.useContext(NR);NR.Provider;function $F(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jF=b.createContext($F()),BF=()=>b.useContext(jF),zF=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},HF=e=>{b.useEffect(()=>{e.clearReset()},[e])},WF=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||xR(n,[e.error,r])),VF=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},KF=(e,t)=>e.isLoading&&e.isFetching&&!t,GF=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,YC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qF(e,t,n){var d,f,p,h,m;const r=UF(),o=BF(),i=Jn(),a=i.defaultQueryOptions(e);(f=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,a),a._optimisticResults=r?"isRestoring":"optimistic",VF(a),zF(a,o),HF(o);const s=!i.getQueryCache().get(a.queryHash),[l]=b.useState(()=>new t(i,a)),u=l.getOptimisticResult(a),c=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(E=>{const g=c?l.subscribe(Yt.batchCalls(E)):An;return l.updateResult(),g},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setOptions(a)},[a,l]),GF(a,u))throw YC(a,l,o);if(WF({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:i.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((h=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||h.call(p,a,u),a.experimental_prefetchInRender&&!Ms&&KF(u,r)){const E=s?YC(a,l,o):(m=i.getQueryCache().get(a.queryHash))==null?void 0:m.promise;E==null||E.catch(An).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function Qs(e,t){return qF(e,_F)}function Jo(e,t){const n=Jn(),[r]=b.useState(()=>new DF(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const o=b.useSyncExternalStore(b.useCallback(a=>r.subscribe(Yt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=b.useCallback((a,s)=>{r.mutate(a,s).catch(An)},[r]);if(o.error&&xR(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const QF="Logging",OR="x-amz-user-agent",YF="NoHubcallbackProvidedException";var tr;(function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE",e.NONE="NONE"})(tr||(tr={}));const XC={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class Lt{constructor(t,n=tr.WARN){this.name=t,this.level=n,this._pluggables=[]}_padding(t){return t<10?"0"+t:""+t}_ts(){const t=new Date;return[this._padding(t.getMinutes()),this._padding(t.getSeconds())].join(":")+"."+t.getMilliseconds()}configure(t){return t?(this._config=t,this._config):this._config}_log(t,...n){let r=this.level;Lt.LOG_LEVEL&&(r=Lt.LOG_LEVEL),typeof window<"u"&&window.LOG_LEVEL&&(r=window.LOG_LEVEL);const o=XC[r];if(!(XC[t]>=o))return;let a=console.log.bind(console);t===tr.ERROR&&console.error&&(a=console.error.bind(console)),t===tr.WARN&&console.warn&&(a=console.warn.bind(console)),Lt.BIND_ALL_LOG_LEVELS&&(t===tr.INFO&&console.info&&(a=console.info.bind(console)),t===tr.DEBUG&&console.debug&&(a=console.debug.bind(console)));const s=`[${t}] ${this._ts()} ${this.name}`;let l="";if(n.length===1&&typeof n[0]=="string")l=`${s} - ${n[0]}`,a(l);else if(n.length===1)l=`${s} ${n[0]}`,a(s,n[0]);else if(typeof n[0]=="string"){let u=n.slice(1);u.length===1&&(u=u[0]),l=`${s} - ${n[0]} ${u}`,a(`${s} - ${n[0]}`,u)}else l=`${s} ${n}`,a(s,n);for(const u of this._pluggables){const c={message:l,timestamp:Date.now()};u.pushLogs([c])}}log(...t){this._log(tr.INFO,...t)}info(...t){this._log(tr.INFO,...t)}warn(...t){this._log(tr.WARN,...t)}error(...t){this._log(tr.ERROR,...t)}debug(...t){this._log(tr.DEBUG,...t)}verbose(...t){this._log(tr.VERBOSE,...t)}addPluggable(t){t&&t.getCategoryName()===QF&&(this._pluggables.push(t),t.configure(this._config))}listPluggables(){return this._pluggables}}Lt.LOG_LEVEL=null;Lt.BIND_ALL_LOG_LEVELS=!1;class wn extends Error{constructor({message:t,name:n,recoverySuggestion:r,underlyingError:o,metadata:i}){if(super(t),this.name=n,this.underlyingError=o,this.recoverySuggestion=r,i){const{extendedRequestId:a,httpStatusCode:s,requestId:l}=i;this.metadata={extendedRequestId:a,httpStatusCode:s,requestId:l}}this.constructor=wn,Object.setPrototypeOf(this,wn.prototype)}}var Mi;(function(e){e.NoEndpointId="NoEndpointId",e.PlatformNotSupported="PlatformNotSupported",e.Unknown="Unknown",e.NetworkError="NetworkError"})(Mi||(Mi={}));const Jm=(e,t=wn)=>(n,r,o)=>{const{message:i,recoverySuggestion:a}=e[r];if(!n)throw new t({name:r,message:o?`${i} ${o}`:i,recoverySuggestion:a})},wo=typeof Symbol<"u"?Symbol("amplify_default"):"@@amplify_default",vc=new Lt("Hub");class DR{constructor(t){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=t}_remove(t,n){const r=this.listeners.get(t);if(!r){vc.warn(`No listeners for ${t}`);return}this.listeners.set(t,[...r.filter(({callback:o})=>o!==n)])}dispatch(t,n,r,o){typeof t=="string"&&this.protectedChannels.indexOf(t)>-1&&(o===wo||vc.warn(`WARNING: ${t} is protected and dispatching on it can have unintended consequences`));const i={channel:t,payload:{...n},source:r,patternInfo:[]};try{this._toListeners(i)}catch(a){vc.error(a)}}listen(t,n,r="noname"){let o;if(typeof n!="function")throw new wn({name:YF,message:"No callback supplied to Hub"});o=n;let i=this.listeners.get(t);return i||(i=[],this.listeners.set(t,i)),i.push({name:r,callback:o}),()=>{this._remove(t,o)}}_toListeners(t){const{channel:n,payload:r}=t,o=this.listeners.get(n);o&&o.forEach(i=>{vc.debug(`Dispatching to ${n} with `,r);try{i.callback(t)}catch(a){vc.error(a)}})}}const dr=new DR("__default__"),nm=new DR("internal-hub"),ob=()=>{if(typeof window=="object"&&typeof window.crypto=="object")return window.crypto;if(typeof crypto=="object")return crypto;throw new wn({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},XF=()=>{if(typeof window<"u"&&typeof window.btoa=="function")return window.btoa;if(typeof btoa=="function")return btoa;throw new wn({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},JF=()=>{if(typeof window<"u"&&typeof window.atob=="function")return window.atob;if(typeof atob=="function")return atob;throw new wn({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})},ib={convert(e,t){let n=e;return t!=null&&t.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),JF()(n)}};var zo;(function(e){e.AuthTokenConfigException="AuthTokenConfigException",e.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",e.AuthUserPoolException="AuthUserPoolException",e.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",e.OAuthNotConfigureException="OAuthNotConfigureException"})(zo||(zo={}));const ZF={[zo.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[zo.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[zo.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[zo.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[zo.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},ab=Jm(ZF);function Re(e){let t=!0;e?t=!!e.userPoolId&&!!e.userPoolClientId:t=!1,ab(t,zo.AuthUserPoolException)}function Zm(e){var n,r,o,i,a,s,l,u;const t=!!((r=(n=e==null?void 0:e.loginWith)==null?void 0:n.oauth)!=null&&r.domain)&&!!((i=(o=e==null?void 0:e.loginWith)==null?void 0:o.oauth)!=null&&i.redirectSignOut)&&!!((s=(a=e==null?void 0:e.loginWith)==null?void 0:a.oauth)!=null&&s.redirectSignIn)&&!!((u=(l=e==null?void 0:e.loginWith)==null?void 0:l.oauth)!=null&&u.responseType);ab(t,zo.OAuthNotConfigureException)}function ah(e){const t=!!(e!=null&&e.identityPoolId);ab(t,zo.InvalidIdentityPoolIdException)}function Fi(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid token");try{const r=t[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(ib.convert(r).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),i=JSON.parse(o);return{toString:()=>e,payload:i}}catch{throw new Error("Invalid token payload")}}const MR=e=>e&&e["nonRetryable"],lp=new Lt("retryUtil");async function e4(e,t,n,r){if(typeof e!="function")throw Error("functionToRetry must be a function");return new Promise(async(o,i)=>{let a=0,s=!1,l=()=>{},u;for(;;){a++,lp.debug(`${e.name} attempt #${a} with this vars: ${JSON.stringify(t)}`);try{o(await e(...t));return}catch(c){if(u=c,lp.debug(`error on ${e.name}`,c),MR(c)){lp.debug(`${e.name} non retryable error`,c),i(c);return}const d=n(a,t,c);if(lp.debug(`${e.name} retrying in ${d} ms`),d===!1||s){i(c);return}else await new Promise(f=>{l=f,setTimeout(l,d)})}}i(u)})}const FR=e=>{const t=Reflect.ownKeys(e);for(const n of t){const r=e[n];(r&&typeof r=="object"||typeof r=="function")&&FR(r)}return Object.freeze(e)},t4=new Lt("parseAWSExports"),n4={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},r4=(e={})=>{var ne,ce,Le,Oe,We,nt;if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new wn({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});const{aws_appsync_apiKey:t,aws_appsync_authenticationType:n,aws_appsync_graphqlEndpoint:r,aws_appsync_region:o,aws_bots_config:i,aws_cognito_identity_pool_id:a,aws_cognito_sign_up_verification_method:s,aws_cognito_mfa_configuration:l,aws_cognito_mfa_types:u,aws_cognito_password_protection_settings:c,aws_cognito_verification_mechanisms:d,aws_cognito_signup_attributes:f,aws_cognito_social_providers:p,aws_cognito_username_attributes:h,aws_mandatory_sign_in:m,aws_mobile_analytics_app_id:E,aws_mobile_analytics_app_region:g,aws_user_files_s3_bucket:y,aws_user_files_s3_bucket_region:v,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:S,aws_user_pools_id:x,aws_user_pools_web_client_id:I,geo:T,oauth:A,predictions:R,aws_cloud_logic_custom:w,Notifications:_,modelIntrospection:k}=e,N={};E&&(N.Analytics={Pinpoint:{appId:E,region:g}});const{InAppMessaging:F,Push:U}=_??{};if(F!=null&&F.AWSPinpoint||U!=null&&U.AWSPinpoint){if(F!=null&&F.AWSPinpoint){const{appId:te,region:de}=F.AWSPinpoint;N.Notifications={InAppMessaging:{Pinpoint:{appId:te,region:de}}}}if(U!=null&&U.AWSPinpoint){const{appId:te,region:de}=U.AWSPinpoint;N.Notifications={...N.Notifications,PushNotification:{Pinpoint:{appId:te,region:de}}}}}if(Array.isArray(i)&&(N.Interactions={LexV1:Object.fromEntries(i.map(te=>[te.name,te]))}),r){const te=n4[n];te||t4.debug(`Invalid authentication type ${n}. Falling back to IAM.`),N.API={GraphQL:{endpoint:r,apiKey:t,region:o,defaultAuthMode:te??"iam"}},k&&(N.API.GraphQL.modelIntrospection=k)}const $=l?{status:l&&l.toLowerCase(),totpEnabled:(u==null?void 0:u.includes("TOTP"))??!1,smsEnabled:(u==null?void 0:u.includes("SMS"))??!1}:void 0,j=c?{minLength:c.passwordPolicyMinLength,requireLowercase:((ne=c.passwordPolicyCharacters)==null?void 0:ne.includes("REQUIRES_LOWERCASE"))??!1,requireUppercase:((ce=c.passwordPolicyCharacters)==null?void 0:ce.includes("REQUIRES_UPPERCASE"))??!1,requireNumbers:((Le=c.passwordPolicyCharacters)==null?void 0:Le.includes("REQUIRES_NUMBERS"))??!1,requireSpecialCharacters:((Oe=c.passwordPolicyCharacters)==null?void 0:Oe.includes("REQUIRES_SYMBOLS"))??!1}:void 0,D=Array.from(new Set([...d??[],...f??[]])).reduce((te,de)=>({...te,[de.toLowerCase()]:{required:!0}}),{}),z=(h==null?void 0:h.includes("EMAIL"))??!1,K=(h==null?void 0:h.includes("PHONE_NUMBER"))??!1;(a||x)&&(N.Auth={Cognito:{identityPoolId:a,allowGuestAccess:m!=="enable",signUpVerificationMethod:s,userAttributes:D,userPoolClientId:I,userPoolId:x,mfa:$,passwordFormat:j,loginWith:{username:!(z||K),email:z,phone:K}}});const ae=A?Object.keys(A).length>0:!1,Ie=p?p.length>0:!1;if(N.Auth&&ae&&(N.Auth.Cognito.loginWith={...N.Auth.Cognito.loginWith,oauth:{...o4(A),...Ie&&{providers:i4(p)}}}),y&&(N.Storage={S3:{bucket:y,region:v,dangerouslyConnectToHttpEndpointForTesting:S}}),T){const{amazon_location_service:te}=T;N.Geo={LocationService:{maps:te.maps,geofenceCollections:te.geofenceCollections,searchIndices:te.search_indices,region:te.region}}}if(w&&(N.API={...N.API,REST:w.reduce((te,de)=>{const{name:le,endpoint:rt,region:me,service:De}=de;return{...te,[le]:{endpoint:rt,...De?{service:De}:void 0,...me?{region:me}:void 0}}},{})}),R){const{VoiceId:te}=((nt=(We=R==null?void 0:R.convert)==null?void 0:We.speechGenerator)==null?void 0:nt.defaults)??{};N.Predictions=te?{...R,convert:{...R.convert,speechGenerator:{...R.convert.speechGenerator,defaults:{voiceId:te}}}}:R}return N},JC=e=>(e==null?void 0:e.split(","))??[],o4=({domain:e,scope:t,redirectSignIn:n,redirectSignOut:r,responseType:o})=>({domain:e,scopes:t,redirectSignIn:JC(n),redirectSignOut:JC(r),responseType:o}),i4=e=>e.map(t=>{const n=t.toLowerCase();return n.charAt(0).toUpperCase()+n.slice(1)}),LR=Symbol("oauth-listener");let up;const a4=new Uint8Array(16);function s4(){if(!up&&(up=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!up))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return up(a4)}const sn=[];for(let e=0;e<256;++e)sn.push((e+256).toString(16).slice(1));function l4(e,t=0){return sn[e[t+0]]+sn[e[t+1]]+sn[e[t+2]]+sn[e[t+3]]+"-"+sn[e[t+4]]+sn[e[t+5]]+"-"+sn[e[t+6]]+sn[e[t+7]]+"-"+sn[e[t+8]]+sn[e[t+9]]+"-"+sn[e[t+10]]+sn[e[t+11]]+sn[e[t+12]]+sn[e[t+13]]+sn[e[t+14]]+sn[e[t+15]]}const u4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZC={randomUUID:u4};function c4(e,t,n){if(ZC.randomUUID&&!t&&!e)return ZC.randomUUID();e=e||{};const r=e.random||(e.rng||s4)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return l4(r)}function d4(e){const{version:t}=e;return t?t.startsWith("1"):!1}function f4(e){if(!e)return;const{bucket_name:t,aws_region:n,buckets:r}=e;return{S3:{bucket:t,region:n,buckets:r&&C4(r)}}}function p4(e){if(!e)return;const{user_pool_id:t,user_pool_client_id:n,identity_pool_id:r,password_policy:o,mfa_configuration:i,mfa_methods:a,unauthenticated_identities_enabled:s,oauth:l,username_attributes:u,standard_required_attributes:c,groups:d}=e,f={Cognito:{userPoolId:t,userPoolClientId:n,groups:d}};return r&&(f.Cognito={...f.Cognito,identityPoolId:r}),o&&(f.Cognito.passwordFormat={requireLowercase:o.require_lowercase,requireNumbers:o.require_numbers,requireUppercase:o.require_uppercase,requireSpecialCharacters:o.require_symbols,minLength:o.min_length??6}),i&&(f.Cognito.mfa={status:w4(i),smsEnabled:a==null?void 0:a.includes("SMS"),totpEnabled:a==null?void 0:a.includes("TOTP")}),s&&(f.Cognito.allowGuestAccess=s),l&&(f.Cognito.loginWith={oauth:{domain:l.domain,redirectSignIn:l.redirect_sign_in_uri,redirectSignOut:l.redirect_sign_out_uri,responseType:l.response_type==="token"?"token":"code",scopes:l.scopes,providers:E4(l.identity_providers)}}),u&&(f.Cognito.loginWith={...f.Cognito.loginWith,email:u.includes("email"),phone:u.includes("phone_number"),username:u.includes("username")}),c&&(f.Cognito.userAttributes=c.reduce((p,h)=>({...p,[h]:{required:!0}}),{})),f}function h4(e){if(!(e!=null&&e.amazon_pinpoint))return;const{amazon_pinpoint:t}=e;return{Pinpoint:{appId:t.app_id,region:t.aws_region}}}function m4(e){if(!e)return;const{aws_region:t,geofence_collections:n,maps:r,search_indices:o}=e;return{LocationService:{region:t,searchIndices:o,geofenceCollections:n,maps:r}}}function g4(e){if(!e)return;const{aws_region:t,default_authorization_type:n,url:r,api_key:o,model_introspection:i}=e;return{GraphQL:{endpoint:r,defaultAuthMode:UR(n),region:t,apiKey:o,modelIntrospection:i}}}function v4(e){if(!(e!=null&&e.events))return;const{url:t,aws_region:n,api_key:r,default_authorization_type:o}=e.events;return{Events:{endpoint:t,defaultAuthMode:UR(o),region:n,apiKey:r}}}function y4(e){if(!e)return;const{aws_region:t,channels:n,amazon_pinpoint_app_id:r}=e,o=n.includes("IN_APP_MESSAGING"),i=n.includes("APNS")||n.includes("FCM");if(!(o||i))return;const a={};return o&&(a.InAppMessaging={Pinpoint:{appId:r,region:t}}),i&&(a.PushNotification={Pinpoint:{appId:r,region:t}}),a}function S4(e){const t={};if(e.storage&&(t.Storage=f4(e.storage)),e.auth&&(t.Auth=p4(e.auth)),e.analytics&&(t.Analytics=h4(e.analytics)),e.geo&&(t.Geo=m4(e.geo)),e.data&&(t.API=g4(e.data)),e.custom){const n=v4(e.custom);n&&"Events"in n&&(t.API={...t.API,...n})}return e.notifications&&(t.Notifications=y4(e.notifications)),t}const b4={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"};function UR(e){return b4[e]}const ex={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"};function E4(e=[]){return e.reduce((t,n)=>(ex[n]!==void 0&&t.push(ex[n]),t),[])}function w4(e){return e==="OPTIONAL"?"optional":e==="REQUIRED"?"on":"off"}function C4(e){const t={};return e.forEach(({name:n,bucket_name:r,aws_region:o,paths:i})=>{if(n in t)throw new Error(`Duplicate friendly name found: ${n}. Name must be unique.`);const a=i?Object.entries(i).reduce((s,[l,u])=>(u!==void 0&&(s[l]=u),s),{}):void 0;t[n]={bucketName:r,region:o,paths:a}}),t}const $R=e=>Object.keys(e).some(t=>t.startsWith("aws_"))?r4(e):d4(e)?S4(e):e;var W0=function(e,t){return W0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},W0(e,t)};function sb(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");W0(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function jR(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(c){try{u(r.next(c))}catch(d){a(d)}}function l(c){try{u(r.throw(c))}catch(d){a(d)}}function u(c){c.done?i(c.value):o(c.value).then(s,l)}u((r=r.apply(e,t||[])).next())})}function lb(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function V0(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function K0(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r1||l(p,m)})},h&&(o[p]=h(o[p])))}function l(p,h){try{u(r[p](h))}catch(m){f(i[0][3],m)}}function u(p){p.value instanceof zl?Promise.resolve(p.value.v).then(c,d):f(i[0][2],p)}function c(p){l("next",p)}function d(p){l("throw",p)}function f(p,h){p(h),i.shift(),i.length&&l(i[0][0],i[0][1])}}function I4(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Ld=="function"?Ld(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value)})}}function o(i,a,s,l){Promise.resolve(l).then(function(u){i({value:u,done:s})},a)}}var Rr=64,T4=32,A4=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),_4=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],R4=Math.pow(2,53)-1,sh=function(){function e(){this.state=Int32Array.from(_4),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw new Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>R4)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===Rr&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%Rr>=Rr-8){for(var o=this.bufferLength;o>>24&255,i[o*4+1]=this.state[o]>>>16&255,i[o*4+2]=this.state[o]>>>8&255,i[o*4+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var t=this,n=t.buffer,r=t.state,o=r[0],i=r[1],a=r[2],s=r[3],l=r[4],u=r[5],c=r[6],d=r[7],f=0;f>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[f-15];var m=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[f]=(h+this.temp[f-7]|0)+(m+this.temp[f-16]|0)}var E=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&u^~l&c)|0)+(d+(A4[f]+this.temp[f]|0)|0)|0,g=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&i^o&a^i&a)|0;d=c,c=u,u=l,l=s+E|0,s=a,a=i,i=o,o=E+g|0}r[0]+=o,r[1]+=i,r[2]+=a,r[3]+=s,r[4]+=l,r[5]+=u,r[6]+=c,r[7]+=d},e}();const P4=e=>new TextEncoder().encode(e);var k4=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:P4;function BR(e){return e instanceof Uint8Array?e:typeof e=="string"?k4(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function N4(e){return typeof e=="string"?e.length===0:e.byteLength===0}var hu=function(){function e(t){this.secret=t,this.hash=new sh,this.reset()}return e.prototype.update=function(t){if(!(N4(t)||this.error))try{this.hash.update(BR(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return jR(this,void 0,void 0,function(){return lb(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new sh,this.secret){this.outer=new sh;var t=O4(this.secret),n=new Uint8Array(Rr);n.set(t);for(var r=0;rRr){var n=new sh;n.update(t),t=n.digest()}var r=new Uint8Array(Rr);return r.set(t),r}const zR={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),zR[e]=t}function D4(e){let t="";for(let n=0;ntypeof global<"u",$u=()=>typeof window<"u",HR=()=>typeof document<"u",ub=()=>typeof process<"u",Ud=(e,t)=>!!Object.keys(e).find(n=>n.startsWith(t));var sx={};function F4(){const e=r=>r.startsWith("_react")||r.startsWith("__react"),t=r=>Object.keys(r).find(e),n=()=>Array.from(document.querySelectorAll("[id]"));return HR()&&n().some(t)}function L4(){return ub()&&typeof sx<"u"&&!!Object.keys(sx).find(e=>e.includes("react"))}function U4(){return $u()&&Ud(window,"__VUE")}function $4(){return eg()&&Ud(global,"__VUE")}var lx={};function j4(){return $u()&&Ud(window,"__SVELTE")}function B4(){return ub()&&typeof lx<"u"&&!!Object.keys(lx).find(e=>e.includes("svelte"))}function z4(){return $u()&&window.next&&typeof window.next=="object"}function H4(){return eg()&&(Ud(global,"__next")||Ud(global,"__NEXT"))}function W4(){return $u()&&(window.__NUXT__!==void 0||window.$nuxt!==void 0)}function V4(){return eg()&&typeof global.__NUXT_PATHS__<"u"}var ux={};function K4(){const e=!!(HR()&&document.querySelector("[ng-version]")),t=!!($u()&&typeof window.ng<"u");return e||t}function G4(){var e;return ub()&&typeof ux=="object"&&((e=ux.npm_lifecycle_script)==null?void 0:e.startsWith("ng "))||!1}function q4(){return typeof navigator<"u"&&typeof navigator.product<"u"&&navigator.product==="ReactNative"}function Q4(){return eg()&&typeof global.expo<"u"}function Y4(){return $u()}const X4=[{platform:Bt.Expo,detectionMethod:Q4},{platform:Bt.ReactNative,detectionMethod:q4},{platform:Bt.NextJs,detectionMethod:z4},{platform:Bt.Nuxt,detectionMethod:W4},{platform:Bt.Angular,detectionMethod:K4},{platform:Bt.React,detectionMethod:F4},{platform:Bt.VueJs,detectionMethod:U4},{platform:Bt.Svelte,detectionMethod:j4},{platform:Bt.WebUnknown,detectionMethod:Y4},{platform:Bt.NextJsSSR,detectionMethod:H4},{platform:Bt.NuxtSSR,detectionMethod:V4},{platform:Bt.ReactSSR,detectionMethod:L4},{platform:Bt.VueJsSSR,detectionMethod:$4},{platform:Bt.AngularSSR,detectionMethod:G4},{platform:Bt.SvelteSSR,detectionMethod:B4}];function J4(){var e;return((e=X4.find(t=>t.detectionMethod()))==null?void 0:e.platform)||Bt.ServerSideUnknown}let ld;const lh=[];let rm=!1;const Z4=10,eL=10,tL=1e3,WR=()=>{var e;if(!ld){if(ld=J4(),rm)for(;lh.length;)(e=lh.pop())==null||e();else lh.forEach(t=>{t()});cx(Bt.ServerSideUnknown,Z4),cx(Bt.WebUnknown,eL)}return ld},nL=e=>{rm||lh.push(e)};function rL(){ld=void 0}function cx(e,t){ld===e&&!rm&&setTimeout(()=>{rL(),rm=!0,setTimeout(WR,tL)},t)}const na={},ni=e=>{na[e.category]=e.apis.reduce((r,o)=>{var i;return{...r,[o]:{refCount:(i=r[o])!=null&&i.refCount?r[o].refCount+1:1,additionalDetails:e.additionalDetails}}},na[e.category]??{});let t=!1;return()=>{t||(t=!0,e.apis.forEach(r=>{const o=na[e.category][r].refCount;o>1?na[e.category][r].refCount=o-1:(delete na[e.category][r],Object.keys(na[e.category]).length||delete na[e.category])}))}},oL=(e,t)=>{var n,r;return(r=(n=na[e])==null?void 0:n[t])==null?void 0:r.additionalDetails},iL="aws-amplify",aL=e=>e.replace(/\+.*/,""),sL=({category:e,action:t}={})=>{const n=[[iL,aL(M4)]];if(e&&n.push([e,t]),n.push(["framework",WR()]),e&&t){const r=oL(e,t);r&&r.forEach(o=>{n.push(o)})}return n},ju=e=>sL(e).map(([r,o])=>r&&o?`${r}/${o}`:r).join(" ");function fn(e){return typeof e=="function"}function lL(e){var t=function(r){Error.call(r),r.stack=new Error().stack},n=e(t);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var sy=lL(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription: `+n.map(function(r,o){return o+1+") "+r.toString()}).join(` `):"",this.name="UnsubscriptionError",this.errors=n}});function dx(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var cb=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Ld(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(m){t={error:m}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(fn(c))try{c()}catch(m){i=m instanceof sy?m.errors:[m]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=Ld(d),p=f.next();!p.done;p=f.next()){var h=p.value;try{fx(h)}catch(m){i=i??[],m instanceof sy?i=K0(K0([],V0(i)),V0(m.errors)):i.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}}if(i)throw new sy(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)fx(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&dx(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&dx(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();cb.EMPTY;function VR(e){return e instanceof cb||e&&"closed"in e&&fn(e.remove)&&fn(e.add)&&fn(e.unsubscribe)}function fx(e){fn(e)?e():e.unsubscribe()}var uL={Promise:void 0},cL={setTimeout:function(e,t){for(var n=[],r=2;r{if(typeof self>"u")return!1;const e=self;return typeof e.WorkerGlobalScope<"u"&&self instanceof e.WorkerGlobalScope};class Hl{networkMonitor(t){const n=FL()?self:typeof window<"u"&&window;return n?new Yn(r=>{r.next({online:n.navigator.onLine});const o=()=>{r.next({online:!0})},i=()=>{r.next({online:!1})};return n.addEventListener("online",o),n.addEventListener("offline",i),Hl._observers.push(r),()=>{n.removeEventListener("online",o),n.removeEventListener("offline",i),Hl._observers=Hl._observers.filter(a=>a!==r)}}):DL([{online:!0}])}static _observerOverride(t){for(const n of this._observers){if(n.closed){this._observers=this._observers.filter(r=>r!==n);continue}n!=null&&n.next&&n.next(t)}}}Hl._observers=[];const rg=()=>typeof window<"u"&&typeof window.document<"u";class LL{configure(t,n){this.authConfig=t,this.authOptions=n}async fetchAuthSession(t={}){var i,a,s,l,u,c;let n,r;const o=await this.getTokens(t);return o?(r=(a=(i=o.accessToken)==null?void 0:i.payload)==null?void 0:a.sub,n=await((l=(s=this.authOptions)==null?void 0:s.credentialsProvider)==null?void 0:l.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:o,authenticated:!0,forceRefresh:t.forceRefresh}))):n=await((c=(u=this.authOptions)==null?void 0:u.credentialsProvider)==null?void 0:c.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:t.forceRefresh})),{tokens:o,credentials:n==null?void 0:n.credentials,identityId:n==null?void 0:n.identityId,userSub:r}}async clearCredentials(){var t,n;await((n=(t=this.authOptions)==null?void 0:t.credentialsProvider)==null?void 0:n.clearCredentialsAndIdentityId())}async getTokens(t){var n,r;return await((r=(n=this.authOptions)==null?void 0:n.tokenProvider)==null?void 0:r.getTokens(t))??void 0}}class UL{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new LL}configure(t,n){const r=$R(t);this.resourcesConfig=r,n&&(this.libraryOptions=n),this.resourcesConfig=FR(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),dr.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",wo),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[LR](t){var n,r,o;(r=(n=this.resourcesConfig.Auth)==null?void 0:n.Cognito.loginWith)!=null&&r.oauth?t((o=this.resourcesConfig.Auth)==null?void 0:o.Cognito):this.oAuthListener=t}notifyOAuthListener(){var t,n,r;!((n=(t=this.resourcesConfig.Auth)==null?void 0:t.Cognito.loginWith)!=null&&n.oauth)||!this.oAuthListener||(this.oAuthListener((r=this.resourcesConfig.Auth)==null?void 0:r.Cognito),this.oAuthListener=void 0)}}const $e=new UL,sP=(e,t)=>e.Auth.fetchAuthSession(t),hf=e=>sP($e,e);function lP(){return $e.Auth.clearCredentials()}const og=e=>{const{headers:t,statusCode:n}=e;return{...$L(e)?e.$metadata:{},httpStatusCode:n,requestId:t["x-amzn-requestid"]??t["x-amzn-request-id"]??t["x-amz-request-id"],extendedRequestId:t["x-amz-id-2"],cfId:t["x-amz-cf-id"]}},$L=e=>typeof(e==null?void 0:e.$metadata)=="object",Qa=async e=>{if(!e||e.statusCode<300)return;const t=await mf(e),r=(a=>{const[s]=a.toString().split(/[,:]+/);return s.includes("#")?s.split("#")[1]:s})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError"),o=t.message??t.Message??"Unknown error",i=new Error(o);return Object.assign(i,{name:r,$metadata:og(e)})},mf=async e=>{if(!e.body)throw new Error("Missing response payload");const t=await e.body.json();return Object.assign(t,{$metadata:og(e)})},hn=(e,t,n,r)=>async(o,i)=>{const a={...r,...o},s=await a.endpointResolver(a,i),l=await t(i,s),u=await e(l,{...a});return n(u)},uP={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},jL={partitions:[uP,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},cP=e=>{const{partitions:t}=jL;for(const{regions:n,outputs:r,regionRegex:o}of t){const i=new RegExp(o);if(n.includes(e)||i.test(e))return r.dnsSuffix}return uP.outputs.dnsSuffix},dP=3,mx="amz-sdk-invocation-id",BL="amz-sdk-request",gx=5*60*1e3,hb=({maxAttempts:e=dP,retryDecider:t,computeDelay:n,abortSignal:r})=>{if(e<1)throw new Error("maxAttempts must be greater than 0");return(o,i)=>async function(s){let l,u=i.attemptsCount??0,c;const d=()=>{if(c)return vx(c,u),c;throw vx(l,u),l};for(;!(r!=null&&r.aborted)&&uu?i.attemptsCount??0:u+1,i.attemptsCount=u;const{isCredentialsExpiredError:f,retryable:p}=await t(c,l,i);if(p){if(i.isCredentialsExpired=!!f,!(r!=null&&r.aborted)&&u{if(t!=null&&t.aborted)return Promise.resolve();let n,r;const o=new Promise(i=>{r=i,n=setTimeout(i,e)});return t==null||t.addEventListener("abort",function i(a){clearTimeout(n),t==null||t.removeEventListener("abort",i),r()}),o},vx=(e,t)=>{Object.prototype.toString.call(e)==="[object Object]"&&(e.$metadata={...e.$metadata??{},attempts:t})},Y0=c4,HL=()=>e=>async function(n){return n.headers[mx]||(n.headers[mx]=Y0()),e(n)},WL=({maxAttempts:e=dP})=>(t,n)=>async function(o){const i=n.attemptsCount??0;return o.headers[BL]=`attempt=${i+1}; max=${e}`,t(o)},mb=({userAgentHeader:e="x-amz-user-agent",userAgentValue:t=""})=>n=>async function(o){if(t.trim().length===0)return await n(o);{const i=e.toLowerCase();return o.headers[i]=o.headers[i]?`${o.headers[i]} ${t}`:t,await n(o)}},gf=(e,t)=>(n,r)=>{const o={};let i=a=>e(a,r);for(let a=t.length-1;a>=0;a--){const s=t[a];i=s(r)(i,o)}return i(n)},ly=e=>{let t;return()=>(t||(t=e()),t)},VL=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),gb=async({url:e,method:t,headers:n,body:r},{abortSignal:o,cache:i,withCrossDomainCredentials:a})=>{var d;let s;try{s=await fetch(e,{method:t,headers:n,body:VL(t)?r:void 0,signal:o,cache:i,credentials:a?"include":"same-origin"})}catch(f){throw f instanceof TypeError?new wn({name:Mi.NetworkError,message:"A network error has occurred.",underlyingError:f}):f}const l={};(d=s.headers)==null||d.forEach((f,p)=>{l[p.toLowerCase()]=f});const u={statusCode:s.status,headers:l,body:null},c=Object.assign(s.body??{},{text:ly(()=>s.text()),blob:ly(()=>s.blob()),json:ly(()=>s.json())});return{...u,body:c}},fP=gf(gb,[mb,HL,hb,WL]),pP=5*60*1e3;function hP(e=pP){return r=>{const o=2**r*100+100*Math.random();return o>e?!1:o}}const vb=e=>{const n=hP(gx)(e);return n===!1?gx:n},KL=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],GL=e=>!!e&&KL.includes(e),yb=e=>async(t,n)=>{const r=n??await e(t)??void 0,o=(r==null?void 0:r.code)||(r==null?void 0:r.name),i=t==null?void 0:t.statusCode;return{retryable:XL(n)||YL(i,o)||GL(o)||JL(i,o)}},qL=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],QL=["TimeoutError","RequestTimeout","RequestTimeoutException"],YL=(e,t)=>e===429||!!t&&qL.includes(t),XL=e=>[Mi.NetworkError,"ERR_NETWORK"].includes(e==null?void 0:e.name),JL=(e,t)=>!!e&&[500,502,503,504].includes(e)||!!t&&QL.includes(t),Hr=URL,mP=URLSearchParams,ZL="cognito-identity",eU=({region:e})=>({url:new Hr(`https://cognito-identity.${e}.${cP(e)}`)}),tU=()=>e=>async function(n){return n.headers["cache-control"]="no-store",e(n)},gP=gf(fP,[tU]),Sb={service:ZL,endpointResolver:eU,retryDecider:yb(Qa),computeDelay:vb,userAgentValue:ju(),cache:"no-store"};nL(()=>{Sb.userAgentValue=ju()});const vP=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),yP=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"}),nU=(e,t)=>{const n=vP("GetId"),r=JSON.stringify(e);return yP(t,n,r)},rU=async e=>{if(e.statusCode>=300)throw await Qa(e);return{IdentityId:(await mf(e)).IdentityId,$metadata:og(e)}},oU=hn(gP,nU,rU,Sb),iU=(e,t)=>{const n=vP("GetCredentialsForIdentity"),r=JSON.stringify(e);return yP(t,n,r)},aU=async e=>{if(e.statusCode>=300)throw await Qa(e);{const t=await mf(e);return{IdentityId:t.IdentityId,Credentials:sU(t.Credentials),$metadata:og(e)}}},sU=({AccessKeyId:e,SecretKey:t,SessionToken:n,Expiration:r}={})=>({AccessKeyId:e,SecretKey:t,SessionToken:n,Expiration:r&&new Date(r*1e3)}),yx=hn(gP,iU,aU,Sb);class jc extends wn{constructor(){super({name:Mi.PlatformNotSupported,message:"Function not supported on current platform"})}}class SP{constructor(t){this.storage=t}async setItem(t,n){if(!this.storage)throw new jc;this.storage.setItem(t,n)}async getItem(t){if(!this.storage)throw new jc;return this.storage.getItem(t)}async removeItem(t){if(!this.storage)throw new jc;this.storage.removeItem(t)}async clear(){if(!this.storage)throw new jc;this.storage.clear()}}class bP{constructor(){this.storage=new Map}get length(){return this.storage.size}key(t){return t>this.length-1?null:Array.from(this.storage.keys())[t]}setItem(t,n){this.storage.set(t,n)}getItem(t){return this.storage.get(t)??null}removeItem(t){this.storage.delete(t)}clear(){this.storage.clear()}}const EP=new Lt("CoreStorageUtils"),lU=()=>{try{if(typeof window<"u"&&window.localStorage)return window.localStorage}catch{EP.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new bP},wP=()=>{try{if(typeof window<"u"&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw new Error("sessionStorage is not defined")}catch{return EP.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new bP}};class uU extends SP{constructor(){super(lU())}}class cU extends SP{constructor(){super(wP())}}class dU{constructor(t){this._storage=t}get storage(){if(!this._storage)throw new jc;return this._storage}setItem(t,n){this.storage.setItem(t,n)}getItem(t){return this.storage.getItem(t)}removeItem(t){this.storage.removeItem(t)}clear(){this.storage.clear()}}class fU extends dU{constructor(){super(wP())}}/*! js-cookie v3.0.5 | MIT */function dp(e){for(var t=1;t"u")){a=dp({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var l in a)a[l]&&(s+="; "+l,a[l]!==!0&&(s+="="+a[l].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+s}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},s=0;sthis.removeItem(r));await Promise.all(n)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}const vf=new uU;new cU;const Ci=new fU,mU=new Lt("I18n");let gU=class{constructor(){this._options=null,this._lang=null,this._dict={}}setDefaultLanguage(){!this._lang&&typeof window<"u"&&window&&window.navigator&&(this._lang=window.navigator.language),mU.debug(this._lang)}setLanguage(t){this._lang=t}get(t,n=void 0){if(this.setDefaultLanguage(),!this._lang)return typeof n<"u"?n:t;const r=this._lang;let o=this.getByLanguage(t,r);return o||(r.indexOf("-")>0&&(o=this.getByLanguage(t,r.split("-")[0])),o)?o:typeof n<"u"?n:t}getByLanguage(t,n,r=null){if(!n)return r;const o=this._dict[n];return o?o[t]:r}putVocabulariesForLanguage(t,n){let r=this._dict[t];r||(r=this._dict[t]={}),this._dict[t]={...r,...n}}putVocabularies(t){Object.keys(t).forEach(n=>{this.putVocabulariesForLanguage(n,t[n])})}};var cs;(function(e){e.NotConfigured="NotConfigured"})(cs||(cs={}));const vU={[cs.NotConfigured]:{message:"i18n is not configured."}},pp=Jm(vU),Sx=new Lt("I18n");let hp={language:null},ro=null;class hi{static configure(t){return Sx.debug("configure I18n"),t&&(hp=Object.assign({},hp,t.I18n||t),hi.createInstance()),hp}static getModuleName(){return"I18n"}static createInstance(){Sx.debug("create I18n instance"),!ro&&(ro=new gU)}static setLanguage(t){hi.checkConfig(),pp(!!ro,cs.NotConfigured),ro.setLanguage(t)}static get(t,n){return hi.checkConfig(),pp(!!ro,cs.NotConfigured),ro.get(t,n)}static putVocabulariesForLanguage(t,n){hi.checkConfig(),pp(!!ro,cs.NotConfigured),ro.putVocabulariesForLanguage(t,n)}static putVocabularies(t){hi.checkConfig(),pp(!!ro,cs.NotConfigured),ro.putVocabularies(t)}static checkConfig(){return ro||hi.createInstance(),!0}}hi.createInstance();const CP=e=>Object.keys(e).map(t=>t.toLowerCase()).sort().join(";"),yU="X-Amz-Date",SU="X-Amz-Security-Token",bU="authorization",EU="host",wU=yU.toLowerCase(),CU=SU.toLowerCase(),xP="aws4_request",IP="AWS4-HMAC-SHA256",xU="AWS4",IU="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",TU="UNSIGNED-PAYLOAD",AU=(e,t,n)=>`${e}/${t}/${n}/${xP}`,_U=e=>{const t=e.toISOString().replace(/[:-]|\.\d{3}/g,"");return{longDate:t,shortDate:t.slice(0,8)}},RU=({credentials:e,signingDate:t=new Date,signingRegion:n,signingService:r,uriEscapePath:o=!0})=>{const{accessKeyId:i,secretAccessKey:a,sessionToken:s}=e,{longDate:l,shortDate:u}=_U(t),c=AU(u,n,r);return{accessKeyId:i,credentialScope:c,longDate:l,secretAccessKey:a,sessionToken:s,shortDate:u,signingRegion:n,signingService:r,uriEscapePath:o}},Bc=(e,t)=>{const n=new hu(e??void 0);return n.update(t),n.digestSync()},J0=(e,t)=>{const n=Bc(e,t);return D4(n)},PU=e=>Object.entries(e).map(([t,n])=>({key:t.toLowerCase(),value:(n==null?void 0:n.trim().replace(/\s+/g," "))??""})).sort((t,n)=>t.key`${t.key}:${t.value} `).join(""),kU=e=>Array.from(e).sort(([t,n],[r,o])=>t===r?n`${bx(t)}=${bx(n)}`).join("&"),bx=e=>encodeURIComponent(e).replace(/[!'()*]/g,NU),NU=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,OU=(e,t=!0)=>e?t?encodeURIComponent(e).replace(/%2F/g,"/"):e:"/",DU=e=>e==null?IU:MU(e)?J0(null,e):TU,MU=e=>typeof e=="string"||ArrayBuffer.isView(e)||FU(e),FU=e=>typeof ArrayBuffer=="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",LU=({body:e,headers:t,method:n,url:r},o=!0)=>[n,OU(r.pathname,o),kU(r.searchParams),PU(t),CP(t),DU(e)].join(` `),UU=(e,t,n,r)=>{const o=`${xU}${e}`,i=Bc(o,t),a=Bc(i,n),s=Bc(a,r);return Bc(s,xP)},$U=(e,t,n)=>[IP,e,t,n].join(` `),jU=(e,{credentialScope:t,longDate:n,secretAccessKey:r,shortDate:o,signingRegion:i,signingService:a,uriEscapePath:s})=>{const l=LU(e,s),u=J0(null,l),c=$U(n,t,u);return J0(UU(r,o,i,a),c)},TP=(e,t)=>{const n=RU(t),{accessKeyId:r,credentialScope:o,longDate:i,sessionToken:a}=n,s={...e.headers};s[EU]=e.url.host,s[wU]=i,a&&(s[CU]=a);const l={...e,headers:s},u=jU(l,n),c=`Credential=${r}/${o}`,d=`SignedHeaders=${CP(s)}`,f=`Signature=${u}`;return s[bU]=`${IP} ${c}, ${d}, ${f}`,l},AP=e=>new Date(Date.now()+e),BU=5*60*1e3,zU=(e,t)=>Math.abs(AP(t).getTime()-e)>=BU,HU=(e,t)=>zU(e,t)?e-Date.now():t,WU=({credentials:e,region:t,service:n,uriEscapePath:r=!0})=>{let o;return(i,a)=>async function(l){o=o??0;const u={credentials:typeof e=="function"?await e({forceRefresh:!!(a!=null&&a.isCredentialsExpired)}):e,signingDate:AP(o),signingRegion:t,signingService:n,uriEscapePath:r},c=await TP(l,u),d=await i(c),f=VU(d);return f&&(o=HU(Date.parse(f),o)),d}},VU=({headers:e}={})=>(e==null?void 0:e.date)??(e==null?void 0:e.Date)??(e==null?void 0:e["x-amz-date"]),KU=e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=new Uint8Array(e);ob().getRandomValues(r);for(const o of r)n.push(t[o%t.length]);return n.join("")};class GU extends Error{constructor(){super(...arguments),this.nonRetryable=!0}}const qU=(e,t,n=pP,r)=>e4(e,t,hP(n));function QU(e){return(e.match(/.{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("")}function YU(e){return e.split("").map(t=>t.charCodeAt(0).toString(16).padStart(2,"0")).join("")}const XU=e=>{let t;return async(...n)=>t||(t=new Promise((r,o)=>{e(...n).then(i=>{r(i)}).catch(i=>{o(i)}).finally(()=>{t=void 0})}),t)};function Ex({expiresAt:e,clockDrift:t,tolerance:n=5e3}){return Date.now()+t+n>e}const JU=async()=>{const{userAgentData:e}=navigator;if(!e)return navigator.userAgent;const{platform:t="",platformVersion:n="",model:r="",architecture:o="",fullVersionList:i=[]}=await e.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]),a=i.map(l=>`${l.brand}/${l.version}`).join(";");return[t,n,o,r,t,a].filter(l=>l).join(" ")||navigator.userAgent};class om extends wn{get response(){return this._response?ZU(this._response):void 0}constructor(t){super(t),this.constructor=om,Object.setPrototypeOf(this,om.prototype),t.response&&(this._response=t.response)}}const ZU=e=>({...e,headers:{...e.headers}});function e6(e){return Array.from(e,t=>String.fromCodePoint(t)).join("")}const Ls={convert(e,t={urlSafe:!1,skipPadding:!1}){const n=typeof e=="string"?e:e6(e);let r=XF()(n);return t.urlSafe&&(r=r.replace(/\+/g,"-").replace(/\//g,"_")),t.skipPadding&&(r=r.replace(/=/g,"")),r}};function t6(){return ob().getRandomValues(new Uint32Array(1))[0]}function n6(e){const{words:t}=e,{sigBytes:n}=e,r=[];for(let o=0;o>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((i&15).toString(16))}return r.join("")}class bb{constructor(t,n){this.words=[];let r=t;r=this.words=r||[],n!==void 0?this.sigBytes=n:this.sigBytes=r.length*4}random(t){const n=[];for(let r=0;r({Name:t,Value:n}))}function r6(e){const t={};return e==null||e.forEach(n=>{n.Name&&(t[n.Name]=n.Value)}),t}var Cx;(function(e){e.ConcurrentModificationException="ConcurrentModificationException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException"})(Cx||(Cx={}));var xx;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(xx||(xx={}));var Ix;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UsernameExistsException="UsernameExistsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Ix||(Ix={}));var Tx;(function(e){e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyFailedAttemptsException="TooManyFailedAttemptsException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Tx||(Tx={}));var Ax;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyFailedAttemptsException="TooManyFailedAttemptsException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(Ax||(Ax={}));var _x;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(_x||(_x={}));var Rx;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Rx||(Rx={}));var Px;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Px||(Px={}));var kx;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(kx||(kx={}));var Nx;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Nx||(Nx={}));var Ox;(function(e){e.ExternalServiceException="ExternalServiceException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceConflictException="ResourceConflictException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException"})(Ox||(Ox={}));var Dx;(function(e){e.ExternalServiceException="ExternalServiceException",e.InternalErrorException="InternalErrorException",e.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceConflictException="ResourceConflictException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException"})(Dx||(Dx={}));var Mx;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Mx||(Mx={}));var Fx;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException"})(Fx||(Fx={}));var im;(function(e){e.PasswordResetRequiredException="PasswordResetRequiredException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(im||(im={}));var Lx;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotFoundException="UserNotFoundException"})(Lx||(Lx={}));var Ux;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.MFAMethodNotFoundException="MFAMethodNotFoundException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Ux||(Ux={}));var $x;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})($x||($x={}));var eS;(function(e){e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidPasswordException="InvalidPasswordException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.NotAuthorizedException="NotAuthorizedException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UsernameExistsException="UsernameExistsException"})(eS||(eS={}));var jx;(function(e){e.AliasExistsException="AliasExistsException",e.CodeDeliveryFailureException="CodeDeliveryFailureException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",e.InvalidLambdaResponseException="InvalidLambdaResponseException",e.InvalidParameterException="InvalidParameterException",e.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",e.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UnexpectedLambdaException="UnexpectedLambdaException",e.UserLambdaValidationException="UserLambdaValidationException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(jx||(jx={}));var Bx;(function(e){e.CodeMismatchException="CodeMismatchException",e.EnableSoftwareTokenMFAException="EnableSoftwareTokenMFAException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Bx||(Bx={}));var zx;(function(e){e.AliasExistsException="AliasExistsException",e.CodeMismatchException="CodeMismatchException",e.ExpiredCodeException="ExpiredCodeException",e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.LimitExceededException="LimitExceededException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(zx||(zx={}));var Hx;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Hx||(Hx={}));var Wx;(function(e){e.ForbiddenException="ForbiddenException",e.InternalErrorException="InternalErrorException",e.InvalidParameterException="InvalidParameterException",e.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",e.NotAuthorizedException="NotAuthorizedException",e.PasswordResetRequiredException="PasswordResetRequiredException",e.ResourceNotFoundException="ResourceNotFoundException",e.TooManyRequestsException="TooManyRequestsException",e.UserNotConfirmedException="UserNotConfirmedException",e.UserNotFoundException="UserNotFoundException"})(Wx||(Wx={}));const ig="UserUnAuthenticatedException",o6="UserAlreadyAuthenticatedException",i6="DeviceMetadataNotFoundException",RP="AutoSignInException",a6="InvalidRedirectException",s6="InvalidAppSchemeException",l6="InvalidPreferredRedirectUrlException",u6=new se({name:a6,message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new se({name:s6,message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});new se({name:l6,message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."});const c6="InvalidOriginException",d6=new se({name:c6,message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."}),f6="OAuthSignOutException",p6="TokenRefreshException",h6="UnexpectedSignInInterruptionException";function yf(e){if(!e||!e.accessToken)throw new se({name:ig,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function m6(e){if(!e||!e.idToken)throw new se({name:ig,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}const g6=new se({name:p6,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. E.g { responseType: 'code' }`}),v6=new se({name:ig,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function PP(e){if(b6(e))throw g6;if(!S6(e))throw v6}function kP(e){if(!e||!e.deviceKey||!e.deviceGroupKey||!e.randomPassword)throw new se({name:i6,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}const y6={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function NP(e){return(e==null?void 0:e.accessToken)||(e==null?void 0:e.idToken)}function S6(e){return NP(e)&&(e==null?void 0:e.refreshToken)}function b6(e){return NP(e)&&!(e!=null&&e.refreshToken)}const E6=async e=>{var s,l;const t=(s=e.getConfig().Auth)==null?void 0:s.Cognito;Re(t);const n=await e.Auth.getTokens({forceRefresh:!1});yf(n);const{"cognito:username":r,sub:o}=((l=n.idToken)==null?void 0:l.payload)??{},i={username:r,userId:o},a=w6(n);return a&&(i.signInDetails=a),i};function w6(e){return e==null?void 0:e.signInDetails}const Sf=async()=>E6($e),ot=(e,t)=>ju({category:fr.Auth,action:e,...t}),Dn=e=>(t,n)=>{const r=C6(e),o=JSON.stringify(t);return x6(n,r,o)},C6=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),x6=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"});function pr(e){if(!e||e.name==="Error"||e instanceof TypeError)throw new se({name:Mi.Unknown,message:"An unknown error has occurred.",underlyingError:e})}const br=()=>async e=>{if(e.statusCode>=300){const t=await Qa(e);throw pr(t),new se({name:t.name,message:t.message,metadata:t.$metadata})}return mf(e)},I6=()=>(e,t)=>async function(r){return r.headers["cache-control"]="no-store",e(r)},Mn=gf(fP,[I6]),OP="cognito-idp",Fn={service:OP,retryDecider:yb(Qa),computeDelay:vb,userAgentValue:ju(),cache:"no-store"},Bu=e=>hn(Mn,Dn("InitiateAuth"),br(),{...Fn,...e}),hr=e=>hn(Mn,Dn("RespondToAuthChallenge"),br(),{...Fn,...e}),T6=e=>hn(Mn,Dn("VerifySoftwareToken"),br(),{...Fn,...e}),A6=e=>hn(Mn,Dn("AssociateSoftwareToken"),br(),{...Fn,...e}),_6=({region:e})=>({url:new Hr(`https://${OP}.${e}.${cP(e)}`)}),ze=({endpointOverride:e})=>t=>e?{url:new Hr(e)}:_6(t);function Zt({username:e,userPoolId:t,userPoolClientId:n}){if(typeof window>"u")return;const r=window.AmazonCognitoAdvancedSecurityData;if(typeof r>"u")return;const o=r.getData(e,t,n);return o?{EncodedData:o}:{}}const R6=async({tokens:e,authConfig:t,username:n})=>{var E;Re(t==null?void 0:t.Cognito);const{userPoolId:r,userPoolClientId:o,userPoolEndpoint:i}=t.Cognito,a=Be(r);PP(e);const s=e.refreshToken,l={REFRESH_TOKEN:s};(E=e.deviceMetadata)!=null&&E.deviceKey&&(l.DEVICE_KEY=e.deviceMetadata.deviceKey);const u=Zt({username:n,userPoolId:r,userPoolClientId:o}),c=Bu({endpointResolver:ze({endpointOverride:i})}),{AuthenticationResult:d}=await c({region:a},{ClientId:o,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:l,UserContextData:u}),f=Fi((d==null?void 0:d.AccessToken)??""),p=d!=null&&d.IdToken?Fi(d.IdToken):void 0,{iat:h}=f.payload;if(!h)throw new se({name:"iatNotFoundException",message:"iat not found in access token"});const m=h*1e3-new Date().getTime();return{accessToken:f,idToken:p,clockDrift:m,refreshToken:s,username:n}},P6=XU(R6),k6={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var am;(function(e){e.InvalidAuthTokens="InvalidAuthTokens"})(am||(am={}));const N6={[am.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},O6=Jm(N6),Vx="CognitoIdentityServiceProvider";class D6{getKeyValueStorage(){if(!this.keyValueStorage)throw new se({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(t){this.keyValueStorage=t}setAuthConfig(t){this.authConfig=t}async loadTokens(){try{const t=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(t.accessToken);if(!n)throw new se({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});const r=Fi(n),o=await this.getKeyValueStorage().getItem(t.idToken),i=o?Fi(o):void 0,a=await this.getKeyValueStorage().getItem(t.refreshToken)??void 0,s=await this.getKeyValueStorage().getItem(t.clockDrift)??"0",l=Number.parseInt(s),u=await this.getKeyValueStorage().getItem(t.signInDetails),c={accessToken:r,idToken:i,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:l,username:await this.getLastAuthUser()};return u&&(c.signInDetails=JSON.parse(u)),c}catch{return null}}async storeTokens(t){O6(t!==void 0,am.InvalidAuthTokens);const n=t.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),n);const r=await this.getAuthKeys();await this.getKeyValueStorage().setItem(r.accessToken,t.accessToken.toString()),t.idToken?await this.getKeyValueStorage().setItem(r.idToken,t.idToken.toString()):await this.getKeyValueStorage().removeItem(r.idToken),t.refreshToken?await this.getKeyValueStorage().setItem(r.refreshToken,t.refreshToken):await this.getKeyValueStorage().removeItem(r.refreshToken),t.deviceMetadata&&(t.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(r.deviceKey,t.deviceMetadata.deviceKey),t.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(r.deviceGroupKey,t.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(r.randomPasswordKey,t.deviceMetadata.randomPassword)),t.signInDetails?await this.getKeyValueStorage().setItem(r.signInDetails,JSON.stringify(t.signInDetails)):await this.getKeyValueStorage().removeItem(r.signInDetails),await this.getKeyValueStorage().setItem(r.clockDrift,`${t.clockDrift}`)}async clearTokens(){const t=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(t.accessToken),this.getKeyValueStorage().removeItem(t.idToken),this.getKeyValueStorage().removeItem(t.clockDrift),this.getKeyValueStorage().removeItem(t.refreshToken),this.getKeyValueStorage().removeItem(t.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(t.oauthMetadata)])}async getDeviceMetadata(t){const n=await this.getAuthKeys(t),r=await this.getKeyValueStorage().getItem(n.deviceKey),o=await this.getKeyValueStorage().getItem(n.deviceGroupKey),i=await this.getKeyValueStorage().getItem(n.randomPasswordKey);return i&&o&&r?{deviceKey:r,deviceGroupKey:o,randomPassword:i}:null}async clearDeviceMetadata(t){const n=await this.getAuthKeys(t);await Promise.all([this.getKeyValueStorage().removeItem(n.deviceKey),this.getKeyValueStorage().removeItem(n.deviceGroupKey),this.getKeyValueStorage().removeItem(n.randomPasswordKey)])}async getAuthKeys(t){var r;Re((r=this.authConfig)==null?void 0:r.Cognito);const n=t??await this.getLastAuthUser();return M6(Vx,`${this.authConfig.Cognito.userPoolClientId}.${n}`)}getLastAuthUserKey(){var n;Re((n=this.authConfig)==null?void 0:n.Cognito);const t=this.authConfig.Cognito.userPoolClientId;return`${Vx}.${t}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(t){const{oauthMetadata:n}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n,JSON.stringify(t))}async getOAuthMetadata(){const{oauthMetadata:t}=await this.getAuthKeys(),n=await this.getKeyValueStorage().getItem(t);return n&&JSON.parse(n)}}const M6=(e,t)=>Eb(k6)(`${e}`,t);function Eb(e){const t=Object.values({...e});return(n,r)=>t.reduce((o,i)=>({...o,[i]:`${n}.${r}.${i}`}),{})}const Kx="amplify-signin-with-hostedUI",Po="CognitoIdentityServiceProvider";class DP{constructor(t){this.keyValueStorage=t}async clearOAuthInflightData(){Re(this.cognitoConfig);const t=ko(Po,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(t.inflightOAuth),this.keyValueStorage.removeItem(t.oauthPKCE),this.keyValueStorage.removeItem(t.oauthState)])}async clearOAuthData(){Re(this.cognitoConfig);const t=ko(Po,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(Kx),this.keyValueStorage.removeItem(t.oauthSignIn)}loadOAuthState(){Re(this.cognitoConfig);const t=ko(Po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthState)}storeOAuthState(t){Re(this.cognitoConfig);const n=ko(Po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthState,t)}loadPKCE(){Re(this.cognitoConfig);const t=ko(Po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(t.oauthPKCE)}storePKCE(t){Re(this.cognitoConfig);const n=ko(Po,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(n.oauthPKCE,t)}setAuthConfig(t){this.cognitoConfig=t}async loadOAuthInFlight(){Re(this.cognitoConfig);const t=ko(Po,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(t.inflightOAuth)==="true"}async storeOAuthInFlight(t){Re(this.cognitoConfig);const n=ko(Po,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.inflightOAuth,`${t}`)}async loadOAuthSignIn(){var i;Re(this.cognitoConfig);const t=ko(Po,this.cognitoConfig.userPoolClientId),n=await this.keyValueStorage.getItem(Kx),[r,o]=((i=await this.keyValueStorage.getItem(t.oauthSignIn))==null?void 0:i.split(","))??[];return{isOAuthSignIn:r==="true"||n==="true",preferPrivateSession:o==="true"}}async storeOAuthSignIn(t,n=!1){Re(this.cognitoConfig);const r=ko(Po,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(r.oauthSignIn,`${t},${n}`)}}const ko=(e,t)=>Eb(y6)(e,t),Hn=new DP(vf),tS=[],F6=e=>{tS.push(e)},MP=()=>{var e;for(;tS.length;)(e=tS.pop())==null||e()};class L6{constructor(){this.waitForInflightOAuth=rg()?async()=>{if(await Hn.loadOAuthInFlight())return this.inflightPromise?this.inflightPromise:(this.inflightPromise=new Promise((t,n)=>{F6(t)}),this.inflightPromise)}:async()=>{}}setAuthConfig(t){Hn.setAuthConfig(t.Cognito),this.authConfig=t}setTokenRefresher(t){this.tokenRefresher=t}setAuthTokenStore(t){this.tokenStore=t}getTokenStore(){if(!this.tokenStore)throw new se({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new se({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(t){var a,s,l,u,c;let n;try{Re((a=this.authConfig)==null?void 0:a.Cognito)}catch{return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,n=await this.getTokenStore().loadTokens();const r=await this.getTokenStore().getLastAuthUser();if(n===null)return null;const o=!!(n!=null&&n.idToken)&&Ex({expiresAt:(((l=(s=n.idToken)==null?void 0:s.payload)==null?void 0:l.exp)??0)*1e3,clockDrift:n.clockDrift??0}),i=Ex({expiresAt:(((c=(u=n.accessToken)==null?void 0:u.payload)==null?void 0:c.exp)??0)*1e3,clockDrift:n.clockDrift??0});return(t!=null&&t.forceRefresh||o||i)&&(n=await this.refreshTokens({tokens:n,username:r}),n===null)?null:{accessToken:n==null?void 0:n.accessToken,idToken:n==null?void 0:n.idToken,signInDetails:n==null?void 0:n.signInDetails}}async refreshTokens({tokens:t,username:n}){try{const{signInDetails:r}=t,o=await this.getTokenRefresher()({tokens:t,authConfig:this.authConfig,username:n});return o.signInDetails=r,await this.setTokens({tokens:o}),dr.dispatch("auth",{event:"tokenRefresh"},"Auth",wo),o}catch(r){return this.handleErrors(r)}}handleErrors(t){if(pr(t),t.name!==Mi.NetworkError&&this.clearTokens(),dr.dispatch("auth",{event:"tokenRefresh_failure",data:{error:t}},"Auth",wo),t.name.startsWith("NotAuthorizedException"))return null;throw t}async setTokens({tokens:t}){return this.getTokenStore().storeTokens(t)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(t){return this.getTokenStore().getDeviceMetadata(t)}clearDeviceMetadata(t){return this.getTokenStore().clearDeviceMetadata(t)}setOAuthMetadata(t){return this.getTokenStore().setOAuthMetadata(t)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class U6{constructor(){this.authTokenStore=new D6,this.authTokenStore.setKeyValueStorage(vf),this.tokenOrchestrator=new L6,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(P6)}getTokens({forceRefresh:t}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:t})}setKeyValueStorage(t){this.authTokenStore.setKeyValueStorage(t)}setAuthConfig(t){this.authTokenStore.setAuthConfig(t),this.tokenOrchestrator.setAuthConfig(t)}}const zc=new U6,{tokenOrchestrator:Pn}=zc;async function Qi(e){if(e.AccessToken){const t=Fi(e.AccessToken),n=(t.payload.iat||0)*1e3,r=new Date().getTime(),o=n>0?n-r:0;let i,a,s;e.RefreshToken&&(a=e.RefreshToken),e.IdToken&&(i=Fi(e.IdToken)),e!=null&&e.NewDeviceMetadata&&(s=e.NewDeviceMetadata);const l={accessToken:t,idToken:i,refreshToken:a,clockDrift:o,deviceMetadata:s,username:e.username};e!=null&&e.signInDetails&&(l.signInDetails=e.signInDetails),await Pn.setTokens({tokens:l})}else throw new wn({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}const $6="Unable to get user session following successful sign-in.",Ya=async()=>{try{dr.dispatch("auth",{event:"signedIn",data:await Sf()},"Auth",wo)}catch(e){throw e.name===ig?new se({name:h6,message:$6,recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."}):e}};function FP(){return{active:!1}}const j6=(e,t)=>{switch(t.type){case"SET_USERNAME":return{...e,username:t.value};case"SET_SESSION":return{...e,session:t.value};case"START":return{...e,active:!0};case"RESET":return FP();default:return e}},B6=e=>{let t=e(FP(),{type:"RESET"});return{getState:()=>t,dispatch:n=>{t=e(t,n)}}},wa=B6(j6),z6=3*60*1e3,mp="CognitoSignInState",xi={username:`${mp}.username`,challengeName:`${mp}.challengeName`,signInSession:`${mp}.signInSession`,expiry:`${mp}.expiry`},H6=(e,t)=>{switch(t.type){case"SET_SIGN_IN_SESSION":return gp({signInSession:t.value}),{...e,signInSession:t.value};case"SET_SIGN_IN_STATE":return gp(t.value),{...t.value};case"SET_CHALLENGE_NAME":return gp({challengeName:t.value}),{...e,challengeName:t.value};case"SET_USERNAME":return gp({username:t.value}),{...e,username:t.value};case"SET_INITIAL_STATE":return V6();case"RESET_STATE":return LP(),wb();default:return e}},W6=e=>{const t=Number(e),n=Date.now();return t<=n},Co=()=>{Qo.dispatch({type:"RESET_STATE"})},LP=()=>{for(const e of Object.values(xi))Ci.removeItem(e)},wb=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),V6=()=>{const e=Ci.getItem(xi.expiry);if(!e||W6(e))return LP(),wb();const t=Ci.getItem(xi.username)??void 0,n=Ci.getItem(xi.challengeName)??void 0,r=Ci.getItem(xi.signInSession)??void 0;return{username:t,challengeName:n,signInSession:r}},K6=e=>{let t=e(wb(),{type:"SET_INITIAL_STATE"});return{getState:()=>t,dispatch:n=>{t=e(t,n)}}},Qo=K6(H6);function Ys(e){Qo.dispatch({type:"SET_SIGN_IN_STATE",value:e})}const gp=({challengeName:e,signInSession:t,username:n})=>{n&&Ci.setItem(xi.username,n),e&&Ci.setItem(xi.challengeName,e),t&&(Ci.setItem(xi.signInSession,t),Ci.setItem(xi.expiry,String(Date.now()+z6)))};class _i extends wn{constructor(t){super(t),this.constructor=_i,Object.setPrototypeOf(this,_i.prototype)}}var Mt;(function(e){e.PasskeyNotSupported="PasskeyNotSupported",e.PasskeyAlreadyExists="PasskeyAlreadyExists",e.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",e.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",e.RelyingPartyMismatch="RelyingPartyMismatch",e.PasskeyRegistrationFailed="PasskeyRegistrationFailed",e.PasskeyRetrievalFailed="PasskeyRetrievalFailed",e.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",e.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",e.PasskeyOperationAborted="PasskeyOperationAborted"})(Mt||(Mt={}));const Gx="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.",uy="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",qx="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",sm={[Mt.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:Gx},[Mt.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:qx},[Mt.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:qx},[Mt.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:Gx},[Mt.PasskeyRetrievalFailed]:{message:"Device failed to retrieve passkey.",recoverySuggestion:"Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP."},[Mt.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[Mt.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:uy},[Mt.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:uy},[Mt.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:uy},[Mt.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},Cb=Jm(sm,_i),G6=e=>{if(e instanceof _i)return e;if(e instanceof Error&&e.name==="NotAllowedError"){const{message:t,recoverySuggestion:n}=sm[Mt.PasskeyAuthenticationCanceled];return new _i({name:Mt.PasskeyAuthenticationCanceled,message:t,recoverySuggestion:n,underlyingError:e})}return q6(e)},q6=e=>{if(e instanceof Error){if(e.name==="AbortError"){const{message:t,recoverySuggestion:n}=sm[Mt.PasskeyOperationAborted];return new _i({name:Mt.PasskeyOperationAborted,message:t,recoverySuggestion:n,underlyingError:e})}if(e.name==="SecurityError"){const{message:t,recoverySuggestion:n}=sm[Mt.RelyingPartyMismatch];return new _i({name:Mt.RelyingPartyMismatch,message:t,recoverySuggestion:n,underlyingError:e})}}return new _i({name:Mi.Unknown,message:"An unknown error has occurred.",underlyingError:e})},Q6=()=>rg()&&window.isSecureContext&&"credentials"in navigator&&typeof window.PublicKeyCredential=="function",yc=e=>Ls.convert(new Uint8Array(e),{urlSafe:!0,skipPadding:!0}),Qx=e=>Uint8Array.from(ib.convert(e,{urlSafe:!0}),t=>t.charCodeAt(0)).buffer,Y6=e=>{const t=Qx(e.challenge),n=(e.allowCredentials||[]).map(r=>({...r,id:Qx(r.id)}));return{...e,challenge:t,allowCredentials:n}},X6=e=>{const t={clientDataJSON:yc(e.response.clientDataJSON),authenticatorData:yc(e.response.authenticatorData),signature:yc(e.response.signature)};e.response.userHandle&&(t.userHandle=yc(e.response.userHandle));const n={id:e.id,rawId:yc(e.rawId),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:t};return e.authenticatorAttachment&&(n.authenticatorAttachment=e.authenticatorAttachment),n};function J6(e){Cb(e&&e instanceof PublicKeyCredential&&e.response instanceof AuthenticatorAssertionResponse,Mt.PasskeyRetrievalFailed)}const Z6=async e=>{try{const t=Q6();Cb(t,Mt.PasskeyNotSupported);const n=Y6(e),r=await navigator.credentials.get({publicKey:n});return J6(r),X6(r)}catch(t){throw G6(t)}},e$=e=>hn(Mn,Dn("ConfirmDevice"),br(),{...Fn,...e}),uh={convert(e){return new TextEncoder().encode(e)}};function J(e,t){e!=null&&this.fromString(e,t)}function Rn(){return new J(null,null)}let Ma;const t$=0xdeadbeefcafe,Yx=(t$&16777215)===15715070;function n$(e,t,n,r,o,i){for(;--i>=0;){const a=t*this[e++]+n[r]+o;o=Math.floor(a/67108864),n[r++]=a&67108863}return o}function r$(e,t,n,r,o,i){const a=t&32767,s=t>>15;for(;--i>=0;){let l=this[e]&32767;const u=this[e++]>>15,c=s*l+u*a;l=a*l+((c&32767)<<15)+n[r]+(o&1073741823),o=(l>>>30)+(c>>>15)+s*u+(o>>>30),n[r++]=l&1073741823}return o}function o$(e,t,n,r,o,i){const a=t&16383,s=t>>14;for(;--i>=0;){let l=this[e]&16383;const u=this[e++]>>14,c=s*l+u*a;l=a*l+((c&16383)<<14)+n[r]+o,o=(l>>28)+(c>>14)+s*u,n[r++]=l&268435455}return o}const Xx=typeof navigator<"u";Xx&&Yx&&navigator.appName==="Microsoft Internet Explorer"?(J.prototype.am=r$,Ma=30):Xx&&Yx&&navigator.appName!=="Netscape"?(J.prototype.am=n$,Ma=26):(J.prototype.am=o$,Ma=28);J.prototype.DB=Ma;J.prototype.DM=(1<=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s}function l$(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0}function Ib(e){const t=Rn();return t.fromInt(e),t}function u$(e,t){let n;if(t===16)n=4;else if(t===8)n=3;else if(t===2)n=1;else if(t===32)n=5;else if(t===4)n=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let r=e.length,o=!1,i=0;for(;--r>=0;){const a=a$(e,r);if(a<0){e.charAt(r)==="-"&&(o=!0);continue}o=!1,i===0?this[this.t++]=a:i+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-i):this[this.t-1]|=a<=this.DB&&(i-=this.DB)}this.clamp(),o&&J.ZERO.subTo(this,this)}function c$(){const e=this.s&this.DM;for(;this.t>0&&this[this.t-1]==e;)--this.t}function d$(e){if(this.s<0)return"-"+this.negate().toString(e);let t;if(e==16)t=4;else if(e===8)t=3;else if(e===2)t=1;else if(e===32)t=5;else if(e===4)t=2;else throw new Error("Only radix 2, 4, 8, 16, 32 are supported");const n=(1<0)for(s>s)>0&&(o=!0,i=Jx(r));a>=0;)s>(s+=this.DB-t)):(r=this[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=Jx(r));return o?i:"0"}function f$(){const e=Rn();return J.ZERO.subTo(this,e),e}function p$(){return this.s<0?this.negate():this}function h$(e){let t=this.s-e.s;if(t!=0)return t;let n=this.t;if(t=n-e.t,t!=0)return this.s<0?-t:t;for(;--n>=0;)if((t=this[n]-e[n])!=0)return t;return 0}function Tb(e){let t=1,n;return(n=e>>>16)!==0&&(e=n,t+=16),(n=e>>8)!==0&&(e=n,t+=8),(n=e>>4)!==0&&(e=n,t+=4),(n=e>>2)!==0&&(e=n,t+=2),(n=e>>1)!==0&&(e=n,t+=1),t}function m$(){return this.t<=0?0:this.DB*(this.t-1)+Tb(this[this.t-1]^this.s&this.DM)}function g$(e,t){let n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s}function v$(e,t){for(let n=e;n=0;--s)t[s+i+1]=this[s]>>r|a,a=(this[s]&o)<=0;--s)t[s]=0;t[i]=a,t.t=this.t+i+1,t.s=this.s,t.clamp()}function S$(e,t){t.s=this.s;const n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}const r=e%this.DB,o=this.DB-r,i=(1<>r;for(let a=n+1;a>r;r>0&&(t[this.t-n-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()}function E$(e,t){const n=this.abs(),r=e.abs();let o=n.t;for(t.t=o+r.t;--o>=0;)t[o]=0;for(o=0;o=0;)e[n]=0;for(n=0;n=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()}function C$(e,t,n){const r=e.abs();if(r.t<=0)return;const o=this.abs();if(o.t0?(r.lShiftTo(l,i),o.lShiftTo(l,n)):(r.copyTo(i),o.copyTo(n));const u=i.t,c=i[u-1];if(c===0)return;const d=c*(1<1?i[u-2]>>this.F2:0),f=this.FV/d,p=(1<=0&&(n[n.t++]=1,n.subTo(g,n)),J.ONE.dlShiftTo(u,g),g.subTo(i,i);i.t=0;){let y=n[--m]===c?this.DM:Math.floor(n[m]*f+(n[m-1]+h)*p);if((n[m]+=i.am(0,y,n,E,0,u))0&&n.rShiftTo(l,n),a<0&&J.ZERO.subTo(n,n)}function x$(e){const t=Rn();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(J.ZERO)>0&&e.subTo(t,t),t}function I$(){if(this.t<1)return 0;const e=this[0];if(!(e&1))return 0;let t=e&3;return t=t*(2-(e&15)*t)&15,t=t*(2-(e&255)*t)&255,t=t*(2-((e&65535)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t}function T$(e){return this.compareTo(e)===0}function A$(e,t){let n=0,r=0;const o=Math.min(e.t,this.t);for(;n>=this.DB;if(e.t>=this.DB;r+=this.s}else{for(r+=this.s;n>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()}function _$(e){const t=Rn();return this.addTo(e,t),t}function R$(e){const t=Rn();return this.subTo(e,t),t}function P$(e){const t=Rn();return this.multiplyTo(e,t),t}function k$(e){const t=Rn();return this.divRemTo(e,t,null),t}function Hu(e){this.m=e,this.mp=e.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(t,t),t}function O$(e){const t=Rn();return e.copyTo(t),this.reduce(t),t}function D$(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(let t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)}function M$(e,t){e.squareTo(t),this.reduce(t)}function F$(e,t,n){e.multiplyTo(t,n),this.reduce(n)}Hu.prototype.convert=N$;Hu.prototype.revert=O$;Hu.prototype.reduce=D$;Hu.prototype.mulTo=F$;Hu.prototype.sqrTo=M$;function L$(e,t,n){let r=e.bitLength(),o,i=Ib(1);const a=new Hu(t);if(r<=0)return i;r<18?o=1:r<48?o=3:r<144?o=4:r<768?o=5:o=6;const s=[];let l=3;const u=o-1,c=(1<1){const g=Rn();for(a.sqrTo(s[1],g);l<=c;)s[l]=Rn(),a.mulTo(g,s[l-2],s[l]),l+=2}let d=e.t-1,f,p=!0,h=Rn(),m;for(r=Tb(e[d])-1;d>=0;){for(r>=u?f=e[d]>>r-u&c:(f=(e[d]&(1<0&&(f|=e[d-1]>>this.DB+r-u)),l=o;!(f&1);)f>>=1,--l;if((r-=l)<0&&(r+=this.DB,--d),p)s[f].copyTo(i),p=!1;else{for(;l>1;)a.sqrTo(i,h),a.sqrTo(h,i),l-=2;l>0?a.sqrTo(i,h):(m=i,i=h,h=m),a.mulTo(h,s[f],i)}for(;d>=0&&!(e[d]&1<new Promise((s,l)=>{t.modPow(r,i,(u,c)=>{if(u){l(u);return}o.subtract(n.multiply(c)).modPow(e.add(a.multiply(r)),i,(d,f)=>{if(d){l(d);return}s(f.mod(i))})})}),$$="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",UP={},nS={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();t.length===1&&(t=`0${t}`),UP[e]=t,nS[t]=e}const mu=e=>{if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n{let t="";for(let n=0;n{const t=new hu;t.update(e);const n=t.digestSync(),r=Ab(n);return new Array(64-r.length).join("0")+r},ch=e=>rS(mu(e)),j$=/^[89a-f]/i,di=e=>{if(!(e instanceof J))throw new Error("Not a BigInteger");const t=e.compareTo(J.ZERO)<0;let n=e.abs().toString(16);if(n=n.length%2!==0?`0${n}`:n,n=j$.test(n)?`00${n}`:n,t){const r=n.split("").map(i=>{const a=~parseInt(i,16)&15;return"0123456789ABCDEF".charAt(a)}).join("");n=new J(r,16).add(J.ONE).toString(16),n.toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},B$=({A:e,B:t})=>{const n=new J(ch(di(e)+di(t)),16);if(n.equals(J.ZERO))throw new Error("U cannot be zero.");return n},z$=(e,t,n)=>{const r=new hu(t);r.update(e);const o=r.digestSync(),i=new hu(o);return i.update(n),i.digestSync().slice(0,16)},_b=e=>{const t=new bb().random(e).toString();return mu(t)},H$=()=>Ls.convert(_b(40));class W${constructor({userPoolName:t,a:n,g:r,A:o,N:i}){this.encoder=uh,this.userPoolName=t,this.a=n,this.g=r,this.A=o,this.N=i,this.k=new J(ch(`${di(i)}${di(r)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new se({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new se({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new se({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(t,n){this.randomPassword=H$();const r=`${t}${n}:${this.randomPassword}`,o=rS(r),i=Ab(_b(16));return this.saltToHashDevices=di(new J(i,16)),new Promise((a,s)=>{this.g.modPow(new J(ch(this.saltToHashDevices+o),16),this.N,(l,u)=>{if(l){s(l);return}this.verifierDevices=di(u),a()})})}async getPasswordAuthenticationKey({username:t,password:n,serverBValue:r,salt:o}){if(r.mod(this.N).equals(J.ZERO))throw new Error("B cannot be zero.");const i=B$({A:this.A,B:r}),a=`${this.userPoolName}${t}:${n}`,s=rS(a),l=new J(ch(di(o)+s),16),u=await U$({a:this.a,g:this.g,k:this.k,x:l,B:r,N:this.N,U:i}),c=this.encoder.convert("Caldera Derived Key"),d=this.encoder.convert(""),f=new Uint8Array(c.byteLength+d.byteLength);return f.set(c,0),f.set(d,c.byteLength),z$(mu(di(u)),mu(di(i)),f)}}const V$=async({a:e,g:t,N:n})=>new Promise((r,o)=>{t.modPow(e,n,(i,a)=>{if(i){o(i);return}if(a.mod(n).equals(J.ZERO)){o(new Error("Illegal parameter. A mod N cannot be 0."));return}r(a)})}),bf=async e=>{const t=new J($$,16),n=new J("2",16),r=K$(),o=await V$({a:r,g:n,N:t});return new W$({userPoolName:e,a:r,g:n,A:o,N:t})},K$=()=>{const e=Ab(_b(128));return new J(e,16)};async function Xs({userPoolId:e,userPoolEndpoint:t,newDeviceMetadata:n,accessToken:r}){if(!n)return;const o=e.split("_")[1]||"",i=await bf(o),a=n==null?void 0:n.DeviceKey,s=n==null?void 0:n.DeviceGroupKey;try{await i.generateHashDevice(s??"",a??"")}catch{return}const l={Salt:Ls.convert(mu(i.getSaltToHashDevices())),PasswordVerifier:Ls.convert(mu(i.getVerifierDevices()))},u=i.getRandomPassword();try{return await e$({endpointResolver:ze({endpointOverride:t})})({region:Be(e)},{AccessToken:r,DeviceName:await JU(),DeviceKey:n==null?void 0:n.DeviceKey,DeviceSecretVerifierConfig:l}),{deviceKey:a,deviceGroupKey:s,randomPassword:u}}catch{return}}async function G$(e){var p;const t=(p=$e.getConfig().Auth)==null?void 0:p.Cognito;Re(t);const{username:n,signInSession:r,signInDetails:o,challengeName:i}=Qo.getState();if(i!=="WEB_AUTHN"||!n)throw new se({name:qo.SignInException,message:"Unable to proceed due to invalid sign in state."});const{CREDENTIAL_REQUEST_OPTIONS:a}=e;Cb(!!a,Mt.InvalidPasskeyAuthenticationOptions);const s=await Z6(JSON.parse(a)),l=hr({endpointResolver:ze({endpointOverride:t.userPoolEndpoint})}),{ChallengeName:u,ChallengeParameters:c,AuthenticationResult:d,Session:f}=await l({region:Be(t.userPoolId),userAgentValue:ot(Ee.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(s)},ClientId:t.userPoolClientId,Session:r});if(Ys({signInSession:f,username:n,challengeName:u,signInDetails:o}),d)return await Qi({...d,username:n,NewDeviceMetadata:await Xs({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:d.NewDeviceMetadata,accessToken:d.AccessToken}),signInDetails:o}),Qo.dispatch({type:"RESET_STATE"}),await Ya(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if(u==="WEB_AUTHN")throw new se({name:qo.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:u,challengeParameters:c}}const q$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Q$=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],$P=()=>{const e=new Date,t=Q$[e.getUTCDay()],n=q$[e.getUTCMonth()],r=e.getUTCDate();let o=e.getUTCHours();o<10&&(o=`0${o}`);let i=e.getUTCMinutes();i<10&&(i=`0${i}`);let a=e.getUTCSeconds();a<10&&(a=`0${a}`);const s=e.getUTCFullYear();return`${t} ${n} ${r} ${o}:${i}:${a} UTC ${s}`},jP=({userPoolName:e,username:t,challengeParameters:n,dateNow:r,hkdf:o})=>{const i=uh.convert(e),a=uh.convert(t),s=Y$(n.SECRET_BLOCK),l=uh.convert(r),u=new Uint8Array(i.byteLength+a.byteLength+s.byteLength+l.byteLength);u.set(i,0),u.set(a,i.byteLength),u.set(s,i.byteLength+a.byteLength),u.set(l,i.byteLength+a.byteLength+s.byteLength);const c=new hu(o);c.update(u);const d=c.digestSync();return Ls.convert(d)},Y$=e=>{const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),r=ib.convert(n),o=new Uint8Array(r.length);for(let i=0;i{const o=`otpauth://totp/${n}:${r??t}?secret=${e}&issuer=${n}`;return new Hr(o)}}}function Vu(e){if(e===im.PasswordResetRequiredException)return{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}};if(e===im.UserNotConfirmedException)return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}}function d8(e){return e?JSON.parse(e).map(n=>n.includes(oS)?n.replace(oS,""):n):[]}function f8(e){if(!e)return{};const t={};return Object.entries(e).forEach(([n,r])=>{r&&(t[`${oS}${n}`]=r)}),t}async function p8(e,t,n,r,o,i,a,s){const l=s==null?void 0:s.userAttributes,u=s==null?void 0:s.friendlyDeviceName;switch(t){case"WEB_AUTHN":case"SELECT_CHALLENGE":return r==="PASSWORD_SRP"||r==="PASSWORD"?{ChallengeName:r,Session:n,$metadata:{}}:J$({username:e,session:n,selectedChallenge:r,config:o,clientMetadata:a});case"SELECT_MFA_TYPE":return o8({challengeResponse:r,clientMetadata:a,session:n,username:e,config:o});case"MFA_SETUP":return r8({challengeResponse:r,clientMetadata:a,session:n,username:e,deviceName:u,config:o});case"NEW_PASSWORD_REQUIRED":return i8({challengeResponse:r,clientMetadata:a,session:n,username:e,requiredAttributes:l,config:o});case"CUSTOM_CHALLENGE":return Wu(n8,[{challengeResponse:r,clientMetadata:a,session:n,username:e,config:o,tokenOrchestrator:i}],e,i);case"SMS_MFA":case"SOFTWARE_TOKEN_MFA":case"SMS_OTP":case"EMAIL_OTP":return v8({challengeName:t,challengeResponse:r,clientMetadata:a,session:n,username:e,config:o});case"PASSWORD":return Z$(e,r,a,o,n);case"PASSWORD_SRP":return e8(e,r,a,o,n,i)}throw new se({name:qo.SignInException,message:`An error occurred during the sign in process. ${t} challengeName returned by the underlying service was not addressed.`})}function h8(e){let t="SMS_MFA";return e==="TOTP"&&(t="SOFTWARE_TOKEN_MFA"),e==="EMAIL"&&(t="EMAIL_OTP"),t}function m8(e){if(e==="SMS_MFA")return"SMS";if(e==="SOFTWARE_TOKEN_MFA")return"TOTP";if(e==="EMAIL_OTP")return"EMAIL"}function Zx(e){if(e)return e.map(m8).filter(Boolean)}function eI(e){return e?JSON.parse(e):[]}function g8(e){return e.filter(t=>t==="EMAIL"||t==="TOTP")}async function zP(){let e;try{e=await Sf()}catch{}if(e&&e.userId&&e.username)throw new se({name:o6,message:"There is already a signed in user.",recoverySuggestion:"Call signOut before calling signIn again."})}function Ef(e){return Qo.getState().username??e}async function v8({challengeName:e,challengeResponse:t,clientMetadata:n,session:r,username:o,config:i}){const{userPoolId:a,userPoolClientId:s,userPoolEndpoint:l}=i,u={USERNAME:o};e==="EMAIL_OTP"&&(u.EMAIL_OTP_CODE=t),e==="SMS_MFA"&&(u.SMS_MFA_CODE=t),e==="SMS_OTP"&&(u.SMS_OTP_CODE=t),e==="SOFTWARE_TOKEN_MFA"&&(u.SOFTWARE_TOKEN_MFA_CODE=t);const c=Zt({username:o,userPoolId:a,userPoolClientId:s}),d={ChallengeName:e,ChallengeResponses:u,Session:r,ClientMetadata:n,ClientId:s,UserContextData:c};return hr({endpointResolver:ze({endpointOverride:l})})({region:Be(a),userAgentValue:ot(Ee.ConfirmSignIn)},d)}async function y8(e){var s;const t=(s=$e.getConfig().Auth)==null?void 0:s.Cognito;Re(t);const{username:n,password:r,options:o}=e,i={loginId:n,authFlowType:"CUSTOM_WITHOUT_SRP"},a=o==null?void 0:o.clientMetadata;Nt(!!n,be.EmptySignInUsername),Nt(!r,be.CustomAuthSignInPassword);try{const{ChallengeName:l,ChallengeParameters:u,AuthenticationResult:c,Session:d}=await Wu(l8,[n,a,t,Pn],n,Pn),f=Ef(n);return Ys({signInSession:d,username:f,challengeName:l,signInDetails:i}),c?(await Qi({username:f,...c,NewDeviceMetadata:await Xs({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:c.NewDeviceMetadata,accessToken:c.AccessToken}),signInDetails:i}),Co(),await Ya(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Zs({challengeName:l,challengeParameters:u})}catch(l){Co(),pr(l);const u=Vu(l.name);if(u)return u;throw l}}async function S8(e){var s;const{username:t,password:n,options:r}=e,o={loginId:t,authFlowType:"CUSTOM_WITH_SRP"},i=(s=$e.getConfig().Auth)==null?void 0:s.Cognito;Re(i);const a=r==null?void 0:r.clientMetadata;Nt(!!t,be.EmptySignInUsername),Nt(!!n,be.EmptySignInPassword);try{const{ChallengeName:l,ChallengeParameters:u,AuthenticationResult:c,Session:d}=await u8(t,n,a,i,Pn),f=Ef(t);return Ys({signInSession:d,username:f,challengeName:l,signInDetails:o}),c?(await Qi({username:f,...c,NewDeviceMetadata:await Xs({userPoolId:i.userPoolId,userPoolEndpoint:i.userPoolEndpoint,newDeviceMetadata:c.NewDeviceMetadata,accessToken:c.AccessToken}),signInDetails:o}),Co(),await Ya(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Zs({challengeName:l,challengeParameters:u})}catch(l){Co(),pr(l);const u=Vu(l.name);if(u)return u;throw l}}const HP=async()=>{throw new se({name:RP,message:"The autoSignIn flow has not started, or has been cancelled/completed.",recoverySuggestion:"Please try to use the signIn API or log out before starting a new autoSignIn flow."})};let Pb=HP;function iS(e){Pb=e}function Gn(e=!0){e&&(Pb=HP),wa.dispatch({type:"RESET"})}async function tI(e){var a,s;const{username:t,password:n}=e,r=(a=$e.getConfig().Auth)==null?void 0:a.Cognito,o={loginId:t,authFlowType:"USER_SRP_AUTH"};Re(r);const i=(s=e.options)==null?void 0:s.clientMetadata;Nt(!!t,be.EmptySignInUsername),Nt(!!n,be.EmptySignInPassword);try{const{ChallengeName:l,ChallengeParameters:u,AuthenticationResult:c,Session:d}=await s8(t,n,i,r,Pn),f=Ef(t);return Ys({signInSession:d,username:f,challengeName:l,signInDetails:o}),c?(await Qi({username:f,...c,NewDeviceMetadata:await Xs({userPoolId:r.userPoolId,userPoolEndpoint:r.userPoolEndpoint,newDeviceMetadata:c.NewDeviceMetadata,accessToken:c.AccessToken}),signInDetails:o}),Co(),await Ya(),Gn(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Zs({challengeName:l,challengeParameters:u})}catch(l){Co(),Gn(),pr(l);const u=Vu(l.name);if(u)return u;throw l}}async function b8(e){var s;const{username:t,password:n,options:r}=e,o=(s=$e.getConfig().Auth)==null?void 0:s.Cognito,i={loginId:t,authFlowType:"USER_PASSWORD_AUTH"};Re(o);const a=r==null?void 0:r.clientMetadata;Nt(!!t,be.EmptySignInUsername),Nt(!!n,be.EmptySignInPassword);try{const{ChallengeName:l,ChallengeParameters:u,AuthenticationResult:c,Session:d}=await Wu(a8,[t,n,a,o,Pn],t,Pn),f=Ef(t);return Ys({signInSession:d,username:f,challengeName:l,signInDetails:i}),c?(await Qi({...c,username:f,NewDeviceMetadata:await Xs({userPoolId:o.userPoolId,userPoolEndpoint:o.userPoolEndpoint,newDeviceMetadata:c.NewDeviceMetadata,accessToken:c.AccessToken}),signInDetails:i}),Co(),await Ya(),Gn(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Zs({challengeName:l,challengeParameters:u})}catch(l){Co(),Gn(),pr(l);const u=Vu(l.name);if(u)return u;throw l}}async function E8({username:e,clientMetadata:t,config:n,tokenOrchestrator:r,preferredChallenge:o,password:i,session:a}){const{userPoolId:s,userPoolClientId:l,userPoolEndpoint:u}=n,c=Zt({username:e,userPoolId:s,userPoolClientId:l}),d={USERNAME:e};if(o){if(o==="PASSWORD_SRP")return Nt(!!i,be.EmptySignInPassword),BP({username:e,password:i,clientMetadata:t,config:n,tokenOrchestrator:r,authFlow:"USER_AUTH",preferredChallenge:o});o==="PASSWORD"&&(Nt(!!i,be.EmptySignInPassword),d.PASSWORD=i),d.PREFERRED_CHALLENGE=o}const f={AuthFlow:"USER_AUTH",AuthParameters:d,ClientMetadata:t,ClientId:l,UserContextData:c};a&&(f.Session=a);const h=await Bu({endpointResolver:ze({endpointOverride:u})})({region:Be(s),userAgentValue:ot(Ee.SignIn)},f);return Js(e),h}async function WP(e){var l;const{username:t,password:n,options:r}=e,o=(l=$e.getConfig().Auth)==null?void 0:l.Cognito,i={loginId:t,authFlowType:"USER_AUTH"};Re(o);const a=r==null?void 0:r.clientMetadata,s=r==null?void 0:r.preferredChallenge;Nt(!!t,be.EmptySignInUsername);try{const u={username:t,config:o,tokenOrchestrator:Pn,clientMetadata:a,preferredChallenge:s,password:n},c=wa.getState();c.active&&c.username===t&&(u.session=c.session);const d=await E8(u),f=Ef(t);return Ys({signInSession:d.Session,username:f,challengeName:d.ChallengeName,signInDetails:i}),d.AuthenticationResult?(await Qi({username:f,...d.AuthenticationResult,NewDeviceMetadata:await Xs({userPoolId:o.userPoolId,userPoolEndpoint:o.userPoolEndpoint,newDeviceMetadata:d.AuthenticationResult.NewDeviceMetadata,accessToken:d.AuthenticationResult.AccessToken}),signInDetails:i}),Co(),await Ya(),Gn(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Zs({challengeName:d.ChallengeName,challengeParameters:d.ChallengeParameters,availableChallenges:"AvailableChallenges"in d?d.AvailableChallenges:void 0})}catch(u){Co(),Gn(),pr(u);const c=Vu(u.name);if(c)return c;throw u}}async function kb(e){var n;Gn(!1);const t=(n=e.options)==null?void 0:n.authFlowType;switch(await zP(),t){case"USER_SRP_AUTH":return tI(e);case"USER_PASSWORD_AUTH":return b8(e);case"CUSTOM_WITHOUT_SRP":return y8(e);case"CUSTOM_WITH_SRP":return S8(e);case"USER_AUTH":return WP(e);default:return tI(e)}}const VP=3*60*1e3;function w8(e){const t=nm.listen("auth-internal",async({payload:r})=>{switch(r.event){case"confirmSignUp":{const o=r.data;o!=null&&o.isSignUpComplete&&(nm.dispatch("auth-internal",{event:"autoSignIn"}),iS(GP(e)),t())}}}),n=setTimeout(()=>{t(),clearTimeout(n),Gn()},VP)}function KP(e,t){let n;return r=>{n||e(...r),clearTimeout(n),n=setTimeout(()=>{n=void 0},t)}}function C8(e,t,n){const r=Date.now(),o=setInterval(async()=>{if(Date.now()-r>VP)clearInterval(o),n(new se({name:RP,message:"The account was not confirmed on time.",recoverySuggestion:"Try to verify your account by clicking the link sent your email or phone and then login manually."})),Gn();else try{const s=await kb(e);s.nextStep.signInStep!=="CONFIRM_SIGN_UP"&&(t(s),clearInterval(o),Gn())}catch(s){clearInterval(o),n(s),Gn()}},5e3)}const x8=KP(C8,300),I8=KP(A8,300);function T8(e){return async()=>new Promise((t,n)=>{x8([e,t,n])})}async function A8(e,t,n){var r;try{const o=((r=e==null?void 0:e.options)==null?void 0:r.authFlowType)==="USER_AUTH"?await WP(e):await kb(e);t(o),Gn()}catch(o){n(o),Gn()}}function GP(e){return async()=>new Promise((t,n)=>{I8([e,t,n])})}const _8=GP,R8=()=>async e=>{if(e.statusCode>=300){const t=await Qa(e);if(pr(t),t.name===eS.InvalidParameterException&&/'password'/.test(t.message)&&/Member must not be null/.test(t.message)){const n=be.EmptySignUpPassword,{message:r,recoverySuggestion:o}=_P[n];throw new se({name:n,message:r,recoverySuggestion:o})}throw new se({name:t.name,message:t.message})}return mf(e)},P8=e=>hn(Mn,Dn("SignUp"),R8(),{...Fn,...e});async function k8(e){var T;const{username:t,password:n,options:r}=e,o=(T=$e.getConfig().Auth)==null?void 0:T.Cognito,i=(o==null?void 0:o.signUpVerificationMethod)??"code",{clientMetadata:a,validationData:s,autoSignIn:l}=e.options??{};Re(o),Nt(!!t,be.EmptySignUpUsername);const u=typeof l!="boolean"?l:void 0,c={username:t,options:u};(u==null?void 0:u.authFlowType)!=="CUSTOM_WITHOUT_SRP"&&(c.password=n);const{userPoolId:d,userPoolClientId:f,userPoolEndpoint:p}=o,h=P8({endpointResolver:ze({endpointOverride:p})}),m={Username:t,Password:void 0,UserAttributes:(r==null?void 0:r.userAttributes)&&wx(r==null?void 0:r.userAttributes),ClientMetadata:a,ValidationData:s&&wx(s),ClientId:f,UserContextData:Zt({username:t,userPoolId:d,userPoolClientId:f})};n&&(m.Password=n);const{UserSub:E,CodeDeliveryDetails:g,UserConfirmed:y,Session:v}=await h({region:Be(d),userAgentValue:ot(Ee.SignUp)},m);(u||l===!0)&&(wa.dispatch({type:"START"}),wa.dispatch({type:"SET_USERNAME",value:t}),wa.dispatch({type:"SET_SESSION",value:v}));const S={destination:g==null?void 0:g.Destination,deliveryMedium:g==null?void 0:g.DeliveryMedium,attributeName:g==null?void 0:g.AttributeName},x=!!y,I=wa.getState().active;if(x)return I?(iS(_8(c)),{isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"},userId:E}):{isSignUpComplete:!0,nextStep:{signUpStep:"DONE"},userId:E};if(I){if(i==="link")return iS(T8(c)),{isSignUpComplete:!1,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN",codeDeliveryDetails:S},userId:E};w8(c)}return{isSignUpComplete:!1,nextStep:{signUpStep:"CONFIRM_SIGN_UP",codeDeliveryDetails:S},userId:E}}const N8=e=>hn(Mn,Dn("ForgotPassword"),br(),{...Fn,...e});async function qP(e){var d,f;const{username:t}=e;Nt(!!t,be.EmptyResetPasswordUsername);const n=(d=$e.getConfig().Auth)==null?void 0:d.Cognito;Re(n);const{userPoolClientId:r,userPoolId:o,userPoolEndpoint:i}=n,a=(f=e.options)==null?void 0:f.clientMetadata,s=Zt({username:t,userPoolId:o,userPoolClientId:r}),c=(await N8({endpointResolver:ze({endpointOverride:i})})({region:Be(o),userAgentValue:ot(Ee.ResetPassword)},{Username:t,ClientMetadata:a,ClientId:r,UserContextData:s})).CodeDeliveryDetails;return{isPasswordReset:!1,nextStep:{resetPasswordStep:"CONFIRM_RESET_PASSWORD_WITH_CODE",codeDeliveryDetails:{deliveryMedium:c==null?void 0:c.DeliveryMedium,destination:c==null?void 0:c.Destination,attributeName:c==null?void 0:c.AttributeName}}}}const O8=e=>hn(Mn,Dn("ConfirmForgotPassword"),br(),{...Fn,...e});async function D8(e){var d,f;const t=(d=$e.getConfig().Auth)==null?void 0:d.Cognito;Re(t);const{userPoolClientId:n,userPoolId:r,userPoolEndpoint:o}=t,{username:i,newPassword:a}=e;Nt(!!i,be.EmptyConfirmResetPasswordUsername),Nt(!!a,be.EmptyConfirmResetPasswordNewPassword);const s=e.confirmationCode;Nt(!!s,be.EmptyConfirmResetPasswordConfirmationCode);const l=(f=e.options)==null?void 0:f.clientMetadata,u=Zt({username:i,userPoolId:r,userPoolClientId:n});await O8({endpointResolver:ze({endpointOverride:o})})({region:Be(t.userPoolId),userAgentValue:ot(Ee.ConfirmResetPassword)},{Username:i,ConfirmationCode:s,Password:a,ClientMetadata:l,ClientId:t.userPoolClientId,UserContextData:u})}const M8=e=>hn(Mn,Dn("ResendConfirmationCode"),br(),{...Fn,...e});async function F8(e){var p,h;const{username:t}=e;Nt(!!t,be.EmptySignUpUsername);const n=(p=$e.getConfig().Auth)==null?void 0:p.Cognito;Re(n);const{userPoolClientId:r,userPoolId:o,userPoolEndpoint:i}=n,a=(h=e.options)==null?void 0:h.clientMetadata,s=Zt({username:t,userPoolId:o,userPoolClientId:r}),l=M8({endpointResolver:ze({endpointOverride:i})}),{CodeDeliveryDetails:u}=await l({region:Be(n.userPoolId),userAgentValue:ot(Ee.ResendSignUpCode)},{Username:t,ClientMetadata:a,ClientId:n.userPoolClientId,UserContextData:s}),{DeliveryMedium:c,AttributeName:d,Destination:f}={...u};return{destination:f,deliveryMedium:c,attributeName:d||void 0}}const L8=e=>hn(Mn,Dn("ConfirmSignUp"),br(),{...Fn,...e});async function U8(e){var f;const{username:t,confirmationCode:n,options:r}=e,o=(f=$e.getConfig().Auth)==null?void 0:f.Cognito;Re(o);const{userPoolId:i,userPoolClientId:a,userPoolEndpoint:s}=o,l=r==null?void 0:r.clientMetadata;Nt(!!t,be.EmptyConfirmSignUpUsername),Nt(!!n,be.EmptyConfirmSignUpCode);const u=Zt({username:t,userPoolId:i,userPoolClientId:a}),c=L8({endpointResolver:ze({endpointOverride:s})}),{Session:d}=await c({region:Be(o.userPoolId),userAgentValue:ot(Ee.ConfirmSignUp)},{Username:t,ConfirmationCode:n,ClientMetadata:l,ForceAliasCreation:r==null?void 0:r.forceAliasCreation,ClientId:o.userPoolClientId,UserContextData:u});return new Promise((p,h)=>{try{const m={isSignUpComplete:!0,nextStep:{signUpStep:"DONE"}},E=wa.getState();if(!E.active||E.username!==t){p(m),Gn();return}wa.dispatch({type:"SET_SESSION",value:d});const g=nm.listen("auth-internal",({payload:y})=>{switch(y.event){case"autoSignIn":p({isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"}}),g()}});nm.dispatch("auth-internal",{event:"confirmSignUp",data:m})}catch(m){h(m)}})}async function QP(e){var u;const{challengeResponse:t,options:n}=e,{username:r,challengeName:o,signInSession:i,signInDetails:a}=Qo.getState(),s=(u=$e.getConfig().Auth)==null?void 0:u.Cognito;Re(s);const l=n==null?void 0:n.clientMetadata;if(Nt(!!t,be.EmptyChallengeResponse),!r||!o||!i)throw new se({name:qo.SignInException,message:` An error occurred during the sign in process. This most likely occurred due to: 1. signIn was not called before confirmSignIn. 2. signIn threw an exception. 3. page was refreshed during the sign in flow and session has expired. `,recoverySuggestion:"Make sure a successful call to signIn is made before calling confirmSignInand that the session has not expired."});try{const{Session:c,ChallengeName:d,AuthenticationResult:f,ChallengeParameters:p}=await p8(r,o,i,t,s,Pn,l,n);return Ys({signInSession:c,username:r,challengeName:d,signInDetails:a}),f?(await Qi({username:r,...f,NewDeviceMetadata:await Xs({userPoolId:s.userPoolId,userPoolEndpoint:s.userPoolEndpoint,newDeviceMetadata:f.NewDeviceMetadata,accessToken:f.AccessToken}),signInDetails:a}),Co(),await Ya(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}}):Zs({challengeName:d,challengeParameters:p})}catch(c){pr(c);const d=Vu(c.name);if(d)return d;throw c}}const $8=e=>hn(Mn,Dn("GetUser"),br(),{...Fn,...e}),j8=e=>hn(Mn,Dn("VerifyUserAttribute"),br(),{...Fn,...e});async function B8(e){var l;const t=(l=$e.getConfig().Auth)==null?void 0:l.Cognito;Re(t);const{userPoolEndpoint:n,userPoolId:r}=t,{confirmationCode:o,userAttributeKey:i}=e;Nt(!!o,be.EmptyConfirmUserAttributeCode);const{tokens:a}=await hf({forceRefresh:!1});yf(a),await j8({endpointResolver:ze({endpointOverride:n})})({region:Be(r),userAgentValue:ot(Ee.ConfirmUserAttribute)},{AccessToken:a.accessToken.toString(),AttributeName:i,Code:o})}new Lt("AuthError");const z8={oauthSignInError:{message:en.OAUTH_ERROR,log:"Make sure Cognito Hosted UI has been configured correctly"},noConfig:{message:en.DEFAULT_MSG},missingAuthConfig:{message:en.DEFAULT_MSG},emptyUsername:{message:en.EMPTY_USERNAME},invalidUsername:{message:en.INVALID_USERNAME},emptyPassword:{message:en.EMPTY_PASSWORD},emptyCode:{message:en.EMPTY_CODE},signUpError:{message:en.SIGN_UP_ERROR},noMFA:{message:en.NO_MFA},invalidMFA:{message:en.INVALID_MFA},emptyChallengeResponse:{message:en.EMPTY_CHALLENGE},noUserSession:{message:en.NO_USER_SESSION},deviceConfig:{message:en.DEVICE_CONFIG},networkError:{message:en.NETWORK_ERROR},autoSignInError:{message:en.AUTOSIGNIN_ERROR},default:{message:en.DEFAULT_MSG}},Us=(e,t)=>new se({message:e??"An error has occurred during the oauth process.",name:qo.OAuthSignInError,recoverySuggestion:z8.oauthSignInError.log});var aS;(function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError",e.OAuthSignInError="oauthSignInError"})(aS||(aS={}));const H8="`signInWithRedirect` has been canceled.",W8="An error occurred while validating the state.",V8="Try to initiate an OAuth flow from Amplify",YP=async e=>{const t=await Hn.loadOAuthState(),n=e===t?t:void 0;if(!n)throw new se({name:aS.OAuthSignInError,message:e===null?H8:W8,recoverySuggestion:e===null?void 0:V8});return n},XP=async({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,responseType:o,domain:i,preferPrivateSession:a})=>{const s=new Hr(e),l=s.searchParams.get("error"),u=s.searchParams.get("error_description");if(l)throw Us(u??l);return o==="code"?K8({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,domain:i,preferPrivateSession:a}):G8({currentUrl:e,redirectUri:r,preferPrivateSession:a})},K8=async({currentUrl:e,userAgentValue:t,clientId:n,redirectUri:r,domain:o,preferPrivateSession:i})=>{const a=new Hr(e),s=a.searchParams.get("code"),l=a.searchParams.get("state");if(!s||!l)throw Us("User cancelled OAuth flow.");const u=await YP(l),c="https://"+o+"/oauth2/token",d=await Hn.loadPKCE(),f={grant_type:"authorization_code",code:s,client_id:n,redirect_uri:r,...d?{code_verifier:d}:{}},p=Object.entries(f).map(([I,T])=>`${encodeURIComponent(I)}=${encodeURIComponent(T)}`).join("&"),{access_token:h,refresh_token:m,id_token:E,error:g,error_message:y,token_type:v,expires_in:S}=await(await fetch(c,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",[OR]:t},body:p})).json();if(g)throw Us(y??g);const x=(h&&Fi(h).payload.username)??"username";return await Qi({username:x,AccessToken:h,IdToken:E,RefreshToken:m}),JP({redirectUri:r,state:u,preferPrivateSession:i})},G8=async({currentUrl:e,redirectUri:t,preferPrivateSession:n})=>{const r=new Hr(e),{id_token:o,access_token:i,state:a,token_type:s,expires_in:l,error_description:u,error:c}=(r.hash??"#").substring(1).split("&").map(p=>p.split("=")).reduce((p,[h,m])=>({...p,[h]:m}),{id_token:void 0,access_token:void 0,state:void 0,token_type:void 0,expires_in:void 0,error_description:void 0,error:void 0});if(c)throw Us(u??c);if(!i)throw Us("No access token returned from OAuth flow.");const d=await YP(a),f=(i&&Fi(i).payload.username)??"username";return await Qi({username:f,AccessToken:i,IdToken:o}),JP({redirectUri:t,state:d,preferPrivateSession:n})},JP=async({redirectUri:e,state:t,preferPrivateSession:n})=>{await Pn.setOAuthMetadata({oauthSignIn:!0}),await Hn.clearOAuthData(),await Hn.storeOAuthSignIn(!0,n),MP(),Y8(e),q8(t)&&dr.dispatch("auth",{event:"customOAuthState",data:QU(Q8(t))},"Auth",wo),dr.dispatch("auth",{event:"signInWithRedirect"},"Auth",wo),await Ya()},q8=e=>/-/.test(e),Q8=e=>e.split("-").splice(1).join("-"),Y8=e=>{typeof window<"u"&&typeof window.history<"u"&&window.history.replaceState(window.history.state,"",e)};function Nb(e,t){{const n=(e==null?void 0:e.find(X8))??(e==null?void 0:e.find(J8)),r=(e==null?void 0:e.find(e9))??(e==null?void 0:e.find(Z8));if(n)return n;throw r?d6:u6}}const X8=e=>e.startsWith(String(window.location.origin+window.location.pathname)),J8=e=>e.includes(String(window.location.hostname)),Z8=e=>e.startsWith("http://"),e9=e=>e.startsWith("https://"),Ob=async e=>{MP(),await Hn.clearOAuthInflightData(),dr.dispatch("auth",{event:"signInWithRedirect_failure",data:{error:e}},"Auth",wo)},t9=async e=>{try{Re(e),Zm(e),Hn.setAuthConfig(e)}catch{return}if(await Hn.loadOAuthInFlight())try{const t=window.location.href,{loginWith:n,userPoolClientId:r}=e,{domain:o,redirectSignIn:i,responseType:a}=n.oauth,s=Nb(i);await XP({currentUrl:t,clientId:r,domain:o,redirectUri:s,responseType:a,userAgentValue:ot(Ee.SignInWithRedirect)})}catch(t){await Ob(t)}};rg()&&$e[LR](t9);const n9={Google:"Google",Facebook:"Facebook",Amazon:"LoginWithAmazon",Apple:"SignInWithApple"},ZP=async e=>{window!=null&&window.location&&(window.location.href=e.replace("http://","https://"))},nI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r9=e=>{const t=new Uint8Array(e);ob().getRandomValues(t);let n="",r;for(const o of t)n+=nI.charAt(o%nI.length);return{value:n,method:"S256",toCodeChallenge(){return r||(r=o9(n),r)}}};function o9(e){const t=new hu;return t.update(e),i9(Ls.convert(t.digestSync(),{urlSafe:!0}))}function i9(e){return e.replace(/=/g,"")}const a9=()=>KU(32),s9=e=>{async function t(n){if(n.persisted&&await e.loadOAuthInFlight()){const o=Us("User cancelled OAuth flow.");await Ob(o)}window.removeEventListener("pageshow",t)}window.addEventListener("pageshow",t)};async function ek(e){var r,o,i,a,s,l;const t=(r=$e.getConfig().Auth)==null?void 0:r.Cognito;Re(t),Zm(t),Hn.setAuthConfig(t),await zP();let n="COGNITO";return typeof(e==null?void 0:e.provider)=="string"?n=n9[e.provider]:(o=e==null?void 0:e.provider)!=null&&o.custom&&(n=e.provider.custom),l9({oauthConfig:t.loginWith.oauth,clientId:t.userPoolClientId,provider:n,customState:e==null?void 0:e.customState,preferPrivateSession:(i=e==null?void 0:e.options)==null?void 0:i.preferPrivateSession,options:{loginHint:(a=e==null?void 0:e.options)==null?void 0:a.loginHint,lang:(s=e==null?void 0:e.options)==null?void 0:s.lang,nonce:(l=e==null?void 0:e.options)==null?void 0:l.nonce}})}const l9=async({oauthConfig:e,provider:t,clientId:n,customState:r,preferPrivateSession:o,options:i})=>{const{domain:a,redirectSignIn:s,responseType:l,scopes:u}=e,{loginHint:c,lang:d,nonce:f}=i??{},p=a9(),h=r?`${p}-${YU(r)}`:p,{value:m,method:E,toCodeChallenge:g}=r9(128),y=Nb(e.redirectSignIn);rg()&&Hn.storeOAuthInFlight(!0),Hn.storeOAuthState(h),Hn.storePKCE(m);const v=Object.entries({redirect_uri:y,response_type:l,client_id:n,identity_provider:t,scope:u.join(" "),...c&&{login_hint:c},...d&&{lang:d},...f&&{nonce:f},state:h,...l==="code"&&{code_challenge:g(),code_challenge_method:E}}).map(([A,R])=>`${encodeURIComponent(A)}=${encodeURIComponent(R)}`).join("&"),S=`https://${a}/oauth2/authorize?${v}`;s9(Hn);const{type:x,error:I,url:T}=await ZP(S)??{};try{if(x==="error")throw Us(String(I));x==="success"&&T&&await XP({currentUrl:T,clientId:n,domain:a,redirectUri:y,responseType:l,userAgentValue:ot(Ee.SignInWithRedirect),preferPrivateSession:o})}catch(A){throw await Ob(A),A}},u9=async e=>{var s;const t=(s=e.getConfig().Auth)==null?void 0:s.Cognito;Re(t);const{userPoolEndpoint:n,userPoolId:r}=t,{tokens:o}=await sP(e,{forceRefresh:!1});yf(o);const i=$8({endpointResolver:ze({endpointOverride:n})}),{UserAttributes:a}=await i({region:Be(r),userAgentValue:ot(Ee.FetchUserAttributes)},{AccessToken:o.accessToken.toString()});return r6(a)},tk=()=>u9($e),c9=async e=>{await e.clearOAuthData(),Pn.clearTokens(),await lP(),dr.dispatch("auth",{event:"signedOut"},"Auth",wo)},d9=async(e,t=!1,n)=>{Zm(e);const{loginWith:r,userPoolClientId:o}=e,{domain:i,redirectSignOut:a}=r.oauth,s=Nb(a),l=`https://${i}/logout?${Object.entries({client_id:o,logout_uri:encodeURIComponent(s)}).map(([u,c])=>`${u}=${c}`).join("&")}`;return ZP(l)},f9=async(e,t,n,r)=>{const{isOAuthSignIn:o}=await t.loadOAuthSignIn(),i=await n.getOAuthMetadata();if(await c9(t),o||i!=null&&i.oauthSignIn)return d9(e,!1)},p9=e=>hn(Mn,Dn("RevokeToken"),br(),{...Fn,...e}),h9=new Lt("Auth");async function $d(e){var r;const t=(r=$e.getConfig().Auth)==null?void 0:r.Cognito;Re(t),await m9(t);let n;try{Zm(t),n=!0}catch{n=!1}if(n){const o=new DP(vf);o.setAuthConfig(t);const{type:i}=await f9(t,o,Pn)??{};if(i==="error")throw new se({name:f6,message:"An error occurred when attempting to log out from OAuth provider."})}else Pn.clearTokens(),await lP(),dr.dispatch("auth",{event:"signedOut"},"Auth",wo)}async function m9(e){try{const{userPoolEndpoint:t,userPoolId:n,userPoolClientId:r}=e,o=await Pn.getTokenStore().loadTokens();PP(o),g9(o.accessToken)&&await p9({endpointResolver:ze({endpointOverride:t})})({region:Be(n),userAgentValue:ot(Ee.SignOut)},{ClientId:r,Token:o.refreshToken})}catch{h9.debug("Client signOut error caught but will proceed with token removal")}}const g9=e=>{var t;return!!((t=e==null?void 0:e.payload)!=null&&t.origin_jti)},v9=e=>hn(Mn,Dn("GetUserAttributeVerificationCode"),br(),{...Fn,...e}),y9=async e=>{var p;const{userAttributeKey:t,options:n}=e,r=(p=$e.getConfig().Auth)==null?void 0:p.Cognito,o=n==null?void 0:n.clientMetadata;Re(r);const{userPoolEndpoint:i,userPoolId:a}=r,{tokens:s}=await hf({forceRefresh:!1});yf(s);const l=v9({endpointResolver:ze({endpointOverride:i})}),{CodeDeliveryDetails:u}=await l({region:Be(a),userAgentValue:ot(Ee.SendUserAttributeVerificationCode)},{AccessToken:s.accessToken.toString(),ClientMetadata:o,AttributeName:t}),{DeliveryMedium:c,AttributeName:d,Destination:f}={...u};return{destination:f,deliveryMedium:c,attributeName:d}},S9=()=>async e=>{if(e.statusCode>=300){const t=await Qa(e);throw pr(t),new se({name:t.name,message:t.message})}else return},b9=e=>hn(Mn,Dn("DeleteUser"),S9(),{...Fn,...e});async function E9(){var i;const e=(i=$e.getConfig().Auth)==null?void 0:i.Cognito;Re(e);const{userPoolEndpoint:t,userPoolId:n}=e,{tokens:r}=await hf();yf(r),await b9({endpointResolver:ze({endpointOverride:t})})({region:Be(n),userAgentValue:ot(Ee.DeleteUser)},{AccessToken:r.accessToken.toString()}),await Pn.clearDeviceMetadata(),await $d()}const w9={identityId:"identityId"},C9=new Lt("DefaultIdentityIdStore");class nk{setAuthConfig(t){ah(t.Cognito),this.authConfig=t,this._authKeys=x9("Cognito",t.Cognito.identityPoolId)}constructor(t){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=t}async loadIdentityId(){var t;ah((t=this.authConfig)==null?void 0:t.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{const n=await this.keyValueStorage.getItem(this._authKeys.identityId);return n?(this._hasGuestIdentityId=!0,{id:n,type:"guest"}):null}}catch(n){return C9.log("Error getting stored IdentityId.",n),null}}async storeIdentityId(t){var n;ah((n=this.authConfig)==null?void 0:n.Cognito),t.type==="guest"?(this.keyValueStorage.setItem(this._authKeys.identityId,t.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=t.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}const x9=(e,t)=>Eb(w9)(`com.amplify.${e}`,t);function rk(e){const t=Fi(e).payload.iss,n={};if(!t)throw new se({name:"InvalidIdTokenException",message:"Invalid Idtoken."});const r=t.replace(/(^\w+:|^)\/\//,"");return n[r]=e,n}async function I9({tokens:e,authConfig:t,identityIdStore:n}){n.setAuthConfig({Cognito:t});const r=await n.loadIdentityId();if(r)return r.id;const o=e!=null&&e.idToken?rk(e.idToken.toString()):{},i=await T9(o,t);return n.storeIdentityId({id:i,type:e?"primary":"guest"}),i}async function T9(e,t){const n=t==null?void 0:t.identityPoolId,r=Z0(n);let o;try{o=(await oU({region:r},{IdentityPoolId:n,Logins:e})).IdentityId}catch(i){throw pr(i),new se(i)}if(!o)throw new se({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return o}const vp=new Lt("CognitoCredentialsProvider"),rI=50*60*1e3;class ok{constructor(t){this._nextCredentialsRefresh=0,this._identityIdStore=t}async clearCredentialsAndIdentityId(){vp.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){vp.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(t){const n=t.authenticated,{tokens:r}=t,{authConfig:o}=t;try{ah(o==null?void 0:o.Cognito)}catch{return}if(!n&&!o.Cognito.allowGuestAccess)return;const{forceRefresh:i}=t,a=this.hasTokenChanged(r),s=await I9({tokens:r,authConfig:o.Cognito,identityIdStore:this._identityIdStore});return(i||a)&&this.clearCredentials(),n?(m6(r),this.credsForOIDCTokens(o.Cognito,r,s)):this.getGuestCredentials(s,o.Cognito)}async getGuestCredentials(t,n){var i,a;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!1)return vp.info("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const r=Z0(n.identityPoolId);let o;try{o=await yx({region:r},{IdentityId:t})}catch(s){throw pr(s),new se(s)}if((i=o==null?void 0:o.Credentials)!=null&&i.AccessKeyId&&((a=o==null?void 0:o.Credentials)!=null&&a.SecretKey)){this._nextCredentialsRefresh=new Date().getTime()+rI;const s={credentials:{accessKeyId:o.Credentials.AccessKeyId,secretAccessKey:o.Credentials.SecretKey,sessionToken:o.Credentials.SessionToken,expiration:o.Credentials.Expiration},identityId:t};return o.IdentityId&&(s.identityId=o.IdentityId,this._identityIdStore.storeIdentityId({id:o.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...s,isAuthenticatedCreds:!1},s}else throw new se({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(t,n,r){var s,l,u;if(this._credentialsAndIdentityId&&!this.isPastTTL()&&this._credentialsAndIdentityId.isAuthenticatedCreds===!0)return vp.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();const o=n.idToken?rk(n.idToken.toString()):{},i=Z0(t.identityPoolId);let a;try{a=await yx({region:i},{IdentityId:r,Logins:o})}catch(c){throw pr(c),new se(c)}if((s=a==null?void 0:a.Credentials)!=null&&s.AccessKeyId&&((l=a==null?void 0:a.Credentials)!=null&&l.SecretKey)){this._nextCredentialsRefresh=new Date().getTime()+rI;const c={credentials:{accessKeyId:a.Credentials.AccessKeyId,secretAccessKey:a.Credentials.SecretKey,sessionToken:a.Credentials.SessionToken,expiration:a.Credentials.Expiration},identityId:r};return a.IdentityId&&(c.identityId=a.IdentityId,this._identityIdStore.storeIdentityId({id:a.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...c,isAuthenticatedCreds:!0,associatedIdToken:(u=n.idToken)==null?void 0:u.toString()},c}else throw new se({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return this._nextCredentialsRefresh===void 0?!0:this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(t){var n,r;return!!t&&!!((n=this._credentialsAndIdentityId)!=null&&n.associatedIdToken)&&((r=t.idToken)==null?void 0:r.toString())!==this._credentialsAndIdentityId.associatedIdToken}}const A9=new ok(new nk(vf)),ik={configure(e,t){const n=$R(e),r=new hU({sameSite:"lax"}),o=t!=null&&t.ssr?r:vf,i=t!=null&&t.ssr?new ok(new nk(r)):A9;if(!n.Auth){$e.configure(n,t);return}if(t!=null&&t.Auth){$e.configure(n,t);return}if(!$e.libraryOptions.Auth){zc.setAuthConfig(n.Auth),zc.setKeyValueStorage(o),$e.configure(n,{...t,Auth:{tokenProvider:zc,credentialsProvider:i}});return}if(t){const a=$e.libraryOptions.Auth;t.ssr!==void 0&&(zc.setKeyValueStorage(o),a.credentialsProvider=i),$e.configure(n,{Auth:a,...t});return}$e.configure(n)},getConfig(){return $e.getConfig()}},_9={user_pool_id:"us-west-2_jtwRRobII",aws_region:"us-west-2",user_pool_client_id:"cir90t139il18tfkp4fblc1vc",identity_pool_id:"us-west-2:b70a20b7-c61c-4903-8fc2-653c5701b10f",mfa_methods:[],standard_required_attributes:["email"],username_attributes:["email"],user_verification_types:["email"],groups:[],mfa_configuration:"NONE",password_policy:{min_length:8,require_lowercase:!0,require_numbers:!0,require_symbols:!0,require_uppercase:!0},unauthenticated_identities_enabled:!0},R9={url:"https://wxc36cjsmjgtnmyvhl2che3h7u.appsync-api.us-west-2.amazonaws.com/graphql",aws_region:"us-west-2",api_key:"da2-avh7sig3enbonnbqdaazxgkgw4",default_authorization_type:"AMAZON_COGNITO_USER_POOLS",authorization_types:["API_KEY","AWS_IAM"],model_introspection:{version:1,models:{Food:{name:"Food",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},name:{name:"name",isArray:!1,type:"String",isRequired:!1,attributes:[]},calories:{name:"calories",isArray:!1,type:"Int",isRequired:!0,attributes:[]},protein:{name:"protein",isArray:!1,type:"Int",isRequired:!1,attributes:[]},day:{name:"day",isArray:!1,type:"String",isRequired:!0,attributes:[]},notes:{name:"notes",isArray:!1,type:"String",isRequired:!1,attributes:[]},photos:{name:"photos",isArray:!0,type:"String",isRequired:!1,attributes:[],isArrayNullable:!0},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"Foods",attributes:[{type:"model",properties:{}},{type:"key",properties:{name:"foodsByDay",queryField:"listFoodByDay",fields:["day"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}},Goal:{name:"Goal",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},dietCalories:{name:"dietCalories",isArray:!1,type:"Int",isRequired:!0,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"Goals",attributes:[{type:"model",properties:{}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}},QuickAdd:{name:"QuickAdd",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},name:{name:"name",isArray:!1,type:"String",isRequired:!0,attributes:[]},calories:{name:"calories",isArray:!1,type:"Int",isRequired:!0,attributes:[]},protein:{name:"protein",isArray:!1,type:"Int",isRequired:!1,attributes:[]},icon:{name:"icon",isArray:!1,type:"String",isRequired:!0,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"QuickAdds",attributes:[{type:"model",properties:{}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}},Weight:{name:"Weight",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},currentWeight:{name:"currentWeight",isArray:!1,type:"Int",isRequired:!0,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"Weights",attributes:[{type:"model",properties:{}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}},Height:{name:"Height",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},currentHeight:{name:"currentHeight",isArray:!1,type:"Int",isRequired:!0,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"Heights",attributes:[{type:"model",properties:{}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}},HealthKitCache:{name:"HealthKitCache",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},activeCalories:{name:"activeCalories",isArray:!1,type:"Float",isRequired:!0,attributes:[]},baseCalories:{name:"baseCalories",isArray:!1,type:"Float",isRequired:!0,attributes:[]},weight:{name:"weight",isArray:!1,type:"Float",isRequired:!1,attributes:[]},steps:{name:"steps",isArray:!1,type:"Float",isRequired:!1,attributes:[]},day:{name:"day",isArray:!1,type:"String",isRequired:!0,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"HealthKitCaches",attributes:[{type:"model",properties:{}},{type:"key",properties:{name:"healthKitCachesByDay",queryField:"listHealthKitCacheByDay",fields:["day"]}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}},Preferences:{name:"Preferences",fields:{id:{name:"id",isArray:!1,type:"ID",isRequired:!0,attributes:[]},hideProtein:{name:"hideProtein",isArray:!1,type:"Boolean",isRequired:!1,attributes:[]},hideSteps:{name:"hideSteps",isArray:!1,type:"Boolean",isRequired:!1,attributes:[]},createdAt:{name:"createdAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0},updatedAt:{name:"updatedAt",isArray:!1,type:"AWSDateTime",isRequired:!1,attributes:[],isReadOnly:!0}},syncable:!0,pluralName:"Preferences",attributes:[{type:"model",properties:{}},{type:"auth",properties:{rules:[{provider:"userPools",ownerField:"owner",allow:"owner",identityClaim:"cognito:username",operations:["create","update","delete","read"]}]}}],primaryKeyInfo:{isCustomPrimaryKey:!1,primaryKeyFieldName:"id",sortKeyFieldNames:[]}}},enums:{},nonModels:{StringType:{name:"StringType",fields:{value:{name:"value",isArray:!1,type:"String",isRequired:!1,attributes:[]}}}},queries:{getWeights:{name:"getWeights",isArray:!1,type:{nonModel:"StringType"},isRequired:!1,arguments:{ignoreThisArgument:{name:"ignoreThisArgument",isArray:!1,type:"String",isRequired:!1}}},getHeights:{name:"getHeights",isArray:!1,type:{nonModel:"StringType"},isRequired:!1,arguments:{ignoreThisArgument:{name:"ignoreThisArgument",isArray:!1,type:"String",isRequired:!1}}},getFoods:{name:"getFoods",isArray:!1,type:{nonModel:"StringType"},isRequired:!1,arguments:{ignoreThisArgument:{name:"ignoreThisArgument",isArray:!1,type:"String",isRequired:!1}}},getCurrentDate:{name:"getCurrentDate",isArray:!1,type:{nonModel:"StringType"},isRequired:!1,arguments:{ignoreThisArgument:{name:"ignoreThisArgument",isArray:!1,type:"String",isRequired:!1}}},getEverything:{name:"getEverything",isArray:!1,type:{nonModel:"StringType"},isRequired:!1,arguments:{userId:{name:"userId",isArray:!1,type:"String",isRequired:!0}}},getSteps:{name:"getSteps",isArray:!1,type:{nonModel:"StringType"},isRequired:!1,arguments:{apiKey:{name:"apiKey",isArray:!1,type:"String",isRequired:!0},userId:{name:"userId",isArray:!1,type:"String",isRequired:!0}}}}}},P9={aws_region:"us-west-2",bucket_name:"amplify-d14lkx3uodtpjt-ma-jpcfitstoragebucket3bb6d-efe9en5thrjt",buckets:[{name:"jpcFitStorage",bucket_name:"amplify-d14lkx3uodtpjt-ma-jpcfitstoragebucket3bb6d-efe9en5thrjt",aws_region:"us-west-2",paths:{"images/*":{authenticated:["get","list","write"]}}}]},k9="1.4",N9={auth:_9,data:R9,storage:P9,version:k9};/*! Capacitor: https://capacitorjs.com/ - MIT License */var gu;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(gu||(gu={}));class cy extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const O9=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},D9=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},o=()=>t!==null?t.name:O9(e),i=()=>o()!=="web",a=d=>{const f=u.get(d);return!!(f!=null&&f.platforms.has(o())||s(d))},s=d=>{var f;return(f=n.PluginHeaders)===null||f===void 0?void 0:f.find(p=>p.name===d)},l=d=>e.console.error(d),u=new Map,c=(d,f={})=>{const p=u.get(d);if(p)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),p.proxy;const h=o(),m=s(d);let E;const g=async()=>(!E&&h in f?E=typeof f[h]=="function"?E=await f[h]():E=f[h]:t!==null&&!E&&"web"in f&&(E=typeof f.web=="function"?E=await f.web():E=f.web),E),y=(A,R)=>{var w,_;if(m){const k=m==null?void 0:m.methods.find(N=>R===N.name);if(k)return k.rtype==="promise"?N=>n.nativePromise(d,R.toString(),N):(N,F)=>n.nativeCallback(d,R.toString(),N,F);if(A)return(w=A[R])===null||w===void 0?void 0:w.bind(A)}else{if(A)return(_=A[R])===null||_===void 0?void 0:_.bind(A);throw new cy(`"${d}" plugin is not implemented on ${h}`,gu.Unimplemented)}},v=A=>{let R;const w=(..._)=>{const k=g().then(N=>{const F=y(N,A);if(F){const U=F(..._);return R=U==null?void 0:U.remove,U}else throw new cy(`"${d}.${A}()" is not implemented on ${h}`,gu.Unimplemented)});return A==="addListener"&&(k.remove=async()=>R()),k};return w.toString=()=>`${A.toString()}() { [capacitor code] }`,Object.defineProperty(w,"name",{value:A,writable:!1,configurable:!1}),w},S=v("addListener"),x=v("removeListener"),I=(A,R)=>{const w=S({eventName:A},R),_=async()=>{const N=await w;x({eventName:A,callbackId:N},R)},k=new Promise(N=>w.then(()=>N({remove:_})));return k.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await _()},k},T=new Proxy({},{get(A,R){switch(R){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return m?I:S;case"removeListener":return x;default:return v(R)}}});return r[d]=T,u.set(d,{name:d,proxy:T,platforms:new Set([...Object.keys(f),...m?[h]:[]])}),T};return n.convertFileSrc||(n.convertFileSrc=d=>d),n.getPlatform=o,n.handleError=l,n.isNativePlatform=i,n.isPluginAvailable=a,n.registerPlugin=c,n.Exception=cy,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},M9=e=>e.Capacitor=D9(e),go=M9(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),el=go.registerPlugin;class ak{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const i=this.windowListeners[t];i&&!i.registered&&this.addWindowListener(i),r&&this.sendRetainedArgumentsForEvent(t);const a=async()=>this.removeListener(t,n);return Promise.resolve({remove:a})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const o=this.listeners[t];if(!o){if(r){let i=this.retainedEventArguments[t];i||(i=[]),i.push(n),this.retainedEventArguments[t]=i}return}o.forEach(i=>i(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new go.Exception(t,gu.Unimplemented)}unavailable(t="not available"){return new go.Exception(t,gu.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const o=r.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const oI=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),iI=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class F9 extends ak{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[o,i]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=iI(o).trim(),i=iI(i).trim(),n[o]=i}),n}async setCookie(t){try{const n=oI(t.key),r=oI(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,i=(t.path||"/").replace("path=",""),a=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${o}; path=${i}; ${a};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}el("CapacitorCookies",{web:()=>new F9});const L9=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const o=r.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},r.onerror=o=>n(o),r.readAsDataURL(e)}),U9=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,i,a)=>(o[i]=e[t[a]],o),{})},$9=(e,t=!0)=>e?Object.entries(e).reduce((r,o)=>{const[i,a]=o;let s,l;return Array.isArray(a)?(l="",a.forEach(u=>{s=t?encodeURIComponent(u):u,l+=`${i}=${s}&`}),l.slice(0,-1)):(s=t?encodeURIComponent(a):a,l=`${i}=${s}`),`${r}&${l}`},"").substr(1):null,j9=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=U9(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const i=new URLSearchParams;for(const[a,s]of Object.entries(e.data||{}))i.set(a,s);n.body=i.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const i=new FormData;if(e.data instanceof FormData)e.data.forEach((s,l)=>{i.append(l,s)});else for(const s of Object.keys(e.data))i.append(s,e.data[s]);n.body=i;const a=new Headers(n.headers);a.delete("content-type"),n.headers=a}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class B9 extends ak{async request(t){const n=j9(t,t.webFetchExtra),r=$9(t.params,t.shouldEncodeUrlParams),o=r?`${t.url}?${r}`:t.url,i=await fetch(o,n),a=i.headers.get("content-type")||"";let{responseType:s="text"}=i.ok?t:{};a.includes("application/json")&&(s="json");let l,u;switch(s){case"arraybuffer":case"blob":u=await i.blob(),l=await L9(u);break;case"json":l=await i.json();break;case"document":case"text":default:l=await i.text()}const c={};return i.headers.forEach((d,f)=>{c[f]=d}),{data:l,headers:c,status:i.status,url:i.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}el("CapacitorHttp",{web:()=>new B9});const z9="modulepreload",H9=function(e){return"/"+e},aI={},wf=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=H9(l),l in aI)return;aI[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="proxy.php?url=https%3A%2F%2Ffit.jpc.io%2F%24%7Bl%7D"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":z9,u||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return o.then(a=>{for(const s of a||[])s.status==="rejected"&&i(s.reason);return t().catch(i)})},sI=el("App",{web:()=>wf(()=>import("./web-B9pQ5oA7.js"),[]).then(e=>new e.AppWeb)}),sk=b.createContext(void 0);function W9({children:e}){const[t,n]=b.useState(null),[r,o]=b.useState(!0);b.useEffect(()=>{i();const s=dr.listen("auth",({payload:l})=>{l.event==="signedIn"?i():l.event==="signedOut"&&n(null)});return()=>s()},[]);async function i(){try{const s=await Sf();n({username:s.username,userId:s.userId})}catch{n(null)}finally{o(!1)}}async function a(){await $d(),n(null)}return C.jsx(sk.Provider,{value:{user:t,loading:r,signOut:a},children:e})}function Cf(){const e=b.useContext(sk);if(e===void 0)throw new Error("useAuth must be used within AuthProvider");return e}function dh(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dh=function(n){return typeof n}:dh=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},dh(e)}function V9(e){return dh(e)=="object"&&e!==null}var lk=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function sS(e,t){for(var n=/\r\n|[\n\r]/g,r=1,o=t+1,i;(i=n.exec(e.body))&&i.index120){for(var f=Math.floor(l/80),p=l%80,h=[],m=0;m"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function tj(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function jd(e,t){return jd=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},jd(e,t)}function Bd(e){return Bd=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Bd(e)}var ud=function(e){Z9(n,e);var t=ej(n);function n(r,o,i,a,s,l,u){var c,d,f,p;Y9(this,n),p=t.call(this,r),p.name="GraphQLError",p.originalError=l??void 0,p.nodes=cI(Array.isArray(o)?o:o?[o]:void 0);for(var h=[],m=0,E=(g=p.nodes)!==null&&g!==void 0?g:[];m0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?(Object.defineProperty(Hc(p),"stack",{value:l.stack,writable:!0,configurable:!0}),ck(p)):(Error.captureStackTrace?Error.captureStackTrace(Hc(p),n):Object.defineProperty(Hc(p),"stack",{value:Error().stack,writable:!0,configurable:!0}),p)}return J9(n,[{key:"toString",value:function(){return nj(this)}},{key:lk,get:function(){return"Object"}}]),n}(lS(Error));function cI(e){return e===void 0||e.length===0?void 0:e}function nj(e){var t=e.message;if(e.nodes)for(var n=0,r=e.nodes;n",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function mh(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mh=function(n){return typeof n}:mh=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},mh(e)}var oj=10,hk=2;function mk(e){return lg(e,[])}function lg(e,t){switch(mh(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":ij(e,t);default:return String(e)}}function ij(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var n=[].concat(t,[e]),r=lj(e);if(r!==void 0){var o=r.call(e);if(o!==e)return typeof o=="string"?o:lg(o,n)}else if(Array.isArray(e))return sj(e,n);return aj(e,n)}function aj(e,t){var n=Object.keys(e);if(n.length===0)return"{}";if(t.length>hk)return"["+uj(e)+"]";var r=n.map(function(o){var i=lg(e[o],t);return o+": "+i});return"{ "+r.join(", ")+" }"}function sj(e,t){if(e.length===0)return"[]";if(t.length>hk)return"[Array]";for(var n=Math.min(oj,e.length),r=e.length-n,o=[],i=0;i1&&o.push("... ".concat(r," more items")),"["+o.join(", ")+"]"}function lj(e){var t=e[String(uS)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function uj(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){var n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function dy(e,t){var n=!!e;if(!n)throw new Error(t)}const cj=function(t,n){return t instanceof n};function dj(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof t=="string"||dy(0,"Body must be a string. Received: ".concat(mk(t),".")),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||dy(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||dy(0,"column in locationOffset is 1-indexed and must be positive.")}return fj(e,[{key:lk,get:function(){return"Source"}}]),e}();function pj(e){return cj(e,gk)}var hj=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function mj(e){var t=e.split(/\r\n|[\n\r]/g),n=gj(e);if(n!==0)for(var r=1;ro&&fI(t[i-1]);)--i;return t.slice(o,i).join(` `)}function fI(e){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:"",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=e.indexOf(` `)===-1,o=e[0]===" "||e[0]===" ",i=e[e.length-1]==='"',a=e[e.length-1]==="\\",s=!r||i||a||n,l="";return s&&!(r&&o)&&(l+=` `+t),l+=t?e.replace(/\n/g,` `+t):e,s&&(l+=` `),'"""'+l.replace(/"""/g,'\\"""')+'"""'}var yj=function(){function e(n){var r=new Rt(H.SOF,0,0,0,0,null);this.source=n,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){this.lastToken=this.token;var r=this.token=this.lookahead();return r},t.lookahead=function(){var r=this.token;if(r.kind!==H.EOF)do{var o;r=(o=r.next)!==null&&o!==void 0?o:r.next=bj(this,r)}while(r.kind===H.COMMENT);return r},e}();function Sj(e){return e===H.BANG||e===H.DOLLAR||e===H.AMP||e===H.PAREN_L||e===H.PAREN_R||e===H.SPREAD||e===H.COLON||e===H.EQUALS||e===H.AT||e===H.BRACKET_L||e===H.BRACKET_R||e===H.BRACE_L||e===H.PIPE||e===H.BRACE_R}function $s(e){return isNaN(e)?H.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function bj(e,t){for(var n=e.source,r=n.body,o=r.length,i=t.end;i31||a===9));return new Rt(H.COMMENT,t,s,n,r,o,i.slice(t+1,s))}function Cj(e,t,n,r,o,i){var a=e.body,s=n,l=t,u=!1;if(s===45&&(s=a.charCodeAt(++l)),s===48){if(s=a.charCodeAt(++l),s>=48&&s<=57)throw sr(e,l,"Invalid number, unexpected digit after 0: ".concat($s(s),"."))}else l=fy(e,l,s),s=a.charCodeAt(l);if(s===46&&(u=!0,s=a.charCodeAt(++l),l=fy(e,l,s),s=a.charCodeAt(l)),(s===69||s===101)&&(u=!0,s=a.charCodeAt(++l),(s===43||s===45)&&(s=a.charCodeAt(++l)),l=fy(e,l,s),s=a.charCodeAt(l)),s===46||_j(s))throw sr(e,l,"Invalid number, expected digit but got: ".concat($s(s),"."));return new Rt(u?H.FLOAT:H.INT,t,l,r,o,i,a.slice(t,l))}function fy(e,t,n){var r=e.body,o=t,i=n;if(i>=48&&i<=57){do i=r.charCodeAt(++o);while(i>=48&&i<=57);return o}throw sr(e,o,"Invalid number, expected digit but got: ".concat($s(i),"."))}function xj(e,t,n,r,o){for(var i=e.body,a=t+1,s=a,l=0,u="";a=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Aj(e,t,n,r,o){for(var i=e.body,a=i.length,s=t+1,l=0;s!==a&&!isNaN(l=i.charCodeAt(s))&&(l===95||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122);)++s;return new Rt(H.NAME,t,s,n,r,o,i.slice(t,s))}function _j(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}function py(e,t){var n=new Rj(e,t);return n.parseDocument()}var Rj=function(){function e(n,r){var o=pj(n)?n:new gk(n);this._lexer=new yj(o),this._options=r}var t=e.prototype;return t.parseName=function(){var r=this.expectToken(H.NAME);return{kind:he.NAME,value:r.value,loc:this.loc(r)}},t.parseDocument=function(){var r=this._lexer.token;return{kind:he.DOCUMENT,definitions:this.many(H.SOF,this.parseDefinition,H.EOF),loc:this.loc(r)}},t.parseDefinition=function(){if(this.peek(H.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(H.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var r=this._lexer.token;if(this.peek(H.BRACE_L))return{kind:he.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(r)};var o=this.parseOperationType(),i;return this.peek(H.NAME)&&(i=this.parseName()),{kind:he.OPERATION_DEFINITION,operation:o,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(r)}},t.parseOperationType=function(){var r=this.expectToken(H.NAME);switch(r.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(r)},t.parseVariableDefinitions=function(){return this.optionalMany(H.PAREN_L,this.parseVariableDefinition,H.PAREN_R)},t.parseVariableDefinition=function(){var r=this._lexer.token;return{kind:he.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(H.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(H.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(r)}},t.parseVariable=function(){var r=this._lexer.token;return this.expectToken(H.DOLLAR),{kind:he.VARIABLE,name:this.parseName(),loc:this.loc(r)}},t.parseSelectionSet=function(){var r=this._lexer.token;return{kind:he.SELECTION_SET,selections:this.many(H.BRACE_L,this.parseSelection,H.BRACE_R),loc:this.loc(r)}},t.parseSelection=function(){return this.peek(H.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var r=this._lexer.token,o=this.parseName(),i,a;return this.expectOptionalToken(H.COLON)?(i=o,a=this.parseName()):a=o,{kind:he.FIELD,alias:i,name:a,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(H.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(r){var o=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(H.PAREN_L,o,H.PAREN_R)},t.parseArgument=function(){var r=this._lexer.token,o=this.parseName();return this.expectToken(H.COLON),{kind:he.ARGUMENT,name:o,value:this.parseValueLiteral(!1),loc:this.loc(r)}},t.parseConstArgument=function(){var r=this._lexer.token;return{kind:he.ARGUMENT,name:this.parseName(),value:(this.expectToken(H.COLON),this.parseValueLiteral(!0)),loc:this.loc(r)}},t.parseFragment=function(){var r=this._lexer.token;this.expectToken(H.SPREAD);var o=this.expectOptionalKeyword("on");return!o&&this.peek(H.NAME)?{kind:he.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(r)}:{kind:he.INLINE_FRAGMENT,typeCondition:o?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(r)}},t.parseFragmentDefinition=function(){var r,o=this._lexer.token;return this.expectKeyword("fragment"),((r=this._options)===null||r===void 0?void 0:r.experimentalFragmentVariables)===!0?{kind:he.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(o)}:{kind:he.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(o)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(r){var o=this._lexer.token;switch(o.kind){case H.BRACKET_L:return this.parseList(r);case H.BRACE_L:return this.parseObject(r);case H.INT:return this._lexer.advance(),{kind:he.INT,value:o.value,loc:this.loc(o)};case H.FLOAT:return this._lexer.advance(),{kind:he.FLOAT,value:o.value,loc:this.loc(o)};case H.STRING:case H.BLOCK_STRING:return this.parseStringLiteral();case H.NAME:switch(this._lexer.advance(),o.value){case"true":return{kind:he.BOOLEAN,value:!0,loc:this.loc(o)};case"false":return{kind:he.BOOLEAN,value:!1,loc:this.loc(o)};case"null":return{kind:he.NULL,loc:this.loc(o)};default:return{kind:he.ENUM,value:o.value,loc:this.loc(o)}}case H.DOLLAR:if(!r)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var r=this._lexer.token;return this._lexer.advance(),{kind:he.STRING,value:r.value,block:r.kind===H.BLOCK_STRING,loc:this.loc(r)}},t.parseList=function(r){var o=this,i=this._lexer.token,a=function(){return o.parseValueLiteral(r)};return{kind:he.LIST,values:this.any(H.BRACKET_L,a,H.BRACKET_R),loc:this.loc(i)}},t.parseObject=function(r){var o=this,i=this._lexer.token,a=function(){return o.parseObjectField(r)};return{kind:he.OBJECT,fields:this.any(H.BRACE_L,a,H.BRACE_R),loc:this.loc(i)}},t.parseObjectField=function(r){var o=this._lexer.token,i=this.parseName();return this.expectToken(H.COLON),{kind:he.OBJECT_FIELD,name:i,value:this.parseValueLiteral(r),loc:this.loc(o)}},t.parseDirectives=function(r){for(var o=[];this.peek(H.AT);)o.push(this.parseDirective(r));return o},t.parseDirective=function(r){var o=this._lexer.token;return this.expectToken(H.AT),{kind:he.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r),loc:this.loc(o)}},t.parseTypeReference=function(){var r=this._lexer.token,o;return this.expectOptionalToken(H.BRACKET_L)?(o=this.parseTypeReference(),this.expectToken(H.BRACKET_R),o={kind:he.LIST_TYPE,type:o,loc:this.loc(r)}):o=this.parseNamedType(),this.expectOptionalToken(H.BANG)?{kind:he.NON_NULL_TYPE,type:o,loc:this.loc(r)}:o},t.parseNamedType=function(){var r=this._lexer.token;return{kind:he.NAMED_TYPE,name:this.parseName(),loc:this.loc(r)}},t.parseTypeSystemDefinition=function(){var r=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(r.kind===H.NAME)switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(r)},t.peekDescription=function(){return this.peek(H.STRING)||this.peek(H.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("schema");var i=this.parseDirectives(!0),a=this.many(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);return{kind:he.SCHEMA_DEFINITION,description:o,directives:i,operationTypes:a,loc:this.loc(r)}},t.parseOperationTypeDefinition=function(){var r=this._lexer.token,o=this.parseOperationType();this.expectToken(H.COLON);var i=this.parseNamedType();return{kind:he.OPERATION_TYPE_DEFINITION,operation:o,type:i,loc:this.loc(r)}},t.parseScalarTypeDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("scalar");var i=this.parseName(),a=this.parseDirectives(!0);return{kind:he.SCALAR_TYPE_DEFINITION,description:o,name:i,directives:a,loc:this.loc(r)}},t.parseObjectTypeDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("type");var i=this.parseName(),a=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),l=this.parseFieldsDefinition();return{kind:he.OBJECT_TYPE_DEFINITION,description:o,name:i,interfaces:a,directives:s,fields:l,loc:this.loc(r)}},t.parseImplementsInterfaces=function(){var r;if(!this.expectOptionalKeyword("implements"))return[];if(((r=this._options)===null||r===void 0?void 0:r.allowLegacySDLImplementsInterfaces)===!0){var o=[];this.expectOptionalToken(H.AMP);do o.push(this.parseNamedType());while(this.expectOptionalToken(H.AMP)||this.peek(H.NAME));return o}return this.delimitedMany(H.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var r;return((r=this._options)===null||r===void 0?void 0:r.allowLegacySDLEmptyFields)===!0&&this.peek(H.BRACE_L)&&this._lexer.lookahead().kind===H.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(H.BRACE_L,this.parseFieldDefinition,H.BRACE_R)},t.parseFieldDefinition=function(){var r=this._lexer.token,o=this.parseDescription(),i=this.parseName(),a=this.parseArgumentDefs();this.expectToken(H.COLON);var s=this.parseTypeReference(),l=this.parseDirectives(!0);return{kind:he.FIELD_DEFINITION,description:o,name:i,arguments:a,type:s,directives:l,loc:this.loc(r)}},t.parseArgumentDefs=function(){return this.optionalMany(H.PAREN_L,this.parseInputValueDef,H.PAREN_R)},t.parseInputValueDef=function(){var r=this._lexer.token,o=this.parseDescription(),i=this.parseName();this.expectToken(H.COLON);var a=this.parseTypeReference(),s;this.expectOptionalToken(H.EQUALS)&&(s=this.parseValueLiteral(!0));var l=this.parseDirectives(!0);return{kind:he.INPUT_VALUE_DEFINITION,description:o,name:i,type:a,defaultValue:s,directives:l,loc:this.loc(r)}},t.parseInterfaceTypeDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("interface");var i=this.parseName(),a=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),l=this.parseFieldsDefinition();return{kind:he.INTERFACE_TYPE_DEFINITION,description:o,name:i,interfaces:a,directives:s,fields:l,loc:this.loc(r)}},t.parseUnionTypeDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("union");var i=this.parseName(),a=this.parseDirectives(!0),s=this.parseUnionMemberTypes();return{kind:he.UNION_TYPE_DEFINITION,description:o,name:i,directives:a,types:s,loc:this.loc(r)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(H.EQUALS)?this.delimitedMany(H.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("enum");var i=this.parseName(),a=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();return{kind:he.ENUM_TYPE_DEFINITION,description:o,name:i,directives:a,values:s,loc:this.loc(r)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(H.BRACE_L,this.parseEnumValueDefinition,H.BRACE_R)},t.parseEnumValueDefinition=function(){var r=this._lexer.token,o=this.parseDescription(),i=this.parseName(),a=this.parseDirectives(!0);return{kind:he.ENUM_VALUE_DEFINITION,description:o,name:i,directives:a,loc:this.loc(r)}},t.parseInputObjectTypeDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("input");var i=this.parseName(),a=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();return{kind:he.INPUT_OBJECT_TYPE_DEFINITION,description:o,name:i,directives:a,fields:s,loc:this.loc(r)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(H.BRACE_L,this.parseInputValueDef,H.BRACE_R)},t.parseTypeSystemExtension=function(){var r=this._lexer.lookahead();if(r.kind===H.NAME)switch(r.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(r)},t.parseSchemaExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var o=this.parseDirectives(!0),i=this.optionalMany(H.BRACE_L,this.parseOperationTypeDefinition,H.BRACE_R);if(o.length===0&&i.length===0)throw this.unexpected();return{kind:he.SCHEMA_EXTENSION,directives:o,operationTypes:i,loc:this.loc(r)}},t.parseScalarTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var o=this.parseName(),i=this.parseDirectives(!0);if(i.length===0)throw this.unexpected();return{kind:he.SCALAR_TYPE_EXTENSION,name:o,directives:i,loc:this.loc(r)}},t.parseObjectTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var o=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(i.length===0&&a.length===0&&s.length===0)throw this.unexpected();return{kind:he.OBJECT_TYPE_EXTENSION,name:o,interfaces:i,directives:a,fields:s,loc:this.loc(r)}},t.parseInterfaceTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var o=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),s=this.parseFieldsDefinition();if(i.length===0&&a.length===0&&s.length===0)throw this.unexpected();return{kind:he.INTERFACE_TYPE_EXTENSION,name:o,interfaces:i,directives:a,fields:s,loc:this.loc(r)}},t.parseUnionTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var o=this.parseName(),i=this.parseDirectives(!0),a=this.parseUnionMemberTypes();if(i.length===0&&a.length===0)throw this.unexpected();return{kind:he.UNION_TYPE_EXTENSION,name:o,directives:i,types:a,loc:this.loc(r)}},t.parseEnumTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var o=this.parseName(),i=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();if(i.length===0&&a.length===0)throw this.unexpected();return{kind:he.ENUM_TYPE_EXTENSION,name:o,directives:i,values:a,loc:this.loc(r)}},t.parseInputObjectTypeExtension=function(){var r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var o=this.parseName(),i=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();if(i.length===0&&a.length===0)throw this.unexpected();return{kind:he.INPUT_OBJECT_TYPE_EXTENSION,name:o,directives:i,fields:a,loc:this.loc(r)}},t.parseDirectiveDefinition=function(){var r=this._lexer.token,o=this.parseDescription();this.expectKeyword("directive"),this.expectToken(H.AT);var i=this.parseName(),a=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var l=this.parseDirectiveLocations();return{kind:he.DIRECTIVE_DEFINITION,description:o,name:i,arguments:a,repeatable:s,locations:l,loc:this.loc(r)}},t.parseDirectiveLocations=function(){return this.delimitedMany(H.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var r=this._lexer.token,o=this.parseName();if(hj[o.value]!==void 0)return o;throw this.unexpected(r)},t.loc=function(r){var o;if(((o=this._options)===null||o===void 0?void 0:o.noLocation)!==!0)return new pk(r,this._lexer.lastToken,this._lexer.source)},t.peek=function(r){return this._lexer.token.kind===r},t.expectToken=function(r){var o=this._lexer.token;if(o.kind===r)return this._lexer.advance(),o;throw sr(this._lexer.source,o.start,"Expected ".concat(vk(r),", found ").concat(hy(o),"."))},t.expectOptionalToken=function(r){var o=this._lexer.token;if(o.kind===r)return this._lexer.advance(),o},t.expectKeyword=function(r){var o=this._lexer.token;if(o.kind===H.NAME&&o.value===r)this._lexer.advance();else throw sr(this._lexer.source,o.start,'Expected "'.concat(r,'", found ').concat(hy(o),"."))},t.expectOptionalKeyword=function(r){var o=this._lexer.token;return o.kind===H.NAME&&o.value===r?(this._lexer.advance(),!0):!1},t.unexpected=function(r){var o=r??this._lexer.token;return sr(this._lexer.source,o.start,"Unexpected ".concat(hy(o),"."))},t.any=function(r,o,i){this.expectToken(r);for(var a=[];!this.expectOptionalToken(i);)a.push(o.call(this));return a},t.optionalMany=function(r,o,i){if(this.expectOptionalToken(r)){var a=[];do a.push(o.call(this));while(!this.expectOptionalToken(i));return a}return[]},t.many=function(r,o,i){this.expectToken(r);var a=[];do a.push(o.call(this));while(!this.expectOptionalToken(i));return a},t.delimitedMany=function(r,o){this.expectOptionalToken(r);var i=[];do i.push(o.call(this));while(this.expectOptionalToken(r));return i},e}();function hy(e){var t=e.value;return vk(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function vk(e){return Sj(e)?'"'.concat(e,'"'):e}var Pj={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},kj=Object.freeze({});function Nj(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pj,r=void 0,o=Array.isArray(e),i=[e],a=-1,s=[],l=void 0,u=void 0,c=void 0,d=[],f=[],p=e;do{a++;var h=a===i.length,m=h&&s.length!==0;if(h){if(u=f.length===0?void 0:d[d.length-1],l=c,c=f.pop(),m){if(o)l=l.slice();else{for(var E={},g=0,y=Object.keys(l);gDj&&(l=s+St(`( `,gh(Z(o,` `)),` )`)),Z([l,Z(i," "),a]," ")},Argument:function(t){var n=t.name,r=t.value;return n+": "+r},FragmentSpread:function(t){var n=t.name,r=t.directives;return"..."+n+St(" ",Z(r," "))},InlineFragment:function(t){var n=t.typeCondition,r=t.directives,o=t.selectionSet;return Z(["...",St("on ",n),Z(r," "),o]," ")},FragmentDefinition:function(t){var n=t.name,r=t.typeCondition,o=t.variableDefinitions,i=t.directives,a=t.selectionSet;return"fragment ".concat(n).concat(St("(",Z(o,", "),")")," ")+"on ".concat(r," ").concat(St("",Z(i," ")," "))+a},IntValue:function(t){var n=t.value;return n},FloatValue:function(t){var n=t.value;return n},StringValue:function(t,n){var r=t.value,o=t.block;return o?vj(r,n==="description"?"":" "):JSON.stringify(r)},BooleanValue:function(t){var n=t.value;return n?"true":"false"},NullValue:function(){return"null"},EnumValue:function(t){var n=t.value;return n},ListValue:function(t){var n=t.values;return"["+Z(n,", ")+"]"},ObjectValue:function(t){var n=t.fields;return"{"+Z(n,", ")+"}"},ObjectField:function(t){var n=t.name,r=t.value;return n+": "+r},Directive:function(t){var n=t.name,r=t.arguments;return"@"+n+St("(",Z(r,", "),")")},NamedType:function(t){var n=t.name;return n},ListType:function(t){var n=t.type;return"["+n+"]"},NonNullType:function(t){var n=t.type;return n+"!"},SchemaDefinition:oo(function(e){var t=e.directives,n=e.operationTypes;return Z(["schema",Z(t," "),io(n)]," ")}),OperationTypeDefinition:function(t){var n=t.operation,r=t.type;return n+": "+r},ScalarTypeDefinition:oo(function(e){var t=e.name,n=e.directives;return Z(["scalar",t,Z(n," ")]," ")}),ObjectTypeDefinition:oo(function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Z(["type",t,St("implements ",Z(n," & ")),Z(r," "),io(o)]," ")}),FieldDefinition:oo(function(e){var t=e.name,n=e.arguments,r=e.type,o=e.directives;return t+(pI(n)?St(`( `,gh(Z(n,` `)),` )`):St("(",Z(n,", "),")"))+": "+r+St(" ",Z(o," "))}),InputValueDefinition:oo(function(e){var t=e.name,n=e.type,r=e.defaultValue,o=e.directives;return Z([t+": "+n,St("= ",r),Z(o," ")]," ")}),InterfaceTypeDefinition:oo(function(e){var t=e.name,n=e.interfaces,r=e.directives,o=e.fields;return Z(["interface",t,St("implements ",Z(n," & ")),Z(r," "),io(o)]," ")}),UnionTypeDefinition:oo(function(e){var t=e.name,n=e.directives,r=e.types;return Z(["union",t,Z(n," "),r&&r.length!==0?"= "+Z(r," | "):""]," ")}),EnumTypeDefinition:oo(function(e){var t=e.name,n=e.directives,r=e.values;return Z(["enum",t,Z(n," "),io(r)]," ")}),EnumValueDefinition:oo(function(e){var t=e.name,n=e.directives;return Z([t,Z(n," ")]," ")}),InputObjectTypeDefinition:oo(function(e){var t=e.name,n=e.directives,r=e.fields;return Z(["input",t,Z(n," "),io(r)]," ")}),DirectiveDefinition:oo(function(e){var t=e.name,n=e.arguments,r=e.repeatable,o=e.locations;return"directive @"+t+(pI(n)?St(`( `,gh(Z(n,` `)),` )`):St("(",Z(n,", "),")"))+(r?" repeatable":"")+" on "+Z(o," | ")}),SchemaExtension:function(t){var n=t.directives,r=t.operationTypes;return Z(["extend schema",Z(n," "),io(r)]," ")},ScalarTypeExtension:function(t){var n=t.name,r=t.directives;return Z(["extend scalar",n,Z(r," ")]," ")},ObjectTypeExtension:function(t){var n=t.name,r=t.interfaces,o=t.directives,i=t.fields;return Z(["extend type",n,St("implements ",Z(r," & ")),Z(o," "),io(i)]," ")},InterfaceTypeExtension:function(t){var n=t.name,r=t.interfaces,o=t.directives,i=t.fields;return Z(["extend interface",n,St("implements ",Z(r," & ")),Z(o," "),io(i)]," ")},UnionTypeExtension:function(t){var n=t.name,r=t.directives,o=t.types;return Z(["extend union",n,Z(r," "),o&&o.length!==0?"= "+Z(o," | "):""]," ")},EnumTypeExtension:function(t){var n=t.name,r=t.directives,o=t.values;return Z(["extend enum",n,Z(r," "),io(o)]," ")},InputObjectTypeExtension:function(t){var n=t.name,r=t.directives,o=t.fields;return Z(["extend input",n,Z(r," "),io(o)]," ")}};function oo(e){return function(t){return Z([t.description,e(t)],` `)}}function Z(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(t=e==null?void 0:e.filter(function(r){return r}).join(n))!==null&&t!==void 0?t:""}function io(e){return St(`{ `,gh(Z(e,` `)),` }`)}function St(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+n:""}function gh(e){return St(" ",e.replace(/\n/g,` `))}function Fj(e){return e.indexOf(` `)!==-1}function pI(e){return e!=null&&e.some(Fj)}class zd extends om{constructor(t){super(t),this.constructor=zd,Object.setPrototypeOf(this,zd.prototype)}}class Hd extends zd{constructor(t={}){super({name:"CanceledError",message:"Request is canceled by user",...t}),this.constructor=Hd,Object.setPrototypeOf(this,Hd.prototype)}}const Lj=e=>!!e&&e instanceof Hd;var cS;(function(e){e.InvalidApiName="InvalidApiName"})(cS||(cS={}));cS.InvalidApiName+"";const yk=async e=>{var n;if(!e)return;const t=await Qa(Uj(e));if(t){const r=await((n=e.body)==null?void 0:n.text());return $j(t,{statusCode:e.statusCode,headers:e.headers,body:r})}},Uj=e=>{let t;const n=new Proxy(e.body,{get(o,i,a){return i==="json"?async()=>{t||(t=o.text());try{return JSON.parse(await t)}catch{return{}}}:i==="text"?async()=>(t||(t=o.text()),t):Reflect.get(o,i,a)}});return new Proxy(e,{get(o,i,a){return i==="body"?n:Reflect.get(o,i,a)}})},$j=(e,t)=>{const n=new zd({name:e==null?void 0:e.name,message:e.message,underlyingError:e,response:t});return Object.assign(n,{$metadata:e.$metadata})},dS=new Lt("RestApis");function jj(e,t){const n=l=>!!t,r=new AbortController,o=r.signal,i=t==null?void 0:t.signal;let a;const s=async()=>{try{const l=await(n(e)?e():e(o));if(l.statusCode>=300)throw await yk(l);return l}catch(l){const u=i??o,c=a??u.reason;if(l.name==="AbortError"||(u==null?void 0:u.aborted)===!0){const d=new Hd({...c&&{message:c},underlyingError:l,recoverySuggestion:"The API request was explicitly canceled. If this is not intended, validate if you called the `cancel()` function on the API request erroneously."});throw dS.debug(l),d}throw dS.debug(l),l}};if(n())return s();{const l=u=>{o.aborted!==!0&&(r.abort(u),u&&o.reason!==u&&(a=u))};return{response:s(),cancel:l}}}const hI="execute-api",Bj="us-east-1",zj=/^.+\.([a-z0-9-]+)\.([a-z0-9-]+)\.amazonaws\.com/,Hj=(e,t)=>{const{service:n=hI,region:r=Bj}={},{hostname:o}=e,[,i,a]=zj.exec(o)??[];return i===hI?{service:i,region:a??r}:i==="appsync-api"?{service:"appsync",region:a??r}:{service:n,region:r}},Wj=({headers:e},t)=>!e.authorization&&!e["x-api-key"]&&!!t,Vj=(e,t)=>{const n={};for(const r in e)n[r.toLowerCase()]=e[r];return t&&(n["content-type"]="application/json; charset=UTF-8",t instanceof FormData&&delete n["content-type"]),n},Kj=gf(gb,[mb,hb,WU]),Gj=gf(gb,[mb,hb]),qj=async(e,t,n,r)=>{var y,v,S;const{url:o,method:i,headers:a,body:s,withCredentials:l,abortSignal:u,retryStrategy:c}=t,d=s?s instanceof FormData?s:JSON.stringify(s??""):void 0,f=Vj(a,s),p={url:o,headers:f,method:i,body:d},h={retryDecider:Qj(c??((S=(v=(y=e==null?void 0:e.libraryOptions)==null?void 0:y.API)==null?void 0:v.REST)==null?void 0:S.retryStrategy)),computeDelay:vb,withCrossDomainCredentials:l,abortSignal:u},m=n(p,r);let E;const g=await Yj(e);if(m&&g){const x=Hj(o),I=(r==null?void 0:r.service)??x.service,T=(r==null?void 0:r.region)??x.region;E=await Kj(p,{...h,credentials:g,region:T,service:I})}else E=await Gj(p,{...h});return{statusCode:E.statusCode,headers:E.headers,body:E.body}},Qj=e=>(e==null?void 0:e.strategy)==="no-retry"?()=>Promise.resolve({retryable:!1}):yb(yk),Yj=async e=>{try{const{credentials:t}=await e.Auth.fetchAuthSession();if(t)return t}catch{dS.debug("No credentials available, the request will be unsigned.")}return null},Db=new WeakMap,Xj=(e,{url:t,options:n,abortController:r})=>{const o=r??new AbortController,a=jj(async()=>qj(e,{url:t,method:"POST",...n,abortSignal:o.signal,retryStrategy:{strategy:"jittered-exponential-backoff"}},Wj,n==null?void 0:n.signingServiceInfo),o).finally(()=>{Db.delete(a)});return a},Jj=(e,t)=>{const n=Db.get(e);return n?(n.abort(t),t&&n.signal.reason!==t&&(n.signal.reason=t),!0):!1},Zj=(e,t)=>{Db.set(e,t)},e7=5e3,t7=[400,401,403],n7=["BadRequestException","UnauthorizedException"],r7="ConnectionStateChange";var Nr;(function(e){e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_START="start",e.GQL_START_ACK="start_ack",e.DATA="data",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_STOP="stop",e.GQL_COMPLETE="complete",e.GQL_ERROR="error",e.EVENT_SUBSCRIBE="subscribe",e.EVENT_PUBLISH="publish",e.EVENT_SUBSCRIBE_ACK="subscribe_success",e.EVENT_PUBLISH_ACK="publish_success",e.EVENT_STOP="unsubscribe",e.EVENT_COMPLETE="unsubscribe_success"})(Nr||(Nr={}));var fi;(function(e){e[e.PENDING=0]="PENDING",e[e.CONNECTED=1]="CONNECTED",e[e.FAILED=2]="FAILED"})(fi||(fi={}));var Cn;(function(e){e[e.CLOSED=0]="CLOSED",e[e.READY=1]="READY",e[e.CONNECTING=2]="CONNECTING"})(Cn||(Cn={}));const o7={accept:"application/json, text/javascript","content-encoding":"amz-1.0","content-type":"application/json; charset=UTF-8"},mI=15e3,i7=15e3,a7=5*60*1e3,s7=5*1e3,l7=65*1e3,u7=5*1e3,c7=60*1e3;var ao;(function(e){e.CONNECTION_CLOSED="Connection closed",e.CONNECTION_FAILED="Connection failed",e.REALTIME_SUBSCRIPTION_INIT_ERROR="AppSync Realtime subscription init error",e.SUBSCRIPTION_ACK="Subscription ack",e.TIMEOUT_DISCONNECT="Timeout disconnect"})(ao||(ao={}));var rn;(function(e){e.Connected="Connected",e.ConnectedPendingNetwork="ConnectedPendingNetwork",e.ConnectionDisrupted="ConnectionDisrupted",e.ConnectionDisruptedPendingNetwork="ConnectionDisruptedPendingNetwork",e.Connecting="Connecting",e.ConnectedPendingDisconnect="ConnectedPendingDisconnect",e.Disconnected="Disconnected",e.ConnectedPendingKeepAlive="ConnectedPendingKeepAlive"})(rn||(rn={}));const gI=()=>new Hl().networkMonitor(),Pr={KEEP_ALIVE_MISSED:{keepAliveState:"unhealthy"},KEEP_ALIVE:{keepAliveState:"healthy"},CONNECTION_ESTABLISHED:{connectionState:"connected"},CONNECTION_FAILED:{intendedConnectionState:"disconnected",connectionState:"disconnected"},CLOSING_CONNECTION:{intendedConnectionState:"disconnected"},OPENING_CONNECTION:{intendedConnectionState:"connected",connectionState:"connecting"},CLOSED:{connectionState:"disconnected"},ONLINE:{networkState:"connected"},OFFLINE:{networkState:"disconnected"}};class d7{constructor(){this._networkMonitoringSubscription=void 0,this._linkedConnectionState={networkState:"connected",connectionState:"disconnected",intendedConnectionState:"disconnected",keepAliveState:"healthy"},this._initialNetworkStateSubscription=gI().subscribe(({online:t})=>{var n;this.record(t?Pr.ONLINE:Pr.OFFLINE),(n=this._initialNetworkStateSubscription)==null||n.unsubscribe()}),this._linkedConnectionStateObservable=new Yn(t=>{t.next(this._linkedConnectionState),this._linkedConnectionStateObserver=t})}enableNetworkMonitoring(){var t;(t=this._initialNetworkStateSubscription)==null||t.unsubscribe(),this._networkMonitoringSubscription===void 0&&(this._networkMonitoringSubscription=gI().subscribe(({online:n})=>{this.record(n?Pr.ONLINE:Pr.OFFLINE)}))}disableNetworkMonitoring(){var t;(t=this._networkMonitoringSubscription)==null||t.unsubscribe(),this._networkMonitoringSubscription=void 0}get connectionStateObservable(){let t;return this._linkedConnectionStateObservable.pipe(pb(n=>this.connectionStatesTranslator(n))).pipe(ML(n=>{const r=n!==t;return t=n,r}))}record(t){var r;t.intendedConnectionState==="connected"?this.enableNetworkMonitoring():t.intendedConnectionState==="disconnected"&&this.disableNetworkMonitoring();const n={...this._linkedConnectionState,...t};this._linkedConnectionState={...n},(r=this._linkedConnectionStateObserver)==null||r.next(this._linkedConnectionState)}connectionStatesTranslator({connectionState:t,networkState:n,intendedConnectionState:r,keepAliveState:o}){return t==="connected"&&n==="disconnected"?rn.ConnectedPendingNetwork:t==="connected"&&r==="disconnected"?rn.ConnectedPendingDisconnect:t==="disconnected"&&r==="connected"&&n==="disconnected"?rn.ConnectionDisruptedPendingNetwork:t==="disconnected"&&r==="connected"?rn.ConnectionDisrupted:t==="connected"&&o==="unhealthy"?rn.ConnectedPendingKeepAlive:t==="connecting"?rn.Connecting:t==="disconnected"?rn.Disconnected:rn.Connected}}var vu;(function(e){e.START_RECONNECT="START_RECONNECT",e.HALT_RECONNECT="HALT_RECONNECT"})(vu||(vu={}));class f7{constructor(){this.reconnectObservers=[]}addObserver(t){this.reconnectObservers.push(t)}record(t){t===vu.START_RECONNECT&&this.reconnectSetTimeoutId===void 0&&this.reconnectIntervalId===void 0&&(this.reconnectSetTimeoutId=setTimeout(()=>{this._triggerReconnect(),this.reconnectIntervalId=setInterval(()=>{this._triggerReconnect()},c7)},u7)),t===vu.HALT_RECONNECT&&(this.reconnectIntervalId&&(clearInterval(this.reconnectIntervalId),this.reconnectIntervalId=void 0),this.reconnectSetTimeoutId&&(clearTimeout(this.reconnectSetTimeoutId),this.reconnectSetTimeoutId=void 0))}close(){this.reconnectObservers.forEach(t=>{var n;(n=t.complete)==null||n.call(t)})}_triggerReconnect(){this.reconnectObservers.forEach(t=>{var n;(n=t.next)==null||n.call(t)})}}const vI="wss://",p7=/^https:\/\/\w{26}\.appsync-api\.\w{2}(?:(?:-\w{2,})+)-\d\.amazonaws.com(?:\.cn)?\/graphql$/i,h7=/^https:\/\/\w{26}\.\w+-api\.\w{2}(?:(?:-\w{2,})+)-\d\.amazonaws.com(?:\.cn)?\/event$/i,yI="/realtime",m7=e=>e.match(p7)===null,g7=e=>e.match(h7)!==null,v7=e=>{let t=e??"";return g7(t)?t=t.concat(yI).replace("ddpg-api","grt-gamma").replace("appsync-api","appsync-realtime-api"):m7(t)?t=t.concat(yI):t=t.replace("appsync-api","appsync-realtime-api").replace("gogi-beta","grt-beta").replace("ddpg-api","grt-gamma"),t=t.replace("https://",vI).replace("http://",vI),new Hr(t)},y7=e=>{if(!e)return{};if("Authorization"in e){const{Authorization:t,...n}=e;return n}return e},S7=e=>{const t=y7(e),n=new mP;return Object.entries(t).forEach(([r,o])=>{n.append(r,o)}),n},b7=(e,t)=>{const n=v7(e),r=new mP(n.search);for(const[o,i]of t.entries())r.append(o,i);return n.search=r.toString(),n.toString()},my=async e=>{const{appSyncGraphqlEndpoint:t,query:n,libraryConfigHeaders:r=()=>({}),additionalHeaders:o={},authToken:i}=e;let a={};const s=await r();return typeof o=="function"?a=await o({url:t||"",queryString:n||""}):a=o,i&&(a={...a,Authorization:i}),{additionalCustomHeaders:a,libraryConfigHeaders:s}},SI=new Lt("AWSAppSyncRealTimeProvider Auth"),bI=async({host:e})=>{var n,r;const t=await hf();return{Authorization:(r=(n=t==null?void 0:t.tokens)==null?void 0:n.accessToken)==null?void 0:r.toString(),host:e}},E7=async({apiKey:e,host:t})=>{const r=new Date().toISOString().replace(/[:-]|\.\d{3}/g,"");return{host:t,"x-amz-date":r,"x-api-key":e}},w7=async({payload:e,canonicalUri:t,appSyncGraphqlEndpoint:n,region:r})=>{const o={region:r,service:"appsync"},i=(await hf()).credentials,a={url:`${n}${t}`,data:e,method:"POST",headers:{...o7}};return TP({headers:a.headers,method:a.method,url:new Hr(a.url),body:a.data},{credentials:i,signingRegion:o.region,signingService:o.service}).headers},EI=async({host:e,additionalCustomHeaders:t})=>{if(!(t!=null&&t.Authorization))throw new Error("No auth token specified");return{Authorization:t.Authorization,host:e}},Sk=async({apiKey:e,authenticationType:t,canonicalUri:n,appSyncGraphqlEndpoint:r,region:o,additionalCustomHeaders:i,payload:a})=>{const s={apiKey:E7,iam:w7,oidc:bI,userPool:bI,lambda:EI,none:EI};if(!t||!s[t]){SI.debug(`Authentication type ${t} not supported`);return}else{const l=s[t],u=r?new Hr(r).host:void 0,c=t==="apiKey"?e:void 0;return SI.debug(`Authenticating with ${JSON.stringify(t)}`),await l({payload:a,canonicalUri:n,appSyncGraphqlEndpoint:r,apiKey:c,region:o,host:u,additionalCustomHeaders:i})}},wI=e=>{dr.dispatch("api",e,"PubSub",wo)};class C7{constructor(t){this.subscriptionObserverMap=new Map,this.allowNoSubscriptions=!1,this.socketStatus=Cn.CLOSED,this.keepAliveTimestamp=Date.now(),this.promiseArray=[],this.connectionStateMonitor=new d7,this.reconnectionMonitor=new f7,this._establishConnection=async(n,r)=>{this.logger.debug(`Establishing WebSocket connection to ${n}`);try{await this._openConnection(n,r),await this._initiateHandshake()}catch(o){const{errorType:i,errorCode:a}=o;throw t7.includes(a)||n7.includes(i)?new GU(i):i?new Error(i):o}},this.logger=new Lt(t.providerName),this.wsProtocolName=t.wsProtocolName,this.wsConnectUri=t.connectUri,this.connectionStateMonitorSubscription=this._startConnectionStateMonitoring()}close(){return this.socketStatus=Cn.CLOSED,this.connectionStateMonitor.record(Pr.CONNECTION_FAILED),this.connectionStateMonitorSubscription.unsubscribe(),this.reconnectionMonitor.close(),new Promise((t,n)=>{this.awsRealTimeSocket?(this.awsRealTimeSocket.onclose=r=>{this._closeSocket(),this.subscriptionObserverMap=new Map,this.awsRealTimeSocket=void 0,t()},this.awsRealTimeSocket.onerror=r=>{n(r)},this.awsRealTimeSocket.close()):t()})}subscribe(t,n){return new Yn(r=>{if(!(t!=null&&t.appSyncGraphqlEndpoint)){r.error({errors:[{...new ud("Subscribe only available for AWS AppSync endpoint")}]}),r.complete();return}let o=!1;const i=Y0(),a=()=>{o||(o=!0,this._startSubscriptionWithAWSAppSyncRealTime({options:t,observer:r,subscriptionId:i,customUserAgentDetails:n}).catch(l=>{this.logger.debug(`${ao.REALTIME_SUBSCRIPTION_INIT_ERROR}: ${l}`),this._closeSocket()}).finally(()=>{o=!1}))},s=new Yn(l=>{this.reconnectionMonitor.addObserver(l)}).subscribe(()=>{a()});return a(),async()=>{await this._cleanupSubscription(i,s)}})}async connect(t){this.socketStatus!==Cn.READY&&await this._connectWebSocket(t)}async publish(t,n){if(this.socketStatus!==Cn.READY)throw new Error("Subscription has not been initialized");return this._publishMessage(t,n)}async _connectWebSocket(t){const{apiKey:n,appSyncGraphqlEndpoint:r,authenticationType:o,region:i}=t,{additionalCustomHeaders:a}=await my(t);this.connectionStateMonitor.record(Pr.OPENING_CONNECTION),await this._initializeWebSocketConnection({apiKey:n,appSyncGraphqlEndpoint:r,authenticationType:o,region:i,additionalCustomHeaders:a})}async _publishMessage(t,n){const r=Y0(),{additionalCustomHeaders:o,libraryConfigHeaders:i}=await my(t),a=await this._prepareSubscriptionPayload({options:t,subscriptionId:r,customUserAgentDetails:n,additionalCustomHeaders:o,libraryConfigHeaders:i,publish:!0});return new Promise((s,l)=>{if(this.awsRealTimeSocket){const u=p=>{const h=JSON.parse(p.data);if(h.id===r&&h.type==="publish_success"&&(this.awsRealTimeSocket&&this.awsRealTimeSocket.removeEventListener("message",u),f(),s()),h.errors&&h.errors.length>0){const m=h.errors.map(E=>E.errorType);f(),l(new Error(`Publish errors: ${m.join(", ")}`))}},c=p=>{f(),l(new Error(`WebSocket error: ${p}`))},d=()=>{f(),l(new Error("WebSocket is closed"))},f=()=>{var p,h,m;(p=this.awsRealTimeSocket)==null||p.removeEventListener("message",u),(h=this.awsRealTimeSocket)==null||h.removeEventListener("error",c),(m=this.awsRealTimeSocket)==null||m.removeEventListener("close",d)};this.awsRealTimeSocket.addEventListener("message",u),this.awsRealTimeSocket.addEventListener("error",c),this.awsRealTimeSocket.addEventListener("close",d),this.awsRealTimeSocket.send(a)}else l(new Error("WebSocket is not connected"))})}async _cleanupSubscription(t,n){n==null||n.unsubscribe();try{await this._waitForSubscriptionToBeConnected(t);const{subscriptionState:r}=this.subscriptionObserverMap.get(t)||{};if(!r)return;if(r===fi.CONNECTED)this._sendUnsubscriptionMessage(t);else throw new Error("Subscription never connected")}catch(r){this.logger.debug(`Error while unsubscribing ${r}`)}finally{this._removeSubscriptionObserver(t)}}_startConnectionStateMonitoring(){return this.connectionStateMonitor.connectionStateObservable.subscribe(t=>{wI({event:r7,data:{provider:this,connectionState:t},message:`Connection state is ${t}`}),this.connectionState=t,t===rn.ConnectionDisrupted&&this.reconnectionMonitor.record(vu.START_RECONNECT),[rn.Connected,rn.ConnectedPendingDisconnect,rn.ConnectedPendingKeepAlive,rn.ConnectedPendingNetwork,rn.ConnectionDisruptedPendingNetwork,rn.Disconnected].includes(t)&&this.reconnectionMonitor.record(vu.HALT_RECONNECT)})}async _startSubscriptionWithAWSAppSyncRealTime({options:t,observer:n,subscriptionId:r,customUserAgentDetails:o}){const{query:i,variables:a}=t;this.subscriptionObserverMap.set(r,{observer:n,query:i??"",variables:a??{},subscriptionState:fi.PENDING,startAckTimeoutId:void 0});const{additionalCustomHeaders:s,libraryConfigHeaders:l}=await my(t),u=await this._prepareSubscriptionPayload({options:t,subscriptionId:r,customUserAgentDetails:o,additionalCustomHeaders:s,libraryConfigHeaders:l});try{await this._connectWebSocket(t)}catch(f){this._logStartSubscriptionError(r,n,f);return}const{subscriptionFailedCallback:c,subscriptionReadyCallback:d}=this.subscriptionObserverMap.get(r)??{};this.subscriptionObserverMap.set(r,{observer:n,subscriptionState:fi.PENDING,query:i??"",variables:a??{},subscriptionReadyCallback:d,subscriptionFailedCallback:c,startAckTimeoutId:setTimeout(()=>{this._timeoutStartSubscriptionAck(r)},i7)}),this.awsRealTimeSocket&&this.awsRealTimeSocket.send(u)}_logStartSubscriptionError(t,n,r){this.logger.debug({err:r});const o=String(r.message??"");if(this._closeSocket(),this.connectionState!==rn.ConnectionDisruptedPendingNetwork){MR(r)?n.error({errors:[{...new ud(`${ao.CONNECTION_FAILED}: ${o}`)}]}):this.logger.debug(`${ao.CONNECTION_FAILED}: ${o}`);const{subscriptionFailedCallback:i}=this.subscriptionObserverMap.get(t)||{};typeof i=="function"&&i()}}async _waitForSubscriptionToBeConnected(t){const n=this.subscriptionObserverMap.get(t);if(n){const{subscriptionState:r}=n;if(r===fi.PENDING)return new Promise((o,i)=>{const{observer:a,subscriptionState:s,variables:l,query:u}=n;this.subscriptionObserverMap.set(t,{observer:a,subscriptionState:s,variables:l,query:u,subscriptionReadyCallback:o,subscriptionFailedCallback:i})})}}_sendUnsubscriptionMessage(t){try{if(this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.socketStatus===Cn.READY){const n=this._unsubscribeMessage(t),r=JSON.stringify(n);this.awsRealTimeSocket.send(r)}}catch(n){this.logger.debug({err:n})}}_removeSubscriptionObserver(t){this.subscriptionObserverMap.delete(t),this.allowNoSubscriptions||setTimeout(this._closeSocketIfRequired.bind(this),1e3)}_closeSocketIfRequired(){if(!(this.subscriptionObserverMap.size>0)){if(!this.awsRealTimeSocket){this.socketStatus=Cn.CLOSED;return}if(this.connectionStateMonitor.record(Pr.CLOSING_CONNECTION),this.awsRealTimeSocket.bufferedAmount>0)setTimeout(this._closeSocketIfRequired.bind(this),1e3);else{this.logger.debug("closing WebSocket...");const t=this.awsRealTimeSocket;t.onclose=null,t.onerror=null,t.close(1e3),this.awsRealTimeSocket=void 0,this.socketStatus=Cn.CLOSED,this._closeSocket()}}}maintainKeepAlive(){this.keepAliveTimestamp=Date.now()}keepAliveHeartbeat(t){const n=Date.now();n-this.keepAliveTimestamp>l7?this.connectionStateMonitor.record(Pr.KEEP_ALIVE_MISSED):this.connectionStateMonitor.record(Pr.KEEP_ALIVE),n-this.keepAliveTimestamp>t&&this._errorDisconnect(ao.TIMEOUT_DISCONNECT)}_handleIncomingSubscriptionMessage(t){if(typeof t.data!="string")return;const[n,r]=this._handleSubscriptionData(t);if(n){this.maintainKeepAlive();return}const{type:o,id:i,payload:a}=r,{observer:s=null,query:l="",variables:u={},startAckTimeoutId:c,subscriptionReadyCallback:d,subscriptionFailedCallback:f}=this.subscriptionObserverMap.get(i)||{};if(o===Nr.GQL_START_ACK||o===Nr.EVENT_SUBSCRIBE_ACK){this.logger.debug(`subscription ready for ${JSON.stringify({query:l,variables:u})}`),typeof d=="function"&&d(),c&&clearTimeout(c),wI({event:ao.SUBSCRIPTION_ACK,data:{query:l,variables:u},message:"Connection established for subscription"});const p=fi.CONNECTED;s&&this.subscriptionObserverMap.set(i,{observer:s,query:l,variables:u,startAckTimeoutId:void 0,subscriptionState:p,subscriptionReadyCallback:d,subscriptionFailedCallback:f}),this.connectionStateMonitor.record(Pr.CONNECTION_ESTABLISHED);return}if(o===Nr.GQL_CONNECTION_KEEP_ALIVE){this.maintainKeepAlive();return}if(o===Nr.GQL_ERROR){const p=fi.FAILED;s&&(this.subscriptionObserverMap.set(i,{observer:s,query:l,variables:u,startAckTimeoutId:c,subscriptionReadyCallback:d,subscriptionFailedCallback:f,subscriptionState:p}),this.logger.debug(`${ao.CONNECTION_FAILED}: ${JSON.stringify(a??r)}`),s.error({errors:[{...new ud(`${ao.CONNECTION_FAILED}: ${JSON.stringify(a??r)}`)}]}),c&&clearTimeout(c),typeof f=="function"&&f())}}_errorDisconnect(t){this.logger.debug(`Disconnect error: ${t}`),this.awsRealTimeSocket&&(this._closeSocket(),this.awsRealTimeSocket.close()),this.socketStatus=Cn.CLOSED}_closeSocket(){this.keepAliveHeartbeatIntervalId&&(clearInterval(this.keepAliveHeartbeatIntervalId),this.keepAliveHeartbeatIntervalId=void 0),this.connectionStateMonitor.record(Pr.CLOSED)}_timeoutStartSubscriptionAck(t){const n=this.subscriptionObserverMap.get(t);if(n){const{observer:r,query:o,variables:i}=n;if(!r)return;this.subscriptionObserverMap.set(t,{observer:r,query:o,variables:i,subscriptionState:fi.FAILED}),this._closeSocket(),this.logger.debug("timeoutStartSubscription",JSON.stringify({query:o,variables:i}))}}_initializeWebSocketConnection({appSyncGraphqlEndpoint:t,authenticationType:n,apiKey:r,region:o,additionalCustomHeaders:i}){if(this.socketStatus!==Cn.READY)return new Promise(async(a,s)=>{if(this.promiseArray.push({res:a,rej:s}),this.socketStatus===Cn.CLOSED)try{this.socketStatus=Cn.CONNECTING;const u=await Sk({authenticationType:n,payload:"{}",canonicalUri:this.wsConnectUri,apiKey:r,appSyncGraphqlEndpoint:t,region:o,additionalCustomHeaders:i}),c=u?JSON.stringify(u):"",f=`header-${Ls.convert(c,{urlSafe:!0,skipPadding:!0})}`,p=S7(i),h=b7(t,p);await this._establishRetryableConnection(h,f),this.promiseArray.forEach(({res:m})=>{this.logger.debug("Notifying connection successful"),m()}),this.socketStatus=Cn.READY,this.promiseArray=[]}catch(l){this.logger.debug("Connection exited with",l),this.promiseArray.forEach(({rej:u})=>{u(l)}),this.promiseArray=[],this.awsRealTimeSocket&&this.awsRealTimeSocket.readyState===WebSocket.OPEN&&this.awsRealTimeSocket.close(3001),this.awsRealTimeSocket=void 0,this.socketStatus=Cn.CLOSED}})}async _establishRetryableConnection(t,n){this.logger.debug("Establishing retryable connection"),await qU(this._establishConnection.bind(this),[t,n],e7)}async _openConnection(t,n){return new Promise((r,o)=>{const i=this._getNewWebSocket(t,[this.wsProtocolName,n]);i.onerror=()=>{this.logger.debug("WebSocket connection error")},i.onclose=()=>{this._closeSocket(),o(new Error("Connection handshake error"))},i.onopen=()=>{this.awsRealTimeSocket=i,r()}})}_getNewWebSocket(t,n){return new WebSocket(t,n)}async _initiateHandshake(){return new Promise((t,n)=>{if(!this.awsRealTimeSocket){n(new Error("awsRealTimeSocket undefined"));return}let r=!1;this.awsRealTimeSocket.onerror=a=>{this.logger.debug(`WebSocket error ${JSON.stringify(a)}`)},this.awsRealTimeSocket.onclose=a=>{this.logger.debug(`WebSocket closed ${a.reason}`),this._closeSocket(),n(new Error(JSON.stringify(a)))},this.awsRealTimeSocket.onmessage=a=>{if(typeof a.data!="string")return;this.logger.debug(`subscription message from AWS AppSyncRealTime: ${a.data} `);const s=JSON.parse(a.data),{type:l}=s,u=this._extractConnectionTimeout(s);if(l===Nr.GQL_CONNECTION_ACK){r=!0,this._registerWebsocketHandlers(u),t("Connected to AWS AppSyncRealTime");return}if(l===Nr.GQL_CONNECTION_ERROR){const{errorType:c,errorCode:d}=this._extractErrorCodeAndType(s);n({errorType:c,errorCode:d})}};const o={type:Nr.GQL_CONNECTION_INIT};this.awsRealTimeSocket.send(JSON.stringify(o));const i=a=>{a||(this.connectionStateMonitor.record(Pr.CONNECTION_FAILED),n(new Error(`Connection timeout: ack from AWSAppSyncRealTime was not received after ${mI} ms`)))};setTimeout(()=>{i(r)},mI)})}_registerWebsocketHandlers(t){this.awsRealTimeSocket&&(this.keepAliveHeartbeatIntervalId=setInterval(()=>{this.keepAliveHeartbeat(t)},s7),this.awsRealTimeSocket.onmessage=this._handleIncomingSubscriptionMessage.bind(this),this.awsRealTimeSocket.onerror=n=>{this.logger.debug(n),this._errorDisconnect(ao.CONNECTION_CLOSED)},this.awsRealTimeSocket.onclose=n=>{this.logger.debug(`WebSocket closed ${n.reason}`),this._closeSocket(),this._errorDisconnect(ao.CONNECTION_CLOSED)})}}const CI="AWSAppSyncRealTimeProvider",x7="graphql-ws",I7="/connect";class T7 extends C7{constructor(){super({providerName:CI,wsProtocolName:x7,connectUri:I7})}getProviderName(){return CI}subscribe(t,n){return super.subscribe(t,n)}async _prepareSubscriptionPayload({options:t,subscriptionId:n,customUserAgentDetails:r,additionalCustomHeaders:o,libraryConfigHeaders:i}){const{appSyncGraphqlEndpoint:a,authenticationType:s,query:l,variables:u,apiKey:c,region:d}=t,p=JSON.stringify({query:l,variables:u}),h={...await Sk({apiKey:c,appSyncGraphqlEndpoint:a,authenticationType:s,payload:p,canonicalUri:"",region:d,additionalCustomHeaders:o}),...i,...o,[OR]:ju(r)},m={id:n,payload:{data:p,extensions:{authorization:{...h}}},type:Nr.GQL_START};return JSON.stringify(m)}_handleSubscriptionData(t){this.logger.debug(`subscription message from AWS AppSync RealTime: ${t.data}`);const{id:n="",payload:r,type:o}=JSON.parse(String(t.data)),{observer:i=null,query:a="",variables:s={}}=this.subscriptionObserverMap.get(n)||{};return this.logger.debug({id:n,observer:i,query:a,variables:s}),o===Nr.DATA&&r&&r.data?(i?i.next(r):this.logger.debug(`observer not found for id: ${n}`),[!0,{id:n,type:o,payload:r}]):[!1,{id:n,type:o,payload:r}]}_unsubscribeMessage(t){return{id:t,type:Nr.GQL_STOP}}_extractConnectionTimeout(t){const{payload:{connectionTimeoutMs:n=a7}={}}=t;return n}_extractErrorCodeAndType(t){const{payload:{errors:[{errorType:n="",errorCode:r=0}={}]=[]}={}}=t;return{errorCode:r,errorType:n}}}class Ho extends wn{constructor(t){super(t),this.constructor=Ho,Object.setPrototypeOf(this,Ho.prototype)}}var Wl;(function(e){e.NoAuthSession="NoAuthSession",e.NoRegion="NoRegion",e.NoCustomEndpoint="NoCustomEndpoint"})(Wl||(Wl={}));const A7={[Wl.NoAuthSession]:{message:"Auth session should not be empty."},[Wl.NoRegion]:{message:"Missing region."},[Wl.NoCustomEndpoint]:{message:"Custom endpoint region is present without custom endpoint."}};function _7(e,t){const{message:n,recoverySuggestion:r}=A7[t];if(!e)throw new Ho({name:t,message:n,recoverySuggestion:r})}const R7=new Lt("GraphQLAPI resolveConfig"),xI=e=>{var l,u;const t=e.getConfig();(l=t.API)!=null&&l.GraphQL||R7.warn("The API configuration is missing. This is likely due to Amplify.configure() not being called prior to generateClient().");const{apiKey:n,customEndpoint:r,customEndpointRegion:o,defaultAuthMode:i,endpoint:a,region:s}=((u=t.API)==null?void 0:u.GraphQL)??{};return _7(!(!r&&o),Wl.NoCustomEndpoint),{apiKey:n,customEndpoint:r,customEndpointRegion:o,defaultAuthMode:i,endpoint:a,region:s}},II=e=>{var r,o,i,a,s,l;const t=(i=(o=(r=e.libraryOptions)==null?void 0:r.API)==null?void 0:o.GraphQL)==null?void 0:i.headers,n=(l=(s=(a=e.libraryOptions)==null?void 0:a.API)==null?void 0:s.GraphQL)==null?void 0:l.withCredentials;return{headers:t,withCredentials:n}};function TI(e){return e.errors&&Array.isArray(e.errors)&&e.errors.forEach(t=>{P7(t)&&(t.message="Unauthorized",t.recoverySuggestion=`If you're calling an Amplify-generated API, make sure to set the "authMode" in generateClient({ authMode: '...' }) to the backend authorization rule's auth provider ('apiKey', 'userPool', 'iam', 'oidc', 'lambda')`)}),e}function P7(e){var t,n,r,o;return!!((n=(t=e==null?void 0:e.originalError)==null?void 0:t.name)!=null&&n.startsWith("UnauthorizedException")||(r=e.message)!=null&&r.startsWith("Connection failed:")&&((o=e.message)!=null&&o.includes("Permission denied")))}var js;(function(e){e.NO_API_KEY="No api-key configured",e.NO_CURRENT_USER="No current user",e.NO_CREDENTIALS="No credentials",e.NO_FEDERATED_JWT="No federated jwt",e.NO_AUTH_TOKEN="No auth token specified"})(js||(js={}));const bk=Symbol("amplify"),vh=Symbol("authMode"),Ek=Symbol("authToken"),fS=Symbol("apiKey"),wk=Symbol("headers"),yh=Symbol("endpoint");function Mb(e){const t=e;return{amplify:t[bk],apiKey:t[fS],authMode:t[vh],authToken:t[Ek],endpoint:t[yh],headers:t[wk]}}const k7={name:"NoApiKey",message:js.NO_API_KEY,recoverySuggestion:'The API request was made with `authMode: "apiKey"` but no API Key was passed into `Amplify.configure()`. Review if your API key is passed into the `Amplify.configure()` function.'},N7={name:"NoCredentials",message:js.NO_CREDENTIALS,recoverySuggestion:'The API request was made with `authMode: "iam"` but no authentication credentials are available.\n\nIf you intended to make a request using an authenticated role, review if your user is signed in before making the request.\n\nIf you intend to make a request using an unauthenticated role or also known as "guest access", verify if "Auth.Cognito.allowGuestAccess" is set to "true" in the `Amplify.configure()` function.'},O7={name:"NoValidAuthTokens",message:js.NO_FEDERATED_JWT,recoverySuggestion:"If you intended to make an authenticated API request, review if the current user is signed in."},D7={name:"NoSignedUser",message:js.NO_CURRENT_USER,recoverySuggestion:"Review the underlying exception field for more details. If you intended to make an authenticated API request, review if the current user is signed in."},M7={name:"NoAuthorizationHeader",message:js.NO_AUTH_TOKEN,recoverySuggestion:'The API request was made with `authMode: "lambda"` but no `authToken` is set. Review if a valid authToken is passed into the request options or in the `Amplify.configure()` function.'},F7={name:"NoEndpoint",message:"No GraphQL endpoint configured in `Amplify.configure()`.",recoverySuggestion:"Review if the GraphQL API endpoint is set in the `Amplify.configure()` function."},AI=e=>({data:{},errors:[new ud(e.message,null,null,null,null,e)]});function L7(e){if(!e)return!1;const t=e;return Array.isArray(t.errors)&&t.errors.length>0}async function U7(e,t,n,r={}){var i;let o={};switch(t){case"apiKey":if(!n)throw new Ho(k7);o={"X-Api-Key":n};break;case"iam":{if((await e.Auth.fetchAuthSession()).credentials===void 0)throw new Ho(N7);break}case"oidc":case"userPool":{let a;try{a=(i=(await e.Auth.fetchAuthSession()).tokens)==null?void 0:i.accessToken.toString()}catch(s){throw new Ho({...D7,underlyingError:s})}if(!a)throw new Ho(O7);o={Authorization:a};break}case"lambda":if(typeof r=="object"&&!r.Authorization)throw new Ho(M7);o={Authorization:r.Authorization};break}return o}const $7="x-amz-user-agent",j7=e=>typeof e!="function";class B7{constructor(){this.appSyncRealTime=new Map,this._api={post:Xj,cancelREST:Jj,isCancelErrorREST:Lj,updateRequestToBeCancellable:Zj}}getModuleName(){return"InternalGraphQLAPI"}getGraphqlOperationType(t){const r=py(t).definitions,[{operation:o}]=r;return o}graphql(t,{query:n,variables:r={},authMode:o,authToken:i,endpoint:a,apiKey:s},l,u){const c=py(typeof n=="string"?n:Sc(n)),[d={}]=c.definitions.filter(h=>h.kind==="OperationDefinition"),{operation:f}=d,p=l||{};switch(f){case"query":case"mutation":{const h=new AbortController;let m;return j7(t)?m=this._graphql(t,{query:c,variables:r,authMode:o,apiKey:s,endpoint:a},p,h,u,i):m=t(async g=>await this._graphql(g,{query:c,variables:r,authMode:o,apiKey:s,endpoint:a},p,h,u,i)),this._api.updateRequestToBeCancellable(m,h),m}case"subscription":return this._graphqlSubscribe(t,{query:c,variables:r,authMode:o,apiKey:s,endpoint:a},p,u,i);default:throw new Error(`invalid operation type: ${f}`)}}async _graphql(t,{query:n,variables:r,authMode:o,endpoint:i,apiKey:a},s={},l,u,c){const{apiKey:d,region:f,endpoint:p,customEndpoint:h,customEndpointRegion:m,defaultAuthMode:E}=xI(t),g=o||E||"iam",y=g==="identityPool"?"iam":g,{headers:v,withCredentials:S}=II(t);let x;if(typeof s=="function"){const k={method:"POST",url:new Hr(i||h||p||"").toString(),queryString:Sc(n)};x=await s(k)}else x=s;c&&(x={...x,Authorization:c});const I=await U7(t,y,a??d,x),T={...!h&&I,...h&&(m?I:{})||{},...v&&await v({query:Sc(n),variables:r}),...x,...!h&&{[$7]:ju(u)}},A={query:Sc(n),variables:r||null};let R;h&&!m||y!=="oidc"&&y!=="userPool"&&y!=="iam"&&y!=="lambda"?R=void 0:R={service:m?"execute-api":"appsync",region:m||f};const w=i||h||p;if(!w)throw AI(new Ho(F7));let _;try{const{body:k}=await this._api.post(t,{url:new Hr(w),options:{headers:T,body:A,signingServiceInfo:R,withCredentials:S},abortController:l});_=await k.json()}catch(k){if(this.isCancelError(k))throw k;_=AI(k)}if(L7(_))throw TI(_);return _}isCancelError(t){return this._api.isCancelErrorREST(t)}cancel(t,n){return this._api.cancelREST(t,n)}_graphqlSubscribe(t,{query:n,variables:r,authMode:o,apiKey:i,endpoint:a},s={},l,u){const c=xI(t),d=o||(c==null?void 0:c.defaultAuthMode)||"iam",f=d==="identityPool"?"iam":d,{headers:p}=II(t),h=a??(c==null?void 0:c.endpoint),m=h??"none",E=this.appSyncRealTime.get(m)??new T7;return this.appSyncRealTime.set(m,E),E.subscribe({query:Sc(n),variables:r,appSyncGraphqlEndpoint:h,region:c==null?void 0:c.region,authenticationType:f,apiKey:i??(c==null?void 0:c.apiKey),additionalHeaders:s,authToken:u,libraryConfigHeaders:p},l).pipe(aP(g=>{throw g.errors?TI(g):g}))}}function ug(e){const t=new Set;for(const n of e.attributes||[])if(z7(n))for(const r of n.properties.rules)r.allow==="owner"?t.add(r.ownerField||"owner"):r.allow==="groups"&&r.groupsField!==void 0&&t.add(r.groupsField);return Array.from(t)}function z7(e){var t,n;return(e==null?void 0:e.type)==="auth"&&typeof(e==null?void 0:e.properties)=="object"&&Array.isArray((t=e==null?void 0:e.properties)==null?void 0:t.rules)?((n=e==null?void 0:e.properties)==null?void 0:n.rules).every(r=>!!r.allow):!1}function Sh(e){return`${e[0].toUpperCase()}${e.slice(1)}`}function Ca(e){let t,n;const r=new Promise((o,i)=>{t=o,n=i});return e(r).then(o=>{t(o)}).catch(o=>{n(o)}),r}const lm=new WeakMap;function xa(e,t){return lm.set(t,e),e.finally(()=>{lm.delete(t)})}function H7(e){const t=e.cancel.bind(e);e.cancel=function(n,r){const o=new Set;let i=n;for(;i&&lm.has(i);){if(o.has(i))throw new Error("A cycle was detected in the modeled graphql cancellation chain. This is a bug. Please report it!");o.add(i),i=lm.get(i)}return t(i,r)}}const Nl={HAS_ONE:"HAS_ONE",HAS_MANY:"HAS_MANY",BELONGS_TO:"BELONGS_TO"},_I={ID:"ID",String:"String",AWSDate:"String",AWSTime:"String",AWSDateTime:"String",AWSTimestamp:"Int",AWSEmail:"String",AWSPhone:"String",AWSURL:"String",AWSIPAddress:"String",AWSJSON:"String",Boolean:"Boolean",Int:"Int",Float:"Float"},um=e=>e.length===1?e[0]:e.reduce((t,n,r)=>r===0?n:t+Sh(n),""),Li=(e,t,n)=>{var o;if(!n)return null;const r={};for(const[i,a]of Object.entries(n)){const s=t?(o=e.models[t])==null?void 0:o.fields[i]:void 0,l={fieldDef:s,value:a};W7(l)?r[i]=l.value.items.map(u=>Li(e,l.fieldDef.type.model,u)):V7(s)?r[i]=Li(e,s.type.model,a):r[i]=a}return r};function W7(e){var t,n;return typeof((t=e.fieldDef)==null?void 0:t.type)=="object"&&"model"in e.fieldDef.type&&typeof e.fieldDef.type.model=="string"&&e.fieldDef.isArray&&Array.isArray((n=e.value)==null?void 0:n.items)}function V7(e){return typeof(e==null?void 0:e.type)=="object"&&"model"in e.type&&typeof e.type.model=="string"}function Ui(e,t,n,r,o,i,a=!1){const s=r.models[t],l=s.fields,u=Object.entries(l).filter(([c,d])=>{var f;return((f=d==null?void 0:d.type)==null?void 0:f.model)!==void 0}).map(([c])=>c);return n.map(c=>{var f,p,h,m,E;if(c==null)return c;const d={};for(const g of u){const y=l[g],S=(y==null?void 0:y.type).model,x=r.models[S],I=x.primaryKeyInfo.primaryKeyFieldName,T=x.primaryKeyInfo.sortKeyFieldNames,A=(f=y.association)==null?void 0:f.connectionType;let R=[];y.association&&"associatedWith"in y.association&&(R=y.association.associatedWith);const w=[];switch(y.association&&"targetNames"in y.association&&w.push(...y.association.targetNames),A){case Nl.BELONGS_TO:{const _=T.reduce((k,N)=>(c[N]&&(k[N]=c[N]),k),{});if(((p=e.models[S])==null?void 0:p.get)===void 0)break;a?d[g]=(k,N)=>c[w[0]]?e.models[S].get(k,{[I]:c[w[0]],..._},{authMode:(N==null?void 0:N.authMode)||o,authToken:(N==null?void 0:N.authToken)||i}):{data:null}:d[g]=k=>c[w[0]]?e.models[S].get({[I]:c[w[0]],..._},{authMode:(k==null?void 0:k.authMode)||o,authToken:(k==null?void 0:k.authToken)||i}):{data:null};break}case Nl.HAS_ONE:case Nl.HAS_MANY:{const _=A===Nl.HAS_ONE?j=>({data:(j==null?void 0:j.data.shift())||null,errors:j.errors,extensions:j.extensions}):j=>j,k=s.primaryKeyInfo.primaryKeyFieldName,N=s.primaryKeyInfo.sortKeyFieldNames,F=x.fields[R[0]];if(F.type.model){let j=[];F.association&&"targetNames"in F.association&&(j=(h=F.association)==null?void 0:h.targetNames);const M=j.map((D,z)=>z===0?{[D]:{eq:c[k]}}:{[D]:{eq:c[N[z-1]]}});if(((m=e.models[S])==null?void 0:m.list)===void 0)break;a?d[g]=(D,z)=>c[k]?Ca(async K=>{const ae=e.models[S].list(D,{filter:{and:M},limit:z==null?void 0:z.limit,nextToken:z==null?void 0:z.nextToken,authMode:(z==null?void 0:z.authMode)||o,authToken:(z==null?void 0:z.authToken)||i}),Ie=xa(ae,K);return _(await Ie)}):[]:d[g]=D=>c[k]?Ca(async z=>{const K=e.models[S].list({filter:{and:M},limit:D==null?void 0:D.limit,nextToken:D==null?void 0:D.nextToken,authMode:(D==null?void 0:D.authMode)||o,authToken:(D==null?void 0:D.authToken)||i}),ae=xa(K,z);return _(await ae)}):[];break}const $=R.map((j,M)=>M===0?{[j]:{eq:c[k]}}:{[j]:{eq:c[N[M-1]]}});if(((E=e.models[S])==null?void 0:E.list)===void 0)break;a?d[g]=(j,M)=>c[k]?Ca(async D=>{const z=e.models[S].list(j,{filter:{and:$},limit:M==null?void 0:M.limit,nextToken:M==null?void 0:M.nextToken,authMode:(M==null?void 0:M.authMode)||o,authToken:(M==null?void 0:M.authToken)||i}),K=xa(z,D);return _(await K)}):[]:d[g]=j=>c[k]?Ca(async M=>{const D=e.models[S].list({filter:{and:$},limit:j==null?void 0:j.limit,nextToken:j==null?void 0:j.nextToken,authMode:(j==null?void 0:j.authMode)||o,authToken:(j==null?void 0:j.authToken)||i}),z=xa(D,M);return _(await z)}):[];break}}}return{...c,...d}})}const pS={CREATE:{operationPrefix:"create",usePlural:!1},GET:{operationPrefix:"get",usePlural:!1},UPDATE:{operationPrefix:"update",usePlural:!1},DELETE:{operationPrefix:"delete",usePlural:!1},LIST:{operationPrefix:"list",usePlural:!0},INDEX_QUERY:{operationPrefix:"",usePlural:!1},ONCREATE:{operationPrefix:"onCreate",usePlural:!1},ONUPDATE:{operationPrefix:"onUpdate",usePlural:!1},ONDELETE:{operationPrefix:"onDelete",usePlural:!1},OBSERVEQUERY:{operationPrefix:"observeQuery",usePlural:!1}},hS="*",cg=(e,t)=>{const{fields:n}=e,r=Object.values(n).map(({type:o,name:i})=>{if(typeof o.enum=="string")return[i,yu];if(typeof o.nonModel=="string")return[i,cg(t.nonModels[o.nonModel],t)];if(typeof o=="string")return[i,yu]}).filter(o=>o!==void 0);return Object.fromEntries(r)},K7=(e,t)=>{const{fields:n}=e,r=Object.values(n).map(({type:i,name:a})=>{if(typeof i.enum=="string"||typeof i=="string")return[a,yu];if(typeof i.nonModel=="string")return[a,cg(t.nonModels[i.nonModel],t)]}).filter(i=>i!==void 0),o=ug(e).map(i=>[i,yu]);return Object.fromEntries(r.concat(o))};function G7(e){const{fields:t}=e,n=Object.values(t).map(({type:o,name:i})=>{if(typeof o=="string")return i;if(typeof o=="object"){if(typeof(o==null?void 0:o.enum)=="string")return i;if(typeof(o==null?void 0:o.nonModel)=="string")return`${i}.${hS}`}}).filter(Boolean),r=ug(e);return Array.from(new Set(n.concat(r)))}const yu="";function q7(e,t,n){const r=(o,i)=>{var E,g,y,v,S,x;const[a,...s]=o.split("."),l=s[0],u=e.models[i]??e.nonModels[i],c=u==null?void 0:u.fields,d=(g=(E=c==null?void 0:c[a])==null?void 0:E.type)==null?void 0:g.model,f=e.models[d],p=(v=(y=c==null?void 0:c[a])==null?void 0:y.type)==null?void 0:v.nonModel,h=e.nonModels[p],m=f?"model":h?"nonModel":"field";if(m==="nonModel"){let I={};if(!l)throw Error(`${a} must declare a wildcard (*) or a field of custom type ${p}`);return l===hS?I={[a]:cg(h,e)}:I={[a]:r(s.join("."),p)},I}else if(m==="model"){let I={};if(!l)throw Error(`${a} must declare a wildcard (*) or a field of model ${d}`);if(l===hS){const T=e.models[d];I={[a]:K7(T,e)}}else I={[a]:r(s.join("."),d)};return(S=c[a])!=null&&S.isArray&&(I={[a]:{items:I[a]}}),I}else{const I=c==null?void 0:c[a],T=e.nonModels[i],A=(x=T==null?void 0:T.fields)==null?void 0:x[a];if(T){if(!A)throw Error(`${a} is not a field of custom type ${i}`)}else{const R=ug(u).includes(a);if(!I&&!R)throw Error(`${a} is not a field of model ${i}`)}return{[a]:yu}}};return n.reduce((o,i)=>Ck(r(i,t),o),{})}function cm(e){const t=[];return Object.entries(e).forEach(([n,r])=>{r===yu?t.push(n):typeof r=="object"&&r!==null&&(r!=null&&r.items?t.push(n,"{","items","{",cm(r.items),"}","}"):t.push(n,"{",cm(r),"}"))}),t.join(" ")}function Ck(e,t){const n=r=>r&&typeof r=="object";for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Object.prototype.hasOwnProperty.call(t,r)&&n(t[r])?Ck(e[r],t[r]):t[r]=e[r]);return t}function xk(e,t,n){const r=e.models[t],o=q7(e,t,n??G7(r));return cm(o)}function dg(e,t,n,r,o){var _,k;const{name:i,pluralName:a,fields:s,primaryKeyInfo:{isCustomPrimaryKey:l,primaryKeyFieldName:u,sortKeyFieldNames:c},attributes:d}=t,f=i.charAt(0).toUpperCase()+i.slice(1),p=a.charAt(0).toUpperCase()+a.slice(1),{operationPrefix:h,usePlural:m}=pS[n],{selectionSet:E}=r||{};let g,y;if(h)g=`${h}${m?p:f}`;else if(o){const{queryField:N,pk:F,sk:U=[]}=o;g=N;let $={};if(U.length===1){const[j]=U,M=typeof s[j].type=="string"?s[j].type:"String",D=_I[M];$={[j]:`Model${D}KeyConditionInput`}}else if(U.length>1){const j=um(U),M=(k=(_=d==null?void 0:d.find(D=>{var z;return((z=D==null?void 0:D.properties)==null?void 0:z.queryField)===N}))==null?void 0:_.properties)==null?void 0:k.name;$={[j]:`Model${Sh(i)}${Sh(M)}CompositeKeyConditionInput`}}y={[F]:`${Object.prototype.hasOwnProperty.call(s[F].type,"enum")?s[F].type.enum:s[F].type}!`,...$}}else throw new Error("Error generating GraphQL Document - invalid operation name");let v,S,x;const I=xk(e,i,E),T={[u]:`${s[u].type}!`},A={},R=N=>{if(c.length===0)return{};if(N==="get")return c.reduce((F,U)=>{const $=s[U].type;return N==="get"&&(F[U]=`${$}!`),F},{});if(c.length===1){const[F]=c,U=typeof s[F].type=="string"?s[F].type:"String",$=_I[U];return{[F]:`Model${$}KeyConditionInput`}}else return{[um(c)]:`Model${Sh(i)}PrimaryCompositeKeyConditionInput`}};switch(l&&(Object.assign(T,R("get")),Object.assign(A,{[u]:`${s[u].type}`,sortDirection:"ModelSortDirection"},R("list"))),n){case"CREATE":case"UPDATE":case"DELETE":x??(x={input:`${h.charAt(0).toLocaleUpperCase()+h.slice(1)}${f}Input!`}),v??(v="mutation");case"GET":x??(x=T),S??(S=I);case"LIST":x??(x={...A,filter:`Model${f}FilterInput`,limit:"Int",nextToken:"String"}),v??(v="query"),S??(S=`items { ${I} } nextToken __typename`);case"INDEX_QUERY":x??(x={...y,filter:`Model${f}FilterInput`,sortDirection:"ModelSortDirection",limit:"Int",nextToken:"String"}),v??(v="query"),S??(S=`items { ${I} } nextToken __typename`);case"ONCREATE":case"ONUPDATE":case"ONDELETE":x??(x={filter:`ModelSubscription${f}FilterInput`}),v??(v="subscription"),S??(S=I);break;case"OBSERVEQUERY":default:throw new Error("Internal error: Attempted to generate graphql document for observeQuery. Please report this error.")}return`${v}${x?`(${Object.entries(x).map(([N,F])=>`$${N}: ${F}`)})`:""} { ${g}${x?`(${Object.keys(x).map(N=>`${N}: $${N}`)})`:""} { ${S} } }`}function fg(e,t,n,r,o){const{fields:i,primaryKeyInfo:{isCustomPrimaryKey:a,primaryKeyFieldName:s,sortKeyFieldNames:l}}=e,u=(l==null?void 0:l.length)&&um(l);let c={};switch(t){case"CREATE":c={input:n?RI(n,e,r):{}};break;case"UPDATE":c={input:n?Object.fromEntries(Object.entries(RI(n,e,r)).filter(([d])=>i[d]?!i[d].isReadOnly:!ug(e).includes(d))):{}};break;case"GET":case"DELETE":n&&(c=a?[s,...l].reduce((d,f)=>(d[f]=n[f],d),{}):{[s]:n[s]}),t==="DELETE"&&(c={input:c});break;case"LIST":n!=null&&n.filter&&(c.filter=n.filter),n!=null&&n.sortDirection&&(c.sortDirection=n.sortDirection),n&&n[s]&&(c[s]=n[s]),u&&n&&n[u]&&(c[u]=n[u]),n!=null&&n.nextToken&&(c.nextToken=n.nextToken),n!=null&&n.limit&&(c.limit=n.limit);break;case"INDEX_QUERY":{const{pk:d,sk:f=[]}=o,p=(f==null?void 0:f.length)&&um(f);c[d]=n[d],p&&n&&n[p]&&(c[p]=n[p]),n!=null&&n.filter&&(c.filter=n.filter),n!=null&&n.sortDirection&&(c.sortDirection=n.sortDirection),n!=null&&n.nextToken&&(c.nextToken=n.nextToken),n!=null&&n.limit&&(c.limit=n.limit);break}case"ONCREATE":case"ONUPDATE":case"ONDELETE":n!=null&&n.filter&&(c={filter:n.filter});break;case"OBSERVEQUERY":throw new Error("Internal error: Attempted to build variables for observeQuery. Please report this error.");default:{const d=t;throw new Error(`Unhandled operation case: ${d}`)}}return c}function RI(e,t,n){const{fields:r}=t,o={};return Object.entries(e).forEach(([i,a])=>{var u,c;const s=(u=r[i])==null?void 0:u.type,l=s==null?void 0:s.model;if(l){const d=(c=r[i])==null?void 0:c.association,p=n.models[l].primaryKeyInfo;if((d==null?void 0:d.connectionType)===Nl.HAS_ONE){const h=d;h.targetNames.forEach((m,E)=>{const g=h.associatedWith[E];o[m]=a[g]})}(d==null?void 0:d.connectionType)===Nl.BELONGS_TO&&d.targetNames.forEach((m,E)=>{if(E===0){const g=p.primaryKeyFieldName;o[m]=a[g]}else{const g=p.sortKeyFieldNames[E-1];o[m]=a[g]}})}else o[i]=a}),o}function Ku(e,t,n={}){const r=t(e);return{authMode:n.authMode||r.authMode,authToken:n.authToken||r.authToken}}function Gu(e,t,n){let r=t(e).headers||{};return n&&(r=n),r}function mS(e){if(e!=null&&e.errors)return{...e,data:[]};throw e}function dm(e){if(e.errors)return{...e,data:null};throw e}const Fb=Symbol("INTERNAL_USER_AGENT_OVERRIDE");var xo;(function(e){e.CreateConversation="1",e.GetConversation="2",e.ListConversations="3",e.DeleteConversation="4",e.SendMessage="5",e.ListMessages="6",e.OnStreamEvent="7",e.Generation="8",e.UpdateConversation="9"})(xo||(xo={}));const Yi=e=>({category:"ai",action:e});function pg(e){return e?{[Fb]:e}:void 0}const Q7=e=>{var t;return typeof((t=e==null?void 0:e.token)==null?void 0:t.value)=="symbol"};function hg(e,t,n,r,o,i,a){const s=r.arguments!==void 0;return(...u)=>{const c=u[u.length-1];let d,f;if(o)if(Q7(u[0]))d=u[0];else throw new Error(`Invalid first argument passed to ${r.name}. Expected contextSpec`);return s&&(o?f=u[1]:f=u[0]),n==="subscription"?eB(e,t,r,i,f,c,a):Z7(e,t,n,r,i,f,c,d,a)}}function Ol(e,t){return typeof e[t]=="string"}function Y7(e){return e instanceof Object&&"enum"in e}function X7(e){return e instanceof Object&&"input"in e}function J7({type:e,isRequired:t}){const n=t?"!":"";return Y7(e)?`${e.enum}${n}`:X7(e)?`${e.input}${n}`:`${e}${n}`}function Ik(e){if(e.arguments===void 0)return"";const t=Object.entries(e.arguments).map(([n,r])=>{const o=J7(r),i=r.isArray?`[${o}]${r.isArrayNullable?"":"!"}`:o;return`$${n}: ${i}`}).join(", ");return t.length>0?`(${t})`:""}function Tk(e){if(e.arguments===void 0)return"";const t=Object.keys(e.arguments).map(n=>`${n}: $${n}`).join(", ");return t.length>0?`(${t})`:""}function Ak(e,t){if(Ol(t,"type")||Ol(t.type,"enum"))return"";if(Ol(t.type,"nonModel")){const n=e.nonModels[t.type.nonModel];return`{${cm(cg(n,e))}}`}else return Ol(t.type,"model")?`{${xk(e,t.type.model)}}`:""}function _k(e,t={}){const n={};if(e.arguments===void 0)return n;for(const r of Object.values(e.arguments))if(typeof t[r.name]<"u")n[r.name]=t[r.name];else if(r.isRequired)throw new Error(`${e.name} requires arguments '${r.name}'`);return n}function Z7(e,t,n,r,o,i,a,s,l){return Ca(async u=>{const{name:c}=r,d=Ku(e,o,a),f=Gu(e,o,a==null?void 0:a.headers),p=Ik(r),h=Tk(r),m=Ak(t,r),E=Ol(r.type,"model")?r.type.model:void 0,g=` ${n.toLocaleLowerCase()}${p} { ${c}${h} ${m} } `,y=_k(r,i),v=pg(l);try{const S=s?e.graphql(s,{...d,query:g,variables:y},f):e.graphql({...d,query:g,variables:y,...v},f),x=xa(S,u),{data:I,extensions:T}=await x;if(I){const[A]=Object.keys(I),R=Array.isArray(I[A]),w=R?I[A].filter(k=>k):I[A],_=E?Ui(e,E,R?w:[w],t,d.authMode,d.authToken,!!s):w;return{data:!R&&Array.isArray(_)?_.shift():_,extensions:T}}else return{data:null,extensions:T}}catch(S){const{data:x,errors:I}=S;if(x&&Object.keys(x).length!==0&&I){const[T]=Object.keys(x),A=Array.isArray(x[T]),R=A?x[T].filter(w=>w):x[T];if(R){const w=E?Ui(e,E,A?R:[R],t,d.authMode,d.authToken,!!s):R;return{data:!A&&Array.isArray(w)?w.shift():w,errors:I}}else return dm(S)}else return dm(S)}})}function eB(e,t,n,r,o,i,a){const s="subscription",{name:l}=n,u=Ku(e,r,i),c=Gu(e,r,i==null?void 0:i.headers),d=Ik(n),f=Tk(n),p=Ak(t,n),h=Ol(n.type,"model")?n.type.model:void 0,m=` ${s.toLocaleLowerCase()}${d} { ${l}${f} ${p} } `,E=_k(n,o),g=pg(a);return e.graphql({...u,query:m,variables:E,...g},c).pipe(pb(v=>{const[S]=Object.keys(v.data),x=v.data[S],[I]=h?Ui(e,h,[x],t,u.authMode,u.authToken):[x];return I}))}const tB={queries:"query",mutations:"mutation",subscriptions:"subscription"};function Lb(e,t,n,r){if(!t)return{};const o=t.modelIntrospection;if(!o)return{};const i=o[n];if(!i)return{};const a={},s=r(e).amplify===null;for(const l of Object.values(i))a[l.name]=hg(e,o,tB[n],l,s,r);return a}function nB(e,t,n){return Lb(e,t,"mutations",n)}function rB(e,t,n){return Lb(e,t,"queries",n)}function oB(e,t,n){return Lb(e,t,"subscriptions",n)}function xf(e,t,n,r,o,i=!1,a){return i?(u,c,d)=>PI(e,t,n,c,d,r,o,u,a):(u,c)=>PI(e,t,n,u,c,r,o,void 0,a)}function PI(e,t,n,r,o,i,a,s,l){return Ca(async u=>{const{name:c}=n,d=dg(t,n,i,o),f=fg(n,i,r,t),p=Ku(e,a,o),h=Gu(e,a,o==null?void 0:o.headers),m=pg(l);try{const E=s?e.graphql(s,{...p,query:d,variables:f},h):e.graphql({...p,query:d,variables:f,...m},h),g=xa(E,u),{data:y,extensions:v}=await g;if(y){const[S]=Object.keys(y),x=Li(t,c,y[S]);if(x===null)return{data:null,extensions:v};if(o!=null&&o.selectionSet)return{data:x,extensions:v};{const[I]=Ui(e,c,[x],t,p.authMode,p.authToken,!!s);return{data:I,extensions:v}}}else return{data:null,extensions:v}}catch(E){const{data:g,errors:y}=E;if(g&&Object.keys(g).length!==0&&y){const[v]=Object.keys(g),S=Li(t,c,g[v]);if(S){if(o!=null&&o.selectionSet)return{data:S,errors:y};{const[x]=Ui(e,c,[S],t,p.authMode,p.authToken,!!s);return{data:x,errors:y}}}else return dm(E)}else return dm(E)}})}function Ub(e,t,n,r,o=!1,i){return o?(l,u)=>kI(e,t,n,r,u,l,i):l=>kI(e,t,n,r,l,void 0,i)}function kI(e,t,n,r,o,i,a){return Ca(async s=>{var h,m,E,g;const{name:l}=n,u=dg(t,n,"LIST",o),c=fg(n,"LIST",o,t),d=Ku(e,r,o),f=Gu(e,r,o==null?void 0:o.headers),p=pg(a);try{const y=i?e.graphql(i,{...d,query:u,variables:c},f):e.graphql({...d,query:u,variables:c,...p},f),v=xa(y,s),{data:S,extensions:x}=await v;if(S!==void 0){const[I]=Object.keys(S);if(S[I].items){const T=S[I].items.map(A=>Li(t,l,A));return o!=null&&o.selectionSet?{data:T,nextToken:S[I].nextToken,extensions:x}:{data:Ui(e,l,T,t,d.authMode,d.authToken,!!i),nextToken:S[I].nextToken,extensions:x}}return{data:S[I],nextToken:S[I].nextToken,extensions:x}}}catch(y){const{data:v,errors:S}=y;if(v!=null&&Object.keys(v).length!==0&&S){const[x]=Object.keys(v);if((h=v[x])!=null&&h.items){const I=v[x].items.map(T=>Li(t,l,T));return I?o!=null&&o.selectionSet?{data:I,nextToken:(m=v[x])==null?void 0:m.nextToken,errors:S}:{data:Ui(e,l,I,t,d.authMode,d.authToken,!!i),nextToken:(E=v[x])==null?void 0:E.nextToken,errors:S}:{data:v[x],nextToken:(g=v[x])==null?void 0:g.nextToken,errors:S}}else return mS(y)}else return mS(y)}})}const Ua={},qu=new Array(64);for(let e=0,t=65,n=90;e+t<=n;e++){const r=String.fromCharCode(e+t);Ua[r]=e,qu[e]=r}for(let e=0,t=97,n=122;e+t<=n;e++){const r=String.fromCharCode(e+t),o=e+26;Ua[r]=o,qu[o]=r}for(let e=0;e<10;e++){Ua[e.toString(10)]=e+52;const t=e.toString(10),n=e+52;Ua[t]=n,qu[n]=t}Ua["+"]=62;qu[62]="+";Ua["/"]=63;qu[63]="/";const Vl=6,cd=8,iB=63,Rk=e=>{let t=e.length/4*3;e.slice(-2)==="=="?t-=2:e.slice(-1)==="="&&t--;const n=new ArrayBuffer(t),r=new DataView(n);for(let o=0;o>=Vl;const s=o/4*3;i>>=a%cd;const l=Math.floor(a/cd);for(let u=0;u>c)}}return new Uint8Array(n)},aB=e=>new TextEncoder().encode(e);function Pk(e){let t;typeof e=="string"?t=aB(e):t=e;const n=typeof t=="object"&&typeof t.length=="number",r=typeof t=="object"&&typeof t.byteOffset=="number"&&typeof t.byteLength=="number";if(!n&&!r)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let i=0;i>c]}o+="==".slice(0,4-l)}return o}const sB=e=>e.map(t=>t.image?kk(t):t.document?lB(t):t.toolUse?cB(t):t.toolResult?dB(t):Nk(t)),kk=({image:e})=>({image:{...e,source:{...e.source,bytes:Rk(e.source.bytes)}}}),lB=({document:e})=>({document:{...e,source:{...e.source,bytes:Rk(e.source.bytes)}}}),uB=({json:e})=>({json:JSON.parse(e)}),cB=({toolUse:e})=>({toolUse:{...e,input:JSON.parse(e.input)}}),dB=({toolResult:e})=>({toolResult:{toolUseId:e.toolUseId,content:e.content.map(t=>t.image?kk(t):t.json?uB(t):Nk(t))}}),Nk=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==null)),Ok=({content:e,createdAt:t,id:n,conversationId:r,role:o})=>({content:sB(e??[]),conversationId:r,createdAt:t,id:n,role:o}),fB=(e,t,n,r,o)=>async i=>{const a=Ub(e,t,r,o,!1,Yi(xo.ListMessages)),{data:s,nextToken:l,errors:u}=await a({...i,filter:{conversationId:{eq:n}}});return{data:s.map(c=>Ok(c)),nextToken:l,errors:u}},pB=({id:e,conversationId:t,associatedUserMessageId:n,contentBlockIndex:r,contentBlockDoneAtIndex:o,contentBlockDeltaIndex:i,contentBlockText:a,contentBlockToolUse:s,stopReason:l,errors:u})=>u?{error:{id:e,conversationId:t,associatedUserMessageId:n,errors:u}}:{next:mB({id:e,conversationId:t,associatedUserMessageId:n,contentBlockIndex:r,contentBlockDoneAtIndex:o,contentBlockDeltaIndex:i,text:a,toolUse:hB(s),stopReason:l})},hB=e=>{if(e)return{...e,input:JSON.parse(e.input)}},mB=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==null)),gB=(e,t,n,r,o)=>i=>{const{conversations:a}=t;if(!a)return{};const s=a[r].message.subscribe;return hg(e,t,"subscription",s,!1,o,Yi(xo.OnStreamEvent))({conversationId:n}).subscribe(u=>{const{next:c,error:d}=pB(u);d&&i.error(d),c&&i.next(c)})},vB=e=>JSON.stringify(e),yB=e=>e.map(t=>t.image?Dk(t):t.document?bB(t):t.toolResult?wB(t):t),SB=({tools:e})=>({tools:Object.entries(e).map(([t,n])=>({toolSpec:{name:t,description:n.description,inputSchema:{json:JSON.stringify(n.inputSchema.json)}}}))}),Dk=({image:e})=>({image:{...e,source:{...e.source,bytes:Pk(e.source.bytes)}}}),bB=({document:e})=>({document:{...e,source:{...e.source,bytes:Pk(e.source.bytes)}}}),EB=({json:e})=>({json:JSON.stringify(e)}),wB=({toolResult:e})=>({toolResult:{...e,content:e.content.map(t=>t.image?Dk(t):t.json?EB(t):t)}}),CB=(e,t,n,r,o)=>async i=>{const{conversations:a}=t;if(!a)return{};const s=typeof i=="string"?{content:[{text:i}]}:i,{content:l,aiContext:u,toolConfiguration:c}=s,d=a[r].message.send,f=hg(e,t,"mutation",d,!1,o,Yi(xo.SendMessage)),{data:p,errors:h}=await f({conversationId:n,content:yB(l),...u&&{aiContext:vB(u)},...c&&{toolConfiguration:SB(c)}});return{data:p&&Ok(p),errors:h}},If=(e,t,n,r,o,i,a,s,l,u)=>{if(!n)throw new Error(`An error occurred converting a ${i} conversation: Missing ID`);return{id:n,createdAt:r,updatedAt:o,metadata:l,name:u,onStreamEvent:gB(e,t,n,i,s),sendMessage:CB(e,t,n,i,s),listMessages:fB(e,t,n,a,s)}},xB=(e,t,n,r,o,i)=>async a=>{const{name:s,metadata:l}=a??{},u=JSON.stringify(l),c=xf(e,t,r,"CREATE",i,!1,Yi(xo.CreateConversation)),{data:d,errors:f}=await c({name:s,metadata:u});return{data:If(e,t,d==null?void 0:d.id,d==null?void 0:d.createdAt,d==null?void 0:d.updatedAt,n,o,i,d==null?void 0:d.metadata,d==null?void 0:d.name),errors:f}},IB=(e,t,n,r,o,i)=>async({id:a})=>{const s=xf(e,t,r,"GET",i,!1,Yi(xo.GetConversation)),{data:l,errors:u}=await s({id:a});return{data:l&&If(e,t,l.id,l.createdAt,l.updatedAt,n,o,i,l==null?void 0:l.metadata,l==null?void 0:l.name),errors:u}},TB=(e,t,n,r,o,i)=>async a=>{const s=Ub(e,t,r,i,!1,Yi(xo.ListConversations)),{data:l,nextToken:u,errors:c}=await s(a);return{data:l.map(d=>If(e,t,d.id,d.createdAt,d.updatedAt,n,o,i,d==null?void 0:d.metadata,d==null?void 0:d.name)),nextToken:u,errors:c}},AB=(e,t,n,r,o,i)=>async({id:a})=>{const s=xf(e,t,r,"DELETE",i,!1,Yi(xo.DeleteConversation)),{data:l,errors:u}=await s({id:a});return{data:l&&If(e,t,l==null?void 0:l.id,l==null?void 0:l.createdAt,l==null?void 0:l.updatedAt,n,o,i,l==null?void 0:l.metadata,l==null?void 0:l.name),errors:u}},_B=(e,t,n,r,o,i)=>async({id:a,metadata:s,name:l})=>{const u=JSON.stringify(s),c=xf(e,t,r,"UPDATE",i,!1,Yi(xo.UpdateConversation)),{data:d,errors:f}=await c({id:a,metadata:u,name:l});return{data:d&&If(e,t,d==null?void 0:d.id,d==null?void 0:d.createdAt,d==null?void 0:d.updatedAt,n,o,i,d==null?void 0:d.metadata,d==null?void 0:d.name),errors:f}};function RB(e,t,n){const r=t==null?void 0:t.modelIntrospection;if(!(r!=null&&r.conversations))return{};const o={};for(const{name:i,conversation:a,message:s,models:l,nonModels:u,enums:c}of Object.values(r.conversations)){const d=l[a.modelName],f=l[s.modelName];if(!d||!f)return{};const p={...r,models:{...r.models,...l},nonModels:{...r.nonModels,...u},enums:{...r.enums,...c}};o[i]={update:_B(e,p,i,d,f,n),create:xB(e,p,i,d,f,n),get:IB(e,p,i,d,f,n),delete:AB(e,p,i,d,f,n),list:TB(e,p,i,d,f,n)}}return o}function PB(e,t,n){const r=t==null?void 0:t.modelIntrospection;if(!(r!=null&&r.generations))return{};const o={};for(const i of Object.values(r.generations))o[i.name]=hg(e,r,"query",i,!1,n,Yi(xo.Generation));return o}const kB=e=>{const t=e.modelIntrospection;if(!t)return{};const n={};for(const[r,o]of Object.entries(t.enums))n[o.name]={values:()=>o.values};return n};function NB(e,t,n,r,o,i=!1){return i?(l,u,c)=>NI(e,t,n,r,o,{...u,...c},l):(l,u)=>NI(e,t,n,r,o,{...l,...u})}function OB(e,t,n,r,o){const{data:i,extensions:a}=n,[s]=Object.keys(i);if(i[s].items){const l=i[s].items.map(u=>Li(e,t,u));return{data:r?l:o(l),nextToken:i[s].nextToken,extensions:a}}return{data:i[s],nextToken:i[s].nextToken,extensions:a}}function NI(e,t,n,r,o,i,a){return Ca(async s=>{var p,h,m,E;const{name:l}=n,u=dg(t,n,"INDEX_QUERY",i,r),c=fg(n,"INDEX_QUERY",i,t,r),d=Ku(e,o,i),f=g=>Ui(e,l,g,t,d.authMode,d.authToken,!!a);try{const g=Gu(e,o,i==null?void 0:i.headers),v=[{...d,query:u,variables:c},g];a!==void 0&&v.unshift(a);const S=e.graphql(...v),I=await xa(S,s);if(I.data!==void 0)return OB(t,l,I,i==null?void 0:i.selectionSet,f)}catch(g){const{data:y,errors:v}=g;if(y!=null&&Object.keys(y).length!==0&&v){const[S]=Object.keys(y);if((p=y[S])!=null&&p.items){const x=(h=y[S])==null?void 0:h.items.map(I=>Li(t,l,I));if(x)return{data:i!=null&&i.selectionSet?x:f(x),nextToken:(m=y[S])==null?void 0:m.nextToken}}return{data:y[S],nextToken:(E=y[S])==null?void 0:E.nextToken}}else return mS(g)}})}function DB(e,t,n,r,o){const{name:i}=n;return s=>{const l=dg(t,n,r,s),u=fg(n,r,s,t),c=Ku(e,o,s),d=Gu(e,o,s==null?void 0:s.headers);return e.graphql({...c,query:l,variables:u},d).pipe(pb(p=>{const[h]=Object.keys(p.data),m=p.data[h],E=Li(t,i,m);if(E===null)return null;if(s!=null&&s.selectionSet)return E;{const[g]=Ui(e,i,[E],t,c.authMode,c.authToken);return g}}))}}function MB(e){const{primaryKeyFieldName:t,sortKeyFieldNames:n}=e.primaryKeyInfo;return[t,...n]}function FB(e,t,n){const r=Object.fromEntries(n.map(o=>[o,e[o]]));for(let o=0;or[i]===t[o][i]))return o;return-1}function LB(e,t){const{name:n}=t;return o=>new Yn(i=>{const a=[],s=[];let l=(...h)=>s.push(...h);const u=e[n].onCreate(o).subscribe({next(h){l({item:h,type:"create"})},error(h){i.error({type:"onCreate",error:h})}}),c=e[n].onUpdate(o).subscribe({next(h){l({item:h,type:"update"})},error(h){i.error({type:"onUpdate",error:h})}}),d=e[n].onDelete(o).subscribe({next(h){l({item:h,type:"delete"})},error(h){i.error({type:"onDelete",error:h})}});function f(h){for(const m of h){const E=FB(m.item,a,p);switch(m.type){case"create":E<0&&a.push(m.item);break;case"update":E>=0&&(a[E]=m.item);break;case"delete":E>=0&&a.splice(E,1);break;default:console.error("Unrecognized message in observeQuery.",m)}}i.next({items:a,isSynced:!0})}const p=MB(t);return(async()=>{let h=!0,m=null;for(;!i.closed&&(h||m);){h=!1;const{data:E,errors:g,nextToken:y}=await e[n].list({...o,nextToken:m});m=y,a.push(...E);const v=s.length===0&&m==null;if(i.next({items:a,isSynced:v}),Array.isArray(g))for(const S of g)i.error(S)}s.length>0&&f(s),l=(...E)=>(f(E),a.length)})(),()=>{u.unsubscribe(),c.unsubscribe(),d.unsubscribe()}})}const UB=e=>{var t,n,r;return e.type==="key"&&((t=e.properties)==null?void 0:t.name)&&((n=e.properties)==null?void 0:n.queryField)&&((r=e.properties)==null?void 0:r.fields.length)>0},$B=e=>{var n;return((n=e.attributes)==null?void 0:n.filter(UB).map(r=>{const o=r.properties.queryField,[i,...a]=r.properties.fields;return{queryField:o,pk:i,sk:a}}))||[]},jB=(e,t)=>{var s;const n=(s=e.models[t].attributes)==null?void 0:s.find(l=>l.type==="model"),r={queries:["list","get","observeQuery"],mutations:["create","update","delete"],subscriptions:["onCreate","onUpdate","onDelete"]},o=[];if(!n)return pS;if(n.properties)for(const[l,u]of Object.entries(n.properties))l in r&&(u===null?o.push(...r[l]):u instanceof Object&&o.push(...Object.keys(u)));o.includes("list")&&o.push("observeQuery");const i=o.map(l=>l.toUpperCase());return Object.fromEntries(Object.entries(pS).filter(([l])=>!i.includes(l)))};function BB(e,t,n){const r={},o=t.modelIntrospection;if(!o)return{};const i=["ONCREATE","ONUPDATE","ONDELETE"];for(const a of Object.values(o.models)){const{name:s}=a;r[s]={};const l=jB(o,s);Object.entries(l).forEach(([c,{operationPrefix:d}])=>{const f=c;f==="LIST"?r[s][d]=Ub(e,o,a,n):i.includes(f)?r[s][d]=DB(e,o,a,f,n):f==="OBSERVEQUERY"?r[s][d]=LB(r,a):r[s][d]=xf(e,o,a,f,n)});const u=$B(a);for(const c of u)r[s][c.queryField]=NB(e,o,a,c,n)}return r}function Mk(e,t,n){return H7(e),e.models=BB(e,t,n),e.enums=kB(t),e.queries=rB(e,t,n),e.mutations=nB(e,t,n),e.subscriptions=oB(e,t,n),e.conversations=RB(e,t,n),e.generations=PB(e,t,n),e}function zB(e){return Fb in e}class HB extends B7{getModuleName(){return"GraphQLAPI"}graphql(t,n,r){const o={category:fr.API,action:G0.GraphQl};if(zB(n)){const{[Fb]:i,...a}=n;return super.graphql(t,a,r,{...o,...i})}return super.graphql(t,n,r,{...o})}isCancelError(t){return super.isCancelError(t)}cancel(t,n){return super.cancel(t,n)}}const $b=new HB;function WB(e,t){const n=Mb(this),r=n.endpoint,o=n.authMode,i=n.apiKey;if(e.authMode=e.authMode||o,e.apiKey=e.apiKey??i,e.authToken=e.authToken||n.authToken,r&&e.authMode==="apiKey"&&!e.apiKey)throw new Error("graphql() requires an explicit `apiKey` for a custom `endpoint` when `authMode = 'apiKey'`.");const a=t||n.headers;return $b.graphql(n.amplify,{...e,endpoint:r},a)}function VB(e,t){return $b.cancel(e,t)}function KB(e){return $b.isCancelError(e)}function Fk(e){return e!==void 0}function GB(e){return e.event==="configure"}function qB(e){var r;const t={[bk]:e.amplify,[vh]:e.authMode,[Ek]:e.authToken,[fS]:"apiKey"in e?e.apiKey:void 0,[yh]:"endpoint"in e?e.endpoint:void 0,[wk]:e.headers,graphql:WB,cancel:VB,isCancelError:KB,models:bc,enums:bc,queries:bc,mutations:bc,subscriptions:bc},n=(r=e.amplify.getConfig().API)==null?void 0:r.GraphQL;if(t[yh]){if(!t[vh])throw new Error("generateClient() requires an explicit `authMode` when `endpoint` is provided.");if(t[vh]==="apiKey"&&!t[fS])throw new Error("generateClient() requires an explicit `apiKey` when `endpoint` is provided and `authMode = 'apiKey'`.")}return t[yh]||(Fk(n)?Mk(t,n,Mb):QB(t)),t}const QB=e=>{dr.listen("core",t=>{var r;if(!GB(t.payload))return;const n=(r=t.payload.data.API)==null?void 0:r.GraphQL;Fk(n)&&Mk(e,n,Mb)})},bc=new Proxy({},{get(){throw new Error("Client could not be generated. This is likely due to `Amplify.configure()` not being called prior to `generateClient()` or because the configuration passed to `Amplify.configure()` is missing GraphQL provider configuration.")}});function YB(e){return qB({...e||{},amplify:$e})}const ke=YB({authMode:"userPool"});function rr(e){return Qs({queryKey:["food",e],queryFn:async()=>{const{data:t}=await ke.models.Food.listFoodByDay({day:e});return t.sort((n,r)=>new Date(n.createdAt).getTime()-new Date(r.createdAt).getTime())}})}function XB(){const e=Jn();return Jo({mutationFn:async t=>{const{data:n}=await ke.models.Food.create(t);return n},onSuccess:async t=>{if(await e.invalidateQueries({queryKey:["food"]}),t!=null&&t.day&&(await e.invalidateQueries({queryKey:["food",t.day]}),t.day===new Date().toLocaleDateString())){const{updateWidget:n}=await wf(async()=>{const{updateWidget:i}=await Promise.resolve().then(()=>N5);return{updateWidget:i}},void 0);await e.refetchQueries({queryKey:["food"]});const o=(e.getQueryData(["food"])||[]).filter(i=>i.day===t.day).reduce((i,a)=>i+a.calories,0);n(o)}}})}function JB(){const e=Jn();return Jo({mutationFn:async t=>{await ke.models.Food.delete({id:t})},onSuccess:async()=>{await e.invalidateQueries({queryKey:["food"]});const{updateWidget:t}=await wf(async()=>{const{updateWidget:o}=await Promise.resolve().then(()=>N5);return{updateWidget:o}},void 0);await e.refetchQueries({queryKey:["food"]});const r=(e.getQueryData(["food"])||[]).filter(o=>o.day===new Date().toLocaleDateString()).reduce((o,i)=>o+i.calories,0);t(r)}})}function ZB(){this.__data__=[],this.size=0}var ez=ZB;function tz(e,t){return e===t||e!==e&&t!==t}var Tf=tz,nz=Tf;function rz(e,t){for(var n=e.length;n--;)if(nz(e[n][0],t))return n;return-1}var mg=rz,oz=mg,iz=Array.prototype,az=iz.splice;function sz(e){var t=this.__data__,n=oz(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():az.call(t,n,1),--this.size,!0}var lz=sz,uz=mg;function cz(e){var t=this.__data__,n=uz(t,e);return n<0?void 0:t[n][1]}var dz=cz,fz=mg;function pz(e){return fz(this.__data__,e)>-1}var hz=pz,mz=mg;function gz(e,t){var n=this.__data__,r=mz(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var vz=gz,yz=ez,Sz=lz,bz=dz,Ez=hz,wz=vz;function Qu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=n&sV?new rV:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=cK}var Kb=dK,fK=Yu,pK=Kb,hK=nl,mK="[object Arguments]",gK="[object Array]",vK="[object Boolean]",yK="[object Date]",SK="[object Error]",bK="[object Function]",EK="[object Map]",wK="[object Number]",CK="[object Object]",xK="[object RegExp]",IK="[object Set]",TK="[object String]",AK="[object WeakMap]",_K="[object ArrayBuffer]",RK="[object DataView]",PK="[object Float32Array]",kK="[object Float64Array]",NK="[object Int8Array]",OK="[object Int16Array]",DK="[object Int32Array]",MK="[object Uint8Array]",FK="[object Uint8ClampedArray]",LK="[object Uint16Array]",UK="[object Uint32Array]",dt={};dt[PK]=dt[kK]=dt[NK]=dt[OK]=dt[DK]=dt[MK]=dt[FK]=dt[LK]=dt[UK]=!0;dt[mK]=dt[gK]=dt[_K]=dt[vK]=dt[RK]=dt[yK]=dt[SK]=dt[bK]=dt[EK]=dt[wK]=dt[CK]=dt[xK]=dt[IK]=dt[TK]=dt[AK]=!1;function $K(e){return hK(e)&&pK(e.length)&&!!dt[fK(e)]}var jK=$K;function BK(e){return function(t){return e(t)}}var zK=BK,hm={exports:{}};hm.exports;(function(e,t){var n=Lk,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,a=i&&n.process,s=function(){try{var l=o&&o.require&&o.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(hm,hm.exports);var HK=hm.exports,WK=jK,VK=zK,WI=HK,VI=WI&&WI.isTypedArray,KK=VI?VK(VI):WK,Gb=KK,GK=qV,qK=Wb,QK=Ji,YK=Vb,XK=bg,JK=Gb,ZK=Object.prototype,eG=ZK.hasOwnProperty;function tG(e,t){var n=QK(e),r=!n&&qK(e),o=!n&&!r&&YK(e),i=!n&&!r&&!o&&JK(e),a=n||r||o||i,s=a?GK(e.length,String):[],l=s.length;for(var u in e)(t||eG.call(e,u))&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||XK(u,l)))&&s.push(u);return s}var Gk=tG,nG=Object.prototype;function rG(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||nG;return e===n}var qb=rG;function oG(e,t){return function(n){return e(t(n))}}var qk=oG,iG=qk,aG=iG(Object.keys,Object),sG=aG,lG=qb,uG=sG,cG=Object.prototype,dG=cG.hasOwnProperty;function fG(e){if(!lG(e))return uG(e);var t=[];for(var n in Object(e))dG.call(e,n)&&n!="constructor"&&t.push(n);return t}var pG=fG,hG=jb,mG=Kb;function gG(e){return e!=null&&mG(e.length)&&!hG(e)}var Eg=gG,vG=Gk,yG=pG,SG=Eg;function bG(e){return SG(e)?vG(e):yG(e)}var Qk=bG,EG=Hk,wG=Vk,CG=Qk;function xG(e){return EG(e,CG,wG)}var IG=xG,KI=IG,TG=1,AG=Object.prototype,_G=AG.hasOwnProperty;function RG(e,t,n,r,o,i){var a=n&TG,s=KI(e),l=s.length,u=KI(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:_G.call(t,f)))return!1}var p=i.get(e),h=i.get(t);if(p&&h)return p==t&&h==e;var m=!0;i.set(e,t),i.set(t,e);for(var E=a;++d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gq:mq;nN.useSyncExternalStore=Su.useSyncExternalStore!==void 0?Su.useSyncExternalStore:vq;tN.exports=nN;var yq=tN.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wg=b,Sq=yq;function bq(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Eq=typeof Object.is=="function"?Object.is:bq,wq=Sq.useSyncExternalStore,Cq=wg.useRef,xq=wg.useEffect,Iq=wg.useMemo,Tq=wg.useDebugValue;eN.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Cq(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=Iq(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&a.hasValue){var h=a.value;if(o(h,p))return d=h}return d=p}if(h=d,Eq(c,p))return h;var m=r(p);return o!==void 0&&o(h,m)?(c=p,h):(c=p,d=m)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var s=wq(e,i[0],i[1]);return xq(function(){a.hasValue=!0,a.value=s},[s]),Tq(s),s};Zk.exports=eN;var Aq=Zk.exports;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var W=function(){return W=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ue(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function ct(e,t,n){if(arguments.length===2)for(var r=0,o=t.length,i;r"u"||typeof r=="string"||bu(r)?{target:r,event:e}:W(W({},r),{event:e})});return n}function Wq(e){if(!(e===void 0||e===Nq))return lo(e)}function fN(e,t,n,r,o){var i=e.options.guards,a={state:o,cond:t,_event:r};if(t.type===wS)return((i==null?void 0:i[t.name])||t.predicate)(n,r.data,a);var s=i==null?void 0:i[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function pN(e){return typeof e=="string"?{type:e}:e}function fd(e,t,n){var r=function(){},o=typeof e=="object",i=o?e:null;return{next:((o?e.next:e)||r).bind(i),error:((o?e.error:t)||r).bind(i),complete:((o?e.complete:n)||r).bind(i)}}function Ep(e,t){return"".concat(e,":invocation[").concat(t,"]")}function xS(e){return(e.type===tc||e.type===Af&&e.to===$a.Internal)&&typeof e.delay!="number"}var Ts=un({type:oN});function Sm(e,t){return t&&t[e]||void 0}function Eu(e,t){var n;if(Ge(e)||typeof e=="number"){var r=Sm(e,t);je(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(je(e))n={type:e.name||e.toString(),exec:e};else{var r=Sm(e.type,t);if(je(r))n=W(W({},e),{exec:r});else if(r){var o=r.type||e.type;n=W(W(W({},r),e),{type:o})}else n=e}return n}var Si=function(e,t){if(!e)return[];var n=nc(e)?e:[e];return n.map(function(r){return Eu(r,t)})};function _g(e){var t=Eu(e);return W(W({id:Ge(e)?e:t.id},t),{type:t.type})}function hN(e,t){return{type:tc,event:typeof e=="function"?e:Ag(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function mN(e,t,n,r){var o={_event:n},i=un(je(e.event)?e.event(t,n.data,o):e.event),a;if(Ge(e.delay)){var s=r&&r[e.delay];a=je(s)?s(t,n.data,o):s}else a=je(e.delay)?e.delay(t,n.data,o):e.delay;return W(W({},e),{type:tc,_event:i,delay:a})}function rc(e,t){return{to:t?t.to:void 0,type:Af,event:je(e)?e:Ag(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:je(e)?e.name:lN(e)}}function gN(e,t,n,r){var o={_event:n},i=un(je(e.event)?e.event(t,n.data,o):e.event),a;if(Ge(e.delay)){var s=r&&r[e.delay];a=je(s)?s(t,n.data,o):s}else a=je(e.delay)?e.delay(t,n.data,o):e.delay;var l=je(e.to)?e.to(t,n.data,o):e.to;return W(W({},e),{to:l,_event:i,event:i.data,delay:a})}function Zb(e,t){return rc(e,W(W({},t),{to:$a.Parent}))}function Vq(e,t,n){return rc(t,W(W({},n),{to:e}))}function vN(){return Zb(Tg)}function Kq(e,t){return rc(e,W(W({},t),{to:function(n,r,o){var i=o._event;return i.origin}}))}var Gq=function(e,t){return{context:e,event:t}};function qq(e,t){return e===void 0&&(e=Gq),{type:Ig,label:t,expr:e}}var yN=function(e,t,n){return W(W({},e),{value:Ge(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},SN=function(e){return{type:Yb,sendId:e}};function bN(e){var t=_g(e);return{type:Qe.Start,activity:t,exec:void 0}}function EN(e){var t=je(e)?e:_g(e);return{type:Qe.Stop,activity:t,exec:void 0}}function wN(e,t,n){var r=je(e.activity)?e.activity(t,n.data):e.activity,o=typeof r=="string"?{id:r}:r,i={type:Qe.Stop,activity:o};return i}var CN=function(e){return{type:xg,assignment:e}};function Qq(e){return typeof e=="object"&&"type"in e}function xN(e,t){var n=t?"#".concat(t):"";return"".concat(Qe.After,"(").concat(e,")").concat(n)}function Vc(e,t){var n="".concat(Qe.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function pd(e,t){var n="".concat(Qe.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Dl(e,t){var n="".concat(Qe.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Yq(e){return{type:Qe.Pure,get:e}}function IN(e,t){return rc(function(n,r){return r},W(W({},t),{to:e}))}function Xq(e,t){return Zb(function(n,r,o){return{type:Xb,data:je(e)?e(n,r,o):e}},W(W({},t),{to:$a.Parent}))}function Jq(e){return{type:Qe.Choose,conds:e}}var Zq=function(e){var t,n,r=[];try{for(var o=Ne(e),i=o.next();!i.done;i=o.next())for(var a=i.value,s=0;s0;){var u=o.shift();n=e.transition(n,u,l),r.forEach(function(c){return c.next(n)})}i=!1}},s=oQ({id:t.id,send:function(u){o.push(u),a()},getSnapshot:function(){return n},subscribe:function(u,c,d){var f=fd(u,c,d);return r.add(f),f.next(n),{unsubscribe:function(){r.delete(f)}}}}),l={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(l):n,s}var TS={sync:!1,autoForward:!1},qt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(qt||(qt={}));var mQ=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=qt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,d){if(nc(c))return r.batch(c),r.state;var f=un(Ag(c,d));if(r.status===qt.Stopped)return r.state;if(r.status!==qt.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(f.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options. Event: `).concat(JSON.stringify(f.data)));return r.scheduler.schedule(function(){r.forward(f);var p=r._nextState(f);r.update(p,f)}),r._state},this.sendTo=function(c,d,f){var p=r.parent&&(d===$a.Parent||r.parent.id===d),h=p?r.parent:Ge(d)?d===$a.Internal?r:r.children.get(d)||wc.get(d):zq(d)?d:void 0;if(!h){if(!p)throw new Error("Unable to send event to child '".concat(d,"' from service '").concat(r.id,"'."));return}if("machine"in h){if(r.status!==qt.Stopped||r.parent!==h||r.state.done){var m=W(W({},c),{name:c.name===Xb?"".concat(Dl(r.id)):c.name,origin:r.sessionId});!f&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,m]):h.send(m)}}else!f&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,c.data]):h.send(c.data)},this._exec=function(c,d,f,p){p===void 0&&(p=r.machine.options.actions);var h=c.exec||Sm(c.type,p),m=je(h)?h:h?h.exec:c.exec;if(m)try{return m(d,f.data,r.machine.config.predictableActionArguments?{action:c,_event:f}:{action:c,state:r.state,_event:f})}catch(F){throw r.parent&&r.parent.send({type:"xstate.error",data:F}),F}switch(c.type){case tc:{var E=c;r.defer(E);break}case Af:var g=c;if(typeof g.delay=="number"){r.defer(g);return}else g.to?r.sendTo(g._event,g.to,f===Ts):r.send(g._event);break;case Yb:r.cancel(c.sendId);break;case mm:{if(r.status!==qt.Running)return;var y=c.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[y.id||y.type])break;if(y.type===Qe.Invoke){var v=pN(y.src),S=r.machine.options.services?r.machine.options.services[v.type]:void 0,x=y.id,I=y.data,T="autoForward"in y?y.autoForward:!!y.forward;if(!S)return;var A=I?ym(I,d,f):void 0;if(typeof S=="string")return;var R=je(S)?S(d,f.data,{data:A,src:v,meta:y.meta}):S;if(!R)return;var w=void 0;bu(R)&&(R=A?R.withContext(A):R,w={autoForward:T}),r.spawn(R,x,w)}else r.spawnActivity(y);break}case Cg:{r.stopChild(c.activity.id);break}case Ig:var _=c,k=_.label,N=_.value;k?r.logger(k,N):r.logger(N);break}};var o=W(W({},e.defaultOptions),n),i=o.clock,a=o.logger,s=o.parent,l=o.id,u=l!==void 0?l:t.id;this.id=u,this.logger=a,this.clock=i,this.parent=s,this.options=o,this.scheduler=new cT({deferEvents:this.options.deferEvents}),this.sessionId=wc.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:vl(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(t,n){var r,o;try{for(var i=Ne(t.actions),a=i.next();!a.done;a=i.next()){var s=a.value;this.exec(s,t,n)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,o,i,a,s,l,u,c,d=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===Ts)&&this.options.execute)this.execute(this.state);else for(var f=void 0;f=this._outgoingQueue.shift();)f[0].send(f[1]);if(this.children.forEach(function(R){d.state.children[R.id]=R}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var p=Ne(this.eventListeners),h=p.next();!h.done;h=p.next()){var m=h.value;m(t.event)}}catch(R){r={error:R}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}try{for(var E=Ne(this.listeners),g=E.next();!g.done;g=E.next()){var m=g.value;m(t,t.event)}}catch(R){i={error:R}}finally{try{g&&!g.done&&(a=E.return)&&a.call(E)}finally{if(i)throw i.error}}try{for(var y=Ne(this.contextListeners),v=y.next();!v.done;v=y.next()){var S=v.value;S(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(R){s={error:R}}finally{try{v&&!v.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}if(this.state.done){var x=t.configuration.find(function(R){return R.type==="final"&&R.parent===d.machine}),I=x&&x.doneData?ym(x.doneData,t.context,n):void 0;this._doneEvent=pd(this.id,I);try{for(var T=Ne(this.doneListeners),A=T.next();!A.done;A=T.next()){var m=A.value;m(this._doneEvent)}}catch(R){u={error:R}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}this._stop(),this._stopChildren(),wc.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===qt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var o=this,i=fd(t,n,r);this.listeners.add(i.next),this.status!==qt.NotStarted&&i.next(this.state);var a=function(){o.doneListeners.delete(a),o.stopListeners.delete(a),i.complete()};return this.status===qt.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){o.listeners.delete(i.next),o.doneListeners.delete(a),o.stopListeners.delete(a)}}},e.prototype.onEvent=function(t){return this.eventListeners.add(t),this},e.prototype.onSend=function(t){return this.sendListeners.add(t),this},e.prototype.onChange=function(t){return this.contextListeners.add(t),this},e.prototype.onStop=function(t){return this.stopListeners.add(t),this},e.prototype.onDone=function(t){return this.status===qt.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},e.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},e.prototype.start=function(t){var n=this;if(this.status===qt.Running)return this;this.machine._init(),wc.register(this.sessionId,this),this.initialized=!0,this.status=qt.Running;var r=t===void 0?this.initialState:vl(this,function(){return lQ(t)?n.machine.resolveState(t):n.machine.resolveState(uo.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,Ts)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){je(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,o,i,a,s,l,u,c;try{for(var d=Ne(this.listeners),f=d.next();!f.done;f=d.next()){var p=f.value;this.listeners.delete(p)}}catch(T){t={error:T}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}try{for(var h=Ne(this.stopListeners),m=h.next();!m.done;m=h.next()){var p=m.value;p(),this.stopListeners.delete(p)}}catch(T){r={error:T}}finally{try{m&&!m.done&&(o=h.return)&&o.call(h)}finally{if(r)throw r.error}}try{for(var E=Ne(this.contextListeners),g=E.next();!g.done;g=E.next()){var p=g.value;this.contextListeners.delete(p)}}catch(T){i={error:T}}finally{try{g&&!g.done&&(a=E.return)&&a.call(E)}finally{if(i)throw i.error}}try{for(var y=Ne(this.doneListeners),v=y.next();!v.done;v=y.next()){var p=v.value;this.doneListeners.delete(p)}}catch(T){s={error:T}}finally{try{v&&!v.done&&(l=y.return)&&l.call(y)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=qt.Stopped,this._initialState=void 0;try{for(var S=Ne(Object.keys(this.delayedEventsMap)),x=S.next();!x.done;x=S.next()){var I=x.value;this.clock.clearTimeout(this.delayedEventsMap[I])}}catch(T){u={error:T}}finally{try{x&&!x.done&&(c=S.return)&&c.call(S)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new cT({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=t._state)===null||r===void 0)&&r.done)){var o=un({type:"xstate.stop"}),i=vl(t,function(){var a=bt(ct([],Ue(t.state.configuration),!1).sort(function(d,f){return f.order-d.order}).map(function(d){return Si(d.onExit,t.machine.options.actions)})),s=Ue(Wd(t.machine,t.state,t.state.context,o,[{type:"exit",actions:a}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),l=s[0],u=s[1],c=new uo({value:t.state.value,context:u,_event:o,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:l.filter(function(d){return!xS(d)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return c.changed=!0,c});t.update(i,o),t._stopChildren(),wc.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(!(this.status===qt.NotStarted&&this.options.deferEvents)){if(this.status!==qt.Running)throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(t.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var o,i,a=n.state,s=!1,l=[],u=function(p){var h=un(p);n.forward(h),a=vl(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),l.push.apply(l,ct([],Ue(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(m){return uQ(m,a)})),!1)),s=s||!!a.changed};try{for(var c=Ne(t),d=c.next();!d.done;d=c.next()){var f=d.value;u(f)}}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}a.changed=s,a.actions=l,n.update(a,un(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var o=un(t);if(o.name.indexOf(ES)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(ES)===0}))throw o.data.data;var i=vl(this,function(){return r.machine.transition(r.state,o,void 0,n||void 0)});return i},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var o=Ne(this.forwardTo),i=o.next();!i.done;i=o.next()){var a=i.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(l){n={error:l}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),je(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==qt.Running)return eE(t,n);if(sT(t))return this.spawnPromise(Promise.resolve(t),n);if(je(t))return this.spawnCallback(t,n);if(rQ(t))return this.spawnActor(t,n);if(Bq(t))return this.spawnObservable(t,n);if(bu(t))return this.spawnMachine(t,W(W({},r),{id:n}));if(Lq(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var o=new e(t,W(W({},this.options),{parent:this,id:n.id||t.id})),i=W(W({},TS),n);i.sync&&o.onTransition(function(s){r.send(Tg,{state:s,id:o.id})});var a=o;return this.children.set(o.id,a),i.autoForward&&this.forwardTo.add(o.id),o.onDone(function(s){r.removeChild(o.id),r.send(un(s,{origin:o.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=hQ(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,o=this,i=!1,a;t.then(function(l){i||(a=l,o.removeChild(n),o.send(un(pd(n,l),{origin:n})))},function(l){if(!i){o.removeChild(n);var u=Dl(n,l);try{o.send(un(u,{origin:n}))}catch{o.devTools&&o.devTools.send(u,o.state),o.machine.strict&&o.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(l,u,c){var d=fd(l,u,c),f=!1;return t.then(function(p){f||(d.next(p),!f&&d.complete())},function(p){f||d.error(p)}),{unsubscribe:function(){return f=!0}}},stop:function(){i=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[ca]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,o=this,i=!1,a=new Set,s=new Set,l,u=function(f){l=f,s.forEach(function(p){return p(f)}),!i&&o.send(un(f,{origin:n}))},c;try{c=t(u,function(f){a.add(f)})}catch(f){this.send(Dl(n,f))}if(sT(c))return this.spawnPromise(c,n);var d=(r={id:n,send:function(f){return a.forEach(function(p){return p(f)})},subscribe:function(f){var p=fd(f);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){i=!0,je(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return l}},r[ca]=function(){return this},r);return this.children.set(n,d),d},e.prototype.spawnObservable=function(t,n){var r,o=this,i,a=t.subscribe(function(l){i=l,o.send(un(l,{origin:n}))},function(l){o.removeChild(n),o.send(un(Dl(n,l),{origin:n}))},function(){o.removeChild(n),o.send(un(pd(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(l,u,c){return t.subscribe(l,u,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return i},toJSON:function(){return{id:n}}},r[ca]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(n){var r=n(this.state.context,t);this.spawnEffect(t.id,r)}},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[ca]=function(){return this},r))},e.prototype.attachDev=function(){var t=tE();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(W(W({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:W({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}pQ(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[ca]=function(){return this},e.prototype.getSnapshot=function(){return this.status===qt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=NN,e}(),gQ=function(e){return Ge(e)?W(W({},TS),{name:e}):W(W(W({},TS),{name:Hq()}),e)};function Cc(e,t){var n=gQ(t);return eQ(function(r){return r?r.spawn(e,n.name,n):eE(e,n.name)})}function NN(e,t){var n=new mQ(e,t);return n}function vQ(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function wp(e){return W(W({type:gm},e),{toJSON:function(){e.onDone,e.onError;var t=Qb(e,["onDone","onError"]);return W(W({},t),{type:gm,src:vQ(e.src)})}})}var Cp="",AS="#",Ey="*",ul={},cl=function(e){return e[0]===AS},yQ=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},SQ=function(){function e(t,n,r,o){r===void 0&&(r="context"in t?t.context:void 0);var i=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(yQ(),n),this.parent=o==null?void 0:o.parent,this.key=this.config.key||(o==null?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:sN),this.id=this.config.id||ct([this.machine.key],Ue(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?Wc(this.config.states,function(u,c){var d,f=new e(u,{},void 0,{parent:i,key:c});return Object.assign(i.idMap,W((d={},d[f.id]=f,d),f.idMap)),f}):ul;var s=0;function l(u){var c,d;u.order=s++;try{for(var f=Ne(_N(u)),p=f.next();!p.done;p=f.next()){var h=p.value;l(h)}}catch(m){c={error:m}}finally{try{p&&!p.done&&(d=f.return)&&d.call(f)}finally{if(c)throw c.error}}}l(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(u){var c=u.event;return c===Cp}):Cp in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=lo(this.config.entry||this.config.onEntry).map(function(u){return Eu(u)}),this.onExit=lo(this.config.exit||this.config.onExit).map(function(u){return Eu(u)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=lo(this.config.invoke).map(function(u,c){var d,f;if(bu(u)){var p=Ep(i.id,c);return i.machine.options.services=W((d={},d[p]=u,d),i.machine.options.services),wp({src:p,id:p})}else if(Ge(u.src)){var p=u.id||Ep(i.id,c);return wp(W(W({},u),{id:p,src:u.src}))}else if(bu(u.src)||je(u.src)){var p=u.id||Ep(i.id,c);return i.machine.options.services=W((f={},f[p]=u.src,f),i.machine.options.services),wp(W(W({id:p},u),{src:p}))}else{var h=u.src;return wp(W(W({id:Ep(i.id,c)},u),{src:h}))}}),this.activities=lo(this.config.activities).concat(this.invoke).map(function(u){return _g(u)}),this.transition=this.transition.bind(this),this.tags=lo(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||RN(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,i=r.activities,a=r.guards,s=r.services,l=r.delays;return new e(this.config,{actions:W(W({},o),t.actions),activities:W(W({},i),t.activities),guards:W(W({},a),t.guards),services:W(W({},s),t.services),delays:W(W({},l),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return je(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Wc(this.states,function(t){return t.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===Cp,r=this.transitions.filter(function(o){var i=o.eventType===t;return n?i:i||o.eventType===Ey});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(i,a){var s=je(i)?"".concat(t.id,":delay[").concat(a,"]"):i,l=xN(s,t.id);return t.onEntry.push(rc(l,{delay:i})),t.onExit.push(SN(l)),l},o=nc(n)?n.map(function(i,a){var s=r(i.delay,a);return W(W({},i),{event:s})}):bt(Object.keys(n).map(function(i,a){var s=n[i],l=Ge(s)?{target:s}:s,u=isNaN(+i)?i:+i,c=r(u,a);return lo(l).map(function(d){return W(W({},d),{event:c,delay:u})})}));return o.map(function(i){var a=i.delay;return W(W({},t.formatTransition(i)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var o=t instanceof uo?t.value:dd(t,this.delimiter);if(Ge(o)){var i=this.getStateNode(o).initial;return i!==void 0?this.getStateNodes((n={},n[o]=i,n)):[this,this.states[o]]}var a=Object.keys(o),s=[this];return s.push.apply(s,ct([],Ue(bt(a.map(function(l){return r.getStateNode(l).getStateNodes(o[l])}))),!1)),s},e.prototype.handles=function(t){var n=lN(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof uo?t:uo.create(t),r=Array.from(Kc([],this.getStateNodes(n.value)));return new uo(W(W({},n),{value:this.resolve(n.value),configuration:r,done:Eh(r,this),tags:uT(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var o=this.getStateNode(t),i=o.next(n,r);return!i||!i.transitions.length?this.next(n,r):i},e.prototype.transitionCompoundNode=function(t,n,r){var o=Object.keys(t),i=this.getStateNode(o[0]),a=i._transition(t[o[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var o,i,a={};try{for(var s=Ne(Object.keys(t)),l=s.next();!l.done;l=s.next()){var u=l.value,c=t[u];if(c){var d=this.getStateNode(u),f=d._transition(c,n,r);f&&(a[u]=f)}}}catch(g){o={error:g}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}var p=Object.keys(a).map(function(g){return a[g]}),h=bt(p.map(function(g){return g.transitions})),m=p.some(function(g){return g.transitions.length>0});if(!m)return this.next(n,r);var E=bt(Object.keys(a).map(function(g){return a[g].configuration}));return{transitions:h,exitSet:bt(p.map(function(g){return g.exitSet})),configuration:E,source:n,actions:bt(Object.keys(a).map(function(g){return a[g].actions}))}},e.prototype._transition=function(t,n,r){return Ge(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,un(n))},e.prototype.next=function(t,n){var r,o,i=this,a=n.name,s=[],l=[],u;try{for(var c=Ne(this.getCandidates(a)),d=c.next();!d.done;d=c.next()){var f=d.value,p=f.cond,h=f.in,m=t.context,E=h?Ge(h)&&cl(h)?t.matches(dd(this.getStateNodeById(h).path,this.delimiter)):Jb(dd(h,this.delimiter),Dq(this.path.slice(0,-2))(t.value)):!0,g=!1;try{g=!p||fN(this.machine,p,m,n,t)}catch(S){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`': `).concat(S.message))}if(g&&E){f.target!==void 0&&(l=f.target),s.push.apply(s,ct([],Ue(f.actions),!1)),u=f;break}}}catch(S){r={error:S}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}if(u){if(!l.length)return{transitions:[u],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var y=bt(l.map(function(S){return i.getRelativeStateNodes(S,t.historyValue)})),v=!!u.internal;return{transitions:[u],exitSet:v?[]:bt(l.map(function(S){return i.getPotentiallyReenteringNodes(S)})),configuration:y,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order0,p=f?t.configuration:n?n.configuration:[],h=Eh(p,this),m=f?iQ(this.machine,d):void 0,E=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,g=this.getActions(new Set(p),h,t,r,i,n,o),y=n?W({},n.activities):{};try{for(var v=Ne(g),S=v.next();!S.done;S=v.next()){var x=S.value;try{for(var I=(l=void 0,Ne(x.actions)),T=I.next();!T.done;T=I.next()){var A=T.value;A.type===mm?y[A.activity.id||A.activity.type]=A:A.type===Cg&&(y[A.activity.id||A.activity.type]=!1)}}catch(ne){l={error:ne}}finally{try{T&&!T.done&&(u=I.return)&&u.call(I)}finally{if(l)throw l.error}}}}catch(ne){a={error:ne}}finally{try{S&&!S.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}var R=Ue(Wd(this,n,r,i,g,o,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),w=R[0],_=R[1],k=Ue(Uq(w,xS),2),N=k[0],F=k[1],U=w.filter(function(ne){var ce;return ne.type===mm&&((ce=ne.activity)===null||ce===void 0?void 0:ce.type)===gm}),$=U.reduce(function(ne,ce){return ne[ce.activity.id]=tQ(ce.activity,c.machine,_,i),ne},n?W({},n.children):{}),j=new uo({value:m||n.value,context:_,_event:i,_sessionid:n?n._sessionid:null,historyValue:m?E?$q(E,m):void 0:n?n.historyValue:void 0,history:!m||t.source?n:void 0,actions:m?F:[],activities:m?y:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:$,done:h,tags:uT(p),machine:this}),M=r!==_;j.changed=i.name===Tg||M;var D=j.history;D&&delete D.history;var z=!h&&(this._transient||d.some(function(ne){return ne._transient}));if(!f&&(!z||i.name===Cp))return j;var K=j;if(!h)for(z&&(K=this.resolveRaisedTransition(K,{type:rN},i,o));N.length;){var ae=N.shift();K=this.resolveRaisedTransition(K,ae._event,i,o)}var Ie=K.changed||(D?!!K.actions.length||M||typeof D.value!=typeof K.value||!kN(K.value,D.value):void 0);return K.changed=Ie,K.history=D,K},e.prototype.getStateNode=function(t){if(cl(t))return this.machine.getStateNodeById(t);if(!this.states)throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=cl(t)?t.slice(AS.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&cl(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=CS(t,this.delimiter).slice(),r=this;n.length;){var o=n.shift();if(!o.length)break;r=r.getStateNode(o)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||ul;switch(this.type){case"parallel":return Wc(this.initialStateValue,function(i,a){return i?r.getStateNode(a).resolve(t[a]||i):ul});case"compound":if(Ge(t)){var o=this.getStateNode(t);return o.type==="parallel"||o.type==="compound"?(n={},n[t]=o.initialStateValue,n):t}return Object.keys(t).length?Wc(t,function(i,a){return i?r.getStateNode(a).resolve(i):ul}):this.initialStateValue||{};default:return t||ul}},e.prototype.getResolvedPath=function(t){if(cl(t)){var n=this.machine.idMap[t.slice(AS.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return CS(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=aT(this.states,function(r){return r.initialStateValue||ul},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=Em(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;Ge(n.target)?t=cl(n.target)?vm(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(Em(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=bh(this.initialStateValue);return bt(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=Ue(t),r=n[0],o=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var i=this.getStateNode(r);if(i.type==="history")return i.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(o)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:aT(this.states,function(n,r){if(!t)return n.historyValue();var o=Ge(t)?void 0:t[r];return n.historyValue(o||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var o=this.target;return o?bt(bh(o).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var i=Mq(r.path,"states")(t).current;return Ge(i)?[r.getStateNode(i)]:bt(bh(i).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=bt(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,o;if(this.__cache.events)return this.__cache.events;var i=this.states,a=new Set(this.ownEvents);if(i)try{for(var s=Ne(Object.keys(i)),l=s.next();!l.done;l=s.next()){var u=l.value,c=i[u];if(c.states)try{for(var d=(r=void 0,Ne(c.events)),f=d.next();!f.done;f=d.next()){var p=f.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!Ge(r))return r;var o=r[0]===n.delimiter;if(o&&!n.parent)return n.getStateNodeByPath(r.slice(1));var i=o?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(i);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`': `).concat(s.message))}else return n.getStateNodeByPath(i)})},e.prototype.formatTransition=function(t){var n=this,r=Wq(t.target),o="internal"in t?t.internal:r?r.some(function(l){return Ge(l)&&l[0]===n.delimiter}):!0,i=this.machine.options.guards,a=this.resolveTarget(r),s=W(W({},t),{actions:Si(lo(t.actions)),cond:dN(t.cond,i),target:a,source:this,internal:o,eventType:t.event,toJSON:function(){return W(W({},s),{target:s.target?s.target.map(function(l){return"#".concat(l.id)}):void 0,source:"#".concat(n.id)})}});return s},e.prototype.formatTransitions=function(){var t,n,r=this,o;if(!this.config.on)o=[];else if(Array.isArray(this.config.on))o=this.config.on;else{var i=this.config.on,a=Ey,s=i[a],l=s===void 0?[]:s,u=Qb(i,[typeof a=="symbol"?a:a+""]);o=bt(Object.keys(u).map(function(y){var v=ll(y,u[y]);return v}).concat(ll(Ey,l)))}var c=this.config.always?ll("",this.config.always):[],d=this.config.onDone?ll(String(Vc(this.id)),this.config.onDone):[],f=bt(this.invoke.map(function(y){var v=[];return y.onDone&&v.push.apply(v,ct([],Ue(ll(String(pd(y.id)),y.onDone)),!1)),y.onError&&v.push.apply(v,ct([],Ue(ll(String(Dl(y.id)),y.onError)),!1)),v})),p=this.after,h=bt(ct(ct(ct(ct([],Ue(d),!1),Ue(f),!1),Ue(o),!1),Ue(c),!1).map(function(y){return lo(y).map(function(v){return r.formatTransition(v)})}));try{for(var m=Ne(p),E=m.next();!E.done;E=m.next()){var g=E.value;h.push(g)}}catch(y){t={error:y}}finally{try{E&&!E.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}return h},e}();function oc(e,t){return new SQ(e,t)}var ri=CN,Rg=vN,bQ=IN,EQ=b.useLayoutEffect;function dT(e){var t=b.useRef();return t.current||(t.current={v:e()}),t.current.v}var wm=function(){return wm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i};function xQ(e,t){var n=dT(function(){return typeof e=="function"?e():e}),r=t.context,o=t.guards,i=t.actions,a=t.activities,s=t.services,l=t.delays;t.state;var u=wQ(t,["context","guards","actions","activities","services","delays","state"]),c=dT(function(){var d={context:r,guards:o,actions:i,activities:a,services:s,delays:l},f=n.withConfig(d,function(){return wm(wm({},n.context),r)});return NN(f,u)});return EQ(function(){Object.assign(c.machine.options.actions,i),Object.assign(c.machine.options.guards,o),Object.assign(c.machine.options.activities,a),Object.assign(c.machine.options.services,s),Object.assign(c.machine.options.delays,l)},[i,o,a,s,l]),c}function IQ(e){for(var t=[],n=1;n{var t;return(t=e.context.actorRef)==null?void 0:t.getSnapshot()},Kd=e=>{var t;return(t=nE(e))==null?void 0:t.context},NQ={category:fr.AI,apis:[ci.CreateConversation,ci.DeleteConversation,ci.ListConversations,ci.UpdateConversation,ci.OnMessage,ci.SendMessage,ci.Generation]},OQ={apis:[Ee.DeleteUser,Ee.UpdatePassword],category:fr.Auth},DQ={apis:[Ee.SignUp,Ee.ConfirmSignUp,Ee.ResendSignUpCode,Ee.SignIn,Ee.ConfirmSignIn,Ee.FetchUserAttributes,Ee.SignOut,Ee.ResetPassword,Ee.ConfirmResetPassword,Ee.SignInWithRedirect],category:fr.Auth},MQ={apis:[ho.UploadData],category:fr.Storage},FQ={apis:[q0.NotifyMessageInteraction],category:fr.InAppMessaging},LQ={category:fr.Geo,apis:[sd.SearchByText,sd.SearchForSuggestions,sd.SearchByPlaceId]},UQ={category:fr.Geo,apis:[]},$Q={apis:[ho.UploadData],category:fr.Storage},jQ={apis:[ho.UploadData,ho.Copy,ho.GetUrl,ho.List,ho.Remove,ho.GetDataAccess,ho.ListCallerAccessGrants],category:fr.Storage};function mr(e){return e!=null&&!Array.isArray(e)&&typeof e=="object"}function $i(e){return typeof e=="string"||typeof e=="object"&&Object.prototype.toString.call(e)==="[object String]"}function BQ(e){return mr(e)&&Object.prototype.toString.call(e)==="[object Map]"}function zQ(e){return mr(e)&&Object.prototype.toString.call(e)==="[object Set]"}function rE(e){if(e==null)return!0;if(mr(e)&&(BQ(e)||zQ(e)))return!e.size;if(mr(e)&&($i(e)||Array.isArray(e)))return!e.length;for(const t in e)if(ji(e,t))return!1;return!0}function HQ(e){return Array.isArray(e)&&rE(e)}function WQ(...e){return e.every(HQ)}function ON(e){return mr(e)&&rE(e)}function VQ(...e){return e.every(ON)}function ji(e,t){return e!=null&&Object.prototype.hasOwnProperty.call(e,t)}function Wr(e){return typeof e=="function"}const Fe=(e,t)=>t?`${e}--${t}`:"",zt=(e,t,n)=>n?`${e}--${t}`:"";function KQ(...e){}function GQ(e,t){const n={},r={};return Object.entries(e).forEach(([o,i])=>{t(o)?n[o]=i:r[o]=i}),[n,r]}const DN=({payload:e},t,n)=>{var l;const{data:r,event:o}=e,{send:i}=t,{onSignIn:a,onSignOut:s}=n??{};switch(o){case"signedIn":{Wr(a)&&a(e);break}case"signInWithRedirect":{i("SIGN_IN_WITH_REDIRECT");break}case"signedOut":{Wr(s)&&s(),i("SIGN_OUT");break}case"tokenRefresh_failure":{if(((l=r==null?void 0:r.error)==null?void 0:l.name)===Mi.NetworkError)return;i("SIGN_OUT");break}}},qQ=(e,t=DN)=>{const n=r=>t(r,e);return dr.listen("auth",n,"authenticator-hub-handler")},MN=["+1","+7","+20","+27","+30","+31","+32","+33","+34","+36","+39","+40","+41","+43","+44","+45","+46","+47","+48","+49","+51","+52","+53","+54","+55","+56","+57","+58","+60","+61","+62","+63","+64","+65","+66","+81","+82","+84","+86","+90","+91","+92","+93","+94","+95","+98","+212","+213","+216","+218","+220","+221","+222","+223","+224","+225","+226","+227","+228","+229","+230","+231","+232","+233","+234","+235","+236","+237","+238","+239","+240","+241","+242","+243","+244","+245","+246","+248","+249","+250","+251","+252","+253","+254","+255","+256","+257","+258","+260","+261","+262","+263","+264","+265","+266","+267","+268","+269","+290","+291","+297","+298","+299","+345","+350","+351","+352","+353","+354","+355","+356","+357","+358","+359","+370","+371","+372","+373","+374","+375","+376","+377","+378","+379","+380","+381","+382","+385","+386","+387","+389","+420","+421","+423","+500","+501","+502","+503","+504","+505","+506","+507","+508","+509","+537","+590","+591","+593","+594","+595","+596","+597","+598","+599","+670","+672","+673","+674","+675","+676","+677","+678","+679","+680","+681","+682","+683","+685","+686","+687","+688","+689","+690","+691","+692","+850","+852","+853","+855","+856","+872","+880","+886","+960","+961","+962","+963","+964","+965","+966","+967","+968","+970","+971","+972","+973","+974","+975","+976","+977","+992","+993","+994","+995","+996","+998"],Pg={birthdate:{label:"Birthdate",placeholder:"Enter your Birthdate",type:"date",autocomplete:"bday",isRequired:!0},confirmation_code:{label:"Confirmation Code",placeholder:"Enter your Confirmation Code",type:"text",autocomplete:"one-time-code",isRequired:!0},confirm_password:{label:"Confirm Password",placeholder:"Please confirm your Password",type:"password",autocomplete:"new-password",isRequired:!0},email:{label:"Email",placeholder:"Enter your Email",type:"email",autocomplete:"username",isRequired:!0},family_name:{label:"Family Name",placeholder:"Enter your Family Name",type:"text",autocomplete:"family-name",isRequired:!0},given_name:{label:"Given Name",placeholder:"Enter your Given Name",type:"text",autocomplete:"given-name",isRequired:!0},middle_name:{label:"Middle Name",placeholder:"Enter your Middle Name",type:"text",autocomplete:"additional-name",isRequired:!0},name:{label:"Name",placeholder:"Enter your Name",type:"text",autocomplete:"name",isRequired:!0},nickname:{label:"Nickname",placeholder:"Enter your Nickname",type:"text",autocomplete:"tel",isRequired:!0},password:{label:"Password",placeholder:"Enter your Password",type:"password",autocomplete:"new-password",isRequired:!0},phone_number:{label:"Phone Number",placeholder:"Enter your Phone Number",type:"tel",autocomplete:"tel",dialCode:"+1",dialCodeList:MN,isRequired:!0},preferred_username:{label:"Preferred Username",placeholder:"Enter your Preferred Username",type:"text",isRequired:!0},profile:{label:"Profile",placeholder:"Add your Profile",type:"url",autocomplete:"url",isRequired:!0},website:{label:"Website",placeholder:"Add your Website",type:"url",autocomplete:"url",isRequired:!0},username:{label:"Username",placeholder:"Enter your Username",type:"text",autocomplete:"username",isRequired:!0}},QQ=["^","$","*",".","[","]","{","}","(",")","?",'"',"!","@","#","%","&","/","\\",",",">","<","'",":",";","|","_","~","`","=","+","-"," "],YQ=(e,t)=>{if(t!=null&&t.matches("federatedSignIn")){if(e.matches("signUpActor"))return"signUp";if(e.matches("signInActor"))return"signIn"}switch(!0){case e.matches("idle"):return"idle";case e.matches("setup"):return"setup";case e.matches("signOut"):return"signOut";case e.matches("authenticated"):return"authenticated";case(t==null?void 0:t.matches("confirmSignUp")):case(t==null?void 0:t.matches("resendSignUpCode")):return"confirmSignUp";case(t==null?void 0:t.matches("confirmSignIn")):return"confirmSignIn";case(t==null?void 0:t.matches("setupTotp.edit")):case(t==null?void 0:t.matches("setupTotp.submit")):return"setupTotp";case(t==null?void 0:t.matches("signIn")):return"signIn";case(t==null?void 0:t.matches("signUp")):case(t==null?void 0:t.matches("autoSignIn")):return"signUp";case(t==null?void 0:t.matches("forceChangePassword")):return"forceNewPassword";case(t==null?void 0:t.matches("forgotPassword")):return"forgotPassword";case(t==null?void 0:t.matches("confirmResetPassword")):return"confirmResetPassword";case(t==null?void 0:t.matches("selectUserAttributes")):return"verifyUser";case(t==null?void 0:t.matches("confirmVerifyUserAttribute")):return"confirmVerifyUser";case(t==null?void 0:t.matches("setupEmail")):return"setupEmail";case(t==null?void 0:t.matches("selectMfaType")):return"selectMfaType";case e.matches("getCurrentUser"):case(t==null?void 0:t.matches("fetchUserAttributes")):return"transition";default:return null}},XQ=e=>{const t=n=>r=>e({type:n,data:r});return{initializeMachine:t("INIT"),resendCode:t("RESEND"),signOut:t("SIGN_OUT"),submitForm:t("SUBMIT"),updateForm:t("CHANGE"),updateBlur:t("BLUR"),toFederatedSignIn:t("FEDERATED_SIGN_IN"),toForgotPassword:t("FORGOT_PASSWORD"),toSignIn:t("SIGN_IN"),toSignUp:t("SIGN_UP"),skipVerification:t("SKIP")}},JQ=e=>{var y,v;const t=Kd(e)??{},{allowedMfaTypes:n,challengeName:r,codeDeliveryDetails:o,remoteError:i,validationError:a,totpSecretCode:s=null,unverifiedUserAttributes:l,username:u}=t,{socialProviders:c=[]}=((y=e.context)==null?void 0:y.config)??{},d=(t==null?void 0:t.user)??((v=e.context)==null?void 0:v.user),f=!!(a&&Object.keys(a).length>0),p=nE(e),h=e.hasTag("pending")||(p==null?void 0:p.hasTag("pending")),m=YQ(e,p),E=(S=>{switch(S){case"idle":case"setup":return"configuring";case"authenticated":return"authenticated";default:return"unauthenticated"}})(m);return{allowedMfaTypes:n,authStatus:E,challengeName:r,codeDeliveryDetails:o,error:i,hasValidationErrors:f,isPending:h,route:m,socialProviders:c,totpSecretCode:s,unverifiedUserAttributes:l,user:d,username:u,validationErrors:a}},ZQ=({send:e,state:t})=>{const n=XQ(e),r=JQ(t);return{...n,...r}};var Ml;(function(e){e.Apple="Apple",e.Amazon="Amazon",e.Facebook="Facebook",e.Google="Google"})(Ml||(Ml={}));var fT;(function(e){e.Email="email",e.PhoneNumber="phone_number"})(fT||(fT={}));const eY=["birthdate","email","family_name","given_name","middle_name","name","nickname","phone_number","preferred_username","profile","website"],tY=["username","email","phone_number"],FN=[...tY,...eY,"confirmation_code","password","confirm_password"],nY=e=>FN.includes(e),LN=e=>FN.includes(e),rY=e=>Array.isArray(e),oY=e=>e?rY(e)?e:[e]:null,iY=e=>{const t=e.trim().split("");for(let n=0;n0&&n{if(e.length<4)return e;const t=e.split("");for(let n=0;n{const t=e.split("@");return`${iY(t[0])}@${t[1]}`},lY=(e,t)=>e==="Phone Number"?aY(t):sY(t),uY=e=>QQ.some(t=>e.includes(t)),cY=(e,t,n)=>encodeURI(`otpauth://totp/${e}:${t}?secret=${n}&issuer=${e}`);function dY(e,...t){return Object.entries(e).reduce((n,[r,o])=>({...n,[r]:t.includes(r)?o:o==null?void 0:o.trim()}),{})}const fY={ADD_PROFILE:"Add your Profile",ADD_WEBSITE:"Add your Website",BACK_SIGN_IN:"Back to Sign In",BIRTHDATE:"Birthdate",CHANGE_PASSWORD:"Change Password",CHANGING_PASSWORD:"Changing",CODE:"Code",CODE_ARRIVAL:"It may take a minute to arrive",CODE_EMAILED:"Your code is on the way. To log in, enter the code we emailed to",CODE_SENT:"Your code is on the way. To log in, enter the code we sent you",CODE_TEXTED:"Your code is on the way. To log in, enter the code we texted to",CONFIRM_PASSWORD:"Confirm Password",CONFIRM_PASSWORD_PLACEHOLDER:"Please confirm your Password",CONFIRM_RESET_PASSWORD_HEADING:"Reset your Password",CONFIRM_SIGNUP_HEADING:"Confirm Sign Up",CONFIRM_SMS:"Confirm SMS Code",CONFIRM_EMAIL:"Confirm Email Code",CONFIRM_MFA_DEFAULT:"Confirm MFA Code",CONFIRM_TOTP:"Confirm TOTP Code",CONFIRM:"Confirm",CONFIRMATION_CODE:"Confirmation Code",CONFIRMING:"Confirming",CREATE_ACCOUNT:"Create Account",CREATING_ACCOUNT:"Creating Account",EMAIL_ADDRESS:"Email",EMAIL_OTP:"Email Message",ENTER_BIRTHDATE:"Enter your Birthdate",ENTER_CODE:"Enter your code",ENTER_CONFIRMATION_CODE:"Enter your Confirmation Code",ENTER_EMAIL:"Enter your Email",ENTER_FAMILY_NAME:"Enter your Family Name",ENTER_GIVEN_NAME:"Enter your Given Name",ENTER_MIDDLE_NAME:"Enter your Middle Name",ENTER_NAME:"Enter your Name",ENTER_NICK_NAME:"Enter your Nickname",ENTER_PASSWORD:"Enter your Password",ENTER_PHONE_NUMBER:"Enter your Phone Number",ENTER_PREFERRED_USERNAME:"Enter your Preferred Username",ENTER_USERNAME:"Enter your username",FAMILY_NAME:"Family Name",GIVEN_NAME:"Given Name",FORGOT_PASSWORD:"Forgot Password?",FORGOT_YOUR_PASSWORD:"Forgot your password?",HIDE_PASSWORD:"Hide password",LOADING:"Loading",LOGIN_NAME:"Username",MIDDLE_NAME:"Middle Name",MFA_SETUP_SELECTION:"Multi-Factor Authentication Setup",MFA_SELECTION:"Multi-Factor Authentication",NAME:"Name",NICKNAME:"Nickname",NEW_PASSWORD:"New password",OR:"or",PASSWORD:"Password",PHONE_NUMBER:"Phone Number",PREFERRED_USERNAME:"Preferred Username",PROFILE:"Profile",RESEND_CODE:"Resend Code",RESET_PASSWORD_HEADING:"Reset your password",RESET_PASSWORD:"Reset Password",SEND_CODE:"Send code",SENDING:"Sending",SELECT_MFA_TYPE:"Select MFA Type",SETUP_EMAIL:"Setup Email",SETUP_TOTP:"Setup TOTP",SHOW_PASSWORD:"Show password",SIGN_IN_BUTTON:"Sign in",SIGN_IN_TAB:"Sign In",SIGN_IN_WITH_AMAZON:"Sign In with Amazon",SIGN_IN_WITH_APPLE:"Sign In with Apple",SIGN_IN_WITH_FACEBOOK:"Sign In with Facebook",SIGN_IN_WITH_GOOGLE:"Sign In with Google",SIGN_IN:"Sign in to your account",SIGN_UP_BUTTON:"Create a new account",SIGNING_IN_BUTTON:"Signing in",SKIP:"Skip",SMS_MFA:"Text Message (SMS)",SUBMIT:"Submit",SUBMITTING:"Submitting",SOFTWARE_TOKEN_MFA:"Authenticator App (TOTP)",UPPERCASE_COPY:"COPY",VERIFY_CONTACT:"Verify Contact",VERIFY_HEADING:"Account recovery requires verified contact information",VERIFY:"Verify",WE_EMAILED:"We Emailed You",WE_SENT_CODE:"We Sent A Code",WE_TEXTED:"We Texted You",WEBSITE:"Website"},wh={...fY},ge={...wh};function oe(e){return hi.get(e)}const oE=e=>{var r;const t=(r=e==null?void 0:e.context.config)==null?void 0:r.loginMechanisms,[n]=t??["username"];return n},pY=e=>{const t={...e};for(const[n,r]of Object.entries(e)){const{label:o,placeholder:i}=r;t[n]={...r,label:o?oe(o):void 0,placeholder:i?oe(i):void 0}}return t},hY=e=>Object.entries(e).sort((t,n)=>{const r=t[1].order||Number.MAX_VALUE,o=n[1].order||Number.MAX_VALUE;return r-o}).filter(t=>t[1]!==void 0),mY="+1",Bi=e=>{let t=Pg[e];const{type:n}=t;return n==="tel"&&(t={...t,dialCode:mY}),t},kg=e=>{const t=oE(e);return{...Bi(t),autocomplete:"username"}},Ch=e=>({confirmation_code:{...Bi("confirmation_code"),label:"Code *",placeholder:"Code"}}),gY=e=>({username:{...kg(e)},password:{...Bi("password"),autocomplete:"current-password"}}),vY=e=>{const{loginMechanisms:t,signUpAttributes:n}=e.context.config,r=oE(e),o=Array.from(new Set([...t,"password","confirm_password",...n])),i={};for(const a of o)if(LN(a)){const s=a===r?kg(e):Bi(a);i[a]={...s}}else console.debug(`Authenticator does not have a default implementation for ${a}. Customize SignUp FormFields to add your own.`);return i},yY=e=>({confirmation_code:{...Bi("confirmation_code"),placeholder:"Enter your code"}}),SY=e=>{const t=oE(e),{label:n}=Pg[t];return{username:{...kg(e),label:`Enter your ${n.toLowerCase()}`,placeholder:`Enter your ${n.toLowerCase()}`}}},bY=e=>({...Ch(),password:{...Bi("password"),label:"New Password",placeholder:"New Password"},confirm_password:{...Bi("confirm_password"),label:"Confirm Password",placeholder:"Confirm Password"}}),EY=e=>{const t=nE(e),{missingAttributes:n}=t.context,r=Array.from(new Set(["password","confirm_password",...n??[]])),o={};for(const i of r)LN(i)?o[i]={...Bi(i)}:console.debug(`Authenticator does not have a default implementation for ${i}. Customize ForceNewPassword FormFields to add your own.`);return o},wY=e=>({email:Bi("email")}),CY={signIn:gY,signUp:vY,confirmSignUp:yY,confirmSignIn:Ch,forceNewPassword:EY,forgotPassword:SY,confirmResetPassword:bY,confirmVerifyUser:Ch,setupEmail:wY,setupTotp:Ch},xY=(e,t)=>{const n=CY[e];return n(t)},IY=(e,t)=>{var r,o;const n=(o=(r=Kd(t))==null?void 0:r.formFields)==null?void 0:o[e];return!n||Object.keys(n).length===0?{}:Object.entries(n).reduce((i,[a,s])=>{if((e==="signIn"||e==="forgotPassword")&&a==="username"){const u={...kg(t),...s};return{...i,[a]:u}}else if(nY(a)){const u={...Pg[a],...s};return{...i,[a]:u}}else return{...i,[a]:s}},{})},TY=(e,t)=>{const n=xY(e,t),r=IY(e,t),o={...n,...r};return delete o.QR,pY(o)},AY=e=>e.map(t=>{const n=t[0],r={...t[1],order:void 0};return[n,r]}),_Y=(e,t)=>{const n=TY(e,t);return AY(hY(n))},RY=e=>{switch(e){case"EMAIL_OTP":return oe(ge.CONFIRM_EMAIL);case"SMS_MFA":return oe(ge.CONFIRM_SMS);case"SOFTWARE_TOKEN_MFA":return oe(ge.CONFIRM_TOTP);default:return oe(ge.CONFIRM_MFA_DEFAULT)}},PY=e=>{const{DeliveryMedium:t,Destination:n}=e??{},r=t==="EMAIL",o=t==="SMS",i=oe(ge.CODE_ARRIVAL);return r||o?`${oe(r?ge.CODE_EMAILED:ge.CODE_TEXTED)} ${n}. ${i}.`:`${oe(ge.CODE_SENT)}. ${i}.`},kY=e=>{const{DeliveryMedium:t}=e??{},n=t==="EMAIL";return oe(!n&&t==="SMS"?ge.WE_SENT_CODE:n?ge.WE_EMAILED:ge.WE_TEXTED)},NY={amazon:"Amazon",apple:"Apple",facebook:"Facebook",google:"Google"},OY=(e,t)=>oe(`Sign ${e==="signIn"?"In":"Up"} with ${NY[t]}`),DY=e=>oe(e==="MFA_SETUP"?ge.MFA_SETUP_SELECTION:ge.MFA_SELECTION),MY=e=>{switch(e){case"EMAIL":return oe(wh.EMAIL_OTP);case"SMS":return oe(wh.SMS_MFA);case"TOTP":return oe(wh.SOFTWARE_TOKEN_MFA);default:return oe(e)}},mn={getBackToSignInText:()=>oe(ge.BACK_SIGN_IN),getChangePasswordText:()=>oe(ge.CHANGE_PASSWORD),getChangingText:()=>oe(ge.CHANGING_PASSWORD),getConfirmText:()=>oe(ge.CONFIRM),getConfirmingText:()=>oe(ge.CONFIRMING),getCopyText:()=>oe(ge.UPPERCASE_COPY),getHidePasswordText:()=>oe(ge.HIDE_PASSWORD),getLoadingText:()=>oe(ge.LOADING),getOrText:()=>oe(ge.OR),getResendCodeText:()=>oe(ge.RESEND_CODE),getSendCodeText:()=>oe(ge.SEND_CODE),getSendingText:()=>oe(ge.SENDING),getShowPasswordText:()=>oe(ge.SHOW_PASSWORD),getSubmitText:()=>oe(ge.SUBMIT),getSubmittingText:()=>oe(ge.SUBMITTING),getSignInTabText:()=>oe(ge.SIGN_IN_TAB),getSignUpTabText:()=>oe(ge.CREATE_ACCOUNT),getForgotPasswordText:e=>oe(e?ge.FORGOT_PASSWORD:ge.FORGOT_YOUR_PASSWORD),getSigningInText:()=>oe(ge.SIGNING_IN_BUTTON),getSignInText:()=>oe(ge.SIGN_IN_BUTTON),getCreatingAccountText:()=>oe(ge.CREATING_ACCOUNT),getCreateAccountText:()=>oe(ge.CREATE_ACCOUNT),getDeliveryMessageText:PY,getDeliveryMethodText:kY,getChallengeText:RY,getResetYourPasswordText:()=>oe(ge.RESET_PASSWORD),getSetupEmailText:()=>oe(ge.SETUP_EMAIL),getSetupTotpText:()=>oe(ge.SETUP_TOTP),getSetupTotpInstructionsText:()=>oe("Copy and paste the secret key below into an authenticator app and then enter the code in the text field below."),getCopiedText:()=>oe("COPIED"),getSignInWithFederationText:OY,getMfaTypeLabelByValue:MY,getSelectMfaTypeByChallengeName:DY,getSelectMfaTypeText:()=>oe(ge.SELECT_MFA_TYPE),getSkipText:()=>oe(ge.SKIP),getVerifyText:()=>oe(ge.VERIFY),getVerifyContactText:()=>oe(ge.VERIFY_CONTACT),getAccountRecoveryInfoText:()=>oe(ge.VERIFY_HEADING),getInvalidEmailText:()=>oe("Please enter a valid email"),getRequiredFieldText:()=>oe("This field is required")};function FY(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n`${e}${t}`.replace(/[^A-Z0-9+]/gi,""),kZ=(e,t)=>{switch(t){case"address":case"birthdate":case"email":case"family_name":case"gender":case"given_name":case"locale":case"middle_name":case"name":case"nickname":case"phone_number":case"picture":case"preferred_username":case"profile":case"updated_at":case"website":case"zoneinfo":return!0;default:return t.startsWith("custom:")}},NZ=e=>{const{phone_number:t,...n}=_Z(e,kZ);if($i(t)&&t!==PZ){const{country_code:r}=e;return{...n,phone_number:Og(r,t)}}return n},OZ=(e,t,n)=>{const{password:r,...o}=t,i=NZ(o),a={autoSignIn:RZ,userAttributes:{...n==="phone_number"?{...i,phone_number:e}:i}};return{username:e,password:r,options:a}},DZ=({formValues:e,loginMechanisms:t})=>{const n=t[0];if(n==="phone_number"){const{country_code:r,phone_number:o}=e;return Og(r,o)}return e[n]},{assign:He}=TN,MZ=He({actorDoneData:void 0}),FZ=He({challengeName:void 0}),LZ=He({missingAttributes:void 0}),UZ=He({remoteError:void 0}),$Z=He({formValues:{}}),jZ=He({touched:{}}),BZ=He({user:void 0}),zZ=He({validationError:{}}),HZ=He({totpSecretCode:(e,{data:t})=>{var r;const{sharedSecret:n}=((r=t.nextStep)==null?void 0:r.totpSetupDetails)??{};return n}}),WZ=He({allowedMfaTypes:(e,{data:t})=>{var n;return(n=t.nextStep)==null?void 0:n.allowedMFATypes}}),VZ=He({step:"SIGN_IN"}),KZ=He({step:"SHOULD_CONFIRM_USER_ATTRIBUTE"}),GZ=He({step:"CONFIRM_ATTRIBUTE_COMPLETE"}),qZ=He({challengeName:(e,{data:t})=>{const{signInStep:n}=t.nextStep;switch(n){case"CONFIRM_SIGN_IN_WITH_SMS_CODE":return"SMS_MFA";case"CONFIRM_SIGN_IN_WITH_TOTP_CODE":return"SOFTWARE_TOKEN_MFA";case"CONFIRM_SIGN_IN_WITH_EMAIL_CODE":return"EMAIL_OTP";case"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION":case"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP":case"CONTINUE_SIGN_IN_WITH_TOTP_SETUP":return"MFA_SETUP";case"CONTINUE_SIGN_IN_WITH_MFA_SELECTION":return"SELECT_MFA_TYPE";default:return}}}),QZ=He({username:({formValues:e,loginMechanisms:t})=>{const n=t[0],{username:r,country_code:o}=e;return n==="phone_number"?Og(o,r):r}}),YZ=He({username:DZ}),XZ=He({username:({formValues:e,loginMechanisms:t})=>{const n=t[0],{username:r,country_code:o}=e;return n==="phone_number"?Og(o,r):r}}),JZ=He({step:(e,{data:t})=>t.nextStep.signInStep==="DONE"?"SIGN_IN_COMPLETE":t.nextStep.signInStep}),ZZ=He({step:(e,{data:t})=>t.nextStep.signUpStep==="DONE"?"SIGN_UP_COMPLETE":t.nextStep.signUpStep}),eee=He({step:(e,{data:t})=>t.nextStep.resetPasswordStep==="DONE"?"RESET_PASSWORD_COMPLETE":t.nextStep.resetPasswordStep}),tee=He({missingAttributes:(e,{data:t})=>{var n;return(n=t.nextStep)==null?void 0:n.missingAttributes}}),nee=He({validationError:(e,{data:t})=>t}),ree=He({remoteError:(e,{data:t})=>t.name==="NoUserPoolError"?"Configuration error (see console) – please contact the administrator":(t==null?void 0:t.message)||t}),oee=He({user:(e,{data:t})=>t}),yT=e=>({Destination:e.destination,DeliveryMedium:e.deliveryMedium,AttributeName:e.attributName}),iee=He({codeDeliveryDetails:(e,{data:t})=>{var n;return(n=t==null?void 0:t.nextStep)!=null&&n.codeDeliveryDetails?yT(t.nextStep.codeDeliveryDetails):yT(t)}}),aee=He({formValues:(e,{data:t})=>{const{name:n,value:r}=t;return{...e.formValues,[n]:r}}}),see=He({formValues:(e,{data:t})=>dY({...e.formValues,...t},"password")}),lee=He({touched:(e,{data:t})=>({...e.touched,[t.name]:!0})}),uee=He({unverifiedUserAttributes:(e,{data:t})=>{const{email:n,phone_number:r}=t;return{...n&&{email:n},...r&&{phone_number:r}}}}),cee=He({selectedUserAttribute:void 0}),dee=He({selectedUserAttribute:e=>{var t;return(t=e.formValues)==null?void 0:t.unverifiedAttr}}),fee=He({step:"CONFIRM_SIGN_UP"}),Rf={clearActorDoneData:MZ,clearChallengeName:FZ,clearError:UZ,clearFormValues:$Z,clearMissingAttributes:LZ,clearSelectedUserAttribute:cee,clearTouched:jZ,clearUser:BZ,clearValidationError:zZ,handleBlur:lee,handleInput:aee,handleSubmit:see,setAllowedMfaTypes:WZ,setChallengeName:qZ,setCodeDeliveryDetails:iee,setFieldErrors:nee,setMissingAttributes:tee,setNextResetPasswordStep:eee,setNextSignInStep:JZ,setNextSignUpStep:ZZ,setRemoteError:ree,setConfirmAttributeCompleteStep:GZ,setConfirmSignUpSignUpStep:fee,setShouldVerifyUserAttributeStep:KZ,setSelectedUserAttribute:dee,setSignInStep:VZ,setTotpSecretCode:HZ,setUser:oee,setUnverifiedUserAttributes:uee,setUsernameForgotPassword:QZ,setUsernameSignIn:XZ,setUsernameSignUp:YZ},pee=["CONFIRM_SIGN_IN_WITH_SMS_CODE","CONFIRM_SIGN_IN_WITH_TOTP_CODE","CONFIRM_SIGN_IN_WITH_EMAIL_CODE"],hee=(e,{data:t})=>(t==null?void 0:t.nextStep.signInStep)==="CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",mee=(e,{data:t})=>{var n;return((n=t==null?void 0:t.nextStep)==null?void 0:n.signInStep)==="RESET_PASSWORD"},gee=(e,{data:t})=>(t==null?void 0:t.nextStep.signInStep)==="CONFIRM_SIGN_UP",vee=(e,{data:t})=>(t==null?void 0:t.nextStep.signUpStep)==="COMPLETE_AUTO_SIGN_IN",yee=(e,{data:t})=>(t==null?void 0:t.nextStep.signInStep)==="DONE",See=(e,{data:t})=>(t==null?void 0:t.nextStep.signUpStep)==="DONE",bee=(e,{data:t})=>(t==null?void 0:t.nextStep.resetPasswordStep)==="DONE",Eee=(e,{data:t})=>(t==null?void 0:t.step)==="CONFIRM_ATTRIBUTE_COMPLETE",wee=(e,{data:t})=>(t==null?void 0:t.step)==="CONFIRM_ATTRIBUTE_WITH_CODE",Cee=(e,{data:t})=>(t==null?void 0:t.step)==="SHOULD_CONFIRM_USER_ATTRIBUTE",xee=(e,{data:t})=>(t==null?void 0:t.step)==="RESET_PASSWORD",Iee=(e,{data:t})=>(t==null?void 0:t.step)==="CONFIRM_SIGN_UP",Tee=({step:e})=>pee.includes(e),Aee=({step:e})=>e==="CONTINUE_SIGN_IN_WITH_TOTP_SETUP",_ee=({step:e})=>e==="CONTINUE_SIGN_IN_WITH_EMAIL_SETUP",Ree=({step:e})=>["CONTINUE_SIGN_IN_WITH_MFA_SELECTION","CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION"].includes(e),Pee=({step:e})=>e==="RESET_PASSWORD",kee=({step:e})=>e==="CONFIRM_RESET_PASSWORD_WITH_CODE",Nee=({step:e})=>e==="CONFIRM_SIGN_UP",Oee=(e,{data:t})=>{const{email:n,phone_number:r,phone_number_verified:o,email_verified:i}=t;return!n&&!r?!1:(i===void 0||i==="false")&&(o===void 0||o==="false")},Dee=(e,{data:t})=>t.message==="User is already confirmed.",Dg={hasCompletedAttributeConfirmation:Eee,hasCompletedResetPassword:bee,hasCompletedSignIn:yee,hasCompletedSignUp:See,isConfirmSignUpStep:Iee,isConfirmUserAttributeStep:wee,isResetPasswordStep:xee,isShouldConfirmUserAttributeStep:Cee,isUserAlreadyConfirmed:Dee,shouldAutoSignIn:vee,shouldConfirmResetPassword:kee,shouldConfirmSignIn:Tee,shouldConfirmSignInWithNewPassword:hee,shouldConfirmSignUp:Nee,shouldConfirmSignUpFromSignIn:gee,shouldResetPassword:Pee,shouldResetPasswordFromSignIn:mee,shouldSetupTotp:Aee,shouldSetupEmail:_ee,shouldSelectMfaType:Ree,shouldVerifyAttribute:Oee};var Mee=dE,Fee=Tf;function Lee(e,t,n){(n!==void 0&&!Fee(e[t],n)||n===void 0&&!(t in e))&&Mee(e,t,n)}var VN=Lee;function Uee(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(n(i[l],l,i)===!1)break}return t}}var $ee=Uee,jee=$ee,Bee=jee(),zee=Bee,Cm={exports:{}};Cm.exports;(function(e,t){var n=Zo,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,a=i?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,f=s?s(d):new u.constructor(d);return u.copy(f),f}e.exports=l})(Cm,Cm.exports);var Hee=Cm.exports,ST=Bk;function Wee(e){var t=new e.constructor(e.byteLength);return new ST(t).set(new ST(e)),t}var Vee=Wee,Kee=Vee;function Gee(e,t){var n=t?Kee(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var qee=Gee;function Qee(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n0){if(++t>=ane)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var cne=une,dne=ine,fne=cne,pne=fne(dne),hne=pne,mne=cE,gne=Zte,vne=hne;function yne(e,t){return vne(gne(e,t,mne),e+"")}var Sne=yne,bne=Tf,Ene=Eg,wne=bg,Cne=Xi;function xne(e,t,n){if(!Cne(n))return!1;var r=typeof t;return(r=="number"?Ene(n)&&wne(t,n.length):r=="string"&&t in n)?bne(n[t],e):!1}var Ine=xne,Tne=Sne,Ane=Ine;function _ne(e){return Tne(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,a&&Ane(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),t=Object(t);++r{const o=await Promise.all(r.map(a=>a(e,t,n))),i=Dne({},...o);return rE(i)?Promise.resolve():Promise.reject(i)},Mne=8,Fne=e=>Array.isArray(e),Lne=e=>{if(e)return Fne(e)?Object.entries(e).map(([t,n])=>Object.keys(n)[0]):Object.keys(e)},ja={async getAmplifyConfig(){var s,l,u,c;const e=ik.getConfig(),t=(s=e.Auth)==null?void 0:s.Cognito,{loginWith:n,userAttributes:r}=((l=e.Auth)==null?void 0:l.Cognito)??{},o=n?Object.entries(n).filter(([d,f])=>d!=="oauth").filter(([d,f])=>!!f).map(d=>d[0]==="phone"?"phone_number":d[0]):void 0,i=Lne(r),a=(u=n==null?void 0:n.oauth)!=null&&u.providers?(c=n.oauth.providers)==null?void 0:c.map(d=>d.toString().toLowerCase()):void 0;return{...t,loginMechanisms:o,signUpAttributes:i,socialProviders:a}},getCurrentUser:Sf,handleSignIn:kb,handleSignUp:k8,handleConfirmSignIn:QP,handleConfirmSignUp:U8,handleForgotPasswordSubmit:D8,handleForgotPassword:qP,handleResendSignUpCode:F8,async validateCustomSignUp(e,t){},async validateFormPassword(e,t,n){const{password:r}=e,{password:o}=t;if(!o||!n)return null;const i=[],a=n.minLength??Mne;return r.length=6&&(r==null?void 0:r.length)>=6))return{confirm_password:"Your passwords must match"}},async validatePreferredUsername(e,t){}};function Une({services:e}){return oc({id:"forgotPasswordActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{cond:"shouldResetPassword",target:"confirmResetPassword"},{cond:"shouldConfirmResetPassword",target:"confirmResetPassword"},{target:"forgotPassword"}]},forgotPassword:{initial:"edit",entry:"sendUpdate",exit:["clearError","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"}}},submit:{tags:"pending",entry:["sendUpdate","clearError","setUsernameForgotPassword"],invoke:{src:"handleResetPassword",onDone:{actions:["setCodeDeliveryDetails","setNextResetPasswordStep"],target:"#forgotPasswordActor.confirmResetPassword"},onError:{actions:"setRemoteError",target:"edit"}}}}},confirmResetPassword:{type:"parallel",exit:["clearFormValues","clearError","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"},RESEND:"resendCode",CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{target:"pending",actions:"clearValidationError"},onError:{target:"idle",actions:"setFieldErrors"}}},resendCode:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"handleResetPassword",onDone:{target:"idle"},onError:{actions:"setRemoteError",target:"idle"}}},pending:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"handleConfirmResetPassword",onDone:[{cond:"hasCompletedResetPassword",actions:"setNextResetPasswordStep",target:"#forgotPasswordActor.resolved"},{actions:"setSignInStep",target:"#forgotPasswordActor.resolved"}],onError:{actions:"setRemoteError",target:"idle"}}}}}}},resolved:{type:"final",data:({step:t})=>({step:t})}}},{actions:{...Rf,sendUpdate:Rg()},guards:Dg,services:{handleResetPassword({username:t}){return e.handleForgotPassword({username:t})},handleConfirmResetPassword({formValues:t,username:n}){const{confirmation_code:r,password:o}=t;return e.handleForgotPasswordSubmit({confirmationCode:r,newPassword:o,username:n})},validateFields(t){return Mg(t.formValues,t.touched,t.passwordSettings,[ja.validateFormPassword,ja.validateConfirmPassword])}}})}const QN=e=>({entry:["sendUpdate","clearError"],invoke:{src:"signInWithRedirect",onDone:{target:e},onError:{actions:"setRemoteError",target:e}}}),$ne=e=>["CONTINUE_SIGN_IN_WITH_MFA_SELECTION","CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION"].includes(e)?"mfa_type":e==="CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"?"email":"confirmation_code",_S={onDone:[{cond:"hasCompletedSignIn",actions:"setNextSignInStep",target:"#signInActor.fetchUserAttributes"},{cond:"shouldConfirmSignInWithNewPassword",actions:["setMissingAttributes","setNextSignInStep"],target:"#signInActor.forceChangePassword"},{cond:"shouldResetPasswordFromSignIn",actions:"setNextSignInStep",target:"#signInActor.resetPassword"},{cond:"shouldConfirmSignUpFromSignIn",actions:"setNextSignInStep",target:"#signInActor.resendSignUpCode"},{actions:["setChallengeName","setMissingAttributes","setNextSignInStep","setTotpSecretCode","setAllowedMfaTypes"],target:"#signInActor.init"}],onError:{actions:"setRemoteError",target:"edit"}},jne={onDone:[{cond:"shouldVerifyAttribute",actions:["setShouldVerifyUserAttributeStep","setUnverifiedUserAttributes"],target:"#signInActor.resolved"},{actions:"setConfirmAttributeCompleteStep",target:"#signInActor.resolved"}],onError:{actions:"setConfirmAttributeCompleteStep",target:"#signInActor.resolved"}},xp=e=>({initial:"edit",exit:e,states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SIGN_IN:"#signInActor.signIn",CHANGE:{actions:"handleInput"}}},submit:{tags:"pending",entry:["sendUpdate","clearError"],invoke:{src:"confirmSignIn",..._S}}}});function Bne({services:e}){return oc({id:"signInActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{cond:"shouldConfirmSignIn",target:"confirmSignIn"},{cond:"shouldSetupTotp",target:"setupTotp"},{cond:"shouldSetupEmail",target:"setupEmail"},{cond:"shouldSelectMfaType",target:"selectMfaType"},{cond:({step:t})=>t==="CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",actions:"setActorDoneData",target:"forceChangePassword"},{target:"signIn"}]},federatedSignIn:QN("signIn"),fetchUserAttributes:{invoke:{src:"fetchUserAttributes",...jne}},resendSignUpCode:{invoke:{src:"handleResendSignUpCode",onDone:{actions:"setCodeDeliveryDetails",target:"#signInActor.resolved"},onError:{actions:"setRemoteError",target:"#signInActor.signIn"}}},resetPassword:{invoke:{src:"resetPassword",onDone:[{actions:"setCodeDeliveryDetails",target:"#signInActor.resolved"}],onError:{actions:["setRemoteError","sendUpdate"]}}},signIn:{initial:"edit",exit:"clearTouched",states:{edit:{entry:"sendUpdate",on:{CHANGE:{actions:"handleInput"},FEDERATED_SIGN_IN:{target:"#signInActor.federatedSignIn"},SUBMIT:{actions:"handleSubmit",target:"submit"}}},submit:{tags:"pending",entry:["clearError","sendUpdate","setUsernameSignIn"],exit:"clearFormValues",invoke:{src:"handleSignIn",..._S}}}},confirmSignIn:xp(["clearChallengeName","clearFormValues","clearError","clearTouched"]),forceChangePassword:{entry:"sendUpdate",type:"parallel",exit:["clearFormValues","clearError","clearTouched"],states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateFields",onDone:{target:"valid",actions:"clearValidationError"},onError:{target:"invalid",actions:"setFieldErrors"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{SIGN_IN:{actions:"setSignInStep",target:"#signInActor.resolved"},CHANGE:{actions:"handleInput",target:".pending"},BLUR:{actions:"handleBlur",target:".pending"}}},submit:{initial:"edit",entry:"clearError",states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"validate"}}},validate:{entry:"sendUpdate",invoke:{src:"validateFields",onDone:{actions:"clearValidationError",target:"pending"},onError:{actions:"setFieldErrors",target:"edit"}}},pending:{tags:"pending",entry:["sendUpdate","clearError"],invoke:{src:"handleForceChangePassword",..._S}}}}}},setupTotp:xp(["clearFormValues","clearError","clearTouched"]),setupEmail:xp(["clearFormValues","clearError","clearTouched"]),selectMfaType:xp(["clearFormValues","clearError","clearTouched"]),resolved:{type:"final",data:t=>({codeDeliveryDetails:t.codeDeliveryDetails,remoteError:t.remoteError,step:t.step,unverifiedUserAttributes:t.unverifiedUserAttributes,username:t.username})}}},{actions:{...Rf,sendUpdate:Rg()},guards:Dg,services:{async fetchUserAttributes(){return tk()},resetPassword({username:t}){return qP({username:t})},handleResendSignUpCode({username:t}){return e.handleResendSignUpCode({username:t})},handleSignIn({formValues:t,username:n}){const{password:r}=t;return e.handleSignIn({username:n,password:r})},confirmSignIn({formValues:t,step:n}){const r=$ne(n),{[r]:o}=t;return e.handleConfirmSignIn({challengeResponse:o})},async handleForceChangePassword({formValues:t}){let{password:n,phone_number:r,country_code:o,confirm_password:i,...a}=t,s;return r&&(s=`${o}${r}`.replace(/[^A-Z0-9+]/gi,""),a={...a,phone_number:s}),QP({challengeResponse:n,options:{userAttributes:a}})},signInWithRedirect(t,{data:n}){return ek(n)},async validateFields(t){return Mg(t.formValues,t.touched,t.passwordSettings,[ja.validateFormPassword,ja.validateConfirmPassword])}}})}const zne={onDone:[{actions:"setCodeDeliveryDetails",target:"#signUpActor.resolved"}],onError:{actions:["setRemoteError","sendUpdate"]}},Hne={onDone:[{cond:"hasCompletedSignIn",actions:"setNextSignInStep",target:"#signUpActor.fetchUserAttributes"},{cond:"shouldConfirmSignInWithNewPassword",actions:"setNextSignInStep",target:"#signUpActor.resolved"},{cond:"shouldResetPasswordFromSignIn",actions:"setNextSignInStep",target:"#signUpActor.resetPassword"},{cond:"shouldConfirmSignUpFromSignIn",actions:"setNextSignInStep",target:"#signUpActor.resendSignUpCode"},{actions:["setNextSignInStep","setChallengeName","setMissingAttributes","setTotpSecretCode","setAllowedMfaTypes"],target:"#signUpActor.resolved"}],onError:{actions:"setRemoteError",target:"#signUpActor.resolved"}},Wne={onDone:[{cond:"shouldVerifyAttribute",actions:["setShouldVerifyUserAttributeStep","setUnverifiedUserAttributes"],target:"#signUpActor.resolved"},{actions:"setConfirmAttributeCompleteStep",target:"#signUpActor.resolved"}],onError:{actions:"setConfirmAttributeCompleteStep",target:"#signUpActor.resolved"}};function Vne({services:e}){return oc({id:"signUpActor",initial:"init",predictableActionArguments:!0,states:{init:{always:[{cond:"shouldConfirmSignUp",target:"confirmSignUp"},{target:"signUp"}]},autoSignIn:{tags:"pending",invoke:{src:"autoSignIn",...Hne}},fetchUserAttributes:{invoke:{src:"fetchUserAttributes",...Wne}},federatedSignIn:QN("signUp"),resetPassword:{invoke:{src:"resetPassword",...zne}},resendSignUpCode:{tags:"pending",entry:"sendUpdate",exit:"sendUpdate",invoke:{src:"resendSignUpCode",onDone:{actions:["setCodeDeliveryDetails","sendUpdate"],target:"#signUpActor.confirmSignUp"},onError:[{cond:"isUserAlreadyConfirmed",target:"#signUpActor.resolved"},{actions:["setRemoteError","sendUpdate"]}]}},signUp:{type:"parallel",exit:"clearTouched",on:{FEDERATED_SIGN_IN:{target:"federatedSignIn"}},states:{validation:{initial:"pending",states:{pending:{invoke:{src:"validateSignUp",onDone:{actions:"clearValidationError",target:"valid"},onError:{actions:"setFieldErrors",target:"invalid"}}},valid:{entry:"sendUpdate"},invalid:{entry:"sendUpdate"}},on:{BLUR:{actions:"handleBlur",target:".pending"},CHANGE:{actions:"handleInput",target:".pending"}}},submission:{initial:"idle",states:{idle:{entry:["sendUpdate"],on:{SUBMIT:{actions:"handleSubmit",target:"validate"}}},validate:{entry:"sendUpdate",invoke:{src:"validateSignUp",onDone:{target:"handleSignUp",actions:"clearValidationError"},onError:{actions:"setFieldErrors",target:"idle"}}},handleSignUp:{tags:"pending",entry:["setUsernameSignUp","clearError"],exit:"sendUpdate",invoke:{src:"handleSignUp",onDone:[{cond:"hasCompletedSignUp",actions:"setNextSignUpStep",target:"#signUpActor.resolved"},{cond:"shouldAutoSignIn",actions:"setNextSignUpStep",target:"#signUpActor.autoSignIn"},{actions:["setCodeDeliveryDetails","setNextSignUpStep"],target:"#signUpActor.init"}],onError:{actions:["sendUpdate","setRemoteError"],target:"idle"}}}}}}},confirmSignUp:{initial:"edit",entry:"sendUpdate",states:{edit:{on:{SUBMIT:{actions:"handleSubmit",target:"submit"},CHANGE:{actions:"handleInput"},BLUR:{actions:"handleBlur"},RESEND:"#signUpActor.resendSignUpCode"}},submit:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"confirmSignUp",onDone:[{cond:"shouldAutoSignIn",actions:["setNextSignUpStep","clearFormValues"],target:"#signUpActor.autoSignIn"},{actions:"setNextSignUpStep",target:"#signUpActor.init"}],onError:{actions:["setRemoteError","sendUpdate"],target:"edit"}}}}},resolved:{type:"final",data:t=>({challengeName:t.challengeName,missingAttributes:t.missingAttributes,remoteError:t.remoteError,step:t.step,totpSecretCode:t.totpSecretCode,username:t.username,unverifiedUserAttributes:t.unverifiedUserAttributes,allowedMfaTypes:t.allowedMfaTypes})}}},{actions:{...Rf,sendUpdate:Rg()},guards:Dg,services:{autoSignIn(){return Pb()},async fetchUserAttributes(){return tk()},confirmSignUp({formValues:t,username:n}){const{confirmation_code:r}=t,o={username:n,confirmationCode:r};return e.handleConfirmSignUp(o)},resendSignUpCode({username:t}){return e.handleResendSignUpCode({username:t})},signInWithRedirect(t,{data:n}){return ek(n)},handleSignUp(t){const{formValues:n,loginMechanisms:r,username:o}=t,i=r[0],a=OZ(o,n,i);return e.handleSignUp(a)},async validateSignUp(t){return Mg(t.formValues,t.touched,t.passwordSettings,[e.validateFormPassword,e.validateConfirmPassword,e.validatePreferredUsername,e.validateCustomSignUp])}}})}const Kne=()=>oc({initial:"pending",id:"signOutActor",predictableActionArguments:!0,states:{pending:{tags:"pending",invoke:{src:"signOut",onDone:"resolved",onError:"rejected"}},resolved:{type:"final"},rejected:{type:"final"}}},{services:{signOut:()=>$d()}});function Gne(){return oc({id:"verifyUserAttributesActor",initial:"selectUserAttributes",predictableActionArguments:!0,states:{selectUserAttributes:{initial:"edit",exit:["clearError","clearTouched","sendUpdate"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:{target:"#verifyUserAttributesActor.resolved"},CHANGE:{actions:"handleInput"}}},submit:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"sendUserAttributeVerificationCode",onDone:{actions:["setSelectedUserAttribute","setCodeDeliveryDetails"],target:"#verifyUserAttributesActor.confirmVerifyUserAttribute"},onError:{actions:"setRemoteError",target:"edit"}}}}},confirmVerifyUserAttribute:{initial:"edit",exit:["clearError","clearFormValues","clearTouched"],states:{edit:{entry:"sendUpdate",on:{SUBMIT:{actions:"handleSubmit",target:"submit"},SKIP:"#verifyUserAttributesActor.resolved",CHANGE:{actions:"handleInput"}}},submit:{tags:"pending",entry:["clearError","sendUpdate"],invoke:{src:"confirmVerifyUserAttribute",onDone:{actions:["setConfirmAttributeCompleteStep","clearSelectedUserAttribute"],target:"#verifyUserAttributesActor.resolved"},onError:{actions:"setRemoteError",target:"edit"}}}}},resolved:{type:"final",data:({step:e})=>({step:e})}}},{actions:{...Rf,sendUpdate:Rg()},services:{sendUserAttributeVerificationCode({formValues:{unverifiedAttr:e}}){return y9({userAttributeKey:e})},async confirmVerifyUserAttribute({formValues:{confirmation_code:e},selectedUserAttribute:t}){return B8({confirmationCode:e,userAttributeKey:t})},async validateFields(e){return Mg(e.formValues,e.touched,e.passwordSettings,[ja.validateFormPassword,ja.validateConfirmPassword])}}})}const Ip=(e,t)=>{var n,r,o,i,a,s;return{...e.actorDoneData,step:((n=e==null?void 0:e.actorDoneData)==null?void 0:n.step)??t,formValues:{},touched:{},validationError:{},formFields:(r=e.config)==null?void 0:r.formFields,loginMechanisms:(o=e.config)==null?void 0:o.loginMechanisms,passwordSettings:(i=e.config)==null?void 0:i.passwordSettings,signUpAttributes:(a=e.config)==null?void 0:a.signUpAttributes,socialProviders:(s=e.config)==null?void 0:s.socialProviders}},{choose:qne,stop:Qne}=TN,xc=e=>Qne(e),Yne={on:{INIT:{actions:"configure",target:"getConfig"},SIGN_OUT:"#authenticator.signOut"}},Xne={always:{actions:"configure",target:"getConfig"}};function Jne(e){const{useNextWaitConfig:t,...n}=e??{};return oc({id:"authenticator",initial:"idle",context:{user:void 0,config:{},services:ja,actorRef:void 0,hasSetup:!1},predictableActionArguments:!0,states:{idle:{invoke:{src:"handleGetCurrentUser",onDone:{actions:"setUser",target:"setup"},onError:{target:"setup"}}},setup:{initial:"initConfig",states:{initConfig:t?Xne:Yne,getConfig:{invoke:{src:"getAmplifyConfig",onDone:[{actions:["applyAmplifyConfig","setHasSetup"],cond:"hasUser",target:"#authenticator.authenticated"},{actions:["applyAmplifyConfig","setHasSetup"],target:"goToInitialState"}]}},goToInitialState:{always:[{cond:"isInitialStateSignUp",target:"#authenticator.signUpActor"},{cond:"isInitialStateResetPassword",target:"#authenticator.forgotPasswordActor"},{target:"#authenticator.signInActor"}]}}},getCurrentUser:{invoke:{src:"handleGetCurrentUser",onDone:{actions:"setUser",target:"#authenticator.authenticated"},onError:{target:"#authenticator.setup"}}},signInActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignInActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:xc("signInActor")}},on:{FORGOT_PASSWORD:"forgotPasswordActor",SIGN_IN:"signInActor",SIGN_UP:"signUpActor","done.invoke.signInActor":[{cond:"hasCompletedAttributeConfirmation",target:"#authenticator.getCurrentUser"},{cond:"isShouldConfirmUserAttributeStep",actions:"setActorDoneData",target:"#authenticator.verifyUserAttributesActor"},{cond:"isResetPasswordStep",actions:"setActorDoneData",target:"#authenticator.forgotPasswordActor"},{cond:"isConfirmSignUpStep",actions:"setActorDoneData",target:"#authenticator.signUpActor"}]}},signUpActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignUpActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:xc("signUpActor")}},on:{SIGN_IN:"signInActor","done.invoke.signUpActor":[{cond:"hasCompletedAttributeConfirmation",target:"#authenticator.getCurrentUser"},{cond:"isShouldConfirmUserAttributeStep",actions:"setActorDoneData",target:"#authenticator.verifyUserAttributesActor"},{cond:"isConfirmUserAttributeStep",target:"#authenticator.verifyUserAttributesActor"},{actions:"setActorDoneData",target:"#authenticator.signInActor"}]}},forgotPasswordActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnForgotPasswordActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:xc("forgotPasswordActor")}},on:{SIGN_IN:"signInActor","done.invoke.forgotPasswordActor":[{target:"#authenticator.signInActor"}]}},verifyUserAttributesActor:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnVerifyUserAttributesActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:xc("verifyUserAttributesActor")}},on:{"done.invoke.verifyUserAttributesActor":[{actions:"setActorDoneData",target:"#authenticator.getCurrentUser"}]}},authenticated:{initial:"idle",states:{idle:{on:{TOKEN_REFRESH:"refreshUser"}},refreshUser:{invoke:{src:"#authenticator.getCurrentUser",onDone:{actions:"setUser",target:"idle"},onError:{target:"#authenticator.signOut"}}}},on:{SIGN_OUT:"signOut"}},signOut:{initial:"spawnActor",states:{spawnActor:{always:{actions:"spawnSignOutActor",target:"runActor"}},runActor:{entry:"clearActorDoneData",exit:xc("signOutActor")}},on:{"done.invoke.signOutActor":{actions:"clearUser",target:"setup.getConfig"}}}},on:{SIGN_IN_WITH_REDIRECT:{target:"#authenticator.getCurrentUser"},CHANGE:{actions:"forwardToActor"},BLUR:{actions:"forwardToActor"},SUBMIT:{actions:"forwardToActor"},FEDERATED_SIGN_IN:{actions:"forwardToActor"},RESEND:{actions:"forwardToActor"},SIGN_IN:{actions:"forwardToActor"},SKIP:{actions:"forwardToActor"}}},{actions:{...Rf,forwardToActor:qne([{cond:"hasActor",actions:bQ(({actorRef:o})=>o)}]),setActorDoneData:ri({actorDoneData:(o,i)=>({challengeName:i.data.challengeName,codeDeliveryDetails:i.data.codeDeliveryDetails,missingAttributes:i.data.missingAttributes,remoteError:i.data.remoteError,username:i.data.username,step:i.data.step,totpSecretCode:i.data.totpSecretCode,unverifiedUserAttributes:i.data.unverifiedUserAttributes,allowedMfaTypes:i.data.allowedMfaTypes})}),applyAmplifyConfig:ri({config(o,{data:i}){const{loginMechanisms:a=i.loginMechanisms??[],signUpAttributes:s=i.signUpAttributes??[],socialProviders:l=i.socialProviders??[],initialState:u,formFields:c,passwordSettings:d=i.passwordFormat??{}}=o.config;return a.length===0&&a.push("username"),{formFields:Zne(c)??{},initialState:u,loginMechanisms:a,passwordSettings:d,signUpAttributes:s,socialProviders:l}}}),spawnSignInActor:ri({actorRef:(o,i)=>{const{services:a}=o,s=Bne({services:a}).withContext(Ip(o,"SIGN_IN"));return Cc(s,{name:"signInActor"})}}),spawnSignUpActor:ri({actorRef:(o,i)=>{const{services:a}=o,s=Vne({services:a}).withContext(Ip(o,"SIGN_UP"));return Cc(s,{name:"signUpActor"})}}),spawnForgotPasswordActor:ri({actorRef:(o,i)=>{const{services:a}=o,s=Une({services:a}).withContext(Ip(o,"FORGOT_PASSWORD"));return Cc(s,{name:"forgotPasswordActor"})}}),spawnVerifyUserAttributesActor:ri({actorRef:o=>{const i=Gne().withContext(Ip(o));return Cc(i,{name:"verifyUserAttributesActor"})}}),spawnSignOutActor:ri({actorRef:o=>{const i=Kne().withContext({user:o==null?void 0:o.user});return Cc(i,{name:"signOutActor"})}}),configure:ri((o,i)=>{const{services:a,...s}=ON(n)?i.data??{}:n;return{services:{...ja,...a},config:s}}),setHasSetup:ri({hasSetup:!0})},guards:{...Dg,hasActor:({actorRef:o})=>!!o,isInitialStateSignUp:({config:o})=>o.initialState==="signUp",isInitialStateResetPassword:({config:o})=>o.initialState==="forgotPassword",shouldSetup:({hasSetup:o})=>!o,hasUser:({user:o})=>!!o},services:{getAmplifyConfig:({services:o})=>o.getAmplifyConfig(),handleGetCurrentUser:({services:o})=>o.getCurrentUser()}})}function Zne(e){return e&&Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{let r=e[t][n];r.required=r.isRequired})}),e}const ere={small:{value:"1px"},medium:{value:"2px"},large:{value:"3px"}},tre={red:{10:{value:"hsl(0, 75%, 95%)"},20:{value:"hsl(0, 75%, 85%)"},40:{value:"hsl(0, 75%, 75%)"},60:{value:"hsl(0, 50%, 50%)"},80:{value:"hsl(0, 95%, 30%)"},90:{value:"hsl(0, 100%, 20%)"},100:{value:"hsl(0, 100%, 15%)"}},orange:{10:{value:"hsl(30, 75%, 95%)"},20:{value:"hsl(30, 75%, 85%)"},40:{value:"hsl(30, 75%, 75%)"},60:{value:"hsl(30, 50%, 50%)"},80:{value:"hsl(30, 95%, 30%)"},90:{value:"hsl(30, 100%, 20%)"},100:{value:"hsl(30, 100%, 15%)"}},yellow:{10:{value:"hsl(60, 75%, 95%)"},20:{value:"hsl(60, 75%, 85%)"},40:{value:"hsl(60, 75%, 75%)"},60:{value:"hsl(60, 50%, 50%)"},80:{value:"hsl(60, 95%, 30%)"},90:{value:"hsl(60, 100%, 20%)"},100:{value:"hsl(60, 100%, 15%)"}},green:{10:{value:"hsl(130, 60%, 95%)"},20:{value:"hsl(130, 60%, 90%)"},40:{value:"hsl(130, 44%, 63%)"},60:{value:"hsl(130, 43%, 46%)"},80:{value:"hsl(130, 33%, 37%)"},90:{value:"hsl(130, 27%, 29%)"},100:{value:"hsl(130, 22%, 23%)"}},teal:{10:{value:"hsl(190, 75%, 95%)"},20:{value:"hsl(190, 75%, 85%)"},40:{value:"hsl(190, 70%, 70%)"},60:{value:"hsl(190, 50%, 50%)"},80:{value:"hsl(190, 95%, 30%)"},90:{value:"hsl(190, 100%, 20%)"},100:{value:"hsl(190, 100%, 15%)"}},blue:{10:{value:"hsl(220, 95%, 95%)"},20:{value:"hsl(220, 85%, 85%)"},40:{value:"hsl(220, 70%, 70%)"},60:{value:"hsl(220, 50%, 50%)"},80:{value:"hsl(220, 95%, 30%)"},90:{value:"hsl(220, 100%, 20%)"},100:{value:"hsl(220, 100%, 15%)"}},purple:{10:{value:"hsl(300, 95%, 95%)"},20:{value:"hsl(300, 85%, 85%)"},40:{value:"hsl(300, 70%, 70%)"},60:{value:"hsl(300, 50%, 50%)"},80:{value:"hsl(300, 95%, 30%)"},90:{value:"hsl(300, 100%, 20%)"},100:{value:"hsl(300, 100%, 15%)"}},pink:{10:{value:"hsl(340, 95%, 95%)"},20:{value:"hsl(340, 90%, 85%)"},40:{value:"hsl(340, 70%, 70%)"},60:{value:"hsl(340, 50%, 50%)"},80:{value:"hsl(340, 95%, 30%)"},90:{value:"hsl(340, 100%, 20%)"},100:{value:"hsl(340, 100%, 15%)"}},neutral:{10:{value:"hsl(210, 5%, 98%)"},20:{value:"hsl(210, 5%, 94%)"},40:{value:"hsl(210, 5%, 87%)"},60:{value:"hsl(210, 10%, 58%)"},80:{value:"hsl(210, 10%, 40%)"},90:{value:"hsl(210, 25%, 25%)"},100:{value:"hsl(210, 50%, 10%)"}},primary:{10:{value:"{colors.teal.10.value}"},20:{value:"{colors.teal.20.value}"},40:{value:"{colors.teal.40.value}"},60:{value:"{colors.teal.60.value}"},80:{value:"{colors.teal.80.value}"},90:{value:"{colors.teal.90.value}"},100:{value:"{colors.teal.100.value}"}},secondary:{10:{value:"{colors.purple.10.value}"},20:{value:"{colors.purple.20.value}"},40:{value:"{colors.purple.40.value}"},60:{value:"{colors.purple.60.value}"},80:{value:"{colors.purple.80.value}"},90:{value:"{colors.purple.90.value}"},100:{value:"{colors.purple.100.value}"}},font:{primary:{value:"{colors.neutral.100.value}"},secondary:{value:"{colors.neutral.90.value}"},tertiary:{value:"{colors.neutral.80.value}"},disabled:{value:"{colors.neutral.60.value}"},inverse:{value:"{colors.white.value}"},interactive:{value:"{colors.primary.80.value}"},hover:{value:"{colors.primary.90.value}"},focus:{value:"{colors.primary.100.value}"},active:{value:"{colors.primary.100.value}"},info:{value:"{colors.blue.90.value}"},warning:{value:"{colors.orange.90.value}"},error:{value:"{colors.red.90.value}"},success:{value:"{colors.green.90.value}"}},background:{primary:{value:"{colors.white.value}"},secondary:{value:"{colors.neutral.10.value}"},tertiary:{value:"{colors.neutral.20.value}"},quaternary:{value:"{colors.neutral.60.value}"},disabled:{value:"{colors.background.tertiary.value}"},info:{value:"{colors.blue.10.value}"},warning:{value:"{colors.orange.10.value}"},error:{value:"{colors.red.10.value}"},success:{value:"{colors.green.10.value}"}},border:{primary:{value:"{colors.neutral.60.value}"},secondary:{value:"{colors.neutral.40.value}"},tertiary:{value:"{colors.neutral.20.value}"},disabled:{value:"{colors.border.tertiary.value}"},pressed:{value:"{colors.primary.100.value}"},focus:{value:"{colors.primary.100.value}"},error:{value:"{colors.red.80.value}"},info:{value:"{colors.blue.80.value}"},success:{value:"{colors.green.80.value}"},warning:{value:"{colors.orange.80.value}"}},shadow:{primary:{value:"hsla(210, 50%, 10%, 0.25)"},secondary:{value:"hsla(210, 50%, 10%, 0.15)"},tertiary:{value:"hsla(210, 50%, 10%, 0.05)"}},overlay:{5:{value:"hsla(0, 0%, 0%, 0.05)"},10:{value:"hsla(0, 0%, 0%, 0.1)"},20:{value:"hsla(0, 0%, 0%, 0.2)"},30:{value:"hsla(0, 0%, 0%, 0.3)"},40:{value:"hsla(0, 0%, 0%, 0.4)"},50:{value:"hsla(0, 0%, 0%, 0.5)"},60:{value:"hsla(0, 0%, 0%, 0.6)"},70:{value:"hsla(0, 0%, 0%, 0.7)"},80:{value:"hsla(0, 0%, 0%, 0.8)"},90:{value:"hsla(0, 0%, 0%, 0.9)"}},black:{value:"hsl(0, 0%, 0%)"},white:{value:"hsl(0, 0%, 100%)"},transparent:{value:"transparent"}},nre={alignItems:{value:"center"},justifyContent:{value:"space-between"},color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.tertiary.value}"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.medium.value}"},icon:{size:{value:"{fontSizes.xl.value}"}},heading:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"}}},rre={message:{backgroundColor:{value:"{colors.background.secondary.value}"},borderRadius:{value:"{radii.large.value}"},gap:{value:"{space.small.value}"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.small.value}"},user:{backgroundColor:{value:"{colors.background.secondary.value}"}},assistant:{backgroundColor:{value:"{colors.primary.10.value}"}},sender:{gap:{value:"{space.small.value}"},username:{color:{value:"{colors.font.primary.value}"},fontSize:{value:"inherit"},fontWeight:{value:"{fontWeights.bold.value}"}},timestamp:{color:{value:"{colors.font.tertiary.value}"},fontSize:{value:"inherit"},fontWeight:{value:"inherit"}}},body:{gap:{value:"{space.xs.value}"}},actions:{gap:{value:"{space.xs.value}"}}},form:{gap:{value:"{space.small.value}"},padding:{value:"{space.small.value}"}},attachment:{borderColor:{value:"{colors.border.secondary.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderRadius:{value:"{radii.small.value}"},fontSize:{value:"{fontSizes.small.value}"},paddingBlock:{value:"{space.xxxs.value}"},paddingInline:{value:"{space.xs.value}"},gap:{value:"{space.xs.value}"},list:{padding:{value:"{space.xs.value}"},paddingBlockStart:{value:"0"},gap:{value:"{space.xxs.value}"}},name:{color:{value:"{colors.font.primary.value}"},fontSize:{value:"{fontSizes.small.value}"},fontWeight:{value:"{fontWeights.normal.value}"}},size:{color:{value:"{colors.font.tertiary.value}"},fontSize:{value:"{fontSizes.small.value}"},fontWeight:{value:"{fontWeights.normal.value}"}},remove:{padding:{value:"{space.xxs.value}"}},image:{width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"}}}},ore={menu:{width:{value:"100%"},marginBlockStart:{value:"{space.xxxs}"},backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderWidth:{value:"{borderWidths.small}"},borderStyle:{value:"solid"},borderRadius:{value:"{radii.small}"},options:{display:{value:"flex"},flexDirection:{value:"column"},maxHeight:{value:"300px"}},option:{backgroundColor:{value:"{colors.background.primary}"},color:{value:"currentcolor"},cursor:{value:"pointer"},transitionDuration:{value:"{time.short}"},transitionProperty:{value:"background-color, color"},transitionTimingFunction:{value:"ease"},_active:{backgroundColor:{value:"{colors.primary.80}"},color:{value:"{colors.white}"}}},_empty:{display:{value:"flex"}},_loading:{alignItems:{value:"center"},display:{value:"flex"},gap:{value:"{space.xxxs}"}},spaceShared:{paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"}}}},ire={maxWidth:{value:"60rem"},modal:{width:{value:"{space.relative.full}"},height:{value:"{space.relative.full}"},backgroundColor:{value:"{colors.overlay.50.value}"},top:{value:"{space.zero}"},left:{value:"{space.zero}"}},container:{widthMax:{value:"30rem"}},router:{borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},boxShadow:{value:"{shadows.medium.value}"}},footer:{paddingBottom:{value:"{space.medium.value}"}},form:{padding:{value:"{space.xl.value}"}},state:{inactive:{backgroundColor:{value:"{colors.background.secondary.value}"}}},orContainer:{color:{value:"{colors.neutral.80.value}"},orLine:{backgroundColor:{value:"{colors.background.primary.value}"}}}},are={color:{value:"{colors.font.tertiary.value}"},lineHeight:{value:1},fontWeight:{value:"{fontWeights.semibold.value}"},fontSize:{value:"{fontSizes.small.value}"},textAlign:{value:"center"},width:{value:"{fontSizes.xxl.value}"},height:{value:"{fontSizes.xxl.value}"},backgroundColor:{value:"{colors.background.tertiary}"},borderRadius:{value:"100%"},borderColor:{value:"{colors.border.primary.value}"},borderWidth:{value:"{borderWidths.medium.value}"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"},borderColor:{value:"{colors.border.info.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"},borderColor:{value:"{colors.border.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"},borderColor:{value:"{colors.border.success.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"},borderColor:{value:"{colors.border.error.value}"}},small:{fontSize:{value:"{fontSizes.xs.value}"},width:{value:"{fontSizes.xl.value}"},height:{value:"{fontSizes.xl.value}"}},large:{fontSize:{value:"{fontSizes.medium.value}"},width:{value:"{fontSizes.xxxl.value}"},height:{value:"{fontSizes.xxxl.value}"}}},sre={color:{value:"{colors.font.primary.value}"},lineHeight:{value:1},fontWeight:{value:"{fontWeights.semibold.value}"},fontSize:{value:"{fontSizes.small.value}"},textAlign:{value:"center"},paddingVertical:{value:"{space.xs.value}"},paddingHorizontal:{value:"{space.small.value}"},backgroundColor:{value:"{colors.background.tertiary.value}"},borderRadius:{value:"{radii.xl.value}"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"}},small:{fontSize:{value:"{fontSizes.xs.value}"},paddingVertical:{value:"{space.xxs.value}"},paddingHorizontal:{value:"{space.xs.value}"}},large:{fontSize:{value:"{fontSizes.medium.value}"},paddingVertical:{value:"{space.small.value}"},paddingHorizontal:{value:"{space.medium.value}"}}},lre={flexDirection:{value:"row"},flexWrap:{value:"wrap"},gap:{value:"0"},color:{value:"{colors.font.tertiary}"},item:{flexDirection:{value:"row"},color:{value:"inherit"},fontSize:{value:"inherit"},alignItems:{value:"center"},lineHeight:{value:"1"}},separator:{color:{value:"inherit"},fontSize:{value:"inherit"},paddingInline:{value:"{space.xxs}"}},link:{color:{value:"{components.link.color}"},fontSize:{value:"inherit"},fontWeight:{value:"normal"},textDecoration:{value:"none"},paddingInline:{value:"{space.xs}"},paddingBlock:{value:"{space.xxs}"},current:{color:{value:"inherit"},fontSize:{value:"inherit"},fontWeight:{value:"normal"},textDecoration:{value:"none"}}}},ure={fontWeight:{value:"{fontWeights.bold.value}"},transitionDuration:{value:"{components.fieldcontrol.transitionDuration.value}"},fontSize:{value:"{components.fieldcontrol.fontSize.value}"},lineHeight:{value:"{components.fieldcontrol.lineHeight.value}"},paddingBlockStart:{value:"{components.fieldcontrol.paddingBlockStart.value}"},paddingBlockEnd:{value:"{components.fieldcontrol.paddingBlockEnd.value}"},paddingInlineStart:{value:"{components.fieldcontrol.paddingInlineStart.value}"},paddingInlineEnd:{value:"{components.fieldcontrol.paddingInlineEnd.value}"},backgroundColor:{value:"transparent"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},borderWidth:{value:"{components.fieldcontrol.borderWidth.value}"},borderStyle:{value:"{components.fieldcontrol.borderStyle.value}"},borderRadius:{value:"{components.fieldcontrol.borderRadius.value}"},color:{value:"{colors.font.primary.value}"},_hover:{color:{value:"{colors.font.focus.value}"},backgroundColor:{value:"{colors.primary.10.value}"},borderColor:{value:"{colors.primary.60.value}"}},_focus:{color:{value:"{colors.font.focus.value}"},backgroundColor:{value:"{colors.primary.10.value}"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_active:{color:{value:"{colors.font.active.value}"},backgroundColor:{value:"{colors.primary.20.value}"},borderColor:{value:"{colors.primary.100.value}"}},_loading:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.tertiary.value}"}},_disabled:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.tertiary.value}"}},outlined:{info:{borderColor:{value:"{colors.blue.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.blue.100}"},_hover:{borderColor:{value:"{colors.blue.60.value}"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.100.value}"}},_focus:{borderColor:{value:"{colors.blue.100.value}"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.100.value}"},boxShadow:{value:"{components.fieldcontrol.info._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.blue.100.value}"},backgroundColor:{value:"{colors.blue.20.value}"},color:{value:"{colors.blue.100.value}"}}},warning:{borderColor:{value:"{colors.orange.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.orange.100}"},_hover:{borderColor:{value:"{colors.orange.60.value}"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.100.value}"}},_focus:{borderColor:{value:"{colors.orange.100.value}"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.100.value}"},boxShadow:{value:"{components.fieldcontrol.warning._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.orange.100.value}"},backgroundColor:{value:"{colors.orange.20.value}"},color:{value:"{colors.orange.100.value}"}}},success:{borderColor:{value:"{colors.green.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.green.100}"},_hover:{borderColor:{value:"{colors.green.60.value}"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.100.value}"}},_focus:{borderColor:{value:"{colors.green.100.value}"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.100.value}"},boxShadow:{value:"{components.fieldcontrol.success._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.green.100.value}"},backgroundColor:{value:"{colors.green.20.value}"},color:{value:"{colors.green.100.value}"}}},error:{borderColor:{value:"{colors.red.80.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.red.100}"},_hover:{borderColor:{value:"{colors.red.80.value}"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.100.value}"}},_focus:{borderColor:{value:"{colors.red.100.value}"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.100.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.red.100.value}"},backgroundColor:{value:"{colors.red.20.value}"},color:{value:"{colors.red.100.value}"}}},overlay:{borderColor:{value:"{colors.overlay.60.value}"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.primary.value}"},_hover:{borderColor:{value:"{colors.overlay.60.value}"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.neutral.90.value}"}},_focus:{borderColor:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.neutral.90.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.neutral.100.value}"}}}},primary:{borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},backgroundColor:{value:"{colors.primary.80.value}"},color:{value:"{colors.font.inverse.value}"},_disabled:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_loading:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.100.value}"},color:{value:"{colors.font.inverse.value}"}},info:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.info._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.100.value}"},color:{value:"{colors.font.inverse.value}"}}},warning:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.100.value}"},color:{value:"{colors.font.inverse.value}"}}},error:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.100.value}"},color:{value:"{colors.font.inverse.value}"}}},success:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.80}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.success._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.100.value}"},color:{value:"{colors.font.inverse.value}"}}},overlay:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.70}"},color:{value:"{colors.font.inverse.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.90.value}"},color:{value:"{colors.font.inverse.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.90.value}"},color:{value:"{colors.font.inverse.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.90.value}"},color:{value:"{colors.font.inverse.value}"}}}},menu:{borderWidth:{value:"{space.zero.value}"},backgroundColor:{value:"transparent"},justifyContent:{value:"start"},_hover:{color:{value:"{colors.font.inverse.value}"},backgroundColor:{value:"{colors.primary.80.value}"}},_focus:{color:{value:"{colors.font.inverse.value}"},backgroundColor:{value:"{colors.primary.80.value}"}},_active:{color:{value:"{colors.font.inverse.value}"},backgroundColor:{value:"{colors.primary.90.value}"}},_disabled:{color:{value:"{colors.font.disabled.value}"}}},link:{backgroundColor:{value:"transparent"},borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small.value}"},color:{value:"{colors.font.interactive.value}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.10.value}"},color:{value:"{colors.font.hover.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.10.value}"},color:{value:"{colors.font.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.primary.20.value}"},color:{value:"{colors.font.active.value}"}},_disabled:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled.value}"}},_loading:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled.value}"}},info:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.blue.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.10.value}"},color:{value:"{colors.blue.100.value}"},boxShadow:{value:"{components.fieldcontrol.info._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.blue.20.value}"},color:{value:"{colors.blue.100.value}"}}},warning:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.orange.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.10.value}"},color:{value:"{colors.orange.100.value}"},boxShadow:{value:"{components.fieldcontrol.warning._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.orange.20.value}"},color:{value:"{colors.orange.100.value}"}}},success:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.green.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.10.value}"},color:{value:"{colors.green.100.value}"},boxShadow:{value:"{components.fieldcontrol.success._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.green.20.value}"},color:{value:"{colors.green.100.value}"}}},error:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.red.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.90.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.10.value}"},color:{value:"{colors.red.100.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.20.value}"},color:{value:"{colors.red.100.value}"}}},overlay:{borderColor:{value:"transparent"},backgroundColor:{value:"transparent"},color:{value:"{colors.neutral.100}"},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.overlay.80.value}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.5.value}"},color:{value:"{colors.overlay.90.value}"},boxShadow:{value:"{components.fieldcontrol.overlay._focus.boxShadow.value}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.overlay.90.value}"}}}},warning:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.red.60}"},borderWidth:{value:"{borderWidths.small}"},color:{value:"{colors.red.60}"},_hover:{borderColor:{value:"{colors.red.80}"},backgroundColor:{value:"{colors.red.10}"},color:{value:"{colors.font.error}"}},_focus:{borderColor:{value:"{colors.red.80}"},backgroundColor:{value:"{colors.red.10}"},color:{value:"{colors.red.80}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow}"}},_active:{borderColor:{value:"{colors.red.100}"},backgroundColor:{value:"{colors.red.20}"},color:{value:"{colors.red.100}"}},_disabled:{borderColor:{value:"{colors.border.tertiary}"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled}"}},_loading:{borderColor:{value:"{colors.border.tertiary}"},backgroundColor:{value:"transparent"},color:{value:"{colors.font.disabled}"}}},destructive:{borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small}"},borderStyle:{value:"solid"},backgroundColor:{value:"{colors.red.60}"},color:{value:"{colors.font.inverse}"},_disabled:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled}"},color:{value:"{colors.font.disabled}"}},_loading:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.background.disabled}"},color:{value:"{colors.font.disabled}"}},_hover:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.80}"},color:{value:"{colors.font.inverse}"}},_focus:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.80}"},color:{value:"{colors.font.inverse}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow}"}},_active:{borderColor:{value:"transparent"},backgroundColor:{value:"{colors.red.100}"},color:{value:"{colors.font.inverse}"}}},small:{fontSize:{value:"{components.fieldcontrol.small.fontSize.value}"},paddingBlockStart:{value:"{components.fieldcontrol.small.paddingBlockStart.value}"},paddingBlockEnd:{value:"{components.fieldcontrol.small.paddingBlockEnd.value}"},paddingInlineStart:{value:"{components.fieldcontrol.small.paddingInlineStart.value}"},paddingInlineEnd:{value:"{components.fieldcontrol.small.paddingInlineEnd.value}"}},large:{fontSize:{value:"{components.fieldcontrol.large.fontSize.value}"},paddingBlockStart:{value:"{components.fieldcontrol.large.paddingBlockStart.value}"},paddingBlockEnd:{value:"{components.fieldcontrol.large.paddingBlockEnd.value}"},paddingInlineStart:{value:"{components.fieldcontrol.large.paddingInlineStart.value}"},paddingInlineEnd:{value:"{components.fieldcontrol.large.paddingInlineEnd.value}"}},loaderWrapper:{alignItems:{value:"center"},gap:{value:"{space.xs.value}"}}},cre={backgroundColor:{value:"{colors.background.primary.value}"},borderRadius:{value:"{radii.xs.value}"},borderWidth:{value:"0"},borderStyle:{value:"solid"},borderColor:{value:"transparent"},boxShadow:{value:"none"},padding:{value:"{space.medium.value}"},outlined:{backgroundColor:{value:"{components.card.backgroundColor.value}"},borderRadius:{value:"{radii.xs.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},boxShadow:{value:"{components.card.boxShadow.value}"}},elevated:{backgroundColor:{value:"{components.card.backgroundColor.value}"},borderRadius:{value:"{radii.xs.value}"},borderWidth:{value:"0"},borderStyle:{value:"solid"},borderColor:{value:"transparent"},boxShadow:{value:"{shadows.medium.value}"}}},dre={cursor:{value:"pointer"},alignItems:{value:"center"},_disabled:{cursor:{value:"not-allowed"}},button:{position:{value:"relative"},alignItems:{value:"center"},justifyContent:{value:"center"},color:{value:"{colors.font.inverse.value}"},before:{width:{value:"100%"},height:{value:"100%"},borderWidth:{value:"{borderWidths.medium.value}"},borderRadius:{value:"20%"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"}},_focus:{outlineColor:{value:"{colors.transparent.value}"},outlineStyle:{value:"solid"},outlineWidth:{value:"{outlineWidths.medium.value}"},outlineOffset:{value:"{outlineOffsets.medium.value}"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"}},_error:{borderColor:{value:"{colors.border.error.value}"},_focus:{borderColor:{value:"{colors.border.error.value}"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}}}},icon:{backgroundColor:{value:"{colors.primary.80.value}"},borderRadius:{value:"20%"},opacity:{value:"{opacities.0.value}"},transform:{value:"scale(0)"},transitionProperty:{value:"all"},transitionDuration:{value:"{time.short.value}"},transitionTimingFunction:{value:"ease-in-out"},_checked:{opacity:{value:"{opacities.100.value}"},transform:{value:"scale(1)"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}},_indeterminate:{opacity:{value:"{opacities.100.value}"},transform:{value:"scale(1)"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}}},label:{color:{value:"{components.text.color.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"}}}},fre={alignItems:{value:"flex-start"},alignContent:{value:"center"},flexDirection:{value:"column"},justifyContent:{value:"center"}},pre={pagination:{current:{color:{value:"{components.pagination.current.color}"},backgroundColor:{value:"{components.pagination.current.backgroundColor}"}},button:{color:{value:"{components.pagination.button.color}"},_hover:{backgroundColor:{value:"{components.pagination.button.hover.backgroundColor}"},color:{value:"{components.pagination.button.hover.color}"}},_disabled:{color:{value:"{components.pagination.button.disabled.color}"}}}},search:{input:{color:{value:"{components.searchfield.color}"}},button:{color:{value:"{components.searchfield.button.color}"},_active:{backgroundColor:{value:"{components.searchfield.button._active.backgroundColor}"},borderColor:{value:"{components.searchfield.button._active.borderColor}"},color:{value:"{components.searchfield.button._active.color}"}},_disabled:{backgroundColor:{value:"{components.searchfield.button._disabled.backgroundColor}"},borderColor:{value:"{components.searchfield.button._disabled.borderColor}"},color:{value:"{components.searchfield.button._disabled.color}"}},_focus:{backgroundColor:{value:"{components.searchfield.button._focus.backgroundColor}"},borderColor:{value:"{components.searchfield.button._focus.borderColor}"},color:{value:"{components.searchfield.button._focus.color}"}},_hover:{backgroundColor:{value:"{components.searchfield.button._hover.backgroundColor}"},borderColor:{value:"{components.searchfield.button._hover.borderColor}"},color:{value:"{components.searchfield.button._hover.color}"}}}}},hre={fontSize:{value:"{fontSizes.xs}"},gap:{value:"{space.relative.medium}"},svg:{path:{fill:{value:"{colors.font.primary}"}}},toolTip:{bottom:{value:"{space.large}"},color:{value:"{colors.teal.100}"},fontSize:{value:"{fontSizes.xxs}"}}},mre={height:{value:"{space.relative.full.value}"}},gre={borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},borderWidth:{value:"{borderWidths.medium.value}"},label:{color:{value:"{colors.font.tertiary.value}"},paddingInline:{value:"{space.medium.value}"},fontSize:{value:"{fontSizes.small.value}"},backgroundColor:{value:"{colors.background.primary.value}"}},small:{borderWidth:{value:"{borderWidths.small.value}"}},large:{borderWidth:{value:"{borderWidths.large.value}"}},opacity:{value:"{opacities.60.value}"}},vre={backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},color:{value:"{colors.font.primary}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.primary.10}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.primary}"}},_disabled:{backgroundColor:{value:"{colors.background.disabled}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.disabled}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.disabled}"}},accepted:{backgroundColor:{value:"{colors.background.success}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.success}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.success}"}},rejected:{backgroundColor:{value:"{colors.background.error}"},borderRadius:{value:"{components.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.dropzone.borderStyle}"},borderWidth:{value:"{components.dropzone.borderWidth}"},color:{value:"{colors.font.error}"}}},yre={backgroundColor:{value:"{colors.background.primary.value}"},item:{borderColor:{value:"{colors.border.secondary.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderRadius:{value:"{radii.small.value}"},trigger:{alignItems:{value:"center"},backgroundColor:{value:"{colors.background.primary.value}"},color:{value:"inherit"},gap:{value:"{space.small.value}"},justifyContent:{value:"space-between"},paddingBlock:{value:"{space.xs.value}"},paddingInline:{value:"{space.small.value}"},_hover:{color:{value:"inherit"},backgroundColor:{value:"{colors.overlay.5.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0",offsetY:"0",blurRadius:"0",spreadRadius:"2px",color:"{colors.border.focus.value}"}}}},content:{color:{value:"inherit"},paddingInline:{value:"{space.small.value}"},paddingBlockEnd:{value:"{space.small.value}"},paddingBlockStart:{value:"{space.xxxs.value}"}},icon:{color:{value:"{colors.font.tertiary.value}"},transitionDuration:{value:"{time.medium.value}"},transitionTimingFunction:{value:"cubic-bezier(0.87, 0, 0.13, 1)"}}}},Sre={gap:{value:"{space.xs.value}"},fontSize:{value:"{fontSizes.medium.value}"},flexDirection:{value:"column"},small:{gap:{value:"{space.xxxs.value}"},fontSize:{value:"{fontSizes.small.value}"}},large:{gap:{value:"{space.small.value}"},fontSize:{value:"{fontSizes.large.value}"}},label:{color:{value:"{colors.font.secondary.value}"}}},bre={borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderRadius:{value:"{radii.small.value}"},color:{value:"{colors.font.primary.value}"},paddingBlockStart:{value:"{space.xs.value}"},paddingBlockEnd:{value:"{space.xs.value}"},paddingInlineStart:{value:"{space.medium.value}"},paddingInlineEnd:{value:"{space.medium.value}"},fontSize:{value:"{components.field.fontSize.value}"},lineHeight:{value:"{lineHeights.medium.value}"},transitionDuration:{value:"{time.medium.value}"},outlineColor:{value:"{colors.transparent.value}"},outlineStyle:{value:"solid"},outlineWidth:{value:"{outlineWidths.medium.value}"},outlineOffset:{value:"{outlineOffsets.medium.value}"},small:{fontSize:{value:"{components.field.small.fontSize.value}"},paddingBlockStart:{value:"{space.xxs.value}"},paddingBlockEnd:{value:"{space.xxs.value}"},paddingInlineStart:{value:"{space.small.value}"},paddingInlineEnd:{value:"{space.small.value}"}},large:{fontSize:{value:"{components.field.large.fontSize.value}"},paddingBlockStart:{value:"{space.xs.value}"},paddingBlockEnd:{value:"{space.xs.value}"},paddingInlineStart:{value:"{space.medium.value}"},paddingInlineEnd:{value:"{space.medium.value}"}},quiet:{borderStyle:{value:"none"},borderInlineStart:{value:"none"},borderInlineEnd:{value:"none"},borderBlockStart:{value:"none"},borderRadius:{value:"0"},_focus:{borderBlockEndColor:{value:"transparent"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_error:{borderBlockEndColor:{value:"{colors.border.error.value}"},_focus:{borderBlockEndColor:{value:"transparent"},boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}}}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.border.focus.value}"}}},_disabled:{color:{value:"{colors.font.disabled.value}"},cursor:{value:"not-allowed"},borderColor:{value:"{colors.transparent.value}"},backgroundColor:{value:"{colors.background.disabled.value}"}},_error:{borderColor:{value:"{colors.border.error.value}"},color:{value:"{colors.font.error.value}"},_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.border.error.value}"}}}},info:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.blue.100.value}"}}}},warning:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.orange.100.value}"}}}},success:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.green.100.value}"}}}},overlay:{_focus:{boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"2px",color:"{colors.overlay.90.value}"}}}}},Ere={gap:{value:"{space.zero.value}"},vertical:{alignItems:{value:"center"}},outer:{alignItems:{value:"center"}}},wre={backgroundColor:{value:"transparent"},borderRadius:{value:"{radii.xs.value}"},flexDirection:{value:"column"},gap:{value:"{components.field.gap.value}"},legend:{color:{value:"{colors.font.primary.value}"},fontSize:{value:"{components.field.fontSize.value}"},fontWeight:{value:"{fontWeights.bold.value}"},lineHeight:{value:"{lineHeights.medium.value}"},small:{fontSize:"{components.field.small.fontSize.value}"},large:{fontSize:"{components.field.large.fontSize.value}"}},outlined:{padding:"{space.medium.value}",borderColor:"{colors.neutral.40.value}",borderWidth:"{borderWidths.small.value}",borderStyle:"solid",small:{padding:"{space.small.value}"},large:{padding:"{space.large.value}"}},small:{gap:"{components.field.small.gap.value}"},large:{gap:"{components.field.large.gap.value}"}},Cre={error:{color:{value:"{colors.font.error.value}"},fontSize:{value:"{fontSizes.small.value}"}},description:{color:{value:"{colors.font.secondary.value}"},fontStyle:{value:"italic"},fontSize:{value:"{fontSizes.small.value}"}}},xre={dropzone:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.primary.10}"},borderRadius:{value:"{components.fileuploader.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.fileuploader.dropzone.borderStyle}"},borderWidth:{value:"{borderWidths.medium}"}},icon:{color:{value:"{colors.border.primary}"},fontSize:{value:"{fontSizes.xxl}"}},text:{color:{value:"{colors.font.tertiary}"},fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"}}},file:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"},gap:{value:"{space.small}"},alignItems:{value:"baseline"},name:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},size:{fontSize:{value:"{fontSizes.small}"},fontWeight:{value:"{fontWeights.normal}"},color:{value:"{colors.font.tertiary}"}},image:{width:{value:"{space.xxl}"},height:{value:"{space.xxl}"},backgroundColor:{value:"{colors.background.secondary}"},color:{value:"{colors.font.tertiary}"},borderRadius:{value:"{radii.small}"}}},filelist:{flexDirection:{value:"column"},gap:{value:"{space.small}"}},loader:{strokeLinecap:{value:"round"},strokeEmpty:{value:"{colors.border.secondary}"},strokeFilled:{value:"{components.loader.strokeFilled}"},strokeWidth:{value:"{borderWidths.large}"}},previewer:{backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},borderRadius:{value:"{radii.small}"},paddingBlock:{value:"{space.zero}"},paddingInline:{value:"{space.zero}"},maxHeight:{value:"40rem"},maxWidth:{value:"auto"},text:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},body:{paddingBlock:{value:"{space.medium}"},paddingInline:{value:"{space.medium}"},gap:{value:"{space.small}"}},footer:{justifyContent:{value:"flex-end"}}}},Ire={gap:{value:"{space.medium.value}"},justifyContent:{value:"normal"},alignItems:{value:"stretch"},alignContent:{value:"normal"},flexWrap:{value:"nowrap"}},Tre={color:{value:"{colors.font.primary.value}"},lineHeight:{value:"{lineHeights.small.value}"},1:{fontSize:{value:"{fontSizes.xxxxl.value}"},fontWeight:{value:"{fontWeights.light.value}"}},2:{fontSize:{value:"{fontSizes.xxxl.value}"},fontWeight:{value:"{fontWeights.normal.value}"}},3:{fontSize:{value:"{fontSizes.xxl.value}"},fontWeight:{value:"{fontWeights.medium.value}"}},4:{fontSize:{value:"{fontSizes.xl.value}"},fontWeight:{value:"{fontWeights.semibold.value}"}},5:{fontSize:{value:"{fontSizes.large.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},6:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.extrabold.value}"}}},Are={highlighted:{fontWeight:{value:"{fontWeights.bold}"}}},_re={lineHeight:{value:1},height:{value:"1em"}},Rre={color:{value:"{components.fieldcontrol.color.value}"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},fontSize:{value:"{components.fieldcontrol.fontSize.value}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor.value}"}}},Pre={maxWidth:{value:"100%"},height:{value:"auto"},objectFit:{value:"initial"},objectPosition:{value:"initial"}},kre={banner:{height:{value:"150px "},width:{value:"400px "}},button:{backgroundColor:{value:"#e8e8e8"},borderRadius:{value:"5px"},color:{value:"black"}},dialog:{height:{value:"50vh"},minHeight:{value:"400px"},minWidth:{value:"400px"},width:{value:"30vw"}},header:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.extrabold.value}"}}},Nre={active:{color:{value:"{colors.font.active.value}"}},color:{value:"{colors.font.interactive.value}"},focus:{color:{value:"{colors.font.focus.value}"}},hover:{color:{value:"{colors.font.hover.value}"}},visited:{color:{value:"{colors.font.interactive.value}"}}},Ore={cameraModule:{backgroundColor:{value:"{colors.background.primary.value}"}}},Dre={width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"},fontSize:{value:"{fontSizes.xs.value}"},strokeEmpty:{value:"{colors.neutral.20.value}"},strokeFilled:{value:"{colors.primary.80.value}"},strokeLinecap:{value:"round"},animationDuration:{value:"1s"},small:{width:{value:"{fontSizes.small.value}"},height:{value:"{fontSizes.small.value}"},fontSize:{value:"{fontSizes.xxs.value}"}},large:{width:{value:"{fontSizes.large.value}"},height:{value:"{fontSizes.large.value}"},fontSize:{value:"{fontSizes.small.value}"}},linear:{width:{value:"100%"},minWidth:{value:"5rem"},fontSize:{value:"{fontSizes.xxs.value}"},strokeWidth:{value:"{fontSizes.xxs.value}"},strokeFilled:{value:"{colors.primary.80.value}"},strokeEmpty:{value:"{colors.neutral.20.value}"},strokeLinecap:{value:"round"},animationDuration:{value:"1s"},small:{strokeWidth:{value:"{fontSizes.xxxs.value}"},fontSize:{value:"{fontSizes.xxxs.value}"}},large:{strokeWidth:{value:"{fontSizes.xs.value}"},fontSize:{value:"{fontSizes.xs.value}"}}},text:{fill:{value:"{colors.font.primary.value}"}}},Mre={backgroundColor:{value:"{colors.background.primary.value}"},borderRadius:{value:"{radii.medium.value}"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderColor:{value:"{colors.border.primary.value}"},boxShadow:{value:"{shadows.large.value}"},flexDirection:{value:"column"},gap:{value:"{space.zero.value}"},maxWidth:{value:"30rem"},minWidth:{value:"14rem"},small:{width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"}},large:{width:{value:"{fontSizes.xxxl.value}"},height:{value:"{fontSizes.xxxl.value}"}},item:{minHeight:{value:"2.5rem"},paddingInlineStart:{value:"{space.medium.value}"},paddingInlineEnd:{value:"{space.medium.value}"}}},Fre={alignItems:{value:"center"},backgroundColor:{value:"{colors.background.tertiary.value}"},borderColor:{value:"transparent"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small.value}"},borderRadius:{value:"{radii.xs.value}"},color:{value:"{colors.font.primary.value}"},justifyContent:{value:"flex-start"},paddingBlock:{value:"{space.small.value}"},paddingInline:{value:"{space.medium.value}"},lineHeight:{value:"{lineHeights.small.value}"},icon:{size:{value:"{fontSizes.xl.value}"}},heading:{fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"}},dismiss:{gap:{value:"{space.xxs.value}"}},plain:{color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"}}},outlined:{color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.primary.value}"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.info.value}"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.error.value}"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.success.value}"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.warning.value}"}}},filled:{color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.background.secondary.value}"},borderColor:{value:"transparent"},info:{color:{value:"{colors.font.info.value}"},backgroundColor:{value:"{colors.background.info.value}"},borderColor:{value:"transparent"}},error:{color:{value:"{colors.font.error.value}"},backgroundColor:{value:"{colors.background.error.value}"},borderColor:{value:"transparent"}},success:{color:{value:"{colors.font.success.value}"},backgroundColor:{value:"{colors.background.success.value}"},borderColor:{value:"transparent"}},warning:{color:{value:"{colors.font.warning.value}"},backgroundColor:{value:"{colors.background.warning.value}"},borderColor:{value:"transparent"}}}},Lre={current:{alignItems:{value:"center"},justifyContent:{value:"center"},color:{value:"{colors.font.inverse.value}"},fontSize:{value:"{fontSizes.small.value}"},backgroundColor:{value:"{colors.overlay.40.value}"}},button:{color:{value:"{colors.font.primary.value}"},paddingInlineStart:{value:"{space.xxs.value}"},paddingInlineEnd:{value:"{space.xxs.value}"},transitionProperty:{value:"background-color"},transitionDuration:{value:"{time.medium.value}"},hover:{backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.font.primary.value}"}},disabled:{color:{value:"{colors.font.disabled.value}"}}},ellipsis:{alignItems:{value:"baseline"},justifyContent:{value:"center"},paddingInlineStart:{value:"{space.xs.value}"},paddingInlineEnd:{value:"{space.xs.value}"}},itemContainer:{marginLeft:{value:"{space.xxxs.value}"},marginRight:{value:"{space.xxxs.value}"}},itemShared:{height:{value:"{fontSizes.xxl.value}"},minWidth:{value:"{fontSizes.xxl.value}"},borderRadius:{value:"{fontSizes.medium.value}"}}},Ure={color:{value:"{components.fieldcontrol.color.value}"},button:{color:{value:"{components.button.color.value}"},_active:{backgroundColor:{value:"{components.button._active.backgroundColor.value}"},borderColor:{value:"{components.button._active.borderColor.value}"},color:{value:"{components.button._active.color.value}"}},_disabled:{backgroundColor:{value:"{components.button._disabled.backgroundColor.value}"},borderColor:{value:"{components.button._disabled.borderColor.value}"},color:{value:"{components.button._disabled.color.value}"}},_error:{color:{value:"{components.button.outlined.error.color.value}"},backgroundColor:{value:"{components.button.outlined.error.backgroundColor.value}"},borderColor:{value:"{components.button.outlined.error.borderColor.value}"},_active:{borderColor:{value:"{components.button.outlined.error._active.borderColor.value}"},backgroundColor:{value:"{components.button.outlined.error._active.backgroundColor.value}"},color:{value:"{components.button.outlined.error._active.color.value}"}},_focus:{borderColor:{value:"{components.button.outlined.error._focus.borderColor.value}"},backgroundColor:{value:"{components.button.outlined.error._focus.backgroundColor.value}"},color:{value:"{components.button.outlined.error._focus.color.value}"},boxShadow:{value:"{components.button.outlined.error._focus.boxShadow.value}"}},_hover:{borderColor:{value:"{components.button.outlined.error._hover.borderColor.value}"},backgroundColor:{value:"{components.button.outlined.error._hover.backgroundColor.value}"},color:{value:"{components.button.outlined.error._hover.color.value}"}}},_focus:{backgroundColor:{value:"{components.button._focus.backgroundColor.value}"},borderColor:{value:"{components.button._focus.borderColor.value}"},color:{value:"{components.button._focus.color.value}"}},_hover:{backgroundColor:{value:"{components.button._hover.backgroundColor.value}"},borderColor:{value:"{components.button._hover.borderColor.value}"},color:{value:"{components.button._hover.color.value}"}}}},$re={color:{value:"{components.fieldcontrol.color}"},borderColor:{value:"{components.fieldcontrol.borderColor}"},fontSize:{value:"{components.fieldcontrol.fontSize}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor}"}}},jre={borderRadius:{value:"{radii.small.value}"},transitionDuration:{value:"{time.long.value}"},startColor:{value:"{colors.background.secondary.value}"},endColor:{value:"{colors.background.tertiary.value}"},small:{height:{value:"{space.small.value}"}},default:{height:{value:"{space.medium.value}"}},large:{height:{value:"{space.large.value}"}}},Bre={alignItems:{value:"center"},justifyContent:{value:"flex-start"},gap:{value:"inherit"},_disabled:{cursor:{value:"not-allowed"}},button:{alignItems:{value:"center"},justifyContent:{value:"center"},width:{value:"{fontSizes.medium.value}"},height:{value:"{fontSizes.medium.value}"},boxSizing:{value:"border-box"},borderWidth:{value:"{borderWidths.medium.value}"},borderStyle:{value:"solid"},borderRadius:{value:"50%"},borderColor:{value:"{colors.border.primary.value}"},color:{value:"{colors.background.primary.value}"},backgroundColor:{value:"{colors.background.primary.value}"},transitionProperty:{value:"all"},transitionDuration:{value:"{time.medium.value}"},outlineColor:{value:"{colors.transparent.value}"},outlineStyle:{value:"solid"},outlineWidth:{value:"{outlineWidths.medium.value}"},outlineOffset:{value:"{outlineOffsets.medium.value}"},padding:{value:"{borderWidths.medium.value}"},small:{width:{value:"{fontSizes.small.value}"},height:{value:"{fontSizes.small.value}"}},large:{width:{value:"{fontSizes.large.value}"},height:{value:"{fontSizes.large.value}"}},_checked:{color:{value:"{colors.primary.80.value}"},_disabled:{color:{value:"{colors.background.disabled.value}"}}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},_error:{borderColor:{value:"{colors.border.error.value}"},_focus:{boxShadow:{value:"{components.fieldcontrol._error._focus.boxShadow.value}"}}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"},backgroundColor:{value:"{colors.background.primary.value}"}}},label:{color:{value:"{components.text.color.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"}}}},zre={radio:{borderWidth:{value:"{components.radio.button.borderWidth}"},borderColor:{value:"{components.radio.button.borderColor}"},backgroundColor:{value:"{components.radio.button.backgroundColor}"},_checked:{color:{value:"{components.radio.button._checked.color}"}},label:{color:{value:"{components.radio.label.color}"}}},legend:{color:{value:"{components.fieldset.legend.color}"},fontWeight:{value:"{fontWeights.normal}"}}},Hre={large:{size:{value:"{fontSizes.xxxl.value}"}},default:{size:{value:"{fontSizes.xl.value}"}},small:{size:{value:"{fontSizes.small.value}"}},filled:{color:{value:"{colors.secondary.80.value}"}},empty:{color:{value:"{colors.background.tertiary.value}"}}},Wre={color:{value:"{components.fieldcontrol.color.value}"},button:{color:{value:"{components.button.color.value}"},backgroundColor:{value:"{colors.background.primary.value}"},_active:{backgroundColor:{value:"{components.button._active.backgroundColor.value}"},borderColor:{value:"{components.button._active.borderColor.value}"},color:{value:"{components.button._active.color.value}"}},_disabled:{backgroundColor:{value:"{components.button._disabled.backgroundColor.value}"},borderColor:{value:"{components.button._disabled.borderColor.value}"},color:{value:"{components.button._disabled.color.value}"}},_focus:{backgroundColor:{value:"{components.button._focus.backgroundColor.value}"},borderColor:{value:"{components.button._focus.borderColor.value}"},color:{value:"{components.button._focus.color.value}"}},_hover:{backgroundColor:{value:"{components.button._hover.backgroundColor.value}"},borderColor:{value:"{components.button._hover.borderColor.value}"},color:{value:"{components.button._hover.color.value}"}}}},Vre={color:{value:"{components.fieldcontrol.color}"},backgroundColor:{value:"{colors.background.primary.value}"},paddingInlineEnd:{value:"{space.xxl.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"{colors.background.disabled.value}"}},wrapper:{flex:{value:"1"},display:{value:"block"},position:{value:"relative"},cursor:{value:"pointer"}},iconWrapper:{alignItems:{value:"center"},position:{value:"absolute"},top:{value:"50%"},right:{value:"{space.medium.value}"},transform:{value:"translateY(-50%)"},pointerEvents:{value:"none"},small:{right:{value:"{space.xs.value}"}},large:{right:{value:"{space.medium.value}"}}},option:{backgroundColor:{value:"transparent"},color:{value:"{colors.font.primary.value}"},_disabled:{color:{value:"{colors.font.disabled.value}"},backgroundColor:{value:"transparent"}}},whiteSpace:{value:"nowrap"},minWidth:{value:"6.5rem"},small:{minWidth:{value:"5.5rem"},paddingInlineEnd:{value:"{space.xl.value}"}},large:{minWidth:{value:"7.5rem"},paddingInlineEnd:{value:"{space.xxl.value}"}},expanded:{paddingBlock:{value:"{space.xs.value}"},paddingInline:{value:"{space.small.value}"},option:{paddingBlock:{value:"{space.xs.value}"},paddingInline:{value:"{space.small.value}"}}}},Kre={borderColor:{value:"{components.fieldcontrol.borderColor}"},color:{value:"{components.fieldcontrol.color}"},flexDirection:{value:"column"},fontSize:{value:"{components.fieldcontrol.fontSize}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor}"}},label:{color:{value:"{components.field.label.color}"}}},Gre={paddingBlock:{value:"{space.xs.value}"},track:{backgroundColor:{value:"{colors.background.quaternary.value}"},borderRadius:{value:"9999px"},height:{value:"0.375rem"},minWidth:{value:"10rem"}},range:{backgroundColor:{value:"{colors.primary.80.value}"},borderRadius:{value:"9999px"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"}}},thumb:{width:{value:"1.25rem"},height:{value:"1.25rem"},backgroundColor:{value:"{colors.background.primary.value}"},boxShadow:{value:"{shadows.small.value}"},borderRadius:{value:"50%"},borderWidth:{value:"{borderWidths.medium.value}"},borderColor:{value:"{colors.border.primary.value}"},borderStyle:{value:"solid"},_disabled:{backgroundColor:{value:"{colors.background.disabled.value}"},borderColor:{value:"transparent"},boxShadow:{value:"none"}},_hover:{backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"{colors.border.focus.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}}},small:{track:{height:{value:"0.25rem"}},thumb:{width:{value:"1rem"},height:{value:"1rem"}}},large:{track:{height:{value:"0.625rem"}},thumb:{width:{value:"1.5rem"},height:{value:"1.5rem"}}}},qre={borderColor:{value:"{components.fieldcontrol.borderColor}"},flexDirection:{value:"column"},input:{color:{value:"{components.fieldcontrol.color}"},fontSize:{value:"{components.fieldcontrol.fontSize}"},textAlign:{value:"center"}},button:{color:{value:"{components.button.color}"},backgroundColor:{value:"{colors.transparent}"},_active:{color:{value:"{components.button._active.color}"},backgroundColor:{value:"{components.button._active.backgroundColor}"}},_focus:{color:{value:"{components.button._focus.color}"},backgroundColor:{value:"{components.button._focus.backgroundColor}"}},_disabled:{color:{value:"{components.button._disabled.color}"},backgroundColor:{value:"{components.fieldcontrol._disabled.backgroundColor}"}},_hover:{color:{value:"{components.button._hover.color}"},backgroundColor:{value:"{components.button._hover.backgroundColor}"}}}},Qre={dropzone:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"dashed"},borderWidth:{value:"{borderWidths.small}"},gap:{value:"{space.small}"},paddingBlock:{value:"{space.xl}"},paddingInline:{value:"{space.large}"},textAlign:{value:"center"},_active:{backgroundColor:{value:"{colors.primary.10}"},borderRadius:{value:"{components.storagemanager.dropzone.borderRadius}"},borderColor:{value:"{colors.border.pressed}"},borderStyle:{value:"{components.storagemanager.dropzone.borderStyle}"},borderWidth:{value:"{borderWidths.medium}"}},icon:{color:{value:"{colors.border.primary}"},fontSize:{value:"{fontSizes.xxl}"}},text:{color:{value:"{colors.font.tertiary}"},fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"}}},file:{backgroundColor:{value:"{colors.background.primary}"},borderRadius:{value:"{radii.small}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},paddingBlock:{value:"{space.xs}"},paddingInline:{value:"{space.small}"},gap:{value:"{space.small}"},alignItems:{value:"baseline"},name:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},size:{fontSize:{value:"{fontSizes.small}"},fontWeight:{value:"{fontWeights.normal}"},color:{value:"{colors.font.tertiary}"}},image:{width:{value:"{space.xxl}"},height:{value:"{space.xxl}"},backgroundColor:{value:"{colors.background.secondary}"},color:{value:"{colors.font.tertiary}"},borderRadius:{value:"{radii.small}"}}},filelist:{flexDirection:{value:"column"},gap:{value:"{space.small}"}},loader:{strokeLinecap:{value:"round"},strokeEmpty:{value:"{colors.border.secondary}"},strokeFilled:{value:"{components.loader.strokeFilled}"},strokeWidth:{value:"{borderWidths.large}"}},previewer:{backgroundColor:{value:"{colors.background.primary}"},borderColor:{value:"{colors.border.primary}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small}"},borderRadius:{value:"{radii.small}"},paddingBlock:{value:"{space.zero}"},paddingInline:{value:"{space.zero}"},maxHeight:{value:"40rem"},maxWidth:{value:"auto"},text:{fontSize:{value:"{fontSizes.medium}"},fontWeight:{value:"{fontWeights.bold}"},color:{value:"{colors.font.primary}"}},body:{paddingBlock:{value:"{space.medium}"},paddingInline:{value:"{space.medium}"},gap:{value:"{space.small}"}},footer:{justifyContent:{value:"flex-end"}}}},Yre={_disabled:{opacity:{value:"{opacities.60.value}"}},_focused:{shadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"}},fontSize:{value:"{fontSizes.medium.value}"},large:{fontSize:{value:"{fontSizes.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"}},label:{padding:{value:"{space.xs.value}"}},thumb:{backgroundColor:{value:"{colors.background.primary.value}"},borderColor:{value:"transparent"},borderWidth:{value:"{borderWidths.small.value}"},borderStyle:{value:"solid"},borderRadius:{value:"{radii.xxxl.value}"},checked:{transform:{value:"{transforms.slideX.medium.value}"}},transition:{duration:{value:"{time.medium.value}"}},width:{value:"{space.relative.medium.value}"}},track:{backgroundColor:{value:"{colors.background.quaternary.value}"},borderRadius:{value:"{radii.xxxl.value}"},checked:{backgroundColor:{value:"{colors.primary.80.value}"}},height:{value:"{space.relative.medium.value}"},padding:{value:"{outlineWidths.medium.value}"},transition:{duration:{value:"{time.short.value}"}},width:{value:"{space.relative.xl.value}"},_error:{backgroundColor:{value:"{colors.background.error.value}"}}}},Xre={borderCollapse:{value:"collapse"},display:{value:"table"},width:{value:"100%"},head:{display:{value:"table-header-group"},verticalAlign:{value:"middle"}},body:{display:{value:"table-row-group"},verticalAlign:{value:"middle"}},foot:{display:{value:"table-footer-group"},verticalAlign:{value:"middle"}},row:{display:{value:"table-row"},verticalAlign:{value:"middle"},hover:{backgroundColor:{value:"{colors.background.tertiary.value}"}},striped:{backgroundColor:{value:"{colors.background.secondary.value}"}}},header:{borderColor:{value:"{colors.border.tertiary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small.value}"},color:{value:"{colors.font.primary.value}"},display:{value:"table-cell"},fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"},padding:{value:"{space.medium.value}"},verticalAlign:{value:"middle"},large:{fontSize:{value:"{fontSizes.large.value}"},padding:{value:"{space.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"},padding:{value:"{space.xs.value}"}}},data:{borderColor:{value:"{colors.border.tertiary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.small.value}"},color:{value:"{colors.font.primary.value}"},display:{value:"table-cell"},fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.normal.value}"},padding:{value:"{space.medium.value}"},verticalAlign:{value:"middle"},large:{fontSize:{value:"{fontSizes.large.value}"},padding:{value:"{space.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"},padding:{value:"{space.xs.value}"}}},caption:{captionSide:{value:"bottom"},color:{value:"{colors.font.primary.value}"},display:{value:"table-caption"},fontSize:{value:"{fontSizes.medium.value}"},textAlign:{value:"center"},wordBreak:{value:"break-all"},large:{fontSize:{value:"{fontSizes.large.value}"}},small:{fontSize:{value:"{fontSizes.small.value}"}}}},Jre={backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.secondary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.medium.value}"},gap:{value:"0"},item:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.secondary.value}"},borderStyle:{value:"solid"},borderWidth:{value:"{borderWidths.medium.value}"},color:{value:"{colors.font.secondary.value}"},fontSize:{value:"{fontSizes.medium.value}"},fontWeight:{value:"{fontWeights.bold.value}"},paddingVertical:{value:"{space.small.value}"},paddingHorizontal:{value:"{space.medium.value}"},textAlign:{value:"center"},transitionDuration:{value:"{time.medium.value}"},_hover:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:"none"},color:{value:"{colors.font.hover.value}"}},_focus:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.focus.value}"},boxShadow:{value:{offsetX:"0px",offsetY:"0px",blurRadius:"0px",spreadRadius:"{borderWidths.medium}",color:"{colors.border.focus.value}"}},color:{value:"{colors.font.focus.value}"}},_active:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.font.interactive.value}"},boxShadow:{value:"none"},color:{value:"{colors.font.interactive.value}"}},_disabled:{backgroundColor:{value:"transparent"},borderColor:{value:"{colors.border.tertiary.value}"},boxShadow:{value:"none"},color:{value:"{colors.font.disabled.value}"}}},panel:{backgroundColor:{value:"transparent"},paddingInline:{value:"0"},paddingBlock:{value:"{space.small.value}"}}},Zre={color:{value:"{colors.font.primary.value}"},primary:{color:{value:"{colors.font.primary.value}"}},secondary:{color:{value:"{colors.font.secondary.value}"}},tertiary:{color:{value:"{colors.font.tertiary.value}"}},error:{color:{value:"{colors.font.error.value}"}},warning:{color:{value:"{colors.font.warning.value}"}},success:{color:{value:"{colors.font.success.value}"}},info:{color:{value:"{colors.font.info.value}"}}},eoe={color:{value:"{components.fieldcontrol.color.value}"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor.value}"}}},toe={color:{value:"{components.fieldcontrol.color.value}"},borderColor:{value:"{components.fieldcontrol.borderColor.value}"},fontSize:{value:"{components.fieldcontrol.fontSize.value}"},_focus:{borderColor:{value:"{components.fieldcontrol._focus.borderColor.value}"}}},noe={borderColor:{value:"{colors.border.primary.value}"},color:{value:"{colors.font.primary.value}"},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"}},_focus:{borderColor:{value:"{colors.border.focus.value}"},color:{value:"{colors.font.primary.value}"}},_active:{backgroundColor:{value:"{colors.transparent.value}"}},_disabled:{backgroundColor:{value:"{colors.transparent.value}"},borderColor:{value:"{colors.border.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{borderColor:{value:"{colors.border.pressed.value}"},color:{value:"{colors.font.primary.value}"},backgroundColor:{value:"{colors.overlay.20.value}"},_hover:{backgroundColor:{value:"{colors.overlay.30.value}"}}},primary:{backgroundColor:{value:"{colors.transparent.value}"},borderWidth:{value:"{borderWidths.small.value}"},_focus:{borderColor:{value:"{colors.border.focus.value}"},backgroundColor:{value:"{colors.transparent.value}"},boxShadow:{value:"{components.fieldcontrol._focus.boxShadow.value}"},color:{value:"{colors.font.primary.value}"}},_hover:{backgroundColor:{value:"{colors.overlay.10.value}"},color:{value:"{colors.font.primary.value}"}},_disabled:{borderColor:{value:"{colors.border.disabled.value}"},backgroundColor:{value:"{colors.background.disabled.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{backgroundColor:{value:"{colors.primary.80.value}"},borderColor:{value:"{colors.primary.80.value}"},color:{value:"{colors.background.primary.value}"},_focus:{backgroundColor:{value:"{colors.border.focus.value}"},borderColor:{value:"{colors.border.focus.value}"},color:{value:"{colors.background.primary.value}"}},_hover:{borderColor:{value:"{colors.primary.60.value}"},backgroundColor:{value:"{colors.primary.60.value}"},boxShadow:{value:"{colors.primary.60.value}"},color:{value:"{colors.background.primary.value}"}}}},link:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"},_hover:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"}},_focus:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.50.value}"}},_disabled:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.font.disabled.value}"}},_pressed:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.90.value}"},_focus:{backgroundColor:{value:"{colors.transparent.value}"},color:{value:"{colors.overlay.90.value}"}},_hover:{color:{value:"{colors.overlay.90.value}"},backgroundColor:{value:"{colors.transparent.value}"}}}}},roe={alignItems:{value:"center"},alignContent:{value:"center"},justifyContent:{value:"flex-start"}},ooe={accordion:yre,aiConversation:rre,alert:nre,authenticator:ire,autocomplete:ore,avatar:are,badge:sre,breadcrumbs:lre,button:ure,card:cre,checkbox:dre,checkboxfield:fre,collection:pre,copy:hre,countrycodeselect:mre,divider:gre,dropzone:vre,field:Sre,fieldcontrol:bre,fieldgroup:Ere,fieldmessages:Cre,fieldset:wre,fileuploader:xre,flex:Ire,heading:Tre,icon:_re,highlightmatch:Are,image:Pre,inappmessaging:kre,input:Rre,link:Nre,liveness:Ore,loader:Dre,menu:Mre,message:Fre,pagination:Lre,passwordfield:Ure,phonenumberfield:$re,placeholder:jre,radio:Bre,radiogroup:zre,rating:Hre,searchfield:Wre,select:Vre,selectfield:Kre,sliderfield:Gre,stepperfield:qre,storagemanager:Qre,switchfield:Yre,table:Xre,tabs:Jre,text:Zre,textareafield:eoe,textfield:toe,togglebutton:noe,togglebuttongroup:roe},ioe={default:{variable:{value:`'InterVariable', 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif`},static:{value:`'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif`}}},si={xxxs:{value:"0.375rem"},xxs:{value:"0.5rem"},xs:{value:"0.75rem"},small:{value:"0.875rem"},medium:{value:"1rem"},large:{value:"1.25rem"},xl:{value:"1.5rem"},xxl:{value:"2rem"},xxxl:{value:"2.5rem"},xxxxl:{value:"3rem"}},aoe={hairline:{value:100},thin:{value:200},light:{value:300},normal:{value:400},medium:{value:500},semibold:{value:600},bold:{value:700},extrabold:{value:800},black:{value:900}},soe={small:{value:"1.25"},medium:{value:"1.5"},large:{value:"2"}},loe={0:{value:"0"},10:{value:"0.1"},20:{value:"0.2"},30:{value:"0.3"},40:{value:"0.4"},50:{value:"0.5"},60:{value:"0.6"},70:{value:"0.7"},80:{value:"0.8"},90:{value:"0.9"},100:{value:"1"}},uoe={small:{value:"1px"},medium:{value:"2px"},large:{value:"3px"}},coe={small:{value:"1px"},medium:{value:"2px"},large:{value:"3px"}},doe={xs:{value:"0.125rem"},small:{value:"0.25rem"},medium:{value:"0.5rem"},large:{value:"1rem"},xl:{value:"2rem"},xxl:{value:"4rem"},xxxl:{value:"8rem"}},foe={small:{value:{offsetX:"0px",offsetY:"2px",blurRadius:"4px",color:"{colors.shadow.tertiary.value}"}},medium:{value:{offsetX:"0px",offsetY:"2px",blurRadius:"6px",color:"{colors.shadow.secondary.value}"}},large:{value:{offsetX:"0px",offsetY:"4px",blurRadius:"12px",color:"{colors.shadow.primary.value}"}}},li={zero:{value:"0"},xxxs:{value:"0.25rem"},xxs:{value:"0.375rem"},xs:{value:"0.5rem"},small:{value:"0.75rem"},medium:{value:"1rem"},large:{value:"1.5rem"},xl:{value:"2.0rem"},xxl:{value:"3.0rem"},xxxl:{value:"4.5rem"},relative:{xxxs:{value:"0.25em"},xxs:{value:"0.375em"},xs:{value:"0.5em"},small:{value:"0.75em"},medium:{value:"1em"},large:{value:"1.5em"},xl:{value:"2.0em"},xxl:{value:"3.0em"},xxxl:{value:"4.5em"},full:{value:"100%"}}},poe={short:{value:"100ms"},medium:{value:"250ms"},long:{value:"500ms"}},hoe={slideX:{small:{value:"translateX(0.5em)"},medium:{value:"translateX(1em)"},large:{value:"translateX(2em)"}}},moe={components:ooe,borderWidths:ere,colors:tre,fonts:ioe,fontSizes:si,fontWeights:aoe,lineHeights:soe,opacities:loe,outlineOffsets:uoe,outlineWidths:coe,radii:doe,shadows:foe,space:li,time:poe,transforms:hoe};si.xxs,si.xs,si.small,si.medium,si.large,si.xl,si.xxl,si.xxxl,li.xxxs,li.xs,li.small,li.medium,li.large,li.xl,li.xxl,li.xxxl;const goe={values:{base:0,small:480,medium:768,large:992,xl:1280,xxl:1536},defaultBreakpoint:"base"},YN={tokens:moe,breakpoints:goe,name:"default-theme"};function voe(e,t,n,r){var o=-1,i=e==null?0:e.length;for(r&&i&&(n=e[++o]);++o{const r=Fg(n)?n.toString():fO({value:n});return`${cO(t)}:${r}; `}).join(" ")}function hE({path:e=[]}){return`${cO([Rie,...e].join(" "))}`}const Pie=["offsetX","offsetY","blurRadius","spreadRadius","color"];function fO(e){const{value:t}=e;return $i(t)?NT(t):kT(t)?Pie.map(n=>NT(kT(e)?e[n]:t[n])).join(" "):t}function Fg(e){return mr(e)&&ji(e,"value")}function kT(e){return mr(e)&&ji(e,"offsetX")}function NT(e){if(!e)return"";if(dO(e)){const t=e.replace(/\{|\}/g,"").replace(".value","").split(".");return`var(--${hE({path:t})})`}return e}const OT=({token:e,path:t})=>{const n=`--${hE({path:t})}`,{value:r}=e,o=fO(e);return{name:n,original:r,path:t,value:o,toString:()=>`var(${n})`}};function PS({tokens:e,path:t=[],setupToken:n}){if(ji(e,"value"))return n({token:e,path:t});const r={};for(const o in e)if(ji(e,o)){const i=e[o],a=mr(i)?i:{value:i};r[o]=PS({tokens:a,path:t.concat(o),setupToken:n})}return r}function kS(e,t){t=t||[];for(var n in e)ji(e,n)&&(mr(e[n])&&"value"in e[n]?t.push(e[n]):mr(e[n])&&kS(e[n],t));return t}function pO(e,t,n){if(e==null)return{};var r,o,i,a,s,l,u=e[0]||{},c=1,d=e.length;for(n=n||[],typeof u!="object"&&(u={});c`--${n}:${r}; `).join(" ")}} `:""}function aa(e,t){let n="";const{_modifiers:r={},_element:o={},_vars:i,...a}=t;if(Object.keys(a).length){const[s,l]=GQ(a,u=>u.startsWith(":")||u.startsWith("["));Object.entries(s).forEach(([u,c])=>{const{_modifiers:d={},_element:f={},_vars:p,...h}=c;n+=`${e}${u} { ${RS(h)} } `,n+=DT(`${e}${u}`,p)}),n+=`${e} { ${RS(l)} } `}return n+=DT(e,i),Object.entries(r).forEach(([s,l])=>{l&&Object.keys(l).length&&(n+=aa(`${e}--${s}`,l))}),Object.entries(o).forEach(([s,l])=>{l&&Object.keys(l).length&&(n+=aa(`${e}__${s}`,l))}),n}function kie({theme:e,components:t}){let n="";const{tokens:r,name:o,breakpoints:i}=e;return t.forEach(({name:a,theme:s,overrides:l})=>{const u=`amplify-${a}`,c=`[data-amplify-theme="${o}"] .${u}`,d=Wr(s)?s(r):s;n+=aa(c,d),l&&l.forEach(f=>{const p=Wr(f.theme)?f.theme(r):f.theme;if("mediaQuery"in f&&(n+=`@media (${f.mediaQuery}) { ${aa(c,p)} }`),"breakpoint"in f){const h=i.values[f.breakpoint];n+=` @media (min-width: ${h}px) { ${aa(c,p)} }`}"selector"in f&&(n+=aa(`${f.selector} .${u}`,p)),"colorMode"in f&&(n+=` @media (prefers-color-scheme: ${f.colorMode}) { ${aa(`[data-amplify-theme="${o}"][data-amplify-color-mode="system"] .${u}`,p)} } `,n+=aa(`[data-amplify-theme="${o}"][data-amplify-color-mode="${f.colorMode}"] .${u}`,p))})}),n}function MT({keys:e,value:t}){return e.reduce((n,r)=>({...n,[r]:{value:`{colors.${t}.${r}.value}`}}),{})}function Nie({animations:e,tokens:t}){let n="";return Object.entries(e).forEach(([r,o])=>{n+=` @keyframes ${r} {`,Object.entries(o).forEach(([i,a])=>{n+=` ${i} { `;const s=Wr(a)?a(t):a;n+=RS(s),n+=` }`}),n+=` }`}),n}function mE(e,t=YN){const n=pO([{},t,{...e,components:{}}]),{primaryColor:r,secondaryColor:o}=n;$i(r)&&(n.tokens.colors.primary=MT({keys:Object.keys(n.tokens.colors[r]),value:r})),$i(o)&&(n.tokens.colors.secondary=MT({keys:Object.keys(n.tokens.colors[o]),value:o}));const i=PS({tokens:n.tokens,setupToken:OT}),{breakpoints:a,name:s}=n;let l=`[data-amplify-theme="${s}"] { `+kS(i).map(c=>`${c.name}: ${c.value};`).join(` `)+` } `;e!=null&&e.components&&(l+=kie({theme:{...n,tokens:i},components:e.components}));let u=[];return n.animations&&(l+=Nie({animations:n.animations,tokens:i})),n.overrides&&(u=n.overrides.map(c=>{const d=PS({tokens:c.tokens,setupToken:OT}),f=kS(d).map(p=>`${p.name}: ${p.value};`).join(` `);if("selector"in c&&(l+=` ${c.selector} { ${f} } `),"mediaQuery"in c&&(l+=` @media (${c.mediaQuery}) { [data-amplify-theme="${s}"] { ${f} } } `),"breakpoint"in c){const p=n.breakpoints.values[c.breakpoint];l+=` @media (min-width: ${p}px) { [data-amplify-theme="${s}"] { ${f} } } `}return"colorMode"in c&&(l+=` @media (prefers-color-scheme: ${c.colorMode}) { [data-amplify-theme="${s}"][data-amplify-color-mode="system"] { ${f} color-scheme: ${c.colorMode}; } } `,l+=` [data-amplify-theme="${s}"][data-amplify-color-mode="${c.colorMode}"] { ${f} color-scheme: ${c.colorMode}; } `),{...c,tokens:d}})),{tokens:i,breakpoints:a,name:s,cssText:l,containerProps:({colorMode:c}={})=>({"data-amplify-theme":s,"data-amplify-color-mode":c}),overrides:u}}const ee=(...e)=>{const t=[];for(const n of e)if(n){if($i(n)){t.push(n);continue}if(typeof n=="number"){t.push(n.toString());continue}if(Array.isArray(n)){t.push(ee(...n));continue}if(mr(n)){if(n.toString!==Object.prototype.toString&&n.toString()!=="[object Object]"){t.push(n.toString());continue}for(const r in n)ji(n,r)&&n[r]&&t.push(r)}}return t.join(" ")},L={Accordion:"amplify-accordion",AccordionItem:"amplify-accordion__item",AccordionItemTrigger:"amplify-accordion__item__trigger",AccordionItemContent:"amplify-accordion__item__content",AccordionItemIcon:"amplify-accordion__item__icon",Alert:"amplify-alert",AlertIcon:"amplify-alert__icon",AlertHeading:"amplify-alert__heading",AlertBody:"amplify-alert__body",AlertDismiss:"amplify-alert__dismiss",Button:"amplify-button",ButtonLoaderWrapper:"amplify-button__loader-wrapper",Card:"amplify-card",CountryCodeSelect:"amplify-countrycodeselect",DialCodeSelect:"amplify-dialcodeselect",Divider:"amplify-divider",Field:"amplify-field",FieldDescription:"amplify-field__description",FieldErrorMessage:"amplify-field__error-message",FieldGroup:"amplify-field-group",FieldGroupControl:"amplify-field-group__control",FieldGroupOuterEnd:"amplify-field-group__outer-end",FieldGroupOuterStart:"amplify-field-group__outer-start",FieldGroupInnerEnd:"amplify-field-group__inner-end",FieldGroupInnerStart:"amplify-field-group__inner-start",FieldGroupHasInnerEnd:"amplify-field-group--has-inner-end",FieldGroupHasInnerStart:"amplify-field-group--has-inner-start",FieldShowPassword:"amplify-field__show-password",FieldGroupFieldWrapper:"amplify-field-group__field-wrapper",Fieldset:"amplify-fieldset",FieldsetLegend:"amplify-fieldset__legend",Flex:"amplify-flex",Grid:"amplify-grid",Heading:"amplify-heading",Icon:"amplify-icon",Image:"amplify-image",Input:"amplify-input",Label:"amplify-label",Link:"amplify-link",Loader:"amplify-loader",LoaderLabel:"amplify-loader__label",PasswordField:"amplify-passwordfield",PhoneNumberField:"amplify-phonenumberfield",Radio:"amplify-radio",RadioButton:"amplify-radio__button",RadioInput:"amplify-radio__input",RadioLabel:"amplify-radio__label",RadioGroupField:"amplify-radiogroupfield",RadioGroup:"amplify-radiogroup",Select:"amplify-select",SelectField:"amplify-selectfield",SelectWrapper:"amplify-select__wrapper",SelectIcon:"amplify-select__icon",SwitchField:"amplify-switchfield",SwitchLabel:"amplify-switch__label",SwitchThumb:"amplify-switch__thumb",SwitchTrack:"amplify-switch__track",SwitchWrapper:"amplify-switch__wrapper",Table:"amplify-table",TableCaption:"amplify-table__caption",TableBody:"amplify-table__body",TableTd:"amplify-table__td",TableTh:"amplify-table__th",TableHead:"amplify-table__head",TableRow:"amplify-table__row",Tabs:"amplify-tabs",TabsList:"amplify-tabs__list",TabsItem:"amplify-tabs__item",TabsPanel:"amplify-tabs__panel",Text:"amplify-text",TextField:"amplify-textfield",VisuallyHidden:"amplify-visually-hidden"},Oie=({componentName:e,packageName:t,version:n})=>{const r=[`ui-${t}`,n];switch(e){case"AIConversation":{ni({...NQ,additionalDetails:[[e],r]});break}case"Authenticator":{ni({...DQ,additionalDetails:[[e],r]});break}case"ChangePassword":case"DeleteUser":{ni({...OQ,additionalDetails:[["AccountSettings"],r]});break}case"FileUploader":{ni({...MQ,additionalDetails:[[e],r]});break}case"InAppMessaging":{ni({...FQ,additionalDetails:[[e],r]});break}case"LocationSearch":{ni({...LQ,additionalDetails:[[e],r]});break}case"MapView":{ni({...UQ,additionalDetails:[[e],r]});break}case"StorageManager":{ni({...$Q,additionalDetails:[[e],r]});break}case"StorageBrowser":{ni({...jQ,additionalDetails:[[e],r]});break}}return KQ},NS=O.createContext(null),Die=e=>(t,n)=>{DN(t,n,e)};function hO({children:e}){const[t,n]=O.useState("configuring");O.useEffect(()=>{Sf().then(()=>{n("authenticated")}).catch(()=>{n("unauthenticated")})},[]);const r=b.useContext(NS),o=IQ(Jne),i=b.useMemo(()=>r||{authStatus:t,service:o},[t,r,o]),{service:a}=i;return b.useEffect(()=>qQ(a,Die({onSignIn:()=>{n("authenticated")},onSignOut:()=>{n("unauthenticated")}})),[a]),O.createElement(NS.Provider,{value:i},e)}const Mie="`useAuthenticator` must be used inside an `Authenticator.Provider`.",Fie=["confirmResetPassword","confirmSignIn","confirmSignUp","confirmVerifyUser","forceNewPassword","forgotPassword","selectMfaType","setupEmail","setupTotp","signIn","signUp","verifyUser"],Lie=e=>Fie.some(t=>t===e),Uie=()=>!1;function $ie(e,t){return e.length!==t.length?!1:e.every((n,r)=>{const o=t[r];return WQ(n,o)||VQ(n,o)?!0:n===o})}const jie=e=>(t,n)=>{const r=e(t),o=e(n);return $ie(r,o)},Bie=e=>{var t,n,r;return{...(r=(n=(t=Kd(e))==null?void 0:t.formFields)==null?void 0:n.setupTotp)==null?void 0:r.QR}},zie=e=>e.flatMap(([t,n])=>({name:t,...n})),Hie=(e={})=>e&&Object.entries(e).map(([t,n])=>!$i(n)||!t?{}:{name:t,label:n,type:"radio",value:n}),Wie=(e=[])=>e.map(t=>({name:"mfa_type",label:mn.getMfaTypeLabelByValue(t),type:"radio",value:t})),Vie=(e,t)=>Lie(e)?e==="verifyUser"?Hie(Kd(t).unverifiedUserAttributes):e==="selectMfaType"?Wie(Kd(t).allowedMfaTypes):zie(_Y(e,t)):[];function et(e){const t=O.useContext(NS);if(!t)throw new Error(Mie);const{service:n}=t,{send:r}=n,o=b.useCallback(m=>({...ZQ({send:r,state:m})}),[r]),i=e?jie(e):Uie,{authStatus:a}=t,s=kQ(n,o,i),{route:l,totpSecretCode:u,user:c,...d}=s,f=n.getSnapshot(),p=l==="setupTotp"?Bie(f):null,h=Vie(l,f);return{...d,authStatus:a,route:l,totpSecretCode:u,user:c,fields:h,QRFields:p}}const Kie=({route:e})=>[e];function Gie(e){const{route:t,initializeMachine:n}=et(Kie),r=O.useRef(!1);O.useEffect(()=>{!r.current&&t==="setup"&&(n(e),r.current=!0)},[n,t,e])}const qie=({shouldWarn:e,message:t})=>{b.useEffect(()=>{},[e,t])};function Qie({componentName:e,packageName:t,version:n}){b.useEffect(()=>Oie({componentName:e,packageName:t,version:n}),[e,t,n])}const mO=b.createContext({theme:mE(),colorMode:void 0}),gE={alignContent:"alignContent",alignItems:"alignItems",alignSelf:"alignSelf",area:"gridArea",aspectRatio:"aspectRatio",autoColumns:"gridAutoColumns",autoFlow:"gridAutoFlow",autoRows:"gridAutoRows",backgroundColor:"backgroundColor",backgroundImage:"backgroundImage",basis:"flexBasis",border:"border",borderRadius:"borderRadius",borderColor:"borderColor",borderWidth:"borderWidth",borderStyle:"borderStyle",bottom:"bottom",boxShadow:"boxShadow",color:"color",column:"gridColumn",columnEnd:"gridColumnEnd",columnGap:"columnGap",columnSpan:"gridColumn",columnStart:"gridColumnStart",direction:"flexDirection",display:"display",flex:"flex",fontFamily:"fontFamily",fontSize:"fontSize",fontStyle:"fontStyle",fontWeight:"fontWeight",gap:"gap",grow:"flexGrow",height:"height",justifyContent:"justifyContent",left:"left",letterSpacing:"letterSpacing",lineHeight:"lineHeight",margin:"margin",marginBlock:"marginBlock",marginBlockEnd:"marginBlockEnd",marginBlockStart:"marginBlockStart",marginBottom:"marginBlockEnd",marginInline:"marginInline",marginInlineEnd:"marginInlineEnd",marginInlineStart:"marginInlineStart",marginLeft:"marginInlineStart",marginRight:"marginInlineEnd",marginTop:"marginBlockStart",maxHeight:"maxHeight",maxWidth:"maxWidth",minHeight:"minHeight",minWidth:"minWidth",objectFit:"objectFit",objectPosition:"objectPosition",opacity:"opacity",order:"order",overflow:"overflow",padding:"padding",paddingBlock:"paddingBlock",paddingBlockEnd:"paddingBlockEnd",paddingBlockStart:"paddingBlockStart",paddingBottom:"paddingBlockEnd",paddingInline:"paddingInline",paddingInlineEnd:"paddingInlineEnd",paddingInlineStart:"paddingInlineStart",paddingLeft:"paddingInlineStart",paddingRight:"paddingInlineEnd",paddingTop:"paddingBlockStart",position:"position",resize:"resize",right:"right",row:"gridRow",rowEnd:"gridRowEnd",rowGap:"rowGap",rowSpan:"gridRow",rowStart:"gridRowStart",shrink:"flexShrink",templateAreas:"gridTemplateAreas",templateColumns:"gridTemplateColumns",templateRows:"gridTemplateRows",textAlign:"textAlign",textDecoration:"textDecoration",textTransform:"textTransform",top:"top",transform:"transform",transformOrigin:"transformOrigin",width:"width",whiteSpace:"whiteSpace",wrap:"flexWrap"},vE={Alert:{dismissButtonLabel:"Dismiss alert"},PhoneNumberField:{countryCodeLabel:"Country code"},PasswordField:{passwordIsHidden:"Password is hidden",passwordIsShown:"Password is shown",showPassword:"Show password"}},OS={backgroundColor:"colors",borderColor:"colors",borderWidth:"borderWidths",color:"colors",borderRadius:"radii",fontSize:"fontSizes",fontWeight:"fontWeights",fontFamily:"fonts",lineHeight:"lineHeights",opacity:"opacities",boxShadow:"shadows",transform:"transforms",left:"space",right:"space",top:"space",bottom:"space",height:"space",width:"space",letterSpacing:"space",margin:"space",marginBlock:"space",marginBlockEnd:"space",marginBlockStart:"space",marginInline:"space",marginInlineEnd:"space",marginInlineStart:"space",marginLeft:"space",marginRight:"space",marginTop:"space",marginBottom:"space",maxHeight:"space",maxWidth:"space",minHeight:"space",minWidth:"space",padding:"space",paddingBlock:"space",paddingBlockEnd:"space",paddingBlockStart:"space",paddingInline:"space",paddingInlineEnd:"space",paddingInlineStart:"space",paddingLeft:"space",paddingRight:"space",paddingTop:"space",paddingBottom:"space",gap:"space",columnGap:"space",rowGap:"space"},Yie=e=>e in OS,gO=e=>typeof e=="string"&&e.length===0,FT=e=>e==null||gO(e),Lg=e=>Object.keys(e),yE=(e,t,n)=>{if(typeof t!="string")return t;if(t.includes(" "))return t.split(" ").map(r=>yE(e,r,n)).join(" ");if(Yie(e)){const r=t.split("."),o=OS[e];let i=n[o];for(let a=0;a{const r=n[e];if(r!==void 0)return r;const o=Lg(t).sort((a,s)=>t[s]-t[a]),i=o.slice(o.indexOf(e));for(const a of i){const s=n[a];if(s!==void 0)return s}return null},Jie=e=>Lg(e).reduce((t,n)=>n in YN.breakpoints.values?{...t,[n]:e[n]}:t,{}),Zie=({breakpoint:e,breakpoints:t,values:n})=>{let r={};const o=Lg(t).sort((i,a)=>t[i]-t[a]);return Array.isArray(n)?n.forEach((i,a)=>{r[o[a]]=i}):typeof n=="object"&&(r=Jie(n)),Xie({breakpoint:e,breakpoints:t,values:r})},eae=({breakpoints:e})=>{const t=Lg(e).sort((n,r)=>e[r]-e[n]);return t.map((n,r)=>{let o="";const i=e[n],a=t[r-1],s=a?e[a]-1:null;return i>=0&&(o=`(min-width: ${i}px)`),s!==null&&(o&&(o+=" and "),o+=`(max-width: ${s}px)`),{breakpoint:n,query:o,maxWidth:s,minWidth:i}})},tae=typeof window>"u"?b.useEffect:b.useLayoutEffect,nae=({breakpoints:e,defaultBreakpoint:t})=>{const r=typeof window<"u"&&typeof window.matchMedia<"u"?window.matchMedia:null,o=b.useMemo(()=>eae({breakpoints:e}),[e]),[i,a]=b.useState(t),s=b.useCallback((l,u)=>{l&&a(u)},[a]);return tae(()=>{if(!r)return;const l=o.map(({query:u,breakpoint:c})=>{const d=r(u);s(d.matches,c);const f=p=>{p.matches&&a(c)};return d.addEventListener("change",f),()=>d.removeEventListener("change",f)});return()=>{l.forEach(u=>u())}},[e,a,r,o]),b.useDebugValue(i,l=>l),i},rae=e=>typeof e>"u"||typeof e.theme>"u"?mE():e.theme,Xa=()=>{const e=b.useContext(mO);return rae(e)},oae=({value:e,propKey:t,tokens:n})=>Fg(e)?e.toString():$i(e)?$i(t)?yE(t,e,n):e:null,iae=e=>e==="auto"||typeof e=="number"&&!isNaN(e)||typeof e=="string"&&!isNaN(parseFloat(e)),wy=e=>e==="auto"?"auto":`span ${e}`,LT=e=>iae(e)?wy(e):Array.isArray(e)?e.map(t=>wy(t)):typeof e=="object"&&e!=null?Object.entries(e).reduce((t,[n,r])=>({...t,[n]:wy(r)}),{}):null,aae=e=>{const{rowSpan:t,columnSpan:n,row:r,column:o,...i}=e,{rowFromSpanValue:a,columnFromSpanValue:s}=b.useMemo(()=>({rowFromSpanValue:LT(t),columnFromSpanValue:LT(n)}),[t,n]);return{row:FT(r)?a:r,column:FT(o)?s:o,...i}},sae=e=>e in gE,lae=({props:e={},style:t={},breakpoint:n,breakpoints:r,tokens:o})=>{const i={};return Object.keys(e).filter(a=>e[a]!==null).forEach(a=>{if(sae(a)){const s=e[a];if(s==null||gO(s))return;const l=gE[a];let u="";Fg(s)?u=s.toString():typeof s=="string"?u=yE(a,s,o):typeof s=="number"?u=s:typeof s=="object"&&(u=oae({propKey:a,tokens:o,value:Zie({values:s,breakpoint:n,breakpoints:r})})),t={...t,[l]:u}}else typeof e[a]<"u"&&(i[a]=e[a])}),{propStyles:t,nonStyleProps:i}},uae=(e,t)=>{const{breakpoints:{values:n,defaultBreakpoint:r},tokens:o}=Xa(),i=nae({breakpoints:n,defaultBreakpoint:r}),a=aae(e);return b.useMemo(()=>lae({props:a,style:t,breakpoint:i,breakpoints:n,tokens:o}),[a,t,n,i,o])},ye=e=>b.forwardRef(e),cae=({as:e="div",children:t,testId:n,ariaLabel:r,isDisabled:o,style:i,inert:a,...s},l)=>{const{propStyles:u,nonStyleProps:c}=uae(s,i);return b.createElement(e,{"aria-label":r,"data-testid":n,disabled:o,ref:l,inert:a?"":null,style:u,...c},t)},Y=ye(cae);Y.displayName="View";const Ic={minX:0,minY:0,width:24,height:24},dae=({className:e,as:t="svg",fill:n="currentColor",pathData:r,viewBox:o=Ic,children:i,paths:a,...s},l)=>{const u=o.minX?o.minX:Ic.minX,c=o.minY?o.minY:Ic.minY,d=o.width?o.width:Ic.width,f=o.height?o.height:Ic.height;let p;return i&&(p=i),a&&(p=a.map((h,m)=>b.createElement("path",{...h,key:m}))),r&&(p=b.createElement("path",{d:r,fill:n})),b.createElement(Y,{as:t,className:ee(L.Icon,e),ref:l,viewBox:`${u} ${c} ${d} ${f}`,...s},p)},vO=ye(dae);vO.displayName="Icon";const fae=b.createContext({});function Pf(e){const t=b.useContext(fae);if(e&&t)return t[e]}const pae=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z",fill:"currentColor"})))},hae=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM13 17H11V15H13V17ZM13 13H11V7H13V13Z",fill:"currentColor"})))},mae=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M11 7H13V9H11V7ZM11 11H13V17H11V11ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20Z",fill:"currentColor"})))},gae=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M1 21H23L12 2L1 21ZM13 18H11V16H13V18ZM13 14H11V10H13V14Z",fill:"currentColor"})))},yO=({variation:e,ariaHidden:t,ariaLabel:n,role:r})=>{const o=Pf("alert");let i;switch(e){case"info":i=(o==null?void 0:o.info)??b.createElement(mae,{"aria-hidden":t,"aria-label":n,role:r});break;case"error":i=(o==null?void 0:o.error)??b.createElement(hae,{"aria-hidden":t,"aria-label":n,role:r});break;case"warning":i=(o==null?void 0:o.warning)??b.createElement(gae,{"aria-hidden":t,"aria-label":n,role:r});break;case"success":i=(o==null?void 0:o.success)??b.createElement(pae,{"aria-hidden":t,"aria-label":n,role:r});break}return i?b.createElement("span",{className:L.AlertIcon},i):null};yO.displayName="AlertIcon";const vae=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},yae="amplify-id",Sae=Rh.useId||(()=>{});let bae=0;const zi=e=>{const[t,n]=b.useState(Sae());return vae(()=>{e||n(r=>r??String(bae++))},[e]),e??(t?`${yae}-${t}`:"")},SO=b.createContext({isFieldsetDisabled:!1}),ic=()=>b.useContext(SO),Eae=({className:e,children:t,...n},r)=>b.createElement(Y,{className:ee(L.Flex,e),ref:r,...n},t),ve=ye(Eae);ve.displayName="Flex";const wae="linear-empty",Cae="linear-filled",xae="circular-empty",Iae="circular-filled",UT=8,DS=42,Tp=2*DS*Math.PI,Tae=({className:e,filledColor:t,emptyColor:n,size:r,variation:o,isDeterminate:i=!1,isPercentageTextHidden:a=!1,percentage:s=0,...l},u)=>{s=Math.min(s,100),s=Math.max(s,0);const c=`${s}%`,d=ee(L.Loader,Fe(L.Loader,r),Fe(L.Loader,o),zt(L.Loader,"determinate",i),e),f=b.createElement("g",null,b.createElement("line",{x1:"0",x2:"100%",y1:"50%",y2:"50%",style:{stroke:String(n)},"data-testid":wae}),b.createElement("line",{x1:"0",x2:i?c:"100%",y1:"50%",y2:"50%",style:{stroke:i&&s===0?"none":t?String(t):void 0},"data-testid":Cae}),i?b.createElement("text",{"aria-live":"polite",className:ee(L.LoaderLabel,a?L.VisuallyHidden:null),x:`${-1+s}%`,y:"200%"},c):null),p=b.createElement("g",null,b.createElement("circle",{cx:"50%",cy:"50%",r:`${DS}%`,strokeWidth:`${UT}%`,style:{stroke:String(n)},"data-testid":xae}),b.createElement("circle",{cx:"50%",cy:"50%",r:`${DS}%`,strokeWidth:`${UT}%`,style:{stroke:String(t),strokeDasharray:i?`${Tp}% ${Tp}%`:void 0,strokeDashoffset:i?`${Tp-Tp*s/100}%`:void 0},"data-testid":Iae}),i?b.createElement("text",{"aria-live":"polite",className:ee(L.LoaderLabel,a?L.VisuallyHidden:null),x:"130%",y:"80%"},c):null);return b.createElement(Y,{as:"svg","aria-valuenow":i?s:void 0,className:d,ref:u,role:"progressbar",...l},o==="linear"?f:p)},Kl=ye(Tae);Kl.displayName="Loader";const Aae=["link","primary",void 0],_ae=({className:e,children:t,colorTheme:n,isFullWidth:r=!1,isDisabled:o,isLoading:i,loadingText:a="",size:s,type:l="button",variation:u,...c},d)=>{const f=Aae.includes(u)&&n?`${u??"outlined"}--${n}`:void 0,{isFieldsetDisabled:p}=ic(),h=p||(o??i??c.disabled),m=ee(L.Button,L.FieldGroupControl,Fe(L.Button,u),Fe(L.Button,f),Fe(L.Button,s),zt(L.Button,"disabled",h),zt(L.Button,"loading",i),zt(L.Button,"fullwidth",r),e);return b.createElement(Y,{ref:d,as:"button",className:m,isDisabled:h,type:l,...c},i?b.createElement(ve,{as:"span",className:L.ButtonLoaderWrapper},b.createElement(Kl,{size:s}),a||null):t)},pt=ye(_ae);pt.displayName="Button";const Rae=e=>{const{className:t,size:n,...r}=e;return b.createElement(Y,{as:"span",width:n??"1em",height:n??"1em",className:ee(L.Icon,t),...r},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n?{width:n,height:n}:void 0},b.createElement("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z",fill:"currentColor"})))},Pae=({as:e="p",className:t,children:n,isTruncated:r,variation:o,...i},a)=>{const s=ee(L.Text,Fe(L.Text,o),zt(L.Text,"truncated",r),t);return b.createElement(Y,{as:e,className:s,ref:a,...i},n)},Je=ye(Pae);Je.displayName="Text";const kae="qa-field-description",Ug=({descriptiveText:e,labelHidden:t,...n})=>e?b.createElement(Je,{"data-testid":kae,className:ee(L.FieldDescription,{[L.VisuallyHidden]:t}),...n},e):null;Ug.displayName="FieldDescription";const kf=({errorMessage:e,hasError:t,...n})=>t&&e?b.createElement(Je,{className:L.FieldErrorMessage,...n},e):null;kf.displayName="FieldErrorMessage";const Nae=({children:e,className:t,visuallyHidden:n,...r},o)=>b.createElement(Y,{as:"label",className:ee(L.Label,t,{[L.VisuallyHidden]:n}),ref:o,...r},e),Ii=ye(Nae);Ii.displayName="Label";const Oae=({buttonRef:e,children:t,className:n,dismissButtonLabel:r=vE.Alert.dismissButtonLabel,hasIcon:o=!0,heading:i,isDismissible:a=!1,onDismiss:s,variation:l,...u},c)=>{const[d,f]=b.useState(!1),p=Pf("alert"),h=b.useCallback(()=>{f(!d),Wr(s)&&s()},[f,s,d]);return d?null:b.createElement(ve,{className:ee(L.Alert,n,Fe(L.Alert,l)),ref:c,role:"alert",...u},o&&b.createElement(yO,{variation:l,ariaHidden:!0}),b.createElement(Y,{flex:"1"},i&&b.createElement(Y,{className:L.AlertHeading},i),b.createElement(Y,{className:L.AlertBody},t)),a&&b.createElement(pt,{ariaLabel:r,variation:"link",className:L.AlertDismiss,onClick:h,ref:e},(p==null?void 0:p.close)??b.createElement(Rae,{"aria-hidden":"true"})))},bO=ye(Oae);bO.displayName="Alert";const As=(e,t)=>e&&t?`${e}-${t}`:void 0,Dae=({children:e,className:t,innerEndComponent:n,innerStartComponent:r,orientation:o="horizontal",outerEndComponent:i,outerStartComponent:a,variation:s,...l},u)=>{const c=r!=null,d=n!=null,f=c?L.FieldGroupHasInnerStart:null,p=d?L.FieldGroupHasInnerEnd:null,h=ee(L.FieldGroup,f,p,Fe(L.FieldGroup,o),t);return b.createElement(ve,{className:h,ref:u,...l},a&&b.createElement(Y,{className:ee(L.FieldGroupOuterStart,Fe(L.FieldGroupOuterStart,s))},a),b.createElement(Y,{className:ee(L.FieldGroupFieldWrapper,Fe(L.FieldGroupFieldWrapper,o))},r&&b.createElement(Y,{className:L.FieldGroupInnerStart},r),e,n&&b.createElement(Y,{className:L.FieldGroupInnerEnd},n)),i&&b.createElement(Y,{className:ee(L.FieldGroupOuterEnd,Fe(L.FieldGroupOuterEnd,s))},i))},EO=ye(Dae);EO.displayName="FieldGroup";const Mae=({autoComplete:e,checked:t,className:n,defaultChecked:r,defaultValue:o,id:i,isDisabled:a,isReadOnly:s,isRequired:l,size:u,type:c="text",hasError:d=!1,value:f,variation:p,...h},m)=>{const E=ee(L.Input,L.FieldGroupControl,Fe(L.Input,p),zt(L.Input,"error",d),Fe(L.Input,u),n),{isFieldsetDisabled:g}=ic();return b.createElement(Y,{"aria-invalid":d,as:"input",autoComplete:e,checked:t,className:E,defaultChecked:r,defaultValue:o,isDisabled:g||a,id:i,readOnly:s,ref:m,required:l,type:c,value:f,...h})},_s=ye(Mae);_s.displayName="Input";const Fae=e=>e in gE,wO=e=>{const t={styleProps:{},rest:{}};return Object.keys(e).forEach(n=>{Fae(n)?t.styleProps={...t.styleProps,[n]:e[n]}:t.rest={...t.rest,[n]:e[n]}}),t},SE=e=>{const t=e.filter(n=>n!==void 0).join(" ");return t.length>0?t:void 0},bE="error",EE="description",Lae=(e,t)=>{const{className:n,descriptiveText:r,errorMessage:o,hasError:i=!1,id:a,innerEndComponent:s,innerStartComponent:l,label:u,labelHidden:c=!1,outerEndComponent:d,outerStartComponent:f,size:p,testId:h,variation:m,inputStyles:E,...g}=e,y=zi(a),v=zi(),S=r?As(v,EE):void 0,x=i?As(v,bE):void 0,I=SE([x,S]),{styleProps:T,rest:A}=wO(g);return b.createElement(ve,{className:ee(L.Field,Fe(L.Field,p),L.TextField,n),testId:h,...T},b.createElement(Ii,{htmlFor:y,visuallyHidden:c},u),b.createElement(Ug,{id:S,labelHidden:c,descriptiveText:r}),b.createElement(EO,{outerStartComponent:f,outerEndComponent:d,innerStartComponent:l,innerEndComponent:s,variation:m},b.createElement(_s,{"aria-describedby":I,hasError:i,id:y,ref:t,size:p,variation:m,...E,...A})),b.createElement(kf,{id:x,hasError:i,errorMessage:o}))},$g=ye(Lae);$g.displayName="TextField";const Uae=({className:e,...t},n)=>b.createElement(Y,{as:"img",ref:n,className:ee(L.Image,e),...t}),ds=ye(Uae);ds.displayName="Image";const $ae=({as:e="a",children:t,className:n,isExternal:r,...o},i)=>b.createElement(Y,{as:e,className:ee(L.Link,n),ref:i,rel:r?"noopener noreferrer":void 0,target:r?"_blank":void 0,...o},t),wE=ye($ae);wE.displayName="Link";const jae=({className:e,children:t,variation:n,...r},o)=>b.createElement(Y,{className:ee(L.Card,Fe(L.Card,n),e),ref:o,...r},t),kn=ye(jae);kn.displayName="Card";const Bae=({as:e="span",children:t,className:n,...r},o)=>b.createElement(Y,{as:e,className:ee(L.VisuallyHidden,n),ref:o,...r},t),wu=ye(Bae);wu.displayName="VisuallyHidden";const zae=({className:e,children:t,...n},r)=>b.createElement(Y,{className:ee(L.Grid,e),ref:r,...n},t),CE=ye(zae);CE.displayName="Grid";const Hae=({className:e,orientation:t="horizontal",size:n,label:r,...o},i)=>{const a=ee(L.Divider,Fe(L.Divider,t),Fe(L.Divider,n),e);return b.createElement(Y,{"aria-orientation":t,as:"hr",className:a,"data-label":r,ref:i,...o})},Gd=ye(Hae);Gd.displayName="Divider";const xE=b.createContext(void 0),CO=b.createContext(void 0),Wae=({children:e,className:t,value:n,as:r="details",...o},i)=>{var l;const a=b.useContext(xE),s=n?(l=a==null?void 0:a.value)==null?void 0:l.includes(n):void 0;return b.createElement(CO.Provider,{value:n},b.createElement(Y,{...o,open:s,ref:i,as:r,className:ee(L.AccordionItem,t)},e))},IE=ye(Wae);IE.displayName="AccordionItem";const Vae=({className:e,children:t,...n},r)=>b.createElement(Y,{...n,className:ee(L.AccordionItemContent,e),ref:r},t),TE=ye(Vae);TE.displayName="Accordion.Content";const Kae=({children:e,className:t,...n},r)=>{const o=b.useContext(xE),i=b.useContext(CO),a=s=>{Wr(n.onClick)&&n.onClick(s),o!=null&&o.setValue&&i&&(s.preventDefault(),o.setValue(i))};return b.createElement(Y,{...n,ref:r,as:"summary",className:ee(L.AccordionItemTrigger,t),onClick:a},e)},AE=ye(Kae);AE.displayName="Accordion.Trigger";const xO=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M16.59 8.58984L12 13.1698L7.41 8.58984L6 9.99984L12 15.9998L18 9.99984L16.59 8.58984Z",fill:"currentColor"})))},Gae=({className:e,as:t="span",...n},r)=>{const o=Pf("accordion");return b.createElement(Y,{...n,ref:r,as:t,className:ee(L.AccordionItemIcon,e),"aria-hidden":"true"},(o==null?void 0:o.more)??b.createElement(xO,null))},_E=ye(Gae);_E.displayName="Accordion.Icon";const qae=({children:e,className:t,defaultValue:n,allowMultiple:r,preventCollapse:o,onValueChange:i,testId:a,value:s,...l},u)=>{const c=s!==void 0,[d,f]=b.useState(()=>c?s:n??[]),p=c?s:d,h=b.useCallback(E=>{let g;p.includes(E)?g=!o||p.length>1?p.filter(y=>y!==E):p:g=r?[...p,E]:[E],Wr(i)&&i(g),c||f(g)},[i,p,c,r,o]),m=b.useMemo(()=>({value:p,setValue:h}),[p,h]);return b.createElement(xE.Provider,{value:m},b.createElement(Y,{...l,className:ee(L.Accordion,t),"data-testid":a,ref:u},e))},RE=ye(qae);RE.displayName="Accordion.Container";const Qae=({items:e,...t},n)=>b.createElement(RE,{ref:n,...t},e==null?void 0:e.map(({content:r,trigger:o,value:i})=>b.createElement(IE,{key:i,value:i},b.createElement(AE,null,o,b.createElement(_E,null)),b.createElement(TE,null,r)))),IO=Object.assign(ye(Qae),{Container:RE,Content:TE,Icon:_E,Item:IE,Trigger:AE});IO.displayName="Accordion";const Yae=({children:e,className:t,isDisabled:n,legend:r,legendHidden:o,size:i,testId:a,variation:s="plain",...l},u)=>{const{isFieldsetDisabled:c}=ic(),d=c||n,f=b.useMemo(()=>({isFieldsetDisabled:d}),[d]),p=ee(L.Fieldset,Fe(L.Fieldset,s),Fe(L.Fieldset,i),t),h=ee(L.FieldsetLegend,Fe(L.FieldsetLegend,i),{[L.VisuallyHidden]:o});return b.createElement(SO.Provider,{value:f},b.createElement(ve,{as:"fieldset",className:p,ref:u,disabled:d,testId:a,...l},b.createElement(wu,{as:"legend"},r),b.createElement(Y,{as:"div","aria-hidden":"true",className:h},r),e))},PE=ye(Yae);PE.displayName="Fieldset";const Xae={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"},Jae=({className:e,children:t,isTruncated:n,level:r=6,...o},i)=>b.createElement(Y,{as:Xae[r],className:ee(L.Heading,Fe(L.Heading,r),zt(L.Heading,"truncated",n),e),ref:i,...o},t),Zn=ye(Jae);Zn.displayName="Heading";var Zae=b.createContext(void 0),ese=e=>{const{dir:t,children:n}=e;return C.jsx(Zae.Provider,{value:t,children:n})};const tse=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M12 6.0002C15.79 6.0002 19.17 8.1302 20.82 11.5002C20.23 12.7202 19.4 13.7702 18.41 14.6202L19.82 16.0302C21.21 14.8002 22.31 13.2602 23 11.5002C21.27 7.1102 17 4.0002 12 4.0002C10.73 4.0002 9.51 4.2002 8.36 4.5702L10.01 6.2202C10.66 6.0902 11.32 6.0002 12 6.0002ZM10.93 7.14019L13 9.2102C13.57 9.4602 14.03 9.9202 14.28 10.4902L16.35 12.5602C16.43 12.2202 16.49 11.8602 16.49 11.4902C16.5 9.0102 14.48 7.0002 12 7.0002C11.63 7.0002 11.28 7.05019 10.93 7.14019ZM2.01 3.8702L4.69 6.5502C3.06 7.8302 1.77 9.5302 1 11.5002C2.73 15.8902 7 19.0002 12 19.0002C13.52 19.0002 14.98 18.7102 16.32 18.1802L19.74 21.6002L21.15 20.1902L3.42 2.4502L2.01 3.8702ZM9.51 11.3702L12.12 13.9802C12.08 13.9902 12.04 14.0002 12 14.0002C10.62 14.0002 9.5 12.8802 9.5 11.5002C9.5 11.4502 9.51 11.4202 9.51 11.3702V11.3702ZM6.11 7.97019L7.86 9.7202C7.63 10.2702 7.5 10.8702 7.5 11.5002C7.5 13.9802 9.52 16.0002 12 16.0002C12.63 16.0002 13.23 15.8702 13.77 15.6402L14.75 16.6202C13.87 16.8602 12.95 17.0002 12 17.0002C8.21 17.0002 4.83 14.8702 3.18 11.5002C3.88 10.0702 4.9 8.89019 6.11 7.97019Z",fill:"currentColor"})))},nse=e=>{const{className:t,...n}=e;return b.createElement(Y,{as:"span",width:"1em",height:"1em",className:ee(L.Icon,t),...n},b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z",fill:"currentColor"})))},{passwordIsHidden:rse,passwordIsShown:ose,showPassword:ise}=vE.PasswordField,ase=({fieldType:e,passwordIsHiddenLabel:t=rse,passwordIsShownLabel:n=ose,showPasswordButtonLabel:r=ise,size:o,hasError:i,...a},s)=>{const l=Pf("passwordField"),u=ee(L.FieldShowPassword,zt(L.FieldShowPassword,"error",i)),c=e==="password"?(l==null?void 0:l.visibility)??b.createElement(nse,{"aria-hidden":"true"}):(l==null?void 0:l.visibilityOff)??b.createElement(tse,{"aria-hidden":"true"});return b.createElement(pt,{"aria-checked":e!=="password",ariaLabel:r,className:u,colorTheme:i?"error":void 0,ref:s,role:"switch",size:o,...a},b.createElement(wu,{"aria-live":"polite"},e==="password"?t:n),c)},TO=ye(ase);TO.displayName="ShowPasswordButton";const sse=({autoComplete:e="current-password",label:t,className:n,hideShowPassword:r=!1,passwordIsHiddenLabel:o,passwordIsShownLabel:i,showPasswordButtonLabel:a,showPasswordButtonRef:s,size:l,hasError:u,...c},d)=>{const[f,p]=b.useState("password"),h=b.useCallback(()=>{p(f==="password"?"text":"password")},[p,f]);return b.createElement($g,{autoComplete:e,outerEndComponent:r?null:b.createElement(TO,{fieldType:f,onClick:h,passwordIsHiddenLabel:o,passwordIsShownLabel:i,ref:s,size:l,showPasswordButtonLabel:a,hasError:u}),size:l,type:f,label:t,className:ee(L.PasswordField,n),ref:d,hasError:u,...c})},AO=ye(sse);AO.displayName="PasswordField";const lse=({autoComplete:e,className:t,size:n,variation:r,value:o,defaultValue:i,hasError:a,icon:s,iconColor:l,children:u,placeholder:c,isDisabled:d,isRequired:f,isMultiple:p=!1,selectSize:h=1,...m},E)=>{const g="",y=o===void 0&&i===void 0&&c,v=p||h>1,S=ee(L.Select,L.FieldGroupControl,Fe(L.Select,n),Fe(L.Select,r),zt(L.Select,"error",a),zt(L.Select,"expanded",v),t),x=Pf("select"),{isFieldsetDisabled:I}=ic();return b.createElement(Y,{className:L.SelectWrapper},b.createElement(Y,{"aria-invalid":a,as:"select",autoComplete:e,value:o,defaultValue:y?g:i,isDisabled:I||d,multiple:p,size:h,required:f,className:S,ref:E,...m},c&&b.createElement("option",{value:""},c),u),v?null:b.createElement(ve,{className:ee(L.SelectIcon,Fe(L.SelectIcon,n)),color:l,"aria-hidden":"true"},s??(x==null?void 0:x.expand)??b.createElement(xO,null)))},_O=ye(lse);_O.displayName="Select";const use=({children:e,options:t})=>e?(t!=null&&t.length&&console.warn("Amplify UI: component defaults to rendering children over `options`. When using the `options` prop, omit children."),e):t==null?void 0:t.map((n,r)=>b.createElement("option",{label:n,value:n,key:`${n}-${r}`},n)),cse=(e,t)=>{const{children:n,className:r,descriptiveText:o,errorMessage:i,hasError:a=!1,id:s,label:l,labelHidden:u=!1,options:c,size:d,testId:f,inputStyles:p,...h}=e,m=zi(s),E=zi(),g=o?As(E,EE):void 0,y=a?As(E,bE):void 0,v=SE([y,g]),{styleProps:S,rest:x}=wO(h);return b.createElement(ve,{className:ee(L.Field,Fe(L.Field,d),L.SelectField,r),testId:f,...S},b.createElement(Ii,{htmlFor:m,visuallyHidden:u},l),b.createElement(Ug,{id:g,labelHidden:u,descriptiveText:o}),b.createElement(_O,{"aria-describedby":v,hasError:a,id:m,ref:t,size:d,...x,...p},use({children:n,options:c})),b.createElement(kf,{id:y,hasError:a,errorMessage:i}))},RO=ye(cse);RO.displayName="SelectField";const dse=({className:e,dialCodeList:t,isReadOnly:n,...r},o)=>{const i=t??MN,a=b.useMemo(()=>i.map(s=>b.createElement("option",{key:s,value:s,disabled:n},s)),[i,n]);return b.createElement(RO,{"aria-disabled":n,autoComplete:"tel-country-code",className:ee(L.CountryCodeSelect,L.DialCodeSelect,e),labelHidden:!0,ref:o,...r},a)},PO=ye(dse);PO.displayName="DialCodeSelect";const fse=({autoComplete:e="tel-national",className:t,defaultDialCode:n,dialCodeLabel:r=vE.PhoneNumberField.countryCodeLabel,dialCodeList:o,dialCodeName:i,dialCodeRef:a,hasError:s,isDisabled:l,isReadOnly:u,onDialCodeChange:c,onInput:d,size:f,variation:p,...h},m)=>b.createElement($g,{outerStartComponent:b.createElement(PO,{defaultValue:n,dialCodeList:o,className:t,hasError:s,isDisabled:l,isReadOnly:u,label:r,name:i,onChange:c,ref:a,size:f,variation:p}),autoComplete:e,className:ee(L.PhoneNumberField,t),hasError:s,isDisabled:l,isReadOnly:u,onInput:d,ref:m,size:f,type:"tel",variation:p,...h}),kO=ye(fse);kO.displayName="PhoneNumberField";const pse={name:"default"},NO=O.createContext(pse),hse=()=>b.useContext(NO),mse=({children:e,className:t,id:n,isDisabled:r=!1,testId:o,value:i,labelPosition:a,...s},l)=>{const{currentValue:u,defaultValue:c,name:d,hasError:f,isGroupDisabled:p=!1,isRequired:h,isReadOnly:m,onChange:E,size:g,labelPosition:y}=hse(),{isFieldsetDisabled:v}=ic(),S=v||p||r||m&&c!==i,x=u!==void 0?i===u:void 0,I=c!==void 0?i===c:void 0,T=a||y;return b.createElement(ve,{as:"label",className:ee(L.Radio,zt(L.Radio,"disabled",S),T?`amplify-label-${T}`:null,t)},e&&b.createElement(Je,{as:"span",className:ee(L.RadioLabel,zt(L.RadioLabel,"disabled",S))},e),b.createElement(_s,{checked:x,className:ee(L.VisuallyHidden,L.RadioInput),defaultChecked:I,hasError:f,id:n,isDisabled:S,isReadOnly:m,isRequired:h,onChange:E,ref:l,type:"radio",name:d,value:i,...s}),b.createElement(ve,{"aria-hidden":"true",as:"span",className:ee(L.RadioButton,Fe(L.RadioButton,g)),testId:o}))},kE=ye(mse);kE.displayName="Radio";const gse=({children:e,className:t,defaultValue:n,descriptiveText:r,errorMessage:o,hasError:i=!1,id:a,isDisabled:s,isRequired:l,isReadOnly:u,legend:c,legendHidden:d=!1,labelPosition:f,onChange:p,name:h,size:m,testId:E,value:g,variation:y,...v},S)=>{const x=zi(a),I=zi(),T=r?As(I,EE):void 0,A=i?As(I,bE):void 0,R=SE([A,T]),w=As(E,L.RadioGroup),_=b.useMemo(()=>({currentValue:g,defaultValue:n,hasError:i,isRequired:l,isReadOnly:u,isGroupDisabled:s,onChange:p,size:m,name:h,labelPosition:f}),[n,i,s,l,u,p,m,h,g,f]);return b.createElement(PE,{className:ee(L.Field,Fe(L.Field,m),L.RadioGroupField,t),isDisabled:s,legend:c,legendHidden:d,ref:S,role:"radiogroup",size:m,testId:E,variation:y,...v},b.createElement(Ug,{id:T,labelHidden:d,descriptiveText:r}),b.createElement(ve,{"aria-describedby":R,className:L.RadioGroup,id:x,testId:w},b.createElement(NO.Provider,{value:_},e)),b.createElement(kf,{id:A,hasError:i,errorMessage:o}))},NE=ye(gse);NE.displayName="RadioGroupField";const vse=e=>{const{onChange:t,isChecked:n,defaultChecked:r,isDisabled:o}=e,i=typeof n<"u",[a,s]=b.useState(i?n:!!r),[l,u]=b.useState(!1),c=b.useCallback(d=>{if(o){d.preventDefault();return}Wr(t)&&t(d),s(d.target.checked)},[t,o]);return i&&a!==n&&s(n),{isOn:a,changeHandler:c,isFocused:l,setIsFocused:u}},yse=({className:e,defaultChecked:t,id:n,isChecked:r,isDisabled:o,isLabelHidden:i,label:a,labelPosition:s,name:l,onChange:u,size:c,thumbColor:d,trackCheckedColor:f,trackColor:p,value:h,hasError:m,errorMessage:E,...g},y)=>{const{isOn:v,changeHandler:S,isFocused:x,setIsFocused:I}=vse({onChange:u,isChecked:r,defaultChecked:t,isDisabled:o}),{isFieldsetDisabled:T}=ic(),A=T||o,R=zi(n),w=ee(L.SwitchTrack,zt(L.SwitchTrack,"checked",v),zt(L.SwitchTrack,"disabled",A),zt(L.SwitchTrack,"focused",x),zt(L.SwitchTrack,"error",m)),_=ee(L.SwitchThumb,zt(L.SwitchThumb,"checked",v),zt(L.SwitchThumb,"disabled",A));return b.createElement(ve,{className:ee(L.SwitchField,Fe(L.SwitchField,c),s?`amplify-label-${s}`:null,e),ref:y,...g},b.createElement(wu,null,b.createElement(_s,{role:"switch",type:"checkbox",id:R,onChange:S,disabled:o,name:l,checked:v,value:h,onFocus:()=>{I(!0)},onBlur:()=>{I(!1)}})),b.createElement(Ii,{htmlFor:R,className:ee(L.SwitchWrapper,Fe(L.SwitchWrapper,s))},i?b.createElement(wu,{as:"span",className:L.SwitchLabel},a):b.createElement(Y,{as:"span",className:L.SwitchLabel},a),b.createElement(Y,{as:"span",className:w,backgroundColor:v?f:p},b.createElement(Y,{as:"span",className:_,"data-checked":v,"data-disabled":A,backgroundColor:d}))),b.createElement(kf,{hasError:m,errorMessage:E}))},MS=ye(yse);MS.displayName="SwitchField";const Sse=({caption:e,children:t,className:n,highlightOnHover:r=!1,size:o,variation:i,...a},s)=>{const l=ee(L.Table,Fe(L.Table,o),Fe(L.Table,i),n);return b.createElement(Y,{as:"table",className:l,"data-highlightonhover":r,ref:s,...a},e&&b.createElement(Y,{as:"caption",className:L.TableCaption},e),t)},rl=ye(Sse);rl.displayName="Table";const bse=({children:e,className:t,...n},r)=>b.createElement(Y,{as:"tbody",className:ee(L.TableBody,t),ref:r,...n},e),ol=ye(bse);ol.displayName="TableBody";const Ese=({as:e="td",children:t,className:n,...r},o)=>b.createElement(Y,{as:e,className:ee(e==="td"?L.TableTd:L.TableTh,n),ref:o,...r},t),G=ye(Ese);G.displayName="TableCell";const wse=({children:e,className:t,...n},r)=>b.createElement(Y,{as:"thead",className:ee(L.TableHead,t),ref:r,...n},e),il=ye(wse);il.displayName="TableHead";const Cse=({children:e,className:t,...n},r)=>b.createElement(Y,{as:"tr",className:ee(L.TableRow,t),ref:r,...n},e),wt=ye(Cse);wt.displayName="TableRow";const jg=b.createContext({groupId:"",activeTab:"",setActiveTab:()=>{}}),OO="-",xse=({className:e,value:t,children:n,onClick:r,as:o="button",role:i="tab",...a},s)=>{const{activeTab:l,setActiveTab:u,groupId:c}=b.useContext(jg);let d=t;typeof d=="string"&&(d=d.replace(" ",OO));const f=l===t,p=h=>{Wr(r)&&(r==null||r(h)),u(t)};return b.createElement(Y,{...a,role:i,as:o,id:`${c}-tab-${d}`,"aria-selected":f,"aria-controls":`${c}-panel-${d}`,tabIndex:f?void 0:-1,className:ee(L.TabsItem,zt(L.TabsItem,"active",l===t),e),ref:s,onClick:p},n)},OE=ye(xse);OE.displayName="Tabs.Item";const Ise=e=>b.isValidElement(e),Tse=({className:e,children:t,indicatorPosition:n,spacing:r,role:o="tablist",...i},a)=>{const s=b.useRef(null),{activeTab:l,setActiveTab:u}=b.useContext(jg);b.useImperativeHandle(a,()=>s.current);const c=b.useMemo(()=>b.Children.toArray(t).map(m=>{if(m&&Ise(m))return m.props.value}).filter(m=>!!m),[t]),d=c.indexOf(l),f=b.useCallback(()=>{var y;let m=d===c.length-1?0:d+1;const E=((y=s.current)==null?void 0:y.querySelectorAll("button"))??[];for(;E[m].disabled;)m===c.length-1?m=0:m++;const g=c[m];if(g){u(g);const v=E[m];v==null||v.focus(),v==null||v.click()}},[d,u,c]),p=b.useCallback(()=>{var y;let m=d===0?c.length-1:d-1;const E=((y=s.current)==null?void 0:y.querySelectorAll("button"))??[];for(;E[m].disabled;)m===0?m=c.length-1:m--;const g=c[m];if(g){u(g);const v=E[m];v==null||v.focus(),v==null||v.click()}},[d,u,c]),h=b.useCallback(m=>{switch(m.key){case"ArrowLeft":m.preventDefault(),m.stopPropagation(),p();break;case"ArrowUp":case"ArrowRight":m.preventDefault(),m.stopPropagation(),f();break}},[p,f]);return b.createElement(Y,{...i,role:o,onKeyDown:h,className:ee(L.TabsList,n?Fe(L.TabsList,n):null,r?Fe(L.TabsList,r):null,e),ref:s},t)},DE=ye(Tse);DE.displayName="Tabs.List";const Ase=({className:e,value:t,children:n,role:r="tabpanel",...o},i)=>{const{activeTab:a,isLazy:s,groupId:l}=b.useContext(jg);if(s&&a!==t)return null;let u=t;return typeof u=="string"&&(u=u.replace(" ",OO)),b.createElement(Y,{...o,role:r,id:`${l}-panel-${u}`,"aria-labelledby":`${l}-tab-${u}`,className:ee(L.TabsPanel,zt(L.TabsPanel,"active",a===t),e),ref:i},n)},ME=ye(Ase);ME.displayName="Tabs.Panel";const _se=({children:e,defaultValue:t,className:n,value:r,onValueChange:o,isLazy:i,...a},s)=>{const l=zi(),u=r!==void 0,[c,d]=b.useState(()=>u?r:t),f=u?r:c??"",p=b.useCallback(m=>{Wr(o)&&o(m),u||d(m)},[o,u]),h=b.useMemo(()=>({activeTab:f,isLazy:i,setActiveTab:p,groupId:l}),[f,p,i,l]);return b.createElement(jg.Provider,{value:h},b.createElement(Y,{...a,ref:s,className:ee(n,L.Tabs)},e))},FE=ye(_se);FE.displayName="Tabs.Container";const Rse=({items:e,indicatorPosition:t,justifyContent:n,spacing:r,...o},i)=>b.createElement(FE,{...o,ref:i},b.createElement(DE,{indicatorPosition:t,justifyContent:n,spacing:r},e==null?void 0:e.map(({value:a,label:s,content:l,...u})=>b.createElement(OE,{...u,key:a,value:a},s))),e==null?void 0:e.map(({value:a,content:s,isDisabled:l})=>b.createElement(ME,{key:a,value:a,isDisabled:l},s))),sa=Object.assign(ye(Rse),{Item:OE,List:DE,Panel:ME,Container:FE});sa.displayName="Tabs";const Cy=({errors:e,id:t,dataAttr:n})=>{if(!((e==null?void 0:e.length)>0))return null;const r=n?{[n]:!0}:{};return O.createElement(Y,{...r,id:t},e.map(o=>O.createElement(Je,{key:o,role:"alert",variation:"error"},oe(o))))},Pse="6.11.2",kse=({message:e,shouldWarn:t})=>{qie({message:e,shouldWarn:t})},DO=b.createContext(null),Er=()=>{const e=b.useContext(DO);if(!e)throw new Error("`useCustomComponents` cannot be used outside of a `CustomComponentsContext.Provider`");return e},Nse=e=>{const t=new FormData(e.target);return Object.fromEntries(t)};function Gr(){const{submitForm:e,updateBlur:t,updateForm:n}=et(a=>[a.submitForm,a.updateBlur,a.updateForm]),r=b.useCallback(({target:{name:a}})=>{t({name:a})},[t]),o=b.useCallback(({target:{checked:a,name:s,type:l,value:u}})=>{n({name:s,value:l==="checkbox"&&!a?void 0:u})},[n]),i=b.useCallback(a=>{a.preventDefault(),e(Nse(a))},[e]);return{handleBlur:r,handleChange:o,handleSubmit:i}}const qr=()=>{const{error:e}=et(t=>[t.error]);return O.createElement(O.Fragment,null,e?O.createElement(bO,{variation:"error",isDismissible:!0},oe(e)):null)};function Ose({autocomplete:e,dialCode:t,name:n,type:r,...o}){const{validationErrors:i}=et(({validationErrors:c})=>[c]),a=b.useMemo(()=>oY(i[n]),[n,i]),s=(a==null?void 0:a.length)>0,l=zi(),u=s?l:void 0;return r==="tel"?b.createElement(b.Fragment,null,b.createElement(kO,{...o,name:n,defaultDialCode:t,dialCodeName:"country_code",autoComplete:e,hasError:s,"aria-describedby":u}),b.createElement(Cy,{dataAttr:"data-amplify-sign-up-errors",errors:a,id:l})):r==="password"?b.createElement(b.Fragment,null,b.createElement(AO,{...o,name:n,autoCapitalize:"off",autoComplete:e,hasError:s,"aria-describedby":u}),b.createElement(Cy,{dataAttr:"data-amplify-sign-up-errors",errors:a,id:l})):b.createElement(b.Fragment,null,b.createElement($g,{...o,name:n,autoCapitalize:"off",autoComplete:e,hasError:s,type:r,"aria-describedby":u}),b.createElement(Cy,{dataAttr:"data-amplify-sign-up-errors",errors:a,id:l}))}function ei(){const{fields:e}=et(({route:n})=>[n]),t=b.useRef(e.map((n,r)=>b.createElement(Ose,{key:r,...n}))).current;return b.createElement(b.Fragment,null,t)}function Io({children:e,className:t,variation:n="default"}){et(({route:i})=>[i]);const{components:{Header:r,Footer:o}}=Er();return O.createElement(Y,{className:t,"data-amplify-authenticator":"","data-variation":n},O.createElement(Y,{"data-amplify-container":""},O.createElement(r,null),O.createElement(Y,{"data-amplify-router":"","data-amplify-router-content":void 0},e),O.createElement(o,null)))}const{getDeliveryMessageText:Dse,getDeliveryMethodText:Mse,getConfirmingText:Fse,getConfirmText:Lse,getResendCodeText:Use}=mn;function Bs({className:e,variation:t}){const{isPending:n,resendCode:r,codeDeliveryDetails:o}=et(u=>[u.isPending,u.resendCode,u.codeDeliveryDetails]),{handleChange:i,handleSubmit:a}=Gr(),{components:{ConfirmSignUp:{Header:s=Bs.Header,Footer:l=Bs.Footer}}}=Er();return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmsignup":"",method:"post",onChange:i,onSubmit:a},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},O.createElement(s,null),O.createElement(ve,{direction:"column"},O.createElement(Je,{className:"amplify-authenticator__subtitle"},Dse(o)),O.createElement(ei,null),O.createElement(qr,null),O.createElement(pt,{variation:"primary",isDisabled:n,type:"submit",loadingText:Fse(),isLoading:n},Lse()),O.createElement(pt,{onClick:r,type:"button"},Use())),O.createElement(l,null))))}const $se=()=>{const{codeDeliveryDetails:e}=et(t=>[t.codeDeliveryDetails]);return O.createElement(Zn,{level:4},Mse(e))};Bs.Header=$se;Bs.Footer=function(){return null};const{getChangePasswordText:MO,getChangingText:jse,getBackToSignInText:Bse}=mn,So=({className:e,variation:t})=>{const{isPending:n,toSignIn:r}=et(c=>[c.isPending,c.toSignIn]),{handleBlur:o,handleChange:i,handleSubmit:a}=Gr(),{components:{ForceNewPassword:{FormFields:s=So.FormFields,Header:l=So.Header,Footer:u=So.Footer}}}=Er();return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-forcenewpassword":"",method:"post",onChange:i,onSubmit:a,onBlur:o},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},O.createElement(l,null),O.createElement(s,null),O.createElement(qr,null),O.createElement(pt,{isDisabled:n,type:"submit",variation:"primary",isLoading:n,loadingText:jse()},MO()),O.createElement(pt,{onClick:r,type:"button",variation:"link",size:"small"},Bse()),O.createElement(u,null))))};So.FormFields=function(){return O.createElement(ei,null)};So.Header=function(){return O.createElement(Zn,{level:4},MO())};So.Footer=function(){return null};var Nf={},zse=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},FO={},wr={};let LE;const Hse=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];wr.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};wr.getSymbolTotalCodewords=function(t){return Hse[t]};wr.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};wr.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');LE=t};wr.isKanjiModeEnabled=function(){return typeof LE<"u"};wr.toSJIS=function(t){return LE(t)};var Bg={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,o){if(e.isValid(r))return r;try{return t(r)}catch{return o}}})(Bg);function LO(){this.buffer=[],this.length=0}LO.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Wse=LO;function Of(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Of.prototype.set=function(e,t,n,r){const o=e*this.size+t;this.data[o]=n,r&&(this.reservedBit[o]=!0)};Of.prototype.get=function(e,t){return this.data[e*this.size+t]};Of.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Of.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Vse=Of,UO={};(function(e){const t=wr.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const o=Math.floor(r/7)+2,i=t(r),a=i===145?26:Math.ceil((i-13)/(2*o-2))*2,s=[i-7];for(let l=1;l=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let a=0,s=0,l=0,u=null,c=null;for(let d=0;d=5&&(a+=t.N1+(s-5)),u=p,s=1),p=o.get(f,d),p===c?l++:(l>=5&&(a+=t.N1+(l-5)),c=p,l=1)}s>=5&&(a+=t.N1+(s-5)),l>=5&&(a+=t.N1+(l-5))}return a},e.getPenaltyN2=function(o){const i=o.size;let a=0;for(let s=0;s=10&&(s===1488||s===93)&&a++,l=l<<1&2047|o.get(c,u),c>=10&&(l===1488||l===93)&&a++}return a*t.N3},e.getPenaltyN4=function(o){let i=0;const a=o.data.length;for(let l=0;l=0;){const a=i[0];for(let l=0;l0){const i=new Uint8Array(this.degree);return i.set(r,o),i}return r};var Gse=UE,HO={},Ja={},$E={};$E.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var ti={};const WO="[0-9]+",qse="[A-Z $%*+\\-./:]+";let qd="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";qd=qd.replace(/u/g,"\\u");const Qse="(?:(?![A-Z0-9 $%*+\\-./:]|"+qd+`)(?:.|[\r ]))+`;ti.KANJI=new RegExp(qd,"g");ti.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ti.BYTE=new RegExp(Qse,"g");ti.NUMERIC=new RegExp(WO,"g");ti.ALPHANUMERIC=new RegExp(qse,"g");const Yse=new RegExp("^"+qd+"$"),Xse=new RegExp("^"+WO+"$"),Jse=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ti.testKanji=function(t){return Yse.test(t)};ti.testNumeric=function(t){return Xse.test(t)};ti.testAlphanumeric=function(t){return Jse.test(t)};(function(e){const t=$E,n=ti;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,a){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?i.ccBits[0]:a<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,a){if(e.isValid(i))return i;try{return r(i)}catch{return a}}})(Ja);(function(e){const t=wr,n=zg,r=Bg,o=Ja,i=$E,a=7973,s=t.getBCHDigit(a);function l(f,p,h){for(let m=1;m<=40;m++)if(p<=e.getCapacity(m,h,f))return m}function u(f,p){return o.getCharCountIndicator(f,p)+4}function c(f,p){let h=0;return f.forEach(function(m){const E=u(m.mode,p);h+=E+m.getBitsLength()}),h}function d(f,p){for(let h=1;h<=40;h++)if(c(f,h)<=e.getCapacity(h,p,o.MIXED))return h}e.from=function(p,h){return i.isValid(p)?parseInt(p,10):h},e.getCapacity=function(p,h,m){if(!i.isValid(p))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=o.BYTE);const E=t.getSymbolTotalCodewords(p),g=n.getTotalCodewordsCount(p,h),y=(E-g)*8;if(m===o.MIXED)return y;const v=y-u(m,p);switch(m){case o.NUMERIC:return Math.floor(v/10*3);case o.ALPHANUMERIC:return Math.floor(v/11*2);case o.KANJI:return Math.floor(v/13);case o.BYTE:default:return Math.floor(v/8)}},e.getBestVersionForData=function(p,h){let m;const E=r.from(h,r.M);if(Array.isArray(p)){if(p.length>1)return d(p,E);if(p.length===0)return 1;m=p[0]}else m=p;return l(m.mode,m.getLength(),E)},e.getEncodedBits=function(p){if(!i.isValid(p)||p<7)throw new Error("Invalid QR Code version");let h=p<<12;for(;t.getBCHDigit(h)-s>=0;)h^=a<=0;)o^=KO<0&&(r=this.data.substr(n),o=parseInt(r,10),t.put(o,i*3+1))};var tle=Cu;const nle=Ja,xy=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function xu(e){this.mode=nle.ALPHANUMERIC,this.data=e}xu.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};xu.prototype.getLength=function(){return this.data.length};xu.prototype.getBitsLength=function(){return xu.getBitsLength(this.data.length)};xu.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=xy.indexOf(this.data[n])*45;r+=xy.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(xy.indexOf(this.data[n]),6)};var rle=xu,ole=function(t){for(var n=[],r=t.length,o=0;o=55296&&i<=56319&&r>o+1){var a=t.charCodeAt(o+1);a>=56320&&a<=57343&&(i=(i-55296)*1024+a-56320+65536,o+=1)}if(i<128){n.push(i);continue}if(i<2048){n.push(i>>6|192),n.push(i&63|128);continue}if(i<55296||i>=57344&&i<65536){n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128);continue}if(i>=65536&&i<=1114111){n.push(i>>18|240),n.push(i>>12&63|128),n.push(i>>6&63|128),n.push(i&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const ile=ole,ale=Ja;function Iu(e){this.mode=ale.BYTE,this.data=new Uint8Array(ile(e))}Iu.getBitsLength=function(t){return t*8};Iu.prototype.getLength=function(){return this.data.length};Iu.prototype.getBitsLength=function(){return Iu.getBitsLength(this.data.length)};Iu.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var cle=Tu,qO={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,r,o){var i={},a={};a[r]=0;var s=t.PriorityQueue.make();s.push(r,0);for(var l,u,c,d,f,p,h,m,E;!s.empty();){l=s.pop(),u=l.value,d=l.cost,f=n[u]||{};for(c in f)f.hasOwnProperty(c)&&(p=f[c],h=d+p,m=a[c],E=typeof a[c]>"u",(E||m>h)&&(a[c]=h,s.push(c,h),i[c]=u))}if(typeof o<"u"&&typeof a[o]>"u"){var g=["Could not find a path from ",r," to ",o,"."].join("");throw new Error(g)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var o=[],i=r;i;)o.push(i),n[i],i=n[i];return o.reverse(),o},find_path:function(n,r,o){var i=t.single_source_shortest_paths(n,r,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,o={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);return o.queue=[],o.sorter=n.sorter||r.default_sorter,o},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var o={value:n,cost:r};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(qO);var dle=qO.exports;(function(e){const t=Ja,n=tle,r=rle,o=sle,i=cle,a=ti,s=wr,l=dle;function u(g){return unescape(encodeURIComponent(g)).length}function c(g,y,v){const S=[];let x;for(;(x=g.exec(v))!==null;)S.push({data:x[0],index:x.index,mode:y,length:x[0].length});return S}function d(g){const y=c(a.NUMERIC,t.NUMERIC,g),v=c(a.ALPHANUMERIC,t.ALPHANUMERIC,g);let S,x;return s.isKanjiModeEnabled()?(S=c(a.BYTE,t.BYTE,g),x=c(a.KANJI,t.KANJI,g)):(S=c(a.BYTE_KANJI,t.BYTE,g),x=[]),y.concat(v,S,x).sort(function(T,A){return T.index-A.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function f(g,y){switch(y){case t.NUMERIC:return n.getBitsLength(g);case t.ALPHANUMERIC:return r.getBitsLength(g);case t.KANJI:return i.getBitsLength(g);case t.BYTE:return o.getBitsLength(g)}}function p(g){return g.reduce(function(y,v){const S=y.length-1>=0?y[y.length-1]:null;return S&&S.mode===v.mode?(y[y.length-1].data+=v.data,y):(y.push(v),y)},[])}function h(g){const y=[];for(let v=0;v=0&&s<=6&&(l===0||l===6)||l>=0&&l<=6&&(s===0||s===6)||s>=2&&s<=4&&l>=2&&l<=4?e.set(i+s,a+l,!0,!0):e.set(i+s,a+l,!1,!0))}}function ble(e){const t=e.size;for(let n=8;n>s&1)===1,e.set(o,i,a,!0),e.set(i,o,a,!0)}function Ay(e,t,n){const r=e.size,o=vle.getEncodedBits(t,n);let i,a;for(i=0;i<15;i++)a=(o>>i&1)===1,i<6?e.set(i,8,a,!0):i<8?e.set(i+1,8,a,!0):e.set(r-15+i,8,a,!0),i<8?e.set(8,r-i-1,a,!0):i<9?e.set(8,15-i-1+1,a,!0):e.set(8,15-i-1,a,!0);e.set(r-8,8,1,!0)}function Cle(e,t){const n=e.size;let r=-1,o=n-1,i=7,a=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let l=0;l<2;l++)if(!e.isReserved(o,s-l)){let u=!1;a>>i&1)===1),e.set(o,s-l,u),i--,i===-1&&(a++,i=7)}if(o+=r,o<0||n<=o){o-=r,r=-r;break}}}function xle(e,t,n){const r=new fle;n.forEach(function(l){r.put(l.mode.bit,4),r.put(l.getLength(),yle.getCharCountIndicator(l.mode,e)),l.write(r)});const o=Wg.getSymbolTotalCodewords(e),i=US.getTotalCodewordsCount(e,t),a=(o-i)*8;for(r.getLengthInBits()+4<=a&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const s=(a-r.getLengthInBits())/8;for(let l=0;l=7&&wle(l,t),Cle(l,a),isNaN(r)&&(r=LS.getBestMask(l,Ay.bind(null,l,n))),LS.applyMask(r,l),Ay(l,n,r),{modules:l,version:t,errorCorrectionLevel:n,maskPattern:r,segments:o}}FO.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=Iy.M,o,i;return typeof n<"u"&&(r=Iy.from(n.errorCorrectionLevel,Iy.M),o=Im.from(n.version),i=LS.from(n.maskPattern),n.toSJISFunc&&Wg.setToSJISFunction(n.toSJISFunc)),Tle(t,o,r,i)};var QO={},jE={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const o=parseInt(r.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const o=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:i,scale:i?4:a,margin:o,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,o){return o.width&&o.width>=r+o.margin*2?o.width/(r+o.margin*2):o.scale},e.getImageWidth=function(r,o){const i=e.getScale(r,o);return Math.floor((r+o.margin*2)*i)},e.qrToImageData=function(r,o,i){const a=o.modules.size,s=o.modules.data,l=e.getScale(a,i),u=Math.floor((a+i.margin*2)*l),c=i.margin*l,d=[i.color.light,i.color.dark];for(let f=0;f=c&&p>=c&&f"u"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(u=r()),l=t.getOptions(l);const c=t.getImageWidth(i.modules.size,l),d=u.getContext("2d"),f=d.createImageData(c,c);return t.qrToImageData(f.data,i,l),n(d,u,c),d.putImageData(f,0,0),u},e.renderToDataURL=function(i,a,s){let l=s;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const u=e.render(i,a,l),c=l.type||"image/png",d=l.rendererOpts||{};return u.toDataURL(c,d.quality)}})(QO);var YO={};const Ale=jE;function BT(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function _y(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function _le(e,t,n){let r="",o=0,i=!1,a=0;for(let s=0;s0&&l>0&&e[s-1]||(r+=i?_y("M",l+n,.5+u+n):_y("m",o,0),o=0,i=!1),l+1':"",u="',c='viewBox="0 0 '+s+" "+s+'"',f=''+l+u+` `;return typeof r=="function"&&r(null,f),f};const Rle=zse,$S=FO,XO=QO,Ple=YO;function BE(e,t,n,r,o){const i=[].slice.call(arguments,1),a=i.length,s=typeof i[a-1]=="function";if(!s&&!Rle())throw new Error("Callback required as last argument");if(s){if(a<2)throw new Error("Too few arguments provided");a===2?(o=n,n=t,t=r=void 0):a===3&&(t.getContext&&typeof o>"u"?(o=r,r=void 0):(o=r,r=n,n=t,t=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(n=t,t=r=void 0):a===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(l,u){try{const c=$S.create(n,r);l(e(c,t,r))}catch(c){u(c)}})}try{const l=$S.create(n,r);o(null,e(l,t,r))}catch(l){o(l)}}Nf.create=$S.create;Nf.toCanvas=BE.bind(null,XO.render);Nf.toDataURL=BE.bind(null,XO.renderToDataURL);Nf.toString=BE.bind(null,function(e,t,n){return Ple.render(e,n)});const{getConfirmText:kle,getConfirmingText:Nle,getBackToSignInText:Ole}=mn,Vg=()=>{const{isPending:e,toSignIn:t}=et(n=>[n.isPending,n.toSignIn]);return O.createElement(ve,{direction:"column"},O.createElement(pt,{isDisabled:e,type:"submit",variation:"primary",isLoading:e,loadingText:Nle()},kle()),O.createElement(pt,{onClick:t,type:"button",variation:"link",size:"small"},Ole()))},Dle=new Lt("SetupTotp-logger"),{getSetupTotpText:Mle,getCopiedText:Fle,getLoadingText:Lle}=mn,Ba=({className:e,variation:t})=>{const{totpSecretCode:n,isPending:r,username:o,QRFields:i}=et(S=>[S.isPending,S.totpSecretCode,S.username]),{handleChange:a,handleSubmit:s}=Gr(),{components:{SetupTotp:{Header:l=Ba.Header,Footer:u=Ba.Footer}}}=Er(),[c,d]=b.useState(!0),[f,p]=b.useState(),[h,m]=b.useState("COPY"),{totpIssuer:E="AWSCognito",totpUsername:g=o}=i??{},y=b.useCallback(async()=>{try{const S=cY(E,g,n),x=await Nf.toDataURL(S);p(x)}catch(S){Dle.error(S)}finally{d(!1)}},[E,g,n]);b.useEffect(()=>{f||y()},[y,f]);const v=()=>{navigator.clipboard.writeText(n),m(Fle())};return b.createElement(Io,{className:e,variation:t},b.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-totp":"",method:"post",onChange:a,onSubmit:s},b.createElement(ve,{as:"fieldset",direction:"column",isDisabled:r},b.createElement(l,null),b.createElement(ve,{direction:"column"},c?b.createElement("p",null,Lle(),"…"):b.createElement("img",{"data-amplify-qrcode":!0,src:f,alt:"qr code",width:"228",height:"228"}),b.createElement(ve,{"data-amplify-copy":!0},b.createElement("div",null,n),b.createElement(ve,{"data-amplify-copy-svg":!0,onClick:v},b.createElement("div",{"data-amplify-copy-tooltip":!0},h),b.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},b.createElement("path",{d:"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z"})))),b.createElement(ei,null),b.createElement(qr,null)),b.createElement(Vg,null),b.createElement(u,null))))};Ba.Header=function(){return b.createElement(Zn,{level:3},Mle())};Ba.Footer=function(){return null};const{getSubmitText:Ule,getSubmittingText:$le}=mn,Kg=e=>{const{cancelButtonSendType:t,cancelButtonText:n,submitButtonText:r}=e,{isPending:o,resendCode:i,skipVerification:a,toSignIn:s}=et(d=>[d.isPending]),l=()=>{switch(t){case"SKIP":a();break;case"RESEND":i();break;case"SIGN_IN":s();break;default:return}},u=o?O.createElement(O.Fragment,null,$le(),"…"):O.createElement(O.Fragment,null,Ule()),c=r??u;return O.createElement(ve,{direction:"column"},O.createElement(pt,{variation:"primary",isDisabled:o,type:"submit"},c),O.createElement(ve,{direction:"column",alignItems:"center"},O.createElement(pt,{onClick:l,type:"button",variation:"link",size:"small"},n)))},jle=()=>O.createElement("svg",{"aria-label":"Apple icon",className:"amplify-icon federated-sign-in-icon",fill:"#000",preserveAspectRatio:"xMidYMid",stroke:"#000",strokeWidth:"0",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},O.createElement("path",{d:"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"})),Ble=()=>O.createElement("svg",{"aria-label":"Google icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 256 262",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},O.createElement("path",{d:"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027",fill:"#4285F4"}),O.createElement("path",{d:"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1",fill:"#34A853"}),O.createElement("path",{d:"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782",fill:"#FBBC05"}),O.createElement("path",{d:"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251",fill:"#EB4335"})),zle=()=>O.createElement(vO,{className:"federated-sign-in-icon",ariaLabel:"Facebook icon",viewBox:{minX:0,minY:0,width:279,height:538},pathData:"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z",fill:"#1877F2"}),Hle=()=>O.createElement("svg",{"aria-label":"Amazon icon",className:"amplify-icon federated-sign-in-icon",viewBox:"0 0 243 264",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid"},O.createElement("path",{d:"M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z",fill:"#F2541B"}),O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z",fill:"#F2541B"})),Rp=e=>{const{icon:t,provider:n,text:r}=e,{toFederatedSignIn:o}=et(),i=s=>{s.preventDefault(),o({provider:n})};let a;return t==="facebook"?a=O.createElement(zle,null):t==="google"?a=O.createElement(Ble,null):t==="amazon"?a=O.createElement(Hle,null):t==="apple"&&(a=O.createElement(jle,null)),O.createElement(pt,{onClick:i,className:"federated-sign-in-button",gap:"1rem"},a,O.createElement(Je,{as:"span"},r))},{getSignInWithFederationText:Pp,getOrText:Wle}=mn;function JO(){const{route:e,socialProviders:t}=et(({route:n,socialProviders:r})=>[n,r]);return t.length===0?null:O.createElement(ve,{direction:"column",padding:"0 0 1rem 0",className:"federated-sign-in-container"},t.map(n=>{switch(n){case"amazon":return O.createElement(Rp,{icon:"amazon",key:n,provider:Ml.Amazon,text:Pp(e,n)});case"apple":return O.createElement(Rp,{icon:"apple",key:n,provider:Ml.Apple,text:Pp(e,n)});case"facebook":return O.createElement(Rp,{icon:"facebook",key:n,provider:Ml.Facebook,text:Pp(e,n)});case"google":return O.createElement(Rp,{icon:"google",key:n,provider:Ml.Google,text:Pp(e,n)});default:console.error(`Authenticator does not support ${n}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`)}}),O.createElement(Gd,{size:"small",label:Wle()}))}const{getSignInText:zT,getSigningInText:Vle,getForgotPasswordText:Kle}=mn;function Hi(){const{isPending:e}=et(i=>[i.isPending]),{handleChange:t,handleSubmit:n}=Gr(),{components:{SignIn:{Header:r=Hi.Header,Footer:o=Hi.Footer}}}=Er();return O.createElement(Y,null,O.createElement(r,null),O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signin":"",method:"post",onSubmit:n,onChange:t},O.createElement(JO,null),O.createElement(ve,{direction:"column"},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:e},O.createElement(wu,null,O.createElement("legend",null,zT())),O.createElement(ei,null)),O.createElement(qr,null),O.createElement(pt,{isDisabled:e,type:"submit",variation:"primary",isLoading:e,loadingText:Vle()},zT()),O.createElement(o,null))))}const Gle=()=>{const{toForgotPassword:e}=et(t=>[t.toForgotPassword]);return O.createElement(Y,{"data-amplify-footer":""},O.createElement(pt,{onClick:e,size:"small",variation:"link"},Kle()))};Hi.Footer=Gle;Hi.Header=function(){return null};const{getCreateAccountText:qle,getCreatingAccountText:Qle}=mn;function bo(){const{hasValidationErrors:e,isPending:t}=et(l=>[l.hasValidationErrors,l.isPending]),{handleChange:n,handleBlur:r,handleSubmit:o}=Gr(),{components:{SignUp:{Header:i=bo.Header,FormFields:a=bo.FormFields,Footer:s=bo.Footer}}}=Er();return O.createElement(Y,null,O.createElement(i,null),O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-signup":"",method:"post",onChange:n,onSubmit:o,onBlur:r},O.createElement(JO,null),O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:t},O.createElement(ve,{direction:"column"},O.createElement(a,null),O.createElement(qr,null)),O.createElement(pt,{isDisabled:e||t,isFullWidth:!0,type:"submit",variation:"primary",isLoading:t,loadingText:Qle()},qle()),O.createElement(s,null))))}bo.Header=function(){return null};bo.FormFields=function(){return O.createElement(ei,null)};bo.Footer=function(){return null};const{getSignInTabText:Yle,getSignUpTabText:Xle}=mn,Jle=({className:e,hideSignUp:t,variation:n})=>{const{route:r,toSignIn:o,toSignUp:i}=et(a=>[a.route,a.toSignIn,a.toSignUp]);return O.createElement(Io,{className:e,variation:n},t?O.createElement(Y,{"data-amplify-router-content":""},r==="signIn"&&O.createElement(Hi,null)):O.createElement(sa.Container,{value:r,isLazy:!0,onValueChange:a=>{a!==r&&(a==="signIn"?o():i())}},O.createElement(sa.List,{spacing:"equal",indicatorPosition:"top"},O.createElement(sa.Item,{value:"signIn"},Yle()),O.createElement(sa.Item,{value:"signUp"},Xle())),O.createElement(sa.Panel,{value:"signIn","data-amplify-router-content":""},O.createElement(Hi,null)),O.createElement(sa.Panel,{value:"signUp","data-amplify-router-content":""},O.createElement(bo,null))))},{getAccountRecoveryInfoText:Zle,getSkipText:eue}=mn,zs=({className:e,variation:t})=>{const{isPending:n}=et(s=>[s.isPending]),{handleChange:r,handleSubmit:o}=Gr(),{components:{ConfirmVerifyUser:{Header:i=zs.Header,Footer:a=zs.Footer}}}=Er();return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmverifyuser":"",method:"post",onChange:r,onSubmit:o},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},O.createElement(i,null),O.createElement(ve,{direction:"column"},O.createElement(ei,null)),O.createElement(qr,null),O.createElement(Kg,{cancelButtonText:eue(),cancelButtonSendType:"SKIP"}),O.createElement(a,null))))};zs.Header=function(){return O.createElement(Zn,{level:3},Zle())};zs.Footer=function(){return null};const{getSkipText:tue,getVerifyText:nue,getVerifyContactText:rue,getAccountRecoveryInfoText:oue}=mn,iue=e=>Object.entries(e).map(([t,n],r)=>{const o=Pg[t].label;return O.createElement(kE,{name:"unverifiedAttr",value:t,key:t,defaultChecked:r===0},oe(o),":"," ",lY(o,n))}),Hs=({className:e,variation:t})=>{const{components:{VerifyUser:{Header:n=Hs.Header,Footer:r=Hs.Footer}}}=Er(),{isPending:o,unverifiedUserAttributes:i}=et(({isPending:c,unverifiedUserAttributes:d})=>[c,d]),{handleChange:a,handleSubmit:s}=Gr(),l=o?O.createElement(O.Fragment,null,"Verifying…"):O.createElement(O.Fragment,null,nue()),u=O.createElement(NE,{legend:rue(),name:"verify_context",isDisabled:o,legendHidden:!0},iue(i));return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-verifyuser":"",method:"post",onChange:a,onSubmit:s},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:o},O.createElement(n,null),u,O.createElement(qr,null),O.createElement(Kg,{cancelButtonText:tue(),cancelButtonSendType:"SKIP",submitButtonText:l}),O.createElement(r,null))))};Hs.Header=function(){return O.createElement(Zn,{level:3},oue())};Hs.Footer=function(){return null};const{getChallengeText:aue}=mn,Ws=({className:e,variation:t})=>{const{isPending:n}=et(s=>[s.isPending]),{handleChange:r,handleSubmit:o}=Gr(),{components:{ConfirmSignIn:{Header:i=Ws.Header,Footer:a=Ws.Footer}}}=Er();return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmsignin":"",method:"post",onChange:r,onSubmit:o},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},O.createElement(i,null),O.createElement(ve,{direction:"column"},O.createElement(ei,null),O.createElement(qr,null)),O.createElement(Vg,null),O.createElement(a,null))))};function sue(){const{challengeName:e}=et(({challengeName:t})=>[t]);return O.createElement(Zn,{level:3},aue(e))}Ws.Header=sue;Ws.Footer=function(){return null};const{getResendCodeText:lue,getResetYourPasswordText:uue}=mn,Vs=({className:e,variation:t})=>{const{isPending:n}=et(l=>[l.isPending]),{handleBlur:r,handleChange:o,handleSubmit:i}=Gr(),{components:{ConfirmResetPassword:{Header:a=Vs.Header,Footer:s=Vs.Footer}}}=Er();return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-confirmresetpassword":"",method:"post",onSubmit:i,onChange:o,onBlur:r},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},O.createElement(a,null),O.createElement(ve,{direction:"column"},O.createElement(ei,null)),O.createElement(qr,null),O.createElement(Kg,{cancelButtonSendType:"RESEND",cancelButtonText:lue()}),O.createElement(s,null))))};Vs.Header=function(){const t=uue();return O.createElement(Zn,{level:3},t)};Vs.Footer=function(){return null};const{getBackToSignInText:cue,getSendingText:due,getSendCodeText:fue,getResetYourPasswordText:pue}=mn,za=({className:e,variation:t})=>{const{isPending:n}=et(s=>[s.isPending]),{handleChange:r,handleSubmit:o}=Gr(),{components:{ForgotPassword:{Header:i=za.Header,Footer:a=za.Footer}}}=Er();return O.createElement(Io,{className:e,variation:t},O.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-forgotpassword":"",method:"post",onChange:r,onSubmit:o},O.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},O.createElement(i,null),O.createElement(ve,{direction:"column"},O.createElement(ei,null)),O.createElement(qr,null),O.createElement(Kg,{cancelButtonText:cue(),cancelButtonSendType:"SIGN_IN",submitButtonText:n?O.createElement(O.Fragment,null,due(),"…"):O.createElement(O.Fragment,null,fue())}),O.createElement(a,null))))};za.Header=function(){return O.createElement(Zn,{level:3},pue())};za.Footer=function(){return null};const hue=e=>e==="signIn"||e==="signUp",{getMfaTypeLabelByValue:mue,getSelectMfaTypeByChallengeName:gue,getSelectMfaTypeText:vue}=mn,Ha=({className:e,variation:t})=>{const{isPending:n,allowedMfaTypes:r=[]}=et(l=>[l.isPending,l.allowedMfaTypes]),{handleChange:o,handleSubmit:i}=Gr(),{components:{SelectMfaType:{Header:a=Ha.Header,Footer:s=Ha.Footer}}}=Er();return b.createElement(Io,{className:e,variation:t},b.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-select-mfa-type":"",method:"post",onChange:o,onSubmit:i},b.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},b.createElement(a,null),b.createElement(ve,{direction:"column"},b.createElement(NE,{name:"mfa_type",legend:vue(),legendHidden:!0,isDisabled:n,isRequired:!0},r.map((l,u)=>b.createElement(kE,{name:"mfa_type",key:l,value:l,defaultChecked:u===0},mue(l)))),b.createElement(qr,null)),b.createElement(Vg,null),b.createElement(s,null))))};Ha.Header=function(){const{challengeName:t}=et(n=>[n.challengeName]);return b.createElement(Zn,{level:3},gue(t))};Ha.Footer=function(){return null};const{getSetupEmailText:yue}=mn,Wa=({className:e,variation:t})=>{const{isPending:n}=et(s=>[s.isPending]),{handleChange:r,handleSubmit:o}=Gr(),{components:{SetupEmail:{Header:i=Wa.Header,Footer:a=Wa.Footer}}}=Er();return b.createElement(Io,{className:e,variation:t},b.createElement("form",{"data-amplify-form":"","data-amplify-authenticator-setup-email":"",method:"post",onChange:r,onSubmit:o},b.createElement(ve,{as:"fieldset",direction:"column",isDisabled:n},b.createElement(i,null),b.createElement(ve,{direction:"column"},b.createElement(ei,null),b.createElement(qr,null)),b.createElement(Vg,null),b.createElement(a,null))))};Wa.Header=function(){return b.createElement(Zn,{level:3},yue())};Wa.Footer=function(){return null};function HT(){return null}const Sue=e=>{switch(e){case"authenticated":case"idle":case"setup":case"transition":return HT;case"confirmSignUp":return Bs;case"confirmSignIn":return Ws;case"selectMfaType":return Ha;case"setupEmail":return Wa;case"setupTotp":return Ba;case"signIn":case"signUp":return Jle;case"forceNewPassword":return So;case"forgotPassword":return za;case"confirmResetPassword":return Vs;case"verifyUser":return Hs;case"confirmVerifyUser":return zs;default:return console.warn(`Unhandled Authenticator route - please open an issue: ${e}`),HT}};function bue({className:e,hideSignUp:t,variation:n}){const{route:r}=et(({route:i})=>[i]),o=b.useMemo(()=>Sue(r),[r]);return O.createElement(o,{className:e,hideSignUp:hue(r)?t:void 0,variation:n})}const Eue={Header:()=>null,SignIn:{Header:Hi.Header,Footer:Hi.Footer},SignUp:{Header:bo.Header,FormFields:bo.FormFields,Footer:bo.Footer},ConfirmSignUp:{Header:Bs.Header,Footer:Bs.Footer},SelectMfaType:{Header:Ha.Header,Footer:Ha.Footer},SetupEmail:{Header:Wa.Header,Footer:Wa.Footer},SetupTotp:{Header:Ba.Header,Footer:Ba.Footer},ConfirmResetPassword:{Header:Vs.Header,Footer:Vs.Footer},ConfirmSignIn:{Header:Ws.Header,Footer:Ws.Footer},VerifyUser:{Header:Hs.Header,Footer:Hs.Footer},ConfirmVerifyUser:{Header:zs.Header,Footer:zs.Footer},ForceNewPassword:{Header:So.Header,Footer:So.Footer,FormFields:So.FormFields},ForgotPassword:{Header:za.Header,Footer:za.Footer},Footer:()=>null};function wue({children:e,className:t,components:n,formFields:r,hideSignUp:o,initialState:i,loginMechanisms:a,passwordSettings:s,signUpAttributes:l,services:u,socialProviders:c,variation:d}){kse({message:"The `passwordSettings` prop has been deprecated and will be removed in a future major version of Amplify UI.",shouldWarn:!1});const{route:f,signOut:p,user:h}=et(({route:g,signOut:y,user:v})=>[g,y,v]);Gie({initialState:i,loginMechanisms:a,passwordSettings:s,services:u,signUpAttributes:l,socialProviders:c,formFields:r});const m=b.useMemo(()=>({components:{...Eue,...n}}),[n]);return f==="authenticated"||f==="signOut"?e?b.createElement(b.Fragment,null,Wr(e)?e({signOut:p,user:h}):e):null:b.createElement(DO.Provider,{value:m},b.createElement(bue,{className:t,hideSignUp:o,variation:d}))}function Zi(e){return Qie({componentName:"Authenticator",packageName:"react",version:Pse}),b.createElement(hO,null,b.createElement(wue,{...e}))}Zi.Provider=hO;Zi.ForgotPassword=za;Zi.SetupTotp=Ba;Zi.SignIn=Hi;Zi.SignUp=bo;Zi.ForceNewPassword=So;Zi.SelectMfaType=Ha;Zi.SetupEmail=Wa;const ZO=({cssText:e,...t})=>e===void 0||/<\/style/i.test(e)?null:b.createElement("style",{...t,dangerouslySetInnerHTML:{__html:e}});ZO.displayName="Style";const eD=({theme:e,...t})=>{if(!e)return null;const{name:n,cssText:r}=e;return b.createElement(ZO,{...t,cssText:r,id:`amplify-theme-${n}`})};eD.displayName="ThemeStyle";function Cue({children:e,colorMode:t,direction:n="ltr",nonce:r,theme:o}){const i=b.useMemo(()=>({theme:mE(o),colorMode:t}),[o,t]);return b.createElement(mO.Provider,{value:i},b.createElement(ese,{dir:n},b.createElement("div",{"data-amplify-theme":i.theme.name,"data-amplify-color-mode":t,dir:n},e),o?b.createElement(eD,{theme:i.theme,nonce:r}):null))}var tD={exports:{}},st={};/** * @license React * react-is.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var zE=Symbol.for("react.transitional.element"),HE=Symbol.for("react.portal"),Gg=Symbol.for("react.fragment"),qg=Symbol.for("react.strict_mode"),Qg=Symbol.for("react.profiler"),Yg=Symbol.for("react.consumer"),Xg=Symbol.for("react.context"),Jg=Symbol.for("react.forward_ref"),Zg=Symbol.for("react.suspense"),ev=Symbol.for("react.suspense_list"),tv=Symbol.for("react.memo"),nv=Symbol.for("react.lazy"),xue=Symbol.for("react.view_transition"),Iue=Symbol.for("react.client.reference");function Qr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case zE:switch(e=e.type,e){case Gg:case Qg:case qg:case Zg:case ev:case xue:return e;default:switch(e=e&&e.$$typeof,e){case Xg:case Jg:case nv:case tv:return e;case Yg:return e;default:return t}}case HE:return t}}}st.ContextConsumer=Yg;st.ContextProvider=Xg;st.Element=zE;st.ForwardRef=Jg;st.Fragment=Gg;st.Lazy=nv;st.Memo=tv;st.Portal=HE;st.Profiler=Qg;st.StrictMode=qg;st.Suspense=Zg;st.SuspenseList=ev;st.isContextConsumer=function(e){return Qr(e)===Yg};st.isContextProvider=function(e){return Qr(e)===Xg};st.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===zE};st.isForwardRef=function(e){return Qr(e)===Jg};st.isFragment=function(e){return Qr(e)===Gg};st.isLazy=function(e){return Qr(e)===nv};st.isMemo=function(e){return Qr(e)===tv};st.isPortal=function(e){return Qr(e)===HE};st.isProfiler=function(e){return Qr(e)===Qg};st.isStrictMode=function(e){return Qr(e)===qg};st.isSuspense=function(e){return Qr(e)===Zg};st.isSuspenseList=function(e){return Qr(e)===ev};st.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Gg||e===Qg||e===qg||e===Zg||e===ev||typeof e=="object"&&e!==null&&(e.$$typeof===nv||e.$$typeof===tv||e.$$typeof===Xg||e.$$typeof===Yg||e.$$typeof===Jg||e.$$typeof===Iue||e.getModuleId!==void 0)};st.typeOf=Qr;tD.exports=st;var nD=tD.exports;function bi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rD(e){if(b.isValidElement(e)||nD.isValidElementType(e)||!bi(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=rD(e[n])}),t}function bn(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return bi(e)&&bi(t)&&Object.keys(t).forEach(o=>{b.isValidElement(t[o])||nD.isValidElementType(t[o])?r[o]=t[o]:bi(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&bi(e[o])?r[o]=bn(e[o],t[o],n):n.clone?r[o]=bi(t[o])?rD(t[o]):t[o]:r[o]=t[o]}),r}function Wi(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function It(e){if(typeof e!="string")throw new Error(Wi(7));return e.charAt(0).toUpperCase()+e.slice(1)}function WT(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function oD(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function Tue(e,t){var n,r,o;return b.isValidElement(e)&&t.indexOf(e.type.muiName??((o=(r=(n=e.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:o.muiName))!==-1}function gr(e){return e&&e.ownerDocument||document}function Vi(e){return gr(e).defaultView||window}function VT(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const Yo=typeof window<"u"?b.useLayoutEffect:b.useEffect;let KT=0;function Aue(e){const[t,n]=b.useState(e),r=e||t;return b.useEffect(()=>{t==null&&(KT+=1,n(`mui-${KT}`))},[t]),r}const _ue={...Rh},GT=_ue.useId;function iD(e){if(GT!==void 0){const t=GT();return e??t}return Aue(e)}function Tm({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=b.useRef(e!==void 0),[i,a]=b.useState(t),s=o?e:i,l=b.useCallback(u=>{o||a(u)},[]);return[s,l]}function Ri(e){const t=b.useRef(e);return Yo(()=>{t.current=e}),b.useRef((...n)=>(0,t.current)(...n)).current}function Vt(...e){const t=b.useRef(void 0),n=b.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,s=a(r);return typeof s=="function"?s:()=>{a(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return b.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const qT={};function aD(e,t){const n=b.useRef(qT);return n.current===qT&&(n.current=e(t)),n}const Rue=[];function Pue(e){b.useEffect(e,Rue)}class rv{constructor(){lc(this,"currentId",null);lc(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});lc(this,"disposeEffect",()=>this.clear)}static create(){return new rv}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function fs(){const e=aD(rv.create).current;return Pue(e.disposeEffect),e}function Am(e){try{return e.matches(":focus-visible")}catch{}return!1}function sD(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function jS(e,t){const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=r;if(o==="components"||o==="slots")n[o]={...e[o],...n[o]};else if(o==="componentsProps"||o==="slotProps"){const i=e[o],a=t[o];if(!a)n[o]=i||{};else if(!i)n[o]=a;else{n[o]={...a};for(const s in i)if(Object.prototype.hasOwnProperty.call(i,s)){const l=s;n[o][l]=jS(i[l],a[l])}}}else n[o]===void 0&&(n[o]=e[o])}return n}function Ot(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let a="",s=!0;for(let l=0;le,kue=()=>{let e=QT;return{configure(t){e=t},generate(t){return e(t)},reset(){e=QT}}},Nue=kue(),Oue={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Dt(e,t,n="Mui"){const r=Oue[t];return r?`${n}-${r}`:`${Nue.generate(e)}-${t}`}function ht(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Dt(e,o,n)}),r}function lD(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Due(e){return typeof e=="string"}function uD(e,t,n){return e===void 0||Due(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function cD(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;tr.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function YT(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function fD(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const p=Te(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),h={...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},m={...n,...o,...r};return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const a=dD({...o,...r}),s=YT(r),l=YT(o),u=t(a),c=Te(u==null?void 0:u.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),d={...u==null?void 0:u.style,...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},f={...u,...n,...l,...s};return c.length>0&&(f.className=c),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:u.ref}}function pD(e,t,n){return typeof e=="function"?e(t,n):e}function hD(e){var d;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,a=o?{}:pD(n,r),{props:s,internalRef:l}=fD({...i,externalSlotProps:a}),u=Vt(l,a==null?void 0:a.ref,(d=e.additionalProps)==null?void 0:d.ref);return uD(t,{...s,ref:u},r)}function al(e){var t;return parseInt(b.version,10)>=19?((t=e==null?void 0:e.props)==null?void 0:t.ref)||null:(e==null?void 0:e.ref)||null}function md(e,t){return t?bn(e,t,{clone:!1}):e}function Mue(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,o)=>{var a,s;const i=/min-width:\s*([0-9.]+)/;return+(((a=r.match(i))==null?void 0:a[1])||0)-+(((s=o.match(i))==null?void 0:s[1])||0)});return n.length?n.reduce((r,o)=>{const i=t[o];return delete r[o],r[o]=i,r},{...t}):t}function Fue(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function Lue(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}function Uue(e){const t=(i,a)=>i.replace("@media",a?`@container ${a}`:"@container");function n(i,a){i.up=(...s)=>t(e.breakpoints.up(...s),a),i.down=(...s)=>t(e.breakpoints.down(...s),a),i.between=(...s)=>t(e.breakpoints.between(...s),a),i.only=(...s)=>t(e.breakpoints.only(...s),a),i.not=(...s)=>{const l=t(e.breakpoints.not(...s),a);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},o=i=>(n(r,i),r);return n(o),{...e,containerQueries:o}}const ov={xs:0,sm:600,md:900,lg:1200,xl:1536},XT={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${ov[e]}px)`},$ue={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:ov[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Ki(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||XT;return t.reduce((a,s,l)=>(a[i.up(i.keys[l])]=n(t[l]),a),{})}if(typeof t=="object"){const i=r.breakpoints||XT;return Object.keys(t).reduce((a,s)=>{if(Fue(i.keys,s)){const l=Lue(r.containerQueries?r:$ue,s);l&&(a[l]=n(t[s],s))}else if(Object.keys(i.values||ov).includes(s)){const l=i.up(s);a[l]=n(t[s],s)}else{const l=s;a[l]=t[l]}return a},{})}return n(t)}function jue(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,o)=>{const i=e.up(o);return r[i]={},r},{}))||{}}function Bue(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function iv(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function _m(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=iv(e,n)||r,t&&(o=t(o,r,e)),o}function Ut(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=a=>{if(a[t]==null)return null;const s=a[t],l=a.theme,u=iv(l,r)||{};return Ki(a,s,d=>{let f=_m(u,o,d);return d===f&&typeof d=="string"&&(f=_m(u,o,`${t}${d==="default"?"":It(d)}`,d)),n===!1?f:{[n]:f}})};return i.propTypes={},i.filterProps=[t],i}function zue(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Hue={m:"margin",p:"padding"},Wue={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},JT={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Vue=zue(e=>{if(e.length>2)if(JT[e])e=JT[e];else return[e];const[t,n]=e.split(""),r=Hue[t],o=Wue[n]||"";return Array.isArray(o)?o.map(i=>r+i):[r+o]}),WE=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],VE=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...WE,...VE];function Df(e,t,n,r){const o=iv(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:typeof o=="string"?`calc(${i} * ${o})`:o*i:Array.isArray(o)?i=>{if(typeof i=="string")return i;const a=Math.abs(i),s=o[a];return i>=0?s:typeof s=="number"?-s:`-${s}`}:typeof o=="function"?o:()=>{}}function KE(e){return Df(e,"spacing",8)}function Mf(e,t){return typeof t=="string"||t==null?t:e(t)}function Kue(e,t){return n=>e.reduce((r,o)=>(r[o]=Mf(t,n),r),{})}function Gue(e,t,n,r){if(!t.includes(n))return null;const o=Vue(n),i=Kue(o,r),a=e[n];return Ki(e,a,i)}function mD(e,t){const n=KE(e.theme);return Object.keys(e).map(r=>Gue(e,t,r,n)).reduce(md,{})}function Tt(e){return mD(e,WE)}Tt.propTypes={};Tt.filterProps=WE;function At(e){return mD(e,VE)}At.propTypes={};At.filterProps=VE;function av(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(i=>{r[i]=o}),r),{}),n=r=>Object.keys(r).reduce((o,i)=>t[i]?md(o,t[i](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function Fr(e){return typeof e!="number"?e:`${e}px solid`}function Yr(e,t){return Ut({prop:e,themeKey:"borders",transform:t})}const que=Yr("border",Fr),Que=Yr("borderTop",Fr),Yue=Yr("borderRight",Fr),Xue=Yr("borderBottom",Fr),Jue=Yr("borderLeft",Fr),Zue=Yr("borderColor"),ece=Yr("borderTopColor"),tce=Yr("borderRightColor"),nce=Yr("borderBottomColor"),rce=Yr("borderLeftColor"),oce=Yr("outline",Fr),ice=Yr("outlineColor"),sv=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Df(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:Mf(t,r)});return Ki(e,e.borderRadius,n)}return null};sv.propTypes={};sv.filterProps=["borderRadius"];av(que,Que,Yue,Xue,Jue,Zue,ece,tce,nce,rce,sv,oce,ice);const lv=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Df(e.theme,"spacing",8),n=r=>({gap:Mf(t,r)});return Ki(e,e.gap,n)}return null};lv.propTypes={};lv.filterProps=["gap"];const uv=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Df(e.theme,"spacing",8),n=r=>({columnGap:Mf(t,r)});return Ki(e,e.columnGap,n)}return null};uv.propTypes={};uv.filterProps=["columnGap"];const cv=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Df(e.theme,"spacing",8),n=r=>({rowGap:Mf(t,r)});return Ki(e,e.rowGap,n)}return null};cv.propTypes={};cv.filterProps=["rowGap"];const ace=Ut({prop:"gridColumn"}),sce=Ut({prop:"gridRow"}),lce=Ut({prop:"gridAutoFlow"}),uce=Ut({prop:"gridAutoColumns"}),cce=Ut({prop:"gridAutoRows"}),dce=Ut({prop:"gridTemplateColumns"}),fce=Ut({prop:"gridTemplateRows"}),pce=Ut({prop:"gridTemplateAreas"}),hce=Ut({prop:"gridArea"});av(lv,uv,cv,ace,sce,lce,uce,cce,dce,fce,pce,hce);function Gl(e,t){return t==="grey"?t:e}const mce=Ut({prop:"color",themeKey:"palette",transform:Gl}),gce=Ut({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Gl}),vce=Ut({prop:"backgroundColor",themeKey:"palette",transform:Gl});av(mce,gce,vce);function ir(e){return e<=1&&e!==0?`${e*100}%`:e}const yce=Ut({prop:"width",transform:ir}),GE=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var o,i,a,s,l;const r=((a=(i=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:i.values)==null?void 0:a[n])||ov[n];return r?((l=(s=e.theme)==null?void 0:s.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:ir(n)}};return Ki(e,e.maxWidth,t)}return null};GE.filterProps=["maxWidth"];const Sce=Ut({prop:"minWidth",transform:ir}),bce=Ut({prop:"height",transform:ir}),Ece=Ut({prop:"maxHeight",transform:ir}),wce=Ut({prop:"minHeight",transform:ir});Ut({prop:"size",cssProperty:"width",transform:ir});Ut({prop:"size",cssProperty:"height",transform:ir});const Cce=Ut({prop:"boxSizing"});av(yce,GE,Sce,bce,Ece,wce,Cce);const dv={border:{themeKey:"borders",transform:Fr},borderTop:{themeKey:"borders",transform:Fr},borderRight:{themeKey:"borders",transform:Fr},borderBottom:{themeKey:"borders",transform:Fr},borderLeft:{themeKey:"borders",transform:Fr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Fr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:sv},color:{themeKey:"palette",transform:Gl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Gl},backgroundColor:{themeKey:"palette",transform:Gl},p:{style:At},pt:{style:At},pr:{style:At},pb:{style:At},pl:{style:At},px:{style:At},py:{style:At},padding:{style:At},paddingTop:{style:At},paddingRight:{style:At},paddingBottom:{style:At},paddingLeft:{style:At},paddingX:{style:At},paddingY:{style:At},paddingInline:{style:At},paddingInlineStart:{style:At},paddingInlineEnd:{style:At},paddingBlock:{style:At},paddingBlockStart:{style:At},paddingBlockEnd:{style:At},m:{style:Tt},mt:{style:Tt},mr:{style:Tt},mb:{style:Tt},ml:{style:Tt},mx:{style:Tt},my:{style:Tt},margin:{style:Tt},marginTop:{style:Tt},marginRight:{style:Tt},marginBottom:{style:Tt},marginLeft:{style:Tt},marginX:{style:Tt},marginY:{style:Tt},marginInline:{style:Tt},marginInlineStart:{style:Tt},marginInlineEnd:{style:Tt},marginBlock:{style:Tt},marginBlockStart:{style:Tt},marginBlockEnd:{style:Tt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:lv},rowGap:{style:cv},columnGap:{style:uv},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ir},maxWidth:{style:GE},minWidth:{transform:ir},height:{transform:ir},maxHeight:{transform:ir},minHeight:{transform:ir},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function xce(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function Ice(e,t){return typeof e=="function"?e(t):e}function Tce(){function e(n,r,o,i){const a={[n]:r,theme:o},s=i[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:d}=s;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const f=iv(o,u)||{};return d?d(a):Ki(a,r,h=>{let m=_m(f,c,h);return h===m&&typeof h=="string"&&(m=_m(f,c,`${n}${h==="default"?"":It(h)}`,h)),l===!1?m:{[l]:m}})}function t(n){const{sx:r,theme:o={}}=n||{};if(!r)return null;const i=o.unstable_sxConfig??dv;function a(s){let l=s;if(typeof s=="function")l=s(o);else if(typeof s!="object")return s;if(!l)return null;const u=jue(o.breakpoints),c=Object.keys(u);let d=u;return Object.keys(l).forEach(f=>{const p=Ice(l[f],o);if(p!=null)if(typeof p=="object")if(i[f])d=md(d,e(f,p,o,i));else{const h=Ki({theme:o},p,m=>({[f]:m}));xce(h,p)?d[f]=t({sx:p,theme:o}):d=md(d,h)}else d=md(d,e(f,p,o,i))}),Mue(o,Bue(c,d))}return Array.isArray(r)?r.map(a):a(r)}return t}const Au=Tce();Au.filterProps=["sx"];function Rm(){return Rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?cn(ac,--Xn):0,_u--,Ht===10&&(_u=1,pv--),Ht}function ur(){return Ht=Xn2||Yd(Ht)>3?"":" "}function jce(e,t){for(;--t&&ur()&&!(Ht<48||Ht>102||Ht>57&&Ht<65||Ht>70&&Ht<97););return Ff(e,xh()+(t<6&&Ko()==32&&ur()==32))}function zS(e){for(;ur();)switch(Ht){case e:return Xn;case 34:case 39:e!==34&&e!==39&&zS(Ht);break;case 40:e===41&&zS(e);break;case 92:ur();break}return Xn}function Bce(e,t){for(;ur()&&e+Ht!==57;)if(e+Ht===84&&Ko()===47)break;return"/*"+Ff(t,Xn-1)+"*"+fv(e===47?e:ur())}function zce(e){for(;!Yd(Ko());)ur();return Ff(e,Xn)}function Hce(e){return ED(Th("",null,null,null,[""],e=bD(e),0,[0],e))}function Th(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,d=a,f=0,p=0,h=0,m=1,E=1,g=1,y=0,v="",S=o,x=i,I=r,T=v;E;)switch(h=y,y=ur()){case 40:if(h!=108&&cn(T,d-1)==58){BS(T+=Ke(Ih(y),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:T+=Ih(y);break;case 9:case 10:case 13:case 32:T+=$ce(h);break;case 92:T+=jce(xh()-1,7);continue;case 47:switch(Ko()){case 42:case 47:kp(Wce(Bce(ur(),xh()),t,n),l);break;default:T+="/"}break;case 123*m:s[u++]=$o(T)*g;case 125*m:case 59:case 0:switch(y){case 0:case 125:E=0;case 59+c:g==-1&&(T=Ke(T,/\f/g,"")),p>0&&$o(T)-d&&kp(p>32?eA(T+";",r,n,d-1):eA(Ke(T," ","")+";",r,n,d-2),l);break;case 59:T+=";";default:if(kp(I=ZT(T,t,n,u,c,o,s,v,S=[],x=[],d),i),y===123)if(c===0)Th(T,t,I,I,S,i,d,s,x);else switch(f===99&&cn(T,3)===110?100:f){case 100:case 108:case 109:case 115:Th(e,I,I,r&&kp(ZT(e,I,I,0,0,o,s,v,o,S=[],d),x),o,x,d,s,r?S:x);break;default:Th(T,I,I,I,[""],x,0,s,x)}}u=c=p=0,m=g=1,v=T="",d=a;break;case 58:d=1+$o(T),p=h;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&Uce()==125)continue}switch(T+=fv(y),y*m){case 38:g=c>0?1:(T+="\f",-1);break;case 44:s[u++]=($o(T)-1)*g,g=1;break;case 64:Ko()===45&&(T+=Ih(ur())),f=Ko(),c=d=$o(v=T+=zce(xh())),y++;break;case 45:h===45&&$o(T)==2&&(m=0)}}return i}function ZT(e,t,n,r,o,i,a,s,l,u,c){for(var d=o-1,f=o===0?i:[""],p=YE(f),h=0,m=0,E=0;h0?f[g]+" "+y:Ke(y,/&\f/g,f[g])))&&(l[E++]=v);return hv(e,t,n,o===0?qE:s,l,u,c)}function Wce(e,t,n){return hv(e,t,n,gD,fv(Lce()),Qd(e,2,-2),0)}function eA(e,t,n,r){return hv(e,t,n,QE,Qd(e,0,r),Qd(e,r+1,-1),r)}function ql(e,t){for(var n="",r=YE(e),o=0;o6)switch(cn(e,t+1)){case 109:if(cn(e,t+4)!==45)break;case 102:return Ke(e,/(.+:)(.+)-([^]+)/,"$1"+Ve+"$2-$3$1"+Pm+(cn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~BS(e,"stretch")?CD(Ke(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(cn(e,t+1)!==115)break;case 6444:switch(cn(e,$o(e)-3-(~BS(e,"!important")&&10))){case 107:return Ke(e,":",":"+Ve)+e;case 101:return Ke(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ve+(cn(e,14)===45?"inline-":"")+"box$3$1"+Ve+"$2$3$1"+yn+"$2box$3")+e}break;case 5936:switch(cn(e,t+11)){case 114:return Ve+e+yn+Ke(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ve+e+yn+Ke(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ve+e+yn+Ke(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ve+e+yn+e+e}return e}var Zce=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case QE:t.return=CD(t.value,t.length);break;case vD:return ql([Tc(t,{value:Ke(t.value,"@","@"+Ve)})],o);case qE:if(t.length)return Fce(t.props,function(i){switch(Mce(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ql([Tc(t,{props:[Ke(i,/:(read-\w+)/,":"+Pm+"$1")]})],o);case"::placeholder":return ql([Tc(t,{props:[Ke(i,/:(plac\w+)/,":"+Ve+"input-$1")]}),Tc(t,{props:[Ke(i,/:(plac\w+)/,":"+Pm+"$1")]}),Tc(t,{props:[Ke(i,/:(plac\w+)/,yn+"input-$1")]})],o)}return""})}},ede=[Zce],tde=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var E=m.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||ede,i={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var E=m.getAttribute("data-emotion").split(" "),g=1;g=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var fde={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},pde=/[A-Z]|^ms/g,hde=/_EMO_([^_]+?)_([^]*?)_EMO_/g,RD=function(t){return t.charCodeAt(1)===45},nA=function(t){return t!=null&&typeof t!="boolean"},Ry=wD(function(e){return RD(e)?e:e.replace(pde,"-$&").toLowerCase()}),rA=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(hde,function(r,o,i){return jo={name:o,styles:i,next:jo},o})}return fde[t]!==1&&!RD(t)&&typeof n=="number"&&n!==0?n+"px":n};function Xd(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return jo={name:o.name,styles:o.styles,next:jo},o.name;var i=n;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)jo={name:a.name,styles:a.styles,next:jo},a=a.next;var s=i.styles+";";return s}return mde(e,t,n)}case"function":{if(e!==void 0){var l=jo,u=n(e);return jo=l,Xd(e,t,u)}break}}var c=n;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function mde(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o96?Ide:Tde},lA=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},Ade=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return ew(n,r,o),kD(function(){return tw(n,r,o)}),null},_de=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,a;n!==void 0&&(i=n.label,a=n.target);var s=lA(t,n,r),l=s||sA(o),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{var f=c[0];d.push(f[0]);for(var p=c.length,h=1;ht(Pde(o)?n:o):t;return C.jsx(Ede,{styles:r})}/** * @mui/styled-engine v6.4.11 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function Nde(e,t){return WS(e,t)}function Ode(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const uA=[];function cA(e){return uA[0]=e,Lf(uA)}const Dde=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function Mde(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=Dde(t),a=Object.keys(i);function s(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-r/100}${n})`}function u(f,p){const h=a.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${n}) and (max-width:${(h!==-1&&typeof t[a[h]]=="number"?t[a[h]]:p)-r/100}${n})`}function c(f){return a.indexOf(f)+1(r.length===0?[1]:r).map(i=>{const a=t(i);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function Lde(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function iw(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...a}=e,s=Mde(n),l=OD(o);let u=bn({breakpoints:s,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:l,shape:{...Fde,...i}},a);return u=Uue(u),u.applyStyles=Lde,u=t.reduce((c,d)=>bn(c,d),u),u.unstable_sxConfig={...dv,...a==null?void 0:a.unstable_sxConfig},u.unstable_sx=function(d){return Au({sx:d,theme:this})},u}function Ude(e){return Object.keys(e).length===0}function $de(e=null){const t=b.useContext(Iv);return!t||Ude(t)?e:t}const jde=iw();function DD(e=jde){return $de(e)}function Bde({styles:e,themeId:t,defaultTheme:n={}}){const r=DD(n),o=typeof e=="function"?e(t&&r[t]||r):e;return C.jsx(kde,{styles:o})}function MD(e){const{variants:t,...n}=e,r={variants:t,style:cA(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=cA(o.style))}),r}const zde=iw();function Py(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Hde(e){return e?(t,n)=>n[e]:null}function Wde(e,t,n){e.theme=Gde(e.theme)?n:e.theme[t]||e.theme}function Ah(e,t){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(r=>Ah(e,r));if(Array.isArray(n==null?void 0:n.variants)){let r;if(n.isProcessed)r=n.style;else{const{variants:o,...i}=n;r=i}return FD(e,n.variants,[r])}return n!=null&&n.isProcessed?n.style:n}function FD(e,t,n=[]){var o;let r;e:for(let i=0;i{Ode(s,x=>x.filter(I=>I!==Au));const{name:u,slot:c,skipVariantsResolver:d,skipSx:f,overridesResolver:p=Hde(Qde(c)),...h}=l,m=d!==void 0?d:c&&c!=="Root"&&c!=="root"||!1,E=f||!1;let g=Py;c==="Root"||c==="root"?g=r:c?g=o:qde(s)&&(g=void 0);const y=Nde(s,{shouldForwardProp:g,label:Kde(),...h}),v=x=>{if(typeof x=="function"&&x.__emotion_real!==x)return function(T){return Ah(T,x)};if(bi(x)){const I=MD(x);return I.variants?function(A){return Ah(A,I)}:I.style}return x},S=(...x)=>{const I=[],T=x.map(v),A=[];if(I.push(i),u&&p&&A.push(function(k){var $,j;const F=(j=($=k.theme.components)==null?void 0:$[u])==null?void 0:j.styleOverrides;if(!F)return null;const U={};for(const M in F)U[M]=Ah(k,F[M]);return p(k,U)}),u&&!m&&A.push(function(k){var U,$;const N=k.theme,F=($=(U=N==null?void 0:N.components)==null?void 0:U[u])==null?void 0:$.variants;return F?FD(k,F):null}),E||A.push(Au),Array.isArray(T[0])){const _=T.shift(),k=new Array(I.length).fill(""),N=new Array(A.length).fill("");let F;F=[...k,..._,...N],F.raw=[...k,..._.raw,...N],I.unshift(F)}const R=[...I,...T,...A],w=y(...R);return s.muiName&&(w.muiName=s.muiName),w};return y.withConfig&&(S.withConfig=y.withConfig),S}}function Kde(e,t){return void 0}function Gde(e){for(const t in e)return!1;return!0}function qde(e){return typeof e=="string"&&e.charCodeAt(0)>96}function Qde(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function aw(e,t=0,n=1){return lD(e,t,n)}function Yde(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Va(e){if(e.type)return e;if(e.charAt(0)==="#")return Va(Yde(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Wi(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(Wi(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const Xde=e=>{const t=Va(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},qc=(e,t)=>{try{return Xde(e)}catch{return e}};function Tv(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function LD(e){e=Va(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),a=(u,c=(u+n/30)%12)=>o-i*Math.max(Math.min(c-3,9-c,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(s+="a",l.push(t[3])),Tv({type:s,values:l})}function VS(e){e=Va(e);let t=e.type==="hsl"||e.type==="hsla"?Va(LD(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Jde(e,t){const n=VS(e),r=VS(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ti(e,t){return e=Va(e),t=aw(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Tv(e)}function Np(e,t,n){try{return Ti(e,t)}catch{return e}}function sw(e,t){if(e=Va(e),t=aw(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Tv(e)}function it(e,t,n){try{return sw(e,t)}catch{return e}}function lw(e,t){if(e=Va(e),t=aw(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Tv(e)}function at(e,t,n){try{return lw(e,t)}catch{return e}}function UD(e,t=.15){return VS(e)>.5?sw(e,t):lw(e,t)}function Op(e,t,n){try{return UD(e,t)}catch{return e}}const Zde=b.createContext(),uw=()=>b.useContext(Zde)??!1,efe=b.createContext(void 0);function tfe(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?jS(o.defaultProps,r):!o.styleOverrides&&!o.variants?jS(o,r):r}function nfe({props:e,name:t}){const n=b.useContext(efe);return tfe({props:e,name:t,theme:{components:n}})}const dA={theme:void 0};function rfe(e){let t,n;return function(o){let i=t;return(i===void 0||o.theme!==n)&&(dA.theme=o.theme,i=MD(e(dA)),t=i,n=o.theme),i}}function ofe(e=""){function t(...r){if(!r.length)return"";const o=r[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...r.slice(1))})`:`, ${o}`}return(r,...o)=>`var(--${e?`${e}-`:""}${r}${t(...o)})`}const fA=(e,t,n,r=[])=>{let o=e;t.forEach((i,a)=>{a===t.length-1?Array.isArray(o)?o[Number(i)]=n:o&&typeof o=="object"&&(o[i]=n):o&&typeof o=="object"&&(o[i]||(o[i]=r.includes(i)?[]:{}),o=o[i])})},ife=(e,t,n)=>{function r(o,i=[],a=[]){Object.entries(o).forEach(([s,l])=>{(!n||n&&!n([...i,s]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...i,s],Array.isArray(l)?[...a,s]:a):t([...i,s],l,a))})}r(e)},afe=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function ky(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},i={},a={};return ife(e,(s,l,u)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(s,l))){const c=`--${n?`${n}-`:""}${s.join("-")}`,d=afe(s,l);Object.assign(o,{[c]:d}),fA(i,s,`var(${c})`,u),fA(a,s,`var(${c}, ${d})`,u)}},s=>s[0]==="vars"),{css:o,vars:i,varsWithDefaults:a}}function sfe(e,t={}){const{getSelector:n=E,disableCssColorScheme:r,colorSchemeSelector:o}=t,{colorSchemes:i={},components:a,defaultColorScheme:s="light",...l}=e,{vars:u,css:c,varsWithDefaults:d}=ky(l,t);let f=d;const p={},{[s]:h,...m}=i;if(Object.entries(m||{}).forEach(([v,S])=>{const{vars:x,css:I,varsWithDefaults:T}=ky(S,t);f=bn(f,T),p[v]={css:I,vars:x}}),h){const{css:v,vars:S,varsWithDefaults:x}=ky(h,t);f=bn(f,x),p[s]={css:v,vars:S}}function E(v,S){var I,T;let x=o;if(o==="class"&&(x=".%s"),o==="data"&&(x="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(x=`[${o}="%s"]`),v){if(x==="media")return e.defaultColorScheme===v?":root":{[`@media (prefers-color-scheme: ${((T=(I=i[v])==null?void 0:I.palette)==null?void 0:T.mode)||v})`]:{":root":S}};if(x)return e.defaultColorScheme===v?`:root, ${x.replace("%s",String(v))}`:x.replace("%s",String(v))}return":root"}return{vars:f,generateThemeVars:()=>{let v={...u};return Object.entries(p).forEach(([,{vars:S}])=>{v=bn(v,S)}),v},generateStyleSheets:()=>{var A,R;const v=[],S=e.defaultColorScheme||"light";function x(w,_){Object.keys(_).length&&v.push(typeof w=="string"?{[w]:{..._}}:w)}x(n(void 0,{...c}),c);const{[S]:I,...T}=p;if(I){const{css:w}=I,_=(R=(A=i[S])==null?void 0:A.palette)==null?void 0:R.mode,k=!r&&_?{colorScheme:_,...w}:{...w};x(n(S,{...k}),k)}return Object.entries(T).forEach(([w,{css:_}])=>{var F,U;const k=(U=(F=i[w])==null?void 0:F.palette)==null?void 0:U.mode,N=!r&&k?{colorScheme:k,..._}:{..._};x(n(w,{...N}),N)}),v}}}function lfe(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const Jd={black:"#000",white:"#fff"},ufe={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},dl={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},fl={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},Ac={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},pl={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},hl={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ml={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function $D(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Jd.white,default:Jd.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const cfe=$D();function jD(){return{text:{primary:Jd.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Jd.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const pA=jD();function hA(e,t,n,r){const o=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=lw(e.main,o):t==="dark"&&(e.dark=sw(e.main,i)))}function dfe(e="light"){return e==="dark"?{main:pl[200],light:pl[50],dark:pl[400]}:{main:pl[700],light:pl[400],dark:pl[800]}}function ffe(e="light"){return e==="dark"?{main:dl[200],light:dl[50],dark:dl[400]}:{main:dl[500],light:dl[300],dark:dl[700]}}function pfe(e="light"){return e==="dark"?{main:fl[500],light:fl[300],dark:fl[700]}:{main:fl[700],light:fl[400],dark:fl[800]}}function hfe(e="light"){return e==="dark"?{main:hl[400],light:hl[300],dark:hl[700]}:{main:hl[700],light:hl[500],dark:hl[900]}}function mfe(e="light"){return e==="dark"?{main:ml[400],light:ml[300],dark:ml[700]}:{main:ml[800],light:ml[500],dark:ml[900]}}function gfe(e="light"){return e==="dark"?{main:Ac[400],light:Ac[300],dark:Ac[700]}:{main:"#ed6c02",light:Ac[500],dark:Ac[900]}}function cw(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,...o}=e,i=e.primary||dfe(t),a=e.secondary||ffe(t),s=e.error||pfe(t),l=e.info||hfe(t),u=e.success||mfe(t),c=e.warning||gfe(t);function d(m){return Jde(m,pA.text.primary)>=n?pA.text.primary:cfe.text.primary}const f=({color:m,name:E,mainShade:g=500,lightShade:y=300,darkShade:v=700})=>{if(m={...m},!m.main&&m[g]&&(m.main=m[g]),!m.hasOwnProperty("main"))throw new Error(Wi(11,E?` (${E})`:"",g));if(typeof m.main!="string")throw new Error(Wi(12,E?` (${E})`:"",JSON.stringify(m.main)));return hA(m,"light",y,r),hA(m,"dark",v,r),m.contrastText||(m.contrastText=d(m.main)),m};let p;return t==="light"?p=$D():t==="dark"&&(p=jD()),bn({common:{...Jd},mode:t,primary:f({color:i,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:s,name:"error"}),warning:f({color:c,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:u,name:"success"}),grey:ufe,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r,...p},o)}function vfe(e){const t={};return Object.entries(e).forEach(r=>{const[o,i]=r;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function yfe(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function Sfe(e){return Math.round(e*1e5)/1e5}const mA={textTransform:"uppercase"},gA='"Roboto", "Helvetica", "Arial", sans-serif';function bfe(e,t){const{fontFamily:n=gA,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:a=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:u,pxToRem:c,...d}=typeof t=="function"?t(e):t,f=r/14,p=c||(E=>`${E/l*f}rem`),h=(E,g,y,v,S)=>({fontFamily:n,fontWeight:E,fontSize:p(g),lineHeight:y,...n===gA?{letterSpacing:`${Sfe(v/g)}em`}:{},...S,...u}),m={h1:h(o,96,1.167,-1.5),h2:h(o,60,1.2,-.5),h3:h(i,48,1.167,0),h4:h(i,34,1.235,.25),h5:h(i,24,1.334,0),h6:h(a,20,1.6,.15),subtitle1:h(i,16,1.75,.15),subtitle2:h(a,14,1.57,.1),body1:h(i,16,1.5,.15),body2:h(i,14,1.43,.15),button:h(a,14,1.75,.4,mA),caption:h(i,12,1.66,.4),overline:h(i,12,2.66,1,mA),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return bn({htmlFontSize:l,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:a,fontWeightBold:s,...m},d,{clone:!1})}const Efe=.2,wfe=.14,Cfe=.12;function mt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Efe})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${wfe})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Cfe})`].join(",")}const xfe=["none",mt(0,2,1,-1,0,1,1,0,0,1,3,0),mt(0,3,1,-2,0,2,2,0,0,1,5,0),mt(0,3,3,-2,0,3,4,0,0,1,8,0),mt(0,2,4,-1,0,4,5,0,0,1,10,0),mt(0,3,5,-1,0,5,8,0,0,1,14,0),mt(0,3,5,-1,0,6,10,0,0,1,18,0),mt(0,4,5,-2,0,7,10,1,0,2,16,1),mt(0,5,5,-3,0,8,10,1,0,3,14,2),mt(0,5,6,-3,0,9,12,1,0,3,16,2),mt(0,6,6,-3,0,10,14,1,0,4,18,3),mt(0,6,7,-4,0,11,15,1,0,4,20,3),mt(0,7,8,-4,0,12,17,2,0,5,22,4),mt(0,7,8,-4,0,13,19,2,0,5,24,4),mt(0,7,9,-4,0,14,21,2,0,5,26,4),mt(0,8,9,-5,0,15,22,2,0,6,28,5),mt(0,8,10,-5,0,16,24,2,0,6,30,5),mt(0,8,11,-5,0,17,26,2,0,6,32,5),mt(0,9,11,-5,0,18,28,2,0,7,34,6),mt(0,9,12,-6,0,19,29,2,0,7,36,6),mt(0,10,13,-6,0,20,31,3,0,8,38,7),mt(0,10,13,-6,0,21,33,3,0,8,40,7),mt(0,10,14,-6,0,22,35,3,0,8,42,7),mt(0,11,14,-7,0,23,36,3,0,9,44,8),mt(0,11,15,-7,0,24,38,3,0,9,46,8)],Ife={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Tfe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function vA(e){return`${Math.round(e)}ms`}function Afe(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function _fe(e){const t={...Ife,...e.easing},n={...Tfe,...e.duration};return{getAutoHeightDuration:Afe,create:(o=["all"],i={})=>{const{duration:a=n.standard,easing:s=t.easeInOut,delay:l=0,...u}=i;return(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof a=="string"?a:vA(a)} ${s} ${typeof l=="string"?l:vA(l)}`).join(",")},...e,easing:t,duration:n}}const Rfe={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Pfe(e){return bi(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function BD(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let i=0;ibn(p,h),f),f.unstable_sxConfig={...dv,...u==null?void 0:u.unstable_sxConfig},f.unstable_sx=function(h){return Au({sx:h,theme:this})},f.toRuntimeSource=BD,f}function GS(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const kfe=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=GS(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function zD(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function HD(e){return e==="dark"?kfe:[]}function Nfe(e){const{palette:t={mode:"light"},opacity:n,overlays:r,...o}=e,i=cw(t);return{palette:i,opacity:{...zD(i.mode),...n},overlays:r||HD(i.mode),...o}}function Ofe(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Dfe=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Mfe=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return Dfe(e.cssVarPrefix).forEach(s=>{a[s]=n[s],delete n[s]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:a}}:i?{[i.replace("%s",t)]:a,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...a}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}return r};function Ffe(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function B(e,t,n){!e[t]&&n&&(e[t]=n)}function Qc(e){return typeof e!="string"||!e.startsWith("hsl")?e:LD(e)}function oi(e,t){`${t}Channel`in e||(e[`${t}Channel`]=qc(Qc(e[t])))}function Lfe(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const No=e=>{try{return e()}catch{}},Ufe=(e="mui")=>ofe(e);function Ny(e,t,n,r){if(!t)return;t=t===!0?{}:t;const o=r==="dark"?"dark":"light";if(!n){e[r]=Nfe({...t,palette:{mode:o,...t==null?void 0:t.palette}});return}const{palette:i,...a}=KS({...n,palette:{mode:o,...t==null?void 0:t.palette}});return e[r]={...t,palette:i,opacity:{...zD(o),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||HD(o)},a}function $fe(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:a=Ofe,colorSchemeSelector:s=n.light&&n.dark?"media":void 0,rootSelector:l=":root",...u}=e,c=Object.keys(n)[0],d=r||(n.light&&c!=="light"?"light":c),f=Ufe(i),{[d]:p,light:h,dark:m,...E}=n,g={...E};let y=p;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(y=!0),!y)throw new Error(Wi(21,d));const v=Ny(g,y,u,d);h&&!g.light&&Ny(g,h,void 0,"light"),m&&!g.dark&&Ny(g,m,void 0,"dark");let S={defaultColorScheme:d,...v,cssVarPrefix:i,colorSchemeSelector:s,rootSelector:l,getCssVar:f,colorSchemes:g,font:{...vfe(v.typography),...v.font},spacing:Lfe(u.spacing)};Object.keys(S.colorSchemes).forEach(R=>{const w=S.colorSchemes[R].palette,_=k=>{const N=k.split("-"),F=N[1],U=N[2];return f(k,w[F][U])};if(w.mode==="light"&&(B(w.common,"background","#fff"),B(w.common,"onBackground","#000")),w.mode==="dark"&&(B(w.common,"background","#000"),B(w.common,"onBackground","#fff")),Ffe(w,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),w.mode==="light"){B(w.Alert,"errorColor",it(w.error.light,.6)),B(w.Alert,"infoColor",it(w.info.light,.6)),B(w.Alert,"successColor",it(w.success.light,.6)),B(w.Alert,"warningColor",it(w.warning.light,.6)),B(w.Alert,"errorFilledBg",_("palette-error-main")),B(w.Alert,"infoFilledBg",_("palette-info-main")),B(w.Alert,"successFilledBg",_("palette-success-main")),B(w.Alert,"warningFilledBg",_("palette-warning-main")),B(w.Alert,"errorFilledColor",No(()=>w.getContrastText(w.error.main))),B(w.Alert,"infoFilledColor",No(()=>w.getContrastText(w.info.main))),B(w.Alert,"successFilledColor",No(()=>w.getContrastText(w.success.main))),B(w.Alert,"warningFilledColor",No(()=>w.getContrastText(w.warning.main))),B(w.Alert,"errorStandardBg",at(w.error.light,.9)),B(w.Alert,"infoStandardBg",at(w.info.light,.9)),B(w.Alert,"successStandardBg",at(w.success.light,.9)),B(w.Alert,"warningStandardBg",at(w.warning.light,.9)),B(w.Alert,"errorIconColor",_("palette-error-main")),B(w.Alert,"infoIconColor",_("palette-info-main")),B(w.Alert,"successIconColor",_("palette-success-main")),B(w.Alert,"warningIconColor",_("palette-warning-main")),B(w.AppBar,"defaultBg",_("palette-grey-100")),B(w.Avatar,"defaultBg",_("palette-grey-400")),B(w.Button,"inheritContainedBg",_("palette-grey-300")),B(w.Button,"inheritContainedHoverBg",_("palette-grey-A100")),B(w.Chip,"defaultBorder",_("palette-grey-400")),B(w.Chip,"defaultAvatarColor",_("palette-grey-700")),B(w.Chip,"defaultIconColor",_("palette-grey-700")),B(w.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),B(w.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),B(w.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),B(w.LinearProgress,"primaryBg",at(w.primary.main,.62)),B(w.LinearProgress,"secondaryBg",at(w.secondary.main,.62)),B(w.LinearProgress,"errorBg",at(w.error.main,.62)),B(w.LinearProgress,"infoBg",at(w.info.main,.62)),B(w.LinearProgress,"successBg",at(w.success.main,.62)),B(w.LinearProgress,"warningBg",at(w.warning.main,.62)),B(w.Skeleton,"bg",`rgba(${_("palette-text-primaryChannel")} / 0.11)`),B(w.Slider,"primaryTrack",at(w.primary.main,.62)),B(w.Slider,"secondaryTrack",at(w.secondary.main,.62)),B(w.Slider,"errorTrack",at(w.error.main,.62)),B(w.Slider,"infoTrack",at(w.info.main,.62)),B(w.Slider,"successTrack",at(w.success.main,.62)),B(w.Slider,"warningTrack",at(w.warning.main,.62));const k=Op(w.background.default,.8);B(w.SnackbarContent,"bg",k),B(w.SnackbarContent,"color",No(()=>w.getContrastText(k))),B(w.SpeedDialAction,"fabHoverBg",Op(w.background.paper,.15)),B(w.StepConnector,"border",_("palette-grey-400")),B(w.StepContent,"border",_("palette-grey-400")),B(w.Switch,"defaultColor",_("palette-common-white")),B(w.Switch,"defaultDisabledColor",_("palette-grey-100")),B(w.Switch,"primaryDisabledColor",at(w.primary.main,.62)),B(w.Switch,"secondaryDisabledColor",at(w.secondary.main,.62)),B(w.Switch,"errorDisabledColor",at(w.error.main,.62)),B(w.Switch,"infoDisabledColor",at(w.info.main,.62)),B(w.Switch,"successDisabledColor",at(w.success.main,.62)),B(w.Switch,"warningDisabledColor",at(w.warning.main,.62)),B(w.TableCell,"border",at(Np(w.divider,1),.88)),B(w.Tooltip,"bg",Np(w.grey[700],.92))}if(w.mode==="dark"){B(w.Alert,"errorColor",at(w.error.light,.6)),B(w.Alert,"infoColor",at(w.info.light,.6)),B(w.Alert,"successColor",at(w.success.light,.6)),B(w.Alert,"warningColor",at(w.warning.light,.6)),B(w.Alert,"errorFilledBg",_("palette-error-dark")),B(w.Alert,"infoFilledBg",_("palette-info-dark")),B(w.Alert,"successFilledBg",_("palette-success-dark")),B(w.Alert,"warningFilledBg",_("palette-warning-dark")),B(w.Alert,"errorFilledColor",No(()=>w.getContrastText(w.error.dark))),B(w.Alert,"infoFilledColor",No(()=>w.getContrastText(w.info.dark))),B(w.Alert,"successFilledColor",No(()=>w.getContrastText(w.success.dark))),B(w.Alert,"warningFilledColor",No(()=>w.getContrastText(w.warning.dark))),B(w.Alert,"errorStandardBg",it(w.error.light,.9)),B(w.Alert,"infoStandardBg",it(w.info.light,.9)),B(w.Alert,"successStandardBg",it(w.success.light,.9)),B(w.Alert,"warningStandardBg",it(w.warning.light,.9)),B(w.Alert,"errorIconColor",_("palette-error-main")),B(w.Alert,"infoIconColor",_("palette-info-main")),B(w.Alert,"successIconColor",_("palette-success-main")),B(w.Alert,"warningIconColor",_("palette-warning-main")),B(w.AppBar,"defaultBg",_("palette-grey-900")),B(w.AppBar,"darkBg",_("palette-background-paper")),B(w.AppBar,"darkColor",_("palette-text-primary")),B(w.Avatar,"defaultBg",_("palette-grey-600")),B(w.Button,"inheritContainedBg",_("palette-grey-800")),B(w.Button,"inheritContainedHoverBg",_("palette-grey-700")),B(w.Chip,"defaultBorder",_("palette-grey-700")),B(w.Chip,"defaultAvatarColor",_("palette-grey-300")),B(w.Chip,"defaultIconColor",_("palette-grey-300")),B(w.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),B(w.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),B(w.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),B(w.LinearProgress,"primaryBg",it(w.primary.main,.5)),B(w.LinearProgress,"secondaryBg",it(w.secondary.main,.5)),B(w.LinearProgress,"errorBg",it(w.error.main,.5)),B(w.LinearProgress,"infoBg",it(w.info.main,.5)),B(w.LinearProgress,"successBg",it(w.success.main,.5)),B(w.LinearProgress,"warningBg",it(w.warning.main,.5)),B(w.Skeleton,"bg",`rgba(${_("palette-text-primaryChannel")} / 0.13)`),B(w.Slider,"primaryTrack",it(w.primary.main,.5)),B(w.Slider,"secondaryTrack",it(w.secondary.main,.5)),B(w.Slider,"errorTrack",it(w.error.main,.5)),B(w.Slider,"infoTrack",it(w.info.main,.5)),B(w.Slider,"successTrack",it(w.success.main,.5)),B(w.Slider,"warningTrack",it(w.warning.main,.5));const k=Op(w.background.default,.98);B(w.SnackbarContent,"bg",k),B(w.SnackbarContent,"color",No(()=>w.getContrastText(k))),B(w.SpeedDialAction,"fabHoverBg",Op(w.background.paper,.15)),B(w.StepConnector,"border",_("palette-grey-600")),B(w.StepContent,"border",_("palette-grey-600")),B(w.Switch,"defaultColor",_("palette-grey-300")),B(w.Switch,"defaultDisabledColor",_("palette-grey-600")),B(w.Switch,"primaryDisabledColor",it(w.primary.main,.55)),B(w.Switch,"secondaryDisabledColor",it(w.secondary.main,.55)),B(w.Switch,"errorDisabledColor",it(w.error.main,.55)),B(w.Switch,"infoDisabledColor",it(w.info.main,.55)),B(w.Switch,"successDisabledColor",it(w.success.main,.55)),B(w.Switch,"warningDisabledColor",it(w.warning.main,.55)),B(w.TableCell,"border",it(Np(w.divider,1),.68)),B(w.Tooltip,"bg",Np(w.grey[700],.92))}oi(w.background,"default"),oi(w.background,"paper"),oi(w.common,"background"),oi(w.common,"onBackground"),oi(w,"divider"),Object.keys(w).forEach(k=>{const N=w[k];k!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&B(w[k],"mainChannel",qc(Qc(N.main))),N.light&&B(w[k],"lightChannel",qc(Qc(N.light))),N.dark&&B(w[k],"darkChannel",qc(Qc(N.dark))),N.contrastText&&B(w[k],"contrastTextChannel",qc(Qc(N.contrastText))),k==="text"&&(oi(w[k],"primary"),oi(w[k],"secondary")),k==="action"&&(N.active&&oi(w[k],"active"),N.selected&&oi(w[k],"selected")))})}),S=t.reduce((R,w)=>bn(R,w),S);const x={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:a,getSelector:Mfe(S)},{vars:I,generateThemeVars:T,generateStyleSheets:A}=sfe(S,x);return S.vars=I,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([R,w])=>{S[R]=w}),S.generateThemeVars=T,S.generateStyleSheets=A,S.generateSpacing=function(){return OD(u.spacing,KE(this))},S.getColorSchemeSelector=lfe(s),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=a,S.unstable_sxConfig={...dv,...u==null?void 0:u.unstable_sxConfig},S.unstable_sx=function(w){return Au({sx:w,theme:this})},S.toRuntimeSource=BD,S}function yA(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:cw({...n===!0?{}:n.palette,mode:t})})}function jfe(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...a}=e,s=i||"light",l=o==null?void 0:o[s],u={...o,...n?{[s]:{...typeof l!="boolean"&&l,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return KS(e,...t);let c=n;"palette"in e||u[s]&&(u[s]!==!0?c=u[s].palette:s==="dark"&&(c={mode:"dark"}));const d=KS({...e,palette:c},...t);return d.defaultColorScheme=s,d.colorSchemes=u,d.palette.mode==="light"&&(d.colorSchemes.light={...u.light!==!0&&u.light,palette:d.palette},yA(d,"dark",u.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:d.palette},yA(d,"light",u.light)),d}return!n&&!("light"in u)&&s==="light"&&(u.light=!0),$fe({...a,colorSchemes:u,defaultColorScheme:s,...typeof r!="boolean"&&r},...t)}const dw=jfe(),fw="$$material";function sc(){const e=DD(dw);return e[fw]||e}function Bfe(e){return C.jsx(Bde,{...e,defaultTheme:dw,themeId:fw})}function WD(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const To=e=>WD(e)&&e!=="classes",pe=Vde({themeId:fw,defaultTheme:dw,rootShouldForwardProp:To});function zfe(e){return function(n){return C.jsx(Bfe,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}const vt=rfe;function $t(e){return nfe(e)}function Hfe(e){return Dt("MuiSvgIcon",e)}ht("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Wfe=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${It(t)}`,`fontSize${It(n)}`]};return Ot(o,Hfe,r)},Vfe=pe("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${It(n.color)}`],t[`fontSize${It(n.fontSize)}`]]}})(vt(({theme:e})=>{var t,n,r,o,i,a,s,l,u,c,d,f,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((a=(i=e.typography)==null?void 0:i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((c=(u=e.typography)==null?void 0:u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,m])=>m&&m.main).map(([m])=>{var E,g;return{props:{color:m},style:{color:(g=(E=(e.vars??e).palette)==null?void 0:E[m])==null?void 0:g.main}}}),{props:{color:"action"},style:{color:(f=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:f.active}},{props:{color:"disabled"},style:{color:(h=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:h.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),qS=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:d,viewBox:f="0 0 24 24",...p}=r,h=b.isValidElement(o)&&o.type==="svg",m={...r,color:a,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:f,hasSvgAsChild:h},E={};c||(E.viewBox=f);const g=Wfe(m);return C.jsxs(Vfe,{as:s,className:Te(g.root,i),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n,...E,...p,...h&&o.props,ownerState:m,children:[h?o.props.children:o,d?C.jsx("title",{children:d}):null]})});qS.muiName="SvgIcon";function we(e,t){function n(r,o){return C.jsx(qS,{"data-testid":`${t}Icon`,ref:o,...r,children:e})}return n.muiName=qS.muiName,b.memo(b.forwardRef(n))}function VD(e,t){if(!e)return t;if(typeof e=="function"||typeof t=="function")return o=>{const i=typeof t=="function"?t(o):t,a=typeof e=="function"?e({...o,...i}):e,s=Te(o==null?void 0:o.className,i==null?void 0:i.className,a==null?void 0:a.className);return{...i,...a,...!!s&&{className:s},...(i==null?void 0:i.style)&&(a==null?void 0:a.style)&&{style:{...i.style,...a.style}},...(i==null?void 0:i.sx)&&(a==null?void 0:a.sx)&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};const n=t,r=Te(n==null?void 0:n.className,e==null?void 0:e.className);return{...t,...e,...!!r&&{className:r},...(n==null?void 0:n.style)&&(e==null?void 0:e.style)&&{style:{...n.style,...e.style}},...(n==null?void 0:n.sx)&&(e==null?void 0:e.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const KD=we(C.jsx("path",{d:"M11 9H9V2H7v7H5V2H3v7c0 2.12 1.66 3.84 3.75 3.97V22h2.5v-9.03C11.34 12.84 13 11.12 13 9V2h-2zm5-3v8h2.5v8H21V2c-2.76 0-5 2.24-5 4"}),"Restaurant"),GD=we([C.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 9c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3"},"0"),C.jsx("path",{d:"M10 8.5h1v1h-1zm1.5 0h1v1h-1zm1.5 0h1v1h-1z"},"1")],"MonitorWeight"),Kfe=we(C.jsx("path",{d:"M19.88 18.47c.44-.7.7-1.51.7-2.39 0-2.49-2.01-4.5-4.5-4.5s-4.5 2.01-4.5 4.5 2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21.58 23 23 21.58zm-3.8.11c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5m-.36-8.5c-.74.02-1.45.18-2.1.45l-.55-.83-3.8 6.18-3.01-3.52-3.63 5.81L1 17l5-8 3 3.5L13 6zm2.59.5c-.64-.28-1.33-.45-2.05-.49L21.38 2 23 3.18z"}),"QueryStats"),Gfe=we(C.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}),"FormatQuote"),qfe=we([C.jsx("circle",{cx:"10",cy:"8",r:"4"},"0"),C.jsx("path",{d:"M10.67 13.02c-.22-.01-.44-.02-.67-.02-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.79-1.13-1.26-2.51-1.26-4 0-1.07.25-2.07.67-2.98M20.75 16c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49q-.48-.405-1.08-.63L18 11h-2l-.3 1.49q-.6.225-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49q.48.405 1.08.63L16 21h2l.3-1.49q.6-.225 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63M17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"},"1")],"ManageAccounts"),qD=we(C.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos"),QD=we(C.jsx("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIos"),Qfe=we(C.jsx("path",{fillRule:"evenodd",d:"M19.28 16.34c-1.21-.89-1.82-1.34-1.82-1.34s.32-.59.96-1.78c.38-.59 1.22-.59 1.6 0l.81 1.26c.19.3.21.68.06 1l-.22.47c-.25.54-.91.72-1.39.39m-14.56 0c-.48.33-1.13.15-1.39-.38l-.23-.47c-.15-.32-.13-.7.06-1l.81-1.26c.38-.59 1.22-.59 1.6 0 .65 1.18.97 1.77.97 1.77s-.61.45-1.82 1.34m10.64-6.97c.09-.68.73-1.06 1.27-.75l1.59.9c.46.26.63.91.36 1.41L16.5 15h-1.8zm-6.73 0L9.3 15H7.5l-2.09-4.08c-.27-.5-.1-1.15.36-1.41l1.59-.9c.53-.3 1.18.08 1.27.76M13.8 15h-3.6l-.74-6.88c-.07-.59.35-1.12.88-1.12h3.3c.53 0 .94.53.88 1.12z"}),"BakeryDining"),Yfe=we(C.jsx("path",{d:"M16 11V5h4c1.1 0 2 .9 2 2v4zm4 8c1.1 0 2-.9 2-2v-4h-6v6zM14 5v14H4c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2zm-4.5 7c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5"}),"Bento"),Xfe=we(C.jsx("path",{fillRule:"evenodd",d:"M18 3H6C3.79 3 2 4.79 2 7c0 1.48.81 2.75 2 3.45V19c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8.55c1.19-.69 2-1.97 2-3.45 0-2.21-1.79-4-4-4m-4 12h-4v-4h4z"}),"BreakfastDining"),Jfe=we(C.jsx("path",{fillRule:"evenodd",d:"M18 8h2V4h-2zm-2.49 14H2.49c-.27 0-.49-.22-.49-.5V20h14v1.5c0 .28-.22.5-.49.5M18 15.89l-.4-.42c-1.02-1.08-1.6-2.52-1.6-4V2h6v9.51c0 1.46-.54 2.87-1.53 3.94l-.47.52V20h2v2h-4zM7 16v-2h4v2h4.5c.28 0 .5.22.5.5v1c0 .28-.22.5-.5.5h-13c-.28 0-.5-.22-.5-.5v-1c0-.28.22-.5.5-.5z"}),"BrunchDining"),Zfe=we(C.jsx("path",{d:"M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2m4.6 9.99-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01M18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9"}),"Cake"),km=we(C.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),epe=we(C.jsx("path",{d:"M2 19h20l-2 2H4zM5 6h1v1H5zm0-2h1v1H5zm4 0v1H7V4zm0 3H7V6h2zm-3 8.23c-.36.11-.69.28-1 .47V8h1zm-2 1.29c-.38.44-.68.93-.84 1.48h16.82c.01-.16.03-.33.03-.5 0-3.04-2.46-5.5-5.5-5.5-2.29 0-4.25 1.4-5.08 3.4-.59-.25-1.24-.4-1.93-.4-.17 0-.33.02-.5.04V8h2c1.03.06 1.9-.96 2-2h10V5H11c-.1-1.05-.97-1.97-2-2H3v1h1v1H3v1h1v1H3v1h1z"}),"DinnerDining"),tpe=we(C.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),npe=we(C.jsx("path",{d:"M12 3C8.5 3 5 9.33 5 14c0 3.87 3.13 7 7 7s7-3.13 7-7c0-4.67-3.5-11-7-11m1 15c-3 0-5-1.99-5-5 0-.55.45-1 1-1s1 .45 1 1c0 2.92 2.42 3 3 3 .55 0 1 .45 1 1s-.45 1-1 1"}),"Egg"),rpe=we(C.jsx("path",{d:"M19 9c-2-2-3.01-7-9.03-7C4.95 2 1.94 6 2 11.52S6.96 19 9.97 19c2.01 0 2.01 3 6.02 3C19 22 22 19 22 15.02 22 12 21.01 11 19 9m-7 6.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5"}),"EggAlt"),ope=we(C.jsx("path",{d:"M20 3H9v2.4l1.81 1.45c.12.09.19.24.19.39v4.26c0 .28-.22.5-.5.5h-4c-.28 0-.5-.22-.5-.5V7.24c0-.15.07-.3.19-.39L8 5.4V3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2m0 5h-2V5h2zM4 19h16v2H4z"}),"EmojiFoodBeverage"),ipe=we(C.jsx("path",{d:"M18.06 22.99h1.66c.84 0 1.53-.64 1.63-1.46L23 5.05h-5V1h-1.97v4.05h-4.97l.3 2.34c1.71.47 3.31 1.32 4.27 2.26 1.44 1.42 2.43 2.89 2.43 5.29zM1 21.99V21h15.03v.99c0 .55-.45 1-1.01 1H2.01c-.56 0-1.01-.45-1.01-1m15.03-7c0-8-15.03-8-15.03 0zM1.02 17h15v2h-15z"}),"Fastfood"),ape=we(C.jsx("path",{d:"M12 3 4 9v12h16V9zm.5 9.5c0 .83-.67 1.5-1.5 1.5v4h-1v-4c-.83 0-1.5-.67-1.5-1.5v-3h1v3h.5v-3h1v3h.5v-3h1zM15 18h-1v-3.5h-1v-3c0-1.1.9-2 2-2z"}),"FoodBank"),spe=we(C.jsx("path",{d:"M13 6.99h3L12 3 8 6.99h3v10.02H8L12 21l4-3.99h-3z"}),"Height"),lpe=we(C.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),upe=we(C.jsx("path",{fillRule:"evenodd",d:"m8.79 12.4 3.26 6.22 3.17-6.21c-.11-.08-.21-.16-.3-.25-.84.53-1.85.84-2.92.84s-2.08-.31-2.92-.84c-.09.09-.19.17-.29.24m-1.96.59C5.25 12.9 4 11.6 4 10c0-1.49 1.09-2.73 2.52-2.96C6.75 4.22 9.12 2 12 2s5.25 2.22 5.48 5.04C18.91 7.27 20 8.51 20 10c0 1.59-1.24 2.9-2.81 2.99L12.07 23z"}),"Icecream"),cpe=we(C.jsx("path",{d:"M7.75 8H11v5H7.75v1h.75c1.38 0 2.5 1.12 2.5 2.5S9.88 19 8.5 19h-.75v4h-1.5v-4H5.5C4.12 19 3 17.88 3 16.5S4.12 14 5.5 14h.75v-1H3V8h3.25V7H5.5C4.12 7 3 5.88 3 4.5S4.12 2 5.5 2h.75V1h1.5v1h.75C9.88 2 11 3.12 11 4.5S9.88 7 8.5 7h-.75zm10-1h.75C19.88 7 21 5.88 21 4.5S19.88 2 18.5 2h-.75V1h-1.5v1h-.75C14.12 2 13 3.12 13 4.5S14.12 7 15.5 7h.75v1H13v5h3.25v1h-.75c-1.38 0-2.5 1.12-2.5 2.5s1.12 2.5 2.5 2.5h.75v4h1.5v-4h.75c1.38 0 2.5-1.12 2.5-2.5S19.88 14 18.5 14h-.75v-1H21V8h-3.25z"}),"KebabDining"),dpe=we(C.jsx("path",{d:"M20 9V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v5zM8 5h2v3H8zm-4 6v9c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-9zm6 6H8v-5h2z"}),"Kitchen"),fpe=we(C.jsx("path",{d:"M3 14c0 1.3.84 2.4 2 2.82V20H3v2h6v-2H7v-3.18C8.16 16.4 9 15.3 9 14V6H3zm2-6h2v3H5zm15.63.54-.95-.32c-.4-.13-.68-.51-.68-.94V3c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v4.28c0 .43-.28.81-.68.95l-.95.32c-.82.27-1.37 1.03-1.37 1.89V20c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-9.56c0-.86-.55-1.62-1.37-1.9M16 4h1v1h-1zm-3 6.44.95-.32C15.18 9.72 16 8.57 16 7.28V7h1v.28c0 1.29.82 2.44 2.05 2.85l.95.31V12h-7zM20 20h-7v-2h7z"}),"Liquor"),ppe=we(C.jsx("path",{d:"M21 5V3H3v2l8 9v5H6v2h12v-2h-5v-5zM7.43 7 5.66 5h12.69l-1.78 2z"}),"LocalBar"),hpe=we(C.jsx("path",{d:"M20 3H4v10c0 2.21 1.79 4 4 4h6c2.21 0 4-1.79 4-4v-3h2c1.11 0 2-.9 2-2V5c0-1.11-.89-2-2-2m0 5h-2V5h2zM4 19h16v2H4z"}),"LocalCafe"),mpe=we(C.jsx("path",{d:"m8.1 13.34 2.83-2.83L3.91 3.5c-1.56 1.56-1.56 4.09 0 5.66zm6.78-1.81c1.53.71 3.68.21 5.27-1.38 1.91-1.91 2.28-4.65.81-6.12-1.46-1.46-4.2-1.1-6.12.81-1.59 1.59-2.09 3.74-1.38 5.27L3.7 19.87l1.41 1.41L12 14.41l6.88 6.88 1.41-1.41L13.41 13z"}),"LocalDining"),gpe=we(C.jsx("path",{d:"M12 2C8.43 2 5.23 3.54 3.01 6L12 22l8.99-16C18.78 3.55 15.57 2 12 2M7 7c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2m5 8c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"LocalPizza"),vpe=we(C.jsx("path",{fillRule:"evenodd",d:"M22 10c.32-3.28-4.28-6-9.99-6S1.7 6.72 2.02 10zM5.35 13.5c.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.64 2.18.64s1.73-.37 2.18-.64c.37-.23.59-.36 1.15-.36.55 0 .78.14 1.15.36.45.27 1.07.63 2.17.64v-1.98s-.79-.16-1.16-.38c-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.6.36-1.15.36s-.78-.14-1.15-.36c-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.59.36-1.15.36-.55 0-.78-.14-1.15-.36-.45-.27-1.07-.64-2.18-.64s-1.73.37-2.18.64c-.37.23-.59.36-1.15.36v2c1.11 0 1.73-.37 2.21-.64.37-.23.59-.36 1.14-.36M2 16v2c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-2z"}),"LunchDining"),ype=we(C.jsx("path",{d:"M1 5h14l-6 9v4h2v2H5v-2h2v-4zm9.1 4 1.4-2H4.49l1.4 2zM17 5h5v3h-3v9c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3c.35 0 .69.06 1 .17z"}),"Nightlife"),Spe=we(C.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),bpe=we(C.jsx("path",{d:"M9 6H8V4.65l1-.12zm0 6H8V7h1zM6 7h1v5H6zm0-2.12 1-.12V6H6zM22 3V2L5 4v8H2c0 3.69 2.47 6.86 6 8.25V22h8v-1.75c3.53-1.39 6-4.56 6-8.25H10V7h12V6H10V4.41z"}),"RamenDining"),Epe=we(C.jsx("path",{d:"m8.1 13.34 2.83-2.83L3.91 3.5c-1.56 1.56-1.56 4.09 0 5.66zm6.78-1.81c1.53.71 3.68.21 5.27-1.38 1.91-1.91 2.28-4.65.81-6.12-1.46-1.46-4.2-1.1-6.12.81-1.59 1.59-2.09 3.74-1.38 5.27L3.7 19.87l1.41 1.41L12 14.41l6.88 6.88 1.41-1.41L13.41 13z"}),"RestaurantMenu"),wpe=we(C.jsx("path",{d:"M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 3.69 2.47 6.86 6 8.25V22h8v-1.75c3.53-1.39 6-4.56 6-8.25m-2 0h-4V5.08c2.39 1.39 4 3.97 4 6.92m-6-7.74V12h-4V4.26c.64-.16 1.31-.26 2-.26s1.36.1 2 .26M4 12c0-2.95 1.61-5.53 4-6.92V12z"}),"RiceBowl"),Cpe=we(C.jsx("path",{d:"m21.05 17.56-17.97.94L3 17l17.98-.94zM21 19.48H3v1.5h18zM22 5v7c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2m-2 1c-1.68 0-3.04.98-3.21 2.23-.64-.73-2.73-2.73-6.54-2.73-4.67 0-6.75 3-6.75 3s2.08 3 6.75 3c3.81 0 5.9-2 6.54-2.73C16.96 10.02 18.32 11 20 11z"}),"SetMeal"),xpe=we(C.jsx("path",{d:"M6.4 7c-.34.55-.4.97-.4 1.38C6 9.15 7 11 7 12c0 .95-.4 1.5-.4 1.5H5.1s.4-.55.4-1.5c0-1-1-2.85-1-3.62 0-.41.06-.83.4-1.38zm5 0c-.34.55-.4.97-.4 1.38 0 .77 1 2.62 1 3.62 0 .95-.4 1.5-.4 1.5h1.5s.4-.55.4-1.5c0-1-1-2.85-1-3.62 0-.41.06-.83.4-1.38zM8.15 7c-.34.55-.4.97-.4 1.38 0 .77 1 2.63 1 3.62 0 .95-.4 1.5-.4 1.5h1.5s.4-.55.4-1.5c0-1-1-2.85-1-3.62 0-.41.06-.83.4-1.38zm13.32-.5s.13-1.06.13-1.5c0-1.65-1.35-3-3-3-1.54 0-2.81 1.16-2.98 2.65L14.53 15H4.01c-.6 0-1.09.53-1 1.13C3.53 19.46 6.39 22 9.75 22c3.48 0 6.34-2.73 6.71-6.23L17.61 4.9c.05-.51.47-.9.99-.9.55 0 1 .45 1 1 0 .3-.1 1.25-.1 1.25z"}),"SoupKitchen"),Ipe=we(C.jsx("path",{fillRule:"evenodd",d:"M5.26 11h13.48l-.67 9H5.93zm3.76-7h5.95L19 7.38l1.59-1.59L22 7.21 19.21 10H4.79L2 7.21 3.41 5.8 5 7.38z"}),"TakeoutDining"),Tpe=we(C.jsx("path",{d:"M22 10V1h-8v9c0 1.86 1.28 3.41 3 3.86V21h-2v2h6v-2h-2v-7.14c1.72-.45 3-2 3-3.86m-2-7v3h-4V3zm-7.5 8.5c0 1.38-1.12 2.5-2.5 2.5H8v9H6v-9H4c-1.38 0-2.5-1.12-2.5-2.5S2.62 9 4 9h2V8H4C2.62 8 1.5 6.88 1.5 5.5S2.62 3 4 3h2V1h2v2h2c1.38 0 2.5 1.12 2.5 2.5S11.38 8 10 8H8v1h2c1.38 0 2.5 1.12 2.5 2.5"}),"Tapas");function Ape(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function _pe(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function pw(e,t){const n=Ape(e);return isNaN(t)?_pe(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Ar(e,t){return pw(e,-t)}function Rpe(){return Qs({queryKey:["goal"],queryFn:async()=>{const{data:e}=await ke.models.Goal.list({limit:5e3});return e[0]}})}function Ppe(){const e=Jn();return Jo({mutationFn:async t=>{const n=e.getQueryData(["goal"]);if(n!=null&&n.id){const{data:r}=await ke.models.Goal.update({id:n.id,...t});return r}else{const{data:r}=await ke.models.Goal.create(t);return r}},onSuccess:()=>{e.invalidateQueries({queryKey:["goal"]})}})}function YD(){return Qs({queryKey:["quickAdd"],queryFn:async()=>{const{data:e}=await ke.models.QuickAdd.list({limit:5e3});return e}})}function kpe(){const e=Jn();return Jo({mutationFn:async t=>{const{data:n}=await ke.models.QuickAdd.create(t);return n},onSuccess:()=>{e.invalidateQueries({queryKey:["quickAdd"]})}})}function Npe(){const e=Jn();return Jo({mutationFn:async t=>{await ke.models.QuickAdd.delete({id:t})},onSuccess:()=>{e.invalidateQueries({queryKey:["quickAdd"]})}})}function Av(){return Qs({queryKey:["preferences"],queryFn:async()=>{const{data:e}=await ke.models.Preferences.list({limit:5e3});return e[0]}})}function Ope(){const e=Jn();return Jo({mutationFn:async t=>{const n=e.getQueryData(["preferences"]);if(n!=null&&n.id){const{data:r}=await ke.models.Preferences.update({id:n.id,...t});return r}else{const{data:r}=await ke.models.Preferences.create(t);return r}},onSuccess:()=>{e.invalidateQueries({queryKey:["preferences"]})}})}const Dpe=el("HealthKitStats"),Mpe=async e=>{if(go.getPlatform()!=="ios")return{activeCalories:0,baseCalories:0,weight:0,steps:0};const t=performance.now(),n=await Dpe.getDayStats({date:e.toISOString()});return console.log(`[HK ${e.toLocaleDateString()}] ${(performance.now()-t).toFixed(0)}ms`),{activeCalories:n.activeCalories,baseCalories:n.baseCalories,weight:0,steps:n.steps}},Yc=new Set,Fpe=e=>Yc.delete(e);function ra(e){const t=e.toLocaleDateString(),{data:n=[],isLoading:r}=or(t),o=Lpe(),i=Upe(),[a,s]=b.useState(!1),l=new Date().toLocaleDateString(),u=t===l,c=n[0];return b.useEffect(()=>{if(go.getPlatform()!=="ios"||r||!u&&c||Yc.has(t))return;(async()=>{s(!0),Yc.add(t);try{const f=await Mpe(e);if(f.activeCalories===0&&f.baseCalories===0)return;const p={day:t,activeCalories:f.activeCalories,baseCalories:f.baseCalories,weight:f.weight>0?f.weight:void 0,steps:f.steps>0?f.steps:void 0};c?i.mutate({id:c.id,...p}):o.mutate(p)}finally{s(!1),u&&setTimeout(()=>Yc.delete(t),3e4)}})().catch(()=>{Yc.delete(t)})},[t,u,c==null?void 0:c.id,r]),{isFetching:a}}function or(e){const{user:t}=Cf();return Qs({queryKey:["healthKitCache",e],queryFn:async()=>{const{data:n}=await ke.models.HealthKitCache.listHealthKitCacheByDay({day:e});return n},enabled:!!t})}function Lpe(){const e=Jn();return Jo({mutationFn:async t=>{const{data:n,errors:r}=await ke.models.HealthKitCache.create(t);if(r!=null&&r.length)throw console.error("[HealthKitCache] create failed:",r),new Error(r[0].message);return n},onMutate:async t=>{await e.cancelQueries({queryKey:["healthKitCache",t.day]});const n=e.getQueryData(["healthKitCache",t.day]);return e.setQueryData(["healthKitCache",t.day],(r=[])=>[{...t,id:"temp-"+Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),owner:""},...r]),{previous:n,day:t.day}},onError:(t,n,r)=>{r!=null&&r.previous&&e.setQueryData(["healthKitCache",r.day],r.previous),Fpe(n.day)},onSettled:(t,n,r)=>{e.invalidateQueries({queryKey:["healthKitCache",r.day]})}})}function Upe(){const e=Jn();return Jo({mutationFn:async t=>{const{data:n,errors:r}=await ke.models.HealthKitCache.update(t);if(r!=null&&r.length)throw console.error("[HealthKitCache] update failed:",r),new Error(r[0].message);return n},onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["healthKitCache",n.day]})}})}function Jt(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:u,slots:c={[e]:void 0},slotProps:d={[e]:void 0},...f}=i,p=c[e]||r,h=pD(d[e],o),{props:{component:m,...E},internalRef:g}=fD({className:n,...l,externalForwardedProps:e==="root"?f:void 0,externalSlotProps:h}),y=Vt(g,h==null?void 0:h.ref,t.ref),v=e==="root"?m||u:m,S=uD(p,{...e==="root"&&!u&&!c[e]&&a,...e!=="root"&&!c[e]&&a,...E,...v&&!s&&{as:v},...v&&s&&{component:v},ref:y},o);return[p,S]}function XD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function QS(e,t){return QS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},QS(e,t)}function JD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,QS(e,t)}const SA={disabled:!1},Nm=O.createContext(null);var $pe=function(t){return t.scrollTop},Xc="unmounted",os="exited",is="entering",Sl="entered",YS="exiting",Ao=function(e){JD(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,s=a&&!a.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?s?(l=os,i.appearStatus=is):l=Sl:r.unmountOnExit||r.mountOnEnter?l=Xc:l=os,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Xc?{status:os}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==is&&a!==Sl&&(i=is):(a===is||a===Sl)&&(i=YS)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,s;return i=a=s=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,s=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===is){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:ap.findDOMNode(this);a&&$pe(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===os&&this.setState({status:Xc})},n.performEnter=function(o){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:o,l=this.props.nodeRef?[s]:[ap.findDOMNode(this),s],u=l[0],c=l[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!o&&!a||SA.disabled){this.safeSetState({status:Sl},function(){i.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:is},function(){i.props.onEntering(u,c),i.onTransitionEnd(f,function(){i.safeSetState({status:Sl},function(){i.props.onEntered(u,c)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:ap.findDOMNode(this);if(!i||SA.disabled){this.safeSetState({status:os},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:YS},function(){o.props.onExiting(s),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:os},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,o(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:ap.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Xc)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=XD(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return O.createElement(Nm.Provider,{value:null},typeof a=="function"?a(o,s):O.cloneElement(O.Children.only(a),s))},t}(O.Component);Ao.contextType=Nm;Ao.propTypes={};function gl(){}Ao.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:gl,onEntering:gl,onEntered:gl,onExit:gl,onExiting:gl,onExited:gl};Ao.UNMOUNTED=Xc;Ao.EXITED=os;Ao.ENTERING=is;Ao.ENTERED=Sl;Ao.EXITING=YS;function jpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hw(e,t){var n=function(i){return t&&b.isValidElement(i)?t(i):i},r=Object.create(null);return e&&b.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function Bpe(e,t){e=e||{},t=t||{};function n(c){return c in t?t[c]:e[c]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var l in t){if(r[l])for(a=0;ae.scrollTop;function Ru(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}const Kpe={entering:{opacity:1},entered:{opacity:1}},Gpe=b.forwardRef(function(t,n){const r=sc(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:s,easing:l,in:u,onEnter:c,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:E,timeout:g=o,TransitionComponent:y=Ao,...v}=t,S=b.useRef(null),x=Vt(S,al(s),n),I=F=>U=>{if(F){const $=S.current;U===void 0?F($):F($,U)}},T=I(f),A=I((F,U)=>{gw(F);const $=Ru({style:E,timeout:g,easing:l},{mode:"enter"});F.style.webkitTransition=r.transitions.create("opacity",$),F.style.transition=r.transitions.create("opacity",$),c&&c(F,U)}),R=I(d),w=I(m),_=I(F=>{const U=Ru({style:E,timeout:g,easing:l},{mode:"exit"});F.style.webkitTransition=r.transitions.create("opacity",U),F.style.transition=r.transitions.create("opacity",U),p&&p(F)}),k=I(h),N=F=>{i&&i(S.current,F)};return C.jsx(y,{appear:a,in:u,nodeRef:S,onEnter:A,onEntered:R,onEntering:T,onExit:_,onExited:k,onExiting:w,addEndListener:N,timeout:g,...v,children:(F,{ownerState:U,...$})=>b.cloneElement(s,{style:{opacity:0,visibility:F==="exited"&&!u?"hidden":void 0,...Kpe[F],...E,...s.props.style},ref:x,...$})})});function qpe(e){return Dt("MuiBackdrop",e)}ht("MuiBackdrop",["root","invisible"]);const Qpe=e=>{const{classes:t,invisible:n}=e;return Ot({root:["root",n&&"invisible"]},qpe,t)},Ype=pe("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),ZD=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:a="div",invisible:s=!1,open:l,components:u={},componentsProps:c={},slotProps:d={},slots:f={},TransitionComponent:p,transitionDuration:h,...m}=r,E={...r,component:a,invisible:s},g=Qpe(E),y={transition:p,root:u.Root,...f},v={...c,...d},S={slots:y,slotProps:v},[x,I]=Jt("root",{elementType:Ype,externalForwardedProps:S,className:Te(g.root,i),ownerState:E}),[T,A]=Jt("transition",{elementType:Gpe,externalForwardedProps:S,ownerState:E});return C.jsx(T,{in:l,timeout:h,...m,...A,children:C.jsx(x,{"aria-hidden":!0,...I,classes:g,ref:n,children:o})})}),Xpe={entering:{transform:"none"},entered:{transform:"none"}},Jpe=b.forwardRef(function(t,n){const r=sc(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:s,easing:l,in:u,onEnter:c,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:E,timeout:g=o,TransitionComponent:y=Ao,...v}=t,S=b.useRef(null),x=Vt(S,al(s),n),I=F=>U=>{if(F){const $=S.current;U===void 0?F($):F($,U)}},T=I(f),A=I((F,U)=>{gw(F);const $=Ru({style:E,timeout:g,easing:l},{mode:"enter"});F.style.webkitTransition=r.transitions.create("transform",$),F.style.transition=r.transitions.create("transform",$),c&&c(F,U)}),R=I(d),w=I(m),_=I(F=>{const U=Ru({style:E,timeout:g,easing:l},{mode:"exit"});F.style.webkitTransition=r.transitions.create("transform",U),F.style.transition=r.transitions.create("transform",U),p&&p(F)}),k=I(h),N=F=>{i&&i(S.current,F)};return C.jsx(y,{appear:a,in:u,nodeRef:S,onEnter:A,onEntered:R,onEntering:T,onExit:_,onExited:k,onExiting:w,addEndListener:N,timeout:g,...v,children:(F,{ownerState:U,...$})=>b.cloneElement(s,{style:{transform:"scale(0)",visibility:F==="exited"&&!u?"hidden":void 0,...Xpe[F],...E,...s.props.style},ref:x,...$})})});class Om{constructor(){lc(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new Om}static use(){const t=aD(Om.create).current,[n,r]=b.useState(!1);return t.shouldMount=n,t.setShouldMount=r,b.useEffect(t.mountEffect,[n]),t}mount(){return this.mounted||(this.mounted=ehe(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...t)})}stop(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...t)})}pulsate(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...t)})}}function Zpe(){return Om.use()}function ehe(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function the(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:a,in:s,onExited:l,timeout:u}=e,[c,d]=b.useState(!1),f=Te(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},h=Te(n.child,c&&n.childLeaving,r&&n.childPulsate);return!s&&!c&&d(!0),b.useEffect(()=>{if(!s&&l!=null){const m=setTimeout(l,u);return()=>{clearTimeout(m)}}},[l,s,u]),C.jsx("span",{className:f,style:p,children:C.jsx("span",{className:h})})}const Or=ht("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),XS=550,nhe=80,rhe=ow` 0% { transform: scale(0); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } `,ohe=ow` 0% { opacity: 1; } 100% { opacity: 0; } `,ihe=ow` 0% { transform: scale(1); } 50% { transform: scale(0.92); } 100% { transform: scale(1); } `,ahe=pe("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),she=pe(the,{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; &.${Or.rippleVisible} { opacity: 0.3; transform: scale(1); animation-name: ${rhe}; animation-duration: ${XS}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } &.${Or.ripplePulsate} { animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; } & .${Or.child} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${Or.childLeaving} { opacity: 0; animation-name: ${ohe}; animation-duration: ${XS}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } & .${Or.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${ihe}; animation-duration: 2500ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; animation-iteration-count: infinite; animation-delay: 200ms; } `,lhe=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:a,...s}=r,[l,u]=b.useState([]),c=b.useRef(0),d=b.useRef(null);b.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=b.useRef(!1),p=fs(),h=b.useRef(null),m=b.useRef(null),E=b.useCallback(S=>{const{pulsate:x,rippleX:I,rippleY:T,rippleSize:A,cb:R}=S;u(w=>[...w,C.jsx(she,{classes:{ripple:Te(i.ripple,Or.ripple),rippleVisible:Te(i.rippleVisible,Or.rippleVisible),ripplePulsate:Te(i.ripplePulsate,Or.ripplePulsate),child:Te(i.child,Or.child),childLeaving:Te(i.childLeaving,Or.childLeaving),childPulsate:Te(i.childPulsate,Or.childPulsate)},timeout:XS,pulsate:x,rippleX:I,rippleY:T,rippleSize:A},c.current)]),c.current+=1,d.current=R},[i]),g=b.useCallback((S={},x={},I=()=>{})=>{const{pulsate:T=!1,center:A=o||x.pulsate,fakeElement:R=!1}=x;if((S==null?void 0:S.type)==="mousedown"&&f.current){f.current=!1;return}(S==null?void 0:S.type)==="touchstart"&&(f.current=!0);const w=R?null:m.current,_=w?w.getBoundingClientRect():{width:0,height:0,left:0,top:0};let k,N,F;if(A||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)k=Math.round(_.width/2),N=Math.round(_.height/2);else{const{clientX:U,clientY:$}=S.touches&&S.touches.length>0?S.touches[0]:S;k=Math.round(U-_.left),N=Math.round($-_.top)}if(A)F=Math.sqrt((2*_.width**2+_.height**2)/3),F%2===0&&(F+=1);else{const U=Math.max(Math.abs((w?w.clientWidth:0)-k),k)*2+2,$=Math.max(Math.abs((w?w.clientHeight:0)-N),N)*2+2;F=Math.sqrt(U**2+$**2)}S!=null&&S.touches?h.current===null&&(h.current=()=>{E({pulsate:T,rippleX:k,rippleY:N,rippleSize:F,cb:I})},p.start(nhe,()=>{h.current&&(h.current(),h.current=null)})):E({pulsate:T,rippleX:k,rippleY:N,rippleSize:F,cb:I})},[o,E,p]),y=b.useCallback(()=>{g({},{pulsate:!0})},[g]),v=b.useCallback((S,x)=>{if(p.clear(),(S==null?void 0:S.type)==="touchend"&&h.current){h.current(),h.current=null,p.start(0,()=>{v(S,x)});return}h.current=null,u(I=>I.length>0?I.slice(1):I),d.current=x},[p]);return b.useImperativeHandle(n,()=>({pulsate:y,start:g,stop:v}),[y,g,v]),C.jsx(ahe,{className:Te(Or.root,i.root,a),ref:m,...s,children:C.jsx(mw,{component:null,exit:!0,children:l})})});function uhe(e){return Dt("MuiButtonBase",e)}const che=ht("MuiButtonBase",["root","disabled","focusVisible"]),dhe=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,a=Ot({root:["root",t&&"disabled",n&&"focusVisible"]},uhe,o);return n&&r&&(a.root+=` ${r}`),a},fhe=pe("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${che.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),e5=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:a,className:s,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:f=!1,focusVisibleClassName:p,LinkComponent:h="a",onBlur:m,onClick:E,onContextMenu:g,onDragLeave:y,onFocus:v,onFocusVisible:S,onKeyDown:x,onKeyUp:I,onMouseDown:T,onMouseLeave:A,onMouseUp:R,onTouchEnd:w,onTouchMove:_,onTouchStart:k,tabIndex:N=0,TouchRippleProps:F,touchRippleRef:U,type:$,...j}=r,M=b.useRef(null),D=Zpe(),z=Vt(D.ref,U),[K,ae]=b.useState(!1);u&&K&&ae(!1),b.useImperativeHandle(o,()=>({focusVisible:()=>{ae(!0),M.current.focus()}}),[]);const Ie=D.shouldMount&&!c&&!u;b.useEffect(()=>{K&&f&&!c&&D.pulsate()},[c,f,K,D]);const ne=ii(D,"start",T,d),ce=ii(D,"stop",g,d),Le=ii(D,"stop",y,d),Oe=ii(D,"stop",R,d),We=ii(D,"stop",re=>{K&&re.preventDefault(),A&&A(re)},d),nt=ii(D,"start",k,d),te=ii(D,"stop",w,d),de=ii(D,"stop",_,d),le=ii(D,"stop",re=>{Am(re.target)||ae(!1),m&&m(re)},!1),rt=Ri(re=>{M.current||(M.current=re.currentTarget),Am(re.target)&&(ae(!0),S&&S(re)),v&&v(re)}),me=()=>{const re=M.current;return l&&l!=="button"&&!(re.tagName==="A"&&re.href)},De=Ri(re=>{f&&!re.repeat&&K&&re.key===" "&&D.stop(re,()=>{D.start(re)}),re.target===re.currentTarget&&me()&&re.key===" "&&re.preventDefault(),x&&x(re),re.target===re.currentTarget&&me()&&re.key==="Enter"&&!u&&(re.preventDefault(),E&&E(re))}),Kt=Ri(re=>{f&&re.key===" "&&K&&!re.defaultPrevented&&D.stop(re,()=>{D.pulsate(re)}),I&&I(re),E&&re.target===re.currentTarget&&me()&&re.key===" "&&!re.defaultPrevented&&E(re)});let yt=l;yt==="button"&&(j.href||j.to)&&(yt=h);const q={};yt==="button"?(q.type=$===void 0?"button":$,q.disabled=u):(!j.href&&!j.to&&(q.role="button"),u&&(q["aria-disabled"]=u));const Se=Vt(n,M),fe={...r,centerRipple:i,component:l,disabled:u,disableRipple:c,disableTouchRipple:d,focusRipple:f,tabIndex:N,focusVisible:K},Ye=dhe(fe);return C.jsxs(fhe,{as:yt,className:Te(Ye.root,s),ownerState:fe,onBlur:le,onClick:E,onContextMenu:ce,onFocus:rt,onKeyDown:De,onKeyUp:Kt,onMouseDown:ne,onMouseLeave:We,onMouseUp:Oe,onDragLeave:Le,onTouchEnd:te,onTouchMove:de,onTouchStart:nt,ref:Se,tabIndex:u?-1:N,type:$,...q,...j,children:[a,Ie?C.jsx(lhe,{ref:z,center:i,...F}):null]})});function ii(e,t,n,r=!1){return Ri(o=>(n&&n(o),r||e[t](o),!0))}function phe(e){return Dt("MuiFab",e)}const bA=ht("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]);function hhe(e){return typeof e.main=="string"}function mhe(e,t=[]){if(!hhe(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function _v(e=[]){return([,t])=>t&&mhe(t,e)}const ghe=e=>{const{color:t,variant:n,classes:r,size:o}=e,i={root:["root",n,`size${It(o)}`,t==="inherit"?"colorInherit":t]},a=Ot(i,phe,r);return{...r,...a}},vhe=pe(e5,{name:"MuiFab",slot:"Root",shouldForwardProp:e=>To(e)||e==="classes",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${It(n.size)}`],n.color==="inherit"&&t.colorInherit,t[It(n.size)],t[n.color]]}})(vt(({theme:e})=>{var t,n;return{...e.typography.button,minHeight:36,transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(e.vars||e).zIndex.fab,boxShadow:(e.vars||e).shadows[6],"&:active":{boxShadow:(e.vars||e).shadows[12]},color:e.vars?e.vars.palette.text.primary:(n=(t=e.palette).getContrastText)==null?void 0:n.call(t,e.palette.grey[300]),backgroundColor:(e.vars||e).palette.grey[300],"&:hover":{backgroundColor:(e.vars||e).palette.grey.A100,"@media (hover: none)":{backgroundColor:(e.vars||e).palette.grey[300]},textDecoration:"none"},[`&.${bA.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]}}),vt(({theme:e})=>({variants:[...Object.entries(e.palette).filter(_v(["dark","contrastText"])).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].contrastText,backgroundColor:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:(e.vars||e).palette[t].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t].main}}}}))]})),vt(({theme:e})=>({[`&.${bA.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}))),t5=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiFab"}),{children:o,className:i,color:a="default",component:s="button",disabled:l=!1,disableFocusRipple:u=!1,focusVisibleClassName:c,size:d="large",variant:f="circular",...p}=r,h={...r,color:a,component:s,disabled:l,disableFocusRipple:u,size:d,variant:f},m=ghe(h);return C.jsx(vhe,{className:Te(m.root,i),component:s,disabled:l,focusRipple:!u,focusVisibleClassName:Te(m.focusVisible,c),ownerState:h,ref:n,...p,classes:m,children:o})});function yhe(e){return Dt("MuiSpeedDial",e)}const Dp=ht("MuiSpeedDial",["root","fab","directionUp","directionDown","directionLeft","directionRight","actions","actionsClosed"]),She=e=>{const{classes:t,open:n,direction:r}=e,o={root:["root",`direction${It(r)}`],fab:["fab"],actions:["actions",!n&&"actionsClosed"]};return Ot(o,yhe,t)};function _c(e){if(e==="up"||e==="down")return"vertical";if(e==="right"||e==="left")return"horizontal"}const Mp=32,Fp=16,bhe=pe("div",{name:"MuiSpeedDial",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`direction${It(n.direction)}`]]}})(vt(({theme:e})=>({zIndex:(e.vars||e).zIndex.speedDial,display:"flex",alignItems:"center",pointerEvents:"none",variants:[{props:{direction:"up"},style:{flexDirection:"column-reverse",[`& .${Dp.actions}`]:{flexDirection:"column-reverse",marginBottom:-32,paddingBottom:Fp+Mp}}},{props:{direction:"down"},style:{flexDirection:"column",[`& .${Dp.actions}`]:{flexDirection:"column",marginTop:-32,paddingTop:Fp+Mp}}},{props:{direction:"left"},style:{flexDirection:"row-reverse",[`& .${Dp.actions}`]:{flexDirection:"row-reverse",marginRight:-32,paddingRight:Fp+Mp}}},{props:{direction:"right"},style:{flexDirection:"row",[`& .${Dp.actions}`]:{flexDirection:"row",marginLeft:-32,paddingLeft:Fp+Mp}}}]}))),Ehe=pe(t5,{name:"MuiSpeedDial",slot:"Fab",overridesResolver:(e,t)=>t.fab})({pointerEvents:"auto"}),whe=pe("div",{name:"MuiSpeedDial",slot:"Actions",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.actions,!n.open&&t.actionsClosed]}})({display:"flex",pointerEvents:"auto",variants:[{props:({ownerState:e})=>!e.open,style:{transition:"top 0s linear 0.2s",pointerEvents:"none"}}]}),Che=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiSpeedDial"}),o=sc(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{ariaLabel:a,FabProps:{ref:s,...l}={},children:u,className:c,direction:d="up",hidden:f=!1,icon:p,onBlur:h,onClose:m,onFocus:E,onKeyDown:g,onMouseEnter:y,onMouseLeave:v,onOpen:S,open:x,openIcon:I,slots:T={},slotProps:A={},TransitionComponent:R,TransitionProps:w,transitionDuration:_=i,...k}=r,[N,F]=Tm({controlled:x,default:!1,name:"SpeedDial",state:"open"}),U={...r,open:N,direction:d},$=She(U),j=fs(),M=b.useRef(0),D=b.useRef(),z=b.useRef([]);z.current=[z.current[0]];const K=b.useCallback(q=>{z.current[0]=q},[]),ae=Vt(s,K),Ie=(q,Se)=>fe=>{z.current[q+1]=fe,Se&&Se(fe)},ne=q=>{g&&g(q);const Se=q.key.replace("Arrow","").toLowerCase(),{current:fe=Se}=D;if(q.key==="Escape"){F(!1),z.current[0].focus(),m&&m(q,"escapeKeyDown");return}if(_c(Se)===_c(fe)&&_c(Se)!==void 0){q.preventDefault();const Ye=Se===fe?1:-1,re=lD(M.current+Ye,0,z.current.length-1);z.current[re].focus(),M.current=re,D.current=fe}};b.useEffect(()=>{N||(M.current=0,D.current=void 0)},[N]);const ce=q=>{q.type==="mouseleave"&&v&&v(q),q.type==="blur"&&h&&h(q),j.clear(),q.type==="blur"?j.start(0,()=>{F(!1),m&&m(q,"blur")}):(F(!1),m&&m(q,"mouseLeave"))},Le=q=>{l.onClick&&l.onClick(q),j.clear(),N?(F(!1),m&&m(q,"toggle")):(F(!0),S&&S(q,"toggle"))},Oe=q=>{q.type==="mouseenter"&&y&&y(q),q.type==="focus"&&E&&E(q),j.clear(),N||j.start(0,()=>{F(!0),S&&S(q,{focus:"focus",mouseenter:"mouseEnter"}[q.type])})},We=a.replace(/^[^a-z]+|[^\w:.-]+/gi,""),nt=b.Children.toArray(u).filter(q=>b.isValidElement(q)),te=nt.map((q,Se)=>{const{FabProps:{ref:fe,...Ye}={},tooltipPlacement:re}=q.props,Ln=re||(_c(d)==="vertical"?"left":"top");return b.cloneElement(q,{FabProps:{...Ye,ref:Ie(Se,fe)},delay:30*(N?Se:nt.length-Se),open:N,tooltipPlacement:Ln,id:`${We}-action-${Se}`})}),de={transition:R,...T},le={transition:w,...A},rt={slots:de,slotProps:le},[me,De]=Jt("root",{elementType:bhe,externalForwardedProps:{...rt,...k},ownerState:U,ref:n,className:Te($.root,c),additionalProps:{role:"presentation"},getSlotProps:q=>({...q,onKeyDown:Se=>{var fe;(fe=q.onKeyDown)==null||fe.call(q,Se),ne(Se)},onBlur:Se=>{var fe;(fe=q.onBlur)==null||fe.call(q,Se),ce(Se)},onFocus:Se=>{var fe;(fe=q.onFocus)==null||fe.call(q,Se),Oe(Se)},onMouseEnter:Se=>{var fe;(fe=q.onMouseEnter)==null||fe.call(q,Se),Oe(Se)},onMouseLeave:Se=>{var fe;(fe=q.onMouseLeave)==null||fe.call(q,Se),ce(Se)}})}),[Kt,yt]=Jt("transition",{elementType:Jpe,externalForwardedProps:rt,ownerState:U});return C.jsxs(me,{...De,children:[C.jsx(Kt,{in:!f,timeout:_,unmountOnExit:!0,...yt,children:C.jsx(Ehe,{color:"primary","aria-label":a,"aria-haspopup":"true","aria-expanded":N,"aria-controls":`${We}-actions`,...l,onClick:Le,className:Te($.fab,l.className),ref:ae,ownerState:U,children:b.isValidElement(p)&&Tue(p,["SpeedDialIcon"])?b.cloneElement(p,{open:N}):p})}),C.jsx(whe,{id:`${We}-actions`,role:"menu","aria-orientation":_c(d),className:Te($.actions,!N&&$.actionsClosed),ownerState:U,children:te})]})}),xhe=we(C.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");function Ihe(e){return Dt("MuiSpeedDialIcon",e)}const Oo=ht("MuiSpeedDialIcon",["root","icon","iconOpen","iconWithOpenIconOpen","openIcon","openIconOpen"]),The=e=>{const{classes:t,open:n,openIcon:r}=e;return Ot({root:["root"],icon:["icon",n&&"iconOpen",r&&n&&"iconWithOpenIconOpen"],openIcon:["openIcon",n&&"openIconOpen"]},Ihe,t)},Ahe=pe("span",{name:"MuiSpeedDialIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Oo.icon}`]:t.icon},{[`& .${Oo.icon}`]:n.open&&t.iconOpen},{[`& .${Oo.icon}`]:n.open&&n.openIcon&&t.iconWithOpenIconOpen},{[`& .${Oo.openIcon}`]:t.openIcon},{[`& .${Oo.openIcon}`]:n.open&&t.openIconOpen},t.root]}})(vt(({theme:e})=>({height:24,[`& .${Oo.icon}`]:{transition:e.transitions.create(["transform","opacity"],{duration:e.transitions.duration.short})},[`& .${Oo.openIcon}`]:{position:"absolute",transition:e.transitions.create(["transform","opacity"],{duration:e.transitions.duration.short}),opacity:0,transform:"rotate(-45deg)"},variants:[{props:({ownerState:t})=>t.open,style:{[`& .${Oo.icon}`]:{transform:"rotate(45deg)"}}},{props:({ownerState:t})=>t.open&&t.openIcon,style:{[`& .${Oo.icon}`]:{opacity:0}}},{props:({ownerState:t})=>t.open,style:{[`& .${Oo.openIcon}`]:{transform:"rotate(0deg)",opacity:1}}}]}))),n5=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiSpeedDialIcon"}),{className:o,icon:i,open:a,openIcon:s,...l}=r,u=r,c=The(u);function d(f,p){return b.isValidElement(f)?b.cloneElement(f,{className:p}):f}return C.jsxs(Ahe,{className:Te(c.root,o),ref:n,ownerState:u,...l,children:[s?d(s,c.openIcon):null,i?d(i,c.icon):C.jsx(xhe,{className:c.icon})]})});n5.muiName="SpeedDialIcon";function JS(e){return`scale(${e}, ${e**2})`}const _he={entering:{opacity:1,transform:JS(1)},entered:{opacity:1,transform:"none"}},Oy=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Dm=b.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:a,in:s,onEnter:l,onEntered:u,onEntering:c,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:E=Ao,...g}=t,y=fs(),v=b.useRef(),S=sc(),x=b.useRef(null),I=Vt(x,al(i),n),T=U=>$=>{if(U){const j=x.current;$===void 0?U(j):U(j,$)}},A=T(c),R=T((U,$)=>{gw(U);const{duration:j,delay:M,easing:D}=Ru({style:h,timeout:m,easing:a},{mode:"enter"});let z;m==="auto"?(z=S.transitions.getAutoHeightDuration(U.clientHeight),v.current=z):z=j,U.style.transition=[S.transitions.create("opacity",{duration:z,delay:M}),S.transitions.create("transform",{duration:Oy?z:z*.666,delay:M,easing:D})].join(","),l&&l(U,$)}),w=T(u),_=T(p),k=T(U=>{const{duration:$,delay:j,easing:M}=Ru({style:h,timeout:m,easing:a},{mode:"exit"});let D;m==="auto"?(D=S.transitions.getAutoHeightDuration(U.clientHeight),v.current=D):D=$,U.style.transition=[S.transitions.create("opacity",{duration:D,delay:j}),S.transitions.create("transform",{duration:Oy?D:D*.666,delay:Oy?j:j||D*.333,easing:M})].join(","),U.style.opacity=0,U.style.transform=JS(.75),d&&d(U)}),N=T(f),F=U=>{m==="auto"&&y.start(v.current||0,U),r&&r(x.current,U)};return C.jsx(E,{appear:o,in:s,nodeRef:x,onEnter:R,onEntered:w,onEntering:A,onExit:k,onExited:N,onExiting:_,addEndListener:F,timeout:m==="auto"?null:m,...g,children:(U,{ownerState:$,...j})=>b.cloneElement(i,{style:{opacity:0,transform:JS(.75),visibility:U==="exited"&&!s?"hidden":void 0,..._he[U],...h,...i.props.style},ref:I,...j})})});Dm&&(Dm.muiSupportAuto=!0);var qn="top",Vr="bottom",Kr="right",Qn="left",vw="auto",Uf=[qn,Vr,Kr,Qn],Pu="start",Zd="end",Rhe="clippingParents",r5="viewport",Rc="popper",Phe="reference",EA=Uf.reduce(function(e,t){return e.concat([t+"-"+Pu,t+"-"+Zd])},[]),o5=[].concat(Uf,[vw]).reduce(function(e,t){return e.concat([t,t+"-"+Pu,t+"-"+Zd])},[]),khe="beforeRead",Nhe="read",Ohe="afterRead",Dhe="beforeMain",Mhe="main",Fhe="afterMain",Lhe="beforeWrite",Uhe="write",$he="afterWrite",jhe=[khe,Nhe,Ohe,Dhe,Mhe,Fhe,Lhe,Uhe,$he];function Xo(e){return e?(e.nodeName||"").toLowerCase():null}function vr(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ks(e){var t=vr(e).Element;return e instanceof t||e instanceof Element}function jr(e){var t=vr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function yw(e){if(typeof ShadowRoot>"u")return!1;var t=vr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Bhe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!jr(i)||!Xo(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function zhe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!jr(o)||!Xo(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const Hhe={name:"applyStyles",enabled:!0,phase:"write",fn:Bhe,effect:zhe,requires:["computeStyles"]};function Go(e){return e.split("-")[0]}var Rs=Math.max,Mm=Math.min,ku=Math.round;function ZS(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function i5(){return!/^((?!chrome|android).)*safari/i.test(ZS())}function Nu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&jr(e)&&(o=e.offsetWidth>0&&ku(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&ku(r.height)/e.offsetHeight||1);var a=Ks(e)?vr(e):window,s=a.visualViewport,l=!i5()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/o,c=(r.top+(l&&s?s.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function Sw(e){var t=Nu(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function a5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yw(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Gi(e){return vr(e).getComputedStyle(e)}function Whe(e){return["table","td","th"].indexOf(Xo(e))>=0}function Za(e){return((Ks(e)?e.ownerDocument:e.document)||window.document).documentElement}function Rv(e){return Xo(e)==="html"?e:e.assignedSlot||e.parentNode||(yw(e)?e.host:null)||Za(e)}function wA(e){return!jr(e)||Gi(e).position==="fixed"?null:e.offsetParent}function Vhe(e){var t=/firefox/i.test(ZS()),n=/Trident/i.test(ZS());if(n&&jr(e)){var r=Gi(e);if(r.position==="fixed")return null}var o=Rv(e);for(yw(o)&&(o=o.host);jr(o)&&["html","body"].indexOf(Xo(o))<0;){var i=Gi(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function $f(e){for(var t=vr(e),n=wA(e);n&&Whe(n)&&Gi(n).position==="static";)n=wA(n);return n&&(Xo(n)==="html"||Xo(n)==="body"&&Gi(n).position==="static")?t:n||Vhe(e)||t}function bw(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function gd(e,t,n){return Rs(e,Mm(t,n))}function Khe(e,t,n){var r=gd(e,t,n);return r>n?n:r}function s5(){return{top:0,right:0,bottom:0,left:0}}function l5(e){return Object.assign({},s5(),e)}function u5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Ghe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,l5(typeof t!="number"?t:u5(t,Uf))};function qhe(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Go(n.placement),l=bw(s),u=[Qn,Kr].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!a)){var d=Ghe(o.padding,n),f=Sw(i),p=l==="y"?qn:Qn,h=l==="y"?Vr:Kr,m=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],E=a[l]-n.rects.reference[l],g=$f(i),y=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=m/2-E/2,S=d[p],x=y-f[c]-d[h],I=y/2-f[c]/2+v,T=gd(S,I,x),A=l;n.modifiersData[r]=(t={},t[A]=T,t.centerOffset=T-I,t)}}function Qhe(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||a5(t.elements.popper,o)&&(t.elements.arrow=o))}const Yhe={name:"arrow",enabled:!0,phase:"main",fn:qhe,effect:Qhe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ou(e){return e.split("-")[1]}var Xhe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Jhe(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:ku(n*o)/o||0,y:ku(r*o)/o||0}}function CA(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,p=f===void 0?0:f,h=a.y,m=h===void 0?0:h,E=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=E.x,m=E.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),v=Qn,S=qn,x=window;if(u){var I=$f(n),T="clientHeight",A="clientWidth";if(I===vr(n)&&(I=Za(n),Gi(I).position!=="static"&&s==="absolute"&&(T="scrollHeight",A="scrollWidth")),I=I,o===qn||(o===Qn||o===Kr)&&i===Zd){S=Vr;var R=d&&I===x&&x.visualViewport?x.visualViewport.height:I[T];m-=R-r.height,m*=l?1:-1}if(o===Qn||(o===qn||o===Vr)&&i===Zd){v=Kr;var w=d&&I===x&&x.visualViewport?x.visualViewport.width:I[A];p-=w-r.width,p*=l?1:-1}}var _=Object.assign({position:s},u&&Xhe),k=c===!0?Jhe({x:p,y:m},vr(n)):{x:p,y:m};if(p=k.x,m=k.y,l){var N;return Object.assign({},_,(N={},N[S]=y?"0":"",N[v]=g?"0":"",N.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",N))}return Object.assign({},_,(t={},t[S]=y?m+"px":"",t[v]=g?p+"px":"",t.transform="",t))}function Zhe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Go(t.placement),variation:Ou(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,CA(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,CA(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const eme={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Zhe,data:{}};var Lp={passive:!0};function tme(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=vr(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",n.update,Lp)}),s&&l.addEventListener("resize",n.update,Lp),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Lp)}),s&&l.removeEventListener("resize",n.update,Lp)}}const nme={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:tme,data:{}};var rme={left:"right",right:"left",bottom:"top",top:"bottom"};function _h(e){return e.replace(/left|right|bottom|top/g,function(t){return rme[t]})}var ome={start:"end",end:"start"};function xA(e){return e.replace(/start|end/g,function(t){return ome[t]})}function Ew(e){var t=vr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ww(e){return Nu(Za(e)).left+Ew(e).scrollLeft}function ime(e,t){var n=vr(e),r=Za(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=i5();(u||!u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+ww(e),y:l}}function ame(e){var t,n=Za(e),r=Ew(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Rs(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Rs(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+ww(e),l=-r.scrollTop;return Gi(o||n).direction==="rtl"&&(s+=Rs(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function Cw(e){var t=Gi(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function c5(e){return["html","body","#document"].indexOf(Xo(e))>=0?e.ownerDocument.body:jr(e)&&Cw(e)?e:c5(Rv(e))}function vd(e,t){var n;t===void 0&&(t=[]);var r=c5(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=vr(r),a=o?[i].concat(i.visualViewport||[],Cw(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(vd(Rv(a)))}function e1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sme(e,t){var n=Nu(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function IA(e,t,n){return t===r5?e1(ime(e,n)):Ks(t)?sme(t,n):e1(ame(Za(e)))}function lme(e){var t=vd(Rv(e)),n=["absolute","fixed"].indexOf(Gi(e).position)>=0,r=n&&jr(e)?$f(e):e;return Ks(r)?t.filter(function(o){return Ks(o)&&a5(o,r)&&Xo(o)!=="body"}):[]}function ume(e,t,n,r){var o=t==="clippingParents"?lme(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,u){var c=IA(e,u,r);return l.top=Rs(c.top,l.top),l.right=Mm(c.right,l.right),l.bottom=Mm(c.bottom,l.bottom),l.left=Rs(c.left,l.left),l},IA(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function d5(e){var t=e.reference,n=e.element,r=e.placement,o=r?Go(r):null,i=r?Ou(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case qn:l={x:a,y:t.y-n.height};break;case Vr:l={x:a,y:t.y+t.height};break;case Kr:l={x:t.x+t.width,y:s};break;case Qn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=o?bw(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case Pu:l[u]=l[u]-(t[c]/2-n[c]/2);break;case Zd:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function ef(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?Rhe:s,u=n.rootBoundary,c=u===void 0?r5:u,d=n.elementContext,f=d===void 0?Rc:d,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,E=m===void 0?0:m,g=l5(typeof E!="number"?E:u5(E,Uf)),y=f===Rc?Phe:Rc,v=e.rects.popper,S=e.elements[h?y:f],x=ume(Ks(S)?S:S.contextElement||Za(e.elements.popper),l,c,a),I=Nu(e.elements.reference),T=d5({reference:I,element:v,placement:o}),A=e1(Object.assign({},v,T)),R=f===Rc?A:I,w={top:x.top-R.top+g.top,bottom:R.bottom-x.bottom+g.bottom,left:x.left-R.left+g.left,right:R.right-x.right+g.right},_=e.modifiersData.offset;if(f===Rc&&_){var k=_[o];Object.keys(w).forEach(function(N){var F=[Kr,Vr].indexOf(N)>=0?1:-1,U=[qn,Vr].indexOf(N)>=0?"y":"x";w[N]+=k[U]*F})}return w}function cme(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?o5:l,c=Ou(r),d=c?s?EA:EA.filter(function(h){return Ou(h)===c}):Uf,f=d.filter(function(h){return u.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=ef(e,{placement:m,boundary:o,rootBoundary:i,padding:a})[Go(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function dme(e){if(Go(e)===vw)return[];var t=_h(e);return[xA(e),t,xA(t)]}function fme(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,E=t.options.placement,g=Go(E),y=g===E,v=l||(y||!h?[_h(E)]:dme(E)),S=[E].concat(v).reduce(function(ne,ce){return ne.concat(Go(ce)===vw?cme(t,{placement:ce,boundary:c,rootBoundary:d,padding:u,flipVariations:h,allowedAutoPlacements:m}):ce)},[]),x=t.rects.reference,I=t.rects.popper,T=new Map,A=!0,R=S[0],w=0;w=0,U=F?"width":"height",$=ef(t,{placement:_,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),j=F?N?Kr:Qn:N?Vr:qn;x[U]>I[U]&&(j=_h(j));var M=_h(j),D=[];if(i&&D.push($[k]<=0),s&&D.push($[j]<=0,$[M]<=0),D.every(function(ne){return ne})){R=_,A=!1;break}T.set(_,D)}if(A)for(var z=h?3:1,K=function(ce){var Le=S.find(function(Oe){var We=T.get(Oe);if(We)return We.slice(0,ce).every(function(nt){return nt})});if(Le)return R=Le,"break"},ae=z;ae>0;ae--){var Ie=K(ae);if(Ie==="break")break}t.placement!==R&&(t.modifiersData[r]._skip=!0,t.placement=R,t.reset=!0)}}const pme={name:"flip",enabled:!0,phase:"main",fn:fme,requiresIfExists:["offset"],data:{_skip:!1}};function TA(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function AA(e){return[qn,Kr,Vr,Qn].some(function(t){return e[t]>=0})}function hme(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=ef(t,{elementContext:"reference"}),s=ef(t,{altBoundary:!0}),l=TA(a,r),u=TA(s,o,i),c=AA(l),d=AA(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const mme={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hme};function gme(e,t,n){var r=Go(e),o=[Qn,qn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[Qn,Kr].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function vme(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=o5.reduce(function(c,d){return c[d]=gme(d,t.rects,i),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const yme={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:vme};function Sme(e){var t=e.state,n=e.name;t.modifiersData[n]=d5({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const bme={name:"popperOffsets",enabled:!0,phase:"read",fn:Sme,data:{}};function Eme(e){return e==="x"?"y":"x"}function wme(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,h=n.tetherOffset,m=h===void 0?0:h,E=ef(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),g=Go(t.placement),y=Ou(t.placement),v=!y,S=bw(g),x=Eme(S),I=t.modifiersData.popperOffsets,T=t.rects.reference,A=t.rects.popper,R=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,w=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(I){if(i){var N,F=S==="y"?qn:Qn,U=S==="y"?Vr:Kr,$=S==="y"?"height":"width",j=I[S],M=j+E[F],D=j-E[U],z=p?-A[$]/2:0,K=y===Pu?T[$]:A[$],ae=y===Pu?-A[$]:-T[$],Ie=t.elements.arrow,ne=p&&Ie?Sw(Ie):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:s5(),Le=ce[F],Oe=ce[U],We=gd(0,T[$],ne[$]),nt=v?T[$]/2-z-We-Le-w.mainAxis:K-We-Le-w.mainAxis,te=v?-T[$]/2+z+We+Oe+w.mainAxis:ae+We+Oe+w.mainAxis,de=t.elements.arrow&&$f(t.elements.arrow),le=de?S==="y"?de.clientTop||0:de.clientLeft||0:0,rt=(N=_==null?void 0:_[S])!=null?N:0,me=j+nt-rt-le,De=j+te-rt,Kt=gd(p?Mm(M,me):M,j,p?Rs(D,De):D);I[S]=Kt,k[S]=Kt-j}if(s){var yt,q=S==="x"?qn:Qn,Se=S==="x"?Vr:Kr,fe=I[x],Ye=x==="y"?"height":"width",re=fe+E[q],Ln=fe-E[Se],jt=[qn,Qn].indexOf(g)!==-1,Xr=(yt=_==null?void 0:_[x])!=null?yt:0,_o=jt?re:fe-T[Ye]-A[Ye]-Xr+w.altAxis,xr=jt?fe+T[Ye]+A[Ye]-Xr-w.altAxis:Ln,Jr=p&&jt?Khe(_o,fe,xr):gd(p?_o:re,fe,p?xr:Ln);I[x]=Jr,k[x]=Jr-fe}t.modifiersData[r]=k}}const Cme={name:"preventOverflow",enabled:!0,phase:"main",fn:wme,requiresIfExists:["offset"]};function xme(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ime(e){return e===vr(e)||!jr(e)?Ew(e):xme(e)}function Tme(e){var t=e.getBoundingClientRect(),n=ku(t.width)/e.offsetWidth||1,r=ku(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Ame(e,t,n){n===void 0&&(n=!1);var r=jr(t),o=jr(t)&&Tme(t),i=Za(t),a=Nu(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Xo(t)!=="body"||Cw(i))&&(s=Ime(t)),jr(t)?(l=Nu(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=ww(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _me(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function Rme(e){var t=_me(e);return jhe.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function Pme(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function kme(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var _A={placement:"bottom",modifiers:[],strategy:"absolute"};function RA(){for(var e=arguments.length,t=new Array(e),n=0;n{i||s(Mme(o)||document.body)},[o,i]),Yo(()=>{if(a&&!i)return VT(n,a),()=>{VT(n,null)}},[n,a,i]),i){if(b.isValidElement(r)){const u={ref:l};return b.cloneElement(r,u)}return r}return a&&Z1.createPortal(r,a)});function Fme(e){return Dt("MuiPopper",e)}ht("MuiPopper",["root"]);function Lme(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function t1(e){return typeof e=="function"?e():e}function Ume(e){return e.nodeType!==void 0}const $me=e=>{const{classes:t}=e;return Ot({root:["root"]},Fme,t)},jme={},Bme=b.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:i,disablePortal:a,modifiers:s,open:l,placement:u,popperOptions:c,popperRef:d,slotProps:f={},slots:p={},TransitionProps:h,ownerState:m,...E}=t,g=b.useRef(null),y=Vt(g,n),v=b.useRef(null),S=Vt(v,d),x=b.useRef(S);Yo(()=>{x.current=S},[S]),b.useImperativeHandle(d,()=>v.current,[]);const I=Lme(u,i),[T,A]=b.useState(I),[R,w]=b.useState(t1(r));b.useEffect(()=>{v.current&&v.current.forceUpdate()}),b.useEffect(()=>{r&&w(t1(r))},[r]),Yo(()=>{if(!R||!l)return;const U=M=>{A(M.placement)};let $=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:M})=>{U(M)}}];s!=null&&($=$.concat(s)),c&&c.modifiers!=null&&($=$.concat(c.modifiers));const j=Dme(R,g.current,{placement:I,...c,modifiers:$});return x.current(j),()=>{j.destroy(),x.current(null)}},[R,a,s,l,c,I]);const _={placement:T};h!==null&&(_.TransitionProps=h);const k=$me(t),N=p.root??"div",F=hD({elementType:N,externalSlotProps:f.root,externalForwardedProps:E,additionalProps:{role:"tooltip",ref:y},ownerState:t,className:k.root});return C.jsx(N,{...F,children:typeof o=="function"?o(_):o})}),zme=b.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:f=jme,popperRef:p,style:h,transition:m=!1,slotProps:E={},slots:g={},...y}=t,[v,S]=b.useState(!0),x=()=>{S(!1)},I=()=>{S(!0)};if(!l&&!c&&(!m||v))return null;let T;if(i)T=i;else if(r){const w=t1(r);T=w&&Ume(w)?gr(w).body:gr(null).body}const A=!c&&l&&(!m||v)?"none":void 0,R=m?{in:c,onEnter:x,onExited:I}:void 0;return C.jsx(f5,{disablePortal:s,container:T,children:C.jsx(Bme,{anchorEl:r,direction:a,disablePortal:s,modifiers:u,ref:n,open:m?!v:c,placement:d,popperOptions:f,popperRef:p,slotProps:E,slots:g,...y,style:{position:"fixed",top:0,left:0,display:A,...h},TransitionProps:R,children:o})})}),Hme=pe(zme,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),p5=b.forwardRef(function(t,n){const r=uw(),o=$t({props:t,name:"MuiPopper"}),{anchorEl:i,component:a,components:s,componentsProps:l,container:u,disablePortal:c,keepMounted:d,modifiers:f,open:p,placement:h,popperOptions:m,popperRef:E,transition:g,slots:y,slotProps:v,...S}=o,x=(y==null?void 0:y.root)??(s==null?void 0:s.Root),I={anchorEl:i,container:u,disablePortal:c,keepMounted:d,modifiers:f,open:p,placement:h,popperOptions:m,popperRef:E,transition:g,...S};return C.jsx(Hme,{as:a,direction:r?"rtl":"ltr",slots:{root:x},slotProps:v??l,...I,ref:n})});function Wme(e){return Dt("MuiTooltip",e)}const Pt=ht("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function Vme(e){return Math.round(e*1e5)/1e5}const Kme=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:i}=e,a={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${It(i.split("-")[0])}`],arrow:["arrow"]};return Ot(a,Wme,t)},Gme=pe(p5,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(vt(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Pt.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Pt.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Pt.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),qme=pe("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${It(n.placement.split("-")[0])}`]]}})(vt(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Ti(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Pt.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Pt.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Pt.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Vme(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Pt.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Pt.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Pt.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Pt.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),Qme=pe("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(vt(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Ti(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let Up=!1;const PA=new rv;let Pc={x:0,y:0};function $p(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Yme=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiTooltip"}),{arrow:o=!1,children:i,classes:a,components:s={},componentsProps:l={},describeChild:u=!1,disableFocusListener:c=!1,disableHoverListener:d=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:h=100,enterNextDelay:m=0,enterTouchDelay:E=700,followCursor:g=!1,id:y,leaveDelay:v=0,leaveTouchDelay:S=1500,onClose:x,onOpen:I,open:T,placement:A="bottom",PopperComponent:R,PopperProps:w={},slotProps:_={},slots:k={},title:N,TransitionComponent:F,TransitionProps:U,...$}=r,j=b.isValidElement(i)?i:C.jsx("span",{children:i}),M=sc(),D=uw(),[z,K]=b.useState(),[ae,Ie]=b.useState(null),ne=b.useRef(!1),ce=f||g,Le=fs(),Oe=fs(),We=fs(),nt=fs(),[te,de]=Tm({controlled:T,default:!1,name:"Tooltip",state:"open"});let le=te;const rt=iD(y),me=b.useRef(),De=Ri(()=>{me.current!==void 0&&(document.body.style.WebkitUserSelect=me.current,me.current=void 0),nt.clear()});b.useEffect(()=>De,[De]);const Kt=xe=>{PA.clear(),Up=!0,de(!0),I&&!le&&I(xe)},yt=Ri(xe=>{PA.start(800+v,()=>{Up=!1}),de(!1),x&&le&&x(xe),Le.start(M.transitions.duration.shortest,()=>{ne.current=!1})}),q=xe=>{ne.current&&xe.type!=="touchstart"||(z&&z.removeAttribute("title"),Oe.clear(),We.clear(),h||Up&&m?Oe.start(Up?m:h,()=>{Kt(xe)}):Kt(xe))},Se=xe=>{Oe.clear(),We.start(v,()=>{yt(xe)})},[,fe]=b.useState(!1),Ye=xe=>{Am(xe.target)||(fe(!1),Se(xe))},re=xe=>{z||K(xe.currentTarget),Am(xe.target)&&(fe(!0),q(xe))},Ln=xe=>{ne.current=!0;const to=j.props;to.onTouchStart&&to.onTouchStart(xe)},jt=xe=>{Ln(xe),We.clear(),Le.clear(),De(),me.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",nt.start(E,()=>{document.body.style.WebkitUserSelect=me.current,q(xe)})},Xr=xe=>{j.props.onTouchEnd&&j.props.onTouchEnd(xe),De(),We.start(S,()=>{yt(xe)})};b.useEffect(()=>{if(!le)return;function xe(to){to.key==="Escape"&&yt(to)}return document.addEventListener("keydown",xe),()=>{document.removeEventListener("keydown",xe)}},[yt,le]);const _o=Vt(al(j),K,n);!N&&N!==0&&(le=!1);const xr=b.useRef(),Jr=xe=>{const to=j.props;to.onMouseMove&&to.onMouseMove(xe),Pc={x:xe.clientX,y:xe.clientY},xr.current&&xr.current.update()},Ir={},Zr=typeof N=="string";u?(Ir.title=!le&&Zr&&!d?N:null,Ir["aria-describedby"]=le?rt:null):(Ir["aria-label"]=Zr?N:null,Ir["aria-labelledby"]=le&&!Zr?rt:null);const _e={...Ir,...$,...j.props,className:Te($.className,j.props.className),onTouchStart:Ln,ref:_o,...g?{onMouseMove:Jr}:{}},Tr={};p||(_e.onTouchStart=jt,_e.onTouchEnd=Xr),d||(_e.onMouseOver=$p(q,_e.onMouseOver),_e.onMouseLeave=$p(Se,_e.onMouseLeave),ce||(Tr.onMouseOver=q,Tr.onMouseLeave=Se)),c||(_e.onFocus=$p(re,_e.onFocus),_e.onBlur=$p(Ye,_e.onBlur),ce||(Tr.onFocus=re,Tr.onBlur=Ye));const er={...r,isRtl:D,arrow:o,disableInteractive:ce,placement:A,PopperComponentProp:R,touch:ne.current},Un=typeof _.popper=="function"?_.popper(er):_.popper,ue=b.useMemo(()=>{var to,Rw;let xe=[{name:"arrow",enabled:!!ae,options:{element:ae,padding:4}}];return(to=w.popperOptions)!=null&&to.modifiers&&(xe=xe.concat(w.popperOptions.modifiers)),(Rw=Un==null?void 0:Un.popperOptions)!=null&&Rw.modifiers&&(xe=xe.concat(Un.popperOptions.modifiers)),{...w.popperOptions,...Un==null?void 0:Un.popperOptions,modifiers:xe}},[ae,w.popperOptions,Un==null?void 0:Un.popperOptions]),Xe=Kme(er),Gt=typeof _.transition=="function"?_.transition(er):_.transition,eo={slots:{popper:s.Popper,transition:s.Transition??F,tooltip:s.Tooltip,arrow:s.Arrow,...k},slotProps:{arrow:_.arrow??l.arrow,popper:{...w,...Un??l.popper},tooltip:_.tooltip??l.tooltip,transition:{...U,...Gt??l.transition}}},[jf,O5]=Jt("popper",{elementType:Gme,externalForwardedProps:eo,ownerState:er,className:Te(Xe.popper,w==null?void 0:w.className)}),[D5,M5]=Jt("transition",{elementType:Dm,externalForwardedProps:eo,ownerState:er}),[F5,L5]=Jt("tooltip",{elementType:qme,className:Xe.tooltip,externalForwardedProps:eo,ownerState:er}),[U5,$5]=Jt("arrow",{elementType:Qme,className:Xe.arrow,externalForwardedProps:eo,ownerState:er,ref:Ie});return C.jsxs(b.Fragment,{children:[b.cloneElement(j,_e),C.jsx(jf,{as:R??p5,placement:A,anchorEl:g?{getBoundingClientRect:()=>({top:Pc.y,left:Pc.x,right:Pc.x,bottom:Pc.y,width:0,height:0})}:z,popperRef:xr,open:z?le:!1,id:rt,transition:!0,...Tr,...O5,popperOptions:ue,children:({TransitionProps:xe})=>C.jsx(D5,{timeout:M.transitions.duration.shorter,...xe,...M5,children:C.jsxs(F5,{...L5,children:[N,o?C.jsx(U5,{...$5}):null]})})})]})});function Xme(e){return Dt("MuiSpeedDialAction",e)}const jp=ht("MuiSpeedDialAction",["fab","fabClosed","staticTooltip","staticTooltipClosed","staticTooltipLabel","tooltipPlacementLeft","tooltipPlacementRight"]),Jme=e=>{const{open:t,tooltipPlacement:n,classes:r}=e,o={fab:["fab",!t&&"fabClosed"],staticTooltip:["staticTooltip",`tooltipPlacement${It(n)}`,!t&&"staticTooltipClosed"],staticTooltipLabel:["staticTooltipLabel"]};return Ot(o,Xme,r)},Zme=pe(t5,{name:"MuiSpeedDialAction",slot:"Fab",skipVariantsResolver:!1,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.fab,!n.open&&t.fabClosed]}})(vt(({theme:e})=>({margin:8,color:(e.vars||e).palette.text.secondary,backgroundColor:(e.vars||e).palette.background.paper,"&:hover":{backgroundColor:e.vars?e.vars.palette.SpeedDialAction.fabHoverBg:UD(e.palette.background.paper,.15)},transition:`${e.transitions.create("transform",{duration:e.transitions.duration.shorter})}, opacity 0.8s`,opacity:1,variants:[{props:({ownerState:t})=>!t.open,style:{opacity:0,transform:"scale(0)"}}]}))),ege=pe("span",{name:"MuiSpeedDialAction",slot:"StaticTooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.staticTooltip,!n.open&&t.staticTooltipClosed,t[`tooltipPlacement${It(n.tooltipPlacement)}`]]}})(vt(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",[`& .${jp.staticTooltipLabel}`]:{transition:e.transitions.create(["transform","opacity"],{duration:e.transitions.duration.shorter}),opacity:1},variants:[{props:({ownerState:t})=>!t.open,style:{[`& .${jp.staticTooltipLabel}`]:{opacity:0,transform:"scale(0.5)"}}},{props:{tooltipPlacement:"left"},style:{[`& .${jp.staticTooltipLabel}`]:{transformOrigin:"100% 50%",right:"100%",marginRight:8}}},{props:{tooltipPlacement:"right"},style:{[`& .${jp.staticTooltipLabel}`]:{transformOrigin:"0% 50%",left:"100%",marginLeft:8}}}]}))),tge=pe("span",{name:"MuiSpeedDialAction",slot:"StaticTooltipLabel",overridesResolver:(e,t)=>t.staticTooltipLabel})(vt(({theme:e})=>({position:"absolute",...e.typography.body1,backgroundColor:(e.vars||e).palette.background.paper,borderRadius:(e.vars||e).shape.borderRadius,boxShadow:(e.vars||e).shadows[1],color:(e.vars||e).palette.text.secondary,padding:"4px 16px",wordBreak:"keep-all"}))),nge=b.forwardRef(function(t,n){var M;const r=$t({props:t,name:"MuiSpeedDialAction"}),{className:o,delay:i=0,FabProps:a={},icon:s,id:l,open:u,TooltipClasses:c,tooltipOpen:d=!1,tooltipPlacement:f="left",tooltipTitle:p,slots:h={},slotProps:m={},...E}=r,g={...r,tooltipPlacement:f},y=Jme(g),v={slots:h,slotProps:{fab:a,...m,tooltip:VD(typeof m.tooltip=="function"?m.tooltip(g):m.tooltip,{title:p,open:d,placement:f,classes:c})}},[S,x]=b.useState((M=v.slotProps.tooltip)==null?void 0:M.open),I=()=>{x(!1)},T=()=>{x(!0)},A={transitionDelay:`${i}ms`},[R,w]=Jt("fab",{elementType:Zme,externalForwardedProps:v,ownerState:g,shouldForwardComponentProp:!0,className:Te(y.fab,o),additionalProps:{style:A,tabIndex:-1,role:"menuitem",size:"small"}}),[_,k]=Jt("tooltip",{elementType:Yme,externalForwardedProps:v,shouldForwardComponentProp:!0,ref:n,additionalProps:{id:l},ownerState:g,getSlotProps:D=>({...D,onClose:z=>{var K;(K=D.onClose)==null||K.call(D,z),I()},onOpen:z=>{var K;(K=D.onOpen)==null||K.call(D,z),T()}})}),[N,F]=Jt("staticTooltip",{elementType:ege,externalForwardedProps:v,ownerState:g,ref:n,className:y.staticTooltip,additionalProps:{id:l}}),[U,$]=Jt("staticTooltipLabel",{elementType:tge,externalForwardedProps:v,ownerState:g,className:y.staticTooltipLabel,additionalProps:{style:A,id:`${l}-label`}}),j=C.jsx(R,{...w,children:s});return k.open?C.jsxs(N,{...F,...E,children:[C.jsx(U,{...$,children:k.title}),b.cloneElement(j,{"aria-labelledby":`${l}-label`})]}):(!u&&S&&x(!1),C.jsx(_,{...k,title:k.title,open:u&&S,placement:k.placement,classes:k.classes,...E,children:j}))}),h5=e=>{var n;const t=(n=m5.find(r=>r.iconName===e))==null?void 0:n.component;return t||C.jsx(Spe,{})},m5=[{iconName:"BakeryDining",component:C.jsx(Qfe,{})},{iconName:"Fastfood",component:C.jsx(ipe,{})},{iconName:"LocalPizza",component:C.jsx(gpe,{})},{iconName:"RamenDining",component:C.jsx(bpe,{})},{iconName:"Restaurant",component:C.jsx(KD,{})},{iconName:"EmojiFoodBeverage",component:C.jsx(ope,{})},{iconName:"FoodBank",component:C.jsx(ape,{})},{iconName:"DinnerDining",component:C.jsx(epe,{})},{iconName:"Icecream",component:C.jsx(upe,{})},{iconName:"KebabDining",component:C.jsx(cpe,{})},{iconName:"Kitchen",component:C.jsx(dpe,{})},{iconName:"LocalDining",component:C.jsx(mpe,{})},{iconName:"RiceBowl",component:C.jsx(wpe,{})},{iconName:"Bento",component:C.jsx(Yfe,{})},{iconName:"Cake",component:C.jsx(Zfe,{})},{iconName:"Egg",component:C.jsx(npe,{})},{iconName:"EggAlt",component:C.jsx(rpe,{})},{iconName:"RestaurantMenu",component:C.jsx(Epe,{})},{iconName:"SetMeal",component:C.jsx(Cpe,{})},{iconName:"SoupKitchen",component:C.jsx(xpe,{})},{iconName:"TakeoutDining",component:C.jsx(Ipe,{})},{iconName:"Tapas",component:C.jsx(Tpe,{})},{iconName:"BreakfastDining",component:C.jsx(Xfe,{})},{iconName:"BrunchDining",component:C.jsx(Jfe,{})},{iconName:"Liquor",component:C.jsx(fpe,{})},{iconName:"LocalBar",component:C.jsx(ppe,{})},{iconName:"LocalCafe",component:C.jsx(hpe,{})},{iconName:"Nightlife",component:C.jsx(ype,{})},{iconName:"LunchDining",component:C.jsx(vpe,{})}];function rge({quickAdds:e,date:t,preferences:n}){const[r,o]=b.useState(!1),i=XB(),a=l=>{let u=l.calories,c=l.protein??0;if(l.id==="dqa-Custom"){const d=prompt("Enter calorie amount");if(u=parseInt(d||""),isNaN(u)||u<1){alert("Invalid integer");return}if(n!=null&&n.hideProtein)c=0;else{const f=prompt("Enter protein in grams");c=parseInt(f||"0"),(isNaN(c)||c<1)&&(c=0)}}o(!1),i.mutate({name:l.name,calories:u,protein:c,day:t.toLocaleDateString()})};return C.jsxs(C.Fragment,{children:[C.jsx("style",{children:` .MuiSpeedDialAction-staticTooltipLabel { width: 15pc; text-align: right; } `}),C.jsx(ZD,{open:r}),C.jsx(Che,{ariaLabel:"Add food",sx:{position:"fixed",bottom:60,right:42},icon:C.jsx(n5,{}),onClose:()=>o(!1),onOpen:()=>o(!0),open:r,children:e.map(l=>C.jsx(nge,{icon:h5(l.icon),tooltipTitle:`${l.name}${l.calories?` (${l.calories} cals)`:""}`,tooltipOpen:!0,onClick:()=>a(l)},l.id))})]})}function oge({foods:e,preferences:t}){return C.jsx(kn,{children:C.jsxs(rl,{caption:"Consumption data",highlightOnHover:!1,children:[C.jsx(il,{children:C.jsxs(wt,{children:[C.jsx(G,{as:"th",children:"Time"}),C.jsx(G,{as:"th",children:"Name"}),C.jsx(G,{as:"th",children:"Cals"}),!(t!=null&&t.hideProtein)&&C.jsx(G,{as:"th",children:"Protein"}),C.jsx(G,{as:"th",children:C.jsx(km,{})})]})}),C.jsx(ol,{children:e.map(n=>C.jsx(ige,{food:n,preferences:t},n.id))})]})})}function ige({food:e,preferences:t}){const[n,r]=b.useState(!1),o=JB(),i=()=>{r(!0),o.mutate(e.id)},a=new Date(e.createdAt);return C.jsxs(wt,{children:[C.jsx(G,{children:a.toLocaleTimeString().split(":").slice(0,2).join(":")}),C.jsx(G,{children:e.name??"No name"}),C.jsx(G,{children:e.calories}),!(t!=null&&t.hideProtein)&&C.jsxs(G,{children:[e.protein??0,"g"]}),C.jsx(G,{onClick:i,style:{cursor:"pointer"},children:n?C.jsx(Kl,{}):"❌"})]})}const g5={icon:"Restaurant",name:"Custom",calories:0,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-Custom"},v5=[{icon:"Fastfood",name:"xx-small",calories:100,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-100"},{icon:"Restaurant",name:"x-small",calories:250,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-250"},{icon:"LocalPizza",name:"small",calories:500,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-500"},{icon:"Restaurant",name:"medium",calories:750,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-750"},{icon:"LocalPizza",name:"large",calories:1e3,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-1000"},{icon:"Fastfood",name:"x-large",calories:1500,protein:0,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),id:"dqa-1500"},g5];function age({date:e,setDate:t}){const n=e.toLocaleDateString(),{data:r=[]}=rr(n),{data:o}=Rpe(),{data:i=[]}=YD(),{data:a}=Av(),{data:s=[]}=or(n),l=Ppe(),{isFetching:u}=ra(e),c=i.length>0?[...i,g5]:v5,d=r.reduce((x,I)=>x+I.calories,0),f=s[0],p=(f==null?void 0:f.steps)??0,h=(f==null?void 0:f.activeCalories)??0,m=(f==null?void 0:f.baseCalories)??0,E=h+m,g=(o==null?void 0:o.dietCalories)??E,y=g-d,v=()=>{const x=parseInt(prompt("Enter new goal")||"");!isNaN(x)&&x>0&&l.mutate({dietCalories:x})},S=()=>{o!=null&&o.id&&l.mutate({dietCalories:E})};return C.jsxs(C.Fragment,{children:[C.jsxs(Je,{as:"div",textAlign:"center",children:[C.jsx(qD,{style:{paddingTop:"10px"},onClick:()=>t(Ar(e,1))}),C.jsx(Je,{as:"span",fontWeight:"bold",margin:"15%",children:n}),C.jsx(QD,{style:{paddingTop:"10px"},onClick:()=>t(pw(e,1))}),n!==new Date().toLocaleDateString()&&C.jsx(pt,{onClick:()=>t(new Date),children:"today"})]}),C.jsx(kn,{children:C.jsxs(Zn,{children:["Remaining Calories:"," ",C.jsx("span",{style:{color:y>0?"green":"red"},children:y})," ","for ",n]})}),C.jsx(kn,{children:C.jsxs(rl,{caption:C.jsxs(C.Fragment,{children:["Healthkit data ",u&&C.jsx(Kl,{size:"small"})]}),highlightOnHover:!1,children:[C.jsx(il,{children:C.jsxs(wt,{children:[C.jsx(G,{as:"th",children:"Data Type"}),C.jsx(G,{as:"th",children:"Value"}),C.jsx(G,{as:"th",children:"Edit"})]})}),C.jsxs(ol,{children:[!(a!=null&&a.hideSteps)&&p>0&&C.jsxs(wt,{children:[C.jsx(G,{children:"Steps"}),C.jsx(G,{children:p}),C.jsx(G,{})]}),C.jsxs(wt,{children:[C.jsx(G,{children:"Active Calories"}),C.jsx(G,{children:u?C.jsx(Kl,{size:"small"}):`${h} cals`}),C.jsx(G,{})]}),C.jsxs(wt,{children:[C.jsx(G,{children:"Base Calories"}),C.jsx(G,{children:u?C.jsx(Kl,{size:"small"}):`${m} cals`}),C.jsx(G,{})]}),C.jsxs(wt,{children:[C.jsx(G,{children:"Goal"}),C.jsxs(G,{children:[g," cals"]}),o!=null&&o.dietCalories?C.jsx(G,{onClick:S,style:{cursor:"pointer"},children:C.jsx(km,{})}):C.jsx(G,{onClick:v,style:{cursor:"pointer"},children:C.jsx(tpe,{})})]}),C.jsxs(wt,{children:[C.jsx(G,{children:"Consumed"}),C.jsxs(G,{children:[d," cals"]}),C.jsx(G,{})]}),!(a!=null&&a.hideProtein)&&C.jsxs(wt,{children:[C.jsx(G,{children:"Protein"}),C.jsxs(G,{children:[r.reduce((x,I)=>x+(I.protein??0),0),"g"]}),C.jsx(G,{})]})]})]})}),r.length>0&&C.jsx(oge,{foods:r,preferences:a}),C.jsx(rge,{quickAdds:c,date:e,preferences:a})]})}function sge(){const[e,t]=b.useState(new Date);return C.jsx(age,{date:e,setDate:t})}function lge(){const{user:e}=Cf();return Qs({queryKey:["weight"],queryFn:async()=>{const{data:t}=await ke.models.Weight.list({limit:5e3});return t.sort((n,r)=>new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime())},enabled:!!e})}function uge(){const e=Jn();return Jo({mutationFn:async t=>{const{data:n}=await ke.models.Weight.create(t);return n},onSuccess:()=>{e.invalidateQueries({queryKey:["weight"]})}})}function y5(){const{user:e}=Cf();return Qs({queryKey:["height"],queryFn:async()=>{const{data:t}=await ke.models.Height.list({limit:5e3});return t.sort((n,r)=>new Date(r.createdAt).getTime()-new Date(n.createdAt).getTime())},enabled:!!e})}function cge(){const e=Jn();return Jo({mutationFn:async t=>{const{data:n}=await ke.models.Height.create(t);return n},onSuccess:()=>{e.invalidateQueries({queryKey:["height"]})}})}function dge(){var f,p;const{data:e=[],isLoading:t}=lge(),{data:n=[],isLoading:r}=y5(),o=uge(),i=cge(),a=((f=e[0])==null?void 0:f.currentWeight)??180,s=((p=n[0])==null?void 0:p.currentHeight)??70,l=()=>{const h=parseInt(prompt("Enter your weight in lbs")||"");!isNaN(h)&&h>0&&o.mutate({currentWeight:h})},u=()=>{const h=parseInt(prompt("Enter your height in inches")||"");!isNaN(h)&&h>0&&i.mutate({currentHeight:h})},c=a/(s*s)*703,d=h=>h<18.5?"underweight":h<25?"healthy":h<30?"overweight":"obese";return t||r?C.jsx("div",{children:"Loading..."}):C.jsx(kn,{children:C.jsxs(rl,{caption:"Health data",highlightOnHover:!1,children:[C.jsx(il,{children:C.jsxs(wt,{children:[C.jsx(G,{as:"th",children:"Data Type"}),C.jsx(G,{as:"th",children:"Value"}),C.jsx(G,{as:"th",children:"Edit"})]})}),C.jsxs(ol,{children:[C.jsxs(wt,{children:[C.jsx(G,{children:"Weight"}),C.jsxs(G,{children:[a," lbs"]}),C.jsx(G,{onClick:l,style:{cursor:"pointer"},children:C.jsx(GD,{})})]}),C.jsxs(wt,{children:[C.jsx(G,{children:"Height"}),C.jsxs(G,{children:[s," inches"]}),C.jsx(G,{onClick:u,style:{cursor:"pointer"},children:C.jsx(spe,{})})]}),C.jsxs(wt,{children:[C.jsx(G,{children:"BMI"}),C.jsxs(G,{children:[c.toFixed(1)," (",d(c),")"]}),C.jsx(G,{})]})]})]})})}function fge(){var i;const{data:e=[]}=y5(),t=((i=e[0])==null?void 0:i.currentHeight)??70,n=(18.5/703*(t*t)).toFixed(1),r=(25/703*(t*t)).toFixed(1),o=(30/703*(t*t)).toFixed(1);return C.jsx(kn,{children:C.jsxs(rl,{caption:"BMI range for your height",highlightOnHover:!1,children:[C.jsx(il,{children:C.jsxs(wt,{children:[C.jsx(G,{as:"th",children:"Classification"}),C.jsx(G,{as:"th",children:"Min Weight"}),C.jsx(G,{as:"th",children:"Max Weight"})]})}),C.jsxs(ol,{children:[C.jsxs(wt,{children:[C.jsxs(G,{children:["Underweight",C.jsx("br",{}),C.jsx(Je,{as:"div",fontSize:"xs",children:"(bmi < 18.5)"})]}),C.jsx(G,{children:"0 lbs"}),C.jsxs(G,{children:[n," lbs"]})]}),C.jsxs(wt,{children:[C.jsxs(G,{children:["Healthy",C.jsx("br",{}),C.jsx(Je,{as:"div",fontSize:"xs",children:"(bmi 18.5 - 25)"})]}),C.jsxs(G,{children:[n," lbs"]}),C.jsxs(G,{children:[r," lbs"]})]}),C.jsxs(wt,{children:[C.jsxs(G,{children:["Overweight",C.jsx("br",{}),C.jsx(Je,{as:"div",fontSize:"xs",children:"(bmi 25 - 30)"})]}),C.jsxs(G,{children:[r," lbs"]}),C.jsxs(G,{children:[o," lbs"]})]}),C.jsxs(wt,{children:[C.jsxs(G,{children:["Obese",C.jsx("br",{}),C.jsx(Je,{as:"div",fontSize:"xs",children:"(bmi 30+)"})]}),C.jsxs(G,{children:[o," lbs"]}),C.jsx(G,{children:"∞ lbs"})]})]})]})})}const pge="/assets/female-bf-eye-test-DeWk1shd.webp",hge="/assets/male-bf-eye-test-CWNnhExb.jpg",mge="/assets/bf-chart-PeBCTGRn.jpeg",gge="/assets/bmi-chart-DcAF9UAt.png";function vge(){const{tokens:e}=Xa();return C.jsxs(C.Fragment,{children:[C.jsxs(Je,{variation:"primary",as:"p",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.small,textDecoration:"none",margin:e.space.small,children:["BMI is often criticized as a blunt and impersonal instrument. After all, it only considers weight and height to determine health - it doesn't consider relevant factors such as gender, genetics, muscle mass."," ",C.jsx(Je,{as:"span",fontWeight:e.fontWeights.semibold,fontStyle:"oblique",children:"Fun fact, Arnold Schwarzenegger in his prime was considered obese according to BMI measurement (he had a BMI of 30.2)!"})]}),C.jsxs(Je,{variation:"primary",as:"p",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.small,textDecoration:"none",margin:e.space.small,children:["However, The Arnies of the world are extreme outliers."," ",C.jsxs(Je,{as:"span",fontWeight:e.fontWeights.semibold,fontStyle:"oblique",children:[`BMI's bluntness is not a "get out of dieting free" card.`," "]}),"Athletes in the vast majority of sports fall within a healthy BMI range, including sports like swimming, UFC, and soccer where the athletes are quite muscular. In Olympic athletes, the average male BMI is 24 and the average female BMI is 21.6, both within the healthy BMI range."]}),C.jsxs(Je,{variation:"primary",as:"p",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.small,textDecoration:"none",margin:e.space.small,children:["For the typical person, whose lifestyle does not involve the extreme training regimens of elite athletes,"," ",C.jsx(Je,{as:"span",fontWeight:e.fontWeights.semibold,fontStyle:"oblique",children:"BMI remains a relevant and practical tool to set healthy goals"}),'. In the USA, BMI is more likely to err in the other direction - for example "skinny fat" has similar health profile to obesity despite being a healthy BMI.']})]})}function yge(){return C.jsx(kn,{children:C.jsx(IO,{items:[{trigger:"Why BMI?",value:"whyBmi",content:C.jsx(vge,{})},{trigger:"BMI Chart",value:"bmiChart",content:C.jsx(ds,{alt:"bmiChart",src:gge})},{trigger:"Male Body Fat % Eye Test",value:"maleBfEyeTest",content:C.jsx(ds,{alt:"maleBfEyeTest",src:hge})},{trigger:"Female Body Fat % Eye Test",value:"femaleBfEyeTest",content:C.jsx(ds,{alt:"femaleBfEyeTest",src:pge})},{trigger:"Body Fat % Chart",value:"bfChart",content:C.jsx(ds,{alt:"bfChart",src:mge})}]})})}function Sge(){return C.jsxs(C.Fragment,{children:[C.jsx(dge,{}),C.jsx(fge,{}),C.jsx(yge,{})]})}function bge(){const{tokens:e}=Xa(),t=Array.from({length:4},(f,p)=>Ar(new Date,p).toLocaleDateString()),n={foods:rr(t[0]),cache:or(t[0])},r={foods:rr(t[1]),cache:or(t[1])},o={foods:rr(t[2]),cache:or(t[2])},i={foods:rr(t[3]),cache:or(t[3])},a=[n,r,o,i],s=f=>{var x;const p=t[f],h=a[f].foods.data??[],m=(x=a[f].cache.data)==null?void 0:x[0],E=h.length>0,g=h.reduce((I,T)=>I+T.calories,0),y=((m==null?void 0:m.activeCalories)||0)+((m==null?void 0:m.baseCalories)||0),[v,S]=p.split("/");return{tracked:E,day:`${v}/${S}`,net:g-y}},l=[s(3),s(2),s(1),s(0)];let u=0,c=0;for(let f=l.length-1;f>=0&&l[f].tracked;f--)u++,c+=l[f].net;const d=c/3500;return C.jsxs(CE,{margin:e.space.small,templateColumns:"1fr 1fr 1fr 1fr",gap:e.space.small,children:[C.jsxs(Y,{columnSpan:4,textAlign:"center",children:["Your streak is ",u," days (~",C.jsxs(Je,{as:"span",color:d>0?"red":"green",children:[Math.abs(d).toFixed(1)," lbs"]}),")"]}),l.map((f,p)=>C.jsxs(Y,{borderRadius:e.radii.xxxl,textAlign:"center",children:[C.jsx(Zn,{children:f.tracked?"🔥":"❌"}),C.jsx(Je,{as:"p",children:f.day})]},p))]})}function Ege(){const[e,t]=b.useState(new Date),n=Array.from({length:7},(g,y)=>Ar(e,y).toLocaleDateString()),r={foods:rr(n[0]),cache:or(n[0])},o={foods:rr(n[1]),cache:or(n[1])},i={foods:rr(n[2]),cache:or(n[2])},a={foods:rr(n[3]),cache:or(n[3])},s={foods:rr(n[4]),cache:or(n[4])},l={foods:rr(n[5]),cache:or(n[5])},u={foods:rr(n[6]),cache:or(n[6])},c=[r,o,i,a,s,l,u];ra(Ar(e,0)),ra(Ar(e,1)),ra(Ar(e,2)),ra(Ar(e,3)),ra(Ar(e,4)),ra(Ar(e,5)),ra(Ar(e,6));const d=g=>{var w;const y=n[g],v=c[g].foods.data??[],S=(w=c[g].cache.data)==null?void 0:w[0],x=v.length>0,I=v.reduce((_,k)=>_+k.calories,0),T=((S==null?void 0:S.activeCalories)||0)+((S==null?void 0:S.baseCalories)||0),[A,R]=y.split("/");return{day:`${A}/${R}`,consumed:I,burned:T,net:I-T,tracked:x}},f=Array.from({length:7},(g,y)=>d(y)),p=f.filter(g=>g.tracked),h=p.reduce((g,y)=>g+y.net,0),m=p.length,E=C.jsxs(C.Fragment,{children:[C.jsx(qD,{style:{paddingTop:"10px"},onClick:()=>t(Ar(e,7))}),C.jsxs(Je,{as:"span",fontWeight:"bold",margin:"15%",children:[Ar(e,6).toLocaleDateString()," - ",e.toLocaleDateString()]}),C.jsx(QD,{style:{paddingTop:"10px"},onClick:()=>t(pw(e,7))})]});return C.jsxs(C.Fragment,{children:[C.jsxs(Y,{columnSpan:4,textAlign:"center",style:{color:h>0?"red":"green"},children:["Net ",h," calories for ",m," tracked day",m!==1?"s":""]}),C.jsx(Y,{columnSpan:4,textAlign:"center",children:"1 lb of fat is ~3500 calories"}),C.jsxs(rl,{caption:E,highlightOnHover:!1,children:[C.jsx(il,{children:C.jsxs(wt,{children:[C.jsx(G,{as:"th",children:"Day"}),C.jsx(G,{as:"th",children:"Consumed"}),C.jsx(G,{as:"th",children:"Burned"}),C.jsx(G,{as:"th",children:"Net"})]})}),C.jsx(ol,{children:f.map((g,y)=>C.jsxs(wt,{children:[C.jsx(G,{children:g.day}),C.jsx(G,{children:g.consumed}),C.jsx(G,{children:g.burned}),C.jsx(G,{style:{color:g.net>0?"red":"green"},children:g.net})]},y))})]}),e.toLocaleDateString()!==new Date().toLocaleDateString()&&C.jsx("div",{style:{textAlign:"center"},children:C.jsx(pt,{onClick:()=>t(new Date),children:"Today"})})]})}function wge(){return C.jsxs(C.Fragment,{children:[C.jsx(bge,{}),C.jsx(Ege,{})]})}const Cge=["Wow, great job on the weight loss, you look really good!","Sometimes you feel like you have to finish the food otherwise it'll go to waste. But you are not a garbage disposal!","If you hit your target weight today, have you created the right habits to keep it?","Nothing changes if nothing changes.","I'd rather be uncomfortable for 45 minutes a day than be uncomfortable in my body for the rest of my life.","Nothing tastes as good as skinny feels.","It gets easier. Every day it gets a little easier. But you gotta do it every day — that's the hard part. But it does get easier","You want a hot body? Look hot in a bikini? You better work bitch!","Make the right choice the easiest one.","Even a bad workout is still a workout.","It takes 4 weeks for you to see changes, 8 weeks for your family and friends, and 12 for the whole world to see.","Say no once in the grocery store so you don't have to say it hundreds of times a day at home.","Discipline is the strongest form of self love.","Better is better","You cannot outrun your fork!","Hunger tells us when to eat, not how much to eat … if you're really really hungry, it's still only telling you that it's time to eat, not to eat a ton","Sweat is your fat crying","DON'T LET YOUR DREAMS BE DREAMS","I have come too far to take orders from a cookie!","There are 2 kinds of pain in this world: the Pain of Discipline, and the Pain of Regret.","Eat less, move more.","Think of your workouts as important meetings you've scheduled with yourself.","Stop rewarding yourself with food. You are not a dog","You won't see results overnight but things are changing. Just wait.","Whatever your problem is, the answer is not in the fridge.","Crave fitness like you would crave junk food.","If you are really serious about losing weight, you need to be completely honest with yourself about what you're eating","Always have a goal, but never compare yourself to someone else","1 pound a week is 52 pounds in the next year!","E'rybody wanna be a bodybuilder, ain't nobody wanna lift no heavy ass weights","Oh my god, you look amazing!","Everyone works hard when they feel like it. Only the best work hard when they don't feel like it.","Greasy fries or skinny thighs?","Some of the hardest things in life are easy to understand, but difficult to implement.","The principles of weight loss are very easy to understand in theory, yet in practice there are dozens of epiphanies along the way.","If what you're doing is working, keep it up! If it's not, then you gotta change something"],xge={aphorisms:Cge};function Ige(){const{tokens:e}=Xa(),t=xge.aphorisms,[n,r]=b.useState([]),o=()=>{if(n.length===t.length)return r([]);let a;do a=Math.floor(Math.random()*t.length);while(n.includes(a));r([...n,a])};n.length||o();const i=t[n[n.length-1]];return C.jsxs(kn,{children:[C.jsx("svg",{style:{height:e.space.xxl.value,width:e.space.xxl.value,color:e.colors.neutral[80].value},"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 18 14",children:C.jsx("path",{d:"M6 0H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4v1a3 3 0 0 1-3 3H2a1 1 0 0 0 0 2h1a5.006 5.006 0 0 0 5-5V2a2 2 0 0 0-2-2Zm10 0h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4v1a3 3 0 0 1-3 3h-1a1 1 0 0 0 0 2h1a5.006 5.006 0 0 0 5-5V2a2 2 0 0 0-2-2Z"})}),C.jsx(Gd,{marginBottom:e.space.medium,marginTop:e.space.medium}),C.jsx(Je,{variation:"primary",as:"p",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.thin,fontSize:e.fontSizes.xxxl,fontStyle:"oblique",textDecoration:"none",children:i}),C.jsx(Gd,{marginBottom:e.space.medium,marginTop:e.space.medium}),C.jsx(pt,{isFullWidth:!0,onClick:()=>o(),children:"Randomize Quote"})]})}function Tge(){const{tokens:e}=Xa();return C.jsxs(Je,{variation:"primary",as:"span",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.medium,textDecoration:"none",margin:e.space.small,children:[C.jsx(lpe,{fontSize:e.fontSizes.small.name})," Why does jpc.fit default to t-shirt sizes when reporting calories consumed?",C.jsx(Je,{variation:"primary",as:"span",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.bold,fontSize:e.fontSizes.small,textDecoration:"none",margin:e.space.small,children:"The philosophy of jpc.fit is that mindful eating is more important than counting every calorie exactly perfectly."}),C.jsx(Je,{variation:"primary",as:"span",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.bold,fontSize:e.fontSizes.small,textDecoration:"none",margin:e.space.small,children:"In the USA, it is legal for calorie labels be wrong by up to 20%. The painstaking math to calculate the calories of each ingredient is not worth the effort. Instead, we recommend loose estimation (and round up when it makes sense!)"}),C.jsx(Je,{variation:"primary",as:"span",display:"block",lineHeight:e.lineHeights.medium,fontWeight:e.fontWeights.bold,fontSize:e.fontSizes.small,textDecoration:"none",margin:e.space.small,children:"If this philosophy doesn't work for you, you can create custom quick adds for your most common meals to reduce the effort of entering calories consumed."})]})}function Age(e){return Dt("MuiPaper",e)}ht("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _ge=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ot(i,Age,o)},Rge=pe("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(vt(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Pge=b.forwardRef(function(t,n){var p;const r=$t({props:t,name:"MuiPaper"}),o=sc(),{className:i,component:a="div",elevation:s=1,square:l=!1,variant:u="elevation",...c}=r,d={...r,component:a,elevation:s,square:l,variant:u},f=_ge(d);return C.jsx(Rge,{as:a,ownerState:d,className:Te(f.root,i),ref:n,...c,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[s],...o.vars&&{"--Paper-overlay":(p=o.vars.overlays)==null?void 0:p[s]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Ti("#fff",GS(s))}, ${Ti("#fff",GS(s))})`}},...c.style}})});function Bp(e){return parseInt(e,10)||0}const kge={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Nge(e){for(const t in e)return!1;return!0}function kA(e){return Nge(e)||e.outerHeightStyle===0&&!e.overflowing}const Oge=b.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:a,value:s,...l}=t,{current:u}=b.useRef(s!=null),c=b.useRef(null),d=Vt(n,c),f=b.useRef(null),p=b.useRef(null),h=b.useCallback(()=>{const v=c.current,S=p.current;if(!v||!S)return;const I=Vi(v).getComputedStyle(v);if(I.width==="0px")return{outerHeightStyle:0,overflowing:!1};S.style.width=I.width,S.value=v.value||t.placeholder||"x",S.value.slice(-1)===` `&&(S.value+=" ");const T=I.boxSizing,A=Bp(I.paddingBottom)+Bp(I.paddingTop),R=Bp(I.borderBottomWidth)+Bp(I.borderTopWidth),w=S.scrollHeight;S.value="x";const _=S.scrollHeight;let k=w;i&&(k=Math.max(Number(i)*_,k)),o&&(k=Math.min(Number(o)*_,k)),k=Math.max(k,_);const N=k+(T==="border-box"?A+R:0),F=Math.abs(k-w)<=1;return{outerHeightStyle:N,overflowing:F}},[o,i,t.placeholder]),m=Ri(()=>{const v=c.current,S=h();if(!v||!S||kA(S))return!1;const x=S.outerHeightStyle;return f.current!=null&&f.current!==x}),E=b.useCallback(()=>{const v=c.current,S=h();if(!v||!S||kA(S))return;const x=S.outerHeightStyle;f.current!==x&&(f.current=x,v.style.height=`${x}px`),v.style.overflow=S.overflowing?"hidden":""},[h]),g=b.useRef(-1);Yo(()=>{const v=oD(E),S=c==null?void 0:c.current;if(!S)return;const x=Vi(S);x.addEventListener("resize",v);let I;return typeof ResizeObserver<"u"&&(I=new ResizeObserver(()=>{m()&&(I.unobserve(S),cancelAnimationFrame(g.current),E(),g.current=requestAnimationFrame(()=>{I.observe(S)}))}),I.observe(S)),()=>{v.clear(),cancelAnimationFrame(g.current),x.removeEventListener("resize",v),I&&I.disconnect()}},[h,E,m]),Yo(()=>{E()});const y=v=>{u||E(),r&&r(v)};return C.jsxs(b.Fragment,{children:[C.jsx("textarea",{value:s,onChange:y,ref:d,rows:i,style:a,...l}),C.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...kge.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function n1(e){return typeof e=="string"}function xw({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const S5=b.createContext(void 0);function Iw(){return b.useContext(S5)}function NA(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function b5(e,t=!1){return e&&(NA(e.value)&&e.value!==""||t&&NA(e.defaultValue)&&e.defaultValue!=="")}function Dge(e){return Dt("MuiInputBase",e)}const Du=ht("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var OA;const Pv=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${It(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},kv=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},Mge=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:a,formControl:s,fullWidth:l,hiddenLabel:u,multiline:c,readOnly:d,size:f,startAdornment:p,type:h}=e,m={root:["root",`color${It(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",f&&f!=="medium"&&`size${It(f)}`,c&&"multiline",p&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",d&&"readOnly"],input:["input",r&&"disabled",h==="search"&&"inputTypeSearch",c&&"inputMultiline",f==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",d&&"readOnly"]};return Ot(m,Dge,t)},Nv=pe("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Pv})(vt(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Du.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),Ov=pe("input",{name:"MuiInputBase",slot:"Input",overridesResolver:kv})(vt(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Du.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Du.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),DA=zfe({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Tw=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:a,className:s,color:l,components:u={},componentsProps:c={},defaultValue:d,disabled:f,disableInjectingGlobalStyles:p,endAdornment:h,error:m,fullWidth:E=!1,id:g,inputComponent:y="input",inputProps:v={},inputRef:S,margin:x,maxRows:I,minRows:T,multiline:A=!1,name:R,onBlur:w,onChange:_,onClick:k,onFocus:N,onKeyDown:F,onKeyUp:U,placeholder:$,readOnly:j,renderSuffix:M,rows:D,size:z,slotProps:K={},slots:ae={},startAdornment:Ie,type:ne="text",value:ce,...Le}=r,Oe=v.value!=null?v.value:ce,{current:We}=b.useRef(Oe!=null),nt=b.useRef(),te=b.useCallback(_e=>{},[]),de=Vt(nt,S,v.ref,te),[le,rt]=b.useState(!1),me=Iw(),De=xw({props:r,muiFormControl:me,states:["color","disabled","error","hiddenLabel","size","required","filled"]});De.focused=me?me.focused:le,b.useEffect(()=>{!me&&f&&le&&(rt(!1),w&&w())},[me,f,le,w]);const Kt=me&&me.onFilled,yt=me&&me.onEmpty,q=b.useCallback(_e=>{b5(_e)?Kt&&Kt():yt&&yt()},[Kt,yt]);Yo(()=>{We&&q({value:Oe})},[Oe,q,We]);const Se=_e=>{N&&N(_e),v.onFocus&&v.onFocus(_e),me&&me.onFocus?me.onFocus(_e):rt(!0)},fe=_e=>{w&&w(_e),v.onBlur&&v.onBlur(_e),me&&me.onBlur?me.onBlur(_e):rt(!1)},Ye=(_e,...Tr)=>{if(!We){const er=_e.target||nt.current;if(er==null)throw new Error(Wi(1));q({value:er.value})}v.onChange&&v.onChange(_e,...Tr),_&&_(_e,...Tr)};b.useEffect(()=>{q(nt.current)},[]);const re=_e=>{nt.current&&_e.currentTarget===_e.target&&nt.current.focus(),k&&k(_e)};let Ln=y,jt=v;A&&Ln==="input"&&(D?jt={type:void 0,minRows:D,maxRows:D,...jt}:jt={type:void 0,maxRows:I,minRows:T,...jt},Ln=Oge);const Xr=_e=>{q(_e.animationName==="mui-auto-fill-cancel"?nt.current:{value:"x"})};b.useEffect(()=>{me&&me.setAdornedStart(!!Ie)},[me,Ie]);const _o={...r,color:De.color||"primary",disabled:De.disabled,endAdornment:h,error:De.error,focused:De.focused,formControl:me,fullWidth:E,hiddenLabel:De.hiddenLabel,multiline:A,size:De.size,startAdornment:Ie,type:ne},xr=Mge(_o),Jr=ae.root||u.Root||Nv,Ir=K.root||c.root||{},Zr=ae.input||u.Input||Ov;return jt={...jt,...K.input??c.input},C.jsxs(b.Fragment,{children:[!p&&typeof DA=="function"&&(OA||(OA=C.jsx(DA,{}))),C.jsxs(Jr,{...Ir,ref:n,onClick:re,...Le,...!n1(Jr)&&{ownerState:{..._o,...Ir.ownerState}},className:Te(xr.root,Ir.className,s,j&&"MuiInputBase-readOnly"),children:[Ie,C.jsx(S5.Provider,{value:null,children:C.jsx(Zr,{"aria-invalid":De.error,"aria-describedby":o,autoComplete:i,autoFocus:a,defaultValue:d,disabled:De.disabled,id:g,onAnimationStart:Xr,name:R,placeholder:$,readOnly:j,required:De.required,rows:D,value:Oe,onKeyDown:F,onKeyUp:U,type:ne,...jt,...!n1(Zr)&&{as:Ln,ownerState:{..._o,...jt.ownerState}},ref:de,className:Te(xr.input,jt.className,j&&"MuiInputBase-readOnly"),onBlur:fe,onChange:Ye,onFocus:Se})}),h,M?M({...De,startAdornment:Ie}):null]})]})});function Fge(e){return Dt("MuiInput",e)}const kc={...Du,...ht("MuiInput",["root","underline","input"])};function Lge(e){return Dt("MuiOutlinedInput",e)}const Do={...Du,...ht("MuiOutlinedInput",["root","notchedOutline","input"])};function Uge(e){return Dt("MuiFilledInput",e)}const es={...Du,...ht("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},$ge=we(C.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function jge(e){const t=gr(e);return t.body===e?Vi(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function yd(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function MA(e){return parseInt(Vi(e).getComputedStyle(e).paddingRight,10)||0}function Bge(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function FA(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,a=>{const s=!i.includes(a),l=!Bge(a);s&&l&&yd(a,o)})}function Dy(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function zge(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(jge(r)){const a=sD(Vi(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${MA(r)+a}px`;const s=gr(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${MA(l)+a}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=gr(r).body;else{const a=r.parentElement,s=Vi(r);i=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:a,property:s})=>{i?a.style.setProperty(s,i):a.style.removeProperty(s)})}}function Hge(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class Wge{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&yd(t.modalRef,!1);const o=Hge(n);FA(n,t.mount,t.modalRef,o,!0);const i=Dy(this.containers,a=>a.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Dy(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=zge(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Dy(this.containers,a=>a.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&yd(t.modalRef,n),FA(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const a=i.modals[i.modals.length-1];a.modalRef&&yd(a.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}const Vge=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Kge(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function Gge(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function qge(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||Gge(e))}function Qge(e){const t=[],n=[];return Array.from(e.querySelectorAll(Vge)).forEach((r,o)=>{const i=Kge(r);i===-1||!qge(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function Yge(){return!0}function Xge(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=Qge,isEnabled:a=Yge,open:s}=e,l=b.useRef(!1),u=b.useRef(null),c=b.useRef(null),d=b.useRef(null),f=b.useRef(null),p=b.useRef(!1),h=b.useRef(null),m=Vt(al(t),h),E=b.useRef(null);b.useEffect(()=>{!s||!h.current||(p.current=!n)},[n,s]),b.useEffect(()=>{if(!s||!h.current)return;const v=gr(h.current);return h.current.contains(v.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),b.useEffect(()=>{if(!s||!h.current)return;const v=gr(h.current),S=T=>{E.current=T,!(r||!a()||T.key!=="Tab")&&v.activeElement===h.current&&T.shiftKey&&(l.current=!0,c.current&&c.current.focus())},x=()=>{var R,w;const T=h.current;if(T===null)return;if(!v.hasFocus()||!a()||l.current){l.current=!1;return}if(T.contains(v.activeElement)||r&&v.activeElement!==u.current&&v.activeElement!==c.current)return;if(v.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let A=[];if((v.activeElement===u.current||v.activeElement===c.current)&&(A=i(h.current)),A.length>0){const _=!!((R=E.current)!=null&&R.shiftKey&&((w=E.current)==null?void 0:w.key)==="Tab"),k=A[0],N=A[A.length-1];typeof k!="string"&&typeof N!="string"&&(_?N.focus():k.focus())}else T.focus()};v.addEventListener("focusin",x),v.addEventListener("keydown",S,!0);const I=setInterval(()=>{v.activeElement&&v.activeElement.tagName==="BODY"&&x()},50);return()=>{clearInterval(I),v.removeEventListener("focusin",x),v.removeEventListener("keydown",S,!0)}},[n,r,o,a,s,i]);const g=v=>{d.current===null&&(d.current=v.relatedTarget),p.current=!0,f.current=v.target;const S=t.props.onFocus;S&&S(v)},y=v=>{d.current===null&&(d.current=v.relatedTarget),p.current=!0};return C.jsxs(b.Fragment,{children:[C.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelStart"}),b.cloneElement(t,{ref:m,onFocus:g}),C.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelEnd"})]})}function Jge(e){return typeof e=="function"?e():e}function Zge(e){return e?e.props.hasOwnProperty("in"):!1}const LA=()=>{},zp=new Wge;function eve(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:a,children:s,onClose:l,open:u,rootRef:c}=e,d=b.useRef({}),f=b.useRef(null),p=b.useRef(null),h=Vt(p,c),[m,E]=b.useState(!u),g=Zge(s);let y=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(y=!1);const v=()=>gr(f.current),S=()=>(d.current.modalRef=p.current,d.current.mount=f.current,d.current),x=()=>{zp.mount(S(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},I=Ri(()=>{const U=Jge(t)||v().body;zp.add(S(),U),p.current&&x()}),T=()=>zp.isTopModal(S()),A=Ri(U=>{f.current=U,U&&(u&&T()?x():p.current&&yd(p.current,y))}),R=b.useCallback(()=>{zp.remove(S(),y)},[y]);b.useEffect(()=>()=>{R()},[R]),b.useEffect(()=>{u?I():(!g||!o)&&R()},[u,R,g,o,I]);const w=U=>$=>{var j;(j=U.onKeyDown)==null||j.call(U,$),!($.key!=="Escape"||$.which===229||!T())&&(n||($.stopPropagation(),l&&l($,"escapeKeyDown")))},_=U=>$=>{var j;(j=U.onClick)==null||j.call(U,$),$.target===$.currentTarget&&l&&l($,"backdropClick")};return{getRootProps:(U={})=>{const $=dD(e);delete $.onTransitionEnter,delete $.onTransitionExited;const j={...$,...U};return{role:"presentation",...j,onKeyDown:w(j),ref:h}},getBackdropProps:(U={})=>{const $=U;return{"aria-hidden":!0,...$,onClick:_($),open:u}},getTransitionProps:()=>{const U=()=>{E(!1),i&&i()},$=()=>{E(!0),a&&a(),o&&R()};return{onEnter:WT(U,(s==null?void 0:s.props.onEnter)??LA),onExited:WT($,(s==null?void 0:s.props.onExited)??LA)}},rootRef:h,portalRef:A,isTopModal:T,exited:m,hasTransition:g}}function tve(e){return Dt("MuiModal",e)}ht("MuiModal",["root","hidden","backdrop"]);const nve=e=>{const{open:t,exited:n,classes:r}=e;return Ot({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},tve,r)},rve=pe("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(vt(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),ove=pe(ZD,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),ive=b.forwardRef(function(t,n){const r=$t({name:"MuiModal",props:t}),{BackdropComponent:o=ove,BackdropProps:i,classes:a,className:s,closeAfterTransition:l=!1,children:u,container:c,component:d,components:f={},componentsProps:p={},disableAutoFocus:h=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:E=!1,disablePortal:g=!1,disableRestoreFocus:y=!1,disableScrollLock:v=!1,hideBackdrop:S=!1,keepMounted:x=!1,onBackdropClick:I,onClose:T,onTransitionEnter:A,onTransitionExited:R,open:w,slotProps:_={},slots:k={},theme:N,...F}=r,U={...r,closeAfterTransition:l,disableAutoFocus:h,disableEnforceFocus:m,disableEscapeKeyDown:E,disablePortal:g,disableRestoreFocus:y,disableScrollLock:v,hideBackdrop:S,keepMounted:x},{getRootProps:$,getBackdropProps:j,getTransitionProps:M,portalRef:D,isTopModal:z,exited:K,hasTransition:ae}=eve({...U,rootRef:n}),Ie={...U,exited:K},ne=nve(Ie),ce={};if(u.props.tabIndex===void 0&&(ce.tabIndex="-1"),ae){const{onEnter:de,onExited:le}=M();ce.onEnter=de,ce.onExited=le}const Le={slots:{root:f.Root,backdrop:f.Backdrop,...k},slotProps:{...p,..._}},[Oe,We]=Jt("root",{ref:n,elementType:rve,externalForwardedProps:{...Le,...F,component:d},getSlotProps:$,ownerState:Ie,className:Te(s,ne==null?void 0:ne.root,!Ie.open&&Ie.exited&&(ne==null?void 0:ne.hidden))}),[nt,te]=Jt("backdrop",{ref:i==null?void 0:i.ref,elementType:o,externalForwardedProps:Le,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:de=>j({...de,onClick:le=>{I&&I(le),de!=null&&de.onClick&&de.onClick(le)}}),className:Te(i==null?void 0:i.className,ne==null?void 0:ne.backdrop),ownerState:Ie});return!x&&!w&&(!ae||K)?null:C.jsx(f5,{ref:D,container:c,disablePortal:g,children:C.jsxs(Oe,{...We,children:[!S&&o?C.jsx(nt,{...te}):null,C.jsx(Xge,{disableEnforceFocus:m,disableAutoFocus:h,disableRestoreFocus:y,isEnabled:z,open:w,children:b.cloneElement(u,ce)})]})})}),UA=ht("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),ave=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:i,hiddenLabel:a,multiline:s}=e,l={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${It(i)}`,a&&"hiddenLabel",s&&"multiline"],input:["input"]},u=Ot(l,Uge,t);return{...t,...u}},sve=pe(Nv,{shouldForwardProp:e=>To(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Pv(e,t),!n.disableUnderline&&t.underline]}})(vt(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${es.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${es.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:a})=>!a.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${es.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${es.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${es.disabled}, .${es.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${es.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(_v()).map(([a])=>{var s;return{props:{disableUnderline:!1,color:a},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[a])==null?void 0:s.main}`}}}}),{props:({ownerState:a})=>a.startAdornment,style:{paddingLeft:12}},{props:({ownerState:a})=>a.endAdornment,style:{paddingRight:12}},{props:({ownerState:a})=>a.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:a,size:s})=>a.multiline&&s==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:a})=>a.multiline&&a.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:a})=>a.multiline&&a.hiddenLabel&&a.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),lve=pe(Ov,{name:"MuiFilledInput",slot:"Input",overridesResolver:kv})(vt(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),E5=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:a,fullWidth:s=!1,hiddenLabel:l,inputComponent:u="input",multiline:c=!1,slotProps:d,slots:f={},type:p="text",...h}=r,m={...r,disableUnderline:o,fullWidth:s,inputComponent:u,multiline:c,type:p},E=ave(r),g={root:{ownerState:m},input:{ownerState:m}},y=d??a?bn(g,d??a):g,v=f.root??i.Root??sve,S=f.input??i.Input??lve;return C.jsx(Tw,{slots:{root:v,input:S},slotProps:y,fullWidth:s,inputComponent:u,multiline:c,ref:n,type:p,...h,classes:E})});E5.muiName="Input";const uve=e=>{const{classes:t,disableUnderline:n}=e,o=Ot({root:["root",!n&&"underline"],input:["input"]},Fge,t);return{...t,...o}},cve=pe(Nv,{shouldForwardProp:e=>To(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Pv(e,t),!n.disableUnderline&&t.underline]}})(vt(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${kc.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${kc.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${kc.disabled}, .${kc.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${kc.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(_v()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),dve=pe(Ov,{name:"MuiInput",slot:"Input",overridesResolver:kv})({}),w5=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:a,fullWidth:s=!1,inputComponent:l="input",multiline:u=!1,slotProps:c,slots:d={},type:f="text",...p}=r,h=uve(r),E={root:{ownerState:{disableUnderline:o}}},g=c??a?bn(c??a,E):E,y=d.root??i.Root??cve,v=d.input??i.Input??dve;return C.jsx(Tw,{slots:{root:y,input:v},slotProps:g,fullWidth:s,inputComponent:l,multiline:u,ref:n,type:f,...p,classes:h})});w5.muiName="Input";const r1=b.createContext({});function fve(e){return Dt("MuiList",e)}ht("MuiList",["root","padding","dense","subheader"]);const pve=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ot({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},fve,t)},hve=pe("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),mve=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiList"}),{children:o,className:i,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:u,...c}=r,d=b.useMemo(()=>({dense:s}),[s]),f={...r,component:a,dense:s,disablePadding:l},p=pve(f);return C.jsx(r1.Provider,{value:d,children:C.jsxs(hve,{as:a,className:Te(p.root,i),ref:n,ownerState:f,...c,children:[u,o]})})}),$A=ht("MuiListItemIcon",["root","alignItemsFlexStart"]),jA=ht("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function My(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function BA(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function C5(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function Nc(e,t,n,r,o,i){let a=!1,s=o(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!C5(s,i)||l)s=o(e,s,n);else return s.focus(),!0}return!1}const gve=b.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:c,variant:d="selectedMenu",...f}=t,p=b.useRef(null),h=b.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Yo(()=>{o&&p.current.focus()},[o]),b.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(v,{direction:S})=>{const x=!p.current.style.width;if(v.clientHeight{const S=p.current,x=v.key;if(v.ctrlKey||v.metaKey||v.altKey){c&&c(v);return}const T=gr(S).activeElement;if(x==="ArrowDown")v.preventDefault(),Nc(S,T,u,l,My);else if(x==="ArrowUp")v.preventDefault(),Nc(S,T,u,l,BA);else if(x==="Home")v.preventDefault(),Nc(S,null,u,l,My);else if(x==="End")v.preventDefault(),Nc(S,null,u,l,BA);else if(x.length===1){const A=h.current,R=x.toLowerCase(),w=performance.now();A.keys.length>0&&(w-A.lastTime>500?(A.keys=[],A.repeating=!0,A.previousKeyMatched=!0):A.repeating&&R!==A.keys[0]&&(A.repeating=!1)),A.lastTime=w,A.keys.push(R);const _=T&&!A.repeating&&C5(T,A);A.previousKeyMatched&&(_||Nc(S,T,!1,l,My,A))?v.preventDefault():A.previousKeyMatched=!1}c&&c(v)},E=Vt(p,n);let g=-1;b.Children.forEach(a,(v,S)=>{if(!b.isValidElement(v)){g===S&&(g+=1,g>=a.length&&(g=-1));return}v.props.disabled||(d==="selectedMenu"&&v.props.selected||g===-1)&&(g=S),g===S&&(v.props.disabled||v.props.muiSkipListHighlight||v.type.muiSkipListHighlight)&&(g+=1,g>=a.length&&(g=-1))});const y=b.Children.map(a,(v,S)=>{if(S===g){const x={};return i&&(x.autoFocus=!0),v.props.tabIndex===void 0&&d==="selectedMenu"&&(x.tabIndex=0),b.cloneElement(v,x)}return v});return C.jsx(mve,{role:"menu",ref:E,className:s,onKeyDown:m,tabIndex:o?0:-1,...f,children:y})});function vve(e){return Dt("MuiPopover",e)}ht("MuiPopover",["root","paper"]);function zA(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function HA(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function WA(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Hp(e){return typeof e=="function"?e():e}const yve=e=>{const{classes:t}=e;return Ot({root:["root"],paper:["paper"]},vve,t)},Sve=pe(ive,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),x5=pe(Pge,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),bve=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:s,anchorReference:l="anchorEl",children:u,className:c,container:d,elevation:f=8,marginThreshold:p=16,open:h,PaperProps:m={},slots:E={},slotProps:g={},transformOrigin:y={vertical:"top",horizontal:"left"},TransitionComponent:v,transitionDuration:S="auto",TransitionProps:x={},disableScrollLock:I=!1,...T}=r,A=b.useRef(),R={...r,anchorOrigin:a,anchorReference:l,elevation:f,marginThreshold:p,transformOrigin:y,TransitionComponent:v,transitionDuration:S,TransitionProps:x},w=yve(R),_=b.useCallback(()=>{if(l==="anchorPosition")return s;const te=Hp(i),le=(te&&te.nodeType===1?te:gr(A.current).body).getBoundingClientRect();return{top:le.top+zA(le,a.vertical),left:le.left+HA(le,a.horizontal)}},[i,a.horizontal,a.vertical,s,l]),k=b.useCallback(te=>({vertical:zA(te,y.vertical),horizontal:HA(te,y.horizontal)}),[y.horizontal,y.vertical]),N=b.useCallback(te=>{const de={width:te.offsetWidth,height:te.offsetHeight},le=k(de);if(l==="none")return{top:null,left:null,transformOrigin:WA(le)};const rt=_();let me=rt.top-le.vertical,De=rt.left-le.horizontal;const Kt=me+de.height,yt=De+de.width,q=Vi(Hp(i)),Se=q.innerHeight-p,fe=q.innerWidth-p;if(p!==null&&meSe){const Ye=Kt-Se;me-=Ye,le.vertical+=Ye}if(p!==null&&Defe){const Ye=yt-fe;De-=Ye,le.horizontal+=Ye}return{top:`${Math.round(me)}px`,left:`${Math.round(De)}px`,transformOrigin:WA(le)}},[i,l,_,k,p]),[F,U]=b.useState(h),$=b.useCallback(()=>{const te=A.current;if(!te)return;const de=N(te);de.top!==null&&te.style.setProperty("top",de.top),de.left!==null&&(te.style.left=de.left),te.style.transformOrigin=de.transformOrigin,U(!0)},[N]);b.useEffect(()=>(I&&window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)),[i,I,$]);const j=()=>{$()},M=()=>{U(!1)};b.useEffect(()=>{h&&$()}),b.useImperativeHandle(o,()=>h?{updatePosition:()=>{$()}}:null,[h,$]),b.useEffect(()=>{if(!h)return;const te=oD(()=>{$()}),de=Vi(Hp(i));return de.addEventListener("resize",te),()=>{te.clear(),de.removeEventListener("resize",te)}},[i,h,$]);let D=S;const z={slots:{transition:v,...E},slotProps:{transition:x,paper:m,...g}},[K,ae]=Jt("transition",{elementType:Dm,externalForwardedProps:z,ownerState:R,getSlotProps:te=>({...te,onEntering:(de,le)=>{var rt;(rt=te.onEntering)==null||rt.call(te,de,le),j()},onExited:de=>{var le;(le=te.onExited)==null||le.call(te,de),M()}}),additionalProps:{appear:!0,in:h}});S==="auto"&&!K.muiSupportAuto&&(D=void 0);const Ie=d||(i?gr(Hp(i)).body:void 0),[ne,{slots:ce,slotProps:Le,...Oe}]=Jt("root",{ref:n,elementType:Sve,externalForwardedProps:{...z,...T},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:E.backdrop},slotProps:{backdrop:VD(typeof g.backdrop=="function"?g.backdrop(R):g.backdrop,{invisible:!0})},container:Ie,open:h},ownerState:R,className:Te(w.root,c)}),[We,nt]=Jt("paper",{ref:A,className:w.paper,elementType:x5,externalForwardedProps:z,shouldForwardComponentProp:!0,additionalProps:{elevation:f,style:F?void 0:{opacity:0}},ownerState:R});return C.jsx(ne,{...Oe,...!n1(ne)&&{slots:ce,slotProps:Le,disableScrollLock:I},children:C.jsx(K,{...ae,timeout:D,children:C.jsx(We,{...nt,children:u})})})});function Eve(e){return Dt("MuiMenu",e)}ht("MuiMenu",["root","paper","list"]);const wve={vertical:"top",horizontal:"right"},Cve={vertical:"top",horizontal:"left"},xve=e=>{const{classes:t}=e;return Ot({root:["root"],paper:["paper"],list:["list"]},Eve,t)},Ive=pe(bve,{shouldForwardProp:e=>To(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Tve=pe(x5,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Ave=pe(gve,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),_ve=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:a,disableAutoFocusItem:s=!1,MenuListProps:l={},onClose:u,open:c,PaperProps:d={},PopoverClasses:f,transitionDuration:p="auto",TransitionProps:{onEntering:h,...m}={},variant:E="selectedMenu",slots:g={},slotProps:y={},...v}=r,S=uw(),x={...r,autoFocus:o,disableAutoFocusItem:s,MenuListProps:l,onEntering:h,PaperProps:d,transitionDuration:p,TransitionProps:m,variant:E},I=xve(x),T=o&&!s&&c,A=b.useRef(null),R=(D,z)=>{A.current&&A.current.adjustStyleForScrollbar(D,{direction:S?"rtl":"ltr"}),h&&h(D,z)},w=D=>{D.key==="Tab"&&(D.preventDefault(),u&&u(D,"tabKeyDown"))};let _=-1;b.Children.map(i,(D,z)=>{b.isValidElement(D)&&(D.props.disabled||(E==="selectedMenu"&&D.props.selected||_===-1)&&(_=z))});const k={slots:g,slotProps:{list:l,transition:m,paper:d,...y}},N=hD({elementType:g.root,externalSlotProps:y.root,ownerState:x,className:[I.root,a]}),[F,U]=Jt("paper",{className:I.paper,elementType:Tve,externalForwardedProps:k,shouldForwardComponentProp:!0,ownerState:x}),[$,j]=Jt("list",{className:Te(I.list,l.className),elementType:Ave,shouldForwardComponentProp:!0,externalForwardedProps:k,getSlotProps:D=>({...D,onKeyDown:z=>{var K;w(z),(K=D.onKeyDown)==null||K.call(D,z)}}),ownerState:x}),M=typeof k.slotProps.transition=="function"?k.slotProps.transition(x):k.slotProps.transition;return C.jsx(Ive,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?wve:Cve,slots:{root:g.root,paper:F,backdrop:g.backdrop,...g.transition&&{transition:g.transition}},slotProps:{root:N,paper:U,backdrop:typeof y.backdrop=="function"?y.backdrop(x):y.backdrop,transition:{...M,onEntering:(...D)=>{var z;R(...D),(z=M==null?void 0:M.onEntering)==null||z.call(M,...D)}}},open:c,ref:n,transitionDuration:p,ownerState:x,...v,classes:f,children:C.jsx($,{actions:A,autoFocus:o&&(_===-1||s),autoFocusItem:T,variant:E,...j,children:i})})});function Rve(e){return Dt("MuiMenuItem",e)}const Oc=ht("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Pve=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},kve=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:a}=e,l=Ot({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},Rve,a);return{...a,...l}},Nve=pe(e5,{shouldForwardProp:e=>To(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:Pve})(vt(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Oc.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ti(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Oc.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ti(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Oc.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ti(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ti(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Oc.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Oc.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${UA.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${UA.inset}`]:{marginLeft:52},[`& .${jA.root}`]:{marginTop:0,marginBottom:0},[`& .${jA.inset}`]:{paddingLeft:36},[`& .${$A.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${$A.root} svg`]:{fontSize:"1.25rem"}}}]}))),Ove=b.forwardRef(function(t,n){const r=$t({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:f,...p}=r,h=b.useContext(r1),m=b.useMemo(()=>({dense:a||h.dense||!1,disableGutters:l}),[h.dense,a,l]),E=b.useRef(null);Yo(()=>{o&&E.current&&E.current.focus()},[o]);const g={...r,dense:m.dense,divider:s,disableGutters:l},y=kve(r),v=Vt(E,n);let S;return r.disabled||(S=d!==void 0?d:-1),C.jsx(r1.Provider,{value:m,children:C.jsx(Nve,{ref:v,role:c,tabIndex:S,component:i,focusVisibleClassName:Te(y.focusVisible,u),className:Te(y.root,f),...p,ownerState:g,classes:y})})});function Dve(e){return Dt("MuiNativeSelect",e)}const Aw=ht("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Mve=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,s={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${It(n)}`,i&&"iconOpen",r&&"disabled"]};return Ot(s,Dve,t)},I5=pe("select")(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${Aw.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),Fve=pe(I5,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:To,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Aw.multiple}`]:t.multiple}]}})({}),T5=pe("svg")(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${Aw.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),Lve=pe(T5,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${It(n.variant)}`],n.open&&t.iconOpen]}})({}),Uve=b.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:a,inputRef:s,variant:l="standard",...u}=t,c={...t,disabled:o,variant:l,error:i},d=Mve(c);return C.jsxs(b.Fragment,{children:[C.jsx(Fve,{ownerState:c,className:Te(d.select,r),disabled:o,ref:s||n,...u}),t.multiple?null:C.jsx(Lve,{as:a,ownerState:c,className:d.icon})]})});var VA;const $ve=pe("fieldset",{shouldForwardProp:To})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),jve=pe("legend",{shouldForwardProp:To})(vt(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function Bve(e){const{children:t,classes:n,className:r,label:o,notched:i,...a}=e,s=o!=null&&o!=="",l={...e,notched:i,withLabel:s};return C.jsx($ve,{"aria-hidden":!0,className:r,ownerState:l,...a,children:C.jsx(jve,{ownerState:l,children:s?C.jsx("span",{children:o}):VA||(VA=C.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const zve=e=>{const{classes:t}=e,r=Ot({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Lge,t);return{...t,...r}},Hve=pe(Nv,{shouldForwardProp:e=>To(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Pv})(vt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Do.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Do.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Do.focused} .${Do.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(_v()).map(([n])=>({props:{color:n},style:{[`&.${Do.focused} .${Do.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Do.error} .${Do.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Do.disabled} .${Do.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),Wve=pe(Bve,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(vt(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}})),Vve=pe(Ov,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:kv})(vt(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),A5=b.forwardRef(function(t,n){var r;const o=$t({props:t,name:"MuiOutlinedInput"}),{components:i={},fullWidth:a=!1,inputComponent:s="input",label:l,multiline:u=!1,notched:c,slots:d={},type:f="text",...p}=o,h=zve(o),m=Iw(),E=xw({props:o,muiFormControl:m,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),g={...o,color:E.color||"primary",disabled:E.disabled,error:E.error,focused:E.focused,formControl:m,fullWidth:a,hiddenLabel:E.hiddenLabel,multiline:u,size:E.size,type:f},y=d.root??i.Root??Hve,v=d.input??i.Input??Vve;return C.jsx(Tw,{slots:{root:y,input:v},renderSuffix:S=>C.jsx(Wve,{ownerState:g,className:h.notchedOutline,label:l!=null&&l!==""&&E.required?r||(r=C.jsxs(b.Fragment,{children:[l," ","*"]})):l,notched:typeof c<"u"?c:!!(S.startAdornment||S.filled||S.focused)}),fullWidth:a,inputComponent:s,multiline:u,ref:n,type:f,...p,classes:{...h,notchedOutline:null}})});A5.muiName="Input";function _5(e){return Dt("MuiSelect",e)}const Dc=ht("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var KA;const Kve=pe(I5,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Dc.select}`]:t.select},{[`&.${Dc.select}`]:t[n.variant]},{[`&.${Dc.error}`]:t.error},{[`&.${Dc.multiple}`]:t.multiple}]}})({[`&.${Dc.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Gve=pe(T5,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${It(n.variant)}`],n.open&&t.iconOpen]}})({}),qve=pe("input",{shouldForwardProp:e=>WD(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function GA(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function Qve(e){return e==null||typeof e=="string"&&!e.trim()}const Yve=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,s={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${It(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ot(s,_5,t)},Xve=b.forwardRef(function(t,n){var Un;const{"aria-describedby":r,"aria-label":o,autoFocus:i,autoWidth:a,children:s,className:l,defaultOpen:u,defaultValue:c,disabled:d,displayEmpty:f,error:p=!1,IconComponent:h,inputRef:m,labelId:E,MenuProps:g={},multiple:y,name:v,onBlur:S,onChange:x,onClose:I,onFocus:T,onOpen:A,open:R,readOnly:w,renderValue:_,required:k,SelectDisplayProps:N={},tabIndex:F,type:U,value:$,variant:j="standard",...M}=t,[D,z]=Tm({controlled:$,default:c,name:"Select"}),[K,ae]=Tm({controlled:R,default:u,name:"Select"}),Ie=b.useRef(null),ne=b.useRef(null),[ce,Le]=b.useState(null),{current:Oe}=b.useRef(R!=null),[We,nt]=b.useState(),te=Vt(n,m),de=b.useCallback(ue=>{ne.current=ue,ue&&Le(ue)},[]),le=ce==null?void 0:ce.parentNode;b.useImperativeHandle(te,()=>({focus:()=>{ne.current.focus()},node:Ie.current,value:D}),[D]),b.useEffect(()=>{u&&K&&ce&&!Oe&&(nt(a?null:le.clientWidth),ne.current.focus())},[ce,a]),b.useEffect(()=>{i&&ne.current.focus()},[i]),b.useEffect(()=>{if(!E)return;const ue=gr(ne.current).getElementById(E);if(ue){const Xe=()=>{getSelection().isCollapsed&&ne.current.focus()};return ue.addEventListener("click",Xe),()=>{ue.removeEventListener("click",Xe)}}},[E]);const rt=(ue,Xe)=>{ue?A&&A(Xe):I&&I(Xe),Oe||(nt(a?null:le.clientWidth),ae(ue))},me=ue=>{ue.button===0&&(ue.preventDefault(),ne.current.focus(),rt(!0,ue))},De=ue=>{rt(!1,ue)},Kt=b.Children.toArray(s),yt=ue=>{const Xe=Kt.find(Gt=>Gt.props.value===ue.target.value);Xe!==void 0&&(z(Xe.props.value),x&&x(ue,Xe))},q=ue=>Xe=>{let Gt;if(Xe.currentTarget.hasAttribute("tabindex")){if(y){Gt=Array.isArray(D)?D.slice():[];const eo=D.indexOf(ue.props.value);eo===-1?Gt.push(ue.props.value):Gt.splice(eo,1)}else Gt=ue.props.value;if(ue.props.onClick&&ue.props.onClick(Xe),D!==Gt&&(z(Gt),x)){const eo=Xe.nativeEvent||Xe,jf=new eo.constructor(eo.type,eo);Object.defineProperty(jf,"target",{writable:!0,value:{value:Gt,name:v}}),x(jf,ue)}y||rt(!1,Xe)}},Se=ue=>{w||[" ","ArrowUp","ArrowDown","Enter"].includes(ue.key)&&(ue.preventDefault(),rt(!0,ue))},fe=ce!==null&&K,Ye=ue=>{!fe&&S&&(Object.defineProperty(ue,"target",{writable:!0,value:{value:D,name:v}}),S(ue))};delete M["aria-invalid"];let re,Ln;const jt=[];let Xr=!1;(b5({value:D})||f)&&(_?re=_(D):Xr=!0);const _o=Kt.map(ue=>{if(!b.isValidElement(ue))return null;let Xe;if(y){if(!Array.isArray(D))throw new Error(Wi(2));Xe=D.some(Gt=>GA(Gt,ue.props.value)),Xe&&Xr&&jt.push(ue.props.children)}else Xe=GA(D,ue.props.value),Xe&&Xr&&(Ln=ue.props.children);return b.cloneElement(ue,{"aria-selected":Xe?"true":"false",onClick:q(ue),onKeyUp:Gt=>{Gt.key===" "&&Gt.preventDefault(),ue.props.onKeyUp&&ue.props.onKeyUp(Gt)},role:"option",selected:Xe,value:void 0,"data-value":ue.props.value})});Xr&&(y?jt.length===0?re=null:re=jt.reduce((ue,Xe,Gt)=>(ue.push(Xe),Gt{const{classes:t}=e,r=Ot({root:["root"]},_5,t);return{...t,...r}},_w={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>To(e)&&e!=="variant",slot:"Root"},Zve=pe(w5,_w)(""),eye=pe(A5,_w)(""),tye=pe(E5,_w)(""),R5=b.forwardRef(function(t,n){const r=$t({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:c=$ge,id:d,input:f,inputProps:p,label:h,labelId:m,MenuProps:E,multiple:g=!1,native:y=!1,onClose:v,onOpen:S,open:x,renderValue:I,SelectDisplayProps:T,variant:A="outlined",...R}=r,w=y?Uve:Xve,_=Iw(),k=xw({props:r,muiFormControl:_,states:["variant","error"]}),N=k.variant||A,F={...r,variant:N,classes:a},U=Jve(F),{root:$,...j}=U,M=f||{standard:C.jsx(Zve,{ownerState:F}),outlined:C.jsx(eye,{label:h,ownerState:F}),filled:C.jsx(tye,{ownerState:F})}[N],D=Vt(n,al(M));return C.jsx(b.Fragment,{children:b.cloneElement(M,{inputComponent:w,inputProps:{children:i,error:k.error,IconComponent:c,variant:N,type:void 0,multiple:g,...y?{id:d}:{autoWidth:o,defaultOpen:l,displayEmpty:u,labelId:m,MenuProps:E,onClose:v,onOpen:S,open:x,renderValue:I,SelectDisplayProps:{id:d,...T}},...p,classes:p?bn(j,p.classes):j,...f?f.props.inputProps:{}},...(g&&y||u)&&N==="outlined"?{notched:!0}:{},ref:D,className:Te(M.props.className,s,U.root),...!f&&{variant:N},...R})})});R5.muiName="Select";function nye(){const{data:e}=Av(),t=kpe(),[n,r]=b.useState(""),[o,i]=b.useState(""),[a,s]=b.useState(""),[l,u]=b.useState("Fastfood"),c=()=>{if(!n||!o||!l){alert("Fill out all fields");return}t.mutate({name:n,calories:parseInt(o),icon:l,protein:parseInt(a)||0}),r(""),i(""),s(""),u("Fastfood")};return C.jsxs(PE,{legend:"Create Quick Add",variation:"outlined",direction:"column",children:[C.jsx(Ii,{htmlFor:"name",children:"Name:"}),C.jsx(_s,{value:n,onChange:d=>r(d.target.value),size:"large",placeholder:"Lunch",id:"name"}),C.jsx(Ii,{htmlFor:"calories",children:"Calories:"}),C.jsx(_s,{value:o,onChange:d=>i(d.target.value),size:"large",placeholder:"250",id:"calories"}),!(e!=null&&e.hideProtein)&&C.jsxs(C.Fragment,{children:[C.jsx(Ii,{htmlFor:"protein",children:"Protein (g):"}),C.jsx(_s,{value:a,onChange:d=>s(d.target.value),size:"large",placeholder:"12",id:"protein"})]}),C.jsx(Ii,{htmlFor:"icon",children:"Icon:"}),C.jsx(R5,{onChange:d=>u(d.target.value),label:"Icon",value:l,id:"icon",children:m5.map(d=>C.jsx(Ove,{value:d.iconName,children:d.component},d.iconName))}),C.jsx(pt,{isFullWidth:!0,isLoading:t.isPending,colorTheme:"overlay",size:"large",onClick:c,children:"Create Quick Add"})]})}function rye(){const{data:e=[]}=YD(),{data:t}=Av(),n=Npe(),r=e.length>0?e:v5,o=i=>{i.startsWith("dqa-")||n.mutate(i)};return C.jsx(kn,{children:C.jsxs(rl,{caption:"Your quick adds",highlightOnHover:!1,children:[C.jsx(il,{children:C.jsxs(wt,{children:[C.jsx(G,{as:"th",children:"Name"}),C.jsx(G,{as:"th",children:"Icon"}),C.jsx(G,{as:"th",children:"Cals"}),!(t!=null&&t.hideProtein)&&C.jsx(G,{as:"th",children:"Pr"}),C.jsx(G,{as:"th",children:C.jsx(km,{})})]})}),C.jsx(ol,{children:r.map(i=>C.jsxs(wt,{children:[C.jsx(G,{children:i.name}),C.jsx(G,{children:h5(i.icon)}),C.jsx(G,{children:i.calories}),!(t!=null&&t.hideProtein)&&C.jsx(G,{children:i.protein}),C.jsx(G,{onClick:()=>o(i.id),children:i.id.startsWith("dqa-")?null:C.jsx(km,{})})]},i.id))})]})})}function oye(){const{data:e}=Av(),t=Ope(),n=o=>{e&&t.mutate({...e,hideProtein:o.target.checked})},r=o=>{e&&t.mutate({...e,hideSteps:o.target.checked})};return C.jsxs(kn,{textAlign:"left",children:[C.jsx(MS,{isChecked:(e==null?void 0:e.hideProtein)??!1,isDisabled:t.isPending,onChange:n,label:"Hide Protein",labelPosition:"start"}),C.jsx(MS,{isChecked:(e==null?void 0:e.hideSteps)??!1,isDisabled:t.isPending,onChange:r,label:"Hide Steps",labelPosition:"start"})]})}var qA;(function(e){e[e.Sunday=1]="Sunday",e[e.Monday=2]="Monday",e[e.Tuesday=3]="Tuesday",e[e.Wednesday=4]="Wednesday",e[e.Thursday=5]="Thursday",e[e.Friday=6]="Friday",e[e.Saturday=7]="Saturday"})(qA||(qA={}));const QA=el("LocalNotifications",{web:()=>wf(()=>import("./web-Bt8Z9-wf.js"),[]).then(e=>new e.LocalNotificationsWeb)});var YA;(function(e){e.STEP_COUNT="stepCount",e.FLIGHTS_CLIMBED="flightsClimbed",e.APPLE_EXERCISE_TIME="appleExerciseTime",e.ACTIVE_ENERGY_BURNED="activeEnergyBurned",e.BASAL_ENERGY_BURNED="basalEnergyBurned",e.DISTANCE_WALKING_RUNNING="distanceWalkingRunning",e.DISTANCE_CYCLING="distanceCycling",e.BLOOD_GLUCOSE="bloodGlucose",e.SLEEP_ANALYSIS="sleepAnalysis",e.WORKOUT_TYPE="workoutType",e.WEIGHT="weight",e.HEART_RATE="heartRate",e.RESTING_HEART_RATE="restingHeartRate",e.RESPIRATORY_RATE="respiratoryRate",e.BODY_FAT="bodyFat",e.OXYGEN_SATURATION="oxygenSaturation",e.BASAL_BODY_TEMPERATURE="basalBodyTemperature",e.BODY_TEMPERATURE="bodyTemperature",e.BLOOD_PRESSURE_SYSTOLIC="bloodPressureSystolic",e.BLOOD_PRESSURE_DIASTOLIC="bloodPressureDiastolic"})(YA||(YA={}));const XA=el("CapacitorHealthkit",{web:()=>wf(()=>import("./web-MOngFcK3.js"),[]).then(e=>new e.CapacitorHealthkitWeb)}),Wp="hasPermission";function P5(){const[e,t]=b.useState(!1),[n,r]=b.useState(localStorage.getItem(Wp)===Wp),o=async()=>{t(!0);const a=["calories","steps","weight","activity"];await XA.requestAuthorization({all:[],read:a,write:[]}),await QA.requestPermissions(),await QA.schedule({notifications:[{title:"Have you logged lunch?",body:"Log your food",id:13,schedule:{allowWhileIdle:!0,on:{hour:13}}},{title:"Have you logged dinner?",body:"Log your food",id:20,schedule:{allowWhileIdle:!0,on:{hour:20}}}]}),localStorage.setItem(Wp,Wp),r(!0),t(!1)},i=async()=>{const a=["calories","steps","weight","activity"];await XA.requestAuthorization({all:[],read:a,write:[]}),window.location.href="proxy.php?url=https%3A%2F%2Ffit.jpc.io%2Fx-apple-health%3A%2F%2FSources%2Fjpc.fit"};return C.jsxs(kn,{children:[C.jsx(Ii,{as:"div",children:"HealthKit data and notifications provide the best experience for this app. Grant permission?"}),C.jsx("br",{}),n?C.jsx(pt,{margin:"10px",onClick:i,children:"Launch Healthkit"}):C.jsx(pt,{variation:"primary",isLoading:e,margin:"10px",onClick:o,children:"Grant Permission"})]})}function iye(){const{tokens:e}=Xa(),t=Jn(),n=async()=>{confirm("Are you sure? This will delete your account and all associated data.")&&(await E9(),await $d())},r=async()=>{await $d()},o=()=>{t.invalidateQueries()};return C.jsxs(C.Fragment,{children:[C.jsxs(kn,{textAlign:"center",children:[C.jsx(pt,{margin:e.space.medium,onClick:o,children:"Clear Cache"})," ",C.jsx(pt,{margin:e.space.medium,variation:"warning",onClick:r,children:"Sign Out"}),C.jsx(pt,{margin:e.space.medium,variation:"destructive",onClick:n,children:"Delete Account"})]}),C.jsxs(kn,{marginTop:e.space.medium,children:["For support, send an email to"," ",C.jsx(wE,{href:"mailto:john@johncorser.com",children:"john@johncorser.com"})]})]})}function aye(){return C.jsxs(C.Fragment,{children:[C.jsx(Tge,{}),C.jsx(nye,{}),C.jsx(Gd,{}),C.jsx(rye,{}),C.jsx(oye,{}),C.jsx(P5,{}),C.jsx(iye,{})]})}function sye(){return C.jsx(sa,{justifyContent:"flex-start",spacing:"equal",defaultValue:"Calories",items:[{label:C.jsx(KD,{}),value:"Calories",content:C.jsx(sge,{})},{label:C.jsx(GD,{}),value:"Weight",content:C.jsx(Sge,{})},{label:C.jsx(Kfe,{}),value:"Stats",content:C.jsx(wge,{})},{label:C.jsx(Gfe,{}),value:"Aphorisms",content:C.jsx(Ige,{})},{label:C.jsx(qfe,{}),value:"Settings",content:C.jsx(aye,{})}]})}const lye=()=>{const{tokens:e}=Xa();return C.jsx(CE,{templateColumns:"3fr 1fr",templateRows:"4rem",gap:e.space.small,marginBottom:e.space.medium,children:C.jsx(Y,{children:C.jsx(kn,{children:C.jsxs(ve,{direction:"row",justifyContent:"flex-start",alignItems:"stretch",alignContent:"flex-start",wrap:"nowrap",gap:"1rem",children:[C.jsx(Y,{height:"2rem",children:C.jsx(ds,{objectFit:"initial",src:"/maskable.png",alt:"icon",borderRadius:e.radii.large,height:"50px"})}),C.jsxs(Y,{height:"2rem",children:[C.jsx(Zn,{level:5,children:"fit.jpc.io"}),C.jsx(Je,{as:"span",fontSize:"small",children:"Health tracker"})]})]})})})})},uye=()=>{const{tokens:e}=Xa();return C.jsx(Y,{backgroundColor:e.colors.background.secondary,padding:e.space.medium,children:C.jsx(kn,{children:C.jsx(ve,{direction:"row",alignItems:"center",justifyContent:"flex-start",alignContent:"flex-start",children:C.jsx(ve,{direction:"column",alignItems:"center",justifyContent:"flex-start",alignContent:"flex-start",gap:e.space.xs,children:C.jsxs(ve,{as:"span",direction:"row",alignItems:"center",justifyContent:"flex-start",alignContent:"flex-start",gap:e.space.xs,children:[C.jsx(pt,{as:"a",href:"https://github.com/johnpc/jpc-fit",children:C.jsx(ds,{alt:"github",src:"/github.png"})}),C.jsx(Je,{as:"span",children:"fit.jpc.io is open source."}),go.getPlatform()==="ios"?null:C.jsx(wE,{href:"https://apps.apple.com/us/app/jpc-fit/id6482482386",children:"Download iOS app"})]})})})})})},Vp=el("WidgetsBridgePlugin"),Fy="group.com.johncorser.fit.prefs",cye="consumedCalories",dye="consumedCaloriesDay",fye="burnedCalories",k5=async(e,t)=>{if(go.getPlatform()==="ios")try{const n=[Vp.setItem({group:Fy,key:cye,value:e.toString()}),Vp.setItem({group:Fy,key:dye,value:new Date().toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})})];t!==void 0&&t>0&&n.push(Vp.setItem({group:Fy,key:fye,value:t.toString()})),await Promise.all(n),await Vp.reloadAllTimelines()}catch(n){console.error("Failed to update widget:",n)}},N5=Object.freeze(Object.defineProperty({__proto__:null,updateWidget:k5},Symbol.toStringTag,{value:"Module"})),Kp="hasPermission";function pye(){const{user:e,loading:t}=Cf(),n=new Date().toLocaleDateString(),{data:r=[]}=rr(n),[o,i]=b.useState(go.getPlatform()!=="ios"||localStorage.getItem(Kp)===Kp),a=()=>{const l=go.getPlatform()!=="ios"||localStorage.getItem(Kp)===Kp;i(l)},s=b.useRef(r);return s.current=r,b.useEffect(()=>{if(go.getPlatform()!=="ios")return;a();const l=sI.addListener("appStateChange",({isActive:c})=>{if(c)a();else{const d=s.current.reduce((f,p)=>f+p.calories,0);k5(d)}}),u=sI.addListener("resume",()=>{a()});return()=>{l.then(c=>c.remove()),u.then(c=>c.remove())}},[]),t?C.jsx("div",{children:"Loading..."}):e?o?C.jsxs(C.Fragment,{children:[C.jsx(lye,{}),C.jsx(sye,{}),C.jsx(uye,{})]}):C.jsx(P5,{}):C.jsx(Zi,{components:{Header(){return C.jsxs("div",{style:{textAlign:"center",backgroundColor:"palevioletred",padding:"15px"},children:[C.jsx("img",{alt:"logo",style:{borderRadius:"12px",width:"100px"},src:"/maskable.png"}),C.jsx("h1",{style:{fontSize:"24px",color:"#f0f0f0",margin:"10px 0"},children:"jpc.fit"})]})},Footer(){return C.jsx("div",{style:{textAlign:"center",padding:"20px"},children:go.getPlatform()!=="ios"&&C.jsx("a",{href:"https://apps.apple.com/us/app/jpc-fit/id6482482386",style:{color:"white"},children:"Download the app for iOS devices"})})}}})}function hye({children:e}){const t=Jn(),{user:n}=Cf();return b.useEffect(()=>{if(!n)return;const r=[ke.models.Food.onCreate().subscribe({next:o=>{const i=o;t.invalidateQueries({queryKey:["food",i.day]})}}),ke.models.Food.onUpdate().subscribe({next:o=>{const i=o;t.invalidateQueries({queryKey:["food",i.day]})}}),ke.models.Food.onDelete().subscribe({next:o=>{const i=o;t.invalidateQueries({queryKey:["food",i.day]})}}),ke.models.Goal.onCreate().subscribe({next:()=>t.invalidateQueries({queryKey:["goal"]})}),ke.models.Goal.onUpdate().subscribe({next:()=>t.invalidateQueries({queryKey:["goal"]})}),ke.models.Weight.onCreate().subscribe({next:()=>t.invalidateQueries({queryKey:["weight"]})}),ke.models.Weight.onDelete().subscribe({next:()=>t.invalidateQueries({queryKey:["weight"]})}),ke.models.Height.onCreate().subscribe({next:()=>t.invalidateQueries({queryKey:["height"]})}),ke.models.QuickAdd.onCreate().subscribe({next:()=>t.invalidateQueries({queryKey:["quickAdd"]})}),ke.models.QuickAdd.onUpdate().subscribe({next:()=>t.invalidateQueries({queryKey:["quickAdd"]})}),ke.models.QuickAdd.onDelete().subscribe({next:()=>t.invalidateQueries({queryKey:["quickAdd"]})}),ke.models.Preferences.onCreate().subscribe({next:()=>t.invalidateQueries({queryKey:["preferences"]})}),ke.models.Preferences.onUpdate().subscribe({next:()=>t.invalidateQueries({queryKey:["preferences"]})}),ke.models.HealthKitCache.onCreate().subscribe({next:o=>{const i=o;t.invalidateQueries({queryKey:["healthKitCache",i.day]})}}),ke.models.HealthKitCache.onUpdate().subscribe({next:o=>{const i=o;t.invalidateQueries({queryKey:["healthKitCache",i.day]})}}),ke.models.HealthKitCache.onDelete().subscribe({next:o=>{const i=o;t.invalidateQueries({queryKey:["healthKitCache",i.day]})}})];return()=>{r.forEach(o=>o.unsubscribe())}},[n,t]),C.jsx(C.Fragment,{children:e})}ik.configure(N9);const mye=new FF({defaultOptions:{queries:{staleTime:1e3*60*5,refetchOnWindowFocus:!1,refetchOnMount:!1}}}),gye={name:"my-theme",primaryColor:"purple"};Ly.createRoot(document.getElementById("root")).render(C.jsx(O.StrictMode,{children:C.jsx(LF,{client:mye,children:C.jsx(W9,{children:C.jsx(hye,{children:C.jsx(Cue,{theme:gye,children:C.jsx(pye,{})})})})})}));export{ak as W};