-
Notifications
You must be signed in to change notification settings - Fork 0
/
602994b4473d45b072c5d082f44c290a3cd4dee2-86d09df05bfc10551dae.js
3 lines (3 loc) · 171 KB
/
602994b4473d45b072c5d082f44c290a3cd4dee2-86d09df05bfc10551dae.js
1
2
3
/*! For license information please see 602994b4473d45b072c5d082f44c290a3cd4dee2-86d09df05bfc10551dae.js.LICENSE.txt */
(self.webpackChunkweblab_website=self.webpackChunkweblab_website||[]).push([[129],{7757:function(e,t,r){e.exports=r(5666)},5330:function(e,t,r){"use strict";r.d(t,{Y:function(){return i}});var n=r(7294),o=n.createContext();function i(){return n.useContext(o)}t.Z=o},6703:function(e,t,r){"use strict";function n(e){var t=e.props,r=e.states,n=e.muiFormControl;return r.reduce((function(e,r){return e[r]=t[r],n&&void 0===t[r]&&(e[r]=n[r]),e}),{})}r.d(t,{Z:function(){return n}})},4376:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(7294),o=r(5330);function i(){return n.useContext(o.Z)}},5685:function(e,t,r){"use strict";var n=r(7462),o=r(5987),i=r(7294),a=r(2585),s=r(4376),u=r(3288),c=r(454),l=r(7969),d=i.forwardRef((function(e,t){e.checked;var r=e.classes,u=e.className,d=e.control,h=e.disabled,f=(e.inputRef,e.label),p=e.labelPlacement,v=void 0===p?"end":p,m=(e.name,e.onChange,e.value,(0,o.Z)(e,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),b=(0,s.Z)(),y=h;void 0===y&&void 0!==d.props.disabled&&(y=d.props.disabled),void 0===y&&b&&(y=b.disabled);var g={disabled:y};return["checked","name","onChange","value","inputRef"].forEach((function(t){void 0===d.props[t]&&void 0!==e[t]&&(g[t]=e[t])})),i.createElement("label",(0,n.Z)({className:(0,a.Z)(r.root,u,"end"!==v&&r["labelPlacement".concat((0,l.Z)(v))],y&&r.disabled),ref:t},m),i.cloneElement(d,g),i.createElement(c.Z,{component:"span",className:(0,a.Z)(r.label,y&&r.disabled)},f))}));t.Z=(0,u.Z)((function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}}),{name:"MuiFormControlLabel"})(d)},3570:function(e,t,r){"use strict";var n=r(7462),o=r(5987),i=r(7294),a=r(2585),s=r(3288),u=i.forwardRef((function(e,t){var r=e.classes,s=e.className,u=e.row,c=void 0!==u&&u,l=(0,o.Z)(e,["classes","className","row"]);return i.createElement("div",(0,n.Z)({className:(0,a.Z)(r.root,s,c&&r.row),ref:t},l))}));t.Z=(0,s.Z)({root:{display:"flex",flexDirection:"column",flexWrap:"wrap"},row:{flexDirection:"row"}},{name:"MuiFormGroup"})(u)},6566:function(e,t,r){"use strict";var n=r(5987),o=r(7462),i=r(7294),a=r(2585),s=r(6703),u=r(4376),c=r(7969),l=r(3288),d=i.forwardRef((function(e,t){var r=e.children,l=e.classes,d=e.className,h=(e.color,e.component),f=void 0===h?"label":h,p=(e.disabled,e.error,e.filled,e.focused,e.required,(0,n.Z)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),v=(0,u.Z)(),m=(0,s.Z)({props:e,muiFormControl:v,states:["color","required","focused","disabled","error","filled"]});return i.createElement(f,(0,o.Z)({className:(0,a.Z)(l.root,l["color".concat((0,c.Z)(m.color||"primary"))],d,m.disabled&&l.disabled,m.error&&l.error,m.filled&&l.filled,m.focused&&l.focused,m.required&&l.required),ref:t},p),r,m.required&&i.createElement("span",{"aria-hidden":!0,className:(0,a.Z)(l.asterisk,m.error&&l.error)}," ","*"))}));t.Z=(0,l.Z)((function(e){return{root:(0,o.Z)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(d)},8025:function(e,t,r){"use strict";var n=r(7462),o=r(885),i=r(5987),a=r(7294),s=r(628),u=r(802),c=r(3633),l=r(395);function d(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var h={entering:{opacity:1,transform:d(1)},entered:{opacity:1,transform:"none"}},f=a.forwardRef((function(e,t){var r=e.children,f=e.disableStrictModeCompat,p=void 0!==f&&f,v=e.in,m=e.onEnter,b=e.onEntered,y=e.onEntering,g=e.onExit,k=e.onExited,w=e.onExiting,x=e.style,E=e.timeout,_=void 0===E?"auto":E,T=e.TransitionComponent,S=void 0===T?s.ZP:T,O=(0,i.Z)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),C=a.useRef(),R=a.useRef(),Z=(0,u.Z)(),P=Z.unstable_strictMode&&!p,N=a.useRef(null),I=(0,l.Z)(r.ref,t),A=(0,l.Z)(P?N:void 0,I),j=function(e){return function(t,r){if(e){var n=P?[N.current,t]:[t,r],i=(0,o.Z)(n,2),a=i[0],s=i[1];void 0===s?e(a):e(a,s)}}},D=j(y),M=j((function(e,t){(0,c.n)(e);var r,n=(0,c.C)({style:x,timeout:_},{mode:"enter"}),o=n.duration,i=n.delay;"auto"===_?(r=Z.transitions.getAutoHeightDuration(e.clientHeight),R.current=r):r=o,e.style.transition=[Z.transitions.create("opacity",{duration:r,delay:i}),Z.transitions.create("transform",{duration:.666*r,delay:i})].join(","),m&&m(e,t)})),U=j(b),L=j(w),B=j((function(e){var t,r=(0,c.C)({style:x,timeout:_},{mode:"exit"}),n=r.duration,o=r.delay;"auto"===_?(t=Z.transitions.getAutoHeightDuration(e.clientHeight),R.current=t):t=n,e.style.transition=[Z.transitions.create("opacity",{duration:t,delay:o}),Z.transitions.create("transform",{duration:.666*t,delay:o||.333*t})].join(","),e.style.opacity="0",e.style.transform=d(.75),g&&g(e)})),F=j(k);return a.useEffect((function(){return function(){clearTimeout(C.current)}}),[]),a.createElement(S,(0,n.Z)({appear:!0,in:v,nodeRef:P?N:void 0,onEnter:M,onEntered:U,onEntering:D,onExit:B,onExited:F,onExiting:L,addEndListener:function(e,t){var r=P?e:t;"auto"===_&&(C.current=setTimeout(r,R.current||0))},timeout:"auto"===_?null:_},O),(function(e,t){return a.cloneElement(r,(0,n.Z)({style:(0,n.Z)({opacity:0,transform:d(.75),visibility:"exited"!==e||v?void 0:"hidden"},h[e],x,r.props.style),ref:A},t))}))}));f.muiSupportAuto=!0,t.Z=f},9509:function(e,t,r){"use strict";var n=r(7462),o=r(5987),i=r(7294),a=r(2585),s=r(2785),u=r(3288),c=i.forwardRef((function(e,t){var r=e.disableUnderline,u=e.classes,c=e.fullWidth,l=void 0!==c&&c,d=e.inputComponent,h=void 0===d?"input":d,f=e.multiline,p=void 0!==f&&f,v=e.type,m=void 0===v?"text":v,b=(0,o.Z)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(s.Z,(0,n.Z)({classes:(0,n.Z)({},u,{root:(0,a.Z)(u.root,!r&&u.underline),underline:null}),fullWidth:l,inputComponent:h,multiline:p,ref:t,type:m},b))}));c.muiName="Input",t.Z=(0,u.Z)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return{root:{position:"relative"},formControl:{"label + &":{marginTop:16}},focused:{},disabled:{},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),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"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(t),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($disabled):before":{borderBottom:"2px solid ".concat(e.palette.text.primary),"@media (hover: none)":{borderBottom:"1px solid ".concat(t)}},"&$disabled:before":{borderBottomStyle:"dotted"}},error:{},marginDense:{},multiline:{},fullWidth:{},input:{},inputMarginDense:{},inputMultiline:{},inputTypeSearch:{}}}),{name:"MuiInput"})(c)},2785:function(e,t,r){"use strict";r.d(t,{Z:function(){return w}});var n=r(5987),o=r(7462),i=r(5035),a=r(7294),s=r(2585),u=r(6703),c=r(5330),l=r(3288),d=r(7969),h=r(395),f=r(6278);function p(e,t){return parseInt(e[t],10)||0}var v="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,m={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},b=a.forwardRef((function(e,t){var r=e.onChange,i=e.rows,s=e.rowsMax,u=e.rowsMin,c=e.maxRows,l=e.minRows,d=void 0===l?1:l,b=e.style,y=e.value,g=(0,n.Z)(e,["onChange","rows","rowsMax","rowsMin","maxRows","minRows","style","value"]),k=c||s,w=i||u||d,x=a.useRef(null!=y).current,E=a.useRef(null),_=(0,h.Z)(t,E),T=a.useRef(null),S=a.useRef(0),O=a.useState({}),C=O[0],R=O[1],Z=a.useCallback((function(){var t=E.current,r=window.getComputedStyle(t),n=T.current;n.style.width=r.width,n.value=t.value||e.placeholder||"x","\n"===n.value.slice(-1)&&(n.value+=" ");var o=r["box-sizing"],i=p(r,"padding-bottom")+p(r,"padding-top"),a=p(r,"border-bottom-width")+p(r,"border-top-width"),s=n.scrollHeight-i;n.value="x";var u=n.scrollHeight-i,c=s;w&&(c=Math.max(Number(w)*u,c)),k&&(c=Math.min(Number(k)*u,c));var l=(c=Math.max(c,u))+("border-box"===o?i+a:0),d=Math.abs(c-s)<=1;R((function(e){return S.current<20&&(l>0&&Math.abs((e.outerHeightStyle||0)-l)>1||e.overflow!==d)?(S.current+=1,{overflow:d,outerHeightStyle:l}):e}))}),[k,w,e.placeholder]);a.useEffect((function(){var e=(0,f.Z)((function(){S.current=0,Z()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[Z]),v((function(){Z()})),a.useEffect((function(){S.current=0}),[y]);return a.createElement(a.Fragment,null,a.createElement("textarea",(0,o.Z)({value:y,onChange:function(e){S.current=0,x||Z(),r&&r(e)},ref:_,rows:w,style:(0,o.Z)({height:C.outerHeightStyle,overflow:C.overflow?"hidden":null},b)},g)),a.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:T,tabIndex:-1,style:(0,o.Z)({},m,b)}))})),y=r(2512),g="undefined"==typeof window?a.useEffect:a.useLayoutEffect,k=a.forwardRef((function(e,t){var r=e["aria-describedby"],l=e.autoComplete,f=e.autoFocus,p=e.classes,v=e.className,m=(e.color,e.defaultValue),k=e.disabled,w=e.endAdornment,x=(e.error,e.fullWidth),E=void 0!==x&&x,_=e.id,T=e.inputComponent,S=void 0===T?"input":T,O=e.inputProps,C=void 0===O?{}:O,R=e.inputRef,Z=(e.margin,e.multiline),P=void 0!==Z&&Z,N=e.name,I=e.onBlur,A=e.onChange,j=e.onClick,D=e.onFocus,M=e.onKeyDown,U=e.onKeyUp,L=e.placeholder,B=e.readOnly,F=e.renderSuffix,H=e.rows,W=e.rowsMax,G=e.rowsMin,z=e.maxRows,$=e.minRows,q=e.startAdornment,K=e.type,J=void 0===K?"text":K,V=e.value,X=(0,n.Z)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","maxRows","minRows","startAdornment","type","value"]),Y=null!=C.value?C.value:V,Q=a.useRef(null!=Y).current,ee=a.useRef(),te=a.useCallback((function(e){0}),[]),re=(0,h.Z)(C.ref,te),ne=(0,h.Z)(R,re),oe=(0,h.Z)(ee,ne),ie=a.useState(!1),ae=ie[0],se=ie[1],ue=(0,c.Y)();var ce=(0,u.Z)({props:e,muiFormControl:ue,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});ce.focused=ue?ue.focused:ae,a.useEffect((function(){!ue&&k&&ae&&(se(!1),I&&I())}),[ue,k,ae,I]);var le=ue&&ue.onFilled,de=ue&&ue.onEmpty,he=a.useCallback((function(e){(0,y.vd)(e)?le&&le():de&&de()}),[le,de]);g((function(){Q&&he({value:Y})}),[Y,he,Q]);a.useEffect((function(){he(ee.current)}),[]);var fe=S,pe=(0,o.Z)({},C,{ref:oe});"string"!=typeof fe?pe=(0,o.Z)({inputRef:oe,type:J},pe,{ref:null}):P?!H||z||$||W||G?(pe=(0,o.Z)({minRows:H||$,rowsMax:W,maxRows:z},pe),fe=b):fe="textarea":pe=(0,o.Z)({type:J},pe);return a.useEffect((function(){ue&&ue.setAdornedStart(Boolean(q))}),[ue,q]),a.createElement("div",(0,o.Z)({className:(0,s.Z)(p.root,p["color".concat((0,d.Z)(ce.color||"primary"))],v,ce.disabled&&p.disabled,ce.error&&p.error,E&&p.fullWidth,ce.focused&&p.focused,ue&&p.formControl,P&&p.multiline,q&&p.adornedStart,w&&p.adornedEnd,"dense"===ce.margin&&p.marginDense),onClick:function(e){ee.current&&e.currentTarget===e.target&&ee.current.focus(),j&&j(e)},ref:t},X),q,a.createElement(c.Z.Provider,{value:null},a.createElement(fe,(0,o.Z)({"aria-invalid":ce.error,"aria-describedby":r,autoComplete:l,autoFocus:f,defaultValue:m,disabled:ce.disabled,id:_,onAnimationStart:function(e){he("mui-auto-fill-cancel"===e.animationName?ee.current:{value:"x"})},name:N,placeholder:L,readOnly:B,required:ce.required,rows:H,value:Y,onKeyDown:M,onKeyUp:U},pe,{className:(0,s.Z)(p.input,C.className,ce.disabled&&p.disabled,P&&p.inputMultiline,ce.hiddenLabel&&p.inputHiddenLabel,q&&p.inputAdornedStart,w&&p.inputAdornedEnd,"search"===J&&p.inputTypeSearch,"dense"===ce.margin&&p.inputMarginDense),onBlur:function(e){I&&I(e),C.onBlur&&C.onBlur(e),ue&&ue.onBlur?ue.onBlur(e):se(!1)},onChange:function(e){if(!Q){var t=e.target||ee.current;if(null==t)throw new Error((0,i.Z)(1));he({value:t.value})}for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];C.onChange&&C.onChange.apply(C,[e].concat(n)),A&&A.apply(void 0,[e].concat(n))},onFocus:function(e){ce.disabled?e.stopPropagation():(D&&D(e),C.onFocus&&C.onFocus(e),ue&&ue.onFocus?ue.onFocus(e):se(!0))}}))),w,F?F((0,o.Z)({},ce,{startAdornment:q})):null)})),w=(0,l.Z)((function(e){var t="light"===e.palette.type,r={color:"currentColor",opacity:t?.42:.5,transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},n={opacity:"0 !important"},i={opacity:t?.42:.5};return{"@global":{"@keyframes mui-auto-fill":{},"@keyframes mui-auto-fill-cancel":{}},root:(0,o.Z)({},e.typography.body1,{color:e.palette.text.primary,lineHeight:"1.1876em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center","&$disabled":{color:e.palette.text.disabled,cursor:"default"}}),formControl:{},focused:{},disabled:{},adornedStart:{},adornedEnd:{},error:{},marginDense:{},multiline:{padding:"".concat(6,"px 0 ").concat(7,"px"),"&$marginDense":{paddingTop:3}},colorSecondary:{},fullWidth:{width:"100%"},input:{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"".concat(6,"px 0 ").concat(7,"px"),border:0,boxSizing:"content-box",background:"none",height:"1.1876em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{"-webkit-appearance":"none"},"label[data-shrink=false] + $formControl &":{"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&:-ms-input-placeholder":n,"&::-ms-input-placeholder":n,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},"&$disabled":{opacity:1},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},inputMarginDense:{paddingTop:3},inputMultiline:{height:"auto",resize:"none",padding:0},inputTypeSearch:{"-moz-appearance":"textfield","-webkit-appearance":"textfield"},inputAdornedStart:{},inputAdornedEnd:{},inputHiddenLabel:{}}}),{name:"MuiInputBase"})(k)},2512:function(e,t,r){"use strict";function n(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(n(e.value)&&""!==e.value||t&&n(e.defaultValue)&&""!==e.defaultValue)}function i(e){return e.startAdornment}r.d(t,{vd:function(){return o},B7:function(){return i}})},4167:function(e,t,r){"use strict";var n=r(7462),o=r(5987),i=r(7294),a=r(2585),s=r(6703),u=r(4376),c=r(3288),l=r(6566),d=i.forwardRef((function(e,t){var r=e.classes,c=e.className,d=e.disableAnimation,h=void 0!==d&&d,f=(e.margin,e.shrink),p=(e.variant,(0,o.Z)(e,["classes","className","disableAnimation","margin","shrink","variant"])),v=(0,u.Z)(),m=f;void 0===m&&v&&(m=v.filled||v.focused||v.adornedStart);var b=(0,s.Z)({props:e,muiFormControl:v,states:["margin","variant"]});return i.createElement(l.Z,(0,n.Z)({"data-shrink":m,className:(0,a.Z)(r.root,c,v&&r.formControl,!h&&r.animated,m&&r.shrink,"dense"===b.margin&&r.marginDense,{filled:r.filled,outlined:r.outlined}[b.variant]),classes:{focused:r.focused,disabled:r.disabled,error:r.error,required:r.required,asterisk:r.asterisk},ref:t},p))}));t.Z=(0,c.Z)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(d)},866:function(e,t,r){"use strict";var n=r(7462),o=r(5987),i=r(7294),a=r(2585),s=r(3288),u=r(4299),c=i.forwardRef((function(e,t){var r=e.children,s=e.classes,c=e.className,l=e.component,d=void 0===l?"ul":l,h=e.dense,f=void 0!==h&&h,p=e.disablePadding,v=void 0!==p&&p,m=e.subheader,b=(0,o.Z)(e,["children","classes","className","component","dense","disablePadding","subheader"]),y=i.useMemo((function(){return{dense:f}}),[f]);return i.createElement(u.Z.Provider,{value:y},i.createElement(d,(0,n.Z)({className:(0,a.Z)(s.root,c,f&&s.dense,!v&&s.padding,m&&s.subheader),ref:t},b),m,r))}));t.Z=(0,s.Z)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(c)},4299:function(e,t,r){"use strict";var n=r(7294).createContext({});t.Z=n},4654:function(e,t,r){"use strict";r.d(t,{Z:function(){return D}});var n=r(7462),o=r(5987),i=r(7294),a=(r(3669),r(2585)),s=r(3288),u=r(3935),c=r(6278),l=r(3226),d=r(5165),h=r(9349),f=r(8439),p=r(8025),v=r(9186);function m(e,t){var r=0;return"number"==typeof t?r=t:"center"===t?r=e.height/2:"bottom"===t&&(r=e.height),r}function b(e,t){var r=0;return"number"==typeof t?r=t:"center"===t?r=e.width/2:"right"===t&&(r=e.width),r}function y(e){return[e.horizontal,e.vertical].map((function(e){return"number"==typeof e?"".concat(e,"px"):e})).join(" ")}function g(e){return"function"==typeof e?e():e}var k=i.forwardRef((function(e,t){var r=e.action,s=e.anchorEl,k=e.anchorOrigin,w=void 0===k?{vertical:"top",horizontal:"left"}:k,x=e.anchorPosition,E=e.anchorReference,_=void 0===E?"anchorEl":E,T=e.children,S=e.classes,O=e.className,C=e.container,R=e.elevation,Z=void 0===R?8:R,P=e.getContentAnchorEl,N=e.marginThreshold,I=void 0===N?16:N,A=e.onEnter,j=e.onEntered,D=e.onEntering,M=e.onExit,U=e.onExited,L=e.onExiting,B=e.open,F=e.PaperProps,H=void 0===F?{}:F,W=e.transformOrigin,G=void 0===W?{vertical:"top",horizontal:"left"}:W,z=e.TransitionComponent,$=void 0===z?p.Z:z,q=e.transitionDuration,K=void 0===q?"auto":q,J=e.TransitionProps,V=void 0===J?{}:J,X=(0,o.Z)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),Y=i.useRef(),Q=i.useCallback((function(e){if("anchorPosition"===_)return x;var t=g(s),r=(t&&1===t.nodeType?t:(0,l.Z)(Y.current).body).getBoundingClientRect(),n=0===e?w.vertical:"center";return{top:r.top+m(r,n),left:r.left+b(r,w.horizontal)}}),[s,w.horizontal,w.vertical,x,_]),ee=i.useCallback((function(e){var t=0;if(P&&"anchorEl"===_){var r=P(e);if(r&&e.contains(r)){var n=function(e,t){for(var r=t,n=0;r&&r!==e;)n+=(r=r.parentElement).scrollTop;return n}(e,r);t=r.offsetTop+r.clientHeight/2-n||0}0}return t}),[w.vertical,_,P]),te=i.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:m(e,G.vertical)+t,horizontal:b(e,G.horizontal)}}),[G.horizontal,G.vertical]),re=i.useCallback((function(e){var t=ee(e),r={width:e.offsetWidth,height:e.offsetHeight},n=te(r,t);if("none"===_)return{top:null,left:null,transformOrigin:y(n)};var o=Q(t),i=o.top-n.vertical,a=o.left-n.horizontal,u=i+r.height,c=a+r.width,l=(0,d.Z)(g(s)),h=l.innerHeight-I,f=l.innerWidth-I;if(i<I){var p=i-I;i-=p,n.vertical+=p}else if(u>h){var v=u-h;i-=v,n.vertical+=v}if(a<I){var m=a-I;a-=m,n.horizontal+=m}else if(c>f){var b=c-f;a-=b,n.horizontal+=b}return{top:"".concat(Math.round(i),"px"),left:"".concat(Math.round(a),"px"),transformOrigin:y(n)}}),[s,_,Q,ee,te,I]),ne=i.useCallback((function(){var e=Y.current;if(e){var t=re(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[re]),oe=i.useCallback((function(e){Y.current=u.findDOMNode(e)}),[]);i.useEffect((function(){B&&ne()})),i.useImperativeHandle(r,(function(){return B?{updatePosition:function(){ne()}}:null}),[B,ne]),i.useEffect((function(){if(B){var e=(0,c.Z)((function(){ne()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[B,ne]);var ie=K;"auto"!==K||$.muiSupportAuto||(ie=void 0);var ae=C||(s?(0,l.Z)(g(s)).body:void 0);return i.createElement(f.Z,(0,n.Z)({container:ae,open:B,ref:t,BackdropProps:{invisible:!0},className:(0,a.Z)(S.root,O)},X),i.createElement($,(0,n.Z)({appear:!0,in:B,onEnter:A,onEntered:j,onExit:M,onExited:U,onExiting:L,timeout:ie},V,{onEntering:(0,h.Z)((function(e,t){D&&D(e,t),ne()}),V.onEntering)}),i.createElement(v.Z,(0,n.Z)({elevation:Z,ref:oe},H,{className:(0,a.Z)(S.paper,H.className)}),T)))})),w=(0,s.Z)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(k),x=r(866),E=r(579),_=r(395);function T(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function S(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function O(e,t){if(void 0===t)return!0;var r=e.innerText;return void 0===r&&(r=e.textContent),0!==(r=r.trim().toLowerCase()).length&&(t.repeating?r[0]===t.keys[0]:0===r.indexOf(t.keys.join("")))}function C(e,t,r,n,o,i){for(var a=!1,s=o(e,t,!!t&&r);s;){if(s===e.firstChild){if(a)return;a=!0}var u=!n&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&O(s,i)&&!u)return void s.focus();s=o(e,s,r)}}var R="undefined"==typeof window?i.useEffect:i.useLayoutEffect,Z=i.forwardRef((function(e,t){var r=e.actions,a=e.autoFocus,s=void 0!==a&&a,c=e.autoFocusItem,d=void 0!==c&&c,h=e.children,f=e.className,p=e.disabledItemsFocusable,v=void 0!==p&&p,m=e.disableListWrap,b=void 0!==m&&m,y=e.onKeyDown,g=e.variant,k=void 0===g?"selectedMenu":g,w=(0,o.Z)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),Z=i.useRef(null),P=i.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});R((function(){s&&Z.current.focus()}),[s]),i.useImperativeHandle(r,(function(){return{adjustStyleForScrollbar:function(e,t){var r=!Z.current.style.width;if(e.clientHeight<Z.current.clientHeight&&r){var n="".concat((0,E.Z)(!0),"px");Z.current.style["rtl"===t.direction?"paddingLeft":"paddingRight"]=n,Z.current.style.width="calc(100% + ".concat(n,")")}return Z.current}}}),[]);var N=i.useCallback((function(e){Z.current=u.findDOMNode(e)}),[]),I=(0,_.Z)(N,t),A=-1;i.Children.forEach(h,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("selectedMenu"===k&&e.props.selected||-1===A)&&(A=t))}));var j=i.Children.map(h,(function(e,t){if(t===A){var r={};return d&&(r.autoFocus=!0),void 0===e.props.tabIndex&&"selectedMenu"===k&&(r.tabIndex=0),i.cloneElement(e,r)}return e}));return i.createElement(x.Z,(0,n.Z)({role:"menu",ref:I,className:f,onKeyDown:function(e){var t=Z.current,r=e.key,n=(0,l.Z)(t).activeElement;if("ArrowDown"===r)e.preventDefault(),C(t,n,b,v,T);else if("ArrowUp"===r)e.preventDefault(),C(t,n,b,v,S);else if("Home"===r)e.preventDefault(),C(t,null,b,v,T);else if("End"===r)e.preventDefault(),C(t,null,b,v,S);else if(1===r.length){var o=P.current,i=r.toLowerCase(),a=performance.now();o.keys.length>0&&(a-o.lastTime>500?(o.keys=[],o.repeating=!0,o.previousKeyMatched=!0):o.repeating&&i!==o.keys[0]&&(o.repeating=!1)),o.lastTime=a,o.keys.push(i);var s=n&&!o.repeating&&O(n,o);o.previousKeyMatched&&(s||C(t,n,!1,v,T,o))?e.preventDefault():o.previousKeyMatched=!1}y&&y(e)},tabIndex:s?0:-1},w),j)})),P=r(9113),N=r(802),I={vertical:"top",horizontal:"right"},A={vertical:"top",horizontal:"left"},j=i.forwardRef((function(e,t){var r=e.autoFocus,s=void 0===r||r,c=e.children,l=e.classes,d=e.disableAutoFocusItem,h=void 0!==d&&d,f=e.MenuListProps,p=void 0===f?{}:f,v=e.onClose,m=e.onEntering,b=e.open,y=e.PaperProps,g=void 0===y?{}:y,k=e.PopoverClasses,x=e.transitionDuration,E=void 0===x?"auto":x,_=e.TransitionProps,T=(_=void 0===_?{}:_).onEntering,S=(0,o.Z)(_,["onEntering"]),O=e.variant,C=void 0===O?"selectedMenu":O,R=(0,o.Z)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"]),j=(0,N.Z)(),D=s&&!h&&b,M=i.useRef(null),U=i.useRef(null),L=-1;i.Children.map(c,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("menu"!==C&&e.props.selected||-1===L)&&(L=t))}));var B=i.Children.map(c,(function(e,t){return t===L?i.cloneElement(e,{ref:function(t){U.current=u.findDOMNode(t),(0,P.Z)(e.ref,t)}}):e}));return i.createElement(w,(0,n.Z)({getContentAnchorEl:function(){return U.current},classes:k,onClose:v,TransitionProps:(0,n.Z)({onEntering:function(e,t){M.current&&M.current.adjustStyleForScrollbar(e,j),m&&m(e,t),T&&T(e,t)}},S),anchorOrigin:"rtl"===j.direction?I:A,transformOrigin:"rtl"===j.direction?I:A,PaperProps:(0,n.Z)({},g,{classes:(0,n.Z)({},g.classes,{root:l.paper})}),open:b,ref:t,transitionDuration:E},R),i.createElement(Z,(0,n.Z)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),v&&v(e,"tabKeyDown"))},actions:M,autoFocus:s&&(-1===L||h),autoFocusItem:D,variant:C},p,{className:(0,a.Z)(l.list,p.className)}),B))})),D=(0,s.Z)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(j)},8439:function(e,t,r){"use strict";r.d(t,{Z:function(){return Z}});var n=r(5987),o=r(7462),i=r(7294),a=r(3935),s=r(7391),u=r(7858),c=r(3226),l=r(2875),d=r(9349),h=r(395),f=r(6986),p=r(939),v=r(5671),m=r(3144),b=r(2982),y=r(579),g=r(5165);function k(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function w(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function x(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0,i=[t,r].concat((0,b.Z)(n)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===i.indexOf(e)&&-1===a.indexOf(e.tagName)&&k(e,o)}))}function E(e,t){var r=-1;return e.some((function(e,n){return!!t(e)&&(r=n,!0)})),r}function _(e,t){var r,n=[],o=[],i=e.container;if(!t.disableScrollLock){if(function(e){var t=(0,c.Z)(e);return t.body===e?(0,g.Z)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(i)){var a=(0,y.Z)();n.push({value:i.style.paddingRight,key:"padding-right",el:i}),i.style["padding-right"]="".concat(w(i)+a,"px"),r=(0,c.Z)(i).querySelectorAll(".mui-fixed"),[].forEach.call(r,(function(e){o.push(e.style.paddingRight),e.style.paddingRight="".concat(w(e)+a,"px")}))}var s=i.parentElement,u="HTML"===s.nodeName&&"scroll"===window.getComputedStyle(s)["overflow-y"]?s:i;n.push({value:u.style.overflow,key:"overflow",el:u}),u.style.overflow="hidden"}return function(){r&&[].forEach.call(r,(function(e,t){o[t]?e.style.paddingRight=o[t]:e.style.removeProperty("padding-right")})),n.forEach((function(e){var t=e.value,r=e.el,n=e.key;t?r.style.setProperty(n,t):r.style.removeProperty(n)}))}}var T=function(){function e(){(0,v.Z)(this,e),this.modals=[],this.containers=[]}return(0,m.Z)(e,[{key:"add",value:function(e,t){var r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&k(e.modalRef,!1);var n=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);x(t,e.mountNode,e.modalRef,n,!0);var o=E(this.containers,(function(e){return e.container===t}));return-1!==o?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:n}),r)}},{key:"mount",value:function(e,t){var r=E(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),n=this.containers[r];n.restore||(n.restore=_(n,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var r=E(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),n=this.containers[r];if(n.modals.splice(n.modals.indexOf(e),1),this.modals.splice(t,1),0===n.modals.length)n.restore&&n.restore(),e.modalRef&&k(e.modalRef,!0),x(n.container,e.mountNode,e.modalRef,n.hiddenSiblingNodes,!1),this.containers.splice(r,1);else{var o=n.modals[n.modals.length-1];o.modalRef&&k(o.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();var S=function(e){var t=e.children,r=e.disableAutoFocus,n=void 0!==r&&r,o=e.disableEnforceFocus,s=void 0!==o&&o,u=e.disableRestoreFocus,l=void 0!==u&&u,d=e.getDoc,f=e.isEnabled,p=e.open,v=i.useRef(),m=i.useRef(null),b=i.useRef(null),y=i.useRef(),g=i.useRef(null),k=i.useCallback((function(e){g.current=a.findDOMNode(e)}),[]),w=(0,h.Z)(t.ref,k),x=i.useRef();return i.useEffect((function(){x.current=p}),[p]),!x.current&&p&&"undefined"!=typeof window&&(y.current=d().activeElement),i.useEffect((function(){if(p){var e=(0,c.Z)(g.current);n||!g.current||g.current.contains(e.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex",-1),g.current.focus());var t=function(){null!==g.current&&(e.hasFocus()&&!s&&f()&&!v.current?g.current&&!g.current.contains(e.activeElement)&&g.current.focus():v.current=!1)},r=function(t){!s&&f()&&9===t.keyCode&&e.activeElement===g.current&&(v.current=!0,t.shiftKey?b.current.focus():m.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",r,!0);var o=setInterval((function(){t()}),50);return function(){clearInterval(o),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",r,!0),l||(y.current&&y.current.focus&&y.current.focus(),y.current=null)}}}),[n,s,l,f,p]),i.createElement(i.Fragment,null,i.createElement("div",{tabIndex:0,ref:m,"data-test":"sentinelStart"}),i.cloneElement(t,{ref:w}),i.createElement("div",{tabIndex:0,ref:b,"data-test":"sentinelEnd"}))},O={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},C=i.forwardRef((function(e,t){var r=e.invisible,a=void 0!==r&&r,s=e.open,u=(0,n.Z)(e,["invisible","open"]);return s?i.createElement("div",(0,o.Z)({"aria-hidden":!0,ref:t},u,{style:(0,o.Z)({},O.root,a?O.invisible:{},u.style)})):null}));var R=new T,Z=i.forwardRef((function(e,t){var r=(0,s.Z)(),v=(0,u.Z)({name:"MuiModal",props:(0,o.Z)({},e),theme:r}),m=v.BackdropComponent,b=void 0===m?C:m,y=v.BackdropProps,g=v.children,w=v.closeAfterTransition,x=void 0!==w&&w,E=v.container,_=v.disableAutoFocus,T=void 0!==_&&_,O=v.disableBackdropClick,Z=void 0!==O&&O,P=v.disableEnforceFocus,N=void 0!==P&&P,I=v.disableEscapeKeyDown,A=void 0!==I&&I,j=v.disablePortal,D=void 0!==j&&j,M=v.disableRestoreFocus,U=void 0!==M&&M,L=v.disableScrollLock,B=void 0!==L&&L,F=v.hideBackdrop,H=void 0!==F&&F,W=v.keepMounted,G=void 0!==W&&W,z=v.manager,$=void 0===z?R:z,q=v.onBackdropClick,K=v.onClose,J=v.onEscapeKeyDown,V=v.onRendered,X=v.open,Y=(0,n.Z)(v,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),Q=i.useState(!0),ee=Q[0],te=Q[1],re=i.useRef({}),ne=i.useRef(null),oe=i.useRef(null),ie=(0,h.Z)(oe,t),ae=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(v),se=function(){return(0,c.Z)(ne.current)},ue=function(){return re.current.modalRef=oe.current,re.current.mountNode=ne.current,re.current},ce=function(){$.mount(ue(),{disableScrollLock:B}),oe.current.scrollTop=0},le=(0,f.Z)((function(){var e=function(e){return e="function"==typeof e?e():e,a.findDOMNode(e)}(E)||se().body;$.add(ue(),e),oe.current&&ce()})),de=i.useCallback((function(){return $.isTopModal(ue())}),[$]),he=(0,f.Z)((function(e){ne.current=e,e&&(V&&V(),X&&de()?ce():k(oe.current,!0))})),fe=i.useCallback((function(){$.remove(ue())}),[$]);if(i.useEffect((function(){return function(){fe()}}),[fe]),i.useEffect((function(){X?le():ae&&x||fe()}),[X,fe,ae,x,le]),!G&&!X&&(!ae||ee))return null;var pe=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(r||{zIndex:p.Z}),ve={};return void 0===g.props.tabIndex&&(ve.tabIndex=g.props.tabIndex||"-1"),ae&&(ve.onEnter=(0,d.Z)((function(){te(!1)}),g.props.onEnter),ve.onExited=(0,d.Z)((function(){te(!0),x&&fe()}),g.props.onExited)),i.createElement(l.Z,{ref:he,container:E,disablePortal:D},i.createElement("div",(0,o.Z)({ref:ie,onKeyDown:function(e){"Escape"===e.key&&de()&&(J&&J(e),A||(e.stopPropagation(),K&&K(e,"escapeKeyDown")))},role:"presentation"},Y,{style:(0,o.Z)({},pe.root,!X&&ee?pe.hidden:{},Y.style)}),H?null:i.createElement(b,(0,o.Z)({open:X,onClick:function(e){e.target===e.currentTarget&&(q&&q(e),!Z&&K&&K(e,"backdropClick"))}},y)),i.createElement(S,{disableEnforceFocus:N,disableAutoFocus:T,disableRestoreFocus:U,getDoc:se,isEnabled:de,open:X},i.cloneElement(g,ve))))}))},9186:function(e,t,r){"use strict";var n=r(5987),o=r(7462),i=r(7294),a=r(2585),s=r(3288),u=i.forwardRef((function(e,t){var r=e.classes,s=e.className,u=e.component,c=void 0===u?"div":u,l=e.square,d=void 0!==l&&l,h=e.elevation,f=void 0===h?1:h,p=e.variant,v=void 0===p?"elevation":p,m=(0,n.Z)(e,["classes","className","component","square","elevation","variant"]);return i.createElement(c,(0,o.Z)({className:(0,a.Z)(r.root,s,"outlined"===v?r.outlined:r["elevation".concat(f)],!d&&r.rounded),ref:t},m))}));t.Z=(0,s.Z)((function(e){var t={};return e.shadows.forEach((function(e,r){t["elevation".concat(r)]={boxShadow:e}})),(0,o.Z)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(u)},2875:function(e,t,r){"use strict";var n=r(7294),o=r(3935),i=r(9113),a=r(395);var s="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,u=n.forwardRef((function(e,t){var r=e.children,u=e.container,c=e.disablePortal,l=void 0!==c&&c,d=e.onRendered,h=n.useState(null),f=h[0],p=h[1],v=(0,a.Z)(n.isValidElement(r)?r.ref:null,t);return s((function(){l||p(function(e){return e="function"==typeof e?e():e,o.findDOMNode(e)}(u)||document.body)}),[u,l]),s((function(){if(f&&!l)return(0,i.Z)(t,f),function(){(0,i.Z)(t,null)}}),[t,f,l]),s((function(){d&&(f||l)&&d()}),[d,f,l]),l?n.isValidElement(r)?n.cloneElement(r,{ref:v}):r:f?o.createPortal(r,f):f}));t.Z=u},2662:function(e,t,r){"use strict";r.d(t,{Z:function(){return X}});var n=r(7462),o=r(5987),i=r(7294),a=r(2585),s=r(9509),u=r(2785),c=r(3288),l=i.forwardRef((function(e,t){var r=e.disableUnderline,s=e.classes,c=e.fullWidth,l=void 0!==c&&c,d=e.inputComponent,h=void 0===d?"input":d,f=e.multiline,p=void 0!==f&&f,v=e.type,m=void 0===v?"text":v,b=(0,o.Z)(e,["disableUnderline","classes","fullWidth","inputComponent","multiline","type"]);return i.createElement(u.Z,(0,n.Z)({classes:(0,n.Z)({},s,{root:(0,a.Z)(s.root,!r&&s.underline),underline:null}),fullWidth:l,inputComponent:h,multiline:p,ref:t,type:m},b))}));l.muiName="Input";var d=(0,c.Z)((function(e){var t="light"===e.palette.type,r=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",n=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)";return{root:{position:"relative",backgroundColor:n,borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:t?"rgba(0, 0, 0, 0.13)":"rgba(255, 255, 255, 0.13)","@media (hover: none)":{backgroundColor:n}},"&$focused":{backgroundColor:t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.09)"},"&$disabled":{backgroundColor:t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)"}},colorSecondary:{"&$underline:after":{borderBottomColor:e.palette.secondary.main}},underline:{"&:after":{borderBottom:"2px solid ".concat(e.palette.primary.main),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"},"&$focused:after":{transform:"scaleX(1)"},"&$error:after":{borderBottomColor:e.palette.error.main,transform:"scaleX(1)"},"&:before":{borderBottom:"1px solid ".concat(r),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:before":{borderBottom:"1px solid ".concat(e.palette.text.primary)},"&$disabled:before":{borderBottomStyle:"dotted"}},focused:{},disabled:{},adornedStart:{paddingLeft:12},adornedEnd:{paddingRight:12},error:{},marginDense:{},multiline:{padding:"27px 12px 10px","&$marginDense":{paddingTop:23,paddingBottom:6}},input:{padding:"27px 12px 10px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},inputMarginDense:{paddingTop:23,paddingBottom:6},inputHiddenLabel:{paddingTop:18,paddingBottom:19,"&$inputMarginDense":{paddingTop:10,paddingBottom:11}},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiFilledInput"})(l),h=r(4942),f=r(802),p=r(7969),v=i.forwardRef((function(e,t){e.children;var r=e.classes,s=e.className,u=e.label,c=e.labelWidth,l=e.notched,d=e.style,v=(0,o.Z)(e,["children","classes","className","label","labelWidth","notched","style"]),m="rtl"===(0,f.Z)().direction?"right":"left";if(void 0!==u)return i.createElement("fieldset",(0,n.Z)({"aria-hidden":!0,className:(0,a.Z)(r.root,s),ref:t,style:d},v),i.createElement("legend",{className:(0,a.Z)(r.legendLabelled,l&&r.legendNotched)},u?i.createElement("span",null,u):i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})));var b=c>0?.75*c+8:.01;return i.createElement("fieldset",(0,n.Z)({"aria-hidden":!0,style:(0,n.Z)((0,h.Z)({},"padding".concat((0,p.Z)(m)),8),d),className:(0,a.Z)(r.root,s),ref:t},v),i.createElement("legend",{className:r.legend,style:{width:l?b:.01}},i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}})))})),m=(0,c.Z)((function(e){return{root:{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"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(v),b=i.forwardRef((function(e,t){var r=e.classes,s=e.fullWidth,c=void 0!==s&&s,l=e.inputComponent,d=void 0===l?"input":l,h=e.label,f=e.labelWidth,p=void 0===f?0:f,v=e.multiline,b=void 0!==v&&v,y=e.notched,g=e.type,k=void 0===g?"text":g,w=(0,o.Z)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return i.createElement(u.Z,(0,n.Z)({renderSuffix:function(e){return i.createElement(m,{className:r.notchedOutline,label:h,labelWidth:p,notched:void 0!==y?y:Boolean(e.startAdornment||e.filled||e.focused)})},classes:(0,n.Z)({},r,{root:(0,a.Z)(r.root,r.underline),notchedOutline:null}),fullWidth:c,inputComponent:d,multiline:b,ref:t,type:k},w))}));b.muiName="Input";var y=(0,c.Z)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(b),g=r(4167),k=r(2512),w=r(9963),x=r(5330),E=i.forwardRef((function(e,t){var r=e.children,s=e.classes,u=e.className,c=e.color,l=void 0===c?"primary":c,d=e.component,h=void 0===d?"div":d,f=e.disabled,v=void 0!==f&&f,m=e.error,b=void 0!==m&&m,y=e.fullWidth,g=void 0!==y&&y,E=e.focused,_=e.hiddenLabel,T=void 0!==_&&_,S=e.margin,O=void 0===S?"none":S,C=e.required,R=void 0!==C&&C,Z=e.size,P=e.variant,N=void 0===P?"standard":P,I=(0,o.Z)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),A=i.useState((function(){var e=!1;return r&&i.Children.forEach(r,(function(t){if((0,w.Z)(t,["Input","Select"])){var r=(0,w.Z)(t,["Select"])?t.props.input:t;r&&(0,k.B7)(r.props)&&(e=!0)}})),e})),j=A[0],D=A[1],M=i.useState((function(){var e=!1;return r&&i.Children.forEach(r,(function(t){(0,w.Z)(t,["Input","Select"])&&(0,k.vd)(t.props,!0)&&(e=!0)})),e})),U=M[0],L=M[1],B=i.useState(!1),F=B[0],H=B[1],W=void 0!==E?E:F;v&&W&&H(!1);var G=i.useCallback((function(){L(!0)}),[]),z={adornedStart:j,setAdornedStart:D,color:l,disabled:v,error:b,filled:U,focused:W,fullWidth:g,hiddenLabel:T,margin:("small"===Z?"dense":void 0)||O,onBlur:function(){H(!1)},onEmpty:i.useCallback((function(){L(!1)}),[]),onFilled:G,onFocus:function(){H(!0)},registerEffect:undefined,required:R,variant:N};return i.createElement(x.Z.Provider,{value:z},i.createElement(h,(0,n.Z)({className:(0,a.Z)(s.root,u,"none"!==O&&s["margin".concat((0,p.Z)(O))],g&&s.fullWidth),ref:t},I),r))})),_=(0,c.Z)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(E),T=r(6703),S=r(4376),O=i.forwardRef((function(e,t){var r=e.children,s=e.classes,u=e.className,c=e.component,l=void 0===c?"p":c,d=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,(0,o.Z)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),h=(0,S.Z)(),f=(0,T.Z)({props:e,muiFormControl:h,states:["variant","margin","disabled","error","filled","focused","required"]});return i.createElement(l,(0,n.Z)({className:(0,a.Z)(s.root,("filled"===f.variant||"outlined"===f.variant)&&s.contained,u,f.disabled&&s.disabled,f.error&&s.error,f.filled&&s.filled,f.focused&&s.focused,f.required&&s.required,"dense"===f.margin&&s.marginDense),ref:t},d)," "===r?i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):r)})),C=(0,c.Z)((function(e){return{root:(0,n.Z)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(O),R=r(540),Z=r(885),P=r(1002),N=r(5035),I=(r(3669),r(3226)),A=r(4654),j=r(395),D=r(2760);function M(e,t){return"object"===(0,P.Z)(t)&&null!==t?e===t:String(e)===String(t)}var U=i.forwardRef((function(e,t){var r=e["aria-label"],s=e.autoFocus,u=e.autoWidth,c=e.children,l=e.classes,d=e.className,h=e.defaultValue,f=e.disabled,v=e.displayEmpty,m=e.IconComponent,b=e.inputRef,y=e.labelId,g=e.MenuProps,w=void 0===g?{}:g,x=e.multiple,E=e.name,_=e.onBlur,T=e.onChange,S=e.onClose,O=e.onFocus,C=e.onOpen,R=e.open,P=e.readOnly,U=e.renderValue,L=e.SelectDisplayProps,B=void 0===L?{}:L,F=e.tabIndex,H=(e.type,e.value),W=e.variant,G=void 0===W?"standard":W,z=(0,o.Z)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),$=(0,D.Z)({controlled:H,default:h,name:"Select"}),q=(0,Z.Z)($,2),K=q[0],J=q[1],V=i.useRef(null),X=i.useState(null),Y=X[0],Q=X[1],ee=i.useRef(null!=R).current,te=i.useState(),re=te[0],ne=te[1],oe=i.useState(!1),ie=oe[0],ae=oe[1],se=(0,j.Z)(t,b);i.useImperativeHandle(se,(function(){return{focus:function(){Y.focus()},node:V.current,value:K}}),[Y,K]),i.useEffect((function(){s&&Y&&Y.focus()}),[s,Y]),i.useEffect((function(){if(Y){var e=(0,I.Z)(Y).getElementById(y);if(e){var t=function(){getSelection().isCollapsed&&Y.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}}),[y,Y]);var ue,ce,le=function(e,t){e?C&&C(t):S&&S(t),ee||(ne(u?null:Y.clientWidth),ae(e))},de=i.Children.toArray(c),he=function(e){return function(t){var r;if(x||le(!1,t),x){r=Array.isArray(K)?K.slice():[];var n=K.indexOf(e.props.value);-1===n?r.push(e.props.value):r.splice(n,1)}else r=e.props.value;e.props.onClick&&e.props.onClick(t),K!==r&&(J(r),T&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:r,name:E}}),T(t,e)))}},fe=null!==Y&&(ee?R:ie);delete z["aria-invalid"];var pe=[],ve=!1;((0,k.vd)({value:K})||v)&&(U?ue=U(K):ve=!0);var me=de.map((function(e){if(!i.isValidElement(e))return null;var t;if(x){if(!Array.isArray(K))throw new Error((0,N.Z)(2));(t=K.some((function(t){return M(t,e.props.value)})))&&ve&&pe.push(e.props.children)}else(t=M(K,e.props.value))&&ve&&(ce=e.props.children);return t&&!0,i.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:he(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));ve&&(ue=x?pe.join(", "):ce);var be,ye=re;!u&&ee&&Y&&(ye=Y.clientWidth),be=void 0!==F?F:f?null:0;var ge=B.id||(E?"mui-component-select-".concat(E):void 0);return i.createElement(i.Fragment,null,i.createElement("div",(0,n.Z)({className:(0,a.Z)(l.root,l.select,l.selectMenu,l[G],d,f&&l.disabled),ref:Q,tabIndex:be,role:"button","aria-disabled":f?"true":void 0,"aria-expanded":fe?"true":void 0,"aria-haspopup":"listbox","aria-label":r,"aria-labelledby":[y,ge].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!P){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),le(!0,e))}},onMouseDown:f||P?null:function(e){0===e.button&&(e.preventDefault(),Y.focus(),le(!0,e))},onBlur:function(e){!fe&&_&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:K,name:E}}),_(e))},onFocus:O},B,{id:ge}),function(e){return null==e||"string"==typeof e&&!e.trim()}(ue)?i.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):ue),i.createElement("input",(0,n.Z)({value:Array.isArray(K)?K.join(","):K,name:E,ref:V,"aria-hidden":!0,onChange:function(e){var t=de.map((function(e){return e.props.value})).indexOf(e.target.value);if(-1!==t){var r=de[t];J(r.props.value),T&&T(e,r)}},tabIndex:-1,className:l.nativeInput,autoFocus:s},z)),i.createElement(m,{className:(0,a.Z)(l.icon,l["icon".concat((0,p.Z)(G))],fe&&l.iconOpen,f&&l.disabled)}),i.createElement(A.Z,(0,n.Z)({id:"menu-".concat(E||""),anchorEl:Y,open:fe,onClose:function(e){le(!1,e)}},w,{MenuListProps:(0,n.Z)({"aria-labelledby":y,role:"listbox",disableListWrap:!0},w.MenuListProps),PaperProps:(0,n.Z)({},w.PaperProps,{style:(0,n.Z)({minWidth:ye},null!=w.PaperProps?w.PaperProps.style:null)})}),me))})),L=(0,r(8230).Z)(i.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),B=i.forwardRef((function(e,t){var r=e.classes,s=e.className,u=e.disabled,c=e.IconComponent,l=e.inputRef,d=e.variant,h=void 0===d?"standard":d,f=(0,o.Z)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return i.createElement(i.Fragment,null,i.createElement("select",(0,n.Z)({className:(0,a.Z)(r.root,r.select,r[h],s,u&&r.disabled),disabled:u,ref:l||t},f)),e.multiple?null:i.createElement(c,{className:(0,a.Z)(r.icon,r["icon".concat((0,p.Z)(h))],u&&r.disabled)}))})),F=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}},H=i.createElement(s.Z,null),W=i.forwardRef((function(e,t){var r=e.children,a=e.classes,s=e.IconComponent,u=void 0===s?L:s,c=e.input,l=void 0===c?H:c,d=e.inputProps,h=(e.variant,(0,o.Z)(e,["children","classes","IconComponent","input","inputProps","variant"])),f=(0,S.Z)(),p=(0,T.Z)({props:e,muiFormControl:f,states:["variant"]});return i.cloneElement(l,(0,n.Z)({inputComponent:B,inputProps:(0,n.Z)({children:r,classes:a,IconComponent:u,variant:p.variant,type:void 0},d,l?l.props.inputProps:{}),ref:t},h))}));W.muiName="Select";(0,c.Z)(F,{name:"MuiNativeSelect"})(W);var G=F,z=i.createElement(s.Z,null),$=i.createElement(d,null),q=i.forwardRef((function e(t,r){var a=t.autoWidth,s=void 0!==a&&a,u=t.children,c=t.classes,l=t.displayEmpty,d=void 0!==l&&l,h=t.IconComponent,f=void 0===h?L:h,p=t.id,v=t.input,m=t.inputProps,b=t.label,g=t.labelId,k=t.labelWidth,w=void 0===k?0:k,x=t.MenuProps,E=t.multiple,_=void 0!==E&&E,O=t.native,C=void 0!==O&&O,Z=t.onClose,P=t.onOpen,N=t.open,I=t.renderValue,A=t.SelectDisplayProps,j=t.variant,D=void 0===j?"standard":j,M=(0,o.Z)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),F=C?B:U,H=(0,S.Z)(),W=(0,T.Z)({props:t,muiFormControl:H,states:["variant"]}).variant||D,G=v||{standard:z,outlined:i.createElement(y,{label:b,labelWidth:w}),filled:$}[W];return i.cloneElement(G,(0,n.Z)({inputComponent:F,inputProps:(0,n.Z)({children:u,IconComponent:f,variant:W,type:void 0,multiple:_},C?{id:p}:{autoWidth:s,displayEmpty:d,labelId:g,MenuProps:x,onClose:Z,onOpen:P,open:N,renderValue:I,SelectDisplayProps:(0,n.Z)({id:p},A)},m,{classes:m?(0,R.Z)({baseClasses:c,newClasses:m.classes,Component:e}):c},v?v.props.inputProps:{}),ref:r},M))}));q.muiName="Select";var K=(0,c.Z)(G,{name:"MuiSelect"})(q),J={standard:s.Z,filled:d,outlined:y},V=i.forwardRef((function(e,t){var r=e.autoComplete,s=e.autoFocus,u=void 0!==s&&s,c=e.children,l=e.classes,d=e.className,h=e.color,f=void 0===h?"primary":h,p=e.defaultValue,v=e.disabled,m=void 0!==v&&v,b=e.error,y=void 0!==b&&b,k=e.FormHelperTextProps,w=e.fullWidth,x=void 0!==w&&w,E=e.helperText,T=e.hiddenLabel,S=e.id,O=e.InputLabelProps,R=e.inputProps,Z=e.InputProps,P=e.inputRef,N=e.label,I=e.multiline,A=void 0!==I&&I,j=e.name,D=e.onBlur,M=e.onChange,U=e.onFocus,L=e.placeholder,B=e.required,F=void 0!==B&&B,H=e.rows,W=e.rowsMax,G=e.maxRows,z=e.minRows,$=e.select,q=void 0!==$&&$,V=e.SelectProps,X=e.type,Y=e.value,Q=e.variant,ee=void 0===Q?"standard":Q,te=(0,o.Z)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","maxRows","minRows","select","SelectProps","type","value","variant"]);var re={};if("outlined"===ee&&(O&&void 0!==O.shrink&&(re.notched=O.shrink),N)){var ne,oe=null!==(ne=null==O?void 0:O.required)&&void 0!==ne?ne:F;re.label=i.createElement(i.Fragment,null,N,oe&&" *")}q&&(V&&V.native||(re.id=void 0),re["aria-describedby"]=void 0);var ie=E&&S?"".concat(S,"-helper-text"):void 0,ae=N&&S?"".concat(S,"-label"):void 0,se=J[ee],ue=i.createElement(se,(0,n.Z)({"aria-describedby":ie,autoComplete:r,autoFocus:u,defaultValue:p,fullWidth:x,multiline:A,name:j,rows:H,rowsMax:W,maxRows:G,minRows:z,type:X,value:Y,id:S,inputRef:P,onBlur:D,onChange:M,onFocus:U,placeholder:L,inputProps:R},re,Z));return i.createElement(_,(0,n.Z)({className:(0,a.Z)(l.root,d),disabled:m,error:y,fullWidth:x,hiddenLabel:T,ref:t,required:F,color:f,variant:ee},te),N&&i.createElement(g.Z,(0,n.Z)({htmlFor:S,id:ae},O),N),q?i.createElement(K,(0,n.Z)({"aria-describedby":ie,id:S,labelId:ae,value:Y,input:ue},V),c):ue,E&&i.createElement(C,(0,n.Z)({id:ie},k),E))})),X=(0,c.Z)({root:{}},{name:"MuiTextField"})(V)},802:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(7391),o=(r(7294),r(862));function i(){return(0,n.Z)()||o.Z}},3633:function(e,t,r){"use strict";r.d(t,{n:function(){return n},C:function(){return o}});var n=function(e){return e.scrollTop};function o(e,t){var r=e.timeout,n=e.style,o=void 0===n?{}:n;return{duration:o.transitionDuration||"number"==typeof r?r:r[t.mode]||0,delay:o.transitionDelay}}},579:function(e,t,r){"use strict";function n(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}r.d(t,{Z:function(){return n}})},4973:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function v(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}h.prototype.append=function(e,t){e=c(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[c(e)]},h.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},h.prototype.set=function(e,t){this.map[c(e)]=l(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(e,t){var r,n,o=(t=t||{}).body;if(e instanceof g){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),y.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function k(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function w(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},b.call(g.prototype),b.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];w.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(_){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,r){return new Promise((function(n,i){var a=new g(e,r);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();t.append(n,o)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;n(new w(o,r))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=h,e.Request=g,e.Response=w),t.Headers=h,t.Request=g,t.Response=w,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t},5413:function(e,t,r){r(5743);var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},6283:function(e,t){"use strict";var r=60103,n=60106,o=60107,i=60108,a=60114,s=60109,u=60110,c=60112,l=60113,d=60120,h=60115,f=60116,p=60121,v=60122,m=60117,b=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var g=Symbol.for;r=g("react.element"),n=g("react.portal"),o=g("react.fragment"),i=g("react.strict_mode"),a=g("react.profiler"),s=g("react.provider"),u=g("react.context"),c=g("react.forward_ref"),l=g("react.suspense"),d=g("react.suspense_list"),h=g("react.memo"),f=g("react.lazy"),p=g("react.block"),v=g("react.server.block"),m=g("react.fundamental"),b=g("react.debug_trace_mode"),y=g("react.legacy_hidden")}function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case a:case i:case l:case d:return e;default:switch(e=e&&e.$$typeof){case u:case c:case f:case h:case s:return e;default:return t}}case n:return t}}}},3669:function(e,t,r){"use strict";r(6283)},628:function(e,t,r){"use strict";r.d(t,{ZP:function(){return m}});var n=r(3366),o=r(4578),i=r(7294),a=r(3935),s=!1,u=r(254),c="unmounted",l="exited",d="entering",h="entered",f="exiting",p=function(e){function t(t,r){var n;n=e.call(this,t,r)||this;var o,i=r&&!r.isMounting?t.enter:t.appear;return n.appearStatus=null,t.in?i?(o=l,n.appearStatus=d):o=h:o=t.unmountOnExit||t.mountOnEnter?c:l,n.state={status:o},n.nextCallback=null,n}(0,o.Z)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===c?{status:l}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==d&&r!==h&&(t=d):r!==d&&r!==h||(t=f)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),t===d?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&this.state.status===l&&this.setState({status:c})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,o=this.props.nodeRef?[n]:[a.findDOMNode(this),n],i=o[0],u=o[1],c=this.getTimeouts(),l=n?c.appear:c.enter;!e&&!r||s?this.safeSetState({status:h},(function(){t.props.onEntered(i)})):(this.props.onEnter(i,u),this.safeSetState({status:d},(function(){t.props.onEntering(i,u),t.onTransitionEnd(l,(function(){t.safeSetState({status:h},(function(){t.props.onEntered(i,u)}))}))})))},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:a.findDOMNode(this);t&&!s?(this.props.onExit(n),this.safeSetState({status:f},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:l},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:l},(function(){e.props.onExited(n)}))},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:a.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],i=o[0],s=o[1];this.props.addEndListener(i,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},r.render=function(){var e=this.state.status;if(e===c)return null;var t=this.props,r=t.children,o=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,(0,n.Z)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(u.Z.Provider,{value:null},"function"==typeof r?r(e,o):i.cloneElement(i.Children.only(r),o))},t}(i.Component);function v(){}p.contextType=u.Z,p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:v,onEntering:v,onEntered:v,onExit:v,onExiting:v,onExited:v},p.UNMOUNTED=c,p.EXITED=l,p.ENTERING=d,p.ENTERED=h,p.EXITING=f;var m=p},8818:function(e,t,r){"use strict";r.d(t,{Ed:function(){return i},UI:function(){return a},VS:function(){return s},tj:function(){return u},pC:function(){return c}});var n=r(9090),o=r(7842);function i(e,t){return function(e,t){if(void 0!==e)return t(o.xt(e))}(e,n.Dm(t))}function a(e,t){return function(e,t){if(void 0!==e)return o.G(t(o.xt(e)))}(e,n.Dm(t))}function s(e,t){return function(e,t){if(void 0!==e)return t(o.xt(e))}(e,n.Dm(t))}function u(e,t){return void 0!==e?o.xt(e):t}function c(e){return void 0!==e}},6406:function(e,t,r){"use strict";function n(e,t,r){for(var n=new Array(r),o=0,i=t;o<r;)n[o]=e[i],o=o+1|0,i=i+1|0;return n}function o(e,t){if(t<0||t>=e.length)throw{RE_EXN_ID:"Invalid_argument",_1:"index out of bounds",Error:new Error};return e[t]}r.d(t,{lu:function(){return n},U2:function(){return o}})},1805:function(e,t,r){"use strict";r.d(t,{Ue:function(){return o},$x:function(){return i}});var n={contents:0};function o(e){return n.contents=n.contents+1|0,e+"/"+n.contents}function i(e){return null!=e&&"string"==typeof e.RE_EXN_ID}},3179:function(e,t,r){"use strict";r.d(t,{lC:function(){return i},UW:function(){return a},tv:function(){return s}});var n=r(7842),o=r(1805),i=o.Ue("Caml_js_exceptions.Error");function a(e){return o.$x(e)?e:{RE_EXN_ID:i,_1:e}}function s(e){if(e.RE_EXN_ID===i)return n.G(e._1)}},7842:function(e,t,r){"use strict";function n(e){return void 0===e?{BS_PRIVATE_NESTED_SOME_NONE:0}:null!==e&&void 0!==e.BS_PRIVATE_NESTED_SOME_NONE?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function o(e){return null==e?void 0:n(e)}function i(e){return void 0===e?void 0:n(e)}function a(e){if(null===e||void 0===e.BS_PRIVATE_NESTED_SOME_NONE)return e;var t=e.BS_PRIVATE_NESTED_SOME_NONE;return 0===t?void 0:{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}r.d(t,{Tl:function(){return o},_2:function(){return i},xt:function(){return a},G:function(){return n}})},9090:function(e,t,r){"use strict";r.d(t,{_1:function(){return i},Dm:function(){return a},uv:function(){return s},ie:function(){return u}});var n=r(6406);function o(e,t){for(;;){var r=t,i=e,a=i.length,s=0===a?1:a,u=s-r.length|0;if(0===u)return i.apply(null,r);if(u>=0)return function(e,t){return function(r){return o(e,t.concat([r]))}}(i,r);t=n.lu(r,s,0|-u),e=i.apply(null,n.lu(r,0,s))}}function i(e,t){var r=e.length;if(1===r)return e(t);switch(r){case 1:return e(t);case 2:return function(r){return e(t,r)};case 3:return function(r,n){return e(t,r,n)};case 4:return function(r,n,o){return e(t,r,n,o)};case 5:return function(r,n,o,i){return e(t,r,n,o,i)};case 6:return function(r,n,o,i,a){return e(t,r,n,o,i,a)};case 7:return function(r,n,o,i,a,s){return e(t,r,n,o,i,a,s)};default:return o(e,[t])}}function a(e){return 1===e.length?e:function(t){return i(e,t)}}function s(e){return 2===e.length?e:function(t,r){return function(e,t,r){var n=e.length;if(2===n)return e(t,r);switch(n){case 1:return o(e(t),[r]);case 2:return e(t,r);case 3:return function(n){return e(t,r,n)};case 4:return function(n,o){return e(t,r,n,o)};case 5:return function(n,o,i){return e(t,r,n,o,i)};case 6:return function(n,o,i,a){return e(t,r,n,o,i,a)};case 7:return function(n,o,i,a,s){return e(t,r,n,o,i,a,s)};default:return o(e,[t,r])}}(e,t,r)}}function u(e){return 3===e.length?e:function(t,r,n){return function(e,t,r,n){var i=e.length;if(3===i)return e(t,r,n);switch(i){case 1:return o(e(t),[r,n]);case 2:return o(e(t,r),[n]);case 3:return e(t,r,n);case 4:return function(o){return e(t,r,n,o)};case 5:return function(o,i){return e(t,r,n,o,i)};case 6:return function(o,i,a){return e(t,r,n,o,i,a)};case 7:return function(o,i,a,s){return e(t,r,n,o,i,a,s)};default:return o(e,[t,r,n])}}(e,t,r,n)}}},3082:function(e,t,r){"use strict";r.d(t,{lC:function(){return a},A0:function(){return o},KL:function(){return i}});var n=r(3179),o=n.UW;function i(e){throw new Error(e)}var a=n.lC},9993:function(e,t,r){var n;if(r(5743),"object"==typeof globalThis)n=globalThis;else try{n=r(5413)}catch(s){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var o=n.WebSocket||n.MozWebSocket,i=r(6564);function a(e,t){return t?new o(e,t):new o(e)}o&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(a,e,{get:function(){return o[e]}})})),e.exports={w3cwebsocket:o?a:null,version:i}},6564:function(e,t,r){e.exports=r(9794).version},5329:function(e,t,r){"use strict";r.d(t,{O:function(){return Je}});var n=r(5671),o=r(3144),i=r(7757),a=r.n(i),s={"X-Client-Info":"supabase-js/".concat("1.31.1")};var u=r(136),c=r(2963),l=r(1120),d=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},h=function(e){return e.msg||e.message||e.error_description||e.error||JSON.stringify(e)},f=function(e,t){if("function"!=typeof e.json)return t(e);e.json().then((function(r){return t({message:h(r),status:(null==e?void 0:e.status)||500})}))},p=function(e,t,r){var n={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e||(n.headers=Object.assign({"Content-Type":"text/plain;charset=UTF-8"},null==t?void 0:t.headers),n.body=JSON.stringify(r)),n};function v(e,t,r,n,o){return d(this,void 0,void 0,a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise((function(i,a){e(r,p(t,n,o)).then((function(e){if(!e.ok)throw e;return(null==n?void 0:n.noResolveJson)?i:e.json()})).then((function(e){return i(e)})).catch((function(e){return f(e,a)}))})));case 1:case"end":return i.stop()}}),i)})))}function m(e,t,r){return d(this,void 0,void 0,a().mark((function n(){return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",v(e,"GET",t,r));case 1:case"end":return n.stop()}}),n)})))}function b(e,t,r,n){return d(this,void 0,void 0,a().mark((function o(){return a().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",v(e,"POST",t,n,r));case 1:case"end":return o.stop()}}),o)})))}function y(e,t,r,n){return d(this,void 0,void 0,a().mark((function o(){return a().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",v(e,"PUT",t,n,r));case 1:case"end":return o.stop()}}),o)})))}function g(e,t,r,n){return d(this,void 0,void 0,a().mark((function o(){return a().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",v(e,"DELETE",t,n,r));case 1:case"end":return o.stop()}}),o)})))}var k={"X-Client-Info":"gotrue-js/".concat("1.22.3")},w="supabase.auth.token",x={name:"sb",lifetime:28800,domain:"",path:"/",sameSite:"lax"};function E(e,t){var r,n,o;return function(e,t,r){var n=r||{},o=encodeURIComponent,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;if("function"!=typeof o)throw new TypeError("option encode is invalid");if(!i.test(e))throw new TypeError("argument name is invalid");var a=o(t);if(a&&!i.test(a))throw new TypeError("argument val is invalid");var s=e+"="+a;if(null!=n.maxAge){var u=n.maxAge-0;if(isNaN(u)||!isFinite(u))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(u)}if(n.domain){if(!i.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!i.test(n.path))throw new TypeError("option path is invalid");s+="; Path="+n.path}if(n.expires){if("function"!=typeof n.expires.toUTCString)throw new TypeError("option expires is invalid");s+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s}(e.name,e.value,{maxAge:e.maxAge,expires:new Date(Date.now()+1e3*e.maxAge),httpOnly:!0,secure:t,path:null!==(r=e.path)&&void 0!==r?r:"/",domain:null!==(n=e.domain)&&void 0!==n?n:"",sameSite:null!==(o=e.sameSite)&&void 0!==o?o:"lax"})}function _(e,t,r){var n=r.map((function(t){return E(t,function(e){if(!e||!e.headers||!e.headers.host)throw new Error('The "host" request header is not available');var t=e.headers.host.indexOf(":")>-1&&e.headers.host.split(":")[0]||e.headers.host;return!(["localhost","127.0.0.1"].indexOf(t)>-1||t.endsWith(".local"))}(e))})),o=t.getHeader("Set-Cookie");return o&&(o instanceof Array?Array.prototype.push.apply(n,o):"string"==typeof o&&n.push(o)),n}function T(e,t,r){t.setHeader("Set-Cookie",_(e,t,r))}var S=r(4973),O=r.n(S);function C(e){return Math.round(Date.now()/1e3)+e}var R=function(){return"undefined"!=typeof window};function Z(e,t){var r;t||(t=(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.href)||""),e=e.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&#]"+e+"(=([^&#]*)|&|#|$)").exec(t);return n?n[2]?decodeURIComponent(n[2].replace(/\+/g," ")):"":null}var P=function(e){var t;return t=e||("undefined"==typeof fetch?O():fetch),function(){return t.apply(void 0,arguments)}},N=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},I=function(){function e(t){var r=t.url,o=void 0===r?"":r,i=t.headers,a=void 0===i?{}:i,s=t.cookieOptions,u=t.fetch;(0,n.Z)(this,e),this.url=o,this.headers=a,this.cookieOptions=Object.assign(Object.assign({},x),s),this.fetch=P(u)}return(0,o.Z)(e,[{key:"_createRequestHeaders",value:function(e){var t=Object.assign({},this.headers);return t.Authorization="Bearer ".concat(e),t}},{key:"cookieName",value:function(){var e;return null!==(e=this.cookieOptions.name)&&void 0!==e?e:""}},{key:"getUrlForProvider",value:function(e,t){var r=["provider=".concat(encodeURIComponent(e))];return(null==t?void 0:t.redirectTo)&&r.push("redirect_to=".concat(encodeURIComponent(t.redirectTo))),(null==t?void 0:t.scopes)&&r.push("scopes=".concat(encodeURIComponent(t.scopes))),"".concat(this.url,"/authorize?").concat(r.join("&"))}},{key:"signUpWithEmail",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return N(this,void 0,void 0,a().mark((function n(){var o,i,s,u;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=Object.assign({},this.headers),i="",r.redirectTo&&(i="?redirect_to="+encodeURIComponent(r.redirectTo)),n.next=6,b(this.fetch,"".concat(this.url,"/signup").concat(i),{email:e,password:t,data:r.data,gotrue_meta_security:{hcaptcha_token:r.captchaToken}},{headers:o});case 6:return s=n.sent,(u=Object.assign({},s)).expires_in&&(u.expires_at=C(s.expires_in)),n.abrupt("return",{data:u,error:null});case 12:return n.prev=12,n.t0=n.catch(0),n.abrupt("return",{data:null,error:n.t0});case 15:case"end":return n.stop()}}),n,this,[[0,12]])})))}},{key:"signInWithEmail",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return N(this,void 0,void 0,a().mark((function n(){var o,i,s,u;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=Object.assign({},this.headers),i="?grant_type=password",r.redirectTo&&(i+="&redirect_to="+encodeURIComponent(r.redirectTo)),n.next=6,b(this.fetch,"".concat(this.url,"/token").concat(i),{email:e,password:t},{headers:o});case 6:return s=n.sent,(u=Object.assign({},s)).expires_in&&(u.expires_at=C(s.expires_in)),n.abrupt("return",{data:u,error:null});case 12:return n.prev=12,n.t0=n.catch(0),n.abrupt("return",{data:null,error:n.t0});case 15:case"end":return n.stop()}}),n,this,[[0,12]])})))}},{key:"signUpWithPhone",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return N(this,void 0,void 0,a().mark((function n(){var o,i,s;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=Object.assign({},this.headers),n.next=4,b(this.fetch,"".concat(this.url,"/signup"),{phone:e,password:t,data:r.data,gotrue_meta_security:{hcaptcha_token:r.captchaToken}},{headers:o});case 4:return i=n.sent,(s=Object.assign({},i)).expires_in&&(s.expires_at=C(i.expires_in)),n.abrupt("return",{data:s,error:null});case 10:return n.prev=10,n.t0=n.catch(0),n.abrupt("return",{data:null,error:n.t0});case 13:case"end":return n.stop()}}),n,this,[[0,10]])})))}},{key:"signInWithPhone",value:function(e,t){return N(this,void 0,void 0,a().mark((function r(){var n,o,i;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=Object.assign({},this.headers),"?grant_type=password",r.next=5,b(this.fetch,"".concat(this.url,"/token").concat("?grant_type=password"),{phone:e,password:t},{headers:n});case 5:return o=r.sent,(i=Object.assign({},o)).expires_in&&(i.expires_at=C(o.expires_in)),r.abrupt("return",{data:i,error:null});case 11:return r.prev=11,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 14:case"end":return r.stop()}}),r,this,[[0,11]])})))}},{key:"signInWithOpenIDConnect",value:function(e){var t=e.id_token,r=e.nonce,n=e.client_id,o=e.issuer,i=e.provider;return N(this,void 0,void 0,a().mark((function e(){var s,u,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=Object.assign({},this.headers),"?grant_type=id_token",e.next=5,b(this.fetch,"".concat(this.url,"/token").concat("?grant_type=id_token"),{id_token:t,nonce:r,client_id:n,issuer:o,provider:i},{headers:s});case 5:return u=e.sent,(c=Object.assign({},u)).expires_in&&(c.expires_at=C(u.expires_in)),e.abrupt("return",{data:c,error:null});case 11:return e.prev=11,e.t0=e.catch(0),e.abrupt("return",{data:null,error:e.t0});case 14:case"end":return e.stop()}}),e,this,[[0,11]])})))}},{key:"sendMagicLinkEmail",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(this,void 0,void 0,a().mark((function r(){var n,o,i,s;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=Object.assign({},this.headers),o="",t.redirectTo&&(o+="?redirect_to="+encodeURIComponent(t.redirectTo)),i=!t.shouldCreateUser||t.shouldCreateUser,r.next=7,b(this.fetch,"".concat(this.url,"/otp").concat(o),{email:e,create_user:i,gotrue_meta_security:{hcaptcha_token:t.captchaToken}},{headers:n});case 7:return s=r.sent,r.abrupt("return",{data:s,error:null});case 11:return r.prev=11,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 14:case"end":return r.stop()}}),r,this,[[0,11]])})))}},{key:"sendMobileOTP",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(this,void 0,void 0,a().mark((function r(){var n,o,i;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=!t.shouldCreateUser||t.shouldCreateUser,o=Object.assign({},this.headers),r.next=5,b(this.fetch,"".concat(this.url,"/otp"),{phone:e,create_user:n,gotrue_meta_security:{hcaptcha_token:t.captchaToken}},{headers:o});case 5:return i=r.sent,r.abrupt("return",{data:i,error:null});case 9:return r.prev=9,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 12:case"end":return r.stop()}}),r,this,[[0,9]])})))}},{key:"signOut",value:function(e){return N(this,void 0,void 0,a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,b(this.fetch,"".concat(this.url,"/logout"),{},{headers:this._createRequestHeaders(e),noResolveJson:!0});case 3:return t.abrupt("return",{error:null});case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",{error:t.t0});case 9:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"verifyMobileOTP",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return N(this,void 0,void 0,a().mark((function n(){var o,i;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=Object.assign({},this.headers),n.next=4,b(this.fetch,"".concat(this.url,"/verify"),{phone:e,token:t,type:"sms",redirect_to:r.redirectTo},{headers:o});case 4:return i=n.sent,n.abrupt("return",{data:i,error:null});case 8:return n.prev=8,n.t0=n.catch(0),n.abrupt("return",{data:null,error:n.t0});case 11:case"end":return n.stop()}}),n,this,[[0,8]])})))}},{key:"inviteUserByEmail",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(this,void 0,void 0,a().mark((function r(){var n,o,i;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=Object.assign({},this.headers),o="",t.redirectTo&&(o+="?redirect_to="+encodeURIComponent(t.redirectTo)),r.next=6,b(this.fetch,"".concat(this.url,"/invite").concat(o),{email:e,data:t.data},{headers:n});case 6:return i=r.sent,r.abrupt("return",{data:i,error:null});case 10:return r.prev=10,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))}},{key:"resetPasswordForEmail",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(this,void 0,void 0,a().mark((function r(){var n,o,i;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=Object.assign({},this.headers),o="",t.redirectTo&&(o+="?redirect_to="+encodeURIComponent(t.redirectTo)),r.next=6,b(this.fetch,"".concat(this.url,"/recover").concat(o),{email:e,gotrue_meta_security:{hcaptcha_token:t.captchaToken}},{headers:n});case 6:return i=r.sent,r.abrupt("return",{data:i,error:null});case 10:return r.prev=10,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))}},{key:"refreshAccessToken",value:function(e){return N(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,b(this.fetch,"".concat(this.url,"/token?grant_type=refresh_token"),{refresh_token:e},{headers:this.headers});case 3:return r=t.sent,(n=Object.assign({},r)).expires_in&&(n.expires_at=C(r.expires_in)),t.abrupt("return",{data:n,error:null});case 9:return t.prev=9,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 12:case"end":return t.stop()}}),t,this,[[0,9]])})))}},{key:"setAuthCookie",value:function(e,t){var r=this;"POST"!==e.method&&(t.setHeader("Allow","POST"),t.status(405).end("Method Not Allowed"));var n=e.body,o=n.event,i=n.session;if(!o)throw new Error("Auth event missing!");if("SIGNED_IN"===o){if(!i)throw new Error("Auth session missing!");T(e,t,[{key:"access-token",value:i.access_token},{key:"refresh-token",value:i.refresh_token}].map((function(e){var t;return{name:"".concat(r.cookieName(),"-").concat(e.key),value:e.value,domain:r.cookieOptions.domain,maxAge:null!==(t=r.cookieOptions.lifetime)&&void 0!==t?t:0,path:r.cookieOptions.path,sameSite:r.cookieOptions.sameSite}})))}"SIGNED_OUT"===o&&T(e,t,["access-token","refresh-token"].map((function(e){return{name:"".concat(r.cookieName(),"-").concat(e),value:"",maxAge:-1}}))),t.status(200).json({})}},{key:"deleteAuthCookie",value:function(e,t,r){var n=this,o=r.redirectTo,i=void 0===o?"/":o;return T(e,t,["access-token","refresh-token"].map((function(e){return{name:"".concat(n.cookieName(),"-").concat(e),value:"",maxAge:-1}}))),t.redirect(307,i)}},{key:"getAuthCookieString",value:function(e,t){var r=this;"POST"!==e.method&&(t.setHeader("Allow","POST"),t.status(405).end("Method Not Allowed"));var n=e.body,o=n.event,i=n.session;if(!o)throw new Error("Auth event missing!");if("SIGNED_IN"===o){if(!i)throw new Error("Auth session missing!");return _(e,t,[{key:"access-token",value:i.access_token},{key:"refresh-token",value:i.refresh_token}].map((function(e){var t;return{name:"".concat(r.cookieName(),"-").concat(e.key),value:e.value,domain:r.cookieOptions.domain,maxAge:null!==(t=r.cookieOptions.lifetime)&&void 0!==t?t:0,path:r.cookieOptions.path,sameSite:r.cookieOptions.sameSite}})))}return"SIGNED_OUT"===o?_(e,t,["access-token","refresh-token"].map((function(e){return{name:"".concat(r.cookieName(),"-").concat(e),value:"",maxAge:-1}}))):t.getHeader("Set-Cookie")}},{key:"generateLink",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return N(this,void 0,void 0,a().mark((function n(){var o;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,b(this.fetch,"".concat(this.url,"/admin/generate_link"),{type:e,email:t,password:r.password,data:r.data,redirect_to:r.redirectTo},{headers:this.headers});case 3:return o=n.sent,n.abrupt("return",{data:o,error:null});case 7:return n.prev=7,n.t0=n.catch(0),n.abrupt("return",{data:null,error:n.t0});case 10:case"end":return n.stop()}}),n,this,[[0,7]])})))}},{key:"createUser",value:function(e){return N(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,b(this.fetch,"".concat(this.url,"/admin/users"),e,{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{user:r,data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{user:null,data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"listUsers",value:function(){return N(this,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m(this.fetch,"".concat(this.url,"/admin/users"),{headers:this.headers});case 3:return t=e.sent,e.abrupt("return",{data:t.users,error:null});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{data:null,error:e.t0});case 10:case"end":return e.stop()}}),e,this,[[0,7]])})))}},{key:"getUserById",value:function(e){return N(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m(this.fetch,"".concat(this.url,"/admin/users/").concat(e),{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"getUserByCookie",value:function(e,t){return N(this,void 0,void 0,a().mark((function r(){var n,o,i,s,u,c,l,d=this;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,e.cookies){r.next=3;break}throw new Error("Not able to parse cookies! When using Express make sure the cookie-parser middleware is in use!");case 3:if(n=e.cookies["".concat(this.cookieName(),"-access-token")],o=e.cookies["".concat(this.cookieName(),"-refresh-token")],n){r.next=7;break}throw new Error("No cookie found!");case 7:return r.next=9,this.getUser(n);case 9:if(i=r.sent,s=i.user,!i.error){r.next=29;break}if(o){r.next=15;break}throw new Error("No refresh_token cookie found!");case 15:if(t){r.next=17;break}throw new Error("You need to pass the res object to automatically refresh the session!");case 17:return r.next=19,this.refreshAccessToken(o);case 19:if(u=r.sent,c=u.data,!(l=u.error)){r.next=26;break}throw l;case 26:if(!c){r.next=29;break}return T(e,t,[{key:"access-token",value:c.access_token},{key:"refresh-token",value:c.refresh_token}].map((function(e){var t;return{name:"".concat(d.cookieName(),"-").concat(e.key),value:e.value,domain:d.cookieOptions.domain,maxAge:null!==(t=d.cookieOptions.lifetime)&&void 0!==t?t:0,path:d.cookieOptions.path,sameSite:d.cookieOptions.sameSite}}))),r.abrupt("return",{token:c.access_token,user:c.user,data:c.user,error:null});case 29:return r.abrupt("return",{token:n,user:s,data:s,error:null});case 32:return r.prev=32,r.t0=r.catch(0),r.abrupt("return",{token:null,user:null,data:null,error:r.t0});case 35:case"end":return r.stop()}}),r,this,[[0,32]])})))}},{key:"updateUserById",value:function(e,t){return N(this,void 0,void 0,a().mark((function r(){var n;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=4,y(this.fetch,"".concat(this.url,"/admin/users/").concat(e),t,{headers:this.headers});case 4:return n=r.sent,r.abrupt("return",{user:n,data:n,error:null});case 8:return r.prev=8,r.t0=r.catch(0),r.abrupt("return",{user:null,data:null,error:r.t0});case 11:case"end":return r.stop()}}),r,this,[[0,8]])})))}},{key:"deleteUser",value:function(e){return N(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,g(this.fetch,"".concat(this.url,"/admin/users/").concat(e),{},{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{user:r,data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{user:null,data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"getUser",value:function(e){return N(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,m(this.fetch,"".concat(this.url,"/user"),{headers:this._createRequestHeaders(e)});case 3:return r=t.sent,t.abrupt("return",{user:r,data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{user:null,data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"updateUser",value:function(e,t){return N(this,void 0,void 0,a().mark((function r(){var n;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,y(this.fetch,"".concat(this.url,"/user"),t,{headers:this._createRequestHeaders(e)});case 3:return n=r.sent,r.abrupt("return",{user:n,data:n,error:null});case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",{user:null,data:null,error:r.t0});case 10:case"end":return r.stop()}}),r,this,[[0,7]])})))}}]),e}();r(5743);var A=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();var j={url:"http://localhost:9999",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,multiTab:!0,headers:k},D=function(){function e(t){(0,n.Z)(this,e),this.stateChangeEmitters=new Map;var r=Object.assign(Object.assign({},j),t);this.currentUser=null,this.currentSession=null,this.autoRefreshToken=r.autoRefreshToken,this.persistSession=r.persistSession,this.multiTab=r.multiTab,this.localStorage=r.localStorage||globalThis.localStorage,this.api=new I({url:r.url,headers:r.headers,cookieOptions:r.cookieOptions,fetch:r.fetch}),this._recoverSession(),this._recoverAndRefresh(),this._listenForMultiTabEvents(),r.detectSessionInUrl&&R()&&Z("access_token")&&this.getSessionFromUrl({storeSession:!0}).then((function(e){var t=e.error;t&&console.error("Error getting session from URL.",t)}))}return(0,o.Z)(e,[{key:"signUp",value:function(e){var t=e.email,r=e.password,n=e.phone,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(this,void 0,void 0,a().mark((function e(){var i,s,u,c,l;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this._removeSession(),!n||!r){e.next=8;break}return e.next=5,this.api.signUpWithPhone(n,r,{data:o.data,captchaToken:o.captchaToken});case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,this.api.signUpWithEmail(t,r,{redirectTo:o.redirectTo,data:o.data,captchaToken:o.captchaToken});case 10:e.t0=e.sent;case 11:if(i=e.t0,s=i.data,!(u=i.error)){e.next=16;break}throw u;case 16:if(s){e.next=18;break}throw"An error occurred on sign up.";case 18:return c=null,l=null,s.access_token&&(l=(c=s).user,this._saveSession(c),this._notifyAllSubscribers("SIGNED_IN")),s.id&&(l=s),e.abrupt("return",{user:l,session:c,error:null});case 25:return e.prev=25,e.t1=e.catch(0),e.abrupt("return",{user:null,session:null,error:e.t1});case 28:case"end":return e.stop()}}),e,this,[[0,25]])})))}},{key:"signIn",value:function(e){var t=e.email,r=e.phone,n=e.password,o=e.refreshToken,i=e.provider,s=e.oidc,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(this,void 0,void 0,a().mark((function e(){var c,l,d,h,f,p;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this._removeSession(),!t||n){e.next=8;break}return e.next=5,this.api.sendMagicLinkEmail(t,{redirectTo:u.redirectTo,shouldCreateUser:u.shouldCreateUser,captchaToken:u.captchaToken});case 5:return c=e.sent,l=c.error,e.abrupt("return",{user:null,session:null,error:l});case 8:if(!t||!n){e.next=10;break}return e.abrupt("return",this._handleEmailSignIn(t,n,{redirectTo:u.redirectTo}));case 10:if(!r||n){e.next=16;break}return e.next=13,this.api.sendMobileOTP(r,{shouldCreateUser:u.shouldCreateUser,captchaToken:u.captchaToken});case 13:return d=e.sent,h=d.error,e.abrupt("return",{user:null,session:null,error:h});case 16:if(!r||!n){e.next=18;break}return e.abrupt("return",this._handlePhoneSignIn(r,n));case 18:if(!o){e.next=26;break}return e.next=21,this._callRefreshToken(o);case 21:if(f=e.sent,!(p=f.error)){e.next=25;break}throw p;case 25:return e.abrupt("return",{user:this.currentUser,session:this.currentSession,error:null});case 26:if(!i){e.next=28;break}return e.abrupt("return",this._handleProviderSignIn(i,{redirectTo:u.redirectTo,scopes:u.scopes}));case 28:if(!s){e.next=30;break}return e.abrupt("return",this._handleOpenIDConnectSignIn(s));case 30:throw new Error("You must provide either an email, phone number, a third-party provider or OpenID Connect.");case 33:return e.prev=33,e.t0=e.catch(0),e.abrupt("return",{user:null,session:null,error:e.t0});case 36:case"end":return e.stop()}}),e,this,[[0,33]])})))}},{key:"verifyOTP",value:function(e){var t=e.phone,r=e.token,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(this,void 0,void 0,a().mark((function e(){var o,i,s,u,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this._removeSession(),e.next=4,this.api.verifyMobileOTP(t,r,n);case 4:if(o=e.sent,i=o.data,!(s=o.error)){e.next=9;break}throw s;case 9:if(i){e.next=11;break}throw"An error occurred on token verification.";case 11:return u=null,c=null,i.access_token&&(c=(u=i).user,this._saveSession(u),this._notifyAllSubscribers("SIGNED_IN")),i.id&&(c=i),e.abrupt("return",{user:c,session:u,error:null});case 18:return e.prev=18,e.t0=e.catch(0),e.abrupt("return",{user:null,session:null,error:e.t0});case 21:case"end":return e.stop()}}),e,this,[[0,18]])})))}},{key:"user",value:function(){return this.currentUser}},{key:"session",value:function(){return this.currentSession}},{key:"refreshSession",value:function(){var e;return A(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null===(e=this.currentSession)||void 0===e?void 0:e.access_token){t.next=3;break}throw new Error("Not logged in.");case 3:return t.next=5,this._callRefreshToken();case 5:if(r=t.sent,!(n=r.error)){t.next=9;break}throw n;case 9:return t.abrupt("return",{data:this.currentSession,user:this.currentUser,error:null});case 12:return t.prev=12,t.t0=t.catch(0),t.abrupt("return",{data:null,user:null,error:t.t0});case 15:case"end":return t.stop()}}),t,this,[[0,12]])})))}},{key:"update",value:function(e){var t;return A(this,void 0,void 0,a().mark((function r(){var n,o,i,s;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,null===(t=this.currentSession)||void 0===t?void 0:t.access_token){r.next=3;break}throw new Error("Not logged in.");case 3:return r.next=5,this.api.updateUser(this.currentSession.access_token,e);case 5:if(n=r.sent,o=n.user,!(i=n.error)){r.next=10;break}throw i;case 10:if(o){r.next=12;break}throw Error("Invalid user data.");case 12:return s=Object.assign(Object.assign({},this.currentSession),{user:o}),this._saveSession(s),this._notifyAllSubscribers("USER_UPDATED"),r.abrupt("return",{data:o,user:o,error:null});case 18:return r.prev=18,r.t0=r.catch(0),r.abrupt("return",{data:null,user:null,error:r.t0});case 21:case"end":return r.stop()}}),r,this,[[0,18]])})))}},{key:"setSession",value:function(e){return A(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}throw new Error("No current session.");case 3:return t.next=5,this.api.refreshAccessToken(e);case 5:if(r=t.sent,n=r.data,!(o=r.error)){t.next=10;break}return t.abrupt("return",{session:null,error:o});case 10:return this._saveSession(n),this._notifyAllSubscribers("SIGNED_IN"),t.abrupt("return",{session:n,error:null});case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",{error:t.t0,session:null});case 18:case"end":return t.stop()}}),t,this,[[0,15]])})))}},{key:"setAuth",value:function(e){return this.currentSession=Object.assign(Object.assign({},this.currentSession),{access_token:e,token_type:"bearer",user:null}),this.currentSession}},{key:"getSessionFromUrl",value:function(e){return A(this,void 0,void 0,a().mark((function t(){var r,n,o,i,s,u,c,l,d,h,f,p,v;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,R()){t.next=3;break}throw new Error("No browser detected.");case 3:if(!(r=Z("error_description"))){t.next=6;break}throw new Error(r);case 6:if(n=Z("provider_token"),o=Z("access_token")){t.next=10;break}throw new Error("No access_token detected.");case 10:if(i=Z("expires_in")){t.next=13;break}throw new Error("No expires_in detected.");case 13:if(s=Z("refresh_token")){t.next=16;break}throw new Error("No refresh_token detected.");case 16:if(u=Z("token_type")){t.next=19;break}throw new Error("No token_type detected.");case 19:return c=Math.round(Date.now()/1e3),l=c+parseInt(i),t.next=23,this.api.getUser(o);case 23:if(d=t.sent,h=d.user,!(f=d.error)){t.next=28;break}throw f;case 28:return p={provider_token:n,access_token:o,expires_in:parseInt(i),expires_at:l,refresh_token:s,token_type:u,user:h},(null==e?void 0:e.storeSession)&&(this._saveSession(p),v=Z("type"),this._notifyAllSubscribers("SIGNED_IN"),"recovery"===v&&this._notifyAllSubscribers("PASSWORD_RECOVERY")),window.location.hash="",t.abrupt("return",{data:p,error:null});case 34:return t.prev=34,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 37:case"end":return t.stop()}}),t,this,[[0,34]])})))}},{key:"signOut",value:function(){var e;return A(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null===(e=this.currentSession)||void 0===e?void 0:e.access_token,this._removeSession(),this._notifyAllSubscribers("SIGNED_OUT"),!r){t.next=10;break}return t.next=6,this.api.signOut(r);case 6:if(n=t.sent,!(o=n.error)){t.next=10;break}return t.abrupt("return",{error:o});case 10:return t.abrupt("return",{error:null});case 11:case"end":return t.stop()}}),t,this)})))}},{key:"onAuthStateChange",value:function(e){var t=this;try{var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),n={id:r,callback:e,unsubscribe:function(){t.stateChangeEmitters.delete(r)}};return this.stateChangeEmitters.set(r,n),{data:n,error:null}}catch(o){return{data:null,error:o}}}},{key:"_handleEmailSignIn",value:function(e,t){var r,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return A(this,void 0,void 0,a().mark((function i(){var s,u,c;return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,this.api.signInWithEmail(e,t,{redirectTo:o.redirectTo});case 3:if(s=i.sent,u=s.data,!(c=s.error)&&u){i.next=8;break}return i.abrupt("return",{data:null,user:null,session:null,error:c});case 8:return((null===(r=null==u?void 0:u.user)||void 0===r?void 0:r.confirmed_at)||(null===(n=null==u?void 0:u.user)||void 0===n?void 0:n.email_confirmed_at))&&(this._saveSession(u),this._notifyAllSubscribers("SIGNED_IN")),i.abrupt("return",{data:u,user:u.user,session:u,error:null});case 12:return i.prev=12,i.t0=i.catch(0),i.abrupt("return",{data:null,user:null,session:null,error:i.t0});case 15:case"end":return i.stop()}}),i,this,[[0,12]])})))}},{key:"_handlePhoneSignIn",value:function(e,t){var r;return A(this,void 0,void 0,a().mark((function n(){var o,i,s;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,this.api.signInWithPhone(e,t);case 3:if(o=n.sent,i=o.data,!(s=o.error)&&i){n.next=8;break}return n.abrupt("return",{data:null,user:null,session:null,error:s});case 8:return(null===(r=null==i?void 0:i.user)||void 0===r?void 0:r.phone_confirmed_at)&&(this._saveSession(i),this._notifyAllSubscribers("SIGNED_IN")),n.abrupt("return",{data:i,user:i.user,session:i,error:null});case 12:return n.prev=12,n.t0=n.catch(0),n.abrupt("return",{data:null,user:null,session:null,error:n.t0});case 15:case"end":return n.stop()}}),n,this,[[0,12]])})))}},{key:"_handleProviderSignIn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.api.getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes});try{return R()&&(window.location.href=r),{provider:e,url:r,data:null,session:null,user:null,error:null}}catch(n){return r?{provider:e,url:r,data:null,session:null,user:null,error:null}:{data:null,user:null,session:null,error:n}}}},{key:"_handleOpenIDConnectSignIn",value:function(e){var t=e.id_token,r=e.nonce,n=e.client_id,o=e.issuer,i=e.provider;return A(this,void 0,void 0,a().mark((function e(){var s,u,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t&&r&&(n&&o||i))){e.next=17;break}return e.prev=1,e.next=4,this.api.signInWithOpenIDConnect({id_token:t,nonce:r,client_id:n,issuer:o,provider:i});case 4:if(s=e.sent,u=s.data,!(c=s.error)&&u){e.next=9;break}return e.abrupt("return",{user:null,session:null,error:c});case 9:return this._saveSession(u),this._notifyAllSubscribers("SIGNED_IN"),e.abrupt("return",{user:u.user,session:u,error:null});case 14:return e.prev=14,e.t0=e.catch(1),e.abrupt("return",{user:null,session:null,error:e.t0});case 17:throw new Error("You must provide a OpenID Connect provider with your id token and nonce.");case 18:case"end":return e.stop()}}),e,this,[[1,14]])})))}},{key:"_recoverSession",value:function(){var e;try{var t=R()&&(null===(e=this.localStorage)||void 0===e?void 0:e.getItem(w));if(!t||"string"!=typeof t)return null;var r=JSON.parse(t),n=r.currentSession;r.expiresAt>=Math.round(Date.now()/1e3)&&(null==n?void 0:n.user)&&(this._saveSession(n),this._notifyAllSubscribers("SIGNED_IN"))}catch(o){console.log("error",o)}}},{key:"_recoverAndRefresh",value:function(){return A(this,void 0,void 0,a().mark((function e(){var t,r,n,o,i,s,u;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,e.t0=R(),!e.t0){e.next=6;break}return e.next=5,this.localStorage.getItem(w);case 5:e.t0=e.sent;case 6:if(t=e.t0){e.next=9;break}return e.abrupt("return",null);case 9:if(r=JSON.parse(t),n=r.currentSession,o=r.expiresAt,i=Math.round(Date.now()/1e3),!(o<i)){e.next=27;break}if(!this.autoRefreshToken||!n.refresh_token){e.next=24;break}return e.next=16,this._callRefreshToken(n.refresh_token);case 16:if(s=e.sent,!(u=s.error)){e.next=22;break}return console.log(u.message),e.next=22,this._removeSession();case 22:e.next=25;break;case 24:this._removeSession();case 25:e.next=28;break;case 27:n&&n.user?(this._saveSession(n),this._notifyAllSubscribers("SIGNED_IN")):(console.log("Current session is missing data."),this._removeSession());case 28:e.next=34;break;case 30:return e.prev=30,e.t1=e.catch(0),console.error(e.t1),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[0,30]])})))}},{key:"_callRefreshToken",value:function(e){var t;return void 0===e&&(e=null===(t=this.currentSession)||void 0===t?void 0:t.refresh_token),A(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e){t.next=3;break}throw new Error("No current session.");case 3:return t.next=5,this.api.refreshAccessToken(e);case 5:if(r=t.sent,n=r.data,!(o=r.error)){t.next=10;break}throw o;case 10:if(n){t.next=12;break}throw Error("Invalid session data.");case 12:return this._saveSession(n),this._notifyAllSubscribers("TOKEN_REFRESHED"),this._notifyAllSubscribers("SIGNED_IN"),t.abrupt("return",{data:n,error:null});case 18:return t.prev=18,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 21:case"end":return t.stop()}}),t,this,[[0,18]])})))}},{key:"_notifyAllSubscribers",value:function(e){var t=this;this.stateChangeEmitters.forEach((function(r){return r.callback(e,t.currentSession)}))}},{key:"_saveSession",value:function(e){this.currentSession=e,this.currentUser=e.user;var t=e.expires_at;if(t){var r=t-Math.round(Date.now()/1e3),n=r>60?60:.5;this._startAutoRefreshToken(1e3*(r-n))}this.persistSession&&e.expires_at&&this._persistSession(this.currentSession)}},{key:"_persistSession",value:function(e){var t={currentSession:e,expiresAt:e.expires_at};R()&&this.localStorage.setItem(w,JSON.stringify(t))}},{key:"_removeSession",value:function(){return A(this,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.currentSession=null,this.currentUser=null,this.refreshTokenTimer&&clearTimeout(this.refreshTokenTimer),e.t0=R(),!e.t0){e.next=7;break}return e.next=7,this.localStorage.removeItem(w);case 7:case"end":return e.stop()}}),e,this)})))}},{key:"_startAutoRefreshToken",value:function(e){var t=this;this.refreshTokenTimer&&clearTimeout(this.refreshTokenTimer),e<=0||!this.autoRefreshToken||(this.refreshTokenTimer=setTimeout((function(){return t._callRefreshToken()}),e),"function"==typeof this.refreshTokenTimer.unref&&this.refreshTokenTimer.unref())}},{key:"_listenForMultiTabEvents",value:function(){var e=this;if(!this.multiTab||!R()||!(null===window||void 0===window?void 0:window.addEventListener))return!1;try{null===window||void 0===window||window.addEventListener("storage",(function(t){var r;if(t.key===w){var n=JSON.parse(String(t.newValue));(null===(r=null==n?void 0:n.currentSession)||void 0===r?void 0:r.access_token)?(e._recoverAndRefresh(),e._notifyAllSubscribers("SIGNED_IN")):(e._removeSession(),e._notifyAllSubscribers("SIGNED_OUT"))}}))}catch(t){console.error("_listenForMultiTabEvents",t)}}}]),e}();function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var U=function(e){(0,u.Z)(r,e);var t=M(r);function r(e){return(0,n.Z)(this,r),t.call(this,e)}return(0,o.Z)(r)}(D),L=r(2982),B=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},F=function(){function e(t){var r;(0,n.Z)(this,e),Object.assign(this,t),r=t.fetch?t.fetch:"undefined"==typeof fetch?O():fetch,this.fetch=function(){return r.apply(void 0,arguments)},this.shouldThrowOnError=t.shouldThrowOnError||!1}return(0,o.Z)(e,[{key:"throwOnError",value:function(e){return null==e&&(e=!0),this.shouldThrowOnError=e,this}},{key:"then",value:function(e,t){var r=this;void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");var n=this.fetch(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then((function(e){return B(r,void 0,void 0,a().mark((function t(){var r,n,o,i,s,u,c,l,d,h,f,p;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=null,s=null,u=null,!e.ok){t.next=15;break}if(c=null===(r=this.headers.Prefer)||void 0===r?void 0:r.split(",").includes("return=minimal"),"HEAD"===this.method||c){t.next=10;break}return t.next=8,e.text();case 8:(l=t.sent)&&(s="text/csv"===this.headers.Accept?l:JSON.parse(l));case 10:d=null===(n=this.headers.Prefer)||void 0===n?void 0:n.match(/count=(exact|planned|estimated)/),h=null===(o=e.headers.get("content-range"))||void 0===o?void 0:o.split("/"),d&&h&&h.length>1&&(u=parseInt(h[1])),t.next=21;break;case 15:return t.next=17,e.text();case 17:f=t.sent;try{i=JSON.parse(f)}catch(a){i={message:f}}if(!i||!this.shouldThrowOnError){t.next=21;break}throw i;case 21:return p={error:i,data:s,count:u,status:e.status,statusText:e.statusText,body:s},t.abrupt("return",p);case 23:case"end":return t.stop()}}),t,this)})))}));return this.shouldThrowOnError||(n=n.catch((function(e){return{error:{message:"FetchError: ".concat(e.message),details:"",hint:"",code:e.code||""},data:null,body:null,count:null,status:400,statusText:"Bad Request"}}))),n.then(e,t)}}]),e}();function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var W=function(e){(0,u.Z)(r,e);var t=H(r);function r(){return(0,n.Z)(this,r),t.apply(this,arguments)}return(0,o.Z)(r,[{key:"select",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=!1,r=e.split("").map((function(e){return/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)})).join("");return this.url.searchParams.set("select",r),this}},{key:"order",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.ascending,n=void 0===r||r,o=t.nullsFirst,i=void 0!==o&&o,a=t.foreignTable,s=void 0===a?"order":"".concat(a,".order"),u=this.url.searchParams.get(s);return this.url.searchParams.set(s,"".concat(u?"".concat(u,","):"").concat(e,".").concat(n?"asc":"desc",".").concat(i?"nullsfirst":"nullslast")),this}},{key:"limit",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.foreignTable,n=void 0===r?"limit":"".concat(r,".limit");return this.url.searchParams.set(n,"".concat(e)),this}},{key:"range",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.foreignTable,o=void 0===n?"offset":"".concat(n,".offset"),i=void 0===n?"limit":"".concat(n,".limit");return this.url.searchParams.set(o,"".concat(e)),this.url.searchParams.set(i,"".concat(t-e+1)),this}},{key:"abortSignal",value:function(e){return this.signal=e,this}},{key:"single",value:function(){return this.headers.Accept="application/vnd.pgrst.object+json",this}},{key:"maybeSingle",value:function(){var e=this;this.headers.Accept="application/vnd.pgrst.object+json";var t=new r(this);return t.then=function(t,r){return e.then((function(e){var r,n;return(null===(n=null===(r=e.error)||void 0===r?void 0:r.details)||void 0===n?void 0:n.includes("Results contain 0 rows"))?t({error:null,data:null,count:e.count,status:200,statusText:"OK",body:null}):t(e)}),r)},t}},{key:"csv",value:function(){return this.headers.Accept="text/csv",this}}]),r}(F);function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var z=function(e){(0,u.Z)(r,e);var t=G(r);function r(){var e;return(0,n.Z)(this,r),(e=t.apply(this,arguments)).cs=e.contains,e.cd=e.containedBy,e.sl=e.rangeLt,e.sr=e.rangeGt,e.nxl=e.rangeGte,e.nxr=e.rangeLte,e.adj=e.rangeAdjacent,e.ov=e.overlaps,e}return(0,o.Z)(r,[{key:"not",value:function(e,t,r){return this.url.searchParams.append("".concat(e),"not.".concat(t,".").concat(r)),this}},{key:"or",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.foreignTable,n=void 0===r?"or":"".concat(r,".or");return this.url.searchParams.append(n,"(".concat(e,")")),this}},{key:"eq",value:function(e,t){return this.url.searchParams.append("".concat(e),"eq.".concat(t)),this}},{key:"neq",value:function(e,t){return this.url.searchParams.append("".concat(e),"neq.".concat(t)),this}},{key:"gt",value:function(e,t){return this.url.searchParams.append("".concat(e),"gt.".concat(t)),this}},{key:"gte",value:function(e,t){return this.url.searchParams.append("".concat(e),"gte.".concat(t)),this}},{key:"lt",value:function(e,t){return this.url.searchParams.append("".concat(e),"lt.".concat(t)),this}},{key:"lte",value:function(e,t){return this.url.searchParams.append("".concat(e),"lte.".concat(t)),this}},{key:"like",value:function(e,t){return this.url.searchParams.append("".concat(e),"like.".concat(t)),this}},{key:"ilike",value:function(e,t){return this.url.searchParams.append("".concat(e),"ilike.".concat(t)),this}},{key:"is",value:function(e,t){return this.url.searchParams.append("".concat(e),"is.".concat(t)),this}},{key:"in",value:function(e,t){var r=t.map((function(e){return"string"==typeof e&&new RegExp("[,()]").test(e)?'"'.concat(e,'"'):"".concat(e)})).join(",");return this.url.searchParams.append("".concat(e),"in.(".concat(r,")")),this}},{key:"contains",value:function(e,t){return"string"==typeof t?this.url.searchParams.append("".concat(e),"cs.".concat(t)):Array.isArray(t)?this.url.searchParams.append("".concat(e),"cs.{".concat(t.join(","),"}")):this.url.searchParams.append("".concat(e),"cs.".concat(JSON.stringify(t))),this}},{key:"containedBy",value:function(e,t){return"string"==typeof t?this.url.searchParams.append("".concat(e),"cd.".concat(t)):Array.isArray(t)?this.url.searchParams.append("".concat(e),"cd.{".concat(t.join(","),"}")):this.url.searchParams.append("".concat(e),"cd.".concat(JSON.stringify(t))),this}},{key:"rangeLt",value:function(e,t){return this.url.searchParams.append("".concat(e),"sl.".concat(t)),this}},{key:"rangeGt",value:function(e,t){return this.url.searchParams.append("".concat(e),"sr.".concat(t)),this}},{key:"rangeGte",value:function(e,t){return this.url.searchParams.append("".concat(e),"nxl.".concat(t)),this}},{key:"rangeLte",value:function(e,t){return this.url.searchParams.append("".concat(e),"nxr.".concat(t)),this}},{key:"rangeAdjacent",value:function(e,t){return this.url.searchParams.append("".concat(e),"adj.".concat(t)),this}},{key:"overlaps",value:function(e,t){return"string"==typeof t?this.url.searchParams.append("".concat(e),"ov.".concat(t)):this.url.searchParams.append("".concat(e),"ov.{".concat(t.join(","),"}")),this}},{key:"textSearch",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.config,o=r.type,i=void 0===o?null:o,a="";"plain"===i?a="pl":"phrase"===i?a="ph":"websearch"===i&&(a="w");var s=void 0===n?"":"(".concat(n,")");return this.url.searchParams.append("".concat(e),"".concat(a,"fts").concat(s,".").concat(t)),this}},{key:"fts",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.config,o=void 0===n?"":"(".concat(n,")");return this.url.searchParams.append("".concat(e),"fts".concat(o,".").concat(t)),this}},{key:"plfts",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.config,o=void 0===n?"":"(".concat(n,")");return this.url.searchParams.append("".concat(e),"plfts".concat(o,".").concat(t)),this}},{key:"phfts",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.config,o=void 0===n?"":"(".concat(n,")");return this.url.searchParams.append("".concat(e),"phfts".concat(o,".").concat(t)),this}},{key:"wfts",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.config,o=void 0===n?"":"(".concat(n,")");return this.url.searchParams.append("".concat(e),"wfts".concat(o,".").concat(t)),this}},{key:"filter",value:function(e,t,r){return this.url.searchParams.append("".concat(e),"".concat(t,".").concat(r)),this}},{key:"match",value:function(e){var t=this;return Object.keys(e).forEach((function(r){t.url.searchParams.append("".concat(r),"eq.".concat(e[r]))})),this}}]),r}(W);function $(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var q=function(e){(0,u.Z)(r,e);var t=$(r);function r(e){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.headers,s=void 0===a?{}:a,u=i.schema,c=i.fetch,l=i.shouldThrowOnError;return(0,n.Z)(this,r),(o=t.call(this,{fetch:c,shouldThrowOnError:l})).url=new URL(e),o.headers=Object.assign({},s),o.schema=u,o}return(0,o.Z)(r,[{key:"select",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.head,n=void 0!==r&&r,o=t.count,i=void 0===o?null:o;this.method="GET";var a=!1,s=e.split("").map((function(e){return/\s/.test(e)&&!a?"":('"'===e&&(a=!a),e)})).join("");return this.url.searchParams.set("select",s),i&&(this.headers.Prefer="count=".concat(i)),n&&(this.method="HEAD"),new z(this)}},{key:"insert",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.upsert,n=void 0!==r&&r,o=t.onConflict,i=t.returning,a=void 0===i?"representation":i,s=t.count,u=void 0===s?null:s;this.method="POST";var c=["return=".concat(a)];if(n&&c.push("resolution=merge-duplicates"),n&&void 0!==o&&this.url.searchParams.set("on_conflict",o),this.body=e,u&&c.push("count=".concat(u)),this.headers.Prefer&&c.unshift(this.headers.Prefer),this.headers.Prefer=c.join(","),Array.isArray(e)){var l=e.reduce((function(e,t){return e.concat(Object.keys(t))}),[]);if(l.length>0){var d=(0,L.Z)(new Set(l)).map((function(e){return'"'.concat(e,'"')}));this.url.searchParams.set("columns",d.join(","))}}return new z(this)}},{key:"upsert",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.onConflict,n=t.returning,o=void 0===n?"representation":n,i=t.count,a=void 0===i?null:i,s=t.ignoreDuplicates,u=void 0!==s&&s;this.method="POST";var c=["resolution=".concat(u?"ignore":"merge","-duplicates"),"return=".concat(o)];return void 0!==r&&this.url.searchParams.set("on_conflict",r),this.body=e,a&&c.push("count=".concat(a)),this.headers.Prefer&&c.unshift(this.headers.Prefer),this.headers.Prefer=c.join(","),new z(this)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.returning,n=void 0===r?"representation":r,o=t.count,i=void 0===o?null:o;this.method="PATCH";var a=["return=".concat(n)];return this.body=e,i&&a.push("count=".concat(i)),this.headers.Prefer&&a.unshift(this.headers.Prefer),this.headers.Prefer=a.join(","),new z(this)}},{key:"delete",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.returning,r=void 0===t?"representation":t,n=e.count,o=void 0===n?null:n;this.method="DELETE";var i=["return=".concat(r)];return o&&i.push("count=".concat(o)),this.headers.Prefer&&i.unshift(this.headers.Prefer),this.headers.Prefer=i.join(","),new z(this)}}]),r}(F),K=r(885);function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var V,X=function(e){(0,u.Z)(r,e);var t=J(r);function r(e){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.headers,s=void 0===a?{}:a,u=i.schema,c=i.fetch,l=i.shouldThrowOnError;return(0,n.Z)(this,r),(o=t.call(this,{fetch:c,shouldThrowOnError:l})).url=new URL(e),o.headers=Object.assign({},s),o.schema=u,o}return(0,o.Z)(r,[{key:"rpc",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.head,o=void 0!==n&&n,i=r.count,a=void 0===i?null:i;return o?(this.method="HEAD",e&&Object.entries(e).forEach((function(e){var r=(0,K.Z)(e,2),n=r[0],o=r[1];t.url.searchParams.append(n,o)}))):(this.method="POST",this.body=e),a&&(void 0!==this.headers.Prefer?this.headers.Prefer+=",count=".concat(a):this.headers.Prefer="count=".concat(a)),new z(this)}}]),r}(F),Y={"X-Client-Info":"postgrest-js/".concat("0.37.1")},Q=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.headers,i=void 0===o?{}:o,a=r.schema,s=r.fetch,u=r.throwOnError;(0,n.Z)(this,e),this.url=t,this.headers=Object.assign(Object.assign({},Y),i),this.schema=a,this.fetch=s,this.shouldThrowOnError=u}return(0,o.Z)(e,[{key:"auth",value:function(e){return this.headers.Authorization="Bearer ".concat(e),this}},{key:"from",value:function(e){var t="".concat(this.url,"/").concat(e);return new q(t,{headers:this.headers,schema:this.schema,fetch:this.fetch,shouldThrowOnError:this.shouldThrowOnError})}},{key:"rpc",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.head,o=void 0!==n&&n,i=r.count,a=void 0===i?null:i,s="".concat(this.url,"/rpc/").concat(e);return new X(s,{headers:this.headers,schema:this.schema,fetch:this.fetch,shouldThrowOnError:this.shouldThrowOnError}).rpc(t,{head:o,count:a})}}]),e}();!function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"}(V||(V={}));var ee,te,re,ne,oe=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=null!==(r=n.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce((function(r,n){return r[n]=ie(n,e,t,o),r}),{})},ie=function(e,t,r,n){var o=t.find((function(t){return t.name===e})),i=null==o?void 0:o.type,a=r[e];return i&&!n.includes(i)?ae(i,a):se(a)},ae=function(e,t){if("_"===e.charAt(0)){var r=e.slice(1,e.length);return de(t,r)}switch(e){case V.bool:return ue(t);case V.float4:case V.float8:case V.int2:case V.int4:case V.int8:case V.numeric:case V.oid:return ce(t);case V.json:case V.jsonb:return le(t);case V.timestamp:return he(t);case V.abstime:case V.date:case V.daterange:case V.int4range:case V.int8range:case V.money:case V.reltime:case V.text:case V.time:case V.timestamptz:case V.timetz:case V.tsrange:case V.tstzrange:default:return se(t)}},se=function(e){return e},ue=function(e){switch(e){case"t":return!0;case"f":return!1;default:return e}},ce=function(e){if("string"==typeof e){var t=parseFloat(e);if(!Number.isNaN(t))return t}return e},le=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return console.log("JSON parse error: ".concat(t)),e}return e},de=function(e,t){if("string"!=typeof e)return e;var r=e.length-1,n=e[r];if("{"===e[0]&&"}"===n){var o,i=e.slice(1,r);try{o=JSON.parse("["+i+"]")}catch(a){o=i?i.split(","):[]}return o.map((function(e){return ae(t,e)}))}return e},he=function(e){return"string"==typeof e?e.replace(" ","T"):e},fe={"X-Client-Info":"realtime-js/".concat("1.3.6")},pe=1e4;!function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"}(ee||(ee={})),function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"}(te||(te={})),function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"}(re||(re={})),function(e){e.websocket="websocket"}(ne||(ne={}));var ve=function(){function e(t,r){(0,n.Z)(this,e),this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}return(0,o.Z)(e,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var e=this;clearTimeout(this.timer),this.timer=setTimeout((function(){e.tries=e.tries+1,e.callback()}),this.timerCalc(this.tries+1))}}]),e}(),me=function(){function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pe;(0,n.Z)(this,e),this.channel=t,this.event=r,this.payload=o,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}return(0,o.Z)(e,[{key:"resend",value:function(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}},{key:"send",value:function(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref}))}},{key:"updatePayload",value:function(e){this.payload=Object.assign(Object.assign({},this.payload),e)}},{key:"receive",value:function(e,t){var r;return this._hasReceived(e)&&t(null===(r=this.receivedResp)||void 0===r?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}},{key:"startTimeout",value:function(){var e=this;this.timeoutTimer||(this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(function(t){e._cancelRefEvent(),e._cancelTimeout(),e.receivedResp=t,e._matchReceive(t)})),this.timeoutTimer=setTimeout((function(){e.trigger("timeout",{})}),this.timeout))}},{key:"trigger",value:function(e,t){this.refEvent&&this.channel.trigger(this.refEvent,{status:e,response:t})}},{key:"destroy",value:function(){this._cancelRefEvent(),this._cancelTimeout()}},{key:"_cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"_cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}},{key:"_matchReceive",value:function(e){var t=e.status,r=e.response;this.recHooks.filter((function(e){return e.status===t})).forEach((function(e){return e.callback(r)}))}},{key:"_hasReceived",value:function(e){return this.receivedResp&&this.receivedResp.status===e}}]),e}(),be=function(){function e(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;(0,n.Z)(this,e),this.topic=t,this.params=o,this.socket=i,this.bindings=[],this.state=te.closed,this.joinedOnce=!1,this.pushBuffer=[],this.timeout=this.socket.timeout,this.joinPush=new me(this,re.join,this.params,this.timeout),this.rejoinTimer=new ve((function(){return r.rejoinUntilConnected()}),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(function(){r.state=te.joined,r.rejoinTimer.reset(),r.pushBuffer.forEach((function(e){return e.send()})),r.pushBuffer=[]})),this.onClose((function(){r.rejoinTimer.reset(),r.socket.log("channel","close ".concat(r.topic," ").concat(r.joinRef())),r.state=te.closed,r.socket.remove(r)})),this.onError((function(e){r.isLeaving()||r.isClosed()||(r.socket.log("channel","error ".concat(r.topic),e),r.state=te.errored,r.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(function(){r.isJoining()&&(r.socket.log("channel","timeout ".concat(r.topic),r.joinPush.timeout),r.state=te.errored,r.rejoinTimer.scheduleTimeout())})),this.on(re.reply,(function(e,t){r.trigger(r.replyEventName(t),e)}))}return(0,o.Z)(e,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"subscribe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(e),this.joinPush}},{key:"onClose",value:function(e){this.on(re.close,e)}},{key:"onError",value:function(e){this.on(re.error,(function(t){return e(t)}))}},{key:"on",value:function(e,t){this.bindings.push({event:e,callback:t})}},{key:"off",value:function(e){this.bindings=this.bindings.filter((function(t){return t.event!==e}))}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '".concat(e,"' to '").concat(this.topic,"' before joining. Use channel.subscribe() before pushing events");var n=new me(this,e,t,r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}},{key:"updateJoinPayload",value:function(e){this.joinPush.updatePayload(e)}},{key:"unsubscribe",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=te.leaving;var r=function(){e.socket.log("channel","leave ".concat(e.topic)),e.trigger(re.close,"leave",e.joinRef())};this.joinPush.destroy();var n=new me(this,re.leave,{},t);return n.receive("ok",(function(){return r()})).receive("timeout",(function(){return r()})),n.send(),this.canPush()||n.trigger("ok",{}),n}},{key:"onMessage",value:function(e,t,r){return t}},{key:"isMember",value:function(e){return this.topic===e}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"rejoin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=te.joining,this.joinPush.resend(e))}},{key:"trigger",value:function(e,t,r){var n=re.close,o=re.error,i=re.leave,a=re.join;if(!(r&&[n,o,i,a].indexOf(e)>=0&&r!==this.joinRef())){var s=this.onMessage(e,t,r);if(t&&!s)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter((function(r){return"*"===r.event?e===(null==t?void 0:t.type):r.event===e})).map((function(e){return e.callback(s,r)}))}}},{key:"replyEventName",value:function(e){return"chan_reply_".concat(e)}},{key:"isClosed",value:function(){return this.state===te.closed}},{key:"isErrored",value:function(){return this.state===te.errored}},{key:"isJoined",value:function(){return this.state===te.joined}},{key:"isJoining",value:function(){return this.state===te.joining}},{key:"isLeaving",value:function(){return this.state===te.leaving}}]),e}(),ye=r(9993),ge=function(){function e(){(0,n.Z)(this,e),this.HEADER_LENGTH=1}return(0,o.Z)(e,[{key:"decode",value:function(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t("string"==typeof e?JSON.parse(e):{})}},{key:"_binaryDecode",value:function(e){var t=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}},{key:"_decodeBroadcast",value:function(e,t,r){var n=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=r.decode(e.slice(i,i+n));i+=n;var s=r.decode(e.slice(i,i+o));return i+=o,{ref:null,topic:a,event:s,payload:JSON.parse(r.decode(e.slice(i,e.byteLength)))}}}]),e}(),ke=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},we=function(){},xe=function(){function e(t,r){var o=this;(0,n.Z)(this,e),this.accessToken=null,this.channels=[],this.endPoint="",this.headers=fe,this.params={},this.timeout=pe,this.transport=ye.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.longpollerTimeout=2e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=we,this.conn=null,this.sendBuffer=[],this.serializer=new ge,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.endPoint="".concat(t,"/").concat(ne.websocket),(null==r?void 0:r.params)&&(this.params=r.params),(null==r?void 0:r.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),r.headers)),(null==r?void 0:r.timeout)&&(this.timeout=r.timeout),(null==r?void 0:r.logger)&&(this.logger=r.logger),(null==r?void 0:r.transport)&&(this.transport=r.transport),(null==r?void 0:r.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=r.heartbeatIntervalMs),(null==r?void 0:r.longpollerTimeout)&&(this.longpollerTimeout=r.longpollerTimeout),this.reconnectAfterMs=(null==r?void 0:r.reconnectAfterMs)?r.reconnectAfterMs:function(e){return[1e3,2e3,5e3,1e4][e-1]||1e4},this.encode=(null==r?void 0:r.encode)?r.encode:function(e,t){return t(JSON.stringify(e))},this.decode=(null==r?void 0:r.decode)?r.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new ve((function(){return ke(o,void 0,void 0,a().mark((function e(){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.disconnect();case 2:this.connect();case 3:case"end":return e.stop()}}),e,this)})))}),this.reconnectAfterMs)}return(0,o.Z)(e,[{key:"connect",value:function(){var e=this;this.conn||(this.conn=new this.transport(this.endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=function(){return e._onConnOpen()},this.conn.onerror=function(t){return e._onConnError(t)},this.conn.onmessage=function(t){return e.onConnMessage(t)},this.conn.onclose=function(t){return e._onConnClose(t)}))}},{key:"disconnect",value:function(e,t){var r=this;return new Promise((function(n,o){try{r.conn&&(r.conn.onclose=function(){},e?r.conn.close(e,t||""):r.conn.close(),r.conn=null,r.heartbeatTimer&&clearInterval(r.heartbeatTimer),r.reconnectTimer.reset()),n({error:null,data:!0})}catch(i){n({error:i,data:!1})}}))}},{key:"log",value:function(e,t,r){this.logger(e,t,r)}},{key:"onOpen",value:function(e){this.stateChangeCallbacks.open.push(e)}},{key:"onClose",value:function(e){this.stateChangeCallbacks.close.push(e)}},{key:"onError",value:function(e){this.stateChangeCallbacks.error.push(e)}},{key:"onMessage",value:function(e){this.stateChangeCallbacks.message.push(e)}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case ee.connecting:return"connecting";case ee.open:return"open";case ee.closing:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(e){this.channels=this.channels.filter((function(t){return t.joinRef()!==e.joinRef()}))}},{key:"channel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new be(e,t,this);return this.channels.push(r),r}},{key:"push",value:function(e){var t=this,r=e.topic,n=e.event,o=e.payload,i=e.ref,a=function(){t.encode(e,(function(e){var r;null===(r=t.conn)||void 0===r||r.send(e)}))};this.log("push","".concat(r," ").concat(n," (").concat(i,")"),o),this.isConnected()?a():this.sendBuffer.push(a)}},{key:"onConnMessage",value:function(e){var t=this;this.decode(e.data,(function(e){var r=e.topic,n=e.event,o=e.payload,i=e.ref;(i&&i===t.pendingHeartbeatRef||n===(null==o?void 0:o.type))&&(t.pendingHeartbeatRef=null),t.log("receive","".concat(o.status||""," ").concat(r," ").concat(n," ").concat(i&&"("+i+")"||""),o),t.channels.filter((function(e){return e.isMember(r)})).forEach((function(e){return e.trigger(n,o,i)})),t.stateChangeCallbacks.message.forEach((function(t){return t(e)}))}))}},{key:"endPointURL",value:function(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}},{key:"makeRef",value:function(){var e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}},{key:"setAuth",value:function(e){this.accessToken=e;try{this.channels.forEach((function(t){e&&t.updateJoinPayload({user_token:e}),t.joinedOnce&&t.isJoined()&&t.push(re.access_token,{access_token:e})}))}catch(t){console.log("setAuth error",t)}}},{key:"leaveOpenTopic",value:function(e){var t=this.channels.find((function(t){return t.topic===e&&(t.isJoined()||t.isJoining())}));t&&(this.log("transport",'leaving duplicate topic "'.concat(e,'"')),t.unsubscribe())}},{key:"_onConnOpen",value:function(){var e=this;this.log("transport","connected to ".concat(this.endPointURL())),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((function(){return e._sendHeartbeat()}),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach((function(e){return e()}))}},{key:"_onConnClose",value:function(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((function(t){return t(e)}))}},{key:"_onConnError",value:function(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach((function(t){return t(e)}))}},{key:"_triggerChanError",value:function(){this.channels.forEach((function(e){return e.trigger(re.error)}))}},{key:"_appendParams",value:function(e,t){if(0===Object.keys(t).length)return e;var r=e.match(/\?/)?"&":"?",n=new URLSearchParams(t);return"".concat(e).concat(r).concat(n)}},{key:"_flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((function(e){return e()})),this.sendBuffer=[])}},{key:"_sendHeartbeat",value:function(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void(null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout"));this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}}]),e}(),Ee=function(){function e(t,r,o,i){(0,n.Z)(this,e);var a={},s="*"===i?"realtime:".concat(o):"realtime:".concat(o,":").concat(i),u=r.Authorization.split(" ")[1];u&&(a.user_token=u),this.subscription=t.channel(s,a)}return(0,o.Z)(e,[{key:"getPayloadRecords",value:function(e){var t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=oe(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=oe(e.columns,e.old_record)),t}},{key:"on",value:function(e,t){var r=this;return this.subscription.on(e,(function(e){var n={schema:e.schema,table:e.table,commit_timestamp:e.commit_timestamp,eventType:e.type,new:{},old:{},errors:e.errors};n=Object.assign(Object.assign({},n),r.getPayloadRecords(e)),t(n)})),this}},{key:"subscribe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};return this.subscription.onError((function(t){return e("SUBSCRIPTION_ERROR",t)})),this.subscription.onClose((function(){return e("CLOSED")})),this.subscription.subscribe().receive("ok",(function(){return e("SUBSCRIBED")})).receive("error",(function(t){return e("SUBSCRIPTION_ERROR",t)})).receive("timeout",(function(){return e("RETRYING_AFTER_TIMEOUT")})),this.subscription}}]),e}();function _e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var Te=function(e){(0,u.Z)(r,e);var t=_e(r);function r(e,o){var i,a=o.headers,s=void 0===a?{}:a,u=o.schema,c=o.realtime,l=o.table,d=o.fetch,h=o.shouldThrowOnError;return(0,n.Z)(this,r),(i=t.call(this,e,{headers:s,schema:u,fetch:d,shouldThrowOnError:h}))._subscription=null,i._realtime=c,i._headers=s,i._schema=u,i._table=l,i}return(0,o.Z)(r,[{key:"on",value:function(e,t){return this._realtime.isConnected()||this._realtime.connect(),this._subscription||(this._subscription=new Ee(this._realtime,this._headers,this._schema,this._table)),this._subscription.on(e,t)}}]),r}(q),Se=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Oe=function(e){return e.msg||e.message||e.error_description||e.error||JSON.stringify(e)},Ce=function(e,t){if("function"!=typeof e.json)return t(e);e.json().then((function(r){return t({message:Oe(r),status:(null==e?void 0:e.status)||500})}))},Re=function(e,t,r,n){var o={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?o:(o.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),o.body=JSON.stringify(n),Object.assign(Object.assign({},o),r))};function Ze(e,t,r,n,o,i){return Se(this,void 0,void 0,a().mark((function s(){return a().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",new Promise((function(a,s){e(r,Re(t,n,o,i)).then((function(e){if(!e.ok)throw e;return(null==n?void 0:n.noResolveJson)?a(e):e.json()})).then((function(e){return a(e)})).catch((function(e){return Ce(e,s)}))})));case 1:case"end":return a.stop()}}),s)})))}function Pe(e,t,r,n){return Se(this,void 0,void 0,a().mark((function o(){return a().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Ze(e,"GET",t,r,n));case 1:case"end":return o.stop()}}),o)})))}function Ne(e,t,r,n,o){return Se(this,void 0,void 0,a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Ze(e,"POST",t,n,o,r));case 1:case"end":return i.stop()}}),i)})))}function Ie(e,t,r,n,o){return Se(this,void 0,void 0,a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Ze(e,"PUT",t,n,o,r));case 1:case"end":return i.stop()}}),i)})))}function Ae(e,t,r,n,o){return Se(this,void 0,void 0,a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Ze(e,"DELETE",t,n,o,r));case 1:case"end":return i.stop()}}),i)})))}var je=function(e){var t;return t=e||("undefined"==typeof fetch?O():fetch),function(){return t.apply(void 0,arguments)}},De=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Me={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ue={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Le=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;(0,n.Z)(this,e),this.url=t,this.headers=r,this.bucketId=o,this.fetch=je(i)}return(0,o.Z)(e,[{key:"uploadOrUpdate",value:function(e,t,r,n){return De(this,void 0,void 0,a().mark((function o(){var i,s,u,c,l,d,h;return a().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,s=Object.assign(Object.assign({},Ue),n),u=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(s.upsert)}),"undefined"!=typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",s.cacheControl),i.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(i=r).append("cacheControl",s.cacheControl):(i=r,u["cache-control"]="max-age=".concat(s.cacheControl),u["content-type"]=s.contentType),c=this._removeEmptyFolders(t),l=this._getFinalPath(c),o.next=8,this.fetch("".concat(this.url,"/object/").concat(l),{method:e,body:i,headers:u});case 8:if(!(d=o.sent).ok){o.next=13;break}return o.abrupt("return",{data:{Key:l},error:null});case 13:return o.next=15,d.json();case 15:return h=o.sent,o.abrupt("return",{data:null,error:h});case 17:o.next=22;break;case 19:return o.prev=19,o.t0=o.catch(0),o.abrupt("return",{data:null,error:o.t0});case 22:case"end":return o.stop()}}),o,this,[[0,19]])})))}},{key:"upload",value:function(e,t,r){return De(this,void 0,void 0,a().mark((function n(){return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.uploadOrUpdate("POST",e,t,r));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"update",value:function(e,t,r){return De(this,void 0,void 0,a().mark((function n(){return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.uploadOrUpdate("PUT",e,t,r));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"move",value:function(e,t){return De(this,void 0,void 0,a().mark((function r(){var n;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Ne(this.fetch,"".concat(this.url,"/object/move"),{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});case 3:return n=r.sent,r.abrupt("return",{data:n,error:null});case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 10:case"end":return r.stop()}}),r,this,[[0,7]])})))}},{key:"copy",value:function(e,t){return De(this,void 0,void 0,a().mark((function r(){var n;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Ne(this.fetch,"".concat(this.url,"/object/copy"),{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});case 3:return n=r.sent,r.abrupt("return",{data:n,error:null});case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 10:case"end":return r.stop()}}),r,this,[[0,7]])})))}},{key:"createSignedUrl",value:function(e,t){return De(this,void 0,void 0,a().mark((function r(){var n,o,i;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=this._getFinalPath(e),r.next=4,Ne(this.fetch,"".concat(this.url,"/object/sign/").concat(n),{expiresIn:t},{headers:this.headers});case 4:return o=r.sent,i="".concat(this.url).concat(o.signedURL),o={signedURL:i},r.abrupt("return",{data:o,error:null,signedURL:i});case 10:return r.prev=10,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0,signedURL:null});case 13:case"end":return r.stop()}}),r,this,[[0,10]])})))}},{key:"createSignedUrls",value:function(e,t){return De(this,void 0,void 0,a().mark((function r(){var n,o=this;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Ne(this.fetch,"".concat(this.url,"/object/sign/").concat(this.bucketId),{expiresIn:t,paths:e},{headers:this.headers});case 3:return n=r.sent,r.abrupt("return",{data:n.map((function(e){return Object.assign(Object.assign({},e),{signedURL:e.signedURL?"".concat(o.url).concat(e.signedURL):null})})),error:null});case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 10:case"end":return r.stop()}}),r,this,[[0,7]])})))}},{key:"download",value:function(e){return De(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=this._getFinalPath(e),t.next=4,Pe(this.fetch,"".concat(this.url,"/object/").concat(r),{headers:this.headers,noResolveJson:!0});case 4:return n=t.sent,t.next=7,n.blob();case 7:return o=t.sent,t.abrupt("return",{data:o,error:null});case 11:return t.prev=11,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 14:case"end":return t.stop()}}),t,this,[[0,11]])})))}},{key:"getPublicUrl",value:function(e){try{var t=this._getFinalPath(e),r="".concat(this.url,"/object/public/").concat(t);return{data:{publicURL:r},error:null,publicURL:r}}catch(n){return{data:null,error:n,publicURL:null}}}},{key:"remove",value:function(e){return De(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Ae(this.fetch,"".concat(this.url,"/object/").concat(this.bucketId),{prefixes:e},{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"list",value:function(e,t,r){return De(this,void 0,void 0,a().mark((function n(){var o,i;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,o=Object.assign(Object.assign(Object.assign({},Me),t),{prefix:e||""}),n.next=4,Ne(this.fetch,"".concat(this.url,"/object/list/").concat(this.bucketId),o,{headers:this.headers},r);case 4:return i=n.sent,n.abrupt("return",{data:i,error:null});case 8:return n.prev=8,n.t0=n.catch(0),n.abrupt("return",{data:null,error:n.t0});case 11:case"end":return n.stop()}}),n,this,[[0,8]])})))}},{key:"_getFinalPath",value:function(e){return"".concat(this.bucketId,"/").concat(e)}},{key:"_removeEmptyFolders",value:function(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}}]),e}(),Be={"X-Client-Info":"storage-js/".concat("0.0.0")},Fe=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},He=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;(0,n.Z)(this,e),this.url=t,this.headers=Object.assign(Object.assign({},Be),r),this.fetch=je(o)}return(0,o.Z)(e,[{key:"listBuckets",value:function(){return Fe(this,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Pe(this.fetch,"".concat(this.url,"/bucket"),{headers:this.headers});case 3:return t=e.sent,e.abrupt("return",{data:t,error:null});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{data:null,error:e.t0});case 10:case"end":return e.stop()}}),e,this,[[0,7]])})))}},{key:"getBucket",value:function(e){return Fe(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Pe(this.fetch,"".concat(this.url,"/bucket/").concat(e),{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"createBucket",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{public:!1};return Fe(this,void 0,void 0,a().mark((function r(){var n;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Ne(this.fetch,"".concat(this.url,"/bucket"),{id:e,name:e,public:t.public},{headers:this.headers});case 3:return n=r.sent,r.abrupt("return",{data:n.name,error:null});case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 10:case"end":return r.stop()}}),r,this,[[0,7]])})))}},{key:"updateBucket",value:function(e,t){return Fe(this,void 0,void 0,a().mark((function r(){var n;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,Ie(this.fetch,"".concat(this.url,"/bucket/").concat(e),{id:e,name:e,public:t.public},{headers:this.headers});case 3:return n=r.sent,r.abrupt("return",{data:n,error:null});case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",{data:null,error:r.t0});case 10:case"end":return r.stop()}}),r,this,[[0,7]])})))}},{key:"emptyBucket",value:function(e){return Fe(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Ne(this.fetch,"".concat(this.url,"/bucket/").concat(e,"/empty"),{},{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"deleteBucket",value:function(e){return Fe(this,void 0,void 0,a().mark((function t(){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Ae(this.fetch,"".concat(this.url,"/bucket/").concat(e),{},{headers:this.headers});case 3:return r=t.sent,t.abrupt("return",{data:r,error:null});case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",{data:null,error:t.t0});case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}}]),e}();function We(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=(0,l.Z)(e);if(t){var o=(0,l.Z)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,c.Z)(this,r)}}var Ge,ze=function(e){(0,u.Z)(r,e);var t=We(r);function r(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return(0,n.Z)(this,r),t.call(this,e,o,i)}return(0,o.Z)(r,[{key:"from",value:function(e){return new Le(this.url,this.headers,e,this.fetch)}}]),r}(He),$e=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(t){i(t)}}function s(e){try{u(n.throw(e))}catch(t){i(t)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},qe={schema:"public",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,multiTab:!0,headers:s},Ke=function(){function e(t,r,o){if((0,n.Z)(this,e),this.supabaseUrl=t,this.supabaseKey=r,!t)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");var i=t.replace(/\/$/,""),a=Object.assign(Object.assign({},qe),o);this.restUrl="".concat(i,"/rest/v1"),this.realtimeUrl="".concat(i,"/realtime/v1").replace("http","ws"),this.authUrl="".concat(i,"/auth/v1"),this.storageUrl="".concat(i,"/storage/v1"),this.schema=a.schema,this.multiTab=a.multiTab,this.fetch=a.fetch,this.headers=Object.assign(Object.assign({},s),null==o?void 0:o.headers),this.shouldThrowOnError=a.shouldThrowOnError||!1,this.auth=this._initSupabaseAuthClient(a),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},a.realtime)),this._listenForAuthEvents(),this._listenForMultiTabEvents()}return(0,o.Z)(e,[{key:"storage",get:function(){return new ze(this.storageUrl,this._getAuthHeaders(),this.fetch)}},{key:"from",value:function(e){var t="".concat(this.restUrl,"/").concat(e);return new Te(t,{headers:this._getAuthHeaders(),schema:this.schema,realtime:this.realtime,table:e,fetch:this.fetch,shouldThrowOnError:this.shouldThrowOnError})}},{key:"rpc",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.head,o=void 0!==n&&n,i=r.count,a=void 0===i?null:i,s=this._initPostgRESTClient();return s.rpc(e,t,{head:o,count:a})}},{key:"removeAllSubscriptions",value:function(){return $e(this,void 0,void 0,a().mark((function e(){var t,r,n,o=this;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getSubscriptions().slice(),r=t.map((function(e){return o.removeSubscription(e)})),e.next=4,Promise.all(r);case 4:return n=e.sent,e.abrupt("return",n.map((function(e,r){var n=e.error;return{data:{subscription:t[r]},error:n}})));case 6:case"end":return e.stop()}}),e,this)})))}},{key:"removeSubscription",value:function(e){return $e(this,void 0,void 0,a().mark((function t(){var r,n,o,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._closeSubscription(e);case 2:if(r=t.sent,n=r.error,o=this.getSubscriptions(),i=o.filter((function(e){return e.isJoined()})).length,0!==o.length){t.next=9;break}return t.next=9,this.realtime.disconnect();case 9:return t.abrupt("return",{data:{openSubscriptions:i},error:n});case 10:case"end":return t.stop()}}),t,this)})))}},{key:"_closeSubscription",value:function(e){return $e(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null,e.isClosed()){t.next=7;break}return t.next=4,this._unsubscribeSubscription(e);case 4:n=t.sent,o=n.error,r=o;case 7:return this.realtime.remove(e),t.abrupt("return",{error:r});case 9:case"end":return t.stop()}}),t,this)})))}},{key:"_unsubscribeSubscription",value:function(e){return new Promise((function(t){e.unsubscribe().receive("ok",(function(){return t({error:null})})).receive("error",(function(e){return t({error:e})})).receive("timeout",(function(){return t({error:new Error("timed out")})}))}))}},{key:"getSubscriptions",value:function(){return this.realtime.channels}},{key:"_initSupabaseAuthClient",value:function(e){var t=e.autoRefreshToken,r=e.persistSession,n=e.detectSessionInUrl,o=e.localStorage,i=e.headers,a=e.fetch,s={Authorization:"Bearer ".concat(this.supabaseKey),apikey:"".concat(this.supabaseKey)};return new U({url:this.authUrl,headers:Object.assign(Object.assign({},i),s),autoRefreshToken:t,persistSession:r,detectSessionInUrl:n,localStorage:o,fetch:a})}},{key:"_initRealtimeClient",value:function(e){return new xe(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign(Object.assign({},null==e?void 0:e.params),{apikey:this.supabaseKey})}))}},{key:"_initPostgRESTClient",value:function(){return new Q(this.restUrl,{headers:this._getAuthHeaders(),schema:this.schema,fetch:this.fetch,throwOnError:this.shouldThrowOnError})}},{key:"_getAuthHeaders",value:function(){var e,t,r=this.headers,n=null!==(t=null===(e=this.auth.session())||void 0===e?void 0:e.access_token)&&void 0!==t?t:this.supabaseKey;return r.apikey=this.supabaseKey,r.Authorization="Bearer ".concat(n),r}},{key:"_listenForMultiTabEvents",value:function(){var e=this;if(!this.multiTab||"undefined"==typeof window||!(null===window||void 0===window?void 0:window.addEventListener))return null;try{return null===window||void 0===window?void 0:window.addEventListener("storage",(function(t){var r,n,o;if("supabase.auth.token"===t.key){var i=JSON.parse(String(t.newValue)),a=null!==(n=null===(r=null==i?void 0:i.currentSession)||void 0===r?void 0:r.access_token)&&void 0!==n?n:void 0,s=null===(o=e.auth.session())||void 0===o?void 0:o.access_token;a?!s&&a?e._handleTokenChanged("SIGNED_IN",a,"STORAGE"):s!==a&&e._handleTokenChanged("TOKEN_REFRESHED",a,"STORAGE"):e._handleTokenChanged("SIGNED_OUT",a,"STORAGE")}}))}catch(t){return console.error("_listenForMultiTabEvents",t),null}}},{key:"_listenForAuthEvents",value:function(){var e=this;return this.auth.onAuthStateChange((function(t,r){e._handleTokenChanged(t,null==r?void 0:r.access_token,"CLIENT")})).data}},{key:"_handleTokenChanged",value:function(e,t,r){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===t?"SIGNED_OUT"!==e&&"USER_DELETED"!==e||(this.realtime.setAuth(this.supabaseKey),"STORAGE"==r&&this.auth.signOut()):(this.realtime.setAuth(t),"STORAGE"==r&&this.auth.setAuth(t),this.changedAccessToken=t)}}]),e}(),Je=new Ke("https://umloapbkkhtmwzfxiwkm.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYzNTgzNjEyNSwiZXhwIjoxOTUxNDEyMTI1fQ.80yZlPnTxEooRvzTYS4vdti2O3hULH5GXKXpRIcfLs4",Ge)},976:function(e,t,r){"use strict";function n(e,t){if("number"==typeof t)return{email:"",password:"",alert:void 0};switch(0|t.TAG){case 0:return{email:t._0,password:e.password,alert:e.alert};case 1:return{email:e.email,password:t._0,alert:e.alert};case 2:return{email:e.email,password:e.password,alert:t._0}}}function o(e,t){if("number"==typeof t)return{email:"",password:"",secondPassword:"",alert:void 0,success:void 0};switch(0|t.TAG){case 0:return{email:t._0,password:e.password,secondPassword:e.secondPassword,alert:e.alert,success:e.success};case 1:return{email:e.email,password:t._0,secondPassword:e.secondPassword,alert:e.alert,success:e.success};case 2:return{email:e.email,password:e.password,secondPassword:t._0,alert:e.alert,success:e.success};case 3:return{email:e.email,password:e.password,secondPassword:e.secondPassword,alert:t._0,success:e.success};case 4:return{email:"",password:"",secondPassword:"",alert:void 0,success:t._0}}}function i(e,t){if("number"==typeof t)return{email:"",alert:void 0,success:void 0};switch(0|t.TAG){case 0:return{email:t._0,alert:e.alert,success:e.success};case 1:return{email:e.email,alert:t._0,success:e.success};case 2:return{email:"",alert:void 0,success:t._0}}}function a(e){return new RegExp("(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{8,})").test(e)}function s(e,t){return t.startsWith(e)}r.d(t,{t:function(){return n},hC:function(){return o},HN:function(){return i},hG:function(){return a},tf:function(){return s}})},5666:function(e){var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(P){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof m?t:m,i=Object.create(o.prototype),a=new C(n||[]);return i._invoke=function(e,t,r){var n=d;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return Z()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=T(a,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(P){return{type:"throw",arg:P}}}e.wrap=c;var d="suspendedStart",h="suspendedYield",f="executing",p="completed",v={};function m(){}function b(){}function y(){}var g={};u(g,i,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(R([])));w&&w!==r&&n.call(w,i)&&(g=w);var x=y.prototype=m.prototype=Object.create(g);function E(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function r(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function T(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function R(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:Z}}function Z(){return{value:t,done:!0}}return b.prototype=y,u(x,"constructor",y),u(y,"constructor",b),b.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,u(e,s,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},E(_.prototype),u(_.prototype,a,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(x),u(x,s,"Generator"),u(x,i,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=R,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(r){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},1120:function(e,t,r){"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},136:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(9611);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,n.Z)(e,t)}},2963:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1002),o=r(7326);function i(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}},9794:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=602994b4473d45b072c5d082f44c290a3cd4dee2-86d09df05bfc10551dae.js.map