!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i,r=t();for(i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,function(){return i={1722:function(e){e.exports=function(){"use strict";var c=1e3,u=6e4,h=36e5,l="millisecond",f="second",m="minute",p="hour",g="day",_="week",v="month",$="quarter",b="year",y="date",S="Invalid Date",n=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,P=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,e={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},a=function(e,t,i){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(i)+e},t={s:a,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),r=Math.floor(i/60),o=i%60;return(t<=0?"+":"-")+a(r,2,"0")+":"+a(o,2,"0")},m:function e(t,i){if(t.date(){"use strict";i.r(t),i.d(t,{FirebaseAuth:()=>a});var o=i(7058),s=i(3282),n=i(3637),t=i(6671),r=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(s<3?o(n):3 `;let i=n.dy`

`,r=n.dy`

`;return e&&(i=n.dy`
${o.GL.auth.signInWith||"Sign in with"}
${t} `,r=n.dy`
${o.GL.auth.signUpWith||"Sign up with"}
${t} `),this.defaultLoginForm?n.dy` `:n.dy` `}};r([(0,t.Cb)()],a.prototype,"redirect",void 0),r([(0,t.Cb)()],a.prototype,"emailConfirmation",void 0),r([(0,t.Cb)()],a.prototype,"skipDefaultEmail",void 0),r([(0,t.Cb)()],a.prototype,"isSignIn",void 0),r([(0,t.Cb)()],a.prototype,"forgotPasswordLink",void 0),a=r([(0,t.Mo)("firebase-auth")],a)},18:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FirebaseForgotPassword:()=>a});var r=i(7058),o=i(3282),s=i(3637),t=i(6671),i=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(s<3?o(n):3

`}};i([(0,t.Cb)()],a.prototype,"buttonText",void 0),i([(0,t.Cb)()],a.prototype,"errorMessage",void 0),i([(0,t.Cb)()],a.prototype,"skipDefaultEmail",void 0),a=i([(0,t.Mo)("firebase-forgot-password")],a)},2697:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FirebaseLogin:()=>o});var a=i(7058),l=i(3282),d=i(269),r=i(3637),t=i(6671),i=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(s<3?o(n):3 `,this.showPasswordIcon=` `,this.defaultPasswordIcon=this.showPasswordIcon}createRenderRoot(){return this}handleForgotPassword(e){e.preventDefault(),(0,l.xb)(this.forgotPasswordLink)?this.isLoginForm=!this.isLoginForm:location.href=this.forgotPasswordLink}togglePassword(){var e=document.getElementById("firebase-login__password");"password"===e.type?(this.defaultPasswordIcon=this.hidePasswordIcon,e.type="text"):(this.defaultPasswordIcon=this.showPasswordIcon,e.type="password"),this.requestUpdate()}send2FARequest(t,i,r,o){return n(this,void 0,void 0,function*(){let e=`log=${t}&wfls-email-verification=&pwd=${i}&redirect_to=${this.siteUrl}/wp-admin&testcookie=1&action=wordfence_ls_authenticate`;return r&&o&&(e+=`&wfls-token-jwt=${o}&wfls-token=`+r),fetch(this.siteUrl+"/wp-admin/admin-ajax.php",{headers:{accept:"application/json, text/javascript, */*; q=0.01","accept-language":"en-US,en;q=0.9","cache-control":"no-cache","content-type":"application/x-www-form-urlencoded; charset=UTF-8",pragma:"no-cache","sec-ch-ua":'" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"',"sec-ch-ua-mobile":"?0","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-requested-with":"XMLHttpRequest"},referrer:this.siteUrl,referrerPolicy:"strict-origin-when-cross-origin",body:e,method:"POST",mode:"cors",credentials:"include"})})}is2FARequired(i,r){return n(this,void 0,void 0,function*(){try{const t=yield this.send2FARequest(i,r);var e=yield t.json();return e.two_factor_required||e.login&&e.jwt}catch(e){return console.error(e.message),!1}})}handleNormalLogin(i,r,o,s){const n=!!(0,l.Lm)("debug");firebase.auth().signInWithEmailAndPassword(i.email,i.password).then(()=>{const e=firebase.auth().currentUser;var t;window.localStorage.setItem(d.m.FirebaseUID,e.uid),r&&!1===e.emailVerified?(n&&console.log("[Firebase] - Resend email verification?"),confirm(a.GL.auth.resendVerificationEmail||"Your email address is not verified. Would you like to resend verification email?")&&(o?(0,l.PZ)(e):e.sendEmailVerification()),(0,l.$A)()()):c&&c.loginWithFirebase?(n&&console.log("[Firebase] - Login with to WordPress is active..."),t=(0,l.Ke)(e,i.password),-1{window.onLoginErrorCallback&&window.onLoginErrorCallback(e),this.errorMessage=a.GL.auth[e.code]||e.message})}_handleSubmit(s){return n(this,void 0,void 0,function*(){s.preventDefault();const e=jQuery("form#firebase-login");var t=(0,l.PY)(e.serializeArray());let i=(0,l.Lm)("redirect_url")||e.data("redirect");var r=!!e.data("send-email-confirmation"),o=!!e.data("skip-default-email");(this.errorMessage="")!==t.email&&""!==t.password?(c.isWordfenceActive&&(yield this.is2FARequired(t.email,t.password))&&((0,l.bJ)(t.email,t.password),i=`${this.siteUrl}/wp-login.php?debug=true&secret=${a.bP.firebaseWordPress.firebaseLoginKey}&redirect_to=${this.siteUrl}/wp-admin`),this.handleNormalLogin(t,r,o,i)):this.errorMessage=a.GL.auth.emailPasswordMissing})}render(){return this.isLoginForm?r.dy`

`:r.dy` `}};i([(0,t.Cb)()],o.prototype,"redirect",void 0),i([(0,t.Cb)()],o.prototype,"emailConfirmation",void 0),i([(0,t.Cb)()],o.prototype,"skipDefaultEmail",void 0),i([(0,t.Cb)()],o.prototype,"buttonText",void 0),i([(0,t.Cb)()],o.prototype,"errorMessage",void 0),i([(0,t.Cb)()],o.prototype,"infoMessage",void 0),i([(0,t.Cb)()],o.prototype,"siteUrl",void 0),i([(0,t.Cb)()],o.prototype,"isLoginForm",void 0),i([(0,t.Cb)()],o.prototype,"forgotPasswordLink",void 0),o=i([(0,t.Mo)("firebase-login")],o)},5608:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FirebaseRegister:()=>o});var n=i(7058),a=i(3282),r=i(3637),t=i(6671),i=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(s<3?o(n):3{(0,a.Gx)();let t=firebase.auth().currentUser;o&&(s?((0,a.bb)(t),this.infoMessage=n.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address."):t.sendEmailVerification().then(()=>{this.infoMessage=n.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address.",console.log("[Firebase] - Confirmation email is sent!")}).catch(e=>{this.errorMessage=n.GL.auth[e.code]||e.message})),t.updateProfile({displayName:(i.firstName+" "+(i.lastName||"")).trim(),phoneNumber:i.phoneNumber}).then(()=>{var e;o?setTimeout(()=>{(0,a.$A)()},3e3):l&&l.loginWithFirebase?(e=(0,a.Ke)(Object.assign(Object.assign({},t._delegate||t),{firstName:i.firstName,lastName:i.lastName,phoneNumber:t.phoneNumber||i.phoneNumber}),i.password),(0,a.mL)(e,r)):(0,a.xb)(r)||(console.log("[Firebase] - Redirect to",r),location.href=r)}).catch(e=>{console.error("[Firebase] - Cannot update user profile..."),this.errorMessage=n.GL.auth[e.code]||e.message})}).catch(e=>{console.error("[Firebase] - Cannot create user with email: "+i.email),this.errorMessage=n.GL.auth[e.code]||e.message}),(0,a.Gx)()}else this.errorMessage=n.GL.auth.invalidForm}render(){var e;return r.dy`

${this.errorMessage}

${this.infoMessage}

`}};i([(0,t.Cb)()],o.prototype,"redirect",void 0),i([(0,t.Cb)()],o.prototype,"emailConfirmation",void 0),i([(0,t.Cb)()],o.prototype,"skipDefaultEmail",void 0),i([(0,t.Cb)()],o.prototype,"errorMessage",void 0),i([(0,t.Cb)()],o.prototype,"infoMessage",void 0),o=i([(0,t.Mo)("firebase-register")],o)},8045:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FirebaseCommonDivider:()=>o});var r=i(3637),t=i(6671),i=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(s<3?o(n):3${this.text} `}};i([(0,t.Cb)()],o.prototype,"text",void 0),o=i([(0,t.Mo)("firebase-common-divider")],o)},4945:(c,e,t)=>{"use strict";t.r(e),t.d(e,{FirestorePagination:()=>d});var i,r=t(3402),o=t(3637),e=t(6671),s=t(8315); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6}; /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class a extends class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}{constructor(e){if(super(e),this.it=s.Ld,e.type!==n.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===s.Ld||null==e)return this._t=void 0,this.it=e;if(e===s.Jb)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;const t=[this.it=e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}a.directiveName="unsafeHTML",a.resultType=1;i=a;const u=(...e)=>({_$litDirective$:i,values:e});var t=function(e,t,i,r){var o,s=arguments.length,n=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(s<3?o(n):3super.connectedCallback}});return l(this,void 0,void 0,function*(){this._vm.transformedOrderBy=(0,r.v)(this.orderBy),this._vm.transformedImages=this.images.split(","),e.connectedCallback.call(this),yield this.retrieveFirestoreData(),this.requestUpdate()})}retrieveFirestoreData(){return l(this,void 0,void 0,function*(){if(null!=this.collectionName)try{const i=firebase.firestore();this._vm.collectionRef=i.collection(this.collectionName);let e=this._vm.collectionRef.limit(this.limit);null!=this._vm.transformedOrderBy&&(e=e.orderBy(this._vm.transformedOrderBy[0],this._vm.transformedOrderBy[1]));var t=yield e.get();null!=t&&t.docs.length&&(this._vm.showPagination=this.pagination),this.displayContent(t),this._vm.disablePreviousBtn=!1,this._vm.originalPreviousVisibleDoc=t.docs[0],this.assignPaginationSteps(t)}catch(e){console.error(e)}else console.warn("[firebase] - please add collection name to [firestore_blocks] shortcode.")})}displayContent(e){this._vm.content="",e.forEach(e=>{this._vm.content+=(0,r.M)(e.data(),e.id,this.displayFields,this._vm.transformedImages,this.childPage,this.childPageTargetField)}),this.requestUpdate()}handlePreviousAction(){return l(this,void 0,void 0,function*(){let e=this._vm.collectionRef;null!=this._vm.transformedOrderBy&&(e=e.orderBy(this._vm.transformedOrderBy[0],this._vm.transformedOrderBy[1]));var t=yield e.endBefore(this._vm.previousVisibleDoc).limitToLast(this.limit).get();this.displayContent(t),this.assignPaginationSteps(t)})}handleNextAction(){return l(this,void 0,void 0,function*(){let e=this._vm.collectionRef;null!=this._vm.transformedOrderBy&&(e=e.orderBy(this._vm.transformedOrderBy[0],this._vm.transformedOrderBy[1]));var t=yield e.startAfter(this._vm.lastVisibleDoc).limit(this.limit).get();this.displayContent(t),this.assignPaginationSteps(t)})}assignPaginationSteps(e){this._vm.lastVisibleDoc=e.docs[e.docs.length-1],null==this._vm.lastVisibleDoc?this._vm.disableNextBtn=!0:(this._vm.previousVisibleDoc=e.docs[0],this._vm.disableNextBtn=!1),null==this._vm.previousVisibleDoc||this._vm.previousVisibleDoc.id===this._vm.originalPreviousVisibleDoc.id?this._vm.disablePreviousBtn=!0:this._vm.disablePreviousBtn=!1}render(){let e=o.dy``;return this._vm.showPagination&&(e=o.dy`
`),o.dy` ${u(this._vm.content)} ${e} `}};t([(0,e.Cb)()],d.prototype,"classes",void 0),t([(0,e.Cb)()],d.prototype,"collectionName",void 0),t([(0,e.Cb)()],d.prototype,"images",void 0),t([(0,e.Cb)()],d.prototype,"displayFields",void 0),t([(0,e.Cb)()],d.prototype,"orderBy",void 0),t([(0,e.Cb)()],d.prototype,"limit",void 0),t([(0,e.Cb)()],d.prototype,"childPage",void 0),t([(0,e.Cb)()],d.prototype,"childPageTargetField",void 0),t([(0,e.Cb)({type:Boolean})],d.prototype,"pagination",void 0),t([(0,e.SB)()],d.prototype,"_vm",void 0),d=t([(0,e.Mo)("firestore-pagination")],d)},8536:(e,t,i)=>{"use strict";i.d(t,{b:()=>r,O:()=>o});const r={firebaseOptions:{apiKey:null===(i=window.firebaseOptions)||void 0===i?void 0:i.apiKey,authDomain:null===(t=window.firebaseOptions)||void 0===t?void 0:t.authDomain,databaseURL:null===(i=window.firebaseOptions)||void 0===i?void 0:i.databaseURL,storageBucket:null===(t=window.firebaseOptions)||void 0===t?void 0:t.storageBucket,appId:null===(i=window.firebaseOptions)||void 0===i?void 0:i.appId,measurementId:null===(t=window.firebaseOptions)||void 0===t?void 0:t.measurementId,projectId:null===(i=window.firebaseOptions)||void 0===i?void 0:i.projectId,services:null===(t=window.firebaseOptions)||void 0===t?void 0:t.services,language:null===(i=window.firebaseOptions)||void 0===i?void 0:i.language,messagingSenderId:null===(t=window.firebaseOptions)||void 0===t?void 0:t.messagingSenderId,reCaptchaSiteKey:null===(i=window.firebaseOptions)||void 0===i?void 0:i.reCaptchaSiteKey,proScript:null===(t=window.firebaseOptions)||void 0===t?void 0:t.proScript},firebaseSettings:{apiToken:null===(i=window.firebaseSettings)||void 0===i?void 0:i.frontendApiToken,baseDomain:null===(t=window.firebaseSettings)||void 0===t?void 0:t.baseDomain,proVersion:null===(i=window.firebaseSettings)||void 0===i?void 0:i.proVersion},authSettings:{loginWithFirebase:null===(t=window.authSettings)||void 0===t?void 0:t.loginWithFirebase,loginUrl:null===(i=window.authSettings)||void 0===i?void 0:i.loginUrl,authPages:null===(t=window.authSettings)||void 0===t?void 0:t.authPages,signinWithEmailLink:null===(i=window.authSettings)||void 0===i?void 0:i.signinWithEmailLink,googleClientId:null===(t=window.authSettings)||void 0===t?void 0:t.googleClientId,signInSuccessUrl:null===(i=window.authSettings)||void 0===i?void 0:i.signInSuccessUrl,signInOptions:null===(t=window.authSettings)||void 0===t?void 0:t.signInOptions,tosUrl:null===(i=window.authSettings)||void 0===i?void 0:i.tosUrl,privacyPolicyUrl:null===(t=window.authSettings)||void 0===t?void 0:t.privacyPolicyUrl,isWordfenceActive:null===(i=window.authSettings)||void 0===i?void 0:i.isWordfenceActive},firebaseWordPress:{siteUrl:null===(t=window.firebaseWordpress)||void 0===t?void 0:t.siteUrl,firebaseLoginKey:null===(i=window.firebaseWordpress)||void 0===i?void 0:i.firebaseLoginKey,userCollectionName:null===(t=window.firebaseWordpress)||void 0===t?void 0:t.userCollectionName,firebaseDatabaseType:null===(i=window.firebaseWordpress)||void 0===i?void 0:i.firebaseDatabaseType,isUserLoggedIn:null===(t=window.firebaseWordpress)||void 0===t?void 0:t.isUserLoggedIn,wpLogoutLink:null===(i=window.firebaseWordpress)||void 0===i?void 0:i.wpLogoutLink,ajaxUrl:null===(t=window.firebaseWordpress)||void 0===t?void 0:t.ajaxUrl},firebaseMessages:{publicKey:null===(i=window.firebaseMessages)||void 0===i?void 0:i.publicKey},firebaseExperiments:{allowUpdatingEmail:null===(t=window.firebaseExperiments)||void 0===t?void 0:t.allowUpdatingEmail},firebaseWoocommerce:{createNewUserAtCheckout:null===(i=window.firebaseWoocommerce)||void 0===i?void 0:i.createNewUserAtCheckout}},o={firebaseSettings:{apiToken:null===(t=window.firebaseSettings)||void 0===t?void 0:t.dashboardApiToken,baseDomain:null===(i=window.firebaseSettings)||void 0===i?void 0:i.baseDomain},proVersion:null===(t=window.firebaseSettings)||void 0===t?void 0:t.proVersion,plugin:{endpoint:"https://techcater.com"}}},7058:(e,t,i)=>{"use strict";i.d(t,{OY:()=>r.O,bP:()=>r.b,GL:()=>o.G});var r=i(8536),o=i(2575)},2575:(e,t,i)=>{"use strict";i.d(t,{G:()=>r});const r=window.firebaseTranslations},9129:(c,e,t)=>{"use strict";t.d(e,{XY:()=>s,i4:()=>n,$A:()=>d,Ke:()=>u,mL:()=>h,$c:()=>f,lg:()=>m,rc:()=>p,bJ:()=>g,LF:()=>v,bb:()=>b,uC:()=>y,PZ:()=>w,V:()=>_,ck:()=>$});var r=t(7058),a=t(3282),i=t(269),o=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};const s=()=>{const{authPages:e=[]}=r.bP.authSettings;return null==e||0===e.length||e.some(e=>location.pathname===e)};const n=()=>!!r.bP.firebaseWordPress.isUserLoggedIn||document.body.classList.contains("logged-in"),l=e=>{firebase.auth().signOut().then(()=>{e&&console.error(e)})};const d=()=>firebase.auth().signOut().then(()=>(0,a.fL)(location.href,{email_verification_sent:"true"})),u=(e,t=null,i=[])=>{let r=["email","userId","firstName","lastName","displayName","photoURL","phoneNumber","role","claims","customClaims"];0e.providerId))||[]),o},h=(e,i=null,t="wordpress")=>{(0,a.VO)(),jQuery.ajax({url:r.bP.firebaseWordPress.siteUrl+"/wp-json/firebase/v2/users/register-autologin",type:"POST",contentType:"application/json",headers:{"firebase-login-key":r.bP.firebaseWordPress.firebaseLoginKey,"auth-source":t},dataType:"json",data:JSON.stringify({user:e}),success:function(e){200===e.code?null!=i?location.href=i:r.bP.authSettings.signInSuccessUrl?location.href=r.bP.authSettings.signInSuccessUrl:location.reload():((0,a.S6)("[Firebase] Error -> "+e.message),l("[Firebase] Error -> User logged out...")),(0,a.Gx)()},error:function(e){var t;console.error(e),200===e.code?null!=i?location.href=i:r.bP.authSettings.signInSuccessUrl?location.href=r.bP.authSettings.signInSuccessUrl:location.reload():(l("[Firebase] Error -> User logged out..."),e&&e.message?(0,a.S6)("[Firebase] - "+e.message):e&&null!==(t=e.responseJSON)&&void 0!==t&&t.message?(0,a.S6)("[Firebase] - "+e.responseJSON.message):(0,a.S6)("[Firebase] Authentication Error")),(0,a.Gx)()}})};const f=e=>e.additionalUserInfo.isNewUser&&"password"===e.additionalUserInfo.providerId&&!0!==e.user.emailVerified,m=e=>!e.additionalUserInfo.isNewUser&&"password"===e.additionalUserInfo.providerId&&!0!==e.user.emailVerified,p=()=>{var e;return(null===(e=firebase.auth().currentUser)||void 0===e?void 0:e.uid)||window.localStorage.getItem(i.m.FirebaseUID)},g=(e,t)=>{e=JSON.stringify({email:e,password:t}),t=(0,a.HI)(e,r.bP.firebaseWordPress.firebaseLoginKey);window.localStorage.setItem(i.m.FirebaseUserCredentials,t),window.localStorage.setItem(i.m.FirebaseLoginToken,r.bP.firebaseWordPress.firebaseLoginKey)},v=(e=r.bP.firebaseWordPress.firebaseLoginKey)=>{var t=window.localStorage.getItem(i.m.FirebaseUserCredentials),t=e&&(0,a.pe)(t,e);return JSON.parse(t||"{}")},b=e=>{window.skipRegistrationDefaultEmailCallback&&(console.log("[Firebase] - running skipRegistrationDefaultEmail"),window.skipRegistrationDefaultEmailCallback(e))},y=e=>{window.skipForgotPasswordDefaultEmailCallback&&(console.log("[Firebase] - running skipForgotPasswordDefaultEmail"),window.skipForgotPasswordDefaultEmailCallback(e))},w=e=>{window.skipLoginDefaultEmailCallback&&(console.log("[Firebase] - running skipLoginDefaultEmail"),window.skipLoginDefaultEmailCallback(e))},_=e=>{var t;return(null===(t=null==e?void 0:e.user)||void 0===t?void 0:t._delegate)||(null==e?void 0:e.user)||(null===(t=firebase.auth().currentUser)||void 0===t?void 0:t._delegate)||firebase.auth().currentUser},$=()=>o(void 0,void 0,void 0,function*(){return new Promise(t=>{jQuery.ajax({url:""+r.bP.firebaseWordPress.ajaxUrl,type:"GET",data:{action:"check_user_logged_in"},success:function(e){t(0{"use strict";i.d(t,{f:()=>o});var r=i(3282);const o=(e="")=>{(0,r.xb)(e)?jQuery("#firebase-error").hide():(console.error(e),jQuery("#firebase-error").show(),jQuery("#firebase-error").text(e))}},3402:(e,t,i)=>{"use strict";i.d(t,{v:()=>r,M:()=>o});var c=i(5538);const r=e=>{if("string"!=typeof e)return null;if(e.includes("|")){const t=e.split("|");return[t[0].trim(),t[1].trim().toLowerCase()]}return[e,"desc"]},o=(e,i,t,r,o=void 0,s=void 0)=>{t=t.split(",");let n="";if(n+=`
`,0";for(const l of r){var a=(0,c.Q5)(e,l);(0,c.xb)(a)||"string"!=typeof a||(n+=``)}n+="
"}for(const d of t){let t=(0,c.Q5)(e,d);if("id"===d&&(0,c.xb)(t)&&(t=i),!(0,c.xb)(t)){t="object"!=typeof t?t:JSON.stringify(t);let e=(0,c.Z6)(t);(0,c.xb)(o)||(0,c.xb)(s)||s===d&&(e=`${e}`),n+=`
${e}
`}}return n+="",n}},1571:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});var r=i(7058),o=i(4473),s=i(5538);const n=e=>{if((0,s.xb)(e))return(0,o.f)(r.GL.utils.invalidForm),null;{const t={};for(const i of e)t[i.name]=i.value;return t}}},3282:(e,t,i)=>{"use strict";i.d(t,{LF:()=>r.LF,bJ:()=>r.bJ,Ke:()=>r.Ke,V:()=>r.V,XY:()=>r.XY,lg:()=>r.lg,$c:()=>r.$c,i4:()=>r.i4,ck:()=>r.ck,mL:()=>r.mL,uC:()=>r.uC,PZ:()=>r.PZ,bb:()=>r.bb,$A:()=>r.$A,S6:()=>o.f,PY:()=>s.P,pe:()=>n.p,HI:()=>n.H,zx:()=>a.zx,Gx:()=>a.Gx,VO:()=>a.VO,__:()=>l.__,gw:()=>l.gw,Q5:()=>l.Q5,Lm:()=>l.Lm,xb:()=>l.xb,fL:()=>l.fL,xq:()=>l.xq,Z6:()=>l.Z6,nN:()=>l.nN,_v:()=>l._v,xI:()=>l.xI});var r=i(9129),o=i(4473),s=i(1571),n=i(8524),a=i(8794),l=i(5538)},8524:(e,t,i)=>{"use strict";i.d(t,{H:()=>r,p:()=>o});const r=(e,t)=>{const i=e=>e.split("").map(e=>e.charCodeAt(0));return e.split("").map(i).map(e=>i(t).reduce((e,t)=>e^t,e)).map(e=>("0"+Number(e).toString(16)).slice(-2)).join("")},o=(e,t)=>{return null==e?void 0:e.match(/.{1,2}/g).map(e=>parseInt(e,16)).map(e=>(e=>e.split("").map(e=>e.charCodeAt(0)))(t).reduce((e,t)=>e^t,e)).map(e=>String.fromCharCode(e)).join("")}},8794:(e,t,i)=>{"use strict";i.d(t,{zx:()=>r,Gx:()=>o,VO:()=>s});const r=()=>{jQuery("body").append('
')},o=()=>{jQuery("#firebase-loader").fadeOut("slow")},s=()=>{jQuery("#firebase-loader").fadeIn("slow")}},5538:(c,e,t)=>{"use strict";t.d(e,{xI:()=>o,xb:()=>u,Lm:()=>h,gw:()=>l,nN:()=>d,xq:()=>f,_v:()=>m,fL:()=>p,Q5:()=>g,Z6:()=>v,__:()=>b});var s,e=t(1722),n=t.n(e),i=t(7058),r=t(9129),a=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};(e=s=s||{}).String="string",e.Number="number",e.Boolean="boolean",e.Undefined="undefined",e.Object="object";const o=(r,o=10)=>a(void 0,void 0,void 0,function*(){return new Promise(e=>{let t=0;const i=setInterval(function(){jQuery(r).length?(clearInterval(i),e(!0)):!jQuery(r).length&&t>o?(clearInterval(i),e(!1)):t++},1e3)})});const u=e=>null==e||e.hasOwnProperty("length")&&0===e.length||e.constructor===Object&&0===Object.keys(e).length,h=e=>{const t=new URLSearchParams(window.location.search);return t.get(e)};(()=>{const e=[]})();(()=>{let e=[]})();const l=t=>new Promise(e=>setTimeout(e,t)),d=(t=1)=>{try{firebase.auth().currentUser.sendEmailVerification().then(()=>{alert(i.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address.")})}catch(e){console.error((null==e?void 0:e.message)||e),t<2&&l(1e3*t).then(()=>{console.log("[Firebase] - email verify retry",t++),d(t++)})}},f=e=>{var t=(0,r.rc)();return-1===(null==e?void 0:e.indexOf("getFirebaseUid"))||null==t?e:e.replace("getFirebaseUid",t)},m=(t=3e3)=>a(void 0,void 0,void 0,function*(){return new Promise(e=>setTimeout(e,t))}),p=(e=location.href,t)=>{var i;if("undefined"!=typeof window)try{const s=new URL(e);if(t){var r=Object.keys(t);for(let e=0;et.split(".").reduce((e,t)=>e[t.trim()],e),v=e=>{let t=e;switch(typeof e){case s.String:t=t.replace(/)<[^<]*)*<\/script>/gim,"");var i=/\r\n|\n|\r/gim;if(t=t.replace(i,"
").trim(),t.includes("seconds")&&t.includes("nanoseconds")){i=JSON.parse(t);const r=n().unix(i.seconds);return r.format("MMM DD, YYYY")}return t;case s.Object:if("toDate"in e){i=t;const o=n().unix(i.seconds);return o.format("MMM DD, YYYY")}return t;case s.Undefined:return"";default:return t}},b=e=>{const t=e.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase(),i=t.split("_"),r=i.map(e=>e.charAt(0).toUpperCase()+e.slice(1));return r.join(" ")}},269:(e,t,i)=>{"use strict";i.d(t,{m:()=>r.m});var r=i(2438)},2438:(e,t,i)=>{"use strict";var r;i.d(t,{m:()=>r}),(i=r=r||{}).FirebaseUserCredentials="FIREBASE_USER_CREDENTIALS",i.FirebaseLoginToken="FIREBASE_LOGIN_TOKEN",i.FirebaseUID="FIREBASE_UID"},8315:(e,t,i)=>{"use strict";i.d(t,{dy:()=>A,Jb:()=>m,Ld:()=>p,sY:()=>T});const r=window,c=r.trustedTypes,o=c?c.createPolicy("lit-html",{createHTML:e=>e}):void 0,h=`lit$${(Math.random()+"").slice(9)}$`,b="?"+h,y=`<${b}>`,l=document,u=(e="")=>l.createComment(e),d=e=>null===e||"object"!=typeof e&&"function"!=typeof e,s=Array.isArray,n=e=>s(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,$=/>/g,f=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),S=/'/g,P=/"/g,x=/^(?:script|style|textarea|title)$/i,a=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),A=a(1),m=(a(2),Symbol.for("lit-noChange")),p=Symbol.for("lit-nothing"),L=new WeakMap,g=l.createTreeWalker(l,129,null,!1),C=(s,e)=>{const n=s.length-1,a=[];let l,d=2===e?"":"",c=w;for(let o=0;o"===t[0]?(c=null!=l?l:w,i=-1):void 0===t[1]?i=-2:(i=c.lastIndex-t[2].length,e=t[1],c=void 0===t[3]?f:'"'===t[3]?P:S):c===P||c===S?c=f:c===_||c===$?c=w:(c=f,l=void 0);var u=c===f&&s[o+1].startsWith("/>")?" ":"";d+=c===w?n+y:0<=i?(a.push(e),n.slice(0,i)+"$lit$"+n.slice(i)+h+u):n+h+(-2===i?(a.push(void 0),o):u)}e=d+(s[n]||"")+(2===e?"":"");if(!Array.isArray(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==o?o.createHTML(e):e,a]};class E{constructor({strings:t,_$litType$:i},e){let r,o=(this.parts=[],0),s=0;const n=t.length-1,a=this.parts,[l,d]=C(t,i);if(this.el=E.createElement(l,e),g.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(r=g.nextNode())&&a.length{var r;const o=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:t;let s=o._$litPart$;if(void 0===s){const e=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=s=new I(t.insertBefore(u(),e),e,void 0,null!=i?i:{})}return s._$AI(e),s})},6671:(e,t,i)=>{"use strict";i.d(t,{Mo:()=>r,Cb:()=>s,SB:()=> /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function(e){return s({...e,state:!0})}}); /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const r=r=>e=>{var t,i;return"function"==typeof e?(e=>(customElements.define(r,e),e))(e):(t=r,{kind:e,elements:i}=e,{kind:e,elements:i,finisher(e){customElements.define(t,e)}})},o=(t,i)=>"method"!==i.kind||!i.descriptor||"value"in i.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(e){e.createProperty(i.key,t)}}:{...i,finisher(e){e.createProperty(i.key,t)}};function s(i){return(e,t)=>void 0!==t?void e.constructor.createProperty(t,i):o(i,e)}null===(i=window.HTMLSlotElement)||void 0===i||i.prototype.assignedElements},3637:(c,e,t)=>{"use strict";t.d(e,{oi:()=>d,iv:()=>f,dy:()=>y.dy}); /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const o=window,i=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),u=new WeakMap;class h{constructor(e,t,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;var t=this.t;if(i&&void 0===e){const i=void 0!==t&&1===t.length;i&&(e=u.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&u.set(t,e))}return e}toString(){return this.cssText}}const f=(r,...e)=>{e=1===r.length?r[0]:e.reduce((e,t,i)=>e+(()=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})()+r[i+1],r[0]);return new h(e,r,s)},m=i?e=>e:t=>{if(!(t instanceof CSSStyleSheet))return t;{let e="";for(const i of t.cssRules)e+=i.cssText;return t=e,new h("string"==typeof t?t:t+"",void 0,s)}};const r=window,p=r.trustedTypes,g=p?p.emptyScript:"",v=r.reactiveElementPolyfillSupport,n={toAttribute(e,t){switch(t){case Boolean:e=e?g:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},b=(e,t)=>t!==e&&(t==t||e==e),a={attribute:!0,type:String,converter:n,reflect:!1,hasChanged:b};class l extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const i=[];return this.elementProperties.forEach((e,t)=>{e=this._$Ep(t,e);void 0!==e&&(this._$Ev.set(e,t),i.push(e))}),i}static createProperty(e,t=a){var i;t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e)||(i="symbol"==typeof e?Symbol():"__"+e,void 0!==(i=this.getPropertyDescriptor(e,i,t))&&Object.defineProperty(this.prototype,e,i))}static getPropertyDescriptor(i,r,o){return{get(){return this[r]},set(e){var t=this[i];this[r]=e,this.requestUpdate(i,t,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||a}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const e=this.properties,t=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(const i of t)this.createProperty(i,e[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){var i=new Set(e.flat(1/0).reverse());for(const e of i)t.unshift(m(e))}else void 0!==e&&t.push(m(e));return t}static _$Ep(e,t){t=t.attribute;return!1===t?void 0:"string"==typeof t?t:"string"==typeof e?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach(e=>e(this))}addController(e){var t;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(t=e.hostConnected)||void 0===t||t.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var r,e,t=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return r=t,e=this.constructor.elementStyles,i?r.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):e.forEach(e=>{const t=document.createElement("style"),i=o.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=e.cssText,r.appendChild(t)}),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EO(e,t,i=a){var r,o=this.constructor._$Ep(e,i);void 0!==o&&!0===i.reflect&&(r=(void 0!==(null===(r=i.converter)||void 0===r?void 0:r.toAttribute)?i.converter:n).toAttribute(t,i.type),this._$El=e,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null)}_$AK(e,t){var i;const r=this.constructor,o=r._$Ev.get(e);if(void 0!==o&&this._$El!==o){const e=r.getPropertyOptions(o),s="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(i=e.converter)||void 0===i?void 0:i.fromAttribute)?e.converter:n;this._$El=o,this[o]=s.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,i){let r=!0;void 0!==e&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||b)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===i.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,i))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}var e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(this.isUpdatePending){this.hasUpdated,this._$Ei&&(this._$Ei.forEach((e,t)=>this[t]=e),this._$Ei=void 0);let e=!1;var i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach((e,t)=>this._$EO(t,this[t],e)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}l.finalized=!0,l.elementProperties=new Map,l.elementStyles=[],l.shadowRootOptions={mode:"open"},null==v||v({ReactiveElement:l}),(null!==(e=r.reactiveElementVersions)&&void 0!==e?e:r.reactiveElementVersions=[]).push("1.6.1");var y=t(8315);class d extends l{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t,i=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=i.firstChild),i}update(e){var t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,y.sY)(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return y.Jb}}d.finalized=!0,d._$litElement$=!0,null===(e=globalThis.litElementHydrateSupport)||void 0===e||e.call(globalThis,{LitElement:d});const w=globalThis.litElementPolyfillSupport;null==w||w({LitElement:d});(null!==(t=globalThis.litElementVersions)&&void 0!==t?t:globalThis.litElementVersions=[]).push("3.2.2")}},r={},le.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return le.d(t,{a:t}),t},le.d=(e,t)=>{for(var i in t)le.o(t,i)&&!le.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},le.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),le.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},U={},(()=>{"use strict";le.r(U);var G=le(7058),W=le(3282),r=le(1722);const a=(i,e)=>{jQuery.each(e,(e,t)=>{switch(jQuery(`[name='${e}']`,i).attr("type")){case"text":case"number":case"tel":jQuery(`[name='${e}']`,i).val(t);break;case"date":"object"==typeof t&&t.seconds&&(t=t.toMillis()),t=r(t).format("YYYY-MM-DD"),jQuery(`[name='${e}']`,i).val(t);case"radio":jQuery(`[name='${e}'][value='${t}']`,i).prop("checked",!0)}})},Y=()=>{if(0{if(e)switch(o){case"firestore":const t=firebase.firestore();t.doc(s+"/"+e.uid).get().then(e=>{e.exists&&a("#ifp-firebase-account",e.data())});break;case"realtime":const i=firebase.database(),r=i.ref(s+"/"+e.uid);r.on("value",e=>{e=e.val();null!=e&&a("#ifp-firebase-account",e)})}}))}};var H,e,B=le(269);(e=H=H||{}).signOut="#firebase-signout",e.show=".firebase-show",e.showWhenNotLogIn=".firebase-show-when-not-login",e.firebaseUIAuthContainer="#firebaseui-auth-container",e.loginForm="#firebase-login-form",e.loginElement="firebase-login",e.loginFormSubmitBtn="#firebase-login-form__submit",e.loginFormForgotPasswordBtn="#firebase-login-form__forgot-password",e.forgotPassword="firebase-forgot-password",e.loginFormErrorMessage="#firebase-login-form__error",e.registerForm="#firebase-register-form",e.autoStraddleEmailLinkSignInForm="#autostraddle-login-email-link",e.emailLinkSignInForm="#firebase-login-email-link",e.emailLinkSignInFormErrorMessage="#firebase-login-email-link__error",e.emailLinkSignInFormInfoMessage="#firebase-login-email-link__info",e.c7RegisterForm="#if-c7-registration-form",e.registerFormSubmitBtn="#firebase-register-form__submit",e.registerFormErrorMessage="#firebase-register-form__error",e.registerFormInfoMessage="#firebase-register-form__info",e.firebaseAuth="firebase-auth",e.createDataForm="#if-create-data-form",e.firebaseAccount="#ifp-firebase-account";const l=t=>{if(t){let e=G.GL.utils.greetings;(0,W.xb)(t.displayName)?(0,W.xb)(t.email)?(0,W.xb)(t.phoneNumber)?e+="!":e+=`, ${t.phoneNumber}!`:e+=`, ${t.email}!`:e+=`, ${t.displayName}!`,jQuery("#firebase-user").text(e)}else jQuery("#firebase-user").hide()},c=e=>{if((0,W.xb)(e))return V(G.GL.utils.invalidForm),null;{const t={};for(const i of e)t[i.name]=i.value;return t}};const V=(e="")=>{(0,W.xb)(e)?jQuery("#firebase-error").hide():(console.error(e),jQuery("#firebase-error").show(),jQuery("#firebase-error").text(e))};const p={eq:"==",ne:"!=",gt:">",ge:">=",lt:"<",le:"<=",in:"in",ni:"not-in",ac:"array-contains",aca:"array-contains-any"},u=G.bP.firebaseSettings.apiToken,h=G.bP.firebaseSettings.baseDomain;var f=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};const d=G.bP.authSettings,n=G.bP.firebaseWordPress,z=(e,t,i=null)=>{if(!(0,W.xb)(n.userCollectionName)&&!(0,W.xb)(n.firebaseDatabaseType))switch(delete t.password,n.firebaseDatabaseType){case"firestore":const r=firebase.firestore();r.collection(n.userCollectionName).doc(e).set(t,{merge:!0}).then(e=>{null!=i&&(location.href=i)}).catch(e=>{console.error(e.message)});break;case"realtime":const o=firebase.database(),s=o.ref(n.userCollectionName).child(e);s.update(t).then(e=>{null!=i&&(location.href=i)}).catch(e=>{console.error(e.message)})}},m=G.bP.authSettings;var g=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};const v=G.bP.authSettings;var b,t=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};const q=G.bP.authSettings,y=G.bP.firebaseWordPress,K=()=>t(void 0,void 0,void 0,function*(){jQuery(H.loginFormSubmitBtn).on("click",e=>{e.preventDefault();const t=jQuery(H.loginForm),i=c(t.serializeArray()),r=(0,W.Lm)("redirect_url")||t.data("redirect"),o=!!t.data("send-email-confirmation"),s=!!t.data("skip-default-email"),n=jQuery(H.loginFormErrorMessage);n.hide(),""!==i.email&&""!==i.password?firebase.auth().signInWithEmailAndPassword(i.email,i.password).then(()=>{const e=firebase.auth().currentUser;var t;o&&!1===e.emailVerified?(console.log("[Firebase] - Resend email verification?"),confirm(G.GL.auth.resendVerificationEmail||"Your email address is not verified. Would you like to resend verification email?")&&(s?(0,W.PZ)(e):e.sendEmailVerification()),(0,W.$A)()):null!==d&&void 0!==d&&d.loginWithFirebase?(console.log("[Firebase] - Login with to WordPress is active..."),t=(0,W.Ke)(e,i.password),(0,W.mL)(t,r)):(0,W.xb)(r)||(console.log("[Firebase] - Redirect to",r),location.href=r)}).catch(e=>{window.onLoginErrorCallback&&window.onLoginErrorCallback(e),n.html(G.GL.auth[e.code]||e.message),n.show()}):(n.html(G.GL.auth.emailPasswordMissing),n.show())});{const i=0{e.preventDefault(),(0,W.VO)(),i.removeClass("sent");const t=i.serializeArray(),r=(t.forEach(e=>{e.name&&-1===e.name.indexOf("_wpcf7")&&-1===e.name.indexOf("_validate")&&(n[""+e.name]=e.value)}),!!n.sendEmailConfirmation),o=!!n.skipDefaultEmail,s=n.redirect||"/";delete n.skipDefaultEmail,delete n.sendEmailConfirmation,delete n.redirect,(0,W.xI)(H.c7RegisterForm+".sent").then(e=>{if(e){console.log("[Firebase] - Form is valid, start registering new user");const i=jQuery(".wpcf7-response-output");n.phoneNumber&&!0!==/^\+?[1-9]\d{10}$/.test(n.phoneNumber)?i.text(G.GL.auth.invalidPhoneNumber):((0,W.S6)(),firebase.auth().createUserWithEmailAndPassword(n.email,n.password).then(()=>{const e=firebase.auth().currentUser,t=(0,W.Ke)(Object.assign(Object.assign(Object.assign({},e),n),{uid:e.uid}),n.password,Object.keys(n));delete t.password,z(e.uid,t),r?(console.log("[Firebase] - Send email confirmation!"),o?((0,W.bb)(e),alert(G.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address.")):e.sendEmailVerification().then(()=>{console.log("[Firebase] - Confirmation email is sent!"),alert(G.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address."),(0,W.Gx)(),setTimeout(()=>{(0,W.$A)()},3e3)}).catch(e=>{i.text(e.message),console.error(e)})):m&&m.loginWithFirebase?(console.log("[Firebase] - Login with to WordPress is active..."),(0,W.mL)(Object.assign(Object.assign({},t),{password:n.password}),s)):z(e.uid,t,s)}).catch(e=>{i.text(e.message),console.error(e),(0,W.Gx)()}))}else(0,W.Gx)()})})}jQuery(H.registerFormSubmitBtn).on("click",l=>f(void 0,void 0,void 0,function*(){l.preventDefault();const e=jQuery(H.registerForm);var t=e[0].checkValidity();const i=jQuery(H.registerFormErrorMessage),r=(i.hide(),jQuery(H.registerFormInfoMessage));if(null!==r&&void 0!==r&&r.hide(),t){(0,W.VO)();var o,t=e.serializeArray(),t=c(t),s=e.data("redirect"),n=e.data("send-email-confirmation"),a=e.data("skip-default-email");if((0,W.xb)(t.email)&&(0,W.xb)(t.password)&&(0,W.xb)(t.confirmPassword))i.html(G.GL.auth.enterMissingData),(0,W.Gx)(),i.show();else if(t.password!==t.confirmPassword)i.html(G.GL.auth.confirmPassword),i.show(),(0,W.Gx)();else if(t.phoneNumber&&!0!==/^\+(?:[0-9]?){6,14}[0-9]$/.test(t.phoneNumber))i.html(G.GL.auth.invalidPhoneNumber),i.show(),(0,W.Gx)();else{try{yield firebase.auth().createUserWithEmailAndPassword(t.email,t.password);let e=firebase.auth().currentUser;n&&(a?(0,W.bb)(e):yield e.sendEmailVerification(),console.log("[Firebase] - Confirmation email is sent!"),r.length?(null!==r&&void 0!==r&&r.html(G.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address."),null!==r&&void 0!==r&&r.show()):alert(G.GL.auth.verifyEmailAfterSignUp||"Account created successfully. Please verify your email address.")),yield e.updateProfile({displayName:(t.firstName+" "+(t.lastName||"")).trim(),phoneNumber:t.phoneNumber}),n?(yield(0,W._v)(3e3),(0,W.$A)()):d&&d.loginWithFirebase?(o=(0,W.Ke)(Object.assign(Object.assign({},e._delegate||e),{firstName:t.firstName,lastName:t.lastName,phoneNumber:e.phoneNumber||t.phoneNumber}),t.password),(0,W.mL)(o,s)):(0,W.xb)(s)||(console.log("[Firebase] - Redirect to",s),location.href=s)}catch(e){i.html(G.GL.auth[e.code]||e.message),i.show()}(0,W.Gx)()}}else i.html(G.GL.auth.invalidForm),i.show()})),jQuery(H.loginFormForgotPasswordBtn).on("click",e=>{e.preventDefault(),console.log("[Firebase] - Start to reset password...");const t=jQuery(H.loginForm),i=c(t.serializeArray()),r=jQuery(H.loginFormErrorMessage);(0,W.xb)(i.email)?(r.html(G.GL.auth.emailNeededForReset),r.show()):(r.hide(),firebase.auth().sendPasswordResetEmail(i.email).then(()=>{console.log("[Firebase] - Reset email is sent to "+i.email),r.html(G.GL.auth.checkInboxForReset),r.show()}).catch(e=>{r.html(G.GL.auth[e.code]||e.message),r.show()}))}),(location.hostname.includes("autostraddle")||location.hostname.includes("techcater"))&&(console.log("[firebase] - Apply email sign link approach"),jQuery(H.emailLinkSignInForm).on("submit",s=>g(void 0,void 0,void 0,function*(){s.preventDefault();const e=jQuery(H.emailLinkSignInForm);var t=e[0].checkValidity();const i=(0,W.PY)(e.serializeArray())["email"],r=jQuery(H.emailLinkSignInFormErrorMessage),o=(r.hide(),jQuery(H.emailLinkSignInFormInfoMessage));null!==o&&void 0!==o&&o.hide(),t&&((0,W.VO)(),t={url:window.location.href,handleCodeInApp:!0},firebase.auth().sendSignInLinkToEmail(i,t).then(()=>{window.localStorage.setItem("emailForSignIn",i),jQuery(H.emailLinkSignInForm).hide(),o.html("Your sign-in link is on its way! Please open your email and click on the link we’ve sent to securely log in."),o.show()}).catch(e=>{r.html(G.GL.auth[e.code]||e.message),r.show()}).finally(()=>(0,W.Gx)()))})),yield g(void 0,void 0,void 0,function*(){v.loginUrl;const e=jQuery(H.autoStraddleEmailLinkSignInForm)||jQuery(H.emailLinkSignInForm);console.log(e);var t=(0,W.Lm)("redirect_url")||e.data("redirect")||window.location.origin+window.location.pathname,i=(console.log({redirectLink:t}),(0,W.Lm)("oobCode"));if(console.log("oobCode",!!i),i&&firebase.auth().isSignInWithEmailLink(window.location.href)){const s=jQuery(H.emailLinkSignInFormErrorMessage);s.hide();let e=window.localStorage.getItem("emailForSignIn");e=e||window.prompt("Please provide your email for confirmation");var r,o,i=yield firebase.auth().signInWithEmailLink(e,window.location.href).catch(e=>{s.html(G.GL.auth[e.code]||e.message),s.show()}).finally(()=>(0,W.Gx)()),i=(window.localStorage.removeItem("emailForSignIn"),console.log("result",i),console.log("currentUser",firebase.auth().currentUser),Object.assign({},(0,W.V)(i)));console.log("cloneUser",i),v.loginWithFirebase&&(r=Math.random().toString(36).substr(2,10),o=yield firebase.auth().currentUser.getIdTokenResult(!1),i=(0,W.Ke)(Object.assign(Object.assign({},i),{claims:(null==o?void 0:o.claims)||{}}),r),console.log("[Firebase] - start to login and redirect to "+t),(0,W.mL)(i,t))}}));{const r=jQuery(H.signOut).data("logout"),o=jQuery(H.signOut).data("redirect");jQuery(H.signOut).on("click",e=>{e.preventDefault(),firebase.auth().signOut().then(()=>{(0,W.xb)(G.bP.authSettings.loginWithFirebase)?window.location.href=G.bP.firebaseWordPress.siteUrl+o:window.location.href=r}).catch(e=>console.log(e))}),jQuery('a[href*="logout"]').each(function(){this.addEventListener("click",()=>{firebase.auth().signOut().catch(e=>console.log(e))})})}{const s=jQuery("#wp-admin-bar-logout");(0,W.xb)(h)?console.warn('[Firebase] Please configure "Firebase > Settings" in order to log out of Firebase from WordPress Dashboard'):s.on("click",e=>{e.stopPropagation(),e.preventDefault();const t=s.find("a").attr("href"),i=window.localStorage.getItem(B.m.FirebaseUID);i?(console.log("Logout user: "+i),jQuery.ajax({url:h+"/api-user/v1/users/sign-out",type:"POST",contentType:"application/json",dataType:"json",beforeSend:function(e){e.setRequestHeader("api-token",u),e.setRequestHeader("source","frontend"),e.setRequestHeader("uid",i)},success:function(e){e.status?(console.log(e.message),localStorage.removeItem(B.m.FirebaseUID)):console.error(e.message),window.location.href=t},error:function(e){console.error(e.message),window.location.href=t}})):(console.warn("firebaseUserUID is empty!"),window.location.href=t)})}if(yield new Promise((t,e)=>firebase.auth().onAuthStateChanged(function(e){e?(l(e),t(!0)):(l(!1),t(!1))}))){jQuery(H.signOut).show(),jQuery(H.show).show(),jQuery(H.showWhenNotLogIn).hide(),jQuery(H.firebaseUIAuthContainer).hide(),jQuery(H.loginForm).hide(),jQuery(H.loginElement).hide(),jQuery(H.forgotPassword).hide(),jQuery(H.registerForm).hide(),jQuery(H.emailLinkSignInForm).hide(),jQuery(H.c7RegisterForm).hide(),jQuery(H.firebaseAuth).hide(),(0,W.S6)(),w();var e=(0,W.Lm)("oobCode");if(q.loginWithFirebase&&!(0,W.i4)()&&null==e){yield(0,W.gw)(3e3);let e=!1;"3.35.0"<=G.OY.proVersion&&(e=yield(0,W.ck)()),console.log({wpUserLoggedIn:e}),!1===(0,W.i4)()&&!1===e&&firebase.auth().signOut().then(()=>{console.log("[Firebase] - WP session is ended. Logging out of Firebase"),window.location.reload()}).catch(e=>console.log(e))}}else{var t,e=window.localStorage.getItem(B.m.FirebaseUserCredentials);(0,W.xb)(e)?(q.loginWithFirebase&&(0,W.i4)()&&(console.log("[Firebase] - Firebase session is ended. Logging out of WP"),window.location.href=y.wpLogoutLink),jQuery(H.show).hide(),jQuery(H.signOut).hide(),jQuery(H.registerForm).show(),jQuery(H.emailLinkSignInForm).show(),jQuery(H.c7RegisterForm).show(),jQuery(H.firebaseAuth).show(),jQuery(H.loginForm).show(),jQuery(H.loginElement).show(),jQuery(H.forgotPassword).show(),(0,W.S6)(),jQuery(H.showWhenNotLogIn).show(),jQuery(H.firebaseUIAuthContainer).show(),jQuery(H.firebaseAccount).hide(),_(),window.localStorage.removeItem("emailForSignIn")):q.loginWithFirebase&&(0,W.i4)()?(e=window.localStorage.getItem(B.m.FirebaseLoginToken),{email:e,password:t}=(0,W.LF)(e),firebase.auth().signInWithEmailAndPassword(e,t).catch(e=>{window.onLoginErrorCallback&&window.onLoginErrorCallback(e),console.error((null==e?void 0:e.message)||e)}).finally(()=>window.localStorage.removeItem(B.m.FirebaseUserCredentials))):window.localStorage.removeItem(B.m.FirebaseUserCredentials)}}),w=()=>{const t=jQuery(".firebase-show-with-claims");if(t.length){const i=t.html(),r=t.data("claims"),o=t.data("message");t.empty(),firebase.auth().onAuthStateChanged(function(e){firebase.auth().currentUser?firebase.auth().currentUser.getIdTokenResult().then(e=>{e.claims[r]?t.html(i):(console.warn(`User must have ${r} right in order to view the content.`),t.html(o)),t.show()}).catch(e=>{console.error(e)}):(console.warn(`User must login and has ${r} right in order to view the content.`),t.html(o),t.show())})}},_=()=>{const e=jQuery(".firebase-show-with-claims");var t=e.data("message");e.html(t),e.show()};var $=new Uint8Array(16);const o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const s=function(e){return"string"==typeof e&&o.test(e)};for(var S,P,i=[],x=0;x<256;++x)i.push((x+256).toString(16).substr(1));const A=function(e){var t=1>>24&255,o[r++]=l>>>16&255,o[r++]=l>>>8&255,o[r++]=255&l,e=n/4294967296*1e4&268435455,o[r++]=e>>>8&255,o[r++]=255&e,o[r++]=e>>>24&15|16,o[r++]=e>>>16&255,o[r++]=i>>>8|128,o[r++]=255&i;for(var d=0;d<6;++d)o[r+d]=s[d];return t||A(o)};var k=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};const I=e=>{const t=!!(0,W.Lm)("debug");t&&console.log("[Firebase] sendDataToFirebase: "+JSON.stringify(e));var i=(0,W.xq)(e.collection);const r=(0,W.xq)(e.docId);switch(console.log({newCollectionName:i,newDocumentId:r}),e.dbType){case"firestore":const o=firebase.firestore();o.collection(i).doc(r).set(e.data,{merge:!0}).then(e=>{t&&console.log("[Firebase] - Firestore data created / updated with id: "+r)}).catch(e=>{V(e.message)});break;case"realtime":const s=firebase.database(),n=s.ref(i);n.child(r).update(e.data).then(e=>{t&&console.log("[Firebase] - Realtime data created / updated with id: "+r)}).catch(e=>{V(e.message)});break;default:V(G.GL.database.invalidDbType)}},J=l=>{const e=0{var[e=null,i=!1]=e&&e.split("__").map(e=>null==e?void 0:e.trim());h.push({fileName:e,isPublic:i,fileContent:null}),null!=e&&jQuery(`input[name="${e}"]`).change(e=>{h[t].fileContent=e.target.files[0]})}),e.on("submit",()=>k(void 0,void 0,void 0,function*(){e.removeClass("sent");const i=e.serializeArray();if(u&&console.log("[Firebase] - Handle form submission"),yield(0,W.xI)(l+".invalid",0))u&&console.log("[Firebase] - Form is invalid. Skip saving to firebase");else{const n=jQuery('input[name="dateType"]').val();let e=[],t=(jQuery('input[name="integerTypes"]').val()&&(e=jQuery('input[name="integerTypes"]').val().split(",")),[]),r=(jQuery('input[name="arrayType"]').val()&&(t=jQuery('input[name="arrayType"]').val().split(","),t.forEach(e=>{d[e]=[]})),[]);jQuery('input[name="mapTypes"]').val()&&(r=jQuery('input[name="mapTypes"]').val().split(","),r.forEach(e=>{d[e]={}})),i.forEach(i=>{i.name&&i.name.indexOf("_wpcf7")&&(-1{-1{var t;i.name.includes(e+"__")&&(t=i.name.split("__")[1],d[e][t]=i.value)}):n&&n.includes(i.name)?(0,W.xb)(i.value)?d[""+i.name]=null:d[""+i.name]=new Date(i.value):0{const i={};return Object.keys(t).forEach(e=>{(0,W.xb)(t[e])||(i[e]=t[e])}),i})(d))):console.error("Database couldn't be saved. Please check collectionName & databaseType in your form."),2!==Object.keys(c.data).length?(0,W.xI)(l+".sent",100).then(e=>{if(e){if(u&&console.log("[Firebase] - Form is valid, start saving data to Firebase"),h.some(e=>null!=e.fileContent)){u&&console.log("[Firebase] - Upload files to cloud storage");const s=firebase.storage().ref();h.forEach(t=>{if(null!=t.fileContent){var e={contentType:t.fileContent.type};const i=`wpImages/${a}/`+Date.now()+"-"+t.fileContent.name,r=s.child(i),o=r.put(t.fileContent,e);o.then(e=>{u&&console.log("[Firebase] - File upload state:",e.state),(0,W.xb)(t.isPublic)?(c.data[t.fileName]=i,I(c)):e.ref.getDownloadURL().then(e=>{c.data[t.fileName]=e,I(c)})}).catch(e=>V(e.message)).finally(()=>{h.forEach((e,t)=>{h[t].fileContent=null,delete c.data[e.fileName]})})}})}else I(c);"#ifp-firebase-account"===l&&Y()}}):u&&console.warn("Form is empty...")}}))};var Z=le(3402);const O=(t,i,e,r)=>{var o=e.split(",");let s=``;if(!(0,W.xb)(e)&&0",s+=``,s+="",s+="")}for(const l of r){var n=(0,W.Q5)(t,l);(0,W.xb)(n)||"string"!=typeof n||(s+="",s+=``,s+=``,s+="")}return s+="
${a} "+(0,W.Z6)(e)+"
${l}
",s},X=(e,t,i)=>{let r=e;if(0{var r=n.data("search-fields")?n.data("search-fields").split("|"):[],o=n.data("search-operators")?n.data("search-operators").split("|"):[];if(!!(0,W.Lm)("debug")&&console.log(r,o,i),r.length!==o.length&&o.length!==i.length)console.error("[firestore_search] - search fields, search operators and search conditions should be equal");else{var u=r.length;const a=n.data("display-type"),l=n.data("display-fields");var h=n.data("order-by")?n.data("order-by").split(","):[],e=n.data("limit");const d=n.data("images")?n.data("images").split(","):[],f=n.data("child-page"),m=n.data("child-page-target-field");for(let e=0;e{if("blocks"===a){let t="";e.forEach(e=>{e.exists&&(t+=(0,Z.M)(e.data(),e.id,l,d,f,m))}),n.append(t)}else{const r=l.split(",");var t="if-firestore-col__table__"+c;let i=``;for(const s of r)i+=``;i+="",e.forEach(e=>{i+=``;for(const t of r)i+=``;i+=""}),i+="
${s}
${e.data()[t.trim()]?(0,W.Z6)(e.data()[t.trim()]):""}
",n.append(i);const o=jQuery("#"+t);o.DataTable()}})}},te=()=>{var e=jQuery(".if-firestore-doc"),t=firebase.firestore();for(const o of e){const s=jQuery(o);var i=s.data("collection-name"),r=s.data("document-name").toString();i&&r?((e,i,t,r)=>{const o=i.data("display-fields"),s=i.data("display-type"),n=i.data("images")?i.data("images").split(","):[],a=i.data("child-page"),l=i.data("child-page-target-field"),d=e.collection((0,W.xq)(t)).doc((0,W.xq)(r));d.get().then(t=>{if(t.exists){let e="";e="blocks"===s?(0,Z.M)(t.data(),t.id,o,n,a,l):O(t.data(),t.id,o,n),i.append(e)}else V("[firestore] "+G.GL.database.invalidCollectionOrDocument)}).catch(e=>{V(e.message)})})(t,s,i,r):V("[firestore] "+G.GL.database.emptyCollectionOrDocument)}},j=(t,e,i,r)=>{var o=i.split(",");let s=``;if(!(0,W.xb)(i)&&0 ${n} `,s+="",s+=""}for(const a of r)s+="",s+=``,s+=``,s+="";return s+="
"+(0,W.Z6)(e)+"
${a}
",s},F=(e,t,i,r)=>{i=i.split(",");let o="";if(o+=`
`,0";for(const s of r)o+=``;o+="
"}for(const n of i)e[n.trim()]&&(o+=`
${(0,W.Z6)(e[n.trim()])}
`);return o+="",o},ie=(e,r,t,i)=>{const o=r.data("display-fields"),s=r.data("display-type"),n=r.data("images")?r.data("images").split(","):[];e.ref("/"+t+"/"+i).once("value").then(function(t){var i=t.val();if(i){let e="";e=("blocks"===s?F:j)(i,t.key,o,n),r.append(e)}else V("[realtime] "+G.GL.database.invalidCollectionOrDocument)}).catch(e=>{V(e.message)})},re=()=>{const e=jQuery(".if-realtime-blocks"),t=firebase.database();for(const o of e){const s=jQuery(o);var i=s.data("collection-name");const n=s.data("display-fields");var r=e.data("order-by")?e.data("order-by").split(","):[];const a=s.data("images")?s.data("images").split(","):[];if(i&&n){let e=t.ref((0,W.xq)(i));e=((e,t,i)=>{let r=e;if(1===t.length)for(const o of t)r=e.orderByChild(o);else V(i+" Invalid orderby: "+t);return r})(e,r,"[realtime_blocks]"),e.once("value").then(e=>{let t="";e.forEach(e=>{t+=F(e.val(),e.key,n,a)}),s.append(t)}).catch(e=>{V(e.message)})}else V("[realtime_blocks] "+G.GL.database.invalidCollectionOrDisplayFields)}};var oe=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};const se=G.bP.firebaseSettings.apiToken,ne=G.bP.firebaseSettings.baseDomain,ae=G.bP.authSettings;var D=function(e,n,a,l){return new(a=a||Promise)(function(i,t){function r(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}s((l=l.apply(e,n||[])).next())})};!function(t){D(this,void 0,void 0,function*(){if(null!=G.bP.firebaseOptions.apiKey){if(!firebase.apps.length&&(firebase.initializeApp(G.bP.firebaseOptions),!(0,W.xb)(G.bP.firebaseOptions.reCaptchaSiteKey)&&-1{var i=!!(0,W.Lm)("debug");i&&console.log("[Firebase] - Firebase sign in successful!!!"),i&&console.log("[Firebase] - authResult ",JSON.stringify(e));const r=JSON.parse(JSON.stringify(e.user));i&&console.log("[Firebase] - user",JSON.stringify(r)),(0,W.xb)(r.email)&&(r.email=null===(o=null===(o=e.additionalUserInfo)||void 0===o?void 0:o.profile)||void 0===o?void 0:o.email),(0,W.xb)(r.firstName)&&(r.firstName=e.firstName||(null===(o=null===(o=e.additionalUserInfo)||void 0===o?void 0:o.profile)||void 0===o?void 0:o.given_name)),(0,W.xb)(r.lastName)&&(r.lastName=e.lastName||(null===(o=null===(o=e.additionalUserInfo)||void 0===o?void 0:o.profile)||void 0===o?void 0:o.family_name)),i&&console.log("[Firebase] - transformed user",JSON.stringify(r));var o=(0,W.xb)(s)?t:s;if(r.uid&&window.localStorage.setItem(B.m.FirebaseUID,r.uid),$&&(0,W.$c)(e))i&&console.log("[Firebase] - Send email verification"),i&&console.log("Skip send default email?",n),n?(0,W.bb)(r):(0,W.nN)(),firebase.auth().signOut().then(()=>location.reload());else if($&&(0,W.lg)(e))i&&console.log("[Firebase] - Resend email verification?"),confirm("Your email address is not verified. Would you like to resend verification email?")&&(n?(0,W.PZ)(r):(0,W.nN)()),firebase.auth().signOut().then(()=>location.reload());else{t=Math.random().toString(36).substr(2,10),t=(0,W.Ke)(r,t);if(i&&console.log("[Firebase] - userObject",JSON.stringify(t)),q&&q.loginWithFirebase)return i&&console.log("[Firebase] - Login with to WordPress is active..."),(0,W.mL)(t,o),!1;if(z(e.user.uid,t,o),null!=o)return!0}return!1}},signInSuccessUrl:(0,W.xb)(s)?q.signInSuccessUrl:s,signInOptions:[],signInFlow:"popup",credentialHelper:firebaseui.auth.CredentialHelper.GOOGLE_YOLO,tosUrl:q.tosUrl||"",privacyPolicyUrl:q.privacyPolicyUrl||""},q.signInOptions.forEach(e=>{switch(e){case"Google":const i={provider:(null===(t=firebase.auth)||void 0===t?void 0:t.GoogleAuthProvider.PROVIDER_ID)||"google.com",scopes:["https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"],clientId:null,customParameters:{prompt:"select_account"}};q.googleClientId&&(i.clientId=q.googleClientId),window.$firebaseuiConfig.signInOptions.push(i);break;case"Facebook":var t={provider:firebase.auth.FacebookAuthProvider.PROVIDER_ID||"facebook.com",scopes:["public_profile","email"]};window.$firebaseuiConfig.signInOptions.push(t);break;case"Twitter":window.$firebaseuiConfig.signInOptions.push((null===(t=firebase.auth)||void 0===t?void 0:t.TwitterAuthProvider.PROVIDER_ID)||"twitter.com");break;case"Github":window.$firebaseuiConfig.signInOptions.push((null===(t=firebase.auth)||void 0===t?void 0:t.GithubAuthProvider.PROVIDER_ID)||"github.com");break;case"Apple":window.$firebaseuiConfig.signInOptions.push({provider:"apple.com",scopes:["name","email"]});break;case"Yahoo":window.$firebaseuiConfig.signInOptions.push("yahoo.com");break;case"Microsoft":window.$firebaseuiConfig.signInOptions.push("microsoft.com");break;case"Phone":window.$firebaseuiConfig.signInOptions.push((null===(t=firebase.auth)||void 0===t?void 0:t.PhoneAuthProvider.PROVIDER_ID)||"phone");break;case"Email":const r={provider:(null===(t=firebase.auth)||void 0===t?void 0:t.EmailAuthProvider.PROVIDER_ID)||"password",signInMethod:(null===(t=firebase.auth)||void 0===t?void 0:t.EmailAuthProvider.EMAIL_PASSWORD_SIGN_IN_METHOD)||"password",forceSameDevice:!1};q.signinWithEmailLink&&(r.signInMethod=(null===(t=firebase.auth)||void 0===t?void 0:t.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD)||"emailLink"),window.$firebaseuiConfig.signInOptions.push(r)}}),window.$firebaseui=new firebaseui.auth.AuthUI(firebase.auth()),!document.getElementById("firebaseui-auth-container")||(window.$firebaseui.start(H.firebaseUIAuthContainer,window.$firebaseuiConfig),window.$firebaseui.disableAutoSignIn())}else console.warn("[Firebase] - Please check sign in options in the Auth tab!");if(yield K(),G.bP.firebaseOptions.services.includes("realtime")){{var c=jQuery(".if-realtime-col");const S=firebase.database();for(let s=0;s{var t="if-realtime-col__table__"+s;let i=``;for(const o of x)i+=``;i+="",e.forEach(e=>{i+=``;for(const t of x)i+=``;i+=""}),i+="
${o}
${e.val()[t.trim()]?(0,W.Z6)(e.val()[t.trim()]):""}
",a.append(i);const r=jQuery("#"+t);r.DataTable()}).catch(e=>{V(e.message)})}else V("[realtime] "+G.GL.database.invalidCollectionOrDisplayFields)}}{e=jQuery(".if-realtime-doc");const A=firebase.database();for(const L of e){const t=jQuery(L),i=t.data("collection-name");var h=t.data("document-name");i&&h?"getFirebaseUid"===h?firebase.auth().onAuthStateChanged(e=>{e&&ie(A,t,i,e.uid)}):ie(A,t,i,h):V("[realtime] "+G.GL.database.emptyCollectionOrDocument)}}re()}if(G.bP.firebaseOptions.services.includes("firestore")){{var f=jQuery(".if-firestore-col");const C=firebase.firestore();for(let s=0;s{var t="if-firestore-col__table__"+s;let r=``;for(const o of O)r+=``;r+="",e.forEach(t=>{r+=``;for(const i of O){let e=t.data()[i.trim()]?(0,W.Z6)(t.data()[i.trim()]):"";(0,W.xb)(k)||(0,W.xb)(I)||I===i&&(e=`${e}`),r+=``}r+=""}),r+="
${(0,W.__)(o)}
${e}
",l.append(r);const i=jQuery("#"+t);i.DataTable()}).catch(e=>{V("[firestore_col] "+e.message)})}else V("[firestore_col] "+G.GL.database.invalidCollectionOrDisplayFields)}}te();{e=jQuery(".if-firestore-blocks");const j=firebase.firestore();for(const F of e){const r=jQuery(F);var v=r.data("collection-name");const D=r.data("display-fields");var b=r.data("order-by")?r.data("order-by").split(","):[],y=r.data("limit");const U=r.data("images")?r.data("images").split(","):[],N=r.data("child-page"),M=r.data("child-page-target-field");if(v&&D){let e=j.collection((0,W.xq)(v));e=X(e,b,"[firestore_blocks]"),(0,W.xb)(y)||(e=e.limit(y)),e.get().then(e=>{let t="";e.forEach(e=>{e.exists&&(t+=(0,Z.M)(e.data(),e.id,D,U,N,M))}),r.append(t)}).catch(e=>{V(e.message)})}else V("[firestore_blocks] "+G.GL.database.invalidCollectionOrDisplayFields)}}{var w=jQuery(".if-firestore-search");const T=firebase.firestore();for(let i=0;i"getFirebaseUid"===e);firebase.auth().onAuthStateChanged(e=>{e?(d[R]=e.uid,ee(t,i,o,d)):console.warn("[firestore_search] - user is not logged in!")})}else ee(t,i,o,d)}}}}firebase.auth().onAuthStateChanged(e=>{if(e)for(const t of jQuery(".getFirebaseUid")){const i=jQuery(t);i.val(e.uid)}}),0{e.stopPropagation(),e.preventDefault();const t=Q.find("a").attr("href"),i=window.localStorage.getItem(B.m.FirebaseUID);i?(console.log("Logout user: "+i),jQuery.ajax({url:ne+"/api-user/v1/users/sign-out",type:"POST",contentType:"application/json",dataType:"json",beforeSend:function(e){e.setRequestHeader("api-token",se),e.setRequestHeader("source","frontend"),e.setRequestHeader("uid",i)},success:function(e){e.status?(console.log(e.message),localStorage.removeItem(B.m.FirebaseUID)):console.error(e.message),window.location.href=t},error:function(e){V(e.message),window.location.href=t}})):(console.warn("firebaseUserUID is empty!"),window.location.href=t)})}G.bP.authSettings.loginWithFirebase&&ae.loginWithFirebase&&(jQuery("#customer_login").hide(),(0,W.xI)("#customer_login").then(e=>{e&&(jQuery("#customer_login").replaceWith(`

${G.GL.woocommerce.loginText}

`),jQuery("#customer_login").show())}),(0,W.xI)(".woocommerce-form-login-toggle1").then(e=>{e&&(jQuery(".woocommerce-form-login-toggle").remove(),jQuery(".woocommerce-form-login").remove())}),(0,W.xI)("form.woocommerce-EditAccountForm").then(e=>{e&&(G.bP.firebaseExperiments.allowUpdatingEmail||(jQuery(".woocommerce-EditAccountForm #account_email").hide(),jQuery('.woocommerce-EditAccountForm label[for="account_email"]').remove()))}))})})}else t(function(){V(G.GL.firebase.firebaseSettingsMissing)})})}(jQuery)})(),U;function le(e){var t=r[e];if(void 0!==t)return t.exports;t=r[e]={exports:{}};return i[e].call(t.exports,t,t.exports,le),t.exports}var i,r,U});