"use strict";(self.webpackChunkCustomerApp=self.webpackChunkCustomerApp||[]).push([[8399,5030],{41143:e=>{e.exports=function(e,r,t,o,n,s,i,a){if(!e){var u;if(void 0===r)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[t,o,n,s,i,a],l=0;(u=new Error(r.replace(/%s/g,(function(){return d[l++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},18399:(e,r,t)=>{t.r(r),t.d(r,{DEFAULT_TIMEOUT_ANDROID:()=>y,DEFAULT_TIMEOUT_IOS:()=>m,SECOND_IN_MS:()=>g,authorize:()=>w,logout:()=>P,prefetchConfiguration:()=>C,refresh:()=>S,register:()=>A,revoke:()=>k});var o=t(41143),n=t.n(o),s=t(59113);let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";const a=function(e){var r,t,o,n,s,a="",u="",d="",l=0;do{o=(r=e.charCodeAt(l++))>>2,n=(3&r)<<4|(t=e.charCodeAt(l++))>>4,s=(15&t)<<2|(u=e.charCodeAt(l++))>>6,d=63&u,isNaN(t)?s=d=64:isNaN(u)&&(d=64),a=a+i.charAt(o)+i.charAt(n)+i.charAt(s)+i.charAt(d),r=t=u="",o=n=s=d=""}while(l<e.length);return a},{RNAppAuth:u}=s.NativeModules,d=(e,r)=>n()("string"==typeof e||r&&"string"==typeof r.authorizationEndpoint&&"string"==typeof r.tokenEndpoint,"Config error: you must provide either an issuer or a service endpoints"),l=e=>n()("string"==typeof e,"Config error: clientId must be a string"),c=e=>n()("string"==typeof e,"Config error: redirectUrl must be a string"),p=e=>{if(!e)return;const r="Config error: customHeaders type must be { token?: { [key: string]: string }, authorize?: { [key: string]: string }, register: { [key: string]: string }}",t=["token","authorize","register"],o=Object.keys(e),s=o.filter((e=>t.includes(e)));n()(o.length<=t.length&&s.length>0&&s.length===o.length,r),Object.values(e).forEach((e=>{n()("object"==typeof e,r),n()(0===Object.values(e).filter((e=>"string"!=typeof e)).length,r)}))},f=e=>{if(!e)return;const r="Config error: additionalHeaders must be { [key: string]: string }";n()("object"==typeof e,r),n()(0===Object.values(e).filter((e=>"string"!=typeof e)).length,r)},h=e=>{e&&n()("number"==typeof e,"Config error: connectionTimeoutSeconds must be a number")},g=1e3,m=60,y=15,v=(e,r=("ios"===s.Platform.OS?m:y))=>"android"===e?r*g:r,C=async({warmAndPrefetchChrome:e=!1,issuer:r,redirectUrl:t,clientId:o,scopes:n,serviceConfiguration:i,dangerouslyAllowInsecureHttpRequests:a=!1,customHeaders:f,connectionTimeoutSeconds:g})=>{if("android"===s.Platform.OS){d(r,i),l(o),c(t),p(f),h(g);const m=[e,r,t,o,n,i,a,f,v(s.Platform.OS,g)];u.prefetchConfiguration(...m)}},A=({issuer:e,redirectUrls:r,responseTypes:t,grantTypes:o,subjectType:i,tokenEndpointAuthMethod:a,additionalParameters:d,serviceConfiguration:l,dangerouslyAllowInsecureHttpRequests:c=!1,customHeaders:g,additionalHeaders:m,connectionTimeoutSeconds:y})=>{((e,r)=>{n()("string"==typeof e||r&&"string"==typeof r.registrationEndpoint,"Config error: you must provide either an issuer or a registration endpoint")})(e,l),p(g),f(m),h(y),n()(Array.isArray(r)&&r.every((e=>"string"==typeof e)),"Config error: redirectUrls must be an Array of strings"),n()(null==t||Array.isArray(t)&&t.every((e=>"string"==typeof e)),"Config error: if provided, responseTypes must be an Array of strings"),n()(null==o||Array.isArray(o)&&o.every((e=>"string"==typeof e)),"Config error: if provided, grantTypes must be an Array of strings"),n()(null==i||"string"==typeof i,"Config error: if provided, subjectType must be a string"),n()(null==a||"string"==typeof a,"Config error: if provided, tokenEndpointAuthMethod must be a string");const C=[e,r,t,o,i,a,d,l,v(s.Platform.OS,y)];return"android"===s.Platform.OS&&(C.push(c),C.push(g)),"ios"===s.Platform.OS&&C.push(m),u.register(...C)},w=({issuer:e,redirectUrl:r,clientId:t,clientSecret:o,scopes:n,useNonce:i=!0,usePKCE:a=!0,additionalParameters:g,serviceConfiguration:m,clientAuthMethod:y="basic",dangerouslyAllowInsecureHttpRequests:C=!1,customHeaders:A,additionalHeaders:w,skipCodeExchange:S=!1,iosCustomBrowser:k=null,androidAllowCustomBrowsers:P=null,androidTrustedWebActivity:b=!1,connectionTimeoutSeconds:T,iosPrefersEphemeralSession:O=!1})=>{d(e,m),l(t),c(r),p(A),f(w),h(T);const E=[e,r,t,o,n,g,m,S,v(s.Platform.OS,T)];return"android"===s.Platform.OS&&(E.push(i),E.push(a),E.push(y),E.push(C),E.push(A),E.push(P),E.push(b)),"ios"===s.Platform.OS&&(E.push(w),E.push(i),E.push(a),E.push(k),E.push(O)),u.authorize(...E)},S=({issuer:e,redirectUrl:r,clientId:t,clientSecret:o,scopes:i,additionalParameters:a={},serviceConfiguration:g,clientAuthMethod:m="basic",dangerouslyAllowInsecureHttpRequests:y=!1,customHeaders:C,additionalHeaders:A,iosCustomBrowser:w=null,androidAllowCustomBrowsers:S=null,connectionTimeoutSeconds:k},{refreshToken:P})=>{d(e,g),l(t),c(r),p(C),f(A),h(k),n()(P,"Please pass in a refresh token");const b=[e,r,t,o,P,i,a,g,v(s.Platform.OS,k)];return"android"===s.Platform.OS&&(b.push(m),b.push(y),b.push(C),b.push(S)),"ios"===s.Platform.OS&&(b.push(A),b.push(w)),u.refresh(...b)},k=async({clientId:e,issuer:r,serviceConfiguration:t,clientSecret:o},{tokenToRevoke:s,sendClientId:i=!1,includeBasicAuth:u=!1})=>{let d;if(n()(s,"Please include the token to revoke"),l(e),((e,r)=>{n()("string"==typeof e||r&&"string"==typeof r.revocationEndpoint,"Config error: you must provide either an issuer or a revocation endpoint")})(r,t),t&&t.revocationEndpoint)d=t.revocationEndpoint;else{const e=await fetch(`${r}/.well-known/openid-configuration`),t=await e.json();n()(t.revocation_endpoint,"The openid config does not specify a revocation endpoint"),d=t.revocation_endpoint}const c={"Content-Type":"application/x-www-form-urlencoded"};return u&&(c.Authorization=`Basic ${a(`${e}:${o}`)}`),await fetch(d,{method:"POST",headers:c,body:`token=${s}${i?`&client_id=${e}`:""}`}).catch((e=>{throw new Error("Failed to revoke token",e)}))},P=({issuer:e,serviceConfiguration:r,additionalParameters:t,dangerouslyAllowInsecureHttpRequests:o=!1,iosCustomBrowser:i=null,iosPrefersEphemeralSession:a=!1,androidAllowCustomBrowsers:d=null},{idToken:l,postLogoutRedirectUrl:p})=>{((e,r)=>{n()("string"==typeof e||r&&"string"==typeof r.endSessionEndpoint,"Config error: you must provide either an issuer or an end session endpoint")})(e,r),c(p),n()(l,"Please pass in the ID token");const f=[e,l,p,r,t];return"android"===s.Platform.OS&&(f.push(o),f.push(d)),"ios"===s.Platform.OS&&(f.push(i),f.push(a)),u.logout(...f)}}}]);