@glideidentity/web-client-sdk 6.0.0-beta.1 → 6.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GlideWebClientSDK=e():n.GlideWebClientSDK=e()}(this,()=>(()=>{"use strict";var n={d:(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(n,e)=>Object.prototype.hasOwnProperty.call(n,e),r:n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},e={};n.r(e),n.d(e,{AUTHENTICATION_STRATEGY:()=>i,AuthModal:()=>x,ERROR_CODES:()=>s,PhoneAuthClient:()=>E,USE_CASE:()=>t,createAuthError:()=>h,createQRCodeDataFromDesktop:()=>w,getUserMessage:()=>p,isAuthCredential:()=>S,isAuthError:()=>d,isCancellable:()=>_,isClientError:()=>c,isDesktopData:()=>T,isDesktopStrategy:()=>I,isErrorResponse:()=>D,isGetPhoneNumberResponse:()=>P,isInvokeResult:()=>C,isLinkData:()=>O,isLinkStrategy:()=>R,isRetryableError:()=>g,isTS43Data:()=>N,isTS43Strategy:()=>A,isVerifyPhoneNumberResponse:()=>L,validatePhoneNumber:()=>r,validatePlmn:()=>a});const t={GET_PHONE_NUMBER:"GetPhoneNumber",VERIFY_PHONE_NUMBER:"VerifyPhoneNumber"},i={TS43:"ts43",LINK:"link",DESKTOP:"desktop"},o=/^\+[1-9]\d{1,14}$/;function r(n){return n?n.startsWith("+")?n.length<8?{valid:!1,error:"Phone number too short for E.164 format (minimum 8 characters including +)"}:n.length>16?{valid:!1,error:"Phone number too long for E.164 format (maximum 15 digits after +)"}:/^\+\d+$/.test(n)?o.test(n)?{valid:!0}:{valid:!1,error:"Invalid E.164 phone number format"}:{valid:!1,error:"Phone number contains invalid characters. E.164 format only allows + followed by digits"}:{valid:!1,error:"Phone number must be in E.164 format (start with +)"}:{valid:!0}}function a(n){if(!n)return{valid:!0};const{mcc:e,mnc:t}=n;return e&&/^\d{3}$/.test(e)?t&&/^\d{2,3}$/.test(t)?{valid:!0}:{valid:!1,error:"MNC must be 2 or 3 digits"}:{valid:!1,error:"MCC must be exactly 3 digits"}}const s={INVALID_PHONE_NUMBER:"INVALID_PHONE_NUMBER",INVALID_PLMN:"INVALID_PLMN",MISSING_PARAMETERS:"MISSING_PARAMETERS",BROWSER_NOT_SUPPORTED:"BROWSER_NOT_SUPPORTED",UNSUPPORTED_STRATEGY:"UNSUPPORTED_STRATEGY",USER_CANCELLED:"USER_CANCELLED",CANCELLED:"CANCELLED",VERIFICATION_FAILED:"VERIFICATION_FAILED",NETWORK_ERROR:"NETWORK_ERROR",TIMEOUT:"TIMEOUT",INVALID_RESPONSE:"INVALID_RESPONSE"},l={[s.INVALID_PHONE_NUMBER]:"Please enter a valid phone number in E.164 format (e.g., +14155551234).",[s.INVALID_PLMN]:"Invalid carrier information provided.",[s.MISSING_PARAMETERS]:"Required information is missing.",[s.BROWSER_NOT_SUPPORTED]:"Your browser does not support this authentication method. Please use Chrome or Edge with the Digital Credentials flag enabled.",[s.UNSUPPORTED_STRATEGY]:"This authentication strategy is not supported.",[s.USER_CANCELLED]:"Authentication was cancelled.",[s.CANCELLED]:"Authentication was cancelled.",[s.VERIFICATION_FAILED]:"Verification failed. Please try again.",[s.NETWORK_ERROR]:"Network connection failed. Please check your connection and try again.",[s.TIMEOUT]:"Request timed out. Please try again.",[s.INVALID_RESPONSE]:"Invalid response received."};function d(n){return null!==n&&"object"==typeof n&&"code"in n&&"message"in n&&"string"==typeof n.code&&"string"==typeof n.message}function c(n){return Object.values(s).includes(n.code)}function g(n){return n.code===s.NETWORK_ERROR||n.code===s.TIMEOUT}function p(n){return c(n)&&l[n.code]||n.message}function h(n,e,t){const i=new Error(e||l[n]||n);return i.code=n,i.details=t,i.timestamp=(new Date).toISOString(),i}const u=/(\+?[1-9]\d{6,14})/g,b=/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g,m=/(eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*)/g,f=/session[_-]?key["']?\s*[:=]\s*["']?([a-zA-Z0-9_-]{20,})["']?/gi;function y(n){if(null==n)return n;if("string"==typeof n){let e=n;return e=e.replace(u,n=>n.length<8?n:n.slice(0,2)+"***"+n.slice(-4)),e=e.replace(b,n=>{const[e,t]=n.split("@");return e.slice(0,1)+"***@"+t}),e=e.replace(m,"[JWT]"),e=e.replace(f,(n,e)=>n.replace(e,e.slice(0,4)+"***"+e.slice(-4))),e}if(Array.isArray(n))return n.map(y);if("object"==typeof n){const e={};for(const[t,i]of Object.entries(n))["phone_number","phoneNumber","credential","token","password","secret"].some(n=>t.toLowerCase().includes(n.toLowerCase()))?e[t]="string"==typeof i?"[REDACTED]":i:e[t]=y(i);return e}return n}function v(n){const{sessionKey:e,interval:t=2e3,maxAttempts:i=30,pollingEndpoint:o,statusUrl:r,logger:a}=n;let l,d,c=0,g=!1,p=!1;function u(){p=!1,l&&(clearInterval(l),l=void 0)}return{start:function(){return new Promise((n,s)=>{d=s,p=!0,c=0;const h=async()=>{if(p&&!g){if(c>=i)return u(),a?.warn("Polling timeout reached",{attempts:c,maxAttempts:i}),void n({status:"expired",message:"Authentication timeout"});try{const t=o?(a?.debug("Using developer config endpoint for polling",{pollingEndpoint:o}),`${o}/${e}`):r?(a?.debug("Using backend status_url for polling",{statusUrl:r}),r):(a?.debug("Using prod fallback for status polling"),`https://api.glideidentity.app/public/status/${e}`);a?.debug("Polling status",{url:t,attempt:c+1,maxAttempts:i});const s=await fetch(t,{method:"GET",headers:{Accept:"application/json"}});if(200===s.status){const t=await s.json();if("completed"===t.status)return u(),a?.info("Authentication completed"),void n({status:"completed",credential:t.credential||e,session:t.session||{session_key:e}});c++}else if(410===s.status){u();const e=await s.json().catch(()=>({}));n({status:"expired",message:e.message||"Session expired"})}else if(422===s.status){u();const e=await s.json().catch(()=>({}));n({status:"error",message:e.message||"Authentication failed"})}else 404===s.status?(u(),n({status:"error",message:"Session not found"})):c++}catch(n){a?.debug("Polling error, retrying",{error:n,attempt:c+1}),c++}}};h(),l=setInterval(h,t)})},stop:u,cancel:function(){a?.debug("Polling cancelled"),g=!0,u(),d&&(d(h(s.CANCELLED,"Authentication cancelled")),d=void 0)},isPolling:function(){return void 0!==l},cleanup:function(){u(),g=!1,d=void 0}}}class x{constructor(n){this.container=null,this.backdrop=null,this.isOpen=!1,this.currentStep="os-choice",this.qrCodeData=null,this.statusMessage="",this.originalBodyOverflow="",this.isClosing=!1,this.iconApple='<svg class="glide-icon glide-icon-os" viewBox="0 0 384 512" fill="currentColor"><path d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 52.3-11.4 69.5-34.3z"/></svg>',this.iconAndroid='<svg class="glide-icon glide-icon-os" viewBox="0 0 576 512" fill="currentColor"><path d="M420.55,301.93a24,24,0,1,1,24-24,24,24,0,0,1-24,24m-265.1,0a24,24,0,1,1,24-24,24,24,0,0,1-24,24m273.7-144.48,47.94-83a10,10,0,1,0-17.27-10h0l-48.54,84.07a301.25,301.25,0,0,0-246.56,0L116.18,64.45a10,10,0,1,0-17.27,10h0l47.94,83C64.53,202.22,8.24,285.55,0,384H576c-8.24-98.45-64.54-181.78-146.85-226.55"/></svg>',this.iconBack='<svg class="glide-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',this.options=n||{},this.theme=this.options.theme||"auto",this.handleEscapeKey=this.handleEscapeKey.bind(this)}shouldUseDarkMode(){return"dark"===this.theme||"light"!==this.theme&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}handleEscapeKey(n){"Escape"===n.key&&this.isOpen&&!1!==this.options?.closeOnEscape&&(this.closeCallback?.(),this.close())}escapeHtml(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}showQRCode(n,e="Scan with your phone camera"){this.qrCodeData=n,this.statusMessage=e;const t=this.options.viewMode||"toggle";if("string"==typeof n)this.renderToggleMode(n,e);else switch(t){case"dual":this.renderDualMode(n,e);break;case"pre-step":this.renderPreStepMode(n,e);break;default:this.renderToggleMode(n,e)}this.show()}updateStatus(n,e=!1){if(this.statusMessage=n,this.container){const t=this.container.querySelector("#glide-status");t&&(t.textContent=n,t.style.color=e?"#ff3b30":"")}}setCloseCallback(n){this.closeCallback=n}renderToggleMode(n,e){let t="",i="";"string"==typeof n?(t=n,i=n):(t=n.iosQRCode,i=n.androidQRCode||n.iosQRCode);const o=`\n <div class="glide-content">\n <div class="glide-toggle" id="glide-toggle" data-active="ios">\n <div class="glide-toggle-slider"></div>\n <button class="glide-btn glide-toggle-btn active" data-platform="ios">${this.iconApple}<span>iOS</span></button>\n <button class="glide-btn glide-toggle-btn" data-platform="android">${this.iconAndroid}<span>Android</span></button>\n </div>\n\n <div class="glide-qr-area">\n <img \n class="glide-qr-img"\n id="glide-qr-img" \n src="${this.escapeHtml(t)}" \n alt="QR Code" \n class="glide-qr-img" \n data-ios="${this.escapeHtml(t)}"\n data-android="${this.escapeHtml(i)}"\n />\n \n \x3c!-- Animation Overlay (Inside QR Area for centering) --\x3e\n <div id="glide-phone-overlay" class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n </div>\n </div>\n `;this.createModal(o,"",!0),this.setupPlatformToggles(),this.setupHelpInteraction()}renderDualMode(n,e){const t='\n <div class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n ';this.createModal(`\n <div class="glide-content glide-dual-mode">\n <div class="glide-dual-container">\n <div class="glide-dual-item">\n <div class="glide-os-logo">\n ${this.iconApple}\n <span>iOS</span>\n </div>\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(n.iosQRCode)}" alt="iOS QR" class="glide-qr-img" />\n ${t}\n </div>\n </div>\n <div class="glide-dual-separator">\n <div class="glide-separator-line"></div>\n <span class="glide-separator-text">or</span>\n <div class="glide-separator-line"></div>\n </div>\n <div class="glide-dual-item">\n <div class="glide-os-logo">\n ${this.iconAndroid}\n <span>Android</span>\n </div>\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(n.androidQRCode||n.iosQRCode)}" alt="Android QR" class="glide-qr-img" />\n ${t}\n </div>\n </div>\n </div>\n </div>\n `,"glide-modal-wide",!0),this.setupHelpInteraction()}renderPreStepMode(n,e){this.currentStep="os-choice";const t=`\n <div class="glide-pre-step-container">\n <button class="glide-os-choice-btn" id="glide-btn-ios">\n ${this.iconApple}\n <span>iOS</span>\n </button>\n <button class="glide-os-choice-btn" id="glide-btn-android">\n ${this.iconAndroid}\n <span>Android</span>\n </button>\n </div>\n `;this.createModal(t,"",!1),this.setupPreStepListeners(),this.show()}setupPreStepListeners(){this.container&&(this.container.querySelector("#glide-btn-ios")?.addEventListener("click",()=>{this.currentStep="ios-qr",this.updatePreStepUI()}),this.container.querySelector("#glide-btn-android")?.addEventListener("click",()=>{this.currentStep="android-qr",this.updatePreStepUI()}))}updatePreStepUI(){if(!this.container)return;let n="";if("os-choice"===this.currentStep)n=`\n <div class="glide-pre-step-container">\n <button class="glide-os-choice-btn" id="glide-btn-ios">\n ${this.iconApple}\n <span>iOS</span>\n </button>\n <button class="glide-os-choice-btn" id="glide-btn-android">\n ${this.iconAndroid}\n <span>Android</span>\n </button>\n </div>\n `,this.createModal(n,"",!1),this.setupPreStepListeners();else if("ios-qr"===this.currentStep){const e="object"==typeof this.qrCodeData&&this.qrCodeData?.iosQRCode?this.qrCodeData.iosQRCode:this.qrCodeData;n=`\n <div class="glide-content">\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(e)}" alt="QR Code" class="glide-qr-img" />\n \n \x3c!-- Animation Overlay --\x3e\n <div id="glide-phone-overlay" class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n </div>\n </div>\n `,this.createModal(n,"",!0,!0),this.setupBackButton(),this.setupHelpInteraction()}else if("android-qr"===this.currentStep){const e="object"==typeof this.qrCodeData&&this.qrCodeData?.androidQRCode?this.qrCodeData.androidQRCode:"object"==typeof this.qrCodeData&&this.qrCodeData?.iosQRCode?this.qrCodeData.iosQRCode:this.qrCodeData;n=`\n <div class="glide-content">\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(e)}" alt="QR Code" class="glide-qr-img" />\n \n \x3c!-- Animation Overlay --\x3e\n <div id="glide-phone-overlay" class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n </div>\n </div>\n `,this.createModal(n,"",!0,!0),this.setupBackButton(),this.setupHelpInteraction()}}setupBackButton(){this.container&&this.container.querySelector("#glide-back-btn")?.addEventListener("click",()=>{this.currentStep="os-choice",this.updatePreStepUI()})}createModal(n,e="",t=!1,i=!1){this.isClosing&&(this.isClosing=!1,this.cleanup()),this.container?(this.container.className=`glide-modal ${e}`,this.shouldUseDarkMode()&&this.container.classList.add("dark")):(this.backdrop=document.createElement("div"),this.backdrop.className="glide-backdrop",this.backdrop.id="glide-backdrop",this.container=document.createElement("div"),this.container.className=`glide-modal ${e}`,this.container.id="glide-modal",this.shouldUseDarkMode()&&this.container.classList.add("dark"),this.isOpen&&(document.body.appendChild(this.backdrop),document.body.appendChild(this.container))),this.container.innerHTML=`\n ${i?`\n <button class="glide-btn glide-btn-back" id="glide-back-btn" aria-label="Back">\n ${this.iconBack}\n </button>\n `:""}\n ${!1!==this.options?.showCloseButton?'\n <button class="glide-btn glide-btn-close" id="glide-close-btn" aria-label="Close">\n <svg class="glide-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n ':""}\n <h2 class="glide-title">${this.options?.title||"Scan to Verify"}</h2>\n <div id="glide-modal-content">${n}</div>\n <p class="glide-status" id="glide-status">${this.options?.description||""}</p>\n ${t?'\n <button class="glide-btn glide-btn-help" id="glide-help-btn">?</button>\n ':""}\n `,this.injectStyles();const o=this.container.querySelector("#glide-close-btn");o&&o.addEventListener("click",()=>{this.closeCallback?.(),this.close()}),this.backdrop&&(this.backdrop.onclick=n=>{n.target===this.backdrop&&!1!==this.options?.closeOnBackdropClick&&(this.closeCallback?.(),this.close())})}setupHelpInteraction(){const n=this.container?.querySelector("#glide-help-btn");n&&n.addEventListener("click",()=>{const n=this.container?.querySelectorAll(".glide-phone-animation-overlay");n&&n.forEach(n=>{n.classList.remove("playing"),n.offsetWidth,n.classList.add("playing"),setTimeout(()=>{n.classList.remove("playing")},3e3)})})}injectStyles(){if(document.getElementById("glide-modal-styles"))return;const n=document.createElement("style");n.id="glide-modal-styles",n.textContent='\n :root {\n --glide-primary: #007AFF;\n --glide-text: #1d1d1f;\n --glide-bg-light: rgba(255, 255, 255, 0.6);\n --glide-bg-dark: rgba(30, 30, 30, 0.6);\n --glide-phone-border: #000000; /* High Contrast Black */\n \n /* Button sizes */\n --glide-btn-size: 28px;\n --glide-help-btn-size: 24px;\n --glide-toggle-icon-size: 14px;\n --glide-dual-icon-size: 18px;\n }\n\n #glide-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n z-index: 9998;\n opacity: 0;\n transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n #glide-modal {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%) scale(0.94);\n background: var(--glide-bg-light);\n backdrop-filter: blur(24px) saturate(180%);\n -webkit-backdrop-filter: blur(24px) saturate(180%);\n border-radius: 24px;\n padding: 32px;\n width: 360px;\n max-width: 90%;\n box-shadow: \n 0 20px 40px rgba(0,0,0,0.2),\n 0 0 0 1px rgba(255,255,255,0.6) inset,\n 0 0 0 1px rgba(0,0,0,0.05);\n z-index: 9999;\n opacity: 0;\n transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n text-align: center;\n color: var(--glide-text);\n }\n \n #glide-modal.glide-modal-wide {\n width: 600px;\n max-width: 95vw;\n }\n\n #glide-modal.dark {\n background: var(--glide-bg-dark);\n color: white;\n box-shadow: \n 0 20px 40px rgba(0,0,0,0.4),\n 0 0 0 1px rgba(255,255,255,0.15) inset,\n 0 0 0 1px rgba(0,0,0,0.5);\n --glide-phone-border: #ffffff; /* High Contrast White */\n }\n\n #glide-modal .glide-btn-close {\n position: absolute;\n top: 16px;\n right: 16px;\n width: var(--glide-btn-size);\n height: var(--glide-btn-size);\n min-width: var(--glide-btn-size);\n min-height: var(--glide-btn-size);\n max-width: var(--glide-btn-size);\n max-height: var(--glide-btn-size);\n background: rgba(118, 118, 128, 0.12);\n border: none;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n color: rgba(0,0,0,0.5);\n transition: background 0.2s;\n padding: 0;\n z-index: 20;\n box-sizing: border-box;\n flex-shrink: 0;\n }\n\n #glide-modal.dark .glide-btn-close {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255,255,255,0.5);\n }\n\n #glide-modal .glide-btn-close:hover {\n background: rgba(118, 118, 128, 0.2);\n }\n \n #glide-modal.dark .glide-btn-close:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n .glide-title {\n margin: 0 0 8px 0;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n }\n \n .glide-status {\n margin: 12px 0 0 0;\n font-size: 13px;\n color: rgba(0,0,0,0.5);\n text-align: center;\n min-height: 18px;\n }\n \n .glide-status:empty {\n display: none;\n }\n \n #glide-modal.dark .glide-status {\n color: rgba(255,255,255,0.5);\n }\n \n .glide-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n }\n \n /* --- Sliding Toggle Switch --- */\n #glide-toggle {\n background: rgba(118, 118, 128, 0.12);\n padding: 2px;\n border-radius: 8px;\n display: inline-flex;\n margin-bottom: 24px;\n margin-top: 16px;\n position: relative;\n height: 32px;\n width: 200px;\n box-sizing: border-box;\n }\n\n #glide-modal.dark #glide-toggle {\n background: rgba(118, 118, 128, 0.24);\n }\n \n /* The sliding background */\n .glide-toggle-slider {\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(50% - 2px);\n height: calc(100% - 4px);\n background: white;\n border-radius: 6px;\n box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04);\n transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n z-index: 0;\n }\n \n #glide-modal.dark .glide-toggle-slider {\n background: #636366;\n }\n \n /* Move slider for Android */\n #glide-toggle[data-active="android"] .glide-toggle-slider {\n transform: translateX(100%);\n }\n\n .glide-toggle-btn {\n flex: 1;\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: inherit;\n cursor: pointer;\n position: relative;\n z-index: 1;\n transition: color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n min-height: auto;\n height: auto;\n min-width: auto;\n border-radius: 0;\n }\n \n #glide-modal .glide-toggle-btn .glide-icon-os,\n #glide-modal .glide-toggle-btn svg {\n width: var(--glide-toggle-icon-size);\n height: var(--glide-toggle-icon-size);\n flex-shrink: 0;\n margin: 0;\n padding: 0;\n }\n \n .glide-toggle-btn span {\n margin: 0;\n padding: 0;\n line-height: 1;\n }\n \n #glide-modal.dark .glide-toggle-btn {\n color: rgba(255,255,255,0.6);\n }\n \n #glide-toggle[data-active="ios"] .glide-toggle-btn[data-platform="ios"],\n #glide-toggle[data-active="android"] .glide-toggle-btn[data-platform="android"] {\n color: #1d1d1f;\n }\n \n #glide-modal.dark #glide-toggle[data-active="ios"] .glide-toggle-btn[data-platform="ios"],\n #glide-modal.dark #glide-toggle[data-active="android"] .glide-toggle-btn[data-platform="android"] {\n color: white;\n }\n\n /* QR Area */\n .glide-qr-area {\n position: relative;\n margin: 0 auto;\n }\n\n .glide-qr-img {\n width: 200px;\n height: 200px;\n object-fit: contain;\n display: block;\n border-radius: 16px;\n }\n \n /* Dual Mode QR Area - no extra padding, same as single mode */\n .glide-dual-mode .glide-qr-area {\n background: transparent;\n padding: 0;\n }\n \n .glide-dual-mode .glide-qr-img {\n width: 180px;\n height: 180px;\n border-radius: 16px;\n }\n \n /* --- Help Icon & Interaction --- */\n .glide-btn-help {\n position: absolute;\n bottom: 20px;\n right: 20px;\n width: var(--glide-help-btn-size);\n height: var(--glide-help-btn-size);\n min-width: var(--glide-help-btn-size);\n min-height: var(--glide-help-btn-size);\n max-width: var(--glide-help-btn-size);\n max-height: var(--glide-help-btn-size);\n border-radius: 50%;\n border: 1.5px solid rgba(0,0,0,0.2);\n color: rgba(0,0,0,0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n line-height: 1;\n cursor: pointer;\n transition: all 0.2s;\n background: transparent;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n z-index: 10;\n }\n \n #glide-modal.dark .glide-btn-help {\n border-color: rgba(255,255,255,0.3);\n color: rgba(255,255,255,0.5);\n }\n\n .glide-btn-help:hover {\n border-color: var(--glide-primary);\n color: var(--glide-primary);\n background: rgba(0, 122, 255, 0.1);\n }\n \n /* Tooltip */\n .glide-btn-help::after {\n content: "Need help?";\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%) translateY(-8px);\n background: rgba(0,0,0,0.8);\n color: white;\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 11px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n }\n \n .glide-btn-help:hover::after {\n opacity: 1;\n }\n\n /* --- Outlined Phone Animation --- */\n .glide-phone-animation-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.3s;\n border-radius: 16px;\n background: rgba(255,255,255,0.8);\n }\n \n #glide-modal.dark .glide-phone-animation-overlay {\n background: rgba(0,0,0,0.6);\n }\n \n .glide-phone-animation-overlay.playing {\n opacity: 1;\n }\n\n .glide-outlined-phone {\n width: 100px;\n height: 180px;\n border: 4px solid var(--glide-phone-border);\n border-radius: 16px;\n position: relative;\n background: transparent;\n box-shadow: 0 10px 30px rgba(0,0,0,0.2);\n transform: translateY(20px);\n }\n \n /* Notch */\n .glide-outlined-phone::before {\n content: \'\';\n position: absolute;\n top: -1px;\n left: 50%;\n transform: translateX(-50%);\n width: 40%;\n height: 12px;\n background: var(--glide-phone-border);\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n \n /* Scanning Line */\n .glide-scan-line {\n position: absolute;\n top: 10%;\n left: 5%;\n width: 90%;\n height: 2px;\n background: var(--glide-primary);\n box-shadow: 0 0 8px var(--glide-primary);\n opacity: 0;\n }\n \n /* Animation Keyframes */\n @keyframes glide-scan-motion {\n 0% { top: 10%; opacity: 0; }\n 10% { opacity: 1; }\n 90% { opacity: 1; }\n 100% { top: 90%; opacity: 0; }\n }\n \n .glide-phone-animation-overlay.playing .glide-outlined-phone {\n animation: glide-phone-appear 3s ease-in-out forwards;\n }\n \n .glide-phone-animation-overlay.playing .glide-scan-line {\n animation: glide-scan-motion 2s ease-in-out 0.5s infinite;\n }\n \n @keyframes glide-phone-appear {\n 0% { transform: translateY(20px); opacity: 0; }\n 10% { transform: translateY(0); opacity: 1; }\n 90% { transform: translateY(0); opacity: 1; }\n 100% { transform: translateY(20px); opacity: 0; }\n }\n \n /* Dual Mode */\n .glide-dual-container {\n display: flex;\n justify-content: center;\n align-items: stretch;\n gap: 32px;\n margin-top: 20px;\n }\n \n .glide-dual-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n \n .glide-os-logo {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 600;\n margin-bottom: 12px;\n font-size: 15px;\n color: inherit;\n }\n \n /* Dual mode OS logo - aligned icons with text, spacing to QR */\n .glide-dual-mode .glide-os-logo {\n margin-bottom: 12px; /* Space between label and QR code */\n }\n \n #glide-modal .glide-dual-mode .glide-os-logo .glide-icon-os,\n #glide-modal .glide-dual-mode .glide-os-logo svg {\n width: var(--glide-dual-icon-size);\n height: var(--glide-dual-icon-size);\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n }\n \n .glide-dual-mode .glide-os-logo span {\n margin: 0;\n padding: 0;\n line-height: 1;\n }\n \n .glide-os-logo svg {\n width: 20px;\n height: 20px;\n opacity: 0.8;\n }\n \n /* Dual Mode Separator - aligned to QR codes only */\n .glide-dual-separator {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n /* Offset for OS label (18px icon + 12px margin = ~30px) */\n margin-top: 30px;\n padding: 20px 0;\n }\n \n .glide-separator-line {\n width: 1px;\n flex: 1;\n background: linear-gradient(to bottom, transparent, rgba(128,128,128,0.3), transparent);\n }\n \n .glide-separator-text {\n padding: 8px 0;\n font-size: 11px;\n font-weight: 500;\n color: rgba(128,128,128,0.5);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n \n #glide-modal.dark .glide-separator-line {\n background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);\n }\n \n #glide-modal.dark .glide-separator-text {\n color: rgba(255,255,255,0.4);\n }\n \n /* Pre-Step */\n .glide-pre-step-container {\n display: flex;\n gap: 20px;\n justify-content: center;\n margin: 24px 0;\n }\n \n .glide-os-choice-btn {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 140px;\n height: 140px;\n border: 1px solid rgba(0,0,0,0.08);\n border-radius: 20px;\n background: rgba(255,255,255,0.4);\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n position: relative;\n overflow: hidden;\n font-size: 14px;\n color: inherit;\n }\n \n #glide-modal.dark .glide-os-choice-btn {\n background: rgba(255,255,255,0.05);\n border-color: rgba(255,255,255,0.1);\n color: white;\n }\n \n .glide-os-choice-btn:hover {\n background: rgba(255,255,255,0.9);\n transform: translateY(-4px);\n box-shadow: 0 12px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);\n border-color: var(--glide-primary);\n }\n \n #glide-modal.dark .glide-os-choice-btn:hover {\n background: rgba(255,255,255,0.15);\n box-shadow: 0 12px 24px rgba(0,0,0,0.3);\n border-color: var(--glide-primary);\n }\n \n .glide-icon-os {\n width: 40px;\n height: 40px;\n margin-bottom: 12px;\n transition: transform 0.3s;\n fill: currentColor;\n }\n \n .glide-os-choice-btn:hover .glide-icon-os {\n transform: scale(1.1);\n }\n \n #glide-modal .glide-btn-back {\n position: absolute;\n top: 16px;\n left: 16px;\n width: var(--glide-btn-size);\n height: var(--glide-btn-size);\n min-width: var(--glide-btn-size);\n min-height: var(--glide-btn-size);\n max-width: var(--glide-btn-size);\n max-height: var(--glide-btn-size);\n background: rgba(118, 118, 128, 0.12);\n border: none;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n color: rgba(0,0,0,0.5);\n transition: background 0.2s;\n z-index: 20;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n flex-shrink: 0;\n }\n \n #glide-modal.dark .glide-btn-back {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255,255,255,0.5);\n }\n\n .glide-btn-back:hover {\n background: rgba(118, 118, 128, 0.2);\n }\n \n #glide-modal.dark .glide-btn-back:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n \n .glide-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(0,0,0,0.1);\n border-top-color: var(--glide-primary);\n border-radius: 50%;\n animation: glide-spin 1s linear infinite;\n margin: 40px auto;\n }\n \n #glide-modal.dark .glide-spinner {\n border-color: rgba(255,255,255,0.1);\n border-top-color: var(--glide-primary);\n }\n \n @keyframes glide-spin {\n to { transform: rotate(360deg); }\n }\n ',document.head.appendChild(n)}show(){this.container&&this.backdrop&&!this.isOpen?(document.body.appendChild(this.backdrop),document.body.appendChild(this.container),this.lockBodyScroll(),document.addEventListener("keydown",this.handleEscapeKey),requestAnimationFrame(()=>{this.backdrop&&this.container&&(this.backdrop.style.opacity="1",this.container.style.opacity="1",this.container.style.transform="translateX(-50%) scale(1)")}),this.isOpen=!0):this.isOpen&&this.container&&this.backdrop&&(document.removeEventListener("keydown",this.handleEscapeKey),document.addEventListener("keydown",this.handleEscapeKey))}setupPlatformToggles(){const n=this.container?.querySelector("#glide-toggle"),e=this.container?.querySelectorAll(".glide-toggle-btn"),t=this.container?.querySelector("#glide-qr-img"),i=this.container?.querySelector("#glide-platform-message");e&&t&&e.forEach(o=>{o.addEventListener("click",o=>{const r=o.currentTarget,a=r.getAttribute("data-platform");n&&a&&n.setAttribute("data-active",a),e.forEach(n=>n.classList.remove("active")),r.classList.add("active"),"ios"===a?(t.src=t.getAttribute("data-ios")||"",i&&(i.textContent="Scan with your iPhone camera")):"android"===a&&(t.src=t.getAttribute("data-android")||"",i&&(i.textContent="Scan with your Android camera"))})})}lockBodyScroll(){this.originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden"}unlockBodyScroll(){document.body.style.overflow=this.originalBodyOverflow}close(){this.container&&this.backdrop&&this.isOpen&&(this.isClosing=!0,document.removeEventListener("keydown",this.handleEscapeKey),this.backdrop.style.opacity="0",this.container.style.opacity="0",this.container.style.transform="translateX(-50%) scale(0.94)",this.closeCallback=void 0,setTimeout(()=>{this.isClosing&&(this.cleanup(),this.isOpen=!1,this.isClosing=!1)},400))}cleanup(){this.container?.remove(),this.backdrop?.remove(),this.container=null,this.backdrop=null,this.unlockBodyScroll()}isModalOpen(){return this.isOpen}}function w(n){const{data:e}=n;if(e.ios_qr_image)return{iosQRCode:e.ios_qr_image,androidQRCode:e.android_qr_image||e.ios_qr_image};if(e.qr_code_image)return e.qr_code_image;throw new Error("No QR code data available")}class k{constructor(){this.logs=[],this.container=null,this.logsContainer=null,this.floatingToggle=null,this.isAtBottom=!0,this.isVisible=!0,this.originalConsole={log:console.log,error:console.error,warn:console.warn,debug:console.debug,info:console.info},this.interceptConsole(),this.createUI()}static init(){return k.instance||(k.instance=new k),k.instance}static destroy(){k.instance&&(k.instance.cleanup(),k.instance=null)}interceptConsole(){["log","error","warn","debug","info"].forEach(n=>{const e=this.originalConsole[n];console[n]=(...t)=>{e.apply(console,t),this.addLog(n,t)}})}addLog(n,e){const t=(new Date).toTimeString().split(" ")[0],i=e.map(n=>{if("object"==typeof n)try{return JSON.stringify(n,null,2)}catch{return"[Object]"}return String(n)}).join(" "),o={log:"#abb2bf",error:"#e06c75",warn:"#e5c07b",info:"#61afef",debug:"#5c6370"},r=`\n <div style="margin: 3px 0; font-family: 'SF Mono', Menlo, Monaco, monospace; font-size: 11px; color: ${o[n]||"#abb2bf"}; line-height: 1.5;">\n <span style="color: #5c6370; font-size: 10px;">${t}</span>\n <span style="background: ${{log:"#3c3c3c",error:"rgba(224, 108, 117, 0.2)",warn:"rgba(229, 192, 123, 0.2)",info:"rgba(97, 175, 239, 0.2)",debug:"#2d2d2d"}[n]}; color: ${o[n]}; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 500; text-transform: uppercase; margin: 0 6px;">${n}</span>\n <span style="white-space: pre-wrap; word-break: break-all;">${this.escapeHtml(i)}</span>\n </div>\n `;this.logs.push(r),this.logs.length>500&&this.logs.shift(),this.updateDisplay()}updateDisplay(){this.logsContainer&&this.isVisible&&(this.isAtBottom=this.logsContainer.scrollHeight-this.logsContainer.scrollTop<=this.logsContainer.clientHeight+50,this.logsContainer.innerHTML=this.logs.join(""),this.isAtBottom&&(this.logsContainer.scrollTop=this.logsContainer.scrollHeight))}createUI(){const n=document.createElement("style");n.textContent="\n #mobile-debug-console {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n height: 45vh;\n background: #1e1e1e;\n z-index: 999999;\n display: flex;\n flex-direction: column;\n font-family: 'SF Mono', Menlo, Monaco, 'Courier New', monospace;\n transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n border-top: 1px solid #3c3c3c;\n box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);\n }\n \n #mobile-debug-console.hidden {\n transform: translateY(100%);\n }\n \n #debug-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n background: #2d2d2d;\n border-bottom: 1px solid #3c3c3c;\n min-height: 36px;\n }\n \n #debug-title {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #9da5b4;\n font-size: 12px;\n font-weight: 500;\n letter-spacing: 0.3px;\n }\n \n #debug-title svg {\n width: 14px;\n height: 14px;\n opacity: 0.8;\n }\n \n /* Traffic light buttons - using ID for specificity */\n #mobile-debug-console .debug-traffic-lights {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n \n #mobile-debug-console button.debug-traffic-btn {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-size: 0;\n line-height: 1;\n }\n \n #mobile-debug-console .debug-traffic-btn svg {\n width: 8px;\n height: 8px;\n }\n \n #mobile-debug-console .debug-traffic-btn.close {\n background: #ff5f57;\n }\n \n #mobile-debug-console .debug-traffic-btn.close svg {\n stroke: #820005;\n stroke-width: 2;\n }\n \n #mobile-debug-console .debug-traffic-btn.clear {\n background: #febc2e;\n }\n \n #mobile-debug-console .debug-traffic-btn.minimize {\n background: #28c840;\n }\n \n #mobile-debug-console .debug-traffic-btn.minimize svg {\n stroke: #006500;\n stroke-width: 2;\n }\n \n #mobile-debug-console .debug-traffic-btn:active {\n filter: brightness(0.85);\n }\n \n #debug-logs {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n background: #1e1e1e;\n -webkit-overflow-scrolling: touch;\n }\n \n button#debug-floating-toggle {\n position: fixed !important;\n bottom: 20px !important;\n right: 20px !important;\n width: 42px !important;\n height: 42px !important;\n min-width: 42px !important;\n min-height: 42px !important;\n border-radius: 8px !important;\n background: #2d2d2d !important;\n border: 1px solid #3c3c3c !important;\n color: #9da5b4 !important;\n cursor: pointer !important;\n z-index: 999998 !important;\n display: none;\n align-items: center !important;\n justify-content: center !important;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;\n transition: all 0.2s ease !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n \n button#debug-floating-toggle:hover {\n background: #3c3c3c !important;\n color: #fff !important;\n transform: translateY(-2px) !important;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;\n }\n \n button#debug-floating-toggle:active {\n transform: translateY(0) !important;\n }\n \n button#debug-floating-toggle.visible {\n display: flex !important;\n }\n \n button#debug-floating-toggle svg {\n width: 20px !important;\n height: 20px !important;\n }\n ",document.head.appendChild(n);const e='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>';this.container=document.createElement("div"),this.container.id="mobile-debug-console",this.isVisible||(this.container.className="hidden");const t=document.createElement("div");t.id="debug-header";const i=document.createElement("div");i.id="debug-title",i.innerHTML=`${e}<span>Mobile Console</span>`;const o=document.createElement("div");o.className="debug-traffic-lights";const r=document.createElement("button");r.className="debug-traffic-btn close",r.title="Close",r.innerHTML='<svg viewBox="0 0 10 10" fill="none"><line x1="2.5" y1="2.5" x2="7.5" y2="7.5" stroke="currentColor"/><line x1="7.5" y1="2.5" x2="2.5" y2="7.5" stroke="currentColor"/></svg>',r.onclick=()=>this.cleanup();const a=document.createElement("button");a.className="debug-traffic-btn clear",a.title="Clear",a.innerHTML='<svg viewBox="0 0 16 16" fill="currentColor"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/><path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/></svg>',a.onclick=()=>this.clear();const s=document.createElement("button");s.className="debug-traffic-btn minimize",s.title="Minimize",s.innerHTML='<svg viewBox="0 0 10 10" fill="none"><path d="M2 3L5 6L8 3" stroke="currentColor" fill="none"/></svg>',s.onclick=()=>this.toggle(),o.appendChild(r),o.appendChild(a),o.appendChild(s),t.appendChild(o),t.appendChild(i),this.logsContainer=document.createElement("div"),this.logsContainer.id="debug-logs",this.logsContainer.addEventListener("scroll",()=>{this.isAtBottom=this.logsContainer.scrollHeight-this.logsContainer.scrollTop<=this.logsContainer.clientHeight+50}),this.container.appendChild(t),this.container.appendChild(this.logsContainer),document.body.appendChild(this.container),this.floatingToggle=document.createElement("button"),this.floatingToggle.id="debug-floating-toggle",this.floatingToggle.innerHTML=e,this.floatingToggle.title="Show Console",this.floatingToggle.onclick=()=>this.toggle(),document.body.appendChild(this.floatingToggle)}escapeHtml(n){const e=document.createElement("div");return e.textContent=n,e.innerHTML}toggle(){this.isVisible=!this.isVisible,this.container&&this.floatingToggle&&(this.isVisible?(this.container.classList.remove("hidden"),this.floatingToggle.classList.remove("visible"),this.updateDisplay()):(this.container.classList.add("hidden"),this.floatingToggle.classList.add("visible")))}clear(){this.logs=[],this.logsContainer&&(this.logsContainer.innerHTML="")}cleanup(){Object.keys(this.originalConsole).forEach(n=>{console[n]=this.originalConsole[n]}),this.container&&this.container.remove(),this.floatingToggle&&this.floatingToggle.remove()}}k.instance=null;class E{constructor(n={}){this.config={...n,endpoints:{prepare:n.endpoints?.prepare||"/api/magic-auth/prepare",process:n.endpoints?.process||"/api/magic-auth/process",polling:n.endpoints?.polling},timeout:n.timeout||3e4,pollingInterval:n.pollingInterval||2e3,maxPollingAttempts:n.maxPollingAttempts||30,debug:n.debug||!1},this.http=n.httpClient||function(n={}){const{timeout:e=3e4,headers:t={},dynamicHeaders:i}=n;async function o(n,e){const o={"Content-Type":"application/json"};t.common&&Object.assign(o,t.common);const r=t[n.endpoint];if(r&&"object"==typeof r&&Object.assign(o,r),i){const e=await i(n);Object.assign(o,e)}return e&&Object.assign(o,e),o}async function r(n,e,t,i){const o=new AbortController,r=setTimeout(()=>o.abort(),t),a=i?()=>o.abort():null;i&&a&&i.addEventListener("abort",a);try{return await fetch(n,{...e,signal:o.signal})}catch(n){if(n instanceof Error&&"AbortError"===n.name){if(i?.aborted)throw h(s.CANCELLED,"Request was cancelled");throw h(s.TIMEOUT,"Request timed out")}throw h(s.NETWORK_ERROR,n instanceof Error?n.message:"Network request failed")}finally{clearTimeout(r),i&&a&&i.removeEventListener("abort",a)}}async function a(n){let e;try{e=await n.json()}catch{if(!n.ok)throw h(s.INVALID_RESPONSE,`Request failed with status ${n.status}`);throw h(s.INVALID_RESPONSE,"Failed to parse response")}if(!n.ok)throw function(n){if(n&&("code"in n||"error"in n)){const e=n,t=e.code||e.error,i=e.message,o=new Error(i||"An error occurred");return o.code=t,o.status=e.status,o.requestId=e.requestId||e.request_id,o.timestamp=e.timestamp,o.details=e.details,o.traceId=e.trace_id||e.traceId,o.spanId=e.span_id||e.spanId,o.service=e.service,e.details&&"object"==typeof e.details&&"retryAfter"in e.details&&(o.retryAfter=e.details.retryAfter),o}if(n&&"status"in n){const e=n,t=e.status,i=new Error(e.message||`Request failed with status ${t}`);return i.code=`HTTP_${t}`,i.status=t,i}const e=new Error("An unexpected error occurred");return e.code="UNKNOWN_ERROR",e}({...e,status:n.status});return e}function l(n){return n.includes("/prepare")?"prepare":n.includes("/process")||n.includes("/get-phone")||n.includes("/verify-phone")?"process":n.includes("/status")?"polling":"prepare"}return{async post(n,t,i){const s=l(n),d=await o({endpoint:s,method:"POST"},i?.headers);return a(await r(n,{method:"POST",headers:d,body:JSON.stringify(t)},i?.timeout||e,i?.signal))},async get(n,t){const i=l(n),s=await o({endpoint:i,method:"GET"},t?.headers);return delete s["Content-Type"],a(await r(n,{method:"GET",headers:s},t?.timeout||e,t?.signal))}}}({timeout:this.config.timeout,headers:n.headers,dynamicHeaders:n.dynamicHeaders}),this.logger=n.logger||(this.config.debug?function(n={}){const{debug:e=!1,prefix:t="[PhoneAuth]"}=n;function i(n,e){const i=`${t} ${n}`;return void 0!==e?[i,y(e)]:[i]}return{debug(n,t){if(e){const e=i(n,t);console.debug(...e)}},info(n,e){const t=i(n,e);console.info(...t)},warn(n,e){const t=i(n,e);console.warn(...t)},error(n,e){const t=i(n,e);console.error(...t)}}}({debug:!0}):{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}}),this.logger.debug("PhoneAuthClient initialized",{endpoints:this.config.endpoints,timeout:this.config.timeout}),n.devtools?.showMobileConsole&&"undefined"!=typeof window&&(k.init(),this.logger.info("Mobile debug console enabled"))}async authenticate(n,e){const i=await this.prepare(n),o=await this.invokeSecurePrompt(i,e),r=await o.credential,a=i.session.use_case||i.session.metadata?.use_case||n.use_case;if(!a)throw h(s.INVALID_RESPONSE,"Could not determine use_case from session or request");return a===t.VERIFY_PHONE_NUMBER?this.verifyPhoneNumber(r,i.session):this.getPhoneNumber(r,i.session)}async prepare(n){if(this.logger.debug("Preparing authentication",{use_case:n.use_case}),n.phone_number){const e=r(n.phone_number);if(!e.valid)throw h(s.INVALID_PHONE_NUMBER,e.error)}if(n.plmn){const e=a(n.plmn);if(!e.valid)throw h(s.INVALID_PLMN,e.error)}if(!n.use_case&&!n.options?.parent_session_id)throw h(s.MISSING_PARAMETERS,"use_case is required");const e={...n,id:n.id||this.generateRequestId(),client_info:n.client_info||{user_agent:navigator.userAgent,platform:navigator.platform}};try{const n=await this.http.post(this.config.endpoints.prepare,e);return this.logger.debug("Prepare successful",{strategy:n.authentication_strategy,sessionKey:n.session.session_key}),n}catch(n){throw this.logger.error("Prepare failed",n),n}}async invokeSecurePrompt(n,e){const{authentication_strategy:t,session:o,data:r}=n;switch(this.logger.debug("Invoking secure prompt",{strategy:t}),t){case i.TS43:return this.handleTS43(r,o);case i.LINK:return this.handleLink(r,o,e);case i.DESKTOP:return this.handleDesktop(r,o,e);default:throw h(s.UNSUPPORTED_STRATEGY,`Unknown strategy: ${t}`)}}async getPhoneNumber(n,e){this.logger.debug("Getting phone number");const i={session:e,credential:n.credential,use_case:t.GET_PHONE_NUMBER};try{const n=await this.http.post(this.config.endpoints.process,i);return this.logger.info("Phone number retrieved"),n}catch(n){throw this.logger.error("Get phone number failed",n),n}}async verifyPhoneNumber(n,e){this.logger.debug("Verifying phone number");const i={session:e,credential:n.credential,use_case:t.VERIFY_PHONE_NUMBER};try{const n=await this.http.post(this.config.endpoints.process,i);return this.logger.info("Phone number verified",{verified:n.verified}),n}catch(n){throw this.logger.error("Verify phone number failed",n),n}}isSupported(){return"undefined"!=typeof window&&"DigitalCredential"in window}getBrowserSupportInfo(){if("undefined"==typeof window)return{supported:!1,browser:"unknown",message:"Not in browser"};const n=navigator.userAgent,e=/Chrome/.test(n)&&/Google Inc/.test(navigator.vendor),t=/Edg\//.test(n);return this.isSupported()?{supported:!0,browser:e?"Chrome":t?"Edge":"Other"}:{supported:!1,browser:e?"Chrome":t?"Edge":"Other",message:"Enable chrome://flags/#web-identity-digital-credentials"}}async handleTS43(n,e){if(!this.isSupported())throw h(s.BROWSER_NOT_SUPPORTED,"Digital Credentials API not available");const t={digital:{requests:[{protocol:n.protocol,data:n.data}]}};return this.logger.debug("Invoking Digital Credentials API"),{credential:(async()=>{try{const n=await navigator.credentials.get(t);if(!n?.data?.vp_token)throw h(s.INVALID_RESPONSE,"No credential returned from Digital Credentials API");const i=n.data.vp_token,o="string"==typeof i?i:Object.values(i)[0],r=Array.isArray(o)?o[0]:o;if(!r||"string"==typeof r&&""===r.trim())throw h(s.INVALID_RESPONSE,"Empty credential returned from Digital Credentials API");return{credential:r,session:e,authenticated:!0}}catch(n){if(d(n))throw n;const e=n;if("NotAllowedError"===e.name||"NetworkError"===e.name&&19===e.code)throw h(s.USER_CANCELLED,"User cancelled authentication");if("NotSupportedError"===e.name)throw h(s.BROWSER_NOT_SUPPORTED,"Browser not supported");throw h(s.NETWORK_ERROR,e.message||"Credential request failed")}})(),cancel:void 0,strategy:i.TS43,session:e}}handleLink(n,e,t){if(!n.url)throw h(s.INVALID_RESPONSE,"Missing link URL");this.logger.debug("Opening App Clip",{url:n.url}),window.location.href=n.url;const o=v({sessionKey:e.session_key,interval:t?.pollingInterval||this.config.pollingInterval,maxAttempts:t?.maxPollingAttempts||this.config.maxPollingAttempts,pollingEndpoint:t?.pollingEndpoint||this.config.endpoints.polling,statusUrl:n.status_url,logger:this.logger});return{credential:o.start().then(n=>{if("completed"===n.status&&n.credential)return{credential:n.credential,session:n.session||e,authenticated:!0};throw h(s.VERIFICATION_FAILED,n.message||"Link authentication failed")}),cancel:()=>o.cancel(),strategy:i.LINK,session:e}}handleDesktop(n,e,t){const o=n.data?.session_id||e.session_key;this.logger.debug("Starting desktop authentication",{sessionId:o});const r=v({sessionKey:o,interval:t?.pollingInterval||this.config.pollingInterval,maxAttempts:t?.maxPollingAttempts||this.config.maxPollingAttempts,pollingEndpoint:t?.pollingEndpoint||this.config.endpoints.polling,statusUrl:n.data?.status_url,logger:this.logger});let a=null;if(!t?.preventDefaultUI)try{const e=w(n);a=new x(t?.modalOptions),a.showQRCode(e,t?.modalOptions?.description||"Scan with your phone camera"),a.setCloseCallback(()=>{this.logger.debug("Modal closed by user, cancelling authentication"),r.cancel()}),this.logger.debug("Desktop modal displayed")}catch(n){this.logger.warn("Failed to show modal, continuing with polling only",n)}return{credential:r.start().then(n=>{if(a&&a.close(),"completed"===n.status&&n.credential)return{credential:n.credential,session:n.session||e,authenticated:!0};throw h(s.VERIFICATION_FAILED,n.message||"Desktop authentication failed")}).catch(n=>{throw a&&a.close(),n}),cancel:()=>{r.cancel(),a&&a.close()},strategy:i.DESKTOP,session:e}}generateRequestId(){return`web-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}}function C(n){return null!==n&&"object"==typeof n&&"credential"in n&&"strategy"in n&&"session"in n}function S(n){return null!==n&&"object"==typeof n&&"credential"in n&&"authenticated"in n&&"session"in n}function A(n){return n.strategy===i.TS43}function R(n){return n.strategy===i.LINK}function I(n){return n.strategy===i.DESKTOP}function _(n){return void 0!==n.cancel}function N(n){return null!==n&&"object"==typeof n&&"protocol"in n&&"data"in n&&"object"==typeof n.data&&"dcql_query"in n.data}function O(n){return null!==n&&"object"==typeof n&&"url"in n&&"string"==typeof n.url}function T(n){return null!==n&&"object"==typeof n&&"data"in n&&"object"==typeof n.data}function P(n){return!("verified"in n)}function L(n){return"verified"in n}function D(n){return null!==n&&"object"==typeof n&&"code"in n&&"message"in n}return e})());
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.GlideWebClientSDK=n():e.GlideWebClientSDK=n()}(this,()=>(()=>{"use strict";var e={d:(n,t)=>{for(var i in t)e.o(t,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:t[i]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{AUTHENTICATION_STRATEGY:()=>i,AuthModal:()=>x,ERROR_CODES:()=>s,PhoneAuthClient:()=>E,USE_CASE:()=>t,createAuthError:()=>h,createQRCodeDataFromDesktop:()=>w,getUserMessage:()=>p,isAuthCredential:()=>S,isAuthError:()=>d,isCancellable:()=>_,isClientError:()=>c,isDesktopData:()=>T,isDesktopStrategy:()=>I,isErrorResponse:()=>D,isGetPhoneNumberResponse:()=>P,isInvokeResult:()=>C,isLinkData:()=>O,isLinkStrategy:()=>R,isRetryableError:()=>g,isTS43Data:()=>N,isTS43Strategy:()=>A,isVerifyPhoneNumberResponse:()=>L,validatePhoneNumber:()=>r,validatePlmn:()=>a});const t={GET_PHONE_NUMBER:"GetPhoneNumber",VERIFY_PHONE_NUMBER:"VerifyPhoneNumber"},i={TS43:"ts43",LINK:"link",DESKTOP:"desktop"},o=/^\+[1-9]\d{1,14}$/;function r(e){return e?e.startsWith("+")?e.length<8?{valid:!1,error:"Phone number too short for E.164 format (minimum 8 characters including +)"}:e.length>16?{valid:!1,error:"Phone number too long for E.164 format (maximum 15 digits after +)"}:/^\+\d+$/.test(e)?o.test(e)?{valid:!0}:{valid:!1,error:"Invalid E.164 phone number format"}:{valid:!1,error:"Phone number contains invalid characters. E.164 format only allows + followed by digits"}:{valid:!1,error:"Phone number must be in E.164 format (start with +)"}:{valid:!0}}function a(e){if(!e)return{valid:!0};const{mcc:n,mnc:t}=e;return n&&/^\d{3}$/.test(n)?t&&/^\d{2,3}$/.test(t)?{valid:!0}:{valid:!1,error:"MNC must be 2 or 3 digits"}:{valid:!1,error:"MCC must be exactly 3 digits"}}const s={INVALID_PHONE_NUMBER:"INVALID_PHONE_NUMBER",INVALID_PLMN:"INVALID_PLMN",MISSING_PARAMETERS:"MISSING_PARAMETERS",BROWSER_NOT_SUPPORTED:"BROWSER_NOT_SUPPORTED",UNSUPPORTED_STRATEGY:"UNSUPPORTED_STRATEGY",USER_CANCELLED:"USER_CANCELLED",CANCELLED:"CANCELLED",VERIFICATION_FAILED:"VERIFICATION_FAILED",NETWORK_ERROR:"NETWORK_ERROR",TIMEOUT:"TIMEOUT",INVALID_RESPONSE:"INVALID_RESPONSE"},l={[s.INVALID_PHONE_NUMBER]:"Please enter a valid phone number in E.164 format (e.g., +14155551234).",[s.INVALID_PLMN]:"Invalid carrier information provided.",[s.MISSING_PARAMETERS]:"Required information is missing.",[s.BROWSER_NOT_SUPPORTED]:"Your browser does not support this authentication method. Please use Chrome or Edge with the Digital Credentials flag enabled.",[s.UNSUPPORTED_STRATEGY]:"This authentication strategy is not supported.",[s.USER_CANCELLED]:"Authentication was cancelled.",[s.CANCELLED]:"Authentication was cancelled.",[s.VERIFICATION_FAILED]:"Verification failed. Please try again.",[s.NETWORK_ERROR]:"Network connection failed. Please check your connection and try again.",[s.TIMEOUT]:"Request timed out. Please try again.",[s.INVALID_RESPONSE]:"Invalid response received."};function d(e){return null!==e&&"object"==typeof e&&"code"in e&&"message"in e&&"string"==typeof e.code&&"string"==typeof e.message}function c(e){return Object.values(s).includes(e.code)}function g(e){return e.code===s.NETWORK_ERROR||e.code===s.TIMEOUT}function p(e){return c(e)&&l[e.code]||e.message}function h(e,n,t){const i=new Error(n||l[e]||e);return i.code=e,i.details=t,i.timestamp=(new Date).toISOString(),i}const u=/(\+?[1-9]\d{6,14})/g,b=/([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g,m=/(eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*)/g,f=/session[_-]?key["']?\s*[:=]\s*["']?([a-zA-Z0-9_-]{20,})["']?/gi;function y(e){if(null==e)return e;if("string"==typeof e){let n=e;return n=n.replace(u,e=>e.length<8?e:e.slice(0,2)+"***"+e.slice(-4)),n=n.replace(b,e=>{const[n,t]=e.split("@");return n.slice(0,1)+"***@"+t}),n=n.replace(m,"[JWT]"),n=n.replace(f,(e,n)=>e.replace(n,n.slice(0,4)+"***"+n.slice(-4))),n}if(Array.isArray(e))return e.map(y);if("object"==typeof e){const n={};for(const[t,i]of Object.entries(e))["phone_number","phoneNumber","credential","token","password","secret"].some(e=>t.toLowerCase().includes(e.toLowerCase()))?n[t]="string"==typeof i?"[REDACTED]":i:n[t]=y(i);return n}return e}function v(e){const{sessionKey:n,interval:t=2e3,maxAttempts:i=30,pollingEndpoint:o,statusUrl:r,logger:a,headers:l}=e;let d,c,g=0,p=!1,u=!1;function b(){u=!1,d&&(clearInterval(d),d=void 0)}return{start:function(){return new Promise((e,s)=>{c=s,u=!0,g=0;const h=async()=>{if(u&&!p){if(g>=i)return b(),a?.warn("Polling timeout reached",{attempts:g,maxAttempts:i}),void e({status:"expired",message:"Authentication timeout"});try{const t=o?(a?.debug("Using developer config endpoint for polling",{pollingEndpoint:o}),`${o}/${n}`):r?(a?.debug("Using backend status_url for polling",{statusUrl:r}),r):(a?.debug("Using prod fallback for status polling"),`https://api.glideidentity.app/public/status/${n}`);a?.debug("Polling status",{url:t,attempt:g+1,maxAttempts:i});const s=await fetch(t,{method:"GET",headers:{Accept:"application/json",...l}});if(200===s.status){const t=await s.json();if("completed"===t.status)return b(),a?.info("Authentication completed"),t.credential?void e({status:"completed",credential:t.credential,session:t.session||{session_key:n}}):(a?.error("Status completed but no credential returned"),void e({status:"error",message:"Authentication completed but no credential returned"}));g++}else if(410===s.status){b();const n=await s.json().catch(()=>({}));e({status:"expired",message:n.message||"Session expired"})}else if(422===s.status){b();const n=await s.json().catch(()=>({}));e({status:"error",message:n.message||"Authentication failed"})}else 404===s.status?(b(),e({status:"error",message:"Session not found"})):g++}catch(e){a?.debug("Polling error, retrying",{error:e,attempt:g+1}),g++}}};h(),d=setInterval(h,t)})},stop:b,cancel:function(){a?.debug("Polling cancelled"),p=!0,b(),c&&(c(h(s.CANCELLED,"Authentication cancelled")),c=void 0)},isPolling:function(){return void 0!==d},cleanup:function(){b(),p=!1,c=void 0}}}class x{constructor(e){this.container=null,this.backdrop=null,this.isOpen=!1,this.currentStep="os-choice",this.qrCodeData=null,this.statusMessage="",this.originalBodyOverflow="",this.isClosing=!1,this.iconApple='<svg class="glide-icon glide-icon-os" viewBox="0 0 384 512" fill="currentColor"><path d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 52.3-11.4 69.5-34.3z"/></svg>',this.iconAndroid='<svg class="glide-icon glide-icon-os" viewBox="0 0 576 512" fill="currentColor"><path d="M420.55,301.93a24,24,0,1,1,24-24,24,24,0,0,1-24,24m-265.1,0a24,24,0,1,1,24-24,24,24,0,0,1-24,24m273.7-144.48,47.94-83a10,10,0,1,0-17.27-10h0l-48.54,84.07a301.25,301.25,0,0,0-246.56,0L116.18,64.45a10,10,0,1,0-17.27,10h0l47.94,83C64.53,202.22,8.24,285.55,0,384H576c-8.24-98.45-64.54-181.78-146.85-226.55"/></svg>',this.iconBack='<svg class="glide-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',this.options=e||{},this.theme=this.options.theme||"auto",this.handleEscapeKey=this.handleEscapeKey.bind(this)}shouldUseDarkMode(){return"dark"===this.theme||"light"!==this.theme&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}handleEscapeKey(e){"Escape"===e.key&&this.isOpen&&!1!==this.options?.closeOnEscape&&(this.closeCallback?.(),this.close())}escapeHtml(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}showQRCode(e,n="Scan with your phone camera"){this.qrCodeData=e,this.statusMessage=n;const t=this.options.viewMode||"toggle";if("string"==typeof e)this.renderToggleMode(e,n);else switch(t){case"dual":this.renderDualMode(e,n);break;case"pre-step":this.renderPreStepMode(e,n);break;default:this.renderToggleMode(e,n)}this.show()}updateStatus(e,n=!1){if(this.statusMessage=e,this.container){const t=this.container.querySelector("#glide-status");t&&(t.textContent=e,t.style.color=n?"#ff3b30":"")}}setCloseCallback(e){this.closeCallback=e}renderToggleMode(e,n){let t="",i="";"string"==typeof e?(t=e,i=e):(t=e.iosQRCode,i=e.androidQRCode||e.iosQRCode);const o=`\n <div class="glide-content">\n <div class="glide-toggle" id="glide-toggle" data-active="ios">\n <div class="glide-toggle-slider"></div>\n <button class="glide-btn glide-toggle-btn active" data-platform="ios">${this.iconApple}<span>iOS</span></button>\n <button class="glide-btn glide-toggle-btn" data-platform="android">${this.iconAndroid}<span>Android</span></button>\n </div>\n\n <div class="glide-qr-area">\n <img \n class="glide-qr-img"\n id="glide-qr-img" \n src="${this.escapeHtml(t)}" \n alt="QR Code" \n class="glide-qr-img" \n data-ios="${this.escapeHtml(t)}"\n data-android="${this.escapeHtml(i)}"\n />\n \n \x3c!-- Animation Overlay (Inside QR Area for centering) --\x3e\n <div id="glide-phone-overlay" class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n </div>\n </div>\n `;this.createModal(o,"",!0),this.setupPlatformToggles(),this.setupHelpInteraction()}renderDualMode(e,n){const t='\n <div class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n ';this.createModal(`\n <div class="glide-content glide-dual-mode">\n <div class="glide-dual-container">\n <div class="glide-dual-item">\n <div class="glide-os-logo">\n ${this.iconApple}\n <span>iOS</span>\n </div>\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(e.iosQRCode)}" alt="iOS QR" class="glide-qr-img" />\n ${t}\n </div>\n </div>\n <div class="glide-dual-separator">\n <div class="glide-separator-line"></div>\n <span class="glide-separator-text">or</span>\n <div class="glide-separator-line"></div>\n </div>\n <div class="glide-dual-item">\n <div class="glide-os-logo">\n ${this.iconAndroid}\n <span>Android</span>\n </div>\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(e.androidQRCode||e.iosQRCode)}" alt="Android QR" class="glide-qr-img" />\n ${t}\n </div>\n </div>\n </div>\n </div>\n `,"glide-modal-wide",!0),this.setupHelpInteraction()}renderPreStepMode(e,n){this.currentStep="os-choice";const t=`\n <div class="glide-pre-step-container">\n <button class="glide-os-choice-btn" id="glide-btn-ios">\n ${this.iconApple}\n <span>iOS</span>\n </button>\n <button class="glide-os-choice-btn" id="glide-btn-android">\n ${this.iconAndroid}\n <span>Android</span>\n </button>\n </div>\n `;this.createModal(t,"",!1),this.setupPreStepListeners(),this.show()}setupPreStepListeners(){this.container&&(this.container.querySelector("#glide-btn-ios")?.addEventListener("click",()=>{this.currentStep="ios-qr",this.updatePreStepUI()}),this.container.querySelector("#glide-btn-android")?.addEventListener("click",()=>{this.currentStep="android-qr",this.updatePreStepUI()}))}updatePreStepUI(){if(!this.container)return;let e="";if("os-choice"===this.currentStep)e=`\n <div class="glide-pre-step-container">\n <button class="glide-os-choice-btn" id="glide-btn-ios">\n ${this.iconApple}\n <span>iOS</span>\n </button>\n <button class="glide-os-choice-btn" id="glide-btn-android">\n ${this.iconAndroid}\n <span>Android</span>\n </button>\n </div>\n `,this.createModal(e,"",!1),this.setupPreStepListeners();else if("ios-qr"===this.currentStep){const n="object"==typeof this.qrCodeData&&this.qrCodeData?.iosQRCode?this.qrCodeData.iosQRCode:this.qrCodeData;e=`\n <div class="glide-content">\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(n)}" alt="QR Code" class="glide-qr-img" />\n \n \x3c!-- Animation Overlay --\x3e\n <div id="glide-phone-overlay" class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n </div>\n </div>\n `,this.createModal(e,"",!0,!0),this.setupBackButton(),this.setupHelpInteraction()}else if("android-qr"===this.currentStep){const n="object"==typeof this.qrCodeData&&this.qrCodeData?.androidQRCode?this.qrCodeData.androidQRCode:"object"==typeof this.qrCodeData&&this.qrCodeData?.iosQRCode?this.qrCodeData.iosQRCode:this.qrCodeData;e=`\n <div class="glide-content">\n <div class="glide-qr-area">\n <img src="${this.escapeHtml(n)}" alt="QR Code" class="glide-qr-img" />\n \n \x3c!-- Animation Overlay --\x3e\n <div id="glide-phone-overlay" class="glide-phone-animation-overlay">\n <div class="glide-outlined-phone">\n <div class="glide-scan-line"></div>\n </div>\n </div>\n </div>\n </div>\n `,this.createModal(e,"",!0,!0),this.setupBackButton(),this.setupHelpInteraction()}}setupBackButton(){this.container&&this.container.querySelector("#glide-back-btn")?.addEventListener("click",()=>{this.currentStep="os-choice",this.updatePreStepUI()})}createModal(e,n="",t=!1,i=!1){this.isClosing&&(this.isClosing=!1,this.cleanup()),this.container?(this.container.className=`glide-modal ${n}`,this.shouldUseDarkMode()&&this.container.classList.add("dark")):(this.backdrop=document.createElement("div"),this.backdrop.className="glide-backdrop",this.backdrop.id="glide-backdrop",this.container=document.createElement("div"),this.container.className=`glide-modal ${n}`,this.container.id="glide-modal",this.shouldUseDarkMode()&&this.container.classList.add("dark"),this.isOpen&&(document.body.appendChild(this.backdrop),document.body.appendChild(this.container))),this.container.innerHTML=`\n ${i?`\n <button class="glide-btn glide-btn-back" id="glide-back-btn" aria-label="Back">\n ${this.iconBack}\n </button>\n `:""}\n ${!1!==this.options?.showCloseButton?'\n <button class="glide-btn glide-btn-close" id="glide-close-btn" aria-label="Close">\n <svg class="glide-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n ':""}\n <h2 class="glide-title">${this.options?.title||"Scan to Verify"}</h2>\n <div id="glide-modal-content">${e}</div>\n <p class="glide-status" id="glide-status">${this.options?.description||""}</p>\n ${t?'\n <button class="glide-btn glide-btn-help" id="glide-help-btn">?</button>\n ':""}\n `,this.injectStyles();const o=this.container.querySelector("#glide-close-btn");o&&o.addEventListener("click",()=>{this.closeCallback?.(),this.close()}),this.backdrop&&(this.backdrop.onclick=e=>{e.target===this.backdrop&&!1!==this.options?.closeOnBackdropClick&&(this.closeCallback?.(),this.close())})}setupHelpInteraction(){const e=this.container?.querySelector("#glide-help-btn");e&&e.addEventListener("click",()=>{const e=this.container?.querySelectorAll(".glide-phone-animation-overlay");e&&e.forEach(e=>{e.classList.remove("playing"),e.offsetWidth,e.classList.add("playing"),setTimeout(()=>{e.classList.remove("playing")},3e3)})})}injectStyles(){if(document.getElementById("glide-modal-styles"))return;const e=document.createElement("style");e.id="glide-modal-styles",e.textContent='\n :root {\n --glide-primary: #007AFF;\n --glide-text: #1d1d1f;\n --glide-bg-light: rgba(255, 255, 255, 0.6);\n --glide-bg-dark: rgba(30, 30, 30, 0.6);\n --glide-phone-border: #000000; /* High Contrast Black */\n \n /* Button sizes */\n --glide-btn-size: 28px;\n --glide-help-btn-size: 24px;\n --glide-toggle-icon-size: 14px;\n --glide-dual-icon-size: 18px;\n }\n\n #glide-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.2);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n z-index: 9998;\n opacity: 0;\n transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n #glide-modal {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%) scale(0.94);\n background: var(--glide-bg-light);\n backdrop-filter: blur(24px) saturate(180%);\n -webkit-backdrop-filter: blur(24px) saturate(180%);\n border-radius: 24px;\n padding: 32px;\n width: 360px;\n max-width: 90%;\n box-shadow: \n 0 20px 40px rgba(0,0,0,0.2),\n 0 0 0 1px rgba(255,255,255,0.6) inset,\n 0 0 0 1px rgba(0,0,0,0.05);\n z-index: 9999;\n opacity: 0;\n transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n text-align: center;\n color: var(--glide-text);\n }\n \n #glide-modal.glide-modal-wide {\n width: 600px;\n max-width: 95vw;\n }\n\n #glide-modal.dark {\n background: var(--glide-bg-dark);\n color: white;\n box-shadow: \n 0 20px 40px rgba(0,0,0,0.4),\n 0 0 0 1px rgba(255,255,255,0.15) inset,\n 0 0 0 1px rgba(0,0,0,0.5);\n --glide-phone-border: #ffffff; /* High Contrast White */\n }\n\n #glide-modal .glide-btn-close {\n position: absolute;\n top: 16px;\n right: 16px;\n width: var(--glide-btn-size);\n height: var(--glide-btn-size);\n min-width: var(--glide-btn-size);\n min-height: var(--glide-btn-size);\n max-width: var(--glide-btn-size);\n max-height: var(--glide-btn-size);\n background: rgba(118, 118, 128, 0.12);\n border: none;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n color: rgba(0,0,0,0.5);\n transition: background 0.2s;\n padding: 0;\n z-index: 20;\n box-sizing: border-box;\n flex-shrink: 0;\n }\n\n #glide-modal.dark .glide-btn-close {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255,255,255,0.5);\n }\n\n #glide-modal .glide-btn-close:hover {\n background: rgba(118, 118, 128, 0.2);\n }\n \n #glide-modal.dark .glide-btn-close:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n\n .glide-title {\n margin: 0 0 8px 0;\n font-size: 22px;\n font-weight: 600;\n letter-spacing: -0.01em;\n }\n \n .glide-status {\n margin: 12px 0 0 0;\n font-size: 13px;\n color: rgba(0,0,0,0.5);\n text-align: center;\n min-height: 18px;\n }\n \n .glide-status:empty {\n display: none;\n }\n \n #glide-modal.dark .glide-status {\n color: rgba(255,255,255,0.5);\n }\n \n .glide-content {\n display: flex;\n flex-direction: column;\n align-items: center;\n position: relative;\n }\n \n /* --- Sliding Toggle Switch --- */\n #glide-toggle {\n background: rgba(118, 118, 128, 0.12);\n padding: 2px;\n border-radius: 8px;\n display: inline-flex;\n margin-bottom: 24px;\n margin-top: 16px;\n position: relative;\n height: 32px;\n width: 200px;\n box-sizing: border-box;\n }\n\n #glide-modal.dark #glide-toggle {\n background: rgba(118, 118, 128, 0.24);\n }\n \n /* The sliding background */\n .glide-toggle-slider {\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(50% - 2px);\n height: calc(100% - 4px);\n background: white;\n border-radius: 6px;\n box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04);\n transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n z-index: 0;\n }\n \n #glide-modal.dark .glide-toggle-slider {\n background: #636366;\n }\n \n /* Move slider for Android */\n #glide-toggle[data-active="android"] .glide-toggle-slider {\n transform: translateX(100%);\n }\n\n .glide-toggle-btn {\n flex: 1;\n background: none;\n border: none;\n padding: 0;\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: inherit;\n cursor: pointer;\n position: relative;\n z-index: 1;\n transition: color 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n min-height: auto;\n height: auto;\n min-width: auto;\n border-radius: 0;\n }\n \n #glide-modal .glide-toggle-btn .glide-icon-os,\n #glide-modal .glide-toggle-btn svg {\n width: var(--glide-toggle-icon-size);\n height: var(--glide-toggle-icon-size);\n flex-shrink: 0;\n margin: 0;\n padding: 0;\n }\n \n .glide-toggle-btn span {\n margin: 0;\n padding: 0;\n line-height: 1;\n }\n \n #glide-modal.dark .glide-toggle-btn {\n color: rgba(255,255,255,0.6);\n }\n \n #glide-toggle[data-active="ios"] .glide-toggle-btn[data-platform="ios"],\n #glide-toggle[data-active="android"] .glide-toggle-btn[data-platform="android"] {\n color: #1d1d1f;\n }\n \n #glide-modal.dark #glide-toggle[data-active="ios"] .glide-toggle-btn[data-platform="ios"],\n #glide-modal.dark #glide-toggle[data-active="android"] .glide-toggle-btn[data-platform="android"] {\n color: white;\n }\n\n /* QR Area */\n .glide-qr-area {\n position: relative;\n margin: 0 auto;\n }\n\n .glide-qr-img {\n width: 200px;\n height: 200px;\n object-fit: contain;\n display: block;\n border-radius: 16px;\n }\n \n /* Dual Mode QR Area - no extra padding, same as single mode */\n .glide-dual-mode .glide-qr-area {\n background: transparent;\n padding: 0;\n }\n \n .glide-dual-mode .glide-qr-img {\n width: 180px;\n height: 180px;\n border-radius: 16px;\n }\n \n /* --- Help Icon & Interaction --- */\n .glide-btn-help {\n position: absolute;\n bottom: 20px;\n right: 20px;\n width: var(--glide-help-btn-size);\n height: var(--glide-help-btn-size);\n min-width: var(--glide-help-btn-size);\n min-height: var(--glide-help-btn-size);\n max-width: var(--glide-help-btn-size);\n max-height: var(--glide-help-btn-size);\n border-radius: 50%;\n border: 1.5px solid rgba(0,0,0,0.2);\n color: rgba(0,0,0,0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n line-height: 1;\n cursor: pointer;\n transition: all 0.2s;\n background: transparent;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n z-index: 10;\n }\n \n #glide-modal.dark .glide-btn-help {\n border-color: rgba(255,255,255,0.3);\n color: rgba(255,255,255,0.5);\n }\n\n .glide-btn-help:hover {\n border-color: var(--glide-primary);\n color: var(--glide-primary);\n background: rgba(0, 122, 255, 0.1);\n }\n \n /* Tooltip */\n .glide-btn-help::after {\n content: "Need help?";\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%) translateY(-8px);\n background: rgba(0,0,0,0.8);\n color: white;\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 11px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n }\n \n .glide-btn-help:hover::after {\n opacity: 1;\n }\n\n /* --- Outlined Phone Animation --- */\n .glide-phone-animation-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.3s;\n border-radius: 16px;\n background: rgba(255,255,255,0.8);\n }\n \n #glide-modal.dark .glide-phone-animation-overlay {\n background: rgba(0,0,0,0.6);\n }\n \n .glide-phone-animation-overlay.playing {\n opacity: 1;\n }\n\n .glide-outlined-phone {\n width: 100px;\n height: 180px;\n border: 4px solid var(--glide-phone-border);\n border-radius: 16px;\n position: relative;\n background: transparent;\n box-shadow: 0 10px 30px rgba(0,0,0,0.2);\n transform: translateY(20px);\n }\n \n /* Notch */\n .glide-outlined-phone::before {\n content: \'\';\n position: absolute;\n top: -1px;\n left: 50%;\n transform: translateX(-50%);\n width: 40%;\n height: 12px;\n background: var(--glide-phone-border);\n border-bottom-left-radius: 8px;\n border-bottom-right-radius: 8px;\n }\n \n /* Scanning Line */\n .glide-scan-line {\n position: absolute;\n top: 10%;\n left: 5%;\n width: 90%;\n height: 2px;\n background: var(--glide-primary);\n box-shadow: 0 0 8px var(--glide-primary);\n opacity: 0;\n }\n \n /* Animation Keyframes */\n @keyframes glide-scan-motion {\n 0% { top: 10%; opacity: 0; }\n 10% { opacity: 1; }\n 90% { opacity: 1; }\n 100% { top: 90%; opacity: 0; }\n }\n \n .glide-phone-animation-overlay.playing .glide-outlined-phone {\n animation: glide-phone-appear 3s ease-in-out forwards;\n }\n \n .glide-phone-animation-overlay.playing .glide-scan-line {\n animation: glide-scan-motion 2s ease-in-out 0.5s infinite;\n }\n \n @keyframes glide-phone-appear {\n 0% { transform: translateY(20px); opacity: 0; }\n 10% { transform: translateY(0); opacity: 1; }\n 90% { transform: translateY(0); opacity: 1; }\n 100% { transform: translateY(20px); opacity: 0; }\n }\n \n /* Dual Mode */\n .glide-dual-container {\n display: flex;\n justify-content: center;\n align-items: stretch;\n gap: 32px;\n margin-top: 20px;\n }\n \n .glide-dual-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n \n .glide-os-logo {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 600;\n margin-bottom: 12px;\n font-size: 15px;\n color: inherit;\n }\n \n /* Dual mode OS logo - aligned icons with text, spacing to QR */\n .glide-dual-mode .glide-os-logo {\n margin-bottom: 12px; /* Space between label and QR code */\n }\n \n #glide-modal .glide-dual-mode .glide-os-logo .glide-icon-os,\n #glide-modal .glide-dual-mode .glide-os-logo svg {\n width: var(--glide-dual-icon-size);\n height: var(--glide-dual-icon-size);\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n }\n \n .glide-dual-mode .glide-os-logo span {\n margin: 0;\n padding: 0;\n line-height: 1;\n }\n \n .glide-os-logo svg {\n width: 20px;\n height: 20px;\n opacity: 0.8;\n }\n \n /* Dual Mode Separator - aligned to QR codes only */\n .glide-dual-separator {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n align-self: stretch;\n /* Offset for OS label (18px icon + 12px margin = ~30px) */\n margin-top: 30px;\n padding: 20px 0;\n }\n \n .glide-separator-line {\n width: 1px;\n flex: 1;\n background: linear-gradient(to bottom, transparent, rgba(128,128,128,0.3), transparent);\n }\n \n .glide-separator-text {\n padding: 8px 0;\n font-size: 11px;\n font-weight: 500;\n color: rgba(128,128,128,0.5);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n \n #glide-modal.dark .glide-separator-line {\n background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);\n }\n \n #glide-modal.dark .glide-separator-text {\n color: rgba(255,255,255,0.4);\n }\n \n /* Pre-Step */\n .glide-pre-step-container {\n display: flex;\n gap: 20px;\n justify-content: center;\n margin: 24px 0;\n }\n \n .glide-os-choice-btn {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 140px;\n height: 140px;\n border: 1px solid rgba(0,0,0,0.08);\n border-radius: 20px;\n background: rgba(255,255,255,0.4);\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);\n position: relative;\n overflow: hidden;\n font-size: 14px;\n color: inherit;\n }\n \n #glide-modal.dark .glide-os-choice-btn {\n background: rgba(255,255,255,0.05);\n border-color: rgba(255,255,255,0.1);\n color: white;\n }\n \n .glide-os-choice-btn:hover {\n background: rgba(255,255,255,0.9);\n transform: translateY(-4px);\n box-shadow: 0 12px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);\n border-color: var(--glide-primary);\n }\n \n #glide-modal.dark .glide-os-choice-btn:hover {\n background: rgba(255,255,255,0.15);\n box-shadow: 0 12px 24px rgba(0,0,0,0.3);\n border-color: var(--glide-primary);\n }\n \n .glide-icon-os {\n width: 40px;\n height: 40px;\n margin-bottom: 12px;\n transition: transform 0.3s;\n fill: currentColor;\n }\n \n .glide-os-choice-btn:hover .glide-icon-os {\n transform: scale(1.1);\n }\n \n #glide-modal .glide-btn-back {\n position: absolute;\n top: 16px;\n left: 16px;\n width: var(--glide-btn-size);\n height: var(--glide-btn-size);\n min-width: var(--glide-btn-size);\n min-height: var(--glide-btn-size);\n max-width: var(--glide-btn-size);\n max-height: var(--glide-btn-size);\n background: rgba(118, 118, 128, 0.12);\n border: none;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n color: rgba(0,0,0,0.5);\n transition: background 0.2s;\n z-index: 20;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n flex-shrink: 0;\n }\n \n #glide-modal.dark .glide-btn-back {\n background: rgba(255, 255, 255, 0.1);\n color: rgba(255,255,255,0.5);\n }\n\n .glide-btn-back:hover {\n background: rgba(118, 118, 128, 0.2);\n }\n \n #glide-modal.dark .glide-btn-back:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n \n .glide-spinner {\n width: 40px;\n height: 40px;\n border: 3px solid rgba(0,0,0,0.1);\n border-top-color: var(--glide-primary);\n border-radius: 50%;\n animation: glide-spin 1s linear infinite;\n margin: 40px auto;\n }\n \n #glide-modal.dark .glide-spinner {\n border-color: rgba(255,255,255,0.1);\n border-top-color: var(--glide-primary);\n }\n \n @keyframes glide-spin {\n to { transform: rotate(360deg); }\n }\n ',document.head.appendChild(e)}show(){this.container&&this.backdrop&&!this.isOpen?(document.body.appendChild(this.backdrop),document.body.appendChild(this.container),this.lockBodyScroll(),document.addEventListener("keydown",this.handleEscapeKey),requestAnimationFrame(()=>{this.backdrop&&this.container&&(this.backdrop.style.opacity="1",this.container.style.opacity="1",this.container.style.transform="translateX(-50%) scale(1)")}),this.isOpen=!0):this.isOpen&&this.container&&this.backdrop&&(document.removeEventListener("keydown",this.handleEscapeKey),document.addEventListener("keydown",this.handleEscapeKey))}setupPlatformToggles(){const e=this.container?.querySelector("#glide-toggle"),n=this.container?.querySelectorAll(".glide-toggle-btn"),t=this.container?.querySelector("#glide-qr-img"),i=this.container?.querySelector("#glide-platform-message");n&&t&&n.forEach(o=>{o.addEventListener("click",o=>{const r=o.currentTarget,a=r.getAttribute("data-platform");e&&a&&e.setAttribute("data-active",a),n.forEach(e=>e.classList.remove("active")),r.classList.add("active"),"ios"===a?(t.src=t.getAttribute("data-ios")||"",i&&(i.textContent="Scan with your iPhone camera")):"android"===a&&(t.src=t.getAttribute("data-android")||"",i&&(i.textContent="Scan with your Android camera"))})})}lockBodyScroll(){this.originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden"}unlockBodyScroll(){document.body.style.overflow=this.originalBodyOverflow}close(){this.container&&this.backdrop&&this.isOpen&&(this.isClosing=!0,document.removeEventListener("keydown",this.handleEscapeKey),this.backdrop.style.opacity="0",this.container.style.opacity="0",this.container.style.transform="translateX(-50%) scale(0.94)",this.closeCallback=void 0,setTimeout(()=>{this.isClosing&&(this.cleanup(),this.isOpen=!1,this.isClosing=!1)},400))}cleanup(){this.container?.remove(),this.backdrop?.remove(),this.container=null,this.backdrop=null,this.unlockBodyScroll()}isModalOpen(){return this.isOpen}}function w(e){const{data:n}=e;if(n.ios_qr_image)return{iosQRCode:n.ios_qr_image,androidQRCode:n.android_qr_image||n.ios_qr_image};if(n.qr_code_image)return n.qr_code_image;throw new Error("No QR code data available")}class k{constructor(){this.logs=[],this.container=null,this.logsContainer=null,this.floatingToggle=null,this.isAtBottom=!0,this.isVisible=!0,this.originalConsole={log:console.log,error:console.error,warn:console.warn,debug:console.debug,info:console.info},this.interceptConsole(),this.createUI()}static init(){return k.instance||(k.instance=new k),k.instance}static destroy(){k.instance&&(k.instance.cleanup(),k.instance=null)}interceptConsole(){["log","error","warn","debug","info"].forEach(e=>{const n=this.originalConsole[e];console[e]=(...t)=>{n.apply(console,t),this.addLog(e,t)}})}addLog(e,n){const t=(new Date).toTimeString().split(" ")[0],i=n.map(e=>{if("object"==typeof e)try{return JSON.stringify(e,null,2)}catch{return"[Object]"}return String(e)}).join(" "),o={log:"#abb2bf",error:"#e06c75",warn:"#e5c07b",info:"#61afef",debug:"#5c6370"},r=`\n <div style="margin: 3px 0; font-family: 'SF Mono', Menlo, Monaco, monospace; font-size: 11px; color: ${o[e]||"#abb2bf"}; line-height: 1.5;">\n <span style="color: #5c6370; font-size: 10px;">${t}</span>\n <span style="background: ${{log:"#3c3c3c",error:"rgba(224, 108, 117, 0.2)",warn:"rgba(229, 192, 123, 0.2)",info:"rgba(97, 175, 239, 0.2)",debug:"#2d2d2d"}[e]}; color: ${o[e]}; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 500; text-transform: uppercase; margin: 0 6px;">${e}</span>\n <span style="white-space: pre-wrap; word-break: break-all;">${this.escapeHtml(i)}</span>\n </div>\n `;this.logs.push(r),this.logs.length>500&&this.logs.shift(),this.updateDisplay()}updateDisplay(){this.logsContainer&&this.isVisible&&(this.isAtBottom=this.logsContainer.scrollHeight-this.logsContainer.scrollTop<=this.logsContainer.clientHeight+50,this.logsContainer.innerHTML=this.logs.join(""),this.isAtBottom&&(this.logsContainer.scrollTop=this.logsContainer.scrollHeight))}createUI(){const e=document.createElement("style");e.textContent="\n #mobile-debug-console {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n height: 45vh;\n background: #1e1e1e;\n z-index: 999999;\n display: flex;\n flex-direction: column;\n font-family: 'SF Mono', Menlo, Monaco, 'Courier New', monospace;\n transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n border-top: 1px solid #3c3c3c;\n box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);\n }\n \n #mobile-debug-console.hidden {\n transform: translateY(100%);\n }\n \n #debug-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n background: #2d2d2d;\n border-bottom: 1px solid #3c3c3c;\n min-height: 36px;\n }\n \n #debug-title {\n display: flex;\n align-items: center;\n gap: 8px;\n color: #9da5b4;\n font-size: 12px;\n font-weight: 500;\n letter-spacing: 0.3px;\n }\n \n #debug-title svg {\n width: 14px;\n height: 14px;\n opacity: 0.8;\n }\n \n /* Traffic light buttons - using ID for specificity */\n #mobile-debug-console .debug-traffic-lights {\n display: flex;\n gap: 8px;\n align-items: center;\n }\n \n #mobile-debug-console button.debug-traffic-btn {\n width: 16px;\n height: 16px;\n min-width: 16px;\n min-height: 16px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n font-size: 0;\n line-height: 1;\n }\n \n #mobile-debug-console .debug-traffic-btn svg {\n width: 8px;\n height: 8px;\n }\n \n #mobile-debug-console .debug-traffic-btn.close {\n background: #ff5f57;\n }\n \n #mobile-debug-console .debug-traffic-btn.close svg {\n stroke: #820005;\n stroke-width: 2;\n }\n \n #mobile-debug-console .debug-traffic-btn.clear {\n background: #febc2e;\n }\n \n #mobile-debug-console .debug-traffic-btn.minimize {\n background: #28c840;\n }\n \n #mobile-debug-console .debug-traffic-btn.minimize svg {\n stroke: #006500;\n stroke-width: 2;\n }\n \n #mobile-debug-console .debug-traffic-btn:active {\n filter: brightness(0.85);\n }\n \n #debug-logs {\n flex: 1;\n overflow-y: auto;\n padding: 12px;\n background: #1e1e1e;\n -webkit-overflow-scrolling: touch;\n }\n \n button#debug-floating-toggle {\n position: fixed !important;\n bottom: 20px !important;\n right: 20px !important;\n width: 42px !important;\n height: 42px !important;\n min-width: 42px !important;\n min-height: 42px !important;\n border-radius: 8px !important;\n background: #2d2d2d !important;\n border: 1px solid #3c3c3c !important;\n color: #9da5b4 !important;\n cursor: pointer !important;\n z-index: 999998 !important;\n display: none;\n align-items: center !important;\n justify-content: center !important;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;\n transition: all 0.2s ease !important;\n padding: 0 !important;\n margin: 0 !important;\n }\n \n button#debug-floating-toggle:hover {\n background: #3c3c3c !important;\n color: #fff !important;\n transform: translateY(-2px) !important;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;\n }\n \n button#debug-floating-toggle:active {\n transform: translateY(0) !important;\n }\n \n button#debug-floating-toggle.visible {\n display: flex !important;\n }\n \n button#debug-floating-toggle svg {\n width: 20px !important;\n height: 20px !important;\n }\n ",document.head.appendChild(e);const n='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 17 10 11 4 5"></polyline><line x1="12" y1="19" x2="20" y2="19"></line></svg>';this.container=document.createElement("div"),this.container.id="mobile-debug-console",this.isVisible||(this.container.className="hidden");const t=document.createElement("div");t.id="debug-header";const i=document.createElement("div");i.id="debug-title",i.innerHTML=`${n}<span>Mobile Console</span>`;const o=document.createElement("div");o.className="debug-traffic-lights";const r=document.createElement("button");r.className="debug-traffic-btn close",r.title="Close",r.innerHTML='<svg viewBox="0 0 10 10" fill="none"><line x1="2.5" y1="2.5" x2="7.5" y2="7.5" stroke="currentColor"/><line x1="7.5" y1="2.5" x2="2.5" y2="7.5" stroke="currentColor"/></svg>',r.onclick=()=>this.cleanup();const a=document.createElement("button");a.className="debug-traffic-btn clear",a.title="Clear",a.innerHTML='<svg viewBox="0 0 16 16" fill="currentColor"><path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z"/><path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z"/></svg>',a.onclick=()=>this.clear();const s=document.createElement("button");s.className="debug-traffic-btn minimize",s.title="Minimize",s.innerHTML='<svg viewBox="0 0 10 10" fill="none"><path d="M2 3L5 6L8 3" stroke="currentColor" fill="none"/></svg>',s.onclick=()=>this.toggle(),o.appendChild(r),o.appendChild(a),o.appendChild(s),t.appendChild(o),t.appendChild(i),this.logsContainer=document.createElement("div"),this.logsContainer.id="debug-logs",this.logsContainer.addEventListener("scroll",()=>{this.isAtBottom=this.logsContainer.scrollHeight-this.logsContainer.scrollTop<=this.logsContainer.clientHeight+50}),this.container.appendChild(t),this.container.appendChild(this.logsContainer),document.body.appendChild(this.container),this.floatingToggle=document.createElement("button"),this.floatingToggle.id="debug-floating-toggle",this.floatingToggle.innerHTML=n,this.floatingToggle.title="Show Console",this.floatingToggle.onclick=()=>this.toggle(),document.body.appendChild(this.floatingToggle)}escapeHtml(e){const n=document.createElement("div");return n.textContent=e,n.innerHTML}toggle(){this.isVisible=!this.isVisible,this.container&&this.floatingToggle&&(this.isVisible?(this.container.classList.remove("hidden"),this.floatingToggle.classList.remove("visible"),this.updateDisplay()):(this.container.classList.add("hidden"),this.floatingToggle.classList.add("visible")))}clear(){this.logs=[],this.logsContainer&&(this.logsContainer.innerHTML="")}cleanup(){Object.keys(this.originalConsole).forEach(e=>{console[e]=this.originalConsole[e]}),this.container&&this.container.remove(),this.floatingToggle&&this.floatingToggle.remove()}}k.instance=null;class E{constructor(e={}){this.config={...e,endpoints:{prepare:e.endpoints?.prepare||"/api/magic-auth/prepare",process:e.endpoints?.process||"/api/magic-auth/process",polling:e.endpoints?.polling},headers:e.headers,timeout:e.timeout||3e4,pollingInterval:e.pollingInterval||2e3,maxPollingAttempts:e.maxPollingAttempts||30,debug:e.debug||!1},this.http=e.httpClient||function(e={}){const{timeout:n=3e4,headers:t={},dynamicHeaders:i}=e;async function o(e,n){const o={"Content-Type":"application/json"};t.common&&Object.assign(o,t.common);const r=t[e.endpoint];if(r&&"object"==typeof r&&Object.assign(o,r),i){const n=await i(e);Object.assign(o,n)}return n&&Object.assign(o,n),o}async function r(e,n,t,i){const o=new AbortController,r=setTimeout(()=>o.abort(),t),a=i?()=>o.abort():null;i&&a&&i.addEventListener("abort",a);try{return await fetch(e,{...n,signal:o.signal})}catch(e){if(e instanceof Error&&"AbortError"===e.name){if(i?.aborted)throw h(s.CANCELLED,"Request was cancelled");throw h(s.TIMEOUT,"Request timed out")}throw h(s.NETWORK_ERROR,e instanceof Error?e.message:"Network request failed")}finally{clearTimeout(r),i&&a&&i.removeEventListener("abort",a)}}async function a(e){let n;try{n=await e.json()}catch{if(!e.ok)throw h(s.INVALID_RESPONSE,`Request failed with status ${e.status}`);throw h(s.INVALID_RESPONSE,"Failed to parse response")}if(!e.ok)throw function(e){if(e&&("code"in e||"error"in e)){const n=e,t=n.code||n.error,i=n.message,o=new Error(i||"An error occurred");return o.code=t,o.status=n.status,o.requestId=n.requestId||n.request_id,o.timestamp=n.timestamp,o.details=n.details,o.traceId=n.trace_id||n.traceId,o.spanId=n.span_id||n.spanId,o.service=n.service,n.details&&"object"==typeof n.details&&"retryAfter"in n.details&&(o.retryAfter=n.details.retryAfter),o}if(e&&"status"in e){const n=e,t=n.status,i=new Error(n.message||`Request failed with status ${t}`);return i.code=`HTTP_${t}`,i.status=t,i}const n=new Error("An unexpected error occurred");return n.code="UNKNOWN_ERROR",n}({...n,status:e.status});return n}function l(e){return e.includes("/prepare")?"prepare":e.includes("/process")||e.includes("/get-phone")||e.includes("/verify-phone")?"process":e.includes("/status")?"polling":"prepare"}return{async post(e,t,i){const s=l(e),d=await o({endpoint:s,method:"POST"},i?.headers);return a(await r(e,{method:"POST",headers:d,body:JSON.stringify(t)},i?.timeout||n,i?.signal))},async get(e,t){const i=l(e),s=await o({endpoint:i,method:"GET"},t?.headers);return delete s["Content-Type"],a(await r(e,{method:"GET",headers:s},t?.timeout||n,t?.signal))}}}({timeout:this.config.timeout,headers:e.headers,dynamicHeaders:e.dynamicHeaders}),this.logger=e.logger||(this.config.debug?function(e={}){const{debug:n=!1,prefix:t="[PhoneAuth]"}=e;function i(e,n){const i=`${t} ${e}`;return void 0!==n?[i,y(n)]:[i]}return{debug(e,t){if(n){const n=i(e,t);console.debug(...n)}},info(e,n){const t=i(e,n);console.info(...t)},warn(e,n){const t=i(e,n);console.warn(...t)},error(e,n){const t=i(e,n);console.error(...t)}}}({debug:!0}):{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}}),this.logger.debug("PhoneAuthClient initialized",{endpoints:this.config.endpoints,timeout:this.config.timeout}),e.devtools?.showMobileConsole&&"undefined"!=typeof window&&(k.init(),this.logger.info("Mobile debug console enabled"))}async authenticate(e,n){const i=await this.prepare(e),o=await this.invokeSecurePrompt(i,n),r=await o.credential,a=i.session.use_case||i.session.metadata?.use_case||e.use_case;if(!a)throw h(s.INVALID_RESPONSE,"Could not determine use_case from session or request");return a===t.VERIFY_PHONE_NUMBER?this.verifyPhoneNumber(r,i.session):this.getPhoneNumber(r,i.session)}async prepare(e){if(this.logger.debug("Preparing authentication",{use_case:e.use_case}),e.phone_number){const n=r(e.phone_number);if(!n.valid)throw h(s.INVALID_PHONE_NUMBER,n.error)}if(e.plmn){const n=a(e.plmn);if(!n.valid)throw h(s.INVALID_PLMN,n.error)}if(!e.use_case&&!e.options?.parent_session_id)throw h(s.MISSING_PARAMETERS,"use_case is required");const n={...e,id:e.id||this.generateRequestId(),client_info:e.client_info||{user_agent:navigator.userAgent,platform:navigator.platform}};try{const e=await this.http.post(this.config.endpoints.prepare,n);return this.logger.debug("Prepare successful",{strategy:e.authentication_strategy,sessionKey:e.session.session_key}),e}catch(e){throw this.logger.error("Prepare failed",e),e}}async invokeSecurePrompt(e,n){const{authentication_strategy:t,session:o,data:r}=e;switch(this.logger.debug("Invoking secure prompt",{strategy:t}),t){case i.TS43:return this.handleTS43(r,o);case i.LINK:return this.handleLink(r,o,n);case i.DESKTOP:return this.handleDesktop(r,o,n);default:throw h(s.UNSUPPORTED_STRATEGY,`Unknown strategy: ${t}`)}}async getPhoneNumber(e,n){this.logger.debug("Getting phone number");const i={session:n,credential:e,use_case:t.GET_PHONE_NUMBER};try{const e=await this.http.post(this.config.endpoints.process,i);return this.logger.info("Phone number retrieved"),e}catch(e){throw this.logger.error("Get phone number failed",e),e}}async verifyPhoneNumber(e,n){this.logger.debug("Verifying phone number");const i={session:n,credential:e,use_case:t.VERIFY_PHONE_NUMBER};try{const e=await this.http.post(this.config.endpoints.process,i);return this.logger.info("Phone number verified",{verified:e.verified}),e}catch(e){throw this.logger.error("Verify phone number failed",e),e}}isSupported(){return"undefined"!=typeof window&&"DigitalCredential"in window}getBrowserSupportInfo(){if("undefined"==typeof window)return{supported:!1,browser:"unknown",message:"Not in browser"};const e=navigator.userAgent,n=/Chrome/.test(e)&&/Google Inc/.test(navigator.vendor),t=/Edg\//.test(e);return this.isSupported()?{supported:!0,browser:n?"Chrome":t?"Edge":"Other"}:{supported:!1,browser:n?"Chrome":t?"Edge":"Other",message:"Enable chrome://flags/#web-identity-digital-credentials"}}async handleTS43(e,n){if(!this.isSupported())throw h(s.BROWSER_NOT_SUPPORTED,"Digital Credentials API not available");const t={digital:{requests:[{protocol:e.protocol,data:e.data}]}};return this.logger.debug("Invoking Digital Credentials API"),{credential:(async()=>{try{const e=await navigator.credentials.get(t);if(!e?.data?.vp_token)throw h(s.INVALID_RESPONSE,"No credential returned from Digital Credentials API");const n=e.data.vp_token,i="string"==typeof n?n:Object.values(n)[0],o=Array.isArray(i)?i[0]:i;if(!o||"string"==typeof o&&""===o.trim())throw h(s.INVALID_RESPONSE,"Empty credential returned from Digital Credentials API");return o}catch(e){if(d(e))throw e;const n=e;if("NotAllowedError"===n.name||"NetworkError"===n.name&&19===n.code)throw h(s.USER_CANCELLED,"User cancelled authentication");if("NotSupportedError"===n.name)throw h(s.BROWSER_NOT_SUPPORTED,"Browser not supported");throw h(s.NETWORK_ERROR,n.message||"Credential request failed")}})(),cancel:void 0,strategy:i.TS43,session:n}}handleLink(e,n,t){if(!e.url)throw h(s.INVALID_RESPONSE,"Missing link URL");this.logger.debug("Opening App Clip",{url:e.url}),window.location.href=e.url;const o={...this.config.headers?.common,...this.config.headers?.polling},r=v({sessionKey:n.session_key,interval:t?.pollingInterval||this.config.pollingInterval,maxAttempts:t?.maxPollingAttempts||this.config.maxPollingAttempts,pollingEndpoint:t?.pollingEndpoint||this.config.endpoints.polling,statusUrl:e.status_url,logger:this.logger,headers:Object.keys(o).length>0?o:void 0});return{credential:r.start().then(e=>{if("completed"===e.status&&e.credential)return e.credential;throw h(s.VERIFICATION_FAILED,e.message||"Link authentication failed")}),cancel:()=>r.cancel(),strategy:i.LINK,session:n}}handleDesktop(e,n,t){const o=e.data?.session_id||n.session_key;this.logger.debug("Starting desktop authentication",{sessionId:o});const r={...this.config.headers?.common,...this.config.headers?.polling},a=v({sessionKey:o,interval:t?.pollingInterval||this.config.pollingInterval,maxAttempts:t?.maxPollingAttempts||this.config.maxPollingAttempts,pollingEndpoint:t?.pollingEndpoint||this.config.endpoints.polling,statusUrl:e.data?.status_url,logger:this.logger,headers:Object.keys(r).length>0?r:void 0});let l=null;if(!t?.preventDefaultUI)try{const n=w(e);l=new x(t?.modalOptions),l.showQRCode(n,t?.modalOptions?.description||"Scan with your phone camera"),l.setCloseCallback(()=>{this.logger.debug("Modal closed by user, cancelling authentication"),a.cancel()}),this.logger.debug("Desktop modal displayed")}catch(e){this.logger.warn("Failed to show modal, continuing with polling only",e)}return{credential:a.start().then(e=>{if(l&&l.close(),"completed"===e.status&&e.credential)return e.credential;throw h(s.VERIFICATION_FAILED,e.message||"Desktop authentication failed")}).catch(e=>{throw l&&l.close(),e}),cancel:()=>{a.cancel(),l&&l.close()},strategy:i.DESKTOP,session:n}}generateRequestId(){return`web-${Date.now()}-${Math.random().toString(36).substring(2,11)}`}}function C(e){return null!==e&&"object"==typeof e&&"credential"in e&&"strategy"in e&&"session"in e}function S(e){return null!==e&&"object"==typeof e&&"credential"in e&&"authenticated"in e&&"session"in e}function A(e){return e.strategy===i.TS43}function R(e){return e.strategy===i.LINK}function I(e){return e.strategy===i.DESKTOP}function _(e){return void 0!==e.cancel}function N(e){return null!==e&&"object"==typeof e&&"protocol"in e&&"data"in e&&"object"==typeof e.data&&"dcql_query"in e.data}function O(e){return null!==e&&"object"==typeof e&&"url"in e&&"string"==typeof e.url}function T(e){return null!==e&&"object"==typeof e&&"data"in e&&"object"==typeof e.data}function P(e){return!("verified"in e)}function L(e){return"verified"in e}function D(e){return null!==e&&"object"==typeof e&&"code"in e&&"message"in e}return n})());
@@ -58,8 +58,15 @@ function usePhoneAuth(config) {
58
58
  const [result, setResult] = (0, react_1.useState)(null);
59
59
  const [step, setStep] = (0, react_1.useState)('idle');
60
60
  // Memoize client - recreate if config changes
61
- // Using JSON.stringify for stable comparison of config object
62
- const configKey = JSON.stringify(config);
61
+ // Note: JSON.stringify excludes functions, so httpClient, logger, and dynamicHeaders
62
+ // won't trigger recreation. For function props, ensure they're stable (use useCallback)
63
+ // or pass them via a ref pattern.
64
+ const configKey = JSON.stringify(config, (key, value) => {
65
+ // Include function presence in the key (won't capture implementation changes)
66
+ if (typeof value === 'function')
67
+ return `[Function:${key}]`;
68
+ return value;
69
+ });
63
70
  const client = (0, react_1.useMemo)(() => new phone_auth_client_1.PhoneAuthClient(config), [configKey]);
64
71
  const isSupported = (0, react_1.useMemo)(() => client.isSupported(), [client]);
65
72
  /**
@@ -28,6 +28,7 @@ class PhoneAuthClient {
28
28
  process: config.endpoints?.process || '/api/magic-auth/process',
29
29
  polling: config.endpoints?.polling,
30
30
  },
31
+ headers: config.headers,
31
32
  timeout: config.timeout || 30000,
32
33
  pollingInterval: config.pollingInterval || 2000,
33
34
  maxPollingAttempts: config.maxPollingAttempts || 30,
@@ -179,7 +180,7 @@ class PhoneAuthClient {
179
180
  this.logger.debug('Getting phone number');
180
181
  const requestBody = {
181
182
  session,
182
- credential: credential.credential,
183
+ credential,
183
184
  use_case: core_1.USE_CASE.GET_PHONE_NUMBER,
184
185
  };
185
186
  try {
@@ -199,7 +200,7 @@ class PhoneAuthClient {
199
200
  this.logger.debug('Verifying phone number');
200
201
  const requestBody = {
201
202
  session,
202
- credential: credential.credential,
203
+ credential,
203
204
  use_case: core_1.USE_CASE.VERIFY_PHONE_NUMBER,
204
205
  };
205
206
  try {
@@ -267,7 +268,7 @@ class PhoneAuthClient {
267
268
  },
268
269
  };
269
270
  this.logger.debug('Invoking Digital Credentials API');
270
- // Create credential promise
271
+ // Create credential promise - resolves to just the credential string
271
272
  const credentialPromise = (async () => {
272
273
  try {
273
274
  const response = await navigator.credentials.get(credentialRequest);
@@ -287,11 +288,8 @@ class PhoneAuthClient {
287
288
  if (!credential || (typeof credential === 'string' && credential.trim() === '')) {
288
289
  throw (0, errors_1.createAuthError)(errors_1.ERROR_CODES.INVALID_RESPONSE, 'Empty credential returned from Digital Credentials API');
289
290
  }
290
- return {
291
- credential: credential,
292
- session,
293
- authenticated: true,
294
- };
291
+ // Return just the credential string
292
+ return credential;
295
293
  }
296
294
  catch (error) {
297
295
  // If it's already an AuthError, rethrow it directly
@@ -330,6 +328,11 @@ class PhoneAuthClient {
330
328
  // Navigate to App Clip URL (must be from user gesture)
331
329
  // Using window.location.href for better iOS compatibility
332
330
  window.location.href = data.url;
331
+ // Build polling headers (merge common + polling-specific)
332
+ const pollingHeaders = {
333
+ ...this.config.headers?.common,
334
+ ...this.config.headers?.polling,
335
+ };
333
336
  // Start polling for authentication status
334
337
  const polling = (0, polling_1.createPollingHandler)({
335
338
  sessionKey: session.session_key,
@@ -338,15 +341,12 @@ class PhoneAuthClient {
338
341
  pollingEndpoint: options?.pollingEndpoint || this.config.endpoints.polling,
339
342
  statusUrl: data.status_url,
340
343
  logger: this.logger,
344
+ headers: Object.keys(pollingHeaders).length > 0 ? pollingHeaders : undefined,
341
345
  });
342
- // Create credential promise from polling
346
+ // Create credential promise from polling - resolves to just the credential string
343
347
  const credentialPromise = polling.start().then(result => {
344
348
  if (result.status === 'completed' && result.credential) {
345
- return {
346
- credential: result.credential,
347
- session: result.session || session,
348
- authenticated: true,
349
- };
349
+ return result.credential;
350
350
  }
351
351
  throw (0, errors_1.createAuthError)(errors_1.ERROR_CODES.VERIFICATION_FAILED, result.message || 'Link authentication failed');
352
352
  });
@@ -364,6 +364,11 @@ class PhoneAuthClient {
364
364
  // Extract session ID for polling
365
365
  const sessionId = data.data?.session_id || session.session_key;
366
366
  this.logger.debug('Starting desktop authentication', { sessionId });
367
+ // Build polling headers (merge common + polling-specific)
368
+ const pollingHeaders = {
369
+ ...this.config.headers?.common,
370
+ ...this.config.headers?.polling,
371
+ };
367
372
  // Start polling for authentication status
368
373
  const polling = (0, polling_1.createPollingHandler)({
369
374
  sessionKey: sessionId,
@@ -372,6 +377,7 @@ class PhoneAuthClient {
372
377
  pollingEndpoint: options?.pollingEndpoint || this.config.endpoints.polling,
373
378
  statusUrl: data.data?.status_url,
374
379
  logger: this.logger,
380
+ headers: Object.keys(pollingHeaders).length > 0 ? pollingHeaders : undefined,
375
381
  });
376
382
  // Show modal UI if not prevented
377
383
  let modal = null;
@@ -393,18 +399,14 @@ class PhoneAuthClient {
393
399
  this.logger.warn('Failed to show modal, continuing with polling only', e);
394
400
  }
395
401
  }
396
- // Create credential promise from polling
402
+ // Create credential promise from polling - resolves to just the credential string
397
403
  const credentialPromise = polling.start().then(result => {
398
404
  // Close modal on success
399
405
  if (modal) {
400
406
  modal.close();
401
407
  }
402
408
  if (result.status === 'completed' && result.credential) {
403
- return {
404
- credential: result.credential,
405
- session: result.session || session,
406
- authenticated: true,
407
- };
409
+ return result.credential;
408
410
  }
409
411
  throw (0, errors_1.createAuthError)(errors_1.ERROR_CODES.VERIFICATION_FAILED, result.message || 'Desktop authentication failed');
410
412
  }).catch(error => {
@@ -13,7 +13,7 @@ const errors_1 = require("../../core/errors");
13
13
  * Creates a polling handler for authentication status.
14
14
  */
15
15
  function createPollingHandler(config) {
16
- const { sessionKey, interval = 2000, maxAttempts = 30, pollingEndpoint, statusUrl, logger, } = config;
16
+ const { sessionKey, interval = 2000, maxAttempts = 30, pollingEndpoint, statusUrl, logger, headers: customHeaders, } = config;
17
17
  let pollingIntervalId;
18
18
  let attempts = 0;
19
19
  let isCancelled = false;
@@ -71,16 +71,28 @@ function createPollingHandler(config) {
71
71
  logger?.debug('Polling status', { url, attempt: attempts + 1, maxAttempts });
72
72
  const response = await fetch(url, {
73
73
  method: 'GET',
74
- headers: { 'Accept': 'application/json' },
74
+ headers: {
75
+ 'Accept': 'application/json',
76
+ ...customHeaders,
77
+ },
75
78
  });
76
79
  if (response.status === 200) {
77
80
  const result = await response.json();
78
81
  if (result.status === 'completed') {
79
82
  stop();
80
83
  logger?.info('Authentication completed');
84
+ // Credential must be present for completed status
85
+ if (!result.credential) {
86
+ logger?.error('Status completed but no credential returned');
87
+ resolve({
88
+ status: 'error',
89
+ message: 'Authentication completed but no credential returned',
90
+ });
91
+ return;
92
+ }
81
93
  resolve({
82
94
  status: 'completed',
83
- credential: result.credential || sessionKey,
95
+ credential: result.credential,
84
96
  session: result.session || { session_key: sessionKey },
85
97
  });
86
98
  return;
@@ -48,8 +48,15 @@ export function usePhoneAuth(config) {
48
48
  const [result, setResult] = useState(null);
49
49
  const [step, setStep] = useState('idle');
50
50
  // Memoize client - recreate if config changes
51
- // Using JSON.stringify for stable comparison of config object
52
- const configKey = JSON.stringify(config);
51
+ // Note: JSON.stringify excludes functions, so httpClient, logger, and dynamicHeaders
52
+ // won't trigger recreation. For function props, ensure they're stable (use useCallback)
53
+ // or pass them via a ref pattern.
54
+ const configKey = JSON.stringify(config, (key, value) => {
55
+ // Include function presence in the key (won't capture implementation changes)
56
+ if (typeof value === 'function')
57
+ return `[Function:${key}]`;
58
+ return value;
59
+ });
53
60
  const client = useMemo(() => new PhoneAuthClient(config), [configKey]);
54
61
  const isSupported = useMemo(() => client.isSupported(), [client]);
55
62
  /**
@@ -25,6 +25,7 @@ export class PhoneAuthClient {
25
25
  process: config.endpoints?.process || '/api/magic-auth/process',
26
26
  polling: config.endpoints?.polling,
27
27
  },
28
+ headers: config.headers,
28
29
  timeout: config.timeout || 30000,
29
30
  pollingInterval: config.pollingInterval || 2000,
30
31
  maxPollingAttempts: config.maxPollingAttempts || 30,
@@ -176,7 +177,7 @@ export class PhoneAuthClient {
176
177
  this.logger.debug('Getting phone number');
177
178
  const requestBody = {
178
179
  session,
179
- credential: credential.credential,
180
+ credential,
180
181
  use_case: USE_CASE.GET_PHONE_NUMBER,
181
182
  };
182
183
  try {
@@ -196,7 +197,7 @@ export class PhoneAuthClient {
196
197
  this.logger.debug('Verifying phone number');
197
198
  const requestBody = {
198
199
  session,
199
- credential: credential.credential,
200
+ credential,
200
201
  use_case: USE_CASE.VERIFY_PHONE_NUMBER,
201
202
  };
202
203
  try {
@@ -264,7 +265,7 @@ export class PhoneAuthClient {
264
265
  },
265
266
  };
266
267
  this.logger.debug('Invoking Digital Credentials API');
267
- // Create credential promise
268
+ // Create credential promise - resolves to just the credential string
268
269
  const credentialPromise = (async () => {
269
270
  try {
270
271
  const response = await navigator.credentials.get(credentialRequest);
@@ -284,11 +285,8 @@ export class PhoneAuthClient {
284
285
  if (!credential || (typeof credential === 'string' && credential.trim() === '')) {
285
286
  throw createAuthError(ERROR_CODES.INVALID_RESPONSE, 'Empty credential returned from Digital Credentials API');
286
287
  }
287
- return {
288
- credential: credential,
289
- session,
290
- authenticated: true,
291
- };
288
+ // Return just the credential string
289
+ return credential;
292
290
  }
293
291
  catch (error) {
294
292
  // If it's already an AuthError, rethrow it directly
@@ -327,6 +325,11 @@ export class PhoneAuthClient {
327
325
  // Navigate to App Clip URL (must be from user gesture)
328
326
  // Using window.location.href for better iOS compatibility
329
327
  window.location.href = data.url;
328
+ // Build polling headers (merge common + polling-specific)
329
+ const pollingHeaders = {
330
+ ...this.config.headers?.common,
331
+ ...this.config.headers?.polling,
332
+ };
330
333
  // Start polling for authentication status
331
334
  const polling = createPollingHandler({
332
335
  sessionKey: session.session_key,
@@ -335,15 +338,12 @@ export class PhoneAuthClient {
335
338
  pollingEndpoint: options?.pollingEndpoint || this.config.endpoints.polling,
336
339
  statusUrl: data.status_url,
337
340
  logger: this.logger,
341
+ headers: Object.keys(pollingHeaders).length > 0 ? pollingHeaders : undefined,
338
342
  });
339
- // Create credential promise from polling
343
+ // Create credential promise from polling - resolves to just the credential string
340
344
  const credentialPromise = polling.start().then(result => {
341
345
  if (result.status === 'completed' && result.credential) {
342
- return {
343
- credential: result.credential,
344
- session: result.session || session,
345
- authenticated: true,
346
- };
346
+ return result.credential;
347
347
  }
348
348
  throw createAuthError(ERROR_CODES.VERIFICATION_FAILED, result.message || 'Link authentication failed');
349
349
  });
@@ -361,6 +361,11 @@ export class PhoneAuthClient {
361
361
  // Extract session ID for polling
362
362
  const sessionId = data.data?.session_id || session.session_key;
363
363
  this.logger.debug('Starting desktop authentication', { sessionId });
364
+ // Build polling headers (merge common + polling-specific)
365
+ const pollingHeaders = {
366
+ ...this.config.headers?.common,
367
+ ...this.config.headers?.polling,
368
+ };
364
369
  // Start polling for authentication status
365
370
  const polling = createPollingHandler({
366
371
  sessionKey: sessionId,
@@ -369,6 +374,7 @@ export class PhoneAuthClient {
369
374
  pollingEndpoint: options?.pollingEndpoint || this.config.endpoints.polling,
370
375
  statusUrl: data.data?.status_url,
371
376
  logger: this.logger,
377
+ headers: Object.keys(pollingHeaders).length > 0 ? pollingHeaders : undefined,
372
378
  });
373
379
  // Show modal UI if not prevented
374
380
  let modal = null;
@@ -390,18 +396,14 @@ export class PhoneAuthClient {
390
396
  this.logger.warn('Failed to show modal, continuing with polling only', e);
391
397
  }
392
398
  }
393
- // Create credential promise from polling
399
+ // Create credential promise from polling - resolves to just the credential string
394
400
  const credentialPromise = polling.start().then(result => {
395
401
  // Close modal on success
396
402
  if (modal) {
397
403
  modal.close();
398
404
  }
399
405
  if (result.status === 'completed' && result.credential) {
400
- return {
401
- credential: result.credential,
402
- session: result.session || session,
403
- authenticated: true,
404
- };
406
+ return result.credential;
405
407
  }
406
408
  throw createAuthError(ERROR_CODES.VERIFICATION_FAILED, result.message || 'Desktop authentication failed');
407
409
  }).catch(error => {
@@ -10,7 +10,7 @@ import { createAuthError, ERROR_CODES } from '../../core/errors';
10
10
  * Creates a polling handler for authentication status.
11
11
  */
12
12
  export function createPollingHandler(config) {
13
- const { sessionKey, interval = 2000, maxAttempts = 30, pollingEndpoint, statusUrl, logger, } = config;
13
+ const { sessionKey, interval = 2000, maxAttempts = 30, pollingEndpoint, statusUrl, logger, headers: customHeaders, } = config;
14
14
  let pollingIntervalId;
15
15
  let attempts = 0;
16
16
  let isCancelled = false;
@@ -68,16 +68,28 @@ export function createPollingHandler(config) {
68
68
  logger?.debug('Polling status', { url, attempt: attempts + 1, maxAttempts });
69
69
  const response = await fetch(url, {
70
70
  method: 'GET',
71
- headers: { 'Accept': 'application/json' },
71
+ headers: {
72
+ 'Accept': 'application/json',
73
+ ...customHeaders,
74
+ },
72
75
  });
73
76
  if (response.status === 200) {
74
77
  const result = await response.json();
75
78
  if (result.status === 'completed') {
76
79
  stop();
77
80
  logger?.info('Authentication completed');
81
+ // Credential must be present for completed status
82
+ if (!result.credential) {
83
+ logger?.error('Status completed but no credential returned');
84
+ resolve({
85
+ status: 'error',
86
+ message: 'Authentication completed but no credential returned',
87
+ });
88
+ return;
89
+ }
78
90
  resolve({
79
91
  status: 'completed',
80
- credential: result.credential || sessionKey,
92
+ credential: result.credential,
81
93
  session: result.session || { session_key: sessionKey },
82
94
  });
83
95
  return;
@@ -31,7 +31,7 @@
31
31
  * ```
32
32
  */
33
33
  import { PhoneAuthClient } from '../client/phone-auth-client';
34
- import type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, PhoneAuthResult, AuthError, AuthCredential, SessionInfo } from '../core/types';
34
+ import type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, PhoneAuthResult, AuthError, SessionInfo } from '../core/types';
35
35
  export { PhoneAuthClient } from '../client/phone-auth-client';
36
36
  export { USE_CASE, AUTHENTICATION_STRATEGY } from '../core/types';
37
37
  export { ERROR_CODES, isAuthError, createAuthError } from '../core/errors';
@@ -55,9 +55,9 @@ export interface UsePhoneAuthReturn {
55
55
  /** Granular: Invoke secure prompt */
56
56
  invokeSecurePrompt: (prepared: PrepareResponse, options?: InvokeOptions) => Promise<InvokeResult>;
57
57
  /** Granular: Get phone number from credential */
58
- getPhoneNumber: (credential: AuthCredential, session: SessionInfo) => Promise<PhoneAuthResult>;
58
+ getPhoneNumber: (credential: string, session: SessionInfo) => Promise<PhoneAuthResult>;
59
59
  /** Granular: Verify phone number with credential */
60
- verifyPhoneNumber: (credential: AuthCredential, session: SessionInfo) => Promise<PhoneAuthResult>;
60
+ verifyPhoneNumber: (credential: string, session: SessionInfo) => Promise<PhoneAuthResult>;
61
61
  /** Reset state */
62
62
  reset: () => void;
63
63
  /** Direct access to client for advanced use */
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/adapters/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,SAAS,EACT,cAAc,EACd,WAAW,EACZ,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3E,YAAY,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,SAAS,EACT,cAAc,EACd,WAAW,EACX,OAAO,EACP,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,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,CAAC,YAAY,CAAC,CAAC;IAClG,iDAAiD;IACjD,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACvF,oDAAoD;IACpD,iBAAiB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IAE1F,kBAAkB;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB,+CAA+C;IAC/C,MAAM,EAAE,eAAe,CAAC;CACzB;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,kBAAkB,CAgKpE"}
@@ -31,11 +31,11 @@
31
31
  * ```
32
32
  */
33
33
  import { PhoneAuthClient } from '../client/phone-auth-client';
34
- import type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, PhoneAuthResult, AuthError, AuthCredential, SessionInfo } from '../core/types';
34
+ import type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, PhoneAuthResult, AuthError, SessionInfo } from '../core/types';
35
35
  export { PhoneAuthClient } from '../client/phone-auth-client';
36
36
  export { USE_CASE, AUTHENTICATION_STRATEGY } from '../core/types';
37
37
  export { ERROR_CODES, isAuthError, createAuthError } from '../core/errors';
38
- export type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, PhoneAuthResult, AuthError, AuthCredential, SessionInfo, UseCase, AuthenticationStrategy, } from '../core/types';
38
+ export type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, PhoneAuthResult, GetPhoneNumberResponse, VerifyPhoneNumberResponse, AuthError, AuthCredential, SessionInfo, UseCase, AuthenticationStrategy, } from '../core/types';
39
39
  export type AuthStep = 'idle' | 'preparing' | 'invoking' | 'processing' | 'complete' | 'error';
40
40
  /**
41
41
  * Vue composable for phone authentication.
@@ -63,8 +63,8 @@ export declare function usePhoneAuth(config?: AuthConfig): {
63
63
  authenticate: (request: PrepareRequest, options?: InvokeOptions) => Promise<PhoneAuthResult>;
64
64
  prepare: (request: PrepareRequest) => Promise<PrepareResponse>;
65
65
  invokeSecurePrompt: (prepared: PrepareResponse, options?: InvokeOptions) => Promise<InvokeResult>;
66
- getPhoneNumber: (credential: AuthCredential, session: SessionInfo) => Promise<PhoneAuthResult>;
67
- verifyPhoneNumber: (credential: AuthCredential, session: SessionInfo) => Promise<PhoneAuthResult>;
66
+ getPhoneNumber: (credential: string, session: SessionInfo) => Promise<PhoneAuthResult>;
67
+ verifyPhoneNumber: (credential: string, session: SessionInfo) => Promise<PhoneAuthResult>;
68
68
  reset: () => void;
69
69
  client: PhoneAuthClient;
70
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../../src/adapters/vue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,SAAS,EACT,cAAc,EACd,WAAW,EACZ,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3E,YAAY,EACV,UAAU,EACV,cAAc,EACd,eAAe,EACf,aAAa,EACb,YAAY,EACZ,eAAe,EACf,SAAS,EACT,cAAc,EACd,WAAW,EACX,OAAO,EACP,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAMvB,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,UA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C,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;4BAiBnC,cAAc,YACb,aAAa,KACtB,OAAO,CAAC,eAAe,CAAC;uBAsBK,cAAc,KAAG,OAAO,CAAC,eAAe,CAAC;mCAsB7D,eAAe,YACf,aAAa,KACtB,OAAO,CAAC,YAAY,CAAC;iCAgBV,MAAM,WACT,WAAW,KACnB,OAAO,CAAC,eAAe,CAAC;oCAsBb,MAAM,WACT,WAAW,KACnB,OAAO,CAAC,eAAe,CAAC;;;EA0C5B"}
@@ -8,7 +8,7 @@
8
8
  * because both iOS App Clips and Android Digital Credentials API require
9
9
  * transient activation (user interaction) to open system UI.
10
10
  */
11
- import type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, AuthCredential, SessionInfo, GetPhoneNumberResponse, VerifyPhoneNumberResponse, PhoneAuthResult } from '../core/types';
11
+ import type { AuthConfig, PrepareRequest, PrepareResponse, InvokeOptions, InvokeResult, SessionInfo, GetPhoneNumberResponse, VerifyPhoneNumberResponse, PhoneAuthResult } from '../core/types';
12
12
  export declare class PhoneAuthClient {
13
13
  private config;
14
14
  private http;
@@ -53,11 +53,11 @@ export declare class PhoneAuthClient {
53
53
  /**
54
54
  * Step 3A: Get phone number from credential.
55
55
  */
56
- getPhoneNumber(credential: AuthCredential, session: SessionInfo): Promise<GetPhoneNumberResponse>;
56
+ getPhoneNumber(credential: string, session: SessionInfo): Promise<GetPhoneNumberResponse>;
57
57
  /**
58
58
  * Step 3B: Verify phone number with credential.
59
59
  */
60
- verifyPhoneNumber(credential: AuthCredential, session: SessionInfo): Promise<VerifyPhoneNumberResponse>;
60
+ verifyPhoneNumber(credential: string, session: SessionInfo): Promise<VerifyPhoneNumberResponse>;
61
61
  /**
62
62
  * Check if Digital Credentials API is supported.
63
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"phone-auth-client.d.ts","sourceRoot":"","sources":["../../../src/client/phone-auth-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH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,6 +16,8 @@ export interface PollingConfig {
16
16
  statusUrl?: string;
17
17
  /** Logger instance */
18
18
  logger?: Logger;
19
+ /** Custom headers for polling requests */
20
+ headers?: Record<string, string>;
19
21
  }
20
22
  export interface PollingResult {
21
23
  status: 'completed' | 'pending' | 'expired' | 'cancelled' | 'error';
@@ -1 +1 @@
1
- {"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../../../src/client/strategies/polling.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAO5E,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa;iBA+CtC,OAAO,CAAC,aAAa,CAAC;gBA4FvB,IAAI;kBAWF,IAAI;qBAcD,OAAO;mBAOT,IAAI;EAazB"}
1
+ {"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../../../src/client/strategies/polling.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAO5E,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa;iBAgDtC,OAAO,CAAC,aAAa,CAAC;gBA0GvB,IAAI;kBAWF,IAAI;qBAcD,OAAO;mBAOT,IAAI;EAazB"}
@@ -266,7 +266,8 @@ export interface ModalOptions {
266
266
  closeOnBackdropClick?: boolean;
267
267
  }
268
268
  /**
269
- * Authentication credential result.
269
+ * Authentication credential result (legacy, kept for compatibility).
270
+ * @deprecated Use credential string directly from InvokeResult
270
271
  */
271
272
  export interface AuthCredential {
272
273
  /** Authentication credential token */
@@ -287,11 +288,11 @@ export interface AuthCredential {
287
288
  */
288
289
  export interface InvokeResult {
289
290
  /**
290
- * Promise that resolves to the credential.
291
+ * Promise that resolves to the credential string.
291
292
  * For TS43: resolves immediately after user completes system prompt.
292
293
  * For Link/Desktop: resolves when polling detects completion.
293
294
  */
294
- credential: Promise<AuthCredential>;
295
+ credential: Promise<string>;
295
296
  /**
296
297
  * Cancel the authentication flow.
297
298
  * Causes credential promise to reject with error code 'CANCELLED'.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,+CAA+C;AAC/C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,iDAAiD;AACjD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,4DAA4D;AAC5D,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAM1B,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,OAAO,QAAQ,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAE7D,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,OAAO,uBAAuB,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAM1G;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,IAAI;IACnB,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;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,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iEAAiE;IACjE,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,8CAA8C;IAC9C,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;QACxC,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAMD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;SAC3C,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE;QACP,QAAQ,EAAE,KAAK,CAAC;YACd,QAAQ,EAAE,MAAM,CAAC;YACjB,IAAI,EAAE,OAAO,CAAC;SACf,CAAC,CAAC;KACJ,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE;QACR,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;KAC5C,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glideidentity/web-client-sdk",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.3",
4
4
  "description": "Glide Phone Authentication SDK for web applications",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -99,8 +99,5 @@
99
99
  "webpack": "^5.89.0",
100
100
  "webpack-cli": "^5.1.4"
101
101
  },
102
- "dependencies": {
103
- "-": "^0.0.1",
104
- "baseline-browser-mapping": "^2.9.7"
105
- }
102
+ "dependencies": {}
106
103
  }