PageSourceSearch

https://stampit.app/_next/static/chunks/c4accbcbee34b019.js

js stampit.app collected 2026-09-24 14:32:33 UTC 23,121 bytes, 4 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="74cd6131-619a-5308-0a76-acaab5516ccf")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,446527,253652,e=>{"use strict";let t=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function r(e){return"string"==typeof e&&t.test(e)?e:void 0}function n(e){if(e)return{...e,backgroundColor:r(e.backgroundColor),textColor:r(e.textColor),accentColor:r(e.accentColor),detailTextColor:r(e.detailTextColor)}}function o(e){if(e)return{...e,stamp:e.stamp?{...e.stamp,primaryColor:r(e.stamp.primaryColor)}:void 0,backgroundColor:r(e.backgroundColor),textColor:r(e.textColor),walletPassStyle:n(e.walletPassStyle)}}function a(e){if(!e)throw Error("parseFirestoreTimestamp: missing value");if(e instanceof Date)return e;if("object"==typeof e&&null!==e){if("function"==typeof e.toDate)return e.toDate();if("number"==typeof e._seconds)return new Date(1e3*e._seconds);if("number"==typeof e.seconds)return new Date(1e3*e.seconds)}if("string"==typeof e){let t=new Date(e);if(!isFinite(t.getTime()))throw Error(`parseFirestoreTimestamp: invalid date string: ${e}`);return t}if("number"==typeof e)return new Date(e<1e11?1e3*e:e);throw Error(`parseFirestoreTimestamp: unrecognized format: ${JSON.stringify(e)}`)}function i(e,t){let i,s=function e(t){if(null==t||"object"!=typeof t)return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(e);if("number"==typeof t.seconds&&"number"==typeof t.nanoseconds&&"function"==typeof t.toDate)return{seconds:t.seconds,nanoseconds:t.nanoseconds};if("number"==typeof t.latitude&&"number"==typeof t.longitude&&"function"==typeof t.isEqual)return{latitude:t.latitude,longitude:t.longitude};let r={};for(let[n,o]of Object.entries(t))r[n]=e(o);return r}(t);return{...s,id:e,style:{logoUrl:(i=s.style??{}).logoUrl??"",designUrl:i.designUrl??"",primaryColor:r(i.primaryColor),backgroundColor:r(i.backgroundColor),textColor:r(i.textColor),walletPassStyle:n(i.walletPassStyle)},locations:function(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e))t[r]={...n,id:r};return t}(s.locations),loyaltyPrograms:function(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e))t[r]={...n,id:r,type:"LOYALTY",status:n.status??"ACTIVE",locationIds:n.locationIds??[],verificationMethods:n.verificationMethods??[],style:o(n.style)};return t}(s.loyaltyPrograms),couponsPrograms:function(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e))t[r]={...n,id:r,type:"COUPONS",status:n.status??"ACTIVE",locationIds:n.locationIds??[],verificationMethods:n.verificationMethods??[],style:o(n.style)};return t}(s.couponsPrograms),status:s.status??"CREATED",tier:s.tier??null,paymentsEnabled:!0===s.paymentsEnabled,createdAt:function(e){if(!e)return null;try{return a(e)}catch{return null}}(s.createdAt)}}function s(e){return{uid:e.uid,email:e.email,displayName:e.displayName,photoURL:e.photoURL,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber}}function l(e){return{id:e.id||"",userId:e.userId||"",createdAt:a(e.createdAt),locationId:e.locationId||"",verificationMethod:e.verificationMethod||"APP_NFC_TAG",transactionInvokerUserId:e.transactionInvokerUserId||""}}function u(e){let t=e.stamps||[];return{id:e.id||"",userId:e.userId||"",createdAt:a(e.createdAt),locationId:e.locationId||"",verificationMethod:e.verificationMethod||"APP_NFC_TAG",transactionInvokerUserId:e.transactionInvokerUserId||"",stamps:t.map(e=>l(e))}}function c(e){return{id:e.id||"",userId:e.userId||"",createdAt:a(e.createdAt),locationId:e.locationId||"",verificationMethod:e.verificationMethod||"APP_NFC_TAG",transactionInvokerUserId:e.transactionInvokerUserId||"",cardId:e.cardId||""}}function d(e,t){let r=e.rewards||[];return{id:t,userId:e.userId||"",createdAt:a(e.createdAt),purchaseId:e.purchaseId||"",size:e.size||0,rewards:r.map(e=>c(e)),status:e.status,amount:e.amount,currency:e.currency}}function m(e,t){let r=e.loyaltyPrograms||{},n=e.couponsPrograms||{},o={};for(let[e,t]of Object.entries(r))o[e]=function(e,t){let r=e.stamps||[],n=e.rewards||[];return{programId:t,stamps:r.map(e=>l(e)),rewards:n.map(e=>u(e))}}(t,e);let a={};for(let[e,t]of Object.entries(n))a[e]=function(e,t){let r=e.cards||{},n={};for(let[e,t]of Object.entries(r))n[e]=d(t,e);return{programId:t,cards:n}}(t,e);return{partnerId:t,loyaltyPrograms:o,couponsPrograms:a}}function f(e){return{partnerId:e,loyaltyPrograms:{},couponsPrograms:{}}}function p(e){let t=Object.values(e.cards).filter(e=>e.rewards.length<e.size&&"VALID"===y(e));return 0===t.length?null:(t.sort((e,t)=>
2e.createdAt.getTime()-t.createdAt.getTime()),t[0])}function g(e,t){let r=e?.stamps.length||0,n=e?.rewards.length||0,o=t>0?Math.min(100,r/t*100):0;return{currentStamps:r,totalRewards:n,capacity:t,progressPercent:o}}function h(e){if(!e||0===Object.keys(e.cards).length)return{remainingCoupons:null,totalCoupons:null,activeCardsCount:0,completedCardsCount:0,totalCouponsRedeemed:0,progressPercent:null};let t=Object.values(e.cards),r=p(e),n=t.filter(e=>e.rewards.length<e.size&&"VALID"==e.status).length,o=t.filter(e=>e.rewards.length>=e.size).length,a=t.reduce((e,t)=>e+t.rewards.length,0),i=null,s=null,l=null;return r&&(i=r.size-r.rewards.length,l=(s=r.size)>0?Math.min(100,(s-i)/s*100):0),{remainingCoupons:i,totalCoupons:s,activeCardsCount:n,completedCardsCount:o,totalCouponsRedeemed:a,progressPercent:l}}function y(e){return e.status?e.status:"VALID"}function w(e){var t;let r;return"VALID"===y(e)&&!(e.rewards.length>0)&&(t=e.createdAt,(r=new Date).setDate(r.getDate()-30),t>r)}function E(e){let t,r;return w(e)?((t=new Date(e.createdAt)).setDate(t.getDate()+30),(r=Math.ceil((t.getTime()-Date.now())/864e5))>0?r:null):null}function A(e,t,r){let n=t.toUpperCase(),o=r?.[n],a=o?.decimalPlaces??2,i=e/Math.pow(10,a),s=i%1==0?0:a,l=new Intl.NumberFormat("en",{style:"decimal",minimumFractionDigits:s,maximumFractionDigits:a}).format(i);if(o){let e=o.symbolSpace?" ":"";return"before"===o.symbolPosition?`${o.symbol}${e}${l}`:`${l}${e}${o.symbol}`}try{return new Intl.NumberFormat("en",{style:"currency",currency:n,currencyDisplay:"narrowSymbol",minimumFractionDigits:s,maximumFractionDigits:a}).format(i)}catch{return`${l} ${n}`}}function S(e){return({STARTER:"Starter",PROFESSIONAL:"Professional",ULTRA:"Ultra",ENTERPRISE:"Enterprise"})[e]}function b(e,t="Unlimited"){return null===e||"Infinity"===e?t:String(e)}function I(e,t){let r={cs:"CZK",da:"DKK",en:"EUR",de:"EUR",sk:"EUR",pl:"PLN",sv:"SEK",nb:"NOK",nn:"NOK",hu:"HUF",fr:"EUR",it:"EUR",es:"EUR",nl:"EUR",pt:"EUR",fi:"EUR",el:"EUR",et:"EUR",lv:"EUR",lt:"EUR",sl:"EUR",mt:"EUR",ro:"RON",bg:"BGN",hr:"EUR",is:"ISK",tr:"TRY",uk:"UAH",ja:"JPY",zh:"CNY",ko:"KRW"}[e];return r&&t.includes(r)?r:t.includes("EUR")?"EUR":t[0]}function C(e){return"PROFESSIONAL"===e}function R(e,t){return Object.entries(e).filter(([,e])=>e.isActive).map(([e])=>e).filter(e=>Object.values(t).some(t=>{let r=t.pricing.MONTHLY?.formattedAmount[e],n=t.pricing.YEARLY?.formattedAmount[e];return null!=r||null!=n}))}function P(e,t,r){let n=e.pricing[t];return n?n.formattedAmount[r]:null}function v(e,t){return null!==e.pricing[t]}function T(e){let t=100*e.feePercentage;return`${t.toFixed(1)}%`}function k(e){return!!e&&e.feePercentage>0}function U(e){return!!e?.canSellThroughPlatform}function D(e,t){return{id:e,userId:"string"==typeof t.userId?t.userId:null,email:"string"==typeof t.email?t.email:null,date:a(t.date),app:t.app??"STAMPIT_APP",type:t.type??"SUPPORT",details:"string"==typeof t.details?t.details:"",isClosed:"boolean"==typeof t.isClosed?t.isClosed:null}}function O(e,t){return{id:e,createdAt:a(t.createdAt),email:"string"==typeof t.email?t.email:"",locale:"string"==typeof t.locale?t.locale:"",message:"string"==typeof t.message?t.message:"",source:"string"==typeof t.source?t.source:"",isResolved:"boolean"==typeof t.isResolved?t.isResolved:null}}function F(e,t){return{id:e,userId:t.userId||"",nickname:t.nickname||void 0,email:t.email||void 0,privileges:t.privileges||[],invitationStatus:t.invitationStatus||void 0,invitedBy:t.invitedBy||void 0,invitedAt:t.invitedAt||void 0,respondedAt:t.respondedAt??void 0}}function L(e){return{totalStamps:e.totalStamps||0,totalRewards:e.totalRewards||0,activeUsers:e.activeUsers||0,startDate:a(e.startDate),endDate:a(e.endDate),rewardRecords:(e.rewardRecords||[]).map(e=>u(e)),stampRecords:(e.stampRecords||[]).map(e=>l(e))}}function N(e){return{totalCards:e.totalCards||0,totalRewards:e.totalRewards||0,activeUsers:e.activeUsers||0,startDate:a(e.startDate),endDate:a(e.endDate),cards:(e.cards||[]).map(e=>d(e,e.id||"")),rewardRecords:(e.rewardRecords||[]).map(e=>c(e))}}function x(e,t){return{id:e,authorId:t.authorId??"",title:t.title??"",description:t.description??"",imageUrl:t.imageUrl??null,releaseDate:t.releaseDate,createdAt:t.createdAt,status:t.status??"CREATED",releaseDetails:t.releaseDetails?{notificationSentCount:t.releaseDetails.notificationSentCount}:null}}function K(e,t="en"){try{return new Intl.DisplayNames([t],{type:"region"}).of(e.toUpperCase())??e.toUpperCase()}catch{return e.toUpperCase()}}let M=["upgrade-tier","verify-identity","add-payouts"];function j(e,t,r){let n=Object.values(e.couponsPrograms).some(e=>"ACTIVE"===e.status),o={"upgrade-tier":e.tier&&r?.canSellThroughPlatform?"done":"pending","verify-identity":t?.chargesEnabled===!0?"done":"pending","add-payouts":t?.payoutsEnabled===!0?"done":"pending"},a=M.find(e=>"pending"===o[e])??null;return{hasCoupons:n,steps:o,nextStep:a,isReady:n&&null===a}}e.s(["COUPONS_SETUP_STEP_ORDER",0,M,"computeCouponsSetupState",()=>j],449991),e.s([],697959),e.s([],446527),e.i(697959),e.i(449991),e.s(["INITIAL_AUTH_STATE",0,{user:null,loading:!0,error:null},"PRICING_FEATURES",0,[{key:"maxLocations",translationKey:"locations",type:"numeric",section:"programs",cardVisible:!0},{key:"maxLoyaltyPrograms",translationKey:"loyaltyPrograms",type:"numeric",section:"programs",cardVisible:!0},{key:"maxCouponsPrograms",translationKey:"couponsPrograms",type:"numeric",section:"programs",cardVisible:!0},{key:"maxTeamMembers",translationKey:"teamMembers",type:"numeric",section:"team",cardVisible:!0},{key:"maxNewsPerMonth",translationKey:"newsPerMonth",type:"numeric",section:"engagement"},{key:"pushNotifications",translationKey:"pushNotifications",type:"boolean",section:"engagement",cardVisible:!0},{key:"canSellThroughPlatform",translationKey:"sellThroughPlatform",type:"boolean",section:"sales"},{key:"canCreateCustomerSubscriptions",translationKey:"customerSubscriptions",type:"boolean",section:"sales",comingSoon:!0},{key:"canCreateGiftCards",translationKey:"giftCards",type:"boolean",section:"sales",comingSoon:!0},{key:"feePercentage",translationKey:"platformFee",type:"fee",section:"sales",cardVisible:!0},{key:"nfcBox",translationKey:"nfcBox",type:"custom",section:"hardware"}],"PRICING_FEATURE_SECTIONS",0,[{key:"programs",translationKey:"programs"},{key:"team",translationKey:"team"},{key:"engagement",translationKey:"engagement"},{key:"sales",translationKey:"sales"},{key:"hardware",translationKey:"hardware",optional:!0}],"SUPPORTED_PAYMENT_COUNTRIES",0,["AT","BE","BG","CH","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GI","GR","HR","HU","IE","IT","LI","LT","LU","LV","MT","NL","NO","PL","PT","RO","SE","SI","SK"],"TIER_ORDER",0,["STARTER","PROFESSIONAL","ULTRA","ENTERPRISE"],"VISIBLE_PARTNER_STATUSES",0,["ACTIVE","SUSPENDED"],"canProcessPayments",()=>k,"canRequestCardRefund",()=>w,"computeCouponsStats",()=>h,"computeLoyaltyStats",()=>g,"emptyUserPartnerRecords",()=>f,"firebaseUserToUser",()=>s,"formatFeePercentage",()=>T,"formatPurchaseAmount",()=>A,"formatTierValue",()=>b,"getActiveCard",()=>p,"getActiveCurrencies",()=>R,"getCardRefundDaysRemaining",()=>E,"getCountryDisplayName",()=>K,"getCouponsCardStatus",()=>y,"getDefaultCurrencyForLocale",()=>I,"getTierDisplayName",()=>S,"getTierPrice",()=>P,"hasPricing",()=>v,"isFeaturedTier",()=>C,"tierCanSellThroughPlatform",()=>U,"toNews",()=>x,"toPartner",()=>i,"toPartnerCouponsProgramStatistics",()=>N,"toPartnerLoyaltyProgramStatistics",()=>L,"toReport",()=>D,"toRequest",()=>O,"toTeamMember",()=>F,"toUserPartnerRecords",()=>m],253652)},45919,e=>{"use strict";e.s(["ClientErrorListeners",()=>s]);var t=e.i(271645),r=e.i(800294);
2let n=/^(chrome|moz|safari|safari-web)-extension:/i,o=[/reCAPTCHA has already been rendered/i];function a(e){return!!e&&o.some(t=>t.test(e))}function i(e){if(!e)return!1;if(n.test(e))return!0;let t=e.includes("<anonymous>"),r=/https?:\/\//.test(e);return t&&!r}function s({service:e}){return(0,t.useEffect)(()=>{let t=t=>{var o;if(a(t.message)||!(o=t.filename)||"<anonymous>"===o||n.test(o)||o.startsWith("about:"))return;let s=t.error instanceof Error?t.error:Error(t.message);a(s.message)||i(s.stack)||(0,r.reportError)(s,{service:e,extra:{source:"window.onerror",filename:t.filename,lineno:t.lineno,colno:t.colno}},{skipSentry:!0})},o=t=>{let n=t.reason,o=n instanceof Error?n:Error("string"==typeof n?n:JSON.stringify(n));a(o.message)||i(o.stack)||(0,r.reportError)(o,{service:e,extra:{source:"unhandledrejection"}},{skipSentry:!0})};return window.addEventListener("error",t),window.addEventListener("unhandledrejection",o),()=>{window.removeEventListener("error",t),window.removeEventListener("unhandledrejection",o)}},[e]),null}},800294,e=>{"use strict";e.s(["reportError",()=>n]);var t=e.i(662537),r=e.i(957688);function n(e,o={},a){a?.skipSentry||function(e,n){try{let o=(0,r.resolveService)(n.service);t.captureException(e,{tags:{service:o,...n.user?.role?{role:n.user.role}:{}},user:n.user?{id:n.user.id,email:n.user.email}:void 0,extra:n.extra,fingerprint:n.fingerprint,level:n.level})}catch{}}(e,o);let i=function(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message,stack:e.stack};if("string"==typeof e)return{name:"Error",message:e};try{return{name:"Error",message:JSON.stringify(e)}}catch{return{name:"Error",message:String(e)}}}(e),s={name:i.name,message:i.message,stack:i.stack,context:{service:o.service,user:o.user,extra:o.extra,request:{url:window.location.href}},skipSentry:!0};try{fetch("/api/log/errors",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),credentials:"same-origin",keepalive:!0}).catch(()=>{})}catch{}}e.i(45919)},486637,547854,884582,650547,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(151718);var n=e.i(618357);e.i(446527);var o=e.i(253652);e.i(328872);var a=e.i(480223);async function i(e,t){let r=await fetch("/api/auth/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:e}),credentials:"include",signal:t});if(!r.ok)throw Error(`Session exchange failed: ${r.status}`)}async function s(e){await fetch("/api/auth/session",{method:"DELETE",credentials:"include",signal:e})}async function l(){try{let e=await fetch("/api/auth/me",{method:"GET",credentials:"include"});if(!e.ok)return null;let t=await e.json();return t&&t.customToken?t:null}catch{return null}}async function u(){let e=(0,a.getFirebaseAuth)(),t=new n.GoogleAuthProvider;return t.addScope("email"),t.addScope("profile"),(await (0,n.signInWithPopup)(e,t)).user}async function c(){let e=(0,a.getFirebaseAuth)(),t=new n.GoogleAuthProvider;t.addScope("email"),t.addScope("profile"),await (0,n.signInWithRedirect)(e,t)}async function d(){let e=(0,a.getFirebaseAuth)(),t=new n.OAuthProvider("apple.com");return t.addScope("email"),t.addScope("name"),(await (0,n.signInWithPopup)(e,t)).user}async function m(){let e=(0,a.getFirebaseAuth)(),t=new n.OAuthProvider("apple.com");t.addScope("email"),t.addScope("name"),await (0,n.signInWithRedirect)(e,t)}e.i(247167),e.s(["clearSessionCookie",()=>s,"exchangeTokenForSession",()=>i,"getSessionUser",()=>l],547854);let f="emailForSignIn";function p(e){try{return window.localStorage.getItem(e)}catch{return null}}function g(){return".stampit.app"}function h(){if("u"<typeof document)return null;let e=document.cookie.match(RegExp(`(?:^|;\\s*)${f}=([^;]+)`));return e?decodeURIComponent(e[1]):null}async function y(e,t){let r=(0,a.getFirebaseAuth)(),o={url:t||window.location.href,handleCodeInApp:!0,linkDomain:"login.stampit.app",iOS:{bundleId:"com.stampit.stampit"},android:{packageName:"com.stampit.stampit",installApp:!0,minimumVersion:"12"}};await (0,n.sendSignInLinkToEmail)(r,e,o);try{window.localStorage.setItem(f,e)}catch{}!function(e){if("u"<typeof document)return;let t=g();if(!t)return;let r="https:"===window.location.protocol?"; Secure":"";document.cookie=`${f}=${encodeURIComponent(e)}; Path=/; Domain=${t}; Max-Age=3600; SameSite=Lax${r}`}(e)}function w(e){let t=(0,a.getFirebaseAuth)();return(0,n.isSignInWithEmailLink)(t,e||window.location.href)}async function E(e,t){let r=(0,a.getFirebaseAuth)(),o=t||window.location.href,i=e;if(i||(i=p(f)||h()||void 0),!i)throw Error("Email is required to complete sign-in");let s=await (0,n.signInWithEmailLink)(r,i,o);try{window.localStorage.removeItem(f)}catch{}return!function(){if("u"<typeof document)return;let e=g();e&&(document.cookie=`${f}=; Path=/; Domain=${e}; Max-Age=0; SameSite=Lax`)}(),s.user}async function A(e,t){let r=(0,a.getFirebaseAuth)();return(await (0,n.signInWithEmailAndPassword)(r,e,t)).user}async function S(e,t){let r=(0,a.getFirebaseAuth)();return(await (0,n.createUserWithEmailAndPassword)(r,e,t)).user}async function b(){let e=(0,a.getFirebaseAuth)(),t=await (0,n.getRedirectResult)(e);return t?.user?t.user:null}async function I(){try{await s()}catch(e){console.error("[Auth] Failed to clear session cookie during signOut:",e)}let e=(0,a.getFirebaseAuth)();await (0,n.signOut)(e)}var C=e.i(662537);function R(){C.setUser(null)}var P=e.i(800294);let v=(0,r.createContext)(null);function T({children:e,onBootstrap:i}
2){let s=(0,r.useRef)(!1),l=(0,r.useRef)(i);l.current=i;let[g,T]=(0,r.useState)(o.INITIAL_AUTH_STATE);(0,r.useEffect)(()=>{let e=!0,t=null,r=null,i=null,u=!1,c=0,d=()=>{r&&(clearTimeout(r),r=null)},m=()=>{let m,y=++c;try{m=(0,a.getFirebaseAuth)()}catch(t){(0,P.reportError)(t,{extra:{feature:"auth",operation:"getFirebaseAuth"}}),e&&T({user:null,loading:!1,error:t});return}if(l.current&&!u&&(r=setTimeout(g,5e3)),i=(0,n.onAuthStateChanged)(m,async r=>{if(y===c){if(d(),r){var a;let t=(0,o.firebaseUserToUser)({uid:r.uid,email:r.email,displayName:r.displayName,photoURL:r.photoURL,emailVerified:r.emailVerified,phoneNumber:r.phoneNumber});a={id:t.uid,email:t.email??void 0},C.setUser({id:a.id,email:a.email,role:a.role}),e&&T({user:t,loading:!1,error:null}),s.current=!0;return}if(!s.current&&l.current){s.current=!0;try{let r=await Promise.race([l.current(),new Promise(e=>{t=setTimeout(()=>e(null),8e3)})]);if(t&&(clearTimeout(t),t=null),!e)return;if(r?.customToken)return void await (0,n.signInWithCustomToken)(m,r.customToken)}catch(e){(0,P.reportError)(e,{extra:{feature:"auth",operation:"bootstrap"}})}R(),e&&T({user:null,loading:!1,error:null});return}s.current=!0,R(),e&&T({user:null,loading:!1,error:null})}},t=>{y===c&&(d(),(0,P.reportError)(t,{extra:{feature:"auth",operation:"onAuthStateChanged-listener"}}),R(),e&&T({user:null,loading:!1,error:t}))}),b().then(e=>{e&&console.debug("[Auth] Redirect sign-in completed")}).catch(e=>{(0,P.reportError)(e,{extra:{feature:"auth",operation:"handleRedirectResult"}})}),w()){let t=p(f)||h();t?E(t).then(()=>{console.debug("[Auth] Email link sign-in completed")}).catch(t=>{let r=t?.code,n="auth/invalid-action-code"===r;(0,P.reportError)(t,{level:n?"warning":"error",extra:{feature:"auth",operation:"completeEmailLinkSignIn",errorCode:r}}),e&&T(e=>({...e,error:t,loading:!1}))}):(console.warn("[Auth] Email link detected but no stored email found — cannot auto-complete sign-in"),e&&T(e=>({...e,loading:!1,error:Error("missing-email-for-sign-in")})))}};async function g(){if(e&&!u){if(u=!0,r=null,console.warn("[Auth] onAuthStateChanged did not fire within 5000ms — resetting Firebase client and retrying via bootstrap"),i){try{i()}catch{}i=null}s.current=!1;try{await (0,a.resetFirebaseClient)(),console.debug("[Auth] Firebase client reset; re-subscribing with non-IDB persistence")}catch(e){(0,P.reportError)(e,{extra:{feature:"auth",operation:"resetFirebaseClient"}})}e&&(m(),setTimeout(()=>{e&&T(e=>e.loading?(console.warn("[Auth] Recovery failed to produce an auth callback; forcing loading=false"),{user:null,loading:!1,error:null}):e)},5e3))}}return m(),()=>{e=!1,t&&clearTimeout(t),d(),i&&i()}},[]);let k=(0,r.useCallback)(async()=>{T(e=>({...e,loading:!0,error:null}));try{await u()}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),U=(0,r.useCallback)(async()=>{T(e=>({...e,loading:!0,error:null}));try{await c()}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),D=(0,r.useCallback)(async()=>{T(e=>({...e,loading:!0,error:null}));try{await d()}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),O=(0,r.useCallback)(async()=>{T(e=>({...e,loading:!0,error:null}));try{await m()}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),F=(0,r.useCallback)(async(e,t)=>{T(e=>({...e,loading:!0,error:null}));try{await y(e,t),T(e=>({...e,loading:!1}))}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),L=(0,r.useCallback)(async e=>{T(e=>({...e,loading:!0,error:null}));try{await E(e)}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),N=(0,r.useCallback)(()=>w(),[]),x=(0,r.useCallback)(()=>p(f)||h(),[]),K=(0,r.useCallback)(async(e,t)=>{T(e=>({...e,loading:!0,error:null}));try{await A(e,t)}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),M=(0,r.useCallback)(async(e,t)=>{T(e=>({...e,loading:!0,error:null}));try{await S(e,t)}catch(e){throw T(t=>({...t,loading:!1,error:e})),e}},[]),j=(0,r.useCallback)(async()=>{try{await I(),R(),T({user:null,loading:!1,error:null})}catch(e){throw T(t=>({...t,error:e})),e}},[]),_=(0,r.useMemo)(()=>({...g,signInWithGoogle:k,signInWithGoogleRedirect:U,signInWithApple:D,signInWithAppleRedirect:O,sendEmailLink:F,completeEmailLinkSignIn:L,isEmailLinkSignIn:N,getStoredEmailForSignIn:x,signInWithEmailPassword:K,createAccountWithEmailPassword:M,signOut:j}),[g,k,U,D,O,F,L,N,x,K,M,j]);return(0,t.jsx)(v.Provider,{value:_,children:e})}function k(){let e=(0,r.useContext)(v);if(!e)throw Error("useAuth must be used within an AuthProvider");return e}function U(){let{user:e}=k();return e}function D(){let{user:e,loading:t}=k();return!t&&null!==e}function O(){let{loading:e}=k();return e}e.s(["AuthProvider",()=>T,"useAuth",()=>k,"useAuthLoading",()=>O,"useIsAuthenticated",()=>D,"useUser",()=>U],884582);let F=new Set(["http:","https:"]);function L(e,t="/"){let r,n;if(!e||"string"!=typeof e||e.startsWith("//"))return t;if(e.startsWith("/"))return e;try{r=new URL(e)}catch{return t}if(!F.has(r.protocol))return t;let o=r.hostname.toLowerCase();return o===window.location.hostname.toLowerCase()?r.pathname+r.search+r.hash:o===(n="stampit.app")||o.endsWith(`.${n}`)?r.toString():t}e.s(["sanitizeCrossOriginReturnUrl",()=>L],650547),e.s([],486637)}]);
3
4//# debugId=74cd6131-619a-5308-0a76-acaab5516ccf

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.