1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[53917],{53917:function(e,t,i){"use strict";i.d(t,{Y:function(){return f}});var r,n,o=i(85893),s=i(67294),a=i(84545),l=i(94680),c=i(75767);let d=(e,t,i)=>e.split(t).join(i),u=(e,t)=>[t].flat().flatMap(e=>[e,d(e," ","+")]).includes(e);var h=i(89371),p=i.n(h);(r=n||(n={})).UserRegisteredAndLinked="USER_REGISTERED_AND_LINKED",r.UserRegisteredButNotLinked="USER_REGISTERED_BUT_NOT_LINKED",r.Unauthorized="UNAUTHORIZED";let f=e=>{let{error:t,operation:i,onForgotPasswordClick:r}=e,{t:n}=(0,a.$G)(),{message:d,name:h}=t,[f,y]=(0,s.useState)(!1),g=(0,s.useMemo)(()=>{if(u(h,"NotAuthorizedException"))return(0,o.jsx)(a.cC,{i18nKey:"error.signin.not-authorized",t:n});if(u(d,"TreedomAuthError user already signed in"))return(0,o.jsx)(a.cC,{i18nKey:"error.signin.email-already-exists",t:n});if(u(d,"User does not exist"))return(0,o.jsx)(a.cC,{i18nKey:"error.signin.user-does-not-exist",t:n});if(u(d,"Username/client id combination not found"))return(0,o.jsx)(a.cC,{i18nKey:"error.forgotPassword.emailRecovery",t:n});if(u(d,["there is already an account with this email","An account with the given email already exists."]))return(0,o.jsx)(a.cC,{i18nKey:"error.signin.email-already-exists",t:n});if(u(d,"PreSignUp failed with error An account with the given email already exists.."))return(0,o.jsx)(a.cC,{i18nKey:"error.signup.email-already-exists",t:n});if(u(d,"Attempt limit exceeded, please try after some time."))return(0,o.jsx)(a.cC,{i18nKey:"error.forgotPasswordConfirm.retry-limit-exceeded",t:n});if(u(d,"Password reset required for the user"))return(0,o.jsxs)(a.cC,{i18nKey:"error.signin.reset-password-required",t:n,children:["A reset password is required to use this account. You have received an email with the instructions to reset your password.",(0,o.jsx)("br",{}),"If you didnt received any email check in the spam or"," ",(0,o.jsx)(l.z,{variant:"text",style:{padding:0,fontSize:"inherit"},onClick:r,children:"try again"}),"."]});if(u(d,"Invalid code provided, please request a code again."))return(0,o.jsx)(a.cC,{i18nKey:"ResetPassword.error.expiredCode",t:n});if(t instanceof c.MS){let e=t.body;if("signIn"===i&&"USER_REGISTERED_BUT_NOT_LINKED"===e.errorCode)return(0,o.jsx)(a.cC,{i18nKey:"error.signin.email-already-exists",t:n});if("signUp"===i&&("USER_REGISTERED_AND_LINKED"===e.errorCode||"USER_REGISTERED_BUT_NOT_LINKED"===e.errorCode))return(0,o.jsx)(a.cC,{i18nKey:"error.signup.email-already-exists",t:n});if("UNAUTHORIZED"===e.errorCode)return(0,o.jsx)(a.cC,{i18nKey:"error.signin.not-authorized",t:n})}return(0,o.jsx)(a.cC,{i18nKey:"error.generic",t:n})},[t,d,h,r,i,n]);return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{children:g}),(0,o.jsx)("button",{type:"button",className:p().button,onClick:()=>y(e=>!e),children:f?(0,o.jsx)(a.cC,{i18nKey:"error.collapse",t:n}):(0,o.jsx)(a.cC,{i18nKey:"error.expand",t:n})}),f&&(0,o.jsx)("div",{className:p().expandedError,children:d})]})}},75767:function(e,t,i){"use strict";i.d(t,{MS:function(){return s},gv:function(){return w},rG:function(){return N},Az:function(){return A},QT:function(){return U},nS:function(){return j},G4:function(){return C}});var r=i(23268);class n{eject(e){let t=this._fns.indexOf(e);-1!==t&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(e){this._fns=[...this._fns,e]}constructor(){this._fns=[]}}let o={BASE:"",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,TOKEN:void 0,USERNAME:void 0,VERSION:"2.0.0",WITH_CREDENTIALS:!1,interceptors:{request:new n,response:new n}};class s extends Error{constructor(e,t,i){super(i),this.name="ApiError",this.url=t.url,this.status=t.status,this.statusText=t.statusText,this.body=t.body,this.request=e}}class a extends Error{get isCancelled(){return!0}constructor(e){super(e),this.name="CancelError"}}class l{get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}cancel(){if(!this._isResolved&&!this._isRejected&&!this._isCancelled){if(this._isCancelled=!0,this.cancelHandlers.length)try{for(let e of this.cancelHandlers)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.cancelHandlers.length=0,this._reject&&this._reject(new a("Request aborted"))}}get isCancelled(){return this._isCancelled}constructor(e){this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((t,i)=>{this._resolve=t,this._reject=i;let r=e=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(e)};return Object.defineProperty(r,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(r,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(r,"isCancelled",{get:()=>this._isCancelled}),e(e=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(e))},e=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(e))},r)})}}var c=i(48764).lW;let d=e=>"string"==typeof e,u=e=>d(e)&&""!==e,h=e=>e instanceof Blob,p=e=>e instanceof FormData,f=e=>{try{return btoa(e)}catch(t){return c.from(e).toString("base64")}},y=e=>{let t=[],i=(e,i)=>{t.push("".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(String(i))))},r=(e,t)=>{null!=t&&(t instanceof Date?i(e,t.toISOString()):Array.isArray(t)?t.forEach(t=>r(e,t)):"object"==typeof t?Object.entries(t).forEach(t=>{let[i,n]=t;return r("".concat(e,"[").concat(i,"]"),n)}):i(e,t))};
1return Object.entries(e).forEach(e=>{let[t,i]=e;return r(t,i)}),t.length?"?".concat(t.join("&")):""},g=(e,t)=>{let i=e.ENCODE_PATH||encodeURI,r=t.url.replace("{api-version}",e.VERSION).replace(/{(.*?)}/g,(e,r)=>{var n;return(null===(n=t.path)||void 0===n?void 0:n.hasOwnProperty(r))?i(String(t.path[r])):e}),n=e.BASE+r;return t.query?n+y(t.query):n},E=e=>{if(e.formData){let t=new FormData,i=(e,i)=>{d(i)||h(i)?t.append(e,i):t.append(e,JSON.stringify(i))};return Object.entries(e.formData).filter(e=>{let[,t]=e;return null!=t}).forEach(e=>{let[t,r]=e;Array.isArray(r)?r.forEach(e=>i(t,e)):i(t,r)}),t}},m=async(e,t)=>"function"==typeof t?t(e):t,v=async(e,t)=>{let[i,r,n,o]=await Promise.all([m(t,e.TOKEN),m(t,e.USERNAME),m(t,e.PASSWORD),m(t,e.HEADERS)]),s=Object.entries({Accept:"application/json",...o,...t.headers}).filter(e=>{let[,t]=e;return null!=t}).reduce((e,t)=>{let[i,r]=t;return{...e,[i]:String(r)}},{});if(u(i)&&(s.Authorization="Bearer ".concat(i)),u(r)&&u(n)){let e=f("".concat(r,":").concat(n));s.Authorization="Basic ".concat(e)}return void 0===t.body||(t.mediaType?s["Content-Type"]=t.mediaType:h(t.body)?s["Content-Type"]=t.body.type||"application/octet-stream":d(t.body)?s["Content-Type"]="text/plain":p(t.body)||(s["Content-Type"]="application/json")),new Headers(s)},R=e=>{if(void 0!==e.body){var t,i;return(null===(t=e.mediaType)||void 0===t?void 0:t.includes("application/json"))||(null===(i=e.mediaType)||void 0===i?void 0:i.includes("+json"))?JSON.stringify(e.body):d(e.body)||h(e.body)||p(e.body)?e.body:JSON.stringify(e.body)}},_=async(e,t,i,r,n,o,s)=>{let a=new AbortController,l={headers:o,body:null!=r?r:n,method:t.method,signal:a.signal};for(let t of(e.WITH_CREDENTIALS&&(l.credentials=e.CREDENTIALS),e.interceptors.request._fns))l=await t(l);return s(()=>a.abort()),await fetch(i,l)},S=(e,t)=>{if(t){let i=e.headers.get(t);if(d(i))return i}},T=async e=>{if(204!==e.status)try{let t=e.headers.get("Content-Type");if(t){if(t.includes("application/json")||t.includes("+json"))return await e.json();if(["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"].some(e=>t.includes(e)))return await e.blob();if(t.includes("multipart/form-data"))return await e.formData();if(t.includes("text/"))return await e.text()}}catch(e){console.error(e)}},b=(e,t)=>{let i={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required",...e.errors}[t.status];if(i)throw new s(e,t,i);if(!t.ok){var r,n;let i=null!==(r=t.status)&&void 0!==r?r:"unknown",o=null!==(n=t.statusText)&&void 0!==n?n:"unknown",a=(()=>{try{return JSON.stringify(t.body,null,2)}catch(e){return}})();throw new s(e,t,"Generic Error: status: ".concat(i,"; status text: ").concat(o,"; body: ").concat(a))}},x=(e,t)=>new l(async(i,r,n)=>{try{let r=g(e,t),o=E(t),s=R(t),a=await v(e,t);if(!n.isCancelled){let l=await _(e,t,r,s,o,a,n);for(let t of e.interceptors.response._fns)l=await t(l);let c=await T(l),d=S(l,t.responseHeader),u={url:r,ok:l.ok,status:l.status,statusText:l.statusText,body:null!=d?d:c};b(t,u),i(u.body)}}catch(e){r(e)}}),j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x(o,{method:"POST",url:"/v2/google/signin",body:e.requestBody,mediaType:"application/json",errors:{401:"Failed to verify social credentials",409:"SignUp has failed due to a conflict with an existing user"}})},C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x(o,{method:"POST",url:"/v2/google/signup",body:e.requestBody,mediaType:"application/json",errors:{401:"Failed to verify social credentials",409:"SignUp has failed due to a conflict with an existing user"}})},w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x(o,{method:"POST",url:"/v2/apple/signin",body:e.requestBody,mediaType:"application/json",errors:{401:"Failed to verify social credentials",409:"SignUp has failed due to a conflict with an existing user"}})},N=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x(o,{method:"POST",url:"/v2/apple/signup",body:e.requestBody,mediaType:"application/json",errors:{401:"Failed to verify social credentials",409:"SignUp has failed due to a conflict with an existing user"}})},A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x(o,{method:"POST",url:"/v2/facebook/signin",body:e.requestBody,mediaType:"application/json",errors:{401:"Failed to verify social credentials",409:"SignUp has failed due to a conflict with an existing user"}})},U=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return x(o,{method:"POST",url:"/v2/facebook/signup",body:e.requestBody,mediaType:"application/json",errors:{401:"Failed to verify social credentials",409:"SignUp has failed due to a conflict with an existing user"}})};o.BASE=r.appConfig.auth.treedomSidUrl},89371:function(e){e.exports={button:"DK99lY",expandedError:"ZMI4PL"}}}]); 2//# sourceMappingURL=53917-130f863bc556ef82.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.